Create first search draft

This commit is contained in:
Dennis Eichhorn 2019-06-01 20:49:59 +02:00
parent 98a3ed4ae2
commit b2176f755c
3 changed files with 143 additions and 0 deletions

43
Admin/Install/Search.php Normal file
View File

@ -0,0 +1,43 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\Help\Admin\Install
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Help\Admin\Install;
use phpOMS\DataStorage\Database\DatabasePool;
/**
* Search class.
*
* @package Modules\Help\Admin\Install
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
final class Search
{
/**
* Install navigation providing
*
* @param string $path Module path
* @param DatabasePool $dbPool Database pool for database interaction
*
* @return void
*
* @since 1.0.0
*/
public static function install(string $path, DatabasePool $dbPool) : void
{
\Modules\Search\Admin\Installer::installExternal($dbPool, ['path' => __DIR__ . '/SearchCommands.php']);
}
}

View File

@ -0,0 +1,53 @@
<?php declare(strict_types=1);
use Modules\Help\Controller\SearchController;
use Modules\Help\Models\PermissionState;
use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb;
return [
'^:help .*$' => [
[
'dest' => '\Modules\Help\Controller\SearchController:searchHelp',
'verb' => RouteVerb::ANY,
'permission' => [
'module' => SearchController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::HELP_MODULE,
],
],
],
'^:help :user .*$' => [
[
'dest' => '\Modules\Help\Controller\SearchController:searchHelp',
'verb' => RouteVerb::ANY,
'permission' => [
'module' => SearchController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::HELP_MODULE,
],
],
],
'^:help :dev .*$' => [
[
'dest' => '\Modules\Help\Controller\SearchController:searchHelp',
'verb' => RouteVerb::ANY,
'permission' => [
'module' => SearchController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::HELP_DEVELOPER,
],
],
],
'^:help :module .*$' => [
[
'dest' => '\Modules\Help\Controller\SearchController:searchHelp',
'verb' => RouteVerb::ANY,
'permission' => [
'module' => SearchController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::HELP_MODULE,
],
],
],
];

View File

@ -0,0 +1,47 @@
<?php
/**
* Orange Management
*
* PHP Version 7.2
*
* @package Modules\Help
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://website.orange-management.de
*/
declare(strict_types=1);
namespace Modules\Help\Controller;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
/**
* Help class.
*
* @package Modules\Help
* @license OMS License 1.0
* @link http://website.orange-management.de
* @since 1.0.0
*/
final class SearchController extends Controller
{
/**
* Api method to create a task
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return array
*
* @api
*
* @since 1.0.0
*/
public function searchHelp(RequestAbstract $request, ResponseAbstract $response, $data = null) : array
{
return ['found'];
}
}