/var-www-hotglue/hotglue.org-test/dev/module_glue.inc.php File Reference

Go to the source code of this file.

Functions

 _cmp_time ($a, $b)
 _obj_lock ($name, $wait=true)
 _obj_unlock ($f)
 check_auto_snapshot ($args)
 clone_object ($args)
 create_object ($args)
 create_page ($args)
 delete_object ($args)
 delete_page ($args)
 delete_upload ($args)
 get_startpage ($args)
 load_object ($args)
 object_get_symlink ($args)
 object_make_symlink ($args)
 object_remove_attr ($args)
 pagenames ($args)
 render_object ($args)
 render_page ($args)
 rename_page ($args)
 copy_page ($args)
 revert ($args)
 revisions ($args)
 revisions_info ($args)
 save_object ($args)
 save_state ($args)
 set_startpage ($args)
 snapshot ($args)
 update_object ($args)
 upload_files ($args)
 upload_references ($args)

Function Documentation

_cmp_time ( a,
b 
)

helper function for revisions_info()

Parameters:
array $a array to compare
array $b array to compare
Returns:
int comparison result

Definition at line 33 of file module_glue.inc.php.

_obj_lock ( name,
wait = true 
)

lock an object file

Parameters:
string $name object name (i.e. page.rev.obj)
mixed $wait false = give up right away, true = wait until successful, integer values = wait up to $wait ms
Returns:
mixed true (on Win32 for now) or lock handle for success, NULL if the object doesn't exist, and false if the lock could not be acquired

Definition at line 51 of file module_glue.inc.php.

_obj_unlock ( f  ) 

unlock an object file

Parameters:
mixed $f lock handle (or anything on Win32)

Definition at line 105 of file module_glue.inc.php.

check_auto_snapshot ( args  ) 

create and delete auto- revisions

this function operates on a specific page and takes SNAPSHOT_MIN_AGE and SNAPSHOT_MAX_AGE into account.

Parameters:
array $args arguments key 'page' is the page (i.e. page.rev)
Returns:
array response true if successful

Definition at line 131 of file module_glue.inc.php.

clone_object ( args  ) 

duplicate an object

Parameters:
array $args arguments key 'name' name of the object to duplicate
Returns:
array response string name of new object if successful

Definition at line 194 of file module_glue.inc.php.

copy_page ( args  ) 

copy a page original page revisions are left out

Parameters:
array $args arguments key 'old' old page (i.e. page1.rev) key 'new' new page (i.e. page2.rev)
Returns:
array response

Definition at line 943 of file module_glue.inc.php.

create_object ( args  ) 

create an empty object in the content directory

Parameters:
array $args arguments key 'page' is the page (i.e. page.rev)
Returns:
array response key 'name' is the name of the object created

Definition at line 235 of file module_glue.inc.php.

create_page ( args  ) 

create a page

Parameters:
array $args arguments key 'page' is the page (i.e. page.rev)
Returns:
array response

Definition at line 276 of file module_glue.inc.php.

delete_object ( args  ) 

delete an object from the content directory

Parameters:
array $args arguments key 'name' is the object name (i.e. page.rev.obj)
Returns:
array response

Definition at line 325 of file module_glue.inc.php.

delete_page ( args  ) 

delete a page

Parameters:
array $args arguments key 'page' is the page (i.e. page.rev)
Returns:
array response

Definition at line 377 of file module_glue.inc.php.

delete_upload ( args  ) 

delete a file in the shared directory of a page

this function only deletes the file when there are no references to it left. this is not meant to be called directly from the frontend, but modules should use it when implementing delete_object.

Parameters:
array $args arguments key 'pagename' is the pagename (i.e. page) key 'file' filename of file in the shared directory key 'max_cnt' delete the file if there are <= max_cnt references (defaults to zero)
Returns:
array response true if the file got deleted for good, false if not

Definition at line 459 of file module_glue.inc.php.

get_startpage ( args  ) 

get the startpage

Parameters:
array $args unused
Returns:
array response string

Definition at line 500 of file module_glue.inc.php.

load_object ( args  ) 

load an object from the content directory

Parameters:
array $args arguments key 'name' is the object name (i.e. page.rev.obj)
Returns:
array response

Definition at line 520 of file module_glue.inc.php.

object_get_symlink ( args  ) 

return the target of an object symlink

Parameters:
array $args arguments key 'name' is the object name (i.e. page.rev.obj)
Returns:
array response key 'data' either has the target as object name, an empty string if the target is outside the content directory or false if the object is no symlink

Definition at line 587 of file module_glue.inc.php.

object_make_symlink ( args  ) 

create a symlink pointing to an object in all other pagename's head revisions

Parameters:
array $args arguments key 'name' is the object name (i.e. page.rev.obj)
Returns:
array response

Definition at line 617 of file module_glue.inc.php.

object_remove_attr ( args  ) 

remove one or more attributes from an object in the content directory

this function takes the object lock.

Parameters:
array $args arguments key 'name' is the object name (i.e. page.rev.obj) key 'attr' is either a string or an array containing the attribute names (keys) to remove
Returns:
array response

Definition at line 690 of file module_glue.inc.php.

pagenames ( args  ) 

return an array of all pagenames in the content directory

Parameters:
array $args unused
Returns:
array response

Definition at line 742 of file module_glue.inc.php.

rename_page ( args  ) 

rename a page

Parameters:
array $args arguments key 'old' old page (i.e. page1.rev) key 'new' new page (i.e. page2.rev)
Returns:
array response

Definition at line 896 of file module_glue.inc.php.

render_object ( args  ) 

turn an object into an html string

the function also appends the resulting string to the output in html.inc.php.

Parameters:
array $args arguments string 'name' is the object name (i.e. page.rev.obj) bool 'edit' are we editing or not
Returns:
array response html

Definition at line 780 of file module_glue.inc.php.

render_page ( args  ) 

turn a page into an html string

the function also appends the resulting string to the output in html.inc.php.

Parameters:
array $args arguments key 'page' is the page (i.e. page.rev) key 'edit' are we editing or not
Returns:
array response html

Definition at line 833 of file module_glue.inc.php.

revert ( args  ) 

revert to a specific revision of a page

this function makes the revision the page's new head revision by copying it.

Parameters:
array $args arguments key 'page' page to revert to (i.e. page.rev)
Returns:
array response

Definition at line 1011 of file module_glue.inc.php.

revisions ( args  ) 

return an array of all revisions of a page

Parameters:
array $args arguments key 'pagename' is the pagename (i.e. page)
Returns:
array response

Definition at line 1077 of file module_glue.inc.php.

revisions_info ( args  ) 

return an array with information about all revisions of a page

Parameters:
array $args arguments key 'pagename' is the pagename (i.e. page) key 'sort' can be either 'time' (descending) or 'name' (ascending, the default)
Returns:
array response

Definition at line 1116 of file module_glue.inc.php.

save_object ( args  ) 

save an object to the content directory

use update_object() whenever possible as we want to preserve any object metadata that is stored in as attributes.

Parameters:
array $args arguments key 'name' is the object name (i.e. page.rev.obj) key 'content' is the object's content all other key/value pairs are treated as attributes
Returns:
array response

Definition at line 1162 of file module_glue.inc.php.

save_state ( args  ) 

save the state of a html element corresponding to an object to disk

this function takes the object lock.

Parameters:
array $args arguments key 'html' one html element
Returns:
array response true if successful

Definition at line 1218 of file module_glue.inc.php.

set_startpage ( args  ) 

set the startpage

Parameters:
array $args arguments key 'page' is the page (i.e. page.rev)
Returns:
array response true if successful

Definition at line 1274 of file module_glue.inc.php.

snapshot ( args  ) 

create a snapshot from a page

Parameters:
array $args arguments key 'page' page to shapshot (i.e. page.rev) key 'rev' (optional) new revision name (i.e. rev2) (if empty or not set a revision starting with 'auto-' and the current date will be created)
Returns:
array response (holding the page of the newly created revision if successful)

Definition at line 1304 of file module_glue.inc.php.

update_object ( args  ) 

update an object

this function merges the attributes in $args with the object already on disk. the object need not exist before, though. this function takes the object lock.

Parameters:
array $args arguments key 'name' is the object name (i.e. page.rev.obj) key 'content' is the object's content all other key/value pairs are treated as attributes
Returns:
array response

Definition at line 1402 of file module_glue.inc.php.

upload_files ( args  ) 

upload one or more files

Parameters:
array $args arguments key 'page' page to upload the files to (i.e. page.rev) key 'preferred_module' (optional) try first to invoke the upload method on this module
Returns:
array response array of rendered, newly created objects

Definition at line 1442 of file module_glue.inc.php.

upload_references ( args  ) 

list all objects referencing a certain file in the shared directory

Parameters:
array $args arguments key 'pagename' is the pagename (i.e. page) key 'file' filename of file in the shared directory key 'stop_after' n references
Returns:
array response array of objects (i.e. page.rev.obj)

Definition at line 1525 of file module_glue.inc.php.

Generated on Wed Jul 11 19:43:16 2012 for hotglue by  doxygen 1.6.3