Class: Content_Page
Source Location: /content_classes/page.class.php
Class Details
[line 38]
Class Variables
Class Methods
constructor __construct [line 59]
Content_Page __construct(
)
|
|
Start instance of base class, load configuration and establish database connection. Please don't call the constructor direcly, use the singleton pattern instead.
Tags:
method addPage [line 85]
int addPage(
array
$sqlData)
|
|
Adds page to the page table. Takes a field=>value array with page data as first argument. Returns insert id.
Tags:
Parameters:
method applyPageBoxes [line 998]
void applyPageBoxes(
int
$page, int
$page_to_apply)
|
|
Apply the page boxes of the selected page. Takes the id of the just created page as first and the the id of the page to apply as second argument. Fails silently if no boxes found.
Tags:
Parameters:
method applyPageContents [line 907]
array applyPageContents(
int
$page, int
1)
|
|
Prepares sql Data to apply for the selected page types. This task has to be executed within the page creation. Takes the id of the page to apply as first argument. Returns array.
Tags:
Parameters:
method checkAccess [line 1242]
bool checkAccess(
int
$page, bool
$protect_flag)
|
|
Checks if current user has access to given page. Takes the page id as first argument, the flag, if the page has to be protected or not, as second argument. Returns bool.
Tags:
Parameters:
method countPages [line 502]
array countPages(
[array
$params = array()])
|
|
Method to count pages. Takes key=>value array with counting params as first argument. Returns array. List of supported params: - index_page, int, optional: whether to select index pages (0/1)
- navigation, int, optional: Navigation id
- navigation_name, string, optional: Navigation name
- root_node, int, optional: Root node id
- parent, int, optional: Parent node id
- level, int, optional: Level count
- sorting, int, optional: Sorting count
- start, int, optional: row offset
- limit, int, optional: amount of rows to return
- draft, int, optional: include/exclude pages with param draft
Tags:
Parameters:
method deletePage [line 166]
Removes page from the page table. Takes the page id as first argument. Returns amount of affected rows
Tags:
Parameters:
method initPageContents [line 791]
bool initPageContents(
int
$page, [int
$page_to_apply = null])
|
|
Prepares and executes table structure for the selected page types. This task has to be executed directly after the page creation. Takes the id of the just created page as first and optional the id of the applied page as second argument if provided. This second argument is used whenever the user chooses to prefill the created page with appropriate content of already applied pages. Returns boolean true.
Tags:
Parameters:
method mapPageToGroups [line 669]
bool mapPageToGroups(
int
$page, [array
$groups = array()])
|
|
Maps template to template sets. Takes template id as first argument, array with list of set ids as second argument. Returns boolean true. If an empty array is passed as sets, all existing links will be removed.
Tags:
Parameters:
method pageBelongsToCurrentProject [line 1117]
int pageBelongsToCurrentProject(
int
$page)
|
|
Tests whether given page belongs to current project. Takes the page id as first argument. Returns bool.
Tags:
Parameters:
method pageBelongsToCurrentUser [line 1163]
bool pageBelongsToCurrentUser(
int
$page)
|
|
Test whether page belongs to current user or not. Takes the page id as first argument. Returns bool.
Tags:
Parameters:
method pageExists [line 1351]
bool pageExists(
int
$id)
|
|
Tests whether page exists or not. Takes the page id as first argument. Returns bool.
Tags:
Parameters:
method resolvePage [line 1285]
Resolves page using the available url params. Returns the page id on success or throws an exception on failure. The function either expects the plain page id (~ $_REQUEST['page']) or the url name of a page (~ $_REQUEST['page_name]).
Tags:
method selectIndexPage [line 614]
Selects index page. Returns array with the complete page information.
Tags:
method selectPage [line 204]
array selectPage(
int
$id)
|
|
Selects one page. Takes the page id as first argument. Returns array with page information.
Tags:
Parameters:
method selectPages [line 302]
array selectPages(
[array
$params = array()])
|
|
Method to select one or more pages. Takes key=>value array with select params as first argument. Returns array. List of supported params: - navigation, int, optional: Navigation id
- navigation_name, string, optional: Navigation name
- root_node, int, optional: Root node id
- parent, int, optional: Parent node id
- level, int, optional: Level count
- sorting, int, optional: Sorting count
- type, int, optional: Page type id
- start, int, optional: row offset
- limit, int, optional: amount of rows to return
- exclude, int, optional: if set exclude page from navigation (only internal use)
- draft, int, optional: if set include pages with param draft (only internal use)
- protect, int, optional: if set exclude protected pages
Tags:
Parameters:
method selectPageToGroupsMap [line 733]
array selectPageToGroupsMap(
int
$page)
|
|
Selects page to groups map. Takes the page id as first argument. Returns array.
Tags:
Parameters:
method selectPath [line 1400]
array selectPath(
int
$target)
|
|
Returns path from root to target node. Takes the id of the target node as first argument. Returns id.
Tags:
Parameters:
method setIndexPage [line 1196]
int setIndexPage(
int
$page)
|
|
Sets index page to given page id. Takes the page id as first argument. Returns amount of affected rows.
Tags:
Parameters:
method testForUniqueUrlName [line 1059]
bool testForUniqueUrlName(
string
$name, [int
$id = null])
|
|
Tests given url name of a page for uniqueness. Takes the page's url name as first argument and an optional page id as second argument. If the page id is given, this page type won't be considered when checking for uniqueness (useful for updates). Returns boolean true if page name is unique.
Tags:
Parameters:
method updatePage [line 124]
int updatePage(
int
$id, array
$sqlData)
|
|
Updates page. Takes the page id as first argument, a field=>value array with the new page data as second argument. Returns amount of affected rows.
Tags:
Parameters:
|
|