From: Michael M Slusarz Date: Fri, 12 Jun 2009 16:45:30 +0000 (-0600) Subject: Honor subscribe preference in DIMP X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=8c8f69702611fa15379e0d3a25e53a6871471e72;p=horde.git Honor subscribe preference in DIMP --- diff --git a/imp/ajax.php b/imp/ajax.php index 033a244fb..a68eb620f 100644 --- a/imp/ajax.php +++ b/imp/ajax.php @@ -314,10 +314,12 @@ case 'Poll': break; case 'Subscribe': - $imp_folder = IMP_Folder::singleton(); - $result = Horde_Util::getPost('sub') - ? $imp_folder->subscribe(array($mbox)) - : $imp_folder->unsubscribe(array($mbox)); + if ($prefs->getValue('subscribe')) { + $imp_folder = IMP_Folder::singleton(); + $result = Horde_Util::getPost('sub') + ? $imp_folder->subscribe(array($mbox)) + : $imp_folder->unsubscribe(array($mbox)); + } break; case 'ViewPort': diff --git a/imp/js/src/DimpBase.js b/imp/js/src/DimpBase.js index f7d3882a9..8608e7578 100644 --- a/imp/js/src/DimpBase.js +++ b/imp/js/src/DimpBase.js @@ -761,11 +761,15 @@ var DimpBase = { if (baseelt.readAttribute('mbox') == 'INBOX') { elts.invoke('hide'); - $('ctx_folder_sub', 'ctx_folder_unsub').invoke('hide'); + if ($('ctx_folder_sub')) { + $('ctx_folder_sub', 'ctx_folder_unsub').invoke('hide'); + } } else { - tmp = baseelt.hasClassName('unsubFolder'); - [ $('ctx_folder_sub') ].invoke(tmp ? 'show' : 'hide'); - [ $('ctx_folder_unsub') ].invoke(tmp ? 'hide' : 'show'); + if ($('ctx_folder_sub')) { + tmp = baseelt.hasClassName('unsubFolder'); + [ $('ctx_folder_sub') ].invoke(tmp ? 'show' : 'hide'); + [ $('ctx_folder_unsub') ].invoke(tmp ? 'hide' : 'show'); + } if (DIMP.conf.fixed_folders && DIMP.conf.fixed_folders.indexOf(baseelt.readAttribute('mbox')) != -1) { diff --git a/imp/templates/index/index-dimp.inc b/imp/templates/index/index-dimp.inc index a379754b0..a50a7ec85 100644 --- a/imp/templates/index/index-dimp.inc +++ b/imp/templates/index/index-dimp.inc @@ -4,6 +4,7 @@ $hordeimg = $registry->getImageDir('horde'); $usetrash = $prefs->getValue('use_trash'); $show_text = in_array($prefs->getValue('menu_view'), array('both', 'text')); +$use_sub = $prefs->getValue('subscribe'); $loading_text = _("Loading..."); $has_blacklist = $registry->hasMethod('mail/blacklistFrom'); @@ -337,8 +338,10 @@ function _simpleButton($id, $text, $image, $imagedir = null) + +