- bugfix: stripos() is php5-only
[project/gallery.git] / gallery_help.inc
CommitLineData
c15e9178 1<?php
2// $Id$
3
4/**
5 * gallery.module : gallery_help.inc
6 * Help info
7 */
8
9/**
10 * Implementation of hook_help
11 */
12function _gallery_help($section) {
13
6758036d 14 switch ($section) {
15 case 'filter#short-tip' :
16 return gallery_filter_short_tip_translated();
17 case 'filter#long-tip' :
18 return gallery_filter_long_tip_translated();
c15e9178 19 case 'admin/help#gallery':
20 $output = t('
04b696f5 21 <h3>Online Documentation</h3>
22 <p>Complete documentation can be found on the <a href="http://drupal.galleryembedded.com">wiki</a>.</p>
c15e9178 23 <h3>Settings</h3>
24 <h4>Directory Settings</h4>
bc815dec 25 <p>"URI of Gallery2" is the URI of the Gallery2 standalone location. Path from docroot to the directory main.php is located. Protocol / host name are both optional. Examples: /gallery2/, /sub/gallery2/, http://photos.example.com/,
c15e9178 26 www.example.com/photos/main.php</p>
bc815dec
AK
27 <p>"Location of Gallery2" is the path of your gallery2 installation, either absolute (starts with "/") or relative to your Drupal installation directory. Normally this is auto-detected, but in case this fails you can turn off auto-detection and manually enter a value.</p>
28 <p>"Embed URI" is the URI needed to access Gallery2 through Drupal. This will end in \'?q=gallery\' (non-clean URLs) or \'gallery\' (clean URLs). Normally this is auto-detected, but in case this fails you can turn off auto-detection and manually enter a value.</p>
c15e9178 29 <p>Some examples:</p>
30 <p>Example 1: If your directory structure and website structure is
31 <ul>
32 <li>Drupal dir: /var/www/web/html/</li>
33 <li>Gallery dir: /var/www/web/html/gallery2/</li>
34 <li>Website URL: http://www.example.com</li>
35 <li>Standalone Gallery2 URL: http://www.example.com/gallery2/</li>
36 <li>Then<ul>
37 <li>"URI of Gallery2" = "/gallery2/" or "http://www.example.com/gallery2/"</li>
38 <li>"Location of Gallery2" = "gallery2/" or "/var/www/web/html/gallery2/"</li>
39 <li>"Embed URI" = "?q=gallery" or "http://www.example.com/?q=gallery"</li>
40 </ul>
41 </ul>
42 </p><p>Example 2: If your directory structure and website structure is
43 <ul>
44 <li>Drupal dir: /var/www/web/html/drupal/</li>
45 <li>Gallery dir: /var/www/web/html/gallery2/</li>
46 <li>Website URL: http://www.example.com/drupal</li>
47 <li>Standalone Gallery2 URL: http://www.example.com/gallery2/</li>
48 <li>Then<ul>
49 <li>"URI of Gallery2" = "/gallery2/" or "http://www.example.com/gallery2/"</li>
50 <li>"Location of Gallery2" = "../gallery2/" or "/var/www/web/html/gallery2/"</li>
51 <li>"Embed URI" = "/drupal/?q=gallery" or "http://www.example.com/drupal/?q=gallery"</li>
52 </ul>
53 </ul>
54 </p><p>Example 3: If your directory structure and website structure is
55 <ul>
56 <li>Drupal dir: /var/www/web/html/drupal/</li>
57 <li>Gallery dir: /var/www/web/html/someotherdir/gallery2/</li>
58 <li>Website URL: http://www.example.com/</li>
59 <li>Standalone Gallery2 URL: http://www.anotherexample.com/gallery2/</li>
60 <li>Then<ul>
61 <li>"URI of Gallery2" = "http://www.anotherexample.com/gallery2/"</li>
62 <li>"Location of Gallery2" = "/var/www/web/html/someotherdir/gallery2/"</li>
63 <li>"Embed URI" = "/drupal/?q=gallery" or "http://www.example.com/drupal/?q=gallery"</li>
64 </ul>
65 </ul>
66 </p>
67 <h4>Full Name settings</h4>
bc815dec 68 <p>Drupal does not have in-built support for full names but Gallery 2 does. If you would like full names in both then you can install profile.module in Drupal and define a "full name" field. Include the name of that field here. You can enable/disable this functionality at will, but it may leave some users with different full names in their Drupal and Gallery users, so it is not recommended.</p>
c15e9178 69 <h4>Search settings</h4>
bc815dec 70 <p>You can select how many items are returned per Gallery2 module. You can also specify whether thumbnails should be returned, and if so, how they should be formatted.</p>
c15e9178 71 <h4>Error Logging settings</h4>
bc815dec 72 <p>You can choose whether errors occuring in this module are logged in the watchdog, displayed in the browser, or both.</p>
c15e9178 73 ');
74 $output .= _gallery_g2image_help();
75 return $output;
76 case 'admin/settings/gallery':
77 return t('');
03460f03 78 /* Used in the default value for the pages list in g2image settings */
c15e9178 79 case 'admin/settings/gallery_g2image#pages':
80 return "node/*\ncomment/*";
81 }
82}
83
04b696f5 84function gallery_filter_short_tip_translated() {
6758036d 85 return t('You may link to Gallery2 items on this site <a href="@explanation-url">using a special syntax</a>.', array('@explanation-url' => url('filter/tips', NULL, 'filter-gallery-0')));
04b696f5 86}
87
88function gallery_filter_long_tip_translated() {
6758036d 89 $prefix = variable_get("gallery_filter_prefix", "G2");
04b696f5 90
bc815dec 91 return t('
6758036d 92 <p><strong>Gallery2 Filter:</strong></p>
04b696f5 93
bc815dec 94 <p>You can link to items in your embedded Gallery2 using a special code. This code will be replaced by a thumbnail image that is linked to the actual item in your Gallery. </p>
04b696f5 95
6758036d 96 <p><em>Syntax:</em></p>
04b696f5 97
6758036d 98 <blockquote><code>
99 ['. $prefix .':<em>item_id</em> n=<em>number</em> type=<em>type</em> size=<em>number</em> class=<em>name</em> frame=<em>name</em> album_frame=<em>name</em> item_frame=<em>name</em>]
100 </code></blockquote>
04b696f5 101
6758036d 102 <ul><li>item_id (required): This is the item ID from Gallery2. If you look at the URL of the item, this is the last number. <em>Note that if the item_id is a single photo, n must be 1.</em></li>
04b696f5 103
6758036d 104 <li>n (suggested): This is the number of photos you want the block to show. It will override whatever is set in the defaults (initially 1). Note: this will change past instances where you did not set n -- the reason for its suggested use.</li>
04b696f5 105
6758036d 106 <li>type: The default type of gallery block. Any of the following may be used: <em>randomImage, recentImage, viewedImage, randomAlbum, recentAlbum, viewedAlbum, dailyImage, weeklyImage, monthlyImage, dailyAlbum, weeklyAlbum, monthlyAlbum, specificItem. </em> Note that for n=1, selectedItem is automatically chosen regardless of this parameter.</li>
04b696f5 107
6758036d 108 <li>class: The block that Gallery2 returns is wrapped in a DIV so additional styling can be done. The classes for this DIV are located in g2_filter.css. Included with the module are "left", "right", and "nowrap". These position the image block to the left or right or on a line all its own with the text not wrapping. You can also add your own class(es) to the CSS file and they will automatically be available.</li>
04b696f5 109
6758036d 110 <li>size: The length of the longest side for the thumbnail. The other side is determined automatically to keep the same aspect ratio. This option (for Gallery2.2 and above) will use the gallery image that is closest in size, and so may end up using a smaller image and expanding it (lower quality). If so, use "exactsize". For Gallery2.1, if you want your size to be bigger than
d4bfc44e
TW
111the thumbnail size for that image as defined in your Gallery2, you must select "Full Size" in
112the gallery settings page (but note that the full image will be returned and then resized by the
113browser, so it may take a while to download).</li>
114
6758036d 115 <li>exactsize: The length of the longest side for the thumbnail. The other side is determined automatically to keep the same aspect ratio. This option always ensures that the image is scaled
d4bfc44e 116from a larger image and so image quality is maintained. This only works for Gallery2.2 and above.</li>
bc815dec 117
6758036d 118 <li>frame/album_frame/item_frame: You can use just "frame" to assign a frame to the thumbnail regardless of whether it\'s for an album or a single item. Using aframe will only affect albums and iframe will only affect single items. Frames included with the default Gallery 2 install are: bamboo, book, brand , dots, flicking, gold, gold2, polaroid, polaroids, shadow, shells, slide, solid, notebook, wood.</li></ul>');
04b696f5 119}
c15e9178 120
121function _gallery_g2image_help() {
bc815dec
AK
122 return t('
123 <h3>Gallery Image Assist (g2image)</h3>
124 <p>Support for <a href="http://g2image.steffensenfamily.com">g2image</a> in either Standalone or TinyMCE is available to simplify adding images already in your Gallery2 albums into your Drupal nodes.</p>
125 <p>Caution: By default, Drupal uses the \'Filtered HTML\' input format for adding content to the site and the default settings cause the &lt;img&gt; tags added by g2image to be removed. Check the TinyMCE documentation for instructions on how to avoid this.</p>');
c15e9178 126}
127
647a600b
TW
128function _gallery_report_help() {
129 return t('<p><strong>A serious error has occured. This can happen due to an incorrect configuration or a bug in the gallery module. If you plan to submit a bug report to the issue queue at <a href="@gallery-issues">drupal.org</a> consider to include the <a href="@report">pre-generated report file</a>.</strong></p>',
130 array('@gallery-issues' => 'http://drupal.org/project/issues/gallery', '@report' => url('admin/settings/gallery/report/download')));
131}
132
c15e9178 133?>