foh@$$ [ [o2Z [ [MGZ [O <i L4[ @0tgo@:Rgo_@gorh@$$ [ [o2 [ [MG [6.i L4[ @1tho@:Rho_@hodh@$$ [ [o2 [ [MG [ 'BON_ORDER_BUTTON_BACKGROUND', ), array( 'type' => 'color', 'label' => $this->l('Button hover background:'), 'name' => 'BON_ORDER_BUTTON_HOVER_BACKGROUND', ), ), 'submit' => array( 'title' => $this->l('Save'), ) ), ); $helper = new HelperForm(); $helper->show_toolbar = false; $helper->table = $this->table; $helper->module = $this; $helper->default_form_language = $this->context->language->id; $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0); $helper->identifier = $this->identifier; $helper->submit_action = 'submitSettings'; $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->tpl_vars = array( 'fields_value' => $this->getConfigFieldsValues(), 'languages' => $this->context->controller->getLanguages(), 'id_language' => $this->context->language->id, ); return $helper->generateForm(array($fields_form)); } public function getConfigFieldsValues() { $fields = array(); $configurations = $this->getConfigurations(); foreach (array_keys($configurations) as $config) { $fields[$config] = Configuration::get($config); } return $fields; } protected function postProcess() { $form_values = $this->getConfigFieldsValues(); foreach (array_keys($form_values) as $key) { Configuration::updateValue($key, Tools::getValue($key)); } } protected function preValidateForm() { $errors = array(); if (Tools::isEmpty(Tools::getValue('BON_ORDER_EMAIL'))) { $errors[] = $this->l('Email is required.'); } else { if (!Validate::isEmail(Tools::getValue('BON_ORDER_EMAIL'))) { $errors[] = $this->l('Email format error'); } } if (!Validate::isColor(Tools::getValue('BON_ORDER_BUTTON_BACKGROUND'))) { $errors[] = $this->l('"Background" format error.'); } if (!Validate::isColor(Tools::getValue('BON_ORDER_BUTTON_HOVER_BACKGROUND'))) { $errors[] = $this->l('"Background" format error.'); } if (Tools::isEmpty(Tools::getValue('BON_ORDER_BOX_WIDTH'))) { $errors[] = $this->l('Width is required.'); } else { if (!Validate::isUnsignedInt(Tools::getValue('BON_ORDER_BOX_WIDTH'))) { $errors[] = $this->l('Bad width format'); } } if (count($errors)) { return $this->displayError(implode('
', $errors)); } return false; } public function hookHeader() { Media::addJsDefL('bon_order_url', $this->_path.'ajax.php'); $this->context->controller->addJqueryPlugin('fancybox'); $this->context->controller->addJS($this->_path.'/views/js/bonorder.js'); $this->context->controller->addCSS($this->_path.'/views/css/bonorder.css'); } public function hookDisplayFooter() { $product = new Product((int)Tools::getValue('id_product')); $this->context->smarty->assign(array( 'product_name' => $product->name[$this->context->language->id], 'bon_order_id_product' => (int)Tools::getValue('id_product'), 'bon_order_phone' => $this->context->cookie->bon_order_phone, 'bon_order_name' => $this->context->cookie->bon_order_name, 'bon_order_width' => Configuration::get('BON_ORDER_BOX_WIDTH'), )); return $this->display(__FILE__, 'views/templates/hook/bonorder.tpl'); } public function hookProductActions() { $this->context->smarty->assign(array( 'bon_order_button' => Configuration::get('BON_ORDER_BUTTON_BACKGROUND'), 'bon_order_button_hover' => Configuration::get('BON_ORDER_BUTTON_HOVER_BACKGROUND'), )); return $this->display(__FILE__, 'views/templates/hook/bonorder-button.tpl'); } } Twoje Ciuszki - modne ubrania i akcesoria

Otrzymuj informację o nowościach i wyprzedażach