text editor adjustments, fix for page delete, ignore update

This commit is contained in:
Ro 2022-01-16 13:42:46 -08:00
commit 257d2a0623
6 changed files with 8374 additions and 21 deletions

4
.gitignore vendored
View file

@ -44,5 +44,5 @@ config/tags.json
config.codekit3
/config/backups
/src/com
/src/styles
src/com
src/styles

View file

@ -105,6 +105,7 @@ class PagesAPI
case "create":
case "write":
$body = $request->getParsedBody();
var_dump($body);
$passed = true;
if (!isset($body["form_token"])) {
$result = [
@ -138,10 +139,7 @@ class PagesAPI
}
}
if ($passed) {
$result = (new Book("../content/pages"))->editPage(
$task,
$request
);
$result = (new Book())->editPage($task, $request);
} else {
$result = [
"message" =>

View file

@ -32,8 +32,9 @@ class Book
{
$content = $this->getContents();
if ($task == "delete") {
$parsed = json_decode(file_get_contents("php://input"), true);
$body = find($content, ["uuid" => $parsed["id"]]);
//$parsed = json_decode(file_get_contents("php://input"), true);
//$body = find($content, ["uuid" => $parsed["id"]]);
$body = $request->getParsedBody();
} else {
$body = $request->getParsedBody();
}
@ -93,13 +94,9 @@ class Book
if ($task == "delete") {
$deleted = "true";
$body["menu"] ? ($body["menu"] = "true") : ($body["menu"] = "false");
$body["published"]
? ($body["published"] = "true")
: ($body["published"] = "false");
$body["featured"]
? ($body["featured"] = "true")
: ($body["featured"] = "false");
$body["menu"] = "false";
$body["published"] = "false";
$body["featured"] = "false";
} else {
$deleted = isset($page["deleted"]) ? $page["deleted"] : "false";
}
@ -195,7 +192,10 @@ class Book
return $item["deleted"] == true;
});
$all = $content;
//$all = $content;
$all = filter($content, function ($item) {
return $item["deleted"] == false;
});
$filter = isset($sort) ? $sort : "all";
switch ($filter) {
case "published":
@ -205,7 +205,7 @@ class Book
$filtered = $deleted;
break;
default:
$filtered = $content;
$filtered = $all;
break;
}
$numOfPages = ceil(count($filtered) / ($limit + 1));

View file

@ -32,7 +32,7 @@
{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" type="text/css" href="/assets/css/dash.css?=dfeef">
<link rel="stylesheet" type="text/css" href="/assets/css/dash.css?=cvbupoyn">
{% endblock %}
{% block mainContent %}

File diff suppressed because one or more lines are too long

View file

@ -248,7 +248,7 @@ class FipamoAdminAPI {
case TASK_PAGE_DELETE:
url = API_DELETE_PAGE;
event = TASK_PAGE_DELETE;
content = CONTENT_TYPE_JSON;
content = CONTENT_TYPE_FORM;
break;
default: