[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/services/ -> maintenance.php (source)

   1  <?php
   2  /**
   3   * $Horde: horde/services/maintenance.php,v 1.31.2.3 2006/01/01 21:29:10 jan Exp $
   4   *
   5   * Copyright 2001-2006 Michael Slusarz <slusarz@bigworm.colorado.edu>
   6   * Copyright 2001-2006 Charles J. Hagenbuch <chuck@horde.org>
   7   * Copyright 2001-2006 Jon Parise <jon@horde.org>
   8   *
   9   * See the enclosed file COPYING for license information (LGPL).  If you
  10   * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
  11   */
  12  
  13  @define('HORDE_BASE', dirname(__FILE__) . '/..');
  14  require_once  HORDE_BASE . '/lib/base.php';
  15  require_once 'Horde/Maintenance.php';
  16  require_once 'Horde/Template.php';
  17  
  18  /* Make sure there is a user logged in. */
  19  if (!Auth::getAuth()) {
  20      Horde::authenticationFailureRedirect();
  21  }
  22  
  23  /* If no 'module' parameter passed in, die with an error. */
  24  if (!($module = basename(Util::getFormData('module')))) {
  25      Horde::fatal(PEAR::raiseError(_("Do not directly access maintenance.php")), __FILE__, __LINE__);
  26  }
  27  $app_name = $registry->get('name', $module);
  28  
  29  /* Load the module specific maintenance class now. */
  30  if (!($maint = &Maintenance::factory($module))) {
  31      Horde::fatal(PEAR::raiseError(_("The Maintenance:: class did not load successfully")), __FILE__, __LINE__);
  32  }
  33  
  34  /* Create the Horde_Template item. */
  35  $template = &new Horde_Template();
  36  $template->set('javascript', $browser->hasFeature('javascript'), true);
  37  
  38  /* Have the maintenance module do all necessary processing. */
  39  list($action, $tasklist) = $maint->runMaintenancePage();
  40  
  41  switch ($action) {
  42  case MAINTENANCE_OUTPUT_CONFIRM:
  43      /* Confirmation-style output. */
  44      $template->set('confirm', true, true);
  45      $template->set('agree', false, true);
  46      $template->set('notice', false, true);
  47  
  48      $notification->push(sprintf(_("%s is ready to perform the maintenance operations checked below. Check the box for any operation(s) you want to perform at this time."), $app_name), 'horde.message');
  49      $template->set('header', sprintf(_("%s Maintenance Operations - Confirmation"), $app_name));
  50      break;
  51  
  52  case MAINTENANCE_OUTPUT_AGREE:
  53      /* Agreement-style output. */
  54      $template->set('confirm', false, true);
  55      $template->set('agree', true, true);
  56      $template->set('notice', false, true);
  57  
  58      $notification->push(_("Please read the following text. You MUST agree with the terms to use the system."), 'horde.message');
  59      $template->set('header', sprintf(_("%s Terms of Agreement"), $app_name));
  60      break;
  61  
  62  case MAINTENANCE_OUTPUT_NOTICE:
  63      /* Notice-style output. */
  64      $template->set('confirm', false, true);
  65      $template->set('agree', false, true);
  66      $template->set('notice', true, true);
  67  
  68      $template->set('header', sprintf(_("%s - Notice"), $app_name));
  69      break;
  70  }
  71  
  72  /* Make variable array needed for templates. */
  73  $tasks = array();
  74  foreach ($tasklist as $pref) {
  75      list($descrip, $checked) = $maint->infoMaintenance($pref);
  76      $tasks[] = array('pref' => $pref, 'descrip' => $descrip, 'checked' => $checked ? ' checked="checked"' : '');
  77  }
  78  
  79  $template->setOption('gettext', true);
  80  $template->set('tasks', $tasks);
  81  $template->set('maint_url', $maint->getMaintenanceFormURL());
  82  $template->set('maint_postdata', $maint->getPostData());
  83  $template->set('notify', Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
  84  
  85  require  HORDE_TEMPLATES . '/common-header.inc';
  86  echo $template->fetch(HORDE_TEMPLATES . '/maintenance/maintenance.html');
  87  require  HORDE_TEMPLATES . '/common-footer.inc';


Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7