Changeset 9272

Show
Ignore:
Timestamp:
03/18/10 07:19:40 (3 years ago)
Author:
mbrevda
Message:

always add a hidden field when using gui_drawselects; now you can get the destination using element?=[[element?].str_replace('goto',,element?)];

Files:

Legend:

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

    r9127 r9272  
    713713 
    714714class gui_drawselects extends guiinput { 
    715   function gui_drawselects($elemname, $index, $prompttext = '', $helptext = '', $canbeempty = true, $failvalidationmsg='') { 
     715  function gui_drawselects($elemname, $index, $dest, $prompttext = '', $helptext = '', $canbeempty = true, $failvalidationmsg='') { 
     716    global $currentcomponent; 
    716717    $parent_class = get_parent_class($this); 
    717718    if(!$canbeempty){ 
    718719      $jsvalidation ='()'; 
    719       $jsvalidationtest ='!$("input[name=goto'.$index.']:submit").val()'; 
     720      $jsvalidationtest ='!$("[name=goto'.$index.']").val()'; 
    720721      $failvalidationmsg = _('Please select a valid destination.'); 
    721722    } 
    722723    parent::$parent_class($elemname, '', $prompttext, $helptext, $jsvalidation, $failvalidationmsg, '', $jsvalidationtest); 
    723724     
    724     $this->html_input=drawselects($currentvalue, $index, false, false); 
    725   }    
     725    $this->html_input=drawselects($dest, $index, false, false); 
     726 
     727    //adttach a value to this element, so that we can find its value 
     728    $currentcomponent->addguielem('', new gui_hidden($elemname,'goto'.$index)); 
     729  }  
    726730} 
    727731 
     
    821825  } 
    822826} 
     827 
    823828?>