1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-28 23:40:41 +02:00

Flextype Box Plugin: Admin #125 #117

- fixes and refactoring
This commit is contained in:
Awilum
2019-06-08 00:46:36 +03:00
parent a1cf8c0f3d
commit a3aa6f62a0
2 changed files with 29 additions and 6 deletions

View File

@@ -5,12 +5,27 @@ namespace Flextype;
use Flextype\Component\Filesystem\Filesystem;
use Flextype\Component\Date\Date;
use Flextype\Component\Arr\Arr;
use Flextype\Component\Registry\Registry;
use function Flextype\Component\I18n\__;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
/**
* @property View $view
* @property Router $router
* @property Cache $cache
* @property Registry $registry
*/
class PluginsController extends Controller
{
public function index($request, $response)
/**
* Index page
*
* @param Request $request PSR7 request
* @param Response $response PSR7 response
*
* @return Response
*/
public function index(/** @scrutinizer ignore-unused */ Request $request, Response $response) : Response
{
return $this->view->render(
$response,
@@ -36,7 +51,15 @@ class PluginsController extends Controller
);
}
public function pluginStatusProcess($request, $response)
/**
* Сhange plugin status process
*
* @param Request $request PSR7 request
* @param Response $response PSR7 response
*
* @return Response
*/
public function pluginStatusProcess(Request $request, Response $response) : Response
{
$data = $request->getParsedBody();
$plugin_settings = JsonParser::decode(Filesystem::read(PATH['plugins'] . '/' . $data['plugin'] . '/' . 'settings.json'));

View File

@@ -10,9 +10,9 @@ use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
/**
* @property $view
* @property $router
* @property $cache
* @property View $view
* @property Router $router
* @property Cache $cache
*/
class SettingsController extends Controller
{