shop.balmet.com

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

header.php (3541B)


      1 <?php
      2 class ControllerCommonHeader extends Controller {
      3 	public function index() {
      4 		// Analytics
      5 		$this->load->model('setting/extension');
      6 
      7 		$data['analytics'] = array();
      8 
      9 		$analytics = $this->model_setting_extension->getExtensions('analytics');
     10 
     11 		foreach ($analytics as $analytic) {
     12 			if ($this->config->get('analytics_' . $analytic['code'] . '_status')) {
     13 				$data['analytics'][] = $this->load->controller('extension/analytics/' . $analytic['code'], $this->config->get('analytics_' . $analytic['code'] . '_status'));
     14 			}
     15 		}
     16 
     17 		if ($this->request->server['HTTPS']) {
     18 			$server = $this->config->get('config_ssl');
     19 		} else {
     20 			$server = $this->config->get('config_url');
     21 		}
     22 
     23 		if (is_file(DIR_IMAGE . $this->config->get('config_icon'))) {
     24 			$this->document->addLink($server . 'image/' . $this->config->get('config_icon'), 'icon');
     25 		}
     26 
     27 		$data['title'] = $this->document->getTitle();
     28 
     29 		$data['base'] = $server;
     30 		$data['description'] = $this->document->getDescription();
     31 		$data['keywords'] = $this->document->getKeywords();
     32 		$data['links'] = $this->document->getLinks();
     33 		$data['styles'] = $this->document->getStyles();
     34 		$data['scripts'] = $this->document->getScripts('header');
     35 		$data['lang'] = $this->language->get('code');
     36 		$data['direction'] = $this->language->get('direction');
     37 
     38 		$data['name'] = $this->config->get('config_name');
     39 
     40 		if (is_file(DIR_IMAGE . $this->config->get('config_logo'))) {
     41 			$data['logo'] = $server . 'image/' . $this->config->get('config_logo');
     42 		} else {
     43 			$data['logo'] = '';
     44 		}
     45 
     46 		$this->load->language('common/header');
     47 
     48 		// Wishlist
     49 		if ($this->customer->isLogged()) {
     50 			$this->load->model('account/wishlist');
     51 
     52 			$data['text_wishlist'] = sprintf($this->language->get('text_wishlist'), $this->model_account_wishlist->getTotalWishlist());
     53 		} else {
     54 			$data['text_wishlist'] = sprintf($this->language->get('text_wishlist'), (isset($this->session->data['wishlist']) ? count($this->session->data['wishlist']) : 0));
     55 		}
     56 
     57 		$data['text_logged'] = sprintf($this->language->get('text_logged'), $this->url->link('account/account', '', true), $this->customer->getFirstName(), $this->url->link('account/logout', '', true));
     58 		
     59 		$data['home'] = $this->url->link('common/home');
     60 		$data['wishlist'] = $this->url->link('account/wishlist', '', true);
     61 		$data['logged'] = $this->customer->isLogged();
     62 		$data['account'] = $this->url->link('account/account', '', true);
     63 		$data['register'] = $this->url->link('account/register', '', true);
     64 		$data['login'] = $this->url->link('account/login', '', true);
     65 		$data['order'] = $this->url->link('account/order', '', true);
     66 		$data['transaction'] = $this->url->link('account/transaction', '', true);
     67 		$data['download'] = $this->url->link('account/download', '', true);
     68 		$data['logout'] = $this->url->link('account/logout', '', true);
     69 		$data['shopping_cart'] = $this->url->link('checkout/cart');
     70 		$data['checkout'] = $this->url->link('checkout/checkout', '', true);
     71 		$data['contact'] = $this->url->link('information/contact');
     72 		$data['telephone'] = $this->config->get('config_telephone');
     73 		
     74 		$data['language'] = $this->load->controller('common/language');
     75 		$data['currency'] = $this->load->controller('common/currency');
     76 		$data['search'] = $this->load->controller('common/search');
     77 		$data['cart'] = $this->load->controller('common/cart');
     78 		$data['menu'] = $this->load->controller('common/menu');
     79 
     80 		return $this->load->view('common/header', $data);
     81 	}
     82 }