Properties

$triggerWords

$triggerWords : 

Type

$parsedUrl

$parsedUrl : 

Type

$moduleKey

$moduleKey : 

Type

$pluginVersion

$pluginVersion : 

Type

$moduleType

$moduleType : 

Type

$dependencies

$dependencies : 

Type

Methods

__construct()

__construct() 

prepareData()

prepareData() : mixed

Launches the data processing step of all modules, executing their own prepareData() function

Returns

mixed

render()

render(  $mainTemplate) : mixed

Launches the rendering step of all modules, executing their own render() function

Parameters

$mainTemplate

Returns

mixed

getPathLength()

getPathLength() : integer

retreive URL path length and correct it (table has 1 element even if the path is void)

Returns

integer

getCurrentPage()

getCurrentPage() : integer

Returns the uid of the current page false if no page is found

Returns

integer

seekPage()

seekPage(  $page,   $urlPathSegmentIndex) : integer

recursively process the current page and its children looking for the segment with index $urlPathSegmentIndex Say you have the following path : /fr/products/testPage.html 'fr' will have an $urlPathSegmentIndex of 0, 'products' will have an $urlPathSegmentIndex of 1, 'testPage' will have an $urlPathSegmentIndex of 2,

The function will return the page uid having its $page->data['url_path_segment']['value'] matching the given $urlPathSegmentIndex, so if a page with uid = 31 has $page->data['url_path_segment']['value']='products', the function will return value 31 If no page is found, false is returned

Parameters

$page

page object

$urlPathSegmentIndex

the index representing the position of the seeked segment in the current path

Returns

integer —

the page uid if found a match, else false

addTrigger()

addTrigger(string  $triggerWord, string  $triggerType = 'segment', integer  $returnPageUid) 

Trigger words can be specified to the urlRewriter using this function. When a trigger word is met, the associated page Uid is called immediately.

Thus it is recommended that trigger words are met only for the required purpose in your site and not for pages unrelated to that purpose, as the trigger word would interfere with their own url rewriting.

Parameters

string $triggerWord

the trigger word to look for (ex : 'products')

string $triggerType

can be "segment" or "prefix". "segment" will attempt to match the triggerWord with the whole segment (ex:'/products/') while prefix will attempt to match a segment prefix (ex: 'products-for-your-home');

integer $returnPageUid

this page uid will be returned when the trigger word is met inside the current page path.

setPageTree()

setPageTree() 

Loads all the pages of the website and store a tree representation of the website in the $mf->info['pageTree'] and $mf->info['pagesByUid'] values This will allow quick and easy access to pages from all plugins and prevent useless SQL requests

getPageURL()

getPageURL(  $pageUid,   $appendHtmlSuffix = true) 

Parameters

$pageUid
$appendHtmlSuffix

getPageLink()

getPageLink(  $pageUid,   $class = '',   $id = '') 

Parameters

$pageUid
$class
$id

getType()

getType() : string

must return one or several plugin types separated by comas current possible values are "backend, frontend, authentification"

Returns

string —

coma separated list of current module execution context types

buildTree()

buildTree(  $mf, null  $currentPage = NULL,   $language = '') : mixed

Generates a tree of page objects. The first page is the root of the website

Parameters

$mf
null $currentPage
$language

Returns

mixed

processPageURL()

processPageURL(integer  $pageUid) : string

Recursive function retreiving all segments in the path in order to build the path

Parameters

integer $pageUid

the uid of the page to look for at the end of the path

Returns

string —

the path found