added page rewrite plugin
This commit is contained in:
parent
82f3f83219
commit
50aecb6ca2
4 changed files with 21 additions and 2 deletions
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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue