@@ -23,18 +23,18 @@ discard block |
||
23 | 23 | $dbupdater = new WfdownloadsDbupdater(); |
24 | 24 | |
25 | 25 | if (!wfdownloads_TableExists('wfdownloads_meta')) { |
26 | - // Create table wfdownloads_meta |
|
27 | - $table = new WfdownloadsTable('wfdownloads_meta'); |
|
28 | - $table->setStructure( "CREATE TABLE %s ( |
|
26 | + // Create table wfdownloads_meta |
|
27 | + $table = new WfdownloadsTable('wfdownloads_meta'); |
|
28 | + $table->setStructure( "CREATE TABLE %s ( |
|
29 | 29 | metakey varchar(50) NOT NULL default '', |
30 | 30 | metavalue varchar(255) NOT NULL default '', |
31 | 31 | PRIMARY KEY (metakey)) |
32 | 32 | ENGINE=MyISAM;"); |
33 | 33 | |
34 | - $table->setData(sprintf("'version', %s", round($GLOBALS['xoopsModule']->getVar('version') / 100, 2))); |
|
35 | - if ($dbupdater->updateTable($table)) { |
|
36 | - echo "wfdownloads_meta table created<br />"; |
|
37 | - } |
|
34 | + $table->setData(sprintf("'version', %s", round($GLOBALS['xoopsModule']->getVar('version') / 100, 2))); |
|
35 | + if ($dbupdater->updateTable($table)) { |
|
36 | + echo "wfdownloads_meta table created<br />"; |
|
37 | + } |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | $download_fields = array( |
@@ -85,11 +85,11 @@ discard block |
||
85 | 85 | $download_table = new WfdownloadsTable("wfdownloads_downloads"); |
86 | 86 | $fields = get_table_info($download_handler->table, $download_fields); |
87 | 87 | // Check for renamed fields |
88 | - rename_fields($download_table, $renamed_fields, $fields, $download_fields); |
|
88 | + rename_fields($download_table, $renamed_fields, $fields, $download_fields); |
|
89 | 89 | update_table($download_fields, $fields, $download_table); |
90 | - if ($dbupdater->updateTable($download_table)) { |
|
91 | - echo "Downloads table updated<br />"; |
|
92 | - } |
|
90 | + if ($dbupdater->updateTable($download_table)) { |
|
91 | + echo "Downloads table updated<br />"; |
|
92 | + } |
|
93 | 93 | unset($fields); |
94 | 94 | |
95 | 95 | $mod_fields = array( |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | rename_fields($mod_table, $renamed_fields, $fields, $mod_fields); |
144 | 144 | update_table($mod_fields, $fields, $mod_table); |
145 | 145 | if ($dbupdater->updateTable($mod_table)) { |
146 | - echo "Modified Downloads table updated <br />"; |
|
146 | + echo "Modified Downloads table updated <br />"; |
|
147 | 147 | } |
148 | 148 | unset($fields); |
149 | 149 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $fields = get_table_info($cat_handler->table, $cat_fields); |
172 | 172 | update_table($cat_fields, $fields, $cat_table); |
173 | 173 | if ($dbupdater->updateTable($cat_table)) { |
174 | - echo "Category table updated<br />"; |
|
174 | + echo "Category table updated<br />"; |
|
175 | 175 | } |
176 | 176 | unset($fields); |
177 | 177 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | $fields = get_table_info($broken_handler->table, $broken_fields); |
191 | 191 | update_table($broken_fields, $fields, $broken_table); |
192 | 192 | if ($dbupdater->updateTable($broken_table)) { |
193 | - echo "Broken Reports table updated<br />"; |
|
193 | + echo "Broken Reports table updated<br />"; |
|
194 | 194 | } |
195 | 195 | unset($fields); |
196 | 196 | } |
@@ -202,31 +202,31 @@ discard block |
||
202 | 202 | // ========================================================================================= |
203 | 203 | function invert_nohtm_dohtml_values() |
204 | 204 | { |
205 | - $ret = array(); |
|
205 | + $ret = array(); |
|
206 | 206 | global $xoopsDB; |
207 | 207 | $cat_handler = xoops_getmodulehandler('category', 'wfdownloads'); |
208 | 208 | $result = $xoopsDB->query("SHOW COLUMNS FROM ".$cat_handler->table); |
209 | 209 | while ($existing_field = $xoopsDB->fetchArray($result)) { |
210 | - $fields[$existing_field['field']] = $existing_field['type']; |
|
210 | + $fields[$existing_field['field']] = $existing_field['type']; |
|
211 | 211 | } |
212 | 212 | if (in_array("nohtml", array_keys($fields))) { |
213 | - $dbupdater = new WfdownloadsDbupdater(); |
|
213 | + $dbupdater = new WfdownloadsDbupdater(); |
|
214 | 214 | //Invert column values |
215 | - // alter options in wfdownloads_cat |
|
216 | - $table = new WfdownloadsTable('wfdownloads_cat'); |
|
217 | - $table->addAlteredField('nohtml', "dohtml tinyint(1) NOT NULL DEFAULT '1'"); |
|
218 | - $table->addAlteredField('nosmiley', "dosmiley tinyint(1) NOT NULL DEFAULT '1'"); |
|
219 | - $table->addAlteredField('noxcodes', "doxcode tinyint(1) NOT NULL DEFAULT '1'"); |
|
220 | - $table->addAlteredField('noimages', "doimage tinyint(1) NOT NULL DEFAULT '1'"); |
|
221 | - $table->addAlteredField('nobreak', "dobr tinyint(1) NOT NULL DEFAULT '1'"); |
|
215 | + // alter options in wfdownloads_cat |
|
216 | + $table = new WfdownloadsTable('wfdownloads_cat'); |
|
217 | + $table->addAlteredField('nohtml', "dohtml tinyint(1) NOT NULL DEFAULT '1'"); |
|
218 | + $table->addAlteredField('nosmiley', "dosmiley tinyint(1) NOT NULL DEFAULT '1'"); |
|
219 | + $table->addAlteredField('noxcodes', "doxcode tinyint(1) NOT NULL DEFAULT '1'"); |
|
220 | + $table->addAlteredField('noimages', "doimage tinyint(1) NOT NULL DEFAULT '1'"); |
|
221 | + $table->addAlteredField('nobreak', "dobr tinyint(1) NOT NULL DEFAULT '1'"); |
|
222 | 222 | |
223 | - //inverting values no=1 <=> do=0 |
|
224 | - // have to store teporarly as value = 2 to |
|
225 | - // avoid putting everithing to same value |
|
226 | - // if you change 1 to 0, then 0 to one, |
|
227 | - // every value will be 1, follow me? |
|
228 | - $table->addUpdatedWhere('dohtml', 2,'=1'); |
|
229 | - $table->addUpdatedWhere('dohtml', 1,'=0'); |
|
223 | + //inverting values no=1 <=> do=0 |
|
224 | + // have to store teporarly as value = 2 to |
|
225 | + // avoid putting everithing to same value |
|
226 | + // if you change 1 to 0, then 0 to one, |
|
227 | + // every value will be 1, follow me? |
|
228 | + $table->addUpdatedWhere('dohtml', 2,'=1'); |
|
229 | + $table->addUpdatedWhere('dohtml', 1,'=0'); |
|
230 | 230 | $table->addUpdatedWhere('dohtml', 0,'=2'); |
231 | 231 | |
232 | 232 | $table->addUpdatedWhere('dosmiley', 2,'=1'); |
@@ -254,22 +254,22 @@ discard block |
||
254 | 254 | * @return void |
255 | 255 | */ |
256 | 256 | function update_table($new_fields, $existing_fields, &$table) { |
257 | - foreach ($new_fields as $field => $fieldinfo) { |
|
258 | - $type = $fieldinfo["Type"]; |
|
259 | - if (!in_array($field, array_keys($existing_fields) ) ) { |
|
260 | - //Add field as it is missing |
|
261 | - $table->addNewField($field, $type); |
|
262 | - //$xoopsDB->query("ALTER TABLE ".$table." ADD ".$field." ".$type); |
|
263 | - //echo $field."(".$type.") <FONT COLOR='##22DD51'>Added</FONT><br />"; |
|
257 | + foreach ($new_fields as $field => $fieldinfo) { |
|
258 | + $type = $fieldinfo["Type"]; |
|
259 | + if (!in_array($field, array_keys($existing_fields) ) ) { |
|
260 | + //Add field as it is missing |
|
261 | + $table->addNewField($field, $type); |
|
262 | + //$xoopsDB->query("ALTER TABLE ".$table." ADD ".$field." ".$type); |
|
263 | + //echo $field."(".$type.") <FONT COLOR='##22DD51'>Added</FONT><br />"; |
|
264 | 264 | } |
265 | 265 | elseif ($existing_fields[$field] != $type) { |
266 | - $table->addAlteredField($field, $field." ".$type); |
|
267 | - // check $fields[$field]['type'] for things like "int(10) unsigned" |
|
268 | - //$xoopsDB->query("ALTER TABLE ".$table." CHANGE ".$field." ".$field." ".$type); |
|
269 | - //echo $field." <FONT COLOR='#FF6600'>Changed to</FONT> ".$type."<br />"; |
|
266 | + $table->addAlteredField($field, $field." ".$type); |
|
267 | + // check $fields[$field]['type'] for things like "int(10) unsigned" |
|
268 | + //$xoopsDB->query("ALTER TABLE ".$table." CHANGE ".$field." ".$field." ".$type); |
|
269 | + //echo $field." <FONT COLOR='#FF6600'>Changed to</FONT> ".$type."<br />"; |
|
270 | 270 | } |
271 | 271 | else { |
272 | - //echo $field." <FONT COLOR='#0033FF'>Uptodate</FONT><br />"; |
|
272 | + //echo $field." <FONT COLOR='#0033FF'>Uptodate</FONT><br />"; |
|
273 | 273 | } |
274 | 274 | } |
275 | 275 | } |
@@ -283,19 +283,19 @@ discard block |
||
283 | 283 | * @return array |
284 | 284 | */ |
285 | 285 | function get_table_info($table, $default_fields) { |
286 | - global $xoopsDB; |
|
286 | + global $xoopsDB; |
|
287 | 287 | $result = $xoopsDB->query("SHOW COLUMNS FROM ".$table); |
288 | 288 | while ($existing_field = $xoopsDB->fetchArray($result)) { |
289 | - $fields[$existing_field['Field']] = $existing_field['Type']; |
|
290 | - if ($existing_field['Null'] != "YES") { |
|
291 | - $fields[$existing_field['Field']] .= " NOT NULL"; |
|
292 | - } |
|
293 | - if ($existing_field['Extra']) { |
|
294 | - $fields[$existing_field['Field']] .= " ".$existing_field['Extra']; |
|
295 | - } |
|
296 | - if ($default_fields[$existing_field['Field']]['Default']) { |
|
297 | - $fields[$existing_field['Field']] .= " default '".$existing_field['Default']."'"; |
|
298 | - } |
|
289 | + $fields[$existing_field['Field']] = $existing_field['Type']; |
|
290 | + if ($existing_field['Null'] != "YES") { |
|
291 | + $fields[$existing_field['Field']] .= " NOT NULL"; |
|
292 | + } |
|
293 | + if ($existing_field['Extra']) { |
|
294 | + $fields[$existing_field['Field']] .= " ".$existing_field['Extra']; |
|
295 | + } |
|
296 | + if ($default_fields[$existing_field['Field']]['Default']) { |
|
297 | + $fields[$existing_field['Field']] .= " default '".$existing_field['Default']."'"; |
|
298 | + } |
|
299 | 299 | } |
300 | 300 | return $fields; |
301 | 301 | } |
@@ -310,59 +310,59 @@ discard block |
||
310 | 310 | * @return array |
311 | 311 | */ |
312 | 312 | function rename_fields(&$table, $renamed_fields, &$fields, $new_fields) { |
313 | - foreach (array_keys($fields) as $field) { |
|
314 | - if (in_array($field, array_keys($renamed_fields))) { |
|
315 | - $new_field_name = $renamed_fields[$field]; |
|
316 | - $new_field_type = $new_fields[$new_field_name]["Type"]; |
|
317 | - $table->addAltered($field, $new_field_name." ".$new_field_type); |
|
318 | - //$xoopsDB->query("ALTER TABLE ".$table." CHANGE ".$field." ".$new_field_name." ".$new_field_type); |
|
319 | - //echo $field." Renamed to ".$new_field_name."<br />"; |
|
320 | - $fields[$new_field_name] = $new_field_type; |
|
321 | - } |
|
313 | + foreach (array_keys($fields) as $field) { |
|
314 | + if (in_array($field, array_keys($renamed_fields))) { |
|
315 | + $new_field_name = $renamed_fields[$field]; |
|
316 | + $new_field_type = $new_fields[$new_field_name]["Type"]; |
|
317 | + $table->addAltered($field, $new_field_name." ".$new_field_type); |
|
318 | + //$xoopsDB->query("ALTER TABLE ".$table." CHANGE ".$field." ".$new_field_name." ".$new_field_type); |
|
319 | + //echo $field." Renamed to ".$new_field_name."<br />"; |
|
320 | + $fields[$new_field_name] = $new_field_type; |
|
321 | + } |
|
322 | 322 | } |
323 | 323 | //return $fields; |
324 | 324 | } |
325 | 325 | |
326 | 326 | $op = isset($_REQUEST['op']) ? intval($_REQUEST['op']) : 0; |
327 | 327 | switch ($op) { |
328 | - case 1: |
|
329 | - // Make sure that nohtml is properly changed to dohtml |
|
330 | - invert_nohtm_dohtml_values(); |
|
331 | - // Ensure that the proper tables are present |
|
332 | - update_tables_to_300(); |
|
333 | - // Import data from MyDownloads |
|
334 | - import_mydownloads_to_wfdownloads(); |
|
335 | - break; |
|
328 | + case 1: |
|
329 | + // Make sure that nohtml is properly changed to dohtml |
|
330 | + invert_nohtm_dohtml_values(); |
|
331 | + // Ensure that the proper tables are present |
|
332 | + update_tables_to_300(); |
|
333 | + // Import data from MyDownloads |
|
334 | + import_mydownloads_to_wfdownloads(); |
|
335 | + break; |
|
336 | 336 | |
337 | - case 2: |
|
338 | - // Update WF-Downloads |
|
339 | - $log = invert_nohtm_dohtml_values(); |
|
340 | - update_tables_to_300(); |
|
341 | - break; |
|
337 | + case 2: |
|
338 | + // Update WF-Downloads |
|
339 | + $log = invert_nohtm_dohtml_values(); |
|
340 | + update_tables_to_300(); |
|
341 | + break; |
|
342 | 342 | |
343 | - default: |
|
344 | - //ask what to do |
|
345 | - include XOOPS_ROOT_PATH."/class/xoopsformloader.php"; |
|
346 | - $form = new XoopsThemeForm('Upgrade WF-Downloads',"form", $_SERVER['REQUEST_URI']); |
|
343 | + default: |
|
344 | + //ask what to do |
|
345 | + include XOOPS_ROOT_PATH."/class/xoopsformloader.php"; |
|
346 | + $form = new XoopsThemeForm('Upgrade WF-Downloads',"form", $_SERVER['REQUEST_URI']); |
|
347 | 347 | |
348 | - //Is MyDownloads installed? |
|
349 | - $module_handler = xoops_gethandler('module'); |
|
350 | - $mydownloadsModule = $module_handler->getByDirname("mydownloads"); |
|
351 | - if (is_object($mydownloadsModule)) { |
|
352 | - $mydownloadsButton = new XoopsFormButton("Import data from MyDownloads", "myd_button", "Import", "submit"); |
|
353 | - $mydownloadsButton->setExtra("onclick='document.forms.form.op.value=\"1\"'"); |
|
354 | - $form->addElement($mydownloadsButton); |
|
355 | - } |
|
348 | + //Is MyDownloads installed? |
|
349 | + $module_handler = xoops_gethandler('module'); |
|
350 | + $mydownloadsModule = $module_handler->getByDirname("mydownloads"); |
|
351 | + if (is_object($mydownloadsModule)) { |
|
352 | + $mydownloadsButton = new XoopsFormButton("Import data from MyDownloads", "myd_button", "Import", "submit"); |
|
353 | + $mydownloadsButton->setExtra("onclick='document.forms.form.op.value=\"1\"'"); |
|
354 | + $form->addElement($mydownloadsButton); |
|
355 | + } |
|
356 | 356 | |
357 | - if (!wfdownloads_TableExists('wfdownloads_meta')) { |
|
358 | - $updateButton = new XoopsFormButton("Update WF-Downloads", "upd_button", "Update", "submit"); |
|
359 | - $updateButton->setExtra("onclick='document.forms.form.op.value=\"2\"'"); |
|
360 | - $form->addElement($updateButton); |
|
361 | - } |
|
357 | + if (!wfdownloads_TableExists('wfdownloads_meta')) { |
|
358 | + $updateButton = new XoopsFormButton("Update WF-Downloads", "upd_button", "Update", "submit"); |
|
359 | + $updateButton->setExtra("onclick='document.forms.form.op.value=\"2\"'"); |
|
360 | + $form->addElement($updateButton); |
|
361 | + } |
|
362 | 362 | |
363 | - $form->addElement(new XoopsFormHidden('op', 0)); |
|
364 | - $form->display(); |
|
365 | - break; |
|
363 | + $form->addElement(new XoopsFormHidden('op', 0)); |
|
364 | + $form->display(); |
|
365 | + break; |
|
366 | 366 | } |
367 | 367 | //wfdownloads_modFooter(); |
368 | 368 | //xoops_cp_footer(); |
@@ -70,21 +70,21 @@ discard block |
||
70 | 70 | $ratingid = isset($_GET['ratingid']) ? intval($_GET['ratingid']) : 0 ; |
71 | 71 | |
72 | 72 | smart_xoops_cp_header(); |
73 | - echo $indexAdmin->addNavigation('rating.php'); |
|
73 | + echo $indexAdmin->addNavigation('rating.php'); |
|
74 | 74 | |
75 | 75 | editclass(true, $ratingid); |
76 | 76 | break; |
77 | 77 | |
78 | 78 | case "addrating": |
79 | - include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartobjectcontroller.php"; |
|
80 | - $controller = new SmartObjectController($smartobject_rating_handler); |
|
79 | + include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartobjectcontroller.php"; |
|
80 | + $controller = new SmartObjectController($smartobject_rating_handler); |
|
81 | 81 | $controller->storeFromDefaultForm(_AM_SOBJECT_RATINGS_CREATED, _AM_SOBJECT_RATINGS_MODIFIED, SMARTOBJECT_URL . 'admin/rating.php'); |
82 | 82 | |
83 | 83 | break; |
84 | 84 | |
85 | 85 | case "del": |
86 | - include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartobjectcontroller.php"; |
|
87 | - $controller = new SmartObjectController($smartobject_rating_handler); |
|
86 | + include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartobjectcontroller.php"; |
|
87 | + $controller = new SmartObjectController($smartobject_rating_handler); |
|
88 | 88 | $controller->handleObjectDeletion(); |
89 | 89 | |
90 | 90 | break; |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | default: |
93 | 93 | |
94 | 94 | smart_xoops_cp_header(); |
95 | - echo $indexAdmin->addNavigation('rating.php'); |
|
95 | + echo $indexAdmin->addNavigation('rating.php'); |
|
96 | 96 | |
97 | 97 | //smart_adminMenu(4, _AM_SOBJECT_RATINGS); |
98 | 98 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | |
22 | 22 | if (!file_exists($fileinc = $pathLanguage . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/' . 'main.php')) { |
23 | - $fileinc = $pathLanguage . '/language/english/main.php'; |
|
23 | + $fileinc = $pathLanguage . '/language/english/main.php'; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | include_once $fileinc; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $i++; |
72 | 72 | $adminmenu[$i]['title'] = _MI_SOBJECT_CURRENCIES; |
73 | 73 | $adminmenu[$i]['link'] = "admin/currency.php"; |
74 | - $adminmenu[$i]["icon"] = $pathIcon32 . '/cash_stack.png'; |
|
74 | + $adminmenu[$i]["icon"] = $pathIcon32 . '/cash_stack.png'; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | switch ($op) { |
27 | 27 | |
28 | 28 | case "del": |
29 | - include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartobjectcontroller.php"; |
|
30 | - $controller = new SmartObjectController($smartobject_link_handler); |
|
29 | + include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartobjectcontroller.php"; |
|
30 | + $controller = new SmartObjectController($smartobject_link_handler); |
|
31 | 31 | $controller->handleObjectDeletion(_AM_SOBJECT_SENT_LINK_DELETE_CONFIRM); |
32 | 32 | |
33 | 33 | break; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | smart_xoops_cp_header(); |
70 | 70 | |
71 | - echo $indexAdmin->addNavigation('link.php'); |
|
71 | + echo $indexAdmin->addNavigation('link.php'); |
|
72 | 72 | |
73 | 73 | |
74 | 74 | //smart_adminMenu(1, _AM_SOBJECT_SENT_LINKS); |
@@ -41,7 +41,7 @@ |
||
41 | 41 | $pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin'); |
42 | 42 | |
43 | 43 | if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))){ |
44 | - include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'); |
|
45 | - }else{ |
|
46 | - redirect_header("../../../admin.php", 5, _AM_BIRTHDAY_MODULEADMIN_MISSING, false); |
|
47 | - } |
|
48 | 44 | \ No newline at end of file |
45 | + include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'); |
|
46 | + }else{ |
|
47 | + redirect_header("../../../admin.php", 5, _AM_BIRTHDAY_MODULEADMIN_MISSING, false); |
|
48 | + } |
|
49 | 49 | \ No newline at end of file |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $adsenseid = isset($_GET['adsenseid']) ? intval($_GET['adsenseid']) : 0 ; |
57 | 57 | |
58 | 58 | smart_xoops_cp_header(); |
59 | - echo $indexAdmin->addNavigation('adsense.php'); |
|
59 | + echo $indexAdmin->addNavigation('adsense.php'); |
|
60 | 60 | |
61 | 61 | editclass(true, $adsenseid); |
62 | 62 | break; |
@@ -66,28 +66,28 @@ discard block |
||
66 | 66 | $adsenseid = isset($_GET['adsenseid']) ? intval($_GET['adsenseid']) : 0 ; |
67 | 67 | |
68 | 68 | smart_xoops_cp_header(); |
69 | - echo $indexAdmin->addNavigation('adsense.php'); |
|
69 | + echo $indexAdmin->addNavigation('adsense.php'); |
|
70 | 70 | |
71 | 71 | editclass(true, $adsenseid, true); |
72 | 72 | break; |
73 | 73 | |
74 | 74 | case "addadsense": |
75 | - if(@include_once SMARTOBJECT_ROOT_PATH . "include/captcha/captcha.php") { |
|
76 | - $xoopsCaptcha = XoopsCaptcha::instance(); |
|
77 | - if(! $xoopsCaptcha->verify() ) { |
|
78 | - redirect_header('javascript:history.go(-1);', 3, $xoopsCaptcha->getMessage()); |
|
79 | - exit; |
|
80 | - } |
|
75 | + if(@include_once SMARTOBJECT_ROOT_PATH . "include/captcha/captcha.php") { |
|
76 | + $xoopsCaptcha = XoopsCaptcha::instance(); |
|
77 | + if(! $xoopsCaptcha->verify() ) { |
|
78 | + redirect_header('javascript:history.go(-1);', 3, $xoopsCaptcha->getMessage()); |
|
79 | + exit; |
|
80 | + } |
|
81 | 81 | } |
82 | - include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartobjectcontroller.php"; |
|
83 | - $controller = new SmartObjectController($smartobject_adsense_handler); |
|
82 | + include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartobjectcontroller.php"; |
|
83 | + $controller = new SmartObjectController($smartobject_adsense_handler); |
|
84 | 84 | $controller->storeFromDefaultForm(_AM_SOBJECT_ADSENSES_CREATED, _AM_SOBJECT_ADSENSES_MODIFIED); |
85 | 85 | break; |
86 | 86 | |
87 | 87 | case "del": |
88 | 88 | |
89 | - include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartobjectcontroller.php"; |
|
90 | - $controller = new SmartObjectController($smartobject_adsense_handler); |
|
89 | + include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartobjectcontroller.php"; |
|
90 | + $controller = new SmartObjectController($smartobject_adsense_handler); |
|
91 | 91 | $controller->handleObjectDeletion(); |
92 | 92 | |
93 | 93 | break; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | default: |
96 | 96 | |
97 | 97 | smart_xoops_cp_header(); |
98 | - echo $indexAdmin->addNavigation('adsense.php'); |
|
98 | + echo $indexAdmin->addNavigation('adsense.php'); |
|
99 | 99 | |
100 | 100 | //smart_adminMenu(3, _AM_SOBJECT_ADSENSES); |
101 | 101 |
@@ -85,15 +85,15 @@ |
||
85 | 85 | break; |
86 | 86 | |
87 | 87 | case "addcurrency": |
88 | - include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartobjectcontroller.php"; |
|
89 | - $controller = new SmartObjectController($smartobject_currency_handler); |
|
88 | + include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartobjectcontroller.php"; |
|
89 | + $controller = new SmartObjectController($smartobject_currency_handler); |
|
90 | 90 | $controller->storeFromDefaultForm(_AM_SOBJECT_CURRENCIES_CREATED, _AM_SOBJECT_CURRENCIES_MODIFIED, SMARTOBJECT_URL . 'admin/currency.php'); |
91 | 91 | |
92 | 92 | break; |
93 | 93 | |
94 | 94 | case "del": |
95 | - include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartobjectcontroller.php"; |
|
96 | - $controller = new SmartObjectController($smartobject_currency_handler); |
|
95 | + include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartobjectcontroller.php"; |
|
96 | + $controller = new SmartObjectController($smartobject_currency_handler); |
|
97 | 97 | $controller->handleObjectDeletion(); |
98 | 98 | |
99 | 99 | break; |
@@ -9,45 +9,45 @@ discard block |
||
9 | 9 | |
10 | 10 | function edittag($tagid = 0, $language=false, $fct=false) |
11 | 11 | { |
12 | - global $smartobject_tag_handler; |
|
13 | - |
|
14 | - $tagObj = $smartobject_tag_handler->get($tagid); |
|
15 | - |
|
16 | - if ($tagObj->isNew()){ |
|
17 | - $breadcrumb = _AM_SOBJECT_TAGS . " > " . _AM_SOBJECT_TAG_CREATE; |
|
18 | - $title = _AM_SOBJECT_TAG_CREATE; |
|
19 | - $info = _AM_SOBJECT_TAG_CREATE_INFO; |
|
20 | - $collaps_name = 'tagcreate'; |
|
21 | - $form_name = _AM_SOBJECT_TAG_CREATE; |
|
22 | - $submit_button_caption = null; |
|
23 | - //$tagObj->stripMultilanguageFields(); |
|
24 | - } else { |
|
25 | - if ($language) { |
|
26 | - $breadcrumb = _AM_SOBJECT_TAGS . " > " . _AM_SOBJECT_TAG_EDITING_LANGUAGE; |
|
27 | - $title = _AM_SOBJECT_TAG_EDIT_LANGUAGE; |
|
28 | - $info = _AM_SOBJECT_TAG_EDIT_LANGUAGE_INFO; |
|
29 | - $collaps_name = 'tageditlanguage'; |
|
30 | - $form_name = _AM_SOBJECT_TAG_EDIT_LANGUAGE; |
|
31 | - $submit_button_caption = null; |
|
32 | - $tagObj->makeNonMLFieldReadOnly(); |
|
33 | - } else { |
|
34 | - $breadcrumb = _AM_SOBJECT_TAGS . " > " . _AM_SOBJECT_EDITING; |
|
35 | - $title = _AM_SOBJECT_TAG_EDIT; |
|
36 | - $info = _AM_SOBJECT_TAG_EDIT_INFO; |
|
37 | - $collaps_name = 'tagedit'; |
|
38 | - $form_name = _AM_SOBJECT_TAG_EDIT; |
|
39 | - $submit_button_caption = null; |
|
40 | - $tagObj->stripMultilanguageFields(); |
|
41 | - } |
|
42 | - } |
|
43 | - |
|
44 | - //smart_adminMenu(2, $breadcrumb); |
|
45 | - |
|
46 | - smart_collapsableBar($collaps_name, $title, $info); |
|
47 | - |
|
48 | - $sform = $tagObj->getForm($form_name, 'addtag', false, $submit_button_caption); |
|
49 | - $sform->display(); |
|
50 | - smart_close_collapsable($collaps_name); |
|
12 | + global $smartobject_tag_handler; |
|
13 | + |
|
14 | + $tagObj = $smartobject_tag_handler->get($tagid); |
|
15 | + |
|
16 | + if ($tagObj->isNew()){ |
|
17 | + $breadcrumb = _AM_SOBJECT_TAGS . " > " . _AM_SOBJECT_TAG_CREATE; |
|
18 | + $title = _AM_SOBJECT_TAG_CREATE; |
|
19 | + $info = _AM_SOBJECT_TAG_CREATE_INFO; |
|
20 | + $collaps_name = 'tagcreate'; |
|
21 | + $form_name = _AM_SOBJECT_TAG_CREATE; |
|
22 | + $submit_button_caption = null; |
|
23 | + //$tagObj->stripMultilanguageFields(); |
|
24 | + } else { |
|
25 | + if ($language) { |
|
26 | + $breadcrumb = _AM_SOBJECT_TAGS . " > " . _AM_SOBJECT_TAG_EDITING_LANGUAGE; |
|
27 | + $title = _AM_SOBJECT_TAG_EDIT_LANGUAGE; |
|
28 | + $info = _AM_SOBJECT_TAG_EDIT_LANGUAGE_INFO; |
|
29 | + $collaps_name = 'tageditlanguage'; |
|
30 | + $form_name = _AM_SOBJECT_TAG_EDIT_LANGUAGE; |
|
31 | + $submit_button_caption = null; |
|
32 | + $tagObj->makeNonMLFieldReadOnly(); |
|
33 | + } else { |
|
34 | + $breadcrumb = _AM_SOBJECT_TAGS . " > " . _AM_SOBJECT_EDITING; |
|
35 | + $title = _AM_SOBJECT_TAG_EDIT; |
|
36 | + $info = _AM_SOBJECT_TAG_EDIT_INFO; |
|
37 | + $collaps_name = 'tagedit'; |
|
38 | + $form_name = _AM_SOBJECT_TAG_EDIT; |
|
39 | + $submit_button_caption = null; |
|
40 | + $tagObj->stripMultilanguageFields(); |
|
41 | + } |
|
42 | + } |
|
43 | + |
|
44 | + //smart_adminMenu(2, $breadcrumb); |
|
45 | + |
|
46 | + smart_collapsableBar($collaps_name, $title, $info); |
|
47 | + |
|
48 | + $sform = $tagObj->getForm($form_name, 'addtag', false, $submit_button_caption); |
|
49 | + $sform->display(); |
|
50 | + smart_close_collapsable($collaps_name); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | include_once("admin_header.php"); |
@@ -68,33 +68,33 @@ discard block |
||
68 | 68 | switch ($op) { |
69 | 69 | |
70 | 70 | case "del": |
71 | - include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartobjectcontroller.php"; |
|
72 | - $controller = new SmartObjectController($smartobject_tag_handler); |
|
71 | + include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartobjectcontroller.php"; |
|
72 | + $controller = new SmartObjectController($smartobject_tag_handler); |
|
73 | 73 | $controller->handleObjectDeletion(_AM_SOBJECT_TAG_DELETE_CONFIRM); |
74 | 74 | |
75 | 75 | break; |
76 | 76 | |
77 | - case "addtag": |
|
78 | - include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartobjectcontroller.php"; |
|
79 | - $controller = new SmartObjectController($smartobject_tag_handler); |
|
80 | - $tagObj = $controller->storeSmartObject(); |
|
81 | - if ($tagObj->hasError()) { |
|
82 | - redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $tagObj->getHtmlErrors()); |
|
83 | - exit; |
|
84 | - } |
|
85 | - |
|
86 | - if ($tagObj->hasError()) { |
|
87 | - redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $tagObj->getHtmlErrors()); |
|
88 | - } else { |
|
89 | - redirect_header(smart_get_page_before_form(), 3, _CO_SOBJECT_SAVE_SUCCESS); |
|
90 | - } |
|
77 | + case "addtag": |
|
78 | + include_once XOOPS_ROOT_PATH."/modules/smartobject/class/smartobjectcontroller.php"; |
|
79 | + $controller = new SmartObjectController($smartobject_tag_handler); |
|
80 | + $tagObj = $controller->storeSmartObject(); |
|
81 | + if ($tagObj->hasError()) { |
|
82 | + redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $tagObj->getHtmlErrors()); |
|
83 | + exit; |
|
84 | + } |
|
85 | + |
|
86 | + if ($tagObj->hasError()) { |
|
87 | + redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $tagObj->getHtmlErrors()); |
|
88 | + } else { |
|
89 | + redirect_header(smart_get_page_before_form(), 3, _CO_SOBJECT_SAVE_SUCCESS); |
|
90 | + } |
|
91 | 91 | exit; |
92 | - break; |
|
92 | + break; |
|
93 | 93 | |
94 | - case "mod": |
|
95 | - smart_xoops_cp_header(); |
|
96 | - edittag($tagid, $language, $fct); |
|
97 | - break; |
|
94 | + case "mod": |
|
95 | + smart_xoops_cp_header(); |
|
96 | + edittag($tagid, $language, $fct); |
|
97 | + break; |
|
98 | 98 | |
99 | 99 | default: |
100 | 100 |
@@ -26,7 +26,7 @@ |
||
26 | 26 | |
27 | 27 | $indexAdmin = new ModuleAdmin(); |
28 | 28 | |
29 | - echo $indexAdmin->addNavigation('index.php'); |
|
30 | - echo $indexAdmin->renderIndex(); |
|
29 | + echo $indexAdmin->addNavigation('index.php'); |
|
30 | + echo $indexAdmin->renderIndex(); |
|
31 | 31 | |
32 | 32 | include "admin_footer.php"; |
33 | 33 | \ No newline at end of file |