mirror of
https://github.com/Karaka-Management/oms-Marketing.git
synced 2026-02-10 23:48:40 +00:00
Init
This commit is contained in:
commit
b9678adddc
38
Admin/Install/Navigation.php
Normal file
38
Admin/Install/Navigation.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?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 Modules\Marketing\Admin\Install;
|
||||
|
||||
/**
|
||||
* Navigation class.
|
||||
*
|
||||
* @category Modules
|
||||
* @package Modules\Admin
|
||||
* @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
|
||||
*/
|
||||
class Navigation
|
||||
{
|
||||
public static function install($dbPool)
|
||||
{
|
||||
$navData = json_decode(file_get_contents(__DIR__ . '/nav.install.json'), true);
|
||||
|
||||
$class = '\\Modules\\Navigation\\Admin\\Installer';
|
||||
$class::installExternal($dbPool, $navData);
|
||||
}
|
||||
}
|
||||
110
Admin/Install/nav.install.json
Normal file
110
Admin/Install/nav.install.json
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
[
|
||||
{
|
||||
"id": 1001901001,
|
||||
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
|
||||
"type": 2,
|
||||
"subtype": 0,
|
||||
"name": "Marketing",
|
||||
"uri": "/{/lang}/backend/marketing/dashboard",
|
||||
"target": "self",
|
||||
"icon": "fa fa-paint-brush",
|
||||
"order": 60,
|
||||
"from": 1001900000,
|
||||
"permission": null,
|
||||
"parent": 1000201001,
|
||||
"children": [
|
||||
{
|
||||
"id": 1001902001,
|
||||
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
|
||||
"type": 2,
|
||||
"subtype": 1,
|
||||
"name": "Promotions",
|
||||
"uri": "/{/lang}/backend/marketing/promotion/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 1,
|
||||
"from": 1001900000,
|
||||
"permission": null,
|
||||
"parent": 1001901001,
|
||||
"children": [
|
||||
{
|
||||
"id": 1001902101,
|
||||
"pid": "5c1412dc489ced2edd20a6883bf5a394011f5235",
|
||||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "List",
|
||||
"uri": "/{/lang}/backend/marketing/promotion/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 1,
|
||||
"from": 1001900000,
|
||||
"permission": null,
|
||||
"parent": 1001902001,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"id": 1001902201,
|
||||
"pid": "5c1412dc489ced2edd20a6883bf5a394011f5235",
|
||||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Create",
|
||||
"uri": "/{/lang}/backend/marketing/promotion/create",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 1,
|
||||
"from": 1001900000,
|
||||
"permission": null,
|
||||
"parent": 1001902001,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1001903001,
|
||||
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
|
||||
"type": 2,
|
||||
"subtype": 1,
|
||||
"name": "Events",
|
||||
"uri": "/{/lang}/backend/marketing/event/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 5,
|
||||
"from": 1001900000,
|
||||
"permission": null,
|
||||
"parent": 1001901001,
|
||||
"children": [
|
||||
{
|
||||
"id": 1001903101,
|
||||
"pid": "083a414f7b324d073baab24daeab1a7d99d2bb8f",
|
||||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "List",
|
||||
"uri": "/{/lang}/backend/marketing/event/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 1,
|
||||
"from": 1001900000,
|
||||
"permission": null,
|
||||
"parent": 1001902001,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"id": 1001903201,
|
||||
"pid": "083a414f7b324d073baab24daeab1a7d99d2bb8f",
|
||||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Create",
|
||||
"uri": "/{/lang}/backend/marketing/event/create",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 1,
|
||||
"from": 1001900000,
|
||||
"permission": null,
|
||||
"parent": 1001902001,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
59
Admin/Installer.php
Normal file
59
Admin/Installer.php
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<?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 Modules\Marketing\Admin;
|
||||
|
||||
use phpOMS\DataStorage\Database\DatabaseType;
|
||||
use phpOMS\DataStorage\Database\Pool;
|
||||
use phpOMS\Module\InstallerAbstract;
|
||||
|
||||
/**
|
||||
* Marketing install class.
|
||||
*
|
||||
* @category Modules
|
||||
* @package Modules\Marketing
|
||||
* @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
|
||||
*/
|
||||
class Installer extends InstallerAbstract
|
||||
{
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function install(Pool $dbPool, array $info)
|
||||
{
|
||||
parent::install($dbPool, $info);
|
||||
|
||||
switch ($dbPool->get('core')->getType()) {
|
||||
case DatabaseType::MYSQL:
|
||||
$dbPool->get('core')->con->prepare(
|
||||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'marketing_promotion` (
|
||||
`marketing_promotion_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`marketing_promotion_name` varchar(30) NOT NULL,
|
||||
`marketing_promotion_description` text DEFAULT NULL,
|
||||
`marketing_promotion_start` datetime DEFAULT NULL,
|
||||
`marketing_promotion_end` datetime DEFAULT NULL,
|
||||
`marketing_promotion_type` tinyint(1) DEFAULT NULL,
|
||||
PRIMARY KEY (`marketing_promotion_id`)
|
||||
)ENGINE=InnoDB DEFAULT CHARSET=utf8;'
|
||||
)->execute();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
189
Controller.php
Normal file
189
Controller.php
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
<?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 Modules\Marketing;
|
||||
|
||||
use Modules\Navigation\Models\Navigation;
|
||||
use Modules\Navigation\Views\NavigationView;
|
||||
use phpOMS\Contract\RenderableInterface;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\RequestDestination;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
use phpOMS\Module\ModuleAbstract;
|
||||
use phpOMS\Module\WebInterface;
|
||||
use phpOMS\Views\View;
|
||||
use phpOMS\Views\ViewLayout;
|
||||
|
||||
/**
|
||||
* Marketing controller class.
|
||||
*
|
||||
* @category Modules
|
||||
* @package Modules\Marketing
|
||||
* @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
|
||||
*/
|
||||
class Controller extends ModuleAbstract implements WebInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* Module name.
|
||||
*
|
||||
* @var \string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $module = 'Marketing';
|
||||
|
||||
/**
|
||||
* Localization files.
|
||||
*
|
||||
* @var \string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $localization = [
|
||||
RequestDestination::BACKEND => ['backend'],
|
||||
];
|
||||
|
||||
/**
|
||||
* Providing.
|
||||
*
|
||||
* @var \string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $providing = [
|
||||
'Content',
|
||||
];
|
||||
|
||||
/**
|
||||
* Dependencies.
|
||||
*
|
||||
* @var \string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $dependencies = [];
|
||||
|
||||
/**
|
||||
* Routing elements.
|
||||
*
|
||||
* @var array
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $routes = [
|
||||
'^.*/backend/marketing/promotion/list.*$' => [['dest' => '\Modules\Marketing\Controller:viewMarketingPromotionList', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
|
||||
'^.*/backend/marketing/promotion/create.*$' => [['dest' => '\Modules\Marketing\Controller:viewMarketingPromotionCreate', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
|
||||
'^.*/backend/marketing/event/list.*$' => [['dest' => '\Modules\Marketing\Controller:viewMarketingEventList', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
|
||||
'^.*/backend/marketing/event/create.*$' => [['dest' => '\Modules\Marketing\Controller:viewMarketingEventCreate', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
|
||||
];
|
||||
|
||||
/**
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param mixed $data Generic data
|
||||
*
|
||||
* @return RenderableInterface
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function viewMarketingPromotionList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app, $request, $response);
|
||||
$view->setTemplate('/Modules/Marketing/Theme/backend/promotion-list');
|
||||
$view->addData('nav', $this->createNavigation(1001902001, $request, $response));
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param mixed $data Generic data
|
||||
*
|
||||
* @return RenderableInterface
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function viewMarketingPromotionCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app, $request, $response);
|
||||
$view->setTemplate('/Modules/Marketing/Theme/backend/promotion-create');
|
||||
$view->addData('nav', $this->createNavigation(1000706001, $request, $response));
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param mixed $data Generic data
|
||||
*
|
||||
* @return RenderableInterface
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function viewMarketingEventList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app, $request, $response);
|
||||
$view->setTemplate('/Modules/Marketing/Theme/backend/event-list');
|
||||
$view->addData('nav', $this->createNavigation(1000706001, $request, $response));
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param mixed $data Generic data
|
||||
*
|
||||
* @return RenderableInterface
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function viewMarketingEventCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app, $request, $response);
|
||||
$view->setTemplate('/Modules/Marketing/Theme/backend/event-create');
|
||||
$view->addData('nav', $this->createNavigation(1000706001, $request, $response));
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $pageId Page/parent Id for navigation
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
*
|
||||
* @return RenderableInterface
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private function createNavigation(\int $pageId, RequestAbstract $request, ResponseAbstract $response)
|
||||
{
|
||||
$nav = Navigation::getInstance($request, $this->app->dbPool);
|
||||
$navView = new NavigationView($this->app, $request, $response);
|
||||
$navView->setTemplate('/Modules/Navigation/Theme/backend/mid');
|
||||
$navView->setNav($nav->getNav());
|
||||
$navView->setLanguage($request->getL11n()->language);
|
||||
$navView->setParent($pageId);
|
||||
|
||||
return $navView;
|
||||
}
|
||||
}
|
||||
0
Theme/backend/event-create.tpl.php
Normal file
0
Theme/backend/event-create.tpl.php
Normal file
0
Theme/backend/event-list.tpl.php
Normal file
0
Theme/backend/event-list.tpl.php
Normal file
0
Theme/backend/event-profile.tpl.php
Normal file
0
Theme/backend/event-profile.tpl.php
Normal file
0
Theme/backend/promotion-create.tpl.php
Normal file
0
Theme/backend/promotion-create.tpl.php
Normal file
16
Theme/backend/promotion-list.tpl.php
Normal file
16
Theme/backend/promotion-list.tpl.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?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
|
||||
*/
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
0
Theme/backend/promotion-profile.tpl.php
Normal file
0
Theme/backend/promotion-profile.tpl.php
Normal file
17
Theme/lang/api.en.lang.php
Normal file
17
Theme/lang/api.en.lang.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?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
|
||||
*/
|
||||
$MODLANG[1] = [
|
||||
];
|
||||
17
Theme/lang/backend.en.lang.php
Normal file
17
Theme/lang/backend.en.lang.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?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
|
||||
*/
|
||||
$MODLANG['Marketing'] = [
|
||||
];
|
||||
22
Theme/lang/nav.backend.en.lang.php
Normal file
22
Theme/lang/nav.backend.en.lang.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?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
|
||||
*/
|
||||
$MODLANG['Navigation'] = [
|
||||
'Analysis' => 'Analysis',
|
||||
'Create' => 'Create',
|
||||
'Events' => 'Events',
|
||||
'Marketing' => 'Marketing',
|
||||
'Promotions' => 'Promotions',
|
||||
];
|
||||
BIN
img/module_teaser_small.png
Normal file
BIN
img/module_teaser_small.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
51
info.json
Normal file
51
info.json
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
"name": {
|
||||
"id": 1001900000,
|
||||
"internal": "Marketing",
|
||||
"external": "OMS Marketing"
|
||||
},
|
||||
"version": "1.0.0",
|
||||
"requirements": {
|
||||
"phpOMS": "1.0.0",
|
||||
"phpOMS-db": "1.0.0"
|
||||
},
|
||||
"creator": {
|
||||
"name": "Orange Management",
|
||||
"website": "www.spl1nes.com"
|
||||
},
|
||||
"description": "Marketing module.",
|
||||
"directory": "Marketing",
|
||||
"dependencies": {},
|
||||
"providing": {
|
||||
"Navigation": "*"
|
||||
},
|
||||
"load": [
|
||||
{
|
||||
"pid": [
|
||||
"86580a45c595de69f4c48de08117379cdfa43e47"
|
||||
],
|
||||
"type": 4,
|
||||
"for": 0,
|
||||
"from": "Marketing",
|
||||
"file": "Marketing"
|
||||
},
|
||||
{
|
||||
"pid": [
|
||||
"754a08ddf8bcb1cf22f310f09206dd783d42f7dd"
|
||||
],
|
||||
"type": 5,
|
||||
"from": "Marketing",
|
||||
"for": "Navigation",
|
||||
"file": "nav.backend"
|
||||
},
|
||||
{
|
||||
"pid": [
|
||||
"86580a45c595de69f4c48de08117379cdfa43e47"
|
||||
],
|
||||
"type": 5,
|
||||
"for": "Content",
|
||||
"file": "backend",
|
||||
"from": "Marketing"
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user