FeinduraBase | --Feindura
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.
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. |
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.... |
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 ">".
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).
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.
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.
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.
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.
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..."
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.
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.
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>.
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"'
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.
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.
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.
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.
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().
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().
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>
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.
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>
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.
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.
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.
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.
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"'
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..."
If TRUE the page title is also a link to the page.
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
If the Feindura::$titleShowPageDate property is TRUE, this string will be used as a separator between the page date and the page title.
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
If the Feindura::$titleShowCategory property is TRUE, this string will be used as a separator between the category name and the page title.
If TRUE the page thumbnail will be wrapped with a link to the page.
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;" />
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.
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'
Contains a string with attributes which will be add the thumbnail <img> tag.
The string should have the following format 'key1="value" key2="value"'
Contains a string which will be add before the thumbnail <img> tag.
Contains a string which will be add after the thumbnail <img> tag.
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>
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
Tells the Feindura::endCache() method to write the a cache file or not.
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 |
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
int | $pageId |
the page ID to set |
Name setStartPage()
Set a page ID to the Feindura::$startPage and Feindura::$page property.
string | $language |
a language country code like "en", "de", ... |
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.
Name getLanguage()
Returns the language country code which was set in the feinduraBase:__construct().
array getLanguageFile ( |
[string|false $langPath = false], [string $filename = '%lang%.php'], [string|false &$currentLangCode = false], [bool $standardLang = 'en']) |
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' |
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
Used Constants
string getLocalized ( |
array $localizedArray, string $value, [string|false $language = false]) |
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 |
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
string createMetaTags ( |
[string|false $author = false], [bool $openGraph = true], [bool $googleSnippets = true]) |
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 |
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
string|false createHref ( |
[int|string|array|bool $id = false], [bool $fullUrl = false]) |
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 |
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/
string|false createLink ( |
[int|string|array|bool $id = false], [string|bool $linkText = 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|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 |
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
array createMenu ( |
[string $idType = 'category'], [int|array|bool $ids = false], [int|bool $menuTag = false], [string|bool $linkText = true], [bool $sortPages = false], [bool $reverseList = false]) |
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 |
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
Example of the returned Array:
Show Example
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]) |
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 |
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
Example of the returned Array:
Show Example
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]) |
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 |
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
Example of the returned Array:
Show Example
array createMenuBySortFunction ( |
string $sortCallback, [string $idType = 'category'], [int|array|bool $ids = false], [int|bool $menuTag = false], [string|bool $linkText = true], [bool $reverseList = false]) |
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 |
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
Example of the returned Array:
Show Example
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 |
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).
bool isSubCategoryOf ( |
[int|string|bool $pageId = false], [int|string|bool $categoryId = false]) |
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 |
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).
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 |
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).
array createSubMenu ( |
[int|bool $menuTag = false], [string|bool $linkText = true], [bool $sortPages = false], [bool $reverseList = 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 |
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
Example of the returned Array:
Show Example
array createSubMenuOfPage ( |
[int|string|array|bool $id = false], [int|bool $menuTag = false], [string|bool $linkText = true], [bool $sortPages = false], [bool $reverseList = false]) |
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 |
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
Example of the returned Array:
Show Example
array createSubMenuOfSubCategory ( |
[int|string|bool $categoryId = false], [int|bool $menuTag = false], [string|bool $linkText = true], [bool $sortPages = false], [bool $reverseList = 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 |
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 |
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
Example of the returned Array:
Show Example
array createLanguageMenu ( |
[int|bool $menuTag = false], [string|bool $linkText = true]) |
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 |
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
Example of the returned Array:
Show Example
array createBreadCrumbsMenu ( |
[int|string|array|bool $id = false], [string|false $separator = ' > '], [int|bool $menuTag = false]) |
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 |
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
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 |
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
array showPage ( |
[int|string|array|bool $id = false], [int|array|bool $shortenText = false], [bool|string $useHtml = 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 |
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 |
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
Example of the returned array:
Show Example
bool hasPlugins ( |
[string|array|true $plugins = true], [int|string|bool $ids = false]) |
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 |
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
array|string|false showPlugins ( |
[string|array|true $plugins = true], [int|string|array|bool $id = false], [string|false $divStyles = false], [bool $returnPlugin = true]) |
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 |
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
Example of the returned array:
Show Example
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 |
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
Note: the tags will be compared case insensitive.
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]) |
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 |
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
Example of the returned array:
Show Example
array listSubPages ( |
[int|string|array|bool $id = false], [int|array|bool $shortenText = false], [bool|string $useHtml = true], [bool $sortPages = false], [bool $reverseList = false]) |
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 |
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
Example of the returned Array:
Show Example
array listSubCategory ( |
[int|string|bool $categoryId = false], [int|array|bool $shortenText = false], [bool|string $useHtml = true], [bool $sortPages = false], [bool $reverseList = 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 |
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 |
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
Example of the returned Array:
Show Example
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]) |
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 |
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
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]) |
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 |
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
array listPagesBySortFunction ( |
string $sortCallback, [string $idType = 'category'], [int|array|bool $ids = false], [int|array|bool $shortenText = false], [bool|string $useHtml = true], [bool $reverseList = false]) |
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 |
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
Example of the returned array:
Show Example
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 |
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().
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.