|
Moodle
2.2.1
http://www.collinsharper.com
|

Public Member Functions | |
| __construct ($repositoryid, $context=SYSCONTEXTID, $options=array(), $readonly=0) | |
| has_moodle_files () | |
| copy_to_area ($encoded, $draftitemid, $new_filepath, $new_filename) | |
| append_suffix ($filename) | |
| prepare_file ($filename) | |
| get_link ($url) | |
| get_file ($url, $filename= '') | |
| get_file_size ($source) | |
| is_visible () | |
| get_name () | |
| supported_filetypes () | |
| supported_returntypes () | |
| get_meta () | |
| delete () | |
| hide ($hide= 'toggle') | |
| set_option ($options=array()) | |
| get_option ($config= '') | |
| filter (&$value) | |
| get_listing ($path= '', $page= '') | |
| search ($search_text) | |
| logout () | |
| check_login () | |
| print_login () | |
| print_search () | |
| callback () | |
| global_search () | |
| cron () | |
| type_config_form ($mform, $classname= 'repository') | |
| instance_config_form ($mform) | |
| get_short_filename ($str, $maxlength) | |
| overwrite_existing_draftfile ($itemid, $filepath, $filename, $newfilepath, $newfilename) | |
| delete_tempfile_from_draft ($draftitemid, $filepath, $filename) | |
Static Public Member Functions | |
| static | get_type_by_typename ($typename) |
| static | get_type_by_id ($id) |
| static | get_types ($visible=null) |
| static | check_capability ($contextid, $instance) |
| static | draftfile_exists ($itemid, $filepath, $filename) |
| static | get_unused_filename ($itemid, $filepath, $filename) |
| static | get_editable_types ($context=null) |
| static | get_instances ($args=array()) |
| static | get_instance ($id) |
| static | static_function ($plugin, $function) |
| static | antivir_scan_file ($thefile, $filename, $deleteinfected) |
| static | move_to_filepool ($thefile, $record) |
| static | build_tree ($fileinfo, $search, $dynamicmode, &$list) |
| static | display_instances_list ($context, $typename=null) |
| static | create ($type, $userid, $context, $params, $readonly=0) |
| static | plugin_init () |
| static | type_form_validation ($mform, $data, $errors) |
| static | get_type_option_names () |
| static | get_instance_option_names () |
| static | instance_form_validation ($mform, $data, $errors) |
Data Fields | |
| $disabled = false | |
| $id | |
| $context | |
| $options | |
| $readonly | |
| $returntypes | |
| $instance | |
| __construct | ( | $ | repositoryid, |
| $ | context = SYSCONTEXTID, |
||
| $ | options = array(), |
||
| $ | readonly = 0 |
||
| ) |
1. Initialize context and options 2. Accept necessary parameters
| integer | $repositoryid | repository instance id |
| integer|object | a context id or context object | |
| array | $options | repository options |
Reimplemented in repository_flickr_public.
Definition at line 492 of file lib.php.

| static antivir_scan_file | ( | $ | thefile, |
| $ | filename, | ||
| $ | deleteinfected | ||
| ) | [static] |
Scan file, throws exception in case of infected file.
Please note that the scanning engine must be able to access the file, permissions of the file are not modified here!
| string | $thefile | |
| string | $filename | name of the file |
| bool | $deleteinfected |
Definition at line 969 of file lib.php.


| append_suffix | ( | $ | filename | ) |
| static build_tree | ( | $ | fileinfo, |
| $ | search, | ||
| $ | dynamicmode, | ||
| &$ | list | ||
| ) | [static] |
Builds a tree of files This function is then called recursively.
| $fileinfo | an object returned by file_browser::get_file_info() |
| $search | searched string |
| $dynamicmode | bool no recursive call is done when in dynamic mode |
| $list | - the array containing the files under the passed $fileinfo |
todo: take $search into account, and respect a threshold for dynamic loading
Definition at line 1113 of file lib.php.

| callback | ( | ) |
For oauth like external authentication, when external repository direct user back to moodle, this funciton will be called to set up token and token_secret
Reimplemented in repository_boxnet, and repository_dropbox.
| static check_capability | ( | $ | contextid, |
| $ | instance | ||
| ) | [static] |
| check_login | ( | ) |
To check whether the user is logged in.
Reimplemented in repository_s3, repository_flickr_public, repository_alfresco, repository_filesystem, repository_dropbox, repository_flickr, repository_boxnet, repository_webdav, repository_url, repository_wikimedia, repository_picasa, repository_googledocs, repository_youtube, and repository_merlot.
| copy_to_area | ( | $ | encoded, |
| $ | draftitemid, | ||
| $ | new_filepath, | ||
| $ | new_filename | ||
| ) |
This function is used to copy a moodle file to draft area
object $USER object $DB
| string | $encoded | The metainfo of file, it is base64 encoded php serialized data |
| string | $draftitemid | itemid |
| string | $new_filename | The intended name of file |
| string | $new_filepath | the new path in draft area |
Reimplemented in repository_recent.
Definition at line 628 of file lib.php.

| static create | ( | $ | type, |
| $ | userid, | ||
| $ | context, | ||
| $ | params, | ||
| $ | readonly = 0 |
||
| ) | [static] |
Create an instance for this plug-in object $CFG object $DB
| string | $type | the type of the repository |
| integer | $userid | the user id |
| object | $context | the context |
| array | $params | the options for this instance |
| integer | $readonly | whether to create it readonly or not (defaults to not) |
Reimplemented in repository_filesystem.
Definition at line 1473 of file lib.php.

| cron | ( | ) |
| delete | ( | ) | [final] |
| delete_tempfile_from_draft | ( | $ | draftitemid, |
| $ | filepath, | ||
| $ | filename | ||
| ) |
| static display_instances_list | ( | $ | context, |
| $ | typename = null |
||
| ) | [static] |
Display a repository instance list (with edit/delete/create links) object $CFG object $USER object $OUTPUT
| object | $context | the context for which we display the instance |
| string | $typename | if set, we display only one type of instance |
Definition at line 1196 of file lib.php.

| static draftfile_exists | ( | $ | itemid, |
| $ | filepath, | ||
| $ | filename | ||
| ) | [static] |
| filter | ( | &$ | value | ) |
| static get_editable_types | ( | $ | context = null | ) | [static] |
Return all types that you a user can create/edit and which are also visible Note: Mostly used in order to know if at least one editable type can be set
| object | $context | the context for which we want the editable types |
Definition at line 715 of file lib.php.


| get_file | ( | $ | url, |
| $ | filename = '' |
||
| ) |
Download a file, this function can be overridden by subclass.
object $CFG
| string | $url | the url of file |
| string | $filename | save location |
Reimplemented in repository_flickr_public, repository_flickr, repository_dropbox, repository_alfresco, repository_filesystem, repository_googledocs, repository_s3, repository_webdav, and repository_url.
Definition at line 1358 of file lib.php.

| get_file_size | ( | $ | source | ) |
| static get_instance | ( | $ | id | ) | [static] |
| static get_instance_option_names | ( | ) | [static] |
Return names of the instance options By default: no instance option name
Reimplemented in repository_flickr_public, repository_alfresco, repository_webdav, and repository_filesystem.
| static get_instances | ( | $ | args = array() | ) | [static] |
Return repository instances object $DB object $CFG object $USER
| array | $args | Array containing the following keys: currentcontext context onlyvisible type accepted_types return_types userid |
Definition at line 751 of file lib.php.


| get_link | ( | $ | url | ) |
Return file URL, for most plugins, the parameter is the original url, but some plugins use a file id, so we need this function to convert file id to original url.
| string | $url | the url of file |
Reimplemented in repository_flickr_public, repository_flickr, repository_alfresco, and repository_coursefiles.
| get_listing | ( | $ | path = '', |
| $ | page = '' |
||
| ) |
Given a path, and perhaps a search, get a list of files.
See details on http://docs.moodle.org/dev/Repository_plugins
| string | $path,this | parameter can a folder name, or a identification of folder |
| string | $page,the | page number of file list |
Reimplemented in repository_flickr_public, repository_flickr, repository_boxnet, repository_alfresco, repository_dropbox, repository_youtube, repository_recent, repository_url, repository_picasa, repository_webdav, repository_googledocs, repository_filesystem, and repository_wikimedia.
Definition at line 1665 of file lib.php.

| get_meta | ( | ) | [final] |
| get_name | ( | ) |
Return the name of this instance, can be overridden. object $DB
Reimplemented in repository_coursefiles, and repository_picasa.
Definition at line 1416 of file lib.php.

| get_option | ( | $ | config = '' | ) |
Get settings for repository instance object $DB
| string | $config |
Reimplemented in repository_dropbox, repository_flickr, repository_boxnet, and repository_flickr_public.
Definition at line 1589 of file lib.php.

| get_short_filename | ( | $ | str, |
| $ | maxlength | ||
| ) |
| static get_type_by_id | ( | $ | id | ) | [static] |
| static get_type_by_typename | ( | $ | typename | ) | [static] |
| static get_type_option_names | ( | ) | [static] |
Return names of the general options By default: no general option name
Reimplemented in repository_flickr_public, repository_flickr, repository_dropbox, repository_boxnet, repository_coursefiles, repository_s3, repository_recent, and repository_merlot.
| static get_types | ( | $ | visible = null | ) | [static] |
Return all repository types ordered by sortorder field first repository type in returnedarray[0], second repository type in returnedarray[1], ... object $DB object $CFG
| boolean | $visible | can return types by visiblity, return all types if null |
Definition at line 557 of file lib.php.


| static get_unused_filename | ( | $ | itemid, |
| $ | filepath, | ||
| $ | filename | ||
| ) | [static] |
| global_search | ( | ) |
is it possible to do glboal search?
Reimplemented in repository_flickr, repository_s3, repository_filesystem, repository_flickr_public, repository_youtube, repository_webdav, repository_wikimedia, and repository_merlot.
| has_moodle_files | ( | ) |
Does this repository used to browse moodle files?
Reimplemented in repository_recent, repository_coursefiles, repository_local, and repository_user.
Definition at line 614 of file lib.php.

| hide | ( | $ | hide = 'toggle' | ) | [final] |
| instance_config_form | ( | $ | mform | ) |
Edit/Create Instance Settings Moodle form
| object | $mform | Moodle form (passed by reference) |
Reimplemented in repository_flickr_public, repository_alfresco, repository_webdav, and repository_filesystem.
| static instance_form_validation | ( | $ | mform, |
| $ | data, | ||
| $ | errors | ||
| ) | [static] |
Reimplemented in repository_filesystem.
| is_visible | ( | ) |
Return is the instance is visible (is the type visible ? is the context enable ?)
Reimplemented in repository_coursefiles.
Definition at line 1397 of file lib.php.

| logout | ( | ) |
Logout from repository instance By default, this function will return a login form
Reimplemented in repository_dropbox, repository_flickr_public, repository_filesystem, repository_alfresco, repository_picasa, repository_googledocs, repository_flickr, repository_wikimedia, and repository_boxnet.
Definition at line 1687 of file lib.php.

| static move_to_filepool | ( | $ | thefile, |
| $ | record | ||
| ) | [static] |
Move file from download folder to file pool using FILE API object $DB object $CFG object $USER object $OUTPUT
| string | $thefile | file path in download folder |
| object | $record |
Definition at line 1041 of file lib.php.

| overwrite_existing_draftfile | ( | $ | itemid, |
| $ | filepath, | ||
| $ | filename, | ||
| $ | newfilepath, | ||
| $ | newfilename | ||
| ) |
| static plugin_init | ( | ) | [static] |
function which is run when the type is created (moodle administrator add the plugin)
Reimplemented in repository_flickr_public, and repository_alfresco.
| prepare_file | ( | $ | filename | ) |
| print_login | ( | ) |
Show the login screen, if required
Reimplemented in repository_boxnet, repository_flickr, repository_flickr_public, repository_filesystem, repository_merlot, repository_dropbox, repository_alfresco, repository_picasa, repository_url, repository_wikimedia, repository_recent, repository_upload, repository_coursefiles, repository_local, and repository_user.
Definition at line 1704 of file lib.php.


| print_search | ( | ) |
Show the search screen, if required
Reimplemented in repository_flickr_public, and repository_alfresco.
| search | ( | $ | search_text | ) |
Search files in repository When doing global search, $search_text will be used as keyword.
Reimplemented in repository_alfresco, repository_flickr, repository_boxnet, repository_picasa, repository_googledocs, repository_wikimedia, repository_merlot, and repository_youtube.
| set_option | ( | $ | options = array() | ) |
Save settings for repository instance $repo->set_option(array('api_key'=>'f2188bde132', 'name'=>'dongsheng')); object $DB
| array | $options | settings |
Reimplemented in repository_dropbox, repository_filesystem, repository_flickr, repository_boxnet, and repository_flickr_public.
| static static_function | ( | $ | plugin, |
| $ | function | ||
| ) | [static] |
what kind of files will be in this repository?
Reimplemented in repository_flickr_public, repository_flickr, repository_dropbox, repository_merlot, repository_youtube, repository_googledocs, and repository_picasa.
Definition at line 1430 of file lib.php.

does it return a file url or a item_id
Reimplemented in repository_flickr_public, repository_flickr, repository_dropbox, repository_alfresco, repository_boxnet, repository_upload, repository_webdav, repository_filesystem, repository_coursefiles, repository_youtube, repository_local, repository_url, repository_s3, repository_merlot, repository_recent, repository_googledocs, repository_user, repository_picasa, and repository_wikimedia.
Definition at line 1439 of file lib.php.

| type_config_form | ( | $ | mform, |
| $ | classname = 'repository' |
||
| ) |
| static type_form_validation | ( | $ | mform, |
| $ | data, | ||
| $ | errors | ||
| ) | [static] |