Simple Web Presenter
An extremely basic CMS
 All Classes Files Functions Variables Pages
Public Member Functions | List of all members
Options Class Reference

Public Member Functions

 getDefaultLang ()
 
 getLang ()
 
 setCacheable ($cacheable)
 
 getCacheable ()
 
 getBaseUrl ()
 
 replacePlaceholders ($value)
 
 setBaseUrl ($baseUrl)
 
 setFlagUrl ($flagUrl)
 
 getFlagUrl ()
 
 setLang ($lang)
 
 getBasePath ()
 
 setBasePath ($basePath)
 
 setUrlParams ($urlParams)
 
 getUrlParams ()
 
 setName ($name)
 
 getName ()
 
 setCache ($cache)
 
 getCache ()
 
 getAcceptedLanguages ()
 
 getInputDefault ($key)
 
 __construct ($baseDocument)
 

Detailed Description

Contains alle configurable parameters, and "globals"

Author
Tom Fredrik Blenning Klaussen

Constructor & Destructor Documentation

Options::__construct (   $baseDocument)

Constructs an options object

This contstructor will consume any tag with the type option, and extract values from any tag with type input

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
<param type="input_config" id="title"/>
</title>
<param type="input_config" id="css"/>
</head>
<body>
<div id="container">
<param type="input" id="name" default="home"/>
<param type="option" id="lang" default="no">
<accept_value>no</accept_value>
</param>
</div>
</body>
</html>
Parameters
$baseDocumentAn open xml file

Member Function Documentation

Options::getAcceptedLanguages ( )

A list of languages which this configuration supports.

Returns
array of two letter language codes
Options::getBasePath ( )

Gets the path where the scripts are located

Returns
path where scripts are located
Options::getBaseUrl ( )

Get the base url, or if non set, extracts it from _SERVER

Returns
the baseurl for the scripts
Options::getCache ( )

Gets the cache object

Returns
cache object
Options::getCacheable ( )

Gets wether or not this page may be cached

Returns
Cacheable, default is YES
Options::getDefaultLang ( )

Gets the default language

Returns
two letter code for the language
Options::getFlagUrl ( )

Gets the url for the flag script, or autogenerate if not set

Returns
url for flag script
Options::getInputDefault (   $key)

Gets the default value associated whith the key

Parameters
$keyas specified in master xml file.
Returns
associated default
Options::getLang ( )

Gets the selected language

Returns
two letter code for the language
Options::getName ( )

Gets the name(identity) for this page

Returns
name(identity)
Options::getUrlParams ( )

Gets the default language

Returns
associative array of key and value for the url parameters
Options::replacePlaceholders (   $value)

Replaces placeholder variables, with actual values.

Currently supported values:

  • %HOST%
Parameters
$valuestring to replace values in
Returns
the processed string
Options::setBasePath (   $basePath)

Sets the path where the scripts are located

Parameters
$basePathpath where scripts are located
Options::setBaseUrl (   $baseUrl)

Sets the base url where scripts are located

Parameters
$baseUrlthe url where scripts are located
Options::setCache (   $cache)

Sets a cache object

Parameters
$cacheCacheTimeCheck object
Options::setCacheable (   $cacheable)

Sets wether or not this page may be cached

Parameters
$cacheableCacheable
Options::setFlagUrl (   $flagUrl)

Sets the url for the flag script

Parameters
$flagUrlfor flag script
Options::setLang (   $lang)

Sets the selected language

Parameters
$langtwo letter code for the language
Options::setName (   $name)

Sets the name(identity) for this page

Parameters
$namename(identity)
Options::setUrlParams (   $urlParams)

Sets a set of urlparameters

Parameters
$urlParamslist of parameters to get from the URL

The documentation for this class was generated from the following file: