@@ -176,7 +176,7 @@ function propertiesNameValue($propertyString) {
176
176
$ tRow = EvolutionCms ()->getDatabase ()->getRow ($ ts ,'assoc ' );
177
177
$ templateId = $ tRow ['id ' ];
178
178
EvolutionCms ()->getDatabase ()->query ("INSERT INTO ` " . $ table_prefix . "site_tmplvar_templates` (tmplvarid, templateid) VALUES(' $ id', ' $ templateId'); " );
179
- }
179
+ }
180
180
}
181
181
}
182
182
}
@@ -242,16 +242,17 @@ function propertiesNameValue($propertyString) {
242
242
if (isset ($ _POST ['module ' ]) || $ installData ) {
243
243
echo "<h3> " . $ _lang ['modules ' ] . ":</h3> " ;
244
244
$ selModules = $ _POST ['module ' ];
245
- foreach ($ moduleModules as $ k=> $ moduleModule ) {
245
+ foreach ($ moduleModules as $ k => $ moduleModule ) {
246
246
$ installSample = in_array ('sample ' , $ moduleModule [7 ]) && $ installData == 1 ;
247
- if ($ installSample || in_array ($ k , $ selModules )) {
248
- $ name = EvolutionCms ()->getDatabase ()->escape ($ moduleModule [0 ]);
249
- $ desc = EvolutionCms ()->getDatabase ()->escape ($ moduleModule [1 ]);
247
+ if ($ installSample || in_array ($ k , $ selModules )) {
248
+ $ name = evo ()->getDatabase ()->escape ($ moduleModule [0 ]);
249
+ $ desc = evo ()->getDatabase ()->escape ($ moduleModule [1 ]);
250
250
$ filecontent = $ moduleModule [2 ];
251
251
$ properties = $ moduleModule [3 ];
252
- $ guid = EvolutionCms ()->getDatabase ()->escape ($ moduleModule [4 ]);
253
- $ shared = EvolutionCms ()->getDatabase ()->escape ($ moduleModule [5 ]);
254
- $ category = EvolutionCms ()->getDatabase ()->escape ($ moduleModule [6 ]);
252
+ $ guid = evo ()->getDatabase ()->escape ($ moduleModule [4 ]);
253
+ $ shared = evo ()->getDatabase ()->escape ($ moduleModule [5 ]);
254
+ $ category = evo ()->getDatabase ()->escape ($ moduleModule [6 ]);
255
+ $ icon = evo ()->getDatabase ()->escape ($ moduleModule [8 ]);
255
256
if (!file_exists ($ filecontent ))
256
257
echo "<p> $ name: <span class= \"notok \"> " . $ _lang ['unable_install_module ' ] . " ' $ filecontent' " . $ _lang ['not_found ' ] . ".</span></p> " ;
257
258
else {
@@ -262,19 +263,19 @@ function propertiesNameValue($propertyString) {
262
263
$ module = end (preg_split ("/(\/\/)?\s*\<\?php/ " , file_get_contents ($ filecontent ), 2 ));
263
264
// remove installer docblock
264
265
$ module = preg_replace ("/^.*?\/\*\*.*?\*\/\s+/s " , '' , $ module , 1 );
265
- $ module = EvolutionCms ()->getDatabase ()->escape ($ module );
266
- $ rs = EvolutionCms ()->getDatabase ()->query ("SELECT * FROM ` " . $ table_prefix . "site_modules` WHERE name=' $ name' " );
267
- if (EvolutionCms ()->getDatabase ()->getRecordCount ($ rs )) {
268
- $ row = EvolutionCms ()->getDatabase ()->getRow ($ rs ,'assoc ' );
269
- $ props = EvolutionCms ()->getDatabase ()->escape (propUpdate ($ properties ,$ row ['properties ' ]));
270
- if (!@ EvolutionCms ()->getDatabase ()->query ("UPDATE ` " . $ table_prefix . "site_modules` SET modulecode=' $ module', description=' $ desc', properties=' $ props', enable_sharedparams=' $ shared' WHERE name=' $ name'; " )) {
266
+ $ module = evo ()->getDatabase ()->escape ($ module );
267
+ $ rs = evo ()->getDatabase ()->query ("SELECT * FROM ` " . $ table_prefix . "site_modules` WHERE name=' $ name' " );
268
+ if (evo ()->getDatabase ()->getRecordCount ($ rs )) {
269
+ $ row = evo ()->getDatabase ()->getRow ($ rs ,'assoc ' );
270
+ $ props = evo ()->getDatabase ()->escape (propUpdate ($ properties ,$ row ['properties ' ]));
271
+ if (!@ evo ()->getDatabase ()->query ("UPDATE ` " . $ table_prefix . "site_modules` SET modulecode=' $ module', description=' $ desc', properties=' $ props', enable_sharedparams=' $ shared', icon=' $ icon ' WHERE name=' $ name'; " )) {
271
272
echo "<p> " . mysql_error () . "</p> " ;
272
273
return ;
273
274
}
274
275
echo "<p> $ name: <span class= \"ok \"> " . $ _lang ['upgraded ' ] . "</span></p> " ;
275
276
} else {
276
- $ properties = EvolutionCms ()->getDatabase ()->escape (parseProperties ($ properties , true ));
277
- if (!@ EvolutionCms ()->getDatabase ()->query ("INSERT INTO ` " . $ table_prefix . "site_modules` (name,description,modulecode,properties,guid,enable_sharedparams,category) VALUES(' $ name',' $ desc',' $ module',' $ properties',' $ guid',' $ shared', ' $ category'); " )) {
277
+ $ properties = evo ()->getDatabase ()->escape (parseProperties ($ properties , true ));
278
+ if (!@ evo ()->getDatabase ()->query ("INSERT INTO ` " . $ table_prefix . "site_modules` (name, description, modulecode, properties, guid, enable_sharedparams, category, icon ) VALUES(' $ name', ' $ desc', ' $ module', ' $ properties', ' $ guid', ' $ shared', ' $ category', ' $ icon '); " )) {
278
279
echo "<p> " . mysql_error () . "</p> " ;
279
280
return ;
280
281
}
@@ -531,7 +532,7 @@ function parseProperties($propertyString, $json=false) {
531
532
}
532
533
533
534
}
534
- // new json-format
535
+ // new json-format
535
536
} else if (!empty ($ jsonFormat )){
536
537
$ property = $ jsonFormat ;
537
538
}
0 commit comments