{*
  Output of search results/browselist
  $Id: list.tpl,v 2.30 2005/09/27 07:31:00 andig2 Exp $
*}

{if $gallerylistcolumns == 1}
    {assign var=IMGWIDTH value="35"}
    {assign var=IMGHEIGHT value="48"}
    {assign var=ROWSPAN value="2"}
{else}
    {assign var=IMGWIDTH value="120"}
    {assign var=IMGHEIGHT value="150"}
    {assign var=ROWSPAN value="3"}
{/if}

{* 		Comments list for item				*}

<div id="docpart_list_target">
<div id="docpart_list_target_loading">
Loading...
</div>



<!-- {$smarty.template} -->

	<br>
	<div id="toppage"><a href="{if $cat==1}show_clubs.php{elseif $cat==2}show_competitions.php{elseif $cat==3}show_stadiums.php{else}show_persons.php{/if}?id={$subcat}">{$item.title}</a></div>
{if $cat}
	<table id="tableshow" width="100%" cellpadding="0" cellspacing="0" border="0">
	<tr>
		<td>
			{if $addgallery}	
				<div>
					{if $addgallery}
					<div>		
						<form action="gallery.php" name="galleryform">
							<input type="hidden" name="subcat" value="{$subcat}"/>
							<input type="hidden" name="cat" value="{$cat}" />
							<input type="hidden" name="new" value="1" />
							{if $idgallery}
							<input type="hidden" name="idgallery" value="{$idgallery}" />
							<span class="onglet-admin">
							<input type="submit" value="{$lang.update}"/>
							</span>
							{else}			
							<span class="onglet-admin">
							<input type="submit" value="{$lang.add}"/>
							</span>
							{/if}
						</form>
					</div>
					{/if}
				</div>	
			<!-- /actions -->
			{/if}	
		</td>
	</tr>
	<tr>
		<td>
		<form action="{if $cat==1}show_clubs.php{elseif $cat==2}show_competitions.php{elseif $cat==3}show_stadiums.php{else}show_persons.php{/if}" name="mkcommentform">
				<input type="hidden" name="id" value="{$subcat}"/>
				<span class="onglet">
				<input type="submit" value="{$lang.card}"/>
				</span>
		</form>
		{if $seegallery}
			<form action="gallery.php" name="galleryform">
				<input type="hidden" name="subcat" value="{$subcat}"/>
				<input type="hidden" name="cat" value="{$cat}" />
				<span class="onglet">
				<input type="submit" value="{$lang.gallery}"/>
				</span>
			</form>
		{/if}
		{if $commentable}
			<form action="comments.php" name="mkcommentform">
				<input type="hidden" name="subcat" value="{$subcat}"/>
				<input type="hidden" name="cat" value="{$cat}" />
				<span class="onglet">
				<input type="submit" value="{$lang.comment}"/>
				</span>
			</form>
		{/if}
		{if $video.prev_id || $video.next_id}
			<form action="{if $cat==1}show_clubs.php{elseif $cat==2}show_competitions.php{elseif $cat==3}show_stadiums.php{else}show_persons.php{/if}" name="prevform">
				<input type="hidden" name="id" value="{$video.prev_id}"/>
				<span class="onglet">
				<input type="submit" value="&laquo;" {if !$video.prev_id}disabled="disabled"{/if} accesskey="," />
				</span>
			</form>
			<form action="{if $cat==1}show_clubs.php{elseif $cat==2}show_competitions.php{elseif $cat==3}show_stadiums.php{else}show_persons.php{/if}" name="nextform">
				<input type="hidden" name="id" value="{$video.next_id}"/>
				<span class="onglet-admin">
				<input type="submit" value="&raquo;" {if !$video.next_id}disabled="disabled"{/if} accesskey="." />
				</span>
			</form>
		 {/if}
		</td>
	</tr>
	</table>

{/if}

<div id="showheader">

<script language="JavaScript" type="text/javascript" src="javascript/look.js"></script>
<script language="JavaScript" type="text/javascript" src="javascript/edit.js"></script>
<!-- content begin -->



{if $mygallery}

<table id="tableshow" width="100%" border="0" cellpadding=0 cellspacing="5">
        <tr>
            <td width="90%"><b><u><a href="gallery.php?cat={$cat}&subcat={$subcat}&idcomment={$mygallery.id}">{$mygallery.title}</a></u></b></td>
			{if $mygallery.addgallery}
			<td nowrap="nowrap" rowspan="2">            
                <form action="gallery.php" method="get">
                    <input type="hidden" name="id" value="{$comment.id}"/>
                    <span class="onglet-admin">
					<input type="submit" value="{$lang.edit}"/>
					</span>
                </form>
                <form action="delete_comment.php" method="get">
                    <input type="hidden" name="id" value="{$comment.id}"/>
                    <span class="onglet-admin">
					<input type="submit" value="{$lang.del}" onclick="return(confirm('{$comment.lastname|escape:javascript}: {$lang.really_del}?'))"/>
					</span>
                </form>            
            </td>
			{/if}
		</tr>
		<tr>
			<td>
				<a title="{$mygallery.title}" href="$link">
				<img alt="{$mygallery.title}" src="{$mygallery.imgurl}" border="0" hspace="5" vspace="5" width="{$IMGWIDTH}">
				</a>
				{if $mygallery.title}
                <span class="list_plot">				
                {$mygallery.title}
                </span>
				{/if}
            </td>
        </tr>
</table>
{/if}



{if $new}
<script language="JavaScript" type="text/javascript" src="javascript/edit.js"></script>
<form action="gallery.php" name="edi" method="post" enctype="multipart/form-data">
<br /><center>
<table border=0 width="100%" id="tableshow" cellspacing="0" cellpadding="2">
	<tr>
		<td id="theme" colspan="2">{$lang.loadimage}</td>
	</tr>
	<tr>
		<td class="td-opt">{$lang.title}</td>
		<td class="td-value"><input type="text" size="50" maxlength="255" name="title" value="{if $mygallery}[RE] {$mygallery.title}{/if}{if $editmygallery} {$editmygallery.title}{/if}">
		</td>
	</tr>
	<tr>
          <td class="td-opt">{$lang.imageurl}:</td>
          <td class="td-value">
          	<input type="text" name="imgurl" id="imgurl" value="{$editmygallery.imgurl}" size="50" maxlength="255" />
          </td>
    </tr>
	<tr>
          <td class="td-opt">{$lang.imageupload}:</td>
          <td class="td-value"><input type="file" name="coverupload" id="coverupload" size="35" /></td>
    </tr>
	<tr>
    	<td colspan="2" class="center">
            <input type="hidden" name="subcat" value="{$subcat}"/>
            <input type="hidden" name="cat" value="{$cat}" />
			<input type="hidden" name="save" value="1" />
			{if $editmygallery.id}
			<input type="hidden" name="id" value="{$editmygallery.id}" />
			{/if}
			{if $idgallery}
			<input type="hidden" name="idgallery" value="{$idgallery}" />
			<span class="onglet-admin">
			<input type="submit" style="width:100%;" value="{$lang.update}"/>
			</span>
			{else}
			<span class="onglet-admin">
			<input type="submit" style="width:100%;" value="{$lang.save}"/>
			</span>
			{/if}
            
            
		</td>
	</tr>
</table></center>
</form>
{/if}


<div id="pagecontent">
<div id="tablefilter"> 
	{if $pageno && $maxpageno}
		{if $pageno != 1}<a href="?pageno={$pageno-1}&type={$type}"><img src="templates/classic/images/back.gif" align="absmiddle" hspace="5" width="22" height="18"></a>{/if}Page {$pageno} sur {$maxpageno}
		{if $pageno != $maxpageno}<a href="?pageno={$pageno+1}&type={$type}"><img src="templates/classic/images/next.gif" align="absmiddle" hspace="5" width="22" height="18"></a>{/if}
					 
		{$totalresults} {$lang.records}.
	{/if}
	{if $number && !$totalresults}
		{$number} displayed.
	{/if}
</div>
{counter start=0 print=false name=listcount}
{foreach item=gallery from=$list}

{if $count == 0}
    {cycle values="lineeven,lineodd" assign=CLASS print=false}
	<div class="{$CLASS}">
    <table id="tableshow" width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
{/if}
		    <td id="vignette" width="{math equation="floor(100/x)" x=$gallerylistcolumns}%" align="center">
				<table width="100%" cellpadding="0" cellspacing="0" border="0">
					<tr>
						<td>
						<div id="theme" style="display:block;">{if $gallery.title}{$gallery.title}{else}---{/if}</div>
						</td>
					</tr>
					<tr>
						<td align="center" height="{$IMGHEIGHT}">
						{if $gallery.imgurl}
							<div class="img-shadow" align="center">
								<a href="javascript:void(PopupImage('{$gallery.imgurl}'))"><IMG SRC="{$gallery.imgurl}" align=left width="{$IMGWIDTH}" class="cover"></a>
							</div>
						{/if}
						</td>
					</tr>
				</table>
				{if $editable and $cat}
				<table width="100%" cellpadding="0" cellspacing="0" border="0">
					<tr>
						<td>						 
							<form action="gallery.php" method="get">
								<input type="hidden" name="id" value="{$gallery.id}"/>
								<input type="hidden" name="subcat" value="{$gallery.subcat_id}"/>
								<input type="hidden" name="cat" value="{$gallery.cat_id}"/>
								<input type="hidden" name="editgallery" value="1"/>
								<input type="hidden" name="new" value="1"/>                    
								<span class="onglet-admin">
								<input type="submit" style="width:100%;" value="{$lang.edit}"/>
								</span>
							</form>
						</td>
					</tr>
					<tr>
						<td>
							<form action="delete_gallery.php" method="get">
								<input type="hidden" name="id" value="{$gallery.id}"/>
								<span class="onglet-admin">
								<input type="submit" style="width:100%;" value="{$lang.del}" onclick="return(confirm('{$gallery.title|escape:javascript}: {$lang.really_del}?'))"/>
								</span>	
						</form>						
						</td>
					</tr>
				</table>
				{/if}			
			{if $gallerylistcolumns < 4}
			</td>
			<td  id="vignette" width="{math equation="floor(100/x)" x=$listcolumns}%">
			{/if}


{counter assign=count name=listcount}
{if $count == $gallerylistcolumns}
    {counter start=0 print=false name=listcount}
    </tr>
</table>
</div>
{/if}

{/foreach}

{if $count != 0}
    {section name="columnLoop" start=$count loop=$gallerylistcolumns}
        <td class="{$CLASS}">&nbsp;</td>
    {/section}
    </tr>
	</table>
</div>
{/if}
</div>


