| 1 | <?php |
|---|
| 2 | // $Id: commentform.inc.php,v 1.4 2005/09/04 20:46:09 onokazu Exp $ |
|---|
| 3 | // ------------------------------------------------------------------------ // |
|---|
| 4 | // XOOPS - PHP Content Management System // |
|---|
| 5 | // Copyright (c) 2000 XOOPS.org // |
|---|
| 6 | // <http://www.xoops.org/> // |
|---|
| 7 | // ------------------------------------------------------------------------ // |
|---|
| 8 | // This program is free software; you can redistribute it and/or modify // |
|---|
| 9 | // it under the terms of the GNU General Public License as published by // |
|---|
| 10 | // the Free Software Foundation; either version 2 of the License, or // |
|---|
| 11 | // (at your option) any later version. // |
|---|
| 12 | // // |
|---|
| 13 | // You may not change or alter any portion of this comment or credits // |
|---|
| 14 | // of supporting developers from this source code or any supporting // |
|---|
| 15 | // source code which is considered copyrighted (c) material of the // |
|---|
| 16 | // original comment or credit authors. // |
|---|
| 17 | // // |
|---|
| 18 | // This program is distributed in the hope that it will be useful, // |
|---|
| 19 | // but WITHOUT ANY WARRANTY; without even the implied warranty of // |
|---|
| 20 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // |
|---|
| 21 | // GNU General Public License for more details. // |
|---|
| 22 | // // |
|---|
| 23 | // You should have received a copy of the GNU General Public License // |
|---|
| 24 | // along with this program; if not, write to the Free Software // |
|---|
| 25 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // |
|---|
| 26 | // ------------------------------------------------------------------------ // |
|---|
| 27 | |
|---|
| 28 | if (!defined('XOOPS_ROOT_PATH')) { |
|---|
| 29 | exit(); |
|---|
| 30 | } |
|---|
| 31 | include_once XOOPS_ROOT_PATH."/class/xoopslists.php"; |
|---|
| 32 | include XOOPS_ROOT_PATH."/class/xoopsformloader.php"; |
|---|
| 33 | $cform = new XoopsThemeForm(_CM_POSTCOMMENT, "commentform", "postcomment.php"); |
|---|
| 34 | if (!preg_match("/^re:/i", $subject)) { |
|---|
| 35 | $subject = "Re: ".xoops_substr($subject,0,56); |
|---|
| 36 | } |
|---|
| 37 | $cform->addElement(new XoopsFormText(_CM_TITLE, 'subject', 50, 255, $subject), true); |
|---|
| 38 | $icons_radio = new XoopsFormRadio(_MESSAGEICON, 'icon', $icon); |
|---|
| 39 | $subject_icons = XoopsLists::getSubjectsList(); |
|---|
| 40 | foreach ($subject_icons as $iconfile) { |
|---|
| 41 | $icons_radio->addOption($iconfile, '<img src="'.XOOPS_URL.'/images/subject/'.$iconfile.'" alt="" />'); |
|---|
| 42 | } |
|---|
| 43 | $cform->addElement($icons_radio); |
|---|
| 44 | $cform->addElement(new XoopsFormDhtmlTextArea(_CM_MESSAGE, 'message', $message, 10, 50), true); |
|---|
| 45 | $option_tray = new XoopsFormElementTray(_OPTIONS,'<br />'); |
|---|
| 46 | if ($xoopsUser) { |
|---|
| 47 | if ($xoopsConfig['anonpost'] == 1) { |
|---|
| 48 | $noname_checkbox = new XoopsFormCheckBox('', 'noname', $noname); |
|---|
| 49 | $noname_checkbox->addOption(1, _POSTANON); |
|---|
| 50 | $option_tray->addElement($noname_checkbox); |
|---|
| 51 | } |
|---|
| 52 | if ($xoopsUser->isAdmin($xoopsModule->getVar('mid'))) { |
|---|
| 53 | $nohtml_checkbox = new XoopsFormCheckBox('', 'nohtml', $nohtml); |
|---|
| 54 | $nohtml_checkbox->addOption(1, _DISABLEHTML); |
|---|
| 55 | $option_tray->addElement($nohtml_checkbox); |
|---|
| 56 | } |
|---|
| 57 | } |
|---|
| 58 | $smiley_checkbox = new XoopsFormCheckBox('', 'nosmiley', $nosmiley); |
|---|
| 59 | $smiley_checkbox->addOption(1, _DISABLESMILEY); |
|---|
| 60 | $option_tray->addElement($smiley_checkbox); |
|---|
| 61 | |
|---|
| 62 | $cform->addElement($option_tray); |
|---|
| 63 | $cform->addElement(new XoopsFormHidden('pid', intval($pid))); |
|---|
| 64 | $cform->addElement(new XoopsFormHidden('comment_id', intval($comment_id))); |
|---|
| 65 | $cform->addElement(new XoopsFormHidden('item_id', intval($item_id))); |
|---|
| 66 | $cform->addElement(new XoopsFormHidden('order', intval($order))); |
|---|
| 67 | $button_tray = new XoopsFormElementTray('' ,' '); |
|---|
| 68 | $button_tray->addElement(new XoopsFormButton('', 'preview', _PREVIEW, 'submit')); |
|---|
| 69 | $button_tray->addElement(new XoopsFormButton('', 'post', _CM_POSTCOMMENT, 'submit')); |
|---|
| 70 | $cform->addElement($button_tray); |
|---|
| 71 | $cform->display(); |
|---|
| 72 | ?> |
|---|