mirror of
https://github.com/Karaka-Management/oms-Admin.git
synced 2026-01-25 19:48:40 +00:00
Prepare for console application
This commit is contained in:
parent
a41c384409
commit
60db1d1cd2
12
Admin/Routes/Console.php
Normal file
12
Admin/Routes/Console.php
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
use phpOMS\Router\RouteVerb;
|
||||
|
||||
return [
|
||||
'^$' => [
|
||||
[
|
||||
'dest' => '\Modules\Admin\Controller:viewEmptyCommand',
|
||||
'verb' => RouteVerb::ANY,
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<?php
|
||||
return [];
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<?php
|
||||
return [];
|
||||
|
|
@ -145,6 +145,38 @@ final class Controller extends ModuleAbstract implements WebInterface
|
|||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method which generates the general settings view.
|
||||
*
|
||||
* In this view general settings for the entire application can be seen and adjusted. Settings which can be modified
|
||||
* here are localization, password, database, etc.
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param mixed $data Generic data
|
||||
*
|
||||
* @return \Serializable Serializable web view
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function viewEmptyCommand(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
|
||||
{
|
||||
$view = new View($this->app, $request, $response);
|
||||
|
||||
/*if (!$this->app->accountManager->get($request->getHeader()->getAccount())->hasPermission(
|
||||
PermissionType::READ, $this->app->orgId, $this->app->appName, self::MODULE_NAME, PermissionState::SETTINGS)
|
||||
) {
|
||||
//$view->setTemplate('/Web/Backend/Error/403_inline');
|
||||
//$response->getHeader()->setStatusCode(RequestStatusCode::R_403);
|
||||
return $view;
|
||||
}*/
|
||||
|
||||
$view->setTemplate('/Modules/Admin/Theme/Console/empty-command');
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method which generates the account list view.
|
||||
*
|
||||
|
|
@ -457,12 +489,12 @@ final class Controller extends ModuleAbstract implements WebInterface
|
|||
return;
|
||||
}
|
||||
|
||||
$success = $this->app->appSettings->set(
|
||||
$this->app->appSettings->set(
|
||||
\json_decode((string) $request->getData('settings'), true),
|
||||
true
|
||||
);
|
||||
|
||||
$response->set($request->getUri()->__toString(), $success);
|
||||
$response->set($request->getUri()->__toString(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
1
Theme/Console/empty-command.tpl.php
Normal file
1
Theme/Console/empty-command.tpl.php
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?= 'Test output';
|
||||
Loading…
Reference in New Issue
Block a user