Changeset 9799

Show
Ignore:
Timestamp:
06/01/10 15:06:54 (2 years ago)
Author:
p_lindheimer
Message:

closes #4311 use freepbx_menu.conf to make modifications to left navigation menu, if file is not present then the code path remains unchanged

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.8/amp_conf/htdocs/admin/views/freepbx_admin.php

    r9788 r9799  
    66<!-- begin menu --> 
    77<?php 
     8global $amp_conf; 
     9$fd = $amp_conf['ASTETCDIR'].'/freepbx_menu.conf'; 
     10if ($fpbx_usecategories && file_exists($fd)) { 
     11  $favorites = parse_ini_file($fd,true); 
     12  if ($favorites !== false) foreach ($favorites as $menuitem => $setting) { 
     13    if (isset($fpbx_menu[$menuitem])) { 
     14      foreach($setting as $key => $value) { 
     15        switch ($key) { 
     16          case 'category': 
     17          case 'name': 
     18            $fpbx_menu[$menuitem][$key] = htmlspecialchars($value); 
     19          break; 
     20          case 'type': 
     21            if (strtolower($value)=='setup' || strtolower($value)=='tool') { 
     22              $fpbx_menu[$menuitem][$key] = strtolower($value); 
     23            } 
     24          break; 
     25          case 'sort': 
     26            if (is_numeric($value) && $value > -10 && $value < 10) { 
     27              $fpbx_menu[$menuitem][$key] = $value; 
     28            } 
     29          break; 
     30          case 'remove': 
     31            // parse_ini_file sets all forms of yes/true to 1 and no/false to nothing 
     32            if ($value == '1') { 
     33              unset($fpbx_menu[$menuitem]); 
     34            } 
     35          break; 
     36        } 
     37      } 
     38    } 
     39  } 
     40} 
     41 
    842$prev_category = ''; 
    943 
     
    1650  // Sorting menu by category and name 
    1751  foreach ($fpbx_menu as $key => $row) { 
    18     $category[$key] = $row['category']; 
     52    // Fake name to have it follow after Admin in the sort order 
     53    $category[$key] = $row['category'] == 'Favorites'?'Admin Favorites':$row['category']; 
    1954    $sort[$key] = $row['sort']; 
    2055    $sort_name[$key] = $row['name'];