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

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

<div class="tips">
<ul>
<li>
<{$smarty.const._AD_USER_LANG_AVATAR_TOTAL}>: <{$avatarTotal}>&nbsp;&nbsp;<br />
<{$smarty.const._AD_USER_LANG_AVATAR_TYPE_S}>: <{$savatarTotal}>&nbsp;&nbsp;|&nbsp; <{$smarty.const._AD_USER_LANG_AVATAR_TYPE_C}>: <{$cavatarTotal}>
</li>
<li>
<{$smarty.const._AD_USER_TIPS_AVATAR}>
</li>
<li><a href="<{$xoops_url}>/modules/legacy/admin/index.php?action=Help&amp;dirname=user"><{$smarty.const._HELP}></a></li>
</ul>
</div>

<ul class="toptab">
  <li class="add"><a href="index.php?action=AvatarEdit"><{$smarty.const._AD_USER_LANG_AVATAR_NEW}></a></li>
  <li class="archive"><a href="index.php?action=AvatarUpload"><{$smarty.const._AD_USER_LANG_AVATAR_UPLOAD}></a></li>
</ul>

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

<div>
<form action="./index.php" method="get">
  <input type="hidden" name="action" value="AvatarList" />
  <{$smarty.const._SEARCH}> : 
  <input type="text" name="search" value="<{$filterForm->mKeyword}>" />
  <{$smarty.const._AD_USER_LANG_AVATAR_TYPE}> : 
  <select name="option_field">
    <option value="all" <{if $filterForm->mOptionField == 'all'}>selected="selected"<{/if}>><{$smarty.const._ALL}></option>
    <option value="system" <{if $filterForm->mOptionField == 'system'}>selected="selected"<{/if}>><{$smarty.const._AD_USER_LANG_AVATAR_TYPE_S}></option>
    <option value="custom" <{if $filterForm->mOptionField == 'custom'}>selected="selected"<{/if}>><{$smarty.const._AD_USER_LANG_AVATAR_TYPE_C}></option>
  </select>
  <{$smarty.const._AD_USER_LANG_AVATAR_DISPLAY}> : 
  <select name="option_field2">
    <option value="all" <{if $filterForm->mOptionField2 == 'all'}>selected="selected"<{/if}>><{$smarty.const._ALL}></option>
    <option value="visible" <{if $filterForm->mOptionField2 == 'visible'}>selected="selected"<{/if}>><{$smarty.const._YES}></option>
    <option value="invisible" <{if $filterForm->mOptionField2 == 'invisible'}>selected="selected"<{/if}>><{$smarty.const._NO}></option>
  </select>
  <{$smarty.const._AD_USER_LANG_AVATAR_MIMETYPE}> : 
  <select name="option_field3">
    <option value="all" <{if $filterForm->mOptionField3 == 'all'}>selected="selected"<{/if}>><{$smarty.const._ALL}></option>
    <option value="gif" <{if $filterForm->mOptionField3 == 'gif'}>selected="selected"<{/if}>>image/gif</option>
    <option value="png" <{if $filterForm->mOptionField3 == 'png'}>selected="selected"<{/if}>>image/png</option>
    <option value="jpeg" <{if $filterForm->mOptionField3 == 'jpeg'}>selected="selected"<{/if}>>image/jpeg</option>
  </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>

<form name="avatarlistform" method="post" action="./index.php?action=AvatarList">
  <{xoops_token form=$actionForm}>
<table class="outer">
  <tr>
    <th><{$smarty.const._MD_USER_LANG_AVATAR_ID}>
      <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=<{$smarty.const.AVATAR_SORT_KEY_AVATAR_ID}>"><img src="<{"icons/up.png"|theme}>" alt="<{$smarty.const._ASCENDING}>" title="<{$smarty.const._ASCENDING}>" /></a>
      <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=-<{$smarty.const.AVATAR_SORT_KEY_AVATAR_ID}>"><img src="<{"icons/down.png"|theme}>" alt="<{$smarty.const._DESCENDING}>" title="<{$smarty.const._DESCENDING}>" /></a></th>
    <th><{$smarty.const._AD_USER_LANG_AVATAR_FILE}>
      ( <{$smarty.const._AD_USER_LANG_AVATAR_NAME}>
      <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=<{$smarty.const.AVATAR_SORT_KEY_AVATAR_NAME}>"><img src="<{"icons/up.png"|theme}>" alt="<{$smarty.const._ASCENDING}>" title="<{$smarty.const._ASCENDING}>" /></a>
      <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=-<{$smarty.const.AVATAR_SORT_KEY_AVATAR_NAME}>"><img src="<{"icons/down.png"|theme}>" alt="<{$smarty.const._DESCENDING}>" title="<{$smarty.const._DESCENDING}>" /></a> )</th>
    <th><{$smarty.const._AD_USER_LANG_AVATAR_MIMETYPE}>
      <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=<{$smarty.const.AVATAR_SORT_KEY_AVATAR_MIMETYPE}>"><img src="<{"icons/up.png"|theme}>" alt="<{$smarty.const._ASCENDING}>" title="<{$smarty.const._ASCENDING}>" /></a>
      <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=-<{$smarty.const.AVATAR_SORT_KEY_AVATAR_MIMETYPE}>"><img src="<{"icons/down.png"|theme}>" alt="<{$smarty.const._DESCENDING}>" title="<{$smarty.const._DESCENDING}>" /></a></th>
    <th><{$smarty.const._AD_USER_LANG_AVATAR_CREATED}>
      <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=<{$smarty.const.AVATAR_SORT_KEY_AVATAR_CREATED}>"><img src="<{"icons/up.png"|theme}>" alt="<{$smarty.const._ASCENDING}>" title="<{$smarty.const._ASCENDING}>" /></a>
      <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=-<{$smarty.const.AVATAR_SORT_KEY_AVATAR_CREATED}>"><img src="<{"icons/down.png"|theme}>" alt="<{$smarty.const._DESCENDING}>" title="<{$smarty.const._DESCENDING}>" /></a></th>
    <th><{$smarty.const._AD_USER_LANG_AVATAR_DISPLAY}>
      <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=<{$smarty.const.AVATAR_SORT_KEY_AVATAR_DISPLAY}>"><img src="<{"icons/up.png"|theme}>" alt="<{$smarty.const._ASCENDING}>" title="<{$smarty.const._ASCENDING}>" /></a>
      <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=-<{$smarty.const.AVATAR_SORT_KEY_AVATAR_DISPLAY}>"><img src="<{"icons/down.png"|theme}>" alt="<{$smarty.const._DESCENDING}>" title="<{$smarty.const._DESCENDING}>" /></a></th>
    <th><{$smarty.const._AD_USER_LANG_AVATAR_WEIGHT}>
      <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=<{$smarty.const.AVATAR_SORT_KEY_AVATAR_WEIGHT}>"><img src="<{"icons/up.png"|theme}>" alt="<{$smarty.const._ASCENDING}>" title="<{$smarty.const._ASCENDING}>" /></a>
      <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=-<{$smarty.const.AVATAR_SORT_KEY_AVATAR_WEIGHT}>"><img src="<{"icons/down.png"|theme}>" alt="<{$smarty.const._DESCENDING}>" title="<{$smarty.const._DESCENDING}>" /></a></th>
    <th><{$smarty.const._AD_USER_LANG_AVATAR_TYPE}>
      <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=<{$smarty.const.AVATAR_SORT_KEY_AVATAR_TYPE}>"><img src="<{"icons/up.png"|theme}>" alt="<{$smarty.const._ASCENDING}>" title="<{$smarty.const._ASCENDING}>" /></a>
      <a href="<{$pageNavi->renderUrlForSort()}>&amp;sort=-<{$smarty.const.AVATAR_SORT_KEY_AVATAR_TYPE}>"><img src="<{"icons/down.png"|theme}>" alt="<{$smarty.const._DESCENDING}>" title="<{$smarty.const._DESCENDING}>" /></a></th>
    <th><{$smarty.const._AD_USER_LANG_AVATAR_USING_COUNT}></th>
    <th><{$smarty.const._DELETE}><br />
      <input name="allbox" id="allbox" onclick="with(document.avatarlistform){for(i=0;i<length;i++){if(elements[i].type=='checkbox'&&elements[i].disabled==false&&elements[i].name.indexOf('delete')>=0){elements[i].checked=this.checked;}}}" type="checkbox" value="Check All" /></th>
    <th><{$smarty.const._AD_USER_LANG_CONTROL}></th>
  </tr>
  <{foreach item=obj from=$objects}>
    <{if $obj->getShow('avatar_display') == 1}>
      <tr class="<{cycle values='odd,even'}> active">
    <{else}>
      <tr class="<{cycle values='odd,even'}> inactive">
    <{/if}>
      <td class="user_list_id"><{$obj->getShow('avatar_id')}></td>
      <td class="user_list_image">
        <img src="<{$smarty.const.XOOPS_UPLOAD_URL}>/<{$obj->getShow('avatar_file')}>" alt="<{$obj->getShow('avatar_name')}>" title="<{$obj->getShow('avatar_name')}>" />
        <div class="user_list_imagetitle"><input type="text" size="12" name="name[<{$obj->getShow('avatar_id')}>]" value="<{$obj->getShow('avatar_name')}>" /></div>
      <td class="user_list_type"><{$obj->getShow('avatar_mimetype')}></td>
      <td class="user_list_date"><{$obj->get('avatar_created')|xoops_formattimestamp:l}></td>
      <td class="user_list_select"><input type="checkbox" name="display[<{$obj->getShow('avatar_id')}>]" value="1" <{if $obj->getShow('avatar_display')}>checked="checked"<{/if}> /></td>
      <td class="user_list_number"><input type="text" size="4" maxlength="6" name="weight[<{$obj->getShow('avatar_id')}>]" value="<{$obj->getShow('avatar_weight')}>" class=user_list_number /></td>
      <td class="user_list_type">
        <{if $obj->getShow('avatar_type') == "C"}>
          <{$smarty.const._AD_USER_LANG_AVATAR_TYPE_C}>
        <{elseif $obj->getShow('avatar_type') == "S"}>
          <{$smarty.const._AD_USER_LANG_AVATAR_TYPE_S}>
        <{/if}>
      </td>
      <td class="user_list_order"><{$obj->getUsingCount()|xoops_escape}></td>
      <td class="user_list_select"><input type="checkbox" name="delete[<{$obj->getShow('avatar_id')}>]" value="1" /></td>
      <td class="user_list_control">
        <a href="index.php?action=AvatarEdit&amp;avatar_id=<{$obj->getShow('avatar_id')}>"><img src="<{"icons/edit.png"|theme}>" alt="<{$smarty.const._EDIT}>" title="<{$smarty.const._EDIT}>" /></a>
        <a href="index.php?action=AvatarDelete&amp;avatar_id=<{$obj->getShow('avatar_id')}>"><img src="<{"icons/delete.png"|theme}>" alt="<{$smarty.const._DELETE}>" title="<{$smarty.const._DELETE}>" /></a>
      </td>
    </tr>
  <{/foreach}>
    <tr>
      <td colspan="10" class="foot">
        <input type="submit" value="<{$smarty.const._SUBMIT}>" class="formButton" />
      </td>
    </tr>
</table>
</form>

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