{*
* Gallery2Flickr
*
* A bridge between your gallery2 installation and flickr.com
*
* File: FlickrSearch.tpl
*
* Template for the flickr set import.
*
* Copyright:
* (c) 2006 - 2008 hide@address.com
* Distributed under the terms of the GNU General Public License v2
*
* Author(s):
* Gunnar Wrobel <hide@address.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* (Gallery2Flickr is a module for Gallery2 - a web based photo album
* viewer and editor - Copyright for Gallery2: (C) 2000-2008 Bharat
* Mediratta)
*
* $Id: FlickrSearch.tpl 10 2008-01-18 09:39:31Z luciferc $
*
*}
<?xml version="1.0" encoding="utf-8"?>
<div class="gbBlock gcBackground1">
<h2>
{g->text text="Flickr Search"}
</h2>
</div>
{if isset($Flickr.imported)}
<div class="gbBlock">
<h2 class="giSuccess">
{g->text text="Successfully imported the images!"}
</h2>
</div>
<hr/>
{/if}
{if isset($Flickr.importerror)}
<div class="gbBlock">
<h2 class="giError">
{g->text text="Importing images failed!"}
</h2>
</div>
<hr/>
{/if}
<div class="gbBlock">
<h3>Import</h3>
The album you chose for this action was: <b>{$Flickr.item.title|default:$Flickr.item.pathComponent}</b>
</div>
<hr/>
<div class="gbBlock">
<h3>Search criteria</h3>
<form action="{g->url}" method="post">
{g->hiddenFormVars}
<input type="hidden" name="{g->formVar var="controller"}" value="Gallery2Flickr.FlickrSearch"/>
<input type="hidden" name="{g->formVar var="form[formName]"}" value="{$form.formName}"/>
<input type="hidden" name="{g->formVar var="itemId"}" value="{$Flickr.item.id}"/>
<input type="hidden" name="{g->formVar var="form[page]"}" value="{$Flickr.pages.current}"/>
<table class="gbDataTable">
<tr>
<td>
<b>
Search photos of user:
</b>
</td>
<td>
<input
type="text"
name="{g->formVar var="form[user]"}"
value="{$form.user}"/>
</td>
<td>
(Enter nothing to search all public images, enter "me" for your images or the user name to search the images of a specific user)
</td>
</tr>
<tr>
<td>
<b>
Tags:
</b>
</td>
<td>
<input
type="text"
name="{g->formVar var="form[tags]"}"
value="{$form.tags}"/>
</td>
<td>
(A comma-delimited list of tags. Photos with one or more of the tags listed will be returned.)
</td>
</tr>
<tr>
<td>
<b>
Match tags:
</b>
</td>
<td>
<input
type="radio"
id="gfMatchAny"
{if empty($form.matchtags) or $form.matchtags=='any'}
checked="checked"
{/if}
name="{g->formVar var="form[matchtags]"}"
value="any"/>
<label for="gfMatchAny">
{g->text text="Any"}
</label>
<br/>
<input
type="radio"
id="gfMatchAll"
{if $form.matchtags=='all'}
checked="checked"
{/if}
name="{g->formVar var="form[matchtags]"}"
value="all"/>
<label for="gfMatchAll">
{g->text text="All"}
</label>
</td>
<td>
(Either 'any' for an OR combination of tags, or 'all' for an AND combination.)
</td>
</tr>
<tr>
<td>
<b>
Text:
</b>
</td>
<td>
<input
type="text"
name="{g->formVar var="form[text]"}"
value="{$form.text}"/>
</td>
<td>
(A free text search. Photos who's title, description or tags contain the text will be returned.)
</td>
</tr>
<tr>
<td>
<b>
License:
</b>
</td>
<td>
<input
type="checkbox"
name="{g->formVar var="form[license][4]"}"
{if isset($form.license.4)}
checked="checked"
{/if}
/>
<a href="http://creativecommons.org/licenses/by/2.0/">{g->text text="Attr. License"}</a>
<br/>
<input
type="checkbox"
name="{g->formVar var="form[license][6]"}"
{if isset($form.license.6)}
checked="checked"
{/if}
/>
<a href="http://creativecommons.org/licenses/by-nd/2.0/">{g->text text="Attr.-NoDerivs License"}</a>
<br/>
<input
type="checkbox"
name="{g->formVar var="form[license][3]"}"
{if isset($form.license.3)}
checked="checked"
{/if}
/>
<a href="http://creativecommons.org/licenses/by-nc-nd/2.0/">{g->text text="Attr.-NonCom.-NoDerivs License"}</a>
<br/>
<input
type="checkbox"
name="{g->formVar var="form[license][2]"}"
{if isset($form.license.2)}
checked="checked"
{/if}
/>
<a href="http://creativecommons.org/licenses/by-nc/2.0/">{g->text text="Attr.-NonCom. License"}</a>
<br/>
<input
type="checkbox"
name="{g->formVar var="form[license][1]"}"
{if isset($form.license.1)}
checked="checked"
{/if}
/>
<a href="http://creativecommons.org/licenses/by-nc-sa/2.0/">{g->text text="Attr.-NonCom.-ShareAlike License"}</a>
<br/>
<input
type="checkbox"
name="{g->formVar var="form[license][5]"}"
{if isset($form.license.5)}
checked="checked"
{/if}
/>
<a href="http://creativecommons.org/licenses/by-sa/2.0/">{g->text text="Attr.-ShareAlike License"}</a>
<br/>
</td>
<td>
(The accepted licenses for the identified photos. Multiple licenses may be selected.)
</td>
</tr>
<tr>
<td>
<b>
Size:
</b>
</td>
<td>
<input
type="text"
name="{g->formVar var="form[minpix]"}" value="{$form.minpix}"/>
</td>
<td>
(Minimal number of pixels.)
</td>
</tr>
</table>
<input
type="submit"
class="inputTypeSubmit"
name="{g->formVar var="form[action][search]"}" value="{g->text text="Search for images"}"/>
</div>
<hr/>
{if isset($Flickr.uid)}
<div class="gbBlock">
Search results from user: <b><a href="{$Flickr.uid.photosurl}">{$Flickr.uid.username|default:images}</a> (Profile: <a href="{$Flickr.uid.profileurl}">{$Flickr.uid.realname|default:profile}</a>)</b>
</div>
<hr/>
{/if}
{if isset($Flickr.pages)}
<div class="gbBlock">
<h4>
{if ($Flickr.pages > 0)}
{g->text text="Results %d - %d of %d, Page %d of %d"
arg1=$Flickr.pages.start arg2=$Flickr.pages.end
arg3=$Flickr.pages.total arg4=$form.page arg5=$Flickr.pages.pages}
{/if}
{if ($form.page > 1)}
<input type="submit" class="inputTypeSubmit"
name="{g->formVar var="form[action][previousPage]"}"
value="{g->text text="« Back"}"/>
{/if}
{if ($form.page < $Flickr.pages.pages)}
<input type="submit" class="inputTypeSubmit"
name="{g->formVar var="form[action][nextPage]"}"
value="{g->text text="Next »"}"/>
{/if}
<input
type="submit"
class="inputTypeSubmit"
name="{g->formVar var="form[action][importpage]"}" value="{g->text text="Import this page"}"/>
<input
type="submit"
class="inputTypeSubmit"
name="{g->formVar var="form[action][importresults]"}" value="{g->text text="Import all results"}"/>
</h4>
</div>
<hr/>
{/if}
{if isset($Flickr.result.photo)}
{if (sizeof($Flickr.result.photo) > 0)}
{assign var="childrenInColumnCount" value=0}
<table border="1">
<tr>
{foreach from=$Flickr.result.photo item=photo}
{* Move to a new row *}
{if ($childrenInColumnCount == 4)}
</tr>
<tr>
{assign var="childrenInColumnCount" value=0}
{/if}
{assign var=childrenInColumnCount value="`$childrenInColumnCount+1`"}
<td style="text-align:center;width:25%;">
<div style="height:103px;margin-top:5px;">
<a href="{$photo.oid.photosurl}{$photo.id}">
<img src="{$photo.thumb}" alt="{$photo.title}"/>
</a>
</div>
<br/>
<div style="margin-bottom:3px;">
<a href="{$photo.oid.photosurl}{$photo.id}">
{$photo.title}
</a>
{if isset($photo.description)}
<br/>
{$photo.description}
{/if}
</div>
<br/>
<div style="margin-bottom:10px;">
{assign var="pid" value=$photo.id}
<input
type="submit"
class="inputTypeSubmit"
name="{g->formVar var="form[action][import][$pid]"}" value="{g->text text="Import"}"/>
</div>
</td>
{/foreach}
</tr>
</table>
{/if}
{/if}
</form>
<div class="block-core-GuestPreview gbBlock">
<a href="http://gunnarwrobel.de/projects/Gallery2Flickr.html">Gallery2Flickr</a> © 2006 - 2008 <a href="http://www.pardus.de">hide@address.com</a> (Author: <a href="http://gunnarwrobel.de">Gunnar Wrobel</a>)
</div>