/[cvs]/nfo/php/libs/com.newsblob.phphtmllib/form/form_elements/FETextArea.inc
ViewVC logotype

Diff of /nfo/php/libs/com.newsblob.phphtmllib/form/form_elements/FETextArea.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by jonen, Sat Feb 22 21:07:48 2003 UTC revision 1.2 by jonen, Sat Sep 20 00:20:15 2003 UTC
# Line 27  Line 27 
27   */   */
28  class FETextArea extends FEBoxElement {  class FETextArea extends FEBoxElement {
29    
30    
31        /**
32         * The constructor
33         *
34         * @param label string - text label for the element
35         * @param bool required - is this a required element
36         * @param int required - the rows attribute
37         * @param int required - the cols attribute
38         * @param int optional - element width in pixels (px), percentage (%) or elements (em)
39         * @param int optional - element height in pixels (px), percentage (%) or elements (em)    
40         * @param int optional - the number of characters to limit the value to.
41         */
42        function FETextArea($label, $required = TRUE, $rows, $cols, $width = NULL, $height = NULL,
43                            $limit_char_count=-1 ) {        
44            $this->_limit_char_count = $limit_char_count;
45            $this->FEBoxElement($label, $required, $width, $height);
46            $this->set_rows( $rows );
47            $this->set_cols( $cols );
48        }
49    
50    
51        /**
52         * This lets you limit the amount of data to
53         * accept in the field
54         */
55        var $_limit_char_count = -1;
56    
57      /**      /**
58       * This function builds and returns the       * This function builds and returns the
59       * form element object       * form element object
# Line 45  class FETextArea extends FEBoxElement { Line 72  class FETextArea extends FEBoxElement {
72          return $tag;          return $tag;
73      }      }
74    
75    
76        /**
77         * This function will return the
78         * elements value
79         *
80         * @return mixed
81         */
82        function get_value() {
83            if ($this->_limit_char_count < 0) {
84                return $this->_value;
85            } else {
86                return substr($this->_value, 0, $this->_limit_char_count);
87            }
88            
89        }
90    
91    
92        /**
93         * This method is used as a shortcut
94         * to set the rows attribute
95         *
96         * @param int the rows attribute value
97         */
98        function set_rows( $rows ) {
99            $this->set_attribute("rows", $rows);
100        }
101    
102        /**
103         * This method is used as a shortcut
104         * to set the cols attribute
105         *
106         * @param int the cols attribute value
107         */
108        function set_cols( $cols ) {
109            $this->set_attribute("cols", $cols);
110        }
111    
112  }  }
113  ?>  ?>

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed