• All Elements
Packages
  • [Backend]
  • [Implementation]
  • [Implementation]-[Backend]
  • [Plugins]
[Implementation]


  • Package Elements
  • Class Hierarchy
Classes
  • Feindura
  • FeinduraBase
Files
  • Feindura.class.php
  • FeinduraBase.class.php

feindura - Docs

  • Back to feindura.org
  • Startpage
  • Feindura Class
Welcome
Documentation
CHANGELOG | LICENSE

Quick Menu
  • Class Overview
  • Inherited Elements
  • Properties | Descriptions
  • Methods | Descriptions

Properties
  • $metaData
  • $xHtml
  • $language
  • $page
  • $category
  • $startPage
  • $startCategory
  • $linkLength
  • $linkId
  • $linkClass
  • $linkActiveClass
  • $linkAttributes
  • $linkBefore
  • $linkAfter
  • $linkBeforeText
  • $linkAfterText
  • $linkShowThumbnail
  • $linkShowThumbnailAfterText
  • $linkShowPageDate
  • $linkPageDateSeparator
  • $linkShowCategory
  • $linkCategorySeparator
  • $menuShowAllPages
  • $menuId
  • $menuClass
  • $menuAttributes
  • $titleLength
  • $titleAsLink
  • $titleShowPageDate
  • $titlePageDateSeparator
  • $titleShowCategory
  • $titleCategorySeparator
  • $thumbnailAsLink
  • $thumbnailAlign
  • $thumbnailId
  • $thumbnailClass
  • $thumbnailAttributes
  • $thumbnailBefore
  • $thumbnailAfter
  • $showErrors
  • $errorTag
  • $cachedScriptCache

Methods
  • __construct()
  • setStartPage()
  • setLanguage()
  • getLanguage()
  • getLanguageFile()
  • getLocalized()
  • createMetaTags()
  • createHref()
  • createLink()
  • createMenu()
  • createMenuByTags()
  • createMenuByDate()
  • createMenuBySortFunction()
  • isSubCategory()
  • isSubCategoryOf()
  • getParentPagesOf()
  • createSubMenu()
  • createSubMenuOfPage()
  • createSubMenuOfSubCategory()
  • createLanguageMenu()
  • createBreadCrumbsMenu()
  • showTitle()
  • showPage()
  • hasPlugins()
  • showPlugins()
  • hasTags()
  • listPages()
  • listSubPages()
  • listSubCategory()
  • listPagesByTags()
  • listPagesByDate()
  • listPagesBySortFunction()
  • startCache()
  • endCache()

Class Feindura File source: /library/classes/Feindura.class.php

Class Overview
FeinduraBase
   |
   --Feindura

Description

The class for implementing feindura - Flat File Content Management System in a website.

It's methods provide necessary functions for implementing the CMS in a website.
It contains, for example, methods for building a menu and get page contents, etc.


Additional
  • author: Fabian Vogelsteller <fabian@feindura.org>
  • copyright: Fabian Vogelsteller
  • license: GNU General Public License version 3
Version
  • 2.0
    ChangeLog
    • 2.0 add Feindura::createSubMenuOfPage(), Feindura::isSubCategory(), Feindura::isSubCategoryOf(), Feindura::createMenuOfSubCategory(), Feindura::createLanguageMenu(), Feindura::createBreadCrumbsMenu(), Feindura::hasTags(), Feindura::getLocalized(), Feindura::listSubPages(), Feindura::listSubCategory()
    • 1.0.1 add setStartPage()
    • 1.0 initial release

Class located in /library/classes/Feindura.class.php [in line 43]
Property Summary
array   $metaData   Contains metaData which can be used in the website.
bool   $xHtml   TRUE when the pages content should be handled as XHTML.
string   $language   A country code (example: de, en, ..) to set the language of the frontend language-files
int   $page   Contains the current page ID get from the $_GET variable.
int   $category   Contains the current category ID get from the $_GET variable.
int   $startPage   Contains the startpage ID from the website-settings config.
int   $startCategory   Contains the start category ID
int|false   $linkLength   The number of maximal visible characters in the link text of any link created by Feindura::createLink() or Feindura::createMenu().
string|false   $linkId   Contains an id-Attribute which will be add to any <a ...> tag of any link created by Feindura::createLink() or Feindura::createMenu().
string|false   $linkClass   Contains a class, which will be add to any <a ...> tag of any link created by Feindura::createLink() or Feindura::createMenu().
string   $linkActiveClass   This class name will be add to every link created with Feindura::createLink() or Feindura::createMenu(), when it is matching the currently selected page. When using the Feindura::createMenu() method, this class will also be add to the wrapping element of the link, like <li> or <td>.
string|false   $linkAttributes   Contains a string with attributes which will be add to any <a ...> tag of any link created by Feindura::createLink() or Feindura::createMenu().
string|false   $linkBefore   Contains a string which will be add before any <a></a> tag of any link created by Feindura::createLink() or Feindura::createMenu().
string|false   $linkAfter   Contains a string which will be add after any <a></a> tag of any link created by Feindura::createLink() or Feindura::createMenu().
string|false   $linkBeforeText   Contains a string which will be add before the link text but inside any <a></a> tag of any link created by Feindura::createLink() or Feindura::createMenu().
string|false   $linkAfterText   Contains a string which will be add after the link text but inside any <a></a> tag of any link created by Feindura::createLink() or Feindura::createMenu().
bool   $linkShowThumbnail   If TRUE and the page has a thumbnail, it places the thumbnail <img> tag inside the <a></a> tag of any link created by Feindura::createLink() or Feindura::createMenu().
bool   $linkShowThumbnailAfterText   If TRUE and the page has a thumbnail, it places the thumbnail <img> tag after the link text but inside the <a></a> tag of any link created by Feindura::createLink() or Feindura::createMenu().
bool   $linkShowPageDate   If TRUE, page dates are allowed for the pages in this category and the page has a page date then it will be add before the link text of any link created by Feindura::createLink() or Feindura::createMenu().
string   $linkPageDateSeparator   If the Feindura::$linkShowPageDate property is TRUE, this string will be used as a separator between the page date and the link text of any link created by Feindura::createLink() or Feindura::createMenu().
bool   $linkShowCategory   If TRUE, the category name of the page will be add before the link text with the Feindura::$linkCategorySpacer property as separator of any link created by Feindura::createLink() or Feindura::createMenu().
string   $linkCategorySeparator   If the Feindura::$linkShowCategory property is TRUE, this string will be used as a separator between the category name and the link text of any link created by Feindura::createLink() or Feindura::createMenu().
bool   $menuShowAllPages   If this property is TRUE, it overwrites the "show in menu" setting of all pages, so that all pages are visible in the following menus.
string|false   $menuId   Contains an id-Attribute which will be add to the menu tag created by any Feindura::createMenu() method.
string|false   $menuClass   Contains a class which will be add to the menu tag created by any Feindura::createMenu() method.
string|false   $menuAttributes   Contains string with attributes which will be add to the menu tag created by any Feindura::createMenu() method.
int|false   $titleLength   A number of maximal characters visible in the page title.
bool   $titleAsLink   If TRUE the page title is also a link to the page.
bool   $titleShowPageDate   If TRUE, page dates are allowed for the pages in this category and the page has a page date then it will be add before the page title.
string   $titlePageDateSeparator   If the Feindura::$titleShowPageDate property is TRUE, this string will be used as a separator between the page date and the page title.
bool   $titleShowCategory   If TRUE, the category name of the page will be add before the page title with the Feindura::$linkCategorySpacer property as separator.
string   $titleCategorySeparator   If the Feindura::$titleShowCategory property is TRUE, this string will be used as a separator between the category name and the page title.
bool   $thumbnailAsLink   If TRUE the page thumbnail will be wrapped with a link to the page.
string|false   $thumbnailAlign   Contains the position of the thumbnail picture, the possible values are "left", "right" or FALSE.
string|false   $thumbnailId   Contains an id-Attribute which will be add to the thumbnail <img> tag.
string|false   $thumbnailClass   Contains a class which will be add the thumbnail <img> tag.
string|false   $thumbnailAttributes   Contains a string with attributes which will be add the thumbnail <img> tag.
string|false   $thumbnailBefore   Contains a string which will be add before the thumbnail <img> tag.
string|false   $thumbnailAfter   Contains a string which will be add after the thumbnail <img> tag.
bool   $showErrors   If TRUE an error will be displayed if the requested page doesn't exists or is currently not public.
string|false   $errorTag   The tag which will be used to wrap the error message. E.g. if a pages is deactivated or doesnt exist.
array   $cachedScriptCache   Tells the Feindura::endCache() method to write the a cache file or not.
Method Summary
void   __construct()   The constructor of the class, sets all basic properties. Calls the FeinduraBase::__construct() class constructor...
void   setStartPage()   Set a page ID to the Feindura::$startPage and Feindura::$page property.
string|false   setLanguage()   Set the FeinduraBase::$language property and reloads the frontend language file. Note The country code will NOT...
string   getLanguage()   Returns the language country code which was set in the feinduraBase:__construct().
array   getLanguageFile()   Check a specific directory for files which have a language code inside the filename (see $filename parameter)....
string   getLocalized()   Gets the localized version of given $value parameter from the $localizedArray , which matches the...
string   createMetaTags()   Creates a string with basic HTML5 meta tags. See the example for a detailed list of the meta tags created. Note :...
string|false   createHref()   Generates a href attribute which links to a page. Depending whether Pretty URLs is in the administrator-settings...
string|false   createLink()   This method uses the $link... and Feindura::$thumbnail... properties. Creates a link of a page. If the given...
array   createMenu()   This method uses the $link... , $menu... and $thumbnail... properties. Creates a menu from a category(ies)...
array   createMenuByTags()   This method uses the $link... , $menu... and $thumbnail... properties. Create a menu from category(ies) or...
array   createMenuByDate()   This method uses the $link... , $menu... and $thumbnail... properties. Creates a menu from category(ies) or...
array   createMenuBySortFunction()   Alias createMenuBySort() Alias createMenuBySortCallback() Alias createMenuByCallback() This...
bool   isSubCategory()   Check if the given $category ID is a subcategory. Note : If the $category parameter is FALSE or empty, it uses...
bool   isSubCategoryOf()   Check if the given $pageId ID has the given $categoryId as a subcategory. Note : If the $pageID parameter...
array|false   getParentPagesOf()   Loads the parent pages of a subcategory. Note : If the $categoryId parameter is FALSE or empty, it uses the...
array   createSubMenu()   This method uses the $link... , $menu... and $thumbnail... properties. Creates a sub menu from the current...
array   createSubMenuOfPage()   This method uses the $link... , $menu... and $thumbnail... properties. Creates a sub menu out of the...
array   createSubMenuOfSubCategory()   Alias createSubMenuOfCategory() Alias createSubMenuFromSubCategory() Alias createSubMenuFromCategory()...
array   createLanguageMenu()   This method uses the $link... , $menu... properties. Creates a menu as language selection for the multi...
array   createBreadCrumbsMenu()   Alias createBreadCrumbMenu() Alias createBreadCrumbs() Alias createBreadCrumb() This method uses the...
string   showTitle()   This method uses the $title... properties. Returns the title of a page. This page title will be generated...
array   showPage()   This method uses the $error... , $title... and $thumbnail... properties. Returns an array which contains all...
bool   hasPlugins()   Alias hasPlugin() Alias isPlugins() Alias isPlugin() Check whether the given plugin(s) are activated for...
array|string|false   showPlugins()   Returns the plugin(s) of a page ready for displaying in a HTML page. It can return an array where each element...
array|false   hasTags()   Load the $pagesMetaData array of pages which have one or more tags from the given $tags parameter. Can be used...
array   listPages()   This method uses the $error... , $title... and $thumbnail... properties. List pages by given category(ies)...
array   listSubPages()   This method uses the $error... , $title... and $thumbnail... properties. List pages of the subcategory of a...
array   listSubCategory()   This method uses the $error... , $title... and $thumbnail... properties. List the pages of a subcategory....
array   listPagesByTags()   This method uses the $error... , $title... and $thumbnail... properties. List pages by given category(ies)...
array   listPagesByDate()   This method uses the $error... , $title... and $thumbnail... properties. List pages by given a category(ies)...
array   listPagesBySortFunction()   Alias listPagesBySort() Alias listPagesBySortCallback() Alias listPagesByCallback() This...
bool   startCache()   This method can cache parts of your script, to speed up page loading time. You need to call Feindura::endCache()...
void   endCache()   This method writes the cache, which was started with Feidnura::startCache(). It will save the last started cache....
Properties
array $metaData = array()

Default value

array()

Description

Contains metaData which can be used in the website.

Example of the array
Show Example

  1. <?php
  2.  
  3. $metaData['title']       = 'My Website Title';
  4. $metaData['publisher']   = 'Max Mustermann';
  5. $metaData['copyright']   = 'XY Company';
  6. $metaData['keywords']    = 'keyword1,keyword2,keyword3';
  7. $metaData['description'] = 'This is a example website.';
  8.  
  9. ?>


Additional
  • access: public

bool $xHtml = false

Default value

false

Description

TRUE when the pages content should be handled as XHTML.

In XHTML standalone tags end with " />" instead of ">".
Therefor when a page content is displayed and this property is FALSE all " />" will be changed to ">".


Additional
  • access: public
Used By
  • FeinduraBase::generatePage()
  • Feindura::showPage()
  • Feindura::listPages()
  • Feindura::listSubPages()
  • Feindura::listSubCategory()
  • Feindura::listPagesByTags()
  • Feindura::listPagesByDate()
  • Feindura::listPagesBySortFunction()

string $language = 'en'

Default value

'en'

Description

A country code (example: de, en, ..) to set the language of the frontend language-files

This country code is used to include the right frontend language-file. The frontend language-file is used when displaying page warnings or errors and additional texts like "more", etc.
This property will be set in the Feindura::__construct() constructor.

The standard value is "en" (english).


Additional
  • see: FeinduraBase::$languageFile
  • see: Feindura::__construct()
  • access: public
Used By
  • Feindura::getLanguageFile() - to be loaded if no <var>$currentLangCode</var> parameter is given
  • Feindura::getLocalized() - the language used to get the localized version

int $page = null

Default value

null

Description

Contains the current page ID get from the $_GET variable.

This property is used when a page loading method is called (for example: Feindura::showPage()) and no page ID parameter is given.

This property will be set in the Feindura::__construct() constructor through the FeinduraBase::setCurrentPageId() method.


Additional
  • see: Feindura::__construct()
  • see: FeinduraBase::getCurrentPageId()
  • access: public
Used By
  • FeinduraBase::setCurrentPageId() - as the property to set
  • FeinduraBase::generatePage()
  • Feindura::createMetaTags() - to load the page title of the right page
  • Feindura::showPage()
  • Feindura::hasPlugins()
  • Feindura::showPlugins()
  • Feindura::setStartPage()

int $category = null

Default value

null

Description

Contains the current category ID get from the $_GET variable.

This property is used when a page-loading method is called (for example: Feindura::showPage()) and no category ID parameter is given.

This property will be set in the Feindura::__construct() constructor through the FeinduraBase::setCurrentCategoryId() method.


Additional
  • see: Feindura::__construct()
  • see: FeinduraBase::getCurrentCategoryId()
  • access: public
Used By
  • FeinduraBase::setCurrentCategoryId() - as the property to set
  • Feindura::createMetaTags() - to load the page title of the right page
  • Feindura::isSubCategory()
  • Feindura::isSubCategoryOf()
  • Feindura::getParentPagesOf()

int $startPage = null

Default value

null

Description

Contains the startpage ID from the website-settings config.

This property is set to the Feindura::$page property when the $_GET page variable and the Feindura::$page property is empty and setting a startpage is activated in the page-settings.

This property will be set in the Feindura::__construct() constructor through the FeinduraBase::setCurrentPageId() method.


Additional
  • see: Feindura::$page
  • see: Feindura::__construct()
  • see: FeinduraBase::setCurrentPageId()
  • see: FeinduraBase::getCurrentPageId()
  • access: public
Used By
  • FeinduraBase::setCurrentPageId() - if the $setStartPage parameter is TRUE this property will also be set
  • Feindura::setStartPage()

int $startCategory = null

Default value

null

Description

Contains the start category ID

Its fetched from the Feindura::$startPage through the GeneralFunctions::getPageCategory() method.
This property is set to the Feindura::$category property when the $_GET category variable and the Feindura::$category property is empty and setting a startpage is activated in the page-settings.

This property will be set in the Feindura::__construct() constructor through the FeinduraBase::setCurrentCategoryId() method.


Additional
  • see: Feindura::$startPage
  • see: Feindura::$category
  • see: Feindura::__construct()
  • see: FeinduraBase::setCurrentCategoryId()
  • see: FeinduraBase::getCurrentCategoryId()
  • access: public
Used By
  • FeinduraBase::getCurrentCategoryId() - if no $_GET variable exists it will try to get the Feindura::$startCategory property
  • FeinduraBase::setCurrentCategoryId() - if the $setStartCategory parameter is TRUE this property will also be set

int|false $linkLength = false

Default value

false

Description

The number of maximal visible characters in the link text of any link created by Feindura::createLink() or Feindura::createMenu().

The link text will be shorten to the last complete word.

For example the following string will be shorten to a $linkLength of "30": "Example Category -> Example Page Title" => "Example Category -> Example..."


Additional
  • var: a number of characters, or FALSE to don't shorten the link text.
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • example: example
  • access: public
Used By
  • Feindura::createLink()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createLanguageMenu()
  • Feindura::createBreadCrumbsMenu()

string|false $linkId = false

Default value

false

Description

Contains an id-Attribute which will be add to any <a ...> tag of any link created by Feindura::createLink() or Feindura::createMenu().

Note: You should set a unique id-Attribute only once to elements in a HTML page, if you set this property and call Feindura::createMenu() every link in the menu will get this id-Attribute.


Additional
  • var: If no id-Attribute should be add, set it to FALSE.
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • example: example
  • access: public
Used By
  • Feindura::createLink()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createLanguageMenu()
  • Feindura::createBreadCrumbsMenu()

string|false $linkClass = false

Default value

false

Description

Contains a class, which will be add to any <a ...> tag of any link created by Feindura::createLink() or Feindura::createMenu().

You can also add multiple classes, just separate the classes with spaces. 'class1 class2'

Note: If you set this property and call Feindura::createMenu() every link in the menu will get this class-Attribute.


Additional
  • var: If no class-Attribute should be add, set it to FALSE.
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • example: example
  • access: public
Used By
  • Feindura::createLink()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createLanguageMenu()
  • Feindura::createBreadCrumbsMenu()

string $linkActiveClass = 'active'

Default value

'active'

Description

This class name will be add to every link created with Feindura::createLink() or Feindura::createMenu(), when it is matching the currently selected page. When using the Feindura::createMenu() method, this class will also be add to the wrapping element of the link, like <li> or <td>.


Additional
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • example: example
  • access: public
Used By
  • Feindura::createLink()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createLanguageMenu()
  • Feindura::createBreadCrumbsMenu()

string|false $linkAttributes = false

Default value

false

Description

Contains a string with attributes which will be add to any <a ...> tag of any link created by Feindura::createLink() or Feindura::createMenu().

Note: If you set this property and call Feindura::createMenu() every link in the menu will get this attributes string.

The string should have the following format 'key1="value" key2="value"'


Additional
  • var: If no additional attributes should be add, set it to FALSE.
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • example: example
  • access: public
Used By
  • Feindura::createLink()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createLanguageMenu()
  • Feindura::createBreadCrumbsMenu()

string|false $linkBefore = false

Default value

false

Description

Contains a string which will be add before any <a></a> tag of any link created by Feindura::createLink() or Feindura::createMenu().

Note: If you set this property and call Feindura::createMenu() every link in the menu will get this string.


Additional
  • var: If no text should be add before a link, set it to FALSE.
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • example: example
  • access: public
Used By
  • Feindura::createLink()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createLanguageMenu()
  • Feindura::createBreadCrumbsMenu()

string|false $linkAfter = false

Default value

false

Description

Contains a string which will be add after any <a></a> tag of any link created by Feindura::createLink() or Feindura::createMenu().

Note: If you set this property and call Feindura::createMenu() every link in the menu will get this string.


Additional
  • var: If no text should be add after a link, set it to FALSE.
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • example: example
  • access: public
Used By
  • Feindura::createLink()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createLanguageMenu()
  • Feindura::createBreadCrumbsMenu()

string|false $linkBeforeText = false

Default value

false

Description

Contains a string which will be add before the link text but inside any <a></a> tag of any link created by Feindura::createLink() or Feindura::createMenu().

Note: If you set this property and call Feindura::createMenu() every link in the menu will get this string.


Additional
  • var: If no text should be add before a link text, set it to FALSE.
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • example: example
  • access: public
Used By
  • Feindura::createLink()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createLanguageMenu()
  • Feindura::createBreadCrumbsMenu()

string|false $linkAfterText = false

Default value

false

Description

Contains a string which will be add after the link text but inside any <a></a> tag of any link created by Feindura::createLink() or Feindura::createMenu().

Note: If you set this property and call Feindura::createMenu() every link in the menu will get this string.


Additional
  • var: If no text should be add after a link text, set it to FALSE.
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • example: example
  • access: public
Used By
  • Feindura::createLink()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createLanguageMenu()
  • Feindura::createBreadCrumbsMenu()

bool $linkShowThumbnail = false

Default value

false

Description

If TRUE and the page has a thumbnail, it places the thumbnail <img> tag inside the <a></a> tag of any link created by Feindura::createLink() or Feindura::createMenu().


Additional
  • var: Set it to FALSE to don't show the thumbnails in links
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • example: example
  • access: public
Used By
  • Feindura::createLink()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createBreadCrumbsMenu()

bool $linkShowThumbnailAfterText = false

Default value

false

Description

If TRUE and the page has a thumbnail, it places the thumbnail <img> tag after the link text but inside the <a></a> tag of any link created by Feindura::createLink() or Feindura::createMenu().


Additional
  • var: Set it to TRUE to place the thumbnail <img> tag after the link text
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • example: example
  • access: public
Used By
  • Feindura::createLink()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createBreadCrumbsMenu()

bool $linkShowPageDate = false

Default value

false

Description

If TRUE, page dates are allowed for the pages in this category and the page has a page date then it will be add before the link text of any link created by Feindura::createLink() or Feindura::createMenu().

If the Feindura::$linkShowCategory property is TRUE, the page date is placed between the category name + separator and the link text.
The page date will be added with the page before-date-text and after-date-text from the page editor in the backend

Note: The page date will only be displayed if the $linkText parameter of Feindura::createLink() or Feindura::createMenu() methods is TRUE and not a string.

Example: <a href="?page=2" ...>200-12-31 Page Title</a>


Additional
  • var: Set it to TRUE to place the page date before the link text
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • example: example
  • access: public
Used By
  • Feindura::createLink()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createBreadCrumbsMenu()

string $linkPageDateSeparator = ' '

Default value

' '

Description

If the Feindura::$linkShowPageDate property is TRUE, this string will be used as a separator between the page date and the link text of any link created by Feindura::createLink() or Feindura::createMenu().

Note: If you set this property and call Feindura::createMenu() every link in the menu will use this separator.


Additional
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • example: example
  • access: public
Used By
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createBreadCrumbsMenu()

bool $linkShowCategory = false

Default value

false

Description

If TRUE, the category name of the page will be add before the link text with the Feindura::$linkCategorySpacer property as separator of any link created by Feindura::createLink() or Feindura::createMenu().

The category name will only be displayed if the $linkText parameter of Feindura::createLink() or Feindura::createMenu() methods is TRUE and not a string.

Example: <a href="?page=2" ...>Catgory Name: Page Title</a>


Additional
  • var: Set it to TRUE to place the category name before the link text
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • example: example
  • access: public
Used By
  • Feindura::createLink()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createBreadCrumbsMenu() - This is set to FALSE for all links, which are in a sub category (So the sub category name doesn't appear). You can change the separator between the category and the page name by setting the Feindura::$linkCategorySeparator

string $linkCategorySeparator = ': '

Default value

': '

Description

If the Feindura::$linkShowCategory property is TRUE, this string will be used as a separator between the category name and the link text of any link created by Feindura::createLink() or Feindura::createMenu().

Note: If you set this property and call Feindura::createMenu() every link in the menu will use this separator.


Additional
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • example: example
  • access: public
Used By
  • Feindura::createLink()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createBreadCrumbsMenu()

bool $menuShowAllPages = false

Default value

false

Description

If this property is TRUE, it overwrites the "show in menu" setting of all pages, so that all pages are visible in the following menus.


Additional
  • see: Feindura::createMenu()
  • example: example
  • access: public

string|false $menuId = false

Default value

false

Description

Contains an id-Attribute which will be add to the menu tag created by any Feindura::createMenu() method.

Notice: You can also add the ID, classes and attributes directly to a specific menu using the $menuTag parameter. See the $menuTag parameter of the Feindura::createMenu() method for details. Notice: This id-Attribute will only be add, if the $menuTag parameter in the Feindura::createMenu() method is not FALSE.
Notice: You can only set one specific id-Attribute to elements in a HTML page.


Additional
  • var: If no id-Attribute should be add, set it to FALSE.
  • see: Feindura::createMenu()
  • example: example
  • access: public
Used By
  • FeinduraBase::generateMenu()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createLanguageMenu()
  • Feindura::createBreadCrumbsMenu()

string|false $menuClass = false

Default value

false

Description

Contains a class which will be add to the menu tag created by any Feindura::createMenu() method.

You can also add multiple classes, just separate the classes with spaces. 'class1 class2'

Notice: You can also add the ID, classes and attributes directly to a specific menu using the $menuTag parameter. See the $menuTag parameter of the Feindura::createMenu() method for details. Note: This class-Attribute will only be add, if the $menuTag parameter in the Feindura::createMenu() method is not FALSE.


Additional
  • var: If no class-Attribute should be add, set it to FALSE.
  • see: Feindura::createMenu()
  • example: example
  • access: public
Used By
  • FeinduraBase::generateMenu()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createLanguageMenu()
  • Feindura::createBreadCrumbsMenu()

string|false $menuAttributes = false

Default value

false

Description

Contains string with attributes which will be add to the menu tag created by any Feindura::createMenu() method.

Notice: You can also add the ID, classes and attributes directly to a specific menu using the $menuTag parameter. See the $menuTag parameter of the Feindura::createMenu() method for details. Note: This string with attributes will only be add, if the $menuTag parameter in the Feindura::createMenu() method is not FALSE.

The string should have the following format 'key1="value" key2="value"'


Additional
  • var: If no additional attributes should be add, set it to FALSE.
  • see: Feindura::createMenu()
  • example: example
  • access: public
Used By
  • FeinduraBase::generateMenu()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createLanguageMenu()
  • Feindura::createBreadCrumbsMenu()

int|false $titleLength = false

Default value

false

Description

A number of maximal characters visible in the page title.

The page title will be shorten to the last complete word.

For example the following string will be shorten to a $titleLength of "30": "Example Category -> Example Page Title" => "Example Category -> Example..."


Additional
  • var: Number of characters or FALSE to don't shorten the page title
  • see: Feindura::getTitle()
  • see: FeinduraBase::createTitle()
  • example: example
  • access: public
Used By
  • FeinduraBase::generatePage()
  • Feindura::showTitle()
  • Feindura::showPage()
  • Feindura::listPages()
  • Feindura::listSubPages()
  • Feindura::listSubCategory()
  • Feindura::listPagesByTags()
  • Feindura::listPagesByDate()
  • Feindura::listPagesBySortFunction()

bool $titleAsLink = false

Default value

false

Description

If TRUE the page title is also a link to the page.


Additional
  • see: Feindura::getTitle()
  • see: FeinduraBase::createTitle()
  • example: example
  • access: public
Used By
  • FeinduraBase::generatePage()
  • Feindura::showTitle()
  • Feindura::showPage()
  • Feindura::listPages()
  • Feindura::listSubPages()
  • Feindura::listSubCategory()
  • Feindura::listPagesByTags()
  • Feindura::listPagesByDate()
  • Feindura::listPagesBySortFunction()

bool $titleShowPageDate = false

Default value

false

Description

If TRUE, page dates are allowed for the pages in this category and the page has a page date then it will be add before the page title.

If the Feindura::$titleShowCategory property is TRUE, the page date is placed between the category name + separator and the page title.
The page date will be added with the page before-date-text and after-date-text from the page editor in the backend.

Example: Catgory Name: 200-12-31 Page Title


Additional
  • var: Set it to TRUE to place the page date before the page title
  • see: Feindura::getTitle()
  • see: FeinduraBase::createTitle()
  • example: example
  • access: public
Used By
  • FeinduraBase::generatePage()
  • Feindura::showTitle()
  • Feindura::showPage()
  • Feindura::listPages()
  • Feindura::listSubPages()
  • Feindura::listSubCategory()
  • Feindura::listPagesByTags()
  • Feindura::listPagesByDate()
  • Feindura::listPagesBySortFunction()

string $titlePageDateSeparator = ' '

Default value

' '

Description

If the Feindura::$titleShowPageDate property is TRUE, this string will be used as a separator between the page date and the page title.


Additional
  • see: Feindura::getTitle()
  • see: FeinduraBase::createTitle()
  • example: example
  • access: public
Used By
  • Feindura::showPage()

bool $titleShowCategory = false

Default value

false

Description

If TRUE, the category name of the page will be add before the page title with the Feindura::$linkCategorySpacer property as separator.

Example: Catgory Name: Page Title


Additional
  • var: Set it to TRUE to place the category name before the page title
  • see: Feindura::getTitle()
  • see: FeinduraBase::createTitle()
  • example: example
  • access: public
Used By
  • FeinduraBase::generatePage()
  • Feindura::showTitle()
  • Feindura::showPage()
  • Feindura::listPages()
  • Feindura::listSubPages()
  • Feindura::listSubCategory()
  • Feindura::listPagesByTags()
  • Feindura::listPagesByDate()
  • Feindura::listPagesBySortFunction()

string $titleCategorySeparator = ': '

Default value

': '

Description

If the Feindura::$titleShowCategory property is TRUE, this string will be used as a separator between the category name and the page title.


Additional
  • see: Feindura::getTitle()
  • see: FeinduraBase::createTitle()
  • example: example
  • access: public
Used By
  • FeinduraBase::generatePage()
  • Feindura::showTitle()
  • Feindura::showPage()
  • Feindura::listPages()
  • Feindura::listSubPages()
  • Feindura::listSubCategory()
  • Feindura::listPagesByTags()
  • Feindura::listPagesByDate()
  • Feindura::listPagesBySortFunction()

bool $thumbnailAsLink = false

Default value

false

Description

If TRUE the page thumbnail will be wrapped with a link to the page.


Additional
  • see: Feindura::showPage()
  • see: FeinduraBase::createThumbnail()
  • access: public

string|false $thumbnailAlign = false

Default value

false

Description

Contains the position of the thumbnail picture, the possible values are "left", "right" or FALSE.

If the values are "left" or "right" a style-attribute will be add to the thumbnail <img> tag with "float:left/right;".

Note: If you set this property, you can't add any style attribute with the Feindura::$thumbnailAttributes property anymore, it would not be used by the browser.

<img src="/path/image.png" ... style="float:left;" />


Additional
  • var: If no style="float:left/right;" attribute should be add, set it to FALSE.
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • see: Feindura::showPage()
  • see: FeinduraBase::generatePage()
  • example: example
  • access: public
Used By
  • FeinduraBase::generatePage()
  • Feindura::createLink()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createBreadCrumbsMenu()
  • Feindura::showPage()
  • Feindura::listPages()
  • Feindura::listSubPages()
  • Feindura::listSubCategory()
  • Feindura::listPagesByTags()
  • Feindura::listPagesByDate()
  • Feindura::listPagesBySortFunction()

string|false $thumbnailId = false

Default value

false

Description

Contains an id-Attribute which will be add to the thumbnail <img> tag.

Note: You can only set one specific id-Attribute to elements in a HTML page.


Additional
  • var: If no id-Attribute should be add, set it to FALSE.
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • see: Feindura::showPage()
  • see: FeinduraBase::generatePage()
  • example: example
  • access: public
Used By
  • FeinduraBase::generatePage()
  • Feindura::createLink()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createBreadCrumbsMenu()
  • Feindura::showPage()
  • Feindura::listPages()
  • Feindura::listSubPages()
  • Feindura::listSubCategory()
  • Feindura::listPagesByTags()
  • Feindura::listPagesByDate()
  • Feindura::listPagesBySortFunction()

string|false $thumbnailClass = false

Default value

false

Description

Contains a class which will be add the thumbnail <img> tag.

You can also add multiple classes, just separate the classes with spaces. 'class1 class2'


Additional
  • var: If no class-Attribute should be add, set it to FALSE.
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • see: Feindura::showPage()
  • see: FeinduraBase::generatePage()
  • example: example
  • access: public
Used By
  • FeinduraBase::generatePage()
  • Feindura::createLink()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createBreadCrumbsMenu()
  • Feindura::showPage()
  • Feindura::listPages()
  • Feindura::listSubPages()
  • Feindura::listSubCategory()
  • Feindura::listPagesByTags()
  • Feindura::listPagesByDate()
  • Feindura::listPagesBySortFunction()

string|false $thumbnailAttributes = false

Default value

false

Description

Contains a string with attributes which will be add the thumbnail <img> tag.

The string should have the following format 'key1="value" key2="value"'


Additional
  • var: If no additional attributes should be add, set it to FALSE.
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • see: Feindura::showPage()
  • see: FeinduraBase::generatePage()
  • example: example
  • access: public
Used By
  • FeinduraBase::generatePage()
  • Feindura::createLink()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createBreadCrumbsMenu()
  • Feindura::showPage()
  • Feindura::listPages()
  • Feindura::listSubPages()
  • Feindura::listSubCategory()
  • Feindura::listPagesByTags()
  • Feindura::listPagesByDate()
  • Feindura::listPagesBySortFunction()

string|false $thumbnailBefore = false

Default value

false

Description

Contains a string which will be add before the thumbnail <img> tag.


Additional
  • var: If no string should be add before the thumbnail <img> tag, set it to FALSE.
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • see: Feindura::showPage()
  • see: FeinduraBase::generatePage()
  • example: example
  • access: public
Used By
  • FeinduraBase::generatePage()
  • Feindura::createLink()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createBreadCrumbsMenu()
  • Feindura::showPage()
  • Feindura::listPages()
  • Feindura::listSubPages()
  • Feindura::listSubCategory()
  • Feindura::listPagesByTags()
  • Feindura::listPagesByDate()
  • Feindura::listPagesBySortFunction()

string|false $thumbnailAfter = false

Default value

false

Description

Contains a string which will be add after the thumbnail <img> tag.


Additional
  • var: If no string should be add after the thumbnail <img> tag, set it to FALSE.
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • see: Feindura::showPage()
  • see: FeinduraBase::generatePage()
  • example: example
  • access: public
Used By
  • FeinduraBase::generatePage()
  • Feindura::createLink()
  • Feindura::createMenu()
  • Feindura::createMenuByTags()
  • Feindura::createMenuByDate()
  • Feindura::createMenuBySortFunction()
  • Feindura::createSubMenu()
  • Feindura::createSubMenuOfPage()
  • Feindura::createSubMenuOfSubCategory()
  • Feindura::createBreadCrumbsMenu()
  • Feindura::showPage()
  • Feindura::listPages()
  • Feindura::listSubPages()
  • Feindura::listSubCategory()
  • Feindura::listPagesByTags()
  • Feindura::listPagesByDate()
  • Feindura::listPagesBySortFunction()

bool $showErrors = true

Default value

true

Description

If TRUE an error will be displayed if the requested page doesn't exists or is currently not public.

Example: <span>The requested page is currently not available.</span>


Additional
  • see: Feindura::showPage()
  • see: FeinduraBase::generatePage()
  • example: example
  • access: public
Used By
  • FeinduraBase::generatePage()
  • Feindura::showPage()
  • Feindura::listPages()
  • Feindura::listSubPages()
  • Feindura::listSubCategory()
  • Feindura::listPagesByTags()
  • Feindura::listPagesByDate()
  • Feindura::listPagesBySortFunction()

string|false $errorTag = ''

Default value

''

Description

The tag which will be used to wrap the error message. E.g. if a pages is deactivated or doesnt exist.

Note: You can add simple Zen Code selectors to this string to add id, classes and attributes. E.g. "div#myId.myClass1.myClass2[attribute1=value][attribute2=value]" converts to <div id="myId" class="myClass1 myClass2" attribute1="value" attribute2="value">

Example:
Show Example

  1.  <?php
  2.  
  3.  // assume we have already created an instance of feindura
  4.  $feindura->errorTag = 'div.errorMessage';
  5.  
  6.  ?>
  7.  
  8.  <!-- Will look like this if an error occours -->
  9.  
  10.  <div class="errorMessage">The requested page is currently not available.</div>


Additional
  • var: If no tag should be add, set it to FALSE.
  • see: Feindura::showPage()
  • see: FeinduraBase::generatePage()
  • example: example
  • access: public
Used By
  • FeinduraBase::generatePage()
  • Feindura::showPage()
  • Feindura::listPages()
  • Feindura::listSubPages()
  • Feindura::listSubCategory()
  • Feindura::listPagesByTags()
  • Feindura::listPagesByDate()
  • Feindura::listPagesBySortFunction()

array $cachedScriptCache = false

Default value

false

Description

Tells the Feindura::endCache() method to write the a cache file or not.


Additional
  • see: Feindura::startCache()
  • see: Feindura::endCache()
  • access: protected

Methods
File source:
line 831
void Constructor __construct ( [string $language = false])

Parameters

string $language (optional) A country code like "de", "en", ... to load the right frontend language-file and is set to the FeinduraBase::$language property
Default false

Redefinition of:
FeinduraBase::__construct()
Type constructor

Description

Type constructor

The constructor of the class, sets all basic properties.

Calls the FeinduraBase::__construct() class constructor to set all necessary properties Fetch the $_GET variable (if existing) and set it to the Feindura::$page and Feindura::$category properties.
If there is no page and category ID it sets the start page ID from the website-settings config.

Example:
Show Example

  1. <?php
  2.  
  3. // a session will be started in the "feindura.include.php",
  4. // therefor you have to include this file before the header of the HTML page is sent,
  5. // which means before any HTML Tag.
  6. require('cms/feindura.include.php');
  7.  
  8. // creates a new Feindura instance
  9. $feindura = new Feindura();
  10.  
  11. ?>
  12. <!DOCTYPE html>
  13. <html>
  14. ...


Additional
  • see: FeinduraBase::__construct()
  • access: public
Uses
  • FeinduraBase::__construct() - the constructor of the parent class to load all necessary properties
  • FeinduraBase::setCurrentCategoryId() - to set the fetched category ID from the $_GET variable to the Feindura::$category property
  • FeinduraBase::setCurrentPageId() - to set the fetched page ID from the $_GET variable to the Feindura::$page property
Version
  • 1.3
    ChangeLog
    • 1.3 add set timezone from the backend as default timezone
    • 1.2 changed the name of $_SESSION['feinduraSession']['websiteLanguage'] to $_SESSION['feinduraSession']['language'], so it differs from the backend version
    • 1.1 fixed language detection
    • 1.0 initial release

File source:
line 935
void setStartPage ( int $pageId)

Parameters

int $pageId the page ID to set

Description

Name setStartPage()

Set a page ID to the Feindura::$startPage and Feindura::$page property.


Additional
  • access: public
Uses
  • Feindura::$startPage
  • Feindura::$page
  • GeneralFunctions::getPageCategory() - to get the category of the page
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 968
string|false setLanguage ( string $language)

Parameters

string $language a language country code like "en", "de", ...

Description

Name setLanguage()

Set the FeinduraBase::$language property and reloads the frontend language file.

Note The country code will NOT set to any $_SESSION variable, you have to take care of this yourself.


Return Value
  • string|false - the language country code or FALSE if the given $language parameter is no country code
Additional
  • see: FeinduraBase::__construct()
  • access: public
Uses
  • FeinduraBase::$language - the language country code like "en", "de", ... which will be returned
  • FeinduraBase::$metaData - to change it to the new language
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 1006
string getLanguage ( )

Description

Name getLanguage()

Returns the language country code which was set in the feinduraBase:__construct().


Return Value
  • string - the language country code
Additional
  • see: feindura()
  • see: FeinduraBase::__construct()
  • access: public
Uses
  • FeinduraBase::$language - the language country code like "en", "de", ... which will be returned
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 1043
array getLanguageFile ( [string|false $langPath = false],
[string $filename = '%lang%.php'],
[string|false &$currentLangCode = false],
[bool $standardLang = 'en'])

Parameters

string|false $langPath (optional) a absolut path to look for a language file which fit the $filename parameter or FALSE to use the "feindura-cms/library/languages" folder
Default false
string $filename (optional) the structure of the filename, which should be loaded. the "%lang%" will be replaced with the country code like "%lang%.backend.php" -> "en.backend.php"
Default '%lang%.php'
string|false &$currentLangCode (optional) (Note: this variable will also be changed outside of this method) a variable with the current language code, if this is set it will be first try to load this language file, when it couldn't find a language file which fits the browsers language code.
Default false
bool $standardLang (optional) a standard language for use if no match was found
Default 'en'

Description

Name getLanguageFile()

Check a specific directory for files which have a language code inside the filename (see $filename parameter). When a matching file is found it includes these and return it. If no match could be found it try to find a file with the browser language code, if the $currentLangCode is empty it uses the Feindura::$language property.

Example of a language file
Show Example

  1. <?php
  2.  
  3. $langFile['SEARCH_TITLE'] = 'Search';
  4. $langFile['TITLE_NEWS']   = 'What\'s new';
  5. ...
  6.  
  7. return $langFile;
  8.   
  9. ?>

Used Constants

  • DOCUMENTROOT the absolut path of the webserver


Return Value
  • array - the loaded language file array or an empty array
Additional
  • see: GeneralFunctions::loadLanguageFile()
  • access: public
Uses
  • GeneralFunctions::loadLanguageFile() - to load the right language file
  • Feindura::$language - to be loaded if no <var>$currentLangCode</var> parameter is given
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 1105
string getLocalized ( array $localizedArray,
string $value,
[string|false $language = false])

Parameters

array $localizedArray an array with an ['localized'] array in the form of: array('de' => .. , 'en' => .. )
string $value the name of the value, which should be returned localized
string|false $language (optional) a language code ("en","de", etc) to use for loading the localized version of the given $value paramter
Default false

Description

Name getLocalized()
Alias getLocalization()

Gets the localized version of given $value parameter from the $localizedArray, which matches the Feindura::$language property.
If no matching localized version for this language exists, it returns the "mainLanguage" or the first one in the localization array.

Example usage:
Show Example

  1.  <?php
  2.  
  3.  require_once('cms/feindura.include.php');
  4.  $feindura = new Feindura();
  5.  
  6.  // For example, you can use this function to get the name of a category (for the current language)
  7.  echo $feindura->getLocalized($feindura->categoryConfig[1],'name');
  8.  
  9.  // RESULT
  10.  // Name of the Category with ID 1
  11.  
  12.  ?>


Return Value
  • string - the localized version of the $value parameter
Additional
  • see: FeinduraBase::$websiteConfig
  • see: FeinduraBase::$categoryConfig
  • access: public
Uses
  • GeneralFunctions::getLocalized() - to get the right localization
  • Feindura::$language - the language used to get the localized version
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 1154
string createMetaTags ( [string|false $author = false],
[bool $openGraph = true],
[bool $googleSnippets = true])

Parameters

string|false $author (optional) the author of the website
Default false
bool $openGraph (optional) if TRUE it add the following open graph meta tags: "og:site_name", "og:url", "og:title", "og:description" and "og:image", you should add ( prefix="og: http://ogp.me/ns#" ) to the <html> tag, like this <html prefix="og: http://ogp.me/ns#">
Default true
bool $googleSnippets (optional) if TRUE it add the following google snippets meta tags: "url", "name", "description" and "image"
Default true

Description

Name createMetaTags()
Alias createMetaTag()

Creates a string with basic HTML5 meta tags. See the example for a detailed list of the meta tags created.

Note: You have to call this method in the <head> tags of your website, to enable the frontend editing feature.
Note: This method also adds the Feed tags.

Example:
Show Example

  1. <?php
  2. /*                               *** CODE *** 
  3. --------------------------------------------------------------------------------
  4. */
  5.  
  6. // a session will be started in the "feindura.include.php",
  7. // therefor you have to include this file before the header of the HTML page is sent,
  8. // which means before any HTML Tag.
  9. require('cms/feindura.include.php');
  10.  
  11. // creates a new Feindura instance
  12. $feindura = new Feindura();
  13.  
  14. // start to write HTML page
  15. ?>
  16. <!DOCTYPE html>
  17.   <html>
  18.   <head>';
  19.   <?php
  20.     // John Doe is the author of the website.
  21.     echo $feindura->createMetaTags('John Doe');
  22.   ?>
  23.   </head>
  24.   <body>
  25.   ...
  26.  
  27.  
  28. <?php                               *** RESULT *** 
  29. --------------------------------------------------------------------------------
  30.  
  31. <!DOCTYPE html>
  32. <html>
  33. <head>
  34.  
  35.   <meta charset="UTF-8">
  36.   <title>Welcome - An Example Website</title>
  37.  
  38.   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <!-- enable google chrome frame, if available -->
  39.  
  40.   <meta name="author" content="Max Musterman">
  41.   <meta name="publisher" content="Somebody From the Backend">
  42.   <meta name="copyright" content="Somebody From the Backend">
  43.   <meta name="generator" content="feindura - Flat File CMS 1.2 build:999">
  44.  
  45.   <link rel="alternate" type="application/atom+xml" title="Eine Beispiel Website (Atom, DE)" href="http://localhost/cms/pages/atom.de.xml">
  46.   <link rel="alternate" type="application/rss+xml" title="Eine Beispiel Website (RSS 2.0, DE)" href="http://localhost/cms/pages/rss2.de.xml">
  47.   <link rel="alternate" type="application/atom+xml" title="An Example Website (Atom, EN)" href="http://localhost/cms/pages/atom.en.xml">
  48.   <link rel="alternate" type="application/rss+xml" title="An Example Website (RSS 2.0, EN)" href="http://localhost/cms/pages/rss2.en.xml">
  49.  
  50.   <link rel="stylesheet" type="text/css" href="/cms/plugins/contactForm/css/style.css">
  51.   <link rel="stylesheet" type="text/css" href="/cms/plugins/imageGallery/milkbox/css/milkbox.css">
  52.   <link rel="stylesheet" type="text/css" href="/cms/plugins/imageGallery/milkbox copy/css/milkbox.css">
  53.  
  54. </head>
  55. <body>
  56. ...
  57.  
  58. ?>


Return Value
  • string - with all meta tags ready to display in a HTML page
Additional
  • access: public
Uses
  • Feindura::$page - to load the page title of the right page
  • Feindura::$category - to load the page title of the right page
  • FeinduraBase::$websiteConfig - for the website title, publisher, copyright, description and keywords
  • GeneralFunctions::readPage() - to load the page for the page title
  • GeneralFunctions::setVisitorTimezone() - to try to set the timezone to the visitors one
Version
  • 1.1
    ChangeLog
    • 1.1 add maintenance message
    • 1.0.2 add GeneralFunctions::setVisitorTimzone() to set the local timezone
    • 1.0.1 changed readPage() from getCurrentPage() to use only the page property
    • 1.0 initial release

File source:
line 1454
string|false createHref ( [int|string|array|bool $id = false],
[bool $fullUrl = false])

Parameters

int|string|array|bool $id (optional) a page ID, array with page and category ID, or a string/array with "previous","next","first","last" or "random". If FALSE it uses the Feindura::$page property.
See Additional -> $id parameter example

Default false
bool $fullUrl (optional) whether the full url should be returned or one relative to the website path.
Default false

Description

Name createHref()

Generates a href attribute which links to a page. Depending whether Pretty URLs is in the administrator-settings activated, it generates a different href attribute.
If cookies are deactivated it attaches the FeinduraBase::$sessionId on the end.

Note: If the $id parameter is empty or FALSE it uses the Feindura::$page property.

Examples of the returned href string:

Pages without category: ?page=1 Pages with category: ?category=1&page=1

Pretty URL href for pages without category: /page/page-title/ Pretty URL href for pages with category: /category/category-name/page-title/


Return Value
  • string|false - the generated href attribute, or FALSE if no page could be loaded
Additional
  • example: $id parameter example
  • see: GeneralFunctions::createHref()
  • access: public
Used By
  • Feindura::createMenu() - to create the href attribute
  • Feindura::createLink() - to create the href-attribute
Uses
  • FeinduraBase::getIdsFromString() - to load the right page and category IDs depending on the $ids parameter
  • GeneralFunctions::createHref() - call the right createHref functions in the GeneralFunctions class
  • GeneralFunctions::getPageCategory() - to get the category of the page
  • FeinduraBase::language
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 1533
string|false createLink ( [int|string|array|bool $id = false],
[string|bool $linkText = true])

Parameters

int|string|array|bool $id (optional) a page ID, array with page and category ID, or a string/array with "previous","next","first","last" or "random". If FALSE it uses the Feindura::$page property.
See Additional -> $id parameter example

Default false
string|bool $linkText (optional) a string with a linktext which the link will use, if TRUE it uses the page title of the page, if FALSE no linktext will be used
Default true

Description

Name createLink()

This method uses the $link... and Feindura::$thumbnail... properties.

Creates a link of a page.

If the given $page parameter is a string with "previous" or "next", it creates a link for the previous or the next page, starting from the current page ID stored in the Feindura::$page property. If there is no current, next or previous page in it returns FALSE.

Note: If the $id parameter is empty or FALSE it uses the Feindura::$page property.
Note: It will add the Feindura::$linkActiveClass property as a CSS class to the link (and also its wrapping element, e.g. <li> or <td>), when the links page is matching the current page, or the current page is a sub page of the links page.

Example:
Show Example

  1. <?php
  2. /*                               *** CODE *** 
  3. --------------------------------------------------------------------------------
  4. This example uses all possible properties.
  5. It's also works much more simple: just call createLink(1) without setting properties
  6. and you have a simple link with the page title.
  7. */
  8.  
  9. // a session will be started in the "feindura.include.php",
  10. // therefor you have to include this file before the header of the HTML page is sent,
  11. // which means before any HTML Tag.
  12. require('cms/feindura.include.php');
  13.  
  14. // creates a new Feindura instance
  15. $feindura = new Feindura();
  16.  
  17. ?>
  18. <!DOCTYPE html>
  19. <html>
  20. ...
  21.  
  22. <?php
  23.  
  24. // set link properties
  25. $feindura->linkLength                 = 20; // shortens the page title in the link
  26. $feindura->linkId                     = 'exampleId';
  27. $feindura->linkClass                  = 'exampleClass';
  28. $feindura->linkAttributes             = 'test="exampleAttribute1" onclick="exampleAttribute2"';
  29. $feindura->linkBefore                 = 'text before link ';
  30. $feindura->linkAfter                  = ' text after link';
  31. $feindura->linkBeforeText             = 'text before ';
  32. $feindura->linkAfterText              = ' text after';
  33. $feindura->linkShowThumbnail          = true;
  34. $feindura->linkShowThumbnailAfterText = false;
  35. $feindura->linkShowPageDate           = true;
  36. $feindura->linkPageDateSeparator      = ' - ';
  37. $feindura->linkShowCategory           = true;
  38. $feindura->linkCategorySeparator      = ' -> ';
  39.  
  40. // set thumbnail properties
  41. $feindura->thumbnailAlign             = 'left';
  42. $feindura->thumbnailId                = 'thumbId';
  43. $feindura->thumbnailClass             = 'thumbClass';
  44. $feindura->thumbnailAttributes        = 'test="thumbnailAttr1" onclick="thumbnailAttr2"';
  45. $feindura->thumbnailBefore            = 'text before thumbnail ';
  46. $feindura->thumbnailAfter             = ' text after thumbnail';
  47.  
  48.  
  49. // finally create the link from the page with ID "1" using the above set link properties
  50. $link = $feindura->createLink(1);
  51.  
  52. // displays the link
  53. echo $link;
  54.  
  55.  
  56.                                *** RESULT *** 
  57. --------------------------------------------------------------------------------
  58.  
  59. text before link <a href="?category=1&amp;page=1" title="Example Category -> 2010-12-31 - Example Page"
  60. id="exampleId" class="exampleClass" test="exampleAttribute1" onclick="exampleAttribute2">
  61. text before thumbnail <img src="/path/thumb_page1.png" class="feinduraThumbnail" alt="Thumbnail" title="Example Page"
  62. id="thumbId" class="thumbClass" test="thumbnailAttr1" onclick="thumbnailAttr2" style="float:left;">
  63. text after thumbnail
  64. text before Example Category -> 2010-12-31 - Example ... text after
  65. </a> text after link
  66.  
  67. ?>


Return Value
  • string|false - the created link, ready to display in a HTML-page, or FALSE if the page doesn't exist or is not public
Additional
  • example: $id parameter example
  • see: Feindura::createMenu()
  • see: Feindura::createMenuByTags()
  • see: Feindura::createMenuByDate()
  • access: public
Used By
  • Feindura::createMenu() - to create a link from every $pageContent array
Uses
  • Feindura::$linkLength
  • Feindura::$linkId
  • Feindura::$linkClass
  • Feindura::$linkActiveClass
  • Feindura::$linkAttributes
  • Feindura::$linkBefore
  • Feindura::$linkAfter
  • Feindura::$linkBeforeText
  • Feindura::$linkAfterText
  • Feindura::$linkShowThumbnail
  • Feindura::$linkShowThumbnailAfterText
  • Feindura::$linkShowPageDate
  • Feidnura::$linkPageDateSeparator
  • Feindura::$linkShowCategory
  • Feindura::$linkCategorySeparator
  • Feindura::$thumbnailAlign
  • Feindura::$thumbnailId
  • Feindura::$thumbnailClass
  • Feindura::$thumbnailAttributes
  • Feindura::$thumbnailBefore
  • Feindura::$thumbnailAfter
  • Feindura::createHref() - to create the href-attribute
  • FeinduraBase::getIdsFromString() - to load the right page and category IDs depending on the $ids parameter
  • FeinduraBase::createAttributes() - to create the attributes used by the link <a> tag
  • FeinduraBase::createThumbnail() - to create the thumbnail for the link if the $linkShowThumbnail property is TRUE
  • FeinduraBase::shortenText() - to shorten the linktext if the $linkLength property is set
  • GeneralFunctions::getPageCategory() - to get the category of the page
  • GeneralFunctions::isPublicCategory() - to check whether the category is public
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 1703
array createMenu ( [string $idType = 'category'],
[int|array|bool $ids = false],
[int|bool $menuTag = false],
[string|bool $linkText = true],
[bool $sortPages = false],
[bool $reverseList = false])

Parameters

string $idType (optional) the ID(s) type can be "cat", "category", "categories" or "pag", "page" or "pages"
Default 'category'
int|array|bool $ids (optional) the category or page ID(s), can be a number or an array with numbers (can also be a $pageContent array), if TRUE it loads all pages, if FALSE it uses the Feindura::$page or Feindura::$category property
Default false
int|bool $menuTag (optional) the tag which is used to create the menu, can be an "menu", "ul", "ol", "array('table',<number until new row>)" or any other tag, if TRUE it uses "div". You can also add simple Zen Code selectors to this string to add id, classes and attributes. E.g. "ul#myId.myClass1.myClass2[attribute1=value][attribute2=value]" converts to <ul id="myId" class="myClass1 myClass2" attribute1="value" attribute2="value">
Default false
string|bool $linkText (optional) a string with a linktext which all links will use, if TRUE it uses the page titles of the pages, if FALSE no linktext will be used
Default true
bool $sortPages (optional) if TRUE it sorts the pages like they are sorted in the backend, if FALSE they are sorted in the order of the given IDs. Can also be a sort function e.g. "sortByLastSaveDate". See GeneralFunctions::sortPages() for more.
Default false
bool $reverseList (optional) if TRUE the pages sorting will be reversed
Default false

Description

Name createMenu()

This method uses the $link..., $menu... and $thumbnail... properties.

Creates a menu from a category(ies) or page(s).
In case no page with the given category or page ID(s) exist it returns an empty array.

Note: The $menuTag parameter can be an "menu", "ul", "ol" or "table", it will then create the necessary child HTML-tags for this element. If its any other tag name it just enclose the links with this HTML-tag.
Note: If the $ids parameter is FALSE it uses the Feindura::$page or Feindura::$category property depending on the $idType parameter.
Note: It will add the Feindura::$linkActiveClass property as a CSS class to the link (and also its wrapping element, e.g. <li> or <td>), when the links page is matching the current page, or the current page is a sub page of the links page.

Example Usage:
Show Example

  1. <?php
  2. /*                               *** SIMPLE EXAMPLE *** 
  3. -------------------------------------------------------------------------------- */
  4.  
  5. // add before any HTML Tag. (eg. before the <!doctype html>)
  6. require('cms/feindura.include.php');
  7.  
  8. // creates a new Feindura instance
  9. $feindura = new Feindura();
  10.  
  11. ?>
  12. <!DOCTYPE html>
  13. <html>
  14. ...
  15.  
  16. <?php
  17.  
  18. // create a menu from the category with ID "1"
  19. $menu = $feindura->createMenu('category',1,'ul.myNav');
  20.  
  21. // displays the menu
  22. foreach($menu as $item) {
  23.   echo $item['menuItem'];
  24. }
  25.  
  26.                                *** RESULT *** 
  27. --------------------------------------------------------------------------------
  28.  
  29. <ul class="myNav">
  30.   <li><a href="?category=1&amp;page=1" title="Example Page 1">Example Page 1</a></li>
  31.   <li><a href="?category=1&amp;page=2" title="Example Page 2">Example Page 2</a></li>
  32. </ul>
  33.  
  34.  
  35. /*                               *** EXTENDED EXAMPLE *** 
  36. --------------------------------------------------------------------------------
  37. This example uses all possible properties.
  38. It's also works much more simple: just call createMenu('category',1)
  39. and you have a simple array with links of the pages from this category.
  40. */
  41.  
  42. // add before any HTML Tag. (eg. before the <!doctype html>)
  43. require('cms/feindura.include.php');
  44.  
  45. // creates a new Feindura instance
  46. $feindura = new Feindura();
  47.  
  48. ?>
  49. <!DOCTYPE html>
  50. <html>
  51. ...
  52.  
  53. <?php
  54.  
  55. // set menu properties
  56. $feindura->menuShowAllPages           = true; // will overwrite the pages "show in menu" setting
  57. $feindura->menuId                     = 'menuId';
  58. $feindura->menuClass                  = 'menuClass';
  59. $feindura->menuAttributes             = 'test="menuAttribute1" onclick="menuAttribute2"';
  60.  
  61. // set link properties
  62. $feindura->linkLength                 = 20; // shortens the page title in the link
  63. $feindura->linkId                     = false; // set no id otherwise it will be repeated
  64. $feindura->linkClass                  = 'linkClass';
  65. $feindura->linkAttributes             = 'test="linkAttribute1" onclick="linkAttribute2"';
  66. $feindura->linkBefore                 = 'text before link ';
  67. $feindura->linkAfter                  = ' text after link';
  68. $feindura->linkBeforeText             = 'text before ';
  69. $feindura->linkAfterText              = ' text after';
  70. $feindura->linkShowThumbnail          = true;
  71. $feindura->linkShowThumbnailAfterText = false;
  72. $feindura->linkShowPageDate           = true;
  73. $feindura->linkPageDateSeparator      = ' - ';
  74. $feindura->linkShowCategory           = true;
  75. $feindura->linkCategorySeparator      = ' -> ';
  76.  
  77. // set thumbnail properties
  78. $feindura->thumbnailAlign             = 'left';
  79. $feindura->thumbnailId                = false; // set no id otherwise it will be repeated
  80. $feindura->thumbnailClass             = 'thumbnailClass';
  81. $feindura->thumbnailAttributes        = 'test="thumbnailAttribute1" onclick="thumbnailAttribute2"';
  82. $feindura->thumbnailBefore            = 'text before thumbnail ';
  83. $feindura->thumbnailAfter             = ' text after thumbnail';
  84.  
  85. // finally create the menu from the category with ID "1" using the above set properties
  86. $menu = $feindura->createMenu('category',1,'table',true,2);
  87.  
  88. // displays the menu
  89. foreach($menu as $item) {
  90.   echo $item['menuItem'];
  91. }
  92.  
  93.  
  94.  
  95.                                *** RESULT *** 
  96. --------------------------------------------------------------------------------
  97.  
  98. <table id="menuId" class="menuClass" test="menuAttribute1" onclick="menuAttribute2">
  99.   <tbody>
  100.     <tr><td>
  101.       text before link <a href="?category=1&amp;page=1" title="Example Category -> 2010-12-31 - Example Page 1"
  102.       class="linkClass" test="linkAttribute1" onclick="linkAttribute2">
  103.       text before thumbnail
  104.       <img src="/path/thumb_page1.png" class="feinduraThumbnail" alt="Thumbnail" title="Example Page 1"
  105.       class="thumbnailClass" test="thumbnailAttribute1" onclick="thumbnailAttribute2" style="float:left;">
  106.       text after thumbnail
  107.       text before Example Category -> 2010-12-31 - Example ... text after
  108.       </a> text after link
  109.     </td><td>
  110.       text before link <a href="?category=1&amp;page=2" title="Example Category -> 2010-11-25 - Example Page 2"
  111.       class="linkClass" test="linkAttribute1" onclick="linkAttribute2">
  112.       text before thumbnail
  113.       <img src="/path/thumb_page2.png" class="feinduraThumbnail" alt="Thumbnail" title="Example Page 2"
  114.       class="thumbnailClass" test="thumbnailAttribute1" onclick="thumbnailAttribute2" style="float:left;">
  115.       text after thumbnail
  116.       text before Example Category -> 2010-11-25 - Example ... text after
  117.       </a> text after link
  118.     </td>
  119.     </tr><tr>
  120.     <td>
  121.       text before link <a href="?category=1&amp;page=3" title="Example Category -> 2010-10-15 - Example Page 3"
  122.       class="linkClass" test="linkAttribute1" onclick="linkAttribute2">
  123.       text before thumbnail
  124.       <img src="/path/thumb_page3.png" class="feinduraThumbnail" alt="Thumbnail" title="Example Page 3"
  125.       class="thumbnailClass" test="thumbnailAttribute1" onclick="thumbnailAttribute2" style="float:left;">
  126.       text after thumbnail
  127.       text before Example Category -> 2010-10-15 - Example ... text after
  128.       </a> text after link
  129.     </td><td>
  130.       text before link <a href="?category=1&amp;page=4" title="Example Category -> 2010-09-05 - Example Page 4"
  131.       class="linkClass" test="linkAttribute1" onclick="linkAttribute2">
  132.       text before thumbnail
  133.       <img src="/path/thumb_page4.png" class="feinduraThumbnail" alt="Thumbnail" title="Example Page 4"
  134.       class="thumbnailClass" test="thumbnailAttribute1" onclick="thumbnailAttribute2" style="float:left;">
  135.       text after thumbnail
  136.       text before Example Category -> 2010-09-05 - Example ... text after
  137.       </a> text after link
  138.     </td></tr>
  139.   </tbody>
  140. </table>
  141.  
  142. ?>

Example of the returned Array:
Show Example

  1. <?php
  2.  
  3. array(
  4.   array(
  5.     'menuItem' or 'item' => '<ul>',
  6.     'startTag'           => '<ul>'
  7.     ),
  8.   array(
  9.     'position'           => 'first',
  10.     'active'             => true,
  11.     'menuItem' or 'item' => '<li class="active"><a href="?page=5&category=1" class="active">Example Page 1</a></li>',
  12.     'startTag'           => '<li>',
  13.     'link'               => '<a href="?page=5&category=1" class="active">Example Page 1</a>',
  14.     'endTag'             => '</li>',
  15.     'title'              => 'Example Page 1',
  16.     'href'               => '?page=5&category=1',
  17.     'pageDate'           => '2000-12-31',
  18.     'pageDateTimestamp'  => array(
  19.                     'date'  => 1325393999, // 'date' and 'start' is the same
  20.                     'start' => 1325393999,
  21.                     'end'   => 1325303455 // will be 0 when its not a date range
  22.                     ),
  23.     'pageId' or 'id'     => 5,
  24.     'categoryId'         => 1
  25.     ),
  26.   array(
  27.     'position'           => 2,
  28.     'menuItem' or 'item' => '<li><a href="?page=8&category=1">Example Page 2</a></li>',
  29.     'startTag'           => '<li>',
  30.     'link'               => '<a href="?page=8&category=1">Example Page 2</a>',
  31.     'endTag'             => '</li>',
  32.     'title'              => 'Example Page 2',
  33.     'href'               => '?page=8&category=1',
  34.     'pageDate'           => '2000-10-10',
  35.     'pageDateTimestamp'  => array(
  36.                     'date'  => 1325393465, // 'date' and 'start' is the same
  37.                     'start' => 1325393465,
  38.                     'end'   => 0
  39.                     ),
  40.     'pageId' or 'id'     => 8,
  41.     'categoryId'         => 1
  42.     ),
  43.   array(
  44.     'position'           => 'last',
  45.     'menuItem' or 'item' => '<li><a href="?page=9&category=1">Example Page 3</a></li>',
  46.     'startTag'           => '<li>',
  47.     'link'               => '<a href="?page=9&category=1">Example Page 3</a>',
  48.     'endTag'             => '</li>',
  49.     'title'              => 'Example Page 3',
  50.     'href'               => '?page=9&category=1',
  51.     'pageDate'           => '2000-10-15',
  52.     'pageDateTimestamp'  => array(
  53.                     'date'  => 1325393322, // 'date' and 'start' is the same
  54.                     'start' => 1325393322,
  55.                     'end'   => 0
  56.                     ),
  57.     'pageId' or 'id'     => 9,
  58.     'categoryId'         => 1
  59.     ),
  60.   array(
  61.     'menuItem' or 'item' => '</ul>',
  62.     'endTag'             => '</ul>'
  63.     )
  64.   )
  65.   
  66. ?>


Return Value
  • array - the created menu in an array, ready to display in a HTML-page, or an empty array
Additional
  • see: Feindura::createLink()
  • see: Feindura::createMenuByTags()
  • see: Feindura::createMenuByDate()
  • access: public
Used By
  • Feindura::createMenuByTags() - to create the menu from the pages load by FeinduraBase::checkPagesForTags()
  • Feindura::createMenuByDate() - to create the menu from the pages
  • Feindura::createMenuBySortFunction() - to create the menu from the pages
  • Feindura::createSubMenu() - to create the menu
  • Feindura::createSubMenuOfPage() - to create the menu
  • Feindura::createSubMenuOfSubCategory() - to create the menu
Uses
  • Feindura::$menuId
  • Feindura::$menuClass
  • Feindura::$menuAttributes
  • Feindura::$linkLength
  • Feindura::$linkId
  • Feindura::$linkClass
  • Feindura::$linkActiveClass
  • Feindura::$linkAttributes
  • Feindura::$linkBefore
  • Feindura::$linkAfter
  • Feindura::$linkBeforeText
  • Feindura::$linkAfterText
  • Feindura::$linkShowThumbnail
  • Feindura::$linkShowThumbnailAfterText
  • Feindura::$linkShowPageDate
  • Feindura::$linkPageDateSeparator
  • Feindura::$linkShowCategory
  • Feindura::$linkCategorySeparator
  • Feindura::$thumbnailAlign
  • Feindura::$thumbnailId
  • Feindura::$thumbnailClass
  • Feindura::$thumbnailAttributes
  • Feindura::$thumbnailBefore
  • Feindura::$thumbnailAfter
  • Feindura::createHref() - to create the href attribute
  • Feindura::createLink() - to create a link from every $pageContent array
  • FeinduraBase::getPropertyIdsByType() - if the $ids parameter is FALSE it gets the property category or page ID, depending on the $idType parameter
  • FeinduraBase::loadPagesByType() - to load the page $pageContent array(s) from the given ID(s)
  • GeneralFunctions::sortPages() - to sort the $pageContent arrays by category
  • FeinduraBase::generateMenu() - to generate the final menu
Version
  • 1.1
    ChangeLog
    • 1.1 changed returned array
    • 1.0 initial release

File source:
line 1855
array createMenuByTags ( string|array $tags,
[string $idType = 'category'],
[int|array|bool $ids = false],
[int|bool $menuTag = false],
[string|bool $linkText = true],
[bool $sortPages = false],
[bool $reverseList = false])

Parameters

string|array $tags a string with tags seperated by "," or ";" or an array with tags
string $idType (optional) the ID(s) type can be "cat", "category", "categories" or "pag", "page" or "pages"
Default 'category'
int|array|bool $ids (optional) the category or page ID(s), can be a number or an array with numbers (can also be a $pageContent array), if TRUE it loads all pages, if FALSE it uses the Feindura::$page or Feindura::$category property
Default false
int|bool $menuTag (optional) the tag which is used to create the menu, can be an "ul", "ol", "array('table',<number until new row>)" or any other tag, if TRUE it uses "div"
Default false
string|bool $linkText (optional) a string with a linktext which all links will use, if TRUE it uses the page titles of the pages, if FALSE no linktext will be used
Default true
bool $sortPages (optional) if TRUE it sorts the pages like they are sorted in the backend, if FALSE they are sorted in the order of the given IDs. Can also be a sort function e.g. "sortByLastSaveDate". See GeneralFunctions::sortPages() for more.
Default false
bool $reverseList (optional) if TRUE the pages sorting will be reversed
Default false

Description

Name createMenuByTags()
Alias createMenuByTag()

This method uses the $link..., $menu... and $thumbnail... properties.

Create a menu from category(ies) or page(s), with pages which have one or more of the tags from the given $tags parameter.
In case no page with the given category or page ID(s) or tags exist it returns an empty array.

Note: the tags will be compared case insensitive.
Note: The $menuTag parameter can be an "menu", "ul", "ol" or "table", it will then create the necessary HTML-tags of this element. If its any other tag name it just enclose the links with this HTML-tag.
Note: If the $ids parameter is FALSE it uses the Feindura::$page or Feindura::$category property depending on the $idType parameter.
Note: It will add the Feindura::$linkActiveClass property as a CSS class to the link (and also its wrapping element, e.g. <li> or <td>), when the links page is matching the current page, or the current page is a sub page of the links page.

Example:
Show Example

  1. <?php
  2. /*                               *** CODE *** 
  3. --------------------------------------------------------------------------------
  4. This example shows only the usage of tags for creating a menu,
  5. for a detailed menu example see createMenu()
  6. */
  7.  
  8. // a session will be started in the "feindura.include.php",
  9. // therefor you have to include this file before the header of the HTML page is sent,
  10. // which means before any HTML Tag.
  11. require('cms/feindura.include.php');
  12.  
  13. // creates a new Feindura instance
  14. $feindura = new Feindura();
  15.  
  16. ?>
  17. <!DOCTYPE html>
  18. <html>
  19. ...
  20.  
  21. <?php
  22.  
  23. // the tags where the pages in the menu should have atleast one
  24. $tags = 'winter summer spring';
  25. // could also be an array like
  26. // $tags = array(0 => 'winter', 1 => 'summer', 2 => 'spring');
  27.  
  28. // finally create the menu from the category with ID "1" using the above set tags
  29. $menu = $feindura->createMenuByTags($tags,'category',1,array('table',2));
  30.  
  31. // displays the menu
  32. foreach($menu as $item) {
  33.   echo $item['menuItem'];
  34. }
  35.  
  36.  
  37.                                *** RESULT *** 
  38. --------------------------------------------------------------------------------
  39.  
  40. <table>
  41.   <tbody>
  42.     <tr><td>
  43.       <a href="?category=1&amp;page=1" title="Summer Page">
  44.       Summer Page
  45.       </a>
  46.     </td><td>
  47.       <a href="?category=1&amp;page=2" title="Winter Page">
  48.       Winter Page
  49.       </a>
  50.     </td>
  51.     </tr><tr>
  52.     <td>
  53.       <a href="?category=1&amp;page=6" title="Spring Page">
  54.       Spring Page
  55.       </a>
  56.     </td><td></td>
  57.     </tr>
  58.   </tbody>
  59. </table>
  60.  
  61.  
  62. ?>

Example of the returned Array:
Show Example

  1. <?php
  2.  
  3. array(
  4.   array(
  5.     'menuItem' or 'item' => '<ul>',
  6.     'startTag'           => '<ul>'
  7.     ),
  8.   array(
  9.     'position'           => 'first',
  10.     'active'             => true,
  11.     'menuItem' or 'item' => '<li class="active"><a href="?page=5&category=1" class="active">Example Page 1</a></li>',
  12.     'startTag'           => '<li>',
  13.     'link'               => '<a href="?page=5&category=1" class="active">Example Page 1</a>',
  14.     'endTag'             => '</li>',
  15.     'title'              => 'Example Page 1',
  16.     'href'               => '?page=5&category=1',
  17.     'pageDate'           => '2000-12-31',
  18.     'pageDateTimestamp'  => array(
  19.                     'date'  => 1325393999, // 'date' and 'start' is the same
  20.                     'start' => 1325393999,
  21.                     'end'   => 1325303455 // will be 0 when its not a date range
  22.                     ),
  23.     'pageId' or 'id'     => 5,
  24.     'categoryId'         => 1
  25.     ),
  26.   array(
  27.     'position'           => 2,
  28.     'menuItem' or 'item' => '<li><a href="?page=8&category=1">Example Page 2</a></li>',
  29.     'startTag'           => '<li>',
  30.     'link'               => '<a href="?page=8&category=1">Example Page 2</a>',
  31.     'endTag'             => '</li>',
  32.     'title'              => 'Example Page 2',
  33.     'href'               => '?page=8&category=1',
  34.     'pageDate'           => '2000-10-10',
  35.     'pageDateTimestamp'  => array(
  36.                     'date'  => 1325393465, // 'date' and 'start' is the same
  37.                     'start' => 1325393465,
  38.                     'end'   => 0
  39.                     ),
  40.     'pageId' or 'id'     => 8,
  41.     'categoryId'         => 1
  42.     ),
  43.   array(
  44.     'position'           => 'last',
  45.     'menuItem' or 'item' => '<li><a href="?page=9&category=1">Example Page 3</a></li>',
  46.     'startTag'           => '<li>',
  47.     'link'               => '<a href="?page=9&category=1">Example Page 3</a>',
  48.     'endTag'             => '</li>',
  49.     'title'              => 'Example Page 3',
  50.     'href'               => '?page=9&category=1',
  51.     'pageDate'           => '2000-10-15',
  52.     'pageDateTimestamp'  => array(
  53.                     'date'  => 1325393322, // 'date' and 'start' is the same
  54.                     'start' => 1325393322,
  55.                     'end'   => 0
  56.                     ),
  57.     'pageId' or 'id'     => 9,
  58.     'categoryId'         => 1
  59.     ),
  60.   array(
  61.     'menuItem' or 'item' => '</ul>',
  62.     'endTag'             => '</ul>'
  63.     )
  64.   )
  65.   
  66. ?>


Return Value
  • array - the created menu in an array, ready to display in a HTML-page, or an empty array
Additional
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • see: Feindura::createMenuByDate()
  • access: public
Uses
  • Feindura::$menuId
  • Feindura::$menuClass
  • Feindura::$menuAttributes
  • Feindura::$linkLength
  • Feindura::$linkId
  • Feindura::$linkClass
  • Feindura::$linkActiveClass
  • Feindura::$linkAttributes
  • Feindura::$linkBefore
  • Feindura::$linkAfter
  • Feindura::$linkBeforeText
  • Feindura::$linkAfterText
  • Feindura::$linkShowThumbnail
  • Feindura::$linkShowThumbnailAfterText
  • Feindura::$linkShowPageDate
  • Feindura::$linkPageDateSeparator
  • Feindura::$linkShowCategory
  • Feindura::$linkCategorySeparator
  • Feindura::$thumbnailAlign
  • Feindura::$thumbnailId
  • Feindura::$thumbnailClass
  • Feindura::$thumbnailAttributes
  • Feindura::$thumbnailBefore
  • Feindura::$thumbnailAfter
  • FeinduraBase::getPropertyIdsByType() - if the $ids parameter is FALSE it gets the property category or page ID, depending on the $idType parameter
  • FeinduraBase::checkPagesForTags() - to get only the pages which have one or more tags from the given $tags parameter
  • Feindura::createMenu() - to create the menu from the pages load by FeinduraBase::checkPagesForTags()
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 1952
array createMenuByDate ( [int|bool|string $from = true],
[int|bool|string $to = true],
[string $idType = 'category'],
[int|array|bool $ids = false],
[int|bool $menuTag = false],
[string|bool $linkText = true],
[bool $sortPages = false],
[bool $reverseList = false])

Parameters

int|bool|string $from (optional) number of months in the past, if TRUE it show all pages in the past, if FALSE it loads only pages starting from the current date. Can also be a string with a date format (e.g. '2 weeks' or '27.06.2012'), for more details see: http://www.php.net/manual/en/datetime.formats.php
Default true
int|bool|string $to (optional) number of months in the future, if TRUE it show all pages in the future, if FALSE it loads only pages until the current date. Can also be a string with a date format (e.g. '10 days' or '27.06.2012'), for more details see: http://www.php.net/manual/de/datetime.formats.php
Default true
string $idType (optional) the ID(s) type can be "cat", "category", "categories" or "pag", "page" or "pages"
Default 'category'
int|array|bool $ids (optional) the category or page ID(s), can be a number or an array with numbers (can also be a $pageContent array), if TRUE it loads all pages, if FALSE it uses the Feindura::$page or Feindura::$category property
Default false
int|bool $menuTag (optional) the tag which is used to create the menu, can be an "ul", "ol", "array('table',<number until new row>)" or any other tag, if TRUE it uses "div"
Default false
string|bool $linkText (optional) a string with a linktext which all links will use, if TRUE it uses the page titles of the pages, if FALSE no linktext will be used
Default true
bool $sortPages (optional) if TRUE it sorts the pages like they are sorted in the backend, if FALSE it sorts the pages by date (If date range: by start date). Can also be a sort function e.g. "sortByEndDate". See GeneralFunctions::sortPages() for more.
Default false
bool $reverseList (optional) if TRUE the pages sorting will be reversed
Default false

Description

Name createMenuByDate()
Alias createMenuByDates()

This method uses the $link..., $menu... and $thumbnail... properties.

Creates a menu from category(ies) or page(s) parameter. Applies for pages which have a page date (and page date is activated for that category!) and it fit in the time period from the $from and the $to parameter (relative to the current date).

The $from and $to parameters can also be a string with a (relative or specific) date, for more information see: http://www.php.net/manual/de/datetime.formats.php.

In case no page with the given category or page ID(s) or tags exist it returns an empty array.

Note: The $menuTag parameter can be an "menu", "ul", "ol" or "table", it will then create the necessary HTML-tags of this element. If its any other tag name it just enclose the links with this HTML-tag.
Note: If the $ids parameter is FALSE it uses the Feindura::$page or Feindura::$category property depending on the $idType parameter.
Note: It will add the Feindura::$linkActiveClass property as a CSS class to the link (and also its wrapping element, e.g. <li> or <td>), when the links page is matching the current page, or the current page is a sub page of the links page.

Example:
Show Example

  1. <?php
  2. /*                               *** CODE *** 
  3. --------------------------------------------------------------------------------
  4. This example shows only the usage of a time period for creating a menu,
  5. for a detailed menu example see createMenu()
  6. */
  7.  
  8. // a session will be started in the "feindura.include.php",
  9. // therefor you have to include this file before the header of the HTML page is sent,
  10. // which means before any HTML Tag.
  11. require('cms/feindura.include.php');
  12.  
  13. // creates a new Feindura instance
  14. $feindura = new Feindura();
  15.  
  16. ?>
  17. <!DOCTYPE html>
  18. <html>
  19. ...
  20.  
  21. <?php
  22.  
  23. // set this property to show the page date in the links text
  24. // the "text before date" and "text after date" was set in the page editor in the backend
  25. $feindura->linkShowPageDate      = true;
  26. $feindura->linkPageDateSeparator = ': ';
  27.  
  28. // create the menu from the category with ID "1" using the time period:
  29. // load all pages in the past until 8 months in the future starting from the date today: 31.05.2010
  30. $menu = $feindura->createMenuByDate('category',1,array('table',2));
  31.  
  32. // displays the menu
  33. foreach($menu as $item) {
  34.   echo $item['menuItem'];
  35. }
  36.  
  37.  
  38.  
  39.                                *** RESULT *** 
  40. --------------------------------------------------------------------------------
  41.  
  42. <table>
  43.   <tbody>
  44.     <tr><td>
  45.       <a href="?category=1&amp;page=1" title="text before date 2005-10-31 text after date: Oldest Page">
  46.       text before date 2005-10-31 text after date: Oldest Page
  47.       </a>
  48.     </td><td>
  49.       <a href="?category=1&amp;page=2" title="text before date 2010-11-31 text after date: Newer Page">
  50.       text before date 2010-11-31 text after date: Newer Page
  51.       </a>
  52.     </td>
  53.     </tr><tr>
  54.     <td>
  55.       <a href="?category=1&amp;page=3" title="text before date 2010-12-31 text after date: Newest Page">
  56.       text before date 2010-12-31 text after date: Newest Page
  57.       </a>
  58.     </td><td></td>
  59.     </tr>
  60.   </tbody>
  61. </table>
  62.  
  63. ?>

Example of the returned Array:
Show Example

  1. <?php
  2.  
  3. array(
  4.   array(
  5.     'menuItem' or 'item' => '<ul>',
  6.     'startTag'           => '<ul>'
  7.     ),
  8.   array(
  9.     'position'           => 'first',
  10.     'active'             => true,
  11.     'menuItem' or 'item' => '<li class="active"><a href="?page=5&category=1" class="active">Example Page 1</a></li>',
  12.     'startTag'           => '<li>',
  13.     'link'               => '<a href="?page=5&category=1" class="active">Example Page 1</a>',
  14.     'endTag'             => '</li>',
  15.     'title'              => 'Example Page 1',
  16.     'href'               => '?page=5&category=1',
  17.     'pageDate'           => '2000-12-31',
  18.     'pageDateTimestamp'  => array(
  19.                     'date'  => 1325393999, // 'date' and 'start' is the same
  20.                     'start' => 1325393999,
  21.                     'end'   => 1325303455 // will be 0 when its not a date range
  22.                     ),
  23.     'pageId' or 'id'     => 5,
  24.     'categoryId'         => 1
  25.     ),
  26.   array(
  27.     'position'           => 2,
  28.     'menuItem' or 'item' => '<li><a href="?page=8&category=1">Example Page 2</a></li>',
  29.     'startTag'           => '<li>',
  30.     'link'               => '<a href="?page=8&category=1">Example Page 2</a>',
  31.     'endTag'             => '</li>',
  32.     'title'              => 'Example Page 2',
  33.     'href'               => '?page=8&category=1',
  34.     'pageDate'           => '2000-10-10',
  35.     'pageDateTimestamp'  => array(
  36.                     'date'  => 1325393465, // 'date' and 'start' is the same
  37.                     'start' => 1325393465,
  38.                     'end'   => 0
  39.                     ),
  40.     'pageId' or 'id'     => 8,
  41.     'categoryId'         => 1
  42.     ),
  43.   array(
  44.     'position'           => 'last',
  45.     'menuItem' or 'item' => '<li><a href="?page=9&category=1">Example Page 3</a></li>',
  46.     'startTag'           => '<li>',
  47.     'link'               => '<a href="?page=9&category=1">Example Page 3</a>',
  48.     'endTag'             => '</li>',
  49.     'title'              => 'Example Page 3',
  50.     'href'               => '?page=9&category=1',
  51.     'pageDate'           => '2000-10-15',
  52.     'pageDateTimestamp'  => array(
  53.                     'date'  => 1325393322, // 'date' and 'start' is the same
  54.                     'start' => 1325393322,
  55.                     'end'   => 0
  56.                     ),
  57.     'pageId' or 'id'     => 9,
  58.     'categoryId'         => 1
  59.     ),
  60.   array(
  61.     'menuItem' or 'item' => '</ul>',
  62.     'endTag'             => '</ul>'
  63.     )
  64.   )
  65.   
  66. ?>


Return Value
  • array - the created menu in an array, ready to display in a HTML-page, or an empty array
Additional
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • see: Feindura::createMenuByTags()
  • access: public
Uses
  • Feindura::$menuId
  • Feindura::$menuClass
  • Feindura::$menuAttributes
  • Feindura::$linkLength
  • Feindura::$linkId
  • Feindura::$linkClass
  • Feindura::$linkActiveClass
  • Feindura::$linkAttributes
  • Feindura::$linkBefore
  • Feindura::$linkAfter
  • Feindura::$linkBeforeText
  • Feindura::$linkAfterText
  • Feindura::$linkShowThumbnail
  • Feindura::$linkShowThumbnailAfterText
  • Feindura::$linkShowPageDate
  • Feindura::$linkPageDateSeparator
  • Feindura::$linkShowCategory
  • Feindura::$linkCategorySeparator
  • Feindura::$thumbnailAlign
  • Feindura::$thumbnailId
  • Feindura::$thumbnailClass
  • Feindura::$thumbnailAttributes
  • Feindura::$thumbnailBefore
  • Feindura::$thumbnailAfter
  • FeinduraBase::loadPagesByDate() - to load the pages which fit in the given time period parameters, sorted by the page date
  • Feindura::createMenu() - to create the menu from the pages
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 2046
array createMenuBySortFunction ( string $sortCallback,
[string $idType = 'category'],
[int|array|bool $ids = false],
[int|bool $menuTag = false],
[string|bool $linkText = true],
[bool $reverseList = false])

Parameters

string $sortCallback the name of the callback function to sort the menu (uses usort()). For a list of available predefined functions see GeneralFunctions::sortPages()
string $idType (optional) the ID(s) type can be "cat", "category", "categories" or "pag", "page" or "pages"
Default 'category'
int|array|bool $ids (optional) the category or page ID(s), can be a number or an array with numbers (can also be a $pageContent array), if TRUE it loads all pages, if FALSE it uses the Feindura::$page or Feindura::$category property
Default false
int|bool $menuTag (optional) the tag which is used to create the menu, can be an "ul", "ol", "array('table',<number until new row>)" or any other tag, if TRUE it uses "div"
Default false
string|bool $linkText (optional) a string with a linktext which all links will use, if TRUE it uses the page titles of the pages, if FALSE no linktext will be used
Default true
bool $reverseList (optional) if TRUE the pages sorting will be reversed
Default false

Description

Name createMenuBySortFunction()

Alias createMenuBySort()
Alias createMenuBySortCallback()
Alias createMenuByCallback()

This method uses the $link..., $menu... and $thumbnail... properties.

Creates a menu from category(ies) or page(s), sorted by a custom sort function passed in the first parameter $sortCallback.

In case no page with the given category or page ID(s) or tags exist it returns an empty array.

Note: The $menuTag parameter can be an "menu", "ul", "ol" or "table", it will then create the necessary HTML-tags of this element. If its any other tag name it just enclose the links with this HTML-tag.
Note: If the $ids parameter is FALSE it uses the Feindura::$page or Feindura::$category property depending on the $idType parameter.
Note: It will add the Feindura::$linkActiveClass property as a CSS class to the link (and also its wrapping element, e.g. <li> or <td>), when the links page is matching the current page, or the current page is a sub page of the links page.

Example:
Show Example

  1. <?php
  2. /*                               *** CODE *** 
  3. --------------------------------------------------------------------------------
  4. This example uses all possible properties.
  5. It's also works much more simple: just call createMenu('category',1)
  6. and you have a simple array with links of the pages from this category.
  7. */
  8.  
  9. // a session will be started in the "feindura.include.php",
  10. // therefor you have to include this file before the header of the HTML page is sent,
  11. // which means before any HTML Tag.
  12. require('cms/feindura.include.php');
  13.  
  14. // creates a new Feindura instance
  15. $feindura = new Feindura();
  16.  
  17. ?>
  18. <!DOCTYPE html>
  19. <html>
  20. ...
  21.  
  22. <?php
  23.  
  24. // create the sort function, which we use with the createMenuBySortFunction() method
  25. function sortByLastEditDate($a,$b) {
  26.   if ($a['lastSaveDate'] == $b['lastSaveDate'])
  27.     return 0;
  28.   return ($a['lastSaveDate'] > $b['lastSaveDate']) ? -1 : 1;
  29. }
  30.  
  31. // now we create the menu from the category with ID "1"
  32. $menu = $feindura->createMenuBySortFunction('sortByLastEditDate','category',1,array('table',2));
  33.  
  34. // displays the menu
  35. foreach($menu as $item) {
  36.   echo $item['menuItem'];
  37. }
  38.  
  39.  
  40.  
  41.                                *** RESULT *** 
  42. --------------------------------------------------------------------------------
  43.  
  44. <table>
  45.   <tbody>
  46.     <tr><td>
  47.       <a href="?category=1&amp;page=2" title="Example Page 2">
  48.       Example Page 2
  49.       </a>
  50.     </td>
  51.     <td>
  52.       <a href="?category=1&amp;page=1" title="Example Page 1">
  53.       Example Page 1
  54.       </a>
  55.     </td>
  56.     </tr><tr>
  57.     <td>
  58.       <a href="?category=1&amp;page=4" title="Example Page 4">
  59.       Example Page 4
  60.       </a>
  61.     </td>
  62.     <td>
  63.       <a href="?category=1&amp;page=3" title="Example Page 3">
  64.       Example Page 3
  65.       </a>
  66.     </td></tr>
  67.   </tbody>
  68. </table>
  69.  
  70. ?>

Example of the returned Array:
Show Example

  1. <?php
  2.  
  3. array(
  4.   array(
  5.     'menuItem' or 'item' => '<ul>',
  6.     'startTag'           => '<ul>'
  7.     ),
  8.   array(
  9.     'position'           => 'first',
  10.     'active'             => true,
  11.     'menuItem' or 'item' => '<li class="active"><a href="?page=5&category=1" class="active">Example Page 1</a></li>',
  12.     'startTag'           => '<li>',
  13.     'link'               => '<a href="?page=5&category=1" class="active">Example Page 1</a>',
  14.     'endTag'             => '</li>',
  15.     'title'              => 'Example Page 1',
  16.     'href'               => '?page=5&category=1',
  17.     'pageDate'           => '2000-12-31',
  18.     'pageDateTimestamp'  => array(
  19.                     'date'  => 1325393999, // 'date' and 'start' is the same
  20.                     'start' => 1325393999,
  21.                     'end'   => 1325303455 // will be 0 when its not a date range
  22.                     ),
  23.     'pageId' or 'id'     => 5,
  24.     'categoryId'         => 1
  25.     ),
  26.   array(
  27.     'position'           => 2,
  28.     'menuItem' or 'item' => '<li><a href="?page=8&category=1">Example Page 2</a></li>',
  29.     'startTag'           => '<li>',
  30.     'link'               => '<a href="?page=8&category=1">Example Page 2</a>',
  31.     'endTag'             => '</li>',
  32.     'title'              => 'Example Page 2',
  33.     'href'               => '?page=8&category=1',
  34.     'pageDate'           => '2000-10-10',
  35.     'pageDateTimestamp'  => array(
  36.                     'date'  => 1325393465, // 'date' and 'start' is the same
  37.                     'start' => 1325393465,
  38.                     'end'   => 0
  39.                     ),
  40.     'pageId' or 'id'     => 8,
  41.     'categoryId'         => 1
  42.     ),
  43.   array(
  44.     'position'           => 'last',
  45.     'menuItem' or 'item' => '<li><a href="?page=9&category=1">Example Page 3</a></li>',
  46.     'startTag'           => '<li>',
  47.     'link'               => '<a href="?page=9&category=1">Example Page 3</a>',
  48.     'endTag'             => '</li>',
  49.     'title'              => 'Example Page 3',
  50.     'href'               => '?page=9&category=1',
  51.     'pageDate'           => '2000-10-15',
  52.     'pageDateTimestamp'  => array(
  53.                     'date'  => 1325393322, // 'date' and 'start' is the same
  54.                     'start' => 1325393322,
  55.                     'end'   => 0
  56.                     ),
  57.     'pageId' or 'id'     => 9,
  58.     'categoryId'         => 1
  59.     ),
  60.   array(
  61.     'menuItem' or 'item' => '</ul>',
  62.     'endTag'             => '</ul>'
  63.     )
  64.   )
  65.   
  66. ?>


Return Value
  • array - the created menu in an array, ready to display in a HTML-page, or an empty array
Additional
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • see: Feindura::createMenuByDate()
  • see: Feindura::createMenuByTags()
  • access: public
Uses
  • Feindura::$menuId
  • Feindura::$menuClass
  • Feindura::$menuAttributes
  • Feindura::$linkLength
  • Feindura::$linkId
  • Feindura::$linkClass
  • Feindura::$linkActiveClass
  • Feindura::$linkAttributes
  • Feindura::$linkBefore
  • Feindura::$linkAfter
  • Feindura::$linkBeforeText
  • Feindura::$linkAfterText
  • Feindura::$linkShowThumbnail
  • Feindura::$linkShowThumbnailAfterText
  • Feindura::$linkShowPageDate
  • Feindura::$linkPageDateSeparator
  • Feindura::$linkShowCategory
  • Feindura::$linkCategorySeparator
  • Feindura::$thumbnailAlign
  • Feindura::$thumbnailId
  • Feindura::$thumbnailClass
  • Feindura::$thumbnailAttributes
  • Feindura::$thumbnailBefore
  • Feindura::$thumbnailAfter
  • FeinduraBase::loadPagesByType() - to load the pages which fit in the given time period parameters, sorted by the page date
  • Feindura::createMenu() - to create the menu from the pages
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 2107
bool isSubCategory ( [int|string|bool $categoryId = false])

Parameters

int|string|bool $categoryId (optional) a category ID, or a string with "previous","next","first","last" or "random". If FALSE it uses the Feindura::$category property.
Default false

Description

Name isSubCategory()

Check if the given $category ID is a subcategory.

Note: If the $category parameter is FALSE or empty, it uses the current category (means the Feindura::$category property).


Return Value
  • bool - whether or not the checked category is a subcategory
Additional
  • access: public
Uses
  • Feindura::$category
  • Feindura::$categoryConfig
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 2142
bool isSubCategoryOf ( [int|string|bool $pageId = false],
[int|string|bool $categoryId = false])

Parameters

int|string|bool $pageId (optional) a page ID, or a string with "previous","next","first","last" or "random". If FALSE it uses the Feindura::$page property.
Default false
int|string|bool $categoryId (optional) a category ID, or a string with "previous","next","first","last" or "random". If FALSE it uses the Feindura::$category property.
Default false

Description

Name isSubCategoryOf()

Check if the given $pageId ID has the given $categoryId as a subcategory.

Note: If the $pageID parameter is FALSE or empty, it uses the current page (means the Feindura::$page property).
Note: If the $categoryId parameter is FALSE or empty, it uses the current page (means the Feindura::$page property).


Return Value
  • bool - whether or not the given page has the given category as subcategory
Additional
  • access: public
Uses
  • Feindura::$category
  • Feindura::$categoryConfig
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 2180
array|false getParentPagesOf ( [int|string|bool $categoryId = false])

Parameters

int|string|bool $categoryId (optional) a category ID, or a string with "previous","next","first","last" or "random". If FALSE it uses the Feindura::$category property.
Default false

Description

Name getParentPagesOf()

Loads the parent pages of a subcategory.

Note: If the $categoryId parameter is FALSE or empty, it uses the current page (means the Feindura::$page property).


Return Value
  • array|false - and array with all the parent pages or FALSE if it is not a sub category
Additional
  • access: public
Uses
  • Feindura::$category
  • Feindura::$categoryConfig
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 2271
array createSubMenu ( [int|bool $menuTag = false],
[string|bool $linkText = true],
[bool $sortPages = false],
[bool $reverseList = false])

Parameters

int|bool $menuTag (optional) the tag which is used to create the menu, can be an "ul", "ol", "array('table',<number until new row>)" or any other tag, if TRUE it uses "div"
Default false
string|bool $linkText (optional) a string with a linktext which all links will use, if TRUE it uses the page titles of the pages, if FALSE no linktext will be used
Default true
bool $sortPages (optional) if TRUE it sorts the pages like they are sorted in the backend, if FALSE they are sorted in the order of the given IDs. Can also be a sort function e.g. "sortByLastSaveDate". See GeneralFunctions::sortPages() for more.
Default false
bool $reverseList (optional) if TRUE the pages sorting will be reversed
Default false

Description

Name createSubMenu()

This method uses the $link..., $menu... and $thumbnail... properties.

Creates a sub menu from the current page (Feindura::$page) or the current category (Feindura::$category), if its a subcategory.
In case the current page has no subcategory or the current category is no subcategory it returns an empty array.

Note: The $menuTag parameter can be an "menu", "ul", "ol" or "table", it will then create the necessary child HTML-tags of this element. If its any other tag name it just enclose the links with this HTML-tag.
Note: It will add the Feindura::$linkActiveClass property as a CSS class to the link (and also its wrapping element, e.g. <li> or <td>), when the links page is matching the current page, or the current page is a sub page of the links page.

Example:
Show Example

  1. <?php
  2. /*                               *** CODE ***
  3. --------------------------------------------------------------------------------
  4. This example uses no extra properties. To see an example using all the properties, see the createMenu() method example.
  5. */
  6.  
  7. // a session will be started in the "feindura.include.php",
  8. // therefor you have to include this file before the header of the HTML page is sent,
  9. // which means before any HTML Tag.
  10. require('cms/feindura.include.php');
  11.  
  12. // creates a new Feindura instance
  13. $feindura = new Feindura();
  14.  
  15. ?>
  16. <!DOCTYPE html>
  17. <html>
  18. ...
  19.  
  20. <?php
  21.  
  22.  
  23. // will create a <ul> menu from the current page, when it has a subcategory or the current subcategory
  24. foreach($feindura->createSubMenu('ul') as $item) {
  25.   echo $item['menuItem'];
  26. }
  27.  
  28.  
  29.                                *** RESULT ***
  30. --------------------------------------------------------------------------------
  31.  
  32. <ul>
  33.   <li>
  34.     <a href="?category=1&page=1" title="Example Page 1">
  35.     Example Page 1
  36.     </a>
  37.  
  38.     <ul>
  39.       <li>
  40.         <a href="?category=2&page=4" title="Example Page in SubCategory 1">
  41.         Example Page in SubCategory 1
  42.         </a>
  43.       </li>
  44.       <li>
  45.         <a href="?category=2&page=5" title="Example Page in SubCategory 2">
  46.         Example Page in SubCategory 2
  47.         </a>
  48.       </li>
  49.     </ul>
  50.  
  51.   </li>
  52.   <li>
  53.     <a href="?category=1&page=2" title="Example Page 2">
  54.     Example Page 2
  55.     </a>
  56.   </li>
  57.   <li>
  58.     <a href="?category=1&page=3" title="Example Page 3">
  59.     Example Page 3
  60.     </a>
  61.   </li>
  62. </ul>
  63.  
  64. ?>

Example of the returned Array:
Show Example

  1. <?php
  2.  
  3. array(
  4.   array(
  5.     'menuItem' or 'item' => '<ul>',
  6.     'startTag'           => '<ul>'
  7.     ),
  8.   array(
  9.     'position'           => 'first',
  10.     'active'             => true,
  11.     'menuItem' or 'item' => '<li class="active"><a href="?page=5&category=1" class="active">Example Page 1</a></li>',
  12.     'startTag'           => '<li>',
  13.     'link'               => '<a href="?page=5&category=1" class="active">Example Page 1</a>',
  14.     'endTag'             => '</li>',
  15.     'title'              => 'Example Page 1',
  16.     'href'               => '?page=5&category=1',
  17.     'pageDate'           => '2000-12-31',
  18.     'pageDateTimestamp'  => array(
  19.                     'date'  => 1325393999, // 'date' and 'start' is the same
  20.                     'start' => 1325393999,
  21.                     'end'   => 1325303455 // will be 0 when its not a date range
  22.                     ),
  23.     'pageId' or 'id'     => 5,
  24.     'categoryId'         => 1
  25.     ),
  26.   array(
  27.     'position'           => 2,
  28.     'menuItem' or 'item' => '<li><a href="?page=8&category=1">Example Page 2</a></li>',
  29.     'startTag'           => '<li>',
  30.     'link'               => '<a href="?page=8&category=1">Example Page 2</a>',
  31.     'endTag'             => '</li>',
  32.     'title'              => 'Example Page 2',
  33.     'href'               => '?page=8&category=1',
  34.     'pageDate'           => '2000-10-10',
  35.     'pageDateTimestamp'  => array(
  36.                     'date'  => 1325393465, // 'date' and 'start' is the same
  37.                     'start' => 1325393465,
  38.                     'end'   => 0
  39.                     ),
  40.     'pageId' or 'id'     => 8,
  41.     'categoryId'         => 1
  42.     ),
  43.   array(
  44.     'position'           => 'last',
  45.     'menuItem' or 'item' => '<li><a href="?page=9&category=1">Example Page 3</a></li>',
  46.     'startTag'           => '<li>',
  47.     'link'               => '<a href="?page=9&category=1">Example Page 3</a>',
  48.     'endTag'             => '</li>',
  49.     'title'              => 'Example Page 3',
  50.     'href'               => '?page=9&category=1',
  51.     'pageDate'           => '2000-10-15',
  52.     'pageDateTimestamp'  => array(
  53.                     'date'  => 1325393322, // 'date' and 'start' is the same
  54.                     'start' => 1325393322,
  55.                     'end'   => 0
  56.                     ),
  57.     'pageId' or 'id'     => 9,
  58.     'categoryId'         => 1
  59.     ),
  60.   array(
  61.     'menuItem' or 'item' => '</ul>',
  62.     'endTag'             => '</ul>'
  63.     )
  64.   )
  65.   
  66. ?>


Return Value
  • array - the created sub menu in an array, ready to display in a HTML-page, or an empty array
Additional
  • see: createMenuFromCategory()
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • access: public
Uses
  • Feindura::$menuId
  • Feindura::$menuClass
  • Feindura::$menuAttributes
  • Feindura::$linkLength
  • Feindura::$linkId
  • Feindura::$linkClass
  • Feindura::$linkActiveClass
  • Feindura::$linkAttributes
  • Feindura::$linkBefore
  • Feindura::$linkAfter
  • Feindura::$linkBeforeText
  • Feindura::$linkAfterText
  • Feindura::$linkShowThumbnail
  • Feindura::$linkShowThumbnailAfterText
  • Feindura::$linkShowPageDate
  • Feindura::$linkPageDateSeparator
  • Feindura::$linkShowCategory
  • Feindura::$linkCategorySeparator
  • Feindura::$thumbnailAlign
  • Feindura::$thumbnailId
  • Feindura::$thumbnailClass
  • Feindura::$thumbnailAttributes
  • Feindura::$thumbnailBefore
  • Feindura::$thumbnailAfter
  • Feindura::createMenu() - to create the menu
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 2354
array createSubMenuOfPage ( [int|string|array|bool $id = false],
[int|bool $menuTag = false],
[string|bool $linkText = true],
[bool $sortPages = false],
[bool $reverseList = false])

Parameters

int|string|array|bool $id (optional) a page ID, array with page and category ID, or a string/array with "previous","next","first","last" or "random". If FALSE it uses the Feindura::$page property.
See Additional -> $id parameter example

Default false
int|bool $menuTag (optional) the tag which is used to create the menu, can be an "ul", "ol", "array('table',<number until new row>)" or any other tag, if TRUE it uses "div"
Default false
string|bool $linkText (optional) a string with a linktext which all links will use, if TRUE it uses the page titles of the pages, if FALSE no linktext will be used
Default true
bool $sortPages (optional) if TRUE it sorts the pages like they are sorted in the backend, if FALSE they are sorted in the order of the given IDs. Can also be a sort function e.g. "sortByLastSaveDate". See GeneralFunctions::sortPages() for more.
Default false
bool $reverseList (optional) if TRUE the pages sorting will be reversed
Default false

Description

Name createSubMenuOfPage()
Alias createSubMenuFromPage()

This method uses the $link..., $menu... and $thumbnail... properties.

Creates a sub menu out of the subcategory of a page. If the page has no subcategory it will return an empty array.
In case no page with the given page ID exist, or it has no subcategory it returns an empty array.

Note: The $menuTag parameter can be an "menu", "ul", "ol" or "table", it will then create the necessary child HTML-tags of this element. If its any other tag name it just enclose the links with this HTML-tag.
Note: If the $id parameter is FALSE or empty, it uses the current page (means the Feindura::$page property).
Note: It will add the Feindura::$linkActiveClass property as a CSS class to the link (and also its wrapping element, e.g. <li> or <td>), when the links page is matching the current page, or the current page is a sub page of the links page.

Example:
Show Example

  1. <?php
  2. /*                               *** CODE *** 
  3. --------------------------------------------------------------------------------
  4. This example uses no extra properties. To see an example using all the properties, see the createMenu() method example.
  5. */
  6.  
  7. // a session will be started in the "feindura.include.php",
  8. // therefor you have to include this file before the header of the HTML page is sent,
  9. // which means before any HTML Tag.
  10. require('cms/feindura.include.php');
  11.  
  12. // creates a new Feindura instance
  13. $feindura = new Feindura();
  14.  
  15. ?>
  16. <!DOCTYPE html>
  17. <html>
  18. ...
  19.  
  20. <?php
  21.  
  22. // will create a <ul> menu from the non category (ID 0)
  23. $menu = $feindura->createMenu('category',0,'ul');
  24.  
  25. // displays the menu
  26. foreach($menu as $item) {
  27.   echo $item['startTag'].$item['link'];
  28.   // when a page has a submenu it will create a <ul> menu inside this <li></li>,
  29.   // which can be used as a CSS dropdown menu. e.g. see http://www.cssnewbie.com/easy-css-dropdown-menus/
  30.   foreach($feindura->createSubMenuOfPage($item['pageId'],'ul') as $subItem) {
  31.     echo $subItem['menuItem'];
  32.   }
  33.   echo $item['endTag'];
  34. }
  35.  
  36.  
  37.                                *** RESULT *** 
  38. --------------------------------------------------------------------------------
  39.  
  40. <ul>
  41.   <li>
  42.     <a href="?category=1&page=1" title="Example Page 1">
  43.     Example Page 1
  44.     </a>
  45.     
  46.     <ul>
  47.       <li>
  48.         <a href="?category=2&page=4" title="Example Page in SubCategory 1">
  49.         Example Page in SubCategory 1
  50.         </a>
  51.       </li>
  52.       <li>
  53.         <a href="?category=2&page=5" title="Example Page in SubCategory 2">
  54.         Example Page in SubCategory 2
  55.         </a>
  56.       </li>
  57.     </ul>
  58.  
  59.   </li>
  60.   <li>
  61.     <a href="?category=1&page=2" title="Example Page 2">
  62.     Example Page 2
  63.     </a>
  64.   </li>
  65.   <li>
  66.     <a href="?category=1&page=3" title="Example Page 3">
  67.     Example Page 3
  68.     </a>
  69.   </li>
  70. </ul>
  71.  
  72. ?>

Example of the returned Array:
Show Example

  1. <?php
  2.  
  3. array(
  4.   array(
  5.     'menuItem' or 'item' => '<ul>',
  6.     'startTag'           => '<ul>'
  7.     ),
  8.   array(
  9.     'position'           => 'first',
  10.     'active'             => true,
  11.     'menuItem' or 'item' => '<li class="active"><a href="?page=5&category=1" class="active">Example Page 1</a></li>',
  12.     'startTag'           => '<li>',
  13.     'link'               => '<a href="?page=5&category=1" class="active">Example Page 1</a>',
  14.     'endTag'             => '</li>',
  15.     'title'              => 'Example Page 1',
  16.     'href'               => '?page=5&category=1',
  17.     'pageDate'           => '2000-12-31',
  18.     'pageDateTimestamp'  => array(
  19.                     'date'  => 1325393999, // 'date' and 'start' is the same
  20.                     'start' => 1325393999,
  21.                     'end'   => 1325303455 // will be 0 when its not a date range
  22.                     ),
  23.     'pageId' or 'id'     => 5,
  24.     'categoryId'         => 1
  25.     ),
  26.   array(
  27.     'position'           => 2,
  28.     'menuItem' or 'item' => '<li><a href="?page=8&category=1">Example Page 2</a></li>',
  29.     'startTag'           => '<li>',
  30.     'link'               => '<a href="?page=8&category=1">Example Page 2</a>',
  31.     'endTag'             => '</li>',
  32.     'title'              => 'Example Page 2',
  33.     'href'               => '?page=8&category=1',
  34.     'pageDate'           => '2000-10-10',
  35.     'pageDateTimestamp'  => array(
  36.                     'date'  => 1325393465, // 'date' and 'start' is the same
  37.                     'start' => 1325393465,
  38.                     'end'   => 0
  39.                     ),
  40.     'pageId' or 'id'     => 8,
  41.     'categoryId'         => 1
  42.     ),
  43.   array(
  44.     'position'           => 'last',
  45.     'menuItem' or 'item' => '<li><a href="?page=9&category=1">Example Page 3</a></li>',
  46.     'startTag'           => '<li>',
  47.     'link'               => '<a href="?page=9&category=1">Example Page 3</a>',
  48.     'endTag'             => '</li>',
  49.     'title'              => 'Example Page 3',
  50.     'href'               => '?page=9&category=1',
  51.     'pageDate'           => '2000-10-15',
  52.     'pageDateTimestamp'  => array(
  53.                     'date'  => 1325393322, // 'date' and 'start' is the same
  54.                     'start' => 1325393322,
  55.                     'end'   => 0
  56.                     ),
  57.     'pageId' or 'id'     => 9,
  58.     'categoryId'         => 1
  59.     ),
  60.   array(
  61.     'menuItem' or 'item' => '</ul>',
  62.     'endTag'             => '</ul>'
  63.     )
  64.   )
  65.   
  66. ?>


Return Value
  • array - the created sub menu in an array, ready to display in a HTML-page, or an empty array
Additional
  • example: $id parameter example
  • see: createMenuFromCategory()
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • access: public
Uses
  • Feindura::$menuId
  • Feindura::$menuClass
  • Feindura::$menuAttributes
  • Feindura::$linkLength
  • Feindura::$linkId
  • Feindura::$linkClass
  • Feindura::$linkActiveClass
  • Feindura::$linkAttributes
  • Feindura::$linkBefore
  • Feindura::$linkAfter
  • Feindura::$linkBeforeText
  • Feindura::$linkAfterText
  • Feindura::$linkShowThumbnail
  • Feindura::$linkShowThumbnailAfterText
  • Feindura::$linkShowPageDate
  • Feindura::$linkPageDateSeparator
  • Feindura::$linkShowCategory
  • Feindura::$linkCategorySeparator
  • Feindura::$thumbnailAlign
  • Feindura::$thumbnailId
  • Feindura::$thumbnailClass
  • Feindura::$thumbnailAttributes
  • Feindura::$thumbnailBefore
  • Feindura::$thumbnailAfter
  • Feindura::createMenu() - to create the menu
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 2459
array createSubMenuOfSubCategory ( [int|string|bool $categoryId = false],
[int|bool $menuTag = false],
[string|bool $linkText = true],
[bool $sortPages = false],
[bool $reverseList = false])

Parameters

int|string|bool $categoryId (optional) a category ID, or a string with "previous","next","first","last" or "random". If FALSE it uses the Feindura::$category property.
Default false
int|bool $menuTag (optional) the tag which is used to create the menu, can be an "ul", "ol", "array('table',<number until new row>)" or any other tag, if TRUE it uses "div"
Default false
string|bool $linkText (optional) a string with a linktext which all links will use, if TRUE it uses the page titles of the pages, if FALSE no linktext will be used
Default true
bool $sortPages (optional) if TRUE it sorts the pages like they are sorted in the backend, if FALSE they are sorted in the order of the given IDs. Can also be a sort function e.g. "sortByLastSaveDate". See GeneralFunctions::sortPages() for more.
Default false
bool $reverseList (optional) if TRUE the pages sorting will be reversed
Default false

Description

Name createSubMenuOfSubCategory()

Alias createSubMenuOfCategory()
Alias createSubMenuFromSubCategory()
Alias createSubMenuFromCategory()
Alias createMenuFromSubCategory()
Alias createMenuOfSubCategory()

This method uses the $link..., $menu... and $thumbnail... properties.

Creates a sub menu from a subcategory. If the category is not a sub category it will return an empty array.
In case no category with the given page ID exist, or it is not a subcategory it returns an empty array.

Note: The $menuTag parameter can be an "menu", "ul", "ol" or "table", it will then create the necessary child HTML-tags of this element. If its any other tag name it just enclose the links with this HTML-tag.
Note: If the $id parameter is FALSE or empty, it uses the current category (means the Feindura::$category property).
Note: It will add the Feindura::$linkActiveClass property as a CSS class to the link (and also its wrapping element, e.g. <li> or <td>), when the links page is matching the current page, or the current page is a sub page of the links page.

You can use this function in conjunction with Feindura::createSubMenuOfPage() to display the submenu, even if you're in a page of the subcategory.
Show Example

  1.  <?php
  2.  
  3.  // we use "false", because we use the current page and category.
  4.  // NOTE: we need the double (), otherwise it would use the assignment of the $subMenu variable as condition!
  5.  if(($subMenu = $feindura->createSubMenuOfPage(false,'ul')) || // will create the menu when inside the page which has a subcategory
  6.     ($subMenu = $feindura->createMenuOfSubCategory(false,'ul'))) { // will create the menu when inside a page within a subcategory
  7.  
  8.    foreach($subMenu as $item)
  9.      echo $item['menuItem'];
  10.  }
  11.  
  12.  ?>

Example of the returned Array:
Show Example

  1. <?php
  2.  
  3. array(
  4.   array(
  5.     'menuItem' or 'item' => '<ul>',
  6.     'startTag'           => '<ul>'
  7.     ),
  8.   array(
  9.     'position'           => 'first',
  10.     'active'             => true,
  11.     'menuItem' or 'item' => '<li class="active"><a href="?page=5&category=1" class="active">Example Page 1</a></li>',
  12.     'startTag'           => '<li>',
  13.     'link'               => '<a href="?page=5&category=1" class="active">Example Page 1</a>',
  14.     'endTag'             => '</li>',
  15.     'title'              => 'Example Page 1',
  16.     'href'               => '?page=5&category=1',
  17.     'pageDate'           => '2000-12-31',
  18.     'pageDateTimestamp'  => array(
  19.                     'date'  => 1325393999, // 'date' and 'start' is the same
  20.                     'start' => 1325393999,
  21.                     'end'   => 1325303455 // will be 0 when its not a date range
  22.                     ),
  23.     'pageId' or 'id'     => 5,
  24.     'categoryId'         => 1
  25.     ),
  26.   array(
  27.     'position'           => 2,
  28.     'menuItem' or 'item' => '<li><a href="?page=8&category=1">Example Page 2</a></li>',
  29.     'startTag'           => '<li>',
  30.     'link'               => '<a href="?page=8&category=1">Example Page 2</a>',
  31.     'endTag'             => '</li>',
  32.     'title'              => 'Example Page 2',
  33.     'href'               => '?page=8&category=1',
  34.     'pageDate'           => '2000-10-10',
  35.     'pageDateTimestamp'  => array(
  36.                     'date'  => 1325393465, // 'date' and 'start' is the same
  37.                     'start' => 1325393465,
  38.                     'end'   => 0
  39.                     ),
  40.     'pageId' or 'id'     => 8,
  41.     'categoryId'         => 1
  42.     ),
  43.   array(
  44.     'position'           => 'last',
  45.     'menuItem' or 'item' => '<li><a href="?page=9&category=1">Example Page 3</a></li>',
  46.     'startTag'           => '<li>',
  47.     'link'               => '<a href="?page=9&category=1">Example Page 3</a>',
  48.     'endTag'             => '</li>',
  49.     'title'              => 'Example Page 3',
  50.     'href'               => '?page=9&category=1',
  51.     'pageDate'           => '2000-10-15',
  52.     'pageDateTimestamp'  => array(
  53.                     'date'  => 1325393322, // 'date' and 'start' is the same
  54.                     'start' => 1325393322,
  55.                     'end'   => 0
  56.                     ),
  57.     'pageId' or 'id'     => 9,
  58.     'categoryId'         => 1
  59.     ),
  60.   array(
  61.     'menuItem' or 'item' => '</ul>',
  62.     'endTag'             => '</ul>'
  63.     )
  64.   )
  65.   
  66. ?>


Return Value
  • array - the created sub menu in an array, ready to display in a HTML-page, or an empty array
Additional
  • example: See the example of the createSubMenuOfPage() method
  • see: Feindura::createSubMenuOfPage()
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • access: public
Uses
  • Feindura::$menuId
  • Feindura::$menuClass
  • Feindura::$menuAttributes
  • Feindura::$linkLength
  • Feindura::$linkId
  • Feindura::$linkClass
  • Feindura::$linkActiveClass
  • Feindura::$linkAttributes
  • Feindura::$linkBefore
  • Feindura::$linkAfter
  • Feindura::$linkBeforeText
  • Feindura::$linkAfterText
  • Feindura::$linkShowThumbnail
  • Feindura::$linkShowThumbnailAfterText
  • Feindura::$linkShowPageDate
  • Feindura::$linkPageDateSeparator
  • Feindura::$linkShowCategory
  • Feindura::$linkCategorySeparator
  • Feindura::$thumbnailAlign
  • Feindura::$thumbnailId
  • Feindura::$thumbnailClass
  • Feindura::$thumbnailAttributes
  • Feindura::$thumbnailBefore
  • Feindura::$thumbnailAfter
  • Feindura::createMenu() - to create the menu
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 2567
array createLanguageMenu ( [int|bool $menuTag = false],
[string|bool $linkText = true])

Parameters

int|bool $menuTag (optional) the tag which is used to create the menu, can be an "ul", "ol", "array('table',<number until new row>)" or any other tag, if TRUE it uses "div"
Default false
string|bool $linkText (optional) a string with a linktext which all links will use, if TRUE it uses the page titles of the pages, if FALSE no linktext will be used
Default true

Description

Name createLanguageMenu()
Alias createLanguagesMenu()

This method uses the $link..., $menu... properties.

Creates a menu as language selection for the multi language website feature. In case that the multi language website feature is deactivated it returns an empty array.

Note: The $menuTag parameter can be an "menu", "ul", "ol" or "table", it will then create the necessary child HTML-tags for this element. If its any other tag name it just enclose the links with this HTML-tag.
Note: It will add the Feindura::$linkActiveClass property as CSS class to the link, which is matching the current language.

Example Usage:
Show Example

  1. <?php
  2. /*                               *** CODE *** 
  3. --------------------------------------------------------------------------------
  4. This example uses no extra properties. To see an example using all the properties, see the createMenu() method example.
  5. */
  6.  
  7. // a session will be started in the "feindura.include.php",
  8. // therefor you have to include this file before the header of the HTML page is sent,
  9. // which means before any HTML Tag.
  10. require('cms/feindura.include.php');
  11.  
  12. // creates a new Feindura instance
  13. $feindura = new Feindura();
  14.  
  15. ?>
  16. <!DOCTYPE html>
  17. <html>
  18. ...
  19.  
  20. <?php
  21.  
  22. // will create a <ul> language menu
  23. $menu = $feindura->createLanguageMenu('ul.langMenu');
  24.  
  25. // displays the menu
  26. foreach($menu as $item) {
  27.   echo $item['item'];
  28. }
  29.  
  30.  
  31.                                *** RESULT *** 
  32. --------------------------------------------------------------------------------
  33.  
  34. <ul class="langMenu">
  35.   <li><a href="/en/page/current-page-with-english-title" title="English">
  36.   English
  37.   </a></li>
  38.   <li><a href="/nl/page/current-page-with-dutch-title" title="Dutch">
  39.   Dutch
  40.   </a></li>
  41. </ul>
  42.  
  43. ?>

Example of the returned Array:
Show Example

  1. <?php
  2.  
  3. array(
  4.   array(
  5.     'menuItem' or 'item' => '<ul>',
  6.     'startTag'           => '<ul>'
  7.     ),
  8.   array(
  9.     'position'           => 'first',
  10.     'active'             => true,
  11.     'menuItem' or 'item' => '<li class="active"><a href="/en/page/english-page" class="active">English</a></li>',
  12.     'startTag'           => '<li>',
  13.     'link'               => '<a href="/en/page/english-page" class="active">English</a>',
  14.     'endTag'             => '</li>',
  15.     'href'               => '/en/page/english-page',
  16.     'flag'               => '/cms/library/images/icons/flags/en.png',
  17.     'language'           => 'en'
  18.     ),
  19.   array(
  20.     'position'           => 2,
  21.     'menuItem' or 'item' => '<li><a href="/de/page/deutsche-seite">German</a></li>',
  22.     'startTag'           => '<li>',
  23.     'link'               => '<a href="/de/page/deutsche-seite">German</a>',
  24.     'endTag'             => '</li>',
  25.     'href'               => '/de/page/deutsche-seite',
  26.     'flag'               => '/cms/library/images/icons/flags/de.png',
  27.     'language'           => 'de'
  28.     ),
  29.   array(
  30.     'position'           => 'last',
  31.     'menuItem' or 'item' => '<li><a href="/fr/page/french-site">French</a></li>',
  32.     'startTag'           => '<li>',
  33.     'link'               => '<a href="/fr/page/french-site">French</a>',
  34.     'endTag'             => '</li>',
  35.     'href'               => '/fr/page/french-site',
  36.     'flag'               => '/cms/library/images/icons/flags/fr.png',
  37.     'language'           => 'fr'
  38.     ),
  39.   array(
  40.     'menuItem' or 'item' => '</ul>',
  41.     'endTag'             => '</ul>'
  42.     )
  43.   )
  44.   
  45. ?>


Return Value
  • array - the created menu in an array, ready to display in a HTML-page, or an empty array
Additional
  • access: public
Uses
  • Feindura::$menuId
  • Feindura::$menuClass
  • Feindura::$menuAttributes
  • Feindura::$linkLength
  • Feindura::$linkId
  • Feindura::$linkClass
  • Feindura::$linkActiveClass
  • Feindura::$linkAttributes
  • Feindura::$linkBefore
  • Feindura::$linkAfter
  • Feindura::$linkBeforeText
  • Feindura::$linkAfterText
  • Feindura::$adminConfig
  • FeinduraBase::generateMenu() - to generate the final menu
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 2698
array createBreadCrumbsMenu ( [int|string|array|bool $id = false],
[string|false $separator = ' > '],
[int|bool $menuTag = false])

Parameters

int|string|array|bool $id (optional) a page ID, array with page and category ID, or a string/array with "previous","next","first","last" or "random". If FALSE it uses the Feindura::$page property.
See Additional -> $id parameter example

Default false
string|false $separator (optional) a string which will be used as separator or FALSE to dont use a separator string
Default ' > '
int|bool $menuTag (optional) the tag which is used to create the menu, can be an "ul", "ol", "array('table',<number until new row>)" or any other tag, if TRUE it uses "div"
Default false

Description

Name createBreadCrumbsMenu()

Alias createBreadCrumbMenu()
Alias createBreadCrumbs()
Alias createBreadCrumb()

This method uses the $link..., $menu... and $thumbnail... properties.

Creates a breadcrumb navigation for the given page. In case no page with the given category or page ID(s) exist it returns an empty array.

Note: If the $id parameter is FALSE or empty, it uses the current page (means the Feindura::$page property).
Note: The $menuTag parameter can be an "menu", "ul", "ol" or "table", it will then create the necessary child HTML-tags for this element. If its any other tag name it just enclose the links with this HTML-tag.

Example of the returned Array:
Show Example

  1. <?php
  2.  
  3. array(
  4.   array(
  5.     'menuItem' or 'item' => '<ul>',
  6.     'startTag'           => '<ul>'
  7.     ),
  8.   array(
  9.     'position'           => 'first',
  10.     'active'             => true,
  11.     'menuItem' or 'item' => '<li class="active"><a href="?page=5&category=1" class="active">Example Page 1</a></li>',
  12.     'startTag'           => '<li>',
  13.     'link'               => '<a href="?page=5&category=1" class="active">Example Page 1</a>',
  14.     'endTag'             => '</li>',
  15.     'title'              => 'Example Page 1',
  16.     'href'               => '?page=5&category=1',
  17.     'pageDate'           => '2000-12-31',
  18.     'pageDateTimestamp'  => array(
  19.                     'date'  => 1325393999, // 'date' and 'start' is the same
  20.                     'start' => 1325393999,
  21.                     'end'   => 1325303455 // will be 0 when its not a date range
  22.                     ),
  23.     'pageId' or 'id'     => 5,
  24.     'categoryId'         => 1
  25.     ),
  26.   array(
  27.     'position'           => 2,
  28.     'menuItem' or 'item' => '<li><a href="?page=8&category=1">Example Page 2</a></li>',
  29.     'startTag'           => '<li>',
  30.     'link'               => '<a href="?page=8&category=1">Example Page 2</a>',
  31.     'endTag'             => '</li>',
  32.     'title'              => 'Example Page 2',
  33.     'href'               => '?page=8&category=1',
  34.     'pageDate'           => '2000-10-10',
  35.     'pageDateTimestamp'  => array(
  36.                     'date'  => 1325393465, // 'date' and 'start' is the same
  37.                     'start' => 1325393465,
  38.                     'end'   => 0
  39.                     ),
  40.     'pageId' or 'id'     => 8,
  41.     'categoryId'         => 1
  42.     ),
  43.   array(
  44.     'position'           => 'last',
  45.     'menuItem' or 'item' => '<li><a href="?page=9&category=1">Example Page 3</a></li>',
  46.     'startTag'           => '<li>',
  47.     'link'               => '<a href="?page=9&category=1">Example Page 3</a>',
  48.     'endTag'             => '</li>',
  49.     'title'              => 'Example Page 3',
  50.     'href'               => '?page=9&category=1',
  51.     'pageDate'           => '2000-10-15',
  52.     'pageDateTimestamp'  => array(
  53.                     'date'  => 1325393322, // 'date' and 'start' is the same
  54.                     'start' => 1325393322,
  55.                     'end'   => 0
  56.                     ),
  57.     'pageId' or 'id'     => 9,
  58.     'categoryId'         => 1
  59.     ),
  60.   array(
  61.     'menuItem' or 'item' => '</ul>',
  62.     'endTag'             => '</ul>'
  63.     )
  64.   )
  65.   
  66. ?>


Return Value
  • array - the created breadcrumb navigation, or an empty array
Additional
  • example: $id parameter example
  • access: public
Uses
  • Feindura::$menuId
  • Feindura::$menuClass
  • Feindura::$menuAttributes
  • Feindura::$linkLength
  • Feindura::$linkId
  • Feindura::$linkClass
  • Feindura::$linkActiveClass
  • Feindura::$linkAttributes
  • Feindura::$linkBefore
  • Feindura::$linkAfter
  • Feindura::$linkBeforeText
  • Feindura::$linkAfterText
  • Feindura::$linkShowThumbnail
  • Feindura::$linkShowThumbnailAfterText
  • Feindura::$linkShowPageDate
  • Feindura::$linkPageDateSeparator
  • Feindura::$linkShowCategory - This is set to FALSE for all links, which are in a sub category (So the sub category name doesn't appear). You can change the separator between the category and the page name by setting the Feindura::$linkCategorySeparator
  • Feindura::$linkCategorySeparator
  • Feindura::$thumbnailAlign
  • Feindura::$thumbnailId
  • Feindura::$thumbnailClass
  • Feindura::$thumbnailAttributes
  • Feindura::$thumbnailBefore
  • Feindura::$thumbnailAfter
  • FeinduraBase::getIdsFromString() - to load the right page and category IDs depending on the $ids parameter
  • Feindura::readPage()
  • GeneralFunctions::getParentPages() - to get the parent pages in an array
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 2828
string showTitle ( [int|string|array|bool $id = false])

Parameters

int|string|array|bool $id (optional) a page ID, array with page and category ID, or a string/array with "previous","next","first","last" or "random". If FALSE it uses the Feindura::$page property.
See Additional -> $id parameter example

Default false

Description

Name showTitle()
Alias getPageTitle()
Alias getTitle()

This method uses the $title... properties.

Returns the title of a page. This page title will be generated using the title properties.

Note: If the $id parameter is empty or FALSE it uses the Feindura::$page property.

Example:
Show Example

  1. <?php
  2. /*                               *** CODE *** 
  3. --------------------------------------------------------------------------------
  4. This example uses all possible properties.
  5. It's also works much more simple: just call createLink(1) without setting properties
  6. and you have a simple link with the page title.
  7. */
  8.  
  9. // a session will be started in the "feindura.include.php",
  10. // therefor you have to include this file before the header of the HTML page is sent,
  11. // which means before any HTML Tag.
  12. require('cms/feindura.include.php');
  13.  
  14. // creates a new Feindura instance
  15. $feindura = new Feindura();
  16.  
  17. ?>
  18. <!DOCTYPE html>
  19. <html>
  20. ...
  21.  
  22. <?php
  23.  
  24. // set title properties
  25. $feindura->titleLength =              10;
  26. $feindura->titleAsLink =              true;
  27. $feindura->titleShowPageDate =        true;
  28. $feindura->titlePageDateSeparator =   ' - ';
  29. $feindura->titleShowCategory =        true;
  30. $feindura->titleCategorySeparator =   ' -> ';
  31.  
  32.  
  33. // finally create the title from the page with ID "1" using the above set title properties
  34. $title = $feindura->getPageTitle(1);
  35.  
  36. // displays the link
  37. echo $title;
  38.  
  39.  
  40.                                *** RESULT *** 
  41. --------------------------------------------------------------------------------
  42.  
  43. <a href="?category=1&amp;page=3" title="Example Category 1 -> 31.12.2010 - Example Page">
  44. Example Category -> 31.12.2010 - Example...
  45. </a>
  46.  
  47. ?>


Return Value
  • string - the generated page title, ready to display in a HTML-page, or FALSE if the page doesn't exist or is not public
Additional
  • example: $id parameter example
  • see: FeinduraBase::createTitle()
  • access: public
Uses
  • Feindura::$titleLength
  • Feindura::$titleAsLink
  • Feindura::$titleShowPageDate
  • Feidnura::$titlePageDateSeparator
  • Feindura::$titleShowCategory
  • Feindura::$titleCategorySeparator
  • FeinduraBase::getIdsFromString() - to load the right page and category IDs depending on the $ids parameter
  • FeinduraBase::createTitle() - to generate the page title with the right title properties
  • GeneralFunctions::getPageCategory() - to get the category of the page
  • GeneralFunctions::isPublicCategory() - to check whether the category is public
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 2936
array showPage ( [int|string|array|bool $id = false],
[int|array|bool $shortenText = false],
[bool|string $useHtml = true])

Parameters

int|string|array|bool $id (optional) a page ID, array with page and category ID, or a string/array with "previous","next","first","last" or "random". If FALSE it uses the Feindura::$page property.
See Additional -> $id parameter example

Default false
int|array|bool $shortenText (optional) number of the maximal text length displayed, adds a "more" link at the end or FALSE to not shorten. You can also pass an array: value 1: text length as int, value 2: text string for the link, or a link string. e.g. array(23,false), array(23,'read more'), or array(23,'<a href="%href%"'>read more</a>'). (the %href% will be replaced by the pages href)
Default false
bool|string $useHtml (optional) whether the content of the page has HTML-tags or not. It also accepts a string with allowed html tags.
Default true

Description

Name showPage()
Alias showPages()

This method uses the $error..., $title... and $thumbnail... properties.

Returns an array which contains all elements of the page, ready for displaying in a HTML-page.

In case the page doesn't exists or is not public and the Feindura::$showErrors property is TRUE, an error will be placed in the ['content'] part of the returned array, otherwiese it returns an empty array.

Note: If the $id parameter is empty or FALSE it uses the Feindura::$page property.

Example usage:
Show Example

  1. <?php
  2. /*                               *** SIMPLE EXAMPLE *** 
  3. -------------------------------------------------------------------------------- */
  4.  
  5. // add before any HTML Tag. (eg. before the <!doctype html>)
  6. require('cms/feindura.include.php');
  7.  
  8. // creates a new Feindura instance
  9. $feindura = new Feindura();
  10.  
  11. ?>
  12. <!DOCTYPE html>
  13. <html>
  14. ...
  15.  
  16. <?php
  17.  
  18. // get the page, which is currently selected, if not page is selected it uses the $feindura->startPage property
  19. $currentPage = $feindura->showPage();
  20.  
  21. // displays the page
  22. echo '<h1>'.$page['title'].'</h1>';
  23. echo $page['content'];
  24.  
  25.  
  26.                                *** RESULT *** 
  27. --------------------------------------------------------------------------------
  28.  
  29. <h1>Example Page 1</h1>
  30.  
  31. <p>Lorem ipsum dolor sit amet, consetetur sadipscing dolores et ea rebum.
  32. Stet clita kasd gubergren, no sea takimata sanctus.</p>
  33.  
  34.  
  35. /*                               *** EXTENDED EXAMPLE *** 
  36. --------------------------------------------------------------------------------
  37. This example uses all possible properties.
  38. It's also works much more simple: just call showPage() without setting properties
  39. and it shows the current page given by the $_GET variable.
  40. */
  41.  
  42. // add before any HTML Tag. (eg. before the <!doctype html>)
  43. require('cms/feindura.include.php');
  44.  
  45. // creates a new Feindura instance
  46. $feindura = new Feindura();
  47.  
  48. // set properties
  49. $feindura->xHtml =                  true;
  50.  
  51. $feindura->titleLength =            20;
  52. $feindura->titleAsLink =            true;
  53. $feindura->titleShowPageDate =      true;
  54. $feindura->titlePageDateSeparator = ' - ';
  55. $feindura->titleShowCategory =      false; // would have no effect, because page with ID "1" has no category
  56. $feindura->titleCategorySeparator = ' -> '; // would have no effect, because $titleShowCategory = FALSE
  57.  
  58. $feindura->thumbnailAlign =         'left';
  59. $feindura->thumbnailId =            'thumbId';
  60. $feindura->thumbnailClass =         'thumbCLass';
  61. $feindura->thumbnailAttributes =    'test="exampleAttribute1" onclick="exampleAttribute2"';
  62. $feindura->thumbnailBefore =        false;
  63. $feindura->thumbnailAfter =         false;
  64.  
  65. $feindura->showErrors =              true;
  66. $feindura->errorTag =               'div.alertClass';
  67.  
  68.  
  69. // finally, get the page, with ID "1", using the above set properties
  70. $page = $feindura->showPage(1);
  71.  
  72. // displays the page (the "\n" creates a line break for a better look)
  73. echo $page['title'];
  74. echo $page['thumbnail'];
  75. echo $page['content'];
  76.  
  77.  
  78.                                *** RESULT *** 
  79. --------------------------------------------------------------------------------
  80.  
  81. <a href="?page=1" title="2010-12-31 - Example Page">
  82. 2010-12-31 - Example...
  83. </a>
  84. <img src="/path/thumb_page3.png" class="feinduraThumbnail" alt="Thumbnail" title="Example Page 1" id="thumbId"
  85. class="thumbCLass" test="exampleAttribute1" onclick="exampleAttribute2" style="float:left;">
  86.  
  87. <h2>Example Headline</h2>
  88. <p>Lorem ipsum dolor sit amet, consetetur sadipscing dolores et ea rebum.
  89. Stet clita kasd gubergren, no sea takimata sanctus.</p>
  90. <p>Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
  91. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam...</p>
  92.  
  93.  
  94.                           *** RESULT with error *** 
  95. --------------------------------------------------------------------------------
  96.  
  97.  
  98. <div class="alertClass">
  99. The requested page is deactivated.
  100. </div>
  101.  
  102. ?>

Example of the returned array:
Show Example

  1. <?php
  2.  
  3. array(
  4.   'pageId' or 'id'    => 1,
  5.   'category'          => 'Example Category',
  6.   'categoryId'        => 3,
  7.   'subCategory'       => 'Another Category',
  8.   'subCategoryId'     => 4,
  9.   'pageDate'          => '2000-12-31 - 2010-01-15', // depending on the date format settings in the backend
  10.   'pageDateTimestamp'  => array(
  11.                     'date'  => 1325393999, // 'date' and 'start' is the same
  12.                     'start' => 1325393999,
  13.                     'end'   => 1325303455 // will be 0 when its not a date range
  14.                     ),
  15.   'title'             => 'Title Example',
  16.   'thumbnail'         => '<img src="/path/thumb_page1.png" class="feinduraThumbnail" alt="Thumbnail" title="Title Example">',
  17.   'thumbnailPath'     => '/path/thumb_page1.png',
  18.   'content'           => "\n".'<p>Content Text</p>'."\n",
  19.   'description'       => 'Short description of the page',
  20.   'tags'              => 'tag1,tag2,tag3',
  21.   'href'              => '?category=3&page=1', // or a speaking url, if activated
  22.   'plugins'           => array( // each activated plugin with its page specific settings
  23.           'imageGallery' => array(
  24.               'active'          => true,
  25.               'galleryPath'     => '/upload/gallery/',
  26.               'imageWidth'      => 800,
  27.               'imageHeight'     => null,
  28.               'thumbnailWidth'  => 160,
  29.               'thumbnailHeight' => null,
  30.               'tag'             => 'table',
  31.               'breakAfter'      => 3
  32.           ),
  33.           'pageRating' => array(
  34.               'active' => false,
  35.               'value'  => 0,
  36.               'votes'  => 0
  37.           )
  38.       ),
  39.   'error'             => false // will be set to TRUE when the page doesn't exist or is deactivated
  40.   )
  41.  
  42. ?>


Return Value
  • array - with the page elements, ready to display in a HTML-page, or FALSE if the page doesn't exist or is not public
Additional
  • example: $id parameter example
  • see: getPageTitle()
  • see: FeinduraBase::generatePage()
  • access: public
Uses
  • Feindura::$page
  • Feindura::$xHtml
  • Feindura::$showErrors
  • Feindura::$errorTag
  • Feindura::$titleLength
  • Feindura::$titleAsLink
  • Feindura::$titleShowPageDate
  • Feindura::$titlePageDateSeparator
  • Feindura::$titleShowCategory
  • Feindura::$titleCategorySeparator
  • Feindura::$thumbnailAlign
  • Feindura::$thumbnailId
  • Feindura::$thumbnailClass
  • Feindura::$thumbnailAttributes
  • Feindura::$thumbnailBefore
  • Feindura::$thumbnailAfter
  • FeinduraBase::getIdsFromString() - to load the right page and category IDs depending on the $ids parameter
  • FeinduraBase::generatePage() - to generate the array with the page elements
  • GeneralFunctions::getPageCategory() - to get the category of the page
Version
  • 1.0.1
    ChangeLog
    • 1.0.1 fixed display of error, was not working anymore
    • 1.0 initial release

File source:
line 2996
bool hasPlugins ( [string|array|true $plugins = true],
[int|string|bool $ids = false])

Parameters

string|array|true $plugins (optional) the plugin name or an array with plugin names or TRUE to load all plugins
Default true
int|string|bool $ids a page ID, or a string/array with "previous","next","first","last" or "random". If FALSE it uses the Feindura::$page property. (See examples) (can also be a $pageContent array)
Default false

Description

Name hasPlugins()

Alias hasPlugin()
Alias isPlugins()
Alias isPlugin()

Check whether the given plugin(s) are activated for the given page.

Note: If the $ids parameter is empty or FALSE it uses the Feindura::$page property.

Example $ids parameters:
Show Example

  1. <?php
  2.   // The "next","previous","first" and "last" is always relative to the current $this->page and $this->category property.
  3.   // If there is an ID, "prev" or "next" for the page value, it will always discard the category value and load the right page.
  4.   // Note: When using "previous","next","first" or "last" it will jump over pages/categories which are not public and return the next one.
  5.  
  6.   empty                  // load the current page
  7.   false/true             // same as above
  8.   array(false,false)     // same as above
  9.  
  10.   2                      // load page with ID 2
  11.   'rand'                 // load a random page of the current category
  12.   array('rand',false)    // same as above
  13.  
  14.   'next'                 // load the next page in the current category
  15.   array('next',false)    // the same as above
  16.   array('next','rand')   // the same as above (it would discard the category ID)
  17.   array(2,45)            // load the page with ID 2 (it would discard the category ID)
  18.  
  19.   array(false,3)         // load the first page of category with ID 3
  20.  
  21.   array(false,'next')    // load the first page of the next category
  22.   array(false,'prev')    // load the first page of the previous category
  23.  
  24.   array('last',false)    // load the last page of the current category
  25.   array('last','next')   // load the last page of the next category
  26.   array('first','last')  // load the first page of the last category
  27.  
  28.   array('rand','next')   // load a random page of the next category
  29.   array('rand','rand')   // load a random page of a random category
  30.   array('first','rand')  // load the first page of a random category
  31.  
  32.   ...
  33.  
  34. ?>


Return Value
  • bool - whether the plugin(s) are activated or not
Additional
  • see: getPageTitle()
  • see: Feindura::showPlugins()
  • see: FeinduraBase::generatePage()
  • access: public
Uses
  • Feindura::$page
  • Feindura::showPlugins() - to check for the activated plugins
  • FeinduraBase::getIdsFromString() - to load the right page and category IDs depending on the $ids parameter
  • FeinduraBase::generatePage() - to generate the array with the page elements
  • GeneralFunctions::getPageCategory() - to get the category of the page
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 3070
array|string|false showPlugins ( [string|array|true $plugins = true],
[int|string|array|bool $id = false],
[string|false $divStyles = false],
[bool $returnPlugin = true])

Parameters

string|array|true $plugins (optional) the plugin name or an array with plugin names or TRUE to load all plugins. If its a plugin name and you want the plugin number 2. etc, you need to add the plugin number like "imageGallery#2".
Default true
int|string|array|bool $id (optional) a page ID, array with page and category ID, or a string/array with "previous","next","first","last" or "random". If FALSE it uses the Feindura::$page property.
See Additional -> $id parameter example

Default false
string|false $divStyles (optional) a string with styles, which will be add to the warapping div of the plugin. In the format: "witdh: 200px; height: 100px;"
Default false
bool $returnPlugin (optional) whether the plugin is returned, or only a boolean to check if the plugin is available for that page (used by Feindura::hasPlugins())
Default true

Description

Name showPlugins()
Alias showPlugin()

Returns the plugin(s) of a page ready for displaying in a HTML page. It can return an array where each element contain the HTML of a plugin (only the activated ones), or if the $plugins parameter is a string with a plugin name (the foldername of the plugin, inside "../feindura_folder/plugins/"), it returns only a string with the HTML of this plugin.

Note: If the $id parameter is empty or FALSE it uses the Feindura::$page property.

Example usage:
Show Example

  1. <?php
  2. /*                               *** CODE *** 
  3. --------------------------------------------------------------------------------
  4. This example gets all plugins which are activated in the page with ID "2".
  5. You can also request only single plugins, it will then only return a string, with the HTML of the plugin.
  6. */
  7.  
  8. // a session will be started in the "feindura.include.php",
  9. // therefor you have to include this file before the header of the HTML page is sent,
  10. // which means before any HTML Tag.
  11. require('cms/feindura.include.php');
  12.  
  13. // creates a new Feindura instance
  14. $feindura = new Feindura();
  15.  
  16. ?>
  17. <!DOCTYPE html>
  18. <html>
  19. ...
  20.  
  21. <?php
  22.  
  23. // get the all plugins from the page with ID "2"
  24. $plugins = $feindura->showPlugins(true,2);
  25. // you could also call
  26. // $plugins = $feindura->showPlugins('imageGallery');
  27. // it would get the imageGallery plugin of the current page
  28.  
  29. // displays the page (the "\n" creates a line break for a better look)
  30. foreach($plugins as $plugin) {
  31.   echo $plugin;
  32.   echo '------';
  33. }
  34.  
  35.  
  36.                                *** RESULT *** 
  37. --------------------------------------------------------------------------------
  38.  
  39. <p>HTML created by the Plugin</p>
  40. <span>What it is depends on the plugin :-)</span>
  41. -----
  42. <h1>Another plugin which follows the first one</h1>
  43. <p>You can also call specific plugins directly. To do that
  44. give it the plugin name, instead of "TRUE".</p>
  45. -----
  46.  
  47. ?>

Example of the returned array:
Show Example

  1. <?php
  2. /* If you call this method and you give as $plugin parameter only a string with a pluginName,
  3. it returns only a string with this plugin content */
  4.  
  5. $plugins['aPlugin']     = '<p>HTML code created by the Plugin</p>
  6.                              <span>What it is depends on the plugin</span>';
  7. $plugins['anotherPlugin'] = '<p>Another plugin resulting HTML code</p>';
  8. ...
  9.  
  10. return $plugins;
  11.   
  12. ?>


Return Value
  • array|string|false - If a single plugin name is given it returns the plugins HTML-code, ready to display in a HTML-page, otherwise array with plugins, an empty array, or FALSE if the plugin(s) or page doesn't exist or the page is not public
Additional
  • see: getPageTitle()
  • see: FeinduraBase::generatePage()
  • example: $id parameter example
  • access: public
Used By
  • Feindura::hasPlugins() - to check for the activated plugins
Uses
  • Feindura::$page
  • FeinduraBase::getIdsFromString() - to load the right page and category IDs depending on the $ids parameter
  • FeinduraBase::generatePage() - to generate the array with the page elements
  • GeneralFunctions::getPageCategory() - to get the category of the page
Version
  • 1.1
    ChangeLog
    • 1.1 add plugin numbers, to be able to add multile plugins of the same type
    • 1.0 initial release

File source:
line 3203
array|false hasTags ( string|array $tags,
string $idType,
int|array|bool $ids)

Parameters

string|array $tags an string (seperated by ",") or an array with tags to compare
string $idType the ID(s) type can be "cat", "category", "categories" or "pag", "page" or "pages"
int|array|bool $ids the category or page ID(s), can be a number or an array with numbers, if TRUE it checks all pages tags

Description

Name hasTags()

Load the $pagesMetaData array of pages which have one or more tags from the given $tags parameter.
Can be used to count pages with specific tags, like in the following example.
Show Example

  1.  <?php
  2.  
  3.  include('cms/feindura.include.php');
  4.  $feindura = new Feindura();
  5.  
  6.  echo $feindura->hasTags('example tag', 'category', 1);
  7.  
  8.  // RESULT
  9.  3 (means 3 pages in category 1 have the 'example tag')
  10.  
  11.  ?>

Note: the tags will be compared case insensitive.


Return Value
  • array|false - an array of $pageContent arrays or FALSE if no $pageContent array has any of the given tags
Additional
  • access: public
Uses
  • FeinduraBase::checkPagesForTags() - to check pages for tags
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 3282
array listPages ( [string $idType = 'category'],
[int|array|bool $ids = false],
[int|array|bool $shortenText = false],
[bool|string $useHtml = true],
[bool $sortPages = false],
[bool $reverseList = false])

Parameters

string $idType (optional) the ID(s) type can be "cat", "category", "categories" or "pag", "page" or "pages"
Default 'category'
int|array|bool $ids (optional) the category or page ID(s), can be a number or an array with numbers (can also be a $pageContent array), if TRUE it loads all pages, if FALSE it uses the Feindura::$page or Feindura::$category property
Default false
int|array|bool $shortenText (optional) number of the maximal text length displayed, adds a "more" link at the end or FALSE to not shorten. You can also pass an array: value 1: text length as int, value 2: text string for the link, or a link string. e.g. array(23,false), array(23,'read more'), or array(23,'<a href="%href%"'>read more</a>'). (the %href% will be replaced by the pages href)
Default false
bool|string $useHtml (optional) whether the content of the page has HTML-tags or not. It also accepts a string with allowed html tags.
Default true
bool $sortPages (optional) if TRUE it sorts the pages like they are sorted in the backend, if FALSE they are sorted in the order of the given IDs. Can also be a sort function e.g. "sortByLastSaveDate". See GeneralFunctions::sortPages() for more.
Default false
bool $reverseList (optional) if TRUE the pages sorting will be reversed
Default false

Description

Name listPages()
Alias listPage()

This method uses the $error..., $title... and $thumbnail... properties.

List pages by given category(ies) or page(s).

Returns an array with multiple pages for displaying in a HTML-page.

In case no page with the given category or page ID(s) exist it returns an empty array.

Note: If the $ids parameter is FALSE it uses the Feindura::$page or Feindura::$category property depending on the $idType parameter.

Example usage:
Show Example

  1. <?php
  2. /*                               *** SIMPLE EXAMPLE *** 
  3. -------------------------------------------------------------------------------- */
  4.  
  5. // add before any HTML Tag. (eg. before the <!doctype html>)
  6. require('cms/feindura.include.php');
  7.  
  8. // creates a new Feindura instance
  9. $feindura = new Feindura();
  10.  
  11. ?>
  12. <!DOCTYPE html>
  13. <html>
  14. ...
  15.  
  16. <?php
  17.  
  18. // Get the pages from the category with ID "1"
  19. // the page content will be shorten to "200" characters
  20. $pages = $feindura->listPages('category',1,200);
  21.  
  22. // displays the pages
  23. foreach($pages as $page) {
  24.   echo '<h1>'.$page['title'].'</h1>';
  25.   echo $page['content'];
  26.   echo '<br>-----------------------<br>\n';
  27. }
  28.  
  29.                                *** RESULT *** 
  30. --------------------------------------------------------------------------------
  31.  
  32. <h1>Example Page 1</h1>
  33. <p>Lorem ipsum dolor sit amet, consetetur sadipscing dolores et ea rebum.
  34. Stet clita kasd gubergren, no sea takimata sanctus.</p>
  35. <a href="?category=1&amp;page=1">mehr</a>
  36.  
  37. <br>-----------------------<br>
  38.  
  39. <h1>Example Page 2</h1>
  40. <p>Lorem ipsum dolor sit amet, consetetur sadipscing dolores et ea rebum.
  41. Stet clita kasd gubergren, no sea takimata sanctus.</p>
  42. <a href="?category=1&amp;page=2">mehr</a>
  43.  
  44. <br>-----------------------<br>
  45.  
  46.  
  47. /*                               *** EXTENDED EXAMPLE *** 
  48. --------------------------------------------------------------------------------
  49. This example uses all possible properties.
  50. It's also works much more simple: just call listPages() without setting properties
  51. and list the current category given by $_GET variable.
  52. */
  53.  
  54. // add before any HTML Tag. (eg. before the <!doctype html>)
  55. require('cms/feindura.include.php');
  56.  
  57. // creates a new Feindura instance
  58. $feindura = new Feindura();
  59.  
  60. // set properties
  61. $feindura->xHtml =                  true;
  62.  
  63. $feindura->showErrors =              true;
  64. $feindura->errorTag =               'div.alertClass';
  65.  
  66. $feindura->titleLength =            20;
  67. $feindura->titleAsLink =            true;
  68. $feindura->titleShowPageDate =      true;
  69. $feindura->titlePageDateSeparator = ' - ';
  70. $feindura->titleShowCategory =      false;
  71. $feindura->titleCategorySeparator = ' -> '; // has no effect, because $titleShowCategory = FALSE
  72.  
  73. $feindura->thumbnailAlign =         'left';
  74. $feindura->thumbnailId =            'thumbId';
  75. $feindura->thumbnailClass =         'thumbCLass';
  76. $feindura->thumbnailAttributes =    'test="exampleAttribute1" onclick="exampleAttribute2"';
  77. $feindura->thumbnailBefore =        false;
  78. $feindura->thumbnailAfter =         false;
  79.  
  80.  
  81. // finally get the pages from the category with ID "1" and "2" using the above set properties
  82. // the page content will be shorten to "200" characters
  83. $pages = $feindura->listPages('category',array(1,2),200,true,true);
  84.  
  85. // displays the pages
  86. foreach($pages as $page) {
  87.   echo $page['title'];
  88.   echo $page['thumbnail'];
  89.   echo $page['content'];
  90.   echo '<br>-----------------------<br>\n';
  91. }
  92.  
  93.  
  94.                                *** RESULT ***
  95. --------------------------------------------------------------------------------
  96.  
  97.  
  98. <a href="?category=1&amp;page=2" title="2010-12-31 - Example Page 2">
  99. 2010-12-31 - Example...
  100. </a>
  101. <h2>Example Headline 2</h2>
  102. <p>Lorem ipsum dolor sit amet, consetetur sadipscing dolores et ea rebum.
  103. Stet clita kasd gubergren, no sea takimata sanctus.</p>
  104. <a href="?category=1&amp;page=2">mehr</a>
  105.  
  106. <br>-----------------------<br>
  107.  
  108. <a href="?category=1&amp;page=3" title="2010-12-31 - Example Page 2">
  109. 2010-12-31 - Example...
  110. </a>
  111. <h2>Another Example Headline</h2>
  112. <p>Lorem ipsum dolor sit amet, consetetur sadipscing dolores et ea rebum.</p>
  113. <h2>And one more Example Headline</h2>
  114. <p>Stet clita kasd gubergren, no sea takimata sanctus est...</p>
  115. <a href="?category=1&amp;page=3">mehr</a>
  116.  
  117. <br>-----------------------<br>
  118.  
  119. <a href="?category=2&amp;page=1" title="Example Page 1">
  120. Example Page 1
  121. </a>
  122. <img src="/path/thumb_page3.png" class="feinduraThumbnail" alt="Thumbnail" title="Example Page 1" id="thumbId"
  123. class="thumbCLass" test="exampleAttribute1" onclick="exampleAttribute2" style="float:left;">
  124. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
  125. invidunt ut labore et dolore magna aliquyam erat, ur sadipscing elitr,
  126. Stet clita kasd...</p>
  127. <a href="?category=2&amp;page=1">mehr</a>
  128.  
  129. <br>-----------------------<br>
  130.  
  131. ?>

Example of the returned array:
Show Example

  1. <?php
  2.  
  3. array(
  4.  
  5.   0 => array(
  6.     'position'          => 'first', // is the first page in the returned pages list
  7.     'pageId' or 'id'    => 1,
  8.     'category'          => 'A Category',
  9.     'categoryId'        => 1,
  10.     'subCategory'       => 'Another Category',
  11.     'subCategoryId'     => 2,
  12.     'pageDate'          => '2010-12-31', // format depending on the administrator-settings
  13.     'pageDateTimestamp'  => array(
  14.                     'date'  => 1325393999, // 'date' and 'start' is the same
  15.                     'start' => 1325393999,
  16.                     'end'   => 0
  17.                     ),
  18.     'title'             => 'Title Example 1',
  19.     'thumbnail'         => false, // page has no thumbnail
  20.     'thumbnailPath'     => false,
  21.     'content'           => "\n".'<p>Content Text</p>'."\n",
  22.     'description'       => 'Short description of the page',
  23.     'tags'              => 'tag1,tag2,tag3',
  24.     'href'              => '?category=1&page=1', // or a speaking url, if activated
  25.     'plugins'           => array (
  26.         'imageGallery' => array(
  27.                 'galleryPath'     => '',
  28.                 'imageWidth'      => 800,
  29.                 'imageHeight'     => null,
  30.                 'thumbnailWidth'  => 160,
  31.                 'thumbnailHeight' => null,
  32.                 'tag'             => 'table',
  33.                 'breakAfter'      => 3
  34.                 )
  35.         )
  36.     ),
  37.    
  38.    1 => array(
  39.     'position'          => 2,
  40.     'pageId' or 'id'    => 5,
  41.     'category'          => 'A Category',
  42.     'categoryId'        => 1,
  43.     'subCategory'       => false,
  44.     'subCategoryId'     => false,
  45.     'pageDate'          => '2009-12-31 - 2010-01-15',
  46.     'pageDateTimestamp'  => array(
  47.                     'date'  => 1325393999, // 'date' and 'start' is the same
  48.                     'start' => 1325393999,
  49.                     'end'   => 1325303455 // will be 0 when its not a date range
  50.                     ),
  51.     'title'             => 'Title Example 2',
  52.     'thumbnail'         => false,
  53.     'thumbnailPath'     => false,
  54.     'content'           => "\n".'<p>Content Text</p>'."\n",
  55.     'description'       => 'Short description of the page',
  56.     'tags'              => 'tag3,tag4',
  57.     'href'              => '?category=1&page=5',
  58.     'plugins'           => array ()
  59.     ),
  60.   
  61.    2 => array(
  62.     'position'          => 'last', // is the last page in the returned pages list
  63.     'pageId' or 'id'    => 8,
  64.     'category'          => 'Another Category',
  65.     'categoryId'        => 2,
  66.     'subCategory'       => false,
  67.     'subCategoryId'     => false,
  68.     'pageDate'          => false, // page has no page date
  69.     'pageDateTimestamp' => false,
  70.     'title'             => 'Title Example 3',
  71.     'thumbnail'         => '<img src="/path/thumb_page3.png" class="feinduraThumbnail" alt="Thumbnail" title="Title Example 3">',
  72.     'thumbnailPath'     => '/path/thumb_page3.png',
  73.     'content'           => "\n".'<p>Content Text</p>'."\n",
  74.     'description'       => 'Short description of the page',
  75.     'tags'              => 'tag3,tag1',
  76.     'href'              => '?category=2&page=8', 
  77.     'plugins'           => array ()
  78.     )
  79.   )
  80.   
  81. ?>


Return Value
  • array - array with page arrays,containing content and title etc., ready to display in a HTML-page, or an empty array
Additional
  • see: Feindura::showPage()
  • see: Feindura::listSubPages()
  • see: Feindura::listPagesByTags()
  • see: Feindura::listPagesByDate()
  • access: public
Used By
  • Feindura::listSubPages() - to get the pages
  • Feindura::listSubCategory() - to get the pages
  • Feindura::listPagesByTags() - to list the pages
  • Feindura::listPagesByDate() - to list the pages
Uses
  • Feindura::$xHtml
  • Feindura::$showErrors
  • Feindura::$errorTag
  • Feindura::$titleLength
  • Feindura::$titleAsLink
  • Feindura::$titleShowPageDate
  • Feindura::$titleShowCategory
  • Feindura::$titleCategorySeparator
  • Feindura::$thumbnailAlign
  • Feindura::$thumbnailId
  • Feindura::$thumbnailClass
  • Feindura::$thumbnailAttributes
  • Feindura::$thumbnailBefore
  • Feindura::$thumbnailAfter
  • FeinduraBase::getPropertyIdsByType() - if the $ids parameter is FALSE it gets the property category or page ID, depending on the $idType parameter
  • FeinduraBase::loadPagesByType() - to load the page $pageContent array(s) from the given ID(s)
  • FeinduraBase::generatePage() - to generate every page which will be listed
  • GeneralFunctions::sortPages() - to sort the $pageContent arrays by category
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 3407
array listSubPages ( [int|string|array|bool $id = false],
[int|array|bool $shortenText = false],
[bool|string $useHtml = true],
[bool $sortPages = false],
[bool $reverseList = false])

Parameters

int|string|array|bool $id (optional) a page ID, array with page and category ID, or a string/array with "previous","next","first","last" or "random". If FALSE it uses the Feindura::$page property.
See Additional -> $id parameter example

Default false
int|array|bool $shortenText (optional) number of the maximal text length displayed, adds a "more" link at the end or FALSE to not shorten. You can also pass an array: value 1: text length as int, value 2: text string for the link, or a link string. e.g. array(23,false), array(23,'read more'), or array(23,'<a href="%href%"'>read more</a>'). (the %href% will be replaced by the pages href)
Default false
bool|string $useHtml (optional) whether the content of the page has HTML-tags or not. It also accepts a string with allowed html tags.
Default true
bool $sortPages (optional) if TRUE it sorts the pages like they are sorted in the backend, if FALSE they are sorted in the order of the given IDs. Can also be a sort function e.g. "sortByLastSaveDate". See GeneralFunctions::sortPages() for more.
Default false
bool $reverseList (optional) if TRUE the pages sorting will be reversed
Default false

Description

Name listSubPages()
Alias listSubPage()

This method uses the $error..., $title... and $thumbnail... properties.

List pages of the subcategory of a given page.

Returns an array with multiple pages for displaying in a HTML-page.
In case no page with the given category or page ID(s) exist it returns an empty array.

Note: If the $id parameter is FALSE or empty, it uses the current page (means the Feindura::$page property).
b>Note</b>: It will add the Feindura::$linkActiveClass property as a CSS class to the link (and also its wrapping element, e.g. <li> or <td>), when the links page is matching the current page, or the current page is a sub page of the links page.

Example:
Show Example

  1. <?php
  2. /*                               *** CODE *** 
  3. --------------------------------------------------------------------------------
  4. This example uses no extra properties. To see an example using all the properties, see the createMenu() method example.
  5. */
  6.  
  7. // a session will be started in the "feindura.include.php",
  8. // therefor you have to include this file before the header of the HTML page is sent,
  9. // which means before any HTML Tag.
  10. require('cms/feindura.include.php');
  11.  
  12. // creates a new Feindura instance
  13. $feindura = new Feindura();
  14.  
  15. ?>
  16. <!DOCTYPE html>
  17. <html>
  18. ...
  19.  
  20. <?php
  21.  
  22. // will list the subpages of the current page. The 200 is the maximum number of characters we want to display
  23. foreach($feindura->listSubPages(false,200) as $subPage) {
  24.    echo '<h1>'.$subPage['title'].'</h1>';
  25.    echo $subPage['content']."\n";
  26.    echo "<br>-----------------------<br>\n";
  27. }
  28.  
  29.  
  30.                                *** RESULT *** 
  31. --------------------------------------------------------------------------------
  32.  
  33. <h1>Example SubPage 1</h1>
  34. <p>Lorem ipsum dolor sit amet, consetetur sadipscing dolores et ea rebum.
  35. Stet clita kasd gubergren, no sea takimata sanctus.</p>
  36. <a href="?category=1&amp;page=2">mehr</a>
  37.  
  38. <br>-----------------------<br>
  39.  
  40. <h1>Example SubPage 2</h1>
  41. <p>Lorem ipsum dolor sit amet, consetetur sadipscing dolores et ea rebum.</p>
  42. <h2>And one more Example Headline</h2>
  43. <p>Stet clita kasd gubergren, no sea takimata sanctus est...</p>
  44. <a href="?category=1&amp;page=3">mehr</a>
  45.  
  46. <br>-----------------------<br>
  47.  
  48. ?>

Example of the returned Array:
Show Example

  1. <?php
  2.  
  3. array(
  4.  
  5.   0 => array(
  6.     'position'          => 'first', // is the first page in the returned pages list
  7.     'pageId' or 'id'    => 1,
  8.     'category'          => 'A Category',
  9.     'categoryId'        => 1,
  10.     'subCategory'       => 'Another Category',
  11.     'subCategoryId'     => 2,
  12.     'pageDate'          => '2010-12-31', // format depending on the administrator-settings
  13.     'pageDateTimestamp'  => array(
  14.                     'date'  => 1325393999, // 'date' and 'start' is the same
  15.                     'start' => 1325393999,
  16.                     'end'   => 0
  17.                     ),
  18.     'title'             => 'Title Example 1',
  19.     'thumbnail'         => false, // page has no thumbnail
  20.     'thumbnailPath'     => false,
  21.     'content'           => "\n".'<p>Content Text</p>'."\n",
  22.     'description'       => 'Short description of the page',
  23.     'tags'              => 'tag1,tag2,tag3',
  24.     'href'              => '?category=1&page=1', // or a speaking url, if activated
  25.     'plugins'           => array (
  26.         'imageGallery' => array(
  27.                 'galleryPath'     => '',
  28.                 'imageWidth'      => 800,
  29.                 'imageHeight'     => null,
  30.                 'thumbnailWidth'  => 160,
  31.                 'thumbnailHeight' => null,
  32.                 'tag'             => 'table',
  33.                 'breakAfter'      => 3
  34.                 )
  35.         )
  36.     ),
  37.    
  38.    1 => array(
  39.     'position'          => 2,
  40.     'pageId' or 'id'    => 5,
  41.     'category'          => 'A Category',
  42.     'categoryId'        => 1,
  43.     'subCategory'       => false,
  44.     'subCategoryId'     => false,
  45.     'pageDate'          => '2009-12-31 - 2010-01-15',
  46.     'pageDateTimestamp'  => array(
  47.                     'date'  => 1325393999, // 'date' and 'start' is the same
  48.                     'start' => 1325393999,
  49.                     'end'   => 1325303455 // will be 0 when its not a date range
  50.                     ),
  51.     'title'             => 'Title Example 2',
  52.     'thumbnail'         => false,
  53.     'thumbnailPath'     => false,
  54.     'content'           => "\n".'<p>Content Text</p>'."\n",
  55.     'description'       => 'Short description of the page',
  56.     'tags'              => 'tag3,tag4',
  57.     'href'              => '?category=1&page=5',
  58.     'plugins'           => array ()
  59.     ),
  60.   
  61.    2 => array(
  62.     'position'          => 'last', // is the last page in the returned pages list
  63.     'pageId' or 'id'    => 8,
  64.     'category'          => 'Another Category',
  65.     'categoryId'        => 2,
  66.     'subCategory'       => false,
  67.     'subCategoryId'     => false,
  68.     'pageDate'          => false, // page has no page date
  69.     'pageDateTimestamp' => false,
  70.     'title'             => 'Title Example 3',
  71.     'thumbnail'         => '<img src="/path/thumb_page3.png" class="feinduraThumbnail" alt="Thumbnail" title="Title Example 3">',
  72.     'thumbnailPath'     => '/path/thumb_page3.png',
  73.     'content'           => "\n".'<p>Content Text</p>'."\n",
  74.     'description'       => 'Short description of the page',
  75.     'tags'              => 'tag3,tag1',
  76.     'href'              => '?category=2&page=8', 
  77.     'plugins'           => array ()
  78.     )
  79.   )
  80.   
  81. ?>


Return Value
  • array - array with page arrays of the subcategory,containing content and title etc., ready to display in a HTML-page, or an empty array
Additional
  • example: $id parameter example
  • see: createMenuFromCategory()
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • access: public
Uses
  • Feindura::$xHtml
  • Feindura::$showErrors
  • Feindura::$errorTag
  • Feindura::$titleLength
  • Feindura::$titleAsLink
  • Feindura::$titleShowPageDate
  • Feindura::$titleShowCategory
  • Feindura::$titleCategorySeparator
  • Feindura::$thumbnailAlign
  • Feindura::$thumbnailId
  • Feindura::$thumbnailClass
  • Feindura::$thumbnailAttributes
  • Feindura::$thumbnailBefore
  • Feindura::$thumbnailAfter
  • Feindura::listPages() - to get the pages
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 3507
array listSubCategory ( [int|string|bool $categoryId = false],
[int|array|bool $shortenText = false],
[bool|string $useHtml = true],
[bool $sortPages = false],
[bool $reverseList = false])

Parameters

int|string|bool $categoryId (optional) a category ID, or a string with "previous","next","first","last" or "random". If FALSE it uses the Feindura::$category property.
Default false
int|array|bool $shortenText (optional) number of the maximal text length displayed, adds a "more" link at the end or FALSE to not shorten. You can also pass an array: value 1: text length as int, value 2: text string for the link, or a link string. e.g. array(23,false), array(23,'read more'), or array(23,'<a href="%href%"'>read more</a>'). (the %href% will be replaced by the pages href)
Default false
bool|string $useHtml (optional) whether the content of the page has HTML-tags or not. It also accepts a string with allowed html tags.
Default true
bool $sortPages (optional) if TRUE it sorts the pages like they are sorted in the backend, if FALSE they are sorted in the order of the given IDs. Can also be a sort function e.g. "sortByLastSaveDate". See GeneralFunctions::sortPages() for more.
Default false
bool $reverseList (optional) if TRUE the pages sorting will be reversed
Default false

Description

Name listSubCategory()
Alias listPagesOfSubCategory()
Alias listPagesFromSubCategory()

This method uses the $error..., $title... and $thumbnail... properties.

List the pages of a subcategory.
In case no category with the given page ID exist, or it is not a subcategory it returns an empty array.

Note: If the $id parameter is FALSE or empty, it uses the current category (means the Feindura::$category property).

You can use this function in conjunction with Feindura::listSubPages() to list subpages, even if you're in a page of the subcategory.
Show Example

  1.  <?php
  2.  
  3.  // we use "false", because we use the current page and category. The 200 is the number of maximum characters we want to display.
  4.  // NOTE: we need the double (), otherwise it would use the assignment of the $subMenu variable as condition!
  5.  if(($subPages = $feindura->listSubPages(false,200)) || // will list the subpages when inside the page which has a subcategory
  6.     ($subPages = $feindura->listPagesOfSubCategory(false,200))) { // will list the subpages when inside a page within a subcategory
  7.  
  8.    foreach($subPages as $subPage) {
  9.      echo '<h1>'.$subPage['title'].'</h1>';
  10.      echo $subPage['content'];
  11.    }
  12.  }
  13.  
  14.  ?>

Example of the returned Array:
Show Example

  1. <?php
  2.  
  3. array(
  4.  
  5.   0 => array(
  6.     'position'          => 'first', // is the first page in the returned pages list
  7.     'pageId' or 'id'    => 1,
  8.     'category'          => 'A Category',
  9.     'categoryId'        => 1,
  10.     'subCategory'       => 'Another Category',
  11.     'subCategoryId'     => 2,
  12.     'pageDate'          => '2010-12-31', // format depending on the administrator-settings
  13.     'pageDateTimestamp'  => array(
  14.                     'date'  => 1325393999, // 'date' and 'start' is the same
  15.                     'start' => 1325393999,
  16.                     'end'   => 0
  17.                     ),
  18.     'title'             => 'Title Example 1',
  19.     'thumbnail'         => false, // page has no thumbnail
  20.     'thumbnailPath'     => false,
  21.     'content'           => "\n".'<p>Content Text</p>'."\n",
  22.     'description'       => 'Short description of the page',
  23.     'tags'              => 'tag1,tag2,tag3',
  24.     'href'              => '?category=1&page=1', // or a speaking url, if activated
  25.     'plugins'           => array (
  26.         'imageGallery' => array(
  27.                 'galleryPath'     => '',
  28.                 'imageWidth'      => 800,
  29.                 'imageHeight'     => null,
  30.                 'thumbnailWidth'  => 160,
  31.                 'thumbnailHeight' => null,
  32.                 'tag'             => 'table',
  33.                 'breakAfter'      => 3
  34.                 )
  35.         )
  36.     ),
  37.    
  38.    1 => array(
  39.     'position'          => 2,
  40.     'pageId' or 'id'    => 5,
  41.     'category'          => 'A Category',
  42.     'categoryId'        => 1,
  43.     'subCategory'       => false,
  44.     'subCategoryId'     => false,
  45.     'pageDate'          => '2009-12-31 - 2010-01-15',
  46.     'pageDateTimestamp'  => array(
  47.                     'date'  => 1325393999, // 'date' and 'start' is the same
  48.                     'start' => 1325393999,
  49.                     'end'   => 1325303455 // will be 0 when its not a date range
  50.                     ),
  51.     'title'             => 'Title Example 2',
  52.     'thumbnail'         => false,
  53.     'thumbnailPath'     => false,
  54.     'content'           => "\n".'<p>Content Text</p>'."\n",
  55.     'description'       => 'Short description of the page',
  56.     'tags'              => 'tag3,tag4',
  57.     'href'              => '?category=1&page=5',
  58.     'plugins'           => array ()
  59.     ),
  60.   
  61.    2 => array(
  62.     'position'          => 'last', // is the last page in the returned pages list
  63.     'pageId' or 'id'    => 8,
  64.     'category'          => 'Another Category',
  65.     'categoryId'        => 2,
  66.     'subCategory'       => false,
  67.     'subCategoryId'     => false,
  68.     'pageDate'          => false, // page has no page date
  69.     'pageDateTimestamp' => false,
  70.     'title'             => 'Title Example 3',
  71.     'thumbnail'         => '<img src="/path/thumb_page3.png" class="feinduraThumbnail" alt="Thumbnail" title="Title Example 3">',
  72.     'thumbnailPath'     => '/path/thumb_page3.png',
  73.     'content'           => "\n".'<p>Content Text</p>'."\n",
  74.     'description'       => 'Short description of the page',
  75.     'tags'              => 'tag3,tag1',
  76.     'href'              => '?category=2&page=8', 
  77.     'plugins'           => array ()
  78.     )
  79.   )
  80.   
  81. ?>


Return Value
  • array - array with page arrays of the subcategory,containing content and title etc., ready to display in a HTML-page, or an empty array
Additional
  • example: $id parameter example
  • see: createMenuFromCategory()
  • see: Feindura::createLink()
  • see: Feindura::createMenu()
  • access: public
Uses
  • Feindura::$xHtml
  • Feindura::$showErrors
  • Feindura::$errorTag
  • Feindura::$titleLength
  • Feindura::$titleAsLink
  • Feindura::$titleShowPageDate
  • Feindura::$titleShowCategory
  • Feindura::$titleCategorySeparator
  • Feindura::$thumbnailAlign
  • Feindura::$thumbnailId
  • Feindura::$thumbnailClass
  • Feindura::$thumbnailAttributes
  • Feindura::$thumbnailBefore
  • Feindura::$thumbnailAfter
  • Feindura::listPages() - to get the pages
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 3597
array listPagesByTags ( string|array $tags,
[string $idType = 'category'],
[int|array|bool $ids = false],
[int|array|bool $shortenText = false],
[bool|string $useHtml = true],
[bool $sortPages = false],
[bool $reverseList = false])

Parameters

string|array $tags a string with tags seperated by "," or ";" or an array with tags
string $idType (optional) the ID(s) type can be "cat", "category", "categories" or "pag", "page" or "pages"
Default 'category'
int|array|bool $ids (optional) the category or page ID(s), can be a number or an array with numbers (can also be a $pageContent array), if TRUE it loads all pages, if FALSE it uses the Feindura::$page or Feindura::$category property
Default false
int|array|bool $shortenText (optional) number of the maximal text length displayed, adds a "more" link at the end or FALSE to not shorten. You can also pass an array: value 1: text length as int, value 2: text string for the link, or a link string. e.g. array(23,false), array(23,'read more'), or array(23,'<a href="%href%"'>read more</a>'). (the %href% will be replaced by the pages href)
Default false
bool|string $useHtml (optional) whether the content of the page has HTML-tags or not. It also accepts a string with allowed html tags.
Default true
bool $sortPages (optional) if TRUE it sorts the pages like they are sorted in the backend, if FALSE they are sorted in the order of the given IDs. Can also be a sort function e.g. "sortByLastSaveDate". See GeneralFunctions::sortPages() for more.
Default false
bool $reverseList (optional) if TRUE the pages sorting will be reversed
Default false

Description

Name listPagesByTags()
Alias listPagesByTag(), listPageByTags(), listPageByTag()

This method uses the $error..., $title... and $thumbnail... properties.

List pages by given category(ies) or page(s), which have one or more of the tags from the given $tags parameter.

Returns an array with multiple pages for displaying in a HTML-page. In case no page with the given category or page ID(s) exist it returns an empty array.

Note: The tags will be compared case insensitive.
Note: If the $ids parameter is FALSE it uses the Feindura::$page or Feindura::$category property depending on the $idType parameter.

Example usage:
Show Example

  1. <?php
  2. /*                               *** CODE *** 
  3. --------------------------------------------------------------------------------
  4. This example shows only the usage of tags for listing pages,
  5. for a detailed example see listPages()
  6. */
  7.  
  8. // a session will be started in the "feindura.include.php",
  9. // therefor you have to include this file before the header of the HTML page is sent,
  10. // which means before any HTML Tag.
  11. require('cms/feindura.include.php');
  12.  
  13. // creates a new Feindura instance
  14. $feindura = new Feindura();
  15.  
  16. ?>
  17. <!DOCTYPE html>
  18. <html>
  19. ...
  20.  
  21. <?php
  22.  
  23. // the tags where the pages in the menu should have atleast one
  24. $tags = 'winter summer spring';
  25. // could also be an array like
  26. // $tags = array(0 => 'winter', 1 => 'summer', 2 => 'spring');
  27.  
  28.  
  29. // get the pages from the category with ID "1"
  30. // the page content will be shorten to "200" characters
  31. foreach($feindura->listPagesByTags($tags,'category',1,200) as $page) {
  32.   echo $page['title'].'<br>
  33.        Has the following Tags: '.$page['tags']."\n";
  34.   echo $page['content']."\n";
  35.   echo "<br>-----------------------<br>\n";
  36. }
  37.  
  38.  
  39.                                *** RESULT *** 
  40. --------------------------------------------------------------------------------
  41.  
  42. Example Page 1<br>
  43. Has the following Tags: Winter antum
  44.  
  45. <h2>Example Headline</h2>
  46. <p>Lorem ipsum dolor sit amet, consetetur sadipscing dolores et ea rebum.
  47. Stet clita kasd gubergren, no sea takimata sanctus.</p>
  48. <a href="?category=1&amp;page=1">mehr</a>
  49.  
  50. <br>-----------------------<br>
  51.  
  52. Example Page 2<br>
  53. Has the following Tags: winter spring summer
  54.  
  55. <h2>Another Example Headline</h2>
  56. <p>Lorem ipsum dolor sit amet, consetetur sadipscing dolores et ea rebum.</p>
  57. <h2>And one more Example Headline</h2>
  58. <p>Stet clita kasd gubergren, no sea takimata sanctus est...</p>
  59. <a href="?category=1&amp;page=2">mehr</a>
  60.  
  61. <br>-----------------------<br>
  62.  
  63. Example Page 3<br>
  64. Has the following Tags: spring antum
  65.  
  66. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
  67. invidunt ut labore et dolore magna aliquyam erat, ur sadipscing elitr,
  68. Stet clita kasd...</p>
  69. <a href="?category=1&amp;page=3">mehr</a>
  70.  
  71. <br>-----------------------<br>
  72.  
  73. ?>


Return Value
  • array - array with page arrays,containing content and title etc., ready to display in a HTML-page, or an empty array
Additional
  • see: Feindura::showPage()
  • see: Feindura::listPages()
  • see: Feindura::listPagesByDate()
  • access: public
Uses
  • Feindura::$xHtml
  • Feindura::$showErrors
  • Feindura::$errorTag
  • Feindura::$titleLength
  • Feindura::$titleAsLink
  • Feindura::$titleShowPageDate
  • Feindura::$titleShowCategory
  • Feindura::$titleCategorySeparator
  • Feindura::$thumbnailAlign
  • Feindura::$thumbnailId
  • Feindura::$thumbnailClass
  • Feindura::$thumbnailAttributes
  • Feindura::$thumbnailBefore
  • Feindura::$thumbnailAfter
  • FeinduraBase::getPropertyIdsByType() - if the $ids parameter is FALSE it gets the property category or page ID, depending on the $idType parameter
  • FeinduraBase::checkPagesForTags() - to get only the pages which have one or more tags from the given $tags parameter
  • Feindura::listPages() - to list the pages
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 3693
array listPagesByDate ( [int|bool|string $from = true],
[int|bool|string $to = true],
[string $idType = 'category'],
[int|array|bool $ids = false],
[int|array|bool $shortenText = false],
[bool|string $useHtml = true],
[bool $sortPages = false],
[bool $reverseList = false])

Parameters

int|bool|string $from (optional) number of months in the past, if TRUE it show all pages in the past, if FALSE it loads only pages starting from the current date. Can also be a string with a date format (e.g. '2 weeks' or '27.06.2012'), for more details see: http://www.php.net/manual/en/datetime.formats.php
Default true
int|bool|string $to (optional) number of months in the future, if TRUE it show all pages in the future, if FALSE it loads only pages until the current date. Can also be a string with a date format (e.g. '10 days' or '27.06.2012'), for more details see: http://www.php.net/manual/de/datetime.formats.php
Default true
string $idType (optional) the ID(s) type can be "cat", "category", "categories" or "pag", "page" or "pages"
Default 'category'
int|array|bool $ids (optional) the category or page ID(s), can be a number or an array with numbers (can also be a $pageContent array), if TRUE it loads all pages, if FALSE it uses the Feindura::$page or Feindura::$category property
Default false
int|array|bool $shortenText (optional) number of the maximal text length displayed, adds a "more" link at the end or FALSE to not shorten. You can also pass an array: value 1: text length as int, value 2: text string for the link, or a link string. e.g. array(23,false), array(23,'read more'), or array(23,'<a href="%href%"'>read more</a>'). (the %href% will be replaced by the pages href)
Default false
bool|string $useHtml (optional) whether the content of the page has HTML-tags or not. It also accepts a string with allowed html tags.
Default true
bool $sortPages (optional) if TRUE it sorts the pages like they are sorted in the backend, if FALSE it sorts the pages by date (If date range: by start date). Can also be a sort function e.g. "sortByEndDate". See GeneralFunctions::sortPages() for more.
Default false
bool $reverseList (optional) if TRUE the pages sorting will be reversed
Default false

Description

Name listPagesByDate()
Alias listPagesByDates(), listPageByDate(), listPageByDates()

This method uses the $error..., $title... and $thumbnail... properties.

List pages by given a category(ies) or page(s) parameter. Applies for pages which have a page date (and page date is activated for that category!) and it fit in the given time period from the $from and the $to parameter (relative to the current date).

The $from and $to parameters can also be a string with a (relative or specific) date, for more information see: http://www.php.net/manual/de/datetime.formats.php.

Returns an array with multiple pages for displaying in a HTML-page. In case no page with the given category or page ID(s) exist it returns an empty array.

Note: If the $ids parameter is FALSE it uses the Feindura::$page or Feindura::$category property depending on the $idType parameter.

Example usage:
Show Example

  1. <?php
  2. /*                               *** CODE *** 
  3. --------------------------------------------------------------------------------
  4. This example shows only the usage of tags for listing pages,
  5. for a detailed example see listPages()
  6. */
  7.  
  8. // a session will be started in the "feindura.include.php",
  9. // therefor you have to include this file before the header of the HTML page is sent,
  10. // which means before any HTML Tag.
  11. require('cms/feindura.include.php');
  12.  
  13. // creates a new Feindura instance
  14. $feindura = new Feindura();
  15.  
  16. ?>
  17. <!DOCTYPE html>
  18. <html>
  19. ...
  20.  
  21. <?php
  22.  
  23. // the tags where the pages in the menu should have atleast one
  24. $tags = 'winter summer spring';
  25. // could also be an array like
  26. // $tags = array(0 => 'winter', 1 => 'summer', 2 => 'spring');
  27.  
  28.  
  29. // get the pages from the category with ID "1"
  30. // the page content will be shorten to "200" characters
  31. foreach($feindura->listPagesByTags($tags,'category',1,200) as $page) {
  32.   echo $page['title'].'<br>
  33.        Has the following Tags: '.$page['tags']."\n";
  34.   echo $page['content']."\n";
  35.   echo "<br>-----------------------<br>\n";
  36. }
  37.  
  38.  
  39.                                *** RESULT *** 
  40. --------------------------------------------------------------------------------
  41.  
  42. Example Page 1<br>
  43. Has the following Tags: Winter antum
  44.  
  45. <h2>Example Headline</h2>
  46. <p>Lorem ipsum dolor sit amet, consetetur sadipscing dolores et ea rebum.
  47. Stet clita kasd gubergren, no sea takimata sanctus.</p>
  48. <a href="?category=1&amp;page=1">mehr</a>
  49.  
  50. <br>-----------------------<br>
  51.  
  52. Example Page 2<br>
  53. Has the following Tags: winter spring summer
  54.  
  55. <h2>Another Example Headline</h2>
  56. <p>Lorem ipsum dolor sit amet, consetetur sadipscing dolores et ea rebum.</p>
  57. <h2>And one more Example Headline</h2>
  58. <p>Stet clita kasd gubergren, no sea takimata sanctus est...</p>
  59. <a href="?category=1&amp;page=2">mehr</a>
  60.  
  61. <br>-----------------------<br>
  62.  
  63. Example Page 3<br>
  64. Has the following Tags: spring antum
  65.  
  66. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
  67. invidunt ut labore et dolore magna aliquyam erat, ur sadipscing elitr,
  68. Stet clita kasd...</p>
  69. <a href="?category=1&amp;page=3">mehr</a>
  70.  
  71. <br>-----------------------<br>
  72.  
  73. ?>


Return Value
  • array - array with page arrays,containing content and title etc., ready to display in a HTML-page, or an empty array
Additional
  • see: Feindura::showPage()
  • see: Feindura::listPages()
  • see: Feindura::listPagesByTags()
  • access: public
Uses
  • Feindura::$xHtml
  • Feindura::$showErrors
  • Feindura::$errorTag
  • Feindura::$titleLength
  • Feindura::$titleAsLink
  • Feindura::$titleShowPageDate
  • Feindura::$titleShowCategory
  • Feindura::$titleCategorySeparator
  • Feindura::$thumbnailAlign
  • Feindura::$thumbnailId
  • Feindura::$thumbnailClass
  • Feindura::$thumbnailAttributes
  • Feindura::$thumbnailBefore
  • Feindura::$thumbnailAfter
  • FeinduraBase::loadPagesByDate() - to load the pages which fit in the given time period parameters, sorted by the page date
  • Feindura::listPages() - to list the pages
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 3797
array listPagesBySortFunction ( string $sortCallback,
[string $idType = 'category'],
[int|array|bool $ids = false],
[int|array|bool $shortenText = false],
[bool|string $useHtml = true],
[bool $reverseList = false])

Parameters

string $sortCallback the name of the callback function to sort the pages (uses usort()). For a list of predefined available functions see GeneralFunctions::sortPages()
string $idType (optional) the ID(s) type can be "cat", "category", "categories" or "pag", "page" or "pages"
Default 'category'
int|array|bool $ids (optional) the category or page ID(s), can be a number or an array with numbers (can also be a $pageContent array), if TRUE it loads all pages, if FALSE it uses the Feindura::$page or Feindura::$category property
Default false
int|array|bool $shortenText (optional) number of the maximal text length displayed, adds a "more" link at the end or FALSE to not shorten. You can also pass an array: value 1: text length as int, value 2: text string for the link, or a link string. e.g. array(23,false), array(23,'read more'), or array(23,'<a href="%href%"'>read more</a>'). (the %href% will be replaced by the pages href)
Default false
bool|string $useHtml (optional) whether the content of the page has HTML-tags or not. It also accepts a string with allowed html tags.
Default true
bool $reverseList (optional) if TRUE the pages sorting will be reversed
Default false

Description

Name listPagesBySortFunction()

Alias listPagesBySort()
Alias listPagesBySortCallback()
Alias listPagesByCallback()

This method uses the $error..., $title... and $thumbnail... properties.

List pages from category(ies) or page(s), sorted by a custom sort function, passed in the first parameter $sortCallback. The custom sort function will be executed on the plain $pageContent array returned by the FeinduraBase::loadPagesByType() method.

Returns an array with multiple pages for displaying in a HTML-page.

In case no page with the given category or page ID(s) exist it returns an empty array.

Note: If the $ids parameter is FALSE it uses the Feindura::$page or Feindura::$category property depending on the $idType parameter.

Example usage:
Show Example

  1. <?php
  2. /*                               *** CODE *** 
  3. --------------------------------------------------------------------------------
  4. This example uses all possible properties.
  5. It's also works much more simple: just call listPages() without setting properties
  6. and list the current category given by $_GET variable.
  7. */
  8.  
  9. // a session will be started in the "feindura.include.php",
  10. // therefor you have to include this file before the header of the HTML page is sent,
  11. // which means before any HTML Tag.
  12. require('cms/feindura.include.php');
  13.  
  14. // creates a new Feindura instance
  15. $feindura = new Feindura();
  16.  
  17. ?>
  18. <!DOCTYPE html>
  19. <html>
  20. ...
  21.  
  22. <?php
  23.  
  24. // create the sort function, which we use with the listPagesBySortFunction() method
  25. function sortByLastEditDate($a,$b) {
  26.   if ($a['lastSaveDate'] == $b['lastSaveDate'])
  27.     return 0;
  28.   return ($a['lastSaveDate'] > $b['lastSaveDate']) ? -1 : 1;
  29. }
  30.  
  31. // now we return the pages from the category with ID "1" and "2"
  32. // the page content will be shorten to "200" characters
  33. $pages = $feindura->listPagesBySortFunction('sortByLastEditDate','category',array(1,2),200);
  34.  
  35. // displays the pages (the "\n" creates a line break for a better look)
  36. foreach($pages as $page) {
  37.   echo $page['title']."\n\n";
  38.   echo $page['thumbnail']."\n";
  39.   echo $page['content']."\n";
  40.   echo "<br>-----------------------<br>\n";
  41. }
  42.  
  43.  
  44.                                *** RESULT *** 
  45. --------------------------------------------------------------------------------
  46.  
  47. Example Page 2
  48.  
  49. <h2>Example Headline</h2>
  50. <p>Lorem ipsum dolor sit amet, consetetur sadipscing dolores et ea rebum.
  51. Stet clita kasd gubergren, no sea takimata sanctus.</p>
  52. <a href="?category=1&amp;page=2">mehr</a>
  53.  
  54. <br>-----------------------<br>
  55.  
  56. Example Page 3
  57.  
  58. <h2>Another Example Headline</h2>
  59. <p>Lorem ipsum dolor sit amet, consetetur sadipscing dolores et ea rebum.</p>
  60. <h2>And one more Example Headline</h2>
  61. <p>Stet clita kasd gubergren, no sea takimata sanctus est...</p>
  62. <a href="?category=1&amp;page=3">mehr</a>
  63.  
  64. <br>-----------------------<br>
  65.  
  66. Example Page 1
  67.  
  68. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
  69. invidunt ut labore et dolore magna aliquyam erat, ur sadipscing elitr,
  70. Stet clita kasd...</p>
  71. <a href="?category=2&amp;page=1">mehr</a>
  72.  
  73. <br>-----------------------<br>
  74.  
  75. ?>

Example of the returned array:
Show Example

  1. <?php
  2.  
  3. array(
  4.  
  5.   0 => array(
  6.     'position'          => 'first', // is the first page in the returned pages list
  7.     'pageId' or 'id'    => 1,
  8.     'category'          => 'A Category',
  9.     'categoryId'        => 1,
  10.     'subCategory'       => 'Another Category',
  11.     'subCategoryId'     => 2,
  12.     'pageDate'          => '2010-12-31', // format depending on the administrator-settings
  13.     'pageDateTimestamp'  => array(
  14.                     'date'  => 1325393999, // 'date' and 'start' is the same
  15.                     'start' => 1325393999,
  16.                     'end'   => 0
  17.                     ),
  18.     'title'             => 'Title Example 1',
  19.     'thumbnail'         => false, // page has no thumbnail
  20.     'thumbnailPath'     => false,
  21.     'content'           => "\n".'<p>Content Text</p>'."\n",
  22.     'description'       => 'Short description of the page',
  23.     'tags'              => 'tag1,tag2,tag3',
  24.     'href'              => '?category=1&page=1', // or a speaking url, if activated
  25.     'plugins'           => array (
  26.         'imageGallery' => array(
  27.                 'galleryPath'     => '',
  28.                 'imageWidth'      => 800,
  29.                 'imageHeight'     => null,
  30.                 'thumbnailWidth'  => 160,
  31.                 'thumbnailHeight' => null,
  32.                 'tag'             => 'table',
  33.                 'breakAfter'      => 3
  34.                 )
  35.         )
  36.     ),
  37.    
  38.    1 => array(
  39.     'position'          => 2,
  40.     'pageId' or 'id'    => 5,
  41.     'category'          => 'A Category',
  42.     'categoryId'        => 1,
  43.     'subCategory'       => false,
  44.     'subCategoryId'     => false,
  45.     'pageDate'          => '2009-12-31 - 2010-01-15',
  46.     'pageDateTimestamp'  => array(
  47.                     'date'  => 1325393999, // 'date' and 'start' is the same
  48.                     'start' => 1325393999,
  49.                     'end'   => 1325303455 // will be 0 when its not a date range
  50.                     ),
  51.     'title'             => 'Title Example 2',
  52.     'thumbnail'         => false,
  53.     'thumbnailPath'     => false,
  54.     'content'           => "\n".'<p>Content Text</p>'."\n",
  55.     'description'       => 'Short description of the page',
  56.     'tags'              => 'tag3,tag4',
  57.     'href'              => '?category=1&page=5',
  58.     'plugins'           => array ()
  59.     ),
  60.   
  61.    2 => array(
  62.     'position'          => 'last', // is the last page in the returned pages list
  63.     'pageId' or 'id'    => 8,
  64.     'category'          => 'Another Category',
  65.     'categoryId'        => 2,
  66.     'subCategory'       => false,
  67.     'subCategoryId'     => false,
  68.     'pageDate'          => false, // page has no page date
  69.     'pageDateTimestamp' => false,
  70.     'title'             => 'Title Example 3',
  71.     'thumbnail'         => '<img src="/path/thumb_page3.png" class="feinduraThumbnail" alt="Thumbnail" title="Title Example 3">',
  72.     'thumbnailPath'     => '/path/thumb_page3.png',
  73.     'content'           => "\n".'<p>Content Text</p>'."\n",
  74.     'description'       => 'Short description of the page',
  75.     'tags'              => 'tag3,tag1',
  76.     'href'              => '?category=2&page=8', 
  77.     'plugins'           => array ()
  78.     )
  79.   )
  80.   
  81. ?>


Return Value
  • array - array with page arrays,containing content and title etc., ready to display in a HTML-page, or an empty array
Additional
  • see: Feindura::showPage()
  • see: Feindura::listPages()
  • see: Feindura::listPagesByTags()
  • see: Feindura::listPagesByDate()
  • access: public
Uses
  • Feindura::$xHtml
  • Feindura::$showErrors
  • Feindura::$errorTag
  • Feindura::$titleLength
  • Feindura::$titleAsLink
  • Feindura::$titleShowPageDate
  • Feindura::$titleShowCategory
  • Feindura::$titleCategorySeparator
  • Feindura::$thumbnailAlign
  • Feindura::$thumbnailId
  • Feindura::$thumbnailClass
  • Feindura::$thumbnailAttributes
  • Feindura::$thumbnailBefore
  • Feindura::$thumbnailAfter
  • FeinduraBase::getPropertyIdsByType() - if the $ids parameter is FALSE it gets the property category or page ID, depending on the $idType parameter
  • FeinduraBase::loadPagesByType() - to load the page $pageContent array(s) from the given ID(s)
  • FeinduraBase::generatePage() - to generate every page which will be listed
  • GeneralFunctions::sortPages() - to sort the $pageContent arrays by category
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 3888
bool startCache ( string $cacheId,
[float $timeout = 8])

Parameters

float $timeout (optional) the number of hours after whihc the cache should be reloaded
string $cacheId a unique id to identify the cache e.g "myScriptCache1"
Default 8

Description

Name startCache()

This method can cache parts of your script, to speed up page loading time.
You need to call Feindura::endCache() to tell it were the cache part ends.
The cache will be resaved after the $timeout parameter is over. The cache will also be deleted when a page is saved in the backend.

Because of PHP scope restricions, you need to manually prevent the processing of the original script. See the example for more.

Note: This method and the Feindura::endCache() uses the ob_start() and ob_end_clean() function, if you start a output buffer inside your script which will be cached, make sure to close you output buffer beforec calling Feindura::endCache(). Note: You cannot nest multiple startCache() calls, this would overwrite the cache of the previous call of startCache().


Show Example

  1.  // this will cache the scripts inside the brackets for two hours,
  2.  // and then recache them again.
  3.  if(!$feindura->startCache('myScriptCache',2)) {
  4.  
  5.  .. your scripts
  6.  
  7.  }
  8.  $feindura->endCache();
  9.  
  10.  ..
  11.  
  12.  
  13.  // Since PHP 5.3 you could also write it like this:
  14.  if($feindura->startCache('myScriptCache',2))
  15.    goto usedCache;
  16.  
  17.  .. your scripts
  18.  
  19.  usedCache:
  20.  $feindura->endCache();
  21.  
  22.  ..


Return Value
  • bool - TRUE if the it will output the cached part, FALSE if no cache existed and it was created
Additional
  • see: Feindura::endCache()
  • access: public
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 3944
void endCache ( )

Description

Name endCache()

This method writes the cache, which was started with Feidnura::startCache(). It will save the last started cache. See the Feidnura::startCache() method for more.


Additional
  • see: Feindura::endCache()
  • access: public
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants
Inherited From FeinduraBase
FeinduraBase::$adminConfig
FeinduraBase::$categoryConfig
FeinduraBase::$languageFile
FeinduraBase::$languageNames
FeinduraBase::$loggedIn
FeinduraBase::$sessionId
FeinduraBase::$websiteConfig
Inherited From FeinduraBase
FeinduraBase::__construct()
Type constructor
FeinduraBase::checkPagesForTags()
Name checkPagesForTags()
FeinduraBase::createAttributes()
Name createAttributes()
FeinduraBase::createThumbnail()
Name createThumbnail()
FeinduraBase::createTitle()
Name createTitle()
FeinduraBase::generateContent()
Name generateContent()
FeinduraBase::generateMenu()
Name generateMenu()
FeinduraBase::generatePage()
Name generatePage()
FeinduraBase::getCurrentCategoryId()
Name getCurrentCategoryId()
Alias getCategoryId()
FeinduraBase::getCurrentPageId()
Name getCurrentPageId()
Alias getPageId()
FeinduraBase::getIdsFromString()
Name getIdsFromString()
FeinduraBase::getParentPages()
Name getParentPages()
FeinduraBase::getPropertyCategory()
Name getPropertyCategory()
FeinduraBase::getPropertyIdsByType()
Name getPropertyIdsByType()
FeinduraBase::getPropertyPage()
Name getPropertyPage()
FeinduraBase::loadFrontendLanguageFile()
Name loadFrontendLanguageFile()
FeinduraBase::loadPagesByDate()
Name loadPagesByDate()
FeinduraBase::loadPagesByType()
Name loadPagesByType()
FeinduraBase::loadPagesMetaDataByType()
Name loadPagesMetaDataByType()
FeinduraBase::setCurrentCategoryId()
Name setCurrentCategoryId()
Alias setCategoryId()
FeinduraBase::setCurrentPageId()
Name setCurrentPageId()
Alias setPageId()
FeinduraBase::shortenHtmlText()
Name shortenHtmlText()
FeinduraBase::shortenText()
Name shortenText()


The feindura API reference was generated from the comments in the feindura source code on Sat, 01 Dec 2012 21:55:14 +0000 by phpDocumentor 1.4.3
feindura - Flat File Content Management System, Copyright © Fabian Vogelsteller [frozeman.de]