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