2015-08-03 00:05:20 +02:00
|
|
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Check role
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
if($Login->role()!=='admin') {
|
|
|
|
Alert::set($Language->g('you-do-not-have-sufficient-permissions'));
|
2017-06-05 22:36:09 +02:00
|
|
|
Redirect::page('dashboard');
|
2015-08-03 00:05:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Functions
|
|
|
|
// ============================================================================
|
|
|
|
|
2015-08-03 02:49:12 +02:00
|
|
|
// ============================================================================
|
|
|
|
// Main before POST
|
|
|
|
// ============================================================================
|
|
|
|
|
2015-08-03 00:05:20 +02:00
|
|
|
// ============================================================================
|
|
|
|
// POST Method
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
// ============================================================================
|
2015-08-03 02:49:12 +02:00
|
|
|
// Main after POST
|
2015-08-03 00:05:20 +02:00
|
|
|
// ============================================================================
|
|
|
|
$themeDirname = $layout['parameters'];
|
|
|
|
|
2017-06-05 22:36:09 +02:00
|
|
|
if( Sanitize::pathFile(PATH_THEMES.$themeDirname) ) {
|
|
|
|
// Set the theme
|
2015-08-03 00:05:20 +02:00
|
|
|
$Site->set(array('theme'=>$themeDirname));
|
2017-06-05 22:36:09 +02:00
|
|
|
|
|
|
|
// Add to syslog
|
|
|
|
$Syslog->add(array(
|
|
|
|
'dictionaryKey'=>'new-theme-configured',
|
|
|
|
'notes'=>$themeDirname
|
|
|
|
));
|
|
|
|
|
|
|
|
// Create an alert
|
|
|
|
Alert::set( $Language->g('The changes have been saved') );
|
2015-08-03 00:05:20 +02:00
|
|
|
}
|
|
|
|
|
2017-06-05 22:36:09 +02:00
|
|
|
// Redirect
|
|
|
|
Redirect::page('themes');
|