| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- $app->get('/settings/appearance', function ($request, $response, $args) {
- $Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
- if ($Organizr->qualifyRequest(1, true)) {
- $GLOBALS['api']['response']['data'] = $Organizr->getCustomizeAppearance();
- }
- $response->getBody()->write(jsonE($GLOBALS['api']));
- return $response
- ->withHeader('Content-Type', 'application/json;charset=UTF-8')
- ->withStatus($GLOBALS['responseCode']);
- });
- $app->get('/settings/plugin', function ($request, $response, $args) {
- $Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
- if ($Organizr->qualifyRequest(1, true)) {
- $GLOBALS['api']['response']['data'] = $Organizr->getPluginSettings();
- }
- $response->getBody()->write(jsonE($GLOBALS['api']));
- return $response
- ->withHeader('Content-Type', 'application/json;charset=UTF-8')
- ->withStatus($GLOBALS['responseCode']);
- });
- $app->get('/settings/main', function ($request, $response, $args) {
- $Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
- if ($Organizr->qualifyRequest(1, true)) {
- $GLOBALS['api']['response']['data'] = $Organizr->getSettingsMain();
- }
- $response->getBody()->write(jsonE($GLOBALS['api']));
- return $response
- ->withHeader('Content-Type', 'application/json;charset=UTF-8')
- ->withStatus($GLOBALS['responseCode']);
- });
- $app->get('/settings/sso', function ($request, $response, $args) {
- $Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
- if ($Organizr->qualifyRequest(1, true)) {
- $GLOBALS['api']['response']['data'] = $Organizr->getSettingsSSO();
- }
- $response->getBody()->write(jsonE($GLOBALS['api']));
- return $response
- ->withHeader('Content-Type', 'application/json;charset=UTF-8')
- ->withStatus($GLOBALS['responseCode']);
- });
- $app->get('/settings/homepage', function ($request, $response, $args) {
- $Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
- if ($Organizr->qualifyRequest(1, true)) {
- $GLOBALS['api']['response']['data'] = $Organizr->getSettingsHomepage();
- }
- $response->getBody()->write(jsonE($GLOBALS['api']));
- return $response
- ->withHeader('Content-Type', 'application/json;charset=UTF-8')
- ->withStatus($GLOBALS['responseCode']);
- });
- $app->get('/settings/homepage/{item}', function ($request, $response, $args) {
- $Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
- if ($Organizr->qualifyRequest(1, true)) {
- $GLOBALS['api']['response']['data'] = $Organizr->getSettingsHomepageItem($args['item']);
- }
- $response->getBody()->write(jsonE($GLOBALS['api']));
- return $response
- ->withHeader('Content-Type', 'application/json;charset=UTF-8')
- ->withStatus($GLOBALS['responseCode']);
- });
- $app->get('/settings/homepage/{item}/debug', function ($request, $response, $args) {
- $Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
- if ($Organizr->qualifyRequest(1, true)) {
- $GLOBALS['api']['response']['data'] = $Organizr->getSettingsHomepageItemDebug($args['item']);
- }
- $response->getBody()->write(jsonE($GLOBALS['api']));
- return $response
- ->withHeader('Content-Type', 'application/json;charset=UTF-8')
- ->withStatus($GLOBALS['responseCode']);
- });
|