Apache-MP3-Skin
view release on metacpan or search on metacpan
is either "" or "0".
=item <TMPL_LOOP NAME=loop_name> do this </TMPL_LOOP>
This tag is more complicated the others, but basically it outputs "do this"
multiple times. The number of times is determined by loop_name. Looping also
changes the context of some variable. For example...
<ul>
<TMPL_LOOP NAME="MP3S"><li> <TMPL_VAR NAME="TITLE"> </TMPL_LOOP>
</ul>
For each iteration of MP3S, TITLE will be different value.
Note: that variables can be used in TMPL_VAR, TMPL_UNLESS, and TMPL_IF, but not
in TMPL_LOOP which requires a loop_name.
=item <TMPL_INCLUDE NAME="filename.tmpl">
This tag includes a template directly into the current template at the
point where the tag is found. The included template contents are used
exactly as if its contents were physically included in the master template.
The file specified can be a full path - beginning with a '/'. If it isn't a
full path, the path to the enclosing file is tried first.
=back
=head1 NESTING TEMPLATE TAGS
Yes. All the tags can be nested in almost any way. A few variables are
limited to be inside certain loops, but that's the only restriction.
=head1 VARIABLES
Variables can be used in TMPL_VAR, TMPL_UNLESS, and TMPL_IF, and they are grouped below
into for types: global, directory scoped, file scoped, and special loop variables. At
last count there were 68 valid variables and some like PARAM_param and IS_SORT_sort can
take many forms.
=head2 Global Variables
These variables' values do not change during the parsing of a template and available
everywhere.
=over 4
=item ADD_TO_PLAYLIST_ALL_SCRIPT
(string) JavaScript that will add all the MP3s currently listed on the page.
Differs from ADD_TO_PLAYLIST_ALL_THIS_DIR_URL which is directory context
sensitive.
=item ADD_TO_PLAYLIST_SELECTED_SCRIPT
(string) JavaScript to add the selected MP3S to the playlist.
=item ALLOW_DOWNLOAD
(1|0) Is streaming allowed? Set by PerlSetVar AllowDownload. It's good form to test
if streaming is allowed before using variables like FETCH_URL which will not work.
=item ALLOW_STREAM
(1|0) Is streaming allowed? Set by PerlSetVar AllowStream. It's good form to test
if streaming is allowed before using variables like PLAY_URL which will not work.
=item BASE_DIR
(string) path the base directory. Set by PerlSetVar BaseDir and defaulted to
/apache_mp3.
=item CLEAR_ALL_PLAYLIST_URL
(string) URL to remove all the files from the playlist.
=item CLEAR_SELECTED_PLAYLIST_SCRIPT
(string) JavaScript to remove all the selected files from the playlist.
=item CONTAINS_PLAYLIST
(int) Return the number of songs on the current browsers playlist. Useful in
TMPL_IF and TMPL_UNLESS tags as an empty playlist will contain 0 songs.
=item DIR
(string) The name of the directory that browser is looking at, similar to
THIS_DIR except DIR's value does not change with the directory context.
=item HOME_LABEL
(string) The name of the top (or home) directory as defined by PerlSetVar.
=item HOME_PATH
(string) The hostname-relative PATH of the top (or home) directory as defined
by PerlSetVar HomePath.
=item IS_SORT_method
(1|0) Is the current page being sorted by method where method is
title, album, artist, etc.. Default is the sort method defined by PerlSetVar
SortFields.
=item PARAM_param
(string) Returns the value of the param named 'param' from the URL's query string. For
example if the current url is http://www.apachemp3.com/demo/pop?cartopen=yes then
<TMPL_VAR NAME=PARAM_CARTOPEN> would return "yes". This can be useful for complicated
skins that need to maintain state.
=item PLAY_ALL_PLAYLIST_URL
(string) URL to play all files in the playlist in order.
=item PLAY_ALL_SCRIPT
(string) Javascript that will play all the MP3s currently listed on page.
Differs from PLAY_ALL_THIS_DIR_URL which is directory context sensitive.
=item PLAY_SELECTED_PLAYLIST_SCRIPT
(string) JavaScript that will play all the selected files in the playlist.
=item PLAY_SELECTED_SCRIPT
(string) Javascript that will play all selected songs.
=item SELECT_ALL_MP3S_SCRIPT
(string) JavaScript that checks all the checkboxes generated by
<TMPL_VAR NAME=CHECKBOX> for MP3 files.
=item SELECT_ALL_PLAYLIST_SCRIPT
(string) JavaScript that checks all the checkboxes generated by
<TMPL_VAR NAME=CHECKBOX> in the playlist.
=item SORT
(string) The current sort method. Returns "" if default, otherwise returns the field name
currently being used to sort See L<Apache::MP3::Sorted> for appropriate values.
This is the same as PARAM_sort since the sort field is contained in the query
string. Default sort is defined by PerlSetVar SortFiles.
=item SHUFFLE_ALL_PLAYLIST_URL
(string) URL to play all files in the playlist in a random order.
=item SHUFFLE_ALL_SCRIPT
(string) Javascript that will play all the MP3s currently listed on a page
in a random order. Not directory context sensitive.
=item SHUFFLE_SELECTED_SCRIPT
(string) Javascript that will play all selected songs in a random
order.
=item SKIN
(string) The current skin. Append to URLs in the form of ?skin=<TMPL_VAR NAME=SKIN>
to maintain your skin if it is not the default. Useful in skins that require
multiple files for framesets.
=item STREAM_TIMEOUT
(int) If anything but 0, this returns the number in seconds of how long a file
will stream before timing out, otherwise returns an empty string. Set by
PerlSetVar StreamTimeout. Used for demos or in cases when streaming an entire
song would not be appropriate or illegal.
=item UNSELECT_ALL_MP3S_SCRIPT
(string) JavaScript that Unchecks all the checkboxes generated by
<TMPL_VAR NAME=CHECKBOX> for all MP3 files.
=item UNSELECT_ALL_PLAYLIST_SCRIPT
(string) JavaScript that unchecks all the checkboxes generated by
<TMPL_VAR NAME=CHECKBOX> in the playlist.
=item URL
(string) The URL path to DIR. Similar to THIS_URL but does not change with
the directory context
=back
=head2 Directory Scoped variables
These variables' values are determined by the current directory context. In the
context of a directory loop -- PATH_FORWARD, PATH_BACKWARD, HOME_DIRS, and DIRS --
the values are those of directory for that loop iteration. Outside of loops, the
directory context is that of the current browser request. These varables are
available everywhere as there is always a directory context.
=over 4
=item IS_LONG_PAGE
(1|0) Does the current directory have more files than the defined value
in PerlSetVar LongList. Useful for adding a second set of buttons on a long
page.
=item CONTAINS_MP3S
(int) Return the number of MP3s in the current directory. Useful in IF and
UNLESS commands to test existance of any MP3s.
=item CONTAINS_DIRS
(int) Return the number of sub-directories in the current directory. Useful in IF
and UNLESS commands to test existance of any sub-directories.
=item IS_HOME
(1|0) Is the current directory the top (or root) directory as defined by
PerlSetVar HomePath.
=item COVER
(string) The full src path of an image. Returns an empty string if there is no image.
The empty string is useful to test the existance of a cover image. The image
is looked for has the filename set by PerlSetVar CoverImage (dafault is cover.jpg)
in the current directory.
=item IS_DIR_INSIDE_THIS_DIR
( run in 0.557 second using v1.01-cache-2.11-cpan-63c85eba8c4 )