|
20 | 20 | //$helper = \XoopsModules\Suico\Helper::getInstance(); |
21 | 21 | //$helper->loadLanguage('blocksadmin'); |
22 | 22 | xoops_loadLanguage('blocksadmin', $moduleDirName); |
23 | | -$form = new XoopsThemeForm($block['form_title'], 'blockform', 'blocksadmin.php', 'post', true); |
| 23 | +$form = new \XoopsThemeForm($block['form_title'], 'blockform', 'blocksadmin.php', 'post', true); |
24 | 24 | if (isset($block['name'])) { |
25 | | - $form->addElement(new XoopsFormLabel(_AM_SYSTEM_BLOCKS_NAME, $block['name'])); |
| 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']); |
| 27 | +$side_select = new \XoopsFormSelect(_AM_SYSTEM_BLOCKS_TYPE, 'bside', $block['side']); |
28 | 28 | $side_select->addOptionArray( |
29 | 29 | [ |
30 | 30 | 0 => _AM_SYSTEM_BLOCKS_SBLEFT, |
|
39 | 39 | ); |
40 | 40 | $form->addElement($side_select); |
41 | 41 | $form->addElement( |
42 | | - new XoopsFormText(constant('CO_' . $moduleDirNameUpper . '_' . 'WEIGHT'), 'bweight', 2, 5, $block['weight']) |
| 42 | + new \XoopsFormText(constant('CO_' . $moduleDirNameUpper . '_' . 'WEIGHT'), 'bweight', 2, 5, $block['weight']) |
43 | 43 | ); |
44 | 44 | $form->addElement( |
45 | | - new XoopsFormRadioYN(constant('CO_' . $moduleDirNameUpper . '_' . 'VISIBLE'), 'bvisible', $block['visible']) |
| 45 | + new \XoopsFormRadioYN(constant('CO_' . $moduleDirNameUpper . '_' . 'VISIBLE'), 'bvisible', $block['visible']) |
46 | 46 | ); |
47 | | -$mod_select = new XoopsFormSelect( |
| 47 | +$mod_select = new \XoopsFormSelect( |
48 | 48 | constant( |
49 | 49 | 'CO_' . $moduleDirNameUpper . '_' . 'VISIBLEIN' |
50 | 50 | ), 'bmodule', $block['modules'], 5, true |
|
59 | 59 | ksort($module_list); |
60 | 60 | $mod_select->addOptionArray($module_list); |
61 | 61 | $form->addElement($mod_select); |
62 | | -$form->addElement(new XoopsFormText(_AM_TITLE, 'btitle', 50, 255, $block['title']), false); |
| 62 | +$form->addElement(new \XoopsFormText(_AM_TITLE, 'btitle', 50, 255, $block['title']), false); |
63 | 63 | if ($block['is_custom']) { |
64 | | - $textarea = new XoopsFormDhtmlTextArea(_AM_SYSTEM_BLOCKS_CONTENT, 'bcontent', $block['content'], 15, 70); |
| 64 | + $textarea = new \XoopsFormDhtmlTextArea(_AM_SYSTEM_BLOCKS_CONTENT, 'bcontent', $block['content'], 15, 70); |
65 | 65 | $textarea->setDescription( |
66 | 66 | '<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( |
67 | 67 | _AM_BLOCKTAG1, |
|
70 | 70 | ) . '</span>' |
71 | 71 | ); |
72 | 72 | $form->addElement($textarea, true); |
73 | | - $ctype_select = new XoopsFormSelect(_AM_SYSTEM_BLOCKS_CTYPE, 'bctype', $block['ctype']); |
| 73 | + $ctype_select = new \XoopsFormSelect(_AM_SYSTEM_BLOCKS_CTYPE, 'bctype', $block['ctype']); |
74 | 74 | $ctype_select->addOptionArray( |
75 | 75 | [ |
76 | 76 | 'H' => _AM_SYSTEM_BLOCKS_HTML, |
|
87 | 87 | $btemplate = $tplfileHandler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $block['bid']); |
88 | 88 | if (count($btemplate) > 0) { |
89 | 89 | $form->addElement( |
90 | | - new XoopsFormLabel( |
| 90 | + new \XoopsFormLabel( |
91 | 91 | _AM_SYSTEM_BLOCKS_CONTENT, '<a href="' . XOOPS_URL . '/modules/system/admin.php?fct=tplsets&op=edittpl&id=' . $btemplate[0]->getVar( |
92 | 92 | 'tpl_id' |
93 | 93 | ) . '">' . _AM_SYSTEM_BLOCKS_EDITTPL . '</a>' |
|
97 | 97 | $btemplate2 = $tplfileHandler->find('default', 'block', $block['bid']); |
98 | 98 | if (count($btemplate2) > 0) { |
99 | 99 | $form->addElement( |
100 | | - new XoopsFormLabel( |
| 100 | + new \XoopsFormLabel( |
101 | 101 | _AM_SYSTEM_BLOCKS_CONTENT, '<a href="' . XOOPS_URL . '/modules/system/admin.php?fct=tplsets&op=edittpl&id=' . $btemplate2[0]->getVar( |
102 | 102 | 'tpl_id' |
103 | 103 | ) . '" target="_blank">' . _AM_SYSTEM_BLOCKS_EDITTPL . '</a>' |
|
107 | 107 | } |
108 | 108 | } |
109 | 109 | if (false !== $block['edit_form']) { |
110 | | - $form->addElement(new XoopsFormLabel(_AM_SYSTEM_BLOCKS_OPTIONS, $block['edit_form'])); |
| 110 | + $form->addElement(new \XoopsFormLabel(_AM_SYSTEM_BLOCKS_OPTIONS, $block['edit_form'])); |
111 | 111 | } |
112 | 112 | } |
113 | | -$cache_select = new XoopsFormSelect(_AM_SYSTEM_BLOCKS_BCACHETIME, 'bcachetime', $block['bcachetime']); |
| 113 | +$cache_select = new \XoopsFormSelect(_AM_SYSTEM_BLOCKS_BCACHETIME, 'bcachetime', $block['bcachetime']); |
114 | 114 | $cache_select->addOptionArray( |
115 | 115 | [ |
116 | 116 | '0' => _NOCACHE, |
|
130 | 130 | /** @var XoopsGroupPermHandler $grouppermHandler */ |
131 | 131 | $grouppermHandler = xoops_getHandler('groupperm'); |
132 | 132 | $groups = $grouppermHandler->getGroupIds('block_read', $block['bid']); |
133 | | -$form->addElement(new XoopsFormSelectGroup(_AM_SYSTEM_BLOCKS_GROUP, 'groups', true, $groups, 5, true)); |
| 133 | +$form->addElement(new \XoopsFormSelectGroup(_AM_SYSTEM_BLOCKS_GROUP, 'groups', true, $groups, 5, true)); |
134 | 134 | if (isset($block['bid'])) { |
135 | | - $form->addElement(new XoopsFormHidden('bid', $block['bid'])); |
| 135 | + $form->addElement(new \XoopsFormHidden('bid', $block['bid'])); |
136 | 136 | } |
137 | | -$form->addElement(new XoopsFormHidden('op', $block['op'])); |
138 | | -$form->addElement(new XoopsFormHidden('fct', 'blocksadmin')); |
139 | | -$button_tray = new XoopsFormElementTray('', ' '); |
| 137 | +$form->addElement(new \XoopsFormHidden('op', $block['op'])); |
| 138 | +$form->addElement(new \XoopsFormHidden('fct', 'blocksadmin')); |
| 139 | +$button_tray = new \XoopsFormElementTray('', ' '); |
140 | 140 | if ($block['is_custom']) { |
141 | | - $button_tray->addElement(new XoopsFormButton('', 'previewblock', _PREVIEW, 'submit')); |
| 141 | + $button_tray->addElement(new \XoopsFormButton('', 'previewblock', _PREVIEW, 'submit')); |
142 | 142 | } |
143 | 143 | //Submit buttons |
144 | | -$button_tray = new XoopsFormElementTray('', ''); |
145 | | -$submit_button = new XoopsFormButton('', 'submitblock', _SUBMIT, 'submit'); |
| 144 | +$button_tray = new \XoopsFormElementTray('', ''); |
| 145 | +$submit_button = new \XoopsFormButton('', 'submitblock', _SUBMIT, 'submit'); |
146 | 146 | $button_tray->addElement($submit_button); |
147 | | -$cancel_button = new XoopsFormButton('', '', _CANCEL, 'button'); |
| 147 | +$cancel_button = new \XoopsFormButton('', '', _CANCEL, 'button'); |
148 | 148 | $cancel_button->setExtra('onclick="history.go(-1)"'); |
149 | 149 | $button_tray->addElement($cancel_button); |
150 | 150 | $form->addElement($button_tray); |
0 commit comments