|
|
@ -1,5 +1,7 @@
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
use function _\find;
|
|
|
|
use function _\find;
|
|
|
|
|
|
|
|
use function _\pull;
|
|
|
|
|
|
|
|
use function _\remove;
|
|
|
|
class Settings
|
|
|
|
class Settings
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private $folks;
|
|
|
|
private $folks;
|
|
|
@ -89,4 +91,27 @@ class Settings
|
|
|
|
|
|
|
|
|
|
|
|
DocTools::writeSettings("../config/settings.json", $settings);
|
|
|
|
DocTools::writeSettings("../config/settings.json", $settings);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static function updateMenu($body)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$settings = self::$settings;
|
|
|
|
|
|
|
|
//$menu = $settings["menu"];
|
|
|
|
|
|
|
|
$item = [
|
|
|
|
|
|
|
|
"title" => $body["title"],
|
|
|
|
|
|
|
|
"id" => $body["id"],
|
|
|
|
|
|
|
|
"uuid" => $body["uuid"],
|
|
|
|
|
|
|
|
"slug" => $body["slug"],
|
|
|
|
|
|
|
|
"path" => $body["path"],
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
if ($body["menu"] == "true") {
|
|
|
|
|
|
|
|
if (!find($settings["menu"], ["uuid" => $item["uuid"]])) {
|
|
|
|
|
|
|
|
array_push($settings["menu"], $item);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (find($settings["menu"], ["uuid" => $item["uuid"]])) {
|
|
|
|
|
|
|
|
pull($settings["menu"], $item);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
DocTools::writeSettings("../config/settings.json", $settings);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|