From 640ee23fb7398fe60a23982a381ba48ab475c747 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 9 Dec 2009 14:43:03 -0700 Subject: [PATCH] group name is now passed to prefsCallback() --- imp/lib/Application.php | 59 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 19 deletions(-) diff --git a/imp/lib/Application.php b/imp/lib/Application.php index ee602d4a6..05a5005df 100644 --- a/imp/lib/Application.php +++ b/imp/lib/Application.php @@ -662,8 +662,10 @@ class IMP_Application extends Horde_Registry_Application /** * Do anything that we need to do as a result of certain preferences * changing. + * + * @param string $group The prefGroup name. */ - public function prefsCallback() + public function prefsCallback($group) { global $prefs; @@ -673,30 +675,49 @@ class IMP_Application extends Horde_Registry_Application $prefs->getValue('use_trash') && !$prefs->getValue('trash_folder') && !$prefs->getValue('use_vtrash')) { - $GLOBALS['notification']->push(_("You have activated move to Trash but no Trash folder is defined. You will be unable to delete messages until you set a Trash folder in the preferences."), 'horde.warning'); + $GLOBALS['notification']->push(_("You have activated move to Trash but no Trash folder is defined. You will be unable to delete messages until you set a Trash folder in the preferences."), 'horde.warning'); + } + + switch ($group) { + case 'compose': + if ($prefs->isDirty('mail_domain')) { + $maildomain = preg_replace('/[^-\.a-z0-9]/i', '', $prefs->getValue('mail_domain')); + $prefs->setValue('maildomain', $maildomain); + if (!empty($maildomain)) { + $_SESSION['imp']['maildomain'] = $maildomain; + } } - if ($prefs->isDirty('use_vtrash') || $prefs->isDirty('use_vinbox')) { - $imp_search = new IMP_Search(); - $imp_search->initialize(true); - } + if ($prefs->isDirty('compose_popup')) { + Horde::addInlineScript(array( + 'if (window.parent.frames.horde_menu) window.parent.frames.horde_menu.location.reload();' + )); + } + break; - if ($prefs->isDirty('subscribe') || $prefs->isDirty('tree_view')) { - $this->_mailboxesChanged(); - } + case 'delmove': + if ($prefs->isDirty('use_vtrash')) { + $imp_search = new IMP_Search(); + $imp_search->initialize(true); + } + break; - if ($prefs->isDirty('mail_domain')) { - $maildomain = preg_replace('/[^-\.a-z0-9]/i', '', $prefs->getValue('mail_domain')); - $prefs->setValue('maildomain', $maildomain); - if (!empty($maildomain)) { - $_SESSION['imp']['maildomain'] = $maildomain; + case 'display': + if ($prefs->isDirty('tree_view')) { + $this->_mailboxesChanged(); } - } + break; - if ($prefs->isDirty('compose_popup')) { - Horde::addInlineScript(array( - 'if (window.parent.frames.horde_menu) window.parent.frames.horde_menu.location.reload();' - )); + case 'server': + if ($prefs->isDirty('use_vinbox')) { + $imp_search = new IMP_Search(); + $imp_search->initialize(true); + } + + if ($prefs->isDirty('subscribe')) { + $this->_mailboxesChanged(); + } + break; } } -- 2.11.0