Dotclear

source: admin/help.php @ 1839:34c515cef663

Revision 1839:34c515cef663, 2.2 KB checked in by Anne Kozlika <kozlika@…>, 12 years ago (diff)

Ajustements charte
Mise en place des onglets (merci Lipki) sur l'aide générale
Ajout d'une chaîne manquante de tard.

Line 
1<?php
2# -- BEGIN LICENSE BLOCK ---------------------------------------
3#
4# This file is part of Dotclear 2.
5#
6# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
7# Licensed under the GPL version 2.0 license.
8# See LICENSE file or
9# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10#
11# -- END LICENSE BLOCK -----------------------------------------
12
13require dirname(__FILE__).'/../inc/admin/prepend.php';
14
15dcPage::check('usage');
16
17function helpPage()
18{
19     $ret = array('content' => '', 'title' => '');
20
21     $args = func_get_args();
22     if (empty($args)) {
23          return $ret;
24     };
25     
26     global $__resources;
27     if (empty($__resources['help'])) {
28          return $ret;
29     }
30     
31     $content = '';
32     $title = '';
33     foreach ($args as $v)
34     {
35          if (is_object($v) && isset($v->content)) {
36               $content .= $v->content;
37               continue;
38          }
39         
40          if (!isset($__resources['help'][$v])) {
41               continue;
42          }
43          $f = $__resources['help'][$v];
44          if (!file_exists($f) || !is_readable($f)) {
45               continue;
46          }
47         
48          $fc = file_get_contents($f);
49          if (preg_match('|<body[^>]*?>(.*?)</body>|ms',$fc,$matches)) {
50               $content .= $matches[1];
51               if (preg_match('|<title[^>]*?>(.*?)</title>|ms',$fc,$matches)) {
52                    $title = $matches[1];
53               }
54          } else {
55               $content .= $fc;
56          }
57     }
58     
59     if (trim($content) == '') {
60          return $ret;
61     }
62     
63     $ret['content'] = $content;
64     if ($title != '') {
65          $ret['title'] = $title;
66     }
67     return $ret;
68}
69
70$help_page = !empty($_GET['page']) ? html::escapeHTML($_GET['page']) : 'index';
71$content_array = helpPage($help_page);
72if (($content_array['content'] == '') || ($help_page == 'index')) {
73     $content_array = helpPage('index');
74}
75if ($content_array['title'] != '') {
76     $breadcrumb = dcPage::breadcrumb(
77          array(
78               __('Global help') => 'help.php',
79               '<span class="page-title">'.$content_array['title'].'</span>' => ''
80          ));
81} else {
82     $breadcrumb = dcPage::breadcrumb(
83          array(
84               '<span class="page-title">'.__('Global help').'</span>' => ''
85          ));
86}
87
88/* DISPLAY
89-------------------------------------------------------- */
90dcPage::open(__('Global help'),
91     # --BEHAVIOR-- adminPostHeaders
92     $core->callBehavior('adminPostHeaders').
93     dcPage::jsPageTabs('first-step'),
94     $breadcrumb
95);
96
97echo $content_array['content'];
98
99dcPage::close();
100?>
Note: See TracBrowser for help on using the repository browser.

Sites map