commit e9bab35dd5dec5004738e012e55b77300ed585b5
parent 72d65cf05db68d92d968a65426eef5bc557bd402
Author: markseu <mark2011@mayberg.se>
Date: Mon, 17 Aug 2020 11:45:11 +0200
Better handling of old layout files
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/system/extensions/update.php b/system/extensions/update.php
@@ -2,7 +2,7 @@
// Update extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/update
class YellowUpdate {
- const VERSION = "0.8.33";
+ const VERSION = "0.8.34";
const PRIORITY = "2";
public $yellow; // access to API
public $updates; // number of updates
@@ -57,7 +57,9 @@ class YellowUpdate {
if ($action=="update") { // TODO: remove later, converts old layout files
$path = $this->yellow->system->get("coreLayoutDirectory");
foreach ($this->yellow->toolbox->getDirectoryEntriesRecursive($path, "/^.*\.html$/", true, false) as $entry) {
+ $key = str_replace("pages", "", $this->yellow->lookup->normaliseName(basename($entry), true, true));
$fileData = $fileDataNew = $this->yellow->toolbox->readFile($entry);
+ $fileDataNew = str_replace("yellow->page->getPages()", "yellow->page->getPages(\"$key\")", $fileDataNew);
$fileDataNew = str_replace("\$this->yellow->content->shared(\"header\")", "null", $fileDataNew);
$fileDataNew = str_replace("\$this->yellow->content->shared(\"footer\")", "null", $fileDataNew);
$fileDataNew = str_replace("php if (\$page = null)", "php /* Remove this line */ if (\$page = null)", $fileDataNew);