示例#1
0
 private function _getForm()
 {
     $this->data['action'] = $this->html->getSecureURL('design/template/edit', '&tmpl_id=' . $this->data['tmpl_id'] . '&store_id=' . $this->data['store_id']);
     $this->data['form_title'] = $this->language->get('text_edit') . ' ' . $this->language->get('heading_title');
     $this->data['update'] = $this->html->getSecureURL('listing_grid/setting/update_field', '&group=' . $this->data['group'] . '&store_id=' . $this->data['store_id'] . '&tmpl_id=' . $this->data['tmpl_id']);
     $form = new AForm('HS');
     $form->setForm(array('form_name' => 'templateFrm', 'update' => $this->data['update']));
     $this->data['form']['id'] = 'templateFrm';
     $this->data['form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'templateFrm', 'attr' => 'data-confirm-exit="true" class="aform form-horizontal"', 'action' => $this->data['action']));
     $this->data['form']['submit'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'submit', 'text' => $this->language->get('button_save'), 'style' => 'button1'));
     $this->data['form']['cancel'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'cancel', 'text' => $this->language->get('button_cancel'), 'style' => 'button2'));
     $this->data['settings']['tmpl_id'] = $this->data['tmpl_id'];
     if ($this->data['settings']['tmpl_id'] == 'default') {
         //get default setting fields for template
         $this->data['settings']['tmpl_id'] = 'appearance';
     }
     $this->data['form']['fields'] = $this->conf_mngr->getFormFields('appearance', $form, $this->data['settings']);
     $resources_scripts = $this->dispatch('responses/common/resource_library/get_resources_scripts', array('object_name' => 'store', 'object_id' => (int) $this->data['store_id'], 'types' => array('image'), 'onload' => true, 'mode' => 'single'));
     $this->data['resources_scripts'] = $resources_scripts->dispatchGetOutput();
 }
 private function _getQuickStartForm($section, $settings_data)
 {
     if ($settings_data['tmpl_id']) {
         //template settings
         $this->data['action'] = $this->html->getSecureURL('setting/setting_quick_form/quick_start_save_next', '&active=' . $section . '&store_id=' . $this->data['store_id'] . '&tmpl_id=' . $settings_data['tmpl_id']);
         $this->data['update'] = $this->html->getSecureURL('listing_grid/setting/update_field', '&group=' . $settings_data['tmpl_id'] . '&store_id=' . $this->data['store_id'] . '&tmpl_id=' . $settings_data['tmpl_id']);
     } else {
         $this->data['action'] = $this->html->getSecureURL('setting/setting_quick_form/quick_start_save_next', '&active=' . $section . '&store_id=' . $this->data['store_id']);
         $this->data['update'] = $this->html->getSecureURL('listing_grid/setting/update_field', '&group=' . $section . '&store_id=' . $this->data['store_id']);
     }
     $this->view->assign('language_code', $this->session->data['language']);
     $form = new AForm('HS');
     $form->setForm(array('form_name' => 'settingFrm', 'update' => $this->data['update']));
     $this->data['form']['id'] = 'settingFrm';
     $this->data['form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'settingFrm', 'attr' => 'data-confirm-exit="true" class="aform form-horizontal"', 'action' => $this->data['action']));
     $this->data['form']['submit'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'submit', 'text' => $this->language->get('button_save'), 'style' => 'button1'));
     $this->data['form']['reset'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'reset', 'text' => $this->language->get('button_reset')));
     $this->data['form']['fields'] = array();
     require_once DIR_CORE . 'lib/config_manager.php';
     $conf_mngr = new AConfigManager();
     $set_fields = $conf_mngr->getFormFields($section, $form, $settings_data);
     foreach ($this->data['qs_fields'][$section] as $field_name) {
         $field = $set_fields[$field_name];
         //replace wyswyg text editor to textarea inside modal-mode!
         if ($field->type == 'texteditor') {
             $ext_url = $this->html->getSecureURL('setting/setting', '&active=' . $section) . '#' . $field->element_id;
             $label_text = sprintf($this->language->get('text_texteditor_extended_mode'), $ext_url);
             $field = $form->getFieldHtml(array('type' => 'textarea', 'name' => $field->name, 'value' => $field->value, 'ovalue' => $field->ovalue, 'style' => $field->style, 'attr' => $field->attr, 'required' => $field->required, 'placeholder' => $field->placeholder, 'label_text' => $label_text));
         }
         $this->data['form']['fields'][$field_name] = $field;
     }
     unset($set_fields);
 }
 private function _getQuickStartForm($section, $settigs_data)
 {
     if ($settigs_data['tmpl_id']) {
         //template settings
         $this->data['action'] = $this->html->getSecureURL('setting/setting_quick_form/quick_start_save_next', '&active=' . $section . '&store_id=' . $this->data['store_id'] . '&tmpl_id=' . $settigs_data['tmpl_id']);
         $this->data['update'] = $this->html->getSecureURL('listing_grid/setting/update_field', '&group=' . $settigs_data['tmpl_id'] . '&store_id=' . $this->data['store_id'] . '&tmpl_id=' . $settigs_data['tmpl_id']);
     } else {
         $this->data['action'] = $this->html->getSecureURL('setting/setting_quick_form/quick_start_save_next', '&active=' . $section . '&store_id=' . $this->data['store_id']);
         $this->data['update'] = $this->html->getSecureURL('listing_grid/setting/update_field', '&group=' . $section . '&store_id=' . $this->data['store_id']);
     }
     $this->view->assign('language_code', $this->session->data['language']);
     $form = new AForm('HS');
     $form->setForm(array('form_name' => 'settingFrm', 'update' => $this->data['update']));
     $this->data['form']['id'] = 'settingFrm';
     $this->data['form']['form_open'] = $form->getFieldHtml(array('type' => 'form', 'name' => 'settingFrm', 'attr' => 'data-confirm-exit="true" class="aform form-horizontal"', 'action' => $this->data['action']));
     $this->data['form']['submit'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'submit', 'text' => $this->language->get('button_save'), 'style' => 'button1'));
     $this->data['form']['reset'] = $form->getFieldHtml(array('type' => 'button', 'name' => 'reset', 'text' => $this->language->get('button_reset')));
     $this->data['form']['fields'] = array();
     require_once DIR_CORE . 'lib/config_manager.php';
     $conf_mngr = new AConfigManager();
     $set_fields = $conf_mngr->getFormFields($section, $form, $settigs_data);
     foreach ($this->data['qs_fields'][$section] as $field) {
         $this->data['form']['fields'][$field] = $set_fields[$field];
     }
     unset($set_fields);
 }