Location: PHPKode > projects > Blandware AtLeap Lite - CMS on PHP > atleaplite/smarty/templates/user/list.tpl
{* Smarty template *}
{assign var="buttonsNumber" value="0"}
{if $allowedViewUser}
    {math assign="buttonsNumber" equation="a + 1" a=$buttonsNumber}
{/if}
{if $allowedUpdateUser}
    {math assign="buttonsNumber" equation="a + 1" a=$buttonsNumber}
{/if}
{if $allowedDeleteUser}
    {math assign="buttonsNumber" equation="a + 1" a=$buttonsNumber}
{/if}
{assign var="columnsNumber" value=3}
{math assign="totalCells" equation="x+y+1" x=$columnsNumber y=$buttonsNumber}
<table border="0" cellpadding="0" cellspacing="0" class="grid" id="userList">
    <tr class="filter">
    <form action="{buildUrl}" method="GET">
        {initFilters}
        <td></td>
        <td>
            {textFilter colon='login'}
        </td>
        <td>
            {textFilter colon='lastName'}
        </td>
        <td>
            {filterValue colon='roleId' assign='roleIdFilter' escape=false}
            <select name="{filterName colon='roleId'}" class="form_filter">
                {html_options options=$roles selected=$roleIdFilter}
            </select>
        </td>
        <td align="center" colspan="{$buttonsNumber}"><input type="submit" value="{message key='common.button.filter'}" class="form_filter_button noTopBottomMargin"></td>
    </form>
    </tr>
    
    <tr> 
        <th class="selectAllButtonCell"><input type="button" value="{message key='common.button.selectAll'}" onClick="checkAll(document.forms['massDeleteForm']);" class="form_button noTopBottomMargin"></th>
        <th><a href="{sortLink colon='login'}">{message key='user.form.login'}</a></th>
        <th><a href="{sortLink colon='lastName'}">{message key='user.form.lastName'}</a></th>
        <th><a href="{sortLink colon='roleId'}">{message key='user.form.role'}</a></th>
        <th colspan="{$buttonsNumber}"></th>
    </tr>
    {if !$dataIsEmpty}
    <form name="massDeleteForm" action="index.php" method="GET" onSubmit="return validateMassDelete(document.forms['massDeleteForm'], '{message escapeSingleQuotes=true key='user.error.nothingSelected'}') && confirmMassDelete('{message escapeSingleQuotes=true key='user.form.confirmMassDelete'}');">
    <input type="hidden" name="action" value="massDeleteUsers">
    {foreach name="mainLoop" from=$data item=user}
    {cycle name="users" values="oddRow,evenRow" assign=parity}
    <tr class="{$parity}" onMouseOver="onMouseOverRow(this)" onMouseOut="onMouseOutRow(this)">
        <td align="center" valign="center"><input type="checkbox" name="checked[{$user->id}]"></td>
        <td>{$user->login|escape}</td>
        <td>{$user->last_name|escape}</td>
        <td>{$user->getRoleTitle()|escape}</td>
        {if $allowedViewUser}
        <td class="gridIcon">
            <a href="{buildUrl action='viewUser' id=$user->id}" title="{message key='user.form.view'}">
                <img src="images/view.gif" border="0" alt="{message key='user.form.view'}">
            </a>
        </td>
        {/if}
        {if $allowedUpdateUser}
        <td class="gridIcon">
            {if $isAdmin || !$user->isAdmin()}
            <a href="{buildUrl action='callUpdateUser' id=$user->id}" title="{message key='user.form.update'}">
                <img src="images/edit.gif" border="0" alt="{message key='user.form.update'}">
            </a>
            {else}
                <img src="images/editDisabled.gif" border="0" alt="{message key='user.form.update'}">
            {/if}
        </td>
        {/if}
        {if $allowedDeleteUser}
        <td class="gridIcon">
            {if ($isAdmin || !$user->isAdmin()) && !$user->me()}
            <a href="{buildUrl action=deleteUser id=$user->id}" title="{message key='user.form.delete'}" onClick="return confirm('{message escapeSingleQuotes=true key='user.form.confirmDelete'}');">
                <img src="images/delete.gif" border="0" alt="{message key='user.form.delete'}">
            </a>
            {else}
                <img src="images/deleteDisabled.gif" border="0" alt="{message key='user.form.delete'}">
            {/if}
        </td>
        {/if}
    </tr>
    {/foreach}
    {else}
        <tr>
            <td class="tfoot" colspan="{$totalCells}" align="center">
                <em>{message key='user.message.nothing'}</em>
            </td>
        </tr>
    {/if}
    </form>
</table>


{include file="after_grid.tpl"}
Return current item: Blandware AtLeap Lite - CMS on PHP