mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-11 22:38:42 +00:00
Remove request destination
This commit is contained in:
parent
0b77a3811b
commit
d7289adf9e
|
|
@ -1,52 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* Orange Management
|
|
||||||
*
|
|
||||||
* PHP Version 7.0
|
|
||||||
*
|
|
||||||
* @category TBD
|
|
||||||
* @package TBD
|
|
||||||
* @author OMS Development Team <dev@oms.com>
|
|
||||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
|
||||||
* @copyright 2013 Dennis Eichhorn
|
|
||||||
* @license OMS License 1.0
|
|
||||||
* @version 1.0.0
|
|
||||||
* @link http://orange-management.com
|
|
||||||
*/
|
|
||||||
namespace phpOMS\Message;
|
|
||||||
|
|
||||||
use phpOMS\Datatypes\Enum;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Request page enum.
|
|
||||||
*
|
|
||||||
* Possible page requests. Page requests can have completely different themes, permissions and page structures.
|
|
||||||
*
|
|
||||||
* @category Request
|
|
||||||
* @package Framework
|
|
||||||
* @author OMS Development Team <dev@oms.com>
|
|
||||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
|
||||||
* @license OMS License 1.0
|
|
||||||
* @link http://orange-management.com
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
abstract class RequestDestination extends Enum
|
|
||||||
{
|
|
||||||
const WEBSITE = 'Website'; /* Website */
|
|
||||||
const API = 'Api'; /* API */
|
|
||||||
const SHOP = 'Shop'; /* Shop */
|
|
||||||
const BACKEND = 'Backend'; /* Backend */
|
|
||||||
const STATICP = 'Static'; /* Static content */
|
|
||||||
const FORUM = 'Forum'; /* Forum */
|
|
||||||
const TICKET = 'Ticket'; /* ???? */
|
|
||||||
const SUPPORT = 'Support'; /* Support center */
|
|
||||||
const SURVEY = 'Survey'; /* Survey page */
|
|
||||||
const BLOG = 'Blog'; /* Blog */
|
|
||||||
const CHART = 'Chart'; /* Chart view */
|
|
||||||
const CALENDAR = 'Calendar'; /* Calendar */
|
|
||||||
const PROFILE = 'Profile'; /* User profile page */
|
|
||||||
const CHAT = 'Chat'; /* Chat page */
|
|
||||||
const GALLERY = 'Gallery'; /* Chat page */
|
|
||||||
const REPORTER = 'Reporter'; /* Reporter page */
|
|
||||||
// This or let api handle this const GUI = 'gui'; /* Request GUI elements */
|
|
||||||
}
|
|
||||||
|
|
@ -80,14 +80,6 @@ abstract class ModuleAbstract
|
||||||
*/
|
*/
|
||||||
protected static $localization = [];
|
protected static $localization = [];
|
||||||
|
|
||||||
/**
|
|
||||||
* Routes.
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
protected static $routes = [];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dependencies.
|
* Dependencies.
|
||||||
*
|
*
|
||||||
|
|
@ -115,12 +107,6 @@ abstract class ModuleAbstract
|
||||||
public function __construct($app)
|
public function __construct($app)
|
||||||
{
|
{
|
||||||
$this->app = $app;
|
$this->app = $app;
|
||||||
|
|
||||||
foreach (static::$routes as $route => $destinations) {
|
|
||||||
foreach ($destinations as $destination) {
|
|
||||||
$this->app->router->add($route, $destination['dest'], $destination['method'], $destination['type']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -148,20 +134,15 @@ abstract class ModuleAbstract
|
||||||
public function getLocalization(string $language, string $destination) : array
|
public function getLocalization(string $language, string $destination) : array
|
||||||
{
|
{
|
||||||
$lang = [];
|
$lang = [];
|
||||||
if (isset(static::$localization[$destination])) {
|
if (($path = realpath($oldPath = __DIR__ . '/../../Modules/' . static::MODULE_NAME . '/Theme/' . $destination . '/Lang/' . $language . '.lang.php')) === false) {
|
||||||
/** @noinspection PhpUnusedLocalVariableInspection */
|
throw new PathException($oldPath);
|
||||||
foreach (static::$localization[$destination] as $file) {
|
|
||||||
if (($path = realpath($oldPath = __DIR__ . '/../../Modules/' . static::MODULE_NAME . '/Theme/' . $destination . '/Lang/' . $language . '.lang.php')) === false) {
|
|
||||||
throw new PathException($oldPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @noinspection PhpIncludeInspection */
|
|
||||||
include realpath($path);
|
|
||||||
/** @var array $MODLANG */
|
|
||||||
$lang += $MODLANG;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @noinspection PhpIncludeInspection */
|
||||||
|
include $path;
|
||||||
|
/** @var array $MODLANG */
|
||||||
|
$lang += $MODLANG;
|
||||||
|
|
||||||
return $lang;
|
return $lang;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user