Class: CategoryUtil
Source Location: /includes/pnobjlib/CategoryUtil.class.php
Class Details
Class Methods
method buildPaths [line 1170]
The buildPaths(
cats
$cats, [field
$field = 'name'])
|
|
Given an array of categories (with the category-IDs being the keys of the array), return an (idenically indexed) array of category-paths based on the given field (name or id make sense)
Tags:
Parameters:
method buildRelativePaths [line 1091]
The buildRelativePaths(
rootCatIDs
$rootCatIDs, cats
&$cats, [includeRoot
$includeRoot = false])
|
|
Given an array of categories (with the Property-Names being the keys of the array) and it corresponding Parent categories (indexed with the Property-Names too), return an (identically indexed) array of category-paths based on the given field (name or id make sense)
Tags:
Parameters:
method buildRelativePathsForCategory [line 1119]
The buildRelativePathsForCategory(
rootCategory
$rootCategory, cat
&$cat, [includeRoot
$includeRoot = false])
|
|
Given a category with its parent category, return an (idenically indexed) array of category-paths based on the given field (name or id make sense)
Tags:
Parameters:
method cmpDesc [line 1027]
The cmpDesc(
catA
$catA, catB
$catB)
|
|
Compare function for ML description field
Tags:
Parameters:
method cmpName [line 1003]
The cmpName(
catA
$catA, catB
$catB)
|
|
Compare function for ML name field
Tags:
Parameters:
method copyCategoriesByID [line 617]
true copyCategoriesByID(
cid
$cid, newparent_id
$newparent_id)
|
|
Copy categories by ID (recursive copy)
Tags:
Parameters:
method copyCategoriesByPath [line 654]
true copyCategoriesByPath(
apath
$apath, newparent_id
$newparent_id, [field
$field = 'ipath'], [includeRoot
$includeRoot = true])
|
|
Copy Categories by Path (recurisve copy)
Tags:
Parameters:
method copySubCategoriesByPath [line 638]
true copySubCategoriesByPath(
apath
$apath, newparent_id
$newparent_id, [field
$field = 'ipath'])
|
|
Copy SubCategories by Path (recurisve copy)
Tags:
Parameters:
method deleteCategoriesByPath [line 490]
The deleteCategoriesByPath(
apath
$apath, [field
$field = 'ipath'])
|
|
Delete categories by Path
Tags:
Parameters:
method deleteCategoryByID [line 467]
The deleteCategoryByID(
cid
$cid)
|
|
Delete a category by it's ID
Tags:
Parameters:
method getCategories [line 69]
The getCategories(
[where
$where = ''], [sort
$sort = ''], [assocKey
$assocKey = ''], [
$enablePermissionFilter = true])
|
|
Return an array of categories objects according the specified where-clause and sort criteria.
Tags:
Parameters:
method getCategoriesByParentID [line 192]
The getCategoriesByParentID(
id
$id, [sort
$sort = ''], [relative
$relative = false], [all
$all = false], [assocKey
$assocKey = ''], [attributes
$attributes = null])
|
|
Return the direct subcategories of the specified category
Tags:
Parameters:
method getCategoriesByPath [line 279]
The getCategoriesByPath(
apath
$apath, [sort
$sort = ''], [field
$field = 'ipath'], [includeLeaf
$includeLeaf = true], [all
$all = false], [exclPath
$exclPath = ''], [assocKey
$assocKey = ''], [attributes
$attributes = null])
|
|
Return an array of category objects by path without the root category
Tags:
Parameters:
method getCategoriesByRegistry [line 151]
The getCategoriesByRegistry(
registry
$registry)
|
|
Return an array of categories by the registry info
Tags:
Parameters:
method getCategoryByID [line 28]
The getCategoryByID(
cid
$cid)
|
|
Return a category object by ID
Tags:
Parameters:
method getCategoryByPath [line 120]
The getCategoryByPath(
apath
$apath, [field
$field = 'path'])
|
|
Return a folder object by it's path
Tags:
Parameters:
method getCategoryTreeJS [line 815]
generated getCategoryTreeJS(
cats
$cats, [doReplaceRootCat
$doReplaceRootCat = true])
|
|
Get the java-script for the tree menu
Tags:
Parameters:
method getCategoryTreeStructure [line 842]
The getCategoryTreeStructure(
cats
$cats)
|
|
Return an array of folders the user has at least access/view rights to.
Tags:
Parameters:
method getParentCategories [line 237]
The getParentCategories(
id
$id, [assocKey
$assocKey = 'id'])
|
|
Return all parent categories starting from id
Tags:
Parameters:
method getSelector_Categories [line 905]
The getSelector_Categories(
cats
$cats, [field
$field = 'id'], [selected
$selectedValue = '0'], [name
$name = 'category[parent_id]'], [defaultValue
$defaultValue = 0], [defaultText
$defaultText = ''], [allValue
$allValue = 0], [allText
$allText = ''], [submit
$submit = false], [displayPath
$displayPath = false], [doReplaceRootCat
$doReplaceRootCat = true], [multipleSize
$multipleSize = 1], [
$fieldIsAttribute = false])
|
|
Return the HTML selector code for the given category hierarchy
Tags:
Parameters:
method getSubCategories [line 329]
The getSubCategories(
cid
$cid, [recurse
$recurse = true], [relative
$relative = true], [includeRoot
$includeRoot = false], [includeLeaf
$includeLeaf = true], [all
$all = false], [excludeCid
$excludeCid = ''], [assocKey
$assocKey = ''], [attributes
$attributes = null])
|
|
Return an array of Subcategories for the specified folder
Tags:
Parameters:
method getSubCategoriesByPath [line 374]
The getSubCategoriesByPath(
apath
$apath, [field
$field = 'ipath'], [recurse
$recurse = true], [relative
$relative = true], [includeRoot
$includeRoot = false], [includeLeaf
$includeLeaf = true], [all
$all = false], [excludeCid
$excludeCid = ''], [assocKey
$assocKey = ''], [attributes
$attributes = null])
|
|
Return an array of Subcategories for the specified folder
Tags:
Parameters:
method getSubCategoriesForCategory [line 420]
The getSubCategoriesForCategory(
category
$category, [recurse
$recurse = true], [relative
$relative = true], [includeRoot
$includeRoot = false], [includeLeaf
$includeLeaf = true], [all
$all = false], [excludeCat
$excludeCat = null], [assocKey
$assocKey = ''], [attributes
$attributes = null], [sortField
$sortField = null])
|
|
Return an array of Subcategories by for the given category
Tags:
Parameters:
method hasCategoryAccess [line 1241]
bool hasCategoryAccess(
array
$categories,
$module, [int
$permLevel = ACCESS_OVERVIEW])
|
|
Check for access to a certain set of categories For each category property in the list, check if we have access to that category in that property. Check is done as "Categories:Property:$propertyName", "$cat[id]::"
Tags:
Parameters:
method haveDirectSubcategories [line 785]
true haveDirectSubcategories(
cid
$cid, [countOnly
$countOnly = false], [all
$all = true])
|
|
Check whether the category $cid has subcategories (optional checks for leafe )
Tags:
Parameters:
method isDirectSubCategory [line 728]
true isDirectSubCategory(
rootCat
$rootCat, cat
$cat)
|
|
Check whether $cid is a direct subcategory of $root_id
Tags:
Parameters:
method isDirectSubCategoryByID [line 704]
true isDirectSubCategoryByID(
root_id
$root_id, cid
$cid)
|
|
Check whether $cid is a direct subcategory of $root_id
Tags:
Parameters:
method isSubCategory [line 767]
true isSubCategory(
rootCat
$rootCat, cat
$cat)
|
|
Check whether $cat is a subcategory of $rootCat
Tags:
Parameters:
method isSubCategoryByID [line 742]
true isSubCategoryByID(
root_id
$root_id, cid
$cid)
|
|
Check whether $cid is a subcategory of $root_id
Tags:
Parameters:
method moveCategoriesByID [line 516]
true moveCategoriesByID(
cid
$cid, newparent_id
$newparent_id)
|
|
Move categories by ID (recursive move)
Tags:
Parameters:
method moveCategoriesByPath [line 558]
true moveCategoriesByPath(
apath
$apath, newparent_id
$newparent_id, [field
$field = 'ipath'], [includeRoot
$includeRoot = true])
|
|
Move Categories by Path (recursive move)
Tags:
Parameters:
method moveSubCategoriesByPath [line 542]
true moveSubCategoriesByPath(
apath
$apath, newparent_id
$newparent_id, [field
$field = 'ipath'])
|
|
Move SubCategories by Path (recurisve move)
Tags:
Parameters:
method rebuildPaths [line 1205]
void rebuildPaths(
[field
$field = 'path'], [sourceField
$sourceField = 'name'], [leaf_id
$leaf_id = 0])
|
|
Rebuild the path field for all categories in the database Note that the
Parameters:
method resequence [line 1063]
True resequence(
cats
$cats, [step
$step = 1])
|
|
Resequence the sort fields for the given category
Tags:
Parameters:
method sortByLocale [line 1048]
The sortByLocale(
cats
&$cats, [func
$func = 'cmpName'])
|
|
Utility function to sort a category array by the current locate of either the ML name or description
Tags:
Parameters:
|
|