shop.balmet.com

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

sitemap.php (3427B)


      1 <?php
      2 class ControllerInformationSitemap extends Controller {
      3 	public function index() {
      4 		$this->load->language('information/sitemap');
      5 
      6 		$this->document->setTitle($this->language->get('heading_title'));
      7 
      8 		$data['breadcrumbs'] = array();
      9 
     10 		$data['breadcrumbs'][] = array(
     11 			'text' => $this->language->get('text_home'),
     12 			'href' => $this->url->link('common/home')
     13 		);
     14 
     15 		$data['breadcrumbs'][] = array(
     16 			'text' => $this->language->get('heading_title'),
     17 			'href' => $this->url->link('information/sitemap')
     18 		);
     19 
     20 		$this->load->model('catalog/category');
     21 		$this->load->model('catalog/product');
     22 
     23 		$data['categories'] = array();
     24 
     25 		$categories_1 = $this->model_catalog_category->getCategories(0);
     26 
     27 		foreach ($categories_1 as $category_1) {
     28 			$level_2_data = array();
     29 
     30 			$categories_2 = $this->model_catalog_category->getCategories($category_1['category_id']);
     31 
     32 			foreach ($categories_2 as $category_2) {
     33 				$level_3_data = array();
     34 
     35 				$categories_3 = $this->model_catalog_category->getCategories($category_2['category_id']);
     36 
     37 				foreach ($categories_3 as $category_3) {
     38 					$level_3_data[] = array(
     39 						'name' => $category_3['name'],
     40 						'href' => $this->url->link('product/category', 'path=' . $category_1['category_id'] . '_' . $category_2['category_id'] . '_' . $category_3['category_id'])
     41 					);
     42 				}
     43 
     44 				$level_2_data[] = array(
     45 					'name'     => $category_2['name'],
     46 					'children' => $level_3_data,
     47 					'href'     => $this->url->link('product/category', 'path=' . $category_1['category_id'] . '_' . $category_2['category_id'])
     48 				);
     49 			}
     50 
     51 			$data['categories'][] = array(
     52 				'name'     => $category_1['name'],
     53 				'children' => $level_2_data,
     54 				'href'     => $this->url->link('product/category', 'path=' . $category_1['category_id'])
     55 			);
     56 		}
     57 
     58 		$data['special'] = $this->url->link('product/special');
     59 		$data['account'] = $this->url->link('account/account', '', true);
     60 		$data['edit'] = $this->url->link('account/edit', '', true);
     61 		$data['password'] = $this->url->link('account/password', '', true);
     62 		$data['address'] = $this->url->link('account/address', '', true);
     63 		$data['history'] = $this->url->link('account/order', '', true);
     64 		$data['download'] = $this->url->link('account/download', '', true);
     65 		$data['cart'] = $this->url->link('checkout/cart');
     66 		$data['checkout'] = $this->url->link('checkout/checkout', '', true);
     67 		$data['search'] = $this->url->link('product/search');
     68 		$data['contact'] = $this->url->link('information/contact');
     69 
     70 		$this->load->model('catalog/information');
     71 
     72 		$data['informations'] = array();
     73 
     74 		foreach ($this->model_catalog_information->getInformations() as $result) {
     75 			$data['informations'][] = array(
     76 				'title' => $result['title'],
     77 				'href'  => $this->url->link('information/information', 'information_id=' . $result['information_id'])
     78 			);
     79 		}
     80 
     81 		$data['column_left'] = $this->load->controller('common/column_left');
     82 		$data['column_right'] = $this->load->controller('common/column_right');
     83 		$data['content_top'] = $this->load->controller('common/content_top');
     84 		$data['content_bottom'] = $this->load->controller('common/content_bottom');
     85 		$data['footer'] = $this->load->controller('common/footer');
     86 		$data['header'] = $this->load->controller('common/header');
     87 
     88 		$this->response->setOutput($this->load->view('information/sitemap', $data));
     89 	}
     90 }