<?php
class ControllerErrorNotFound extends Controller {
	public function index() {

  if ($this->config->get('mlseo_404')) {
    $this->load->model('tool/seo_package');
    $this->model_tool_seo_package->addUrl404(urldecode('http' . (!empty($_SERVER['HTTPS']) ? 's' : '') . '://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']));
  }
      

                //=== ISL Promotions
                $this->load->model('setting/setting');
                $this->config->load('isenselabs/promotions');
                $module = $this->config->get('promotions');

                $setting = $this->model_setting_setting->getSetting($module['code'], $this->config->get('config_store_id'));
                $module['setting'] = array_replace_recursive(
                    $module['setting'],
                    !empty($setting[$module['code'] . '_setting']) ? $setting[$module['code'] . '_setting'] : array()
                );

                if (isset($this->request->get['_route_']) && !empty($module['setting']['page']['seo_url']) && $this->request->get['_route_'] == $module['setting']['page']['seo_url'][$this->config->get('config_language_id')]) {
                    $this->request->get['route'] = $module['path'] . '/page';
                    return new Action($this->request->get['route']);
                }
                //=== ISL Promotions :: end
            
		$this->load->language('error/not_found');

		$this->document->setTitle($this->language->get('heading_title'));

		$data['breadcrumbs'] = array();

		$data['breadcrumbs'][] = array(
			'text' => $this->language->get('text_home'),
			'href' => $this->url->link('common/home')
		);

		if (isset($this->request->get['route'])) {
			$url_data = $this->request->get;

			unset($url_data['_route_']);

			$route = $url_data['route'];

			unset($url_data['route']);

			$url = '';

			if ($url_data) {
				$url = '&' . urldecode(http_build_query($url_data, '', '&'));
			}

			$data['breadcrumbs'][] = array(
				'text' => $this->language->get('heading_title'),
				'href' => $this->url->link($route, $url, $this->request->server['HTTPS'])
			);
		}

		$data['continue'] = $this->url->link('common/home');

		$data['column_left'] = $this->load->controller('common/column_left');
		$data['column_right'] = $this->load->controller('common/column_right');
		$data['content_top'] = $this->load->controller('common/content_top');
		$data['content_bottom'] = $this->load->controller('common/content_bottom');
		$data['footer'] = $this->load->controller('common/footer');
		$data['header'] = $this->load->controller('common/header');

		$this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . ' 404 Not Found');

		$this->response->setOutput($this->load->view('error/not_found', $data));
	}
}