<?xml version="1.0" encoding="ISO-8859-1"?>

<xwikidoc>
<web>XWiki</web>
<name>PhotoAlbumClassSheet</name>
<language></language>
<defaultLanguage>en</defaultLanguage>
<translation>0</translation>
<parent>XWiki.PhotoAlbumClass</parent>
<creator>XWiki.Admin</creator>
<author>XWiki.Admin</author>
<customClass></customClass>
<contentAuthor>XWiki.Admin</contentAuthor>
<creationDate>1107121242000</creationDate>
<date>1176363402000</date>
<contentUpdateDate>1176363402000</contentUpdateDate>
<version>1.26</version>
<title>Photo Album Class Sheet</title>
<template></template>
<defaultTemplate></defaultTemplate>
<validationScript></validationScript>
<object>
<class>
<name>XWiki.TagClass</name>
<customClass></customClass>
<customMapping></customMapping>
<defaultViewSheet></defaultViewSheet>
<defaultEditSheet></defaultEditSheet>
<defaultWeb></defaultWeb>
<nameField></nameField>
<validationScript></validationScript>
<tags>
<name>tags</name>
<prettyName>Tags</prettyName>
<unmodifiable>0</unmodifiable>
<relationalStorage>1</relationalStorage>
<displayType>input</displayType>
<multiSelect>1</multiSelect>
<size>30</size>
<separator> </separator>
<separators> ,|</separators>
<values></values>
<number>1</number>
<classType>com.xpn.xwiki.objects.classes.StaticListClass</classType>
</tags>
</class>
<name>XWiki.PhotoAlbumClassSheet</name>
<number>0</number>
<className>XWiki.TagClass</className>
<property>
<tags/>
</property>
</object>
<content>#set($obj = $doc.getObject("XWiki.PhotoAlbumClass", 0))
#if(!$obj)
## String type is more specific than Object type. We should avoid ambiguous method call
## see http://java.sun.com/docs/books/jls/clarifications-2-2nd-ed.html (JLS 15.12.2.2)
#set($obj = "")
#end

&lt;br /&gt;
1 $doc.display("title", $obj)

$doc.display("description", $obj)

#if($context.action != "inline")

  #set($diapo = $request.get("diapo"))
  #if(!$diapo)
    #set($diapo="all")
  #end
  
  #if($diapo=="all")

    #macro(photosAlbum2 $height)
      #set($current = 0)
      #foreach ($attach in $doc.attachmentList)
        #set($current = $current + 1)
        &lt;a href="$doc.getURL("view","diapo=$current")" &gt;
          &lt;img src="$doc.getAttachmentURL($attach.filename,"download")"  height="${height}" alt="photo ${current}" /&gt;
        &lt;/a&gt;
      #end
    #end

    ## Compute the size of the thumbnails. If there's no height property specified default to 150
    #if(!$obj.getProperty("height"))
      #set($height = 150)
    #else
      #set($height = $doc.display("height", "view", $obj))
    #end

    #photosAlbum2($height)

  #else

    #set($current = 0)
    #set($height = 400)
    #foreach ($attach in $doc.attachmentList)
      #set($current = $current + 1)
      #set($scurrent = "$current")
      #if("$diapo" == "$current")
        #set($prev = ($current - 1))
        #set($next = ($current + 1))
        &lt;a href="$doc.getAttachmentURL($attach.filename,"download")" &gt;
          &lt;img src="$doc.getAttachmentURL($attach.filename,"download")"  height="${height}" /&gt;
        &lt;/a&gt;
      #end
    #end
    #if($prev==0)
      #set($prev = $doc.attachmentList.size())
    #end
    #if($next==$doc.attachmentList.size()+1)
      #set($next = 1)
    #end

    #if(!$prev)
      #set($prev = 1)
      #set($next = 1)
    #end
    &lt;br /&gt;
    ~~[Previous Photo&gt;${doc.name}?diapo=$prev] [Next Photo&gt;${doc.name}?diapo=$next]~~

  #end

  &lt;br /&gt;
  ~~&lt;a href="$doc.getURL("attach")"&gt;Add Photos&lt;/a&gt; &lt;a href="$doc.getURL("inline")"&gt;Modify the Album&lt;/a&gt; [All Photos&gt;${doc.name}?diapo=all] [Diaporama&gt;${doc.name}?diapo=1]~~
#end

#set($showattachments = 0)</content>
</xwikidoc>
