[ Index ]
 

Code source de IMP H3 (4.1.5)

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/ -> filterprefs.php (source)

   1  <?php
   2  /**
   3   * $Horde: imp/filterprefs.php,v 2.16.10.6 2007/01/02 13:54:54 jan Exp $
   4   *
   5   * Copyright 2003-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
   6   *
   7   * See the enclosed file COPYING for license information (GPL).  If you
   8   * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
   9   */
  10  
  11  @define('IMP_BASE', dirname(__FILE__));
  12  $authentication = OP_HALFOPEN;
  13  require_once  IMP_BASE . '/lib/base.php';
  14  require_once 'Horde/Prefs/UI.php';
  15  require IMP_BASE . '/config/prefs.php';
  16  
  17  /* Are preferences locked? */
  18  $login_locked = $prefs->isLocked('filter_on_login') || empty($_SESSION['imp']['filteravail']);
  19  $display_locked = $prefs->isLocked('filter_on_display') || empty($_SESSION['imp']['filteravail']);
  20  $anymailbox_locked = $prefs->isLocked('filter_any_mailbox') || empty($_SESSION['imp']['filteravail']);
  21  $menuitem_locked = $prefs->isLocked('filter_menuitem');
  22  
  23  /* Run through the action handlers. */
  24  $actionID = Util::getFormData('actionID');
  25  switch ($actionID) {
  26  case 'update_prefs':
  27      if (!$login_locked) {
  28          $prefs->setValue('filter_on_login', Util::getFormData('filter_login'));
  29      }
  30      if (!$display_locked) {
  31          $prefs->setValue('filter_on_display', Util::getFormData('filter_display'));
  32      }
  33      if (!$anymailbox_locked) {
  34          $prefs->setValue('filter_any_mailbox', Util::getFormData('filter_any_mailbox'));
  35      }
  36      if (!$menuitem_locked) {
  37          $prefs->setValue('filter_menuitem', Util::getFormData('filter_menuitem'));
  38      }
  39      $notification->push(_("Preferences successfully updated."), 'horde.success');
  40      break;
  41  }
  42  
  43  /* Get filter links. */
  44  if ($registry->hasMethod('mail/showBlacklist')) {
  45      $blacklist_link = $registry->link('mail/showBlacklist');
  46  }
  47  if ($registry->hasMethod('mail/showWhitelist')) {
  48      $whitelist_link = $registry->link('mail/showWhitelist');
  49  }
  50  if ($registry->hasMethod('mail/showFilters')) {
  51      $filters_link = $registry->link('mail/showFilters');
  52  }
  53  
  54  /* Show the header. */
  55  require_once 'Horde/Prefs/UI.php';
  56  require IMP_BASE . '/config/prefs.php';
  57  $app = 'imp';
  58  $group = 'filters';
  59  
  60  Prefs_UI::generateHeader();
  61  
  62  /* If filters are disabled. */
  63  if (empty($blacklist_link) && empty($whitelist_link) && empty($filters_link)) {
  64      require IMP_TEMPLATES . '/filters/notactive.inc';
  65  } else {
  66      $selfURL = Horde::applicationUrl('filterprefs.php');
  67      require IMP_TEMPLATES . '/filters/prefs.inc';
  68  }
  69  
  70  require $registry->get('templates', 'horde') . '/common-footer.inc';


Généré le : Thu Nov 29 12:30:07 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics