1=head1 Toader Gallery Documentation
2
3L<Toader::Gallery> handles image galleries for Toader.
4
5Each Toader directory can have one gallery.
6
7Below are the common variables used for in this POD.
8
9    $srcPath - The base source image path from the config.
10    $srcURL - The base URL for the source image from the config.
11    $outputPath - The base output path from the config.
12    $outputURL - The base URL for the output from the config.
13    $gdir - The gallery directory formed as below.
14    $image - The filename of a image, with the path part removed.
15
16The gallery directory part is formed as below.
17
18    $srcPath/$gdir/$image
19
20It is just the gallery directory is the the path between the srcPath
21and a image.
22
23The following are recognized image extensions currently.
24
25    jpg
26    jpeg
27    gif
28    png
29
30=head1 Configuration Storage
31
32The config for a Toader::Gallery is $toaderDir.'/gallery.ini' .
33
34=head2 Gallery INI Variables
35
36=head3 outputPath
37
38This is the output path to use for where output to.
39
40This is required.
41
42=head3 outputURL
43
44This is the output URL to use for when creating the required
45non-relative URLs.
46
47None of the methods will append a '/', so if one is needed, it should
48be provided here.
49
50This is required.
51
52=head3 srcPath
53
54This is the path to find images under.
55
56This is required.
57
58=head3 srcURL
59
60This is the URL that source images can be found under.
61
62None of the methods will append a '/', so if one is needed, it should
63be provided here.
64
65This is required.
66
67=head3 renderUpdateDetails
68
69If image details should be updated upon render being called.
70
71This defaults to '0'.
72
73This is optional.
74
75=head3 renderUpdateIndexes
76
77If image gallery directory index should be updated upon render being called.
78
79This defaults to '0'.
80
81This is optional.
82
83=head3 renderUpdateScaled
84
85If the scaled images should be updated upon render being called.
86
87This defaults to '0'.
88
89This is optional.
90
91=head3 resolutionSmall
92
93The resolution to default to for the small image.
94
95This is a integer that represents what the largest resolution for either
96X or Y a scalled image may have.
97
98The default is '200'.
99
100This is optional.
101
102=head3 resolutionLarge
103
104The resolution to default to for the large image.
105
106This is a integer that represents what the largest resolution for either
107X or Y a scalled image may have.
108
109The default is '1024'.
110
111This is optional.
112
113=head1 Page Template
114
115L<Toader::Gallery> uses a different page template than other modules. The
116template used is 'pageGallery' and the default is as below.
117
118    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
119    <html>
120
121      <head>
122        <title> [== $c->{_}->{siteTitle} ==] </title>
123        <LINK href="[== $g->cssLocation ==]" rel="stylesheet" type="text/css">
124      </head>
125
126      <body>
127
128        <div id="header" >
129          [== $g->top ==]
130        </div>
131
132        <div id="location" >
133          [== $g->locationbar( $locationID ) ==]
134          [== $g->locationSub ==]
135        </div>
136
137        <div>
138
139        <div id="content" >
140          [== $content ==]
141        </div>
142
143        <br><br><br>
144
145        <div id="copyright">
146          [==
147            my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
148            $year=$year+1900;
149            return "Copyright ".$year." ".$c->{_}->{owner};
150           ==]
151        </div>
152
153      </body>
154    </html>
155
156
157Below is what is passed to it, for both updateIndex and updateDetails.
158
159    toader - The L<Toader> object.
160    g - The L<Toader::Render::General> object.
161    self - The L<Toader::Render::Entry> object.
162    obj - The L<Toader::Entry> object.
163    c - The L<Config::Tiny> holding the Toader config.
164    dir - The R2R path for the Toader directory the gallery is for.
165    gdir - The current gallery directory.
166    content - The content for the page.
167
168For updateDetails, the one below is also passed to it.
169
170    image - The name of the image for this page.
171
172=head1 Rendering
173
174Rendering is handled by L<Toader::Render::Gallery>.
175
176Upon Toader::Render::Gallery->render being called, it checks if it should
177render any thing.
178
179    renderUpdateDetails
180    renderUpdateIndexes
181    renderUpdateScaled
182
183The above gallery config settings are used to check for if it should render
184any thing. If any of those are set to 1, it calls the related methods.
185
186=head2 updateDetails
187
188This method updates the detailed images page.
189
190The detail pages are writen out to
191$outputPath.'/.toader-gallery/html/'.$gdir.'/'.$image.'.html' .
192
193The content of the page is pulled from Toader::Render::General->galleryImageLarge .
194
195=head2 updateIndexes
196
197This method updates indexes of a directory.
198
199The index pages are writen out to
200$outputPath.'/.toader/html/'.$gdir.'/index.html' .
201
202When joining the list of sub directories and images, directories
203always come first.
204
205=head3 templates
206
207=head4 gallerySmallImageBegin
208
209This begins the list.
210
211The default template is blank.
212
213The arguments passed to it are as below.
214
215    toader - The L<Toader> object.
216    g - The L<Toader::Render::General> object.
217    self - The L<Toader::Render::Entry> object.
218    obj - The L<Toader::Entry> object.
219    c - The L<Config::Tiny> holding the Toader config.
220    dir - The R2R path for the Toader directory the gallery is for.
221    gdir - The current gallery directory.
222
223=head4 galleryDir
224
225This links to a gallery directory.
226
227The default template is as below.
228
229    <div id="imageDiv" > [== $link ==] </div>
230
231The arguments passed to it are as below.
232
233    toader - The L<Toader> object.
234    g - The L<Toader::Render::General> object.
235    self - The L<Toader::Render::Entry> object.
236    obj - The L<Toader::Entry> object.
237    c - The L<Config::Tiny> holding the Toader config.
238    dir - The R2R path for the Toader directory the gallery is for.
239    gdir - The gallery directory being linked to.
240    link - This is the HTML for the gdir being linked to.
241
242=head4 gallerySmallImage
243
244This links to a gallery directory.
245
246The default template is as below.
247
248    [== $g->galleryImageSmall( $dir, $gdir, $image ); ==]
249
250The arguments passed to it are as below.
251
252    toader - The L<Toader> object.
253    g - The L<Toader::Render::General> object.
254    self - The L<Toader::Render::Entry> object.
255    obj - The L<Toader::Entry> object.
256    c - The L<Config::Tiny> holding the Toader config.
257    dir - The R2R path for the Toader directory the gallery is for.
258    gdir - The current gallery directory.
259    image - The current image in the current gdir.
260
261=head4 gallerySmallJoin
262
263This joins the dir divs and image divs together.
264
265The default template is as below.
266
267
268
269
270The arguments passed to it are as below.
271
272    toader - The L<Toader> object.
273    g - The L<Toader::Render::General> object.
274    self - The L<Toader::Render::Entry> object.
275    obj - The L<Toader::Entry> object.
276    c - The L<Config::Tiny> holding the Toader config.
277    dir - The R2R path for the Toader directory the gallery is for.
278    gdir - The current gallery directory.
279
280=head4 gallerySmallImageBegin
281
282This ends the list.
283
284The default template is blank.
285
286The arguments passed to it are as below.
287
288    toader - The L<Toader> object.
289    g - The L<Toader::Render::General> object.
290    self - The L<Toader::Render::Entry> object.
291    obj - The L<Toader::Entry> object.
292    c - The L<Config::Tiny> holding the Toader config.
293    dir - The R2R path for the Toader directory the gallery is for.
294    gdir - The current gallery directory.
295
296=head1 updateScaled
297
298This updates the scaled images.
299
300The small images are written out to
301$outputPath.'/.toader-gallery/small/'.$gdir.'/'.$image .
302
303The large images are written out to
304$outputPath.'/.toader-gallery/small/'.$gdir.'/'.$image .
305
306=cut
307