Changeset 2617

Show
Ignore:
Timestamp:
09/26/06 06:43:51 (6 years ago)
Author:
qldrob
Message:

Apply first part of tidy-up patches in #1138 - Thanks!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/amp_conf/htdocs/admin/components.class.php

    r2547 r2617  
    33 
    44class component { 
    5   var $_compname; // Component name (e.g. users, devices, etc.etc.) 
     5  var $_compname; // Component name (e.g. users, devices, etc.) 
     6  var $_type; // Type name of this component ( e.g. setup, tool etc.) 
    67   
    78  var $_guielems_top; // Array of guielements 
     
    2021  var $_lists; // Array of lists 
    2122 
    22   function component($compname) { 
     23  function component($compname, $type = 'setup') { 
    2324    $this->_compname = $compname; 
     25    $this->_type = $type; 
    2426     
    2527    $this->_sorted_guielems = true; 
     
    236238    // Start of form 
    237239    $htmlout .= "<form name=\"$formname\" action=\"".$_SERVER['PHP_SELF']."\" method=\"post\" onsubmit=\"return ".$formname."_onsubmit();\">\n"; 
    238     $htmlout .= "<input type=\"hidden\" name=\"display\" value=\"$this->_compname\">\n\n"; 
     240    $htmlout .= "<input type=\"hidden\" name=\"display\" value=\"$this->_compname\">\n"; 
     241    $htmlout .= "<input type=\"hidden\" name=\"type\" value=\"$this->_type\">\n\n"; 
    239242     
    240243    // Start of table 
     
    367370    } 
    368371  } 
     372 
     373  function isequal($compname, $type) { 
     374    return $this->_compname == $compname && $this->_type == $type; 
     375  } 
    369376} 
    370377 
  • freepbx/trunk/amp_conf/htdocs/admin/config.php

    r2563 r2617  
    1414$title="freePBX administration"; 
    1515 
     16$type = isset($_REQUEST['type'])?$_REQUEST['type']:'setup'; 
     17$display = isset($_REQUEST['display'])?$_REQUEST['display']:''; 
     18$extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null; 
     19$skip = isset($_REQUEST['skip'])?$_REQUEST['skip']:0; 
     20$action = isset($_REQUEST['action'])?$_REQUEST['action']:null; 
     21$quietmode = isset($_REQUEST['quietmode'])?$_REQUEST['quietmode']:''; 
     22 
    1623// determine module type to show, default to 'setup' 
    17 if(isset($_REQUEST['type']) && $_REQUEST['type'] == "tool") { 
     24if($type == "tool") { 
    1825  $message="Tools"; 
     26  $amp_sections = array( 
     27    'modules'=>_("Module Admin") 
     28  ); 
     29} elseif($type == "cdrcost") { 
     30  $message="Call Cost"; 
    1931} else { 
    2032  $message="Setup"; 
    2133} 
    2234 
    23 $quietmode = isset($_REQUEST['quietmode'])?$_REQUEST['quietmode']:''; 
    2435require_once('functions.inc.php'); 
    2536 
     
    2940 
    3041include 'header_auth.php'; 
    31  
    32 if (isset($_REQUEST['display'])) { 
    33   $display=$_REQUEST['display']; 
    34 } else { 
    35   $display=''; 
    36 } 
    37  
    38 // if we are looking at tools, then show module admin 
    39 if ($_REQUEST['type'] == "tool") { 
    40   $amp_sections = array( 
    41     'modules'=>_("Module Admin") 
    42   ); 
    43 } 
    4442 
    4543/* 
     
    4947}*/ 
    5048 
    51 // determine module type to show, default to 'setup' 
    52 if(isset($_REQUEST['type']) && $_REQUEST['type'] == "tool") { 
    53   $type='tool'; 
    54 } else { 
    55   $type='setup'; 
    56 } 
    5749// get all enabled modules 
    5850// active_modules array used below and in drawselects function and genConf function 
     
    140132          echo "<li>".$matches[1]._($matches[2]).$matches[3]."</li>\n"; 
    141133        else 
    142         echo "<li><a id=\"".(($display==$key) ? 'current':'')."\" href=\"config.php?".(isset($_REQUEST['type'])?"type={$_REQUEST['type']}&":"")."display=".$key."\">"._($value)."</a></li>\n"; 
     134        echo "<li><a id=\"".(($display==$key) ? 'current':'')."\" href=\"config.php?type=".$type."&display=".$key."\">"._($value)."</a></li>\n"; 
    143135      } 
    144136    } 
     
    158150// load the component from the loaded modules 
    159151if ( $display != '' && isset($configpageinits) && is_array($configpageinits) ) { 
    160   $currentcomponent = new component($display); 
     152 
     153  $currentcomponent = new component($display,$type); 
    161154 
    162155  // call every modules _configpageinit function which should just 
  • freepbx/trunk/amp_conf/htdocs/admin/functions.inc.php

    r2392 r2617  
    324324 
    325325// draw list for users and devices with paging 
    326 function drawListMenu($results, $skip, $dispnum, $extdisplay, $description) { 
     326function drawListMenu($results, $skip, $type, $dispnum, $extdisplay, $description) { 
    327327  $perpage=20; 
    328328   
     
    330330  $index = 0; 
    331331  if ($skip == "") $skip = 0; 
    332   echo "<li><a id=\"".($extdisplay=='' ? 'current':'')."\" href=\"config.php?display=".$dispnum."\">"._("Add")." ".$description."</a></li>"; 
     332  echo "<li><a id=\"".($extdisplay=='' ? 'current':'')."\" href=\"config.php?type=".$type."&display=".$dispnum."\">"._("Add")." ".$description."</a></li>"; 
    333333 
    334334  if (isset($results)) { 
     
    345345       
    346346      $index= $index + 1;  
    347       echo "<li><a id=\"".($extdisplay==$result[0] ? 'current':'')."\" href=\"config.php?display=".$dispnum."&extdisplay={$result[0]}&skip={$skip}\">{$result[1]} <{$result[0]}></a></li>"; 
     347      echo "<li><a id=\"".($extdisplay==$result[0] ? 'current':'')."\" href=\"config.php?type=".$type."&display=".$dispnum."&extdisplay={$result[0]}&skip={$skip}\">{$result[1]} <{$result[0]}></a></li>"; 
    348348    } 
    349349  } 
     
    356356     $prevskip= $skip - $perpage; 
    357357     if ($prevskip<0) $prevskip= 0; 
    358      $prevtag_pre= "<a href='?display=".$dispnum."&skip=$prevskip'>[PREVIOUS]</a>"; 
     358     $prevtag_pre= "<a href='?type=".$type."&display=".$dispnum."&skip=$prevskip'>[PREVIOUS]</a>"; 
    359359     print "$prevtag_pre"; 
    360360  } 
     
    363363    $nextskip= $skip + $index; 
    364364    if ($prevtag_pre) $prevtag .= " | "; 
    365     print "$prevtag <a href='?display=".$dispnum."&skip=$nextskip'>[NEXT]</a>"; 
     365    print "$prevtag <a href='?type=".$type."&display=".$dispnum."&skip=$nextskip'>[NEXT]</a>"; 
    366366  } 
    367367  elseif ($skip) { 
  • freepbx/trunk/amp_conf/htdocs/admin/header.php

    r1874 r2617  
    8686<?php } ?> 
    8787 
    88   <a id="<?php echo ($currentFile=='config.php' && $_REQUEST['type']!='tool' ? 'current':'') ?>" href="config.php?type=setup"> 
     88  <a id="<?php echo ($currentFile=='config.php' && $_REQUEST['type']=='setup' ? 'current':'') ?>" href="config.php?type=setup"> 
    8989    &#8226; 
    9090    <li><?php echo _("Setup") ?></li> 
  • freepbx/trunk/amp_conf/htdocs/admin/modules/core/page.devices.php

    r2399 r2617  
    1616<?php  
    1717$devices = core_devices_list(); 
    18 drawListMenu($devices, $_REQUEST['skip'], $_REQUEST['display'], $_REQUEST['extdisplay'], _("Device")); 
     18drawListMenu($devices, $skip, $type, $display, $extdisplay, _("Device")); 
    1919?> 
    2020</div> 
  • freepbx/trunk/amp_conf/htdocs/admin/modules/core/page.extensions.php

    r2547 r2617  
    1515<div class="rnav"> 
    1616<?php  
    17 $skip = isset($_REQUEST['skip'])?$_REQUEST['skip']:null; 
    18 $display = isset($_REQUEST['display'])?$_REQUEST['display']:null; 
    19 $extdisplay = isset($_REQUEST['extdisplay'])?$_REQUEST['extdisplay']:null; 
    2017$extens = core_users_list(); 
    21  
    22 drawListMenu($extens, $skip, $display, $extdisplay, _("Extension")); 
     18drawListMenu($extens, $skip, $type, $display, $extdisplay, _("Extension")); 
    2319?> 
    2420</div> 
  • freepbx/trunk/amp_conf/htdocs/admin/modules/core/page.users.php

    r2392 r2617  
    1919 
    2020$extens = core_users_list(); 
    21 drawListMenu($extens, $_REQUEST['skip'], $_REQUEST['display'], $_REQUEST['extdisplay'], _("User")); 
     21drawListMenu($extens, $skip, $type, $display, $extdisplay, _("User")); 
    2222?> 
    2323</div>