Changeset 4008

Show
Ignore:
Timestamp:
06/08/07 00:04:05 (6 years ago)
Author:
p_lindheimer
Message:

Merged revisions 4007 via svnmerge from
https://amportal.svn.sourceforge.net/svnroot/amportal/modules/branches/2.2

........

r4007 | p_lindheimer | 2007-06-07 21:02:56 -0700 (Thu, 07 Jun 2007) | 1 line


added some improved error checking and minor display tweaks

........

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.3

    • Property svnmerge-integrated changed from /modules/branches/2.2:1-3588,3615-3635,3637-3638,3640,3674,3680,3686,3692,3702,3706,3710,3716,3758,3760,3762-3765,3767-3785,3787-3789,3801,3810,3828,3831,3839,3860,3866,3875,3877,3887,3899,3911,3913,3943,3982-3983,3990,3998 to /modules/branches/2.2:1-3588,3615-3635,3637-3638,3640,3674,3680,3686,3692,3702,3706,3710,3716,3758,3760,3762-3765,3767-3785,3787-3789,3801,3810,3828,3831,3839,3860,3866,3875,3877,3887,3899,3911,3913,3943,3982-3983,3990,3998,4007
  • modules/branches/2.3/asteriskinfo/module.xml

    r3986 r4008  
    22  <rawname>asteriskinfo</rawname> 
    33  <name>Asterisk Info</name> 
    4   <version>0.1.0</version> 
     4  <version>0.2.0</version> 
    55  <type>tool</type> 
    66  <category>System Administration</category> 
     
    1111    <asteriskinfo>Asterisk Info</asteriskinfo> 
    1212  </menuitems> 
     13  <depends> 
     14    <engine>asterisk</engine> 
     15  </depends> 
    1316  <changelog> 
    1417    *0.1.0* Initial release 
     18    *0.2.0* Add depends asterisk xml tag, proper error checking for manager connection, center table titles 
    1519  </changelog> 
    1620  <location>release/2.3/asteriskinfo-0.1.0.tgz</location> 
  • modules/branches/2.3/asteriskinfo/page.asteriskinfo.php

    r3985 r4008  
    9494<?php  
    9595foreach ($modes as $mode => $value) { 
    96 echo "<li><a id=\"".($extdisplay==$mode)."\" href=\"config.php?&type=".urlencode("tool")."&display=".urlencode($dispnum)."&extdisplay=".urlencode($mode)."\">"._($value)."</a></li>"; 
     96 echo "<li><a id=\"".($extdisplay==$mode)."\" href=\"config.php?&type=".urlencode("tool")."&display=".urlencode($dispnum)."&extdisplay=".urlencode($mode)."\">"._($value)."</a></li>"; 
    9797} 
    9898?> 
     
    109109<table class="box"> 
    110110<?php 
    111 if ($extdisplay != "summary") { 
    112   $arr="arr_".$extdisplay; 
    113   foreach ($$arr as $key => $value) { 
    114   ?> 
    115     <tr class="boxheader"> 
    116       <td colspan="2"><h5><?php echo _("$key")?><hr></h5></td> 
    117     </tr> 
     111if (!$astman) { 
     112?> 
     113  <tr class="boxheader"> 
     114    <td colspan="2" align="center"><h5><?php echo _("ASTERISK MANAGER ERROR")?><hr></h5></td> 
     115  </tr> 
    118116    <tr class="boxbody"> 
    119117      <td> 
    120118      <table border="0" > 
    121119        <tr> 
    122           <td> 
    123             <pre> 
     120          <td align="left"> 
    124121              <?php  
    125               $response = $astman->send_request('Command',array('Command'=>$value)); 
    126               $new_value = $response['data']; 
    127               /* 
    128               $new_value = explode("\n",$new_value); 
    129               array_shift($new_value); 
    130               $new_value = implode("\n",$new_value); 
    131               */ 
    132               echo ltrim($new_value,'Privilege: Command'); 
     122              echo "<br>The module was unable to connect to the asterisk manager.<br>Make sure Asterisk is running and your manager.conf settings are proper.<br><br>"; 
    133123              ?> 
    134             </pre> 
    135           </td> 
    136         </tr> 
    137       </table> 
    138       </td> 
    139     </tr> 
    140   <?php 
    141     } 
    142   } else { 
    143 ?> 
    144     <tr class="boxheader"> 
    145       <td colspan="2"><h5><?php echo _("Summary")?><hr></h5></td> 
    146     </tr> 
    147     <tr class="boxbody"> 
    148       <td> 
    149       <table border="0"> 
    150         <tr> 
    151           <td> 
    152             <?php echo buildAsteriskInfo(); ?> 
    153124          </td> 
    154125        </tr> 
     
    157128    </tr> 
    158129<?php 
    159   } 
    160 ?> 
    161 </table> 
     130} else { 
     131  if ($extdisplay != "summary") { 
     132    $arr="arr_".$extdisplay; 
     133    foreach ($$arr as $key => $value) { 
     134?> 
     135      <tr class="boxheader"> 
     136        <td colspan="2" align="center"><h5><?php echo _("$key")?><hr></h5></td> 
     137      </tr> 
     138      <tr class="boxbody"> 
     139        <td> 
     140        <table border="0" > 
     141          <tr> 
     142            <td> 
     143              <pre> 
     144                <?php  
     145                $response = $astman->send_request('Command',array('Command'=>$value)); 
     146                $new_value = $response['data']; 
     147                echo ltrim($new_value,'Privilege: Command'); 
     148                ?> 
     149              </pre> 
     150            </td> 
     151          </tr> 
     152        </table> 
     153        </td> 
     154      </tr> 
     155    <?php 
     156      } 
     157    } else { 
     158  ?> 
     159      <tr class="boxheader"> 
     160        <td colspan="2" align="center"><h5><?php echo _("Summary")?><hr></h5></td> 
     161      </tr> 
     162      <tr class="boxbody"> 
     163        <td> 
     164        <table border="0"> 
     165          <tr> 
     166            <td> 
     167              <?php echo buildAsteriskInfo(); ?> 
     168            </td> 
     169          </tr> 
     170        </table> 
     171      </td> 
     172    </tr> 
     173<?php 
     174  } 
     175
     176?> 
     177  </table> 
    162178<tr> 
    163179  <td colspan="2"><h6><input name="Submit" type="submit" value="<?php echo _("Refresh")?>"></h6></td>