Welcompose
[ class tree: Welcompose ] [ index: Welcompose ] [ all elements ]

Class: Content_Page

Source Location: /content_classes/page.class.php

Class Overview




Variables

Methods



Class Details

[line 38]


[ Top ]


Class Variables

static $instance =  null

[line 45]

Singleton



Tags:

access:  public

Type:   object


[ Top ]

$base =  null

[line 52]

Reference to base class



Tags:

access:  public

Type:   object


[ Top ]



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:

access:  public


[ Top ]

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:

return:  Page id
throws:  Content_PageException
access:  public


Parameters:

array   $sqlData   Row data

[ Top ]

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:

throws:  Content_PageException
access:  public


Parameters:

int   $page   Page id
int   $page_to_apply   Page id of page contains boxes to apply

[ Top ]

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:

return:  sqlData
throws:  Content_PageException
access:  public


Parameters:

int   1   Page id of page to apply
int   $page   Page id

[ Top ]

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:

throws:  Content_PageException
access:  public


Parameters:

int   $page   Page id
bool   $protect_flag   Protect flag

[ Top ]

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:

throws:  Content_PageException
access:  public


Parameters:

array   $params   Count params

[ Top ]

method deletePage [line 166]

int deletePage( int $id)

Removes page from the page table. Takes the page id as first argument. Returns amount of affected rows



Tags:

return:  Amount of affected rows
throws:  Content_PageException
access:  public


Parameters:

int   $id   Page id

[ Top ]

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:

throws:  Content_PageException
access:  public


Parameters:

int   $page   Page id
int   $page_to_apply   Page id of page to apply

[ Top ]

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:

throws:  throw new Templating_TemplateException
access:  public


Parameters:

int   $page   Template id
array   $groups   Template set ids

[ Top ]

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:

return:  bool
throws:  Content_PageException
access:  public


Parameters:

int   $page   Page id

[ Top ]

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:

throws:  Content_PageException
access:  public


Parameters:

int   $page   page id

[ Top ]

method pageExists [line 1351]

bool pageExists( int $id)

Tests whether page exists or not. Takes the page id as first argument. Returns bool.



Tags:

throws:  Content_PageException
access:  public


Parameters:

int   $id   Page id

[ Top ]

method resolvePage [line 1285]

int resolvePage( )

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:

throws:  Content_BlogPostingException
access:  public


[ Top ]

method selectIndexPage [line 614]

array selectIndexPage( )

Selects index page. Returns array with the complete page information.



Tags:

throws:  Content_PageException
access:  public


[ Top ]

method selectPage [line 204]

array selectPage( int $id)

Selects one page. Takes the page id as first argument.

Returns array with page information.




Tags:

throws:  Content_PageException
access:  public


Parameters:

int   $id   Page id

[ Top ]

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:

throws:  Content_PageException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method selectPageToGroupsMap [line 733]

array selectPageToGroupsMap( int $page)

Selects page to groups map. Takes the page id as first argument. Returns array.



Tags:

throws:  Content_PageException
access:  public


Parameters:

int   $page   Page id

[ Top ]

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:

throws:  Content_PageException
access:  public


Parameters:

int   $target   Page id

[ Top ]

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:

return:  Affected rows
throws:  Content_PageException
access:  public


Parameters:

int   $page   Page id

[ Top ]

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:

throws:  Content_PagetypeException
access:  public


Parameters:

string   $name   Page name
int   $id   Page id

[ Top ]

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:

return:  Affected rows
throws:  Content_PageException
access:  public


Parameters:

int   $id   Page id
array   $sqlData   Row data

[ Top ]


Documentation generated on Sun, 08 Jan 2012 17:51:56 +0100 by phpDocumentor 1.4.3