This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
1 | <?php |
||
2 | /* |
||
3 | * You may not change or alter any portion of this comment or credits |
||
4 | * of supporting developers from this source code or any supporting source code |
||
5 | * which is considered copyrighted (c) material of the original comment or credit authors. |
||
6 | * |
||
7 | * This program is distributed in the hope that it will be useful, |
||
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||
10 | */ |
||
11 | |||
12 | /** |
||
13 | * @copyright {@link https://xoops.org/ XOOPS Project} |
||
14 | * @license {@link https://www.gnu.org/licenses/gpl-2.0.html GNU GPL 2 or later} |
||
15 | * @package |
||
16 | * @since |
||
17 | * @author XOOPS Development Team |
||
18 | */ |
||
19 | |||
20 | require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
||
21 | $form = new \XoopsThemeForm($block['form_title'], 'blockform', 'admin.php'); |
||
22 | if (isset($block['name'])) { |
||
23 | $form->addElement(new \XoopsFormLabel(_AM_NAME, $block['name'])); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
24 | } |
||
25 | $side_select = new \XoopsFormSelect(_AM_BLKTYPE, 'bside', $block['side']); |
||
0 ignored issues
–
show
|
|||
26 | $side_select->addOptionArray( |
||
27 | [ |
||
28 | 1 => _AM_SBLEFT, |
||
0 ignored issues
–
show
|
|||
29 | 2 => _AM_SBRIGHT, |
||
0 ignored issues
–
show
|
|||
30 | 3 => _AM_CBLEFT, |
||
0 ignored issues
–
show
|
|||
31 | 5 => _AM_CBRIGHT, |
||
0 ignored issues
–
show
|
|||
32 | 4 => _AM_CBCENTER, |
||
0 ignored issues
–
show
|
|||
33 | 6 => _AM_CBBOTTOMLEFT, |
||
0 ignored issues
–
show
|
|||
34 | 7 => _AM_CBBOTTOM, |
||
0 ignored issues
–
show
|
|||
35 | 8 => _AM_CBBOTTOMRIGHT, |
||
0 ignored issues
–
show
|
|||
36 | ] |
||
37 | ); |
||
38 | $form->addElement($side_select); |
||
39 | $form->addElement(new \XoopsFormText(_AM_WEIGHT, 'bweight', 2, 5, $block['weight'])); |
||
0 ignored issues
–
show
|
|||
40 | $form->addElement(new \XoopsFormRadioYN(_AM_VISIBLE, 'bvisible', $block['visible'])); |
||
0 ignored issues
–
show
|
|||
41 | $mod_select = new \XoopsFormSelect(_AM_VISIBLEIN, 'bmodule', $block['modules'], 5, true); |
||
0 ignored issues
–
show
|
|||
42 | /** @var \XoopsModuleHandler $moduleHandler */ |
||
43 | $moduleHandler = xoops_getHandler('module'); |
||
44 | $criteria = new \CriteriaCompo(new \Criteria('hasmain', 1)); |
||
45 | $criteria->add(new \Criteria('isactive', 1)); |
||
46 | $module_list = $moduleHandler->getList($criteria); |
||
47 | $module_list[-1] = _AM_TOPPAGE; |
||
0 ignored issues
–
show
|
|||
48 | $module_list[0] = _AM_ALLPAGES; |
||
0 ignored issues
–
show
|
|||
49 | ksort($module_list); |
||
50 | $mod_select->addOptionArray($module_list); |
||
51 | $form->addElement($mod_select); |
||
52 | $form->addElement(new \XoopsFormText(_AM_TITLE, 'btitle', 50, 255, $block['title']), false); |
||
0 ignored issues
–
show
|
|||
53 | if ($block['is_custom']) { |
||
54 | $textarea = new \XoopsFormDhtmlTextArea(_AM_CONTENT, 'bcontent', $block['content'], 15, 70); |
||
0 ignored issues
–
show
|
|||
55 | $textarea->setDescription('<span style="font-size:x-small;font-weight:bold;">' . _AM_USEFULTAGS . '</span><br><span style="font-size:x-small;font-weight:normal;">' . sprintf(_AM_BLOCKTAG1, '{X_SITEURL}', XOOPS_URL . '/') . '</span>'); |
||
0 ignored issues
–
show
|
|||
56 | $form->addElement($textarea, true); |
||
57 | $ctype_select = new \XoopsFormSelect(_AM_CTYPE, 'bctype', $block['ctype']); |
||
0 ignored issues
–
show
|
|||
58 | $ctype_select->addOptionArray(['H' => _AM_HTML, 'P' => _AM_PHP, 'S' => _AM_AFWSMILE, 'T' => _AM_AFNOSMILE]); |
||
0 ignored issues
–
show
|
|||
59 | $form->addElement($ctype_select); |
||
60 | } else { |
||
61 | if (!defined('XOOPS_ORETEKI') && '' !== $block['template']) { |
||
62 | /** @var \XoopsTplfileHandler $tplfileHandler */ |
||
63 | $tplfileHandler = xoops_getHandler('tplfile'); |
||
64 | $btemplate = $tplfileHandler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $block['bid']); |
||
65 | if (count($btemplate) > 0) { |
||
66 | $form->addElement(new \XoopsFormLabel(_AM_CONTENT, '<a href="' . XOOPS_URL . '/modules/system/admin.php?fct=tplsets&op=edittpl&id=' . $btemplate[0]->getVar('tpl_id') . '">' . _AM_EDITTPL . '</a>')); |
||
0 ignored issues
–
show
|
|||
67 | } else { |
||
68 | $btemplate2 = $tplfileHandler->find('default', 'block', $block['bid']); |
||
69 | if (count($btemplate2) > 0) { |
||
70 | $form->addElement(new \XoopsFormLabel(_AM_CONTENT, '<a href="' . XOOPS_URL . '/modules/system/admin.php?fct=tplsets&op=edittpl&id=' . $btemplate2[0]->getVar('tpl_id') . '" target="_blank">' . _AM_EDITTPL . '</a>')); |
||
71 | } |
||
72 | } |
||
73 | } |
||
74 | if (false !== $block['edit_form']) { |
||
75 | $form->addElement(new \XoopsFormLabel(_AM_OPTIONS, $block['edit_form'])); |
||
0 ignored issues
–
show
|
|||
76 | } |
||
77 | } |
||
78 | $cache_select = new \XoopsFormSelect(_AM_BCACHETIME, 'bcachetime', $block['cachetime']); |
||
0 ignored issues
–
show
|
|||
79 | $cache_select->addOptionArray( |
||
80 | [ |
||
81 | '0' => _NOCACHE, |
||
82 | '30' => sprintf(_SECONDS, 30), |
||
83 | '60' => _MINUTE, |
||
84 | '300' => sprintf(_MINUTES, 5), |
||
85 | '1800' => sprintf(_MINUTES, 30), |
||
86 | '3600' => _HOUR, |
||
87 | '18000' => sprintf(_HOURS, 5), |
||
88 | '86400' => _DAY, |
||
89 | '259200' => sprintf(_DAYS, 3), |
||
90 | '604800' => _WEEK, |
||
91 | '2592000' => _MONTH, |
||
92 | ] |
||
93 | ); |
||
94 | $form->addElement($cache_select); |
||
95 | if (isset($block['bid'])) { |
||
96 | $form->addElement(new \XoopsFormHidden('bid', $block['bid'])); |
||
97 | } |
||
98 | // $form -> addElement(new \XoopsFormHidden('options', $block['options'])); |
||
99 | $form->addElement(new \XoopsFormHidden('op', $block['op'])); |
||
100 | $form->addElement(new \XoopsFormHidden('fct', 'blocksadmin')); |
||
101 | $buttonTray = new \XoopsFormElementTray('', ' '); |
||
102 | if ($block['is_custom']) { |
||
103 | $buttonTray->addElement(new \XoopsFormButton('', 'previewblock', _PREVIEW, 'submit')); |
||
104 | } |
||
105 | $buttonTray->addElement(new \XoopsFormButton('', 'submitblock', $block['submit_button'], 'submit')); |
||
106 | $form->addElement($buttonTray); |
||
107 |