Remove request destination

This commit is contained in:
Dennis Eichhorn 2016-04-02 17:24:15 +02:00
parent 0b77a3811b
commit d7289adf9e
2 changed files with 7 additions and 78 deletions

View File

@ -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 */
}

View File

@ -80,14 +80,6 @@ abstract class ModuleAbstract
*/
protected static $localization = [];
/**
* Routes.
*
* @var array
* @since 1.0.0
*/
protected static $routes = [];
/**
* Dependencies.
*
@ -115,12 +107,6 @@ abstract class ModuleAbstract
public function __construct($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
{
$lang = [];
if (isset(static::$localization[$destination])) {
/** @noinspection PhpUnusedLocalVariableInspection */
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;
}
if (($path = realpath($oldPath = __DIR__ . '/../../Modules/' . static::MODULE_NAME . '/Theme/' . $destination . '/Lang/' . $language . '.lang.php')) === false) {
throw new PathException($oldPath);
}
/** @noinspection PhpIncludeInspection */
include $path;
/** @var array $MODLANG */
$lang += $MODLANG;
return $lang;
}