<div class="adminnavi">
  <a href="./index.php"><{$smarty.const._MI_LEGACY_NAME}></a>
  &raquo;&raquo; <span class="adminnaviTitle"><a href="./index.php?action=BlockList"><{$smarty.const._MI_LEGACY_MENU_BLOCKLIST}></a></span>
</div>

<h3 class="admintitle"><{$smarty.const._MI_LEGACY_MENU_BLOCKLIST}></h3>

<div class="tips">
<ul>
<li>
<{$smarty.const._AD_LEGACY_LANG_BLOCK_TOTAL}>: <{$BlockTotal}><br />
<{$smarty.const._AD_LEGACY_LANG_BLOCK_ACTIVETOTAL}>: <{$ActiveBlockTotal}>&nbsp;&nbsp;|&nbsp; <{$smarty.const._AD_LEGACY_LANG_BLOCK_INSTALLEDTOTAL}>: <{$ActiveInstalledBlockTotal}>&nbsp;&nbsp;|&nbsp; <{$smarty.const._AD_LEGACY_LANG_BLOCK_UNINSTALLEDTOTAL}>: <{$ActiveUninstalledBlockTotal}><br />
<{$smarty.const._AD_LEGACY_LANG_BLOCK_INACTIVETOTAL}>: <{$InactiveBlockTotal}>&nbsp;&nbsp;|&nbsp; <{$smarty.const._AD_LEGACY_LANG_BLOCK_INSTALLEDTOTAL}>: <{$InactiveInstalledBlockTotal}>&nbsp;&nbsp;|&nbsp; <{$smarty.const._AD_LEGACY_LANG_BLOCK_UNINSTALLEDTOTAL}>: <{$InactiveUninstalledBlockTotal}>
</li>
<li>
<{$smarty.const._AD_LEGACY_TIPS_ADD_CUSTOM_BLOCK}>
</li>
<li>
<{$smarty.const._AD_LEGACY_TIPS_BLOCK}>
</li>
<li><a href="<{$xoops_url}>/modules/legacy/admin/index.php?action=Help&amp;dirname=legacy"><{$smarty.const._HELP}></a></li>
</ul>
</div>

<ul class="toptab">
  <li class="addBlock"><a href="index.php?action=BlockInstallList"><{$smarty.const._AD_LEGACY_LANG_BLOCK_INSTALL}></a></li>
  <li class="addBlockCustom"><a href="index.php?action=CustomBlockEdit"><{$smarty.const._AD_LEGACY_LANG_ADD_CUSTOM_BLOCK}></a></li>
</ul>

<div>
<form action="./index.php" method="get">
  <input type="hidden" name="action" value="BlockList" />
  <{$smarty.const._SEARCH}> : 
  <input type="text" name="search" value="<{$filterForm->mKeyword}>" />
  <{$smarty.const._AD_LEGACY_LANG_MOD_NAME}> : 
  <select name="dirname">
    <option value="0"><{$smarty.const._ALL}></option>
    <{foreach from=$modules item=module}>
      <{if is_object($filterForm->mModule)}>
        <option value="<{$module->getShow('dirname')}>" <{if $filterForm->mModule->get('dirname') == $module->get('dirname')}>selected="selected"<{/if}> >
        <{$module->getShow('name')}></option>
      <{else}>
        <option value="<{$module->getShow('dirname')}>">
        <{$module->getShow('name')}></option>
      <{/if}>
    <{/foreach}>
     <option value="-1"  <{if $filterForm->mModule == "cblock"}>selected="selected"<{/if}>><{$smarty.const._AD_LEGACY_LANG_CUSTOMBLOCK_EDIT}></option>
  </select>
  <{$smarty.const._AD_LEGACY_LANG_SIDE}> :
	<select name="option_field">
	<{if $filterForm->mOptionField == "all"}> 
	<option value="all" selected="selected"><{$smarty.const._ALL}></option>
	<{foreach from=$columnSideArr item=columnSide}>
	<option value="<{$columnSide->getShow('id')}>">	<{$columnSide->getShow('name')}></option>
	<{/foreach}>
	<{else}>
	<option value="all"><{$smarty.const._ALL}></option>
	<{foreach from=$columnSideArr item=columnSide}>
	<option value="<{$columnSide->getShow('id')}>" <{if $filterForm->mOptionField == $columnSide->getShow('id')}>selected="selected"<{/if}> >
	<{$columnSide->getShow('name')}></option>
	<{/foreach}>
	<{/if}>
	</select>
  <{$smarty.const._VIEW}> : 
  <select name="perpage">
    <option value="<{$smarty.const.XCUBE_PAGENAVI_DEFAULT_PERPAGE}>"><{$smarty.const._SELECT}></option>
    <{foreach item=page from=$pageArr}>
      <{if $pageNavi->mPerpage == $page && $page != 0}>
        <option value="<{$page}>" selected="selected"><{$page}></option>
      <{elseif $pageNavi->mPerpage == $page && $page == 0}>
        <option value="<{$page}>" selected="selected"><{$smarty.const._ALL}></option>
      <{elseif $pageNavi->mPerpage != $page && $page == 0}>
        <option value="<{$page}>"><{$smarty.const._ALL}></option>
      <{else}>
        <option value="<{$page}>"><{$page}></option>
      <{/if}>
    <{/foreach}>
  </select>
  <input class="formButton" type="submit" value="<{$smarty.const._SUBMIT}>" />
</form>
</div>

<{if $actionForm->hasError()}>
<div class="error">
  <ul>
    <{foreach item=message from=$actionForm->getErrorMessages()}>
      <li><{$message|xoops_escape}></li>
    <{/foreach}>
  </ul>
</div>
<{/if}>

<form name="blockform" method="post" action="./index.php?action=BlockList">
  <{xoops_token form=$actionForm}>
  <table class="outer">
    <tr>
      <th><{$smarty.const._AD_LEGACY_LANG_BID}>
        <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=<{$smarty.const.NEWBLOCKS_SORT_KEY_BID}>"><img src="<{"icons/up.png"|theme}>" alt="<{$smarty.const._ASCENDING}>" title="<{$smarty.const._ASCENDING}>" /></a>
        <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=-<{$smarty.const.NEWBLOCKS_SORT_KEY_BID}>"><img src="<{"icons/down.png"|theme}>" alt="<{$smarty.const._DESCENDING}>" title="<{$smarty.const._DESCENDING}>" /></a></th>
      <th><{$smarty.const._AD_LEGACY_LANG_BLOCK_MOD}>
        <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=<{$smarty.const.NEWBLOCKS_SORT_KEY_MID}>"><img src="<{"icons/up.png"|theme}>" alt="<{$smarty.const._ASCENDING}>" title="<{$smarty.const._ASCENDING}>" /></a>
        <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=-<{$smarty.const.NEWBLOCKS_SORT_KEY_MID}>"><img src="<{"icons/down.png"|theme}>" alt="<{$smarty.const._DESCENDING}>" title="<{$smarty.const._DESCENDING}>" /></a></th>
      <th><{$smarty.const._AD_LEGACY_LANG_TITLE}>
        <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=<{$smarty.const.NEWBLOCKS_SORT_KEY_TITLE}>"><img src="<{"icons/up.png"|theme}>" alt="<{$smarty.const._ASCENDING}>" title="<{$smarty.const._ASCENDING}>" /></a>
        <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=-<{$smarty.const.NEWBLOCKS_SORT_KEY_TITLE}>"><img src="<{"icons/down.png"|theme}>" alt="<{$smarty.const._DESCENDING}>" title="<{$smarty.const._DESCENDING}>" /></a></th>
      <th><{$smarty.const._AD_LEGACY_LANG_SIDE}>
        <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=<{$smarty.const.NEWBLOCKS_SORT_KEY_SIDE}>"><img src="<{"icons/up.png"|theme}>" alt="<{$smarty.const._ASCENDING}>" title="<{$smarty.const._ASCENDING}>" /></a>
        <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=-<{$smarty.const.NEWBLOCKS_SORT_KEY_SIDE}>"><img src="<{"icons/down.png"|theme}>" alt="<{$smarty.const._DESCENDING}>" title="<{$smarty.const._DESCENDING}>" /></a><br />
        <{$smarty.const._AD_LEGACY_LANG_LCR}></th>
      <th><{$smarty.const._AD_LEGACY_LANG_WEIGHT}>
        <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=<{$smarty.const.NEWBLOCKS_SORT_KEY_WEIGHT}>"><img src="<{"icons/up.png"|theme}>" alt="<{$smarty.const._ASCENDING}>" title="<{$smarty.const._ASCENDING}>" /></a>
        <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=-<{$smarty.const.NEWBLOCKS_SORT_KEY_WEIGHT}>"><img src="<{"icons/down.png"|theme}>" alt="<{$smarty.const._DESCENDING}>" title="<{$smarty.const._DESCENDING}>" /></a></th>
      <th><{$smarty.const._AD_LEGACY_LANG_BCACHETIME}>
        <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=<{$smarty.const.NEWBLOCKS_SORT_KEY_BCACHETIME}>"><img src="<{"icons/up.png"|theme}>" alt="<{$smarty.const._ASCENDING}>" title="<{$smarty.const._ASCENDING}>" /></a>
        <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=-<{$smarty.const.NEWBLOCKS_SORT_KEY_BCACHETIME}>"><img src="<{"icons/down.png"|theme}>" alt="<{$smarty.const._DESCENDING}>" title="<{$smarty.const._DESCENDING}>" /></a></th>
      <th><{$smarty.const._AD_LEGACY_LANG_LAST_MODIFIED}>
        <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=<{$smarty.const.NEWBLOCKS_SORT_KEY_LAST_MODIFIED}>"><img src="<{"icons/up.png"|theme}>" alt="<{$smarty.const._ASCENDING}>" title="<{$smarty.const._ASCENDING}>" /></a>
        <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=-<{$smarty.const.NEWBLOCKS_SORT_KEY_LAST_MODIFIED}>"><img src="<{"icons/down.png"|theme}>" alt="<{$smarty.const._DESCENDING}>" title="<{$smarty.const._DESCENDING}>" /></a></th>
      <th><{$smarty.const._AD_LEGACY_LANG_UNINSTALL}><br />
      <input name="allbox" id="allbox" onclick="with(document.blockform){for(i=0;i<length;i++){if(elements[i].type=='checkbox'&&elements[i].disabled==false&&elements[i].name.indexOf('uninstall')>=0){elements[i].checked=this.checked;}}}" type="checkbox" value="Check All" /></th>    
      <th><{$smarty.const._AD_LEGACY_LANG_CONTROL}></th>
    </tr>
    <{foreach item=obj from=$objects}>
      <tr class="<{cycle values='odd,even'}>">
        <td class="legacy_list_id"><{$obj->getShow('bid')}></td>
        <td class="legacy_list_name">
          <{if $obj->mModule}>
            <span class="legacy_blocktype_module"><{$obj->mModule->getShow('name')}></span>
          <{else}>
            <span class="legacy_blocktype_custom">
            <{if $obj->get('c_type') == "H" }><{$smarty.const._AD_LEGACY_LANG_CUSTOM_HTML}>
            <{elseif $obj->get('c_type') == "P"}><{$smarty.const._AD_LEGACY_LANG_CUSTOM_PHP}>
            <{elseif $obj->get('c_type') == "S"}><{$smarty.const._AD_LEGACY_LANG_CUSTOM_WITH_SMILIES}>
            <{elseif $obj->get('c_type') == "T"}><{$smarty.const._AD_LEGACY_LANG_CUSTOM_WITHOUT_SMILIES}>
            <{/if}>
            </span>
          <{/if}>
        </td>
        <td class="legacy_list_title"><{xoops_input type=text name=title key=$obj->get('bid') value=$obj->get('title') size=14 maxlength=255}></td>
        <td class="legacy_blockside">
        <{strip}>
          <{if $obj->get('side') == 0}>
            <div class="legacy_blocksideInput active"><{xoops_input type=radio name=side key=$obj->get('bid') value=0 default=$obj->get('side')}></div>
          <{else}>
            <div class="legacy_blocksideInput inactive"><{xoops_input type=radio name=side key=$obj->get('bid') value=0 default=$obj->get('side')}></div>
          <{/if}>
          <div class="legacy_blockside_separator">-</div>
          <{if $obj->get('side') == 3}>
            <div class="legacy_blocksideInput active"><{xoops_input type=radio name=side key=$obj->get('bid') value=3 default=$obj->get('side')}></div>
          <{else}>
            <div class="legacy_blocksideInput inactive"><{xoops_input type=radio name=side key=$obj->get('bid') value=3 default=$obj->get('side')}></div>
          <{/if}>
          <{if $obj->get('side') == 5}>
            <div class="legacy_blocksideInput active"><{xoops_input type=radio name=side key=$obj->get('bid') value=5 default=$obj->get('side')}></div>
          <{else}>
            <div class="legacy_blocksideInput inactive"><{xoops_input type=radio name=side key=$obj->get('bid') value=5 default=$obj->get('side')}></div>
          <{/if}>
          <{if $obj->get('side') == 4}>
            <div class="legacy_blocksideInput active"><{xoops_input type=radio name=side key=$obj->get('bid') value=4 default=$obj->get('side')}></div>
          <{else}>
            <div class="legacy_blocksideInput inactive"><{xoops_input type=radio name=side key=$obj->get('bid') value=4 default=$obj->get('side')}></div>
          <{/if}>
          <div class="legacy_blockside_separator">-</div>
          <{if $obj->get('side') == 1}>
            <div class="legacy_blocksideInput active"><{xoops_input type=radio name=side key=$obj->get('bid') value=1 default=$obj->get('side')}></div>
          <{else}>
            <div class="legacy_blocksideInput inactive"><{xoops_input type=radio name=side key=$obj->get('bid') value=1 default=$obj->get('side')}></div>
          <{/if}>
        <{/strip}>
        </td>
        <td class="legacy_list_select">
          <{xoops_input type=text name=weight size=4 key=$obj->get('bid') value=$obj->get('weight') class=legacy_list_number}>
        </td>
        <td class="legacy_list_select">
          <select name="bcachetime[<{$obj->getShow('bid')}>]">
            <{assign var="bid" value=$obj->getShow('bid') }>
            <{xoops_optionsArray id="bcachetime[`$bid`]" from=$cachetimeArr value=cachetime label=label default=$obj->get('bcachetime')}>
          </select>
        </td>
        <td class="legacy_list_date"><{$obj->getShow('last_modified')|xoops_formattimestamp:l}></td>
        <td class="legacy_list_select"><input type="checkbox" name="uninstall[<{$obj->get('bid')}>]" value="1" /></td>
        <td class="legacy_list_control">
          <{if $obj->get('block_type') == 'C'}>
            <a href="./index.php?action=CustomBlockEdit&amp;bid=<{$obj->getShow('bid')}>"><img src="<{"icons/block_edit.png"|theme}>" alt="<{$smarty.const._EDIT}>" title="<{$smarty.const._EDIT}>" /></a>
          <{else}>
            <a href="./index.php?action=BlockEdit&amp;bid=<{$obj->getShow('bid')}>"><img src="<{"icons/block_edit.png"|theme}>" alt="<{$smarty.const._EDIT}>" title="<{$smarty.const._EDIT}>" /></a>
          <{/if}>
          <a href="./index.php?action=BlockUninstall&amp;bid=<{$obj->getShow('bid')}>"><img src="<{"icons/block_remove.png"|theme}>" alt="<{$smarty.const._AD_LEGACY_LANG_UNINSTALL}>" title="<{$smarty.const._AD_LEGACY_LANG_UNINSTALL}>" /></a>
        </td>
      </tr>
    <{/foreach}>
    <tr>
      <td colspan="11" class="foot">
        <input type="submit" value="<{$smarty.const._SUBMIT}>" class="formButton" />
      </td>
    </tr>
  </table>
</form>

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