public showService ( string $type ) : boolean | ||
$type | string | The type of link.
The following must be defined in Horde's menu config, or else they won't be displayed in the menu: 'help', 'problem', 'logout', 'login', 'prefs' |
return | boolean | True if the link is to be shown. |
public function showService($type)
{
global $conf;
if (!in_array($type, array('help', 'problem', 'logout', 'login', 'prefs'))) {
return true;
}
if (empty($conf['menu']['links'][$type])) {
return false;
}
switch ($conf['menu']['links'][$type]) {
case 'all':
return true;
case 'authenticated':
return (bool) $this->getAuth();
default:
case 'never':
return false;
}
}