{include file="$admintemplatepath/header.template"}
{include file="$admintemplatepath/navigation.template" showOpt=editLinkCategories title=$locale->tr("editLinkCategories")}
<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>
        <div id="list_nav_bar">
            <div id="list_nav_select">

<form id="viewLinkCategories" action="admin.php" method="post">
 <fieldset>
  <legend>{$locale->tr("show_by")}</legend>

   <div class="list_nav_option">
   <label for="search">{$locale->tr("search_terms")}</label>
   <br />
   <input type="text" name="searchTerms" value="{$searchTerms|escape:"html"}" size="15" id="search" />
   </div>   
   
   <div class="list_nav_option">
    <br />
    <input type="hidden" name="op" value="editLinkCategories" />
    <input type="submit" name="Show" value="{$locale->tr("show")}" />
   </div>
  </fieldset> 
 </form> 
 </div>
 <br style="clear:both" />
 </div> 

 <form id="linkCategories" action="admin.php" method="post">
 <div id="list"> 
  {include file="$admintemplatepath/successmessage.template"}
  {include file="$admintemplatepath/errormessage.template"}
 <table id="list" class="info" summary="{$locale->tr("editLinkCategories")}">
  <thead>
   <tr>
    <th><input class="checkbox" type="checkbox" name="all" id="all" value="1" onclick="toggleAllChecks('linkCategories');" /></th>
    <th style="width:75%">{$locale->tr("name")}</th>
    <th style="width:15%">{$locale->tr("links")}</th>
    <th style="width:10%;">{$locale->tr("actions")}</th>
   </tr>
  </thead>
  <tbody> 
  {foreach from=$linkcategories item=category}
  <tr>
   <td align="center"><input class="checkbox" type="checkbox" name="categoryIds[{counter}]" value="{$category->getId()}"/></td>  
   <td class="col_highlighted">
	 {check_perms perm="update_link_category"}<a href="admin.php?op=editLinkCategory&amp;categoryId={$category->getId()}">{/check_perms}{$category->getName()}{check_perms perm="update_link_category"}</a>{/check_perms}
   </td>
   <td>   
     {if $category->getNumLinks() > 0}
      <a href="admin.php?op=editLinks&amp;showCategory={$category->getId()}">({$category->getNumLinks()})</a>
     {else}
      (0)
    {/if}
   </td> 
   <td>
     <div class="list_action_button">
	  {check_perms perm="update_link_category"}	
       <a href="?op=editLinkCategory&amp;categoryId={$category->getId()}"><img src="imgs/admin/icon_edit-16.png" alt="{$locale->tr("edit")}" /></a>
      {/check_perms} 
	  {check_perms perm="update_link_category"}	
       <a href="?op=deleteLinkCategory&amp;categoryId={$category->getId()}"><img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" /></a>
	  {/check_perms}
     </div>
   </td>   
  </tr>
  {/foreach}
 </tbody> 
 </table>
 </div>
 <div id="list_action_bar">
  {adminpager style=list}
  <input type="hidden" name="op" value="deleteLinkCategories"/>
  {check_perms perm="update_link_category"}	
    <input type="submit" name="Delete selected" value="{$locale->tr("delete")}"/>
  {/check_perms}
 </div> 
 </form>

{include file="$admintemplatepath/footernavigation.template"}
{include file="$admintemplatepath/footer.template"}
