get setting classes method
This commit is contained in:
parent
471fc1dd79
commit
60458494e0
@ -5,6 +5,7 @@ namespace ManiaControl\Settings;
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
use ManiaControl\Callbacks\CallbackManager;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Plugins\PluginManager;
|
||||
|
||||
/**
|
||||
* Class managing Settings and Configurations
|
||||
@ -439,6 +440,30 @@ class SettingManager implements CallbackListener {
|
||||
return $settings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all Setting Classes
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getSettingClasses($hidePluginClasses = true) {
|
||||
$mysqli = $this->maniaControl->database->mysqli;
|
||||
$query = "SELECT DISTINCT `class` FROM `" . self::TABLE_SETTINGS . "`
|
||||
ORDER BY `class` ASC;";
|
||||
$result = $mysqli->query($query);
|
||||
if ($mysqli->error) {
|
||||
trigger_error($mysqli->error);
|
||||
return null;
|
||||
}
|
||||
$settingClasses = array();
|
||||
while ($setting = $result->fetch_object()) {
|
||||
if (!$hidePluginClasses || !PluginManager::isPluginClass($setting->class)) {
|
||||
array_push($settingClasses, $setting->class);
|
||||
}
|
||||
}
|
||||
$result->free();
|
||||
return $settingClasses;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all unused Settings that haven't been initialized during the current Startup
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user