Changeset 9644 for freepbx/trunk

Show
Ignore:
Timestamp:
05/17/10 09:14:35 (3 years ago)
Author:
mbrevda
Message:

add guieleemtns text area, copy&paste from downstream, not specificaly tested

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/amp_conf/htdocs/admin/components.class.php

    r9272 r9644  
    730730} 
    731731 
     732class gui_textarea extends guiinput { 
     733  function gui_textarea($elemname, $currentvalue = '', $prompttext = '', $helptext = '', $jsvalidation = '', $failvalidationmsg = '', $canbeempty = true, $maxchars = 0) { 
     734    // call parent class contructor 
     735    $parent_class = get_parent_class($this); 
     736    parent::$parent_class($elemname, $currentvalue, $prompttext, $helptext, $jsvalidation, $failvalidationmsg, $canbeempty); 
     737     
     738    $maxlength = ($maxchars > 0) ? " maxlength=\"$maxchars\"" : ''; 
     739   
     740    $list = explode("\n",$this->currentvalue); 
     741    $rows = count($list);  
     742    $rows = (($rows > 20) ? 20 : $rows); 
     743 
     744    $this->html_input = "<textarea rows=\"$rows\" cols=\"24\" name=\"$this->_elemname\" id=\"$this->_elemname\"$maxlength>" . htmlentities($this->currentvalue) . "</textarea>"; 
     745  } 
     746} 
     747 
    732748/* 
    733749************************************************************