commit 7c99a54bb2722c525128aad521c6dd85de1caf1d
parent df9b37d23851fc699e3b8af782513bb5f41e6767
Author: markseu <mark2011@mayberg.se>
Date: Thu, 22 Oct 2020 13:33:29 +0200
Better handling of old layout files
Diffstat:
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/system/extensions/update-current.ini b/system/extensions/update-current.ini
@@ -90,11 +90,11 @@ system/themes/stockholm-opensans-light.woff: stockholm-opensans-light.woff, crea
system/themes/stockholm-opensans-regular.woff: stockholm-opensans-regular.woff, create, update, careful
Extension: Update
-Version: 0.8.35
+Version: 0.8.36
Description: Keep your website up to date.
HelpUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/update
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/update.zip
-Published: 2020-10-14 13:29:01
+Published: 2020-10-22 13:26:23
Developer: Datenstrom
Tag: feature
system/extensions/update.php: update.php, create, update
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.35";
+ const VERSION = "0.8.36";
const PRIORITY = "2";
public $yellow; // access to API
public $updates; // number of updates
@@ -60,8 +60,10 @@ class YellowUpdate {
$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("\$page = \$this->yellow->content->shared(\"header\")", "\$page = null", $fileDataNew);
+ $fileDataNew = str_replace("\$page = \$this->yellow->content->shared(\"footer\")", "\$page = null", $fileDataNew);
+ $fileDataNew = str_replace("\$page = \$this->yellow->content->shared(\"sidebar\")", "\$page = null", $fileDataNew);
+ $fileDataNew = str_replace("\$this->yellow->content->shared(\"sidebar\")", "\$this->yellow->page->isPage(\"sidebar\")", $fileDataNew);
$fileDataNew = str_replace("php if (\$page = null)", "php /* Remove this line */ if (\$page = null)", $fileDataNew);
if ($fileData!=$fileDataNew && !$this->yellow->toolbox->createFile($entry, $fileDataNew)) {
$this->yellow->log("error", "Can't write file '$entry'!");