Removing translation directories
[project/gallery.git] / gallery_help.inc
1 <?php
2
3 /**
4 * gallery.module : gallery_help.inc
5 * Help and documentation
6 */
7
8 /**
9 * Implementation of hook_help().
10 */
11 function _gallery_help($section) {
12 switch ($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();
17 default:
18 return '';
19 }
20 }
21
22 /**
23 * Function gallery_help_filter_short_tip().
24 */
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'))));
28 }
29
30 /**
31 * Function gallery_help_filter_long_tip().
32 */
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';
36
37 $output = '<p><strong>Gallery2 Filter:</strong> </p>';
38 $output .= str_replace('PREFIX:', $prefix, file_get_contents($path));
39
40 return $output;
41 }
42
43 /**
44 * Function _gallery_report_help().
45 */
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>',
50 array(
51 '@gallery-issues' => 'http://drupal.org/project/issues/gallery',
52 '@report' => url('admin/settings/gallery/report/download'))
53 );
54 }
55
56 /**
57 * Function _gallery_advanced_help_get_form_help().
58 */
59 function _gallery_advanced_help_get_form_help($form_id, $module = 'gallery') {
60 static $form_help = NULL;
61
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;
69 }
70 }
71 }
72
73 return isset($form_help[$form_id]) ? $form_help[$form_id] : array();
74 }