mirror of
https://github.com/Karaka-Management/oms-Shop.git
synced 2026-01-11 18:48:41 +00:00
Add test/install for shop
This commit is contained in:
commit
6a03db2ffc
0
Admin/Install/Application/Shop/Application.php
Normal file
0
Admin/Install/Application/Shop/Application.php
Normal file
0
Admin/Install/Application/Shop/ShopView.php
Normal file
0
Admin/Install/Application/Shop/ShopView.php
Normal file
0
Admin/Install/Application/Shop/index.tpl.php
Normal file
0
Admin/Install/Application/Shop/index.tpl.php
Normal file
0
Admin/Install/Application/Shop/manifest.json
Normal file
0
Admin/Install/Application/Shop/manifest.json
Normal file
0
Admin/Install/Application/config.tpl.php
Normal file
0
Admin/Install/Application/config.tpl.php
Normal file
0
Admin/Install/Navigation.install.json
Normal file
0
Admin/Install/Navigation.install.json
Normal file
0
Admin/Install/Navigation.php
Normal file
0
Admin/Install/Navigation.php
Normal file
0
Admin/Install/db.json
Normal file
0
Admin/Install/db.json
Normal file
49
Admin/Installer.php
Normal file
49
Admin/Installer.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.2
|
||||
*
|
||||
* @package Modules\Shop\Admin
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://website.orange-management.de
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Shop\Admin;
|
||||
|
||||
use phpOMS\DataStorage\Database\DatabasePool;
|
||||
use phpOMS\Module\InfoManager;
|
||||
use phpOMS\Module\InstallerAbstract;
|
||||
use phpOMS\System\File\PathException;
|
||||
use phpOMS\System\File\PermissionException;
|
||||
use phpOMS\Utils\Parser\Php\ArrayParser;
|
||||
use phpOMS\System\File\Local\Directory;
|
||||
|
||||
/**
|
||||
* Installer class.
|
||||
*
|
||||
* @package Modules\Shop\Admin
|
||||
* @license OMS License 1.0
|
||||
* @link http://website.orange-management.de
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Installer extends InstallerAbstract
|
||||
{
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function install(DatabasePool $dbPool, InfoManager $info) : void
|
||||
{
|
||||
if (\file_exists(__DIR__ . '/../../../Web/Shop')) {
|
||||
Directory::delete(__DIR__ . '/../../../Web/Shop');
|
||||
}
|
||||
|
||||
Directory::copy(__DIR__ . '/Install/Shop', __DIR__ . '/../../../Web/Shop');
|
||||
|
||||
parent::install($dbPool, $info);
|
||||
}
|
||||
}
|
||||
9
Admin/Routes/Web/Api.php
Normal file
9
Admin/Routes/Web/Api.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use Modules\Shop\Controller\ApiController;
|
||||
use Modules\Shop\Models\PermissionState;
|
||||
use phpOMS\Account\PermissionType;
|
||||
use phpOMS\Router\RouteVerb;
|
||||
|
||||
return [
|
||||
];
|
||||
3
Admin/Routes/Web/Backend.php
Normal file
3
Admin/Routes/Web/Backend.php
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
return [];
|
||||
20
Admin/Routes/Web/Shop.php
Normal file
20
Admin/Routes/Web/Shop.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use Modules\Shop\Controller\ShopController;
|
||||
use Modules\Shop\Models\PermissionState;
|
||||
use phpOMS\Account\PermissionType;
|
||||
use phpOMS\Router\RouteVerb;
|
||||
|
||||
return [
|
||||
'^(\/)(\?.*)*$' => [
|
||||
[
|
||||
'dest' => '\Modules\Shop\Controller\ShopController:viewWelcome',
|
||||
'verb' => RouteVerb::GET,
|
||||
'permission' => [
|
||||
'module' => ShopController::MODULE_NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::SHOP,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
30
Admin/Status.php
Normal file
30
Admin/Status.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.2
|
||||
*
|
||||
* @package Modules\Shop\Admin
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://website.orange-management.de
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Shop\Admin;
|
||||
|
||||
use phpOMS\Module\StatusAbstract;
|
||||
|
||||
/**
|
||||
* Shop class.
|
||||
*
|
||||
* @package Modules\Shop\Admin
|
||||
* @license OMS License 1.0
|
||||
* @link http://website.orange-management.de
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Status extends StatusAbstract
|
||||
{
|
||||
|
||||
}
|
||||
29
Admin/Uninstaller.php
Normal file
29
Admin/Uninstaller.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.2
|
||||
*
|
||||
* @package Modules\Shop\Admin
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://website.orange-management.de
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Shop\Admin;
|
||||
|
||||
use phpOMS\Module\UninstallerAbstract;
|
||||
|
||||
/**
|
||||
* Uninstaller class.
|
||||
*
|
||||
* @package Modules\Shop\Admin
|
||||
* @license OMS License 1.0
|
||||
* @link http://website.orange-management.de
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Uninstaller extends UninstallerAbstract
|
||||
{
|
||||
}
|
||||
30
Admin/Updater.php
Normal file
30
Admin/Updater.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.2
|
||||
*
|
||||
* @package Modules\Shop\Admin
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://website.orange-management.de
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Shop\Admin;
|
||||
|
||||
use phpOMS\Module\UpdaterAbstract;
|
||||
|
||||
/**
|
||||
* Updater class.
|
||||
*
|
||||
* @package Modules\Shop\Admin
|
||||
* @license OMS License 1.0
|
||||
* @link http://website.orange-management.de
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Updater extends UpdaterAbstract
|
||||
{
|
||||
|
||||
}
|
||||
35
Controller/ApiController.php
Normal file
35
Controller/ApiController.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.2
|
||||
*
|
||||
* @package Modules\Shop
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://website.orange-management.de
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Shop\Controller;
|
||||
|
||||
use phpOMS\ApplicationAbstract;
|
||||
use phpOMS\Router\Router;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
use phpOMS\System\MimeType;
|
||||
use phpOMS\Message\NotificationLevel;
|
||||
|
||||
/**
|
||||
* Api controller
|
||||
*
|
||||
* @package Modules\Shop
|
||||
* @license OMS License 1.0
|
||||
* @link http://website.orange-management.de
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class ApiController extends Controller
|
||||
{
|
||||
|
||||
}
|
||||
35
Controller/BackendController.php
Normal file
35
Controller/BackendController.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.2
|
||||
*
|
||||
* @package Modules\Shop
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://website.orange-management.de
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Shop\Controller;
|
||||
|
||||
use phpOMS\ApplicationAbstract;
|
||||
use phpOMS\Router\Router;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
use phpOMS\System\MimeType;
|
||||
use phpOMS\Message\NotificationLevel;
|
||||
|
||||
/**
|
||||
* Backend controller.
|
||||
*
|
||||
* @package Modules\Shop
|
||||
* @license OMS License 1.0
|
||||
* @link http://website.orange-management.de
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class BackendController extends Controller
|
||||
{
|
||||
|
||||
}
|
||||
80
Controller/Controller.php
Normal file
80
Controller/Controller.php
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.2
|
||||
*
|
||||
* @package Modules\Shop
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://website.orange-management.de
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Shop\Controller;
|
||||
|
||||
use Modules\Shop\Models\Shop;
|
||||
use phpOMS\Module\ModuleAbstract;
|
||||
use phpOMS\Module\WebInterface;
|
||||
|
||||
/**
|
||||
* Shop class.
|
||||
*
|
||||
* @package Modules\Shop
|
||||
* @license OMS License 1.0
|
||||
* @link http://website.orange-management.de
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Controller extends ModuleAbstract implements WebInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* Module path.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const MODULE_PATH = __DIR__ . '/../';
|
||||
|
||||
/**
|
||||
* Module version.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const MODULE_VERSION = '1.0.0';
|
||||
|
||||
/**
|
||||
* Module name.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const MODULE_NAME = 'Shop';
|
||||
|
||||
/**
|
||||
* Module id.
|
||||
*
|
||||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const MODULE_ID = 1007700000;
|
||||
|
||||
/**
|
||||
* Providing.
|
||||
*
|
||||
* @var string[]
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $providing = [
|
||||
];
|
||||
|
||||
/**
|
||||
* Dependencies.
|
||||
*
|
||||
* @var string[]
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $dependencies = [];
|
||||
}
|
||||
35
Controller/ShopController.php
Normal file
35
Controller/ShopController.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.2
|
||||
*
|
||||
* @package Modules\Shop
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://website.orange-management.de
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Shop\Controller;
|
||||
|
||||
use phpOMS\ApplicationAbstract;
|
||||
use phpOMS\Router\Router;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
use phpOMS\System\MimeType;
|
||||
use phpOMS\Message\NotificationLevel;
|
||||
|
||||
/**
|
||||
* Shop controller.
|
||||
*
|
||||
* @package Modules\Shop
|
||||
* @license OMS License 1.0
|
||||
* @link http://website.orange-management.de
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class ShopController extends Controller
|
||||
{
|
||||
|
||||
}
|
||||
2
Docs/introduction.md
Normal file
2
Docs/introduction.md
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# Introduction
|
||||
|
||||
33
Models/PermissionState.php
Normal file
33
Models/PermissionState.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.2
|
||||
*
|
||||
* @package Modules\Shop
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://website.orange-management.de
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Shop\Models;
|
||||
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Permision state enum.
|
||||
*
|
||||
* @package Modules\Shop
|
||||
* @license OMS License 1.0
|
||||
* @link http://website.orange-management.de
|
||||
* @since 1.0.0
|
||||
*/
|
||||
abstract class PermissionState extends Enum
|
||||
{
|
||||
public const ARTICLE = 1;
|
||||
public const BUYER = 2;
|
||||
public const SELLER = 3;
|
||||
public const SHOP = 4;
|
||||
}
|
||||
BIN
img/module_teaser_small.png
Normal file
BIN
img/module_teaser_small.png
Normal file
Binary file not shown.
38
info.json
Normal file
38
info.json
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"name": {
|
||||
"id": 1007700000,
|
||||
"internal": "Shop",
|
||||
"external": "Shop"
|
||||
},
|
||||
"category": "General",
|
||||
"version": "1.0.0",
|
||||
"requirements": {
|
||||
"phpOMS": "1.0.0",
|
||||
"phpOMS-db": "1.0.0"
|
||||
},
|
||||
"creator": {
|
||||
"name": "Orange Management",
|
||||
"website": "www.spl1nes.com"
|
||||
},
|
||||
"description": "The search module.",
|
||||
"directory": "Shop",
|
||||
"dependencies": {
|
||||
"Admin": "1.0.0"
|
||||
},
|
||||
"providing": {
|
||||
},
|
||||
"load": [
|
||||
{
|
||||
"pid": [
|
||||
"/"
|
||||
],
|
||||
"type": 4,
|
||||
"for": "Content",
|
||||
"file": "Shop",
|
||||
"from": "Admin"
|
||||
}
|
||||
],
|
||||
"lang": false,
|
||||
"js": true,
|
||||
"css": false
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user