13
13
/**
14
14
* Batchmake_ConfigController
15
15
* @todo TODO list for ConfigController and batchmake module
16
- * - add phpdocumenter style comments
17
- * - rework Notification
18
- * - add tests
19
- * - clean UI layout
20
- * - repititions/redundancy in controller
21
- * - repititions/redundancy in index.pthml
22
- * - translations/centralized string resources
23
- * - centralize constants
24
- * - ? how to sync PHP, javascript, and css constants? info, error, warning among them
25
- * - ? how to internationalize javascript strings?
26
16
* - better way of loading internationalization component in component and form
27
- * - For now, have a KWBatchmakeComponent, which includes kwutils stuff and kwbatchmake
28
- * - separate kw utils, where does this go?
29
- * - separate kwbatchmake, where does this go?
30
- * - clean component, internationalize strings
31
17
* - look into zend internationalization/translate
32
- * - look into cmake infinite loop
33
18
* - for web api, there is a json wrapper , ajax_web_api.js in midas2
34
19
* - an element: ajax_web_api.thtml look in assetstore for usage
35
20
* - should need to put the "writing" of the auth token info in some common controller code
36
21
* - then include the element in any view
37
22
* - then the json .js wrapper will automaticially negotiate
38
- * - ? how to use web api in a module?
39
- * - want to namaespace constants MIDAS_BATCHMAKE
40
- * - for imports have a static var for one time class loading
41
- * - change ajax callst o be through web api
42
- * - kwutils, try to use zend framework
23
+ * - change ajax callst o be through web api, and standard ajax
43
24
*/
44
25
class Batchmake_ConfigController extends Batchmake_AppController
45
26
{
@@ -72,18 +53,19 @@ protected function archiveOldModuleLocal()
72
53
73
54
74
55
/**
75
- * @method indexAction()
56
+ * @method indexAction(), will test the configuration that the user has set
57
+ * and return validation info for the passed in properties.
76
58
*/
77
- function indexAction ()
59
+ public function indexAction ()
78
60
{
79
61
80
- $ applicationConfig = $ this ->ModuleComponent ->KWBatchmake ->loadApplicationConfig ();
62
+ $ applicationConfig = $ this ->ModuleComponent ->KWBatchmake ->loadConfigProperties ();
81
63
$ configPropertiesRequirements = $ this ->ModuleComponent ->KWBatchmake ->getConfigPropertiesRequirements ();
82
64
$ configForm = $ this ->ModuleForm ->Config ->createConfigForm ($ configPropertiesRequirements );
83
65
$ formArray = $ this ->getFormAsArray ($ configForm );
84
66
foreach ($ configPropertiesRequirements as $ configProperty => $ configPropertyRequirement )
85
67
{
86
- $ formArray [$ configProperty ]->setValue ($ applicationConfig [$ this -> moduleName . ' . ' . $ configProperty ]);
68
+ $ formArray [$ configProperty ]->setValue ($ applicationConfig [$ configProperty ]);
87
69
}
88
70
$ this ->view ->configForm = $ formArray ;
89
71
@@ -129,7 +111,7 @@ public function testconfigAction()
129
111
130
112
131
113
$ configPropertiesParamVals = array ();
132
- $ configPropertiesRequirements = $ this ->ModuleComponent ->KWBatchmake ->GetConfigPropertiesRequirements ();
114
+ $ configPropertiesRequirements = $ this ->ModuleComponent ->KWBatchmake ->getConfigPropertiesRequirements ();
133
115
foreach ($ configPropertiesRequirements as $ configProperty => $ configPropertyRequirement )
134
116
{
135
117
$ configPropertiesParamVals [$ configProperty ] = $ this ->_getParam ($ configProperty );
@@ -138,17 +120,7 @@ public function testconfigAction()
138
120
$ config_status = $ this ->ModuleComponent ->KWBatchmake ->testconfig ($ configPropertiesParamVals );
139
121
$ jsonout = JsonComponent::encode ($ config_status );
140
122
echo $ jsonout ;
141
- // echo JsonComponent::encode($config_status);
142
123
}//end testconfigAction
143
124
144
125
145
-
146
-
147
-
148
-
149
-
150
-
151
-
152
-
153
-
154
126
}//end class
0 commit comments