Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
This class is used to manage repository plugins. More...
Public Member Functions | |
__construct ($typename='', $typeoptions=array(), $visible=true, $sortorder=0) | |
repository_type constructor More... | |
create ($silent=false) | |
Create a repository type (the type name must not already exist) More... | |
delete ($downloadcontents=false) | |
Delete a repository_type (general options are removed from config_plugin table, and all instances are deleted) More... | |
get_contextvisibility ($context) | |
Return if the instance is visible in a context. More... | |
get_options () | |
Return general options. More... | |
get_readablename () | |
Return a human readable and user-friendly type name. More... | |
get_sortorder () | |
Return order / position of display in the file picker. More... | |
get_typename () | |
Get the type name (no whitespace) For a human readable name, use get_readablename() More... | |
get_visible () | |
Return visibility. More... | |
move_order ($move) | |
Change order of the type with its adjacent upper or downer type (database fields are updated) Algorithm details: More... | |
prepare_to_cache () | |
Prepares the repository type to be cached. More... | |
update_options ($options=null) | |
Update plugin options into the config_plugin table. More... | |
update_visibility ($visible=null) | |
Static Public Member Functions | |
static | wake_from_cache ($data) |
Restores repository type from cache. More... | |
This class is used to manage repository plugins.
A repository_type is a repository plug-in. It can be Box.net, Flick-r, ... A repository type can be edited, sorted and hidden. It is mandatory for an administrator to create a repository type in order to be able to create some instances of this type. Coding note:
repository_type::__construct | ( | $typename = '' , |
|
$typeoptions = array() , |
|||
$visible = true , |
|||
$sortorder = 0 |
|||
) |
repository_type constructor
int | $typename | |
array | $typeoptions | |
bool | $visible | |
int | $sortorder | (don't really need set, it will be during create() call) |
repository_type::create | ( | $silent = false | ) |
Create a repository type (the type name must not already exist)
bool | $silent | throw exception? |
mixed | return int if create successfully, return false if |
repository_type::delete | ( | $downloadcontents = false | ) |
Delete a repository_type (general options are removed from config_plugin table, and all instances are deleted)
bool | $downloadcontents | download external contents if exist |
bool |
repository_type::get_contextvisibility | ( | $context | ) |
Return if the instance is visible in a context.
stdClass | $context | context |
bool |
repository_type::get_options | ( | ) |
Return general options.
array | the general options |
repository_type::get_readablename | ( | ) |
Return a human readable and user-friendly type name.
string | user-friendly type name |
repository_type::get_sortorder | ( | ) |
Return order / position of display in the file picker.
int |
repository_type::get_typename | ( | ) |
Get the type name (no whitespace) For a human readable name, use get_readablename()
string | the type name |
repository_type::get_visible | ( | ) |
Return visibility.
bool |
repository_type::move_order | ( | $move | ) |
Change order of the type with its adjacent upper or downer type (database fields are updated) Algorithm details:
string | $move | "up" or "down" |
repository_type::prepare_to_cache | ( | ) |
Prepares the repository type to be cached.
Implements method from cacheable_object interface.
array |
Implements cacheable_object.
repository_type::update_options | ( | $options = null | ) |
Update plugin options into the config_plugin table.
array | $options |
bool |
repository_type::update_visibility | ( | $visible = null | ) |
bool | $visible |
bool |
|
static |
Restores repository type from cache.
Implements method from cacheable_object interface.
array |
Implements cacheable_object.