<div class="adminnavi">
  <a href="./index.php"><{$smarty.const._MI_LEGACYRENDER_NAME}></a>
  &raquo;&raquo; <a href="./index.php?action=TplsetList"><{$smarty.const._AD_LEGACYRENDER_LANG_TEMPLATE_MANAGE}></a>
  &raquo;&raquo; <{$smarty.const._AD_LEGACYRENDER_LANG_TEMPLATE_SET_LIST}>
</div>

<h3><{$smarty.const._AD_LEGACYRENDER_LANG_TEMPLATE_SET_LIST}></h3>

<div style="text-align:right;">
<form action="index.php" method="GET"><{$smarty.const._AD_LEGACYRENDER_LANG_SEARCH_TEMPLATE}> : 
  <input type="hidden" name="action" value="TplfileList" />
  <input type="text" name="tpl_file" />
  <input class="formButton" type="submit" value="<{$smarty.const._SEARCH}>" />
</form>
</div>

<{if count($objects) == 1 }>
  <div class="tips"><{$smarty.const._AD_LEGACYRENDER_TIPS_TEMPLATE_MANAGE_1}></div>
<{else}>
  <div class="tips"><{$smarty.const._AD_LEGACYRENDER_TIPS_TEMPLATE_MANAGE_2}></div>
<{/if}>

<{if $actionForm->hasError()}>
  <ul>
    <{foreach item=message from=$actionForm->getErrorMessages()}>
      <li><{$message|escape}></li>
    <{/foreach}>
  </ul>
<{/if}>

<{assign var=tokenName value=$actionForm->getTokenName()}>
<{assign var=token value=$actionForm->getToken()}>

<table class="outer">
  <tr>
    <th><{$smarty.const._AD_LEGACYRENDER_LANG_TPLSET_ID}><br />
      <a href="<{$pageNavi->renderSortUrl()}>&amp;sort=<{$smarty.const.TPLSET_SORT_KEY_TPLSET_ID}>"><img src="<{"icons/up.gif"|theme}>" alt="<{$smarty.const._ASCENDING}>" title="<{$smarty.const._ASCENDING}>" /></a>
      <a href="<{$pageNavi->renderSortUrl()}>&amp;sort=-<{$smarty.const.TPLSET_SORT_KEY_TPLSET_ID}>"><img src="<{"icons/down.gif"|theme}>" alt="<{$smarty.const._DESCENDING}>" title="<{$smarty.const._DESCENDING}>" /></a></th>
    <th><{$smarty.const._AD_LEGACYRENDER_LANG_TPLSET_NAME}><br />
      (<{$smarty.const._AD_LEGACYRENDER_LANG_TPLSET_DESC}>)<br />
      <a href="<{$pageNavi->renderSortUrl()}>&amp;sort=<{$smarty.const.TPLSET_SORT_KEY_TPLSET_NAME}>"><img src="<{"icons/up.gif"|theme}>" alt="<{$smarty.const._ASCENDING}>" title="<{$smarty.const._ASCENDING}>" /></a>
      <a href="<{$pageNavi->renderSortUrl()}>&amp;sort=-<{$smarty.const.TPLSET_SORT_KEY_TPLSET_NAME}>"><img src="<{"icons/down.gif"|theme}>" alt="<{$smarty.const._DESCENDING}>" title="<{$smarty.const._DESCENDING}>" /></a></th>
    <th><{$smarty.const._AD_LEGACYRENDER_LANG_TPLSET_CREDITS}><br />
      <a href="<{$pageNavi->renderSortUrl()}>&amp;sort=<{$smarty.const.TPLSET_SORT_KEY_TPLSET_CREDITS}>"><img src="<{"icons/up.gif"|theme}>" alt="<{$smarty.const._ASCENDING}>" title="<{$smarty.const._ASCENDING}>" /></a>
      <a href="<{$pageNavi->renderSortUrl()}>&amp;sort=-<{$smarty.const.TPLSET_SORT_KEY_TPLSET_CREDITS}>"><img src="<{"icons/down.gif"|theme}>" alt="<{$smarty.const._DESCENDING}>" title="<{$smarty.const._DESCENDING}>" /></a></th>
    <th><{$smarty.const._AD_LEGACYRENDER_LANG_TPLSET_CREATED}><br />
      <a href="<{$pageNavi->renderSortUrl()}>&amp;sort=<{$smarty.const.TPLSET_SORT_KEY_TPLSET_CREATED}>"><img src="<{"icons/up.gif"|theme}>" alt="<{$smarty.const._ASCENDING}>" title="<{$smarty.const._ASCENDING}>" /></a>
      <a href="<{$pageNavi->renderSortUrl()}>&amp;sort=-<{$smarty.const.TPLSET_SORT_KEY_TPLSET_CREATED}>"><img src="<{"icons/down.gif"|theme}>" alt="<{$smarty.const._DESCENDING}>" title="<{$smarty.const._DESCENDING}>" /></a></th>
    <th><{$smarty.const._AD_LEGACYRENDER_LANG_TEMPLATE}></th>
    <th><{$smarty.const._AD_LEGACYRENDER_LANG_CONTROL}></th>
  </tr>
  <{foreach item=obj from=$objects}>
    <{if $activeTemplateSet == $obj->getVar('tplset_name')}>
      <tr class="head" style="background-color:pink;">
    <{else}>
      <tr class="<{cycle values='odd,even'}>">
    <{/if}>
      <td style="text-align:center;"><{$obj->getVar('tplset_id')}></td>
      <td><b><{$obj->getVar('tplset_name')}></b><br /><br />
        <{$obj->getVar('tplset_desc')}></td>
      <td><{$obj->get('tplset_credits')|escape|nl2br}></td>
      <td style="text-align:center;"><{$obj->getVar('tplset_created')|xoops_formattimestamp:l}></td>
      <td>
        <ul>
        <{foreach item=moduletpl from=$obj->mModuleTemplates}>
          <li><a href="./index.php?action=TplfileList&amp;tpl_tplset=<{$obj->get('tplset_name')|escape}>&amp;tpl_module=<{$moduletpl->get('dirname')|escape}>"><{$moduletpl->getVar('name')}></a> (<{$moduletpl->getVar('count')}>)</li>
        <{/foreach}>
        </ul>
      </td>
      <td style="text-align:center;">
        <{if $activeTemplateSet == $obj->getVar('tplset_name')}>
          <img src="<{"icons/active.gif"|theme}>" alt="*active*" title="*active*" /><br /><br />
        <{else}>
          <form action="./index.php?action=TplsetList" method="POST">
            <{xoops_token name=$actionForm->getTokenName() value=$actionForm->getToken()}>
            <{xoops_input type=hidden name=tplset_name value=$obj->get('tplset_name')}>
            <input type="submit" value="<{$smarty.const._SELECT}>" class="formButton" />
          </form>
        <{/if}>
        
<{*        <a href="index.php?action=TplsetDownload&amp;tplset_id=<{$obj->get('tplset_id')}>"><img src="<{"icons/download.gif"|theme}>" alt="*Download*" title="*Download*" /></a> *}>
        <a href="index.php?action=TplsetClone&amp;tplset_id=<{$obj->get('tplset_id')}>"><img src="<{"icons/clone.gif"|theme}>" alt="<{$smarty.const._CLONE}>" title="<{$smarty.const._CLONE}>" /></a>
        <br />
        <{if $obj->getVar('tplset_name') != "default"}>
          <a href="index.php?action=TplsetEdit&amp;tplset_id=<{$obj->get('tplset_id')}>"><img src="<{"icons/edit.gif"|theme}>" alt="<{$smarty.const._EDIT}>" title="<{$smarty.const._EDIT}>" /></a>
          <{if $activeTemplateSet != $obj->getVar('tplset_name')}>
            <a href="index.php?action=TplsetDelete&amp;tplset_id=<{$obj->get('tplset_id')}>"><img src="<{"icons/delete.gif"|theme}>" alt="<{$smarty.const._DELETE}>" title="<{$smarty.const._DELETE}>" /></a>
          <{/if}>
        <{/if}>
      </td>
    </tr>
  <{/foreach}>
</table>

<div class="pagenavi"><{xoops_pagenavi pagenavi=$pageNavi}></div>

<hr />
<h4><{$smarty.const._AD_LEGACYRENDER_LANG_RECENT_MODIFY_FILES}></h4>

<table class="outer">
  <tr>
    <th><{$smarty.const._AD_LEGACYRENDER_LANG_TPL_ID}></th>
    <th><{$smarty.const._AD_LEGACYRENDER_LANG_TPL_MODULE}></th>
    <th><{$smarty.const._AD_LEGACYRENDER_LANG_TPL_TPLSET}></th>
    <th><{$smarty.const._AD_LEGACYRENDER_LANG_TPL_FILE}></th>
    <th><{$smarty.const._AD_LEGACYRENDER_LANG_TPL_LASTMODIFIED}></th>
    <th><{$smarty.const._AD_LEGACYRENDER_LANG_TPL_LASTIMPORTED}></th>
    <th><{$smarty.const._AD_LEGACYRENDER_LANG_TPL_TYPE}></th>
    <th><{$smarty.const._AD_LEGACYRENDER_LANG_CONTROL}></th>
  </tr>
  <{foreach item=obj from=$recentObjects}>
    <{if $obj->getVar('tpl_type') == "block"}>
      <tr class="<{cycle values='odd,even'}>" style="color:#0000ff;">
    <{else}>
      <tr class="<{cycle values='odd,even'}>">
    <{/if}>
      <td><{$obj->getVar('tpl_id')}></td>
      <td><{$obj->getVar('tpl_module')}></td>
      <td><{$obj->getVar('tpl_tplset')}></td>
      <td>
        <b><{$obj->getVar('tpl_file')}></b><br />
        <{$obj->getVar('tpl_desc')}>
      </td>
      <td><{$obj->getVar('tpl_lastmodified')|xoops_formattimestamp:l}></td>
      <td><{$obj->getVar('tpl_lastimported')|xoops_formattimestamp:l}></td>
      <td><{$obj->getVar('tpl_type')}></td>
      <td style="text-align:center;">
        <{if $obj->getVar('tpl_tplset') == "default"}>
          <a href="index.php?action=TplfileView&amp;tpl_id=<{$obj->get('tpl_id')}>"><img src="<{"icons/view.gif"|theme}>" alt="<{$smarty.const._AD_LEGACYRENDER_LANG_VIEW}>" title="<{$smarty.const._AD_LEGACYRENDER_LANG_VIEW}>" /></a>
        <{else}>
          <a href="index.php?action=TplfileEdit&amp;tpl_id=<{$obj->get('tpl_id')}>"><img src="<{"icons/edit.gif"|theme}>" alt="<{$smarty.const._EDIT}>" title="<{$smarty.const._EDIT}>" /></a>
        <{/if}>
      </td>
    </tr>
  <{/foreach}>
  <tr>
    <td class="foot" colspan="8">
      <a href="index.php?action=TplfileList&amp;sort=-7"><{$smarty.const._MORE}></a>
    </td>
  </tr>
</table>
