Return a valid page for a given URL
static
CMS_page
analyseURL
(
string $pageUrl, [
boolean $useDomain =
true])
-
string
$pageUrl: the page URL
-
boolean
$useDomain: : use queried domain to found root page associated (default : true)
Attach a page to the tree (references it in the linx_tree tables) Static function.
static boolean
attachPageToTree
(mixed $page, mixed $ancestor, [boolean $publicTree = false])
-
mixed
$page: The page to attach
-
mixed
$ancestor: The father to attach to
-
boolean
$publicTree: Do we want to fetch the public tree or the edited one ?
Change pages order. Add the RESOURCE_EDITION_SIBLINGSORDER edition to the father.
Static function.
static
boolean
changePagesOrder
(
array $newSiblingOrder,
&$user,
CMS_profile_user $user)
-
CMS_profile_user
$user: The user operating the change.
-
array
$newSiblingOrder: of CMS_page id $newSiblingOrder The sibling pages to move in the good order
-
&$user
Change a sibling order. Add the RESOURCE_EDITION_SIBLINGSORDER edition to the father.
Static function.
-
CMS_page
$sibling: The sibling page to move
-
integer
$moveOffset: The move offset : 1 to move it to the right, -1 to the left. No other values permitted.
-
CMS_profile_user
$user: The user operating the change.
-
&$sibling
-
&$user
Compact ordered list of siblings, prevent from blank intervals in the list of integers representing order. All orders must increase one by one to avoir bugs in reordering then.
Static function.
static
boolean
compactSiblingOrder
(
&$page, [
$publicTree =
false],
CMS_page $page)
-
CMS_page
$page: The sibling page order list of siblings
-
&$page
-
$publicTree
Deletes a page from the tree (it will not be deleted, only detached).
Static function.
static
boolean
detachPageFromTree
(
&$page, [
boolean $publicTree =
false],
CMS_page $page)
-
CMS_page
$page: The page to delete
-
boolean
$publicTree: Do we want to fetch the public tree or the edited one ?
-
&$page
Returns all the siblings pages recursively.
Static function.
static array(id)
getAllSiblings
(integer $pageID, [boolean $publicTree = false], [boolean $stopAtWebsites = false])
-
integer
$pageID: The page we want he siblings of
-
boolean
$publicTree: Do we want to fetch the public tree or the edited one ?
-
boolean
$stopAtWebsites: Do we want to fetch the tree of all websites or only the current one (default : false)
Returns the ancestor of the given page, at the given offset.
Offset : positive : 1 is for father, 2 for grand-father, and so on. negative : -1 for the root sibling, -2 for the root grand-son (which are ancestors of $page) Static function.
static
CMS_page
getAncestor
(
&$page,
integer $offset, [
boolean $stopAtWebsites =
false], [
$publicTree =
false],
CMS_page $page)
-
CMS_page
$page: The page we want the brother of
-
integer
$offset: The ancestor offset (negative, will be sibling from root
-
boolean
$stopAtWebsites: Should the lineage stop at websites roots (other than the main website) ?
-
&$page
-
$publicTree
Get all the archived pages data : title, reference (ID), lastFileCreation date Static function.
static array(string=>string)
getArchivedPagesData
()
Returns the brother of the given page, at the given brotherhood position.
Offset : positive for right-hand brothers, negative for left-hand brother. Static function.
static
CMS_page
getBrother
(
&$page,
integer $offset, [
boolean $publicTree =
false],
CMS_page $page)
-
CMS_page
$page: The page we want the brother of
-
integer
$offset: The brotherhood offset
-
boolean
$publicTree: Do we want to fetch the public tree or the edited one ?
-
&$page
Returns page father Static function.
static mixed,
getFather
(mixed $page, [boolean $outputObject = false], [boolean $publicTree = false])
-
mixed
$page: : the page id or the cms_page object to get father of
-
boolean
$outputObject: : if true, return father as a cms_page object, otherwise, return father page Id (default false)
-
boolean
$publicTree: : if true, return public father page, else, return edited father (default false : edited)
Returns the ancestors of the given page to root, including root and the page.
Static function.
static
array(CMS_page)
getLineage
(
CMS_page $ancestor,
CMS_page $page, [
boolean $IO_CMS_page =
true], [
$publicTree =
false])
-
CMS_page
$ancestor: The oldest ancestor we want
-
CMS_page
$page: The page we want the lineage of
-
boolean
$IO_CMS_page: if it false, then the Input arguments aren't CMS_page but only page ID and function return an array(pageID). (this is realy fastest)
-
$publicTree
Get a page by it's codename relative to a given website Static function.
static mixed
getPageByCodename
($page $codename, $website $website, [boolean $public = false], [$returnObject $returnObject = true])
-
boolean
$public: Do we want to fetch the public tree or the edited one (default) ?
-
$page
$codename: string : the page codename to get
-
$website
$website: mixed integer / CMS_website : the website which codename is relative to
-
$returnObject
$returnObject: boolean : does the method return a CMS_page (default) or the page Id
Returns a CMS_page when given an ID Static function.
static
CMS_page
getPageByID
(
integer $id, [
$reset =
false])
-
integer
$id: The DB ID of the wanted CMS_page
-
$reset
Returns a queried CMS_page value identified by it's codename and a reference page to identify the requested website Static function.
static
CMS_page
getPageCodenameValue
(
string $codename,
$referencePageId,
string $type,
integer $id)
-
string
$codename: The codename of the wanted CMS_page
-
integer
$id: The DB ID of the reference CMS_page. This id is used to get the website of reference
-
string
$type: The value type to get
-
$referencePageId
Get all pages for a given codename Static function.
static mixed
getPagesByCodename
($page $codename, [boolean $public = false], [$returnObject $returnObject = true])
-
boolean
$public: Do we want to fetch the public tree or the edited one (default) ?
-
$page
$codename: string : the page codename to get
-
$returnObject
$returnObject: boolean : does the method return a CMS_page (default) or the page Id
Returns a queried CMS_page value Static function.
static
CMS_page
getPageValue
(
mixed $id,
string $type, [
boolean $public =
true], [
integer $currentPageId =
null])
-
mixed
$id: The DB ID of the wanted CMS_page or or "self" or the page codename ($currentPageId is mandatory in this case)
-
string
$type: The value type to get
-
boolean
$public: : public value or edited value (default : public)
-
integer
$currentPageId: : the page reference (required if first parameter is not a page Id)
Returns the website of a page Static function
-
mixed
$page: CMS_page or pageID $page : The page we want the website of
Returns the CMS_page of the root. It MUST exists or else everything fails.
Static function.
Returns all the siblings pages, sorted by sibling order.
Static function.
static
array(CMS_page)
getSiblings
(
&$page, [
boolean $publicTree =
false], [
boolean $getPages =
true],
CMS_page $page)
-
CMS_page
$page: The page we want he siblings of (can accept the page ID instead of CMS_page)
-
boolean
$publicTree: Do we want to fetch the public tree or the edited one ?
-
boolean
$getPages: if false, return only an array of sibling ID, else, return an array of sibling CMS_pages
-
&$page
Get the tree string needed by the text edition applet
format is : pageID/roottitle/subroottitle/pagetitle:::[SAME AS BEFORE...] where ::: is the separator passed as argument Static function. Recursive function
static string
getTreeString
( &$user, $pageID, string $separator, &$treeString)
-
string
$separator: The pages separator.
-
&$user
-
$pageID
-
&$treeString
Does the page has an ancestor ? Static function.
static boolean
hasAncestor
(integer $pageId, [boolean $publicTree = false])
-
integer
$pageId: The page to check for ancestor
-
boolean
$publicTree: Do we want to fetch the public tree or the edited one ?
Does given page has sibling ? Static function.
static
boolean
hasSiblings
(
&$page, [
boolean $publicTree =
false],
CMS_page $page)
-
CMS_page
$page: The page we want he siblings of (can accept the page ID instead of CMS_page)
-
boolean
$publicTree: Do we want to fetch the public tree or the edited one ?
-
&$page
Is the page an ancetor of the other ? Static function.
static
boolean
isAncestor
(
&$ancestor,
&$page, [
boolean $publicTree =
false],
CMS_page $ancestor,
CMS_page $sibling)
-
CMS_page
$ancestor: The contested ancestor page
-
CMS_page
$sibling: The sibling page
-
boolean
$publicTree: Do we want to fetch the public tree or the edited one ?
-
&$ancestor
-
&$page
Returns true if the page is in the public tree Static function.
static boolean
isInPublicTree
(mixed $page)
-
mixed
$page: The CMS_page to check or the page Id
Move a page in the tree structure Static function.
-
CMS_page
$page: The page to move
-
CMS_page
$newFather: The new father of the page
-
CMS_profile_user
$user: The user operating the change.
-
array
$newSiblingOrder: of CMS_page id $newSiblingOrder The sibling pages to move in the good order
-
&$page
-
&$newFather
-
&$user
Check if public page exists for given user Static function.
static boolean
pageExistsForUser
($pageID $pageID, $user 1)
-
$user
1: CMS_profile_user : the user to check
-
$pageID
$pageID: integer : the page id to check
Check if page(s) exists and is(are) in userspace.
Static function.
static mixed
pagesExistsInUserSpace
($pagesID $pagesID)
-
$pagesID
$pagesID: mixed integer / array of page(s) id(s) : the page(s) id(s) to check
Publish the move of a page : page new position pass from edited to public Static function.
static
boolean
publishPageMove
(
&$page,
CMS_page $page)
-
CMS_page
$page: The page which move
-
&$page
Publish the siblings order of a page : all its siblings order will go from _edited to _public Static function.
static
boolean
publishSiblingsOrder
(
&$page,
CMS_page $page)
-
CMS_page
$page: The page whose siblings are well ordered
-
&$page
Regenerates all the pages AND make all re-register their links Static function.
static void
regenerateAllPages
([boolean $fromScratch = false])
-
boolean
$fromScratch: If set to true, all pages will rebuild their content and not only their linxes
Revert page move from public state (used when a move is not validated).
This function must only be used on page which was already validated once Static function.
static
boolean
revertPageMove
(
CMS_page $page)
Revert siblings order from public state (used when a reordering is not validated).
Take care to set never validated pages to the end of public order Static function.
static
boolean
revertSiblingsOrder
(
CMS_page $page)
-
CMS_page
$page: The pages to revert siblings order
Submit pages to the regenerator. The first argument can either be a single page ID or an array of those.
static void
submitToRegenerator
(mixed $pages, integer $fromScratch, [boolean $dontLaunchRegenerator = false])
-
mixed
$pages: If it's a scalar, it's a page ID, else an array of pages IDs
-
integer
$fromScratch: Is the submission concerning a full from scratch regeneration (true) or a regeneration from linx files (false) ?
-
boolean
$dontLaunchRegenerator: to avoid multiple launch of the regenerator during multiple validation only the last page validation launch the script
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()