= $data["name"] ?>
Back
Category: = $data["category"] ?? "Unsorted" ?>
Last modified never
Last modified ">= timeAgo($data["last"]["date"]) ?>
by = $data["last"]["author"] === "raindrops" ? "the Raindrops System" : "the Cloudburst System" ?>
· Saved
= 0 && $data["last"]["author"] !== $_PROFILE["login"]): ?>
This document is currently in use by = $data["last"]["author"] === "raindrops" ? "the Raindrops System" : "the Cloudburst System" ?>. 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 = $timeDiff ?> minute= $timeDiff > 1 ? "s" : "" ?>.
= $data["contents"] ?>
substr($i, 0, -5),
...(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/docs/" . $i), true) ?? [])
];
}, array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/docs"), function ($i) {
return !str_starts_with($i, ".") && str_ends_with($i, ".json");
}));
$deletable = array_values(array_filter($documents, function ($i) {
return str_starts_with(strip_tags($i["contents"]), "/delete");
}));
$unsorted_pre = array_values(array_filter($documents, function ($i) {
return !str_starts_with(strip_tags($i["contents"]), "/delete");
}));
$categoryFirst = [];
$unsorted = [];
$categories = [];
foreach ($unsorted_pre as $item) {
if (isset($item["category"])) {
$existing_categories = [...array_keys($categories), ...array_keys($categoryFirst)];
$matched_category = null;
foreach ($existing_categories as $existing_category) {
if (levenshtein($item["category"], $existing_category) < 3) {
$matched_category = $existing_category;
}
}
$selected_category = $matched_category ?? $item["category"];
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;
}
}
uasort($unsorted, function ($a, $b) {
return $b["last"]["date"] - $a["last"]["date"];
});
uasort($deletable, function ($a, $b) {
return $b["last"]["date"] - $a["last"]["date"];
});
$fullList = [...$categoryFirst, ...$categories];
?>
$items): ?>
= str_starts_with($category, ".") ? substr($category, 1) : $category ?>
Unsorted
Marked for deletion