diff --git a/.gitignore b/.gitignore index a4d34c6..cd51bc1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ /src/Vendor/ node_modules src/Cache/* -src/config.yaml -src/pages.yaml \ No newline at end of file +src/Config/config.yaml +src/Config/pages.yaml \ No newline at end of file diff --git a/src/AntCMS/AntCMS.php b/src/AntCMS/AntCMS.php index d35c6c8..6c37638 100644 --- a/src/AntCMS/AntCMS.php +++ b/src/AntCMS/AntCMS.php @@ -125,10 +125,10 @@ class AntCMS - <!--AntCMS-Title--> - - - + {{ AntCMSTitle }} + + +

AntCMS had an error when fetching the page template, please contact the site administrator.

diff --git a/src/Plugins/Admin/AdminPlugin.php b/src/Plugins/Admin/AdminPlugin.php index 538c165..b0a3415 100644 --- a/src/Plugins/Admin/AdminPlugin.php +++ b/src/Plugins/Admin/AdminPlugin.php @@ -7,6 +7,7 @@ use AntCMS\AntPages; use AntCMS\AntYaml; use AntCMS\AntAuth; use AntCMS\AntTools; +use AntCMS\AntTwig; class AdminPlugin extends AntPlugin { @@ -30,11 +31,19 @@ class AdminPlugin extends AntPlugin break; default: + $antTwig = new AntTwig; + $params = array( + 'AntCMSTitle' => 'AntCMS Admin Dashboard', + 'AntCMSDescription' => 'The AntCMS admin dashboard', + 'AntCMSAuthor' => 'AntCMS', + 'AntCMSKeywords' => 'N/A', + ); + $HTMLTemplate = "

AntCMS Admin Plugin

\n"; $HTMLTemplate .= "AntCMS Configuration
\n"; $HTMLTemplate .= "Page management
\n"; - $pageTemplate = str_replace('', 'AntCMS Configuration', $pageTemplate); $pageTemplate = str_replace('', $HTMLTemplate, $pageTemplate); + $pageTemplate = $antTwig->renderWithTiwg($pageTemplate, $params); echo $pageTemplate; break; @@ -53,6 +62,13 @@ class AdminPlugin extends AntPlugin $HTMLTemplate = $antCMS->getThemeTemplate('textarea_edit_layout'); $currentConfig = AntConfig::currentConfig(); $currentConfigFile = file_get_contents(antConfigFile); + $antTwig = new AntTwig; + $params = array( + 'AntCMSTitle' => 'AntCMS Configuration', + 'AntCMSDescription' => 'The AntCMS configuration screen', + 'AntCMSAuthor' => 'AntCMS', + 'AntCMSKeywords' => 'N/A', + ); switch ($route[0] ?? 'none') { case 'edit': @@ -91,8 +107,8 @@ class AdminPlugin extends AntPlugin } $HTMLTemplate .= "\n"; } - $pageTemplate = str_replace('', 'AntCMS Configuration', $pageTemplate); $pageTemplate = str_replace('', $HTMLTemplate, $pageTemplate); + $pageTemplate = $antTwig->renderWithTiwg($pageTemplate, $params); echo $pageTemplate; exit; @@ -105,6 +121,13 @@ class AdminPlugin extends AntPlugin $HTMLTemplate = $antCMS->getThemeTemplate('markdown_edit_layout'); $pages = AntPages::getPages(); $currentConfig = AntConfig::currentConfig(); + $antTwig = new AntTwig; + $params = array( + 'AntCMSTitle' => 'AntCMS Page Management', + 'AntCMSDescription' => 'The AntCMS page management screen', + 'AntCMSAuthor' => 'AntCMS', + 'AntCMSKeywords' => 'N/A', + ); switch ($route[0] ?? 'none') { case 'regenerate': @@ -171,8 +194,8 @@ class AdminPlugin extends AntPlugin $HTMLTemplate .= "\n"; } - $pageTemplate = str_replace('', 'AntCMS Page Management', $pageTemplate); $pageTemplate = str_replace('', $HTMLTemplate, $pageTemplate); + $pageTemplate = $antTwig->renderWithTiwg($pageTemplate, $params); echo $pageTemplate; exit; diff --git a/src/Themes/Bootstrap/Templates/default_layout.html.twig b/src/Themes/Bootstrap/Templates/default_layout.html.twig index fcc92f5..9ca494a 100644 --- a/src/Themes/Bootstrap/Templates/default_layout.html.twig +++ b/src/Themes/Bootstrap/Templates/default_layout.html.twig @@ -15,32 +15,6 @@ crossorigin="anonymous"> {{ AntCMSTitle }} - -