diff --git a/application/Bootstrap.php b/application/Bootstrap.php index 1f1c3c1..fef5e41 100644 --- a/application/Bootstrap.php +++ b/application/Bootstrap.php @@ -48,8 +48,6 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap protected function _initLayout() { $layout = Zend_Layout::startMvc(); - $layout->setLayoutPath(APPLICATION_PATH . '/modules/default/views/layout'); - $layout->setLayout('default'); return $layout; } @@ -103,6 +101,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap // Add plugins $frontController->registerPlugin(new Fiktiv_Controller_Plugin_Language()); $frontController->registerPlugin(new Fiktiv_Controller_Plugin_Navigation()); + $frontController->registerPlugin(new Fiktiv_Controller_Plugin_Layout()); return $frontController; } diff --git a/application/modules/admin/controllers/IndexController.php b/application/modules/admin/controllers/IndexController.php new file mode 100644 index 0000000..28ee119 --- /dev/null +++ b/application/modules/admin/controllers/IndexController.php @@ -0,0 +1,9 @@ + + + + headTitle() . "\n" /* Newline for pretty source :) */ ?> + headMeta() . "\n" /* Newline for pretty source :) */ ?> + + + headScript() ?> + + fancybox()->headScript() ?> + + +
+ + layout()->content ?> + +
+ + \ No newline at end of file diff --git a/application/modules/admin/views/scripts/index/index.phtml b/application/modules/admin/views/scripts/index/index.phtml new file mode 100644 index 0000000..17967e8 --- /dev/null +++ b/application/modules/admin/views/scripts/index/index.phtml @@ -0,0 +1 @@ +

Admin module, more here later.

\ No newline at end of file diff --git a/library/Fiktiv/Controller/Plugin/Layout.php b/library/Fiktiv/Controller/Plugin/Layout.php new file mode 100644 index 0000000..e999aee --- /dev/null +++ b/library/Fiktiv/Controller/Plugin/Layout.php @@ -0,0 +1,30 @@ +getParam('bootstrap'); + $layout = $bootstrap->getResource('layout'); + + $moduleName = $request->getModuleName(); + + if (file_exists(APPLICATION_PATH . '/modules/' . $moduleName . '/views/layout/' . $this->_default . '.phtml')) { + + $layout->setLayoutPath(APPLICATION_PATH . '/modules/' . $moduleName . '/views/layout'); + } else { + + $layout->setLayoutPath(APPLICATION_PATH . '/modules/default/views/layout'); + } + + $layout->setLayout($this->_default); + + } +} \ No newline at end of file