bludit/bl-kernel/admin/controllers/new-content.php

39 lines
1.5 KiB
PHP
Raw Normal View History

2015-05-05 03:00:01 +02:00
<?php defined('BLUDIT') or die('Bludit CMS.');
2015-08-03 02:49:12 +02:00
// ============================================================================
// Check role
// ============================================================================
2018-07-28 18:33:37 +02:00
checkRole(array('admin', 'editor'));
2018-07-25 23:42:00 +02:00
2015-07-14 06:41:32 +02:00
// ============================================================================
// Functions
// ============================================================================
2015-08-03 02:49:12 +02:00
// ============================================================================
// Main before POST
// ============================================================================
2015-07-14 06:41:32 +02:00
// ============================================================================
// POST Method
// ============================================================================
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// If the checkbox is not selected the form doesn't send the field
$_POST['noindex'] = isset($_POST['noindex'])?true:false;
$_POST['nofollow'] = isset($_POST['nofollow'])?true:false;
$_POST['noarchive'] = isset($_POST['noarchive'])?true:false;
createPage($_POST);
2017-10-02 22:42:18 +02:00
Redirect::page('content');
2015-05-31 03:06:55 +02:00
}
2015-08-03 02:49:12 +02:00
// ============================================================================
// Main after POST
// ============================================================================
// UUID of the page is need it for autosave and media manager
$uuid = $pages->generateUUID();
// Title of the page
$layout['title'] = $L->g('New content').' - '.$layout['title'];