OpenCart 🇺🇦

Схема

protected mixed validateForm ( )

Аргументы

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

Описание

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

Исходный код

if (!$this->user->hasPermission('modify', 'setting/store')) {
	$this->error['warning'] = $this->language->get('error_permission');
}

if (!$this->request->post['config_url']) {
	$this->error['url'] = $this->language->get('error_url');
}

if (!$this->request->post['config_name']) {
	$this->error['name'] = $this->language->get('error_name');
}	

if ((utf8_strlen($this->request->post['config_owner']) < 3) || (utf8_strlen($this->request->post['config_owner']) > 64)) {
	$this->error['owner'] = $this->language->get('error_owner');
}

if ((utf8_strlen($this->request->post['config_address']) < 3) || (utf8_strlen($this->request->post['config_address']) > 256)) {
	$this->error['address'] = $this->language->get('error_address');
}

if ((utf8_strlen($this->request->post['config_email']) > 96) || !preg_match('/^[^\@]+@.*\.[a-z]{2,6}$/i', $this->request->post['config_email'])) {
	$this->error['email'] = $this->language->get('error_email');
}

if ((utf8_strlen($this->request->post['config_telephone']) < 3) || (utf8_strlen($this->request->post['config_telephone']) > 32)) {
	$this->error['telephone'] = $this->language->get('error_telephone');
}

if (!$this->request->post['config_title']) {
	$this->error['title'] = $this->language->get('error_title');
}	

if (!empty($this->request->post['config_customer_group_display']) && !in_array($this->request->post['config_customer_group_id'], $this->request->post['config_customer_group_display'])) {
	$this->error['customer_group_display'] = $this->language->get('error_customer_group_display');
}	

if (!$this->request->post['config_image_category_width'] || !$this->request->post['config_image_category_height']) {
	$this->error['image_category'] = $this->language->get('error_image_category');
}

if (!$this->request->post['config_image_thumb_width'] || !$this->request->post['config_image_thumb_height']) {
	$this->error['image_thumb'] = $this->language->get('error_image_thumb');
}	

if (!$this->request->post['config_image_popup_width'] || !$this->request->post['config_image_popup_height']) {
	$this->error['image_popup'] = $this->language->get('error_image_popup');
}

if (!$this->request->post['config_image_product_width'] || !$this->request->post['config_image_product_height']) {
	$this->error['image_product'] = $this->language->get('error_image_product');
}

if (!$this->request->post['config_image_additional_width'] || !$this->request->post['config_image_additional_height']) {
	$this->error['image_additional'] = $this->language->get('error_image_additional');
}

if (!$this->request->post['config_image_related_width'] || !$this->request->post['config_image_related_height']) {
	$this->error['image_related'] = $this->language->get('error_image_related');
}

if (!$this->request->post['config_image_compare_width'] || !$this->request->post['config_image_compare_height']) {
	$this->error['image_compare'] = $this->language->get('error_image_compare');
}

if (!$this->request->post['config_image_wishlist_width'] || !$this->request->post['config_image_wishlist_height']) {
	$this->error['image_wishlist'] = $this->language->get('error_image_wishlist');
}

if (!$this->request->post['config_image_cart_width'] || !$this->request->post['config_image_cart_height']) {
	$this->error['image_cart'] = $this->language->get('error_image_cart');
}

if (!$this->request->post['config_catalog_limit']) {
	$this->error['catalog_limit'] = $this->language->get('error_limit');
}

if ($this->error && !isset($this->error['warning'])) {
	$this->error['warning'] = $this->language->get('error_warning');
}

if (!$this->error) {
	return true;
} else {
	return false;
}