|
24 | 24 | if (isset($block['name'])) {
|
25 | 25 | $form->addElement(new \XoopsFormLabel(_AM_SYSTEM_BLOCKS_NAME, $block['name']));
|
26 | 26 | }
|
27 |
| -$side_select = new \XoopsFormSelect(_AM_SYSTEM_BLOCKS_TYPE, 'bside', $block['side']); |
28 |
| -$side_select->addOptionArray( |
| 27 | +$sideSelect = new \XoopsFormSelect(_AM_SYSTEM_BLOCKS_TYPE, 'bside', $block['side']); |
| 28 | +$sideSelect->addOptionArray( |
29 | 29 | [
|
30 | 30 | 0 => _AM_SYSTEM_BLOCKS_SBLEFT,
|
31 | 31 | 1 => _AM_SYSTEM_BLOCKS_SBRIGHT,
|
|
37 | 37 | 9 => _AM_SYSTEM_BLOCKS_CBBOTTOM,
|
38 | 38 | ]
|
39 | 39 | );
|
40 |
| -$form->addElement($side_select); |
| 40 | +$form->addElement($sideSelect); |
41 | 41 | $form->addElement(new \XoopsFormText(constant('CO_' . $moduleDirNameUpper . '_' . 'WEIGHT'), 'bweight', 2, 5, $block['weight']));
|
42 | 42 | $form->addElement(new \XoopsFormRadioYN(constant('CO_' . $moduleDirNameUpper . '_' . 'VISIBLE'), 'bvisible', $block['visible']));
|
43 |
| -$mod_select = new \XoopsFormSelect(constant('CO_' . $moduleDirNameUpper . '_' . 'VISIBLEIN'), 'bmodule', $block['modules'], 5, true); |
| 43 | +$moduleSelect = new \XoopsFormSelect(constant('CO_' . $moduleDirNameUpper . '_' . 'VISIBLEIN'), 'bmodule', $block['modules'], 5, true); |
44 | 44 | /** @var \XoopsModuleHandler $moduleHandler */
|
45 | 45 | $moduleHandler = xoops_getHandler('module');
|
46 | 46 | $criteria = new \CriteriaCompo(new \Criteria('hasmain', 1));
|
47 | 47 | $criteria->add(new \Criteria('isactive', 1));
|
48 |
| -$module_list = $moduleHandler->getList($criteria); |
49 |
| -$module_list[-1] = _AM_SYSTEM_BLOCKS_TOPPAGE; |
50 |
| -$module_list[0] = _AM_SYSTEM_BLOCKS_ALLPAGES; |
51 |
| -ksort($module_list); |
52 |
| -$mod_select->addOptionArray($module_list); |
53 |
| -$form->addElement($mod_select); |
| 48 | +$moduleList = $moduleHandler->getList($criteria); |
| 49 | +$moduleList[-1] = _AM_SYSTEM_BLOCKS_TOPPAGE; |
| 50 | +$moduleList[0] = _AM_SYSTEM_BLOCKS_ALLPAGES; |
| 51 | +ksort($moduleList); |
| 52 | +$moduleSelect->addOptionArray($moduleList); |
| 53 | +$form->addElement($moduleSelect); |
54 | 54 | $form->addElement(new \XoopsFormText(constant('CO_' . $moduleDirNameUpper . '_' . 'TITLE'), 'btitle', 50, 255, $block['title']), false);
|
55 | 55 | if ($block['is_custom']) {
|
56 | 56 | $textarea = new \XoopsFormDhtmlTextArea(_AM_SYSTEM_BLOCKS_CONTENT, 'bcontent', $block['content'], 15, 70);
|
57 | 57 | $textarea->setDescription('<span style="font-size:x-small;font-weight:bold;">' . _AM_SYSTEM_BLOCKS_USEFULTAGS . '</span><br><span style="font-size:x-small;font-weight:normal;">' . sprintf(_AM_BLOCKTAG1, '{X_SITEURL}', XOOPS_URL . '/') . '</span>');
|
58 | 58 | $form->addElement($textarea, true);
|
59 |
| - $ctype_select = new \XoopsFormSelect(_AM_SYSTEM_BLOCKS_CTYPE, 'bctype', $block['ctype']); |
60 |
| - $ctype_select->addOptionArray( |
| 59 | + $ctypeSelect = new \XoopsFormSelect(_AM_SYSTEM_BLOCKS_CTYPE, 'bctype', $block['ctype']); |
| 60 | + $ctypeSelect->addOptionArray( |
61 | 61 | [
|
62 | 62 | 'H' => _AM_SYSTEM_BLOCKS_HTML,
|
63 | 63 | 'P' => _AM_SYSTEM_BLOCKS_PHP,
|
64 | 64 | 'S' => _AM_SYSTEM_BLOCKS_AFWSMILE,
|
65 | 65 | 'T' => _AM_SYSTEM_BLOCKS_AFNOSMILE,
|
66 | 66 | ]
|
67 | 67 | );
|
68 |
| - $form->addElement($ctype_select); |
| 68 | + $form->addElement($ctypeSelect); |
69 | 69 | } else {
|
70 | 70 | if ('' !== $block['template']) {
|
71 | 71 | /** @var \XoopsTplfileHandler $tplfileHandler */
|
|
84 | 84 | $form->addElement(new \XoopsFormLabel(_AM_SYSTEM_BLOCKS_OPTIONS, $block['edit_form']));
|
85 | 85 | }
|
86 | 86 | }
|
87 |
| -$cache_select = new \XoopsFormSelect(_AM_SYSTEM_BLOCKS_BCACHETIME, 'bcachetime', $block['bcachetime']); |
88 |
| -$cache_select->addOptionArray( |
| 87 | +$cacheSelect = new \XoopsFormSelect(_AM_SYSTEM_BLOCKS_BCACHETIME, 'bcachetime', $block['bcachetime']); |
| 88 | +$cacheSelect->addOptionArray( |
89 | 89 | [
|
90 | 90 | '0' => _NOCACHE,
|
91 | 91 | '30' => sprintf(_SECONDS, 30),
|
|
100 | 100 | '2592000' => _MONTH,
|
101 | 101 | ]
|
102 | 102 | );
|
103 |
| -$form->addElement($cache_select); |
| 103 | +$form->addElement($cacheSelect); |
104 | 104 |
|
105 | 105 | /** @var \XoopsGroupPermHandler $grouppermHandler */
|
106 | 106 | $grouppermHandler = xoops_getHandler('groupperm');
|
|
120 | 120 |
|
121 | 121 | //Submit buttons
|
122 | 122 | $buttonTray = new \XoopsFormElementTray('', '');
|
123 |
| -$submit_button = new \XoopsFormButton('', 'submitblock', _SUBMIT, 'submit'); |
124 |
| -$buttonTray->addElement($submit_button); |
| 123 | +$submitButton = new \XoopsFormButton('', 'submitblock', _SUBMIT, 'submit'); |
| 124 | +$buttonTray->addElement($submitButton); |
125 | 125 |
|
126 |
| -$cancel_button = new \XoopsFormButton('', '', _CANCEL, 'button'); |
127 |
| -$cancel_button->setExtra('onclick="history.go(-1)"'); |
128 |
| -$buttonTray->addElement($cancel_button); |
| 126 | +$cancelButton = new \XoopsFormButton('', '', _CANCEL, 'button'); |
| 127 | +$cancelButton->setExtra('onclick="history.go(-1)"'); |
| 128 | +$buttonTray->addElement($cancelButton); |
129 | 129 |
|
130 | 130 | $form->addElement($buttonTray);
|
0 commit comments