cleaned project, repaired router
This commit is contained in:
parent
2156d3f5c6
commit
bffe0f1660
16 changed files with 1172 additions and 1440 deletions
|
|
@ -1,36 +1,19 @@
|
|||
<?php
|
||||
/**
|
||||
* Abstract Controller Plugin
|
||||
* All controller plugins must extend this class.
|
||||
*
|
||||
* @author Karl Pannek <info@katharsis.in>
|
||||
* @version 0.5.2
|
||||
* @package Katharsis
|
||||
*/
|
||||
abstract class Katharsis_Controller_Plugin_Abstract
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->_con = Katharsis_DatabaseConnector::getConnection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Overwrite this method, if you want something to be processed
|
||||
* _before_ the controller is called
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function preController()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Overwrite this method, if you want something to be processed
|
||||
* _after_ the controller was called
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function postController()
|
||||
{
|
||||
}
|
||||
}
|
||||
<?php
|
||||
abstract class Katharsis_Controller_Plugin_Abstract
|
||||
{
|
||||
protected $_con;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_con = Katharsis_DatabaseConnector::getConnection();
|
||||
}
|
||||
|
||||
public function preController()
|
||||
{
|
||||
}
|
||||
|
||||
public function postController()
|
||||
{
|
||||
}
|
||||
}
|
||||
?>
|
||||
21
library/Katharsis/Controller/Plugin/AutoScriptControl.php
Normal file
21
library/Katharsis/Controller/Plugin/AutoScriptControl.php
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
class Katharsis_Controller_Plugin_AutoScriptControl extends Katharsis_Controller_Plugin_Abstract
|
||||
{
|
||||
public function preController()
|
||||
{
|
||||
$view = Katharsis_View::getInstance();
|
||||
|
||||
$view->autoScriptFile = false;
|
||||
|
||||
|
||||
|
||||
$scriptName = ucfirst(Katharsis_Request::getControllerName()) . '/' . strtolower(Katharsis_Request::getActionName());
|
||||
$autoScriptFile = 'scripts/DidgeridooArtwork/' . $scriptName . '.js';
|
||||
$sl = DIRECTORY_SEPARATOR;
|
||||
|
||||
if(file_exists(getcwd() . $sl . str_replace('/', $sl, $autoScriptFile)))
|
||||
{
|
||||
$view->autoScriptFile = $view->base . '/' . $autoScriptFile;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,33 +1,20 @@
|
|||
<?php
|
||||
/**
|
||||
* Autorender Controller Plugin
|
||||
*
|
||||
* @author Karl Pannek <info@katharsis.in>
|
||||
* @version 0.5.2
|
||||
* @package Katharsis
|
||||
*/
|
||||
class Katharsis_Controller_Plugin_Autorender extends Katharsis_Controller_Plugin_Abstract
|
||||
{
|
||||
/**
|
||||
* Renders a controller/action.phtml template automaticly after processing controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function postController()
|
||||
{
|
||||
|
||||
$view = Katharsis_View::getInstance();
|
||||
|
||||
$view->controllerAction = false;
|
||||
|
||||
$templateName = strtolower(Katharsis_Request::getControllerName()) . DIRECTORY_SEPARATOR . strtolower(Katharsis_Request::getActionName());
|
||||
|
||||
if(file_exists('application/view' . DIRECTORY_SEPARATOR . $templateName . '.phtml'))
|
||||
{
|
||||
$view->controllerAction = $templateName;
|
||||
}
|
||||
|
||||
$view = Katharsis_View::getInstance();
|
||||
echo $view->render('main');
|
||||
}
|
||||
}
|
||||
<?php
|
||||
class Katharsis_Controller_Plugin_Autorender extends Katharsis_Controller_Plugin_Abstract
|
||||
{
|
||||
public function postController()
|
||||
{
|
||||
$view = Katharsis_View::getInstance();
|
||||
|
||||
$view->stageContent = false;
|
||||
|
||||
$templateName = ucfirst(Katharsis_Request::getControllerName()) . DIRECTORY_SEPARATOR . strtolower(Katharsis_Request::getActionName());
|
||||
|
||||
if(file_exists(getcwd() . '/application/view' . DIRECTORY_SEPARATOR . $templateName . '.phtml'))
|
||||
{
|
||||
$view->stageContent = $view->render($templateName);
|
||||
}
|
||||
|
||||
echo $view->render('main');
|
||||
}
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue