commit 63cf2d4dafc46f09164d228fbdcd41460111ae89
parent a0d03dcd7c111b942daa53b504c4c2b59e475dba
Author: markseu <mark2011@mayberg.se>
Date: Thu, 18 Nov 2021 22:15:09 +0100
Update blog/wiki layout handling
Diffstat:
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/system/extensions/install-wiki.zip b/system/extensions/install-wiki.zip
Binary files differ.
diff --git a/system/extensions/update-current.ini b/system/extensions/update-current.ini
@@ -129,11 +129,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.57
+Version: 0.8.58
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: 2021-11-18 19:47:05
+Published: 2021-11-18 22:03:08
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.57";
+ const VERSION = "0.8.58";
const PRIORITY = "2";
public $yellow; // access to API
public $updates; // number of updates
@@ -69,7 +69,7 @@ class YellowUpdate {
}
}
}
- if ($action=="update") { // TODO: remove later, convert old content files
+ if ($action=="update") { // TODO: remove later, convert old content/layout files
if ($this->yellow->system->isExisting("blogLocation") || $this->yellow->system->isExisting("wikiLocation")) {
$path = $this->yellow->system->get("coreContentDirectory");
foreach ($this->yellow->toolbox->getDirectoryEntriesRecursive($path, "/^.*\.md$/", true, false) as $entry) {
@@ -82,6 +82,15 @@ class YellowUpdate {
$this->yellow->log("error", "Can't write file '$entry'!");
}
}
+ $path = $this->yellow->system->get("coreLayoutDirectory");
+ foreach ($this->yellow->toolbox->getDirectoryEntriesRecursive($path, "/^.*\.html$/", true, false) as $entry) {
+ $fileData = $fileDataNew = $this->yellow->toolbox->readFile($entry);
+ $fileDataNew = str_replace("yellow->page->getPage(\"blog\")", "yellow->page->getPage(\"blogStart\")", $fileDataNew);
+ $fileDataNew = str_replace("yellow->page->getPage(\"wiki\")", "yellow->page->getPage(\"wikiStart\")", $fileDataNew);
+ if ($fileData!=$fileDataNew && !$this->yellow->toolbox->createFile($entry, $fileDataNew)) {
+ $this->yellow->log("error", "Can't write file '$entry'!");
+ }
+ }
}
}
if ($action=="update") { // TODO: remove later, convert old extension settings