OpenCart 🇺🇦

Схема

protected mixed getForm ( )

Аргументы

Аргумент Возможный тип Описание
У метода нет аргументов

Описание

Метод пока еще не документирован.

Исходный код

$this->data['heading_title'] = $this->language->get('heading_title');

$this->data['text_default'] = $this->language->get('text_default');

$this->data['entry_name'] = $this->language->get('entry_name');
$this->data['entry_store'] = $this->language->get('entry_store');
$this->data['entry_route'] = $this->language->get('entry_route');

$this->data['button_save'] = $this->language->get('button_save');
$this->data['button_cancel'] = $this->language->get('button_cancel');
$this->data['button_add_route'] = $this->language->get('button_add_route');
$this->data['button_remove'] = $this->language->get('button_remove');

if (isset($this->error['warning'])) {
	$this->data['error_warning'] = $this->error['warning'];
} else {
	$this->data['error_warning'] = '';
}

if (isset($this->error['name'])) {
	$this->data['error_name'] = $this->error['name'];
} else {
	$this->data['error_name'] = '';
}

$url = '';

if (isset($this->request->get['sort'])) {
	$url .= '&sort=' . $this->request->get['sort'];
}

if (isset($this->request->get['order'])) {
	$url .= '&order=' . $this->request->get['order'];
}

if (isset($this->request->get['page'])) {
	$url .= '&page=' . $this->request->get['page'];
}

$this->data['breadcrumbs'] = array();

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

$this->data['breadcrumbs'][] = array(
	'text'      => $this->language->get('heading_title'),
	'href'      => $this->url->link('design/layout', 'token=' . $this->session->data['token'] . $url, 'SSL'),
	'separator' => ' :: '
);

if (!isset($this->request->get['layout_id'])) { 
	$this->data['action'] = $this->url->link('design/layout/insert', 'token=' . $this->session->data['token'] . $url, 'SSL');
} else {
	$this->data['action'] = $this->url->link('design/layout/update', 'token=' . $this->session->data['token'] . '&layout_id=' . $this->request->get['layout_id'] . $url, 'SSL');
}

$this->data['cancel'] = $this->url->link('design/layout', 'token=' . $this->session->data['token'] . $url, 'SSL');

if (isset($this->request->get['layout_id']) && ($this->request->server['REQUEST_METHOD'] != 'POST')) {
	$layout_info = $this->model_design_layout->getLayout($this->request->get['layout_id']);
}

if (isset($this->request->post['name'])) {
	$this->data['name'] = $this->request->post['name'];
} elseif (!empty($layout_info)) {
	$this->data['name'] = $layout_info['name'];
} else {
	$this->data['name'] = '';
}

$this->load->model('setting/store');

$this->data['stores'] = $this->model_setting_store->getStores();

if (isset($this->request->post['layout_route'])) {
	$this->data['layout_routes'] = $this->request->post['layout_route'];
} elseif (isset($this->request->get['layout_id'])) {
	$this->data['layout_routes'] = $this->model_design_layout->getLayoutRoutes($this->request->get['layout_id']);
} else {
	$this->data['layout_routes'] = array();
}	

$this->template = 'design/layout_form.tpl';
$this->children = array(
	'common/header',
	'common/footer'
);

$this->response->setOutput($this->render());