public function get($parameter, $app = null)
{
if (is_null($app)) {
$app = $this->getApp();
}
if (isset($this->applications[$app][$parameter])) {
$pval = $this->applications[$app][$parameter];
} else {
switch ($parameter) {
case 'icon':
$pval = Horde_Themes::img($app . '.png', $app);
if ((string) $pval == '') {
$pval = Horde_Themes::img('app-unknown.png', 'horde');
}
break;
case 'initial_page':
$pval = null;
break;
default:
$pval = isset($this->applications['horde'][$parameter]) ? $this->applications['horde'][$parameter] : null;
break;
}
}
return $parameter == 'name' ? strlen($pval) ? _($pval) : '' : $pval;
}
/** * Given a permission name, returns the title for that permission by * looking it up in the applications's permission api. * * @param string $name The permissions's name. * * @return string The title for the permission. */ public function getTitle($name) { if ($name === Horde_Perms::ROOT) { return Horde_Core_Translation::t("All Permissions"); } $levels = explode(':', $name); if (count($levels) == 1) { return $this->_registry->get('name', $name) . ' (' . $name . ')'; } array_pop($levels); // This is the permission name /* First level is always app. */ $app = $levels[0]; $app_perms = $this->getApplicationPermissions($app); return isset($app_perms['title'][$name]) ? $app_perms['title'][$name] . ' (' . $this->_perms->getShortName($name) . ')' : $this->_perms->getShortName($name); }