@@ -19,19 +19,24 @@ class MIDAS_GlobalModule extends AppController
19
19
{
20
20
/** contructor*/
21
21
public function __construct (Zend_Controller_Request_Abstract $ request , Zend_Controller_Response_Abstract $ response , array $ invokeArgs = array ())
22
- {
22
+ {
23
23
parent ::__construct ($ request , $ response , $ invokeArgs );
24
24
$ this ->loadModuleElements ();
25
25
if (!isset ($ this ->moduleName ))
26
26
{
27
27
throw new Zend_Exception ("Please set the module name in AppController " );
28
- }
28
+ }
29
29
$ fc = Zend_Controller_Front::getInstance ();
30
30
$ this ->view ->moduleWebroot = $ fc ->getBaseUrl ().'/modules/ ' .$ this ->moduleName ;
31
-
31
+ $ this ->view ->moduleName = $ this ->moduleName ;
32
+
33
+ $ config = new Zend_Config_Ini (BASE_PATH .'/modules/ ' .$ this ->moduleName .'/configs/module.ini ' , 'global ' , true );
34
+ $ this ->view ->moduleFullName = $ config ->fullname ;
35
+ $ this ->view ->moduleDescription = $ config ->description ;
36
+
32
37
$ stack = debug_backtrace ();
33
38
$ forward = $ this ->_getParam ('forwardModule ' );
34
-
39
+
35
40
// Add variables to the view that allow the retrieval of any enabled module
36
41
// webroots
37
42
$ allModules = Zend_Registry::get ('modulesEnable ' );
@@ -41,22 +46,22 @@ public function __construct(Zend_Controller_Request_Abstract $request, Zend_Cont
41
46
$ this ->view ->$ modWebroot = $ fc ->getBaseUrl ().'/modules/ ' .$ mod ;
42
47
}
43
48
}
44
-
49
+
45
50
/** pre dispatch (zend)*/
46
51
public function preDispatch ()
47
- {
48
- parent ::preDispatch ();
52
+ {
53
+ parent ::preDispatch ();
49
54
$ this ->view ->setScriptPath (BASE_PATH ."/modules/ " .$ this ->moduleName ."/views " );
50
55
if ($ this ->isTestingEnv ())
51
56
{
52
57
$ this ->disableLayout ();
53
58
}
54
59
else
55
- {
56
-
60
+ {
61
+
57
62
if (file_exists (BASE_PATH ."/modules/ " .$ this ->moduleName ."/layouts/layout.phtml " ))
58
63
{
59
- $ this ->_helper ->layout ->setLayoutPath (BASE_PATH ."/modules/ " .$ this ->moduleName ."/layouts " );
64
+ $ this ->_helper ->layout ->setLayoutPath (BASE_PATH ."/modules/ " .$ this ->moduleName ."/layouts " );
60
65
}
61
66
}
62
67
}
@@ -98,7 +103,7 @@ public function loadModuleElements()
98
103
}
99
104
}
100
105
}
101
-
106
+
102
107
if (isset ($ this ->_moduleDaos ))
103
108
{
104
109
foreach ($ this ->_moduleDaos as $ dao )
@@ -116,7 +121,7 @@ public function loadModuleElements()
116
121
@$ this ->ModuleComponent ->$ component = new $ nameComponent ();
117
122
}
118
123
}
119
-
124
+
120
125
if (isset ($ this ->_moduleForms ))
121
126
{
122
127
foreach ($ this ->_moduleForms as $ forms )
0 commit comments