Apache-MP3-Skin

 view release on metacpan or  search on metacpan

Skin.pm  view on Meta::CPAN

=item FETCH_URL

(string) The file's URL to fetch it from.  May be disabled with 
PerlSetVar AllowDownload no. Also available in PLAYLIST loop.

=item PLAY_URL

(string) The file's URL to stream it from.  May be disabled with
PerlSetVar AllowStream. Also available in PLAYLIST loop.

=item REMOVE_FROM_PLAYLIST_URL

(string) The URL to remove the file from the playlist. Only available inside 
PLAYLIST loop.

=item ADD_TO_PLAYLIST_URL

(string) The URL to add the current file to the users playlist. 
Not available inside PLAYLIST loop.

=back

=head2 Special Loop Variables

Inside a loop these varables are also available

=over 4

=item __COUNT__

(int) Starting with 1, this is the loop count.  It increases by 1
with each iteration.

=item __COUNT_BASE_ZERO__

(int) Useful for building JavaScript Object and Arrays, this is __COUNT__
minus 1.

=item __FIRST__

(1|0) Returns 1 if __COUNT__ is 1, otherwise it returns 0.  More simply,
it's 1 for the first iteration only.  Implemented by HTML::Template.

=item __LAST__

(1|0) Returns 1 on the last iteration only.  Implemented by HTML::Template.

=item __INNER__

(1|0) If an iteration is not first and not last, than __INNER__ is 1.
Implemented by HTML::Template.

=item __FIRST_COL_x__ 

(1|0) Where x is an integer.  For __FIRST_COL_3__, 1 would be returned on
 __COUNT__ values: 1, 4, 7, 10, etc.

=item __LAST_COL_x__

(1|0) Similar to __FIRST_COL_x__ but given x is 3, __LAST_COL_3__ 
would return 1, on the following iterations: 3, 6, 9, 12, etc.

=item __INNER_COL_x__

If an iteration is not a __FIRST_COL_x__ or a __LAST_COL_x__ it is an __INNER_COL_x__.

=item __ODD__

(1|0) Returns 1 on odd __COUNT__ values.

=item __EVEN__

(1|0) Returns 0 on even __COUNT__ values.

=item IS_MP3

(1|0) Useful in LOOP_MP3S_AND_DIRS and LOOP_DIRS_AND_MP3S this will return 1
if the current loop iteration is an mp3.	

=item IS_DIR

(1|0) Useful in LOOP_MP3S_AND_DIRS and LOOP_DIRS_AND_MP3S this will return 1
if the current loop iteration is a directory.

=back

=head2 About Variables Ending in _URL or _SCRIPT

Many of the TMPL_VAR variables below return URLs or JavaScript functions.  Variables that return
URLs, always end with _URL.  This value can be used as an href in an anchor tag. Or be included
in a javascript event like onClick.  Here's an example of use in a form button.

<BUTTON onClick="location=<TMPL_VAR NAME=SOME_URL>;">

and then a variable ending in _SCRIPT would be like this:

<BUTTON onClick="<TMPL_VAR NAME=SOME_SCRIPT>">

to use a _SCRIPT as part of a url do something like this:

<a href="javascript: <TMPL_VAR NAME=SOME_SCRIPT>">



=head1 LOOP NAMES

A variety of loops are possible, and all can be nested inside of each other for some 
interesting and sometimes useless effects. Note that when looping through a series of 
directories, the current directory context changes. So multiple nested DIRS loops would result
in a directory tree because DIRS loops through the current directory context, and inside 
iterations change that same context.

Valid loop names are:

=over 4

=item PATH_FORWARD

Iterate through the path from the top (or home) directory as
defined by PerlSetVar to the current Directory.  Useful for making
breadcrumb trails.

=item PATH_BACKWARD

Same as PATH_FORWARD but the loops starts with the current
directory and goes up the file tree to the top (or home) directory.

=item HOME_DIRS

Loop through all the directories in the top (or home) directory.
Useful for creating persistent global nav.

=item MP3S

Loop through all the MP3s in the current directory.

=item DIRS

Loop through all the DIRs in the current directory.

=item PLAYLIST

Loop through all the MP3s in the current browser's playlist.

=item DIRS_AND_MP3S

Loop through all the directories and then all the MP3s in the current directory. Use 
the IS_DIR variable to test whether a given iteration is a directory or MP3.

=item MP3S_AND_DIRS

Same and DIRS_AND_MP3S except all the MP3s come before directories.

=back

=head1 ABOUT FRAMES

A skin can be composed of multiple template files.  The default template should contain the 
framset and the source's for each from should end with "?skin=thisframe.tmpl" where 
thisframe.tmpl is the name of the file to be used to skin that frame.  Links inside 
thisframe.tmpl will also need to end in "?skin=thisframe.tmpl" to maintain their look.

=head1 ABOUT FORMS

A open form and closing form tag is automatically added to every page.  Do not include
any forms tags in your skin files.  You can include form input fields and they will be part
of the apache_mp3_skin form.  Use document.apache_mp3_skin to refer to the form object
in any JavaScript that you have.

=head1 METHODS



( run in 1.308 second using v1.01-cache-2.11-cpan-96521ef73a4 )