Changeset 6424

Show
Ignore:
Timestamp:
08/19/08 10:47:24 (5 years ago)
Author:
p_lindheimer
Message:

fixes #3086 add checkbox to gui elements

Files:

Legend:

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

    r6055 r6424  
    634634} 
    635635 
     636class gui_checkbox extends guiinput { 
     637  function gui_checkbox($elemname, $checked=false, $prompttext='', $helptext='', $value='on', $post_text = '', $jsonclick = '', $disable=false) { 
     638    $parent_class = get_parent_class($this); 
     639    parent::$parent_class($elemname, '', $prompttext, $helptext); 
     640 
     641    $itemchecked = $checked ? 'checked' : ''; 
     642    $disable_state = $disable ? 'disabled="true"' : ''; 
     643    $js_onclick_include = ($jsonclick != '') ? 'onclick="' . $jsonclick. '"' : ''; 
     644    $tabindex = guielement::gettabindex(); 
     645 
     646    $this->html_input = "<input type=\"checkbox\" name=\"$this->_elemname\" id=\"$this->_elemname\" $disable_state tabindex=$tabindex value=\"$value\" $js_onclick_include $itemchecked/>$post_text\n"; 
     647  } 
     648} 
     649 
    636650class gui_radio extends guiinput { 
    637651  function gui_radio($elemname, $valarray, $currentvalue = '', $prompttext = '', $helptext = '', $disable=false) {