XOOPS Docs - kernel
[ class tree: kernel ] [ index: kernel ] [ all elements ]

Source for file formtextarea.php

Documentation is available at formtextarea.php

  1. <?php
  2. // $Id: formtextarea.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. // Author: Kazumi Ono (AKA onokazu)                                          //
  28. // URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
  29. // Project: The XOOPS Project                                                //
  30. // ------------------------------------------------------------------------- //
  31. if (!defined('XOOPS_ROOT_PATH')) {
  32.     die("XOOPS root path not defined");
  33. }
  34. /**
  35.  * 
  36.  * 
  37.  * @package     kernel
  38.  * @subpackage  form
  39.  * 
  40.  * @author        Kazumi Ono    <onokazu@xoops.org>
  41.  * @copyright    copyright (c) 2000-2003 XOOPS.org
  42.  */
  43. /**
  44.  * A textarea
  45.  * 
  46.  * @author    Kazumi Ono    <onokazu@xoops.org>
  47.  * @copyright    copyright (c) 2000-2003 XOOPS.org
  48.  * 
  49.  * @package     kernel
  50.  * @subpackage  form
  51.  */
  52.     /**
  53.      * number of columns
  54.      * @var    int 
  55.      * @access  private
  56.      */
  57.     var $_cols;
  58.  
  59.     /**
  60.      * number of rows
  61.      * @var    int 
  62.      * @access  private
  63.      */
  64.     var $_rows;
  65.  
  66.     /**
  67.      * initial content
  68.      * @var    string 
  69.      * @access  private
  70.      */
  71.     var $_value;
  72.  
  73.     /**
  74.      * Constuctor
  75.      * 
  76.      * @param    string  $caption    caption
  77.      * @param    string  $name       name
  78.      * @param    string  $value      initial content
  79.      * @param    int     $rows       number of rows
  80.      * @param    int     $cols       number of columns
  81.      */
  82.     function XoopsFormTextArea($caption$name$value=""$rows=5$cols=50){
  83.         $this->setCaption($caption);
  84.         $this->setName($name);
  85.         $this->_rows intval($rows);
  86.         $this->_cols intval($cols);
  87.         $this->setValue($value);
  88.     }
  89.  
  90.     /**
  91.      * get number of rows
  92.      * 
  93.      * @return    int 
  94.      */
  95.     function getRows(){
  96.         return $this->_rows;
  97.     }
  98.  
  99.     /**
  100.      * Get number of columns
  101.      * 
  102.      * @return    int 
  103.      */
  104.     function getCols(){
  105.         return $this->_cols;
  106.     }
  107.  
  108.     /**
  109.      * Get initial content
  110.      * 
  111.      * @return    string 
  112.      */
  113.     function getValue(){
  114.         return $this->_value;
  115.     }
  116.  
  117.     /**
  118.      * Set initial content
  119.      * 
  120.      * @param    $value    string
  121.      */
  122.     function setValue($value){
  123.         $this->_value $value;
  124.     }
  125.  
  126.     /**
  127.      * prepare HTML for output
  128.      * 
  129.      * @return    sting HTML
  130.      */
  131.     function render(){
  132.         return "<textarea name='".$this->getName()."' id='".$this->getName()."' rows='".$this->getRows()."' cols='".$this->getCols()."'".$this->getExtra().">".$this->getValue()."</textarea>";
  133.     }
  134. }
  135. ?>

XOOPS Docs generated by phpDocumentor