$GLOBALS['conf']['avatar']['enable_gallery'] &&
$vfs->isFolder(Agora::AVATAR_PATH, 'gallery')) {
Horde::addScriptFile('popup.js', 'horde', true);
- } else {
- $suppress[] = 'avatar_link';
}
break;
}
}
/**
+ * Determine active prefs when displaying a group.
+ *
+ * @param Horde_Core_Prefs_Ui $ui The UI object.
+ */
+ public function prefsGroup($ui)
+ {
+ switch ($ui->group) {
+ case 'display_avatar':
+ $vfs = Agora::getVFS();
+ if (($vfs instanceof PEAR_Error) ||
+ !$GLOBALS['conf']['avatar']['enable_gallery'] ||
+ !$vfs->isFolder(Agora::AVATAR_PATH, 'gallery')) {
+ $suppress[] = 'avatar_link';
+ }
+ break;
+ }
+ }
+
+ /**
* Generate code used to display a special preference.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
}
/**
- * Populate dynamically-generated preference values.
+ * Determine active prefs when displaying a group.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
*/
- public function prefsEnum($ui)
+ public function prefsGroup($ui)
{
global $conf, $prefs;
* @author Chuck Hagenbuch <chuck@horde.org>
* @author Michael Slusarz <slusarz@horde.org>
* @category Horde
+ * @license http://www.fsf.org/copyleft/lgpl.html LGPL
* @package Core
*/
class Horde_Core_Prefs_Ui
public $suppressGroups = array();
/**
- * Suppressed preference entries to automatically update.
- *
- * @var array
- */
- public $suppressUpdate = array();
-
- /**
* Current application.
*
* @var string
/* Load preferences. */
$this->_loadPrefs($this->app);
- /* Populate enums. */
- if ($this->group &&
- $registry->hasAppMethod($this->app, 'prefsEnum') &&
- $this->groupIsEditable($this->group)) {
- $registry->callAppMethod($this->app, 'prefsEnum', array('args' => array($this)));
- }
-
/* Run app-specific init code. */
if ($registry->hasAppMethod($this->app, 'prefsInit')) {
$registry->callAppMethod($this->app, 'prefsInit', array('args' => array($this)));
}
+
+ if ($this->group &&
+ $registry->hasAppMethod($this->app, 'prefsGroup')) {
+ $registry->callAppMethod($this->app, 'prefsGroup', array('args' => array($this)));
+ }
}
/**
($this->prefGroups[$this->group]['type'] == 'identities')) {
$this->_identitiesUpdate();
} else {
- $this->_handleForm(array_diff($this->getChangeablePrefs($this->group), $this->suppressUpdate), $GLOBALS['prefs']);
+ $this->_handleForm($this->getChangeablePrefs($this->group), $GLOBALS['prefs']);
}
break;
$this->_handleForm($special, $GLOBALS['prefs']);
break;
}
+
+ if ($GLOBALS['registry']->hasAppMethod($this->app, 'prefsGroup')) {
+ $this->suppress = array();
+ $GLOBALS['registry']->callAppMethod($this->app, 'prefsGroup', array('args' => array($this)));
+ }
}
/*
$identity->setDefault($id);
try {
- $this->_handleForm(array_diff($this->_addHordeIdentitiesPrefs($this->getChangeablePrefs($this->group)), $this->suppressUpdate), $identity);
+ $this->_handleForm($this->_addHordeIdentitiesPrefs($this->getChangeablePrefs($this->group)), $identity);
} catch (Exception $e) {
$notification->push($e, 'horde.error');
return;
// public function changeLanguage() {}
/**
- * Populate dynamically-generated preference values.
+ * Run on init when viewing prefs for an application.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
*/
- // public function prefsEnum($ui) {}
+ // public function prefsInit($ui) {}
/**
- * Code to run on init when viewing prefs for this application.
+ * Determine active prefs when displaying a group. This is where all
+ * suppress/overrides should be defined.
+ *
+ * This function may be run multiple times in a single page - once on init
+ * and once after prefs are updated.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
*/
- // public function prefsInit($ui) {}
+ // public function prefsGroup($ui) {}
/**
* Called when preferences are changed.
}
/**
- * Populate dynamically-generated preference values.
- *
- * @param Horde_Core_Prefs_Ui $ui The UI object.
- */
- public function prefsEnum($ui)
- {
- $GLOBALS['injector']->getInstance('Horde_Prefs_Ui')->prefsEnum($ui);
- }
-
- /**
* Code to run on init when viewing prefs for this application.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
class Horde_Prefs_Ui
{
/**
- * Populate dynamically-generated preference values.
+ * Code to run on init when viewing prefs for this application.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
*/
- public function prefsEnum($ui)
+ public function prefsInit($ui)
{
- global $injector, $notification, $prefs, $registry;
+ global $conf, $injector, $prefs, $registry;
switch ($ui->group) {
case 'display':
}
if (!$prefs->isLocked('theme')) {
- try {
- $ui->override['theme'] = Horde_Themes::themeList();
- } catch (UnexpectedValueException $e) {
- $notification->push(_("Theme directory can't be opened"), 'horde.error');
- }
+ $ui->override['theme'] = Horde_Themes::themeList();
}
break;
$ui->override['timezone'] = Horde_Nls::getTimezones();
array_unshift($ui->override['timezone'], _("Default"));
}
- break;
- }
- }
-
- /**
- * Code to run on init when viewing prefs for this application.
- *
- * @param Horde_Core_Prefs_Ui $ui The UI object.
- */
- public function prefsInit($ui)
- {
- global $conf, $injector, $prefs, $registry;
- switch ($ui->group) {
- case 'language':
if (!$prefs->isLocked('sending_charset')) {
asort($registry->nlsconfig['encodings']);
}
* IMP_Prefs_Ui so it doesn't have to be loaded on every page load. */
/**
- * Populate dynamically-generated preference values.
+ * Code to run on init when viewing prefs for this application.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
*/
- public function prefsEnum($ui)
+ public function prefsInit($ui)
{
- $GLOBALS['injector']->getInstance('IMP_Prefs_Ui')->prefsEnum($ui);
+ $GLOBALS['injector']->getInstance('IMP_Prefs_Ui')->prefsInit($ui);
}
/**
- * Code to run on init when viewing prefs for this application.
+ * Determine active prefs when displaying a group.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
*/
- public function prefsInit($ui)
+ public function prefsGroup($ui)
{
- $GLOBALS['injector']->getInstance('IMP_Prefs_Ui')->prefsInit($ui);
+ $GLOBALS['injector']->getInstance('IMP_Prefs_Ui')->prefsGroup($ui);
}
/**
protected $_cache = null;
/**
- * Populate dynamically-generated preference values.
+ * Run once on init when viewing prefs for an application.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
*/
- public function prefsEnum($ui)
+ public function prefsInit($ui)
{
- global $prefs, $registry;
+ global $conf, $injector, $prefs, $registry, $session;
switch ($ui->group) {
+ case 'accounts':
+ if (!empty($conf['user']['allow_accounts'])) {
+ Horde::addScriptFile('accountsprefs.js', 'imp');
+ }
+ break;
+
+ case 'acl':
+ Horde::addScriptFile('acl.js', 'imp');
+ break;
+
case 'addressbooks':
- if (!$prefs->isLocked('add_source')) {
- try {
- $sources = array();
- foreach ($registry->call('contacts/sources', array(true)) as $source => $name) {
- $sources[$source] = $name;
- }
- $ui->override['add_source'] = $sources;
- } catch (Horde_Exception $e) {
- $ui->suppress[] = 'add_source';
- }
+ if (!$prefs->isLocked('sourceselect')) {
+ Horde_Core_Prefs_Ui_Widgets::addressbooksInit();
}
break;
case 'delmove':
- if ($GLOBALS['session']->get('imp', 'protocol') == 'pop') {
+ if ($session->get('imp', 'protocol') == 'pop') {
$tmp = $ui->prefs['delete_spam_after_report']['enum'];
unset($tmp[2]);
$ui->override['delete_spam_after_report'] = $tmp;
}
break;
+
+ case 'display':
+ /* Set the timezone on this page so the 'time_format' output uses
+ * the configured time zone's time, not the system's time zone. */
+ $registry->setTimeZone();
+ break;
+
+ case 'flags':
+ if ($prefs->isLocked('msgflags') &&
+ $prefs->isLocked('msgflags_user')) {
+ $ui->nobuttons = true;
+ } else {
+ Horde::addScriptFile('colorpicker.js', 'horde');
+ Horde::addScriptFile('flagprefs.js', 'imp');
+ }
+ break;
+
+ case 'identities':
+ if (!$prefs->isLocked('sent_mail_folder')) {
+ Horde::addScriptFile('folderprefs.js', 'imp');
+ }
+
+ if (!$prefs->isLocked('signature_html') &&
+ $session->get('imp', 'rteavail')) {
+ Horde::addScriptFile('signaturehtml.js', 'imp');
+ IMP_Ui_Editor::init(false, 'signature_html');
+ }
+ break;
+
+ case 'pgp':
+ Horde::addScriptFile('imp.js', 'imp');
+ break;
+
+ case 'searches':
+ Horde::addScriptFile('searchesprefs.js', 'imp');
+ break;
+
+ case 'server':
+ $code = array();
+
+ if (!$prefs->isLocked('drafts_folder')) {
+ $code['drafts'] = _("Enter the name for your new drafts folder.");
+ }
+
+ if (!$prefs->isLocked('spam_folder')) {
+ $code['spam'] = _("Enter the name for your new spam folder.");
+ }
+
+ if (!$prefs->isLocked('trash_folder')) {
+ $code['trash'] = _("Enter the name for your new trash folder.");
+ }
+
+ if (!empty($code)) {
+ Horde::addScriptFile('folderprefs.js', 'imp');
+ Horde::addInlineJsVars(array(
+ 'ImpFolderPrefs.folders' => $code
+ ));
+ }
+ break;
+
+ case 'smime':
+ Horde::addScriptFile('imp.js', 'imp');
+ break;
+
+ case 'stationery':
+ if (!$prefs->isLocked('stationery')) {
+ $ui->nobuttons = true;
+ }
+ break;
+
+ case 'viewing':
+ /* Sort encodings. */
+ if (!$prefs->isLocked('default_msg_charset')) {
+ asort($registry->nlsconfig['encodings']);
+ }
+ break;
+ }
+
+ /* Hide appropriate prefGroups. */
+ if ($session->get('imp', 'protocol') == 'pop') {
+ $ui->suppressGroups[] = 'flags';
+ $ui->suppressGroups[] = 'searches';
+ $ui->suppressGroups[] = 'server';
+ }
+
+ try {
+ $injector->getInstance('IMP_Imap_Acl');
+ } catch (IMP_Exception $e) {
+ $ui->suppressGroups[] = 'acl';
+ }
+
+ if (empty($conf['user']['allow_accounts'])) {
+ $ui->suppressGroups[] = 'accounts';
+ }
+
+ $contacts_app = $registry->hasInterface('contacts');
+ if (!$contacts_app || !$registry->hasPermission($contacts_app)) {
+ $ui->suppressGroups[] = 'addressbooks';
+ }
+
+ if (!isset($conf['gnupg']['path'])) {
+ $ui->suppressGroups[] = 'pgp';
+ }
+
+ if (!Horde_Util::extensionExists('openssl') ||
+ !isset($conf['openssl']['path'])) {
+ $ui->suppressGroups[] = 'smime';
}
+
+ if (empty($conf['user']['allow_folders'])) {
+ $ui->suppressGroups[] = 'searches';
+ }
+
+ // TODO: For now, disable this group since accounts code has not
+ // yet been fully written.
+ $ui->suppressGroups[] = 'accounts';
}
/**
- * Code to run on init when viewing prefs for this application.
+ * Determine active prefs when displaying a group.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
*/
- public function prefsInit($ui)
+ public function prefsGroup($ui)
{
- global $conf, $prefs, $registry, $session;
-
- $pop3 = ($session->get('imp', 'protocol') == 'pop');
+ global $conf, $injector, $prefs, $registry, $session;
switch ($ui->group) {
case 'accounts':
if (empty($conf['user']['allow_accounts'])) {
$ui->suppress[] = 'accountsmanagement';
- } else {
- Horde::addScriptFile('accountsprefs.js', 'imp');
}
break;
- case 'acl':
- Horde::addScriptFile('acl.js', 'imp');
- break;
-
case 'addressbooks':
- if (!$prefs->isLocked('sourceselect')) {
- Horde_Core_Prefs_Ui_Widgets::addressbooksInit();
+ if (!$prefs->isLocked('add_source')) {
+ try {
+ $ui->override['add_source'] = $registry->call('contacts/sources', array(true));
+ } catch (Horde_Exception $e) {
+ $ui->suppress[] = 'add_source';
+ }
}
break;
break;
case 'delmove':
- if ($pop3) {
+ if ($session->get('imp', 'protocol') == 'pop') {
$ui->suppress[] = 'move_ham_after_report';
$ui->suppress[] = 'empty_spam_menu';
$ui->suppress[] = 'use_trash';
break;
case 'display':
- /* Set the timezone on this page so the 'time_format' output uses
- * the configured time zone's time, not the system's time zone. */
- $registry->setTimeZone();
- if ($pop3) {
+ if ($session->get('imp', 'protocol') == 'pop') {
$ui->suppress[] = 'nav_expanded';
$ui->suppress[] = 'tree_view';
}
}
break;
- case 'flags':
- if ($prefs->isLocked('msgflags') &&
- $prefs->isLocked('msgflags_user')) {
- $ui->nobuttons = true;
- } else {
- Horde::addScriptFile('colorpicker.js', 'horde');
- Horde::addScriptFile('flagprefs.js', 'imp');
- }
- break;
-
case 'identities':
if ($prefs->isLocked('sent_mail_folder')) {
$ui->suppress[] = 'sentmailselect';
- } else {
- Horde::addScriptFile('folderprefs.js', 'imp');
}
if ($prefs->isLocked('signature_html') ||
!$session->get('imp', 'rteavail')) {
$ui->suppress[] = 'signature_html_select';
- } else {
- Horde::addScriptFile('signaturehtml.js', 'imp');
- IMP_Ui_Editor::init(false, 'signature_html');
}
break;
if ($prefs->isLocked('initial_page')) {
$ui->suppress[] = 'initialpageselect';
}
- if ($pop3) {
+ if ($session->get('imp', 'protocol') == 'pop') {
$ui->suppress[] = 'initialpageselect';
$ui->suppress[] = 'rename_sentmail_monthly';
$ui->suppress[] = 'delete_sentmail_monthly';
if ($prefs->isLocked('nav_audio')) {
$ui->suppress[] = 'soundselect';
}
- if ($pop3) {
+ if ($session->get('imp', 'protocol') == 'pop') {
$ui->suppress[] = 'nav_poll_all';
}
break;
case 'pgp':
- if ($prefs->getValue('use_pgp')) {
- Horde::addScriptFile('imp.js', 'imp');
- } else {
+ if (!$prefs->getValue('use_pgp')) {
$ui->suppress[] = 'use_pgp_text';
$ui->suppress[] = 'pgp_attach_pubkey';
$ui->suppress[] = 'pgp_scan_body';
}
break;
- case 'searches':
- Horde::addScriptFile('searchesprefs.js', 'imp');
- break;
-
case 'server':
- $code = array();
-
if ($prefs->isLocked('drafts_folder')) {
$ui->suppress[] = 'draftsselect';
- } else {
- $code['drafts'] = _("Enter the name for your new drafts folder.");
}
-
if ($prefs->isLocked('spam_folder')) {
$ui->suppress[] = 'spamselect';
- } else {
- $code['spam'] = _("Enter the name for your new spam folder.");
}
- if (!$prefs->isLocked('trash_folder')) {
- $code['trash'] = _("Enter the name for your new trash folder.");
- } else {
+ if ($prefs->isLocked('trash_folder')) {
$ui->suppress[] = 'trashselect';
}
-
- if (!empty($code)) {
- Horde::addScriptFile('folderprefs.js', 'imp');
- Horde::addInlineJsVars(array(
- 'ImpFolderPrefs.folders' => $code
- ));
- }
break;
case 'smime':
- $use_smime = false;
- if ($prefs->getValue('use_smime')) {
- try {
- $GLOBALS['injector']->getInstance('IMP_Crypt_Smime')->checkForOpenSSL();
- $use_smime = true;
- } catch (Horde_Exception $e) {}
- }
-
- if ($use_smime) {
- Horde::addScriptFile('imp.js', 'imp');
- } else {
+ if (!$prefs->getValue('use_smime')) {
$ui->suppress[] = 'use_smime_text';
$ui->suppress[] = 'smime_verify';
$ui->suppress[] = 'smimepublickey';
case 'stationery':
if ($prefs->isLocked('stationery')) {
$ui->suppress[] = 'stationerymanagement';
- } else {
- $ui->nobuttons = true;
}
break;
$mock_part = new Horde_Mime_Part();
$mock_part->setType('text/html');
- $v = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_MimeViewer')->create($mock_part);
+ $v = $injector->getInstance('IMP_Injector_Factory_MimeViewer')->create($mock_part);
if (!$v->canRender('inline')) {
$ui->suppress[] = 'alternative_display';
}
-
- /* Sort encodings. */
- if (!$prefs->isLocked('default_msg_charset')) {
- asort($registry->nlsconfig['encodings']);
- }
break;
}
-
- /* Hide appropriate prefGroups. */
- if ($pop3) {
- $ui->suppressGroups[] = 'flags';
- $ui->suppressGroups[] = 'searches';
- $ui->suppressGroups[] = 'server';
- }
-
- try {
- $GLOBALS['injector']->getInstance('IMP_Imap_Acl');
- } catch (IMP_Exception $e) {
- $ui->suppressGroups[] = 'acl';
- }
-
- if (empty($conf['user']['allow_accounts'])) {
- $ui->suppressGroups[] = 'accounts';
- }
-
- $contacts_app = $registry->hasInterface('contacts');
- if (!$contacts_app || !$registry->hasPermission($contacts_app)) {
- $ui->suppressGroups[] = 'addressbooks';
- }
-
- if (!isset($GLOBALS['conf']['gnupg']['path'])) {
- $ui->suppressGroups[] = 'pgp';
- }
-
- if (!Horde_Util::extensionExists('openssl') ||
- !isset($conf['openssl']['path'])) {
- $ui->suppressGroups[] = 'smime';
- }
-
- if (empty($conf['user']['allow_folders'])) {
- $ui->suppressGroups[] = 'searches';
- }
-
- // TODO: For now, disable this group since accounts code has not
- // yet been fully written.
- $ui->suppressGroups[] = 'accounts';
}
/**
}
break;
- case 'delmove':
- if ($prefs->isDirty('use_trash')) {
- $ui->suppress = array_diff($ui->suppress, array('trashselect', 'empty_trash_menu'));
- }
- break;
-
case 'dimp':
if ($prefs->isDirty('dynamic_view')) {
$session->set(
}
/**
- * Populate dynamically-generated preference values.
+ * Code to run on init when viewing prefs for this application.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
*/
- public function prefsEnum($ui)
+ public function prefsInit($ui)
{
global $conf, $prefs, $registry;
switch ($ui->group) {
+ case 'addressbooks':
+ if (!$prefs->isLocked('sourceselect')) {
+ Horde_Core_Prefs_Ui_Widgets::addressbooksInit();
+ }
+ break;
+
case 'freebusy':
if (!$prefs->isLocked('fb_cals')) {
$fb_list = array();
}
break;
- case 'share':
- if (!$prefs->isLocked('default_share')) {
- $all_shares = Kronolith::listInternalCalendars();
- $sharelist = array();
-
- foreach ($all_shares as $id => $share) {
- if (!empty($conf['share']['hidden']) &&
- ($share->get('owner') != $GLOBALS['registry']->getAuth()) &&
- !in_array($share->getName(), $GLOBALS['display_calendars'])) {
- continue;
- }
- $sharelist[$id] = $share;
- }
-
- $vals = array();
- foreach ($sharelist as $id => $share) {
- $vals[htmlspecialchars($id)] = htmlspecialchars($share->get('name'));
- }
- $ui->override['default_share'] = $vals;
+ case 'notification':
+ if (!empty($conf['alarms']['driver']) &&
+ !$prefs->isLocked('event_alarms') &&
+ !$prefs->isLocked('event_alarms_select')) {
+ Horde_Core_Prefs_Ui_Widgets::alarminit();
}
break;
+ }
- case 'view':
- if (!$prefs->isLocked('day_hour_start') ||
- !$prefs->isLocked('day_hour_end')) {
- $out = array();
- $tf = $GLOBALS['prefs']->getValue('twentyFour') ? 'G:i' : 'g:ia';
- for ($i = 0; $i <= 48; ++$i) {
- $out[$i] = date($tf, mktime(0, $i * 30, 0));
- }
- $ui->override['day_hour_end'] = $out;
- $ui->override['day_hour_start'] = $out;
- }
- break;
+ /* Suppress prefGroups display. */
+ if (!$registry->hasMethod('contacts/sources')) {
+ $ui->suppressGroups[] = 'addressbooks';
+ }
+
+ if ($prefs->isLocked('default_alarm')) {
+ $ui->suppressGroups[] = 'event_options';
}
}
/**
- * Code to run on init when viewing prefs for this application.
+ * Determine active prefs when displaying a group.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
*/
- public function prefsInit($ui)
+ public function prefsGroup($ui)
{
- global $conf, $prefs, $registry;
+ global $conf, $prefs;
switch ($ui->group) {
- case 'addressbooks':
- if (!$prefs->isLocked('sourceselect')) {
- Horde_Core_Prefs_Ui_Widgets::addressbooksInit();
- }
- break;
-
case 'notification':
if (empty($conf['alarms']['driver']) ||
$prefs->isLocked('event_alarms') ||
$prefs->isLocked('event_alarms_select')) {
- $ui->suppress[]= 'event_alarms';
- } else {
- Horde_Core_Prefs_Ui_Widgets::alarminit();
+ $ui->suppress[] = 'event_alarms';
}
break;
}
-
- /* Suppress prefGroups display. */
- if (!$registry->hasMethod('contacts/sources')) {
- $ui->suppressGroups[] = 'addressbooks';
- }
-
- if ($prefs->isLocked('default_alarm')) {
- $ui->suppressGroups[] = 'event_options';
- }
}
- /**
+ /**
* Generate code used to display a special preference.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
}
/**
- * Populate dynamically-generated preference values.
+ * Run once on init when viewing prefs for an application.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
*/
- public function prefsEnum($ui)
+ public function prefsInit($ui)
{
switch ($ui->group) {
case 'share':
}
/**
- * Populate dynamically-generated preference values.
+ * Code to run on init when viewing prefs for this application.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
*/
- public function prefsEnum($ui)
+ public function prefsInit($ui)
{
- global $prefs, $registry;
+ global $conf, $prefs, $registry;
switch ($ui->group) {
case 'share':
foreach ($all_tasklists as $id => $tasklist) {
if (!empty($conf['share']['hidden']) &&
- ($tasklist->get('owner') != $GLOBALS['registry']->getAuth()) &&
+ ($tasklist->get('owner') != $registry->getAuth()) &&
!in_array($tasklist->getName(), $GLOBALS['display_tasklists'])) {
continue;
}
break;
}
- $show_external = array();
if ($registry->hasMethod('getListTypes', 'whups')) {
- $show_external['whups'] = $registry->get('name', 'whups');
- }
- if (count($show_external)) {
- $ui->override['show_external'] = $show_external;
- } else {
- $ui->suppress[] = 'show_external';
- $ui->suppressGroups[] = 'external';
+ $ui->override['show_external'] = array(
+ 'whups' => $registry->get('name', 'whups')
+ );
}
}
/**
- * Code to run on init when viewing prefs for this application.
+ * Determine active prefs when displaying a group.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
*/
- public function prefsInit($ui)
+ public function prefsGroup($ui)
{
- global $conf, $prefs;
+ global $conf, $prefs, $registry;
switch ($ui->group) {
case 'notification':
}
break;
}
+
+ if (!$registry->hasMethod('getListTypes', 'whups')) {
+ $ui->suppress[] = 'show_external';
+ }
}
/**
}
/**
- * Populate dynamically-generated preference values.
+ * Code to run on init when viewing prefs for this application.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
*/
- public function prefsEnum($ui)
+ public function prefsInit($ui)
{
global $prefs;
}
}
$ui->override['sync_books'] = $out;
- break;
- }
- }
-
- /**
- * Code to run on init when viewing prefs for this application.
- *
- * @param Horde_Core_Prefs_Ui $ui The UI object.
- */
- public function prefsInit($ui)
- {
- global $prefs;
- switch ($ui->group) {
- case 'addressbooks':
Horde_Core_Prefs_Ui_Widgets::sourceInit();
break;