Completed
Branch master (1b2f30)
by Michael
06:29 queued 03:22
created

include/request.inc.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/**
4
 * Module: SmartFAQ
5
 * Author: The SmartFactory <www.smartfactory.ca>
6
 * Licence: GNU
7
 */
8
// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
0 ignored issues
show
Unused Code Comprehensibility introduced by
70% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
9
10
global $_POST;
11
12
include_once XOOPS_ROOT_PATH . '/class/xoopstree.php';
13
include_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
14
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
15
16
$form = new XoopsThemeForm(_MD_SF_REQUEST, 'form', xoops_getenv('PHP_SELF'));
17
// CATEGORY
18
$mytree = new XoopsTree($xoopsDB->prefix('smartfaq_categories'), 'categoryid', 'parentid');
19
ob_start();
20
$form->addElement(new XoopsFormHidden('categoryid', ''));
21
$mytree->makeMySelBox('name', 'weight', '');
22
$category_label = new XoopsFormLabel(_MD_SF_CATEGORY_QUESTION, ob_get_contents());
23
$category_label->setDescription(_MD_SF_CATEGORY_QUESTION_DSC);
24
$form->addElement($category_label);
25
ob_end_clean();
26
// QUESTION
27
$form->addElement(new XoopsFormTextArea(_MD_SF_QUESTION, 'question', '', 10, 38), true);
28
29
$button_tray = new XoopsFormElementTray('', '');
30
$hidden      = new XoopsFormHidden('op', 'post');
31
$button_tray->addElement($hidden);
32
$button_tray->addElement(new XoopsFormButton('', 'post', _SUBMIT, 'submit'));
33
$form->addElement($button_tray);
34
// NOTIFY ON PUBLISH
35 View Code Duplication
if (is_object($xoopsUser)) {
36
    $notify_checkbox = new XoopsFormCheckBox('', 'notifypub', 1);
37
    $notify_checkbox->addOption(1, _MD_SF_NOTIFY);
38
    $form->addElement($notify_checkbox);
39
}
40
41
$form->assign($xoopsTpl);
42
unset($hidden);
43