#c// ###################################################################
#c// Album Theme by Ed Maste, updated by DaveSource
#c// 2003/06:  XHTML 1.0 & .htaccess: Magnus von Koeller, vonkoeller.de
#c// 2003/06:  CSS: hnilek, hnilek.zsbarr.cz
#c// ###################################################################
#c//
<:
  # Path setting - this is the path to the images
  $PATH = Theme_URL();

  # Font/color settings for the document
  $INTER_ROW_HEIGHT = "10";
  $BORDER_WIDTH = "0";
  $BODY = "bgcolor='#ffffff' text='#666666' link='blue' alink='blue' vlink='purple'";
  $SEP_BAR = "<div align='center'><img src='$PATH/Null.gif' height='5' width='1' alt='' /><br /><img src='$PATH/Bar.gif' width='95%' height='3' border='0' alt='Separator bar' /><br /><img src='$PATH/Null.gif' height='5' width='1' alt='' /></div>";

  # Shorthand for column info specified by -columns
  $Cols = Option('columns');
  $Col_Perc = int(100/$Cols)."%";

  # Thumbnail border
  @ThBord_L =   ("$PATH/ThBord_L.gif", 11, 0);
  @ThBord_R =   ("$PATH/ThBord_R.gif", 13, 0);
  @ThBord_TL =  ("$PATH/ThBord_TL.gif", 11, 11);
  @ThBord_TR =  ("$PATH/ThBord_TR.gif", 13, 11);
  @ThBord_BL =  ("$PATH/ThBord_BL.gif", 11, 13);
  @ThBord_BR =  ("$PATH/ThBord_BR.gif", 13, 13);
  @ThBord_T =   ("$PATH/ThBord_T.gif", 0, 11);
  @ThBord_B =   ("$PATH/ThBord_B.gif", 0, 13);
  @Border =	(\@ThBord_TL,\@ThBord_T,\@ThBord_TR,\@ThBord_RT,\@ThBord_R,\@ThBord_RB,\@ThBord_BR,\@ThBord_B,\@ThBord_BL,\@ThBord_LB,\@ThBord_L,\@ThBord_LT);
  @locked =     ("$PATH/locked.jpg", 10, 10);
  @empty =      ("$PATH/empty.jpg", 10, 10);
:>//
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

  <head>
    <meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />
    <: Meta() :>
    <title>Album: <:=Path('album_name'):></title>
    <link rel="stylesheet" type="text/css" href="<:=$PATH:>/style.css">
  </head>

  <body <:=$BODY:>>
    <table border="<:=$BORDER_WIDTH:>" cellpadding="0" cellspacing="0" align='center' width="95%">

      <tr>
        <td colspan="<:=($Cols-1):>" align='left'>
          <p class='title'>
            <b>Album</b>:
            <:=Parent_Albums("::"):>
          </p>
        </td>
        <td width="25%">
          <div align="right">
            <a href=<:=Back():> class='title'>Up</a>
          </div>
        </td>
      </tr>
    </table>

    <:=$SEP_BAR:>


#c// Are there more albums below this one?
<:
  my $alb = First('dirs');
  if ($alb || isHeader()) { _:>
    <table border="<:=$BORDER_WIDTH:>" width='95%' align='center' cellspacing='0' cellpadding='0'>
    <tr>

<:  if ($alb) { _:>
      <td valign="top">
    <p class='title'>
      <b>Folders</b>:<br />

#c//
#c// Loop on all the albums
<:    while ($alb) {
        my $locked = (-e Get($alb,'path').'/.htaccess') ? 1 : 0;
        print Image_Array($locked ? @locked : @empty);
        print Get($alb,'href','dir');
        print Name($alb),"</a><br />\n";
        print Caption($alb);
        $alb = Next($alb);
      } _:>

        </p>
      </td>
<:  } :>

#c// --SGR
<:  if (isHeader()) { _:>
      <td valign="bottom" width="50%">
        <div align="center">
          <p class='main'>
            <:pHeader():>
          </p>
        </div>
      </td>
<:  } _:>
#c// ++SGR

    </tr></table>

#c// Bar after child albums
    <:=$SEP_BAR:>


#c//
#c// End of sub-albums/header
<:  } :>

#c// The images

<:
  my $img = First('pics');
  if ($img) { _:>
    <table border="<:=$BORDER_WIDTH:>" cellpadding="0" cellspacing="0" width="100%">

      <tr>
  <: while ($img) { _:>//
        <td valign="top" width="<:=$Col_Perc:>">
          <div align="center">
            <: Border($img,'thumb','image', @Border) if Get($img,'thumb','x') :>
            <span class='main'>
              <:=Get($img,'href','image'):>
              <:=Name($img):></a>
              <: my $cap=Caption($img);  print "<br />$cap" if $cap :>
              </span>
          </div>
        </td>

<:    my $new_row = (!((Get($img,'num')+1) % $Cols) && Next($img)) ? 1 : 0; :>
<:    if ($new_row || !Next($img)) { _:>
      </tr>
      <tr>
        <td height="<:=$INTER_ROW_HEIGHT:>" colspan="<:=$Cols:>"><img src="<:=$PATH:>/Null.gif" width="20" height="<:=$INTER_ROW_HEIGHT:>" border="0" alt='' /></td>
      </tr>
      <tr>
<:
      }
      $img = Next($img);
    }
_:>
      </tr>
      </table>

      <:=$SEP_BAR:>
<:}:>//

#c//
#c// Optional footer
<: if (isFooter()) { _:>
	    <td valign="bottom" width="50%">
	      <p class='title'>
		<center>
		<:pFooter():>
		</center>
	      </p>
	    </td>
      <:=$SEP_BAR:>
<: } _:>


    <div align="center">
    <p class='credit'><: Credit() :> on <:=scalar localtime:></p>
    </div>
    <p></p>

  </body>

</html>
