2 Commits

3 changed files with 8 additions and 3 deletions

View File

@ -1,7 +1,7 @@
(function(window) {
const folder_selector = document.querySelectorAll('.pride_flags_server_settings .server-settings.folder-flavour select')[0];
const button_selector = document.querySelectorAll('.pride_flags_server_settings .server-settings.button-flavour select')[0];
const submit_button = document.querySelectorAll('.pride_flags_user_settings .settings-pride-submit');
const submit_button = document.querySelectorAll('.pride_flags_server_settings .settings-pride-submit');
const container = document.querySelector('.pride_flags_server_settings .settings-section');
function load() {

View File

@ -40,6 +40,11 @@ class SettingsController extends Controller {
return $this->makeJSONResponse(fn () => $this->appSettings->getGlobal());
}
#[NoCSRFRequired]
public function getGlobal(): JSONResponse {
return $this->makeJSONResponse(fn () => $this->appSettings->getGlobal());
}
protected function makeJSONResponse(Closure $closure): JSONResponse {
try {
return new JSONResponse($closure(), HTTP::STATUS_OK);

View File

@ -34,8 +34,8 @@ class AppSettings {
public function getGlobal(): array {
return [
AppSettings::FOLDER_VARIANT => $this->config->getAppValue(AppSettings::APP_ID, AppSettings::FOLDER_VARIANT, 'pride'),
AppSettings::BUTTON_VARIANT => $this->config->getAppValue(AppSettings::APP_ID, AppSettings::BUTTON_VARIANT, 'trans'),
AppSettings::FOLDER_VARIANT => $this->config->getAppValue(AppConstants::APP_ID, AppSettings::FOLDER_VARIANT, 'pride'),
AppSettings::BUTTON_VARIANT => $this->config->getAppValue(AppConstants::APP_ID, AppSettings::BUTTON_VARIANT, 'trans'),
];
}