first commit
This commit is contained in:
40
catalog/controller/error/exception.php
Normal file
40
catalog/controller/error/exception.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
namespace Opencart\Catalog\Controller\Error;
|
||||
/**
|
||||
* Class Exception
|
||||
*
|
||||
* @package Opencart\Catalog\Controller\Error
|
||||
*/
|
||||
class Exception extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @param string $message
|
||||
* @param string $code
|
||||
* @param string $file
|
||||
* @param string $line
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function index(string $message, string $code, string $file, string $line): void {
|
||||
$this->load->language('error/exception');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('error/exception', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['header'] = $this->load->controller('common/header');
|
||||
$data['column_left'] = $this->load->controller('common/column_left');
|
||||
$data['footer'] = $this->load->controller('common/footer');
|
||||
|
||||
$this->response->setOutput($this->load->view('error/exception', $data));
|
||||
}
|
||||
}
|
56
catalog/controller/error/not_found.php
Normal file
56
catalog/controller/error/not_found.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
namespace Opencart\Catalog\Controller\Error;
|
||||
/**
|
||||
* Class Not Found
|
||||
*
|
||||
* @package Opencart\Catalog\Controller\Error
|
||||
*/
|
||||
class NotFound extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('error/not_found');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/home', 'language=' . $this->config->get('config_language'))
|
||||
];
|
||||
|
||||
if (isset($this->request->get['route'])) {
|
||||
$url_data = $this->request->get;
|
||||
|
||||
$route = $url_data['route'];
|
||||
|
||||
unset($url_data['route']);
|
||||
|
||||
$url = '';
|
||||
|
||||
if ($url_data) {
|
||||
$url .= '&' . urldecode(http_build_query($url_data, '', '&'));
|
||||
}
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link($route, $url)
|
||||
];
|
||||
}
|
||||
|
||||
$data['continue'] = $this->url->link('common/home', 'language=' . $this->config->get('config_language'));
|
||||
|
||||
$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));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user