@@ -12,32 +12,32 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | function editcustomtag($showmenu = false, $customtagid = 0, $clone = false) |
| 14 | 14 | { |
| 15 | - global $smartobjectCustomtagHandler; |
|
| 16 | - |
|
| 17 | - $customtagObj = $smartobjectCustomtagHandler->get($customtagid); |
|
| 18 | - |
|
| 19 | - if (!$clone && !$customtagObj->isNew()) { |
|
| 20 | - if ($showmenu) { |
|
| 21 | - //smart_adminMenu(2, _AM_SOBJECT_CUSTOMTAGS . " > " . _AM_SOBJECT_EDITING); |
|
| 22 | - } |
|
| 23 | - smart_collapsableBar('customtagedit', _AM_SOBJECT_CUSTOMTAGS_EDIT, _AM_SOBJECT_CUSTOMTAGS_EDIT_INFO); |
|
| 24 | - |
|
| 25 | - $sform = $customtagObj->getForm(_AM_SOBJECT_CUSTOMTAGS_EDIT, 'addcustomtag'); |
|
| 26 | - $sform->display(); |
|
| 27 | - smart_close_collapsable('customtagedit'); |
|
| 28 | - } else { |
|
| 29 | - $customtagObj->setVar('customtagid', 0); |
|
| 30 | - $customtagObj->setVar('tag', ''); |
|
| 31 | - |
|
| 32 | - if ($showmenu) { |
|
| 33 | - //smart_adminMenu(2, _AM_SOBJECT_CUSTOMTAGS . " > " . _CO_SOBJECT_CREATINGNEW); |
|
| 34 | - } |
|
| 35 | - |
|
| 36 | - smart_collapsableBar('customtagcreate', _AM_SOBJECT_CUSTOMTAGS_CREATE, _AM_SOBJECT_CUSTOMTAGS_CREATE_INFO); |
|
| 37 | - $sform = $customtagObj->getForm(_AM_SOBJECT_CUSTOMTAGS_CREATE, 'addcustomtag'); |
|
| 38 | - $sform->display(); |
|
| 39 | - smart_close_collapsable('customtagcreate'); |
|
| 40 | - } |
|
| 15 | + global $smartobjectCustomtagHandler; |
|
| 16 | + |
|
| 17 | + $customtagObj = $smartobjectCustomtagHandler->get($customtagid); |
|
| 18 | + |
|
| 19 | + if (!$clone && !$customtagObj->isNew()) { |
|
| 20 | + if ($showmenu) { |
|
| 21 | + //smart_adminMenu(2, _AM_SOBJECT_CUSTOMTAGS . " > " . _AM_SOBJECT_EDITING); |
|
| 22 | + } |
|
| 23 | + smart_collapsableBar('customtagedit', _AM_SOBJECT_CUSTOMTAGS_EDIT, _AM_SOBJECT_CUSTOMTAGS_EDIT_INFO); |
|
| 24 | + |
|
| 25 | + $sform = $customtagObj->getForm(_AM_SOBJECT_CUSTOMTAGS_EDIT, 'addcustomtag'); |
|
| 26 | + $sform->display(); |
|
| 27 | + smart_close_collapsable('customtagedit'); |
|
| 28 | + } else { |
|
| 29 | + $customtagObj->setVar('customtagid', 0); |
|
| 30 | + $customtagObj->setVar('tag', ''); |
|
| 31 | + |
|
| 32 | + if ($showmenu) { |
|
| 33 | + //smart_adminMenu(2, _AM_SOBJECT_CUSTOMTAGS . " > " . _CO_SOBJECT_CREATINGNEW); |
|
| 34 | + } |
|
| 35 | + |
|
| 36 | + smart_collapsableBar('customtagcreate', _AM_SOBJECT_CUSTOMTAGS_CREATE, _AM_SOBJECT_CUSTOMTAGS_CREATE_INFO); |
|
| 37 | + $sform = $customtagObj->getForm(_AM_SOBJECT_CUSTOMTAGS_CREATE, 'addcustomtag'); |
|
| 38 | + $sform->display(); |
|
| 39 | + smart_close_collapsable('customtagcreate'); |
|
| 40 | + } |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | include_once __DIR__ . '/admin_header.php'; |
@@ -52,70 +52,70 @@ discard block |
||
| 52 | 52 | $op = ''; |
| 53 | 53 | |
| 54 | 54 | if (isset($_GET['op'])) { |
| 55 | - $op = $_GET['op']; |
|
| 55 | + $op = $_GET['op']; |
|
| 56 | 56 | } |
| 57 | 57 | if (isset($_POST['op'])) { |
| 58 | - $op = $_POST['op']; |
|
| 58 | + $op = $_POST['op']; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | switch ($op) { |
| 62 | - case 'mod': |
|
| 62 | + case 'mod': |
|
| 63 | 63 | |
| 64 | - $customtagid = isset($_GET['customtagid']) ? (int)$_GET['customtagid'] : 0; |
|
| 64 | + $customtagid = isset($_GET['customtagid']) ? (int)$_GET['customtagid'] : 0; |
|
| 65 | 65 | |
| 66 | - smart_xoops_cp_header(); |
|
| 67 | - echo $indexAdmin->addNavigation(basename(__FILE__)); |
|
| 66 | + smart_xoops_cp_header(); |
|
| 67 | + echo $indexAdmin->addNavigation(basename(__FILE__)); |
|
| 68 | 68 | |
| 69 | - editcustomtag(true, $customtagid); |
|
| 70 | - break; |
|
| 69 | + editcustomtag(true, $customtagid); |
|
| 70 | + break; |
|
| 71 | 71 | |
| 72 | - case 'clone': |
|
| 72 | + case 'clone': |
|
| 73 | 73 | |
| 74 | - $customtagid = isset($_GET['customtagid']) ? (int)$_GET['customtagid'] : 0; |
|
| 74 | + $customtagid = isset($_GET['customtagid']) ? (int)$_GET['customtagid'] : 0; |
|
| 75 | 75 | |
| 76 | - smart_xoops_cp_header(); |
|
| 77 | - echo $indexAdmin->addNavigation(basename(__FILE__)); |
|
| 76 | + smart_xoops_cp_header(); |
|
| 77 | + echo $indexAdmin->addNavigation(basename(__FILE__)); |
|
| 78 | 78 | |
| 79 | - editcustomtag(true, $customtagid, true); |
|
| 80 | - break; |
|
| 79 | + editcustomtag(true, $customtagid, true); |
|
| 80 | + break; |
|
| 81 | 81 | |
| 82 | - case 'addcustomtag': |
|
| 83 | - include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 84 | - $controller = new SmartObjectController($smartobjectCustomtagHandler); |
|
| 85 | - $controller->storeFromDefaultForm(_AM_SOBJECT_CUSTOMTAGS_CREATED, _AM_SOBJECT_CUSTOMTAGS_MODIFIED); |
|
| 86 | - break; |
|
| 82 | + case 'addcustomtag': |
|
| 83 | + include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 84 | + $controller = new SmartObjectController($smartobjectCustomtagHandler); |
|
| 85 | + $controller->storeFromDefaultForm(_AM_SOBJECT_CUSTOMTAGS_CREATED, _AM_SOBJECT_CUSTOMTAGS_MODIFIED); |
|
| 86 | + break; |
|
| 87 | 87 | |
| 88 | - case 'del': |
|
| 88 | + case 'del': |
|
| 89 | 89 | |
| 90 | - include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 91 | - $controller = new SmartObjectController($smartobjectCustomtagHandler); |
|
| 92 | - $controller->handleObjectDeletion(); |
|
| 90 | + include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 91 | + $controller = new SmartObjectController($smartobjectCustomtagHandler); |
|
| 92 | + $controller->handleObjectDeletion(); |
|
| 93 | 93 | |
| 94 | - break; |
|
| 94 | + break; |
|
| 95 | 95 | |
| 96 | - default: |
|
| 96 | + default: |
|
| 97 | 97 | |
| 98 | - smart_xoops_cp_header(); |
|
| 99 | - echo $indexAdmin->addNavigation(basename(__FILE__)); |
|
| 100 | - $indexAdmin->addItemButton(_AM_SOBJECT_CUSTOMTAGS_CREATE, 'customtag.php?op=mod', 'add', ''); |
|
| 101 | - echo $indexAdmin->renderButton('left', ''); |
|
| 98 | + smart_xoops_cp_header(); |
|
| 99 | + echo $indexAdmin->addNavigation(basename(__FILE__)); |
|
| 100 | + $indexAdmin->addItemButton(_AM_SOBJECT_CUSTOMTAGS_CREATE, 'customtag.php?op=mod', 'add', ''); |
|
| 101 | + echo $indexAdmin->renderButton('left', ''); |
|
| 102 | 102 | |
| 103 | - //smart_adminMenu(2, _AM_SOBJECT_CUSTOMTAGS); |
|
| 103 | + //smart_adminMenu(2, _AM_SOBJECT_CUSTOMTAGS); |
|
| 104 | 104 | |
| 105 | - smart_collapsableBar('createdcustomtags', _AM_SOBJECT_CUSTOMTAGS, _AM_SOBJECT_CUSTOMTAGS_DSC); |
|
| 105 | + smart_collapsableBar('createdcustomtags', _AM_SOBJECT_CUSTOMTAGS, _AM_SOBJECT_CUSTOMTAGS_DSC); |
|
| 106 | 106 | |
| 107 | - include_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 108 | - $objectTable = new SmartObjectTable($smartobjectCustomtagHandler); |
|
| 109 | - $objectTable->addColumn(new SmartObjectColumn('name', 'left', 150, 'getCustomtagName')); |
|
| 110 | - $objectTable->addColumn(new SmartObjectColumn('description', 'left')); |
|
| 111 | - $objectTable->addColumn(new SmartObjectColumn('language', 'center', 150)); |
|
| 107 | + include_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 108 | + $objectTable = new SmartObjectTable($smartobjectCustomtagHandler); |
|
| 109 | + $objectTable->addColumn(new SmartObjectColumn('name', 'left', 150, 'getCustomtagName')); |
|
| 110 | + $objectTable->addColumn(new SmartObjectColumn('description', 'left')); |
|
| 111 | + $objectTable->addColumn(new SmartObjectColumn('language', 'center', 150)); |
|
| 112 | 112 | |
| 113 | - // $objectTable->addCustomAction('getCreateItemLink'); |
|
| 114 | - // $objectTable->addCustomAction('getCreateAttributLink'); |
|
| 113 | + // $objectTable->addCustomAction('getCreateItemLink'); |
|
| 114 | + // $objectTable->addCustomAction('getCreateAttributLink'); |
|
| 115 | 115 | |
| 116 | - // $objectTable->addIntroButton('addcustomtag', 'customtag.php?op=mod', _AM_SOBJECT_CUSTOMTAGS_CREATE); //mb button |
|
| 116 | + // $objectTable->addIntroButton('addcustomtag', 'customtag.php?op=mod', _AM_SOBJECT_CUSTOMTAGS_CREATE); //mb button |
|
| 117 | 117 | |
| 118 | - /* |
|
| 118 | + /* |
|
| 119 | 119 | $criteria_upcoming = new CriteriaCompo(); |
| 120 | 120 | $criteria_upcoming->add(new Criteria('start_date', time(), '>')); |
| 121 | 121 | $objectTable->addFilter(_AM_SOBJECT_FILTER_UPCOMING, array( |
@@ -139,16 +139,16 @@ discard block |
||
| 139 | 139 | 'criteria' => $criteria_last30days |
| 140 | 140 | )); |
| 141 | 141 | */ |
| 142 | - $objectTable->addQuickSearch(array('title', 'summary', 'description')); |
|
| 143 | - $objectTable->addCustomAction('getCloneLink'); |
|
| 142 | + $objectTable->addQuickSearch(array('title', 'summary', 'description')); |
|
| 143 | + $objectTable->addCustomAction('getCloneLink'); |
|
| 144 | 144 | |
| 145 | - $objectTable->render(); |
|
| 145 | + $objectTable->render(); |
|
| 146 | 146 | |
| 147 | - echo '<br>'; |
|
| 148 | - smart_close_collapsable('createdcustomtags'); |
|
| 149 | - echo '<br>'; |
|
| 147 | + echo '<br>'; |
|
| 148 | + smart_close_collapsable('createdcustomtags'); |
|
| 149 | + echo '<br>'; |
|
| 150 | 150 | |
| 151 | - break; |
|
| 151 | + break; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | //smart_modFooter(); |
@@ -18,180 +18,180 @@ discard block |
||
| 18 | 18 | // ========================================================================================= |
| 19 | 19 | function update_tables_to_300() |
| 20 | 20 | { |
| 21 | - $dbupdater = new WfdownloadsDbupdater(); |
|
| 21 | + $dbupdater = new WfdownloadsDbupdater(); |
|
| 22 | 22 | |
| 23 | - if (!wfdownloads_TableExists('wfdownloads_meta')) { |
|
| 24 | - // Create table wfdownloads_meta |
|
| 25 | - $table = new WfdownloadsTable('wfdownloads_meta'); |
|
| 26 | - $table->setStructure("CREATE TABLE %s ( |
|
| 23 | + if (!wfdownloads_TableExists('wfdownloads_meta')) { |
|
| 24 | + // Create table wfdownloads_meta |
|
| 25 | + $table = new WfdownloadsTable('wfdownloads_meta'); |
|
| 26 | + $table->setStructure("CREATE TABLE %s ( |
|
| 27 | 27 | metakey varchar(50) NOT NULL default '', |
| 28 | 28 | metavalue varchar(255) NOT NULL default '', |
| 29 | 29 | PRIMARY KEY (metakey)) |
| 30 | 30 | ENGINE=MyISAM;"); |
| 31 | 31 | |
| 32 | - $table->setData(sprintf("'version', %s", round($GLOBALS['xoopsModule']->getVar('version') / 100, 2))); |
|
| 33 | - if ($dbupdater->updateTable($table)) { |
|
| 34 | - echo 'wfdownloads_meta table created<br>'; |
|
| 35 | - } |
|
| 36 | - } |
|
| 32 | + $table->setData(sprintf("'version', %s", round($GLOBALS['xoopsModule']->getVar('version') / 100, 2))); |
|
| 33 | + if ($dbupdater->updateTable($table)) { |
|
| 34 | + echo 'wfdownloads_meta table created<br>'; |
|
| 35 | + } |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | - $download_fields = array( |
|
| 39 | - 'lid' => array('Type' => 'int(11) unsigned NOT NULL auto_increment', 'Default' => false), |
|
| 40 | - 'cid' => array('Type' => "int(5) unsigned NOT NULL default '0'", 'Default' => true), |
|
| 41 | - 'title' => array('Type' => "varchar(100) NOT NULL default ''", 'Default' => true), |
|
| 42 | - 'url' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 43 | - 'filename' => array('Type' => "varchar(150) NOT NULL default ''", 'Default' => true), |
|
| 44 | - 'filetype' => array('Type' => "varchar(100) NOT NULL default ''", 'Default' => true), |
|
| 45 | - 'homepage' => array('Type' => "varchar(100) NOT NULL default ''", 'Default' => true), |
|
| 46 | - 'version' => array('Type' => "varchar(20) NOT NULL default ''", 'Default' => true), |
|
| 47 | - 'size' => array('Type' => "int(8) NOT NULL default '0'", 'Default' => true), |
|
| 48 | - 'platform' => array('Type' => "varchar(50) NOT NULL default ''", 'Default' => true), |
|
| 49 | - 'screenshot' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 50 | - 'submitter' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 51 | - 'publisher' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 52 | - 'status' => array('Type' => "tinyint(2) NOT NULL default '0'", 'Default' => true), |
|
| 53 | - 'date' => array('Type' => "int(10) NOT NULL default '0'", 'Default' => true), |
|
| 54 | - 'hits' => array('Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true), |
|
| 55 | - 'rating' => array('Type' => "double(6,4) NOT NULL default '0.0000'", 'Default' => true), |
|
| 56 | - 'votes' => array('Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true), |
|
| 57 | - 'comments' => array('Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true), |
|
| 58 | - 'license' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 59 | - 'mirror' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 60 | - 'price' => array('Type' => "varchar(10) NOT NULL default 'Free'", 'Default' => true), |
|
| 61 | - 'paypalemail' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 62 | - 'features' => array('Type' => 'text NOT NULL', 'Default' => false), |
|
| 63 | - 'requirements' => array('Type' => 'text NOT NULL', 'Default' => false), |
|
| 64 | - 'homepagetitle' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 65 | - 'forumid' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 66 | - 'limitations' => array('Type' => "varchar(255) NOT NULL default '30 day trial'", 'Default' => true), |
|
| 67 | - 'dhistory' => array('Type' => 'text NOT NULL', 'Default' => false), |
|
| 68 | - 'published' => array('Type' => "int(11) NOT NULL default '1089662528'", 'Default' => true), |
|
| 69 | - 'expired' => array('Type' => "int(10) NOT NULL default '0'", 'Default' => true), |
|
| 70 | - 'updated' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 71 | - 'offline' => array('Type' => "tinyint(1) NOT NULL default '0'", 'Default' => true), |
|
| 72 | - 'description' => array('Type' => 'text NOT NULL', 'Default' => false), |
|
| 73 | - 'ipaddress' => array('Type' => "varchar(120) NOT NULL default '0'", 'Default' => true), |
|
| 74 | - 'notifypub' => array('Type' => "int(1) NOT NULL default '0'", 'Default' => true), |
|
| 75 | - 'summary' => array('Type' => 'text NOT NULL', 'Default' => false) |
|
| 76 | - ); |
|
| 38 | + $download_fields = array( |
|
| 39 | + 'lid' => array('Type' => 'int(11) unsigned NOT NULL auto_increment', 'Default' => false), |
|
| 40 | + 'cid' => array('Type' => "int(5) unsigned NOT NULL default '0'", 'Default' => true), |
|
| 41 | + 'title' => array('Type' => "varchar(100) NOT NULL default ''", 'Default' => true), |
|
| 42 | + 'url' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 43 | + 'filename' => array('Type' => "varchar(150) NOT NULL default ''", 'Default' => true), |
|
| 44 | + 'filetype' => array('Type' => "varchar(100) NOT NULL default ''", 'Default' => true), |
|
| 45 | + 'homepage' => array('Type' => "varchar(100) NOT NULL default ''", 'Default' => true), |
|
| 46 | + 'version' => array('Type' => "varchar(20) NOT NULL default ''", 'Default' => true), |
|
| 47 | + 'size' => array('Type' => "int(8) NOT NULL default '0'", 'Default' => true), |
|
| 48 | + 'platform' => array('Type' => "varchar(50) NOT NULL default ''", 'Default' => true), |
|
| 49 | + 'screenshot' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 50 | + 'submitter' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 51 | + 'publisher' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 52 | + 'status' => array('Type' => "tinyint(2) NOT NULL default '0'", 'Default' => true), |
|
| 53 | + 'date' => array('Type' => "int(10) NOT NULL default '0'", 'Default' => true), |
|
| 54 | + 'hits' => array('Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true), |
|
| 55 | + 'rating' => array('Type' => "double(6,4) NOT NULL default '0.0000'", 'Default' => true), |
|
| 56 | + 'votes' => array('Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true), |
|
| 57 | + 'comments' => array('Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true), |
|
| 58 | + 'license' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 59 | + 'mirror' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 60 | + 'price' => array('Type' => "varchar(10) NOT NULL default 'Free'", 'Default' => true), |
|
| 61 | + 'paypalemail' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 62 | + 'features' => array('Type' => 'text NOT NULL', 'Default' => false), |
|
| 63 | + 'requirements' => array('Type' => 'text NOT NULL', 'Default' => false), |
|
| 64 | + 'homepagetitle' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 65 | + 'forumid' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 66 | + 'limitations' => array('Type' => "varchar(255) NOT NULL default '30 day trial'", 'Default' => true), |
|
| 67 | + 'dhistory' => array('Type' => 'text NOT NULL', 'Default' => false), |
|
| 68 | + 'published' => array('Type' => "int(11) NOT NULL default '1089662528'", 'Default' => true), |
|
| 69 | + 'expired' => array('Type' => "int(10) NOT NULL default '0'", 'Default' => true), |
|
| 70 | + 'updated' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 71 | + 'offline' => array('Type' => "tinyint(1) NOT NULL default '0'", 'Default' => true), |
|
| 72 | + 'description' => array('Type' => 'text NOT NULL', 'Default' => false), |
|
| 73 | + 'ipaddress' => array('Type' => "varchar(120) NOT NULL default '0'", 'Default' => true), |
|
| 74 | + 'notifypub' => array('Type' => "int(1) NOT NULL default '0'", 'Default' => true), |
|
| 75 | + 'summary' => array('Type' => 'text NOT NULL', 'Default' => false) |
|
| 76 | + ); |
|
| 77 | 77 | |
| 78 | - $renamed_fields = array( |
|
| 79 | - 'logourl' => 'screenshot' |
|
| 80 | - ); |
|
| 78 | + $renamed_fields = array( |
|
| 79 | + 'logourl' => 'screenshot' |
|
| 80 | + ); |
|
| 81 | 81 | |
| 82 | - echo '<br><b>Checking Download table</b><br>'; |
|
| 83 | - $downloadHandler = xoops_getModuleHandler('download', 'wfdownloads'); |
|
| 84 | - $download_table = new WfdownloadsTable('wfdownloads_downloads'); |
|
| 85 | - $fields = get_table_info($downloadHandler->table, $download_fields); |
|
| 86 | - // Check for renamed fields |
|
| 87 | - rename_fields($download_table, $renamed_fields, $fields, $download_fields); |
|
| 88 | - update_table($download_fields, $fields, $download_table); |
|
| 89 | - if ($dbupdater->updateTable($download_table)) { |
|
| 90 | - echo 'Downloads table updated<br>'; |
|
| 91 | - } |
|
| 92 | - unset($fields); |
|
| 82 | + echo '<br><b>Checking Download table</b><br>'; |
|
| 83 | + $downloadHandler = xoops_getModuleHandler('download', 'wfdownloads'); |
|
| 84 | + $download_table = new WfdownloadsTable('wfdownloads_downloads'); |
|
| 85 | + $fields = get_table_info($downloadHandler->table, $download_fields); |
|
| 86 | + // Check for renamed fields |
|
| 87 | + rename_fields($download_table, $renamed_fields, $fields, $download_fields); |
|
| 88 | + update_table($download_fields, $fields, $download_table); |
|
| 89 | + if ($dbupdater->updateTable($download_table)) { |
|
| 90 | + echo 'Downloads table updated<br>'; |
|
| 91 | + } |
|
| 92 | + unset($fields); |
|
| 93 | 93 | |
| 94 | - $mod_fields = array( |
|
| 95 | - 'requestid' => array('Type' => 'int(11) NOT NULL auto_increment', 'Default' => false), |
|
| 96 | - 'lid' => array('Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true), |
|
| 97 | - 'cid' => array('Type' => "int(5) unsigned NOT NULL default '0'", 'Default' => true), |
|
| 98 | - 'title' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 99 | - 'url' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 100 | - 'filename' => array('Type' => "varchar(150) NOT NULL default ''", 'Default' => true), |
|
| 101 | - 'filetype' => array('Type' => "varchar(100) NOT NULL default ''", 'Default' => true), |
|
| 102 | - 'homepage' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 103 | - 'version' => array('Type' => "varchar(20) NOT NULL default ''", 'Default' => true), |
|
| 104 | - 'size' => array('Type' => "int(8) NOT NULL default '0'", 'Default' => true), |
|
| 105 | - 'platform' => array('Type' => "varchar(50) NOT NULL default ''", 'Default' => true), |
|
| 106 | - 'screenshot' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 107 | - 'submitter' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 108 | - 'publisher' => array('Type' => 'text NOT NULL', 'Default' => false), |
|
| 109 | - 'status' => array('Type' => "tinyint(2) NOT NULL default '0'", 'Default' => true), |
|
| 110 | - 'date' => array('Type' => "int(10) NOT NULL default '0'", 'Default' => true), |
|
| 111 | - 'hits' => array('Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true), |
|
| 112 | - 'rating' => array('Type' => "double(6,4) NOT NULL default '0.0000'", 'Default' => true), |
|
| 113 | - 'votes' => array('Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true), |
|
| 114 | - 'comments' => array('Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true), |
|
| 115 | - 'license' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 116 | - 'mirror' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 117 | - 'price' => array('Type' => "varchar(10) NOT NULL default 'Free'", 'Default' => true), |
|
| 118 | - 'paypalemail' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 119 | - 'features' => array('Type' => 'text NOT NULL', 'Default' => false), |
|
| 120 | - 'requirements' => array('Type' => 'text NOT NULL', 'Default' => false), |
|
| 121 | - 'homepagetitle' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 122 | - 'forumid' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 123 | - 'limitations' => array('Type' => "varchar(255) NOT NULL default '30 day trial'", 'Default' => true), |
|
| 124 | - 'dhistory' => array('Type' => 'text NOT NULL', 'Default' => false), |
|
| 125 | - 'published' => array('Type' => "int(10) NOT NULL default '0'", 'Default' => true), |
|
| 126 | - 'expired' => array('Type' => "int(10) NOT NULL default '0'", 'Default' => true), |
|
| 127 | - 'updated' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 128 | - 'offline' => array('Type' => "tinyint(1) NOT NULL default '0'", 'Default' => true), |
|
| 129 | - 'summary' => array('Type' => 'text NOT NULL', 'Default' => false), |
|
| 130 | - 'description' => array('Type' => 'text NOT NULL', 'Default' => false), |
|
| 131 | - 'modifysubmitter' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 132 | - 'requestdate' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true) |
|
| 133 | - ); |
|
| 94 | + $mod_fields = array( |
|
| 95 | + 'requestid' => array('Type' => 'int(11) NOT NULL auto_increment', 'Default' => false), |
|
| 96 | + 'lid' => array('Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true), |
|
| 97 | + 'cid' => array('Type' => "int(5) unsigned NOT NULL default '0'", 'Default' => true), |
|
| 98 | + 'title' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 99 | + 'url' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 100 | + 'filename' => array('Type' => "varchar(150) NOT NULL default ''", 'Default' => true), |
|
| 101 | + 'filetype' => array('Type' => "varchar(100) NOT NULL default ''", 'Default' => true), |
|
| 102 | + 'homepage' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 103 | + 'version' => array('Type' => "varchar(20) NOT NULL default ''", 'Default' => true), |
|
| 104 | + 'size' => array('Type' => "int(8) NOT NULL default '0'", 'Default' => true), |
|
| 105 | + 'platform' => array('Type' => "varchar(50) NOT NULL default ''", 'Default' => true), |
|
| 106 | + 'screenshot' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 107 | + 'submitter' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 108 | + 'publisher' => array('Type' => 'text NOT NULL', 'Default' => false), |
|
| 109 | + 'status' => array('Type' => "tinyint(2) NOT NULL default '0'", 'Default' => true), |
|
| 110 | + 'date' => array('Type' => "int(10) NOT NULL default '0'", 'Default' => true), |
|
| 111 | + 'hits' => array('Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true), |
|
| 112 | + 'rating' => array('Type' => "double(6,4) NOT NULL default '0.0000'", 'Default' => true), |
|
| 113 | + 'votes' => array('Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true), |
|
| 114 | + 'comments' => array('Type' => "int(11) unsigned NOT NULL default '0'", 'Default' => true), |
|
| 115 | + 'license' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 116 | + 'mirror' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 117 | + 'price' => array('Type' => "varchar(10) NOT NULL default 'Free'", 'Default' => true), |
|
| 118 | + 'paypalemail' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 119 | + 'features' => array('Type' => 'text NOT NULL', 'Default' => false), |
|
| 120 | + 'requirements' => array('Type' => 'text NOT NULL', 'Default' => false), |
|
| 121 | + 'homepagetitle' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 122 | + 'forumid' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 123 | + 'limitations' => array('Type' => "varchar(255) NOT NULL default '30 day trial'", 'Default' => true), |
|
| 124 | + 'dhistory' => array('Type' => 'text NOT NULL', 'Default' => false), |
|
| 125 | + 'published' => array('Type' => "int(10) NOT NULL default '0'", 'Default' => true), |
|
| 126 | + 'expired' => array('Type' => "int(10) NOT NULL default '0'", 'Default' => true), |
|
| 127 | + 'updated' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 128 | + 'offline' => array('Type' => "tinyint(1) NOT NULL default '0'", 'Default' => true), |
|
| 129 | + 'summary' => array('Type' => 'text NOT NULL', 'Default' => false), |
|
| 130 | + 'description' => array('Type' => 'text NOT NULL', 'Default' => false), |
|
| 131 | + 'modifysubmitter' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 132 | + 'requestdate' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true) |
|
| 133 | + ); |
|
| 134 | 134 | |
| 135 | - $renamed_fields = array( |
|
| 136 | - 'logourl' => 'screenshot' |
|
| 137 | - ); |
|
| 135 | + $renamed_fields = array( |
|
| 136 | + 'logourl' => 'screenshot' |
|
| 137 | + ); |
|
| 138 | 138 | |
| 139 | - echo '<br><b>Checking Modified Downloads table</b><br>'; |
|
| 140 | - $modHandler = xoops_getModuleHandler('modification', 'wfdownloads'); |
|
| 141 | - $mod_table = new WfdownloadsTable('wfdownloads_mod'); |
|
| 142 | - $fields = get_table_info($modHandler->table, $mod_fields); |
|
| 143 | - rename_fields($mod_table, $renamed_fields, $fields, $mod_fields); |
|
| 144 | - update_table($mod_fields, $fields, $mod_table); |
|
| 145 | - if ($dbupdater->updateTable($mod_table)) { |
|
| 146 | - echo 'Modified Downloads table updated <br>'; |
|
| 147 | - } |
|
| 148 | - unset($fields); |
|
| 139 | + echo '<br><b>Checking Modified Downloads table</b><br>'; |
|
| 140 | + $modHandler = xoops_getModuleHandler('modification', 'wfdownloads'); |
|
| 141 | + $mod_table = new WfdownloadsTable('wfdownloads_mod'); |
|
| 142 | + $fields = get_table_info($modHandler->table, $mod_fields); |
|
| 143 | + rename_fields($mod_table, $renamed_fields, $fields, $mod_fields); |
|
| 144 | + update_table($mod_fields, $fields, $mod_table); |
|
| 145 | + if ($dbupdater->updateTable($mod_table)) { |
|
| 146 | + echo 'Modified Downloads table updated <br>'; |
|
| 147 | + } |
|
| 148 | + unset($fields); |
|
| 149 | 149 | |
| 150 | - $cat_fields = array( |
|
| 151 | - 'cid' => array('Type' => 'int(5) unsigned NOT NULL auto_increment', 'Default' => false), |
|
| 152 | - 'pid' => array('Type' => "int(5) unsigned NOT NULL default '0'", 'Default' => true), |
|
| 153 | - 'title' => array('Type' => "varchar(50) NOT NULL default ''", 'Default' => true), |
|
| 154 | - 'imgurl' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 155 | - 'description' => array('Type' => "text NOT NULL default ''", 'Default' => true), |
|
| 156 | - 'total' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 157 | - 'summary' => array('Type' => 'text NOT NULL', 'Default' => false), |
|
| 158 | - 'spotlighttop' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 159 | - 'spotlighthis' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 160 | - 'dohtml' => array('Type' => "tinyint(1) NOT NULL default '1'", 'Default' => true), |
|
| 161 | - 'dosmiley' => array('Type' => "tinyint(1) NOT NULL default '1'", 'Default' => true), |
|
| 162 | - 'doxcode' => array('Type' => "tinyint(1) NOT NULL default '1'", 'Default' => true), |
|
| 163 | - 'doimage' => array('Type' => "tinyint(1) NOT NULL default '1'", 'Default' => true), |
|
| 164 | - 'dobr' => array('Type' => "tinyint(1) NOT NULL default '1'", 'Default' => true), |
|
| 165 | - 'weight' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true) |
|
| 166 | - ); |
|
| 167 | - echo '<br><b>Checking Category table</b><br>'; |
|
| 168 | - $catHandler = xoops_getModuleHandler('category', 'wfdownloads'); |
|
| 169 | - $cat_table = new WfdownloadsTable('wfdownloads_cat'); |
|
| 170 | - $fields = get_table_info($catHandler->table, $cat_fields); |
|
| 171 | - update_table($cat_fields, $fields, $cat_table); |
|
| 172 | - if ($dbupdater->updateTable($cat_table)) { |
|
| 173 | - echo 'Category table updated<br>'; |
|
| 174 | - } |
|
| 175 | - unset($fields); |
|
| 150 | + $cat_fields = array( |
|
| 151 | + 'cid' => array('Type' => 'int(5) unsigned NOT NULL auto_increment', 'Default' => false), |
|
| 152 | + 'pid' => array('Type' => "int(5) unsigned NOT NULL default '0'", 'Default' => true), |
|
| 153 | + 'title' => array('Type' => "varchar(50) NOT NULL default ''", 'Default' => true), |
|
| 154 | + 'imgurl' => array('Type' => "varchar(255) NOT NULL default ''", 'Default' => true), |
|
| 155 | + 'description' => array('Type' => "text NOT NULL default ''", 'Default' => true), |
|
| 156 | + 'total' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 157 | + 'summary' => array('Type' => 'text NOT NULL', 'Default' => false), |
|
| 158 | + 'spotlighttop' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 159 | + 'spotlighthis' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 160 | + 'dohtml' => array('Type' => "tinyint(1) NOT NULL default '1'", 'Default' => true), |
|
| 161 | + 'dosmiley' => array('Type' => "tinyint(1) NOT NULL default '1'", 'Default' => true), |
|
| 162 | + 'doxcode' => array('Type' => "tinyint(1) NOT NULL default '1'", 'Default' => true), |
|
| 163 | + 'doimage' => array('Type' => "tinyint(1) NOT NULL default '1'", 'Default' => true), |
|
| 164 | + 'dobr' => array('Type' => "tinyint(1) NOT NULL default '1'", 'Default' => true), |
|
| 165 | + 'weight' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true) |
|
| 166 | + ); |
|
| 167 | + echo '<br><b>Checking Category table</b><br>'; |
|
| 168 | + $catHandler = xoops_getModuleHandler('category', 'wfdownloads'); |
|
| 169 | + $cat_table = new WfdownloadsTable('wfdownloads_cat'); |
|
| 170 | + $fields = get_table_info($catHandler->table, $cat_fields); |
|
| 171 | + update_table($cat_fields, $fields, $cat_table); |
|
| 172 | + if ($dbupdater->updateTable($cat_table)) { |
|
| 173 | + echo 'Category table updated<br>'; |
|
| 174 | + } |
|
| 175 | + unset($fields); |
|
| 176 | 176 | |
| 177 | - $broken_fields = array( |
|
| 178 | - 'reportid' => array('Type' => 'int(5) NOT NULL auto_increment', 'Default' => false), |
|
| 179 | - 'lid' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 180 | - 'sender' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 181 | - 'ip' => array('Type' => "varchar(20) NOT NULL default ''", 'Default' => true), |
|
| 182 | - 'date' => array('Type' => "varchar(11) NOT NULL default '0'", 'Default' => true), |
|
| 183 | - 'confirmed' => array('Type' => "enum('0','1') NOT NULL default '0'", 'Default' => true), |
|
| 184 | - 'acknowledged' => array('Type' => "enum('0','1') NOT NULL default '0'", 'Default' => true) |
|
| 185 | - ); |
|
| 186 | - echo '<br><b>Checking Broken Report table</b><br>'; |
|
| 187 | - $brokenHandler = xoops_getModuleHandler('report', 'wfdownloads'); |
|
| 188 | - $broken_table = new WfdownloadsTable('wfdownloads_broken'); |
|
| 189 | - $fields = get_table_info($brokenHandler->table, $broken_fields); |
|
| 190 | - update_table($broken_fields, $fields, $broken_table); |
|
| 191 | - if ($dbupdater->updateTable($broken_table)) { |
|
| 192 | - echo 'Broken Reports table updated<br>'; |
|
| 193 | - } |
|
| 194 | - unset($fields); |
|
| 177 | + $broken_fields = array( |
|
| 178 | + 'reportid' => array('Type' => 'int(5) NOT NULL auto_increment', 'Default' => false), |
|
| 179 | + 'lid' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 180 | + 'sender' => array('Type' => "int(11) NOT NULL default '0'", 'Default' => true), |
|
| 181 | + 'ip' => array('Type' => "varchar(20) NOT NULL default ''", 'Default' => true), |
|
| 182 | + 'date' => array('Type' => "varchar(11) NOT NULL default '0'", 'Default' => true), |
|
| 183 | + 'confirmed' => array('Type' => "enum('0','1') NOT NULL default '0'", 'Default' => true), |
|
| 184 | + 'acknowledged' => array('Type' => "enum('0','1') NOT NULL default '0'", 'Default' => true) |
|
| 185 | + ); |
|
| 186 | + echo '<br><b>Checking Broken Report table</b><br>'; |
|
| 187 | + $brokenHandler = xoops_getModuleHandler('report', 'wfdownloads'); |
|
| 188 | + $broken_table = new WfdownloadsTable('wfdownloads_broken'); |
|
| 189 | + $fields = get_table_info($brokenHandler->table, $broken_fields); |
|
| 190 | + update_table($broken_fields, $fields, $broken_table); |
|
| 191 | + if ($dbupdater->updateTable($broken_table)) { |
|
| 192 | + echo 'Broken Reports table updated<br>'; |
|
| 193 | + } |
|
| 194 | + unset($fields); |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | // ========================================================================================= |
@@ -204,48 +204,48 @@ discard block |
||
| 204 | 204 | */ |
| 205 | 205 | function invert_nohtm_dohtml_values() |
| 206 | 206 | { |
| 207 | - $ret = array(); |
|
| 208 | - global $xoopsDB; |
|
| 209 | - $catHandler = xoops_getModuleHandler('category', 'wfdownloads'); |
|
| 210 | - $result = $xoopsDB->query('SHOW COLUMNS FROM ' . $catHandler->table); |
|
| 211 | - while ($existing_field = $xoopsDB->fetchArray($result)) { |
|
| 212 | - $fields[$existing_field['field']] = $existing_field['type']; |
|
| 213 | - } |
|
| 214 | - if (in_array('nohtml', array_keys($fields))) { |
|
| 215 | - $dbupdater = new WfdownloadsDbupdater(); |
|
| 216 | - //Invert column values |
|
| 217 | - // alter options in wfdownloads_cat |
|
| 218 | - $table = new WfdownloadsTable('wfdownloads_cat'); |
|
| 219 | - $table->addAlteredField('nohtml', "dohtml tinyint(1) NOT NULL DEFAULT '1'"); |
|
| 220 | - $table->addAlteredField('nosmiley', "dosmiley tinyint(1) NOT NULL DEFAULT '1'"); |
|
| 221 | - $table->addAlteredField('noxcodes', "doxcode tinyint(1) NOT NULL DEFAULT '1'"); |
|
| 222 | - $table->addAlteredField('noimages', "doimage tinyint(1) NOT NULL DEFAULT '1'"); |
|
| 223 | - $table->addAlteredField('nobreak', "dobr tinyint(1) NOT NULL DEFAULT '1'"); |
|
| 207 | + $ret = array(); |
|
| 208 | + global $xoopsDB; |
|
| 209 | + $catHandler = xoops_getModuleHandler('category', 'wfdownloads'); |
|
| 210 | + $result = $xoopsDB->query('SHOW COLUMNS FROM ' . $catHandler->table); |
|
| 211 | + while ($existing_field = $xoopsDB->fetchArray($result)) { |
|
| 212 | + $fields[$existing_field['field']] = $existing_field['type']; |
|
| 213 | + } |
|
| 214 | + if (in_array('nohtml', array_keys($fields))) { |
|
| 215 | + $dbupdater = new WfdownloadsDbupdater(); |
|
| 216 | + //Invert column values |
|
| 217 | + // alter options in wfdownloads_cat |
|
| 218 | + $table = new WfdownloadsTable('wfdownloads_cat'); |
|
| 219 | + $table->addAlteredField('nohtml', "dohtml tinyint(1) NOT NULL DEFAULT '1'"); |
|
| 220 | + $table->addAlteredField('nosmiley', "dosmiley tinyint(1) NOT NULL DEFAULT '1'"); |
|
| 221 | + $table->addAlteredField('noxcodes', "doxcode tinyint(1) NOT NULL DEFAULT '1'"); |
|
| 222 | + $table->addAlteredField('noimages', "doimage tinyint(1) NOT NULL DEFAULT '1'"); |
|
| 223 | + $table->addAlteredField('nobreak', "dobr tinyint(1) NOT NULL DEFAULT '1'"); |
|
| 224 | 224 | |
| 225 | - //inverting values no=1 <=> do=0 |
|
| 226 | - // have to store teporarly as value = 2 to |
|
| 227 | - // avoid putting everithing to same value |
|
| 228 | - // if you change 1 to 0, then 0 to one, |
|
| 229 | - // every value will be 1, follow me? |
|
| 230 | - $table->addUpdatedWhere('dohtml', 2, '=1'); |
|
| 231 | - $table->addUpdatedWhere('dohtml', 1, '=0'); |
|
| 232 | - $table->addUpdatedWhere('dohtml', 0, '=2'); |
|
| 225 | + //inverting values no=1 <=> do=0 |
|
| 226 | + // have to store teporarly as value = 2 to |
|
| 227 | + // avoid putting everithing to same value |
|
| 228 | + // if you change 1 to 0, then 0 to one, |
|
| 229 | + // every value will be 1, follow me? |
|
| 230 | + $table->addUpdatedWhere('dohtml', 2, '=1'); |
|
| 231 | + $table->addUpdatedWhere('dohtml', 1, '=0'); |
|
| 232 | + $table->addUpdatedWhere('dohtml', 0, '=2'); |
|
| 233 | 233 | |
| 234 | - $table->addUpdatedWhere('dosmiley', 2, '=1'); |
|
| 235 | - $table->addUpdatedWhere('dosmiley', 1, '=0'); |
|
| 236 | - $table->addUpdatedWhere('dosmiley', 0, '=2'); |
|
| 234 | + $table->addUpdatedWhere('dosmiley', 2, '=1'); |
|
| 235 | + $table->addUpdatedWhere('dosmiley', 1, '=0'); |
|
| 236 | + $table->addUpdatedWhere('dosmiley', 0, '=2'); |
|
| 237 | 237 | |
| 238 | - $table->addUpdatedWhere('doxcode', 2, '=1'); |
|
| 239 | - $table->addUpdatedWhere('doxcode', 1, '=0'); |
|
| 240 | - $table->addUpdatedWhere('doxcode', 0, '=2'); |
|
| 238 | + $table->addUpdatedWhere('doxcode', 2, '=1'); |
|
| 239 | + $table->addUpdatedWhere('doxcode', 1, '=0'); |
|
| 240 | + $table->addUpdatedWhere('doxcode', 0, '=2'); |
|
| 241 | 241 | |
| 242 | - $table->addUpdatedWhere('doimage', 2, '=1'); |
|
| 243 | - $table->addUpdatedWhere('doimage', 1, '=0'); |
|
| 244 | - $table->addUpdatedWhere('doimage', 0, '=2'); |
|
| 245 | - $ret = $dbupdater->updateTable($table); |
|
| 246 | - } |
|
| 242 | + $table->addUpdatedWhere('doimage', 2, '=1'); |
|
| 243 | + $table->addUpdatedWhere('doimage', 1, '=0'); |
|
| 244 | + $table->addUpdatedWhere('doimage', 0, '=2'); |
|
| 245 | + $ret = $dbupdater->updateTable($table); |
|
| 246 | + } |
|
| 247 | 247 | |
| 248 | - return $ret; |
|
| 248 | + return $ret; |
|
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | /** |
@@ -258,22 +258,22 @@ discard block |
||
| 258 | 258 | */ |
| 259 | 259 | function update_table($new_fields, $existing_fields, &$table) |
| 260 | 260 | { |
| 261 | - foreach ($new_fields as $field => $fieldinfo) { |
|
| 262 | - $type = $fieldinfo['Type']; |
|
| 263 | - if (!in_array($field, array_keys($existing_fields))) { |
|
| 264 | - //Add field as it is missing |
|
| 265 | - $table->addNewField($field, $type); |
|
| 266 | - //$xoopsDB->query("ALTER TABLE ".$table." ADD ".$field." ".$type); |
|
| 267 | - //echo $field."(".$type.") <FONT COLOR='##22DD51'>Added</FONT><br>"; |
|
| 268 | - } elseif ($existing_fields[$field] != $type) { |
|
| 269 | - $table->addAlteredField($field, $field . ' ' . $type); |
|
| 270 | - // check $fields[$field]['type'] for things like "int(10) unsigned" |
|
| 271 | - //$xoopsDB->query("ALTER TABLE ".$table." CHANGE ".$field." ".$field." ".$type); |
|
| 272 | - //echo $field." <FONT COLOR='#FF6600'>Changed to</FONT> ".$type."<br>"; |
|
| 273 | - } else { |
|
| 274 | - //echo $field." <FONT COLOR='#0033FF'>Uptodate</FONT><br>"; |
|
| 275 | - } |
|
| 276 | - } |
|
| 261 | + foreach ($new_fields as $field => $fieldinfo) { |
|
| 262 | + $type = $fieldinfo['Type']; |
|
| 263 | + if (!in_array($field, array_keys($existing_fields))) { |
|
| 264 | + //Add field as it is missing |
|
| 265 | + $table->addNewField($field, $type); |
|
| 266 | + //$xoopsDB->query("ALTER TABLE ".$table." ADD ".$field." ".$type); |
|
| 267 | + //echo $field."(".$type.") <FONT COLOR='##22DD51'>Added</FONT><br>"; |
|
| 268 | + } elseif ($existing_fields[$field] != $type) { |
|
| 269 | + $table->addAlteredField($field, $field . ' ' . $type); |
|
| 270 | + // check $fields[$field]['type'] for things like "int(10) unsigned" |
|
| 271 | + //$xoopsDB->query("ALTER TABLE ".$table." CHANGE ".$field." ".$field." ".$type); |
|
| 272 | + //echo $field." <FONT COLOR='#FF6600'>Changed to</FONT> ".$type."<br>"; |
|
| 273 | + } else { |
|
| 274 | + //echo $field." <FONT COLOR='#0033FF'>Uptodate</FONT><br>"; |
|
| 275 | + } |
|
| 276 | + } |
|
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | /** |
@@ -286,22 +286,22 @@ discard block |
||
| 286 | 286 | */ |
| 287 | 287 | function get_table_info($table, $default_fields) |
| 288 | 288 | { |
| 289 | - global $xoopsDB; |
|
| 290 | - $result = $xoopsDB->query('SHOW COLUMNS FROM ' . $table); |
|
| 291 | - while ($existing_field = $xoopsDB->fetchArray($result)) { |
|
| 292 | - $fields[$existing_field['Field']] = $existing_field['Type']; |
|
| 293 | - if ($existing_field['Null'] !== 'YES') { |
|
| 294 | - $fields[$existing_field['Field']] .= ' NOT NULL'; |
|
| 295 | - } |
|
| 296 | - if ($existing_field['Extra']) { |
|
| 297 | - $fields[$existing_field['Field']] .= ' ' . $existing_field['Extra']; |
|
| 298 | - } |
|
| 299 | - if ($default_fields[$existing_field['Field']]['Default']) { |
|
| 300 | - $fields[$existing_field['Field']] .= " default '" . $existing_field['Default'] . "'"; |
|
| 301 | - } |
|
| 302 | - } |
|
| 289 | + global $xoopsDB; |
|
| 290 | + $result = $xoopsDB->query('SHOW COLUMNS FROM ' . $table); |
|
| 291 | + while ($existing_field = $xoopsDB->fetchArray($result)) { |
|
| 292 | + $fields[$existing_field['Field']] = $existing_field['Type']; |
|
| 293 | + if ($existing_field['Null'] !== 'YES') { |
|
| 294 | + $fields[$existing_field['Field']] .= ' NOT NULL'; |
|
| 295 | + } |
|
| 296 | + if ($existing_field['Extra']) { |
|
| 297 | + $fields[$existing_field['Field']] .= ' ' . $existing_field['Extra']; |
|
| 298 | + } |
|
| 299 | + if ($default_fields[$existing_field['Field']]['Default']) { |
|
| 300 | + $fields[$existing_field['Field']] .= " default '" . $existing_field['Default'] . "'"; |
|
| 301 | + } |
|
| 302 | + } |
|
| 303 | 303 | |
| 304 | - return $fields; |
|
| 304 | + return $fields; |
|
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | /** |
@@ -315,59 +315,59 @@ discard block |
||
| 315 | 315 | */ |
| 316 | 316 | function rename_fields(&$table, $renamed_fields, &$fields, $new_fields) |
| 317 | 317 | { |
| 318 | - foreach (array_keys($fields) as $field) { |
|
| 319 | - if (in_array($field, array_keys($renamed_fields))) { |
|
| 320 | - $new_field_name = $renamed_fields[$field]; |
|
| 321 | - $new_field_type = $new_fields[$new_field_name]['Type']; |
|
| 322 | - $table->addAltered($field, $new_field_name . ' ' . $new_field_type); |
|
| 323 | - //$xoopsDB->query("ALTER TABLE ".$table." CHANGE ".$field." ".$new_field_name." ".$new_field_type); |
|
| 324 | - //echo $field." Renamed to ".$new_field_name."<br>"; |
|
| 325 | - $fields[$new_field_name] = $new_field_type; |
|
| 326 | - } |
|
| 327 | - } |
|
| 328 | - //return $fields; |
|
| 318 | + foreach (array_keys($fields) as $field) { |
|
| 319 | + if (in_array($field, array_keys($renamed_fields))) { |
|
| 320 | + $new_field_name = $renamed_fields[$field]; |
|
| 321 | + $new_field_type = $new_fields[$new_field_name]['Type']; |
|
| 322 | + $table->addAltered($field, $new_field_name . ' ' . $new_field_type); |
|
| 323 | + //$xoopsDB->query("ALTER TABLE ".$table." CHANGE ".$field." ".$new_field_name." ".$new_field_type); |
|
| 324 | + //echo $field." Renamed to ".$new_field_name."<br>"; |
|
| 325 | + $fields[$new_field_name] = $new_field_type; |
|
| 326 | + } |
|
| 327 | + } |
|
| 328 | + //return $fields; |
|
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | $op = isset($_REQUEST['op']) ? (int)$_REQUEST['op'] : 0; |
| 332 | 332 | switch ($op) { |
| 333 | - case 1: |
|
| 334 | - // Make sure that nohtml is properly changed to dohtml |
|
| 335 | - invert_nohtm_dohtml_values(); |
|
| 336 | - // Ensure that the proper tables are present |
|
| 337 | - update_tables_to_300(); |
|
| 338 | - // Import data from MyDownloads |
|
| 339 | - import_mydownloads_to_wfdownloads(); |
|
| 340 | - break; |
|
| 333 | + case 1: |
|
| 334 | + // Make sure that nohtml is properly changed to dohtml |
|
| 335 | + invert_nohtm_dohtml_values(); |
|
| 336 | + // Ensure that the proper tables are present |
|
| 337 | + update_tables_to_300(); |
|
| 338 | + // Import data from MyDownloads |
|
| 339 | + import_mydownloads_to_wfdownloads(); |
|
| 340 | + break; |
|
| 341 | 341 | |
| 342 | - case 2: |
|
| 343 | - // Update WF-Downloads |
|
| 344 | - $log = invert_nohtm_dohtml_values(); |
|
| 345 | - update_tables_to_300(); |
|
| 346 | - break; |
|
| 342 | + case 2: |
|
| 343 | + // Update WF-Downloads |
|
| 344 | + $log = invert_nohtm_dohtml_values(); |
|
| 345 | + update_tables_to_300(); |
|
| 346 | + break; |
|
| 347 | 347 | |
| 348 | - default: |
|
| 349 | - //ask what to do |
|
| 350 | - include XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 351 | - $form = new XoopsThemeForm('Upgrade WF-Downloads', 'form', $_SERVER['REQUEST_URI']); |
|
| 348 | + default: |
|
| 349 | + //ask what to do |
|
| 350 | + include XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 351 | + $form = new XoopsThemeForm('Upgrade WF-Downloads', 'form', $_SERVER['REQUEST_URI']); |
|
| 352 | 352 | |
| 353 | - //Is MyDownloads installed? |
|
| 354 | - $moduleHandler = xoops_getHandler('module'); |
|
| 355 | - $mydownloadsModule = $moduleHandler->getByDirname('mydownloads'); |
|
| 356 | - if (is_object($mydownloadsModule)) { |
|
| 357 | - $mydownloadsButton = new XoopsFormButton('Import data from MyDownloads', 'myd_button', 'Import', 'submit'); |
|
| 358 | - $mydownloadsButton->setExtra("onclick='document.forms.form.op.value=\"1\"'"); |
|
| 359 | - $form->addElement($mydownloadsButton); |
|
| 360 | - } |
|
| 353 | + //Is MyDownloads installed? |
|
| 354 | + $moduleHandler = xoops_getHandler('module'); |
|
| 355 | + $mydownloadsModule = $moduleHandler->getByDirname('mydownloads'); |
|
| 356 | + if (is_object($mydownloadsModule)) { |
|
| 357 | + $mydownloadsButton = new XoopsFormButton('Import data from MyDownloads', 'myd_button', 'Import', 'submit'); |
|
| 358 | + $mydownloadsButton->setExtra("onclick='document.forms.form.op.value=\"1\"'"); |
|
| 359 | + $form->addElement($mydownloadsButton); |
|
| 360 | + } |
|
| 361 | 361 | |
| 362 | - if (!wfdownloads_TableExists('wfdownloads_meta')) { |
|
| 363 | - $updateButton = new XoopsFormButton('Update WF-Downloads', 'upd_button', 'Update', 'submit'); |
|
| 364 | - $updateButton->setExtra("onclick='document.forms.form.op.value=\"2\"'"); |
|
| 365 | - $form->addElement($updateButton); |
|
| 366 | - } |
|
| 362 | + if (!wfdownloads_TableExists('wfdownloads_meta')) { |
|
| 363 | + $updateButton = new XoopsFormButton('Update WF-Downloads', 'upd_button', 'Update', 'submit'); |
|
| 364 | + $updateButton->setExtra("onclick='document.forms.form.op.value=\"2\"'"); |
|
| 365 | + $form->addElement($updateButton); |
|
| 366 | + } |
|
| 367 | 367 | |
| 368 | - $form->addElement(new XoopsFormHidden('op', 0)); |
|
| 369 | - $form->display(); |
|
| 370 | - break; |
|
| 368 | + $form->addElement(new XoopsFormHidden('op', 0)); |
|
| 369 | + $form->display(); |
|
| 370 | + break; |
|
| 371 | 371 | } |
| 372 | 372 | //wfdownloads_modFooter(); |
| 373 | 373 | //xoops_cp_footer(); |
@@ -11,44 +11,44 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | function editclass($showmenu = false, $ratingid = 0) |
| 13 | 13 | { |
| 14 | - global $smartobjectRatingHandler; |
|
| 15 | - |
|
| 16 | - $ratingObj = $smartobjectRatingHandler->get($ratingid); |
|
| 17 | - |
|
| 18 | - if (!$ratingObj->isNew()) { |
|
| 19 | - if ($showmenu) { |
|
| 20 | - //smart_adminMenu(4, _AM_SOBJECT_RATINGS . " > " . _AM_SOBJECT_EDITING); |
|
| 21 | - } |
|
| 22 | - smart_collapsableBar('ratingedit', _AM_SOBJECT_RATINGS_EDIT, _AM_SOBJECT_RATINGS_EDIT_INFO); |
|
| 23 | - |
|
| 24 | - $sform = $ratingObj->getForm(_AM_SOBJECT_RATINGS_EDIT, 'addrating'); |
|
| 25 | - $sform->display(); |
|
| 26 | - smart_close_collapsable('ratingedit'); |
|
| 27 | - } else { |
|
| 28 | - $ratingObj->hideFieldFromForm(array('item', 'itemid', 'uid', 'date', 'rate')); |
|
| 29 | - |
|
| 30 | - if (isset($_POST['op'])) { |
|
| 31 | - $controller = new SmartObjectController($smartobjectRatingHandler); |
|
| 32 | - $controller->postDataToObject($ratingObj); |
|
| 33 | - |
|
| 34 | - if ($_POST['op'] === 'changedField') { |
|
| 35 | - switch ($_POST['changedField']) { |
|
| 36 | - case 'dirname': |
|
| 37 | - $ratingObj->showFieldOnForm(array('item', 'itemid', 'uid', 'date', 'rate')); |
|
| 38 | - break; |
|
| 39 | - } |
|
| 40 | - } |
|
| 41 | - } |
|
| 42 | - |
|
| 43 | - if ($showmenu) { |
|
| 44 | - //smart_adminMenu(4, _AM_SOBJECT_RATINGS . " > " . _CO_SOBJECT_CREATINGNEW); |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - smart_collapsableBar('ratingcreate', _AM_SOBJECT_RATINGS_CREATE, _AM_SOBJECT_RATINGS_CREATE_INFO); |
|
| 48 | - $sform = $ratingObj->getForm(_AM_SOBJECT_RATINGS_CREATE, 'addrating'); |
|
| 49 | - $sform->display(); |
|
| 50 | - smart_close_collapsable('ratingcreate'); |
|
| 51 | - } |
|
| 14 | + global $smartobjectRatingHandler; |
|
| 15 | + |
|
| 16 | + $ratingObj = $smartobjectRatingHandler->get($ratingid); |
|
| 17 | + |
|
| 18 | + if (!$ratingObj->isNew()) { |
|
| 19 | + if ($showmenu) { |
|
| 20 | + //smart_adminMenu(4, _AM_SOBJECT_RATINGS . " > " . _AM_SOBJECT_EDITING); |
|
| 21 | + } |
|
| 22 | + smart_collapsableBar('ratingedit', _AM_SOBJECT_RATINGS_EDIT, _AM_SOBJECT_RATINGS_EDIT_INFO); |
|
| 23 | + |
|
| 24 | + $sform = $ratingObj->getForm(_AM_SOBJECT_RATINGS_EDIT, 'addrating'); |
|
| 25 | + $sform->display(); |
|
| 26 | + smart_close_collapsable('ratingedit'); |
|
| 27 | + } else { |
|
| 28 | + $ratingObj->hideFieldFromForm(array('item', 'itemid', 'uid', 'date', 'rate')); |
|
| 29 | + |
|
| 30 | + if (isset($_POST['op'])) { |
|
| 31 | + $controller = new SmartObjectController($smartobjectRatingHandler); |
|
| 32 | + $controller->postDataToObject($ratingObj); |
|
| 33 | + |
|
| 34 | + if ($_POST['op'] === 'changedField') { |
|
| 35 | + switch ($_POST['changedField']) { |
|
| 36 | + case 'dirname': |
|
| 37 | + $ratingObj->showFieldOnForm(array('item', 'itemid', 'uid', 'date', 'rate')); |
|
| 38 | + break; |
|
| 39 | + } |
|
| 40 | + } |
|
| 41 | + } |
|
| 42 | + |
|
| 43 | + if ($showmenu) { |
|
| 44 | + //smart_adminMenu(4, _AM_SOBJECT_RATINGS . " > " . _CO_SOBJECT_CREATINGNEW); |
|
| 45 | + } |
|
| 46 | + |
|
| 47 | + smart_collapsableBar('ratingcreate', _AM_SOBJECT_RATINGS_CREATE, _AM_SOBJECT_RATINGS_CREATE_INFO); |
|
| 48 | + $sform = $ratingObj->getForm(_AM_SOBJECT_RATINGS_CREATE, 'addrating'); |
|
| 49 | + $sform->display(); |
|
| 50 | + smart_close_collapsable('ratingcreate'); |
|
| 51 | + } |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | include_once __DIR__ . '/admin_header.php'; |
@@ -60,60 +60,60 @@ discard block |
||
| 60 | 60 | $op = ''; |
| 61 | 61 | |
| 62 | 62 | if (isset($_GET['op'])) { |
| 63 | - $op = $_GET['op']; |
|
| 63 | + $op = $_GET['op']; |
|
| 64 | 64 | } |
| 65 | 65 | if (isset($_POST['op'])) { |
| 66 | - $op = $_POST['op']; |
|
| 66 | + $op = $_POST['op']; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | switch ($op) { |
| 70 | - case 'mod': |
|
| 71 | - case 'changedField'; |
|
| 70 | + case 'mod': |
|
| 71 | + case 'changedField'; |
|
| 72 | 72 | |
| 73 | - $ratingid = isset($_GET['ratingid']) ? (int)$_GET['ratingid'] : 0; |
|
| 73 | + $ratingid = isset($_GET['ratingid']) ? (int)$_GET['ratingid'] : 0; |
|
| 74 | 74 | |
| 75 | - smart_xoops_cp_header(); |
|
| 76 | - echo $indexAdmin->addNavigation(basename(__FILE__)); |
|
| 75 | + smart_xoops_cp_header(); |
|
| 76 | + echo $indexAdmin->addNavigation(basename(__FILE__)); |
|
| 77 | 77 | |
| 78 | - editclass(true, $ratingid); |
|
| 79 | - break; |
|
| 78 | + editclass(true, $ratingid); |
|
| 79 | + break; |
|
| 80 | 80 | |
| 81 | - case 'addrating': |
|
| 82 | - include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 83 | - $controller = new SmartObjectController($smartobjectRatingHandler); |
|
| 84 | - $controller->storeFromDefaultForm(_AM_SOBJECT_RATINGS_CREATED, _AM_SOBJECT_RATINGS_MODIFIED, SMARTOBJECT_URL . 'admin/rating.php'); |
|
| 81 | + case 'addrating': |
|
| 82 | + include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 83 | + $controller = new SmartObjectController($smartobjectRatingHandler); |
|
| 84 | + $controller->storeFromDefaultForm(_AM_SOBJECT_RATINGS_CREATED, _AM_SOBJECT_RATINGS_MODIFIED, SMARTOBJECT_URL . 'admin/rating.php'); |
|
| 85 | 85 | |
| 86 | - break; |
|
| 86 | + break; |
|
| 87 | 87 | |
| 88 | - case 'del': |
|
| 89 | - include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 90 | - $controller = new SmartObjectController($smartobjectRatingHandler); |
|
| 91 | - $controller->handleObjectDeletion(); |
|
| 88 | + case 'del': |
|
| 89 | + include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 90 | + $controller = new SmartObjectController($smartobjectRatingHandler); |
|
| 91 | + $controller->handleObjectDeletion(); |
|
| 92 | 92 | |
| 93 | - break; |
|
| 93 | + break; |
|
| 94 | 94 | |
| 95 | - default: |
|
| 95 | + default: |
|
| 96 | 96 | |
| 97 | - smart_xoops_cp_header(); |
|
| 98 | - echo $indexAdmin->addNavigation(basename(__FILE__)); |
|
| 97 | + smart_xoops_cp_header(); |
|
| 98 | + echo $indexAdmin->addNavigation(basename(__FILE__)); |
|
| 99 | 99 | |
| 100 | - //smart_adminMenu(4, _AM_SOBJECT_RATINGS); |
|
| 100 | + //smart_adminMenu(4, _AM_SOBJECT_RATINGS); |
|
| 101 | 101 | |
| 102 | - smart_collapsableBar('createdratings', _AM_SOBJECT_RATINGS, _AM_SOBJECT_RATINGS_DSC); |
|
| 102 | + smart_collapsableBar('createdratings', _AM_SOBJECT_RATINGS, _AM_SOBJECT_RATINGS_DSC); |
|
| 103 | 103 | |
| 104 | - include_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 105 | - $objectTable = new SmartObjectTable($smartobjectRatingHandler); |
|
| 106 | - $objectTable->addColumn(new SmartObjectColumn('name', 'left')); |
|
| 107 | - $objectTable->addColumn(new SmartObjectColumn('dirname', 'left')); |
|
| 108 | - $objectTable->addColumn(new SmartObjectColumn('item', 'left', false, 'getItemValue')); |
|
| 109 | - $objectTable->addColumn(new SmartObjectColumn('date', 'center', 150)); |
|
| 110 | - $objectTable->addColumn(new SmartObjectColumn('rate', 'center', 40, 'getRateValue')); |
|
| 104 | + include_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 105 | + $objectTable = new SmartObjectTable($smartobjectRatingHandler); |
|
| 106 | + $objectTable->addColumn(new SmartObjectColumn('name', 'left')); |
|
| 107 | + $objectTable->addColumn(new SmartObjectColumn('dirname', 'left')); |
|
| 108 | + $objectTable->addColumn(new SmartObjectColumn('item', 'left', false, 'getItemValue')); |
|
| 109 | + $objectTable->addColumn(new SmartObjectColumn('date', 'center', 150)); |
|
| 110 | + $objectTable->addColumn(new SmartObjectColumn('rate', 'center', 40, 'getRateValue')); |
|
| 111 | 111 | |
| 112 | - // $objectTable->addCustomAction('getCreateItemLink'); |
|
| 113 | - // $objectTable->addCustomAction('getCreateAttributLink'); |
|
| 112 | + // $objectTable->addCustomAction('getCreateItemLink'); |
|
| 113 | + // $objectTable->addCustomAction('getCreateAttributLink'); |
|
| 114 | 114 | |
| 115 | - $objectTable->addIntroButton('addrating', 'rating.php?op=mod', _AM_SOBJECT_RATINGS_CREATE); |
|
| 116 | - /* |
|
| 115 | + $objectTable->addIntroButton('addrating', 'rating.php?op=mod', _AM_SOBJECT_RATINGS_CREATE); |
|
| 116 | + /* |
|
| 117 | 117 | $criteria_upcoming = new CriteriaCompo(); |
| 118 | 118 | $criteria_upcoming->add(new Criteria('start_date', time(), '>')); |
| 119 | 119 | $objectTable->addFilter(_AM_SOBJECT_FILTER_UPCOMING, array( |
@@ -138,13 +138,13 @@ discard block |
||
| 138 | 138 | )); |
| 139 | 139 | */ |
| 140 | 140 | |
| 141 | - $objectTable->render(); |
|
| 141 | + $objectTable->render(); |
|
| 142 | 142 | |
| 143 | - echo '<br>'; |
|
| 144 | - smart_close_collapsable('createdratings'); |
|
| 145 | - echo '<br>'; |
|
| 143 | + echo '<br>'; |
|
| 144 | + smart_close_collapsable('createdratings'); |
|
| 145 | + echo '<br>'; |
|
| 146 | 146 | |
| 147 | - break; |
|
| 147 | + break; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | //smart_modFooter(); |
@@ -12,45 +12,45 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | function edittag($tagid = 0, $language = false, $fct = false) |
| 14 | 14 | { |
| 15 | - global $smartobjectTagHandler; |
|
| 16 | - |
|
| 17 | - $tagObj = $smartobjectTagHandler->get($tagid); |
|
| 18 | - |
|
| 19 | - if ($tagObj->isNew()) { |
|
| 20 | - $breadcrumb = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_TAG_CREATE; |
|
| 21 | - $title = _AM_SOBJECT_TAG_CREATE; |
|
| 22 | - $info = _AM_SOBJECT_TAG_CREATE_INFO; |
|
| 23 | - $collaps_name = 'tagcreate'; |
|
| 24 | - $form_name = _AM_SOBJECT_TAG_CREATE; |
|
| 25 | - $submit_button_caption = null; |
|
| 26 | - //$tagObj->stripMultilanguageFields(); |
|
| 27 | - } else { |
|
| 28 | - if ($language) { |
|
| 29 | - $breadcrumb = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_TAG_EDITING_LANGUAGE; |
|
| 30 | - $title = _AM_SOBJECT_TAG_EDIT_LANGUAGE; |
|
| 31 | - $info = _AM_SOBJECT_TAG_EDIT_LANGUAGE_INFO; |
|
| 32 | - $collaps_name = 'tageditlanguage'; |
|
| 33 | - $form_name = _AM_SOBJECT_TAG_EDIT_LANGUAGE; |
|
| 34 | - $submit_button_caption = null; |
|
| 35 | - $tagObj->makeNonMLFieldReadOnly(); |
|
| 36 | - } else { |
|
| 37 | - $breadcrumb = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_EDITING; |
|
| 38 | - $title = _AM_SOBJECT_TAG_EDIT; |
|
| 39 | - $info = _AM_SOBJECT_TAG_EDIT_INFO; |
|
| 40 | - $collaps_name = 'tagedit'; |
|
| 41 | - $form_name = _AM_SOBJECT_TAG_EDIT; |
|
| 42 | - $submit_button_caption = null; |
|
| 43 | - $tagObj->stripMultilanguageFields(); |
|
| 44 | - } |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - //smart_adminMenu(2, $breadcrumb); |
|
| 48 | - |
|
| 49 | - smart_collapsableBar($collaps_name, $title, $info); |
|
| 50 | - |
|
| 51 | - $sform = $tagObj->getForm($form_name, 'addtag', false, $submit_button_caption); |
|
| 52 | - $sform->display(); |
|
| 53 | - smart_close_collapsable($collaps_name); |
|
| 15 | + global $smartobjectTagHandler; |
|
| 16 | + |
|
| 17 | + $tagObj = $smartobjectTagHandler->get($tagid); |
|
| 18 | + |
|
| 19 | + if ($tagObj->isNew()) { |
|
| 20 | + $breadcrumb = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_TAG_CREATE; |
|
| 21 | + $title = _AM_SOBJECT_TAG_CREATE; |
|
| 22 | + $info = _AM_SOBJECT_TAG_CREATE_INFO; |
|
| 23 | + $collaps_name = 'tagcreate'; |
|
| 24 | + $form_name = _AM_SOBJECT_TAG_CREATE; |
|
| 25 | + $submit_button_caption = null; |
|
| 26 | + //$tagObj->stripMultilanguageFields(); |
|
| 27 | + } else { |
|
| 28 | + if ($language) { |
|
| 29 | + $breadcrumb = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_TAG_EDITING_LANGUAGE; |
|
| 30 | + $title = _AM_SOBJECT_TAG_EDIT_LANGUAGE; |
|
| 31 | + $info = _AM_SOBJECT_TAG_EDIT_LANGUAGE_INFO; |
|
| 32 | + $collaps_name = 'tageditlanguage'; |
|
| 33 | + $form_name = _AM_SOBJECT_TAG_EDIT_LANGUAGE; |
|
| 34 | + $submit_button_caption = null; |
|
| 35 | + $tagObj->makeNonMLFieldReadOnly(); |
|
| 36 | + } else { |
|
| 37 | + $breadcrumb = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_EDITING; |
|
| 38 | + $title = _AM_SOBJECT_TAG_EDIT; |
|
| 39 | + $info = _AM_SOBJECT_TAG_EDIT_INFO; |
|
| 40 | + $collaps_name = 'tagedit'; |
|
| 41 | + $form_name = _AM_SOBJECT_TAG_EDIT; |
|
| 42 | + $submit_button_caption = null; |
|
| 43 | + $tagObj->stripMultilanguageFields(); |
|
| 44 | + } |
|
| 45 | + } |
|
| 46 | + |
|
| 47 | + //smart_adminMenu(2, $breadcrumb); |
|
| 48 | + |
|
| 49 | + smart_collapsableBar($collaps_name, $title, $info); |
|
| 50 | + |
|
| 51 | + $sform = $tagObj->getForm($form_name, 'addtag', false, $submit_button_caption); |
|
| 52 | + $sform->display(); |
|
| 53 | + smart_close_collapsable($collaps_name); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | include_once __DIR__ . '/admin_header.php'; |
@@ -62,10 +62,10 @@ discard block |
||
| 62 | 62 | $op = ''; |
| 63 | 63 | |
| 64 | 64 | if (isset($_GET['op'])) { |
| 65 | - $op = $_GET['op']; |
|
| 65 | + $op = $_GET['op']; |
|
| 66 | 66 | } |
| 67 | 67 | if (isset($_POST['op'])) { |
| 68 | - $op = $_POST['op']; |
|
| 68 | + $op = $_POST['op']; |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | $tagid = isset($_GET['tagid']) ? $_GET['tagid'] : 0; |
@@ -74,66 +74,66 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | switch ($op) { |
| 76 | 76 | |
| 77 | - case 'del': |
|
| 78 | - include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 79 | - $controller = new SmartObjectController($smartobjectTagHandler); |
|
| 80 | - $controller->handleObjectDeletion(_AM_SOBJECT_TAG_DELETE_CONFIRM); |
|
| 77 | + case 'del': |
|
| 78 | + include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 79 | + $controller = new SmartObjectController($smartobjectTagHandler); |
|
| 80 | + $controller->handleObjectDeletion(_AM_SOBJECT_TAG_DELETE_CONFIRM); |
|
| 81 | 81 | |
| 82 | - break; |
|
| 82 | + break; |
|
| 83 | 83 | |
| 84 | - case 'addtag': |
|
| 85 | - include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 86 | - $controller = new SmartObjectController($smartobjectTagHandler); |
|
| 87 | - $tagObj = $controller->storeSmartObject(); |
|
| 88 | - if ($tagObj->hasError()) { |
|
| 89 | - redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $tagObj->getHtmlErrors()); |
|
| 90 | - exit; |
|
| 91 | - } |
|
| 84 | + case 'addtag': |
|
| 85 | + include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 86 | + $controller = new SmartObjectController($smartobjectTagHandler); |
|
| 87 | + $tagObj = $controller->storeSmartObject(); |
|
| 88 | + if ($tagObj->hasError()) { |
|
| 89 | + redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $tagObj->getHtmlErrors()); |
|
| 90 | + exit; |
|
| 91 | + } |
|
| 92 | 92 | |
| 93 | - if ($tagObj->hasError()) { |
|
| 94 | - redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $tagObj->getHtmlErrors()); |
|
| 95 | - } else { |
|
| 96 | - redirect_header(smart_get_page_before_form(), 3, _CO_SOBJECT_SAVE_SUCCESS); |
|
| 97 | - } |
|
| 98 | - exit; |
|
| 99 | - break; |
|
| 93 | + if ($tagObj->hasError()) { |
|
| 94 | + redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $tagObj->getHtmlErrors()); |
|
| 95 | + } else { |
|
| 96 | + redirect_header(smart_get_page_before_form(), 3, _CO_SOBJECT_SAVE_SUCCESS); |
|
| 97 | + } |
|
| 98 | + exit; |
|
| 99 | + break; |
|
| 100 | 100 | |
| 101 | - case 'mod': |
|
| 102 | - smart_xoops_cp_header(); |
|
| 103 | - edittag($tagid, $language, $fct); |
|
| 104 | - break; |
|
| 101 | + case 'mod': |
|
| 102 | + smart_xoops_cp_header(); |
|
| 103 | + edittag($tagid, $language, $fct); |
|
| 104 | + break; |
|
| 105 | 105 | |
| 106 | - default: |
|
| 106 | + default: |
|
| 107 | 107 | |
| 108 | - smart_xoops_cp_header(); |
|
| 108 | + smart_xoops_cp_header(); |
|
| 109 | 109 | |
| 110 | - //smart_adminMenu(2, _AM_SOBJECT_TAGS); |
|
| 110 | + //smart_adminMenu(2, _AM_SOBJECT_TAGS); |
|
| 111 | 111 | |
| 112 | - smart_collapsableBar('tags', _AM_SOBJECT_TAGS, _AM_SOBJECT_TAGS_INFO); |
|
| 112 | + smart_collapsableBar('tags', _AM_SOBJECT_TAGS, _AM_SOBJECT_TAGS_INFO); |
|
| 113 | 113 | |
| 114 | - include_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 115 | - $objectTable = new SmartObjectTable($smartobjectTagHandler, false, array('delete')); |
|
| 116 | - $objectTable->addColumn(new SmartObjectColumn('name')); |
|
| 117 | - $objectTable->addColumn(new SmartObjectColumn('language')); |
|
| 118 | - $objectTable->addColumn(new SmartObjectColumn('value')); |
|
| 119 | - // $objectTable->addColumn(new SmartObjectColumn(_AM_SOBJECT_SENT_TAGS_FROM, $align='left', $width=false, 'getFromInfo')); |
|
| 114 | + include_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 115 | + $objectTable = new SmartObjectTable($smartobjectTagHandler, false, array('delete')); |
|
| 116 | + $objectTable->addColumn(new SmartObjectColumn('name')); |
|
| 117 | + $objectTable->addColumn(new SmartObjectColumn('language')); |
|
| 118 | + $objectTable->addColumn(new SmartObjectColumn('value')); |
|
| 119 | + // $objectTable->addColumn(new SmartObjectColumn(_AM_SOBJECT_SENT_TAGS_FROM, $align='left', $width=false, 'getFromInfo')); |
|
| 120 | 120 | |
| 121 | - $objectTable->addFilter('language', 'getLanguages'); |
|
| 121 | + $objectTable->addFilter('language', 'getLanguages'); |
|
| 122 | 122 | |
| 123 | - $objectTable->addCustomAction('getEditLanguageLink'); |
|
| 124 | - $objectTable->addCustomAction('getEditItemLink'); |
|
| 123 | + $objectTable->addCustomAction('getEditLanguageLink'); |
|
| 124 | + $objectTable->addCustomAction('getEditItemLink'); |
|
| 125 | 125 | |
| 126 | - $objectTable->setDefaultSort('tagid'); |
|
| 126 | + $objectTable->setDefaultSort('tagid'); |
|
| 127 | 127 | |
| 128 | - $objectTable->addIntroButton('addtag', 'tag.php?op=mod', _AM_SOBJECT_TAG_CREATE); |
|
| 128 | + $objectTable->addIntroButton('addtag', 'tag.php?op=mod', _AM_SOBJECT_TAG_CREATE); |
|
| 129 | 129 | |
| 130 | - $objectTable->render(); |
|
| 130 | + $objectTable->render(); |
|
| 131 | 131 | |
| 132 | - echo '<br>'; |
|
| 133 | - smart_close_collapsable('tags'); |
|
| 134 | - echo '<br>'; |
|
| 132 | + echo '<br>'; |
|
| 133 | + smart_close_collapsable('tags'); |
|
| 134 | + echo '<br>'; |
|
| 135 | 135 | |
| 136 | - break; |
|
| 136 | + break; |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | //smart_modFooter(); |
@@ -21,81 +21,81 @@ |
||
| 21 | 21 | $op = ''; |
| 22 | 22 | |
| 23 | 23 | if (isset($_GET['op'])) { |
| 24 | - $op = $_GET['op']; |
|
| 24 | + $op = $_GET['op']; |
|
| 25 | 25 | } |
| 26 | 26 | if (isset($_POST['op'])) { |
| 27 | - $op = $_POST['op']; |
|
| 27 | + $op = $_POST['op']; |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | switch ($op) { |
| 31 | 31 | |
| 32 | - case 'del': |
|
| 33 | - include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 34 | - $controller = new SmartObjectController($smartobjectLinkHandler); |
|
| 35 | - $controller->handleObjectDeletion(_AM_SOBJECT_SENT_LINK_DELETE_CONFIRM); |
|
| 32 | + case 'del': |
|
| 33 | + include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 34 | + $controller = new SmartObjectController($smartobjectLinkHandler); |
|
| 35 | + $controller->handleObjectDeletion(_AM_SOBJECT_SENT_LINK_DELETE_CONFIRM); |
|
| 36 | 36 | |
| 37 | - break; |
|
| 37 | + break; |
|
| 38 | 38 | |
| 39 | - case 'view': |
|
| 40 | - $linkid = isset($_GET['linkid']) ? $_GET['linkid'] : 0; |
|
| 41 | - $linkObj = $smartobjectLinkHandler->get($linkid); |
|
| 39 | + case 'view': |
|
| 40 | + $linkid = isset($_GET['linkid']) ? $_GET['linkid'] : 0; |
|
| 41 | + $linkObj = $smartobjectLinkHandler->get($linkid); |
|
| 42 | 42 | |
| 43 | - if ($linkObj->isNew()) { |
|
| 44 | - redirect_header(SMARTOBJECT_URL . 'admin/link.php', 3, _AM_SOBJECT_LINK_NOT_FOUND); |
|
| 45 | - } |
|
| 43 | + if ($linkObj->isNew()) { |
|
| 44 | + redirect_header(SMARTOBJECT_URL . 'admin/link.php', 3, _AM_SOBJECT_LINK_NOT_FOUND); |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - smart_xoops_cp_header(); |
|
| 47 | + smart_xoops_cp_header(); |
|
| 48 | 48 | |
| 49 | - //smart_adminMenu(1, _AM_SOBJECT_SENT_LINK_DISPLAY); |
|
| 49 | + //smart_adminMenu(1, _AM_SOBJECT_SENT_LINK_DISPLAY); |
|
| 50 | 50 | |
| 51 | - smart_collapsableBar('sentlinks', _AM_SOBJECT_SENT_LINK_DISPLAY, _AM_SOBJECT_SENT_LINK_DISPLAY_INFO); |
|
| 51 | + smart_collapsableBar('sentlinks', _AM_SOBJECT_SENT_LINK_DISPLAY, _AM_SOBJECT_SENT_LINK_DISPLAY_INFO); |
|
| 52 | 52 | |
| 53 | - include_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 53 | + include_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 54 | 54 | |
| 55 | - // --- |
|
| 56 | - // 2012-01-01 PHP 5.3: Assigning the return value of new by reference is now deprecated. |
|
| 57 | - // $xoopsTpl = new XoopsTpl(); |
|
| 58 | - $xoopsTpl = new XoopsTpl(); |
|
| 59 | - //--- |
|
| 55 | + // --- |
|
| 56 | + // 2012-01-01 PHP 5.3: Assigning the return value of new by reference is now deprecated. |
|
| 57 | + // $xoopsTpl = new XoopsTpl(); |
|
| 58 | + $xoopsTpl = new XoopsTpl(); |
|
| 59 | + //--- |
|
| 60 | 60 | |
| 61 | - $xoopsTpl->assign('link', $linkObj->toArray()); |
|
| 62 | - $xoopsTpl->display('db:smartobject_sentlink_display.tpl'); |
|
| 61 | + $xoopsTpl->assign('link', $linkObj->toArray()); |
|
| 62 | + $xoopsTpl->display('db:smartobject_sentlink_display.tpl'); |
|
| 63 | 63 | |
| 64 | - echo '<br>'; |
|
| 65 | - smart_close_collapsable('sentlinks'); |
|
| 66 | - echo '<br>'; |
|
| 64 | + echo '<br>'; |
|
| 65 | + smart_close_collapsable('sentlinks'); |
|
| 66 | + echo '<br>'; |
|
| 67 | 67 | |
| 68 | - break; |
|
| 68 | + break; |
|
| 69 | 69 | |
| 70 | - default: |
|
| 70 | + default: |
|
| 71 | 71 | |
| 72 | - smart_xoops_cp_header(); |
|
| 72 | + smart_xoops_cp_header(); |
|
| 73 | 73 | |
| 74 | - echo $indexAdmin->addNavigation(basename(__FILE__)); |
|
| 74 | + echo $indexAdmin->addNavigation(basename(__FILE__)); |
|
| 75 | 75 | |
| 76 | - //smart_adminMenu(1, _AM_SOBJECT_SENT_LINKS); |
|
| 76 | + //smart_adminMenu(1, _AM_SOBJECT_SENT_LINKS); |
|
| 77 | 77 | |
| 78 | - smart_collapsableBar('sentlinks', _AM_SOBJECT_SENT_LINKS, _AM_SOBJECT_SENT_LINKS_INFO); |
|
| 78 | + smart_collapsableBar('sentlinks', _AM_SOBJECT_SENT_LINKS, _AM_SOBJECT_SENT_LINKS_INFO); |
|
| 79 | 79 | |
| 80 | - include_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 81 | - $objectTable = new SmartObjectTable($smartobjectLinkHandler, null, array('delete')); |
|
| 82 | - $objectTable->addColumn(new SmartObjectColumn('date')); |
|
| 83 | - $objectTable->addColumn(new SmartObjectColumn(_AM_SOBJECT_SENT_LINKS_FROM, $align = 'left', $width = false, 'getFromInfo')); |
|
| 84 | - $objectTable->addColumn(new SmartObjectColumn(_AM_SOBJECT_SENT_LINKS_TO, $align = 'left', $width = false, 'getToInfo')); |
|
| 85 | - $objectTable->addColumn(new SmartObjectColumn('link')); |
|
| 80 | + include_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 81 | + $objectTable = new SmartObjectTable($smartobjectLinkHandler, null, array('delete')); |
|
| 82 | + $objectTable->addColumn(new SmartObjectColumn('date')); |
|
| 83 | + $objectTable->addColumn(new SmartObjectColumn(_AM_SOBJECT_SENT_LINKS_FROM, $align = 'left', $width = false, 'getFromInfo')); |
|
| 84 | + $objectTable->addColumn(new SmartObjectColumn(_AM_SOBJECT_SENT_LINKS_TO, $align = 'left', $width = false, 'getToInfo')); |
|
| 85 | + $objectTable->addColumn(new SmartObjectColumn('link')); |
|
| 86 | 86 | |
| 87 | - $objectTable->addCustomAction('getViewItemLink'); |
|
| 87 | + $objectTable->addCustomAction('getViewItemLink'); |
|
| 88 | 88 | |
| 89 | - $objectTable->setDefaultSort('date'); |
|
| 90 | - $objectTable->setDefaultOrder('DESC'); |
|
| 89 | + $objectTable->setDefaultSort('date'); |
|
| 90 | + $objectTable->setDefaultOrder('DESC'); |
|
| 91 | 91 | |
| 92 | - $objectTable->render(); |
|
| 92 | + $objectTable->render(); |
|
| 93 | 93 | |
| 94 | - echo '<br>'; |
|
| 95 | - smart_close_collapsable('sentlinks'); |
|
| 96 | - echo '<br>'; |
|
| 94 | + echo '<br>'; |
|
| 95 | + smart_close_collapsable('sentlinks'); |
|
| 96 | + echo '<br>'; |
|
| 97 | 97 | |
| 98 | - break; |
|
| 98 | + break; |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | //smart_modFooter(); |
@@ -12,32 +12,32 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | function editclass($showmenu = false, $adsenseid = 0, $clone = false) |
| 14 | 14 | { |
| 15 | - global $smartobjectAdsenseHandler; |
|
| 16 | - |
|
| 17 | - $adsenseObj = $smartobjectAdsenseHandler->get($adsenseid); |
|
| 18 | - |
|
| 19 | - if (!$clone && !$adsenseObj->isNew()) { |
|
| 20 | - if ($showmenu) { |
|
| 21 | - //smart_adminMenu(3, _AM_SOBJECT_ADSENSES . " > " . _AM_SOBJECT_EDITING); |
|
| 22 | - } |
|
| 23 | - smart_collapsableBar('adsenseedit', _AM_SOBJECT_ADSENSES_EDIT, _AM_SOBJECT_ADSENSES_EDIT_INFO); |
|
| 24 | - |
|
| 25 | - $sform = $adsenseObj->getForm(_AM_SOBJECT_ADSENSES_EDIT, 'addadsense'); |
|
| 26 | - $sform->display(); |
|
| 27 | - smart_close_collapsable('adsenseedit'); |
|
| 28 | - } else { |
|
| 29 | - $adsenseObj->setVar('adsenseid', 0); |
|
| 30 | - $adsenseObj->setVar('tag', ''); |
|
| 31 | - |
|
| 32 | - if ($showmenu) { |
|
| 33 | - //smart_adminMenu(3, _AM_SOBJECT_ADSENSES . " > " . _CO_SOBJECT_CREATINGNEW); |
|
| 34 | - } |
|
| 35 | - |
|
| 36 | - smart_collapsableBar('adsensecreate', _AM_SOBJECT_ADSENSES_CREATE, _AM_SOBJECT_ADSENSES_CREATE_INFO); |
|
| 37 | - $sform = $adsenseObj->getForm(_AM_SOBJECT_ADSENSES_CREATE, 'addadsense', false, false, false, true); |
|
| 38 | - $sform->display(); |
|
| 39 | - smart_close_collapsable('adsensecreate'); |
|
| 40 | - } |
|
| 15 | + global $smartobjectAdsenseHandler; |
|
| 16 | + |
|
| 17 | + $adsenseObj = $smartobjectAdsenseHandler->get($adsenseid); |
|
| 18 | + |
|
| 19 | + if (!$clone && !$adsenseObj->isNew()) { |
|
| 20 | + if ($showmenu) { |
|
| 21 | + //smart_adminMenu(3, _AM_SOBJECT_ADSENSES . " > " . _AM_SOBJECT_EDITING); |
|
| 22 | + } |
|
| 23 | + smart_collapsableBar('adsenseedit', _AM_SOBJECT_ADSENSES_EDIT, _AM_SOBJECT_ADSENSES_EDIT_INFO); |
|
| 24 | + |
|
| 25 | + $sform = $adsenseObj->getForm(_AM_SOBJECT_ADSENSES_EDIT, 'addadsense'); |
|
| 26 | + $sform->display(); |
|
| 27 | + smart_close_collapsable('adsenseedit'); |
|
| 28 | + } else { |
|
| 29 | + $adsenseObj->setVar('adsenseid', 0); |
|
| 30 | + $adsenseObj->setVar('tag', ''); |
|
| 31 | + |
|
| 32 | + if ($showmenu) { |
|
| 33 | + //smart_adminMenu(3, _AM_SOBJECT_ADSENSES . " > " . _CO_SOBJECT_CREATINGNEW); |
|
| 34 | + } |
|
| 35 | + |
|
| 36 | + smart_collapsableBar('adsensecreate', _AM_SOBJECT_ADSENSES_CREATE, _AM_SOBJECT_ADSENSES_CREATE_INFO); |
|
| 37 | + $sform = $adsenseObj->getForm(_AM_SOBJECT_ADSENSES_CREATE, 'addadsense', false, false, false, true); |
|
| 38 | + $sform->display(); |
|
| 39 | + smart_close_collapsable('adsensecreate'); |
|
| 40 | + } |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | include_once __DIR__ . '/admin_header.php'; |
@@ -50,73 +50,73 @@ discard block |
||
| 50 | 50 | $op = ''; |
| 51 | 51 | |
| 52 | 52 | if (isset($_GET['op'])) { |
| 53 | - $op = $_GET['op']; |
|
| 53 | + $op = $_GET['op']; |
|
| 54 | 54 | } |
| 55 | 55 | if (isset($_POST['op'])) { |
| 56 | - $op = $_POST['op']; |
|
| 56 | + $op = $_POST['op']; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | switch ($op) { |
| 60 | - case 'mod': |
|
| 60 | + case 'mod': |
|
| 61 | 61 | |
| 62 | - $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0; |
|
| 62 | + $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0; |
|
| 63 | 63 | |
| 64 | - smart_xoops_cp_header(); |
|
| 65 | - echo $indexAdmin->addNavigation(basename(__FILE__)); |
|
| 64 | + smart_xoops_cp_header(); |
|
| 65 | + echo $indexAdmin->addNavigation(basename(__FILE__)); |
|
| 66 | 66 | |
| 67 | - editclass(true, $adsenseid); |
|
| 68 | - break; |
|
| 67 | + editclass(true, $adsenseid); |
|
| 68 | + break; |
|
| 69 | 69 | |
| 70 | - case 'clone': |
|
| 70 | + case 'clone': |
|
| 71 | 71 | |
| 72 | - $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0; |
|
| 72 | + $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0; |
|
| 73 | 73 | |
| 74 | - smart_xoops_cp_header(); |
|
| 75 | - echo $indexAdmin->addNavigation(basename(__FILE__)); |
|
| 74 | + smart_xoops_cp_header(); |
|
| 75 | + echo $indexAdmin->addNavigation(basename(__FILE__)); |
|
| 76 | 76 | |
| 77 | - editclass(true, $adsenseid, true); |
|
| 78 | - break; |
|
| 77 | + editclass(true, $adsenseid, true); |
|
| 78 | + break; |
|
| 79 | 79 | |
| 80 | - case 'addadsense': |
|
| 81 | - if (@include_once SMARTOBJECT_ROOT_PATH . 'include/captcha/captcha.php') { |
|
| 82 | - $xoopsCaptcha = XoopsCaptcha::getInstance(); |
|
| 83 | - if (!$xoopsCaptcha->verify()) { |
|
| 84 | - redirect_header('javascript:history.go(-1);', 3, $xoopsCaptcha->getMessage()); |
|
| 85 | - exit; |
|
| 86 | - } |
|
| 87 | - } |
|
| 88 | - include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 89 | - $controller = new SmartObjectController($smartobjectAdsenseHandler); |
|
| 90 | - $controller->storeFromDefaultForm(_AM_SOBJECT_ADSENSES_CREATED, _AM_SOBJECT_ADSENSES_MODIFIED); |
|
| 91 | - break; |
|
| 80 | + case 'addadsense': |
|
| 81 | + if (@include_once SMARTOBJECT_ROOT_PATH . 'include/captcha/captcha.php') { |
|
| 82 | + $xoopsCaptcha = XoopsCaptcha::getInstance(); |
|
| 83 | + if (!$xoopsCaptcha->verify()) { |
|
| 84 | + redirect_header('javascript:history.go(-1);', 3, $xoopsCaptcha->getMessage()); |
|
| 85 | + exit; |
|
| 86 | + } |
|
| 87 | + } |
|
| 88 | + include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 89 | + $controller = new SmartObjectController($smartobjectAdsenseHandler); |
|
| 90 | + $controller->storeFromDefaultForm(_AM_SOBJECT_ADSENSES_CREATED, _AM_SOBJECT_ADSENSES_MODIFIED); |
|
| 91 | + break; |
|
| 92 | 92 | |
| 93 | - case 'del': |
|
| 93 | + case 'del': |
|
| 94 | 94 | |
| 95 | - include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 96 | - $controller = new SmartObjectController($smartobjectAdsenseHandler); |
|
| 97 | - $controller->handleObjectDeletion(); |
|
| 95 | + include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 96 | + $controller = new SmartObjectController($smartobjectAdsenseHandler); |
|
| 97 | + $controller->handleObjectDeletion(); |
|
| 98 | 98 | |
| 99 | - break; |
|
| 99 | + break; |
|
| 100 | 100 | |
| 101 | - default: |
|
| 101 | + default: |
|
| 102 | 102 | |
| 103 | - smart_xoops_cp_header(); |
|
| 104 | - echo $indexAdmin->addNavigation(basename(__FILE__)); |
|
| 103 | + smart_xoops_cp_header(); |
|
| 104 | + echo $indexAdmin->addNavigation(basename(__FILE__)); |
|
| 105 | 105 | |
| 106 | - //smart_adminMenu(3, _AM_SOBJECT_ADSENSES); |
|
| 106 | + //smart_adminMenu(3, _AM_SOBJECT_ADSENSES); |
|
| 107 | 107 | |
| 108 | - smart_collapsableBar('createdadsenses', _AM_SOBJECT_ADSENSES, _AM_SOBJECT_ADSENSES_DSC); |
|
| 108 | + smart_collapsableBar('createdadsenses', _AM_SOBJECT_ADSENSES, _AM_SOBJECT_ADSENSES_DSC); |
|
| 109 | 109 | |
| 110 | - include_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 111 | - $objectTable = new SmartObjectTable($smartobjectAdsenseHandler); |
|
| 112 | - $objectTable->addColumn(new SmartObjectColumn('description', 'left')); |
|
| 113 | - $objectTable->addColumn(new SmartObjectColumn(_AM_SOBJECT_ADSENSE_TAG, 'center', 200, 'getXoopsCode')); |
|
| 110 | + include_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 111 | + $objectTable = new SmartObjectTable($smartobjectAdsenseHandler); |
|
| 112 | + $objectTable->addColumn(new SmartObjectColumn('description', 'left')); |
|
| 113 | + $objectTable->addColumn(new SmartObjectColumn(_AM_SOBJECT_ADSENSE_TAG, 'center', 200, 'getXoopsCode')); |
|
| 114 | 114 | |
| 115 | - // $objectTable->addCustomAction('getCreateItemLink'); |
|
| 116 | - // $objectTable->addCustomAction('getCreateAttributLink'); |
|
| 115 | + // $objectTable->addCustomAction('getCreateItemLink'); |
|
| 116 | + // $objectTable->addCustomAction('getCreateAttributLink'); |
|
| 117 | 117 | |
| 118 | - $objectTable->addIntroButton('addadsense', 'adsense.php?op=mod', _AM_SOBJECT_ADSENSES_CREATE); |
|
| 119 | - /* |
|
| 118 | + $objectTable->addIntroButton('addadsense', 'adsense.php?op=mod', _AM_SOBJECT_ADSENSES_CREATE); |
|
| 119 | + /* |
|
| 120 | 120 | $criteria_upcoming = new CriteriaCompo(); |
| 121 | 121 | $criteria_upcoming->add(new Criteria('start_date', time(), '>')); |
| 122 | 122 | $objectTable->addFilter(_AM_SOBJECT_FILTER_UPCOMING, array( |
@@ -140,16 +140,16 @@ discard block |
||
| 140 | 140 | 'criteria' => $criteria_last30days |
| 141 | 141 | )); |
| 142 | 142 | */ |
| 143 | - $objectTable->addQuickSearch(array('title', 'summary', 'description')); |
|
| 144 | - $objectTable->addCustomAction('getCloneLink'); |
|
| 143 | + $objectTable->addQuickSearch(array('title', 'summary', 'description')); |
|
| 144 | + $objectTable->addCustomAction('getCloneLink'); |
|
| 145 | 145 | |
| 146 | - $objectTable->render(); |
|
| 146 | + $objectTable->render(); |
|
| 147 | 147 | |
| 148 | - echo '<br>'; |
|
| 149 | - smart_close_collapsable('createdadsenses'); |
|
| 150 | - echo '<br>'; |
|
| 148 | + echo '<br>'; |
|
| 149 | + smart_close_collapsable('createdadsenses'); |
|
| 150 | + echo '<br>'; |
|
| 151 | 151 | |
| 152 | - break; |
|
| 152 | + break; |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | //smart_modFooter(); |