public static function get_fields($key = '', $raw = false) { if (empty(self::$fields)) { self::init_fields(); } if (!$key) { return ''; } $html = ''; if (is_array(self::$fields)) { foreach (self::$fields as $i => $field) { if ($field['id'] == $key) { if ($raw == false) { $html .= '<div class="form-group fieldset-' . esc_attr_e($key) . '">'; if ($field['label']) { $html .= '<label class="' . esc_attr($field['parent_key_class']) . ' control-label" for="' . esc_attr_e($key) . '">' . balanceTags($field['label'] . ($field['required'] ? '' : ' <small>' . __('(optional)', DLN_CLF) . '</small>')) . '</label>'; } $html .= '<div class="' . esc_attr($field['parent_value_class']) . '">'; $html .= DLN_Form_Functions::form_get_template('form-fields/' . $field['type'] . '-field.php', array('key' => $key, 'field' => $field)); $html .= '</div>'; $html .= '</div>'; } else { $html = DLN_Form_Functions::form_get_template('form-fields/' . $field['type'] . '-field.php', array('key' => $key, 'field' => $field)); } } } } return $html; }
public static function submit() { global $post; self::init_fields(); self::$fields = self::validate_post_fields(self::$fields); $page_title = isset(self::$steps[self::$step]['name']) ? self::$steps[self::$step]['name'] : ''; $page_desc = isset(self::$steps[self::$step]['description']) ? self::$steps[self::$step]['description'] : ''; DLN_Form_Functions::form_get_template('fashion-submit.php', array('page_title' => $page_title, 'page_description' => $page_desc, 'form' => self::$form_name, 'action' => self::get_action(), 'fashion_fields' => self::get_fields('fashion'), 'fashion_id' => self::$fashion_id, 'step' => self::$step, 'submit_button' => __('Sell now', DLN_CLF))); }
public static function render_page() { self::init_fields(); DLN_Form_Functions::load_frontend_assets(); DLN_Form_Functions::form_get_template('submit-item.php', array('fields' => self::$fields, 'fashion_id' => self::$fashion_id)); }