Class: spunq
Source Location: /backend/classes/spunq.class.php
Class spunq
Method Summary
| void |
spunq() |
spunq::spunq() |
| void |
debug() |
spunq::debug() |
| void |
logit() |
spunq::logit() |
Methods
void spunq(
object
$db, array
$server, array
$rights, array
$post, array
$session, array
$checkperm, object
$logit, object
$message
)
|
|
spunq::spunq()
// purpose: constructor
Parameters:
|
object |
$db: |
|
|
array |
$server: |
|
|
array |
$rights: |
|
|
array |
$post: |
|
|
array |
$session: |
|
|
array |
$checkperm: |
|
|
object |
$logit: |
|
|
object |
$message: |
|
void __construct(
object
$db, array
$server, array
$rights, array
$post, array
$session, array
$checkperm, object
$logit, object
$message
)
|
|
spunq::__construct()
// purpose: constructor for php 5
Parameters:
|
object |
$db: |
|
|
array |
$server: |
|
|
array |
$rights: |
|
|
array |
$post: |
|
|
array |
$session: |
|
|
array |
$checkperm: |
|
|
object |
$logit: |
|
|
object |
$message: |
|
boolean advSearch(
int
$class
)
|
|
spunq::advSearch()
// purpose: full search through members of a class
Parameters:
API Tags:
| Return: | FALSE or search-result as an array |
spunq::appRights()
// purpose: full search through class, member, member_perf to construct the app_rights-array
API Tags:
| Return: | rights for group as an array or FALSE |
void changeObjectPerm(
int
$object_id, int
$class_id
)
|
|
spunq::changeobjectPerm()
// purpose: change publish permission for object
Parameters:
|
int |
$class_id: |
// class id as stored in database |
|
int |
$object_id: |
// object id as stored in database |
API Tags:
| Return: | TRUE or pear-db error-object |
spunq::checkClass()
// purpose: check if the called class is existing and write it to get-array
boolean checkContentPermissions(
)
|
|
spunq::checkContentPermissions()
// purpose: check permissions for called links and user/c_groups
API Tags:
| Return: | TRUE or FALSE as permissions on contentlevel |
spunq::checkObject()
// purpose: check if the called object is existing and write to get array
spunq::checkPermission()
// purpose: check permissions on content level as defined
API Tags:
| Return: | modified getarray using permissions |
spunq::checkStruct()
// purpose: check if the called structure is existing and write to get-array
string cleanFileName(
string
$filename
)
|
|
spunq::cleanFileName()
// purpose: substitutes all characters except a-zA-Z1-9 with ''
Parameters:
spunq::clearGet()
// purpose: create $_GET array from url
API Tags:
| Return: | modified getarray for usage in spunq |
int countStructureObjects(
int
$class_id,
$folder, int
$parent
)
|
|
spunq::countStructureObjects()
// purpose: counts the objects in a given structure
Parameters:
|
int |
$class_id: |
// id of given class as stored in database |
|
int |
$parent: |
// given parent in structure hierarchie |
|
|
$folder: |
|
void createBookmark(
int
$class, int
$parent, int
$oid,
$page, string
$method
)
|
|
spunq::createBookmark()
// purpose: creates a bookmark entry
Parameters:
|
int |
$class: |
// class id |
|
int |
$parent: |
// parent id in structure hierarchies |
|
int |
$oid: |
// object id |
|
string |
$method: |
// method for moving up or down |
|
|
$page: |
|
string createPreviewLink(
)
|
|
spunq::createPreviewLink
// purpose: creates a link to view content in frontend
void debug(
array
$data, [string
$title = NULL], [
$pre = 0]
)
|
|
spunq::debug()
// purpose: print data as debug statement using print_R()
Parameters:
|
array |
$data: |
// data for debugging |
|
string |
$title: |
// title for debug-writer |
|
|
$pre: |
|
void delAllRelations(
$relations, int
$class_ref1, int
$class_ref2, int
$object_ref1, int
$object_ref2
)
|
|
spunq::delAllRelations()
// purpose: deletes an object from table object
Parameters:
|
int |
$class_ref1: |
// class reference for class 1 |
|
int |
$class_ref2: |
// class reference for class 2 |
|
int |
$object_ref1: |
// object id for object 1 |
|
int |
$object_ref2: |
// object id for object 2 |
|
|
$relations: |
|
API Tags:
| Return: | pear db result object |
void deleteBookmark(
int
$oid
)
|
|
spunq::deleteBookmark()
// purpose: creates a bookmark entry
Parameters:
API Tags:
| Return: | pear-db error object or TRUE |
boolean deleteContentPermissions(
)
|
|
spunq::deleteContentPermissions()
// purpose: delete permissions for this object
API Tags:
| Return: | TRUE, object // true or pear-db error-object |
void delMultipleObjects(
array
$object_ids
)
|
|
spunq::delMultipleObjects()
// purpose: deletes multiple objects from data-class, object, struct and _relation
Parameters:
void delObject(
int
$oid
)
|
|
spunq::delObject()
// purpose: deletes an object from table object
Parameters:
|
int |
$oid: |
// object id as stored in database |
API Tags:
| Return: | pear-db result object |
void delObjectData(
array
$GET
)
|
|
spunq::delObjectData()
// purpose: deletes an object from data-class, object, struct and _relation
Parameters:
|
array |
$GET: |
// given GET array |
API Tags:
| Return: | TRUE or pear-db error object |
void delObjectFile(
int
$obj_id
)
|
|
spunq::delObjectFile()
// purpose: deletes the files (including thumbnails) belonging to an object
Parameters:
void delRelation(
int
$class_ref2, int
$class_ref1, int
$object_ref2, int
$object_ref1
)
|
|
spunq::delRelation()
// purpose: deletes an object from table object
Parameters:
|
int |
$class_ref1: |
// class reference for class 1 |
|
int |
$class_ref2: |
// class reference for class 2 |
|
int |
$object_ref1: |
// object id for object 1 |
|
int |
$object_ref2: |
// object id for object 2 |
API Tags:
| Return: | pear db result object |
spunq::delStruct()
// purpose: deletes an object from table struct
API Tags:
spunq::fastSearch()
// purpose: full search through objecttitle
API Tags:
| Return: | FALSE or search-result as an array |
boolean findOneRelation(
int
$class_ref1, int
$class_ref2, int
$object_ref1, int
$object_ref2
)
|
|
spunq::findOneRelation()
// purpose: finds a single relation return TRUE or FALSE
Parameters:
|
int |
$class_ref1: |
// class reference for class 1 |
|
int |
$class_ref2: |
// class reference for class 2 |
|
int |
$object_ref1: |
// object id for object 1 |
|
int |
$object_ref2: |
// object id for object 2 |
API Tags:
| Return: | TRUE on existing relation FALSE if relation does not exist |
void findRelation(
$class,
$object, int
$class_ref, int
$object_ref
)
|
|
spunq::findRelation()
// purpose: searches for all m:n relations of an object
Parameters:
|
int |
$class_ref: |
// class refernce 1 |
|
int |
$object_ref: |
// object reference 1 |
|
|
$class: |
|
|
|
$object: |
|
API Tags:
| Return: | all referenced objects for given parameters |
array getAllRelatedObjectsReverse(
$class_ref2,
$object_ref2, int
$class_ref, int
$object_ref
)
|
|
spunq::getAllRelatedObjectsReverse()
// purpose: gets all "incoming relations" for an object (through all classes)
Parameters:
|
int |
$class_ref: |
|
|
int |
$object_ref: |
|
|
|
$class_ref2: |
|
|
|
$object_ref2: |
|
array getBreadCrums(
int
$class_id, int
$parent
)
|
|
spunq::getBreadCrums()
// purpose: return class name for id
Parameters:
|
int |
$class_id: |
// class id as stored in database |
|
int |
$parent: |
// parent for strcuture hierarchie |
API Tags:
| Return: | breadcrums as an array |
void getClassData(
int
$class_id
)
|
|
spunq::getClassName()
// purpose: return class name for id
Parameters:
|
int |
$class_id: |
// id of given class as stored in database |
API Tags:
| Return: | return data as pear-object |
int getClassIdForPermissions(
)
|
|
spunq::getClassIdForPermissions()
// purpose: check if the called class is existing
API Tags:
| Return: | // classid for root object |
void getClassMap(
int
$class_id, int
$id, int
$parent, int
$depth, string
$method
)
|
|
spunq::getClassMap()
// purpose: return hole tree-structure for class .. calls itself recursivly
Parameters:
|
int |
$class_id: |
|
|
int |
$id: |
|
|
int |
$parent: |
|
|
int |
$depth: |
|
|
string |
$method: |
|
void getclassStructure(
int
$class_id, int
$parent
)
|
|
spunq::getClassStructure()
// purpose: return class structure
Parameters:
|
int |
$class_id: |
// id of given class as stored in database |
|
int |
$parent: |
// given parent in structure hierarchie |
API Tags:
| Return: | return data as pear-object |
array getEditControls(
array
$rights, int
$objectid, [array
$objref = 0]
)
|
|
spunq::getEditControls()
// purpose: returns all controls to edit an object
Parameters:
|
int |
$objectid: |
// object to edit |
|
array |
$rights: |
// system permissions for interface construction |
|
array |
$objref: |
// data from the reference object |
API Tags:
| Return: | members of class as array |
array getGroupPermissions(
int
$oid, int
$class, array
$groups
)
|
|
spunq::getContentPermissions()
// purpose: check if the called class is existing
Parameters:
|
int |
$oid: |
// object id as stored in database |
|
int |
$class: |
// class id as stored in database |
|
array |
$groups: |
// groups on content level |
API Tags:
| Return: | // group permissions |
void getInstitutionData(
[
$page = 0], [
$limit = 0], [
$sort = ""], [
$dir = ""], int
$class_id, int
$parent
)
|
|
spunq::getInstitutionData()
// purpose: return institution data
Parameters:
|
int |
$class_id: |
// id of given class as stored in database |
|
int |
$parent: |
// given parent in structure hierarchie |
|
|
$page: |
|
|
|
$limit: |
|
|
|
$sort: |
|
|
|
$dir: |
|
API Tags:
| Return: | return data as pear-object |
spunq::getLastObjectId()
// purpose: returns the last objectid inserted in table object
API Tags:
void getObject(
int
$object_id
)
|
|
spunq::getObject()
// purpose: returns data for a single object via objectid, classid
Parameters:
API Tags:
array getObjectData(
int
$id, int
$version
)
|
|
spunq::getObjectData()
// purpose: returns all (object, class) data for a single object via objectid
Parameters:
|
int |
$id: |
// object data as stored in database |
|
int |
$version: |
// version of object |
API Tags:
| Return: | object data as array |
void getObjectDataVersion(
int
$id, int
$version
)
|
|
spunq::getObjectDataVersion()
// purpose: returns all (object, class) data for a single object via objectid
Parameters:
|
int |
$id: |
// object id as stored in database |
|
int |
$version: |
// version of object |
API Tags:
| Return: | object data for version != 0 |
array getPageLimits(
array
$result, int
$page
)
|
|
spunq::getPageLimits()
// purpose: returns start and end number of object results
Parameters:
|
int |
$page: |
// current page |
|
array |
$result: |
// result from getStructureObjects |
array getParentObjectsForPermissions(
)
|
|
spunq::getParentObjectsForPermission()
// purpose: check which object provides the permissions in the hierarchies
API Tags:
| Return: | the objects which provides the node for permissions in the hierarchie |
void getRelatedObjects(
int
$class_ref1, int
$class_ref2,
$object_ref1, int
$object_ref
)
|
|
spunq::getRelatedObjects()
// purpose: searches for m:n relations for an object in other classes
Parameters:
|
int |
$class_ref1: |
// class reference for class 1 |
|
int |
$class_ref2: |
// class reference for class 2 |
|
int |
$object_ref: |
// object id for object 1 |
|
|
$object_ref1: |
|
API Tags:
| Return: | all objects for given parameters in a defined class (class_ref2) |
void getRelatedObjectsReverse(
int
$class_ref1, int
$class_ref2,
$object_ref2, [int
$sort_table = false], [int
$sort_field = false], int
$object_ref
)
|
|
spunq::getRelatedObjectsReverse()
// purpose: searches for objects relating to given object with optional sorting function
Parameters:
|
int |
$class_ref1: |
// class reference for class 1 |
|
int |
$class_ref2: |
// class reference for class 2 |
|
int |
$object_ref: |
// object id for object 2 |
|
int |
$sort_table: |
// table for sorting |
|
int |
$sort_field: |
// field for sorting |
|
|
$object_ref2: |
|
API Tags:
| Return: | all objects for given parameters in a defined class (class_ref2) |
void getStructure(
int
$parent, int
$class
)
|
|
spunq::getStructure()
// purpose: returns data for a single structure via parent
Parameters:
API Tags:
void getStructureObjects(
int
$class_id,
$folder, [
$page = 0], [
$limit = 0], [
$sort = ""], [
$dir = ""], int
$parent
)
|
|
spunq::getStructureObjects()
// purpose: return objects for structure
Parameters:
|
int |
$class_id: |
// id of given class as stored in database |
|
int |
$parent: |
// given parent in structure hierarchie |
|
|
$folder: |
|
|
|
$page: |
|
|
|
$limit: |
|
|
|
$sort: |
|
|
|
$dir: |
|
API Tags:
| Return: | return data as pear-object |
void getUserData(
[
$page = 0], [
$limit = 0], [
$sort = ""], [
$dir = ""], int
$class_id, int
$parent
)
|
|
spunq::getUserData()
// purpose: return user data
Parameters:
|
int |
$class_id: |
// id of given class as stored in database |
|
int |
$parent: |
// given parent in structure hierarchie |
|
|
$page: |
|
|
|
$limit: |
|
|
|
$sort: |
|
|
|
$dir: |
|
API Tags:
| Return: | return data as pear-object |
void getUserPermissions(
$users
)
|
|
spunq::getContentPermissions()
// purpose: check if the called class is existing function is deprecated
Parameters:
array handleMacros(
$item, array
$data
)
|
|
spunq::handleMacros
// purpose: reads macros from configs and sets html-tags for further use in fckeditor // this method is mainly deprecated because of fckeditor in most of textareas
Parameters:
spunq::insertObject()
// purpose: insertes a new object in table object
API Tags:
| Return: | // pear-db result object |
object insertObjectData(
)
|
|
spunq::insertObjectData()
// purpose: saves a new object in object und class-table
void insertPureObject(
int
$class_ref, int
$object_ref, string
$name, int
$user, int
$group, int
$perm, int
$sort
)
|
|
spunq::insertPureObject()
// purpose: inserts an object in table object by given parameters
Parameters:
|
int |
$class_ref: |
// class reference |
|
int |
$object_ref: |
// object reference |
|
string |
$name: |
// object name |
|
int |
$user: |
// userid |
|
int |
$group: |
// groupid |
|
int |
$perm: |
// permissions for object |
|
int |
$sort: |
// sort value for object |
API Tags:
| Return: | pear-db result object |
void insertRelation(
int
$class_ref1, int
$class_ref2, int
$object_ref1, int
$object_ref2, [int
$member_ref = 0], [int
$sort = 0]
)
|
|
spunq::insertRelation()
// purpose: deletes an object from table object
Parameters:
|
int |
$class_ref1: |
// class reference for class 1 |
|
int |
$class_ref2: |
// class reference for class 2 |
|
int |
$object_ref1: |
// object id for object 1 |
|
int |
$object_ref2: |
// object id for object 2 |
|
int |
$member_ref: |
// member reference |
|
int |
$sort: |
// sort value for relations |
API Tags:
| Return: | pear db result object |
spunq::listBackups()
// purpose: read Backups from filesystem
API Tags:
| Return: | all existing backup files |
void logit(
string
$action, int
$classid, int
$oid
)
|
|
spunq::logit()
// purpose: starts logging using logit.class.php
Parameters:
|
int |
$classid: |
// class id |
|
int |
$oid: |
// object id |
|
string |
$action: |
// action |
string makeAltFilename(
$filename, string
$path
)
|
|
spunq::makeAltFilename()
// purpose: creates an alternative name - in the case a file already exists
Parameters:
boolean memberRights(
[
$classid = 0]
)
|
|
spunq::memberRights()
// purpose: get member permissions for a given class
Parameters:
API Tags:
| Return: | rights for group as an array or FALSE |
void moveMultipleObjects(
array
$object_ids, int
$class_id, int
$old_parent,
$new_parent
)
|
|
spunq::moveMultipleObjects()
// purpose: moves multiple objects
Parameters:
|
array |
$object_ids: |
|
|
int |
$class_id: |
|
|
int |
$old_parent: |
|
|
|
$new_parent: |
|
void moveObject(
string
$method, int
$object_id, int
$class_id, [int
$parent = 0]
)
|
|
spunq::moveObjectUp
// purpose: move object in its structure up
Parameters:
|
int |
$class_id: |
// class id as stored in database |
|
int |
$object_id: |
// object id as stored in database |
|
string |
$method: |
// method up or down |
|
int |
$parent: |
// parent object |
API Tags:
| Return: | TRUE or pear-db error-object |
void moveRelation(
array
$get
)
|
|
spunq::moveRelation()
// purpose: change sort-order for relations
Parameters:
spunq::moveStructur()
// purpose: moves structure in the class-struct hierarchies
API Tags:
| Return: | TRUE or pear-db error object |
void moveStructure(
string
$method, int
$object_id, int
$class_id, [int
$parent = 0]
)
|
|
spunq::moveStructureDown
// purpose: move object in its structure down
Parameters:
|
int |
$class_id: |
// class id as stored in database |
|
int |
$object_id: |
// object id as stored in database |
|
string |
$method: |
// method up or down |
|
int |
$parent: |
// parent object |
API Tags:
| Return: | TRUE or pear-db error-object |
boolean saveContentPermissions(
)
|
|
spunq::saveObjectPermissions()
// purpose: check permissions for called links and user/c_groups
API Tags:
| Return: | TRUE, object // true or pear-db error-object |
int saveObject(
array
$rights
)
|
|
spunq::saveObject()
// purpose: decides if object is updated or newly inserted and calls necessary method
Parameters:
|
array |
$rights: |
// general rights array for object save action |
API Tags:
| Return: | structid to display interface after save-action |
int saveObjectVersion(
array
$rights
)
|
|
spunq::saveObjectVersion()
// purpose: decides if object is updated or newly inserted and calls necessary method
Parameters:
|
array |
$rights: |
// general rights array for object save action |
API Tags:
| Return: | structid to display interface after save-action |
spunq::saveStruct()
// purpose: inserts a new structure object (just core data)
API Tags:
spunq::showinfo()
// purpose: show systeminfo about php-modules
spunq::updateObject()
// purpose: updates an object in table object
API Tags:
| Return: | pear-db result object |
(object) updateObjectData(
)
|
|
spunq::updateObjectData()
// purpose: updates a new object in object und class-table
void updatePureObject(
$id, int
$class_ref, int
$object_ref, string
$name, int
$user, int
$group, int
$perm, int
$sort
)
|
|
spunq::updatePureObject()
// purpose: updates an object in table object by given parameters
Parameters:
|
int |
$class_ref: |
// class reference |
|
int |
$object_ref: |
// object reference |
|
string |
$name: |
// object name |
|
int |
$user: |
// userid |
|
int |
$group: |
// groupid |
|
int |
$perm: |
// permissions for object |
|
int |
$sort: |
// sort value for object |
|
|
$id: |
|
API Tags:
| Return: | pear-db result object |
array writeFile(
string
$content, string
$path, string
$filename
)
|
|
spunq::writeFile()
// purpose: writes a file into the filesystem by filename, path and content
Parameters:
|
string |
$content: |
|
|
string |
$path: |
|
|
string |
$filename: |
|
API Tags:
| Return: | all existing backup files |
|
|