@@ -10,29 +10,29 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | function editclass($showmenu = false, $currencyid = 0) |
| 12 | 12 | { |
| 13 | - global $smartobjectCurrencyHandler; |
|
| 14 | - |
|
| 15 | - $currencyObj = $smartobjectCurrencyHandler->get($currencyid); |
|
| 16 | - |
|
| 17 | - if (!$currencyObj->isNew()) { |
|
| 18 | - if ($showmenu) { |
|
| 19 | - //smart_adminMenu(5, _AM_SOBJECT_CURRENCIES . " > " . _AM_SOBJECT_EDITING); |
|
| 20 | - } |
|
| 21 | - smart_collapsableBar('currencyedit', _AM_SOBJECT_CURRENCIES_EDIT, _AM_SOBJECT_CURRENCIES_EDIT_INFO); |
|
| 22 | - |
|
| 23 | - $sform = $currencyObj->getForm(_AM_SOBJECT_CURRENCIES_EDIT, 'addcurrency'); |
|
| 24 | - $sform->display(); |
|
| 25 | - smart_close_collapsable('currencyedit'); |
|
| 26 | - } else { |
|
| 27 | - if ($showmenu) { |
|
| 28 | - //smart_adminMenu(5, _AM_SOBJECT_CURRENCIES . " > " . _CO_SOBJECT_CREATINGNEW); |
|
| 29 | - } |
|
| 30 | - |
|
| 31 | - smart_collapsableBar('currencycreate', _AM_SOBJECT_CURRENCIES_CREATE, _AM_SOBJECT_CURRENCIES_CREATE_INFO); |
|
| 32 | - $sform = $currencyObj->getForm(_AM_SOBJECT_CURRENCIES_CREATE, 'addcurrency'); |
|
| 33 | - $sform->display(); |
|
| 34 | - smart_close_collapsable('currencycreate'); |
|
| 35 | - } |
|
| 13 | + global $smartobjectCurrencyHandler; |
|
| 14 | + |
|
| 15 | + $currencyObj = $smartobjectCurrencyHandler->get($currencyid); |
|
| 16 | + |
|
| 17 | + if (!$currencyObj->isNew()) { |
|
| 18 | + if ($showmenu) { |
|
| 19 | + //smart_adminMenu(5, _AM_SOBJECT_CURRENCIES . " > " . _AM_SOBJECT_EDITING); |
|
| 20 | + } |
|
| 21 | + smart_collapsableBar('currencyedit', _AM_SOBJECT_CURRENCIES_EDIT, _AM_SOBJECT_CURRENCIES_EDIT_INFO); |
|
| 22 | + |
|
| 23 | + $sform = $currencyObj->getForm(_AM_SOBJECT_CURRENCIES_EDIT, 'addcurrency'); |
|
| 24 | + $sform->display(); |
|
| 25 | + smart_close_collapsable('currencyedit'); |
|
| 26 | + } else { |
|
| 27 | + if ($showmenu) { |
|
| 28 | + //smart_adminMenu(5, _AM_SOBJECT_CURRENCIES . " > " . _CO_SOBJECT_CREATINGNEW); |
|
| 29 | + } |
|
| 30 | + |
|
| 31 | + smart_collapsableBar('currencycreate', _AM_SOBJECT_CURRENCIES_CREATE, _AM_SOBJECT_CURRENCIES_CREATE_INFO); |
|
| 32 | + $sform = $currencyObj->getForm(_AM_SOBJECT_CURRENCIES_CREATE, 'addcurrency'); |
|
| 33 | + $sform->display(); |
|
| 34 | + smart_close_collapsable('currencycreate'); |
|
| 35 | + } |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | require_once __DIR__ . '/admin_header.php'; |
@@ -43,36 +43,36 @@ discard block |
||
| 43 | 43 | $op = ''; |
| 44 | 44 | |
| 45 | 45 | if (isset($_GET['op'])) { |
| 46 | - $op = $_GET['op']; |
|
| 46 | + $op = $_GET['op']; |
|
| 47 | 47 | } |
| 48 | 48 | if (isset($_POST['op'])) { |
| 49 | - $op = $_POST['op']; |
|
| 49 | + $op = $_POST['op']; |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | switch ($op) { |
| 53 | - case 'mod': |
|
| 54 | - $currencyid = isset($_GET['currencyid']) ? (int)$_GET['currencyid'] : 0; |
|
| 53 | + case 'mod': |
|
| 54 | + $currencyid = isset($_GET['currencyid']) ? (int)$_GET['currencyid'] : 0; |
|
| 55 | 55 | |
| 56 | - smart_xoops_cp_header(); |
|
| 56 | + smart_xoops_cp_header(); |
|
| 57 | 57 | |
| 58 | - editclass(true, $currencyid); |
|
| 59 | - break; |
|
| 58 | + editclass(true, $currencyid); |
|
| 59 | + break; |
|
| 60 | 60 | |
| 61 | - case 'updateCurrencies': |
|
| 61 | + case 'updateCurrencies': |
|
| 62 | 62 | |
| 63 | - if (!isset($_POST['SmartobjectCurrency_objects']) || count($_POST['SmartobjectCurrency_objects']) == 0) { |
|
| 64 | - redirect_header($smart_previous_page, 3, _AM_SOBJECT_NO_RECORDS_TO_UPDATE); |
|
| 65 | - } |
|
| 63 | + if (!isset($_POST['SmartobjectCurrency_objects']) || count($_POST['SmartobjectCurrency_objects']) == 0) { |
|
| 64 | + redirect_header($smart_previous_page, 3, _AM_SOBJECT_NO_RECORDS_TO_UPDATE); |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | - if (isset($_POST['default_currency'])) { |
|
| 68 | - $newDefaultCurrency = $_POST['default_currency']; |
|
| 69 | - $sql = 'UPDATE ' . $smartobjectCurrencyHandler->table . ' SET default_currency=0'; |
|
| 70 | - $smartobjectCurrencyHandler->query($sql); |
|
| 71 | - $sql = 'UPDATE ' . $smartobjectCurrencyHandler->table . ' SET default_currency=1 WHERE currencyid=' . $newDefaultCurrency; |
|
| 72 | - $smartobjectCurrencyHandler->query($sql); |
|
| 73 | - } |
|
| 67 | + if (isset($_POST['default_currency'])) { |
|
| 68 | + $newDefaultCurrency = $_POST['default_currency']; |
|
| 69 | + $sql = 'UPDATE ' . $smartobjectCurrencyHandler->table . ' SET default_currency=0'; |
|
| 70 | + $smartobjectCurrencyHandler->query($sql); |
|
| 71 | + $sql = 'UPDATE ' . $smartobjectCurrencyHandler->table . ' SET default_currency=1 WHERE currencyid=' . $newDefaultCurrency; |
|
| 72 | + $smartobjectCurrencyHandler->query($sql); |
|
| 73 | + } |
|
| 74 | 74 | |
| 75 | - /* |
|
| 75 | + /* |
|
| 76 | 76 | $criteria = new CriteriaCompo(); |
| 77 | 77 | $criteria->add(new Criteria('currencyid', '(' . implode(', ', $_POST['SmartobjectCurrency_objects']) . ')', 'IN')); |
| 78 | 78 | $currenciesObj = $smartobjectCurrencyHandler->getObjects($criteria, true); |
@@ -82,49 +82,49 @@ discard block |
||
| 82 | 82 | $smartobjectCurrencyHandler->insert($currencyObj); |
| 83 | 83 | } |
| 84 | 84 | */ |
| 85 | - redirect_header($smart_previous_page, 3, _AM_SOBJECT_RECORDS_UPDATED); |
|
| 86 | - break; |
|
| 85 | + redirect_header($smart_previous_page, 3, _AM_SOBJECT_RECORDS_UPDATED); |
|
| 86 | + break; |
|
| 87 | 87 | |
| 88 | - case 'addcurrency': |
|
| 89 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 90 | - $controller = new SmartObjectController($smartobjectCurrencyHandler); |
|
| 91 | - $controller->storeFromDefaultForm(_AM_SOBJECT_CURRENCIES_CREATED, _AM_SOBJECT_CURRENCIES_MODIFIED, SMARTOBJECT_URL . 'admin/currency.php'); |
|
| 88 | + case 'addcurrency': |
|
| 89 | + require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 90 | + $controller = new SmartObjectController($smartobjectCurrencyHandler); |
|
| 91 | + $controller->storeFromDefaultForm(_AM_SOBJECT_CURRENCIES_CREATED, _AM_SOBJECT_CURRENCIES_MODIFIED, SMARTOBJECT_URL . 'admin/currency.php'); |
|
| 92 | 92 | |
| 93 | - break; |
|
| 93 | + break; |
|
| 94 | 94 | |
| 95 | - case 'del': |
|
| 96 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 97 | - $controller = new SmartObjectController($smartobjectCurrencyHandler); |
|
| 98 | - $controller->handleObjectDeletion(); |
|
| 95 | + case 'del': |
|
| 96 | + require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 97 | + $controller = new SmartObjectController($smartobjectCurrencyHandler); |
|
| 98 | + $controller->handleObjectDeletion(); |
|
| 99 | 99 | |
| 100 | - break; |
|
| 100 | + break; |
|
| 101 | 101 | |
| 102 | - default: |
|
| 102 | + default: |
|
| 103 | 103 | |
| 104 | - smart_xoops_cp_header(); |
|
| 104 | + smart_xoops_cp_header(); |
|
| 105 | 105 | |
| 106 | - //smart_adminMenu(5, _AM_SOBJECT_CURRENCIES); |
|
| 106 | + //smart_adminMenu(5, _AM_SOBJECT_CURRENCIES); |
|
| 107 | 107 | |
| 108 | - smart_collapsableBar('createdcurrencies', _AM_SOBJECT_CURRENCIES, _AM_SOBJECT_CURRENCIES_DSC); |
|
| 108 | + smart_collapsableBar('createdcurrencies', _AM_SOBJECT_CURRENCIES, _AM_SOBJECT_CURRENCIES_DSC); |
|
| 109 | 109 | |
| 110 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 111 | - $objectTable = new SmartObjectTable($smartobjectCurrencyHandler); |
|
| 112 | - $objectTable->addColumn(new SmartObjectColumn('name', 'left', false, 'getCurrencyLink')); |
|
| 113 | - $objectTable->addColumn(new SmartObjectColumn('rate', 'center', 150)); |
|
| 114 | - $objectTable->addColumn(new SmartObjectColumn('iso4217', 'center', 150)); |
|
| 115 | - $objectTable->addColumn(new SmartObjectColumn('default_currency', 'center', 150, 'getDefaultCurrencyControl')); |
|
| 110 | + require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 111 | + $objectTable = new SmartObjectTable($smartobjectCurrencyHandler); |
|
| 112 | + $objectTable->addColumn(new SmartObjectColumn('name', 'left', false, 'getCurrencyLink')); |
|
| 113 | + $objectTable->addColumn(new SmartObjectColumn('rate', 'center', 150)); |
|
| 114 | + $objectTable->addColumn(new SmartObjectColumn('iso4217', 'center', 150)); |
|
| 115 | + $objectTable->addColumn(new SmartObjectColumn('default_currency', 'center', 150, 'getDefaultCurrencyControl')); |
|
| 116 | 116 | |
| 117 | - $objectTable->addIntroButton('addcurrency', 'currency.php?op=mod', _AM_SOBJECT_CURRENCIES_CREATE); |
|
| 117 | + $objectTable->addIntroButton('addcurrency', 'currency.php?op=mod', _AM_SOBJECT_CURRENCIES_CREATE); |
|
| 118 | 118 | |
| 119 | - $objectTable->addActionButton('updateCurrencies', _SUBMIT, _AM_SOBJECT_CURRENCY_UPDATE_ALL); |
|
| 119 | + $objectTable->addActionButton('updateCurrencies', _SUBMIT, _AM_SOBJECT_CURRENCY_UPDATE_ALL); |
|
| 120 | 120 | |
| 121 | - $objectTable->render(); |
|
| 121 | + $objectTable->render(); |
|
| 122 | 122 | |
| 123 | - echo '<br>'; |
|
| 124 | - smart_close_collapsable('createdcurrencies'); |
|
| 125 | - echo '<br>'; |
|
| 123 | + echo '<br>'; |
|
| 124 | + smart_close_collapsable('createdcurrencies'); |
|
| 125 | + echo '<br>'; |
|
| 126 | 126 | |
| 127 | - break; |
|
| 127 | + break; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | //smart_modFooter(); |
@@ -50,29 +50,29 @@ discard block |
||
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | switch ($op) { |
| 53 | - case 'mod': |
|
| 54 | - $currencyid = isset($_GET['currencyid']) ? (int)$_GET['currencyid'] : 0; |
|
| 53 | + case 'mod': |
|
| 54 | + $currencyid = isset($_GET['currencyid']) ? (int)$_GET['currencyid'] : 0; |
|
| 55 | 55 | |
| 56 | - smart_xoops_cp_header(); |
|
| 56 | + smart_xoops_cp_header(); |
|
| 57 | 57 | |
| 58 | - editclass(true, $currencyid); |
|
| 59 | - break; |
|
| 58 | + editclass(true, $currencyid); |
|
| 59 | + break; |
|
| 60 | 60 | |
| 61 | - case 'updateCurrencies': |
|
| 61 | + case 'updateCurrencies': |
|
| 62 | 62 | |
| 63 | - if (!isset($_POST['SmartobjectCurrency_objects']) || count($_POST['SmartobjectCurrency_objects']) == 0) { |
|
| 64 | - redirect_header($smart_previous_page, 3, _AM_SOBJECT_NO_RECORDS_TO_UPDATE); |
|
| 65 | - } |
|
| 63 | + if (!isset($_POST['SmartobjectCurrency_objects']) || count($_POST['SmartobjectCurrency_objects']) == 0) { |
|
| 64 | + redirect_header($smart_previous_page, 3, _AM_SOBJECT_NO_RECORDS_TO_UPDATE); |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | - if (isset($_POST['default_currency'])) { |
|
| 68 | - $newDefaultCurrency = $_POST['default_currency']; |
|
| 69 | - $sql = 'UPDATE ' . $smartobjectCurrencyHandler->table . ' SET default_currency=0'; |
|
| 70 | - $smartobjectCurrencyHandler->query($sql); |
|
| 71 | - $sql = 'UPDATE ' . $smartobjectCurrencyHandler->table . ' SET default_currency=1 WHERE currencyid=' . $newDefaultCurrency; |
|
| 72 | - $smartobjectCurrencyHandler->query($sql); |
|
| 73 | - } |
|
| 67 | + if (isset($_POST['default_currency'])) { |
|
| 68 | + $newDefaultCurrency = $_POST['default_currency']; |
|
| 69 | + $sql = 'UPDATE ' . $smartobjectCurrencyHandler->table . ' SET default_currency=0'; |
|
| 70 | + $smartobjectCurrencyHandler->query($sql); |
|
| 71 | + $sql = 'UPDATE ' . $smartobjectCurrencyHandler->table . ' SET default_currency=1 WHERE currencyid=' . $newDefaultCurrency; |
|
| 72 | + $smartobjectCurrencyHandler->query($sql); |
|
| 73 | + } |
|
| 74 | 74 | |
| 75 | - /* |
|
| 75 | + /* |
|
| 76 | 76 | $criteria = new CriteriaCompo(); |
| 77 | 77 | $criteria->add(new Criteria('currencyid', '(' . implode(', ', $_POST['SmartobjectCurrency_objects']) . ')', 'IN')); |
| 78 | 78 | $currenciesObj = $smartobjectCurrencyHandler->getObjects($criteria, true); |
@@ -82,49 +82,49 @@ discard block |
||
| 82 | 82 | $smartobjectCurrencyHandler->insert($currencyObj); |
| 83 | 83 | } |
| 84 | 84 | */ |
| 85 | - redirect_header($smart_previous_page, 3, _AM_SOBJECT_RECORDS_UPDATED); |
|
| 86 | - break; |
|
| 85 | + redirect_header($smart_previous_page, 3, _AM_SOBJECT_RECORDS_UPDATED); |
|
| 86 | + break; |
|
| 87 | 87 | |
| 88 | - case 'addcurrency': |
|
| 89 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 90 | - $controller = new SmartObjectController($smartobjectCurrencyHandler); |
|
| 91 | - $controller->storeFromDefaultForm(_AM_SOBJECT_CURRENCIES_CREATED, _AM_SOBJECT_CURRENCIES_MODIFIED, SMARTOBJECT_URL . 'admin/currency.php'); |
|
| 88 | + case 'addcurrency': |
|
| 89 | + require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 90 | + $controller = new SmartObjectController($smartobjectCurrencyHandler); |
|
| 91 | + $controller->storeFromDefaultForm(_AM_SOBJECT_CURRENCIES_CREATED, _AM_SOBJECT_CURRENCIES_MODIFIED, SMARTOBJECT_URL . 'admin/currency.php'); |
|
| 92 | 92 | |
| 93 | - break; |
|
| 93 | + break; |
|
| 94 | 94 | |
| 95 | - case 'del': |
|
| 96 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 97 | - $controller = new SmartObjectController($smartobjectCurrencyHandler); |
|
| 98 | - $controller->handleObjectDeletion(); |
|
| 95 | + case 'del': |
|
| 96 | + require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 97 | + $controller = new SmartObjectController($smartobjectCurrencyHandler); |
|
| 98 | + $controller->handleObjectDeletion(); |
|
| 99 | 99 | |
| 100 | - break; |
|
| 100 | + break; |
|
| 101 | 101 | |
| 102 | - default: |
|
| 102 | + default: |
|
| 103 | 103 | |
| 104 | - smart_xoops_cp_header(); |
|
| 104 | + smart_xoops_cp_header(); |
|
| 105 | 105 | |
| 106 | - //smart_adminMenu(5, _AM_SOBJECT_CURRENCIES); |
|
| 106 | + //smart_adminMenu(5, _AM_SOBJECT_CURRENCIES); |
|
| 107 | 107 | |
| 108 | - smart_collapsableBar('createdcurrencies', _AM_SOBJECT_CURRENCIES, _AM_SOBJECT_CURRENCIES_DSC); |
|
| 108 | + smart_collapsableBar('createdcurrencies', _AM_SOBJECT_CURRENCIES, _AM_SOBJECT_CURRENCIES_DSC); |
|
| 109 | 109 | |
| 110 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 111 | - $objectTable = new SmartObjectTable($smartobjectCurrencyHandler); |
|
| 112 | - $objectTable->addColumn(new SmartObjectColumn('name', 'left', false, 'getCurrencyLink')); |
|
| 113 | - $objectTable->addColumn(new SmartObjectColumn('rate', 'center', 150)); |
|
| 114 | - $objectTable->addColumn(new SmartObjectColumn('iso4217', 'center', 150)); |
|
| 115 | - $objectTable->addColumn(new SmartObjectColumn('default_currency', 'center', 150, 'getDefaultCurrencyControl')); |
|
| 110 | + require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 111 | + $objectTable = new SmartObjectTable($smartobjectCurrencyHandler); |
|
| 112 | + $objectTable->addColumn(new SmartObjectColumn('name', 'left', false, 'getCurrencyLink')); |
|
| 113 | + $objectTable->addColumn(new SmartObjectColumn('rate', 'center', 150)); |
|
| 114 | + $objectTable->addColumn(new SmartObjectColumn('iso4217', 'center', 150)); |
|
| 115 | + $objectTable->addColumn(new SmartObjectColumn('default_currency', 'center', 150, 'getDefaultCurrencyControl')); |
|
| 116 | 116 | |
| 117 | - $objectTable->addIntroButton('addcurrency', 'currency.php?op=mod', _AM_SOBJECT_CURRENCIES_CREATE); |
|
| 117 | + $objectTable->addIntroButton('addcurrency', 'currency.php?op=mod', _AM_SOBJECT_CURRENCIES_CREATE); |
|
| 118 | 118 | |
| 119 | - $objectTable->addActionButton('updateCurrencies', _SUBMIT, _AM_SOBJECT_CURRENCY_UPDATE_ALL); |
|
| 119 | + $objectTable->addActionButton('updateCurrencies', _SUBMIT, _AM_SOBJECT_CURRENCY_UPDATE_ALL); |
|
| 120 | 120 | |
| 121 | - $objectTable->render(); |
|
| 121 | + $objectTable->render(); |
|
| 122 | 122 | |
| 123 | - echo '<br>'; |
|
| 124 | - smart_close_collapsable('createdcurrencies'); |
|
| 125 | - echo '<br>'; |
|
| 123 | + echo '<br>'; |
|
| 124 | + smart_close_collapsable('createdcurrencies'); |
|
| 125 | + echo '<br>'; |
|
| 126 | 126 | |
| 127 | - break; |
|
| 127 | + break; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | //smart_modFooter(); |
@@ -35,9 +35,9 @@ discard block |
||
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | -require_once __DIR__ . '/admin_header.php'; |
|
| 39 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 40 | -require_once SMARTOBJECT_ROOT_PATH . 'class/currency.php'; |
|
| 38 | +require_once __DIR__.'/admin_header.php'; |
|
| 39 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php'; |
|
| 40 | +require_once SMARTOBJECT_ROOT_PATH.'class/currency.php'; |
|
| 41 | 41 | $smartobjectCurrencyHandler = xoops_getModuleHandler('currency'); |
| 42 | 42 | |
| 43 | 43 | $op = ''; |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | switch ($op) { |
| 53 | 53 | case 'mod': |
| 54 | - $currencyid = isset($_GET['currencyid']) ? (int)$_GET['currencyid'] : 0; |
|
| 54 | + $currencyid = isset($_GET['currencyid']) ? (int) $_GET['currencyid'] : 0; |
|
| 55 | 55 | |
| 56 | 56 | smart_xoops_cp_header(); |
| 57 | 57 | |
@@ -66,9 +66,9 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | if (isset($_POST['default_currency'])) { |
| 68 | 68 | $newDefaultCurrency = $_POST['default_currency']; |
| 69 | - $sql = 'UPDATE ' . $smartobjectCurrencyHandler->table . ' SET default_currency=0'; |
|
| 69 | + $sql = 'UPDATE '.$smartobjectCurrencyHandler->table.' SET default_currency=0'; |
|
| 70 | 70 | $smartobjectCurrencyHandler->query($sql); |
| 71 | - $sql = 'UPDATE ' . $smartobjectCurrencyHandler->table . ' SET default_currency=1 WHERE currencyid=' . $newDefaultCurrency; |
|
| 71 | + $sql = 'UPDATE '.$smartobjectCurrencyHandler->table.' SET default_currency=1 WHERE currencyid='.$newDefaultCurrency; |
|
| 72 | 72 | $smartobjectCurrencyHandler->query($sql); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -86,14 +86,14 @@ discard block |
||
| 86 | 86 | break; |
| 87 | 87 | |
| 88 | 88 | case 'addcurrency': |
| 89 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 89 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 90 | 90 | $controller = new SmartObjectController($smartobjectCurrencyHandler); |
| 91 | - $controller->storeFromDefaultForm(_AM_SOBJECT_CURRENCIES_CREATED, _AM_SOBJECT_CURRENCIES_MODIFIED, SMARTOBJECT_URL . 'admin/currency.php'); |
|
| 91 | + $controller->storeFromDefaultForm(_AM_SOBJECT_CURRENCIES_CREATED, _AM_SOBJECT_CURRENCIES_MODIFIED, SMARTOBJECT_URL.'admin/currency.php'); |
|
| 92 | 92 | |
| 93 | 93 | break; |
| 94 | 94 | |
| 95 | 95 | case 'del': |
| 96 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 96 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 97 | 97 | $controller = new SmartObjectController($smartobjectCurrencyHandler); |
| 98 | 98 | $controller->handleObjectDeletion(); |
| 99 | 99 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | smart_collapsableBar('createdcurrencies', _AM_SOBJECT_CURRENCIES, _AM_SOBJECT_CURRENCIES_DSC); |
| 109 | 109 | |
| 110 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 110 | + require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php'; |
|
| 111 | 111 | $objectTable = new SmartObjectTable($smartobjectCurrencyHandler); |
| 112 | 112 | $objectTable->addColumn(new SmartObjectColumn('name', 'left', false, 'getCurrencyLink')); |
| 113 | 113 | $objectTable->addColumn(new SmartObjectColumn('rate', 'center', 150)); |
@@ -129,4 +129,4 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | //smart_modFooter(); |
| 131 | 131 | //xoops_cp_footer(); |
| 132 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 132 | +require_once __DIR__.'/admin_footer.php'; |
|
@@ -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 | require_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 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 66 | + smart_xoops_cp_header(); |
|
| 67 | + $adminObject->displayNavigation(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 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 76 | + smart_xoops_cp_header(); |
|
| 77 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 78 | 78 | |
| 79 | - editcustomtag(true, $customtagid, true); |
|
| 80 | - break; |
|
| 79 | + editcustomtag(true, $customtagid, true); |
|
| 80 | + break; |
|
| 81 | 81 | |
| 82 | - case 'addcustomtag': |
|
| 83 | - require_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 | + require_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 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 91 | - $controller = new SmartObjectController($smartobjectCustomtagHandler); |
|
| 92 | - $controller->handleObjectDeletion(); |
|
| 90 | + require_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 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 100 | - $adminObject->addItemButton(_AM_SOBJECT_CUSTOMTAGS_CREATE, 'customtag.php?op=mod', 'add', ''); |
|
| 101 | - $adminObject->displayButton('left', ''); |
|
| 98 | + smart_xoops_cp_header(); |
|
| 99 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 100 | + $adminObject->addItemButton(_AM_SOBJECT_CUSTOMTAGS_CREATE, 'customtag.php?op=mod', 'add', ''); |
|
| 101 | + $adminObject->displayButton('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 | - require_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 | + require_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(); |
@@ -59,63 +59,63 @@ discard block |
||
| 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 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 66 | + smart_xoops_cp_header(); |
|
| 67 | + $adminObject->displayNavigation(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 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 76 | + smart_xoops_cp_header(); |
|
| 77 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 78 | 78 | |
| 79 | - editcustomtag(true, $customtagid, true); |
|
| 80 | - break; |
|
| 79 | + editcustomtag(true, $customtagid, true); |
|
| 80 | + break; |
|
| 81 | 81 | |
| 82 | - case 'addcustomtag': |
|
| 83 | - require_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 | + require_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 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 91 | - $controller = new SmartObjectController($smartobjectCustomtagHandler); |
|
| 92 | - $controller->handleObjectDeletion(); |
|
| 90 | + require_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 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 100 | - $adminObject->addItemButton(_AM_SOBJECT_CUSTOMTAGS_CREATE, 'customtag.php?op=mod', 'add', ''); |
|
| 101 | - $adminObject->displayButton('left', ''); |
|
| 98 | + smart_xoops_cp_header(); |
|
| 99 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 100 | + $adminObject->addItemButton(_AM_SOBJECT_CUSTOMTAGS_CREATE, 'customtag.php?op=mod', 'add', ''); |
|
| 101 | + $adminObject->displayButton('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 | - require_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 | + require_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(); |
@@ -40,11 +40,11 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | -require_once __DIR__ . '/admin_header.php'; |
|
| 43 | +require_once __DIR__.'/admin_header.php'; |
|
| 44 | 44 | smart_loadLanguageFile('smartobject', 'customtag'); |
| 45 | 45 | |
| 46 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 47 | -require_once SMARTOBJECT_ROOT_PATH . 'class/customtag.php'; |
|
| 46 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php'; |
|
| 47 | +require_once SMARTOBJECT_ROOT_PATH.'class/customtag.php'; |
|
| 48 | 48 | $smartobjectCustomtagHandler = xoops_getModuleHandler('customtag'); |
| 49 | 49 | |
| 50 | 50 | $adminObject = \Xmf\Module\Admin::getInstance(); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | switch ($op) { |
| 62 | 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 | 66 | smart_xoops_cp_header(); |
| 67 | 67 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 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 | 76 | smart_xoops_cp_header(); |
| 77 | 77 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -80,14 +80,14 @@ discard block |
||
| 80 | 80 | break; |
| 81 | 81 | |
| 82 | 82 | case 'addcustomtag': |
| 83 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 83 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 84 | 84 | $controller = new SmartObjectController($smartobjectCustomtagHandler); |
| 85 | 85 | $controller->storeFromDefaultForm(_AM_SOBJECT_CUSTOMTAGS_CREATED, _AM_SOBJECT_CUSTOMTAGS_MODIFIED); |
| 86 | 86 | break; |
| 87 | 87 | |
| 88 | 88 | case 'del': |
| 89 | 89 | |
| 90 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 90 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 91 | 91 | $controller = new SmartObjectController($smartobjectCustomtagHandler); |
| 92 | 92 | $controller->handleObjectDeletion(); |
| 93 | 93 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | smart_collapsableBar('createdcustomtags', _AM_SOBJECT_CUSTOMTAGS, _AM_SOBJECT_CUSTOMTAGS_DSC); |
| 106 | 106 | |
| 107 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 107 | + require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php'; |
|
| 108 | 108 | $objectTable = new SmartObjectTable($smartobjectCustomtagHandler); |
| 109 | 109 | $objectTable->addColumn(new SmartObjectColumn('name', 'left', 150, 'getCustomtagName')); |
| 110 | 110 | $objectTable->addColumn(new SmartObjectColumn('description', 'left')); |
@@ -153,4 +153,4 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | //smart_modFooter(); |
| 155 | 155 | //xoops_cp_footer(); |
| 156 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 156 | +require_once __DIR__.'/admin_footer.php'; |
|
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | if (false !== ($moduleHelper = Xmf\Module\Helper::getHelper($moduleDirName))) { |
| 29 | 29 | } else { |
| 30 | - $moduleHelper = Xmf\Module\Helper::getHelper('system'); |
|
| 30 | + $moduleHelper = Xmf\Module\Helper::getHelper('system'); |
|
| 31 | 31 | } |
| 32 | 32 | $adminObject = \Xmf\Module\Admin::getInstance(); |
| 33 | 33 | |
@@ -43,6 +43,6 @@ discard block |
||
| 43 | 43 | $myts = MyTextSanitizer::getInstance(); |
| 44 | 44 | |
| 45 | 45 | if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof XoopsTpl)) { |
| 46 | - require_once $GLOBALS['xoops']->path('class/template.php'); |
|
| 47 | - $xoopsTpl = new XoopsTpl(); |
|
| 46 | + require_once $GLOBALS['xoops']->path('class/template.php'); |
|
| 47 | + $xoopsTpl = new XoopsTpl(); |
|
| 48 | 48 | } |
@@ -17,11 +17,11 @@ |
||
| 17 | 17 | * @author XOOPS Development Team |
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | -require_once __DIR__ . '/../../../include/cp_header.php'; |
|
| 20 | +require_once __DIR__.'/../../../include/cp_header.php'; |
|
| 21 | 21 | //require_once $GLOBALS['xoops']->path('www/class/xoopsformloader.php'); |
| 22 | 22 | |
| 23 | -require_once __DIR__ . '/../class/utility.php'; |
|
| 24 | -require_once __DIR__ . '/../include/common.php'; |
|
| 23 | +require_once __DIR__.'/../class/utility.php'; |
|
| 24 | +require_once __DIR__.'/../include/common.php'; |
|
| 25 | 25 | |
| 26 | 26 | $moduleDirName = basename(dirname(__DIR__)); |
| 27 | 27 | |
@@ -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 | require_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 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 75 | + smart_xoops_cp_header(); |
|
| 76 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 77 | 77 | |
| 78 | - editclass(true, $ratingid); |
|
| 79 | - break; |
|
| 78 | + editclass(true, $ratingid); |
|
| 79 | + break; |
|
| 80 | 80 | |
| 81 | - case 'addrating': |
|
| 82 | - require_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 | + require_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 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 90 | - $controller = new SmartObjectController($smartobjectRatingHandler); |
|
| 91 | - $controller->handleObjectDeletion(); |
|
| 88 | + case 'del': |
|
| 89 | + require_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 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 97 | + smart_xoops_cp_header(); |
|
| 98 | + $adminObject->displayNavigation(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 | - require_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 | + require_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(); |
@@ -67,53 +67,53 @@ discard block |
||
| 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 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 75 | + smart_xoops_cp_header(); |
|
| 76 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 77 | 77 | |
| 78 | - editclass(true, $ratingid); |
|
| 79 | - break; |
|
| 78 | + editclass(true, $ratingid); |
|
| 79 | + break; |
|
| 80 | 80 | |
| 81 | - case 'addrating': |
|
| 82 | - require_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 | + require_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 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 90 | - $controller = new SmartObjectController($smartobjectRatingHandler); |
|
| 91 | - $controller->handleObjectDeletion(); |
|
| 88 | + case 'del': |
|
| 89 | + require_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 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 97 | + smart_xoops_cp_header(); |
|
| 98 | + $adminObject->displayNavigation(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 | - require_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 | + require_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(); |
@@ -51,9 +51,9 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | -require_once __DIR__ . '/admin_header.php'; |
|
| 55 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 56 | -require_once SMARTOBJECT_ROOT_PATH . 'class/rating.php'; |
|
| 54 | +require_once __DIR__.'/admin_header.php'; |
|
| 55 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php'; |
|
| 56 | +require_once SMARTOBJECT_ROOT_PATH.'class/rating.php'; |
|
| 57 | 57 | $smartobjectRatingHandler = xoops_getModuleHandler('rating'); |
| 58 | 58 | $indexAdmin = \Xmf\Module\Admin::getInstance(); |
| 59 | 59 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | case 'mod': |
| 71 | 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 | 75 | smart_xoops_cp_header(); |
| 76 | 76 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -79,14 +79,14 @@ discard block |
||
| 79 | 79 | break; |
| 80 | 80 | |
| 81 | 81 | case 'addrating': |
| 82 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 82 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 83 | 83 | $controller = new SmartObjectController($smartobjectRatingHandler); |
| 84 | - $controller->storeFromDefaultForm(_AM_SOBJECT_RATINGS_CREATED, _AM_SOBJECT_RATINGS_MODIFIED, SMARTOBJECT_URL . 'admin/rating.php'); |
|
| 84 | + $controller->storeFromDefaultForm(_AM_SOBJECT_RATINGS_CREATED, _AM_SOBJECT_RATINGS_MODIFIED, SMARTOBJECT_URL.'admin/rating.php'); |
|
| 85 | 85 | |
| 86 | 86 | break; |
| 87 | 87 | |
| 88 | 88 | case 'del': |
| 89 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 89 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 90 | 90 | $controller = new SmartObjectController($smartobjectRatingHandler); |
| 91 | 91 | $controller->handleObjectDeletion(); |
| 92 | 92 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | smart_collapsableBar('createdratings', _AM_SOBJECT_RATINGS, _AM_SOBJECT_RATINGS_DSC); |
| 103 | 103 | |
| 104 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 104 | + require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php'; |
|
| 105 | 105 | $objectTable = new SmartObjectTable($smartobjectRatingHandler); |
| 106 | 106 | $objectTable->addColumn(new SmartObjectColumn('name', 'left')); |
| 107 | 107 | $objectTable->addColumn(new SmartObjectColumn('dirname', 'left')); |
@@ -149,4 +149,4 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | //smart_modFooter(); |
| 151 | 151 | //xoops_cp_footer(); |
| 152 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 152 | +require_once __DIR__.'/admin_footer.php'; |
|
@@ -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 | - require_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 | + require_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 | - require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 53 | + require_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 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 74 | + $adminObject->displayNavigation(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 | - require_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 | + require_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(); |
@@ -29,73 +29,73 @@ |
||
| 29 | 29 | |
| 30 | 30 | switch ($op) { |
| 31 | 31 | |
| 32 | - case 'del': |
|
| 33 | - require_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 | + require_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 | - require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 53 | + require_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 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 74 | + $adminObject->displayNavigation(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 | - require_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 | + require_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(); |
@@ -11,9 +11,9 @@ discard block |
||
| 11 | 11 | * Licence: GNU |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -require_once __DIR__ . '/admin_header.php'; |
|
| 15 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 16 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectlink.php'; |
|
| 14 | +require_once __DIR__.'/admin_header.php'; |
|
| 15 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php'; |
|
| 16 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartobjectlink.php'; |
|
| 17 | 17 | $adminObject = \Xmf\Module\Admin::getInstance(); |
| 18 | 18 | |
| 19 | 19 | $smartobjectLinkHandler = xoops_getModuleHandler('link'); |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | switch ($op) { |
| 31 | 31 | |
| 32 | 32 | case 'del': |
| 33 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 33 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 34 | 34 | $controller = new SmartObjectController($smartobjectLinkHandler); |
| 35 | 35 | $controller->handleObjectDeletion(_AM_SOBJECT_SENT_LINK_DELETE_CONFIRM); |
| 36 | 36 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $linkObj = $smartobjectLinkHandler->get($linkid); |
| 42 | 42 | |
| 43 | 43 | if ($linkObj->isNew()) { |
| 44 | - redirect_header(SMARTOBJECT_URL . 'admin/link.php', 3, _AM_SOBJECT_LINK_NOT_FOUND); |
|
| 44 | + redirect_header(SMARTOBJECT_URL.'admin/link.php', 3, _AM_SOBJECT_LINK_NOT_FOUND); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | smart_xoops_cp_header(); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | smart_collapsableBar('sentlinks', _AM_SOBJECT_SENT_LINK_DISPLAY, _AM_SOBJECT_SENT_LINK_DISPLAY_INFO); |
| 52 | 52 | |
| 53 | - require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 53 | + require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
| 54 | 54 | |
| 55 | 55 | // --- |
| 56 | 56 | // 2012-01-01 PHP 5.3: Assigning the return value of new by reference is now deprecated. |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | smart_collapsableBar('sentlinks', _AM_SOBJECT_SENT_LINKS, _AM_SOBJECT_SENT_LINKS_INFO); |
| 79 | 79 | |
| 80 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 80 | + require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php'; |
|
| 81 | 81 | $objectTable = new SmartObjectTable($smartobjectLinkHandler, null, array('delete')); |
| 82 | 82 | $objectTable->addColumn(new SmartObjectColumn('date')); |
| 83 | 83 | $objectTable->addColumn(new SmartObjectColumn(_AM_SOBJECT_SENT_LINKS_FROM, $align = 'left', $width = false, 'getFromInfo')); |
@@ -100,4 +100,4 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | //smart_modFooter(); |
| 102 | 102 | //xoops_cp_footer(); |
| 103 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 103 | +require_once __DIR__.'/admin_footer.php'; |
|
@@ -17,11 +17,11 @@ |
||
| 17 | 17 | * @author XOOPS Development Team |
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | -require_once __DIR__ . '/admin_header.php'; |
|
| 20 | +require_once __DIR__.'/admin_header.php'; |
|
| 21 | 21 | xoops_cp_header(); |
| 22 | 22 | |
| 23 | 23 | $adminObject->displayNavigation(basename(__FILE__)); |
| 24 | 24 | $adminObject->setPaypal('[email protected]'); |
| 25 | 25 | $adminObject->displayAbout(false); |
| 26 | 26 | |
| 27 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 27 | +require_once __DIR__.'/admin_footer.php'; |
|
@@ -18,6 +18,6 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | 20 | $pathIcon32 = \Xmf\Module\Admin::iconUrl('', 32); |
| 21 | -echo "<div class='adminfooter'>\n" . " <div style='text-align: center;'>\n" . " <a href='https://xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n" . " </div>\n" . ' ' . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" . '</div>'; |
|
| 21 | +echo "<div class='adminfooter'>\n"." <div style='text-align: center;'>\n"." <a href='https://xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n"." </div>\n".' '._AM_MODULEADMIN_ADMIN_FOOTER."\n".'</div>'; |
|
| 22 | 22 | |
| 23 | 23 | xoops_cp_footer(); |
@@ -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 | require_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 | - require_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 | + require_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 | - require_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 | + require_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 | - require_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 | + require_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(); |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | $tagObj = $smartobjectTagHandler->get($tagid); |
| 18 | 18 | |
| 19 | 19 | if ($tagObj->isNew()) { |
| 20 | - $breadcrumb = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_TAG_CREATE; |
|
| 20 | + $breadcrumb = _AM_SOBJECT_TAGS.' > '._AM_SOBJECT_TAG_CREATE; |
|
| 21 | 21 | $title = _AM_SOBJECT_TAG_CREATE; |
| 22 | 22 | $info = _AM_SOBJECT_TAG_CREATE_INFO; |
| 23 | 23 | $collaps_name = 'tagcreate'; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | //$tagObj->stripMultilanguageFields(); |
| 27 | 27 | } else { |
| 28 | 28 | if ($language) { |
| 29 | - $breadcrumb = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_TAG_EDITING_LANGUAGE; |
|
| 29 | + $breadcrumb = _AM_SOBJECT_TAGS.' > '._AM_SOBJECT_TAG_EDITING_LANGUAGE; |
|
| 30 | 30 | $title = _AM_SOBJECT_TAG_EDIT_LANGUAGE; |
| 31 | 31 | $info = _AM_SOBJECT_TAG_EDIT_LANGUAGE_INFO; |
| 32 | 32 | $collaps_name = 'tageditlanguage'; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $submit_button_caption = null; |
| 35 | 35 | $tagObj->makeNonMLFieldReadOnly(); |
| 36 | 36 | } else { |
| 37 | - $breadcrumb = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_EDITING; |
|
| 37 | + $breadcrumb = _AM_SOBJECT_TAGS.' > '._AM_SOBJECT_EDITING; |
|
| 38 | 38 | $title = _AM_SOBJECT_TAG_EDIT; |
| 39 | 39 | $info = _AM_SOBJECT_TAG_EDIT_INFO; |
| 40 | 40 | $collaps_name = 'tagedit'; |
@@ -53,9 +53,9 @@ discard block |
||
| 53 | 53 | smart_close_collapsable($collaps_name); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | -require_once __DIR__ . '/admin_header.php'; |
|
| 57 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 58 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttag.php'; |
|
| 56 | +require_once __DIR__.'/admin_header.php'; |
|
| 57 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php'; |
|
| 58 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttag.php'; |
|
| 59 | 59 | |
| 60 | 60 | $smartobjectTagHandler = xoops_getModuleHandler('tag'); |
| 61 | 61 | |
@@ -75,23 +75,23 @@ discard block |
||
| 75 | 75 | switch ($op) { |
| 76 | 76 | |
| 77 | 77 | case 'del': |
| 78 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 78 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 79 | 79 | $controller = new SmartObjectController($smartobjectTagHandler); |
| 80 | 80 | $controller->handleObjectDeletion(_AM_SOBJECT_TAG_DELETE_CONFIRM); |
| 81 | 81 | |
| 82 | 82 | break; |
| 83 | 83 | |
| 84 | 84 | case 'addtag': |
| 85 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 85 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 86 | 86 | $controller = new SmartObjectController($smartobjectTagHandler); |
| 87 | 87 | $tagObj = $controller->storeSmartObject(); |
| 88 | 88 | if ($tagObj->hasError()) { |
| 89 | - redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $tagObj->getHtmlErrors()); |
|
| 89 | + redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR.$tagObj->getHtmlErrors()); |
|
| 90 | 90 | exit; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | if ($tagObj->hasError()) { |
| 94 | - redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $tagObj->getHtmlErrors()); |
|
| 94 | + redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR.$tagObj->getHtmlErrors()); |
|
| 95 | 95 | } else { |
| 96 | 96 | redirect_header(smart_get_page_before_form(), 3, _CO_SOBJECT_SAVE_SUCCESS); |
| 97 | 97 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | smart_collapsableBar('tags', _AM_SOBJECT_TAGS, _AM_SOBJECT_TAGS_INFO); |
| 113 | 113 | |
| 114 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 114 | + require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php'; |
|
| 115 | 115 | $objectTable = new SmartObjectTable($smartobjectTagHandler, false, array('delete')); |
| 116 | 116 | $objectTable->addColumn(new SmartObjectColumn('name')); |
| 117 | 117 | $objectTable->addColumn(new SmartObjectColumn('language')); |
@@ -138,4 +138,4 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | //smart_modFooter(); |
| 140 | 140 | //xoops_cp_footer(); |
| 141 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 141 | +require_once __DIR__.'/admin_footer.php'; |
|
@@ -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 | - $moduleHandler = xoops_getModuleHandler('modification', 'wfdownloads'); |
|
| 141 | - $mod_table = new WfdownloadsTable('wfdownloads_mod'); |
|
| 142 | - $fields = get_table_info($moduleHandler->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 | + $moduleHandler = xoops_getModuleHandler('modification', 'wfdownloads'); |
|
| 141 | + $mod_table = new WfdownloadsTable('wfdownloads_mod'); |
|
| 142 | + $fields = get_table_info($moduleHandler->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 NULL", '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 NULL", '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,60 +315,60 @@ 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 | - /** @var XoopsModuleHandler $moduleHandler */ |
|
| 355 | - $moduleHandler = xoops_getHandler('module'); |
|
| 356 | - $mydownloadsModule = $moduleHandler->getByDirname('mydownloads'); |
|
| 357 | - if (is_object($mydownloadsModule)) { |
|
| 358 | - $mydownloadsButton = new XoopsFormButton('Import data from MyDownloads', 'myd_button', 'Import', 'submit'); |
|
| 359 | - $mydownloadsButton->setExtra("onclick='document.forms.form.op.value=\"1\"'"); |
|
| 360 | - $form->addElement($mydownloadsButton); |
|
| 361 | - } |
|
| 353 | + //Is MyDownloads installed? |
|
| 354 | + /** @var XoopsModuleHandler $moduleHandler */ |
|
| 355 | + $moduleHandler = xoops_getHandler('module'); |
|
| 356 | + $mydownloadsModule = $moduleHandler->getByDirname('mydownloads'); |
|
| 357 | + if (is_object($mydownloadsModule)) { |
|
| 358 | + $mydownloadsButton = new XoopsFormButton('Import data from MyDownloads', 'myd_button', 'Import', 'submit'); |
|
| 359 | + $mydownloadsButton->setExtra("onclick='document.forms.form.op.value=\"1\"'"); |
|
| 360 | + $form->addElement($mydownloadsButton); |
|
| 361 | + } |
|
| 362 | 362 | |
| 363 | - if (!wfdownloads_TableExists('wfdownloads_meta')) { |
|
| 364 | - $updateButton = new XoopsFormButton('Update WF-Downloads', 'upd_button', 'Update', 'submit'); |
|
| 365 | - $updateButton->setExtra("onclick='document.forms.form.op.value=\"2\"'"); |
|
| 366 | - $form->addElement($updateButton); |
|
| 367 | - } |
|
| 363 | + if (!wfdownloads_TableExists('wfdownloads_meta')) { |
|
| 364 | + $updateButton = new XoopsFormButton('Update WF-Downloads', 'upd_button', 'Update', 'submit'); |
|
| 365 | + $updateButton->setExtra("onclick='document.forms.form.op.value=\"2\"'"); |
|
| 366 | + $form->addElement($updateButton); |
|
| 367 | + } |
|
| 368 | 368 | |
| 369 | - $form->addElement(new XoopsFormHidden('op', 0)); |
|
| 370 | - $form->display(); |
|
| 371 | - break; |
|
| 369 | + $form->addElement(new XoopsFormHidden('op', 0)); |
|
| 370 | + $form->display(); |
|
| 371 | + break; |
|
| 372 | 372 | } |
| 373 | 373 | //wfdownloads_modFooter(); |
| 374 | 374 | //xoops_cp_footer(); |
@@ -7,8 +7,8 @@ discard block |
||
| 7 | 7 | * Licence: GNU |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -require_once __DIR__ . '/admin_header.php'; |
|
| 11 | -require_once SMARTCONTENT_ROOT_PATH . 'class/dbupdater.php'; |
|
| 10 | +require_once __DIR__.'/admin_header.php'; |
|
| 11 | +require_once SMARTCONTENT_ROOT_PATH.'class/dbupdater.php'; |
|
| 12 | 12 | |
| 13 | 13 | smartcontent_xoops_cp_header(); |
| 14 | 14 | |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | $ret = array(); |
| 208 | 208 | global $xoopsDB; |
| 209 | 209 | $catHandler = xoops_getModuleHandler('category', 'wfdownloads'); |
| 210 | - $result = $xoopsDB->query('SHOW COLUMNS FROM ' . $catHandler->table); |
|
| 210 | + $result = $xoopsDB->query('SHOW COLUMNS FROM '.$catHandler->table); |
|
| 211 | 211 | while ($existing_field = $xoopsDB->fetchArray($result)) { |
| 212 | 212 | $fields[$existing_field['field']] = $existing_field['type']; |
| 213 | 213 | } |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | //$xoopsDB->query("ALTER TABLE ".$table." ADD ".$field." ".$type); |
| 267 | 267 | //echo $field."(".$type.") <FONT COLOR='##22DD51'>Added</FONT><br>"; |
| 268 | 268 | } elseif ($existing_fields[$field] != $type) { |
| 269 | - $table->addAlteredField($field, $field . ' ' . $type); |
|
| 269 | + $table->addAlteredField($field, $field.' '.$type); |
|
| 270 | 270 | // check $fields[$field]['type'] for things like "int(10) unsigned" |
| 271 | 271 | //$xoopsDB->query("ALTER TABLE ".$table." CHANGE ".$field." ".$field." ".$type); |
| 272 | 272 | //echo $field." <FONT COLOR='#FF6600'>Changed to</FONT> ".$type."<br>"; |
@@ -287,17 +287,17 @@ discard block |
||
| 287 | 287 | function get_table_info($table, $default_fields) |
| 288 | 288 | { |
| 289 | 289 | global $xoopsDB; |
| 290 | - $result = $xoopsDB->query('SHOW COLUMNS FROM ' . $table); |
|
| 290 | + $result = $xoopsDB->query('SHOW COLUMNS FROM '.$table); |
|
| 291 | 291 | while ($existing_field = $xoopsDB->fetchArray($result)) { |
| 292 | 292 | $fields[$existing_field['Field']] = $existing_field['Type']; |
| 293 | 293 | if ($existing_field['Null'] !== 'YES') { |
| 294 | 294 | $fields[$existing_field['Field']] .= ' NOT NULL'; |
| 295 | 295 | } |
| 296 | 296 | if ($existing_field['Extra']) { |
| 297 | - $fields[$existing_field['Field']] .= ' ' . $existing_field['Extra']; |
|
| 297 | + $fields[$existing_field['Field']] .= ' '.$existing_field['Extra']; |
|
| 298 | 298 | } |
| 299 | 299 | if ($default_fields[$existing_field['Field']]['Default']) { |
| 300 | - $fields[$existing_field['Field']] .= " default '" . $existing_field['Default'] . "'"; |
|
| 300 | + $fields[$existing_field['Field']] .= " default '".$existing_field['Default']."'"; |
|
| 301 | 301 | } |
| 302 | 302 | } |
| 303 | 303 | |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | if (in_array($field, array_keys($renamed_fields))) { |
| 320 | 320 | $new_field_name = $renamed_fields[$field]; |
| 321 | 321 | $new_field_type = $new_fields[$new_field_name]['Type']; |
| 322 | - $table->addAltered($field, $new_field_name . ' ' . $new_field_type); |
|
| 322 | + $table->addAltered($field, $new_field_name.' '.$new_field_type); |
|
| 323 | 323 | //$xoopsDB->query("ALTER TABLE ".$table." CHANGE ".$field." ".$new_field_name." ".$new_field_type); |
| 324 | 324 | //echo $field." Renamed to ".$new_field_name."<br>"; |
| 325 | 325 | $fields[$new_field_name] = $new_field_type; |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | //return $fields; |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | -$op = isset($_REQUEST['op']) ? (int)$_REQUEST['op'] : 0; |
|
| 331 | +$op = isset($_REQUEST['op']) ? (int) $_REQUEST['op'] : 0; |
|
| 332 | 332 | switch ($op) { |
| 333 | 333 | case 1: |
| 334 | 334 | // Make sure that nohtml is properly changed to dohtml |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | |
| 348 | 348 | default: |
| 349 | 349 | //ask what to do |
| 350 | - include XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 350 | + include XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 351 | 351 | $form = new XoopsThemeForm('Upgrade WF-Downloads', 'form', $_SERVER['REQUEST_URI']); |
| 352 | 352 | |
| 353 | 353 | //Is MyDownloads installed? |
@@ -372,4 +372,4 @@ discard block |
||
| 372 | 372 | } |
| 373 | 373 | //wfdownloads_modFooter(); |
| 374 | 374 | //xoops_cp_footer(); |
| 375 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 375 | +require_once __DIR__.'/admin_footer.php'; |
|