• 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
  • Descendants
  • Properties | Descriptions
  • Methods | Descriptions

Properties
  • $sessionId
  • $loggedIn
  • $adminConfig
  • $websiteConfig
  • $categoryConfig
  • $languageNames
  • $languageFile

Methods
  • __construct()
  • getParentPages()
  • getCurrentPageId()
  • getCurrentCategoryId()
  • loadPagesByType()
  • loadPagesMetaDataByType()
  • loadPagesByDate()
  • setCurrentPageId()
  • setCurrentCategoryId()
  • loadFrontendLanguageFile()
  • generateMenu()
  • generateContent()
  • generatePage()
  • createTitle()
  • createThumbnail()
  • createAttributes()
  • checkPagesForTags()
  • getIdsFromString()
  • getPropertyIdsByType()
  • getPropertyPage()
  • getPropertyCategory()
  • shortenText()
  • shortenHtmlText()

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

Class Overview


		    
            
        
		

Description

The basis feindura class for the implementation classes.

It's methods provide necessary functions for the feindura and the feinduraModules classes.


Additional
  • author: Fabian Vogelsteller <fabian@feindura.org>
  • copyright: Fabian Vogelsteller
  • license: GNU General Public License version 3
Version
  • 1.6
    ChangeLog
    • 1.6 add createMenu()
    • 1.59 changed it to a PHP5 class, add visibilities (public, protected, private)
    • 1.58 add phpDocumentor documentation
    • 1.57 startet documentation

Class located in /library/classes/FeinduraBase.class.php [in line 42]
Descendants
Child Class Description
Feindura The class for implementing feindura - Flat File Content Management System in a website.
Property Summary
string   $sessionId   Contains the session-ID, if cookies are deactivated
bool   $loggedIn   Is TRUE when the user is logged into the backend of feindura and visits the frontend website.
array   $adminConfig   Contains the administrator-settings and the page-settings set in the CMS backend
array   $websiteConfig   Contains the website-settings config set in the CMS backend
array   $categoryConfig   Contains the categories-settings config set in the CMS backend
array   $languageNames   An array with country codes and language names.
array   $languageFile   Contains the frontend language-file array
Method Summary
void   __construct()   The constructor of the class, sets all basic properties. First gets all settings config arrays and external...
array|false   getParentPages()   Returns an array with the parent pages of given subcategory. If the given category ID is not a sub category of any...
int|false   getCurrentPageId()   Returns the current page ID from the $_GET variable. Gets the current page ID from the $_GET variable. If...
int|false   getCurrentCategoryId()   Returns the current category ID from the $_GET variable. Gets the current category ID from the $_GET variable....
array|false   loadPagesByType()   Load pages by ID-type and ID(s). If the $idType parameter start with "cat" it takes the given $ids...
array|false   loadPagesMetaDataByType()   Filters the GeneralFunctions::$pagesMetaData by ID-type and ID(s). If the $idType parameter start with...
array|false   loadPagesByDate()   Loads pages by ID-type and ID, which fit in the given time period parameters. Checks if the pages to load have a...
int|false   setCurrentPageId()   Sets the current page ID from the $_GET variable to the Feindura::$page property. Gets the current page ID from...
int|false   setCurrentCategoryId()   Sets the current category ID from the $_GET variable to the Feindura::$category property. Gets the current...
string   loadFrontendLanguageFile()   Loads the frontend language file into the Feindura::$languageFile property.
array   generateMenu()   Generates a menu from a given $links array. Note : It will add the Feindura::$linkActiveClass property as CSS...
string   generateContent()   Generates the page content and adds the frontend editing when activated and logged in. Note: Activates the...
array   generatePage()   This method uses the $showErrors, $titleLength and $thumbnailAlign properties. Generates a page. This method is...
string   createTitle()   Generates a page title from a given $pageContent array by using the given parameters. Note: Activates the...
array|false   createThumbnail()   Generates a thumbnail <img> tag from the given $pageContent array and returns an array with the ready to...
string   createAttributes()   Generates a string with a given id, class and other attributes. Check whether the given parameters are strings or...
array|false   checkPagesForTags()   Load the $pageContent array of pages, only if the page(s) have one or more tags from the given $tags parameter....
array|false   getIdsFromString()   Gets the right page and category IDs. If the $ids parameter is a an array it uses the first value as page ID and...
int|false   getPropertyIdsByType()   If $ids parameter is FALSE it check the ID-type and returns then the Feindura::$page or Feindura::$category...
mixed   getPropertyPage()   Returns the Feindura::$page property if the given $page parameter is a Boolean.
int|true   getPropertyCategory()   Returns the Feindura::$category property if the given $category parameter is a Boolean.
string   shortenText()   Shorten a text by to a given length. If the $endString parameter is set and a $pageContent array is given, it...
string   shortenHtmlText()   Shorten a HTML text by to a given length. All HTML tags which are contained in the shortend text will be counted...
Properties
string $sessionId = null

Default value

null

Description

Contains the session-ID, if cookies are deactivated

This session ID is then placed on the end of every link.


Additional
  • access: protected
Used By
  • FeinduraBase::__construct() - the session ID string will set to this property, if cookies are deactivated

bool $loggedIn = false

Default value

false

Description

Is TRUE when the user is logged into the backend of feindura and visits the frontend website.

If TRUE, it will enable the the frontend editing feature.


Additional
  • access: public
Used By
  • FeinduraBase::__construct() - to set whether the visitor is logged in or not

array $adminConfig

Default value

Description

Contains the administrator-settings and the page-settings set in the CMS backend

The file with the administrator-settings config array is situated at "feindura-CMS/config/admin.config.php".

This settings will be set to this property in the FeinduraBase constructor.

Example array:
Show Example

  1. <?php
  2.  
  3. $adminConfig['url']               = 'http://localhost';
  4. $adminConfig['basePath']          = '/_feindura/'; // url path, relative to the DOCUMENT ROOT
  5. $adminConfig['realBasePath']      = '/_feindura/'; // real file path (mostly matches the above one)
  6. $adminConfig['websitePath']       = '/';
  7. $adminConfig['uploadPath']        = '/_feindura/_upload/';
  8. $adminConfig['websiteFilesPath']  = '/_feindura/_upload/';
  9. $adminConfig['stylesheetPath']    = '';
  10.  
  11. $adminConfig['permissions']       = 493; // = 0755
  12. $adminConfig['timezone']          = 'Europe/Berlin';
  13. $adminConfig['dateFormat']        = 'MDY';
  14. $adminConfig['speakingUrl']       = false;
  15.  
  16. $adminConfig['varName']['page']      = 'page';
  17. $adminConfig['varName']['category']  = 'category';
  18. $adminConfig['varName']['modul']     = 'modul';
  19.  
  20. $adminConfig['cache']['active']      = true;
  21. $adminConfig['cache']['timeout']     = 1.5;
  22.  
  23. $adminConfig['user']['frontendEditing']   = true;
  24. $adminConfig['user']['fileManager']       = true;
  25. $adminConfig['user']['editWebsiteFiles']  = false;
  26. $adminConfig['user']['editStyleSheets']   = false;
  27. $adminConfig['user']['editSnippets']      = false;
  28. $adminConfig['user']['info']              = '';
  29.  
  30. $adminConfig['multiLanguageWebsite']['active']       = true;
  31. $adminConfig['multiLanguageWebsite']['languages'][]    = en;
  32. $adminConfig['multiLanguageWebsite']['languages'][]    = nl;
  33. $adminConfig['multiLanguageWebsite']['mainLanguage']   = en;
  34.  
  35. $adminConfig['pages']['createDelete']     = true;
  36. $adminConfig['pages']['thumbnails']       = true;
  37. $adminConfig['pages']['showTags']         = true;
  38. $adminConfig['pages']['showPageDate']     = true;
  39. $adminConfig['pages']['showSubCategory']  = false;
  40. $adminConfig['pages']['feeds']            = true;
  41. $adminConfig['pages']['plugins']          = 'a:4:{i:0;s:11:"contactForm";i:1;s:12:"imageGallery";i:2;s:10:"pageRating";i:3;s:9:"slideShow";}';
  42.  
  43. $adminConfig['pages']['sorting']       = 'manually';
  44. $adminConfig['pages']['sortReverse']   = false;
  45.  
  46. $adminConfig['editor']['htmlLawed']    = true;
  47. $adminConfig['editor']['safeHtml']     = false;
  48. $adminConfig['editor']['enterMode']    = 'p';
  49. $adminConfig['editor']['editorStyles'] = true;
  50. $adminConfig['editor']['snippets']     = false;
  51. $adminConfig['editor']['styleFile']    = 'a:0:{}';
  52. $adminConfig['editor']['styleId']      = '';
  53. $adminConfig['editor']['styleClass']   = '';
  54.  
  55. $adminConfig['pageThumbnail']['width']   = '100';
  56. $adminConfig['pageThumbnail']['height']  = '100';
  57. $adminConfig['pageThumbnail']['ratio']   = '';
  58. $adminConfig['pageThumbnail']['path']    = 'thumbnails/'; // relative to the ['uploadPath']
  59.  
  60. return $adminConfig;
  61. ?>


Additional
  • see: FeinduraBase::__construct()
  • access: public
Used By
  • FeinduraBase::__construct() - the administrator-settings config array will set to this property
  • FeinduraBase::getCurrentCategoryId() - to look if set startpage is allowed
  • FeinduraBase::setCurrentPageId() - to check if setting a startpage is allowed
  • FeinduraBase::setCurrentCategoryId() - to check if setting a startpage is allowed
  • FeinduraBase::generatePage() - for the thumbnail upload path
  • FeinduraBase::createThumbnail() - for the thumbnail path

array $websiteConfig

Default value

Description

Contains the website-settings config set in the CMS backend

The file with the website-settings config array is situated at "feindura-CMS/config/website.config.php".

This settings will be set to this property in the FeinduraBase constructor.

Example array:
Show Example

  1. <?php
  2.  
  3. $websiteConfig['startPage']      = 1;
  4.  
  5. $websiteConfig['localized']['de']['title']          = 'Beispiel Website';
  6. $websiteConfig['localized']['de']['publisher']      = 'Max Musterman';
  7. $websiteConfig['localized']['de']['copyright']      = 'Max Musterman';
  8. $websiteConfig['localized']['de']['keywords']       = 'schlüsselwort1,schlüsselwort2,schlüsselwort3';
  9. $websiteConfig['localized']['de']['description']    = 'Diese Beispielseite ist dazu da um zu zeigen wie einfach feindura CMS ist.';
  10.  
  11. $websiteConfig['localized']['en']['title']          = 'Example Website';
  12. $websiteConfig['localized']['en']['publisher']      = 'Max Musterman';
  13. $websiteConfig['localized']['en']['copyright']      = 'Max Musterman';
  14. $websiteConfig['localized']['en']['keywords']       = 'keyword1,keyword2,keyword3,keyword4';
  15. $websiteConfig['localized']['en']['description']    = 'This example website is intended to show how easy it is to use feindura CMS.';
  16.  
  17. return $websiteConfig;
  18. ?>


Additional
  • see: FeinduraBase::__construct()
  • access: public
Used By
  • FeinduraBase::__construct() - the website-settings config array will set to this property
  • FeinduraBase::setCurrentPageId() - to get the startpage ID
  • FeinduraBase::setCurrentCategoryId() - to get the startpage ID
  • Feindura::createMetaTags() - for the website title, publisher, copyright, description and keywords

array $categoryConfig

Default value

Description

Contains the categories-settings config set in the CMS backend

The file with the categories-settings config array is situated at "feindura-CMS/config/category.config.php".

This settings will be set to this property in the FeinduraBase constructor.

Example array:
Show Example

  1. <?php
  2.  
  3. $categoryConfig[1]['id'] =              1;
  4. $categoryConfig[1]['public'] =          true;
  5. $categoryConfig[1]['isSubCategory']       = true;
  6. $categoryConfig[1]['isSubCategoryOf']     = 'a:1:{i:3;s:1:"3";}';
  7. $categoryConfig[1]['createDelete'] =    true;
  8. $categoryConfig[1]['thumbnail'] =       true;
  9. $categoryConfig[1]['plugins'] =         'N;';
  10. $categoryConfig[1]['showTags'] =        true;
  11. $categoryConfig[1]['showPageDate'] =    true;
  12. $categoryConfig[1]['showSubCategory'] = true;
  13. $categoryConfig[1]['feeds'] =           true;
  14.  
  15. $categoryConfig[1]['sorting'] =         'manually';
  16. $categoryConfig[1]['sortReverse'] =        false;
  17.  
  18. $categoryConfig[1]['styleFile'] =       '/styles/sheet.css';
  19. $categoryConfig[1]['styleId'] =         'contentId';
  20. $categoryConfig[1]['styleClass'] =      'contentClass';
  21.  
  22. $categoryConfig[1]['thumbWidth'] =      '100';
  23. $categoryConfig[1]['thumbHeight'] =     '';
  24. $categoryConfig[1]['thumbRatio'] =      'x';
  25.  
  26. $categoryConfig[1]['localized']['de']['name'] = 'Beispiel Kategorie 1';
  27. $categoryConfig[1]['localized']['en']['name'] = 'Example Category 1';
  28.  
  29.  
  30. $categoryConfig[2]['id'] =              2;
  31. $categoryConfig[2]['name'] =            'Example Category 2';
  32. $categoryConfig[2]['public'] =          false;
  33. $categoryConfig[2]['isSubCategory']       = false;
  34. $categoryConfig[2]['isSubCategoryOf']     = 'a:0:{}';
  35. $categoryConfig[2]['createDelete'] =    false;
  36. $categoryConfig[2]['thumbnail'] =       false;
  37. $categoryConfig[2]['plugins'] =         'a:1:{i:0;s:12:"imageGallery";}';
  38. $categoryConfig[2]['showTags'] =        false;
  39. $categoryConfig[2]['showPageDate'] =    false;
  40. $categoryConfig[2]['showSubCategory'] = false;
  41. $categoryConfig[2]['feeds'] =           true;
  42.  
  43. $categoryConfig[2]['sorting'] =         'manually';
  44. $categoryConfig[2]['sortReverse'] =        false;
  45.  
  46. $categoryConfig[2]['styleFile'] =       '';
  47. $categoryConfig[2]['styleId'] =         '';
  48. $categoryConfig[2]['styleClass'] =      '';
  49.  
  50. $categoryConfig[2]['thumbWidth'] =      '150';
  51. $categoryConfig[2]['thumbHeight'] =     '100';
  52. $categoryConfig[2]['thumbRatio'] =      '';
  53.  
  54. $categoryConfig[2]['localized']['de']['name'] = 'Beispiel Kategorie 2';
  55. $categoryConfig[2]['localized']['en']['name'] = 'Example Category 2';
  56.  
  57. ...
  58.  
  59. ?>


Additional
  • see: FeinduraBase::__construct()
  • access: public
Used By
  • FeinduraBase::__construct() - the category-settings config array will set to this property
  • FeinduraBase::getCurrentCategoryId() - for the right category name, if the $_GET variable is not a ID but a category name
  • FeinduraBase::loadPagesByDate() - to check if in the category is sorting by page date allowed
  • FeinduraBase::generatePage() - to check whether the category of the page allows thumbnails
  • FeinduraBase::createTitle() - to check if showing the page date is allowed and for the category name
  • FeinduraBase::createThumbnail() - to check if thumbnails are allowed for the th category of this page

array $languageNames = array()

Default value

array()

Description

An array with country codes and language names.

Example array array( 'ae' => 'Avestan', 'af' => 'Afrikaans', 'de' => 'German', 'en' => 'English', ...


Additional
  • see: Feindura::createLanguageMenu()
  • see: FeinduraBase()
  • access: public

array $languageFile = null

Default value

null

Description

Contains the frontend language-file array

The frontend language file array contains texts for displaying page warnings or errors and additional texts like "more", etc.
The file is situated at "feindura-CMS/library/languages/de.frontend.php".

It will be included and set to this property in the FeinduraBase constructor.


Additional
  • see: FeinduraBase()
  • access: public
Used By
  • FeinduraBase::__construct() - set the loaded frontend language-file to this property
  • FeinduraBase::generatePage() - for the error texts
  • FeinduraBase::createTitle() - for showing "yesterday", "today" or "tomorrow" instead of a page date

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

Parameters

string $language (optional) A language code "de", "en", ... to load the right frontend language-file and it will be set to the Feindura::$language property
Default false

Redefined in descendants as:
  • Feindura::__construct() : Type constructor

Description

Type constructor

The constructor of the class, sets all basic properties.

First gets all settings config arrays and external classes.
Then Check if the visitor is a logged in user of the feindura backend and set the FeinduraBase::$loggedIn property. Then set the $_GET variable names from the administrator-settings config to the $varNames property.
Check if cookies are activated, otherwise store the session ID in the $sessionId property for use in links.
Get the the given $language parameter or try to find the browser language and load the frontend language-file and set it to the Feindura::$languageFile property.

Used Global Variables

  • $adminConfig the administrator-settings config (included in the general.include.php)
  • $websiteConfig the website-settings config (included in the general.include.php)
  • $categoryConfig the categories-settings config (included in the general.include.php)


Additional
  • example: example
  • access: protected
Used By
  • Feindura::__construct() - the constructor of the parent class to load all necessary properties
Uses
  • FeinduraBase::$adminConfig - the administrator-settings config array will set to this property
  • FeinduraBase::$websiteConfig - the website-settings config array will set to this property
  • FeinduraBase::$categoryConfig - the category-settings config array will set to this property
  • FeinduraBase::$loggedIn - to set whether the visitor is logged in or not
  • $varNames - the variable names from the administrator-settings config will set to this property
  • FeinduraBase::$sessionId - the session ID string will set to this property, if cookies are deactivated
  • $language - to set the given $language parameter to, or try to get the browser language automatically
  • FeinduraBase::$languageFile - set the loaded frontend language-file to this property
  • StatisticFunctions::saveWebsiteStats() - save the website statistic like user visit count, first and last visit AND the visit time of the last visited pages
Version
  • 1.1
    ChangeLog
    • 1.1 moved languages to the Feindura constructor
    • 1.0 initial release

File source:
line 246
array|false getParentPages ( [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 getParentPages()

Returns an array with the parent pages of given subcategory. If the given category ID is not a sub category of any page, it will return an empty array.

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


Return Value
  • array|false - an array with the parent pages in the order from the current category on, or FALSE if this category is not a subcategory
Additional
  • see: GeneralFunctions::getParentPages
  • access: public
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 283
int|false getCurrentPageId ( )

Description

Name getCurrentPageId()
Alias getPageId()

Returns the current page ID from the $_GET variable.

Gets the current page ID from the $_GET variable. If $_GET is not a ID but a page name, it loads all pages in an array and look for the right page name and returns the ID. If no $_GET variable exists try to return the Feindura::$startPage property.

Used Global Variables

  • $_GET to fetch the page ID


Return Value
  • int|false - the current page ID or FALSE
Additional
  • access: public
Used By
  • FeinduraBase::setCurrentPageId() - to get the Feindura::$page property or the Feindura::$startPage property
Uses
  • StatisticFunctions::getCurrentPageId() - to get the current page id
Version
  • 1.2
    ChangeLog
    • 1.2 moved method to StatisticFunctions
    • 1.1 add localization
    • 1.0 initial release

File source:
line 324
int|false getCurrentCategoryId ( )

Description

Name getCurrentCategoryId()
Alias getCategoryId()

Returns the current category ID from the $_GET variable.

Gets the current category ID from the $_GET variable. If $_GET is not a ID but a category name, it look in the FeinduraBase::$categoryConfig for the right category ID. If no $_GET variable exists it try to return the Feindura::$startPage property.

Used Global Variables

  • $_GET to fetch the category ID


Return Value
  • int|false - the current category ID or FALSE
Additional
  • access: public
Used By
  • FeinduraBase::setCurrentCategoryId() - to get the Feindura::$category property or the $startCategory property
Uses
  • $varNames - for variable names which the $_GET variable will use for the category ID
  • FeinduraBase::$adminConfig - to look if set startpage is allowed
  • FeinduraBase::$categoryConfig - for the right category name, if the $_GET variable is not a ID but a category name
  • Feindura::$startCategory - if no $_GET variable exists it will try to get the Feindura::$startCategory property
Version
  • 1.1
    ChangeLog
    • 1.1 add localization
    • 1.0 initial release

File source:
line 368
array|false loadPagesByType ( string $idType,
int|array|bool $ids)

Parameters

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 loads all pages

Description

Name loadPagesByType()

Load pages by ID-type and ID(s).

If the $idType parameter start with "cat" it takes the given $ids parameter as category IDs.
If the $idType parameter start with "pag" it takes the given $ids parameter as page IDs.
While it is not important that whether the $idType parameter is written in plural or singular. The $ids parameter is automaticly checked whether its an array with IDs or a single ID.

Example of the returned $pageContent array: (Note This array will be wraped in another array, not shown here)
Show Example

  1. <?php
  2.  
  3. array(
  4.     "id"             => 2,
  5.     "category"       => 1,
  6.     "subCategory"    => false,
  7.     "public"         => true,
  8.     "sortOrder"      => 4,
  9.     "showInMenus"    => true,
  10.     "editLink"       => '',
  11.  
  12.     "lastSaveDate"   => 1282348800, // UNIX-Timestamp
  13.     "lastSaveAuthor" => 1, // ID of the user
  14.  
  15.     "pageDate"       => array(
  16.         "start"   => 1282342343,
  17.         "end"     => 1282353627
  18.       ),
  19.  
  20.     "plugins"      => array(
  21.           'imageGallery' => array(
  22.               'active'          => true,
  23.               'galleryPath'     => '/upload/gallery/',
  24.               'imageWidth'      => 800,
  25.               'imageHeight'     => null,
  26.               'thumbnailWidth'  => 160,
  27.               'thumbnailHeight' => null,
  28.               'tag'             => 'table',
  29.               'breakAfter'      => 3
  30.           ),
  31.           'pageRating' => array(
  32.               'active' => false,
  33.               'value'  => 0,
  34.               'votes'  => 0
  35.           ),
  36.  
  37.     "thumbnail"    => 'thumb_page1.jpg',
  38.  
  39.     "styleFile"    => '',
  40.     "styleId"      => '',
  41.     "styleClass"   => '',
  42.  
  43.     "localized"    => array(
  44.         "en" => array( 
  45.           "title"       => 'Example Page 1',
  46.           "description" => '',
  47.           "tags"        => 'fall',
  48.           "pageDate"    => array(
  49.               "before" => 'text before date',
  50.               "after"  => 'text after date'
  51.             ),
  52.           "content"     => '<p>Example Content of page 1</p>'
  53.         ),
  54.         "de" => array( 
  55.           "title"       => 'Beispiel Seite 1',
  56.           "description" => '',
  57.           "tags"        => 'herbst',
  58.           "pageDate"    => array(
  59.               "before" => 'Text davor',
  60.               "after"  => 'Text danach'
  61.             ),
  62.           "content"     => '<p>Beispiel Inhalt von Seite 1</p>'
  63.         )
  64.       )
  65.     )
  66.  
  67. ?>


Return Value
  • array|false - an array with $pageContent array(s)
Additional
  • access: public
Used By
  • FeinduraBase::loadPagesByDate() - load the pages depending on the type
  • FeinduraBase::checkPagesForTags() - to load pages by the given ID(s) for comparision
  • Feindura::createMenu() - to load the page $pageContent array(s) from the given ID(s)
  • Feindura::createMenuBySortFunction() - to load the pages which fit in the given time period parameters, sorted by the page date
  • Feindura::listPages() - to load the page $pageContent array(s) from the given ID(s)
  • Feindura::listPagesBySortFunction() - to load the page $pageContent array(s) from the given ID(s)
Uses
  • isPageContentArray() - to check if the given array is a $pageContent array, if TRUE it just returns this array
  • GeneralFunctions::isPublicCategory() - to check if the category(ies) or page(s) category(ies) are public
  • GeneralFunctions::loadPages() - to load pages
  • GeneralFunctions::readPage() - to load a single page
  • GeneralFunctions::getPageCategory() - to get the category of the page
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 477
array|false loadPagesMetaDataByType ( string $idType,
int|array|bool $ids)

Parameters

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 loads all pages

Description

Name loadPagesMetaDataByType()

Filters the GeneralFunctions::$pagesMetaData by ID-type and ID(s).

If the $idType parameter start with "cat" it takes the given $ids parameter as category IDs.
If the $idType parameter start with "pag" it takes the given $ids parameter as page IDs.
While it is not important that whether the $idType parameter is written in plural or singular. The $ids parameter is automaticly checked whether its an array with IDs or a single ID.


Return Value
  • array|false - the filtered $pagesMetaData array, or FALSE
Additional
  • access: public
Uses
  • GeneralFunctions::isPublicCategory() - to check if the category(ies) or page(s) category(ies) are public
  • GeneralFunctions::getPageCategory() - to get the category of the page
  • GeneralFunctions::$pagesMetaData
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 585
array|false loadPagesByDate ( [int|bool|string $from = true],
[int|bool|string $to = true],
string $idType,
int|array|bool $ids,
[bool $sortPages = false],
[bool $reverseList = false])

Parameters

string $idType the ID(s) type can be "cat", "category", "categories" or "pag", "page" or "pages"
Default true
int|array|bool $ids the category or page ID(s), can be a number or an array with numbers, if TRUE it loads all pages
Default true
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
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
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 loadPagesByDate()

Loads pages by ID-type and ID, which fit in the given time period parameters.

Checks if the pages to load have a page date and the page date fit in the given $from and $to parameters. All time period parameters are compared against 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.


Return Value
  • array|false - an array with the $pageContent arrays or FALSE if no page has a page date or is allowed for sorting
Additional
  • link: http://www.php.net/manual/de/datetime.formats.php
  • see: Feindura::listPagesByDate()
  • see: Feindura::createMenuByDate()
  • access: public
Used By
  • Feindura::createMenuByDate() - to load the pages which fit in the given time period parameters, sorted by the page date
  • Feindura::listPagesByDate() - to load the pages which fit in the given time period parameters, sorted by the page date
Uses
  • FeinduraBase::$categoryConfig - to check if in the category is sorting by page date allowed
  • FeinduraBase::getPropertyIdsByType() - to get the property IDs if the $ids parameter is FALSE
  • FeinduraBase::loadPagesByType() - load the pages depending on the type
  • changeDate() - change the current date minus or plus the months from specified in the parameters
  • gernalFunctions::sortPages() - to sort the pages by page date
Version
  • 1.0.1
    ChangeLog
    • 1.0.1 fixed timezone when using strtotime
    • 1.0 initial release

File source:
line 731
int|false setCurrentPageId ( [bool $setStartPage = false])

Parameters

bool $setStartPage (optional) If set to TRUE it also sets the Feindura::$startPage property
Default false

Description

Name setCurrentPageId()
Alias setPageId()

Sets the current page ID from the $_GET variable to the Feindura::$page property.

Gets the current page ID from the $_GET variable (through getCurrentPageId) and set it to the Feindura::$page property. If the $setStartPage parameter is TRUE and the Feindura::$category is empty, the Feindura::$startPage property will also be set with the start page ID from the $websiteConfig.


Return Value
  • int|false - the set page ID or FALSE
Additional
  • access: protected
Used By
  • Feindura::__construct() - to set the fetched page ID from the $_GET variable to the Feindura::$page property
Uses
  • FeinduraBase::$adminConfig - to check if setting a startpage is allowed
  • FeinduraBase::$websiteConfig - to get the startpage ID
  • Feindura::$page - as the property to set
  • Feindura::$startPage - if the $setStartPage parameter is TRUE this property will also be set
  • FeinduraBase::getCurrentPageId() - to get the Feindura::$page property or the Feindura::$startPage property
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 779
int|false setCurrentCategoryId ( [bool $setStartCategory = false])

Parameters

bool $setStartCategory (optional) If set to TRUE it also sets the $startCategory property
Default false

Description

Name setCurrentCategoryId()
Alias setCategoryId()

Sets the current category ID from the $_GET variable to the Feindura::$category property.

Gets the current category ID from the $_GET variable (through getCurrentCategoryId) and set it to the Feindura::$category property. If the $setStartCategory parameter is TRUE the $startCategory property will also be set with the startpage ID from the $websiteConfig.


Return Value
  • int|false - the set category ID or FALSE
Additional
  • access: protected
Used By
  • Feindura::__construct() - to set the fetched category ID from the $_GET variable to the Feindura::$category property
Uses
  • FeinduraBase::$adminConfig - to check if setting a startpage is allowed
  • FeinduraBase::$websiteConfig - to get the startpage ID
  • Feindura::$category - as the property to set
  • Feindura::$startCategory - if the $setStartCategory parameter is TRUE this property will also be set
  • FeinduraBase::getCurrentCategoryId() - to get the Feindura::$category property or the $startCategory property
  • GeneralFunctions::getPageCategory() - to get the right category ID of the startpage
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 821
string loadFrontendLanguageFile ( [string $language = false])

Parameters

string $language (optional) a given country code which will be used to try to load the language file
Default false

Description

Name loadFrontendLanguageFile()

Loads the frontend language file into the Feindura::$languageFile property.


Return Value
  • string - the country code which was used to load the frontend language files
Additional
  • access: protected
Uses
  • GeneralFunctions::loadLanguageFile() - to load the language files
Version
  • 1.2
    ChangeLog
    • add $standardLang parameter
    • 1.1 add new GeneralFunctions::loadLanguageFile() method
    • 1.0 initial release

File source:
line 861
array generateMenu ( array $links,
[int|bool $menuTag = false])

Parameters

array $links an array with links in the format
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 generateMenu()

Generates a menu from a given $links array.

Note: It will add the Feindura::$linkActiveClass property as CSS class to the link, which is matching the current language.


Return Value
  • array - the generated menu array, ready to display in a HTML file
Additional
  • see: Feindura::createMenu()
  • see: Feindura::createSubMenu()
  • access: protected
Used By
  • Feindura::createMenu() - to generate the final menu
  • Feindura::createLanguageMenu() - to generate the final menu
Uses
  • Feindura::$menuId
  • Feindura::$menuClass
  • Feindura::$menuAttributes
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 1135
string generateContent ( string $pageContentString,
int|array $pageId)

Parameters

string $pageContentString the localized page content string of a page
int|array $pageId page ID

Description

Name generateContent()

Generates the page content and adds the frontend editing when activated and logged in.

Note: Activates the frontend editing (adds a div tag with feindura data).


Return Value
  • string - the generated page content
Additional
  • see: FeinduraBase::generatePage()
  • access: protected
Used By
  • FeinduraBase::generatePage() - to modify the pageContent (and add frontend editing container)
Uses
  • GeneralFunctions::$adminConfig - to check for frontend editing
  • $xHtml
  • GeneralFunctions::htmLawed()
  • GeneralFunctions::replaceLinks()
  • GeneralFunctions::replaceSnippets()
  • GeneralFunctions::shortenHtmlText()
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 1241
array generatePage ( int|array $page,
[bool $showErrors = true],
[int|array|bool $shortenText = false],
[bool|string $useHtml = true])

Parameters

int|array $page page ID or a $pageContent array
bool $showErrors (optional) says if errors like "The page you requested doesn't exist" will be displayed
Default true
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) displays the page content with or without HTML tags. It also accepts a string with allowed html tags.
Default true

Description

Name generatePage()

This method uses the $showErrors, $titleLength and $thumbnailAlign properties.

Generates a page.

This method is called in descendant classes.
Generates a page by the given page ID. An array will be returned with 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 $showErrors parameter is TRUE, an error will be placed in the ['content'] part of the returned array, otherwiese it returns an empty array.

Note: Activates the frontend editing (adds a span tag with feindura data).

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 - the generated page array, ready to display in a HTML file
Additional
  • example: the called showPage method in this example uses the generatePage() method
  • see: Feindura::showPages()
  • see: Feindura::listPages()
  • access: protected
Used By
  • Feindura::showPage() - to generate the array with the page elements
  • Feindura::hasPlugins() - to generate the array with the page elements
  • Feindura::showPlugins() - to generate the array with the page elements
  • Feindura::listPages() - to generate every page which will be listed
  • Feindura::listPagesBySortFunction() - to generate every page which will be listed
Uses
  • FeinduraBase::$adminConfig - for the thumbnail upload path
  • FeinduraBase::$categoryConfig - to check whether the category of the page allows thumbnails
  • FeinduraBase::$languageFile - for the error texts
  • Feindura::$page
  • 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::createTitle() - to create the page title
  • FeinduraBase::createThumbnail() - to check to show thumbnails are allowed and create the thumbnail <img> tag
  • FeinduraBase::createAttributes() - to create the attributes used in the error tag
  • FeinduraBase::shortenHtmlText() - to shorten the HTML page content
  • FeinduraBase::shortenText() - to shorten the non HTML page content, if the $useHtml parameter is FALSE
  • FeinduraBase::generateContent() - to modify the pageContent (and add frontend editing container)
  • GeneralFunctions::formatDate() - to format the page date for output
  • GeneralFunctions::dateDayBeforeAfter() - check if the page date is "yesterday" "today" or "tomorrow"
  • GeneralFunctions::isPublicCategory() - to check whether the category is public
  • GeneralFunctions::isPageContentArray() - to check if the given array is a $pageContent array
  • GeneralFunctions::readPage() - to load the page if the $page parameter is an ID
  • GeneralFunctions::getPageCategory() - to get the category of the page
Version
  • 1.1
    ChangeLog
    • 1.1 add <time> tag to the pageDate
    • 1.0.1 fixed description return
    • 1.0 initial release

File source:
line 1497
string createTitle ( array $pageContent,
[int $titleLength = false],
[bool $titleAsLink = false],
[bool $titleShowPageDate = false],
[bool $titleShowCategory = false],
[ $titlePageDateSeparator = false],
[string $titleCategorySeparator = false],
[bool $allowFrontendEditing = true])

Parameters

array $pageContent the $pageContent Array of a page
int $titleLength (optional) number of the maximal text length shown or FALSE to not shorten
Default false
bool $titleAsLink (optional) if TRUE, it creates the title as link
Default false
bool $titleShowPageDate (optional) if TRUE, it shows the page date before the title text
Default false
bool $titleShowCategory (optional) if TRUE, it shows the category name before the title text, and uses the $titleShowCategory parameter string between both
Default false
string $titleCategorySeparator (optional) string to seperate the category name and the title text, if the $titleShowCategory parameter is TRUE
Default false
bool $allowFrontendEditing (optional) if TRUE it will allow frontendenditing, when it is activated and the user is logged in. If $titleAsLink is TRUE, frontend editing will be deactivated anyway.
Default false
$titlePageDateSeparator
Default true

Description

Name createTitle()

Generates a page title from a given $pageContent array by using the given parameters.

Note: Activates the frontend editing (adds a span tag with feindura data).


Return Value
  • string - the generated title string ready to display in a HTML file
Additional
  • see: Feindura::getPageTitle()
  • example: example not found
  • access: protected
Used By
  • FeinduraBase::generatePage() - to create the page title
  • Feindura::showTitle() - to generate the page title with the right title properties
Uses
  • FeinduraBase::$categoryConfig - to check if showing the page date is allowed and for the category name
  • FeinduraBase::$languageFile - for showing "yesterday", "today" or "tomorrow" instead of a page date
  • FeinduraBase::shortenText() - to shorten the title text, if the $titleLength parameter is TRUE
  • createHref() - to create the href if the $titleAsLink parameter is TRUE
  • GeneralFunctions::formatDate() - to format the title date for output
  • GeneralFunctions::dateDayBeforeAfter() - check if the title date is "yesterday" "today" or "tomorrow"
Version
  • 1.1
    ChangeLog
    • 1.1 add <time> tag to the pageDate
    • 1.0 initial release

File source:
line 1598
array|false createThumbnail ( array $pageContent)

Parameters

array $pageContent the $pageContent array of a page

Description

Name createThumbnail()

Generates a thumbnail <img> tag from the given $pageContent array and returns an array with the ready to display tag and the plain thumbnail path.

Note:: It will add the class "feinduraThumbnail" to the image.

Used Constants

  • DOCUMENTROOT the absolut path of the webserver


Return Value
  • array|false - the generated thumbnail <img> tag and a the plain thumbnail path or FALSE if no thumbnail exists or is not allowed to show
Additional
  • see: Feindura::createLink()
  • see: FeinduraBase::generatePage()
  • access: protected
Used By
  • FeinduraBase::generatePage() - to check to show thumbnails are allowed and create the thumbnail <img> tag
  • Feindura::createLink() - to create the thumbnail for the link if the $linkShowThumbnail property is TRUE
Uses
  • FeinduraBase::$adminConfig - for the thumbnail path
  • FeinduraBase::$categoryConfig - to check if thumbnails are allowed for the th category of this page
  • FeinduraBase::createAttributes() - to create the attributes used in the thumbnail <img> tag
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 1683
string createAttributes ( string|number $id,
string|number $class,
string|number $attributes)

Parameters

string|number $id a HTML id attribute value
string|number $class a HTML class attribute value
string|number $attributes one or more 'key="values"' attributes

Description

Name createAttributes()

Generates a string with a given id, class and other attributes.

Check whether the given parameters are strings or numbers and add them to a string with attributes.

Example return: 'id="exampleId" class="exampleClass" key="value"'


Return Value
  • string - the generated attribute string
Additional
  • access: protected
Used By
  • FeinduraBase::generatePage() - to create the attributes used in the error tag
  • FeinduraBase::createThumbnail() - to create the attributes used in the thumbnail <img> tag
  • Feindura::createLink() - to create the attributes used by the link <a> tag
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 1732
array|false checkPagesForTags ( string $idType,
int|array|bool $ids,
string|array $tags,
[bool $loadPageContent = true])

Parameters

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
string|array $tags an string (seperated by ",") or an array with tags to compare
bool $loadPageContent whether or not to return pageContent</var arrays or just the <var>$pagesMetaData arrays
Default true

Description

Name checkPagesForTags()

Load the $pageContent array of pages, only if the page(s) have one or more tags from the given $tags parameter.

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
  • see: Feindura::listPagesByTags()
  • see: Feindura::createMenuByTags()
  • access: protected
Used By
  • Feindura::createMenuByTags() - to get only the pages which have one or more tags from the given $tags parameter
  • Feindura::hasTags() - to check pages for tags
  • Feindura::listPagesByTags() - to get only the pages which have one or more tags from the given $tags parameter
Uses
  • FeinduraBase::loadPagesByType() - to load pages by the given ID(s) for comparision
  • compareTags() - to compare each tags between two strings
Version
  • 1.1
    ChangeLog
    • 1.1 add $pagesMetaData array to get the tags of the page, speeds up the comparision
    • 1.0.2 removed separation by ; which has problems with signs like " in utf-8
    • 1.0.1 fixed issue when get a single tag as string
    • 1.0 initial release

File source:
line 1810
array|false getIdsFromString ( int|string|array|bool $ids)

Parameters

int|string|array|bool $ids a page ID, array with page and category IDs, or a string/array with "previous","next","first","last" or "random". (See example) (can also be a $pageContent array)

Description

Name getIdsFromString()

Gets the right page and category IDs. If the $ids parameter is a an array it uses the first value as page ID and the second as category ID.

If the given $ids parameter is a string/array with "previous" or "next" it returns the previous or next page ID from the current Feindura::$page property/Feindura::$category property on. If the given $ids parameter is a string/array with "first" or "last" it returns the first or last page ID in that category from the current Feindura::$page property/Feindura::$category property on. If the string is "random" it returns a random page ID in the current category, if its an array like: array('random','random') it would return a random page ID from a random category.

Note: What is the first or last page/category depends on the sorting you have of the pages/categories in the feindura backend.
Note: When using "previous","next","first" or "last" it will jump over pages/categories which are not public and return the next one.

Examples of possible $ids parameter.
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. ?>

Example return value, where first value is the page ID and the second value is the category ID. array(2,1)


Return Value
  • array|false - array with the page ID and category ID of the right page, or FALSE if no page could be resolved (e.g. last page and "next"). (will also pass through a given $pageContent array)
Additional
  • access: protected
Used By
  • Feindura::createHref() - to load the right page and category IDs depending on the $ids parameter
  • Feindura::createLink() - to load the right page and category IDs depending on the $ids parameter
  • Feindura::createBreadCrumbsMenu() - to load the right page and category IDs depending on the $ids parameter
  • Feindura::showTitle() - to load the right page and category IDs depending on the $ids parameter
  • Feindura::showPage() - to load the right page and category IDs depending on the $ids parameter
  • Feindura::hasPlugins() - to load the right page and category IDs depending on the $ids parameter
  • Feindura::showPlugins() - to load the right page and category IDs depending on the $ids parameter
Uses
  • FeinduraBase::getPropertyPage() - to get the right Feindura::$page property
  • GeneralFunctions::getPageCategory() - to get the category ID of the given page
  • GeneralFunctions::getPagesMetaDataOfCategory() - to load all pages in a category to find the right previous or next page and return it
Version
  • 2.0
    ChangeLog
    • 2.0 change name from loadPrevNextPage() to getIdsFromString(), now handles also categories
    • 1.0 initial release

File source:
line 2047
int|false getPropertyIdsByType ( string $idType,
int|array|bool $ids)

Parameters

string $idType the ID type can be "page", "pages" or "category", "categories"
int|array|bool $ids the category or page ID(s), if they are FALSE it returns the property ID, otherwise it passes the ID(s) through

Description

Name getPropertyIdsByType()

If $ids parameter is FALSE it check the ID-type and returns then the Feindura::$page or Feindura::$category property.


Return Value
  • int|false - a page or category property ID or FALSE, if there are no property IDs
Additional
  • see: Feindura::listPages()
  • see: Feindura::createMenu()
  • access: protected
Used By
  • FeinduraBase::loadPagesByDate() - to get the property IDs if the $ids parameter is FALSE
  • Feindura::createMenu() - if the $ids parameter is FALSE it gets the property category or page ID, depending on the $idType parameter
  • Feindura::createMenuByTags() - if the $ids parameter is FALSE it gets the property category or page ID, depending on the $idType parameter
  • Feindura::listPages() - if the $ids parameter is FALSE it gets the property category or page ID, depending on the $idType parameter
  • Feindura::listPagesByTags() - if the $ids parameter is FALSE it gets the property category or page ID, depending on the $idType parameter
  • Feindura::listPagesBySortFunction() - if the $ids parameter is FALSE it gets the property category or page ID, depending on the $idType parameter
Uses
  • FeinduraBase::getPropertyPage() - to get the right Feindura::$page property
  • FeinduraBase::getPropertyCategory() - to get the right Feindura::$category property
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 2081
mixed getPropertyPage ( [int|bool $page = false])

Parameters

int|bool $page (optional) a page id or a boolean
Default false

Description

Name getPropertyPage()

Returns the Feindura::$page property if the given $page parameter is a Boolean.


Return Value
  • mixed - either the Feindura::$page property or passes the $page parameter
Additional
  • access: protected
Used By
  • FeinduraBase::getIdsFromString() - to get the right Feindura::$page property
  • FeinduraBase::getPropertyIdsByType() - to get the right Feindura::$page property
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 2104
int|true getPropertyCategory ( [int|bool $category = false])

Parameters

int|bool $category (optional) a category id or a boolean
Default false

Description

Name getPropertyCategory()

Returns the Feindura::$category property if the given $category parameter is a Boolean.


Return Value
  • int|true - the Feindura::$category property or the $category parameter
Additional
  • access: protected
Used By
  • FeinduraBase::getPropertyIdsByType() - to get the right Feindura::$category property
Version
  • 1.0
    ChangeLog
    • 1.0 initial release

File source:
line 2138
string shortenText ( string $string,
int|array $length,
[array|false $pageContent = false],
[string|false $endString = " ..."])

Parameters

string $string the string to shorten
int|array $length the number of maximal characters, or an array with a number for text length and the more string, or a bool, whether to add the more link or not. e.g. array(23,false), array(23,'read more'), or array(23,'<a href="…"'>read more</a>')
array|false $pageContent (optional) the pageContent array of the page to create the "more" link to the page from
Default false
string|false $endString (optional) a string which will be put after the last character and before the "more" link
Default " ..."

Description

Name shortenText()

Shorten a text by to a given length.

If the $endString parameter is set and a $pageContent array is given, it adds the $endString parameter after the last character and a "more" link on the end of the shortened text.


Return Value
  • string - the shortened string
Additional
  • access: protected
Used By
  • FeinduraBase::generatePage() - to shorten the non HTML page content, if the $useHtml parameter is FALSE
  • FeinduraBase::createTitle() - to shorten the title text, if the $titleLength parameter is TRUE
  • FeinduraBase::shortenHtmlText() - shorten the text
  • Feindura::createLink() - to shorten the linktext if the $linkLength property is set
Uses
  • createHref() - create the href for the "more" link
  • GeneralFunctions::isPageContentArray() - check if the given $pageContent parameter is valid
Version
  • 1.1
    ChangeLog
    • 1.1 $length parameter can now be an array
    • 1.0 initial release

File source:
line 2203
string shortenHtmlText (  $input,
int|array $length,
[array|false $pageContent = false],
[string|false $endString = ' ...'],
string $string)

Parameters

string $string the string to shorten
int|array $length the number of maximal characters, or an array with a number for text length and the more string, or a bool, whether to add the more link or not. e.g. array(23,false), array(23,'read more'), or array(23,'<a href="…"'>read more</a>')
array|false $pageContent (optional) the pageContent array of the page to create the "more" link to the page from
Default false
string|false $endString (optional) a string which will be put after the last character and before the "more" link
Default ' ...'
$input

Description

Name shortenHtmlText()

Shorten a HTML text by to a given length.

All HTML tags which are contained in the shortend text will be counted and closed on the end.
If the $endString parameter is set and a $pageContent array is given, it adds the $endString parameter after the last character and a "more" link on the end of the shortened text.


Return Value
  • string - the shortened string
Additional
  • access: protected
Used By
  • FeinduraBase::generatePage() - to shorten the HTML page content
Uses
  • FeinduraBase::shortenText() - shorten the text
  • createHref() - create the href for the "more" link
Version
  • 1.1
    ChangeLog
    • 1.1 $length parameter can now be an array
    • 1.0 initial release



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