Skip to content

Commit

Permalink
fix install thirty bees
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaspijak committed Nov 6, 2018
1 parent eac2d0c commit 768d02c
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 14 deletions.
19 changes: 16 additions & 3 deletions bulkgate_thirtybees.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @author Lukáš Piják 2018 TOPefekt s.r.o.
* @link https://www.bulkgate.com/
*/
class BulkGate_Thirtybees extends Module
class BulkGate_ThirtyBees extends Module
{
/** @var ThirtyBeesSms\DIContainer */
private $ps_di;
Expand Down Expand Up @@ -41,7 +41,7 @@ public function __construct()
$this->ps_translator = $this->ps_di->getTranslator();

$this->displayName = _BULKGATE_NAME_;
$this->description = $this->l('Extend your PrestaShop store capabilities. Send personalized bulk SMS messages. Notify your customers about order status via customer SMS notifications. Receive order updates via Admin SMS notifications.');
$this->description = $this->l('Extend your ThirtyBees store capabilities. Send personalized bulk SMS messages. Notify your customers about order status via customer SMS notifications. Receive order updates via Admin SMS notifications.');

$this->confirmUninstall = $this->l('Are you sure you want to uninstall this module?');

Expand All @@ -63,8 +63,8 @@ public function install()
{
$install = parent::install();
$this->ps_settings->install();
ThirtyBeesSms\Helpers::installMenu($this->ps_translator);
$this->installHooks();
ThirtyBeesSms\Helpers::installMenu($this->ps_translator);

return $install;
}
Expand Down Expand Up @@ -96,6 +96,19 @@ public function installHooks()
$this->registerHook('actionBulkGateSendSms');
$this->registerHook('actionBulkGateExtendsVariables');
$this->registerHook('displayAdminOrderRight');
$this->registerHook('displayBackOfficeHeader');
}


public function hookDisplayBackOfficeHeader()
{
/** @var Controller $controller */
$controller = $this->context->controller;

if($controller instanceof Controller && $this instanceof ModuleCore)
{
$controller->addCSS($this->getPathUri().'css/menu.css');
}
}


Expand Down
29 changes: 29 additions & 0 deletions css/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
/**
* Copyright (C) 2018 thirty bees
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@thirtybees.com so we can send you a copy immediately.
*
* @author thirty bees <modules@thirtybees.com>
* @copyright 2018 thirty bees
* @license Academic Free License (AFL 3.0)
*/

header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');

header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');

header('Location: ../');

exit;
13 changes: 13 additions & 0 deletions css/menu.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

.icon-BULKGATE {
text-align: center;
width: 1.28571em;
}

.icon-BULKGATE:hover {
text-align: center;
}

.icon-BULKGATE:before {
content: "\f003";
}
Binary file modified logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 10 additions & 8 deletions thirtybees/src/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ public static function generateTokens()

$result = \Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('SELECT `id_tab`, `class_name`, `module` FROM `'._DB_PREFIX_.'tab` WHERE `module` = \''._BULKGATE_SLUG_.'\'', true, false);

if (is_array($result)) {
foreach ($result as $row) {
if (is_array($result))
{
foreach ($result as $row)
{
$output[$row['class_name']] = \Tools::getAdminToken($row['class_name'].(int)$row['id_tab'].(int)\Context::getContext()->employee->id);
}
}
Expand All @@ -62,7 +64,7 @@ public static function installMenu(Extensions\Translator $translator)
{
$main = Helpers::installModuleTab('BULKGATE', $translator->translate('bulkgate', 'BulkGate'), 0, 'mail_outline');

$dashboard = Helpers::installModuleTab('AdminBulkGateDashboardDefault', $translator->translate('dashboard','Dashboard'), $main, 'desktop_windows');
$dashboard = Helpers::installModuleTab('AdminBulkGateDashboardDefault', $translator->translate('dashboard','Dashboard'), $main);

Helpers::installModuleTab('AdminBulkGateSmsCampaignNew', $translator->translate('start_campaign','Start Campaign'), $main);
Helpers::installModuleTab('AdminBulkGateSmsCampaignDefault', $translator->translate('campaigns','Campaigns'), $main);
Expand All @@ -84,11 +86,11 @@ public static function installMenu(Extensions\Translator $translator)

Helpers::installModuleTab('AdminBulkGateAboutDefault', $translator->translate('about_module','About module'), $main);

Helpers::installModuleTab('AdminBulkGateSignIn', '', $dashboard);
Helpers::installModuleTab('AdminBulkGateSignUp', '', $dashboard);
Helpers::installModuleTab('AdminBulkGateSmsCampaignCampaign', '', $dashboard);
Helpers::installModuleTab('AdminBulkGateSmsCampaignActive', '', $dashboard);
Helpers::installModuleTab('AdminBulkGateBlackListImport', '', $dashboard);
Helpers::installModuleTab('AdminBulkGateSignIn', 'SignIn', $dashboard);
Helpers::installModuleTab('AdminBulkGateSignUp', 'SignUp', $dashboard);
Helpers::installModuleTab('AdminBulkGateSmsCampaignCampaign', 'SmsCampaignCampaign', $dashboard);
Helpers::installModuleTab('AdminBulkGateSmsCampaignActive', 'SmsCampaignActive', $dashboard);
Helpers::installModuleTab('AdminBulkGateBlackListImport', 'BlackListImport', $dashboard);
}

public static function uninstallMenu()
Expand Down
6 changes: 3 additions & 3 deletions thirtybees/src/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
* @link https://www.bulkgate.com/
*/

define('_BULKGATE_DIR_', __DIR__.'/../../');
define('_BULKGATE_SLUG_', 'bulkgate_thirtybees');
define('_BULKGATE_DIR_', _PS_MODULE_DIR_.'/'._BULKGATE_SLUG_);

define('_BULKGATE_NAME_', 'BulkGate');
define('_BULKGATE_AUTHOR_', 'TOPefekt s.r.o.');
define('_BULKGATE_AUTHOR_', 'BulkGate.com');
define('_BULKGATE_AUTHOR_URL_', 'https://www.bulkgate.com/');
define('_BULKGATE_PS_MIN_VERSION_', '1.0.0.0');
define('_BULKGATE_SLUG_', 'bulkgate_thirtybees');
define('_BULKGATE_VERSION_', '1.0.0');
define('_BULKGATE_DEMO_', false);

Expand Down

0 comments on commit 768d02c

Please sign in to comment.