Attach a category to parent given
Does a category exists with given parameters this method is use by fromArray import method to know if an imported category already exist or not
static mixed
categoryExists
(string $module, string $uuid)
-
string
$module: The module codename to check
-
string
$uuid: The category uuid to check
Check and/or repair positions in siblings of a given category if ever needed
static boolean
compactSiblingsOrder
( $category, [ $codename = false], integer $category_id,)
-
integer
$category_id,: category ID to compact
-
$category
-
$codename
Detach a category from its parent and destroys category
Import module from given array datas
static
boolean
fromArray
(
array $data,
array $params,
CMS_language $cms_language,
&$idsRelation,
&$infos,
array $idsRelation,
string $infos)
-
array
$data: The module datas to import
-
array
$params: The import parameters. array( module => false|true : the module to create categories (required) create => false|true : create missing objects (default : true) update => false|true : update existing objects (default : true) files => false|true : use files from PATH_TMP_FS (default : true) )
-
CMS_language
$cms_language: The CMS_langage to use
-
array
$idsRelation: : Reference : The relations between import datas ids and real imported ids
-
string
$infos: : Reference : The import infos returned
-
&$idsRelation
-
&$infos
Return categories founded in given module in current language
static array(CMS_moduleCategory)
getAll
( $attrs, array $attrs,)
-
array
$attrs,: search criteria Array ( "module" => string "language" => CMS_language "level" => integer (Default -1) "root" => integer (Default -1) "cms_user" => CMS_profile "clearanceLevel" => mixed (default : false)
- false : CLEARANCE_MODULE_VIEW
- true : CLEARANCE_MODULE_EDIT
- constant value : clearanceLevel value
"strict" => boolean (default : false) )
-
$attrs
Returns each category ID and label in a module given user can see (from : none, to : view)
static
array(string)
getAllCategoriesAsArray
(
&$cms_user,
$cms_module,
$cms_language, [
$level =
0], [
$root =
-1], [
mixed $clearanceLevel =
false], [
boolean $strict =
false], [
$crossLanguage =
false],
CMS_profile $cms_user,,
string $cms_module,,
CMS_language $cms_language,,
integer $level,,
integer $root,)
-
CMS_profile
$cms_user,: the profile concerned by these restrictions
-
string
$cms_module,: the module codename
-
CMS_language
$cms_language,: the language of the labels
-
integer
$level,: the level category if any
-
integer
$root,: the root category if any
-
mixed
$clearanceLevel: - false : CLEARANCE_MODULE_VIEW
- true : CLEARANCE_MODULE_EDIT
- constant value : clearanceLevel value
-
boolean
$strict: return only categories from this clearance (default : false, else, return complete categories tree until given clearance)
-
&$cms_user
-
$cms_module
-
$cms_language
-
$level
-
$root
-
$crossLanguage
Parses a lineage and returns a category ID in given level By default returns root category ID in lineage
static integer
getCategoryIdFromLineage
( $lineage, [ $level = 0], strign $lineage,, integer $level,)
-
strign
$lineage,: string with integers separated with ;
-
integer
$level,: which level to get from lineage (default is rott, so 0)
-
$lineage
-
$level
Return categories marked as deleted
static array(CMS_moduleCategory)
getDeletedCategories
([ $module = false], [ $return_objects = false], string $module,, boolean $return_objects,)
-
string
$module,: the module codename who want's deleted cats
-
boolean
$return_objects,: does the function return array of objects or array of objects ID
-
$module
-
$return_objects
Get the last position used in siblings list
static integer
getLastSiblingOrder
([ $parentCategoryID = 0], integer $parentCategoryID,)
-
integer
$parentCategoryID,: ID of parent category to count order of
-
$parentCategoryID
Gives an array containing the lineage of a category ID was given From oldest ancestor to itself
static array(integer)
getLineageOfCategory
( $categoryID, [ $reset = false], integer $categoryID,)
-
integer
$categoryID,: the category ID
-
$categoryID
-
$reset
Gives a string representing the lineage of a category whose ID was given From oldest ancestor to itself, imploded with ; (semicolon) by Default
static string
getLineageOfCategoryAsString
( $category_id, [ $separator = ";"], integer $category_id,, string $separator,)
-
integer
$category_id,: the category ID
-
string
$separator,: the separator we want to use instead of semicolon (;)
-
$category_id
-
$separator
Create a select box XHTML containing all categories user has access to
View CMS_dialog_listboxes::getListBox for detail
static string,
getListBox
( $args, mixed array())
-
mixed
array(): $args, This array contains all parameters.
-
$args
Create 2 listboxes XHTML exchanging their values through javascript
View CMS_dialog_listboxes::getListBoxes for detail
static string,
getListBoxes
( $args, mixed array())
-
mixed
array(): $args, This array contains all parameters.
-
$args
Get the ID of the category parent to another This method must be as fast as possible
static false
getParentIdOf
( $categoryID, [ $reset = false], integer $categoryID,, boolean $reset,)
-
integer
$categoryID,: the category ID to get parent of
-
boolean
$reset,: force cache reloading : default false (used by writeToPersistence in CMS_moduleCategory)
-
$categoryID
-
$reset
Returns each category ID and label in a module given user can see
static
array(string)
getSiblingCategoriesAsArray
(
&$category,
$count,
&$cms_user,
$cms_module,
$cms_language, [
mixed $clearanceLevel =
false], [
boolean $strict =
false],
CMS_profile $cms_user,,
string $cms_module,,
CMS_language $cms_language,)
-
CMS_profile
$cms_user,: the profile concerned by these restrictions
-
string
$cms_module,: the module codename
-
CMS_language
$cms_language,: the language of the labels
-
mixed
$clearanceLevel: - false : CLEARANCE_MODULE_VIEW
- true : CLEARANCE_MODULE_EDIT
- constant value : clearanceLevel value
-
boolean
$strict: return only categories from this clearance (default : false, else, return complete categories tree until given clearance)
-
&$category
-
$count
-
&$cms_user
-
$cms_module
-
$cms_language
Returns a multidimentionnal array of categories viewvable If access control is active, we need to limit serch to user's permissions on categories
static
array(catID
getViewvableCategoriesForProfile
(
&$cms_user, [
string $module =
false], [
boolean $returnLineageArray =
false], [
mixed $clearanceLevel =
false], [
boolean $strict =
false],
CMS_profile $cms_user,)
-
CMS_profile
$cms_user,: the profile concerned by these restrictions
-
string
$module: the module codename we want
-
boolean
$returnLineageArray: return array like array(catID => catLineage) instead
-
mixed
$clearanceLevel: - false : CLEARANCE_MODULE_VIEW
- true : CLEARANCE_MODULE_EDIT
- constant value : clearanceLevel value
-
boolean
$strict: return only categories from this clearance (default : false, else, return complete categories tree until given clearance)
-
&$cms_user
Moves a cateogry from its parent to another
-
CMS_moduleCategory
$category
-
CMS_moduleCategory
$parentCategory
-
integer
$index: : the new index for the new parent (if false, put the category at last position)
-
&$category
-
&$newParentCategory
Moves position of a category in list at given index
Moves position of a category in list, with given offset
static
boolean
moveCategoryOrder
(
&$siblingCategory,
integer $moveOffset,
CMS_moduleCategory $siblingCategory)
-
CMS_moduleCategory
$siblingCategory
-
integer
$moveOffset: values 1 or -1 expected
-
&$siblingCategory
Does given uuid already exists for categories
static boolean
uuidExists
(string $uuid)
-
string
$uuid: The category uuid to check
Inherited Methods
Inherited From CMS_grandFather
CMS_grandFather::autoload()
CMS_grandFather::hasError()
CMS_grandFather::log()
CMS_grandFather::PHPErrorHandler()
CMS_grandFather::raiseError()
CMS_grandFather::setDebug()
CMS_grandFather::setLog()
CMS_grandFather::_raiseError()
CMS_grandFather::__call()