Passed
Push — master ( 81ba93...c6c854 )
by Michael
03:30
created

include/request.inc.php (1 issue)

Labels
Severity
1
<?php
2
3
/**
4
 * Module: SmartFAQ
5
 * Author: The SmartFactory <www.smartfactory.ca>
6
 * Licence: GNU
7
 */
8
9
use XoopsModules\Smartfaq;
10
11
// defined('XOOPS_ROOT_PATH') || die('Restricted access');
12
13
global $_POST;
14
15
require_once XOOPS_ROOT_PATH . '/class/xoopstree.php';
16
require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
17
require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
18
19
$form = new \XoopsThemeForm(_MD_SF_REQUEST, 'form', xoops_getenv('PHP_SELF'), 'post', true);
20
// CATEGORY
21
$mytree = new Smartfaq\Tree($xoopsDB->prefix('smartfaq_categories'), 'categoryid', 'parentid');
22
ob_start();
23
$form->addElement(new \XoopsFormHidden('categoryid', ''));
24
$mytree->makeMySelBox('name', 'weight', '');
0 ignored issues
show
'' of type string is incompatible with the type integer expected by parameter $preset_id of XoopsModules\Smartfaq\Tree::makeMySelBox(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

24
$mytree->makeMySelBox('name', 'weight', /** @scrutinizer ignore-type */ '');
Loading history...
25
$category_label = new \XoopsFormLabel(_MD_SF_CATEGORY_QUESTION, ob_get_contents());
26
$category_label->setDescription(_MD_SF_CATEGORY_QUESTION_DSC);
27
$form->addElement($category_label);
28
ob_end_clean();
29
// QUESTION
30
$form->addElement(new \XoopsFormTextArea(_MD_SF_QUESTION, 'question', '', 10, 38), true);
31
32
$buttonTray = new \XoopsFormElementTray('', '');
33
$hidden     = new \XoopsFormHidden('op', 'post');
34
$buttonTray->addElement($hidden);
35
$buttonTray->addElement(new \XoopsFormButton('', 'post', _SUBMIT, 'submit'));
36
$form->addElement($buttonTray);
37
// NOTIFY ON PUBLISH
38
if (is_object($xoopsUser)) {
39
    $notify_checkbox = new \XoopsFormCheckBox('', 'notifypub', 1);
40
    $notify_checkbox->addOption(1, _MD_SF_NOTIFY);
41
    $form->addElement($notify_checkbox);
42
}
43
44
$form->assign($xoopsTpl);
45
unset($hidden);
46