Changeset 12728

Show
Ignore:
Timestamp:
10/03/11 19:07:37 (2 years ago)
Author:
p_lindheimer
Message:

allows menu tabs with only a single module to be a direct link, removes User Panel link which will be replaced by a module

Files:

Legend:

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

    r12727 r12728  
    5858      case 'reports': 
    5959      case 'settings': 
     60      case 'user panel': 
    6061        $menu[strtolower($deets['category'])][] = $deets; 
    6162        break; 
     
    6667  } else { 
    6768    foreach ($fpbx_menu as $mod => $deets) { 
    68       $menu[strtolower($deets['category'])][] = $deets; 
     69      $menu[$deets['category']][] = $deets; 
    6970    } 
    7071  } 
     
    7677    //      first checking in the module owner's i18n, then in the core i18n 
    7778    // 
     79 
     80    if (count($cat) == 1) { 
     81      if (isset($cat[0]['hidden']) && $cat[0]['hidden'] == 'true') { 
     82        continue; 
     83      } 
     84      $href = isset($cat[0]['href']) ? $cat[0]['href'] : 'config.php?display=' . $cat[0]['display']; 
     85      $target = isset($cat[0]['target']) ? ' target="' . $cat[0]['target'] . '"'  : ''; 
     86      $class = $cat[0]['display'] == $display ? 'class="ui-state-highlight"' : ''; 
     87      $mods[$t] = '<a href="' . $href . '" ' . $target . $class . '>' . _(ucwords($t)) . '</a>'; 
     88      continue; 
     89    } 
    7890    $mods[$t] = '<a href="#">' 
    7991        . _(ucwords($t)) 
     
    90102          : "config.php?display=" . $mod['display']; 
    91103 
     104      $target = isset($mod['target'])  
     105          ? ' target="' . $cat[0]['target'] . '" '  : ''; 
     106 
    92107      //highlight currently in-use module 
    93108      if ($display == $mod['display']) { 
     
    103118 
    104119      $items[$mod['name']] = '<li><a href="' . $href . '"' 
     120          . $target 
    105121          . 'class="' . implode(' ', $classes) . '">' 
    106122          . _(ucwords($mod['name'])) 
     
    117133  $out .= implode($mods); 
    118134} 
    119 $out .= '<a href="/recordings" target="_blank">' . _('User Panel') . '</a>'; 
    120135$out .= '<a id="language-menu-button" class="button-right ui-widget-content ui-state-default">' . _('Language') . '</a>'; 
    121136$out .= '<ul id="fpbx_lang" style="display:none;">';