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 get_instance()
 {
     // If the single instance hasn't been set, set it now.
     if (null == self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
 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));
 }
Example #4
0
echo esc_html($page_title);
?>
</h4>
					<p class="pb10"><?php 
echo esc_html($page_description);
?>
</p>
					<?php 
if (apply_filters('submit_profile_form_show', true)) {
    ?>
						<?php 
    if (DLN_Form_Functions::form_user_can_post_profile()) {
        ?>
						
							<?php 
        DLN_Form_Functions::form_profile_fields($fashion_fields);
        ?>
							
							<div class="panel-footer">
								<div class="form-group no-border">
									<label class="col-sm-3 control-label"></label>
									<div class="col-sm-9">
										<?php 
        wp_nonce_field('submit_form_posted');
        ?>
										<input type="hidden" id="fashion_id" name="fashion_id" value="<?php 
        echo esc_attr($fashion_id);
        ?>
" />
										<input type="hidden" id="dln_form" name="dln_form" value="<?php 
        echo esc_attr($form);
 public static function output()
 {
     DLN_Form_Functions::load_frontend_assets();
     $keys = array_keys(self::$steps);
     if (!empty(self::$errors) || isset($keys[self::$step]) && is_callable(self::$steps[$keys[self::$step]]['view'])) {
         self::show_errors();
         call_user_func(self::$steps[$keys[self::$step]]['view']);
     }
 }