From 2c4ae43e688a9873e86211ea0e7aeb9ba770dd77 Mon Sep 17 00:00:00 2001 From: Minteck Date: Tue, 18 Oct 2022 08:59:09 +0200 Subject: Update --- pages/docs.inc | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'pages/docs.inc') diff --git a/pages/docs.inc b/pages/docs.inc index f893e95..0322f32 100644 --- a/pages/docs.inc +++ b/pages/docs.inc @@ -57,6 +57,12 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ยท Saved

+ = 0 && $data["last"]["author"] !== $_PROFILE["login"]): ?> +
+ This document is currently in use by . It has been open in read-only to prevent conflicts with the changes they make. If they stopped editing the document, it will become editable for you after you refresh the page in minute 1 ? "s" : "" ?>. +
+ + @@ -112,6 +118,10 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; .ck-editor__editable { border-color: transparent !important; } + + .ck.ck-sticky-panel__content_sticky { + top: 59px !important; + } +

Documents

@@ -210,11 +221,12 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; return strip_tags($i["contents"]) !== "/delete"; })); + $categoryFirst = []; $unsorted = []; $categories = []; foreach ($unsorted_pre as $item) { if (isset($item["category"])) { - $existing_categories = array_keys($categories); + $existing_categories = [...array_keys($categories), ...array_keys($categoryFirst)]; $matched_category = null; foreach ($existing_categories as $existing_category) { @@ -224,8 +236,14 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; } $selected_category = $matched_category ?? $item["category"]; - if (!isset($categories[$selected_category])) $categories[$selected_category] = []; - $categories[$selected_category][] = $item; + + if (str_starts_with($item["category"], ".")) { + if (!isset($categoryFirst[$selected_category])) $categoryFirst[$selected_category] = []; + $categoryFirst[$selected_category][] = $item; + } else { + if (!isset($categories[$selected_category])) $categories[$selected_category] = []; + $categories[$selected_category][] = $item; + } } else { $unsorted[] = $item; } @@ -239,10 +257,12 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; return $b["last"]["date"] - $a["last"]["date"]; }); + $fullList = [...$categoryFirst, ...$categories]; + ?> - $items): ?> -