/[drupal]/contributions/modules/help_soc/help/help.admin.inc
ViewVC logotype

Diff of /contributions/modules/help_soc/help/help.admin.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.13, Tue Aug 12 18:16:39 2008 UTC revision 1.14, Sun Aug 17 20:56:18 2008 UTC
# Line 10  Line 10 
10   * Menu callback; prints a page displaying available help topics for modules.   * Menu callback; prints a page displaying available help topics for modules.
11   */   */
12  function help_index_page() {  function help_index_page() {
13      if (!empty($_GET['popup'])) {
14        print help_by_module();
15        return;
16      }
17      else {
18        return help_topic_page('help', 'welcome-page', FALSE);
19      }
20    }
21    
22    /**
23     * Menu callback; prints a page displaying available help topics for modules.
24     */
25    function help_by_module() {
26    $output = '';    $output = '';
27    $breadcrumb = array();    $breadcrumb = array();
28    $menu_items = array();    $menu_items = array();
# Line 21  function help_index_page() { Line 34  function help_index_page() {
34    $modules = module_rebuild_cache();    $modules = module_rebuild_cache();
35    foreach ($modules as $file) {    foreach ($modules as $file) {
36      $module = $file->name;      $module = $file->name;
37      if (empty($topics[$module])) {      if (empty($topics[$module]) || $module == 'help') {
38        continue;        continue;
39      }      }
40    
# Line 55  function help_index_page() { Line 68  function help_index_page() {
68  /**  /**
69   * Menu callback; prints a page with help topic for a module.   * Menu callback; prints a page with help topic for a module.
70   */   */
71  function help_topic_page($module, $topic = NULL) {  function help_topic_page($module, $topic = NULL, $bells_and_whistles = TRUE) {
72    $info = help_get_topic($module, $topic);    $info = help_get_topic($module, $topic);
73    if (isset($topic) && !$info) {    if (isset($topic) && !$info) {
74      return drupal_not_found();      return drupal_not_found();
# Line 97  function help_topic_page($module, $topic Line 110  function help_topic_page($module, $topic
110    $breadcrumb[] = help_l(help_get_module_name($pmodule), "admin/help/$pmodule");    $breadcrumb[] = help_l(help_get_module_name($pmodule), "admin/help/$pmodule");
111    $breadcrumb[] = help_l(t('Help'), "admin/help");    $breadcrumb[] = help_l(t('Help'), "admin/help");
112    
113    if (isset($topic)) {    if (!isset($topic)) {
114      $output = help_view_topic($module, $topic, $popup);      $topic = 'about';
   }  
   else {  
     $output = help_view_topic($module, 'about', $popup);  
115      drupal_set_title(t('About @module', array('@module' => help_get_module_name($module))));      drupal_set_title(t('About @module', array('@module' => help_get_module_name($module))));
116    }    }
117      $output = help_view_topic($module, $topic, $popup, $bells_and_whistles);
118    if (empty($output)) {    if (empty($output)) {
119      $output = t('Missing help topic.');      if ($topic == 'about') {
120          $output = help_view_module($module, $popup);
121        }
122        else {
123          $output = t('Missing help topic.');
124          }
125    }    }
126    
127    if ($popup) {    if ($popup) {
# Line 114  function help_topic_page($module, $topic Line 130  function help_topic_page($module, $topic
130      print theme('help_popup', $output);      print theme('help_popup', $output);
131      return;      return;
132    }    }
133    
134    $breadcrumb[] = help_l('Administer', 'admin');    if ($bells_and_whistles) {
135    $breadcrumb[] = l('Home', '');      $breadcrumb[] = help_l('Administer', 'admin');
136    drupal_set_breadcrumb(array_reverse($breadcrumb));      $breadcrumb[] = l('Home', '');
137        drupal_set_breadcrumb(array_reverse($breadcrumb));
138      }
139    drupal_add_css(drupal_get_path('module', 'help') . '/help.css');    drupal_add_css(drupal_get_path('module', 'help') . '/help.css');
140    return $output;    return $output;
141  }  }
# Line 140  function help_view_module($module, $popu Line 158  function help_view_module($module, $popu
158  /**  /**
159   * Load and render a help topic.   * Load and render a help topic.
160   */   */
161  function help_view_topic($module, $topic, $popup = FALSE) {  function help_view_topic($module, $topic, $popup = FALSE, $bells_and_whistles = TRUE) {
162    $file = help_get_topic_filename($module, $topic);    $file = help_get_topic_filename($module, $topic);
163    $info = help_get_topic($module, $topic);    $info = help_get_topic($module, $topic);
164    if ($file) {    if ($file) {
# Line 177  function help_view_topic($module, $topic Line 195  function help_view_topic($module, $topic
195      $output = preg_replace('/href="base_url:([^"]+)"/', 'href="' . strtr(url('$1'), array('%24' => '$')) . '"', $output);      $output = preg_replace('/href="base_url:([^"]+)"/', 'href="' . strtr(url('$1'), array('%24' => '$')) . '"', $output);
196      $output = preg_replace('/src="base_url:([^"]+)"/', 'src="' . strtr(url('$1'), array('%24' => '$')) . '"', $output);      $output = preg_replace('/src="base_url:([^"]+)"/', 'src="' . strtr(url('$1'), array('%24' => '$')) . '"', $output);
197    
198      if (!empty($info['navigation'])) {      if (!empty($info['navigation']) && !empty($bells_and_whistles)) {
199        $topics = help_get_topics();        $topics = help_get_topics();
200        help_get_topic_hierarchy($topics);        help_get_topic_hierarchy($topics);
201    

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.2