|
34 | 34 | // Define main template |
35 | 35 | $templateMain = 'modulebuilder_fields.tpl'; |
36 | 36 |
|
37 | | -include __DIR__ . '/header.php'; |
| 37 | +require __DIR__ . '/header.php'; |
38 | 38 | // Recovered value of arguments op in the URL $ |
39 | 39 | $op = \Xmf\Request::getString('op', 'list'); |
40 | 40 | // Get fields Variables |
|
53 | 53 | $GLOBALS['xoTheme']->addScript('modules/modulebuilder/assets/js/functions.js'); |
54 | 54 | $GLOBALS['xoTheme']->addScript('modules/modulebuilder/assets/js/sortable.js'); |
55 | 55 | $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('fields.php')); |
56 | | - $adminObject->addItemButton(_AM_MODULEBUILDER_TABLES_ADD, 'tables.php?op=new', 'add'); |
| 56 | + $adminObject->addItemButton(\_AM_MODULEBUILDER_TABLES_ADD, 'tables.php?op=new', 'add'); |
57 | 57 | $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
58 | 58 | $GLOBALS['xoopsTpl']->assign('modPathIcon16', TDMC_URL . '/' . $modPathIcon16); |
59 | 59 | // Redirect if there aren't modules |
60 | 60 | $modulesCount = $helper->getHandler('Modules')->getCountModules(); |
61 | 61 | if (0 == $modulesCount) { |
62 | | - \redirect_header('modules.php?op=new', 2, _AM_MODULEBUILDER_THEREARENT_MODULES2); |
| 62 | + \redirect_header('modules.php?op=new', 2, \_AM_MODULEBUILDER_THEREARENT_MODULES2); |
63 | 63 | } |
64 | 64 | unset($modulesCount); |
65 | 65 | // Redirect if there aren't tables |
66 | 66 | $tablesCount = $helper->getHandler('Tables')->getCountTables(); |
67 | 67 | if (0 == $tablesCount) { |
68 | | - \redirect_header('tables.php?op=new', 2, _AM_MODULEBUILDER_THEREARENT_TABLES2); |
| 68 | + \redirect_header('tables.php?op=new', 2, \_AM_MODULEBUILDER_THEREARENT_TABLES2); |
69 | 69 | } |
70 | 70 | // Get the list of tables |
71 | 71 | $tablesAll = $helper->getHandler('Tables')->getAllTables($start, $limit); |
|
100 | 100 | unset($tlid); |
101 | 101 | unset($fields); |
102 | 102 | if ($tablesCount > $limit) { |
103 | | - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
| 103 | + require_once \XOOPS_ROOT_PATH . '/class/pagenav.php'; |
104 | 104 | $pagenav = new \XoopsPageNav($tablesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
105 | 105 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
106 | 106 | } |
107 | 107 | } else { |
108 | | - $GLOBALS['xoopsTpl']->assign('error', _AM_MODULEBUILDER_THEREARENT_FIELDS); |
| 108 | + $GLOBALS['xoopsTpl']->assign('error', \_AM_MODULEBUILDER_THEREARENT_FIELDS); |
109 | 109 | } |
110 | 110 | break; |
111 | 111 | case 'new': |
112 | 112 | $GLOBALS['xoTheme']->addStylesheet('modules/modulebuilder/assets/css/admin/style.css'); |
113 | 113 | $GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/jquery.ui.js'); |
114 | 114 | $GLOBALS['xoTheme']->addScript('modules/modulebuilder/assets/js/functions.js'); |
115 | 115 | $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('fields.php')); |
116 | | - $adminObject->addItemButton(_AM_MODULEBUILDER_TABLES_LIST, 'tables.php', 'list'); |
117 | | - $adminObject->addItemButton(_AM_MODULEBUILDER_FIELDS_LIST, 'fields.php', 'list'); |
| 116 | + $adminObject->addItemButton(\_AM_MODULEBUILDER_TABLES_LIST, 'tables.php', 'list'); |
| 117 | + $adminObject->addItemButton(\_AM_MODULEBUILDER_FIELDS_LIST, 'fields.php', 'list'); |
118 | 118 | $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
119 | 119 | // Form Add |
120 | 120 | $fieldsObj = $helper->getHandler('Fields')->create(); |
|
175 | 175 | // Set field elements |
176 | 176 | if ($fieldsObj->isNew()) { |
177 | 177 | // Redirect to field.php if saved |
178 | | - \redirect_header('fields.php', 2, \sprintf(_AM_MODULEBUILDER_FIELDS_FORM_SAVED_OK, $tableName)); |
| 178 | + \redirect_header('fields.php', 2, \sprintf(\_AM_MODULEBUILDER_FIELDS_FORM_SAVED_OK, $tableName)); |
179 | 179 | } else { |
180 | 180 | // Redirect to field.php if updated - (Needed code from table name by field_tid) |
181 | | - \redirect_header('fields.php', 2, \sprintf(_AM_MODULEBUILDER_FIELDS_FORM_UPDATED_OK, $tableName)); |
| 181 | + \redirect_header('fields.php', 2, \sprintf(\_AM_MODULEBUILDER_FIELDS_FORM_UPDATED_OK, $tableName)); |
182 | 182 | } |
183 | 183 |
|
184 | 184 | $GLOBALS['xoopsTpl']->assign('error', $fieldsObj->getHtmlErrors()); |
|
190 | 190 | $GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/jquery.ui.js'); |
191 | 191 | $GLOBALS['xoTheme']->addScript('modules/modulebuilder/assets/js/functions.js'); |
192 | 192 | $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('fields.php')); |
193 | | - $adminObject->addItemButton(_AM_MODULEBUILDER_TABLES_ADD, 'tables.php?op=new', 'add'); |
194 | | - $adminObject->addItemButton(_AM_MODULEBUILDER_TABLES_LIST, 'tables.php', 'list'); |
195 | | - $adminObject->addItemButton(_AM_MODULEBUILDER_FIELDS_LIST, 'fields.php', 'list'); |
| 193 | + $adminObject->addItemButton(\_AM_MODULEBUILDER_TABLES_ADD, 'tables.php?op=new', 'add'); |
| 194 | + $adminObject->addItemButton(\_AM_MODULEBUILDER_TABLES_LIST, 'tables.php', 'list'); |
| 195 | + $adminObject->addItemButton(\_AM_MODULEBUILDER_FIELDS_LIST, 'fields.php', 'list'); |
196 | 196 | $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
197 | 197 | // Form Edit |
198 | 198 | $fieldId = \Xmf\Request::getInt('field_id'); |
|
215 | 215 | ++$i; |
216 | 216 | } |
217 | 217 | } |
218 | | - \redirect_header('fields.php', 5, _AM_MODULEBUILDER_FIELD_ORDER_ERROR); |
| 218 | + \redirect_header('fields.php', 5, \_AM_MODULEBUILDER_FIELD_ORDER_ERROR); |
219 | 219 | unset($i); |
220 | 220 | } |
221 | 221 | exit; |
|
235 | 235 | } |
236 | 236 | } |
237 | 237 | if ($helper->getHandler('Fields')->insert($fieldsObj)) { |
238 | | - \redirect_header('fields.php', 3, _AM_MODULEBUILDER_TOGGLE_SUCCESS); |
| 238 | + \redirect_header('fields.php', 3, \_AM_MODULEBUILDER_TOGGLE_SUCCESS); |
239 | 239 | } |
240 | 240 | $GLOBALS['xoopsTpl']->assign('error', $fieldsObj->getHtmlErrors()); |
241 | 241 | } |
242 | 242 | break; |
243 | 243 | } |
244 | | -include __DIR__ . '/footer.php'; |
| 244 | +require __DIR__ . '/footer.php'; |
0 commit comments