2015-10-19 00:45:58 +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');
|
2015-10-19 00:45:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Functions
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Main after POST
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// POST Method
|
|
|
|
// ============================================================================
|
|
|
|
|
2017-09-09 00:33:14 +02:00
|
|
|
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
|
|
|
editSettings($_POST);
|
|
|
|
Redirect::page('settings-advanced');
|
2015-10-19 00:45:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Main after POST
|
|
|
|
// ============================================================================
|
2017-10-22 14:36:16 +02:00
|
|
|
$allPages = buildAllpages($publishedPages=true, $staticPages=true, $draftPages=false, $scheduledPages=false);
|
2015-10-19 00:45:58 +02:00
|
|
|
|
2018-02-06 18:26:59 +01:00
|
|
|
// Generate $pagesByParentByKey and pagesByParent
|
|
|
|
$pagesByParent = array(PARENT=>array());
|
|
|
|
$pagesByParentByKey = array(PARENT=>array());
|
|
|
|
buildPagesByParent(true, true);
|
|
|
|
|
2017-07-11 23:53:53 +02:00
|
|
|
// Homepage select options
|
2018-02-06 18:26:59 +01:00
|
|
|
$homepageOptions = array(' '=>'- '.$L->g('Default').' -');
|
2017-10-22 14:36:16 +02:00
|
|
|
foreach ($allPages as $key=>$page) {
|
2017-07-23 17:02:06 +02:00
|
|
|
$parentKey = $page->parentKey();
|
|
|
|
if ($parentKey) {
|
|
|
|
$homepageOptions[$key] = $pagesByParentByKey[PARENT][$parentKey]->title() .'->'. $page->title();
|
|
|
|
} else {
|
|
|
|
$homepageOptions[$key] = $page->title();
|
|
|
|
}
|
2017-09-04 19:09:37 +02:00
|
|
|
|
|
|
|
ksort($homepageOptions);
|
2017-09-09 00:33:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Title of the page
|
|
|
|
$layout['title'] .= ' - '.$Language->g('Advanced Settings');
|