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



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

<div class="admin_content">
<table width="100%" cellspacing="2px">
<tr class="admin_title"><td>{$lang.link_name}</td><td>{$lang.link_url}</td>
<td>{$lang.edit}</td><td>{$lang.delete}</td></tr>
{section name=links loop=$links}
<tr class="{cycle values="admin_row1, admin_row2"}">
<td>{$links[links].name}</td><td>{$links[links].url}</td>
<td><a href="{$smarty.server.SCRIPT_NAME}?do=edit&amp;id={$links[links].id}">
{$lang.edit}</a></td>
<td><a href="{$smarty.server.SCRIPT_NAME}?do=delete&amp;id={$links[links].id}">
{$lang.delete}</a></td></tr>
{/section}
</table>
</div>
{/if}


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

{if $smarty.get.do == "add"}
<div class="admin_heading">
{$lang.link_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">
<table cellspacing="0" cellpadding="0" width="100%">
<tr><td class="admin_form_label">{$lang.link_name}:</td>
<td class="admin_form_input"><input type="text" name="name" size="50" /></td></tr>
<tr><td class="admin_form_label">{$lang.link_url}:</td>
<td class="admin_form_input"><input type="text" name="url" 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 web link *}

{if $smarty.get.do == "edit"}
<div class="admin_heading">
{$lang.link_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.link_name}:</td>
<td class="admin_form_input"><input type="text" name="name" size="50" value="{$link.name}" /></td></tr>
<tr><td class="admin_form_label">{$lang.link_url}:</td>
<td class="admin_form_input"><input type="text" name="url" size="50" value="{$link.url}" /></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 web link *}

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

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

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

{/if}
Return current item: Jarida