Class Page

Description

The page object in Concrete encapsulates all the functionality used by a typical page and their contents including blocks, page metadata, page permissions.

  • author: Andrew Embler <andrew@concrete5.org>
  • copyright: Copyright (c) 2003-2008 Concrete5. (http://www.concrete5.org)

Located in /models/page.php (line 12)

Object
   |
   --Collection
      |
      --Page
Direct descendents
Class Description
 class ComposerPage ComposerPage is a special object of pages that haven't been published yet but still live in the sitemap system.
 class SinglePage SinglePage extends the page class for those instances of pages that have no type, and are special "single pages" within the system.
Variable Summary
Method Summary
 static page addHomePage ()
 static Page getByID (int $cID, [string $versionOrig = 'RECENT'], [string $class = 'Page'])
 static Page getByPath (string $path, [string $version = 'RECENT'])
 static string getCollectionPathFromID (int $cID)
 static void getCurrentPage ()
 void __destruct ()
 void acquireAreaPermissions ( $permissionsCollectionID)
 page add (collectiontype $ct, array $data)
 int addCollectionAliasExternal (string $cName, string $cLink, [bool $newWindow = 0])
 void addStatic ( $data)
 void addToPageCache ( $content)
 void assignPermissionSet (array $permissionsArray)
 void canMoveCopyTo ( $cobj)
 void delete ()
 void duplicate ( $nc, [ $preserveUserID = false])
 void duplicateAll ( $nc, [ $preserveUserID = false])
 void forceCheckIn ()
 void getCollectionChildrenArray ([ $oneLevelOnly = 0])
 string getCollectionDatePublic ([string $dateFormat = null], [string $type = 'system'])
 string getCollectionIcon ()
 string getCollectionName ()
 string getCollectionPath ()
 Page getFirstChild ([string $sortColumn = 'cDisplayOrder asc'])
 void getNumChildren ()
 string getPackageHandle ()
 int getPackageID ()
 void getPagePaths ()
 string getPendingAction ()
 string getPendingActionDateTime ([string $type = 'system'])
 bool isAdminArea ()
 bool isAlias ()
 bool isArrangeMode ()
 bool isBlockAliasedFromMasterCollection ( &$b, array $b)
 bool isCheckedOut ()
 bool isEditMode ()
 bool isExternalLink ()
 bool isPendingCopy ()
 bool isPendingDelete ()
 bool isPendingMove ()
 bool isSystemPage ()
 void markPendingAction ( $action, [ $targetC = null])
 void move ( $nc, [ $retainOldPagePath = false])
 void populatePage ( $cInfo,  $where,  $cvID)
 void processArrangement (array $areas)
 void renderFromCache ()
 void rescanCollectionPath ([ $retainOldPagePath = false])
 void rescanCollectionPathChildren ( $cID,  $cPath)
 void rescanCollectionPathIndividual ( $cID,  $cPath, [ $retainOldPagePath = false])
 void rescanPagePaths ( $newPaths)
 void setPageIndexScore ( $score)
 void setTheme (PageTheme $pl)
 void supportsPageCache ( $blocks, [ $controller = false])
 void uniquifyPagePath ( $origPath)
 void update ( $data)
 void updateCollectionAliasExternal (string $cName, string $cLink, [bool $newWindow = 0])
 void updateDisplayOrder ( $do, [ $cID = 0])
 void updateGroupsSubCollection ( $cParentIDString)
 void updatePermissions ([ $args = null])
 void updatePermissionsCollectionID ( $cParentIDString,  $npID)
 void _associateMasterCollectionBlocks ( $newCID,  $masterCID)
 void _getNumChildren ( $cID, [ $oneLevelOnly = 0], [ $sortColumn = 'cDisplayOrder asc'])
Variables
mixed $blocksAliasedFromMasterCollection = null (line 14)
  • access: protected

Inherited Variables

Inherited from Collection

Collection::$attributes
Collection::$cID
Methods
static addHomePage (line 2112)

Adds the home page to the system. Typically used only by the installation program.

  • access: public
page addHomePage ()
static getByID (line 39)
  • access: public
Page getByID (int $cID, [string $versionOrig = 'RECENT'], [string $class = 'Page'])
  • int $cID: Collection ID of a page
  • string $versionOrig: ACTIVE or RECENT
  • string $class

Redefinition of:
Collection::getByID()

Redefined in descendants as:
static getByPath (line 21)
  • access: public
Page getByPath (string $path, [string $version = 'RECENT'])
  • string $path: /path/to/page
  • string $version: ACTIVE or RECENT
static getCollectionPathFromID (line 669)

Returns the path for a page from its cID

  • access: public
string getCollectionPathFromID (int $cID)
  • int $cID: cID
static getCurrentPage (line 2410)
  • access: public
void getCurrentPage ()
Destructor __destruct (line 1368)
  • access: public
void __destruct ()

Redefinition of:
Collection::__destruct()
acquireAreaPermissions (line 1274)
void acquireAreaPermissions ( $permissionsCollectionID)
  • $permissionsCollectionID
add (line 2162)

Adds a new page of a certain type, using a passed associate array to setup value. $data may contain any or all of the following:

"uID": User ID of the page's owner "pkgID": Package ID the page belongs to "cName": The name of the page "cHandle": The handle of the page as used in the path "cDatePublic": The date assigned to the page

  • access: public
page add (collectiontype $ct, array $data)
  • collectiontype $ct
  • array $data

Redefinition of:
Collection::add()

Redefined in descendants as:
addCollectionAlias (line 432)

Make an alias to a page

int addCollectionAlias (Collection $c)
addCollectionAliasExternal (line 508)

Add a new external link

int addCollectionAliasExternal (string $cName, string $cLink, [bool $newWindow = 0])
  • string $cName
  • string $cLink
  • bool $newWindow
addStatic (line 2344)
  • access: public
void addStatic ( $data)
  • $data
addToPageCache (line 2244)
  • access: public
void addToPageCache ( $content)
  • $content
approvePendingAction (line 1685)
void approvePendingAction ()
assignPermissionSet (line 283)

Assign permissions to a page based on an array

  1.  $pxml->guests['canRead'1;
  2.  $pxml->registered['canWrite'1;
  3.  $pxml->group[0]['canWrite'1;
  4.  $pxml->group[0]['canRead'1;

void assignPermissionSet (array $permissionsArray)
  • array $permissionsArray
canMoveCopyTo (line 1102)
void canMoveCopyTo ( $cobj)
  • $cobj
clearPendingAction (line 1677)
void clearPendingAction ()
delete (line 1584)
void delete ()

Redefinition of:
Collection::delete()
duplicate (line 1484)
void duplicate ( $nc, [ $preserveUserID = false])
  • $nc
  • $preserveUserID

Redefinition of:
Collection::duplicate()
duplicateAll (line 1459)
void duplicateAll ( $nc, [ $preserveUserID = false])
  • $nc
  • $preserveUserID
forceCheckIn (line 155)

Forces the page to be checked in if its checked out

  • access: public
void forceCheckIn ()
getAllowedSubCollections (line 652)

Gets the allowed sub pages for a page

void getAllowedSubCollections ()
getCollectionAction (line 1867)
void getCollectionAction ()
getCollectionCheckedOutUserID (line 645)

Returns the uID for a page that is checked out

int getCollectionCheckedOutUserID ()
getCollectionChildrenArray (line 1082)
void getCollectionChildrenArray ([ $oneLevelOnly = 0])
  • $oneLevelOnly
getCollectionDatePublic (line 843)

Gets the date a the current version was made public,

if user is specified, returns in the current user's timezone

  • return: date formated like: 2009-01-01 00:00:00
string getCollectionDatePublic ([string $dateFormat = null], [string $type = 'system'])
  • string $dateFormat
  • string $type: (system || user)
getCollectionDescription (line 859)

Get the description of a page

string getCollectionDescription ()
getCollectionDisplayOrder (line 983)

Gets the position of the page in the sitemap

int getCollectionDisplayOrder ()
getCollectionFilename (line 832)

Get the file name of a page (single pages)

string getCollectionFilename ()
getCollectionFullPageCaching (line 2256)
  • access: public
void getCollectionFullPageCaching ()
getCollectionFullPageCachingLifetime (line 2260)
  • access: public
void getCollectionFullPageCachingLifetime ()
getCollectionFullPageCachingLifetimeCustomValue (line 2264)
  • access: public
void getCollectionFullPageCachingLifetimeCustomValue ()
getCollectionFullPageCachingLifetimeValue (line 2268)
  • access: public
void getCollectionFullPageCachingLifetimeValue ()
getCollectionHandle (line 696)

Returns the page's handle

string getCollectionHandle ()

Redefinition of:
Collection::getCollectionHandle()
getCollectionIcon (line 567)

Gets the icon for a page (also fires the on_page_get_icon event)

  • return: Path to the icon
  • access: public
string getCollectionIcon ()
getCollectionInheritance (line 1021)
void getCollectionInheritance ()
getCollectionName (line 773)

Returns the page's name

string getCollectionName ()
getCollectionParentID (line 867)

Gets the cID of the page's parent

int getCollectionParentID ()
getCollectionParentIDFromChildID (line 876)

Get the Parent cID from a page by using a cID

int getCollectionParentIDFromChildID (int $cID)
  • int $cID
getCollectionParentIDs (line 891)

Returns an array of this cParentID and aliased parentIDs

array getCollectionParentIDs ()
getCollectionPath (line 660)

Returns the path for the current page

string getCollectionPath ()
getCollectionPointerExternalLink (line 792)

Returns link for the aliased page

string getCollectionPointerExternalLink ()
getCollectionPointerID (line 784)

Returns the collection ID for the aliased page (returns 0 unless used on an actual alias)

int getCollectionPointerID ()
getCollectionPointerOriginalID (line 824)

Get the original cID of a page

int getCollectionPointerOriginalID ()
getCollectionThemeID (line 728)

Returns theme id for the collection

int getCollectionThemeID ()
getCollectionThemeObject (line 760)

Returns Collection's theme object

PageTheme getCollectionThemeObject ()
getCollectionTypeHandle (line 720)

Returns the Collection Type handle

string getCollectionTypeHandle ()
getCollectionTypeID (line 712)

Returns the Collection Type ID

int getCollectionTypeID ()

Redefinition of:
Collection::getCollectionTypeID()
getCollectionTypeName (line 704)

Returns the page's name

string getCollectionTypeName ()
getCollectionUserID (line 688)

Returns the uID for a page ownder

int getCollectionUserID ()
getFirstChild (line 1073)

Returns the first child of the current page, or null if there is no child

  • access: public
Page getFirstChild ([string $sortColumn = 'cDisplayOrder asc'])
  • string $sortColumn
getMasterCollectionID (line 1037)
void getMasterCollectionID ()
getNextSubPageDisplayOrder (line 1714)
void getNextSubPageDisplayOrder ()
getNumChildren (line 1053)
void getNumChildren ()
getNumChildrenDirect (line 1057)
void getNumChildrenDirect ()
getOriginalCollectionID (line 1046)
void getOriginalCollectionID ()
getPackageHandle (line 142)

Get the package handle for a page (page thats added by a package)

  • access: public
string getPackageHandle ()
getPackageID (line 136)

Get the package ID for a page (page thats added by a package) (returns 0 if its not in a package)

  • access: public
int getPackageID ()
getPageIndexContent (line 1848)
  • access: public
void getPageIndexContent ()
getPageIndexScore (line 1844)
  • access: public
void getPageIndexScore ()
getPagePaths (line 2390)
void getPagePaths ()
getParentPermissionsCollectionID (line 1025)
void getParentPermissionsCollectionID ()
getPendingAction (line 912)

Gets the pending action for a page

string getPendingAction ()
getPendingActionDateTime (line 930)

Gets the pending action date,

if user is specified, returns in the current user's timezone

  • return: date formated like: 2009-01-01 00:00:00
string getPendingActionDateTime ([string $type = 'system'])
  • string $type: (system || user)
getPendingActionTargetCollectionID (line 943)

Gets the cID of the target page (like for deleting)

int getPendingActionTargetCollectionID ()
getPendingActionUserID (line 920)

Gets the uID of the user that intiated the pending action

int getPendingActionUserID ()
getPermissionsCollectionID (line 1017)
void getPermissionsCollectionID ()
getPermissionsCollectionObject (line 1033)
void getPermissionsCollectionObject ()
isAdminArea (line 166)

Checks if the page is a dashboard page, returns true if it is

  • access: public
bool isAdminArea ()
isAlias (line 808)

Checks to see if the page is an alias

bool isAlias ()
isArrangeMode (line 150)

Returns 1 if the page is in arrange mode

  • access: public
bool isArrangeMode ()
isBlockAliasedFromMasterCollection (line 742)

Check if a block is an alias from a page default

bool isBlockAliasedFromMasterCollection ( &$b, array $b)
  • array $b
  • &$b
isCheckedOut (line 227)

checks if the page is checked out, if it is return true

bool isCheckedOut ()
isCheckedOutByMe (line 259)

Checks if the page is checked out by the current user

bool isCheckedOutByMe ()
isEditMode (line 127)

Returns 1 if the page is in edit mode

  • access: public
bool isEditMode ()
isExternalLink (line 816)

Checks if a page is an external link

bool isExternalLink ()
isGeneratedCollection (line 268)

Checks if the page is a single page

bool isGeneratedCollection ()
isMasterCollection (line 904)

Checks if a page is a page default

bool isMasterCollection ()
isPendingCopy (line 959)

Checks if the pending action is copy

bool isPendingCopy ()
isPendingDelete (line 967)

Checks if the pending action is delete

bool isPendingDelete ()
isPendingMove (line 951)

Checks if the pending action is move

bool isPendingMove ()
isSystemPage (line 555)

Check if a page is a single page that is in the core (/concrete directory)

  • access: public
bool isSystemPage ()
markPendingAction (line 1651)
void markPendingAction ( $action, [ $targetC = null])
  • $action
  • $targetC
move (line 1408)
void move ( $nc, [ $retainOldPagePath = false])
  • $nc
  • $retainOldPagePath
movePageDisplayOrderToBottom (line 1768)
  • access: public
void movePageDisplayOrderToBottom ()
movePageDisplayOrderToTop (line 1753)
  • access: public
void movePageDisplayOrderToTop ()
openCollectionPointerExternalLinkInNewWindow (line 800)

Returns if the alias opens in a new window

bool openCollectionPointerExternalLinkInNewWindow ()
overrideTemplatePermissions (line 975)

Gets the template permissions

string overrideTemplatePermissions ()
populatePage (line 66)
  • access: protected
void populatePage ( $cInfo,  $where,  $cvID)
  • $cInfo
  • $where
  • $cvID
processArrangement (line 180)

Takes an array of area/block values and makes that the arrangement for this page's version

Format is like: $area[10][0] = 2, $area[10][1] = 8, $area[15][0] = 27, with the area ID being the key and the block IDs being 1-n values inside it

  • access: public
void processArrangement (array $areas)
  • array $areas
removeThisAlias (line 606)

Remove an external link/alias

  • return: cID for the original page if the page was an alias
int removeThisAlias ()
renderFromCache (line 2248)
  • access: public
void renderFromCache ()
rescanChildrenDisplayOrder (line 1699)
void rescanChildrenDisplayOrder ()
rescanCollectionPath (line 1727)
void rescanCollectionPath ([ $retainOldPagePath = false])
  • $retainOldPagePath
rescanCollectionPathChildren (line 1854)
void rescanCollectionPathChildren ( $cID,  $cPath)
  • $cID
  • $cPath
rescanCollectionPathIndividual (line 1781)
void rescanCollectionPathIndividual ( $cID,  $cPath, [ $retainOldPagePath = false])
  • $cID
  • $cPath
  • $retainOldPagePath
rescanPagePaths (line 1228)
  • access: public
void rescanPagePaths ( $newPaths)
  • $newPaths
setPageIndexScore (line 1840)
  • access: public
void setPageIndexScore ( $score)
  • $score
setPermissionsInheritanceToOverride (line 1010)

Set the permissions of sub-collections added beneath this permissions to inherit from the parent

void setPermissionsInheritanceToOverride ()
setPermissionsInheritanceToTemplate (line 1000)

Set the permissions of sub-collections added beneath this permissions to inherit from the template

void setPermissionsInheritanceToTemplate ()
setTheme (line 991)

Set the theme for a page using the page object

  • access: public
void setTheme (PageTheme $pl)
supportsPageCache (line 2288)
  • access: public
void supportsPageCache ( $blocks, [ $controller = false])
  • $blocks
  • $controller
uniquifyPagePath (line 1208)
  • access: public
void uniquifyPagePath ( $origPath)
  • $origPath
update (line 1109)
void update ( $data)
  • $data
updateCollectionAliasExternal (line 486)

Update the name, link, and to open in a new window for an external link

void updateCollectionAliasExternal (string $cName, string $cLink, [bool $newWindow = 0])
  • string $cName
  • string $cLink
  • bool $newWindow
updateDisplayOrder (line 1745)
void updateDisplayOrder ( $do, [ $cID = 0])
  • $do
  • $cID
updateGroupsSubCollection (line 1390)
void updateGroupsSubCollection ( $cParentIDString)
  • $cParentIDString
updatePermissions (line 1303)
void updatePermissions ([ $args = null])
  • $args
updatePermissionsCollectionID (line 1372)
void updatePermissionsCollectionID ( $cParentIDString,  $npID)
  • $cParentIDString
  • $npID
_associateMasterCollectionBlocks (line 2074)
void _associateMasterCollectionBlocks ( $newCID,  $masterCID)
  • $newCID
  • $masterCID
_getNumChildren (line 1088)
void _getNumChildren ( $cID, [ $oneLevelOnly = 0], [ $sortColumn = 'cDisplayOrder asc'])
  • $cID
  • $oneLevelOnly
  • $sortColumn

Inherited Methods

Inherited From Collection

 Collection::add()
 Collection::addAreaLayout()
 Collection::addAttribute()
 Collection::addBlock()
 Collection::clearAttribute()
 Collection::clearCollectionAttributes()
 Collection::delete()
 Collection::deleteAreaLayout()
 Collection::duplicate()
 Collection::getArea()
 Collection::getAreaCustomStyleRule()
 Collection::getAttribute()
 Collection::getAttributeValueObject()
 Collection::getBlocks()
 Collection::getByHandle()
 Collection::getByID()
 Collection::getCollectionAreaDisplayOrder()
 Collection::getCollectionAttributeValue()
 Collection::getCollectionDateAdded()
 Collection::getCollectionDateLastModified()
 Collection::getCollectionHandle()
 Collection::getCollectionID()
 Collection::getCollectionTypeID()
 Collection::getSetCollectionAttributes()
 Collection::getVersionID()
 Collection::getVersionObject()
 Collection::getVersionToModify()
 Collection::hasAliasedContent()
 Collection::loadVersionObject()
 Collection::markModified()
 Collection::outputCustomStyleHeaderItems()
 Collection::refreshCache()
 Collection::reindex()
 Collection::rescanDisplayOrder()
 Collection::resetAreaCustomStyle()
 Collection::setAreaCustomStyle()
 Collection::setAttribute()
 Collection::updateAreaLayoutId()
 Collection::_cloneVersion()
 Collection::__destruct()

Documentation generated on Thu, 15 Sep 2011 16:36:28 -0700 by phpDocumentor 1.4.1