Skip to content

Commit

Permalink
Updated edit events for Steffen
Browse files Browse the repository at this point in the history
  • Loading branch information
markseuffert committed Apr 30, 2024
1 parent 45559c8 commit 999f1fa
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
12 changes: 6 additions & 6 deletions system/extensions/update-available.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ system/themes/berlin-opensans-light.woff: berlin-opensans-light.woff, create, up
system/themes/berlin-opensans-regular.woff: berlin-opensans-regular.woff, create, update, careful

Extension: Blog
Version: 0.9.1
Version: 0.9.2
Description: Blog for your website.
Developer: Anna Svensson
Tag: feature
DownloadUrl: https://github.com/annaesvensson/yellow-blog/archive/refs/heads/main.zip
DocumentationUrl: https://github.com/annaesvensson/yellow-blog
DocumentationLanguage: en, de, sv
Published: 2024-04-04 17:13:35
Published: 2024-04-30 18:03:27
Status: available
system/workers/blog.php: blog.php, create, update
system/layouts/blog.html: blog.html, create, update, careful
Expand Down Expand Up @@ -213,14 +213,14 @@ Status: available
system/workers/dutch.php: dutch.php, create, update

Extension: Edit
Version: 0.9.5
Version: 0.9.6
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: 2024-04-23 11:37:34
Published: 2024-04-30 17:04:26
Status: available
system/workers/edit.php: edit.php, create, update
system/workers/edit.css: edit.css, create, update
Expand Down Expand Up @@ -792,14 +792,14 @@ system/workers/update.php: update.php, create, update
system/workers/updatepatch.bin: updatepatch.php, create, additional

Extension: Wiki
Version: 0.9.2
Version: 0.9.3
Description: Wiki for your website.
Developer: Anna Svensson
Tag: feature
DownloadUrl: https://github.com/annaesvensson/yellow-wiki/archive/refs/heads/main.zip
DocumentationUrl: https://github.com/annaesvensson/yellow-wiki
DocumentationLanguage: en, de, sv
Published: 2024-04-26 16:22:52
Published: 2024-04-30 16:45:31
Status: available
system/workers/wiki.php: wiki.php, create, update
system/layouts/wiki.html: wiki.html, create, update, careful
Expand Down
4 changes: 2 additions & 2 deletions system/extensions/yellow-extension.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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.5
Version: 0.9.6
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: 2024-04-23 11:37:34
Published: 2024-04-30 17:04:26
Status: available
system/workers/edit.php: edit.php, create, update
system/workers/edit.css: edit.css, create, update
Expand Down
24 changes: 12 additions & 12 deletions system/workers/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Edit extension, https://github.com/annaesvensson/yellow-edit

class YellowEdit {
const VERSION = "0.9.5";
const VERSION = "0.9.6";
public $yellow; // access to API
public $response; // web response
public $merge; // text merge
Expand Down Expand Up @@ -1078,17 +1078,16 @@ public function getPageNew($scheme, $address, $base, $location, $fileName, $rawD
$rawData = $this->yellow->lookup->normaliseLines($rawData, $endOfLine);
$page = new YellowPage($this->yellow);
$page->setRequestInformation($scheme, $address, $base, $location, $fileName, false);
$page->parseMeta($rawData);
$this->editContentFile($page, "create", $this->userEmail);
$page->parseMeta($rawData, 200);
if ($this->yellow->content->find($page->location)) {
$page->location = $this->getPageNewLocation($page->rawData, $page->location, $page->get("editNewLocation"));
$page->fileName = $this->getPageNewFile($page->location, $page->fileName, $page->get("published"));
$page->fileName = $this->getPageNewFile($page->location, $page->fileName, $page->get("editNewPrefix"));
$pageCounter = 0;
while ($this->yellow->content->find($page->location) || is_string_empty($page->fileName)) {
$page->rawData = $this->yellow->toolbox->setMetaData($page->rawData, "title", $this->getTitleNext($page->rawData));
$page->rawData = $this->yellow->lookup->normaliseLines($page->rawData, $endOfLine);
$page->location = $this->getPageNewLocation($page->rawData, $page->location, $page->get("editNewLocation"));
$page->fileName = $this->getPageNewFile($page->location, $page->fileName, $page->get("published"));
$page->fileName = $this->getPageNewFile($page->location, $page->fileName, $page->get("editNewPrefix"));
if (++$pageCounter>999) break;
}
if ($this->yellow->content->find($page->location) || is_string_empty($page->fileName)) {
Expand All @@ -1100,6 +1099,7 @@ public function getPageNew($scheme, $address, $base, $location, $fileName, $rawD
if (!$this->isUserAccess("create", $page->location)) {
$page->error(500, "Page '".$page->get("title")."' is restricted!");
}
$this->editContentFile($page, "create", $this->userEmail);
return $page;
}

Expand All @@ -1111,14 +1111,13 @@ public function getPageEdit($scheme, $address, $base, $location, $fileName, $raw
$rawData = $this->extension->merge->merge($rawDataSource, $rawDataEdit, $rawDataFile);
$page = new YellowPage($this->yellow);
$page->setRequestInformation($scheme, $address, $base, $location, $fileName, false);
$page->parseMeta($rawData);
$page->parseMeta($rawData, 200);
$pageSource = new YellowPage($this->yellow);
$pageSource->setRequestInformation($scheme, $address, $base, $location, $fileName, false);
$pageSource->parseMeta($rawDataSource);
$this->editContentFile($page, "edit", $this->userEmail);
$pageSource->parseMeta($rawDataSource, 200);
if ($this->isMetaModified($pageSource, $page) && $page->location!=$this->yellow->content->getHomeLocation($page->location)) {
$page->location = $this->getPageNewLocation($page->rawData, $page->location, $page->get("editNewLocation"), true);
$page->fileName = $this->getPageNewFile($page->location, $page->fileName, $page->get("published"));
$page->fileName = $this->getPageNewFile($page->location, $page->fileName, $page->get("editNewPrefix"));
if ($page->location!=$pageSource->location && ($this->yellow->content->find($page->location) || is_string_empty($page->fileName))) {
$page->error(500, "Page '".$page->get("title")."' is not possible!");
}
Expand All @@ -1128,6 +1127,7 @@ public function getPageEdit($scheme, $address, $base, $location, $fileName, $raw
!$this->isUserAccess("edit", $pageSource->location)) {
$page->error(500, "Page '".$page->get("title")."' is restricted!");
}
$this->editContentFile($page, "edit", $this->userEmail);
return $page;
}

Expand All @@ -1136,11 +1136,11 @@ public function getPageDelete($scheme, $address, $base, $location, $fileName, $r
$rawData = $this->yellow->lookup->normaliseLines($rawData, $endOfLine);
$page = new YellowPage($this->yellow);
$page->setRequestInformation($scheme, $address, $base, $location, $fileName, false);
$page->parseMeta($rawData);
$this->editContentFile($page, "delete", $this->userEmail);
$page->parseMeta($rawData, 200);
if (!$this->isUserAccess("delete", $page->location)) {
$page->error(500, "Page '".$page->get("title")."' is restricted!");
}
$this->editContentFile($page, "delete", $this->userEmail);
return $page;
}

Expand All @@ -1149,10 +1149,10 @@ public function getPageRestore($scheme, $address, $base, $location, $fileName) {
$page = new YellowPage($this->yellow);
$page->setRequestInformation($scheme, $address, $base, $location, $fileName, false);
$page->parseMeta("");
$this->editContentFile($page, "restore", $this->userEmail);
if (!$this->isUserAccess("restore", $page->location)) {
$page->error(500, "Page '".$page->get("title")."' is restricted!");
}
$this->editContentFile($page, "restore", $this->userEmail);
return $page;
}

Expand Down
Binary file modified system/workers/install-blog.bin
Binary file not shown.
Binary file modified system/workers/install-wiki.bin
Binary file not shown.

0 comments on commit 999f1fa

Please sign in to comment.