diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea61d9e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +.security.php diff --git a/classes/Core.class.php b/classes/Core.class.php index 7f1acee..c2239d1 100644 --- a/classes/Core.class.php +++ b/classes/Core.class.php @@ -71,8 +71,8 @@ private function init() { $this->hooks = new Hooks(); - $this->template = new Template($this); $this->modules = new Modules($this); + $this->template = new Template($this); $this->router = new Router($this); $this->router->addRoute('/', function() { @@ -139,10 +139,10 @@ } if(method_exists($module->getInstance(), 'load')) { - $module->getInstance()->load(); + $module->getInstance()->load($submodule); } - if(!method_exists($module->getInstance(), 'content')) { + if(!method_exists($module->getInstance(), 'content') && !method_exists($module->getInstance(), 'frame')) { $this->template->display('error/module_empty', [ 'module' => $module, 'submodule' => $submodule diff --git a/classes/ModuleInterface.class.php b/classes/ModuleInterface.class.php index 5b4ab12..45e9656 100644 --- a/classes/ModuleInterface.class.php +++ b/classes/ModuleInterface.class.php @@ -40,8 +40,8 @@ $this->getCore()->getTemplate()->assign($name, $value); } - public function url($path) { - $this->getCore()->getTemplate()->url($path); + public function url($path = '') { + return $this->getCore()->getTemplate()->url($path); } /* Filter */ diff --git a/classes/Modules.class.php b/classes/Modules.class.php index 36facbb..75ce61f 100644 --- a/classes/Modules.class.php +++ b/classes/Modules.class.php @@ -21,7 +21,6 @@ $path = sprintf('%s%s%s', $this->getPath(), DS, $info->getFilename()); $module = new Module($path); $module->setEnabled(in_array(basename($path), $enabled)); - $this->addModule(basename($path), $module); } } diff --git a/classes/Template.class.php b/classes/Template.class.php index 5a9a0ce..250f3d6 100644 --- a/classes/Template.class.php +++ b/classes/Template.class.php @@ -14,6 +14,7 @@ $this->files = new TemplateFiles(); $this->navigation = new TemplateNavigation($this->core); $this->theme = $this->core->getHooks()->applyFilter('theme_name', 'default'); + ob_start('ob_gzhandler'); $this->core->getHooks()->addAction('html_head', [ $this, 'head_robots' ]); @@ -56,7 +57,7 @@ $template = $this; foreach($arguments AS $name => $value) { - ${$name} = $value; + $this->assigns[$name] = $value; } $path = sprintf('%1$s%2$sthemes%2$s%4$s%2$s%3$s.php', dirname(PATH), DS, $file, $this->theme); diff --git a/theme/css/style.css b/theme/css/style.css index c43989f..1eb2c2f 100644 --- a/theme/css/style.css +++ b/theme/css/style.css @@ -130,6 +130,24 @@ body.sortable { margin: 0px; } +[role="main"].frame { + padding-left: 0px !important; + padding-right: 0px !important; +} + +main iframe { + width: 100%; + border: none; + display: block; + height: 100%; + top: 0; + left: 0; + right: 0; + height: calc(100vh - 48px); + overflow-x: hidden; + overflow-y: auto; +} + .form-control-dark { color: #fff; background-color: rgba(255, 255, 255, .1); diff --git a/theme/header.php b/theme/header.php index dfb9af3..5554021 100644 --- a/theme/header.php +++ b/theme/header.php @@ -77,7 +77,15 @@ ?> -
- getInstance(), 'frame') && !empty($module->getInstance()->frame())) { + ?> +
+ +
+ \ No newline at end of file diff --git a/theme/module.php b/theme/module.php index fd9c8e6..87b79d4 100644 --- a/theme/module.php +++ b/theme/module.php @@ -1,6 +1,12 @@ header(); - ?> + + if(method_exists($module->getInstance(), 'frame') && !empty($module->getInstance()->frame())) { + ?> + +

getInfo()->getName(); ?> @@ -48,8 +54,8 @@ ?>

getInstance()->content(); - ?> - getInstance()->content($submodule); + } + $template->footer(); ?> \ No newline at end of file