php-mpos/public/include/pages/admin/news_edit.inc.php
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

22 lines
646 B
PHP

<?php
// Make sure we are called from index.php
if (!defined('SECURITY')) die('Hacking attempt');
// Include markdown library
use \Michelf\Markdown;
if (@$_REQUEST['do'] == 'save') {
if ($news->updateNews($_REQUEST['id'], $_REQUEST['header'], $_REQUEST['content'], $_REQUEST['active'])) {
$_SESSION['POPUP'][] = array('CONTENT' => 'News updated', 'TYPE' => 'success');
} else {
$_SESSION['POPUP'][] = array('CONTENT' => 'News update failed: ' . $news->getError(), 'TYPE' => 'errormsg');
}
}
// Fetch news entry
$aNews = $news->getEntry($_REQUEST['id']);
$smarty->assign("NEWS", $aNews);
$smarty->assign("CONTENT", "default.tpl");
?>