@@ -131,15 +131,11 @@ public function preDispatch()
131
131
132
132
$ this ->userSession = $ user ;
133
133
$ this ->view ->recentItems = array ();
134
- $ this ->view ->needUpgrade = false ;
135
134
$ this ->view ->highNumberError = false ;
136
135
if ($ user ->Dao != null && $ user ->Dao instanceof UserDao) {
137
136
if ($ user ->Dao ->isAdmin () && $ fc ->getRequest ()->getControllerName () != 'install ' && $ fc ->getRequest (
138
137
)->getControllerName () != 'error '
139
138
) {
140
- if ($ this ->isUpgradeNeeded ()) {
141
- $ this ->view ->needUpgrade = true ;
142
- }
143
139
$ errorlogModel = MidasLoader::loadModel ('Errorlog ' );
144
140
$ count = $ errorlogModel ->countSince (
145
141
date ('Y-m-d H:i:s ' , strtotime ('-24 hour ' )),
@@ -311,14 +307,14 @@ public function preDispatch()
311
307
) {
312
308
$ this ->_helper ->layout ->setLayout ($ layoutParam );
313
309
} else {
314
- $ modulesConfig = Zend_Registry::get ('configsModules ' );
315
- foreach ($ modulesConfig as $ key => $ module ) {
316
- if (file_exists (BASE_PATH .'/modules/ ' .$ key .'/layouts/layout-core.phtml ' )) {
317
- $ this ->_helper ->layout ->setLayoutPath (BASE_PATH .'/modules/ ' .$ key .'/layouts/ ' );
310
+ $ enabledModules = Zend_Registry::get ('modulesEnable ' );
311
+ foreach ($ enabledModules as $ enabledModule ) {
312
+ if (file_exists (BASE_PATH .'/modules/ ' .$ enabledModule .'/layouts/layout-core.phtml ' )) {
313
+ $ this ->_helper ->layout ->setLayoutPath (BASE_PATH .'/modules/ ' .$ enabledModule .'/layouts/ ' );
318
314
$ this ->_helper ->layout ->setLayout ('layout-core ' );
319
315
}
320
- if (file_exists (BASE_PATH .'/privateModules/ ' .$ key .'/layouts/layout-core.phtml ' )) {
321
- $ this ->_helper ->layout ->setLayoutPath (BASE_PATH .'/privateModules/ ' .$ key .'/layouts/ ' );
316
+ if (file_exists (BASE_PATH .'/privateModules/ ' .$ enabledModule .'/layouts/layout-core.phtml ' )) {
317
+ $ this ->_helper ->layout ->setLayoutPath (BASE_PATH .'/privateModules/ ' .$ enabledModule .'/layouts/ ' );
322
318
$ this ->_helper ->layout ->setLayout ('layout-core ' );
323
319
}
324
320
}
@@ -490,34 +486,6 @@ public function showNotificationMessage($message)
490
486
$ this ->view ->json ['triggerNotification ' ][] = $ message ;
491
487
}
492
488
493
- /** check if midas needs to be upgraded */
494
- public function isUpgradeNeeded ()
495
- {
496
- require_once BASE_PATH .'/core/controllers/components/UpgradeComponent.php ' ;
497
- $ upgradeComponent = new UpgradeComponent ();
498
- $ db = Zend_Registry::get ('dbAdapter ' );
499
- $ dbtype = Zend_Registry::get ('configDatabase ' )->database ->adapter ;
500
-
501
- $ upgradeComponent ->initUpgrade ('core ' , $ db , $ dbtype );
502
- if ($ upgradeComponent ->getNewestVersion () > $ upgradeComponent ->transformVersionToNumeric (
503
- Zend_Registry::get ('configDatabase ' )->version
504
- )
505
- ) {
506
- return true ;
507
- }
508
- $ modulesConfig = Zend_Registry::get ('configsModules ' );
509
- foreach ($ modulesConfig as $ key => $ module ) {
510
- $ upgradeComponent ->initUpgrade ($ key , $ db , $ dbtype );
511
- if ($ upgradeComponent ->getNewestVersion () != 0 && $ upgradeComponent ->getNewestVersion (
512
- ) > $ upgradeComponent ->transformVersionToNumeric ($ module ->version )
513
- ) {
514
- return true ;
515
- }
516
- }
517
-
518
- return false ;
519
- }
520
-
521
489
/** zend post dispatch */
522
490
public function postDispatch ()
523
491
{
0 commit comments