Skip to content

Commit

Permalink
Updated core
Browse files Browse the repository at this point in the history
Co-Authored-By: GiovanniSalmeri <[email protected]>
  • Loading branch information
markseuffert and GiovanniSalmeri committed Apr 24, 2024
1 parent dedd517 commit 6bef555
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 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.6";
const VERSION = "0.9.7";
const RELEASE = "0.9";
public $content; // content files
public $media; // media files
Expand Down Expand Up @@ -3153,11 +3153,11 @@ public function parseContent() {
}

// Parse page content element, experimental
public function parseContentElement($name, $text, $attrributes, $type) {
public function parseContentElement($name, $text, $attributes, $type) {
$output = null;
foreach ($this->yellow->extension->data as $key=>$value) {
if (method_exists($value["object"], "onParseContentElement")) {
$output = $value["object"]->onParseContentElement($this, $name, $text, $attrributes, $type);
$output = $value["object"]->onParseContentElement($this, $name, $text, $attributes, $type);
if (!is_null($output)) break;
}
}
Expand Down Expand Up @@ -3397,8 +3397,17 @@ public function getPage($key) {
}

// Return page URL
public function getUrl() {
return $this->yellow->lookup->normaliseUrl($this->scheme, $this->address, $this->base, $this->location);
public function getUrl($canoncialUrl = false) {
if ($canoncialUrl) {
$scheme = $this->yellow->system->get("coreServerScheme");
$address = $this->yellow->system->get("coreServerAddress");
$location = $this->yellow->system->get("coreServerBase").$this->location;
} else {
$scheme = $this->scheme;
$address = $this->address;
$location = $this->base.$this->location;
}
return "$scheme://$address$location";
}

// Return page base
Expand Down

0 comments on commit 6bef555

Please sign in to comment.