11 PageDataRouter.php

 

 デフォルトでは cmsimple/functions.php で定義されてる

$pd_router = new XH_PageDataRouter(
        $h, $page_data_fields, $temp_data, $page_data
    );

 

Class: XH_PageDataRouter Source Location: /cmsimple/classes/PageDataRouter.php

Class XH_PageDataRouter

Class Overview

Handles all the data that has to be collected to generate the page-data-array.

Located in /cmsimple/classes/PageDataRouter.php [line 29]

 
Author(s): Information Tags:
Link:   http://cmsimple-xh.org/
License:   GNU GPLv3

Properties

Methods

[ Top ]

Property Summary
array   $currentInterests   The currently registered interests. array   $current_page   The page data of the current page. object   $model   The model.

[ Top ]

Method Summary
void   XH_PageDataRouter()   Constructs an instance. void   add_interest()   Registers a field for the page data. void   add_tab()   Registers a page data tab. void   appendNewPage()   Appends a new page. string   create_tabs()   Returns the page data tab views. bool   destroy()   Deletes the page data of a single page. Returns whether that succeeded. array   find_all()   Returns the page data of all pages. array   find_field_value()   Returns an array of all pages containing $value in $field. array   find_field_value_sortkey()   Returns the sorted page data of all pages, which contain a value in a (list) field. array   find_page()   Returns the page data of a single page. array   getCurrentInterests()   Returns the currently registered interests. string   headAsPHP()   Returns the global page data arrays as a PHP tag. bool   insert()   Replaces the page data of a single page. Returns whether that succeeded. void   keep_in_mind()   Stores page data in the recycle bin. array   new_page()   Returns the page data for a new page, without actually creating the page. string   pageAsPHP()   Returns the page data of a single page as PHP tag. bool   refresh_from_menu_manager()   Updates the page data according to changes from the menumanager plugin. bool   refresh_from_texteditor()   Updates the page data according to changes from the online editor. void   removeInterest()   Unregisters a field for the page data. To permanently remove the field, one has to call XH_saveContents() subsequently. array   storedFields()   Returns all fields that are stored in the page data. bool   update()   Updates the page data of a single page and returns whether that succeeded.

[ Top ]

Properties
array   $currentInterests = array() [line 56]

The currently registered interests.

API Tags:
Access:   protected


[ Top ]
array   $current_page [line 47]

The page data of the current page.

API Tags:
Access:   protected


[ Top ]
object   $model [line 38]

The model.

API Tags:
Access:   protected


[ Top ]

Methods
Constructor XH_PageDataRouter  [line 70]

  void XH_PageDataRouter( array $h, array $pageDataFields, array $tempData, array $pageData  )

Constructs an instance.

Parameters:
array   $h:  The page headings.
array   $pageDataFields:  The page data fields.
array   $tempData:  The most recently deleted page data.
array   $pageData:  The page data.

API Tags:
Access:   public


[ Top ]
add_interest  [line 115]

  void add_interest( string $field  )

Registers a field for the page data.

Parameters:
string   $field:  The name of the page data field.

API Tags:
Access:   public


[ Top ]
add_tab  [line 156]

  void add_tab( string $tab_name, string $tab_view  )

Registers a page data tab.

Parameters:
string   $tab_name:  The title of the tab.
string   $tab_view:  The filename of the view.

API Tags:
Access:   public


[ Top ]
appendNewPage  [line 221]

  void appendNewPage( [array $params = array()]  )

Appends a new page.

Parameters:
array   $params:  Default data of the page.

API Tags:
Access:   public

Information Tags:
Since:   1.6

[ Top ]
create_tabs  [line 487]

  string create_tabs( int $s  )

Returns the page data tab views.

Parameters:
int   $s:  The index of the page.

API Tags:
Return:   The (X)HTML.
Global:   bool $edit:
Global:   string $f:
Global:   string $o:
Global:   string $su:
Global:   int $_XH_firstPublishedPage: The index of the first published page.
Access:   public


[ Top ]
destroy  [line 251]

  bool destroy( int $key  )

Deletes the page data of a single page. Returns whether that succeeded.

Parameters:
int   $key:  The index of the page.

API Tags:
Access:   public


[ Top ]
find_all  [line 187]

  array find_all( )

Returns the page data of all pages.


API Tags:
Access:   public


[ Top ]
find_field_value  [line 271]

  array find_field_value( string $field, string $value, [string $separator = null]  )

Returns an array of all pages containing $value in $field.

If $separator is given the $field will be translated to an array

  • explode($separator, $value) - before the search.
Parameters:
string   $field:  The name of the field.
string   $value:  The value to look for.
string   $separator:  The list item separator.

API Tags:
Access:   public


[ Top ]
find_field_value_sortkey  [line 299]

  array find_field_value_sortkey( string $field, string $value, string $sortKey, [int $sortFlag = null], [string $sep = null]  )

Returns the sorted page data of all pages, which contain a value in a (list) field.

Parameters:
string   $field:  The name of the field.
string   $value:  The value to look for.
string   $sortKey:  The name of the field to sort by.
int   $sortFlag:  The sort options as for array_multisort().
string   $sep:  The list item separator.

API Tags:
Access:   public


[ Top ]
find_page  [line 172]

  array find_page( int $id  )

Returns the page data of a single page.

Parameters:
int   $id:  The page index.

API Tags:
Access:   public


[ Top ]
getCurrentInterests  [line 100]

  array getCurrentInterests( )

Returns the currently registered interests.

Must not be called before all plugins have been loaded.


API Tags:
Access:   public

Information Tags:
Since:   1.6

[ Top ]
headAsPHP  [line 535]

  string headAsPHP( )

Returns the global page data arrays as a PHP tag.


API Tags:
Return:   The PHP tag.
Access:   public

Information Tags:
Since:   1.6

[ Top ]
insert  [line 237]

  bool insert( array $pages, int $index  )

Replaces the page data of a single page. Returns whether that succeeded.

Parameters:
array   $pages:  The new page data.
int   $index:  The index of the page.

API Tags:
Access:   public


[ Top ]
keep_in_mind  [line 519]

  void keep_in_mind( int $pd_s  )

Stores page data in the recycle bin.

Parameters:
int   $pd_s:  The index of the page.

API Tags:
Access:   protected


[ Top ]
new_page  [line 203]

  array new_page( [array $params = array()]  )

Returns the page data for a new page, without actually creating the page.

Parameters:
array   $params:  Default data of the page.

API Tags:
Access:   public


[ Top ]
pageAsPHP  [line 566]

  string pageAsPHP( int $id  )

Returns the page data of a single page as PHP tag.

Parameters:
int   $id:  The index of the page.

API Tags:
Return:   The PHP tag.
Access:   public

Information Tags:
Since:   1.6

[ Top ]
refresh_from_menu_manager  [line 403]

  bool refresh_from_menu_manager( string $changes  )

Updates the page data according to changes from the menumanager plugin.

Returns whether that succeeded.

Parameters:
string   $changes:  The changed page structure.

API Tags:
Access:   public

Information Tags:
Todo:   Remove sometimes in the future.

[ Top ]
refresh_from_texteditor  [line 321]

  bool refresh_from_texteditor( array $headings, int $index  )

Updates the page data according to changes from the online editor.

Returns whether that succeeded.

Parameters:
array   $headings:  The page headings contained in the current edit.
int   $index:  The page index.

API Tags:
Access:   public


[ Top ]
removeInterest  [line 136]

  void removeInterest( string $field  )

Unregisters a field for the page data. To permanently remove the field, one has to call XH_saveContents() subsequently.

Parameters:
string   $field:  A page data field name.

API Tags:
Access:   public

Information Tags:
Since:   1.6

[ Top ]
storedFields  [line 84]

  array storedFields( )

Returns all fields that are stored in the page data.


Information Tags:
Since:   1.6

[ Top ]
update  [line 460]

  bool update( int $s, array $params  )

Updates the page data of a single page and returns whether that succeeded.

Parameters:
int   $s:  The index of the page.
array   $params:  The dictionary of fields to update.

API Tags:
Access:   public


[ Top ]

Documentation generated on Tue, 30 Jun 2015 19:07:37 +0200 by phpDocumentor 1.4.4