php-mpos/public/templates/mmcFE/admin/news/default.tpl
Sebastian Grewe e4e88e5226 Adding custom news posts via admin panel
* Adding dynamic news posts from DB
* Support Adding, Editing, Activating, Deactivating through admin panel
* Display all active posts on news page
* Implemented Markdown Library by Michelf

Fixes #61
2013-06-21 11:16:02 +02:00

39 lines
1.6 KiB
Smarty

{include file="global/block_header.tpl" BLOCK_HEADER="News Posts"}
{include file="global/block_header.tpl" BLOCK_HEADER="Add News Post"}
<form method="POST" action="{$smarty.server.PHP_SELF}">
<input type="hidden" name="page" value="{$smarty.request.page}">
<input type="hidden" name="action" value="{$smarty.request.action}">
<input type="hidden" name="do" value="add">
<table width="80%">
<tr>
<th>Header</th>
<td><input size="30" type="text" name="data[header]" required /></td>
</tr>
<tr>
<th>Content</th>
<td><textarea name="data[content]" required></textarea></td>
</tr>
<tr><td class="center" colspan="2"><input type="submit" value="Add" class="submit small"></td></tr>
</table>
</form>
{include file="global/block_footer.tpl"}
{section name=news loop=$NEWS}
{include
file="global/block_header.tpl"
BLOCK_HEADER="{$NEWS[news].header}"
BUTTONS="
<a href='{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action=news_edit&id={$NEWS[news].id}'>Edit</a>&nbsp;
<a href='{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&do=delete&id={$NEWS[news].id}'>Delete</a>
"
}
{if $NEWS[news].active == 0}<font size="2px">This post is <font color="red"><b>inactive</b></font><br /><br />{/if}
{$NEWS[news].content}
<form method="POST" action="{$smarty.server.PHP_SELF}">
<input type="hidden" name="page" value="{$smarty.request.page}">
<input type="hidden" name="action" value="news_edit">
<input type="hidden" name="id" value="{$NEWS[news].id}">
</form>
{include file="global/block_footer.tpl"}
{/section}
{include file="global/block_footer.tpl"}