[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/repository/googledocs/ -> lib.php (summary)

This plugin is used to access Google Drive.

Copyright: 2009 Dan Poltawski <talktodan@gmail.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 505 lines (18 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

repository_googledocs:: (19 methods):
  __construct()
  get_access_token()
  store_access_token()
  callback()
  check_login()
  print_login()
  build_breadcrumb()
  build_node_path()
  explode_node_path()
  get_listing()
  search()
  query()
  logout()
  get_file()
  get_file_reference()
  supported_filetypes()
  supported_returntypes()
  get_type_option_names()
  type_config_form()


Class: repository_googledocs  - X-Ref

Google Docs Plugin

__construct($repositoryid, $context = SYSCONTEXTID, $options = array()   X-Ref
Constructor.

param: int $repositoryid repository instance id.
param: int|stdClass $context a context id or context object.
param: array $options repository options.
param: int $readonly indicate this repo is readonly or not.
return: void

get_access_token()   X-Ref
Returns the access token if any.

return: string|null access token.

store_access_token($token)   X-Ref
Store the access token in the session.

param: string $token token to store.
return: void

callback()   X-Ref
Callback method during authentication.

return: void

check_login()   X-Ref
Checks whether the user is authenticate or not.

return: bool true when logged in.

print_login()   X-Ref
Print or return the login form.

return: void|array for ajax.

build_breadcrumb($path)   X-Ref
Build the breadcrumb from a path.

param: string $path to create a breadcrumb from.
return: array containing name and path of each crumb.

build_node_path($id, $name = '', $root = '')   X-Ref
Generates a safe path to a node.

Typically, a node will be id|Name of the node.

param: string $id of the node.
param: string $name of the node, will be URL encoded.
param: string $root to append the node on, must be a result of this function.
return: string path to the node.

explode_node_path($node)   X-Ref
Returns information about a node in a path.

param: string $node to extrat information from.
return: array about the node.

get_listing($path='', $page = '')   X-Ref
List the files and folders.

param: string $path path to browse.
param: string $page page to browse.
return: array of result.

search($search_text, $page = 0)   X-Ref
Search throughout the Google Drive.

param: string $search_text text to search for.
param: int $page search page.
return: array of results.

query($q, $path = null, $page = 0)   X-Ref
Query Google Drive for files and folders using a search query.

Documentation about the query format can be found here:
https://developers.google.com/drive/search-parameters

This returns a list of files and folders with their details as they should be
formatted and returned by functions such as get_listing() or search().

param: string $q search query as expected by the Google API.
param: string $path parent path of the current files, will not be used for the query.
param: int $page page.
return: array of files and folders.

logout()   X-Ref
Logout.

return: string

get_file($reference, $filename = '')   X-Ref
Get a file.

param: string $reference reference of the file.
param: string $file name to save the file to.
return: string JSON encoded array of information about the file.

get_file_reference($source)   X-Ref
Prepare file reference information.

We are using this method to clean up the source to make sure that it
is a valid source.

param: string $source of the file.
return: string file reference.

supported_filetypes()   X-Ref
What kind of files will be in this repository?

return: array return '*' means this repository support any files, otherwise

supported_returntypes()   X-Ref
Tells how the file can be picked from this repository.

Maximum value is FILE_INTERNAL | FILE_EXTERNAL | FILE_REFERENCE.

return: int

get_type_option_names()   X-Ref
Return names of the general options.
By default: no general option name.

return: array

type_config_form($mform, $classname = 'repository')   X-Ref
Edit/Create Admin Settings Moodle form.

param: moodleform $mform Moodle form (passed by reference).
param: string $classname repository class name.



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1