Changeset 12222
- Timestamp:
- 06/09/11 03:36:14 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/trunk/amp_conf/htdocs/admin/libraries/components.class.php
r12212 r12222 23 23 24 24 var $_lists; // Array of lists 25 26 var $_opts; //array of configurable options 25 27 26 28 function component($compname, $type = 'setup') { … … 283 285 284 286 // Start of form 285 $htmlout .= "<form name=\"$formname\" action=\"".$_SERVER['PHP_SELF']."\" method=\"post\" onsubmit=\"return ".$formname."_onsubmit();\">\n"; 287 288 $form_action = isset($this->_opts['form_action']) ? $this->_opts['form_action'] : $_SERVER['PHP_SELF']; 289 $htmlout .= "<form name=\"$formname\" action=\"".$form_action."\" method=\"post\" onsubmit=\"return ".$formname."_onsubmit();\">\n"; 286 290 $htmlout .= "<input type=\"hidden\" name=\"display\" value=\"$this->_compname\" />\n"; 287 291 $htmlout .= "<input type=\"hidden\" name=\"type\" value=\"$this->_type\" />\n\n"; … … 303 307 } 304 308 305 // TODO: should _($section) have _() removed?306 309 // Middle 307 310 if ( is_array($this->_guielems_middle) ) { … … 312 315 continue; 313 316 // Header for $section 314 $htmlout .= "\t<tr >\n";317 $htmlout .= "\t<tr class=\"guielToggle\" data-toggleClass=\"".preg_replace('/[^A-Za-z]/', '' ,$section)."\">\n"; 315 318 $htmlout .= "\t\t<td colspan=\"2\">"; 316 $htmlout .= "<h5>" . $section . "<hr></h5>"; 319 if ($section) { 320 $state = isset($this_opts[$section]['guielToggle']) && $this_opts[$section]['guielToggle'] == true 321 ? '+' : '- '; 322 $htmlout .= "<h5>" 323 . "<span class=\"guielToggleBut\">$state</span>" 324 . $section 325 . "</h5><hr>"; 326 } else { 327 $htmlout .= '<hr>'; 328 } 329 317 330 $htmlout .= "</td>\n"; 318 331 $htmlout .= "\t</tr>\n"; … … 324 337 foreach ( array_keys($this->_guielems_middle[$section][$sortorder]) as $idx ) { 325 338 $elem = $this->_guielems_middle[$section][$sortorder][$idx]; 326 $htmlout .= $elem->generatehtml( );339 $htmlout .= $elem->generatehtml(preg_replace('/[^A-Za-z]/', '' ,$section)); 327 340 $this->addjsfunc('onsubmit()', $elem->generatevalidation()); 328 341 } … … 567 580 } 568 581 569 function generatehtml( ) {582 function generatehtml($section = '') { 570 583 // this effectivly creates the template using the prompttext and html_input 571 584 // we would expect the $html_input to be set by the child class … … 574 587 575 588 // start new row 576 $output .= "\t<tr>\n"; 589 if ($section) { 590 $output .= "\t<tr class=\"$section\">\n"; 591 } else { 592 $output .= "\t<tr>\n"; 593 } 594 577 595 578 596 // prompt in first column 579 597 $output .= "\t\t<td>"; 580 598 if ($this->helptext != '') { 581 $output .= "<a href=\"#\" class=\"info\">$this->prompttext<span>$this->helptext</span></a>";599 $output .= fpbx_label($this->prompttext,$this->helptext); 582 600 } else { 583 601 $output .= $this->prompttext; … … 766 784 } 767 785 768 function generatehtml( ) {786 function generatehtml($section = '') { 769 787 // this effectivly creates the template using the html_text 770 788 // we would expect the $html_text to be set by the child class … … 773 791 774 792 // start new row 775 $output .= "\t<tr>\n"; 793 if ($section) { 794 $output .= "\t<tr class=\"$section\">\n"; 795 } else { 796 $output .= "\t<tr>\n"; 797 } 798 776 799 777 800 // actual input in second row
