praiadeseselle/wire/modules/AdminTheme/AdminThemeUikit/default.php

48 lines
1.2 KiB
PHP
Raw Normal View History

2022-03-08 15:55:41 +01:00
<?php namespace ProcessWire;
/**
* default.php: Main control file for AdminThemeUikit
*
* FileCompiler=0
*
*/
2022-11-05 18:32:48 +01:00
if(!defined("PROCESSWIRE")) die();
2022-03-08 15:55:41 +01:00
/** @var Config $config */
/** @var AdminThemeUikit $adminTheme */
/** @var User $user */
/** @var Modules $modules */
/** @var Notices $notices */
/** @var Page $page */
/** @var Process $process */
/** @var Sanitizer $sanitizer */
/** @var WireInput $input */
/** @var Paths $urls */
2022-11-05 18:32:48 +01:00
/** @var string $content */
2022-03-08 15:55:41 +01:00
if($adminTheme->isModal) {
$layout = 'modal';
} else if($user->isLoggedin() && isset($_GET['layout'])) {
$layout = $input->get->name('layout');
} else {
$layout = '';
}
2022-11-05 18:32:48 +01:00
$content .= $adminTheme->renderExtraMarkup('content');
$vars = array('layout' => $layout, 'content' => &$content);
2022-03-08 15:55:41 +01:00
2022-11-05 18:32:48 +01:00
if(strpos($layout, 'sidenav') === 0 && $layout != 'sidenav-main') {
include(__DIR__ . '/_sidenav/default.php');
2022-03-08 15:55:41 +01:00
} else {
// main markup file
if($user->isLoggedin() && $adminTheme->layout && !$adminTheme->isModal) {
2022-11-05 18:32:48 +01:00
$vars['layout'] = $adminTheme->layout;
$adminTheme->addBodyClass("pw-layout-$vars[layout]");
2022-03-08 15:55:41 +01:00
} else if($layout != 'modal') {
2022-11-05 18:32:48 +01:00
$vars['layout'] = '';
2022-03-08 15:55:41 +01:00
}
2022-11-05 18:32:48 +01:00
$adminTheme->includeFile('_main.php', $vars);
2022-03-08 15:55:41 +01:00
}