#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
  $Overlay =   ["$PATH/Overlay.tn.Landscape.1.png", 133, 100];
  @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%">
<: my $back = Back();
   if ($back && $back ne "''" && $back ne "'0'") { _:>
          <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">
<:  if (Get_Opt('dir_thumbs')) { _:>
        <table border="<:=$BORDER_WIDTH:>" cellpadding="0" cellspacing="0" width="100%">
          <tr>
            <td valign=top>
<:  } _:>

    <p class='title'>
      <b>Folders</b>:<br />

<:  if (Get_Opt('dir_thumbs')) { _:>
            </td>
<:  } _:>

#c//
#c// Loop on all the albums
<:    while ($alb) {
        my $locked = (-e Get($alb,'path').'/.htaccess') ? 1 : 0;
        # We do -nodir_thumbs nice and clean, one directory per line
        if (Get_Opt('dir_thumbs')) { _:>
            <td valign="bottom" width="<:=$Col_Perc:>">
              <div align="center">
                <: Overlay($alb,'thumb', 'full', $Overlay) if Get($alb,'thumb', 'x') :>
                <: Border($alb,'thumb','dir', @Border) if Get($alb,'thumb','x') :>
                <span class='main'>
                  <:=Image_Array($locked ? @locked : @empty):>
                  <:=Get($alb,'href','dir'):>
                  <:=Pretty(Name($alb),1,1):></a>
                  <: my $cap=Caption($alb);  print "<br />$cap" if $cap :>
                  </span>
              </div>
            </td>
<:      if (New_Row($alb,$Cols,1) || !Next($alb)) { _:>
          </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>
<:        }
        } else {
          print Image_Array($locked ? @locked : @empty);
          print Get($alb,'href','dir');
          print Pretty(Name($alb),1),"</a>\n";
          print Caption($alb),"<br />\n";
        }
        $alb = Next($alb);
      } _:>

        </p>
      </td>
<:    if (Get_Opt('dir_thumbs')) { _:>
    </tr>
  </table>
<:    } :>
<:  } :>

#c// --SGR
<:  if (isHeader()) { _:>
      <td valign="top" 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
    </table>
<:  } :>

#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">
            <: Overlay($img,'thumb', 'full', $Overlay) if Get($img,'thumb', 'x') :>
            <: Border($img,'thumb','image', @Border) if Get($img,'thumb','x') :>
            <span class='main'>
              <:=Get($img,'href','image'):>
              <:=Pretty(Name($img),1,1):></a>
              <: my $cap=Caption($img);  print "<br />$cap" if $cap :>
              </span>
          </div>
        </td>

<:    if (New_Row($img,$Cols) || !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>
