Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
|
This class is used to manage repository plugins. More...
Public Member Functions | |
__construct ($typename='', $typeoptions=array(), $visible=true, $sortorder=0) | |
repository_type constructor | |
create ($silent=false) | |
Create a repository type (the type name must not already exist) | |
delete ($downloadcontents=false) | |
Delete a repository_type (general options are removed from config_plugin table, and all instances are deleted) | |
get_contextvisibility ($context) | |
Return if the instance is visible in a context. | |
get_options () | |
Return general options. | |
get_readablename () | |
Return a human readable and user-friendly type name. | |
get_sortorder () | |
Return order / position of display in the file picker. | |
get_typename () | |
Get the type name (no whitespace) For a human readable name, use get_readablename() | |
get_visible () | |
Return visibility. | |
move_order ($move) | |
Change order of the type with its adjacent upper or downer type (database fields are updated) Algorithm details: | |
prepare_to_cache () | |
Prepares the repository type to be cached. | |
update_options ($options=null) | |
Update plugin options into the config_plugin table. | |
update_visibility ($visible=null) | |
Static Public Member Functions | |
static | wake_from_cache ($data) |
Restores repository type from cache. | |
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.