'Unnamed Website',self::META_SITE_DESC => false, self::META_SITE_TAGS => false,self::META_PAGE_TITLE => false, self::META_PAGE_DESC => false,self::META_PAGE_TAGS => false); /** * * @var array content fragments, used by the final layout plugin to generate the page */ private $fragments = array(); /** * * @var string the main content */ private $content = ''; /** * * @var string a new target url */ private $redirectURL = false; private $redirectTarget = false; private $redirectView = false; private $redirectParam = array(); public $addons = array(self::ADDON_CSS => array(), self::ADDON_JSLIB => array()); /** * * @return int the number of errors in the current run */ public function errorCount() { return count($this->errors); } public function addError($code, $message, $type = 'cms', $e = null) { $this->errors[] = array( 'code' => $code,'type' => $type,'message' => $message,'exception' => $e); } public function getErrors() { return $this->errors; } public function clearErrors() { $this->errors = array(); } public function setFragment($key, $value) { $this->fragments[$key] = (string) $value; } public function getFragment($key) { return !empty($this->fragments[$key]) ? $this->fragments[$key] : NULL; } public function getAllFragments() { return $this->fragments; } public function removeFragment($key) { unset($this->fragments[$key]); } public function getType() { return $this->type; } public function setType($type) { $this->type = $type; } public function getMedia() { return $this->type; } public function setMedia($type) { $type = strtolower($type); switch($type) { case 'default': $this->type = $type; break; default: throw new MFIllegalArgumentException($type . ' is not a valid output media (default,popup,small,print)'); break; } } public function getContent() { return $this->content; } public function setContent($content) { $this->content = (string) $content; } public function appendContent($content) { $this->content .= $content; } public function clearContent() { $this->content = ''; } /** * defines a new target which should be opened instead of the current one * * @param string $url * the full redirect url */ public function setRedirectURL($url) { $this->redirectURL = $url; } /** * Set a redirect target * * @param string $instanceName * the target instance * @param string $view * the target view * @param array $param * optional parameters */ public function setRedirect($instanceName, $view, array $param = array()) { $this->redirectTarget = $instanceName; $this->redirectView = $view; $this->redirectParam = $param; } /** * * @return array an array with the redirect parameters or false if none set */ public function getRedirect() { if($this->redirectTarget == false && $this->redirectURL == false) return false; return array( 'url' => $this->redirectURL,'instance' => $this->redirectTarget, 'view' => $this->redirectView,'param' => $this->redirectParam); } /** * Fetches a meta setting * * @param string $name * the keyname of the setting * @since 1.0.0.1 * @return multitype:string boolean |boolean */ public function getMeta($name) { if(isset($this->meta[$name])) return $this->meta[$name]; return false; } /** * Stores a meta setting * * @param string $name * the keyname of the setting * @param mixed $value * the value * @since 1.0.0.1 */ public function setMeta($name, $value) { $this->meta[$name] = $value; } /** * Resets the redirect values */ public function clearRedirect() { $this->redirectTarget = false; $this->redirectAction = false; $this->redirectParam = false; } }