diff --git a/Message/RequestDestination.php b/Message/RequestDestination.php deleted file mode 100644 index 7b39125ae..000000000 --- a/Message/RequestDestination.php +++ /dev/null @@ -1,52 +0,0 @@ - - * @author Dennis Eichhorn - * @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 - * @author Dennis Eichhorn - * @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 */ -} diff --git a/Module/ModuleAbstract.php b/Module/ModuleAbstract.php index 564a8ce24..1a8889ba7 100644 --- a/Module/ModuleAbstract.php +++ b/Module/ModuleAbstract.php @@ -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; }