2017-04-17 12:49:03 +02:00
|
|
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Check role
|
|
|
|
// ============================================================================
|
|
|
|
|
2017-09-09 00:33:14 +02:00
|
|
|
if ($Login->role()!=='admin') {
|
|
|
|
Alert::set($Language->g('You do not have sufficient permissions'));
|
|
|
|
Redirect::page('dashboard');
|
2017-04-17 12:49:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Functions
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Main before POST
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// POST Method
|
|
|
|
// ============================================================================
|
|
|
|
|
2017-11-01 19:38:56 +01:00
|
|
|
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
|
|
|
createCategory($_POST['category']);
|
|
|
|
Redirect::page('categories');
|
2017-04-17 12:49:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Main after POST
|
|
|
|
// ============================================================================
|
2017-09-09 00:33:14 +02:00
|
|
|
|
|
|
|
// Title of the page
|
|
|
|
$layout['title'] .= ' - '.$Language->g('New category');
|