Skip to content

Commit

Permalink
Updated extension for Jérôme, fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
markseuffert committed Aug 28, 2024
1 parent aa80148 commit fa1f6a7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions system/extensions/update-available.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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.11
Version: 0.9.12
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: 2024-07-22 11:47:55
Published: 2024-08-28 10:15:04
Status: available
system/workers/core.php: core.php, create, update
system/extensions/core.php: corepatch.txt, update
Expand Down
4 changes: 2 additions & 2 deletions system/extensions/yellow-extension.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Datenstrom Yellow extension settings

Extension: Core
Version: 0.9.11
Version: 0.9.12
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: 2024-07-22 11:47:55
Published: 2024-08-28 10:15:04
Status: available
system/workers/core.php: core.php, create, update
system/extensions/core.php: corepatch.txt, update
Expand Down
5 changes: 3 additions & 2 deletions system/workers/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Core extension, https://github.com/annaesvensson/yellow-core

class YellowCore {
const VERSION = "0.9.11";
const VERSION = "0.9.12";
const RELEASE = "0.9";
public $content; // content files
public $media; // media files
Expand Down Expand Up @@ -602,16 +602,17 @@ public function getHomeLocation($location) {

// Return parent location
public function getParentLocation($location) {
$parentLocation = "";
$token = rtrim($this->yellow->system->get("coreMediaLocation"), "/");
if (preg_match("#^($token.*\/).+?$#", $location, $matches)) {
if ($matches[1]!="$token/" || $this->yellow->lookup->isFileLocation($location)) $parentLocation = $matches[1];
}
if (is_string_empty($parentLocation)) $parentLocation = "";
return $parentLocation;
}

// Return top-level location
public function getParentTopLocation($location) {
$parentTopLocation = "";
$token = rtrim($this->yellow->system->get("coreMediaLocation"), "/");
if (preg_match("#^($token.+?\/)#", $location, $matches)) $parentTopLocation = $matches[1];
if (is_string_empty($parentTopLocation)) $parentTopLocation = "$token/";
Expand Down

0 comments on commit fa1f6a7

Please sign in to comment.