diff options
Diffstat (limited to 'includes/pages/admin_news.php')
-rw-r--r-- | includes/pages/admin_news.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/includes/pages/admin_news.php b/includes/pages/admin_news.php index 1c435a14..192f3cce 100644 --- a/includes/pages/admin_news.php +++ b/includes/pages/admin_news.php @@ -1,4 +1,5 @@ <?php + function admin_news() { global $user; @@ -6,10 +7,11 @@ function admin_news() { redirect(page_link_to("news")); } else { $html = '<div class="col-md-12"><h1>' . _("Edit news entry") . '</h1>' . msg(); - if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) + if (isset($_REQUEST['id']) && preg_match("/^[0-9]{1,11}$/", $_REQUEST['id'])) { $id = $_REQUEST['id']; - else + } else { return error("Incomplete call, missing News ID.", true); + } $news = sql_select("SELECT * FROM `News` WHERE `ID`='" . sql_escape($id) . "' LIMIT 1"); if (count($news) > 0) { @@ -20,17 +22,18 @@ function admin_news() { list($news) = $news; $user_source = User($news['UID']); - if ($user_source === false) + if ($user_source === false) { engelsystem_error("Unable to load user."); + } - $html .= form(array( + $html .= form([ form_info(_("Date"), date("Y-m-d H:i", $news['Datum'])), form_info(_("Author"), User_Nick_render($user_source)), form_text('eBetreff', _("Subject"), $news['Betreff']), form_textarea('eText', _("Message"), $news['Text']), form_checkbox('eTreffen', _("Meeting"), $news['Treffen'] == 1, 1), form_submit('submit', _("Save")) - ), page_link_to('admin_news&action=save&id=' . $id)); + ], page_link_to('admin_news&action=save&id=' . $id)); $html .= '<a class="btn btn-danger" href="' . page_link_to('admin_news&action=delete&id=' . $id) . '"><span class="glyphicon glyphicon-trash"></span> ' . _("Delete") . '</a>'; break; |