added page rewrite plugin
This commit is contained in:
parent
82f3f83219
commit
50aecb6ca2
4 changed files with 21 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
title = Seinheit.
|
||||
subtitle = Praxis für Traditionelle Europäische Medizin
|
||||
email = info@seinheit.ch
|
||||
#sites = index, event, news
|
||||
#sites = news, blog
|
|
@ -3,6 +3,6 @@
|
|||
{
|
||||
public function render($pageName)
|
||||
{
|
||||
return $this->_view->base . "/page/" . $pageName;
|
||||
return $this->_view->base . "/" . $pageName;
|
||||
}
|
||||
}
|
18
library/Local/Controller/Plugin/PageRewrite.php
Normal file
18
library/Local/Controller/Plugin/PageRewrite.php
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,6 +13,7 @@ require_once('library/Katharsis/Bootstrap.php');
|
|||
Katharsis_Autoload::init();
|
||||
|
||||
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 Katharsis_Controller_Plugin_StartSession());
|
||||
Katharsis_Controller_Plugin::registerPlugin(new DidgeridooArtwork_Controller_Plugin_Notice());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue