|
|
|
@ -4,6 +4,7 @@ namespace brain\data;
|
|
|
|
|
|
|
|
|
|
use brain\utility\DocTools;
|
|
|
|
|
use brain\utility\Sorting;
|
|
|
|
|
|
|
|
|
|
use function _\find;
|
|
|
|
|
use function _\pull;
|
|
|
|
|
use function _\remove;
|
|
|
|
@ -24,6 +25,7 @@ class Settings
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function sync($data)
|
|
|
|
|
{
|
|
|
|
|
$settings = self::$settings;
|
|
|
|
@ -46,6 +48,7 @@ class Settings
|
|
|
|
|
|
|
|
|
|
DocTools::writeSettings('../config/settings.json', $settings);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function navSync($data)
|
|
|
|
|
{
|
|
|
|
|
$settings = self::$settings;
|
|
|
|
@ -94,6 +97,7 @@ class Settings
|
|
|
|
|
|
|
|
|
|
DocTools::writeSettings('../config/settings.json', $settings);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getFolks($key = null)
|
|
|
|
|
{
|
|
|
|
|
if (isset($key)) {
|
|
|
|
@ -106,25 +110,30 @@ class Settings
|
|
|
|
|
return $this->folks;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getSettings($key = null)
|
|
|
|
|
{
|
|
|
|
|
return self::$settings;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function getTags()
|
|
|
|
|
{
|
|
|
|
|
return self::$tags;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function updateGlobalData($key, $data)
|
|
|
|
|
{
|
|
|
|
|
$settings = self::$settings;
|
|
|
|
|
$settings['global'][$key] = $data;
|
|
|
|
|
DocTools::writeSettings('../config/settings.json', $settings);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function getCurrentIndex()
|
|
|
|
|
{
|
|
|
|
|
$settings = self::$settings;
|
|
|
|
|
return $settings['library_stats']['current_index'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function updateIndex()
|
|
|
|
|
{
|
|
|
|
|
$settings = self::$settings;
|
|
|
|
@ -133,6 +142,7 @@ class Settings
|
|
|
|
|
|
|
|
|
|
DocTools::writeSettings('../config/settings.json', $settings);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function updateMenu($body)
|
|
|
|
|
{
|
|
|
|
|
$settings = self::$settings;
|
|
|
|
@ -155,6 +165,7 @@ class Settings
|
|
|
|
|
}
|
|
|
|
|
DocTools::writeSettings('../config/settings.json', $settings);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function updateTags()
|
|
|
|
|
{
|
|
|
|
|
$tags = Sorting::tags();
|
|
|
|
|