Show
Ignore:
Timestamp:
06/05/06 06:44:49 (7 years ago)
Author:
diego_iastrubni
Message:

This patch moves the post reload actions to after the "need reload" flag has removed from the SQL server.
As a bonus, now the banners are centered, and I also added a proper properties to the script tag

Not really a bugfix, but an enhancement.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/1.0/amp_conf/htdocs/admin/footer.php

    r653 r2036  
    2525//check to see if we are requesting an asterisk reload 
    2626if ($_REQUEST['clk_reload'] == 'true') { 
    27    
    28   if (isset($amp_conf["POST_RELOAD"])) 
    29   { 
    30     echo " 
    31 <style> 
    32 .clsWait        { position: absolute; top:75px; left: 100; width: 700px; text-align:center; border: red solid 1px; background:#f0d0d0; display: block; font-weight: bold } 
    33 .clsWaitFinishOK{ position: absolute; top:75px; left: 100; width: 700px; text-align:center; border: blue solid 1px; background:#d0d0f0; display: block; } 
    34 .clsHidden      { display: none } 
    35 </style> 
    36 "; 
    37     echo "<div id='idWaitBanner' class='clsWait'> Please wait while applying configuration</div>"; 
    38      
    39     if (!isset($amp_conf["POST_RELOAD_DEBUG"]) ||  
    40         (($amp_conf["POST_RELOAD_DEBUG"]!="1") &&  
    41          ($amp_conf["POST_RELOAD_DEBUG"]!="true"))  
    42        ) 
    43       echo "<div style='display:none'>"; 
    44        
    45     echo "Executing post apply script <b>".$amp_conf["POST_RELOAD"]."</b><pre>"; 
    46     system( $amp_conf["POST_RELOAD"] ); 
    47     echo "</pre>"; 
    48      
    49     if (!isset($amp_conf["POST_RELOAD_DEBUG"]) ||  
    50         (($amp_conf["POST_RELOAD_DEBUG"]!="1") &&  
    51          ($amp_conf["POST_RELOAD_DEBUG"]!="true")) 
    52         ) 
    53       echo "</div><br>"; 
    54      
    55     echo " 
    56 <script>  
    57 function hideWaitBanner() 
    58 { 
    59   document.getElementById('idWaitBanner').className = 'clsHidden'; 
    60 } 
    61  
    62   document.getElementById('idWaitBanner').innerHTML = 'Configuration applied'; 
    63   document.getElementById('idWaitBanner').className = 'clsWaitFinishOK'; 
    64   setTimeout('hideWaitBanner()',3000); 
    65 </script> 
    66 "; 
    67   } 
    68    
    6927  //reload asterisk 
    7028  $fp = fsockopen("localhost", 5038, $errno, $errstr, 10); 
     
    10866  } 
    10967  $need_reload[0] = 'false'; 
     68 
     69  // fix - this will trigger the post reload actions after the "need reload" flag 
     70  // is down.  
     71  if (isset($amp_conf["POST_RELOAD"])) 
     72  { 
     73    echo " 
     74<style> 
     75.clsWait        { position: absolute; top:75px; left: 25%; width: 50%; text-align:center; border: red solid 1px; background:#f0d0d0; display: block; font-weight: bold } 
     76.clsWaitFinishOK{ position: absolute; top:75px; left: 25%; width: 50%; text-align:center; border: blue solid 1px; background:#d0d0f0; display: block; } 
     77.clsHidden      { display: none } 
     78</style> 
     79"; 
     80    echo "<div id='idWaitBanner' class='clsWait'> Please wait while applying configuration</div>"; 
     81     
     82    if (!isset($amp_conf["POST_RELOAD_DEBUG"]) ||  
     83        (($amp_conf["POST_RELOAD_DEBUG"]!="1") && ($amp_conf["POST_RELOAD_DEBUG"]!="true"))  
     84       ) 
     85      echo "<div style='display:none'>"; 
     86       
     87    echo "Executing post apply script <b>".$amp_conf["POST_RELOAD"]."</b><pre>"; 
     88    system( $amp_conf["POST_RELOAD"] ); 
     89    echo "</pre>"; 
     90     
     91    if (!isset($amp_conf["POST_RELOAD_DEBUG"]) ||  
     92        (($amp_conf["POST_RELOAD_DEBUG"]!="1") &&  
     93         ($amp_conf["POST_RELOAD_DEBUG"]!="true")) 
     94        ) 
     95      echo "</div><br>"; 
     96     
     97    echo " 
     98<script type='text/javascript'> 
     99function hideWaitBanner() 
     100{ 
     101  document.getElementById('idWaitBanner').className = 'clsHidden'; 
     102} 
     103 
     104  document.getElementById('idWaitBanner').innerHTML = 'Configuration applied'; 
     105  document.getElementById('idWaitBanner').className = 'clsWaitFinishOK'; 
     106  setTimeout('hideWaitBanner()',3000); 
     107</script> 
     108"; 
     109  } 
     110     
    110111} 
    111112if (isset($_SESSION["AMP_user"]) && ($_SESSION["AMP_user"]->checkSection(99))) {