make all themes have a Page class, to simplify loading
This commit is contained in:
parent
903679dc53
commit
dba89e9d13
10 changed files with 15 additions and 12 deletions
|
@ -38,7 +38,7 @@ require_all(zglob("ext/{".Extension::get_enabled_extensions_as_string()."}/main.
|
|||
|
||||
// load the theme parts
|
||||
require_all(_get_themelet_files(get_theme()));
|
||||
$page = class_exists("CustomPage") ? new CustomPage() : new Page();
|
||||
$page = new Page();
|
||||
|
||||
// hook up event handlers
|
||||
_load_event_listeners();
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
<?php declare(strict_types=1);
|
||||
require_once "core/event.php";
|
||||
|
||||
/**
|
||||
* \page themes Themes
|
||||
*
|
||||
|
@ -42,7 +44,7 @@ abstract class PageMode
|
|||
* The various extensions all add whatever they want to this structure,
|
||||
* then Layout turns it into HTML.
|
||||
*/
|
||||
class Page
|
||||
class BasePage
|
||||
{
|
||||
/** @var string */
|
||||
public $mode = PageMode::PAGE;
|
|
@ -528,9 +528,7 @@ function _sanitise_environment(): void
|
|||
function _get_themelet_files(string $_theme): array
|
||||
{
|
||||
$base_themelets = [];
|
||||
if (file_exists('themes/'.$_theme.'/custompage.class.php')) {
|
||||
$base_themelets[] = 'themes/'.$_theme.'/custompage.class.php';
|
||||
}
|
||||
$base_themelets[] = 'themes/'.$_theme.'/page.class.php';
|
||||
$base_themelets[] = 'themes/'.$_theme.'/layout.class.php';
|
||||
$base_themelets[] = 'themes/'.$_theme.'/themelet.class.php';
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
class CustomPage extends Page
|
||||
class Page extends BasePage
|
||||
{
|
||||
/** @var bool */
|
||||
public $left_enabled = true;
|
|
@ -1,6 +1,6 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
class CustomPage extends Page
|
||||
class Page extends BasePage
|
||||
{
|
||||
public $left_enabled = true;
|
||||
public function disable_left()
|
2
themes/default/page.class.php
Normal file
2
themes/default/page.class.php
Normal file
|
@ -0,0 +1,2 @@
|
|||
<?php declare(strict_types=1);
|
||||
class Page extends BasePage {}
|
|
@ -1,6 +1,6 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
class CustomPage extends Page
|
||||
class Page extends BasePage
|
||||
{
|
||||
public $left_enabled = true;
|
||||
public function disable_left()
|
|
@ -1,9 +1,6 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Class CustomPage
|
||||
*/
|
||||
class CustomPage extends Page
|
||||
class Page extends BasePage
|
||||
{
|
||||
/** @var bool */
|
||||
public $left_enabled = true;
|
2
themes/material/page.class.php
Normal file
2
themes/material/page.class.php
Normal file
|
@ -0,0 +1,2 @@
|
|||
<?php declare(strict_types=1);
|
||||
class Page extends BasePage {}
|
2
themes/warm/page.class.php
Normal file
2
themes/warm/page.class.php
Normal file
|
@ -0,0 +1,2 @@
|
|||
<?php declare(strict_types=1);
|
||||
class Page extends BasePage {}
|
Reference in a new issue