|
|
@@ -14,6 +14,26 @@ $app->get('/plugins', function ($request, $response, $args) {
|
|
|
->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
->withStatus($GLOBALS['responseCode']);
|
|
|
});
|
|
|
+$app->get('/plugins/disabled', function ($request, $response, $args) {
|
|
|
+ $Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
|
|
|
+ if ($Organizr->checkRoute($request)) {
|
|
|
+ $GLOBALS['api']['response']['data'] = $Organizr->getPlugins('disabled');
|
|
|
+ }
|
|
|
+ $response->getBody()->write(jsonE($GLOBALS['api']));
|
|
|
+ return $response
|
|
|
+ ->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
+ ->withStatus($GLOBALS['responseCode']);
|
|
|
+});
|
|
|
+$app->get('/plugins/enabled', function ($request, $response, $args) {
|
|
|
+ $Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
|
|
|
+ if ($Organizr->checkRoute($request)) {
|
|
|
+ $GLOBALS['api']['response']['data'] = $Organizr->getPlugins('enabled');
|
|
|
+ }
|
|
|
+ $response->getBody()->write(jsonE($GLOBALS['api']));
|
|
|
+ return $response
|
|
|
+ ->withHeader('Content-Type', 'application/json;charset=UTF-8')
|
|
|
+ ->withStatus($GLOBALS['responseCode']);
|
|
|
+});
|
|
|
$app->post('/plugins/manage/{plugin}', function ($request, $response, $args) {
|
|
|
$Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
|
|
|
if ($Organizr->qualifyRequest(1, true)) {
|