Location: PHPKode > projects > Jarida > jarida_1.0/templates/default/admin/smilie.tpl
{* if the $_get['do'] is empty we are dealing with  
the display of all smilies with links to edit and delete *}



{if !$smarty.get.do}
<div class="admin_heading">
<a href="{$smarty.server.SCRIPT_NAME}?do=add">{$lang.smilie_add_link}</a>
</div>

<div class="admin_content">
<table width="100%" cellspacing="2px">
<tr class="admin_title"><td>{$lang.smilie}</td><td>{$lang.smilie_code}</td>
<td>{$lang.edit}</td><td>{$lang.delete}</td></tr>
{section name=smilies loop=$smilies}
<tr class="{cycle values="admin_row1, admin_row2"}">
<td>{html_image file="../img/`$smilies[smilies].file`"}</td>
<td>{$smilies[smilies].code}</td>
<td><a href="{$smarty.server.SCRIPT_NAME}?do=edit&amp;id={$smilies[smilies].id}">
{$lang.edit}</a></td>
<td><a href="{$smarty.server.SCRIPT_NAME}?do=delete&amp;id={$smilies[smilies].id}">
{$lang.delete}</a></td></tr>
{/section}
</table>
</div>
{/if}


{* if the $_get['do'] == "add" we are dealing with  
an addition of a new smilie *}

{if $smarty.get.do == "add"}
<div class="admin_heading">
{$lang.smilie_add_head}
</div>

{* If the user has hit submit we update the DB *}
{if $smarty.post.submit}
<div class="admin_confirm">
{$confirm_message}
</div>

{* Otherwise we display the form to fill *}
{else}
<div class="admin_form">
<form name="Form" method="post" action="{$smarty.server.SCRIPT_NAME}?do=add" ENCTYPE="multipart/form-data">
<table cellspacing="0" cellpadding="0" width="100%">
<tr><td class="admin_form_label">{$lang.smilie_code}:</td>
<td class="admin_form_input"><input type="text" name="code" size="50" /></td></tr>
<tr><td class="admin_form_label">{$lang.smilie_file}:</td>
<td class="admin_form_input"><input type="file" name="file" size="50" /></td></tr>
<tr><td colspan="2" align="center"><input type="submit" name="submit" value="{$lang.submit}" /></td></tr>
</table>
</form>
</div>

{/if}

{/if}


{* if the $_get['do'] == "edit" we are dealing with  
an editing of a smilie *}

{if $smarty.get.do == "edit"}
<div class="admin_heading">
{$lang.smilie_edit_head}
</div>
{if $smarty.post.submit}
<div class="admin_confirm">
{$confirm_message}
</div>
{else}
<div class="admin_form">
<form name="Form" method="post" action="{$smarty.server.SCRIPT_NAME}?do=edit">
<table cellspacing="0" cellpadding="0" width="100%">
<tr><td class="admin_form_label">{$lang.smilie_code}:</td>
<td class="admin_form_input"><input type="text" name="code" size="50" value="{$smilie.code}" /></td></tr>
<input type="hidden" name="id" value="{$smarty.get.id}" />
<tr><td colspan="2" align="center"><input type="submit" name="submit" value="{$lang.submit}" /></td></tr>
</table>
</form>
</div>
{/if}
{/if}

{* if the $_get['do'] == "delete" we are dealing with  
the deleting of a smilie *}

{if $smarty.get.do == "delete"}

<div class="admin_heading">
{$lang.smilie_delete_head}
</div>

<div class="admin_confirm">
{$confirm_message}
</div>

{/if}
Return current item: Jarida