OpenCart 🇺🇦

Схема

protected mixed getForm ( )

Аргументы

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

Описание

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

Исходный код

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

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

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

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'] = array();
}

$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('localisation/stock_status', 'token=' . $this->session->data['token'] . $url, 'SSL'),
	'separator' => ' :: '
);

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

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

$this->load->model('localisation/language');

$this->data['languages'] = $this->model_localisation_language->getLanguages();

if (isset($this->request->post['stock_status'])) {
	$this->data['stock_status'] = $this->request->post['stock_status'];
} elseif (isset($this->request->get['stock_status_id'])) {
	$this->data['stock_status'] = $this->model_localisation_stock_status->getStockStatusDescriptions($this->request->get['stock_status_id']);
} else {
	$this->data['stock_status'] = array();
}

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

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