4 * gallery.module : gallery_help.inc
5 * Help and documentation
9 * Implementation of hook_help().
11 function _gallery_help($section) {
13 case
'filter#short-tip' :
14 return gallery_help_filter_short_tip();
15 case
'filter#long-tip' :
16 return gallery_help_filter_long_tip();
23 * Function gallery_help_filter_short_tip().
25 function gallery_help_filter_short_tip() {
26 return t('You may link to Gallery2 items on this site <a href="@url">using a special syntax</a>.',
27 array('@url' => url('filter/tips', array('fragment' => 'filter-gallery-0'))));
31 * Function gallery_help_filter_long_tip().
33 function gallery_help_filter_long_tip() {
34 $prefix = trim(variable_get('gallery_filter_prefix', 'G2')) .
':';
35 $path = drupal_get_path('module', 'gallery') .
'/help/filter-gallery.html';
37 $output = '<p><strong>Gallery2 Filter:</strong> </p>';
38 $output .
= str_replace('PREFIX:', $prefix, file_get_contents($path));
44 * Function _gallery_report_help().
46 function _gallery_report_help() {
47 return t('<p><strong>A serious error has occured. This can happen due to an incorrect configuration or a bug in the
48 gallery module. If you plan to submit a bug report to the issue queue at <a href="@gallery-issues">drupal.org</a>
49 consider to include the <a href="@report">pre-generated report file</a>.</strong></p>',
51 '@gallery-issues' => 'http://drupal.org/project/issues/gallery',
52 '@report' => url('admin/settings/gallery/report/download'))
57 * Function _gallery_advanced_help_get_form_help().
59 function _gallery_advanced_help_get_form_help($form_id, $module = 'gallery') {
60 static
$form_help = NULL
;
62 if (!isset($form_help)) {
63 $module_path = drupal_get_path('module', $module);
64 if (file_exists("$module_path/help/$module.forms_help.ini")) {
65 $info = parse_ini_file("./$module_path/help/$module.forms_help.ini", TRUE
);
66 foreach ($info["$module-forms"] as
$form => $topic) {
67 $form = explode('@', $form);
68 $form_help[$form[1]][$form[0]] = $topic;
73 return isset($form_help[$form_id]) ?
$form_help[$form_id] : array();