mikuli.cz

:)
git clone https://git.sr.ht/~ashymad/mikuli.cz
Log | Files | Refs

commit 513512a8656393496dd42c20be7a9e2f0144fe15
parent 81ac88364ddadf7de3f75753cfb7ba66937c7dc3
Author: markseu <mark2011@mayberg.se>
Date:   Mon,  9 Feb 2026 11:09:07 +0100

Updated API and events for Mike

Diffstat:
Msystem/extensions/update-available.ini | 12++++++------
Msystem/extensions/update-installed.ini | 12++++++------
Msystem/workers/core.php | 44+++++++++++++++++++++-----------------------
Msystem/workers/edit.php | 4++--
Msystem/workers/install.php | 4++--
5 files changed, 37 insertions(+), 39 deletions(-)

diff --git a/system/extensions/update-available.ini b/system/extensions/update-available.ini @@ -149,14 +149,14 @@ system/themes/copenhagen.css: copenhagen.css, create, update, careful system/themes/copenhagen.png: copenhagen.png, create Extension: Core -Version: 0.9.19 +Version: 0.9.20 Description: Core functionality of your website. Developer: Anna Svensson Tag: feature DownloadUrl: https://github.com/annaesvensson/yellow-core/archive/refs/heads/main.zip DocumentationUrl: https://github.com/annaesvensson/yellow-core DocumentationLanguage: en, de, sv -Published: 2026-02-08 21:54:10 +Published: 2026-02-09 10:52:06 Status: available system/workers/core.php: core.php, create, update system/extensions/core.php: corepatch.txt, update @@ -213,14 +213,14 @@ Status: available system/workers/dutch.php: dutch.php, create, update Extension: Edit -Version: 0.9.13 +Version: 0.9.14 Description: Edit your website in a web browser. Developer: Anna Svensson Tag: feature DownloadUrl: https://github.com/annaesvensson/yellow-edit/archive/refs/heads/main.zip DocumentationUrl: https://github.com/annaesvensson/yellow-edit DocumentationLanguage: en, de, sv -Published: 2026-02-07 21:24:45 +Published: 2026-02-09 10:28:18 Status: available system/workers/edit.php: edit.php, create, update system/workers/edit.css: edit.css, create, update @@ -328,14 +328,14 @@ Status: available system/workers/german.php: german.php, create, update Extension: Help -Version: 0.9.7 +Version: 0.9.8 Description: Documentation of the basics. Developer: Anna Svensson Tag: feature DownloadUrl: https://github.com/annaesvensson/yellow-help/archive/refs/heads/main.zip DocumentationUrl: https://github.com/annaesvensson/yellow-help DocumentationLanguage: en, de, sv -Published: 2025-12-19 01:11:01 +Published: 2026-02-09 10:49:45 Status: available system/workers/help.php: help.php, create, update content/9-help/api-for-developers.md: api-for-developers.md, create, optional, multi-language diff --git a/system/extensions/update-installed.ini b/system/extensions/update-installed.ini @@ -1,14 +1,14 @@ # Datenstrom Yellow update settings for installed extensions Extension: Core -Version: 0.9.19 +Version: 0.9.20 Description: Core functionality of your website. Developer: Anna Svensson Tag: feature DownloadUrl: https://github.com/annaesvensson/yellow-core/archive/refs/heads/main.zip DocumentationUrl: https://github.com/annaesvensson/yellow-core DocumentationLanguage: en, de, sv -Published: 2026-02-08 21:54:10 +Published: 2026-02-09 10:52:06 Status: available system/workers/core.php: core.php, create, update system/extensions/core.php: corepatch.txt, update @@ -20,14 +20,14 @@ system/layouts/navigation.html: navigation.html, create, update, careful system/layouts/pagination.html: pagination.html, create, update, careful Extension: Edit -Version: 0.9.13 +Version: 0.9.14 Description: Edit your website in a web browser. Developer: Anna Svensson Tag: feature DownloadUrl: https://github.com/annaesvensson/yellow-edit/archive/refs/heads/main.zip DocumentationUrl: https://github.com/annaesvensson/yellow-edit DocumentationLanguage: en, de, sv -Published: 2026-02-07 21:24:45 +Published: 2026-02-09 10:28:18 Status: available system/workers/edit.php: edit.php, create, update system/workers/edit.css: edit.css, create, update @@ -62,13 +62,13 @@ media/images/photo.jpg: photo.jpg, create, optional media/thumbnails/photo-100x40.jpg: photo-100x40.jpg, create, optional Extension: Install -Version: 0.9.7 +Version: 0.9.8 Description: Install a brand new website. Developer: Anna Svensson DownloadUrl: https://github.com/annaesvensson/yellow-install/archive/refs/heads/main.zip DocumentationUrl: https://github.com/annaesvensson/yellow-install DocumentationLanguage: en, de, sv -Published: 2025-11-28 10:18:20 +Published: 2026-02-09 10:35:10 Status: unassembled system/workers/install.php: install.php, create system/workers/install-language.bin: install-language.bin, compress @source/yellow-language/, create diff --git a/system/workers/core.php b/system/workers/core.php @@ -2,7 +2,7 @@ // Core extension, https://github.com/annaesvensson/yellow-core class YellowCore { - const VERSION = "0.9.19"; + const VERSION = "0.9.20"; const RELEASE = "0.9"; public $content; // content files public $media; // media files @@ -703,12 +703,12 @@ class YellowSystem { // Return different value for system setting public function getDifferent($key) { - $array = array_diff($this->yellow->toolbox->enumerate("system", $key), array($this->get($key))); + $array = array_diff($this->yellow->toolbox->enumerate($key), array($this->get($key))); return reset($array); } // TODO: Remove later, this is only for backwards compatibility - public function getAvailable($key) { return $this->yellow->toolbox->enumerate("system", $key); } + public function getAvailable($key) { return $this->yellow->toolbox->enumerate($key); } // Return system settings public function getSettings($filterStart = "", $filterEnd = "") { @@ -2908,33 +2908,31 @@ class YellowToolbox { } // Return possible values - public function enumerate($action, $text) { + public function enumerate($action, $context = "") { $values = array(); foreach ($this->yellow->extension->data as $key=>$value) { if (method_exists($value["object"], "onEnumerate")) { - $output = $value["object"]->onEnumerate($action, $text); + $output = $value["object"]->onEnumerate($action, $context); if (!is_null($output)) { $values = array_merge($values, is_array($output) ? $output : array($output)); } } } - if ($action=="system") { - if ($text=="email") { - foreach ($this->yellow->user->settings as $userKey=>$userValue) { - array_push($values, $userKey); - } - } elseif ($text=="language") { - foreach ($this->yellow->language->settings as $languageKey=>$languageValue) { - array_push($values, $languageKey); - } - } elseif ($text=="theme") { - $path = $this->yellow->system->get("coreThemeDirectory"); - foreach ($this->yellow->toolbox->getDirectoryEntries($path, "/^.*\.css$/", true, false, false) as $entry) { - array_push($values, substru($entry, 0, -4)); - } + if ($action=="email") { + foreach ($this->yellow->user->settings as $userKey=>$userValue) { + array_push($values, $userKey); + } + } elseif ($action=="language") { + foreach ($this->yellow->language->settings as $languageKey=>$languageValue) { + array_push($values, $languageKey); + } + } elseif ($action=="theme") { + $path = $this->yellow->system->get("coreThemeDirectory"); + foreach ($this->yellow->toolbox->getDirectoryEntries($path, "/^.*\.css$/", true, false, false) as $entry) { + array_push($values, substru($entry, 0, -4)); } - usort($values, "strnatcasecmp"); } + usort($values, "strnatcasecmp"); return $values; } @@ -3200,9 +3198,9 @@ class YellowPage { if (!$this->isHeader("Content-Type")) $this->setHeader("Content-Type", "text/html; charset=utf-8"); if (!$this->isHeader("Content-Modified")) $this->setHeader("Content-Modified", $this->getModified(true)); if (!$this->isHeader("Last-Modified")) $this->setHeader("Last-Modified", $this->getLastModified(true)); - $name = $this->yellow->lookup->normaliseName($this->get("theme")); - if (!is_file($this->yellow->system->get("coreThemeDirectory").$name.".css") && - !in_array($name, $this->yellow->toolbox->enumerate("system", "theme"))) { + $theme = $this->yellow->lookup->normaliseName($this->get("theme")); + if (!is_file($this->yellow->system->get("coreThemeDirectory").$theme.".css") && + !in_array($theme, $this->yellow->toolbox->enumerate("theme"))) { $this->error(500, "Theme '".$this->get("theme")."' does not exist!"); } if (!$this->yellow->language->isExisting($this->get("language"))) { diff --git a/system/workers/edit.php b/system/workers/edit.php @@ -2,7 +2,7 @@ // Edit extension, https://github.com/annaesvensson/yellow-edit class YellowEdit { - const VERSION = "0.9.13"; + const VERSION = "0.9.14"; public $yellow; // access to API public $response; // web response public $merge; // text merge @@ -1253,7 +1253,7 @@ class YellowEditResponse { $data["coreExtensions"][$key] = $value["class"]; } $data["coreLanguages"] = array(); - foreach ($this->yellow->toolbox->enumerate("system", "language") as $language) { + foreach ($this->yellow->toolbox->enumerate("language") as $language) { $data["coreLanguages"][$language] = $this->yellow->language->getTextHtml("languageDescription", $language); } $data["editSettingsActions"] = $this->getSettingsActions(); diff --git a/system/workers/install.php b/system/workers/install.php @@ -2,7 +2,7 @@ // Install extension, https://github.com/annaesvensson/yellow-install class YellowInstall { - const VERSION = "0.9.7"; + const VERSION = "0.9.8"; const PRIORITY = "1"; public $yellow; // access to API @@ -538,7 +538,7 @@ class YellowInstall { // Return raw data for install page public function getRawDataInstall() { - $languages = $this->yellow->system->getAvailable("language"); + $languages = $this->yellow->toolbox->enumerate("language"); $language = $this->yellow->toolbox->detectBrowserLanguage($languages, $this->yellow->system->get("language")); $this->yellow->language->set($language); $rawData = "---\nTitle:".$this->yellow->language->getText("installTitle")."\nLanguage:$language\nNavigation:navigation\nHeader:none\nFooter:none\nSidebar:none\n---\n";