Moodle  2.2.1
http://www.collinsharper.com
repository_type Class Reference

Public Member Functions

 get_contextvisibility ($context)
 __construct ($typename= '', $typeoptions=array(), $visible=true, $sortorder=0)
 get_typename ()
 get_readablename ()
 get_options ()
 get_visible ()
 get_sortorder ()
 create ($silent=false)
 update_options ($options=null)
 move_order ($move)
 update_visibility ($visible=null)
 delete ()

Detailed Description

Definition at line 59 of file lib.php.


Constructor & Destructor Documentation

__construct ( typename = '',
typeoptions = array(),
visible = true,
sortorder = 0 
)

repository_type constructor object $CFG

Parameters:
integer$typename
array$typeoptions
boolean$visible
integer$sortorder(don't really need set, it will be during create() call)

Definition at line 127 of file lib.php.

Here is the call graph for this function:


Member Function Documentation

create ( silent = false)

Create a repository type (the type name must not already exist)

Parameters:
booleanthrow exception?
Returns:
mixed return int if create successfully, return false if any errors object $DB

Definition at line 211 of file lib.php.

Here is the call graph for this function:

delete ( )

Delete a repository_type (general options are removed from config_plugin table, and all instances are deleted) object $DB

Returns:
boolean

Definition at line 426 of file lib.php.

Here is the call graph for this function:

get_contextvisibility ( context)

Return if the instance is visible in a context TODO: check if the context visibility has been overwritten by the plugin creator (need to create special functions to be overvwritten in repository class)

Parameters:
objet$context- context
Returns:
boolean

Definition at line 102 of file lib.php.

Return general options

Returns:
array the general options

Definition at line 184 of file lib.php.

Return a human readable and user-friendly type name

Returns:
string user-friendly type name

Definition at line 176 of file lib.php.

Return order / position of display in the file picker

Returns:
integer

Definition at line 200 of file lib.php.

Here is the caller graph for this function:

Get the type name (no whitespace) For a human readable name, use get_readablename()

Returns:
String the type name

Definition at line 168 of file lib.php.

Here is the caller graph for this function:

Return visibility

Returns:
boolean

Definition at line 192 of file lib.php.

move_order ( move)

Change order of the type with its adjacent upper or downer type (database fields are updated) Algorithm details: 1. retrieve all types in an array. This array is sorted by sortorder, and the array keys start from 0 to X (incremented by 1) 2. switch sortorder values of this type and its adjacent type object $DB

Parameters:
string$move"up" or "down"

retrieve this type into the returned array

retrieve adjacent indice

Definition at line 368 of file lib.php.

Here is the call graph for this function:

update_options ( options = null)

Update plugin options into the config_plugin table

Parameters:
array$options
Returns:
boolean

Definition at line 285 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

update_visibility ( visible = null)

1. Change visibility to the value chosen

2. Update the type

Returns:
boolean

Definition at line 410 of file lib.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations