added page rewrite plugin

This commit is contained in:
Logsol 2013-07-19 16:41:54 +02:00
parent 82f3f83219
commit 50aecb6ca2
4 changed files with 21 additions and 2 deletions

View file

@ -1,4 +1,4 @@
title = Seinheit. title = Seinheit.
subtitle = Praxis für Traditionelle Europäische Medizin subtitle = Praxis für Traditionelle Europäische Medizin
email = info@seinheit.ch email = info@seinheit.ch
#sites = index, event, news #sites = news, blog

View file

@ -3,6 +3,6 @@
{ {
public function render($pageName) public function render($pageName)
{ {
return $this->_view->base . "/page/" . $pageName; return $this->_view->base . "/" . $pageName;
} }
} }

View file

@ -0,0 +1,18 @@
<?php
class Local_Controller_Plugin_PageRewrite extends Katharsis_Controller_Plugin_Abstract
{
public function preController()
{
$defaultSites = array();
if(isset(Katharsis_Registry::getInstance()->defaults['sites'])){
$defaultSites = explode(", ", Katharsis_Registry::getInstance()->defaults['sites']);
}
$page = Katharsis_Request::getControllerName();
if(!in_array($page, $defaultSites)) {
Katharsis_Request::setControllerName('page');
Katharsis_Request::setActionName($page);
}
}
}

View file

@ -13,6 +13,7 @@ require_once('library/Katharsis/Bootstrap.php');
Katharsis_Autoload::init(); Katharsis_Autoload::init();
Katharsis_Controller_Plugin::registerPlugin(new DidgeridooArtwork_Controller_Plugin_Defaults()); Katharsis_Controller_Plugin::registerPlugin(new DidgeridooArtwork_Controller_Plugin_Defaults());
Katharsis_Controller_Plugin::registerPlugin(new Local_Controller_Plugin_PageRewrite());
Katharsis_Controller_Plugin::registerPlugin(new DidgeridooArtwork_Controller_Plugin_SetNames()); Katharsis_Controller_Plugin::registerPlugin(new DidgeridooArtwork_Controller_Plugin_SetNames());
Katharsis_Controller_Plugin::registerPlugin(new Katharsis_Controller_Plugin_StartSession()); Katharsis_Controller_Plugin::registerPlugin(new Katharsis_Controller_Plugin_StartSession());
Katharsis_Controller_Plugin::registerPlugin(new DidgeridooArtwork_Controller_Plugin_Notice()); Katharsis_Controller_Plugin::registerPlugin(new DidgeridooArtwork_Controller_Plugin_Notice());