A simple alias for the ContentOperations class
package |
CMS |
---|---|
ignore |
get_instance() : \ContentOperations
getContentObject() : \getContentObject()
\getContentObject()
LoadContentFromSerializedData(array &$data) : \ContentBase
Expects an associative array with 2 elements: content_type: string A content type name serialized_content: string Serialized form data
array
$dataA content object derived from ContentBase
CreateNewContent(mixed $type) : \ContentBase
if the content type is registered with the system, and the class does not exist, the appropriate filename will be included and then, if possible a new object of the designated type will be instantiated.
mixed
$typeThe type. Either a string, or an instance of CmsContentTypePlaceHolder
(A valid object derived from ContentBase)
LoadContentFromId(integer $id, boolean $loadprops = false) : mixed
integer
$idThe id of the content object to load
boolean
$loadpropsAlso load the properties of that content object. Defaults to false.
mixed
The loaded content object. If nothing is found, returns FALSE.
LoadContentFromAlias(integer $alias, boolean $only_active = false) : \ContentBase
integer
$aliasThe alias of the content object to load
boolean
$only_activeIf true, only return the object if it's active flag is true. Defaults to false.
The loaded content object. If nothing is found, returns NULL.
GetDefaultContent() : integer
integer
The id of the default content page
register_content_type(\CmsContentTypePlaceHolder &$obj)
\CmsContentTypePlaceHolder
$objListContentTypes(boolean $byclassname = false, boolean $allowed = false, boolean $system = FALSE) : array
boolean
$byclassnameoptionally return keys as class names.
boolean
$allowedoptionally trim the list of content types that are allowed by the site preference.
boolean
$systemreturn only system content types.
array
List of content types registered in the system.
SetAllHierarchyPositions()
This is an expensive operation on the database, but must be called once each time one or more content pages are updated if positions have changed in the page structure.
GetLastContentModification() : \unix
\unix
timestamp representing the last time a content page was modified.
GetAllContentAsHierarchy(boolean $loadcontent = false) : \cms_content_tree
boolean
$loadcontentIf false, only create the nodes in the tree, don't load the content objects
The cached tree of content
LoadAllContent(boolean $loadprops = FALSE, boolean $inactive = FALSE, boolean $showinmenu = FALSE)
boolean
$loadpropsLoad extended content properties or just the page structure and basic properties
boolean
$inactiveLoad inactive pages as well
boolean
$showinmenuLoad pages marked as show in menu
LoadChildren(integer $id, boolean $loadprops = false, boolean $all = false, array $explicit_ids = array())
integer
$idThe parent of the content objects to load into the tree
boolean
$loadpropsIf true, load the properties of all loaded content objects
boolean
$allIf true, load all content objects, even inactive ones.
array
$explicit_ids(optional) array of explicit content ids to load
SetDefaultContent(integer $id)
integer
$idThe id to set as default
GetAllContent(boolean $loadprops = true) : array
Caution: it is entirely possible that this method (and other similar methods of loading content) will result in a memory outage if there are large amounts of content objects AND/OR large amounts of content properties. Use with caution.
boolean
$loadpropsNot implemented
array
The array of content objects
CreateHierarchyDropdown(string $current = '', string $value = '', string $name = 'parent_id', boolean $allowcurrent, boolean $use_perms, boolean $ignore_current, boolean $allow_all = false, boolean $for_child = false) : string
This method was rewritten for 2.0 to use the jquery hierselector plugin to better accommodate larger websites.
Since many parameters are now ignored, A new method needs to be writtent o replace this archaic method... so consider this method to be deprecateed.
string
$currentThe currently selected content object. If none is given, we show all items (ignored since 2.0).
string
$valueThe id of the currently selected content object.
string
$nameThe html name of the dropdown.
boolean
$allowcurrentOverrides the logic if $current and/or $parent are passed. Defaults to false.
boolean
$use_permsIf true, checks authorship permissions on pages and only shows those the current user has authorship of (can edit)
boolean
$ignore_current(ignored as of 2.0) (Before 2.2 this parameter was called ignore_current and
boolean
$allow_allIf true, show all items, even if the content object doesn't have a valid link. Defaults to false.
boolean
$for_childIf true, assume that we want to add a new child and obey the WantsChildren flag of each content page. (new in 2.2).
string
The html dropdown of the hierarchy.
GetDefaultPageID() : integer
integer
The id of the default page. false if not found.
GetPageIDFromAlias(string $alias) : integer
string
$aliasThe alias to query
integer
The resulting id. null if not found.
GetPageIDFromHierarchy(string $position) : integer
string
$positionThe position to query
integer
The resulting id. false if not found.
GetPageAliasFromID(integer $id) : string
integer
$idThe content id to query
string
The resulting content alias. false if not found.
CheckAliasError(string $alias, string $content_id = -1) : string
string
$aliasThe content alias to check
string
$content_idThe id of the current page, for used alias checks on existing pages
string
The error, if any. If there is no error, returns FALSE.
CreateFriendlyHierarchyPosition(string $position) : string
string
$positionThe hierarchy position to convert
string
The unfriendly version of the hierarchy string
CreateUnfriendlyHierarchyPosition(string $position) : string
string
$positionThe hierarchy position to convert
string
The friendly version of the hierarchy string
CheckParentage(integer $test_id, integer $base_id = null) : boolean
integer
$test_idPage ID to test
integer
$base_id(optional) Page ID to act as the base page. The current page is used if not specified.
boolean
GetOwnedPages(integer $userid) : array
integer
$useridThe userid
array
Array of integer page id's
CheckPageOwnership(integer $userid, integer $pageid) : boolean
integer
$useridinteger
$pageid boolean
GetPageAccessForUser(integer $userid) : array<mixed,integer>
integer
$useridThe userid
array<mixed,integer>
Array of page id's
CheckPageAuthorship(integer $userid, integer $contentid) : boolean
integer
$useridinteger
$contentid boolean
CheckPeerAuthorship(integer $userid, integer $contentid) : boolean
integer
$useridinteger
$contentid boolean
quickfind_node_by_id(integer $id) : \cms_content_tree