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

Public Member Functions

 __construct ($api_key, $auth_token= '', $debug=false)
 makeRequest ($method, $params=array())
 getTicket ($params=array())
 getAuthToken ($ticket, $username, $password)
 getfiletree ($path, $params=array())
 buildtree ($sax, &$tree)
 getAccountTree ($params=array())
 CreateFolder ($new_folder_name, $params=array())
 UploadFile ($params=array())
 RenameFile ($fileid, $newname)
 RegisterUser ($params=array())
 AddTag ($tag, $id, $target_type, $params=array())
 PublicShare ($message, $emails, $id, $target_type, $password, $params=array())
 GetFriends ($params=array())
 Logout ($params=array())
 _checkForError ($data)
 isError ()
 setError ($code=0, $msg)
 getErrorMsg ()
 getErrorCode ()
 _clearErrors ()

Data Fields

 $auth_token = ''

Detailed Description

Definition at line 35 of file boxlib.php.


Constructor & Destructor Documentation

__construct ( api_key,
auth_token = '',
debug = false 
)
Parameters:
string$api_key
string$auth_token
bool$debug

Definition at line 51 of file boxlib.php.


Member Function Documentation

_checkForError ( data)
Parameters:
array$data
Returns:
bool

Definition at line 596 of file boxlib.php.

Here is the caller graph for this function:

Definition at line 639 of file boxlib.php.

Here is the caller graph for this function:

AddTag ( tag,
id,
target_type,
params = array() 
)

Add Tags (http://enabled.box.net/docs/rest#add_to_tag)

Parameters:
string$tag
string$idSet to ID of file or folder
string$target_typeFile or folder
array$params
Returns:
array|bool Outcome Array or false

Definition at line 462 of file boxlib.php.

Here is the call graph for this function:

buildtree ( sax,
&$  tree 
)
Parameters:
array$sax
array$treePassed by reference

Definition at line 195 of file boxlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

CreateFolder ( new_folder_name,
params = array() 
)
Parameters:
string$new_folder_name
array$params
Returns:
bool|array Array or false

Definition at line 285 of file boxlib.php.

Here is the call graph for this function:

getAccountTree ( params = array())
Parameters:
array$params
Returns:
bool|array Array or false

Definition at line 234 of file boxlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getAuthToken ( ticket,
username,
password 
)

$options['username'] and $options['password'] must be given, we will use them to obtain a valid auth_token To get a token, you should use following code:

$box = new boxclient('dmls97d8j3i9tn7av8y71m9eb55vrtj4'); Get a ticket $t = $box->getTicket(); $box->getAuthToken($t['ticket'], array( 'username'=>'dongsheng@moodle.com', 'password'=>'xxx'));

Parameters:
string$ticket
string$username
string$password
Returns:
mixed

Definition at line 133 of file boxlib.php.

Here is the call graph for this function:

Returns:
string

Definition at line 633 of file boxlib.php.

Returns:
string

Definition at line 627 of file boxlib.php.

Here is the caller graph for this function:

getfiletree ( path,
params = array() 
)
Parameters:
string$pathUnused
array$params
Returns:
array

Definition at line 168 of file boxlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

GetFriends ( params = array())

Get Friends (http://enabled.box.net/docs/rest#get_friends)

Parameters:
array$params
Returns:
array|bool Outcome Array or false

Definition at line 529 of file boxlib.php.

Here is the call graph for this function:

getTicket ( params = array())
Parameters:
array$params
Returns:
array

Definition at line 93 of file boxlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

isError ( )
Returns:
bool

Definition at line 611 of file boxlib.php.

Here is the caller graph for this function:

Logout ( params = array())

Logout User (http://enabled.box.net/docs/rest#get_friends)

Parameters:
array$params
Returns:
array|bool Outcome Array or false

Definition at line 573 of file boxlib.php.

Here is the call graph for this function:

makeRequest ( method,
params = array() 
)

Setup for Functions

Parameters:
string$method
array$params
Returns:
array

Definition at line 67 of file boxlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

PublicShare ( message,
emails,
id,
target_type,
password,
params = array() 
)

Public Share (http://enabled.box.net/docs/rest#public_share)

Parameters:
string$message
string$emails
string$idSet to ID of file or folder
string$target_typeFile or folder
string$password
array$params
Returns:
array|bool Outcome Array or false

Definition at line 496 of file boxlib.php.

Here is the call graph for this function:

RegisterUser ( params = array())

Register New User

Parameters:
array$params
Returns:
array|bool Outcome Array or false

Definition at line 418 of file boxlib.php.

Here is the call graph for this function:

RenameFile ( fileid,
newname 
)
Parameters:
string$fileid
string$newname
Returns:
bool

Definition at line 388 of file boxlib.php.

Here is the call graph for this function:

setError ( code = 0,
msg 
)

Definition at line 620 of file boxlib.php.

Here is the caller graph for this function:

UploadFile ( params = array())

Upload a File

Parameters:
array$paramsthe file MUST be present in key 'file' and be a moodle stored_file object.
Returns:
array|bool Array or false

Definition at line 341 of file boxlib.php.

Here is the call graph for this function:


Field Documentation

$auth_token = ''

Definition at line 37 of file boxlib.php.


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