bludit/admin/controllers/new-page.php

31 lines
518 B
PHP
Raw Normal View History

2015-05-05 03:00:01 +02:00
<?php defined('BLUDIT') or die('Bludit CMS.');
function addPage($args)
{
global $dbPages;
// Page status, published or draft.
if( isset($args['publish']) ) {
$args['status'] = "published";
}
else {
$args['status'] = "draft";
}
// Add the page.
if( $dbPages->add($args) )
{
2015-06-27 06:32:29 +02:00
Alert::set('Page added successfuly');
2015-05-05 03:00:01 +02:00
Redirect::page('admin', 'manage-pages');
}
else
{
2015-06-27 06:32:29 +02:00
Alert::set('Error occurred when trying to create the page');
2015-05-05 03:00:01 +02:00
}
}
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
addPage($_POST);
2015-05-31 03:06:55 +02:00
}