feat(oc2022): fix multi-menu grouping, PHP 5.6 catch compatibility, Gatekeeper V5 contacts and button styling

This commit is contained in:
nertyog 2026-10-12 05:35:43 +03:00
parent 44df0f8ac3
commit d41e8c87d9
6 changed files with 58 additions and 22 deletions

View File

@ -12,6 +12,9 @@
<search><![CDATA[$data['text_dashboard'] = $this->language->get('text_dashboard');]]></search>
<add position="before"><![CDATA[
try {
if (!isset($data['nat_sidebar_menus'])) {
$data['nat_sidebar_menus'] = array();
}
if (is_file(DIR_APPLICATION . 'controller/module/poll_widget_nat.php')) {
$this->load->model('setting/setting');
$nat_status = $this->config->get('module_poll_widget_nat_status');
@ -21,10 +24,15 @@
if ($nat_pos == 'sidebar' || $nat_pos == 'both') {
if ($this->user->hasPermission('access', 'module/poll_widget_nat')) {
$data['poll_widget_nat_href'] = $this->url->link('module/poll_widget_nat', 'token=' . $this->session->data['token'], 'SSL');
$data['nat_sidebar_menus'][] = array(
'name' => 'Poll Widget',
'href' => $data['poll_widget_nat_href']
);
}
}
}
}
} catch (\Exception $e) {
} catch (\Throwable $e) {
}
]]></add>
@ -35,7 +43,16 @@
<operation error="skip">
<search><![CDATA[<li id="catalog">]]></search>
<add position="before"><![CDATA[
<?php if (!empty($poll_widget_nat_href)) { ?>
<?php if (!empty($nat_sidebar_menus) && empty($nat_sidebar_menu_rendered)) { ?>
<?php $nat_sidebar_menu_rendered = true; ?>
<li id="menu-nat"><a class="parent"><i class="fa fa-space-shuttle fa-rotate-270 fw" style="color: #ec741c;"></i> <span>[NAT] Modules</span></a>
<ul>
<?php foreach ($nat_sidebar_menus as $n_item) { ?>
<li><a href="<?php echo $n_item['href']; ?>"><i class="fa fa-angle-right"></i> <?php echo $n_item['name']; ?></a></li>
<?php } ?>
</ul>
</li>
<?php } elseif (!empty($poll_widget_nat_href) && empty($nat_sidebar_menu_rendered)) { ?>
<li id="menu-nat"><a class="parent"><i class="fa fa-space-shuttle fa-rotate-270 fw" style="color: #ec741c;"></i> <span>[NAT] Modules</span></a>
<ul>
<li><a href="<?php echo $poll_widget_nat_href; ?>"><i class="fa fa-angle-right"></i> Poll Widget</a></li>

View File

@ -214,6 +214,7 @@ class ControllerModulePollWidgetNat extends Controller {
);
}
}
} catch (\Exception $e) {
} catch (\Throwable $e) {
}
@ -260,6 +261,8 @@ class ControllerModulePollWidgetNat extends Controller {
$this->response->redirect($this->url->link('module/poll_widget_nat', 'token=' . $this->session->data['token'], true));
}
}
} catch (\Exception $e) {
$this->error['warning'] = $e->getMessage();
} catch (\Throwable $e) {
$this->error['warning'] = $e->getMessage();
}
@ -289,6 +292,8 @@ class ControllerModulePollWidgetNat extends Controller {
$this->response->redirect($this->url->link('module/poll_widget_nat', 'token=' . $this->session->data['token'], true));
}
}
} catch (\Exception $e) {
$this->error['warning'] = $e->getMessage();
} catch (\Throwable $e) {
$this->error['warning'] = $e->getMessage();
}
@ -312,6 +317,8 @@ class ControllerModulePollWidgetNat extends Controller {
$this->session->data['success'] = $this->language->get('text_success');
}
}
} catch (\Exception $e) {
$this->error['warning'] = $e->getMessage();
} catch (\Throwable $e) {
$this->error['warning'] = $e->getMessage();
}
@ -384,6 +391,7 @@ class ControllerModulePollWidgetNat extends Controller {
}
}
}
} catch (\Exception $e) {
} catch (\Throwable $e) {
}
@ -395,6 +403,8 @@ class ControllerModulePollWidgetNat extends Controller {
} elseif ($poll_id) {
try {
$data['poll_description'] = isset($this->model_module_poll_widget_nat) ? $this->model_module_poll_widget_nat->getPollDescriptions($poll_id) : array();
} catch (\Exception $e) {
$data['poll_description'] = array();
} catch (\Throwable $e) {
$data['poll_description'] = array();
}
@ -470,6 +480,7 @@ class ControllerModulePollWidgetNat extends Controller {
);
}
}
} catch (\Exception $e) {
} catch (\Throwable $e) {
}
}

View File

@ -21,7 +21,7 @@
</div>
<?php } ?>
<div class="panel panel-default">
<div class="panel-heading" style="background: #2c3e50; color: white;">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-pencil"></i> <?php echo $text_edit; ?></h3>
</div>
<div class="panel-body">

View File

@ -125,43 +125,47 @@
color: #ffffff !important;
}
/* Кнопка Телеграм бота */
.nat-btn-bot {
background: #0284c7 !important;
border: 1px solid #0284c7 !important;
/* Главная кнопка Telegram-бота (38px) */
.nat-btn-bot,
.nat-btn-bot:link,
.nat-btn-bot:visited {
height: 38px !important;
line-height: 20px !important;
padding: 8px 16px !important;
background: #0088cc !important;
border-color: #0088cc !important;
color: #ffffff !important;
height: 44px !important;
line-height: 42px !important;
padding: 0 20px !important;
font-size: 14px !important;
font-weight: 700 !important;
font-size: 14px !important;
border-radius: 6px !important;
box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25) !important;
transition: all 0.2s !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
gap: 8px !important;
text-decoration: none !important;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35) !important;
box-shadow: 0 3px 10px rgba(0, 136, 204, 0.3) !important;
box-sizing: border-box !important;
}
.nat-btn-bot:hover {
background: #0369a1 !important;
border-color: #0369a1 !important;
.nat-btn-bot:hover,
.nat-btn-bot:focus,
.nat-btn-bot:active {
background: #006da3 !important;
border-color: #006da3 !important;
color: #ffffff !important;
transform: translateY(-1px);
text-decoration: none !important;
}
/* Блок правил */
.nat-gk-rules {
background: #fff7ed;
background: rgba(236, 116, 28, 0.05);
border-left: 3px solid #ec741c;
padding: 10px 14px;
border-radius: 0 6px 6px 0;
border-radius: 4px;
margin-bottom: 22px;
font-size: 12px;
color: #7c2d12;
line-height: 1.5;
color: #64748b;
}
.nat-gk-rules p {
margin: 0;
@ -443,11 +447,11 @@ body.nat-dark-mode .nat-license-status-badge {
<a href="https://t.me/natodua_hosting_bot?start=lic_<?php echo $nat_current_domain; ?>" target="_blank" rel="noopener noreferrer" class="btn btn-default nat-contact-btn">
<i class="fa fa-paper-plane text-primary"></i> Telegram-бот
</a>
<a href="https://t.me/nat_support" target="_blank" rel="noopener noreferrer" class="btn btn-default nat-contact-btn">
<i class="fa fa-paper-plane text-info"></i> Підтримка
<a href="https://t.me/natodua" target="_blank" rel="noopener noreferrer" class="btn btn-default nat-contact-btn">
<i class="fa fa-paper-plane" style="color: #229ed9;"></i> @natodua
</a>
<a href="https://opencartforum.com/ru/files/developer/725443-nertyod/" target="_blank" rel="noopener noreferrer" class="btn btn-default nat-contact-btn">
<i class="fa fa-comments text-warning"></i> Профіль
<i class="fa fa-comments text-warning"></i> Форум
</a>
<a href="mailto:info@nat.od.ua" class="btn btn-default nat-contact-btn">
<i class="fa fa-envelope text-danger"></i> info@nat.od.ua

View File

@ -118,6 +118,8 @@ class ControllerModulePollWidgetNat extends Controller {
} else {
return $this->load->view('module/poll_widget_nat', $data);
}
} catch (\Exception $e) {
return false;
} catch (\Throwable $e) {
return false;
}
@ -204,6 +206,8 @@ class ControllerModulePollWidgetNat extends Controller {
} else {
$json['error'] = $this->language->get('error_select');
}
} catch (\Exception $e) {
$json['error'] = $e->getMessage();
} catch (\Throwable $e) {
$json['error'] = $e->getMessage();
}