Changeset 2828

Show
Ignore:
Timestamp:
10/24/06 01:33:38 (7 years ago)
Author:
gregmac
Message:

Added module categories to menu

Files:

Legend:

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

    r2819 r2828  
    7070        foreach($module['items'] as $itemKey => $itemName) { 
    7171          $amp_sections[$itemKey] = $itemName; 
     72          $amp_menu[ $module['category'] ][$itemKey] = $itemName; 
    7273        } 
    7374      } 
     
    100101} 
    101102 
    102  
    103 if (!$quietmode) { 
    104   //echo "<table width=\"100%\" cellspacing='0' cellpadding='0'><tr><td>"; 
    105   // show menu 
    106   echo "\t<div id=\"nav\"><ul>\n"; 
    107 } 
    108103 
    109104// extensions vs device/users ... this is a bad design, but hey, it works 
     
    134129        } 
    135130      } 
    136       if (!$quietmode) { 
    137         if (preg_match("/^(<a.+>)(.+)(<\/a>)/",$value,$matches)) 
    138           echo "\t\t<li>".$matches[1]._($matches[2]).$matches[3]."</li>\n"; 
    139         else 
    140           echo "\t\t<li><a" . 
    141             (($display==$key) ? ' id="current"':'') . 
    142             " href=\"config.php?type=".$type."&amp;display=".$key."\">"._($value)."</a></li>\n"; 
    143       } 
    144131    } 
    145132  } else { 
     
    148135  } 
    149136} 
    150 if (!$quietmode) {   
     137 
    151138//  TODO why do we need the <div class='clear'> here ...? 
    152139//  echo "\t\t\n"; 
    153140//  echo "\t\t<div class='clear'></div>\n"; 
     141 
     142if (!$quietmode) { 
     143  echo "\t<div id=\"nav\"><ul>\n"; 
     144  ksort($amp_menu); 
     145  foreach ($amp_menu as $category => $items) { 
     146    echo "\t\t<li>".$category."</li>\n"; 
     147    asort($items); 
     148    foreach ($items as $key=>$value) { 
     149      if (preg_match("/^(<a.+>)(.+)(<\/a>)/",$value,$matches)) { 
     150        echo "\t\t<li>".$matches[1]._($matches[2]).$matches[3]."</li>\n"; 
     151      } else { 
     152        echo "\t\t<li><a" . 
     153          (($display==$key) ? ' id="current"':'') . 
     154          " href=\"config.php?type=".$type."&amp;display=".$key."\">"._($value)."</a></li>\n"; 
     155      } 
     156    } 
     157  } 
    154158  echo "\t</ul></div>\n\n"; 
    155159  echo "<div id=\"wrapper\"><div class=\"content\">\n";