HEX
Server: LiteSpeed
System: Linux php-prod-3.spaceapp.ru 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: sarli3128 (1010)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /home/retile.ru/public_html/catalog/controller/extension/module/uni_news_category.php
<?php
class ControllerExtensionModuleUniNewsCategory extends Controller {
	public function index($setting) {
		static $module = 0;
		
		$this->load->language('extension/module/uni_othertext');
		$this->load->language('extension/module/uni_news');
		
		$this->load->model('extension/module/uni_news');
		
		$lang_id = $this->config->get('config_language_id');
		$store_id = (int)$this->config->get('config_store_id');
		
		if (isset($this->request->get['news_path'])) {
			$data['category_arr'] = explode('_', (string)$this->request->get['news_path']);
		} else {
			$data['category_arr'] = [];
		}
		
		$cache_name = 'unishop.news.category.module.'.$lang_id.'.'.$store_id;
		
		$data['categories'] = $this->cache->get($cache_name);
		
		if(!$data['categories']) {
			
			$categories = $this->model_extension_module_uni_news->getCategories();

			foreach ($categories as $category) {
				
				$children_data = [];

				$children = $this->model_extension_module_uni_news->getCategories($category['category_id']);
				
				if($children) {
					foreach($children as $child) {
						$children_data[] = array(
							'category_id' => $child['category_id'],
							'name' 		  => $child['name'],
							'href'		  => $this->url->link('information/uni_news', 'news_path='.$category['category_id'].'_'.$child['category_id'])
						);
					}
				}

				$data['categories'][] = array(
					'category_id' => $category['category_id'],
					'name'        => $category['name'],
					'children'	  => $children_data,
					'href'     	  => $this->url->link('information/uni_news', 'news_path='.$category['category_id']),
				);
			}
		
			if($data['categories']) {
				$this->cache->set($cache_name, $data['categories']);
			}
		}
		
		$data['module'] = $module++;

		return $this->load->view('extension/module/uni_news_category', $data);
	}
}
?>