@ademar26

Почему контроллер не отдает на отрисовку Opencart 2.0?

Есть модуль всплывающего окна. По непонятным причинам контроллер не отдает на отрисовку в админкий шаблон модуля. Данные в контроллере присутствуют. В чем может проблема?
<?php
class ControllerModulePopUpByKj extends Controller
{
    private $error = array();
    public function index()
    {
        $this->load->language('module/popup_by_kj');
        $this->document->setTitle($this->language->get('heading_title'));
        $this->load->model('extension/module');
        if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate())
        {
            if (!isset($this->request->get['module_id']))
            {				
                $this->model_extension_module->addModule('popup_by_kj', $this->request->post);
            } else
            {
				
                $this->model_extension_module->editModule($this->request->get['module_id'], $this->request->post);
            }

            $this->session->data['success'] = $this->language->get('text_success');

            $this->response->redirect($this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL'));
        }
		

        $data['heading_title'] = $this->language->get('heading_title');

        $data['text_edit'] = $this->language->get('text_edit');
        $data['text_enabled'] = $this->language->get('text_enabled');
        $data['text_disabled'] = $this->language->get('text_disabled');
        $data['entry_help_effect_duration'] = $this->language->get('entry_help_effect_duration');
        $data['entry_help_max_width'] = $this->language->get('entry_help_max_width');
        $data['entry_help_action_argument'] = $this->language->get('entry_help_action_argument');
        $data['entry_all_user'] = $this->language->get('entry_all_user');
        $data['entry_name'] = $this->language->get('entry_name');
        $data['entry_action'] = $this->language->get('entry_action');
        $data['entry_action_argument'] = $this->language->get('entry_action_argument');
        $data['entry_max_width'] = $this->language->get('entry_max_width');
        $data['entry_content'] = $this->language->get('entry_content');
        $data['entry_effect'] = $this->language->get('entry_effect');
        $data['entry_bg_effect'] = $this->language->get('entry_bg_effect');
        $data['entry_effect_duration'] = $this->language->get('entry_effect_duration');
        $data['entry_bg_effect_duration'] = $this->language->get('entry_bg_effect_duration');
        $data['entry_custom_css'] = $this->language->get('entry_custom_css');
        $data['entry_status'] = $this->language->get('entry_status');
        $data['entry_customer_group'] = $this->language->get('entry_customer_group');
        $data['entry_customer_group'] = $this->language->get('entry_customer_group');
        $data['button_save'] = $this->language->get('button_save');
        $data['button_cancel'] = $this->language->get('button_cancel');

        $effects = array(
            'clip' => 'clip',
            'blind' => 'blind',
            'bounce' => 'bounce',
            'drop' => 'drop',
            'fade' => 'fade',
            'fold' => 'fold',
            'highlight' => 'highlight',
            'puff' => 'puff',
            'pulsate' => 'pulsate',
            'scale' => 'scale',
            'shake' => 'shake',
            'size' => 'size',
            'slide' => 'slide'
        );

        $actions = array(
            'timeout' => $this->language->get('entry_action_timeout'),
            'click' => $this->language->get('entry_action_click'),
            'onMouseOver' => $this->language->get('entry_action_onMouseOver'),
        );

        $this->load->model('customer/customer_group');
        $data['customer_groups'] = $this->model_customer_customer_group->getCustomerGroups();
        $data['effects'] = $effects;
        $data['actions'] = $actions;

        if (isset($this->error['warning']))
        {
            $data['error_warning'] = $this->error['warning'];
        } else
        {
            $data['error_warning'] = '';
        }

        if (isset($this->error['name']))
        {
            $data['error_name'] = $this->error['name'];
        } else
        {
            $data['error_name'] = '';
        }

        if (isset($this->error['error_effect_duration']))
        {
            $data['error_effect_duration'] = $this->error['error_effect_duration'];
        } else
        {
            $data['error_effect_duration'] = '';
        }

        if (isset($this->error['error_bg_effect_duration']))
        {
            $data['error_bg_effect_duration'] = $this->error['error_bg_effect_duration'];
        } else
        {
            $data['error_bg_effect_duration'] = '';
        }

        if (isset($this->error['error_action_argument']))
        {
            $data['error_action_argument'] = $this->error['error_action_argument'];
        } else
        {
            $data['error_action_argument'] = '';
        }
        if (isset($this->error['error_max_width']))
        {
            $data['error_max_width'] = $this->error['error_max_width'];
        } else
        {
            $data['error_max_width'] = '';
        }
        $data['breadcrumbs'] = array();

        $data['breadcrumbs'][] = array(
            'text' => $this->language->get('text_home'),
            'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], 'SSL')
        );

        $data['breadcrumbs'][] = array(
            'text' => $this->language->get('text_module'),
            'href' => $this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL')
        );

        if (!isset($this->request->get['module_id']))
        {
            $data['breadcrumbs'][] = array(
                'text' => $this->language->get('heading_title'),
                'href' => $this->url->link('module/popup_by_kj', 'token=' . $this->session->data['token'], 'SSL')
            );
        } else
        {
            $data['breadcrumbs'][] = array(
                'text' => $this->language->get('heading_title'),
                'href' => $this->url->link('module/popup_by_kj', 'token=' . $this->session->data['token'] . '&module_id=' . $this->request->get['module_id'], 'SSL')
            );
        }

        if (!isset($this->request->get['module_id']))
        {
            $data['action'] = $this->url->link('module/popup_by_kj', 'token=' . $this->session->data['token'], 'SSL');
        } else
        {
            $data['action'] = $this->url->link('module/popup_by_kj', 'token=' . $this->session->data['token'] . '&module_id=' . $this->request->get['module_id'], 'SSL');
        }

        $data['cancel'] = $this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL');

        if (isset($this->request->get['module_id']) && ($this->request->server['REQUEST_METHOD'] != 'POST'))
        {
            $module_info = $this->model_extension_module->getModule($this->request->get['module_id']);
        }
        if (isset($this->request->post['name']))
        {
            $data['name'] = $this->request->post['name'];
        } elseif (!empty($module_info))
        {
            $data['name'] = $module_info['name'];
        } else
        {
            $data['name'] = '';
        }

        if (isset($this->request->post['actionn']))
        {
            $data['actionn'] = $this->request->post['actionn'];
        } elseif (!empty($module_info))
        {
            $data['actionn'] = $module_info['actionn'];
        } else
        {
            $data['actionn'] = '';
        }
  • Вопрос задан
  • 142 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы