protected function _loadPrefs($app, $data = false)
{
global $registry;
try {
$pconf = $registry->loadConfigFile('prefs.php', array('prefGroups', '_prefs'), $app);
$res = array('prefGroups' => $pconf->config['prefGroups'], '_prefs' => $pconf->config['_prefs']);
} catch (Horde_Exception $e) {
$res = array('prefGroups' => array(), '_prefs' => array());
}
if ($data) {
return $res;
}
$this->prefGroups = isset($res['prefGroups']) ? $res['prefGroups'] : array();
$this->prefs = $res['_prefs'];
/* If there's only one prefGroup, just show it. */
if (!$this->group && count($this->prefGroups) == 1) {
reset($this->prefGroups);
$this->group = key($this->prefGroups);
}
}