XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
commentform.inc.php
Go to the documentation of this file.
1 <?php
20 defined('XOOPS_ROOT_PATH') or die('Restricted access');
21 
22 include_once $GLOBALS['xoops']->path('class/xoopslists.php');
23 include $GLOBALS['xoops']->path('class/xoopsformloader.php');
24 
25 $cform = new XoopsThemeForm(_CM_POSTCOMMENT, "commentform", "postcomment.php", "post", true);
26 if (!preg_match("/^" . _RE . "/i", $subject)) {
27  $subject = _RE . " " . xoops_substr($subject, 0, 56);
28 }
29 
30 $cform->addElement(new XoopsFormText(_CM_TITLE, 'subject', 50, 255, $subject), true);
32 $subject_icons = XoopsLists::getSubjectsList();
33 foreach ($subject_icons as $iconfile) {
34  $icons_radio->addOption($iconfile, '<img src="' . XOOPS_URL . '/images/subject/' . $iconfile . '" alt="" />');
35 }
36 $cform->addElement($icons_radio);
37 $cform->addElement(new XoopsFormDhtmlTextArea(_CM_MESSAGE, 'message', $message, 10, 50), true);
39 if ($xoopsUser) {
40  if ($xoopsConfig['anonpost'] == 1) {
41  $noname_checkbox = new XoopsFormCheckBox('', 'noname', $noname);
42  $noname_checkbox->addOption(1, _POSTANON);
43  $option_tray->addElement($noname_checkbox);
44  }
45  if ($xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
46  $nohtml_checkbox = new XoopsFormCheckBox('', 'nohtml', $nohtml);
47  $nohtml_checkbox->addOption(1, _DISABLEHTML);
48  $option_tray->addElement($nohtml_checkbox);
49  }
50 }
51 $smiley_checkbox = new XoopsFormCheckBox('', 'nosmiley', $nosmiley);
52 $smiley_checkbox->addOption(1, _DISABLESMILEY);
53 $option_tray->addElement($smiley_checkbox);
54 
55 $cform->addElement($option_tray);
56 
57 if (!$xoopsUser) {
58  $cform->addElement(new XoopsFormCaptcha());
59 }
60 
61 $cform->addElement(new XoopsFormHidden('pid', intval($pid)));
62 $cform->addElement(new XoopsFormHidden('comment_id', intval($comment_id)));
63 $cform->addElement(new XoopsFormHidden('item_id', intval($item_id)));
64 $cform->addElement(new XoopsFormHidden('order', intval($order)));
65 $button_tray = new XoopsFormElementTray('' ,'&nbsp;');
66 $button_tray->addElement(new XoopsFormButton('', 'preview', _PREVIEW, 'submit'));
67 $button_tray->addElement(new XoopsFormButton('', 'post', _CM_POSTCOMMENT, 'submit'));
68 $cform->addElement($button_tray);
69 $cform->display();
70 ?>