@@ -63,8 +63,10 @@ public function preDispatch()
63
63
Zend_Registry::set ('webroot ' , $ this ->view ->webroot );
64
64
Zend_Registry::set ('coreWebroot ' , $ this ->view ->coreWebroot );
65
65
66
- $ this ->view ->title = Zend_Registry::get ('configGlobal ' )->application ->name ;
67
- $ this ->view ->metaDescription = Zend_Registry::get ('configGlobal ' )->application ->description ;
66
+ /** @var SettingModel $settingModel */
67
+ $ settingModel = MidasLoader::loadModel ('Setting ' );
68
+ $ this ->view ->title = $ settingModel ->getValueByNameWithDefault ('title ' , 'Midas Platform - Digital Archiving System ' );
69
+ $ this ->view ->metaDescription = $ settingModel ->getValueByNameWithDefault ('description ' , '' );
68
70
69
71
// Set the version
70
72
$ version = UtilityComponent::getCurrentModuleVersion ('core ' );
@@ -82,7 +84,7 @@ public function preDispatch()
82
84
83
85
// log in when testing
84
86
$ testingUserId = $ this ->getParam ('testingUserId ' );
85
- if (Zend_Registry::get ('configGlobal ' )->environment == 'testing ' && isset ($ testingUserId )
87
+ if (Zend_Registry::get ('configGlobal ' )->get ( ' environment ' , ' production ' ) = == 'testing ' && isset ($ testingUserId )
86
88
) {
87
89
$ user = new Zend_Session_Namespace ('Auth_User_Testing ' );
88
90
@@ -94,7 +96,7 @@ public function preDispatch()
94
96
}
95
97
} else {
96
98
$ user = new Zend_Session_Namespace ('Auth_User ' );
97
- $ user ->setExpirationSeconds (60 * Zend_Registry::get ('configGlobal ' )->session -> lifetime );
99
+ $ user ->setExpirationSeconds (60 * ( int ) Zend_Registry::get ('configGlobal ' )->get ( ' session_lifetime ' , 20 ) );
98
100
}
99
101
100
102
/** @var Zend_Controller_Request_Http $request */
@@ -193,7 +195,11 @@ public function preDispatch()
193
195
// init notifier
194
196
Zend_Registry::set ('notifier ' , new MIDAS_Notifier ($ this ->logged , $ this ->userSession ));
195
197
196
- $ this ->view ->lang = Zend_Registry::get ('configGlobal ' )->application ->lang ;
198
+ if ((int ) Zend_Registry::get ('configGlobal ' )->get ('internationalization ' , 0 ) === 1 ) {
199
+ $ this ->view ->lang = $ settingModel ->getValueByNameWithDefault ('language ' , 'en ' );
200
+ } else {
201
+ $ this ->view ->lang = 'en ' ;
202
+ }
197
203
198
204
$ this ->view ->isStartingGuide = $ this ->isStartingGuide ();
199
205
$ this ->view ->isDynamicHelp = $ this ->isDynamicHelp ();
@@ -205,7 +211,7 @@ public function preDispatch()
205
211
'logged ' => $ this ->logged ,
206
212
'needToLog ' => false ,
207
213
'currentUri ' => $ this ->getRequest ()->REQUEST_URI ,
208
- 'lang ' => Zend_Registry:: get ( ' configGlobal ' )-> application ->lang ,
214
+ 'lang ' => $ this -> view ->lang ,
209
215
'dynamichelp ' => $ this ->isDynamicHelp (),
210
216
'dynamichelpAnimate ' => $ this ->isDynamicHelp () && isset ($ _GET ['first ' ]),
211
217
'startingGuide ' => $ this ->isStartingGuide (),
@@ -336,7 +342,7 @@ public function preDispatch()
336
342
}
337
343
338
344
// If there is an outbound HTTP proxy configured on this server, set it up here
339
- $ httpProxy = Zend_Registry::get ('configGlobal ' )->httpproxy ;
345
+ $ httpProxy = Zend_Registry::get ('configGlobal ' )->get ( ' http_proxy ' , false ) ;
340
346
if ($ httpProxy ) {
341
347
$ opts = array ('http ' => array ('proxy ' => $ httpProxy ));
342
348
stream_context_set_default ($ opts );
@@ -351,15 +357,18 @@ public function preDispatch()
351
357
public function isDynamicHelp ()
352
358
{
353
359
try {
354
- $ dynamichelp = Zend_Registry::get ('configGlobal ' )->dynamichelp ;
355
- if ($ dynamichelp && $ this ->userSession != null ) {
360
+ /** @var SettingModel $settingModel */
361
+ $ settingModel = MidasLoader::loadModel ('Setting ' );
362
+ $ dynamicHelp = $ settingModel ->getValueByNameWithDefault ('dynamic_help ' , 0 );
363
+
364
+ if ($ dynamicHelp && $ this ->userSession != null ) {
356
365
$ userDao = $ this ->userSession ->Dao ;
357
366
if ($ userDao != null && $ userDao instanceof UserDao) {
358
367
return $ userDao ->getDynamichelp () == 1 ;
359
368
}
360
369
}
361
370
362
- return $ dynamichelp == 1 ;
371
+ return $ dynamicHelp == 1 ;
363
372
} catch (Zend_Exception $ exc ) {
364
373
$ this ->getLogger ()->warn ($ exc ->getMessage ());
365
374
@@ -404,7 +413,7 @@ public function getServerURL()
404
413
*/
405
414
public function isTestingEnv ()
406
415
{
407
- return Zend_Registry::get ('configGlobal ' )->environment == 'testing ' ;
416
+ return Zend_Registry::get ('configGlobal ' )->get ( ' environment ' , ' production ' ) = == 'testing ' ;
408
417
}
409
418
410
419
/**
@@ -474,7 +483,7 @@ public function postDispatch()
474
483
{
475
484
parent ::postDispatch ();
476
485
$ this ->view ->json = JsonComponent::encode ($ this ->view ->json );
477
- if (Zend_Registry::get ('configGlobal ' )->environment ! = 'testing ' ) {
486
+ if (Zend_Registry::get ('configGlobal ' )->get ( ' environment ' , ' production ' ) != = 'testing ' ) {
478
487
header ('Content-Type: text/html; charset=UTF-8 ' );
479
488
}
480
489
if ($ this ->progressDao != null ) {
0 commit comments