roleadmin.smarty 1.85 KB
<h2>{i18n}Role Administration{/i18n}</h2>

<p class="descriptiveText"><strong>FIXME</strong> Overview of roles.</p>

{if ($for_edit === false)}

<form action="{$smarty.server.PHP_SELF}" method="POST">
<fieldset>
   <legend>{i18n}Add a Role{/i18n}</legend>
   
   <input type="hidden" name="action" value="createRole" />
   
   {foreach item=oWidget from=$add_fields}
     {$oWidget->render()}
   {/foreach}

   <div class="form_actions">
      <input type="submit" value="{i18n}create new role{/i18n}" />
   </div class="form_actions">
</fieldset>
</form>

{else}

<form action="{$smarty.server.PHP_SELF}" method="POST">
<fieldset>
   <legend>{i18n}Change a role's details{/i18n}</legend>
   
   <input type="hidden" name="action" value="updateRole" />
   <input type="hidden" name="role_id" value="{$edit_role->getId()}" />
   
   {foreach item=oWidget from=$edit_fields}
     {$oWidget->render()}
   {/foreach}
   
   <div class="form_actions">
      <input type="submit" value="{i18n}update role information{/i18n}" />
      <a href="?action=main" class="ktAction ktCancel">{i18n}Cancel{/i18n}</a>
   </div class="form_actions">
</fieldset>
</form>

{/if}

<table class="listing">
<thead>
   <tr>
      <th>{i18n}Role Name{/i18n}</th>
      <th>{i18n}Edit{/i18n}</th>
      <th>{i18n}Delete{/i18n}</th>
   </tr>
</thead>
<tbody>
     {if (count($roles) !== 0)}
     {foreach item=oRole from=$roles}
     <tr>
        <td>{$oRole->getName()}</td>
        <td><a href="?action=editRole&role_id={$oRole->getId()}" class="ktAction ktEdit">{i18n}Edit{/i18n}</a></td>
        <td><a href="?action=deleteRole&role_id={$oRole->getId()}" class="ktAction ktDelete">{i18n}Delete{/i18n}</a></td>
     </tr>   
     {/foreach}
     {else}
     <tr>
        <td class="ktInfo" colspan="3"><p>{i18n}There are currently no roles created within the system.{/i18n}</td>
     </tr>   
     {/if}
</tbody>
</table>