shop.balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

content_bottom.php (2143B)


      1 <?php
      2 class ControllerCommonContentBottom extends Controller {
      3 	public function index() {
      4 		$this->load->model('design/layout');
      5 
      6 		if (isset($this->request->get['route'])) {
      7 			$route = (string)$this->request->get['route'];
      8 		} else {
      9 			$route = 'common/home';
     10 		}
     11 
     12 		$layout_id = 0;
     13 
     14 		if ($route == 'product/category' && isset($this->request->get['path'])) {
     15 			$this->load->model('catalog/category');
     16 
     17 			$path = explode('_', (string)$this->request->get['path']);
     18 
     19 			$layout_id = $this->model_catalog_category->getCategoryLayoutId(end($path));
     20 		}
     21 
     22 		if ($route == 'product/product' && isset($this->request->get['product_id'])) {
     23 			$this->load->model('catalog/product');
     24 
     25 			$layout_id = $this->model_catalog_product->getProductLayoutId($this->request->get['product_id']);
     26 		}
     27 
     28 		if ($route == 'information/information' && isset($this->request->get['information_id'])) {
     29 			$this->load->model('catalog/information');
     30 
     31 			$layout_id = $this->model_catalog_information->getInformationLayoutId($this->request->get['information_id']);
     32 		}
     33 
     34 		if (!$layout_id) {
     35 			$layout_id = $this->model_design_layout->getLayout($route);
     36 		}
     37 
     38 		if (!$layout_id) {
     39 			$layout_id = $this->config->get('config_layout_id');
     40 		}
     41 
     42 		$this->load->model('setting/module');
     43 
     44 		$data['modules'] = array();
     45 
     46 		$modules = $this->model_design_layout->getLayoutModules($layout_id, 'content_bottom');
     47 
     48 		foreach ($modules as $module) {
     49 			$part = explode('.', $module['code']);
     50 
     51 			if (isset($part[0]) && $this->config->get('module_' . $part[0] . '_status')) {
     52 				$module_data = $this->load->controller('extension/module/' . $part[0]);
     53 
     54 				if ($module_data) {
     55 					$data['modules'][] = $module_data;
     56 				}
     57 			}
     58 
     59 			if (isset($part[1])) {
     60 				$setting_info = $this->model_setting_module->getModule($part[1]);
     61 
     62 				if ($setting_info && $setting_info['status']) {
     63 					$output = $this->load->controller('extension/module/' . $part[0], $setting_info);
     64 
     65 					if ($output) {
     66 						$data['modules'][] = $output;
     67 					}
     68 				}
     69 			}
     70 		}
     71 
     72 		return $this->load->view('common/content_bottom', $data);
     73 	}
     74 }