[ Index ]
 

Code source de XOOPS 2.0.17.1

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/htdocs/include/ -> commentform.inc.php (source)

   1  <?php
   2  // $Id: commentform.inc.php 2 2005-11-02 18:23:29Z skalpa $

   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  if (!defined("XOOPS_ROOT_PATH")) {
  28      die("XOOPS root path not defined");
  29  }
  30  include_once XOOPS_ROOT_PATH."/class/xoopslists.php";
  31  include XOOPS_ROOT_PATH."/class/xoopsformloader.php";
  32  $cform = new XoopsThemeForm(_CM_POSTCOMMENT, "commentform", "postcomment.php", "post", true);
  33  if (!preg_match("/^re:/i", $subject)) {
  34      $subject = "Re: ".xoops_substr($subject,0,56);
  35  }
  36  $cform->addElement(new XoopsFormText(_CM_TITLE, 'subject', 50, 255, $subject), true);
  37  $icons_radio = new XoopsFormRadio(_MESSAGEICON, 'icon', $icon);
  38  $subject_icons = XoopsLists::getSubjectsList();
  39  foreach ($subject_icons as $iconfile) {
  40      $icons_radio->addOption($iconfile, '<img src="'.XOOPS_URL.'/images/subject/'.$iconfile.'" alt="" />');
  41  }
  42  $cform->addElement($icons_radio);
  43  $cform->addElement(new XoopsFormDhtmlTextArea(_CM_MESSAGE, 'message', $message, 10, 50), true);
  44  $option_tray = new XoopsFormElementTray(_OPTIONS,'<br />');
  45  if ($xoopsUser) {
  46      if ($xoopsConfig['anonpost'] == 1) {
  47          $noname_checkbox = new XoopsFormCheckBox('', 'noname', $noname);
  48          $noname_checkbox->addOption(1, _POSTANON);
  49          $option_tray->addElement($noname_checkbox);
  50      }
  51      if ($xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
  52          $nohtml_checkbox = new XoopsFormCheckBox('', 'nohtml', $nohtml);
  53          $nohtml_checkbox->addOption(1, _DISABLEHTML);
  54          $option_tray->addElement($nohtml_checkbox);
  55      }
  56  }
  57  $smiley_checkbox = new XoopsFormCheckBox('', 'nosmiley', $nosmiley);
  58  $smiley_checkbox->addOption(1, _DISABLESMILEY);
  59  $option_tray->addElement($smiley_checkbox);
  60  
  61  $cform->addElement($option_tray);
  62  $cform->addElement(new XoopsFormHidden('pid', intval($pid)));
  63  $cform->addElement(new XoopsFormHidden('comment_id', intval($comment_id)));
  64  $cform->addElement(new XoopsFormHidden('item_id', intval($item_id)));
  65  $cform->addElement(new XoopsFormHidden('order', intval($order)));
  66  $button_tray = new XoopsFormElementTray('' ,'&nbsp;');
  67  $button_tray->addElement(new XoopsFormButton('', 'preview', _PREVIEW, 'submit'));
  68  $button_tray->addElement(new XoopsFormButton('', 'post', _CM_POSTCOMMENT, 'submit'));
  69  $cform->addElement($button_tray);
  70  $cform->display();
  71  ?>


Généré le : Sun Nov 25 11:44:32 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics