mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-19 12:13:25 +02:00
Add categories in tabs, move more settings, revert back getPluginSettings
Categories and sections are now not numbered Remove example settings plugin
This commit is contained in:
@@ -207,13 +207,33 @@ class Plugins {
|
||||
return $hooks;
|
||||
}
|
||||
|
||||
public static function getPluginSettings($pluginName)
|
||||
{
|
||||
$plugin_json = self::getPluginJson($pluginName);
|
||||
if (!$plugin_json) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isset($plugin_json['settings']) || !file_exists(BASE . $plugin_json['settings'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $plugin_json['settings'];
|
||||
}
|
||||
|
||||
public static function getPluginJson($name = null)
|
||||
{
|
||||
if(!isset($name)) {
|
||||
return self::$plugin_json;
|
||||
}
|
||||
|
||||
$string = file_get_contents(PLUGINS . $name . '.json');
|
||||
$pathToPlugin = PLUGINS . $name . '.json';
|
||||
if (!file_exists($pathToPlugin)) {
|
||||
self::$warnings[] = "Cannot load " . $name . ".json. File doesn't exist.";
|
||||
return false;
|
||||
}
|
||||
|
||||
$string = file_get_contents($pathToPlugin);
|
||||
$string = self::removeComments($string);
|
||||
$plugin_json = json_decode($string, true);
|
||||
if ($plugin_json == null) {
|
||||
|
Reference in New Issue
Block a user