Changeset 12446
- Timestamp:
- 08/29/11 08:31:32 (2 years ago)
- Files:
-
- freepbx/trunk/amp_conf/htdocs/admin/assets/js/pbxlib.js.php (modified) (1 diff)
- freepbx/trunk/amp_conf/htdocs/admin/assets/js/script.legacy.js (modified) (1 diff)
- freepbx/trunk/amp_conf/htdocs/admin/functions.inc.php (modified) (1 diff)
- freepbx/trunk/amp_conf/htdocs/admin/libraries/components.class.php (modified) (18 diffs)
- freepbx/trunk/amp_conf/htdocs/admin/libraries/view.functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/trunk/amp_conf/htdocs/admin/assets/js/pbxlib.js.php
r12445 r12446 125 125 function toggle_reload_button(action){switch(action){case'show':$('#button_reload').show();break;case'hide':$('#button_reload').hide();break;}} 126 126 $(document).ready(function(){bind_dests_double_selects();$("a.info").each(function(){$(this).after('<span class="help">?<span>'+$(this).find('span').text()+'</span></span>');}) 127 $(".help").live('mouseenter',function(){var pos=$(this).offset();var left=(200-pos.left)+"px";$(this).find("span").css("left",left).stop(true,true).delay(500).animate({opacity:"show"},750);}).live('mouseleave',function(){$(this).find("span").stop(true,true).animate({opacity:"hide"},"fast");});$(".category-header").each(function(){if($.cookie(this.id)=='collapsed'){$(".id-"+this.id).hide();$(this).removeClass("toggle-minus").addClass("toggle-plus") 128 $.cookie(this.id,'collapsed',{expires:365});}else{$(".id-"+this.id).show();$(this).removeClass("toggle-plus").addClass("toggle-minus") 129 $.cookie(this.id,'expanded',{expires:365});}});$(".category-header").click(function(){if($.cookie(this.id)=='expanded'){$(".id-"+this.id).slideUp();$.cookie(this.id,'collapsed',{expires:365});$(this).removeClass("toggle-minus").addClass("toggle-plus")}else{$(".id-"+this.id).slideDown();$.cookie(this.id,'expanded',{expires:365});$(this).removeClass("toggle-plus").addClass("toggle-minus")}});$('.guielToggle').click(function(){var txt=$(this).find('.guielToggleBut');var el=$(this).data('toggleClass') 130 switch(txt.text().replace(/ /g,'')){case'-':txt.text('+ ');$('.'+el).hide() 127 $(".help").live('mouseenter',function(){var pos=$(this).offset();var left=(200-pos.left)+"px";$(this).find("span").css("left",left).stop(true,true).delay(500).animate({opacity:"show"},750);}).live('mouseleave',function(){$(this).find("span").stop(true,true).animate({opacity:"hide"},"fast");});$('.guielToggle').click(function(){var txt=$(this).find('.guielToggleBut');var el=$(this).data('toggle_class');switch(txt.text().replace(/ /g,'')){case'-':txt.text('+ ');$('.'+el).hide() 131 128 break;case'+':txt.text('- ');$('.'+el).show();break;}}) 132 129 $('#fpbx_lang > li').click(function(){$.cookie('lang',$(this).data('lang'));window.location.reload();}) freepbx/trunk/amp_conf/htdocs/admin/assets/js/script.legacy.js
r12445 r12446 702 702 }); 703 703 704 705 // initialize the displayed/hidden nav bar categories706 $(".category-header").each(function(){707 if ($.cookie(this.id) == 'collapsed') {708 $(".id-"+this.id).hide();709 $(this).removeClass("toggle-minus").addClass("toggle-plus")710 $.cookie(this.id,'collapsed', { expires: 365 });711 } else {712 $(".id-"+this.id).show();713 $(this).removeClass("toggle-plus").addClass("toggle-minus")714 $.cookie(this.id,'expanded', { expires: 365 });715 }716 });717 718 //slide open/closed each section719 $(".category-header").click(function(){720 if ($.cookie(this.id) == 'expanded') {721 $(".id-"+this.id).slideUp();722 $.cookie(this.id,'collapsed', { expires: 365 });723 $(this).removeClass("toggle-minus").addClass("toggle-plus")724 } else {725 $(".id-"+this.id).slideDown();726 $.cookie(this.id,'expanded', { expires: 365 });727 $(this).removeClass("toggle-plus").addClass("toggle-minus")728 }729 });730 731 704 //show/hide a gui_eleements section 732 705 $('.guielToggle').click(function() { 733 706 var txt = $(this).find('.guielToggleBut'); 734 var el = $(this).data('toggle Class')707 var el = $(this).data('toggle_class'); 735 708 switch(txt.text().replace(/ /g,'')) { 736 709 case '-': freepbx/trunk/amp_conf/htdocs/admin/functions.inc.php
r12445 r12446 175 175 return $ast_with_dahdi; 176 176 } 177 178 if (empty($version)) { 177 if (!isset($version) || !$version || !is_string($version)) { 179 178 $engine_info = engine_getinfo(); 180 179 $version = $engine_info['version']; freepbx/trunk/amp_conf/htdocs/admin/libraries/components.class.php
r12445 r12446 287 287 288 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();\"> ";290 $htmlout .= "<input type=\"hidden\" name=\"display\" value=\"$this->_compname\" /> ";291 $htmlout .= "<input type=\"hidden\" name=\"type\" value=\"$this->_type\" /> ";289 $htmlout .= "<form name=\"$formname\" action=\"".$form_action."\" method=\"post\" onsubmit=\"return ".$formname."_onsubmit();\">\n"; 290 $htmlout .= "<input type=\"hidden\" name=\"display\" value=\"$this->_compname\" />\n"; 291 $htmlout .= "<input type=\"hidden\" name=\"type\" value=\"$this->_type\" />\n\n"; 292 292 293 293 // Start of table 294 $htmlout .= "<table><!-- start of table $formname --> ";294 $htmlout .= "<table><!-- start of table $formname -->\n"; 295 295 296 296 // Gui Elements / JavaScript validation … … 315 315 continue; 316 316 // Header for $section 317 $htmlout .= " <tr class=\"guielToggle\" data-toggleClass=\"".preg_replace('/[^A-Za-z]/', '' ,$section)."\">";318 $htmlout .= " <td colspan=\"2\">";317 $htmlout .= "\t<tr class=\"guielToggle\" data-toggle_class=\"".preg_replace('/[^A-Za-z]/', '' ,$section)."\">\n"; 318 $htmlout .= "\t\t<td colspan=\"2\">"; 319 319 if ($section) { 320 320 $state = isset($this_opts[$section]['guielToggle']) && $this_opts[$section]['guielToggle'] == true … … 328 328 } 329 329 330 $htmlout .= "</td> ";331 $htmlout .= " </tr>";330 $htmlout .= "</td>\n"; 331 $htmlout .= "\t</tr>\n"; 332 332 333 333 // Elements … … 345 345 // Spacer before bottom 346 346 if ( is_array($this->_guielems_bottom) ) { 347 $htmlout .= " <tr>";348 $htmlout .= " <td colspan=\"2\">";349 $htmlout .= "</td> ";350 $htmlout .= " </tr>";347 $htmlout .= "\t<tr>\n"; 348 $htmlout .= "\t\t<td colspan=\"2\">"; 349 $htmlout .= "</td>\n"; 350 $htmlout .= "\t</tr>\n"; 351 351 } 352 352 } … … 370 370 // 371 371 if (guielement::getformfields()) { 372 $htmlout .= " <tr>";373 $htmlout .= " <td colspan=\"2\">";372 $htmlout .= "\t<tr>\n"; 373 $htmlout .= "\t\t<td colspan=\"2\">"; 374 374 $htmlout .= "<h6>"; 375 375 $htmlout .= "<input name=\"Submit\" type=\"submit\" tabindex=\"$tabindex\" value=\""._("Submit")."\">"; 376 376 $htmlout .= "</h6>"; 377 $htmlout .= "</td> ";378 $htmlout .= " </tr>";379 } 380 $htmlout .= "</table><!-- end of table $formname --> ";377 $htmlout .= "</td>\n"; 378 $htmlout .= "\t</tr>\n"; 379 } 380 $htmlout .= "</table><!-- end of table $formname -->\n\n"; 381 381 382 382 if ( !$this->_sorted_jsfuncs ) … … 384 384 385 385 // Javascript 386 $htmlout .= "<script type=\"text/javascript\"> <!--";387 $htmlout .= "var theForm = document.$formname; ";386 $htmlout .= "<script type=\"text/javascript\">\n<!--\n"; 387 $htmlout .= "var theForm = document.$formname;\n\n"; 388 388 389 389 // TODO: * Create standard JS to go thru each text box looking for first one not hidden and set focus … … 391 391 foreach ( array_keys($this->_jsfuncs) as $function ) { 392 392 // Functions 393 $htmlout .= "function ".$formname."_$function { ";393 $htmlout .= "function ".$formname."_$function {\n"; 394 394 foreach ( array_keys($this->_jsfuncs[$function]) as $sortorder ) { 395 395 foreach ( array_keys($this->_jsfuncs[$function][$sortorder]) as $idx ) { … … 399 399 } 400 400 if ( $function == 'onsubmit()' ) 401 $htmlout .= " return true;";402 $htmlout .= "} ";403 } 404 } 405 $htmlout .= "//--> </script>";401 $htmlout .= "\treturn true;\n"; 402 $htmlout .= "}\n"; 403 } 404 } 405 $htmlout .= "//-->\n</script>"; 406 406 407 407 // End of form 408 $htmlout .= " </form>";408 $htmlout .= "\n</form>\n\n"; 409 409 410 410 if ( $hasoutput ) { … … 510 510 511 511 // make it a new row 512 $this->_html = " <tr><td>" . $this->_html . "</td></tr>";512 $this->_html = "\t<tr>\n\t\t<td>" . $this->_html . "</td>\n\t</tr>\n"; 513 513 } 514 514 } … … 567 567 568 568 if ($this->canbeempty) { 569 $output .= " defaultEmptyOK = true;";569 $output .= "\tdefaultEmptyOK = true;\n"; 570 570 } else { 571 $output .= " defaultEmptyOK = false;";572 } 573 574 $output .= " if (" . str_replace("()", "(" . $thefldvalue . ")", $this->jsvalidation) . ")";575 $output .= " return warnInvalid(" . $thefld . ", \"" . $this->failvalidationmsg . "\");";576 $output .= " ";571 $output .= "\tdefaultEmptyOK = false;\n"; 572 } 573 574 $output .= "\tif (" . str_replace("()", "(" . $thefldvalue . ")", $this->jsvalidation) . ") \n"; 575 $output .= "\t\treturn warnInvalid(" . $thefld . ", \"" . $this->failvalidationmsg . "\");\n"; 576 $output .= "\n"; 577 577 } 578 578 … … 588 588 // start new row 589 589 if ($section) { 590 $output .= " <tr class=\"$section\">";590 $output .= "\t<tr class=\"$section\">\n"; 591 591 } else { 592 $output .= " <tr>";592 $output .= "\t<tr>\n"; 593 593 } 594 594 595 595 596 596 // prompt in first column 597 $output .= " <td>";597 $output .= "\t\t<td>"; 598 598 if ($this->helptext != '') { 599 599 $output .= fpbx_label($this->prompttext,$this->helptext); … … 601 601 $output .= $this->prompttext; 602 602 } 603 $output .= "</td> ";603 $output .= "</td>\n"; 604 604 605 605 // actual input in second row 606 $output .= " <td>";606 $output .= "\t\t<td>"; 607 607 $output .= $this->html_input; 608 $output .= "</td> ";608 $output .= "</td>\n"; 609 609 610 610 // end this row 611 $output .= " </tr>";611 $output .= "\t</tr>\n"; 612 612 613 613 return $output; … … 666 666 $tabindex = guielement::gettabindex(); 667 667 $disable_state = $disable ? 'disabled="true"':''; 668 $output .= " <select name=\"$this->_elemname\" id=\"$this->_elemname\" tabindex=$tabindex $disable_state $onchange >";668 $output .= "\n\t\t\t<select name=\"$this->_elemname\" id=\"$this->_elemname\" tabindex=$tabindex $disable_state $onchange >\n"; 669 669 // include blank option if required 670 670 if ($canbeempty) … … 677 677 $itemselected = ((string) $currentvalue == (string) $itemvalue) ? ' selected' : ''; 678 678 679 $output .= " <option value=\"$itemvalue\"$itemselected>$itemtext</option>";680 } 681 $output .= " </select>";679 $output .= "\t\t\t\t<option value=\"$itemvalue\"$itemselected>$itemtext</option>\n"; 680 } 681 $output .= "\t\t\t</select>\n\t\t"; 682 682 683 683 return $output; … … 695 695 $tabindex = guielement::gettabindex(); 696 696 697 $this->html_input = "<input type=\"checkbox\" name=\"$this->_elemname\" id=\"$this->_elemname\" $disable_state tabindex=$tabindex value=\"$value\" $js_onclick_include $itemchecked/>$post_text ";697 $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"; 698 698 } 699 699 } … … 724 724 $tabindex = guielement::gettabindex(); 725 725 $disable_state = $disable ? 'disabled="true"':''; 726 $output .= "<input type=\"radio\" name=\"$this->_elemname\" id=\"$this->_elemname$count\" $disable_state tabindex=$tabindex value=\"$this->_elemname=$itemvalue\"$itemchecked/><label for=\"$this->_elemname$count\">$itemtext</label> ";726 $output .= "<input type=\"radio\" name=\"$this->_elemname\" id=\"$this->_elemname$count\" $disable_state tabindex=$tabindex value=\"$this->_elemname=$itemvalue\"$itemchecked/><label for=\"$this->_elemname$count\">$itemtext</label>\n"; 727 727 $count++; 728 728 } … … 755 755 $maxlength = ($maxchars > 0) ? " maxlength=\"$maxchars\"" : ''; 756 756 757 $list = explode(" ",$this->currentvalue);757 $list = explode("\n",$this->currentvalue); 758 758 $rows = count($list); 759 759 $rows = (($rows > 20) ? 20 : $rows); … … 787 787 // start new row 788 788 if ($section) { 789 $output .= " <tr class=\"$section\">";789 $output .= "\t<tr class=\"$section\">\n"; 790 790 } else { 791 $output .= " <tr>";791 $output .= "\t<tr>\n"; 792 792 } 793 793 794 794 795 795 // actual input in second row 796 $output .= " <td colspan=\"2\">";796 $output .= "\t\t<td colspan=\"2\">"; 797 797 $output .= $this->html_text; 798 $output .= "</td> ";798 $output .= "</td>\n"; 799 799 800 800 // end this row 801 $output .= " </tr>";801 $output .= "\t</tr>\n"; 802 802 803 803 return $output; freepbx/trunk/amp_conf/htdocs/admin/libraries/view.functions.php
r12445 r12446 425 425 426 426 function framework_include_js($module_name, $module_page) { 427 dbug('mod', $module_name);428 dbug('page', $module_name);429 427 global $amp_conf, $active_modules; 430 428 $version = get_framework_version();
