[ Index ]
 

Code source de Horde 3.1.3

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

title

Body

[fermer]

/services/help/ -> index.php (source)

   1  <?php
   2  /**
   3   * $Horde: horde/services/help/index.php,v 2.80.10.9 2006/07/06 22:28:02 chuck Exp $
   4   *
   5   * Copyright 1999-2006 Jon Parise <jon@horde.org>
   6   *
   7   * See the enclosed file COPYING for license information (LGPL). If you
   8   * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
   9   */
  10  
  11  @define('HORDE_BASE', dirname(__FILE__) . '/../..');
  12  @define('AUTH_HANDLER', true);
  13  
  14  require_once  HORDE_BASE . '/lib/base.php';
  15  require_once 'Horde/Help.php';
  16  
  17  $title = _("Help");
  18  $show = String::lower(Util::getFormData('show', 'index'));
  19  $module = String::lower(preg_replace('/\W/', '', Util::getFormData('module', 'horde')));
  20  $topic = Util::getFormData('topic');
  21  
  22  if ($module == 'admin') {
  23      $fileroot = $registry->get('fileroot');
  24      $help_file = $fileroot . "/admin/locale/$language/help.xml";
  25      $help_file_fallback = $fileroot . '/admin/locale/en_US/help.xml';
  26  } else {
  27      $fileroot = $registry->get('fileroot', $module);
  28      $help_file = $fileroot . "/locale/$language/help.xml";
  29      $help_file_fallback = $fileroot . '/locale/en_US/help.xml';
  30  }
  31  
  32  if ($show == 'index') {
  33      $base_url = $registry->get('webroot', 'horde') . '/services/help/';
  34      $main_url = Horde::url($base_url);
  35      $main_url = Util::addParameter($main_url, array('show' => 'entry',
  36                                                      'module' => $module,
  37                                                      'topic' => $topic));
  38      $menu_url = Horde::url($base_url);
  39      $menu_url = Util::addParameter($menu_url, array('module' => $module,
  40                                                      'show' => 'menu'));
  41      require  HORDE_TEMPLATES . '/help/index.inc';
  42      exit;
  43  }
  44  
  45  $bodyClass = 'help';
  46  require  HORDE_TEMPLATES . '/common-header.inc';
  47  if ($show == 'menu') {
  48      /* Set up urls. */
  49      $url = Horde::url($registry->get('webroot', 'horde') . '/services/help/');
  50      $url = Util::addParameter($url, 'module', $module);
  51      $topics_link = Util::addParameter($url, 'show', 'topics');
  52      $topics_link = Horde::link($topics_link, null, 'header', 'help_main') . _("List Help Topics") . '</a>';
  53      $about_link = Util::addParameter($url, 'show', 'about');
  54      $about_link = Horde::link($about_link, null, 'header', 'help_main') . _("About...") . '</a>';
  55      require  HORDE_TEMPLATES . '/help/menu.inc';
  56  } elseif ($show == 'about') {
  57      require $fileroot . '/lib/version.php';
  58      $mod_version_constant = String::upper($module) . '_VERSION';
  59      if (!defined($mod_version_constant)) {
  60          exit;
  61      }
  62      $version = String::ucfirst($module) . ' ' . constant($mod_version_constant);
  63      $credits = Util::bufferOutput('include', $fileroot . '/docs/CREDITS');
  64      $credits = String::convertCharset($credits, 'iso-8859-1', NLS::getCharset());
  65      require  HORDE_TEMPLATES . '/help/about.inc';
  66  } else {
  67      $help = &new Help(HELP_SOURCE_FILE, array($help_file, $help_file_fallback));
  68      if (($show == 'entry') && !empty($topic)) {
  69          $help->lookup($topic);
  70          $help->display();
  71      } else {
  72          $topics = $help->topics();
  73          foreach ($topics as $id => $title) {
  74              $link = Horde::url($registry->get('webroot', 'horde') . '/services/help/');
  75              $link = Util::addParameter($link, array('show' => 'entry', 'module' => $module, 'topic' => $id));
  76              echo Horde::link($link);
  77              echo $title . "</a><br />\n";
  78          }
  79      }
  80      $help->cleanup();
  81  }
  82  
  83  require  HORDE_TEMPLATES . '/common-footer.inc';


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