Location: PHPKode > projects > Blandware AtLeap Lite - CMS on PHP > atleaplite/smarty/templates/role/list.tpl
{* Smarty template *}
{assign var="buttonsNumber" value="0"}
{if $allowedViewRole}
    {math assign="buttonsNumber" equation="a + 1" a=$buttonsNumber}
{/if}
{if $allowedUpdateRole}
    {math assign="buttonsNumber" equation="a + 1" a=$buttonsNumber}
{/if}
{if $allowedDeleteRole}
    {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="roleList">
    <tr class="filter">
    <form action="{buildUrl}" method="GET">
        {initFilters}
        <td></td>
        <td>
            {textFilter colon='identifier'}
        </td>
        <td>
            {textFilter colon='title'}
        </td>
        <td>
        </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='identifier'}">{message key='role.form.identifier'}</a></th>
        <th><a href="{sortLink colon='title'}">{message key='role.form.title'}</a></th>
        <th><a href="{sortLink colon='admin'}">{message key='role.form.admin'}</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='role.error.nothingSelected'}') && confirmMassDelete('{message escapeSingleQuotes=true key='role.form.confirmMassDelete'}');">
    <input type="hidden" name="action" value="massDeleteRoles">
    {foreach name="mainLoop" from=$data item=role}
    {cycle name="roles" values="oddRow,evenRow" assign=parity}
    <tr class="{$parity}" onMouseOver="onMouseOverRow(this)" onMouseOut="onMouseOutRow(this)">
        <td align="center" valign="center"><input type="checkbox" name="checked[{$role->id}]"></td>
        <td>{$role->identifier|escape}</td>
        <td>{$role->title|escape}</td>
        <td>{$role->isAdminYesno()|escape}</td>
        {if $allowedViewRole}
        <td class="gridIcon">
            <a href="{buildUrl action='viewRole' id=$role->id}" title="{message key='role.form.view'}">
                <img src="images/view.gif" border="0" alt="{message key='role.form.view'}">
            </a>
        </td>
        {/if}
        {if $allowedUpdateRole}
        <td class="gridIcon">
            {if $isAdmin || !$role->isAdmin()}
            <a href="{buildUrl action='callUpdateRole' id=$role->id}" title="{message key='role.form.update'}">
                <img src="images/edit.gif" border="0" alt="{message key='role.form.update'}">
            </a>
            {else}
                <img src="images/editDisabled.gif" border="0" alt="{message key='role.form.update'}">
            {/if}
        </td>
        {/if}
        {if $allowedDeleteRole}
        <td class="gridIcon">
            {if ($isAdmin || !$role->isAdmin())}
            <a href="{buildUrl action=deleteRole id=$role->id}" title="{message key='role.form.delete'}" onClick="return confirm('{message escapeSingleQuotes=true key='role.form.confirmDelete'}');">
                <img src="images/delete.gif" border="0" alt="{message key='role.form.delete'}">
            </a>
            {else}
                <img src="images/deleteDisabled.gif" border="0" alt="{message key='role.form.delete'}">
            {/if}
        </td>
        {/if}
    </tr>
    {/foreach}
    {else}
        <tr>
            <td class="tfoot" colspan="{$totalCells}" align="center">
                <em>{message key='role.message.nothing'}</em>
            </td>
        </tr>
    {/if}
    </form>
</table>

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