Changeset 12446

Show
Ignore:
Timestamp:
08/29/11 08:31:32 (2 years ago)
Author:
mbrevda
Message:

re #5342 - quick touch up

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/amp_conf/htdocs/admin/assets/js/pbxlib.js.php

    r12445 r12446  
    125125function toggle_reload_button(action){switch(action){case'show':$('#button_reload').show();break;case'hide':$('#button_reload').hide();break;}} 
    126126$(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() 
    131128break;case'+':txt.text('-  ');$('.'+el).show();break;}}) 
    132129$('#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  
    702702  }); 
    703703 
    704  
    705   // initialize the displayed/hidden nav bar categories 
    706   $(".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 section 
    719   $(".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  
    731704  //show/hide a gui_eleements section 
    732705  $('.guielToggle').click(function() { 
    733706    var txt = $(this).find('.guielToggleBut'); 
    734     var el = $(this).data('toggleClass') 
     707    var el = $(this).data('toggle_class'); 
    735708    switch(txt.text().replace(/ /g,'')) { 
    736709      case '-': 
  • freepbx/trunk/amp_conf/htdocs/admin/functions.inc.php

    r12445 r12446  
    175175    return $ast_with_dahdi; 
    176176  } 
    177    
    178   if (empty($version)) { 
     177  if (!isset($version) || !$version || !is_string($version)) { 
    179178    $engine_info = engine_getinfo(); 
    180179    $version = $engine_info['version']; 
  • freepbx/trunk/amp_conf/htdocs/admin/libraries/components.class.php

    r12445 r12446  
    287287     
    288288    $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"; 
    292292     
    293293    // Start of table 
    294     $htmlout .= "<table><!-- start of table $formname -->"; 
     294    $htmlout .= "<table><!-- start of table $formname -->\n"; 
    295295     
    296296    // Gui Elements / JavaScript validation 
     
    315315            continue; 
    316316          // 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\">"; 
    319319          if ($section) { 
    320320            $state = isset($this_opts[$section]['guielToggle']) && $this_opts[$section]['guielToggle'] == true  
     
    328328          } 
    329329 
    330           $htmlout .= "</td>"; 
    331           $htmlout .= "</tr>"; 
     330          $htmlout .= "</td>\n"; 
     331          $htmlout .= "\t</tr>\n"; 
    332332           
    333333          // Elements 
     
    345345      // Spacer before bottom 
    346346      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"; 
    351351      } 
    352352    } 
     
    370370    // 
    371371    if (guielement::getformfields()) { 
    372       $htmlout .= "<tr>"; 
    373       $htmlout .= "<td colspan=\"2\">"; 
     372      $htmlout .= "\t<tr>\n"; 
     373      $htmlout .= "\t\t<td colspan=\"2\">"; 
    374374      $htmlout .= "<h6>"; 
    375375      $htmlout .= "<input name=\"Submit\" type=\"submit\" tabindex=\"$tabindex\" value=\""._("Submit")."\">"; 
    376376      $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"; 
    381381 
    382382    if ( !$this->_sorted_jsfuncs ) 
     
    384384 
    385385    // 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"; 
    388388     
    389389    // TODO:  * Create standard JS to go thru each text box looking for first one not hidden and set focus 
     
    391391      foreach ( array_keys($this->_jsfuncs) as $function ) { 
    392392        // Functions 
    393         $htmlout .= "function ".$formname."_$function {"; 
     393        $htmlout .= "function ".$formname."_$function {\n"; 
    394394        foreach ( array_keys($this->_jsfuncs[$function]) as $sortorder ) { 
    395395          foreach ( array_keys($this->_jsfuncs[$function][$sortorder]) as $idx ) { 
     
    399399        } 
    400400        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>"; 
    406406     
    407407    // End of form 
    408     $htmlout .= "</form>"; 
     408    $htmlout .= "\n</form>\n\n"; 
    409409     
    410410    if ( $hasoutput ) { 
     
    510510     
    511511    // 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"; 
    513513  } 
    514514} 
     
    567567     
    568568      if ($this->canbeempty) { 
    569         $output .= "defaultEmptyOK = true;"; 
     569        $output .= "\tdefaultEmptyOK = true;\n"; 
    570570      } 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"; 
    577577    } 
    578578     
     
    588588    // start new row 
    589589    if ($section) { 
    590       $output .= "<tr class=\"$section\">"; 
     590      $output .= "\t<tr class=\"$section\">\n"; 
    591591    } else { 
    592       $output .= "<tr>"; 
     592      $output .= "\t<tr>\n"; 
    593593    } 
    594594     
    595595 
    596596    // prompt in first column 
    597     $output .= "<td>"; 
     597    $output .= "\t\t<td>"; 
    598598    if ($this->helptext != '') { 
    599599      $output .= fpbx_label($this->prompttext,$this->helptext); 
     
    601601      $output .= $this->prompttext; 
    602602    } 
    603     $output .= "</td>"; 
     603    $output .= "</td>\n"; 
    604604     
    605605    // actual input in second row 
    606     $output .= "<td>"; 
     606    $output .= "\t\t<td>"; 
    607607    $output .= $this->html_input; 
    608     $output .= "</td>"; 
     608    $output .= "</td>\n"; 
    609609     
    610610    // end this row 
    611     $output .= "</tr>"; 
     611    $output .= "\t</tr>\n"; 
    612612     
    613613    return $output; 
     
    666666    $tabindex = guielement::gettabindex(); 
    667667    $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"; 
    669669    // include blank option if required 
    670670    if ($canbeempty) 
     
    677677      $itemselected = ((string) $currentvalue == (string) $itemvalue) ? ' selected' : ''; 
    678678       
    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"; 
    682682     
    683683    return $output; 
     
    695695    $tabindex = guielement::gettabindex(); 
    696696 
    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"; 
    698698  } 
    699699} 
     
    724724      $tabindex = guielement::gettabindex(); 
    725725      $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"; 
    727727      $count++; 
    728728    } 
     
    755755    $maxlength = ($maxchars > 0) ? " maxlength=\"$maxchars\"" : ''; 
    756756   
    757     $list = explode("",$this->currentvalue); 
     757    $list = explode("\n",$this->currentvalue); 
    758758    $rows = count($list);  
    759759    $rows = (($rows > 20) ? 20 : $rows); 
     
    787787    // start new row 
    788788    if ($section) { 
    789       $output .= "<tr class=\"$section\">"; 
     789      $output .= "\t<tr class=\"$section\">\n"; 
    790790    } else { 
    791       $output .= "<tr>"; 
     791      $output .= "\t<tr>\n"; 
    792792    } 
    793793     
    794794 
    795795    // actual input in second row 
    796     $output .= "<td colspan=\"2\">"; 
     796    $output .= "\t\t<td colspan=\"2\">"; 
    797797    $output .= $this->html_text; 
    798     $output .= "</td>"; 
     798    $output .= "</td>\n"; 
    799799     
    800800    // end this row 
    801     $output .= "</tr>"; 
     801    $output .= "\t</tr>\n"; 
    802802     
    803803    return $output; 
  • freepbx/trunk/amp_conf/htdocs/admin/libraries/view.functions.php

    r12445 r12446  
    425425 
    426426function framework_include_js($module_name, $module_page) { 
    427   dbug('mod', $module_name); 
    428   dbug('page', $module_name); 
    429427  global $amp_conf, $active_modules; 
    430428  $version      = get_framework_version();