@@ -15,44 +15,44 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | function editclass($showmenu = false, $ratingid = 0) |
| 17 | 17 | { |
| 18 | - global $smartobjectRatingHandler; |
|
| 19 | - |
|
| 20 | - $ratingObj = $smartobjectRatingHandler->get($ratingid); |
|
| 21 | - |
|
| 22 | - if (!$ratingObj->isNew()) { |
|
| 23 | - if ($showmenu) { |
|
| 24 | - //smart_adminMenu(4, _AM_SOBJECT_RATINGS . " > " . _AM_SOBJECT_EDITING); |
|
| 25 | - } |
|
| 26 | - smart_collapsableBar('ratingedit', _AM_SOBJECT_RATINGS_EDIT, _AM_SOBJECT_RATINGS_EDIT_INFO); |
|
| 27 | - |
|
| 28 | - $sform = $ratingObj->getForm(_AM_SOBJECT_RATINGS_EDIT, 'addrating'); |
|
| 29 | - $sform->display(); |
|
| 30 | - smart_close_collapsable('ratingedit'); |
|
| 31 | - } else { |
|
| 32 | - $ratingObj->hideFieldFromForm(['item', 'itemid', 'uid', 'date', 'rate']); |
|
| 33 | - |
|
| 34 | - if (isset($_POST['op'])) { |
|
| 35 | - $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectRatingHandler); |
|
| 36 | - $controller->postDataToObject($ratingObj); |
|
| 37 | - |
|
| 38 | - if ('changedField' === $_POST['op']) { |
|
| 39 | - switch ($_POST['changedField']) { |
|
| 40 | - case 'dirname': |
|
| 41 | - $ratingObj->showFieldOnForm(['item', 'itemid', 'uid', 'date', 'rate']); |
|
| 42 | - break; |
|
| 43 | - } |
|
| 44 | - } |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - if ($showmenu) { |
|
| 48 | - //smart_adminMenu(4, _AM_SOBJECT_RATINGS . " > " . _CO_SOBJECT_CREATINGNEW); |
|
| 49 | - } |
|
| 50 | - |
|
| 51 | - smart_collapsableBar('ratingcreate', _AM_SOBJECT_RATINGS_CREATE, _AM_SOBJECT_RATINGS_CREATE_INFO); |
|
| 52 | - $sform = $ratingObj->getForm(_AM_SOBJECT_RATINGS_CREATE, 'addrating'); |
|
| 53 | - $sform->display(); |
|
| 54 | - smart_close_collapsable('ratingcreate'); |
|
| 55 | - } |
|
| 18 | + global $smartobjectRatingHandler; |
|
| 19 | + |
|
| 20 | + $ratingObj = $smartobjectRatingHandler->get($ratingid); |
|
| 21 | + |
|
| 22 | + if (!$ratingObj->isNew()) { |
|
| 23 | + if ($showmenu) { |
|
| 24 | + //smart_adminMenu(4, _AM_SOBJECT_RATINGS . " > " . _AM_SOBJECT_EDITING); |
|
| 25 | + } |
|
| 26 | + smart_collapsableBar('ratingedit', _AM_SOBJECT_RATINGS_EDIT, _AM_SOBJECT_RATINGS_EDIT_INFO); |
|
| 27 | + |
|
| 28 | + $sform = $ratingObj->getForm(_AM_SOBJECT_RATINGS_EDIT, 'addrating'); |
|
| 29 | + $sform->display(); |
|
| 30 | + smart_close_collapsable('ratingedit'); |
|
| 31 | + } else { |
|
| 32 | + $ratingObj->hideFieldFromForm(['item', 'itemid', 'uid', 'date', 'rate']); |
|
| 33 | + |
|
| 34 | + if (isset($_POST['op'])) { |
|
| 35 | + $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectRatingHandler); |
|
| 36 | + $controller->postDataToObject($ratingObj); |
|
| 37 | + |
|
| 38 | + if ('changedField' === $_POST['op']) { |
|
| 39 | + switch ($_POST['changedField']) { |
|
| 40 | + case 'dirname': |
|
| 41 | + $ratingObj->showFieldOnForm(['item', 'itemid', 'uid', 'date', 'rate']); |
|
| 42 | + break; |
|
| 43 | + } |
|
| 44 | + } |
|
| 45 | + } |
|
| 46 | + |
|
| 47 | + if ($showmenu) { |
|
| 48 | + //smart_adminMenu(4, _AM_SOBJECT_RATINGS . " > " . _CO_SOBJECT_CREATINGNEW); |
|
| 49 | + } |
|
| 50 | + |
|
| 51 | + smart_collapsableBar('ratingcreate', _AM_SOBJECT_RATINGS_CREATE, _AM_SOBJECT_RATINGS_CREATE_INFO); |
|
| 52 | + $sform = $ratingObj->getForm(_AM_SOBJECT_RATINGS_CREATE, 'addrating'); |
|
| 53 | + $sform->display(); |
|
| 54 | + smart_close_collapsable('ratingcreate'); |
|
| 55 | + } |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | require_once __DIR__ . '/admin_header.php'; |
@@ -64,60 +64,60 @@ discard block |
||
| 64 | 64 | $op = ''; |
| 65 | 65 | |
| 66 | 66 | if (isset($_GET['op'])) { |
| 67 | - $op = $_GET['op']; |
|
| 67 | + $op = $_GET['op']; |
|
| 68 | 68 | } |
| 69 | 69 | if (isset($_POST['op'])) { |
| 70 | - $op = $_POST['op']; |
|
| 70 | + $op = $_POST['op']; |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | switch ($op) { |
| 74 | - case 'mod': |
|
| 75 | - case 'changedField': |
|
| 74 | + case 'mod': |
|
| 75 | + case 'changedField': |
|
| 76 | 76 | |
| 77 | - $ratingid = isset($_GET['ratingid']) ? (int)$_GET['ratingid'] : 0; |
|
| 77 | + $ratingid = isset($_GET['ratingid']) ? (int)$_GET['ratingid'] : 0; |
|
| 78 | 78 | |
| 79 | - smart_xoops_cp_header(); |
|
| 80 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 79 | + smart_xoops_cp_header(); |
|
| 80 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 81 | 81 | |
| 82 | - editclass(true, $ratingid); |
|
| 83 | - break; |
|
| 82 | + editclass(true, $ratingid); |
|
| 83 | + break; |
|
| 84 | 84 | |
| 85 | - case 'addrating': |
|
| 86 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 87 | - $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectRatingHandler); |
|
| 88 | - $controller->storeFromDefaultForm(_AM_SOBJECT_RATINGS_CREATED, _AM_SOBJECT_RATINGS_MODIFIED, SMARTOBJECT_URL . 'admin/rating.php'); |
|
| 85 | + case 'addrating': |
|
| 86 | + require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 87 | + $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectRatingHandler); |
|
| 88 | + $controller->storeFromDefaultForm(_AM_SOBJECT_RATINGS_CREATED, _AM_SOBJECT_RATINGS_MODIFIED, SMARTOBJECT_URL . 'admin/rating.php'); |
|
| 89 | 89 | |
| 90 | - break; |
|
| 90 | + break; |
|
| 91 | 91 | |
| 92 | - case 'del': |
|
| 93 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 94 | - $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectRatingHandler); |
|
| 95 | - $controller->handleObjectDeletion(); |
|
| 92 | + case 'del': |
|
| 93 | + require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 94 | + $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectRatingHandler); |
|
| 95 | + $controller->handleObjectDeletion(); |
|
| 96 | 96 | |
| 97 | - break; |
|
| 97 | + break; |
|
| 98 | 98 | |
| 99 | - default: |
|
| 99 | + default: |
|
| 100 | 100 | |
| 101 | - smart_xoops_cp_header(); |
|
| 102 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 101 | + smart_xoops_cp_header(); |
|
| 102 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 103 | 103 | |
| 104 | - //smart_adminMenu(4, _AM_SOBJECT_RATINGS); |
|
| 104 | + //smart_adminMenu(4, _AM_SOBJECT_RATINGS); |
|
| 105 | 105 | |
| 106 | - smart_collapsableBar('createdratings', _AM_SOBJECT_RATINGS, _AM_SOBJECT_RATINGS_DSC); |
|
| 106 | + smart_collapsableBar('createdratings', _AM_SOBJECT_RATINGS, _AM_SOBJECT_RATINGS_DSC); |
|
| 107 | 107 | |
| 108 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 109 | - $objectTable = new XoopsModules\Smartobject\SmartObjectTable($smartobjectRatingHandler); |
|
| 110 | - $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('name', 'left')); |
|
| 111 | - $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('dirname', 'left')); |
|
| 112 | - $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('item', 'left', false, 'getItemValue')); |
|
| 113 | - $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('date', 'center', 150)); |
|
| 114 | - $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('rate', 'center', 40, 'getRateValue')); |
|
| 108 | + require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 109 | + $objectTable = new XoopsModules\Smartobject\SmartObjectTable($smartobjectRatingHandler); |
|
| 110 | + $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('name', 'left')); |
|
| 111 | + $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('dirname', 'left')); |
|
| 112 | + $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('item', 'left', false, 'getItemValue')); |
|
| 113 | + $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('date', 'center', 150)); |
|
| 114 | + $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('rate', 'center', 40, 'getRateValue')); |
|
| 115 | 115 | |
| 116 | - // $objectTable->addCustomAction('getCreateItemLink'); |
|
| 117 | - // $objectTable->addCustomAction('getCreateAttributLink'); |
|
| 116 | + // $objectTable->addCustomAction('getCreateItemLink'); |
|
| 117 | + // $objectTable->addCustomAction('getCreateAttributLink'); |
|
| 118 | 118 | |
| 119 | - $objectTable->addIntroButton('addrating', 'rating.php?op=mod', _AM_SOBJECT_RATINGS_CREATE); |
|
| 120 | - /* |
|
| 119 | + $objectTable->addIntroButton('addrating', 'rating.php?op=mod', _AM_SOBJECT_RATINGS_CREATE); |
|
| 120 | + /* |
|
| 121 | 121 | $criteria_upcoming = new \CriteriaCompo(); |
| 122 | 122 | $criteria_upcoming->add(new \Criteria('start_date', time(), '>')); |
| 123 | 123 | $objectTable->addFilter(_AM_SOBJECT_FILTER_UPCOMING, array( |
@@ -142,13 +142,13 @@ discard block |
||
| 142 | 142 | )); |
| 143 | 143 | */ |
| 144 | 144 | |
| 145 | - $objectTable->render(); |
|
| 145 | + $objectTable->render(); |
|
| 146 | 146 | |
| 147 | - echo '<br>'; |
|
| 148 | - smart_close_collapsable('createdratings'); |
|
| 149 | - echo '<br>'; |
|
| 147 | + echo '<br>'; |
|
| 148 | + smart_close_collapsable('createdratings'); |
|
| 149 | + echo '<br>'; |
|
| 150 | 150 | |
| 151 | - break; |
|
| 151 | + break; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | //smart_modFooter(); |
@@ -71,53 +71,53 @@ discard block |
||
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | switch ($op) { |
| 74 | - case 'mod': |
|
| 75 | - case 'changedField': |
|
| 74 | + case 'mod': |
|
| 75 | + case 'changedField': |
|
| 76 | 76 | |
| 77 | - $ratingid = isset($_GET['ratingid']) ? (int)$_GET['ratingid'] : 0; |
|
| 77 | + $ratingid = isset($_GET['ratingid']) ? (int)$_GET['ratingid'] : 0; |
|
| 78 | 78 | |
| 79 | - smart_xoops_cp_header(); |
|
| 80 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 79 | + smart_xoops_cp_header(); |
|
| 80 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 81 | 81 | |
| 82 | - editclass(true, $ratingid); |
|
| 83 | - break; |
|
| 82 | + editclass(true, $ratingid); |
|
| 83 | + break; |
|
| 84 | 84 | |
| 85 | - case 'addrating': |
|
| 86 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 87 | - $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectRatingHandler); |
|
| 88 | - $controller->storeFromDefaultForm(_AM_SOBJECT_RATINGS_CREATED, _AM_SOBJECT_RATINGS_MODIFIED, SMARTOBJECT_URL . 'admin/rating.php'); |
|
| 85 | + case 'addrating': |
|
| 86 | + require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 87 | + $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectRatingHandler); |
|
| 88 | + $controller->storeFromDefaultForm(_AM_SOBJECT_RATINGS_CREATED, _AM_SOBJECT_RATINGS_MODIFIED, SMARTOBJECT_URL . 'admin/rating.php'); |
|
| 89 | 89 | |
| 90 | - break; |
|
| 90 | + break; |
|
| 91 | 91 | |
| 92 | - case 'del': |
|
| 93 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 94 | - $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectRatingHandler); |
|
| 95 | - $controller->handleObjectDeletion(); |
|
| 92 | + case 'del': |
|
| 93 | + require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 94 | + $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectRatingHandler); |
|
| 95 | + $controller->handleObjectDeletion(); |
|
| 96 | 96 | |
| 97 | - break; |
|
| 97 | + break; |
|
| 98 | 98 | |
| 99 | - default: |
|
| 99 | + default: |
|
| 100 | 100 | |
| 101 | - smart_xoops_cp_header(); |
|
| 102 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 101 | + smart_xoops_cp_header(); |
|
| 102 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 103 | 103 | |
| 104 | - //smart_adminMenu(4, _AM_SOBJECT_RATINGS); |
|
| 104 | + //smart_adminMenu(4, _AM_SOBJECT_RATINGS); |
|
| 105 | 105 | |
| 106 | - smart_collapsableBar('createdratings', _AM_SOBJECT_RATINGS, _AM_SOBJECT_RATINGS_DSC); |
|
| 106 | + smart_collapsableBar('createdratings', _AM_SOBJECT_RATINGS, _AM_SOBJECT_RATINGS_DSC); |
|
| 107 | 107 | |
| 108 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 109 | - $objectTable = new XoopsModules\Smartobject\SmartObjectTable($smartobjectRatingHandler); |
|
| 110 | - $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('name', 'left')); |
|
| 111 | - $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('dirname', 'left')); |
|
| 112 | - $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('item', 'left', false, 'getItemValue')); |
|
| 113 | - $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('date', 'center', 150)); |
|
| 114 | - $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('rate', 'center', 40, 'getRateValue')); |
|
| 108 | + require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 109 | + $objectTable = new XoopsModules\Smartobject\SmartObjectTable($smartobjectRatingHandler); |
|
| 110 | + $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('name', 'left')); |
|
| 111 | + $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('dirname', 'left')); |
|
| 112 | + $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('item', 'left', false, 'getItemValue')); |
|
| 113 | + $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('date', 'center', 150)); |
|
| 114 | + $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('rate', 'center', 40, 'getRateValue')); |
|
| 115 | 115 | |
| 116 | - // $objectTable->addCustomAction('getCreateItemLink'); |
|
| 117 | - // $objectTable->addCustomAction('getCreateAttributLink'); |
|
| 116 | + // $objectTable->addCustomAction('getCreateItemLink'); |
|
| 117 | + // $objectTable->addCustomAction('getCreateAttributLink'); |
|
| 118 | 118 | |
| 119 | - $objectTable->addIntroButton('addrating', 'rating.php?op=mod', _AM_SOBJECT_RATINGS_CREATE); |
|
| 120 | - /* |
|
| 119 | + $objectTable->addIntroButton('addrating', 'rating.php?op=mod', _AM_SOBJECT_RATINGS_CREATE); |
|
| 120 | + /* |
|
| 121 | 121 | $criteria_upcoming = new \CriteriaCompo(); |
| 122 | 122 | $criteria_upcoming->add(new \Criteria('start_date', time(), '>')); |
| 123 | 123 | $objectTable->addFilter(_AM_SOBJECT_FILTER_UPCOMING, array( |
@@ -142,13 +142,13 @@ discard block |
||
| 142 | 142 | )); |
| 143 | 143 | */ |
| 144 | 144 | |
| 145 | - $objectTable->render(); |
|
| 145 | + $objectTable->render(); |
|
| 146 | 146 | |
| 147 | - echo '<br>'; |
|
| 148 | - smart_close_collapsable('createdratings'); |
|
| 149 | - echo '<br>'; |
|
| 147 | + echo '<br>'; |
|
| 148 | + smart_close_collapsable('createdratings'); |
|
| 149 | + echo '<br>'; |
|
| 150 | 150 | |
| 151 | - break; |
|
| 151 | + break; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | //smart_modFooter(); |
@@ -55,9 +55,9 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | -require_once __DIR__ . '/admin_header.php'; |
|
| 59 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 60 | -require_once SMARTOBJECT_ROOT_PATH . 'class/rating.php'; |
|
| 58 | +require_once __DIR__.'/admin_header.php'; |
|
| 59 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php'; |
|
| 60 | +require_once SMARTOBJECT_ROOT_PATH.'class/rating.php'; |
|
| 61 | 61 | $smartobjectRatingHandler = xoops_getModuleHandler('rating'); |
| 62 | 62 | $indexAdmin = \Xmf\Module\Admin::getInstance(); |
| 63 | 63 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | case 'mod': |
| 75 | 75 | case 'changedField': |
| 76 | 76 | |
| 77 | - $ratingid = isset($_GET['ratingid']) ? (int)$_GET['ratingid'] : 0; |
|
| 77 | + $ratingid = isset($_GET['ratingid']) ? (int) $_GET['ratingid'] : 0; |
|
| 78 | 78 | |
| 79 | 79 | smart_xoops_cp_header(); |
| 80 | 80 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -83,14 +83,14 @@ discard block |
||
| 83 | 83 | break; |
| 84 | 84 | |
| 85 | 85 | case 'addrating': |
| 86 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 86 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 87 | 87 | $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectRatingHandler); |
| 88 | - $controller->storeFromDefaultForm(_AM_SOBJECT_RATINGS_CREATED, _AM_SOBJECT_RATINGS_MODIFIED, SMARTOBJECT_URL . 'admin/rating.php'); |
|
| 88 | + $controller->storeFromDefaultForm(_AM_SOBJECT_RATINGS_CREATED, _AM_SOBJECT_RATINGS_MODIFIED, SMARTOBJECT_URL.'admin/rating.php'); |
|
| 89 | 89 | |
| 90 | 90 | break; |
| 91 | 91 | |
| 92 | 92 | case 'del': |
| 93 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 93 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 94 | 94 | $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectRatingHandler); |
| 95 | 95 | $controller->handleObjectDeletion(); |
| 96 | 96 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | smart_collapsableBar('createdratings', _AM_SOBJECT_RATINGS, _AM_SOBJECT_RATINGS_DSC); |
| 107 | 107 | |
| 108 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 108 | + require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php'; |
|
| 109 | 109 | $objectTable = new XoopsModules\Smartobject\SmartObjectTable($smartobjectRatingHandler); |
| 110 | 110 | $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('name', 'left')); |
| 111 | 111 | $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('dirname', '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'; |
|
@@ -7,8 +7,8 @@ |
||
| 7 | 7 | * Licence: GNU |
| 8 | 8 | */ |
| 9 | 9 | // |
| 10 | -require_once __DIR__ . '/admin_header.php'; |
|
| 10 | +require_once __DIR__.'/admin_header.php'; |
|
| 11 | 11 | |
| 12 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectabout.php'; |
|
| 12 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartobjectabout.php'; |
|
| 13 | 13 | $aboutObj = new XoopsModules\Smartobject\SmartobjectAbout(); |
| 14 | 14 | $aboutObj->render(); |
@@ -16,45 +16,45 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | function edittag($tagid = 0, $language = false, $fct = false) |
| 18 | 18 | { |
| 19 | - global $smartobjectTagHandler; |
|
| 20 | - |
|
| 21 | - $tagObj = $smartobjectTagHandler->get($tagid); |
|
| 22 | - |
|
| 23 | - if ($tagObj->isNew()) { |
|
| 24 | - $breadcrumb = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_TAG_CREATE; |
|
| 25 | - $title = _AM_SOBJECT_TAG_CREATE; |
|
| 26 | - $info = _AM_SOBJECT_TAG_CREATE_INFO; |
|
| 27 | - $collaps_name = 'tagcreate'; |
|
| 28 | - $form_name = _AM_SOBJECT_TAG_CREATE; |
|
| 29 | - $submit_button_caption = null; |
|
| 30 | - //$tagObj->stripMultilanguageFields(); |
|
| 31 | - } else { |
|
| 32 | - if ($language) { |
|
| 33 | - $breadcrumb = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_TAG_EDITING_LANGUAGE; |
|
| 34 | - $title = _AM_SOBJECT_TAG_EDIT_LANGUAGE; |
|
| 35 | - $info = _AM_SOBJECT_TAG_EDIT_LANGUAGE_INFO; |
|
| 36 | - $collaps_name = 'tageditlanguage'; |
|
| 37 | - $form_name = _AM_SOBJECT_TAG_EDIT_LANGUAGE; |
|
| 38 | - $submit_button_caption = null; |
|
| 39 | - $tagObj->makeNonMLFieldReadOnly(); |
|
| 40 | - } else { |
|
| 41 | - $breadcrumb = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_EDITING; |
|
| 42 | - $title = _AM_SOBJECT_TAG_EDIT; |
|
| 43 | - $info = _AM_SOBJECT_TAG_EDIT_INFO; |
|
| 44 | - $collaps_name = 'tagedit'; |
|
| 45 | - $form_name = _AM_SOBJECT_TAG_EDIT; |
|
| 46 | - $submit_button_caption = null; |
|
| 47 | - $tagObj->stripMultilanguageFields(); |
|
| 48 | - } |
|
| 49 | - } |
|
| 50 | - |
|
| 51 | - //smart_adminMenu(2, $breadcrumb); |
|
| 52 | - |
|
| 53 | - smart_collapsableBar($collaps_name, $title, $info); |
|
| 54 | - |
|
| 55 | - $sform = $tagObj->getForm($form_name, 'addtag', false, $submit_button_caption); |
|
| 56 | - $sform->display(); |
|
| 57 | - smart_close_collapsable($collaps_name); |
|
| 19 | + global $smartobjectTagHandler; |
|
| 20 | + |
|
| 21 | + $tagObj = $smartobjectTagHandler->get($tagid); |
|
| 22 | + |
|
| 23 | + if ($tagObj->isNew()) { |
|
| 24 | + $breadcrumb = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_TAG_CREATE; |
|
| 25 | + $title = _AM_SOBJECT_TAG_CREATE; |
|
| 26 | + $info = _AM_SOBJECT_TAG_CREATE_INFO; |
|
| 27 | + $collaps_name = 'tagcreate'; |
|
| 28 | + $form_name = _AM_SOBJECT_TAG_CREATE; |
|
| 29 | + $submit_button_caption = null; |
|
| 30 | + //$tagObj->stripMultilanguageFields(); |
|
| 31 | + } else { |
|
| 32 | + if ($language) { |
|
| 33 | + $breadcrumb = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_TAG_EDITING_LANGUAGE; |
|
| 34 | + $title = _AM_SOBJECT_TAG_EDIT_LANGUAGE; |
|
| 35 | + $info = _AM_SOBJECT_TAG_EDIT_LANGUAGE_INFO; |
|
| 36 | + $collaps_name = 'tageditlanguage'; |
|
| 37 | + $form_name = _AM_SOBJECT_TAG_EDIT_LANGUAGE; |
|
| 38 | + $submit_button_caption = null; |
|
| 39 | + $tagObj->makeNonMLFieldReadOnly(); |
|
| 40 | + } else { |
|
| 41 | + $breadcrumb = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_EDITING; |
|
| 42 | + $title = _AM_SOBJECT_TAG_EDIT; |
|
| 43 | + $info = _AM_SOBJECT_TAG_EDIT_INFO; |
|
| 44 | + $collaps_name = 'tagedit'; |
|
| 45 | + $form_name = _AM_SOBJECT_TAG_EDIT; |
|
| 46 | + $submit_button_caption = null; |
|
| 47 | + $tagObj->stripMultilanguageFields(); |
|
| 48 | + } |
|
| 49 | + } |
|
| 50 | + |
|
| 51 | + //smart_adminMenu(2, $breadcrumb); |
|
| 52 | + |
|
| 53 | + smart_collapsableBar($collaps_name, $title, $info); |
|
| 54 | + |
|
| 55 | + $sform = $tagObj->getForm($form_name, 'addtag', false, $submit_button_caption); |
|
| 56 | + $sform->display(); |
|
| 57 | + smart_close_collapsable($collaps_name); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | require_once __DIR__ . '/admin_header.php'; |
@@ -66,10 +66,10 @@ discard block |
||
| 66 | 66 | $op = ''; |
| 67 | 67 | |
| 68 | 68 | if (isset($_GET['op'])) { |
| 69 | - $op = $_GET['op']; |
|
| 69 | + $op = $_GET['op']; |
|
| 70 | 70 | } |
| 71 | 71 | if (isset($_POST['op'])) { |
| 72 | - $op = $_POST['op']; |
|
| 72 | + $op = $_POST['op']; |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | $tagid = isset($_GET['tagid']) ? $_GET['tagid'] : 0; |
@@ -78,65 +78,65 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | switch ($op) { |
| 80 | 80 | |
| 81 | - case 'del': |
|
| 82 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 83 | - $controller = new SmartObjectController($smartobjectTagHandler); |
|
| 84 | - $controller->handleObjectDeletion(_AM_SOBJECT_TAG_DELETE_CONFIRM); |
|
| 81 | + case 'del': |
|
| 82 | + require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 83 | + $controller = new SmartObjectController($smartobjectTagHandler); |
|
| 84 | + $controller->handleObjectDeletion(_AM_SOBJECT_TAG_DELETE_CONFIRM); |
|
| 85 | 85 | |
| 86 | - break; |
|
| 86 | + break; |
|
| 87 | 87 | |
| 88 | - case 'addtag': |
|
| 89 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 90 | - $controller = new SmartObjectController($smartobjectTagHandler); |
|
| 91 | - $tagObj = $controller->storeSmartObject(); |
|
| 92 | - if ($tagObj->hasError()) { |
|
| 93 | - redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $tagObj->getHtmlErrors()); |
|
| 94 | - } |
|
| 88 | + case 'addtag': |
|
| 89 | + require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 90 | + $controller = new SmartObjectController($smartobjectTagHandler); |
|
| 91 | + $tagObj = $controller->storeSmartObject(); |
|
| 92 | + if ($tagObj->hasError()) { |
|
| 93 | + redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $tagObj->getHtmlErrors()); |
|
| 94 | + } |
|
| 95 | 95 | |
| 96 | - if ($tagObj->hasError()) { |
|
| 97 | - redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $tagObj->getHtmlErrors()); |
|
| 98 | - } else { |
|
| 99 | - redirect_header(smart_get_page_before_form(), 3, _CO_SOBJECT_SAVE_SUCCESS); |
|
| 100 | - } |
|
| 101 | - exit; |
|
| 102 | - break; |
|
| 96 | + if ($tagObj->hasError()) { |
|
| 97 | + redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $tagObj->getHtmlErrors()); |
|
| 98 | + } else { |
|
| 99 | + redirect_header(smart_get_page_before_form(), 3, _CO_SOBJECT_SAVE_SUCCESS); |
|
| 100 | + } |
|
| 101 | + exit; |
|
| 102 | + break; |
|
| 103 | 103 | |
| 104 | - case 'mod': |
|
| 105 | - smart_xoops_cp_header(); |
|
| 106 | - edittag($tagid, $language, $fct); |
|
| 107 | - break; |
|
| 104 | + case 'mod': |
|
| 105 | + smart_xoops_cp_header(); |
|
| 106 | + edittag($tagid, $language, $fct); |
|
| 107 | + break; |
|
| 108 | 108 | |
| 109 | - default: |
|
| 109 | + default: |
|
| 110 | 110 | |
| 111 | - smart_xoops_cp_header(); |
|
| 111 | + smart_xoops_cp_header(); |
|
| 112 | 112 | |
| 113 | - //smart_adminMenu(2, _AM_SOBJECT_TAGS); |
|
| 113 | + //smart_adminMenu(2, _AM_SOBJECT_TAGS); |
|
| 114 | 114 | |
| 115 | - smart_collapsableBar('tags', _AM_SOBJECT_TAGS, _AM_SOBJECT_TAGS_INFO); |
|
| 115 | + smart_collapsableBar('tags', _AM_SOBJECT_TAGS, _AM_SOBJECT_TAGS_INFO); |
|
| 116 | 116 | |
| 117 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 118 | - $objectTable = new SmartObjectTable($smartobjectTagHandler, false, ['delete']); |
|
| 119 | - $objectTable->addColumn(new SmartObjectColumn('name')); |
|
| 120 | - $objectTable->addColumn(new SmartObjectColumn('language')); |
|
| 121 | - $objectTable->addColumn(new SmartObjectColumn('value')); |
|
| 122 | - // $objectTable->addColumn(new SmartObjectColumn(_AM_SOBJECT_SENT_TAGS_FROM, $align='left', $width=false, 'getFromInfo')); |
|
| 117 | + require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 118 | + $objectTable = new SmartObjectTable($smartobjectTagHandler, false, ['delete']); |
|
| 119 | + $objectTable->addColumn(new SmartObjectColumn('name')); |
|
| 120 | + $objectTable->addColumn(new SmartObjectColumn('language')); |
|
| 121 | + $objectTable->addColumn(new SmartObjectColumn('value')); |
|
| 122 | + // $objectTable->addColumn(new SmartObjectColumn(_AM_SOBJECT_SENT_TAGS_FROM, $align='left', $width=false, 'getFromInfo')); |
|
| 123 | 123 | |
| 124 | - $objectTable->addFilter('language', 'getLanguages'); |
|
| 124 | + $objectTable->addFilter('language', 'getLanguages'); |
|
| 125 | 125 | |
| 126 | - $objectTable->addCustomAction('getEditLanguageLink'); |
|
| 127 | - $objectTable->addCustomAction('getEditItemLink'); |
|
| 126 | + $objectTable->addCustomAction('getEditLanguageLink'); |
|
| 127 | + $objectTable->addCustomAction('getEditItemLink'); |
|
| 128 | 128 | |
| 129 | - $objectTable->setDefaultSort('tagid'); |
|
| 129 | + $objectTable->setDefaultSort('tagid'); |
|
| 130 | 130 | |
| 131 | - $objectTable->addIntroButton('addtag', 'tag.php?op=mod', _AM_SOBJECT_TAG_CREATE); |
|
| 131 | + $objectTable->addIntroButton('addtag', 'tag.php?op=mod', _AM_SOBJECT_TAG_CREATE); |
|
| 132 | 132 | |
| 133 | - $objectTable->render(); |
|
| 133 | + $objectTable->render(); |
|
| 134 | 134 | |
| 135 | - echo '<br>'; |
|
| 136 | - smart_close_collapsable('tags'); |
|
| 137 | - echo '<br>'; |
|
| 135 | + echo '<br>'; |
|
| 136 | + smart_close_collapsable('tags'); |
|
| 137 | + echo '<br>'; |
|
| 138 | 138 | |
| 139 | - break; |
|
| 139 | + break; |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | //smart_modFooter(); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | $tagObj = $smartobjectTagHandler->get($tagid); |
| 22 | 22 | |
| 23 | 23 | if ($tagObj->isNew()) { |
| 24 | - $breadcrumb = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_TAG_CREATE; |
|
| 24 | + $breadcrumb = _AM_SOBJECT_TAGS.' > '._AM_SOBJECT_TAG_CREATE; |
|
| 25 | 25 | $title = _AM_SOBJECT_TAG_CREATE; |
| 26 | 26 | $info = _AM_SOBJECT_TAG_CREATE_INFO; |
| 27 | 27 | $collaps_name = 'tagcreate'; |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | //$tagObj->stripMultilanguageFields(); |
| 31 | 31 | } else { |
| 32 | 32 | if ($language) { |
| 33 | - $breadcrumb = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_TAG_EDITING_LANGUAGE; |
|
| 33 | + $breadcrumb = _AM_SOBJECT_TAGS.' > '._AM_SOBJECT_TAG_EDITING_LANGUAGE; |
|
| 34 | 34 | $title = _AM_SOBJECT_TAG_EDIT_LANGUAGE; |
| 35 | 35 | $info = _AM_SOBJECT_TAG_EDIT_LANGUAGE_INFO; |
| 36 | 36 | $collaps_name = 'tageditlanguage'; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $submit_button_caption = null; |
| 39 | 39 | $tagObj->makeNonMLFieldReadOnly(); |
| 40 | 40 | } else { |
| 41 | - $breadcrumb = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_EDITING; |
|
| 41 | + $breadcrumb = _AM_SOBJECT_TAGS.' > '._AM_SOBJECT_EDITING; |
|
| 42 | 42 | $title = _AM_SOBJECT_TAG_EDIT; |
| 43 | 43 | $info = _AM_SOBJECT_TAG_EDIT_INFO; |
| 44 | 44 | $collaps_name = 'tagedit'; |
@@ -57,9 +57,9 @@ discard block |
||
| 57 | 57 | smart_close_collapsable($collaps_name); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | -require_once __DIR__ . '/admin_header.php'; |
|
| 61 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 62 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttag.php'; |
|
| 60 | +require_once __DIR__.'/admin_header.php'; |
|
| 61 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php'; |
|
| 62 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttag.php'; |
|
| 63 | 63 | |
| 64 | 64 | $smartobjectTagHandler = xoops_getModuleHandler('tag'); |
| 65 | 65 | |
@@ -79,22 +79,22 @@ discard block |
||
| 79 | 79 | switch ($op) { |
| 80 | 80 | |
| 81 | 81 | case 'del': |
| 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($smartobjectTagHandler); |
| 84 | 84 | $controller->handleObjectDeletion(_AM_SOBJECT_TAG_DELETE_CONFIRM); |
| 85 | 85 | |
| 86 | 86 | break; |
| 87 | 87 | |
| 88 | 88 | case 'addtag': |
| 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($smartobjectTagHandler); |
| 91 | 91 | $tagObj = $controller->storeSmartObject(); |
| 92 | 92 | if ($tagObj->hasError()) { |
| 93 | - redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $tagObj->getHtmlErrors()); |
|
| 93 | + redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR.$tagObj->getHtmlErrors()); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | if ($tagObj->hasError()) { |
| 97 | - redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $tagObj->getHtmlErrors()); |
|
| 97 | + redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR.$tagObj->getHtmlErrors()); |
|
| 98 | 98 | } else { |
| 99 | 99 | redirect_header(smart_get_page_before_form(), 3, _CO_SOBJECT_SAVE_SUCCESS); |
| 100 | 100 | } |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | smart_collapsableBar('tags', _AM_SOBJECT_TAGS, _AM_SOBJECT_TAGS_INFO); |
| 116 | 116 | |
| 117 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 117 | + require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php'; |
|
| 118 | 118 | $objectTable = new SmartObjectTable($smartobjectTagHandler, false, ['delete']); |
| 119 | 119 | $objectTable->addColumn(new SmartObjectColumn('name')); |
| 120 | 120 | $objectTable->addColumn(new SmartObjectColumn('language')); |
@@ -141,4 +141,4 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | //smart_modFooter(); |
| 143 | 143 | //xoops_cp_footer(); |
| 144 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 144 | +require_once __DIR__.'/admin_footer.php'; |
|
@@ -16,32 +16,32 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | function editcustomtag($showmenu = false, $customtagid = 0, $clone = false) |
| 18 | 18 | { |
| 19 | - global $smartobjectCustomtagHandler; |
|
| 20 | - |
|
| 21 | - $customtagObj = $smartobjectCustomtagHandler->get($customtagid); |
|
| 22 | - |
|
| 23 | - if (!$clone && !$customtagObj->isNew()) { |
|
| 24 | - if ($showmenu) { |
|
| 25 | - //smart_adminMenu(2, _AM_SOBJECT_CUSTOMTAGS . " > " . _AM_SOBJECT_EDITING); |
|
| 26 | - } |
|
| 27 | - smart_collapsableBar('customtagedit', _AM_SOBJECT_CUSTOMTAGS_EDIT, _AM_SOBJECT_CUSTOMTAGS_EDIT_INFO); |
|
| 28 | - |
|
| 29 | - $sform = $customtagObj->getForm(_AM_SOBJECT_CUSTOMTAGS_EDIT, 'addcustomtag'); |
|
| 30 | - $sform->display(); |
|
| 31 | - smart_close_collapsable('customtagedit'); |
|
| 32 | - } else { |
|
| 33 | - $customtagObj->setVar('customtagid', 0); |
|
| 34 | - $customtagObj->setVar('tag', ''); |
|
| 35 | - |
|
| 36 | - if ($showmenu) { |
|
| 37 | - //smart_adminMenu(2, _AM_SOBJECT_CUSTOMTAGS . " > " . _CO_SOBJECT_CREATINGNEW); |
|
| 38 | - } |
|
| 39 | - |
|
| 40 | - smart_collapsableBar('customtagcreate', _AM_SOBJECT_CUSTOMTAGS_CREATE, _AM_SOBJECT_CUSTOMTAGS_CREATE_INFO); |
|
| 41 | - $sform = $customtagObj->getForm(_AM_SOBJECT_CUSTOMTAGS_CREATE, 'addcustomtag'); |
|
| 42 | - $sform->display(); |
|
| 43 | - smart_close_collapsable('customtagcreate'); |
|
| 44 | - } |
|
| 19 | + global $smartobjectCustomtagHandler; |
|
| 20 | + |
|
| 21 | + $customtagObj = $smartobjectCustomtagHandler->get($customtagid); |
|
| 22 | + |
|
| 23 | + if (!$clone && !$customtagObj->isNew()) { |
|
| 24 | + if ($showmenu) { |
|
| 25 | + //smart_adminMenu(2, _AM_SOBJECT_CUSTOMTAGS . " > " . _AM_SOBJECT_EDITING); |
|
| 26 | + } |
|
| 27 | + smart_collapsableBar('customtagedit', _AM_SOBJECT_CUSTOMTAGS_EDIT, _AM_SOBJECT_CUSTOMTAGS_EDIT_INFO); |
|
| 28 | + |
|
| 29 | + $sform = $customtagObj->getForm(_AM_SOBJECT_CUSTOMTAGS_EDIT, 'addcustomtag'); |
|
| 30 | + $sform->display(); |
|
| 31 | + smart_close_collapsable('customtagedit'); |
|
| 32 | + } else { |
|
| 33 | + $customtagObj->setVar('customtagid', 0); |
|
| 34 | + $customtagObj->setVar('tag', ''); |
|
| 35 | + |
|
| 36 | + if ($showmenu) { |
|
| 37 | + //smart_adminMenu(2, _AM_SOBJECT_CUSTOMTAGS . " > " . _CO_SOBJECT_CREATINGNEW); |
|
| 38 | + } |
|
| 39 | + |
|
| 40 | + smart_collapsableBar('customtagcreate', _AM_SOBJECT_CUSTOMTAGS_CREATE, _AM_SOBJECT_CUSTOMTAGS_CREATE_INFO); |
|
| 41 | + $sform = $customtagObj->getForm(_AM_SOBJECT_CUSTOMTAGS_CREATE, 'addcustomtag'); |
|
| 42 | + $sform->display(); |
|
| 43 | + smart_close_collapsable('customtagcreate'); |
|
| 44 | + } |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | require_once __DIR__ . '/admin_header.php'; |
@@ -56,70 +56,70 @@ discard block |
||
| 56 | 56 | $op = ''; |
| 57 | 57 | |
| 58 | 58 | if (isset($_GET['op'])) { |
| 59 | - $op = $_GET['op']; |
|
| 59 | + $op = $_GET['op']; |
|
| 60 | 60 | } |
| 61 | 61 | if (isset($_POST['op'])) { |
| 62 | - $op = $_POST['op']; |
|
| 62 | + $op = $_POST['op']; |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | switch ($op) { |
| 66 | - case 'mod': |
|
| 66 | + case 'mod': |
|
| 67 | 67 | |
| 68 | - $customtagid = isset($_GET['customtagid']) ? (int)$_GET['customtagid'] : 0; |
|
| 68 | + $customtagid = isset($_GET['customtagid']) ? (int)$_GET['customtagid'] : 0; |
|
| 69 | 69 | |
| 70 | - smart_xoops_cp_header(); |
|
| 71 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 70 | + smart_xoops_cp_header(); |
|
| 71 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 72 | 72 | |
| 73 | - editcustomtag(true, $customtagid); |
|
| 74 | - break; |
|
| 73 | + editcustomtag(true, $customtagid); |
|
| 74 | + break; |
|
| 75 | 75 | |
| 76 | - case 'clone': |
|
| 76 | + case 'clone': |
|
| 77 | 77 | |
| 78 | - $customtagid = isset($_GET['customtagid']) ? (int)$_GET['customtagid'] : 0; |
|
| 78 | + $customtagid = isset($_GET['customtagid']) ? (int)$_GET['customtagid'] : 0; |
|
| 79 | 79 | |
| 80 | - smart_xoops_cp_header(); |
|
| 81 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 80 | + smart_xoops_cp_header(); |
|
| 81 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 82 | 82 | |
| 83 | - editcustomtag(true, $customtagid, true); |
|
| 84 | - break; |
|
| 83 | + editcustomtag(true, $customtagid, true); |
|
| 84 | + break; |
|
| 85 | 85 | |
| 86 | - case 'addcustomtag': |
|
| 87 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 88 | - $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectCustomtagHandler); |
|
| 89 | - $controller->storeFromDefaultForm(_AM_SOBJECT_CUSTOMTAGS_CREATED, _AM_SOBJECT_CUSTOMTAGS_MODIFIED); |
|
| 90 | - break; |
|
| 86 | + case 'addcustomtag': |
|
| 87 | + require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 88 | + $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectCustomtagHandler); |
|
| 89 | + $controller->storeFromDefaultForm(_AM_SOBJECT_CUSTOMTAGS_CREATED, _AM_SOBJECT_CUSTOMTAGS_MODIFIED); |
|
| 90 | + break; |
|
| 91 | 91 | |
| 92 | - case 'del': |
|
| 92 | + case 'del': |
|
| 93 | 93 | |
| 94 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 95 | - $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectCustomtagHandler); |
|
| 96 | - $controller->handleObjectDeletion(); |
|
| 94 | + require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 95 | + $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectCustomtagHandler); |
|
| 96 | + $controller->handleObjectDeletion(); |
|
| 97 | 97 | |
| 98 | - break; |
|
| 98 | + break; |
|
| 99 | 99 | |
| 100 | - default: |
|
| 100 | + default: |
|
| 101 | 101 | |
| 102 | - smart_xoops_cp_header(); |
|
| 103 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 104 | - $adminObject->addItemButton(_AM_SOBJECT_CUSTOMTAGS_CREATE, 'customtag.php?op=mod', 'add', ''); |
|
| 105 | - $adminObject->displayButton('left', ''); |
|
| 102 | + smart_xoops_cp_header(); |
|
| 103 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 104 | + $adminObject->addItemButton(_AM_SOBJECT_CUSTOMTAGS_CREATE, 'customtag.php?op=mod', 'add', ''); |
|
| 105 | + $adminObject->displayButton('left', ''); |
|
| 106 | 106 | |
| 107 | - //smart_adminMenu(2, _AM_SOBJECT_CUSTOMTAGS); |
|
| 107 | + //smart_adminMenu(2, _AM_SOBJECT_CUSTOMTAGS); |
|
| 108 | 108 | |
| 109 | - smart_collapsableBar('createdcustomtags', _AM_SOBJECT_CUSTOMTAGS, _AM_SOBJECT_CUSTOMTAGS_DSC); |
|
| 109 | + smart_collapsableBar('createdcustomtags', _AM_SOBJECT_CUSTOMTAGS, _AM_SOBJECT_CUSTOMTAGS_DSC); |
|
| 110 | 110 | |
| 111 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 112 | - $objectTable = new XoopsModules\Smartobject\SmartObjectTable($smartobjectCustomtagHandler); |
|
| 113 | - $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('name', 'left', 150, 'getCustomtagName')); |
|
| 114 | - $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('description', 'left')); |
|
| 115 | - $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('language', 'center', 150)); |
|
| 111 | + require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 112 | + $objectTable = new XoopsModules\Smartobject\SmartObjectTable($smartobjectCustomtagHandler); |
|
| 113 | + $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('name', 'left', 150, 'getCustomtagName')); |
|
| 114 | + $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('description', 'left')); |
|
| 115 | + $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('language', 'center', 150)); |
|
| 116 | 116 | |
| 117 | - // $objectTable->addCustomAction('getCreateItemLink'); |
|
| 118 | - // $objectTable->addCustomAction('getCreateAttributLink'); |
|
| 117 | + // $objectTable->addCustomAction('getCreateItemLink'); |
|
| 118 | + // $objectTable->addCustomAction('getCreateAttributLink'); |
|
| 119 | 119 | |
| 120 | - // $objectTable->addIntroButton('addcustomtag', 'customtag.php?op=mod', _AM_SOBJECT_CUSTOMTAGS_CREATE); //mb button |
|
| 120 | + // $objectTable->addIntroButton('addcustomtag', 'customtag.php?op=mod', _AM_SOBJECT_CUSTOMTAGS_CREATE); //mb button |
|
| 121 | 121 | |
| 122 | - /* |
|
| 122 | + /* |
|
| 123 | 123 | $criteria_upcoming = new \CriteriaCompo(); |
| 124 | 124 | $criteria_upcoming->add(new \Criteria('start_date', time(), '>')); |
| 125 | 125 | $objectTable->addFilter(_AM_SOBJECT_FILTER_UPCOMING, array( |
@@ -143,16 +143,16 @@ discard block |
||
| 143 | 143 | 'criteria' => $criteria_last30days |
| 144 | 144 | )); |
| 145 | 145 | */ |
| 146 | - $objectTable->addQuickSearch(['title', 'summary', 'description']); |
|
| 147 | - $objectTable->addCustomAction('getCloneLink'); |
|
| 146 | + $objectTable->addQuickSearch(['title', 'summary', 'description']); |
|
| 147 | + $objectTable->addCustomAction('getCloneLink'); |
|
| 148 | 148 | |
| 149 | - $objectTable->render(); |
|
| 149 | + $objectTable->render(); |
|
| 150 | 150 | |
| 151 | - echo '<br>'; |
|
| 152 | - smart_close_collapsable('createdcustomtags'); |
|
| 153 | - echo '<br>'; |
|
| 151 | + echo '<br>'; |
|
| 152 | + smart_close_collapsable('createdcustomtags'); |
|
| 153 | + echo '<br>'; |
|
| 154 | 154 | |
| 155 | - break; |
|
| 155 | + break; |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | //smart_modFooter(); |
@@ -63,63 +63,63 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | switch ($op) { |
| 66 | - case 'mod': |
|
| 66 | + case 'mod': |
|
| 67 | 67 | |
| 68 | - $customtagid = isset($_GET['customtagid']) ? (int)$_GET['customtagid'] : 0; |
|
| 68 | + $customtagid = isset($_GET['customtagid']) ? (int)$_GET['customtagid'] : 0; |
|
| 69 | 69 | |
| 70 | - smart_xoops_cp_header(); |
|
| 71 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 70 | + smart_xoops_cp_header(); |
|
| 71 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 72 | 72 | |
| 73 | - editcustomtag(true, $customtagid); |
|
| 74 | - break; |
|
| 73 | + editcustomtag(true, $customtagid); |
|
| 74 | + break; |
|
| 75 | 75 | |
| 76 | - case 'clone': |
|
| 76 | + case 'clone': |
|
| 77 | 77 | |
| 78 | - $customtagid = isset($_GET['customtagid']) ? (int)$_GET['customtagid'] : 0; |
|
| 78 | + $customtagid = isset($_GET['customtagid']) ? (int)$_GET['customtagid'] : 0; |
|
| 79 | 79 | |
| 80 | - smart_xoops_cp_header(); |
|
| 81 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 80 | + smart_xoops_cp_header(); |
|
| 81 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 82 | 82 | |
| 83 | - editcustomtag(true, $customtagid, true); |
|
| 84 | - break; |
|
| 83 | + editcustomtag(true, $customtagid, true); |
|
| 84 | + break; |
|
| 85 | 85 | |
| 86 | - case 'addcustomtag': |
|
| 87 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 88 | - $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectCustomtagHandler); |
|
| 89 | - $controller->storeFromDefaultForm(_AM_SOBJECT_CUSTOMTAGS_CREATED, _AM_SOBJECT_CUSTOMTAGS_MODIFIED); |
|
| 90 | - break; |
|
| 86 | + case 'addcustomtag': |
|
| 87 | + require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 88 | + $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectCustomtagHandler); |
|
| 89 | + $controller->storeFromDefaultForm(_AM_SOBJECT_CUSTOMTAGS_CREATED, _AM_SOBJECT_CUSTOMTAGS_MODIFIED); |
|
| 90 | + break; |
|
| 91 | 91 | |
| 92 | - case 'del': |
|
| 92 | + case 'del': |
|
| 93 | 93 | |
| 94 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 95 | - $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectCustomtagHandler); |
|
| 96 | - $controller->handleObjectDeletion(); |
|
| 94 | + require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 95 | + $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectCustomtagHandler); |
|
| 96 | + $controller->handleObjectDeletion(); |
|
| 97 | 97 | |
| 98 | - break; |
|
| 98 | + break; |
|
| 99 | 99 | |
| 100 | - default: |
|
| 100 | + default: |
|
| 101 | 101 | |
| 102 | - smart_xoops_cp_header(); |
|
| 103 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 104 | - $adminObject->addItemButton(_AM_SOBJECT_CUSTOMTAGS_CREATE, 'customtag.php?op=mod', 'add', ''); |
|
| 105 | - $adminObject->displayButton('left', ''); |
|
| 102 | + smart_xoops_cp_header(); |
|
| 103 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 104 | + $adminObject->addItemButton(_AM_SOBJECT_CUSTOMTAGS_CREATE, 'customtag.php?op=mod', 'add', ''); |
|
| 105 | + $adminObject->displayButton('left', ''); |
|
| 106 | 106 | |
| 107 | - //smart_adminMenu(2, _AM_SOBJECT_CUSTOMTAGS); |
|
| 107 | + //smart_adminMenu(2, _AM_SOBJECT_CUSTOMTAGS); |
|
| 108 | 108 | |
| 109 | - smart_collapsableBar('createdcustomtags', _AM_SOBJECT_CUSTOMTAGS, _AM_SOBJECT_CUSTOMTAGS_DSC); |
|
| 109 | + smart_collapsableBar('createdcustomtags', _AM_SOBJECT_CUSTOMTAGS, _AM_SOBJECT_CUSTOMTAGS_DSC); |
|
| 110 | 110 | |
| 111 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 112 | - $objectTable = new XoopsModules\Smartobject\SmartObjectTable($smartobjectCustomtagHandler); |
|
| 113 | - $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('name', 'left', 150, 'getCustomtagName')); |
|
| 114 | - $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('description', 'left')); |
|
| 115 | - $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('language', 'center', 150)); |
|
| 111 | + require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 112 | + $objectTable = new XoopsModules\Smartobject\SmartObjectTable($smartobjectCustomtagHandler); |
|
| 113 | + $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('name', 'left', 150, 'getCustomtagName')); |
|
| 114 | + $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('description', 'left')); |
|
| 115 | + $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('language', 'center', 150)); |
|
| 116 | 116 | |
| 117 | - // $objectTable->addCustomAction('getCreateItemLink'); |
|
| 118 | - // $objectTable->addCustomAction('getCreateAttributLink'); |
|
| 117 | + // $objectTable->addCustomAction('getCreateItemLink'); |
|
| 118 | + // $objectTable->addCustomAction('getCreateAttributLink'); |
|
| 119 | 119 | |
| 120 | - // $objectTable->addIntroButton('addcustomtag', 'customtag.php?op=mod', _AM_SOBJECT_CUSTOMTAGS_CREATE); //mb button |
|
| 120 | + // $objectTable->addIntroButton('addcustomtag', 'customtag.php?op=mod', _AM_SOBJECT_CUSTOMTAGS_CREATE); //mb button |
|
| 121 | 121 | |
| 122 | - /* |
|
| 122 | + /* |
|
| 123 | 123 | $criteria_upcoming = new \CriteriaCompo(); |
| 124 | 124 | $criteria_upcoming->add(new \Criteria('start_date', time(), '>')); |
| 125 | 125 | $objectTable->addFilter(_AM_SOBJECT_FILTER_UPCOMING, array( |
@@ -143,16 +143,16 @@ discard block |
||
| 143 | 143 | 'criteria' => $criteria_last30days |
| 144 | 144 | )); |
| 145 | 145 | */ |
| 146 | - $objectTable->addQuickSearch(['title', 'summary', 'description']); |
|
| 147 | - $objectTable->addCustomAction('getCloneLink'); |
|
| 146 | + $objectTable->addQuickSearch(['title', 'summary', 'description']); |
|
| 147 | + $objectTable->addCustomAction('getCloneLink'); |
|
| 148 | 148 | |
| 149 | - $objectTable->render(); |
|
| 149 | + $objectTable->render(); |
|
| 150 | 150 | |
| 151 | - echo '<br>'; |
|
| 152 | - smart_close_collapsable('createdcustomtags'); |
|
| 153 | - echo '<br>'; |
|
| 151 | + echo '<br>'; |
|
| 152 | + smart_close_collapsable('createdcustomtags'); |
|
| 153 | + echo '<br>'; |
|
| 154 | 154 | |
| 155 | - break; |
|
| 155 | + break; |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | //smart_modFooter(); |
@@ -44,11 +44,11 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | -require_once __DIR__ . '/admin_header.php'; |
|
| 47 | +require_once __DIR__.'/admin_header.php'; |
|
| 48 | 48 | smart_loadLanguageFile('smartobject', 'customtag'); |
| 49 | 49 | |
| 50 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 51 | -require_once SMARTOBJECT_ROOT_PATH . 'class/customtag.php'; |
|
| 50 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php'; |
|
| 51 | +require_once SMARTOBJECT_ROOT_PATH.'class/customtag.php'; |
|
| 52 | 52 | $smartobjectCustomtagHandler = xoops_getModuleHandler('customtag'); |
| 53 | 53 | |
| 54 | 54 | $adminObject = \Xmf\Module\Admin::getInstance(); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | switch ($op) { |
| 66 | 66 | case 'mod': |
| 67 | 67 | |
| 68 | - $customtagid = isset($_GET['customtagid']) ? (int)$_GET['customtagid'] : 0; |
|
| 68 | + $customtagid = isset($_GET['customtagid']) ? (int) $_GET['customtagid'] : 0; |
|
| 69 | 69 | |
| 70 | 70 | smart_xoops_cp_header(); |
| 71 | 71 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | case 'clone': |
| 77 | 77 | |
| 78 | - $customtagid = isset($_GET['customtagid']) ? (int)$_GET['customtagid'] : 0; |
|
| 78 | + $customtagid = isset($_GET['customtagid']) ? (int) $_GET['customtagid'] : 0; |
|
| 79 | 79 | |
| 80 | 80 | smart_xoops_cp_header(); |
| 81 | 81 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -84,14 +84,14 @@ discard block |
||
| 84 | 84 | break; |
| 85 | 85 | |
| 86 | 86 | case 'addcustomtag': |
| 87 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 87 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 88 | 88 | $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectCustomtagHandler); |
| 89 | 89 | $controller->storeFromDefaultForm(_AM_SOBJECT_CUSTOMTAGS_CREATED, _AM_SOBJECT_CUSTOMTAGS_MODIFIED); |
| 90 | 90 | break; |
| 91 | 91 | |
| 92 | 92 | case 'del': |
| 93 | 93 | |
| 94 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 94 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 95 | 95 | $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectCustomtagHandler); |
| 96 | 96 | $controller->handleObjectDeletion(); |
| 97 | 97 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | smart_collapsableBar('createdcustomtags', _AM_SOBJECT_CUSTOMTAGS, _AM_SOBJECT_CUSTOMTAGS_DSC); |
| 110 | 110 | |
| 111 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 111 | + require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php'; |
|
| 112 | 112 | $objectTable = new XoopsModules\Smartobject\SmartObjectTable($smartobjectCustomtagHandler); |
| 113 | 113 | $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('name', 'left', 150, 'getCustomtagName')); |
| 114 | 114 | $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('description', 'left')); |
@@ -157,4 +157,4 @@ discard block |
||
| 157 | 157 | |
| 158 | 158 | //smart_modFooter(); |
| 159 | 159 | //xoops_cp_footer(); |
| 160 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 160 | +require_once __DIR__.'/admin_footer.php'; |
|
@@ -12,32 +12,32 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | function editclass($showmenu = false, $adsenseid = 0, $clone = false) |
| 14 | 14 | { |
| 15 | - global $smartobjectAdsenseHandler; |
|
| 16 | - |
|
| 17 | - $adsenseObj = $smartobjectAdsenseHandler->get($adsenseid); |
|
| 18 | - |
|
| 19 | - if (!$clone && !$adsenseObj->isNew()) { |
|
| 20 | - if ($showmenu) { |
|
| 21 | - //smart_adminMenu(3, _AM_SOBJECT_ADSENSES . " > " . _AM_SOBJECT_EDITING); |
|
| 22 | - } |
|
| 23 | - smart_collapsableBar('adsenseedit', _AM_SOBJECT_ADSENSES_EDIT, _AM_SOBJECT_ADSENSES_EDIT_INFO); |
|
| 24 | - |
|
| 25 | - $sform = $adsenseObj->getForm(_AM_SOBJECT_ADSENSES_EDIT, 'addadsense'); |
|
| 26 | - $sform->display(); |
|
| 27 | - smart_close_collapsable('adsenseedit'); |
|
| 28 | - } else { |
|
| 29 | - $adsenseObj->setVar('adsenseid', 0); |
|
| 30 | - $adsenseObj->setVar('tag', ''); |
|
| 31 | - |
|
| 32 | - if ($showmenu) { |
|
| 33 | - //smart_adminMenu(3, _AM_SOBJECT_ADSENSES . " > " . _CO_SOBJECT_CREATINGNEW); |
|
| 34 | - } |
|
| 35 | - |
|
| 36 | - smart_collapsableBar('adsensecreate', _AM_SOBJECT_ADSENSES_CREATE, _AM_SOBJECT_ADSENSES_CREATE_INFO); |
|
| 37 | - $sform = $adsenseObj->getForm(_AM_SOBJECT_ADSENSES_CREATE, 'addadsense', false, false, false, true); |
|
| 38 | - $sform->display(); |
|
| 39 | - smart_close_collapsable('adsensecreate'); |
|
| 40 | - } |
|
| 15 | + global $smartobjectAdsenseHandler; |
|
| 16 | + |
|
| 17 | + $adsenseObj = $smartobjectAdsenseHandler->get($adsenseid); |
|
| 18 | + |
|
| 19 | + if (!$clone && !$adsenseObj->isNew()) { |
|
| 20 | + if ($showmenu) { |
|
| 21 | + //smart_adminMenu(3, _AM_SOBJECT_ADSENSES . " > " . _AM_SOBJECT_EDITING); |
|
| 22 | + } |
|
| 23 | + smart_collapsableBar('adsenseedit', _AM_SOBJECT_ADSENSES_EDIT, _AM_SOBJECT_ADSENSES_EDIT_INFO); |
|
| 24 | + |
|
| 25 | + $sform = $adsenseObj->getForm(_AM_SOBJECT_ADSENSES_EDIT, 'addadsense'); |
|
| 26 | + $sform->display(); |
|
| 27 | + smart_close_collapsable('adsenseedit'); |
|
| 28 | + } else { |
|
| 29 | + $adsenseObj->setVar('adsenseid', 0); |
|
| 30 | + $adsenseObj->setVar('tag', ''); |
|
| 31 | + |
|
| 32 | + if ($showmenu) { |
|
| 33 | + //smart_adminMenu(3, _AM_SOBJECT_ADSENSES . " > " . _CO_SOBJECT_CREATINGNEW); |
|
| 34 | + } |
|
| 35 | + |
|
| 36 | + smart_collapsableBar('adsensecreate', _AM_SOBJECT_ADSENSES_CREATE, _AM_SOBJECT_ADSENSES_CREATE_INFO); |
|
| 37 | + $sform = $adsenseObj->getForm(_AM_SOBJECT_ADSENSES_CREATE, 'addadsense', false, false, false, true); |
|
| 38 | + $sform->display(); |
|
| 39 | + smart_close_collapsable('adsensecreate'); |
|
| 40 | + } |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | require_once __DIR__ . '/admin_header.php'; |
@@ -50,72 +50,72 @@ discard block |
||
| 50 | 50 | $op = ''; |
| 51 | 51 | |
| 52 | 52 | if (isset($_GET['op'])) { |
| 53 | - $op = $_GET['op']; |
|
| 53 | + $op = $_GET['op']; |
|
| 54 | 54 | } |
| 55 | 55 | if (isset($_POST['op'])) { |
| 56 | - $op = $_POST['op']; |
|
| 56 | + $op = $_POST['op']; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | switch ($op) { |
| 60 | - case 'mod': |
|
| 60 | + case 'mod': |
|
| 61 | 61 | |
| 62 | - $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0; |
|
| 62 | + $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0; |
|
| 63 | 63 | |
| 64 | - smart_xoops_cp_header(); |
|
| 65 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 64 | + smart_xoops_cp_header(); |
|
| 65 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 66 | 66 | |
| 67 | - editclass(true, $adsenseid); |
|
| 68 | - break; |
|
| 67 | + editclass(true, $adsenseid); |
|
| 68 | + break; |
|
| 69 | 69 | |
| 70 | - case 'clone': |
|
| 70 | + case 'clone': |
|
| 71 | 71 | |
| 72 | - $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0; |
|
| 72 | + $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0; |
|
| 73 | 73 | |
| 74 | - smart_xoops_cp_header(); |
|
| 75 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 74 | + smart_xoops_cp_header(); |
|
| 75 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 76 | 76 | |
| 77 | - editclass(true, $adsenseid, true); |
|
| 78 | - break; |
|
| 77 | + editclass(true, $adsenseid, true); |
|
| 78 | + break; |
|
| 79 | 79 | |
| 80 | - case 'addadsense': |
|
| 81 | - if (@require_once SMARTOBJECT_ROOT_PATH . 'include/captcha/captcha.php') { |
|
| 82 | - $xoopsCaptcha = XoopsCaptcha::getInstance(); |
|
| 83 | - if (!$xoopsCaptcha->verify()) { |
|
| 84 | - redirect_header('javascript:history.go(-1);', 3, $xoopsCaptcha->getMessage()); |
|
| 85 | - } |
|
| 86 | - } |
|
| 87 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 88 | - $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectAdsenseHandler); |
|
| 89 | - $controller->storeFromDefaultForm(_AM_SOBJECT_ADSENSES_CREATED, _AM_SOBJECT_ADSENSES_MODIFIED); |
|
| 90 | - break; |
|
| 80 | + case 'addadsense': |
|
| 81 | + if (@require_once SMARTOBJECT_ROOT_PATH . 'include/captcha/captcha.php') { |
|
| 82 | + $xoopsCaptcha = XoopsCaptcha::getInstance(); |
|
| 83 | + if (!$xoopsCaptcha->verify()) { |
|
| 84 | + redirect_header('javascript:history.go(-1);', 3, $xoopsCaptcha->getMessage()); |
|
| 85 | + } |
|
| 86 | + } |
|
| 87 | + require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 88 | + $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectAdsenseHandler); |
|
| 89 | + $controller->storeFromDefaultForm(_AM_SOBJECT_ADSENSES_CREATED, _AM_SOBJECT_ADSENSES_MODIFIED); |
|
| 90 | + break; |
|
| 91 | 91 | |
| 92 | - case 'del': |
|
| 92 | + case 'del': |
|
| 93 | 93 | |
| 94 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 95 | - $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectAdsenseHandler); |
|
| 96 | - $controller->handleObjectDeletion(); |
|
| 94 | + require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 95 | + $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectAdsenseHandler); |
|
| 96 | + $controller->handleObjectDeletion(); |
|
| 97 | 97 | |
| 98 | - break; |
|
| 98 | + break; |
|
| 99 | 99 | |
| 100 | - default: |
|
| 100 | + default: |
|
| 101 | 101 | |
| 102 | - smart_xoops_cp_header(); |
|
| 103 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 102 | + smart_xoops_cp_header(); |
|
| 103 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 104 | 104 | |
| 105 | - //smart_adminMenu(3, _AM_SOBJECT_ADSENSES); |
|
| 105 | + //smart_adminMenu(3, _AM_SOBJECT_ADSENSES); |
|
| 106 | 106 | |
| 107 | - smart_collapsableBar('createdadsenses', _AM_SOBJECT_ADSENSES, _AM_SOBJECT_ADSENSES_DSC); |
|
| 107 | + smart_collapsableBar('createdadsenses', _AM_SOBJECT_ADSENSES, _AM_SOBJECT_ADSENSES_DSC); |
|
| 108 | 108 | |
| 109 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 110 | - $objectTable = new XoopsModules\Smartobject\SmartObjectTable($smartobjectAdsenseHandler); |
|
| 111 | - $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('description', 'left')); |
|
| 112 | - $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn(_AM_SOBJECT_ADSENSE_TAG, 'center', 200, 'getXoopsCode')); |
|
| 109 | + require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 110 | + $objectTable = new XoopsModules\Smartobject\SmartObjectTable($smartobjectAdsenseHandler); |
|
| 111 | + $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('description', 'left')); |
|
| 112 | + $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn(_AM_SOBJECT_ADSENSE_TAG, 'center', 200, 'getXoopsCode')); |
|
| 113 | 113 | |
| 114 | - // $objectTable->addCustomAction('getCreateItemLink'); |
|
| 115 | - // $objectTable->addCustomAction('getCreateAttributLink'); |
|
| 114 | + // $objectTable->addCustomAction('getCreateItemLink'); |
|
| 115 | + // $objectTable->addCustomAction('getCreateAttributLink'); |
|
| 116 | 116 | |
| 117 | - $objectTable->addIntroButton('addadsense', 'adsense.php?op=mod', _AM_SOBJECT_ADSENSES_CREATE); |
|
| 118 | - /* |
|
| 117 | + $objectTable->addIntroButton('addadsense', 'adsense.php?op=mod', _AM_SOBJECT_ADSENSES_CREATE); |
|
| 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(['title', 'summary', 'description']); |
|
| 143 | - $objectTable->addCustomAction('getCloneLink'); |
|
| 142 | + $objectTable->addQuickSearch(['title', 'summary', 'description']); |
|
| 143 | + $objectTable->addCustomAction('getCloneLink'); |
|
| 144 | 144 | |
| 145 | - $objectTable->render(); |
|
| 145 | + $objectTable->render(); |
|
| 146 | 146 | |
| 147 | - echo '<br>'; |
|
| 148 | - smart_close_collapsable('createdadsenses'); |
|
| 149 | - echo '<br>'; |
|
| 147 | + echo '<br>'; |
|
| 148 | + smart_close_collapsable('createdadsenses'); |
|
| 149 | + echo '<br>'; |
|
| 150 | 150 | |
| 151 | - break; |
|
| 151 | + break; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | //smart_modFooter(); |
@@ -57,65 +57,65 @@ discard block |
||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | switch ($op) { |
| 60 | - case 'mod': |
|
| 60 | + case 'mod': |
|
| 61 | 61 | |
| 62 | - $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0; |
|
| 62 | + $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0; |
|
| 63 | 63 | |
| 64 | - smart_xoops_cp_header(); |
|
| 65 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 64 | + smart_xoops_cp_header(); |
|
| 65 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 66 | 66 | |
| 67 | - editclass(true, $adsenseid); |
|
| 68 | - break; |
|
| 67 | + editclass(true, $adsenseid); |
|
| 68 | + break; |
|
| 69 | 69 | |
| 70 | - case 'clone': |
|
| 70 | + case 'clone': |
|
| 71 | 71 | |
| 72 | - $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0; |
|
| 72 | + $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0; |
|
| 73 | 73 | |
| 74 | - smart_xoops_cp_header(); |
|
| 75 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 74 | + smart_xoops_cp_header(); |
|
| 75 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 76 | 76 | |
| 77 | - editclass(true, $adsenseid, true); |
|
| 78 | - break; |
|
| 77 | + editclass(true, $adsenseid, true); |
|
| 78 | + break; |
|
| 79 | 79 | |
| 80 | - case 'addadsense': |
|
| 81 | - if (@require_once SMARTOBJECT_ROOT_PATH . 'include/captcha/captcha.php') { |
|
| 82 | - $xoopsCaptcha = XoopsCaptcha::getInstance(); |
|
| 83 | - if (!$xoopsCaptcha->verify()) { |
|
| 84 | - redirect_header('javascript:history.go(-1);', 3, $xoopsCaptcha->getMessage()); |
|
| 85 | - } |
|
| 86 | - } |
|
| 87 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 88 | - $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectAdsenseHandler); |
|
| 89 | - $controller->storeFromDefaultForm(_AM_SOBJECT_ADSENSES_CREATED, _AM_SOBJECT_ADSENSES_MODIFIED); |
|
| 90 | - break; |
|
| 80 | + case 'addadsense': |
|
| 81 | + if (@require_once SMARTOBJECT_ROOT_PATH . 'include/captcha/captcha.php') { |
|
| 82 | + $xoopsCaptcha = XoopsCaptcha::getInstance(); |
|
| 83 | + if (!$xoopsCaptcha->verify()) { |
|
| 84 | + redirect_header('javascript:history.go(-1);', 3, $xoopsCaptcha->getMessage()); |
|
| 85 | + } |
|
| 86 | + } |
|
| 87 | + require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 88 | + $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectAdsenseHandler); |
|
| 89 | + $controller->storeFromDefaultForm(_AM_SOBJECT_ADSENSES_CREATED, _AM_SOBJECT_ADSENSES_MODIFIED); |
|
| 90 | + break; |
|
| 91 | 91 | |
| 92 | - case 'del': |
|
| 92 | + case 'del': |
|
| 93 | 93 | |
| 94 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 95 | - $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectAdsenseHandler); |
|
| 96 | - $controller->handleObjectDeletion(); |
|
| 94 | + require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 95 | + $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectAdsenseHandler); |
|
| 96 | + $controller->handleObjectDeletion(); |
|
| 97 | 97 | |
| 98 | - break; |
|
| 98 | + break; |
|
| 99 | 99 | |
| 100 | - default: |
|
| 100 | + default: |
|
| 101 | 101 | |
| 102 | - smart_xoops_cp_header(); |
|
| 103 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 102 | + smart_xoops_cp_header(); |
|
| 103 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 104 | 104 | |
| 105 | - //smart_adminMenu(3, _AM_SOBJECT_ADSENSES); |
|
| 105 | + //smart_adminMenu(3, _AM_SOBJECT_ADSENSES); |
|
| 106 | 106 | |
| 107 | - smart_collapsableBar('createdadsenses', _AM_SOBJECT_ADSENSES, _AM_SOBJECT_ADSENSES_DSC); |
|
| 107 | + smart_collapsableBar('createdadsenses', _AM_SOBJECT_ADSENSES, _AM_SOBJECT_ADSENSES_DSC); |
|
| 108 | 108 | |
| 109 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 110 | - $objectTable = new XoopsModules\Smartobject\SmartObjectTable($smartobjectAdsenseHandler); |
|
| 111 | - $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('description', 'left')); |
|
| 112 | - $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn(_AM_SOBJECT_ADSENSE_TAG, 'center', 200, 'getXoopsCode')); |
|
| 109 | + require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 110 | + $objectTable = new XoopsModules\Smartobject\SmartObjectTable($smartobjectAdsenseHandler); |
|
| 111 | + $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('description', 'left')); |
|
| 112 | + $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn(_AM_SOBJECT_ADSENSE_TAG, 'center', 200, 'getXoopsCode')); |
|
| 113 | 113 | |
| 114 | - // $objectTable->addCustomAction('getCreateItemLink'); |
|
| 115 | - // $objectTable->addCustomAction('getCreateAttributLink'); |
|
| 114 | + // $objectTable->addCustomAction('getCreateItemLink'); |
|
| 115 | + // $objectTable->addCustomAction('getCreateAttributLink'); |
|
| 116 | 116 | |
| 117 | - $objectTable->addIntroButton('addadsense', 'adsense.php?op=mod', _AM_SOBJECT_ADSENSES_CREATE); |
|
| 118 | - /* |
|
| 117 | + $objectTable->addIntroButton('addadsense', 'adsense.php?op=mod', _AM_SOBJECT_ADSENSES_CREATE); |
|
| 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(['title', 'summary', 'description']); |
|
| 143 | - $objectTable->addCustomAction('getCloneLink'); |
|
| 142 | + $objectTable->addQuickSearch(['title', 'summary', 'description']); |
|
| 143 | + $objectTable->addCustomAction('getCloneLink'); |
|
| 144 | 144 | |
| 145 | - $objectTable->render(); |
|
| 145 | + $objectTable->render(); |
|
| 146 | 146 | |
| 147 | - echo '<br>'; |
|
| 148 | - smart_close_collapsable('createdadsenses'); |
|
| 149 | - echo '<br>'; |
|
| 147 | + echo '<br>'; |
|
| 148 | + smart_close_collapsable('createdadsenses'); |
|
| 149 | + echo '<br>'; |
|
| 150 | 150 | |
| 151 | - break; |
|
| 151 | + break; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | //smart_modFooter(); |
@@ -40,9 +40,9 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | -require_once __DIR__ . '/admin_header.php'; |
|
| 44 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 45 | -require_once SMARTOBJECT_ROOT_PATH . 'class/adsense.php'; |
|
| 43 | +require_once __DIR__.'/admin_header.php'; |
|
| 44 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php'; |
|
| 45 | +require_once SMARTOBJECT_ROOT_PATH.'class/adsense.php'; |
|
| 46 | 46 | $smartobjectAdsenseHandler = xoops_getModuleHandler('adsense'); |
| 47 | 47 | smart_loadLanguageFile('smartobject', 'adsense'); |
| 48 | 48 | $adminObject = \Xmf\Module\Admin::getInstance(); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | switch ($op) { |
| 60 | 60 | case 'mod': |
| 61 | 61 | |
| 62 | - $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0; |
|
| 62 | + $adsenseid = isset($_GET['adsenseid']) ? (int) $_GET['adsenseid'] : 0; |
|
| 63 | 63 | |
| 64 | 64 | smart_xoops_cp_header(); |
| 65 | 65 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | case 'clone': |
| 71 | 71 | |
| 72 | - $adsenseid = isset($_GET['adsenseid']) ? (int)$_GET['adsenseid'] : 0; |
|
| 72 | + $adsenseid = isset($_GET['adsenseid']) ? (int) $_GET['adsenseid'] : 0; |
|
| 73 | 73 | |
| 74 | 74 | smart_xoops_cp_header(); |
| 75 | 75 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -78,20 +78,20 @@ discard block |
||
| 78 | 78 | break; |
| 79 | 79 | |
| 80 | 80 | case 'addadsense': |
| 81 | - if (@require_once SMARTOBJECT_ROOT_PATH . 'include/captcha/captcha.php') { |
|
| 81 | + if (@require_once SMARTOBJECT_ROOT_PATH.'include/captcha/captcha.php') { |
|
| 82 | 82 | $xoopsCaptcha = XoopsCaptcha::getInstance(); |
| 83 | 83 | if (!$xoopsCaptcha->verify()) { |
| 84 | 84 | redirect_header('javascript:history.go(-1);', 3, $xoopsCaptcha->getMessage()); |
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 87 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 88 | 88 | $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectAdsenseHandler); |
| 89 | 89 | $controller->storeFromDefaultForm(_AM_SOBJECT_ADSENSES_CREATED, _AM_SOBJECT_ADSENSES_MODIFIED); |
| 90 | 90 | break; |
| 91 | 91 | |
| 92 | 92 | case 'del': |
| 93 | 93 | |
| 94 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 94 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 95 | 95 | $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectAdsenseHandler); |
| 96 | 96 | $controller->handleObjectDeletion(); |
| 97 | 97 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | smart_collapsableBar('createdadsenses', _AM_SOBJECT_ADSENSES, _AM_SOBJECT_ADSENSES_DSC); |
| 108 | 108 | |
| 109 | - require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
|
| 109 | + require_once SMARTOBJECT_ROOT_PATH.'class/smartobjecttable.php'; |
|
| 110 | 110 | $objectTable = new XoopsModules\Smartobject\SmartObjectTable($smartobjectAdsenseHandler); |
| 111 | 111 | $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn('description', 'left')); |
| 112 | 112 | $objectTable->addColumn(new XoopsModules\Smartobject\SmartObjectColumn(_AM_SOBJECT_ADSENSE_TAG, 'center', 200, 'getXoopsCode')); |
@@ -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'; |
|
@@ -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,9 +18,9 @@ discard block |
||
| 18 | 18 | $adminmenu = []; |
| 19 | 19 | |
| 20 | 20 | $adminmenu[] = [ |
| 21 | - 'title' => _MI_SOBJECT_HOME, |
|
| 22 | - 'link' => 'admin/index.php', |
|
| 23 | - 'icon' => $pathIcon32 . '/home.png', |
|
| 21 | + 'title' => _MI_SOBJECT_HOME, |
|
| 22 | + 'link' => 'admin/index.php', |
|
| 23 | + 'icon' => $pathIcon32 . '/home.png', |
|
| 24 | 24 | ]; |
| 25 | 25 | |
| 26 | 26 | //$adminmenu[] = [ |
@@ -30,76 +30,76 @@ discard block |
||
| 30 | 30 | //]; |
| 31 | 31 | |
| 32 | 32 | $adminmenu[] = [ |
| 33 | - 'title' => _MI_SOBJECT_SENT_LINKS, |
|
| 34 | - 'link' => 'admin/link.php', |
|
| 35 | - 'icon' => $pathIcon32 . '/addlink.png', |
|
| 33 | + 'title' => _MI_SOBJECT_SENT_LINKS, |
|
| 34 | + 'link' => 'admin/link.php', |
|
| 35 | + 'icon' => $pathIcon32 . '/addlink.png', |
|
| 36 | 36 | ]; |
| 37 | 37 | |
| 38 | 38 | $adminmenu[] = [ |
| 39 | - 'title' => _MI_SOBJECT_TAGS, |
|
| 40 | - 'link' => 'admin/customtag.php', |
|
| 41 | - 'icon' => $pathIcon32 . '/identity.png', |
|
| 39 | + 'title' => _MI_SOBJECT_TAGS, |
|
| 40 | + 'link' => 'admin/customtag.php', |
|
| 41 | + 'icon' => $pathIcon32 . '/identity.png', |
|
| 42 | 42 | ]; |
| 43 | 43 | |
| 44 | 44 | $adminmenu[] = [ |
| 45 | - 'title' => _MI_SOBJECT_ADSENSES, |
|
| 46 | - 'link' => 'admin/adsense.php', |
|
| 47 | - 'icon' => $pathIcon32 . '/alert.png', |
|
| 45 | + 'title' => _MI_SOBJECT_ADSENSES, |
|
| 46 | + 'link' => 'admin/adsense.php', |
|
| 47 | + 'icon' => $pathIcon32 . '/alert.png', |
|
| 48 | 48 | ]; |
| 49 | 49 | |
| 50 | 50 | $adminmenu[] = [ |
| 51 | - 'title' => _MI_SOBJECT_RATINGS, |
|
| 52 | - 'link' => 'admin/rating.php', |
|
| 53 | - 'icon' => $pathIcon32 . '/stats.png', |
|
| 51 | + 'title' => _MI_SOBJECT_RATINGS, |
|
| 52 | + 'link' => 'admin/rating.php', |
|
| 53 | + 'icon' => $pathIcon32 . '/stats.png', |
|
| 54 | 54 | ]; |
| 55 | 55 | |
| 56 | 56 | $adminmenu[] = [ |
| 57 | - 'title' => _MI_SOBJECT_ABOUT, |
|
| 58 | - 'link' => 'admin/about.php', |
|
| 59 | - 'icon' => $pathIcon32 . '/about.png', |
|
| 57 | + 'title' => _MI_SOBJECT_ABOUT, |
|
| 58 | + 'link' => 'admin/about.php', |
|
| 59 | + 'icon' => $pathIcon32 . '/about.png', |
|
| 60 | 60 | ]; |
| 61 | 61 | |
| 62 | 62 | //--------------------------------- |
| 63 | 63 | |
| 64 | 64 | if (!defined('SMARTOBJECT_ROOT_PATH')) { |
| 65 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/functions.php'; |
|
| 65 | + require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/functions.php'; |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | $smartobjectConfig = smart_getModuleConfig('smartobject'); |
| 69 | 69 | |
| 70 | 70 | if (isset($smartobjectConfig['enable_currencyman']) && true === $smartobjectConfig['enable_currencyman']) { |
| 71 | - $adminmenu[] = [ |
|
| 72 | - 'title' => _MI_SOBJECT_CURRENCIES, |
|
| 73 | - 'link' => 'admin/currency.php', |
|
| 74 | - 'icon' => $pathIcon32 . '/cash_stack.png', |
|
| 75 | - ]; |
|
| 71 | + $adminmenu[] = [ |
|
| 72 | + 'title' => _MI_SOBJECT_CURRENCIES, |
|
| 73 | + 'link' => 'admin/currency.php', |
|
| 74 | + 'icon' => $pathIcon32 . '/cash_stack.png', |
|
| 75 | + ]; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | global $xoopsModule; |
| 79 | 79 | if (isset($xoopsModule)) { |
| 80 | - $i = -1; |
|
| 81 | - |
|
| 82 | - // --- for XCL --- |
|
| 83 | - // $headermenu[$i]['link'] = '../../system/admin.php?fct=preferences&op=showmod&mod=' . $xoopsModule->getVar('mid'); |
|
| 84 | - $mid = $xoopsModule->getVar('mid'); |
|
| 85 | - if (defined('XOOPS_CUBE_LEGACY')) { |
|
| 86 | - $link_pref = XOOPS_URL . '/modules/legacy/admin/index.php?action=PreferenceEdit&confmod_id=' . $mid; |
|
| 87 | - } else { |
|
| 88 | - $link_pref = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mid; |
|
| 89 | - } |
|
| 90 | - $headermenu[$i]['link'] = $link_pref; |
|
| 91 | - // ----- |
|
| 92 | - |
|
| 93 | - // --- for XCL --- |
|
| 94 | - // $headermenu[$i]['link'] = XOOPS_URL . "/modules/system/admin.php?fct=modulesadmin&op=update&module=" . $xoopsModule->getVar('dirname'); |
|
| 95 | - $dirname = $xoopsModule->getVar('dirname'); |
|
| 96 | - if (defined('XOOPS_CUBE_LEGACY')) { |
|
| 97 | - $link_module = XOOPS_URL . '/modules/legacy/admin/index.php?action=ModuleUpdate&dirname=' . $dirname; |
|
| 98 | - } else { |
|
| 99 | - $link_module = XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin&op=update&module=' . $dirname; |
|
| 100 | - } |
|
| 101 | - $headermenu[$i]['link'] = $link_module; |
|
| 102 | - // ----- |
|
| 103 | - |
|
| 104 | - ++$i; |
|
| 80 | + $i = -1; |
|
| 81 | + |
|
| 82 | + // --- for XCL --- |
|
| 83 | + // $headermenu[$i]['link'] = '../../system/admin.php?fct=preferences&op=showmod&mod=' . $xoopsModule->getVar('mid'); |
|
| 84 | + $mid = $xoopsModule->getVar('mid'); |
|
| 85 | + if (defined('XOOPS_CUBE_LEGACY')) { |
|
| 86 | + $link_pref = XOOPS_URL . '/modules/legacy/admin/index.php?action=PreferenceEdit&confmod_id=' . $mid; |
|
| 87 | + } else { |
|
| 88 | + $link_pref = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mid; |
|
| 89 | + } |
|
| 90 | + $headermenu[$i]['link'] = $link_pref; |
|
| 91 | + // ----- |
|
| 92 | + |
|
| 93 | + // --- for XCL --- |
|
| 94 | + // $headermenu[$i]['link'] = XOOPS_URL . "/modules/system/admin.php?fct=modulesadmin&op=update&module=" . $xoopsModule->getVar('dirname'); |
|
| 95 | + $dirname = $xoopsModule->getVar('dirname'); |
|
| 96 | + if (defined('XOOPS_CUBE_LEGACY')) { |
|
| 97 | + $link_module = XOOPS_URL . '/modules/legacy/admin/index.php?action=ModuleUpdate&dirname=' . $dirname; |
|
| 98 | + } else { |
|
| 99 | + $link_module = XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin&op=update&module=' . $dirname; |
|
| 100 | + } |
|
| 101 | + $headermenu[$i]['link'] = $link_module; |
|
| 102 | + // ----- |
|
| 103 | + |
|
| 104 | + ++$i; |
|
| 105 | 105 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | $adminmenu[] = [ |
| 21 | 21 | 'title' => _MI_SOBJECT_HOME, |
| 22 | 22 | 'link' => 'admin/index.php', |
| 23 | - 'icon' => $pathIcon32 . '/home.png', |
|
| 23 | + 'icon' => $pathIcon32.'/home.png', |
|
| 24 | 24 | ]; |
| 25 | 25 | |
| 26 | 26 | //$adminmenu[] = [ |
@@ -32,37 +32,37 @@ discard block |
||
| 32 | 32 | $adminmenu[] = [ |
| 33 | 33 | 'title' => _MI_SOBJECT_SENT_LINKS, |
| 34 | 34 | 'link' => 'admin/link.php', |
| 35 | - 'icon' => $pathIcon32 . '/addlink.png', |
|
| 35 | + 'icon' => $pathIcon32.'/addlink.png', |
|
| 36 | 36 | ]; |
| 37 | 37 | |
| 38 | 38 | $adminmenu[] = [ |
| 39 | 39 | 'title' => _MI_SOBJECT_TAGS, |
| 40 | 40 | 'link' => 'admin/customtag.php', |
| 41 | - 'icon' => $pathIcon32 . '/identity.png', |
|
| 41 | + 'icon' => $pathIcon32.'/identity.png', |
|
| 42 | 42 | ]; |
| 43 | 43 | |
| 44 | 44 | $adminmenu[] = [ |
| 45 | 45 | 'title' => _MI_SOBJECT_ADSENSES, |
| 46 | 46 | 'link' => 'admin/adsense.php', |
| 47 | - 'icon' => $pathIcon32 . '/alert.png', |
|
| 47 | + 'icon' => $pathIcon32.'/alert.png', |
|
| 48 | 48 | ]; |
| 49 | 49 | |
| 50 | 50 | $adminmenu[] = [ |
| 51 | 51 | 'title' => _MI_SOBJECT_RATINGS, |
| 52 | 52 | 'link' => 'admin/rating.php', |
| 53 | - 'icon' => $pathIcon32 . '/stats.png', |
|
| 53 | + 'icon' => $pathIcon32.'/stats.png', |
|
| 54 | 54 | ]; |
| 55 | 55 | |
| 56 | 56 | $adminmenu[] = [ |
| 57 | 57 | 'title' => _MI_SOBJECT_ABOUT, |
| 58 | 58 | 'link' => 'admin/about.php', |
| 59 | - 'icon' => $pathIcon32 . '/about.png', |
|
| 59 | + 'icon' => $pathIcon32.'/about.png', |
|
| 60 | 60 | ]; |
| 61 | 61 | |
| 62 | 62 | //--------------------------------- |
| 63 | 63 | |
| 64 | 64 | if (!defined('SMARTOBJECT_ROOT_PATH')) { |
| 65 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/functions.php'; |
|
| 65 | + require_once XOOPS_ROOT_PATH.'/modules/smartobject/include/functions.php'; |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | $smartobjectConfig = smart_getModuleConfig('smartobject'); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $adminmenu[] = [ |
| 72 | 72 | 'title' => _MI_SOBJECT_CURRENCIES, |
| 73 | 73 | 'link' => 'admin/currency.php', |
| 74 | - 'icon' => $pathIcon32 . '/cash_stack.png', |
|
| 74 | + 'icon' => $pathIcon32.'/cash_stack.png', |
|
| 75 | 75 | ]; |
| 76 | 76 | } |
| 77 | 77 | |
@@ -83,9 +83,9 @@ discard block |
||
| 83 | 83 | // $headermenu[$i]['link'] = '../../system/admin.php?fct=preferences&op=showmod&mod=' . $xoopsModule->getVar('mid'); |
| 84 | 84 | $mid = $xoopsModule->getVar('mid'); |
| 85 | 85 | if (defined('XOOPS_CUBE_LEGACY')) { |
| 86 | - $link_pref = XOOPS_URL . '/modules/legacy/admin/index.php?action=PreferenceEdit&confmod_id=' . $mid; |
|
| 86 | + $link_pref = XOOPS_URL.'/modules/legacy/admin/index.php?action=PreferenceEdit&confmod_id='.$mid; |
|
| 87 | 87 | } else { |
| 88 | - $link_pref = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mid; |
|
| 88 | + $link_pref = XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=showmod&mod='.$mid; |
|
| 89 | 89 | } |
| 90 | 90 | $headermenu[$i]['link'] = $link_pref; |
| 91 | 91 | // ----- |
@@ -94,9 +94,9 @@ discard block |
||
| 94 | 94 | // $headermenu[$i]['link'] = XOOPS_URL . "/modules/system/admin.php?fct=modulesadmin&op=update&module=" . $xoopsModule->getVar('dirname'); |
| 95 | 95 | $dirname = $xoopsModule->getVar('dirname'); |
| 96 | 96 | if (defined('XOOPS_CUBE_LEGACY')) { |
| 97 | - $link_module = XOOPS_URL . '/modules/legacy/admin/index.php?action=ModuleUpdate&dirname=' . $dirname; |
|
| 97 | + $link_module = XOOPS_URL.'/modules/legacy/admin/index.php?action=ModuleUpdate&dirname='.$dirname; |
|
| 98 | 98 | } else { |
| 99 | - $link_module = XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin&op=update&module=' . $dirname; |
|
| 99 | + $link_module = XOOPS_URL.'/modules/system/admin.php?fct=modulesadmin&op=update&module='.$dirname; |
|
| 100 | 100 | } |
| 101 | 101 | $headermenu[$i]['link'] = $link_module; |
| 102 | 102 | // ----- |
@@ -28,82 +28,82 @@ |
||
| 28 | 28 | $op = isset($_POST['op']) ? $_POST['op'] : ''; |
| 29 | 29 | |
| 30 | 30 | switch ($op) { |
| 31 | - case 'sendlink': |
|
| 32 | - |
|
| 33 | - require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 34 | - $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectLinkHandler); |
|
| 35 | - |
|
| 36 | - $linkObj = $controller->storeSmartObject(); |
|
| 37 | - if ($linkObj->hasError()) { |
|
| 38 | - /** |
|
| 39 | - * @todo inform user and propose to close the window if a problem occured when saving the link |
|
| 40 | - */ |
|
| 41 | - } |
|
| 42 | - |
|
| 43 | - $xoopsMailer = xoops_getMailer(); |
|
| 44 | - $xoopsMailer->useMail(); |
|
| 45 | - $xoopsMailer->setTemplateDir('language/' . $xoopsConfig['language'] . '/mail_template'); |
|
| 46 | - |
|
| 47 | - $xoopsMailer->setTemplate('sendlink.tpl'); |
|
| 48 | - $xoopsMailer->assign('X_SITENAME', $xoopsConfig['sitename']); |
|
| 49 | - $xoopsMailer->assign('TO_NAME', $linkObj->getVar('to_name')); |
|
| 50 | - $xoopsMailer->assign('FROM_NAME', $linkObj->getVar('from_name')); |
|
| 51 | - $xoopsMailer->assign('SITEURL', XOOPS_URL . '/'); |
|
| 52 | - $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']); |
|
| 53 | - $xoopsMailer->assign('MESSAGE', $_POST['body']); |
|
| 54 | - $xoopsMailer->setToEmails($linkObj->getVar('to_email')); |
|
| 55 | - $xoopsMailer->setFromEmail($linkObj->getVar('from_email')); |
|
| 56 | - $xoopsMailer->setFromName($xoopsConfig['sitename']); |
|
| 57 | - $xoopsMailer->setSubject(sprintf(_CO_SOBJECT_SUBJECT_DEFAULT, $myts->oopsStripSlashesGPC($xoopsConfig['sitename']))); |
|
| 58 | - |
|
| 59 | - if (!$xoopsMailer->send(true)) { |
|
| 60 | - $xoopsTpl->assign('send_error', sprintf(_CO_SOBJECT_SEND_ERROR, $xoopsConfig['adminmail']) . '<br>' . $xoopsMailer->getErrors(true)); |
|
| 61 | - } else { |
|
| 62 | - $xoopsTpl->assign('send_success', _CO_SOBJECT_SEND_SUCCESS); |
|
| 63 | - } |
|
| 64 | - |
|
| 65 | - break; |
|
| 66 | - |
|
| 67 | - default: |
|
| 68 | - if (isset($_GET['mid'])) { |
|
| 69 | - $mid = $_GET['mid']; |
|
| 70 | - } else { |
|
| 71 | - /** |
|
| 72 | - * @todo close the window if no mid is passed as GET |
|
| 73 | - */ |
|
| 74 | - } |
|
| 75 | - |
|
| 76 | - $hModule = xoops_getHandler('module'); |
|
| 77 | - $module = $hModule->get($mid); |
|
| 78 | - $linkObj->setVar('mid', $module->getVar('mid')); |
|
| 79 | - $linkObj->setVar('mid_name', $module->getVar('name')); |
|
| 80 | - |
|
| 81 | - if (isset($_GET['link'])) { |
|
| 82 | - $link = $_GET['link']; |
|
| 83 | - } else { |
|
| 84 | - /** |
|
| 85 | - * @todo close the window if no link is passed as GET |
|
| 86 | - */ |
|
| 87 | - } |
|
| 88 | - $linkObj->setVar('link', $link); |
|
| 89 | - |
|
| 90 | - if (is_object($xoopsUser)) { |
|
| 91 | - $linkObj->setVar('from_uid', $xoopsUser->getVar('uid')); |
|
| 92 | - $linkObj->setVar('from_name', '' !== $xoopsUser->getVar('name') ? $xoopsUser->getVar('name') : $xoopsUser->getVar('uname')); |
|
| 93 | - $linkObj->setVar('from_email', $xoopsUser->getVar('email')); |
|
| 94 | - } |
|
| 95 | - |
|
| 96 | - $linkObj->setVar('subject', sprintf(_CO_SOBJECT_SUBJECT_DEFAULT, $xoopsConfig['sitename'])); |
|
| 97 | - $linkObj->setVar('body', sprintf(_CO_SOBJECT_BODY_DEFAULT, $xoopsConfig['sitename'], $link)); |
|
| 98 | - $linkObj->setVar('date', time()); |
|
| 99 | - $linkObj->hideFieldFromForm(['from_uid', 'to_uid', 'link', 'mid', 'mid_name']); |
|
| 100 | - |
|
| 101 | - $form = $linkObj->getForm(_CO_SOBJECT_SEND_LINK_FORM, 'sendlink', false, _SEND, 'javascript:window.close();'); |
|
| 102 | - |
|
| 103 | - $form->assign($xoopsTpl); |
|
| 104 | - |
|
| 105 | - $xoopsTpl->assign('showform', true); |
|
| 106 | - break; |
|
| 31 | + case 'sendlink': |
|
| 32 | + |
|
| 33 | + require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
|
| 34 | + $controller = new XoopsModules\Smartobject\SmartObjectController($smartobjectLinkHandler); |
|
| 35 | + |
|
| 36 | + $linkObj = $controller->storeSmartObject(); |
|
| 37 | + if ($linkObj->hasError()) { |
|
| 38 | + /** |
|
| 39 | + * @todo inform user and propose to close the window if a problem occured when saving the link |
|
| 40 | + */ |
|
| 41 | + } |
|
| 42 | + |
|
| 43 | + $xoopsMailer = xoops_getMailer(); |
|
| 44 | + $xoopsMailer->useMail(); |
|
| 45 | + $xoopsMailer->setTemplateDir('language/' . $xoopsConfig['language'] . '/mail_template'); |
|
| 46 | + |
|
| 47 | + $xoopsMailer->setTemplate('sendlink.tpl'); |
|
| 48 | + $xoopsMailer->assign('X_SITENAME', $xoopsConfig['sitename']); |
|
| 49 | + $xoopsMailer->assign('TO_NAME', $linkObj->getVar('to_name')); |
|
| 50 | + $xoopsMailer->assign('FROM_NAME', $linkObj->getVar('from_name')); |
|
| 51 | + $xoopsMailer->assign('SITEURL', XOOPS_URL . '/'); |
|
| 52 | + $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']); |
|
| 53 | + $xoopsMailer->assign('MESSAGE', $_POST['body']); |
|
| 54 | + $xoopsMailer->setToEmails($linkObj->getVar('to_email')); |
|
| 55 | + $xoopsMailer->setFromEmail($linkObj->getVar('from_email')); |
|
| 56 | + $xoopsMailer->setFromName($xoopsConfig['sitename']); |
|
| 57 | + $xoopsMailer->setSubject(sprintf(_CO_SOBJECT_SUBJECT_DEFAULT, $myts->oopsStripSlashesGPC($xoopsConfig['sitename']))); |
|
| 58 | + |
|
| 59 | + if (!$xoopsMailer->send(true)) { |
|
| 60 | + $xoopsTpl->assign('send_error', sprintf(_CO_SOBJECT_SEND_ERROR, $xoopsConfig['adminmail']) . '<br>' . $xoopsMailer->getErrors(true)); |
|
| 61 | + } else { |
|
| 62 | + $xoopsTpl->assign('send_success', _CO_SOBJECT_SEND_SUCCESS); |
|
| 63 | + } |
|
| 64 | + |
|
| 65 | + break; |
|
| 66 | + |
|
| 67 | + default: |
|
| 68 | + if (isset($_GET['mid'])) { |
|
| 69 | + $mid = $_GET['mid']; |
|
| 70 | + } else { |
|
| 71 | + /** |
|
| 72 | + * @todo close the window if no mid is passed as GET |
|
| 73 | + */ |
|
| 74 | + } |
|
| 75 | + |
|
| 76 | + $hModule = xoops_getHandler('module'); |
|
| 77 | + $module = $hModule->get($mid); |
|
| 78 | + $linkObj->setVar('mid', $module->getVar('mid')); |
|
| 79 | + $linkObj->setVar('mid_name', $module->getVar('name')); |
|
| 80 | + |
|
| 81 | + if (isset($_GET['link'])) { |
|
| 82 | + $link = $_GET['link']; |
|
| 83 | + } else { |
|
| 84 | + /** |
|
| 85 | + * @todo close the window if no link is passed as GET |
|
| 86 | + */ |
|
| 87 | + } |
|
| 88 | + $linkObj->setVar('link', $link); |
|
| 89 | + |
|
| 90 | + if (is_object($xoopsUser)) { |
|
| 91 | + $linkObj->setVar('from_uid', $xoopsUser->getVar('uid')); |
|
| 92 | + $linkObj->setVar('from_name', '' !== $xoopsUser->getVar('name') ? $xoopsUser->getVar('name') : $xoopsUser->getVar('uname')); |
|
| 93 | + $linkObj->setVar('from_email', $xoopsUser->getVar('email')); |
|
| 94 | + } |
|
| 95 | + |
|
| 96 | + $linkObj->setVar('subject', sprintf(_CO_SOBJECT_SUBJECT_DEFAULT, $xoopsConfig['sitename'])); |
|
| 97 | + $linkObj->setVar('body', sprintf(_CO_SOBJECT_BODY_DEFAULT, $xoopsConfig['sitename'], $link)); |
|
| 98 | + $linkObj->setVar('date', time()); |
|
| 99 | + $linkObj->hideFieldFromForm(['from_uid', 'to_uid', 'link', 'mid', 'mid_name']); |
|
| 100 | + |
|
| 101 | + $form = $linkObj->getForm(_CO_SOBJECT_SEND_LINK_FORM, 'sendlink', false, _SEND, 'javascript:window.close();'); |
|
| 102 | + |
|
| 103 | + $form->assign($xoopsTpl); |
|
| 104 | + |
|
| 105 | + $xoopsTpl->assign('showform', true); |
|
| 106 | + break; |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | $xoopsTpl->display('db:smartobject_sendlink.tpl'); |
@@ -9,17 +9,17 @@ discard block |
||
| 9 | 9 | |
| 10 | 10 | use XoopsModules\Smartobject\SmartObjectController; |
| 11 | 11 | |
| 12 | -require_once __DIR__ . '/header.php'; |
|
| 13 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartloader.php'; |
|
| 14 | -require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectlink.php'; |
|
| 15 | -require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 12 | +require_once __DIR__.'/header.php'; |
|
| 13 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartloader.php'; |
|
| 14 | +require_once SMARTOBJECT_ROOT_PATH.'class/smartobjectlink.php'; |
|
| 15 | +require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
| 16 | 16 | |
| 17 | 17 | $xoopsTpl = new \XoopsTpl(); |
| 18 | 18 | $myts = \MyTextSanitizer::getInstance(); |
| 19 | 19 | $xoopsConfig['sitename'] = $myts->displayTarea($xoopsConfig['sitename']); |
| 20 | 20 | |
| 21 | 21 | xoops_header(false); |
| 22 | -echo smart_get_css_link(SMARTOBJECT_URL . 'assets/css/module.css'); |
|
| 22 | +echo smart_get_css_link(SMARTOBJECT_URL.'assets/css/module.css'); |
|
| 23 | 23 | echo '</head><body>'; |
| 24 | 24 | |
| 25 | 25 | $smartobjectLinkHandler = xoops_getModuleHandler('link', 'smartobject'); |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | switch ($op) { |
| 31 | 31 | case 'sendlink': |
| 32 | 32 | |
| 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 XoopsModules\Smartobject\SmartObjectController($smartobjectLinkHandler); |
| 35 | 35 | |
| 36 | 36 | $linkObj = $controller->storeSmartObject(); |
@@ -42,13 +42,13 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | $xoopsMailer = xoops_getMailer(); |
| 44 | 44 | $xoopsMailer->useMail(); |
| 45 | - $xoopsMailer->setTemplateDir('language/' . $xoopsConfig['language'] . '/mail_template'); |
|
| 45 | + $xoopsMailer->setTemplateDir('language/'.$xoopsConfig['language'].'/mail_template'); |
|
| 46 | 46 | |
| 47 | 47 | $xoopsMailer->setTemplate('sendlink.tpl'); |
| 48 | 48 | $xoopsMailer->assign('X_SITENAME', $xoopsConfig['sitename']); |
| 49 | 49 | $xoopsMailer->assign('TO_NAME', $linkObj->getVar('to_name')); |
| 50 | 50 | $xoopsMailer->assign('FROM_NAME', $linkObj->getVar('from_name')); |
| 51 | - $xoopsMailer->assign('SITEURL', XOOPS_URL . '/'); |
|
| 51 | + $xoopsMailer->assign('SITEURL', XOOPS_URL.'/'); |
|
| 52 | 52 | $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']); |
| 53 | 53 | $xoopsMailer->assign('MESSAGE', $_POST['body']); |
| 54 | 54 | $xoopsMailer->setToEmails($linkObj->getVar('to_email')); |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $xoopsMailer->setSubject(sprintf(_CO_SOBJECT_SUBJECT_DEFAULT, $myts->oopsStripSlashesGPC($xoopsConfig['sitename']))); |
| 58 | 58 | |
| 59 | 59 | if (!$xoopsMailer->send(true)) { |
| 60 | - $xoopsTpl->assign('send_error', sprintf(_CO_SOBJECT_SEND_ERROR, $xoopsConfig['adminmail']) . '<br>' . $xoopsMailer->getErrors(true)); |
|
| 60 | + $xoopsTpl->assign('send_error', sprintf(_CO_SOBJECT_SEND_ERROR, $xoopsConfig['adminmail']).'<br>'.$xoopsMailer->getErrors(true)); |
|
| 61 | 61 | } else { |
| 62 | 62 | $xoopsTpl->assign('send_success', _CO_SOBJECT_SEND_SUCCESS); |
| 63 | 63 | } |
@@ -4,29 +4,29 @@ |
||
| 4 | 4 | * @see http://www.php-fig.org/psr/psr-4/examples/ |
| 5 | 5 | */ |
| 6 | 6 | spl_autoload_register(function ($class) { |
| 7 | - // project-specific namespace prefix |
|
| 8 | - $prefix = 'XoopsModules\\' . ucfirst(basename(dirname(__DIR__))); |
|
| 7 | + // project-specific namespace prefix |
|
| 8 | + $prefix = 'XoopsModules\\' . ucfirst(basename(dirname(__DIR__))); |
|
| 9 | 9 | |
| 10 | - // base directory for the namespace prefix |
|
| 11 | - $base_dir = __DIR__ . '/../class/'; |
|
| 10 | + // base directory for the namespace prefix |
|
| 11 | + $base_dir = __DIR__ . '/../class/'; |
|
| 12 | 12 | |
| 13 | - // does the class use the namespace prefix? |
|
| 14 | - $len = strlen($prefix); |
|
| 13 | + // does the class use the namespace prefix? |
|
| 14 | + $len = strlen($prefix); |
|
| 15 | 15 | |
| 16 | - if (0 !== strncmp($prefix, $class, $len)) { |
|
| 17 | - return; |
|
| 18 | - } |
|
| 16 | + if (0 !== strncmp($prefix, $class, $len)) { |
|
| 17 | + return; |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - // get the relative class name |
|
| 21 | - $relative_class = substr($class, $len); |
|
| 20 | + // get the relative class name |
|
| 21 | + $relative_class = substr($class, $len); |
|
| 22 | 22 | |
| 23 | - // replace the namespace prefix with the base directory, replace namespace |
|
| 24 | - // separators with directory separators in the relative class name, append |
|
| 25 | - // with .php |
|
| 26 | - $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; |
|
| 23 | + // replace the namespace prefix with the base directory, replace namespace |
|
| 24 | + // separators with directory separators in the relative class name, append |
|
| 25 | + // with .php |
|
| 26 | + $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; |
|
| 27 | 27 | |
| 28 | - // if the file exists, require it |
|
| 29 | - if (file_exists($file)) { |
|
| 30 | - require $file; |
|
| 31 | - } |
|
| 28 | + // if the file exists, require it |
|
| 29 | + if (file_exists($file)) { |
|
| 30 | + require $file; |
|
| 31 | + } |
|
| 32 | 32 | }); |
@@ -3,12 +3,12 @@ discard block |
||
| 3 | 3 | /** |
| 4 | 4 | * @see http://www.php-fig.org/psr/psr-4/examples/ |
| 5 | 5 | */ |
| 6 | -spl_autoload_register(function ($class) { |
|
| 6 | +spl_autoload_register(function($class) { |
|
| 7 | 7 | // project-specific namespace prefix |
| 8 | - $prefix = 'XoopsModules\\' . ucfirst(basename(dirname(__DIR__))); |
|
| 8 | + $prefix = 'XoopsModules\\'.ucfirst(basename(dirname(__DIR__))); |
|
| 9 | 9 | |
| 10 | 10 | // base directory for the namespace prefix |
| 11 | - $base_dir = __DIR__ . '/../class/'; |
|
| 11 | + $base_dir = __DIR__.'/../class/'; |
|
| 12 | 12 | |
| 13 | 13 | // does the class use the namespace prefix? |
| 14 | 14 | $len = strlen($prefix); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | // replace the namespace prefix with the base directory, replace namespace |
| 24 | 24 | // separators with directory separators in the relative class name, append |
| 25 | 25 | // with .php |
| 26 | - $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; |
|
| 26 | + $file = $base_dir.str_replace('\\', '/', $relative_class).'.php'; |
|
| 27 | 27 | |
| 28 | 28 | // if the file exists, require it |
| 29 | 29 | if (file_exists($file)) { |