Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for ionCube Encoder)
- *
- * @ Version : 4.0.8.5
- * @ Author : DeZender
- * @ Release on : 25.03.2019
- * @ Official site : http://DeZender.Net
- *
- */
- namespace Module\Aldoc\Admin\Controller\Catalog;
- class LicenseCategory extends \Module\Core\Controller
- {
- private $curl;
- public $json = [];
- private $new_car_info = '';
- private $sync_file;
- public function __construct($registry, $module)
- {
- parent::__construct($registry, $module);
- $this->variables += $this->getAldocSettings();
- $this->module_load->model('aldoc', 'common/License', 'catalog');
- $this->sync_file = DIR_MODULE . $this->module . DS . 'Log' . DS . $this->sync_data_file;
- }
- public function getPage()
- {
- $data = [];
- $this->jade->loadTemplate('Catalog/Category');
- $this->load_language('Catalog/LicenseCategory');
- $breadcrumbs = [
- ['breadcrumb_text' => $this->data['text_home'], 'breadcrumb_href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)],
- ['breadcrumb_text' => $this->data['text_easymenu'] . ' >> ' . $this->data['heading_title'], 'breadcrumb_href' => $this->url->link('easyhosting/easyhosting/aldoc_categories', 'user_token=' . $this->session->data['user_token'], true)]
- ];
- $this->data['breadcrumbs'] = $this->jade->renderSubTemplateRecursive('aldoc_category/breadcrumbs', $breadcrumbs);
- $json['user_token'] = $this->session->data['user_token'];
- $this->data['aldoc_js'] = '<script type="text/javascript"><!--' . "\n" . $this->load_javascript('aldoc') . "\n" . 'var js_vars = ' . json_encode($json) . "\n" . '//--></script>';
- $data['easy_content'] = $this->jade->renderTemplate('aldoc_category', $this->data);
- $this->renderTwig($data);
- }
- private function renderTwig($data)
- {
- $data['header'] = $this->load->controller('common/header');
- $data['column_left'] = $this->load->controller('common/column_left');
- $data['footer'] = $this->load->controller('common/footer');
- $this->response->setOutput($this->load->view('easyhosting/skeleton', $data));
- }
- public function deleteAldocBase()
- {
- $this->model_aldoc_common_License->truncateTable('category_aldoc');
- $this->model_aldoc_common_License->truncateTable('save_aldoc_data');
- $this->clear_sync_data();
- $this->json['result'] = '(php response) Aldoc categorie-data gereset.' . "\n";
- $this->json['finished'] = 'finished';
- $this->response->setOutput(json_encode($this->json));
- }
- public function getAldocMenu()
- {
- ob_start();
- set_error_handler([$this, 'import_exception_error_handler']);
- if ($this->debug_xml) {
- $this->module_log = new \Module\Library\ModuleLog(DIR_MODULE . $this->module . DS . 'Log' . DS . $this->aldoc_log);
- }
- $this->curl_connect();
- $start_time = time();
- $start_microtime = microtime(true);
- $time_out = ini_get('max_execution_time');
- if (is_null($time_out) || !$time_out || ($time_out == 0)) {
- $time_out = $this->time_out;
- }
- $this->json['finished'] = '';
- $this->json['error'] = '';
- $this->json['result'] = '';
- $sync_data = $this->get_sync_data();
- if (!$sync_data) {
- $sync_data['data_name'] = 'truncate_aldoc_tables';
- $sync_data['limit'] = 0;
- $sync_data['start_time'] = $start_time;
- $this->set_sync_data($sync_data);
- }
- $max_exec_secs = (int) $time_out - (int) $this->break_time;
- if (15 < $max_exec_secs) {
- $max_exec_secs = 15;
- }
- $restart = false;
- while (!$this->json['error'] && ((time() - $start_time) < $max_exec_secs) && !$restart) {
- switch ($sync_data['data_name']) {
- case 'truncate_aldoc_tables':
- $this->truncate_aldoc_tables();
- $this->cache->delete('category');
- $this->cache->delete('product');
- $sync_data['data_name'] = 'get_menu_data';
- $this->set_sync_data($sync_data);
- $this->json['result'] .= 'Aldoc tabellen en cache geleegd' . "\n";
- break;
- case 'get_menu_data':
- $this->getMenuData();
- $sync_data['limit'] = 0;
- $sync_data['menu_data'] = json_encode($this->data['menu_data']);
- $sync_data['data_name'] = 'organize_menu';
- $this->set_sync_data($sync_data);
- $this->json['result'] .= 'Menu opgehaald bij Aldoc' . "\n";
- break;
- case 'organize_menu':
- if (!isset($this->data['menu_data']) || !$this->data['menu_data']) {
- $this->data['menu_data'] = json_decode($sync_data['menu_data'], true);
- }
- if ($this->data['menu_data']) {
- if (isset($this->data['menu_data']) && is_array($this->data['menu_data']['Menuitem'])) {
- $menu_data = [];
- $menu_code = 0;
- foreach ($this->data['menu_data']['Menuitem'] as $index => $menu_item) {
- if (((int) $menu_item['state'] == 1) || ((int) $menu_item['state'] == 2)) {
- $menu_code = $menu_item['menucode'];
- }
- if ($menu_item) {
- $menu_item['menu'] = ucfirst(strtolower($menu_item['menu']));
- $menu_data[$menu_code][] = $menu_item;
- }
- }
- $this->data['menu_data'] = [];
- $tmp_menu_data = [];
- foreach ($menu_data as $index => $values) {
- $menuitems = $values;
- usort($menuitems, [$this, 'cmp_menu']);
- $tmp_submenu = [];
- $tmp_submenu[0] = 'foo';
- foreach ($menuitems as $sub_index => $menu_item) {
- if (((int) $menu_item['state'] == 1) || ((int) $menu_item['state'] == 2)) {
- $tmp_submenu[0] = $menu_item;
- }
- else {
- $tmp_submenu[] = $menu_item;
- }
- }
- $tmp_menu_data[$index] = $tmp_submenu;
- }
- foreach ($tmp_menu_data as $menuitems) {
- foreach ($menuitems as $menu_item) {
- $this->data['menu_data'][] = $menu_item;
- ................................................
- ..............................
- ............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement