protected function getBlockContent($instance_id) { $block_info = $this->layout->getBlockDetails($instance_id); $custom_block_id = $block_info['custom_block_id']; $descriptions = $this->layout->getBlockDescriptions($custom_block_id); if ($descriptions[$this->config->get('storefront_language_id')]) { $key = $this->config->get('storefront_language_id'); } else { $key = $descriptions ? key($descriptions) : null; } if ($descriptions[$key]['content']) { $content = unserialize($descriptions[$key]['content']); } else { $content = array('form_id' => null); } $this->loadModel('tool/forms_manager'); $form_data = $this->model_tool_forms_manager->getForm($content['form_id']); if (empty($form_data)) { return array(); } $field_types = $this->model_tool_forms_manager->getFieldTypes($content['form_id']); $form = new AForm(); $form->loadFromDb($form_data['form_name']); $form_info = $form->getForm(); $form_info['controller'] = $form_info['controller'] . '&form_id=' . $content['form_id']; $form->setForm($form_info); if (isset($this->session->data['custom_form_' . $content['form_id']]['errors'])) { $form->setErrors($this->session->data['custom_form_' . $content['form_id']]['errors']); unset($this->session->data['custom_form_' . $content['form_id']]['errors']); } $output = array('title' => $key ? $descriptions[$key]['title'] : '', 'content' => $form->getFormHtml(), 'block_wrapper' => $key ? $descriptions[$key]['block_wrapper'] : 0, 'block_framed' => $key ? (int) $descriptions[$key]['block_framed'] : 0); return $output; }
/** * @return bool */ private function _validate() { $this->error = array_merge($this->form->validateFormData($this->request->post), $this->error); if (!$this->error) { return TRUE; } else { $this->form->setErrors($this->error); return FALSE; } }
/** * @return bool */ private function _validate() { $this->error = array_merge($this->form->validateFormData($this->request->post), $this->error); $this->extensions->hk_ValidateData($this); if (!$this->error) { return true; } else { $this->form->setErrors($this->error); return false; } }