Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit e55ae61

Browse files
author
Charles Ma
committed
ENH: refs #301 Added layout change (module)
1 parent 7052145 commit e55ae61

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

core/AppController.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,22 @@ public function preDispatch()
253253
$this->view->json = array(
254254
"global" => $jsonGlobal, "login" => $login, 'feed' => $feed, "browse" => $browse);
255255
Zend_Loader::loadClass("JsonComponent", BASE_PATH.'/core/controllers/components');
256+
257+
// init layout
258+
$modulesConfig = Zend_Registry::get('configsModules');
259+
foreach($modulesConfig as $key => $module)
260+
{
261+
if($this->_helper->hasHelper('layout') && file_exists(BASE_PATH . "/modules/".$key."/layouts/layout-core.phtml"))
262+
{
263+
$this->_helper->layout->setLayoutPath(BASE_PATH . "/modules/".$key."/layouts/");
264+
$this->_helper->layout->setLayout('layout-core');
265+
}
266+
if($this->_helper->hasHelper('layout') && file_exists(BASE_PATH . "/privateModules/".$key."/layouts/layout-core.phtml"))
267+
{
268+
$this->_helper->layout->setLayoutPath(BASE_PATH . "/privateModules/".$key."/layouts/");
269+
$this->_helper->layout->setLayout('layout-core');
270+
}
271+
}
256272
} // end preDispatch()
257273

258274
/** get server's url */

0 commit comments

Comments
 (0)