{include file="$admintemplatepath/header.template"}
{include file="$admintemplatepath/navigation.template" showOpt=editAdBlocks title=$locale->tr("editAdBlocks")}

<script type="text/javascript">
{literal}
YAHOO.util.Event.addListener( window, "load", function() {
		var t = new Lifetype.UI.TableEffects( "list" );
		t.stripe();
		t.highlightRows();
	});
{/literal}
</script>
            
<form id="adBlocks" action="admin.php" method="post">
 <div id="list">
  {include file="$admintemplatepath/successmessage.template"}
  {include file="$admintemplatepath/errormessage.template"}
 <table class="info" id="info" summary="{$locale->tr("editAdBlocks")}">
  <thead>
   <tr>
    <th><input class="checkbox" type="checkbox" name="all" id="all" value="1" onclick="toggleAllChecks('adBlocks');" /></th>
    <th style="width:40%;">{$locale->tr("name")}</th>
    <th style="width:30%">{$locale->tr("mode")}</th>
    <th style="width:20%">{$locale->tr("position")}</th>
    <th style="width:10%;">{$locale->tr("actions")}</th>
   </tr>
  </thead>
  <tbody>
  {foreach from=$blocks item=block}
    <tr>
	  <td>
		<input class="checkbox" type="checkbox" name="blockIds[{counter}]" id="checks_{$block->getId()}" value="{$block->getId()}" />
	  </td>
	  <td class="col_highlighted">
		<a href="?op=editAdBlock&amp;blockId={$block->getId()}">{$block->getName()}</a>
	  </td>
	  <td>
		{if $block->getMode()==1}{$locale->tr("ad_blogs_all")}{/if}
		{if $block->getMode()==2}{$locale->tr("ad_blogs_include_list")}{/if}
		{if $block->getMode()==3}{$locale->tr("ad_blogs_exclude_list")}{/if}
	  </td>
	  <td>
		{if $block->getPosition()==1}{$locale->tr("ad_position_top")}{/if}
		{if $block->getPosition()==2}{$locale->tr("ad_position_bottom")}{/if}
		{if $block->getPosition()==3}{$locale->tr("ad_position_custom")}{/if}				
	  </td>	
	  <td>
	     <div class="list_action_button">
		 {check_perms perm=manage_ad_blocks}
	       <a href="?op=editAdBlock&amp;blockId={$block->getId()}"><img src="imgs/admin/icon_edit-16.png" alt="{$locale->tr("edit")}" /></a>
	       <a href="?op=deleteAdBlock&amp;blockId={$block->getId()}"><img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" /></a>
		 {/check_perms}
	     </div>		
	  </td>	
	</tr>
  {/foreach}
  </tbody>
</table>	

</fieldset>
<div class="buttons">
 <input type="hidden" name="op" value="deleteAdBlocks" />
 <input type="submit" name="delete" value="{$locale->tr("delete")}" />
</div> 
</form>
{include file="$admintemplatepath/footernavigation.template"}
{include file="$admintemplatepath/footer.template"}