Changeset 5903

Show
Ignore:
Timestamp:
07/04/08 11:16:00 (2 months ago)
Author:
p_lindheimer
Message:

added gettabindex() and settabindex(val) to guielement class that is used
by each of the relevant guielement compoenents. I tried the auto-increment
but because of hooks the order did not come out right and I failed to figure
out where I could hook into the sorting order process to get the auto
increment to work. However, with all of the value set to 1 it obtains the
desired result or at least a lot better than was there.

also fixed an annoying format issue on section headings.

(I can't wait to get rid of these guielements and get a proper forms library!)

Files:

Legend:

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

    r5398 r5903  
    11<?php 
    2 // TODO: * Test 'processfunctions' 
     2// This is a global to be used by gettabindex() 
     3// 
     4$_guielement_tabindex = 1; 
    35 
    46class component { 
     
    274276         
    275277        function generateconfigpage() { 
     278 
    276279                $htmlout = ''; 
    277280                $formname = "frm_$this->_compname"; 
     
    312315                                        $htmlout .= "\t<tr>\n"; 
    313316                                        $htmlout .= "\t\t<td colspan=\"2\">"; 
    314                                         $htmlout .= "<h5>" . _($section) . "</h5><hr>"; 
     317                                        $htmlout .= "<h5>" . _($section) . "<hr></h5>"; 
    315318                                        $htmlout .= "</td>\n"; 
    316319                                        $htmlout .= "\t</tr>\n"; 
     
    448451                return $this->_javascript; 
    449452        } 
     453        function gettabindex() { 
     454                global $_guielement_tabindex; 
     455                return $_guielement_tabindex; 
     456        } 
     457        function settabindex($new_tab) { 
     458                global $_guielement_tabindex; 
     459                $_guielement_tabindex = $new_tab; 
     460        } 
    450461} 
    451462 
     
    560571                 
    561572                $maxlength = ($maxchars > 0) ? " maxlength=\"$maxchars\"" : ''; 
    562                 $this->html_input = "<input type=\"text\" name=\"$this->_elemname\" id=\"$this->_elemname\"$maxlength value=\"" . htmlentities($this->currentvalue) . "\">"; 
     573                $tabindex = guielement::gettabindex(); 
     574                $this->html_input = "<input type=\"text\" name=\"$this->_elemname\" id=\"$this->_elemname\"$maxlength tabindex=$tabindex value=\"" . htmlentities($this->currentvalue) . "\">"; 
    563575        } 
    564576} 
     
    572584                 
    573585                $maxlength = ($maxchars > 0) ? " maxlength=\"$maxchars\"" : ''; 
    574                 $this->html_input = "<input type=\"password\" name=\"$this->_elemname\" id=\"$this->_elemname\"$maxlength value=\"" . htmlentities($this->currentvalue) . "\">"; 
     586                $tabindex = guielement::gettabindex(); 
     587                $this->html_input = "<input type=\"password\" name=\"$this->_elemname\" id=\"$this->_elemname\"$maxlength tabindex=$tabindex value=\"" . htmlentities($this->currentvalue) . "\">"; 
    575588        } 
    576589} 
     
    597610                $onchange = ($onchange != '') ? " onchange=\"$onchange\"" : ''; 
    598611                 
    599                 $output .= "\n\t\t\t<select name=\"$this->_elemname\" id=\"$this->_elemname\"$onchange>\n"; 
     612                $tabindex = guielement::gettabindex(); 
     613                $output .= "\n\t\t\t<select name=\"$this->_elemname\" id=\"$this->_elemname\" tabindex=$tabindex  $onchange >\n"; 
    600614                // include blank option if required 
    601615                if ($canbeempty) 
     
    637651                        $itemchecked = ($currentvalue == $itemvalue) ? ' checked=checked' : ''; 
    638652                         
    639                         $output .= "<input type=\"radio\" name=\"$this->_elemname\" id=\"$this->_elemname\" value=\"$this->_elemname=$itemvalue\"$itemchecked/>$itemtext&nbsp;&nbsp;&nbsp;&nbsp;\n"; 
     653                        $tabindex = guielement::gettabindex(); 
     654                        $output .= "<input type=\"radio\" name=\"$this->_elemname\" id=\"$this->_elemname\" tabindex=$tabindex value=\"$this->_elemname=$itemvalue\"$itemchecked/>$itemtext&nbsp;&nbsp;&nbsp;&nbsp;\n"; 
    640655                } 
    641656                return $output; 
     
    662677                // this effectivly creates the template using the html_text 
    663678                // we would expect the $html_text to be set by the child class 
    664                  
     679 
    665680                $output = ''; 
    666681                 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads