/**
  * Render duplicate form options in Lightbox via Hooks
  * 
  * @since 1.0.0
  * @access public
  */
 public function render_duplicate_form()
 {
     $template_id = (int) $_POST['postid'];
     $data = TF_Model::get_field_exist_values($this->fields(), $template_id);
     $get_post = get_post($template_id);
     $data['tf_template_name'] = $get_post->post_title . ' Copy';
     $data['menu_order'] = $get_post->menu_order;
     echo TF_Form::open(array('id' => 'tf_template_duplicate_form'));
     echo sprintf('<input type="hidden" name="_template_id" value="%d">', $template_id);
     echo TF_Form::render($this->fields(), $data);
     echo TF_Form::submit_button(__('Duplicate', 'themify-flow'));
     echo TF_Form::close();
 }
 /**
  * Render duplicate form options in Lightbox via Hooks
  * 
  * @since 1.0.0
  * @access public
  */
 public function render_duplicate_form()
 {
     $theme_id = (int) $_POST['postid'];
     $theme = get_post($theme_id);
     $data = get_post_meta($theme_id, 'theme_info', true);
     $data['tf_theme_name'] = $theme->post_title . ' Copy';
     $fields = $this->fields();
     if (isset($fields['tf_import_base_template_and_part'])) {
         unset($fields['tf_import_base_template_and_part']);
     }
     echo TF_Form::open(array('id' => 'tf_theme_duplicate_form'));
     wp_nonce_field('tf_theme_export_nonce', 'nonce_field');
     echo sprintf('<input type="hidden" name="_theme_id" value="%d">', $theme_id);
     echo TF_Form::render($fields, $data);
     echo TF_Form::submit_button(__('Duplicate', 'themify-flow'));
     echo TF_Form::close();
 }
 /**
  * Render form on ajax.
  * 
  * @since 1.0.0
  * @access public
  */
 public function render_duplicate_form()
 {
     $template_part_id = (int) $_POST['postid'];
     $data = array();
     $get_post = get_post($template_part_id);
     $data['tf_template_part_name'] = $get_post->post_title . ' Copy';
     $data['tf_template_part_custom_css_class'] = get_post_meta($get_post->ID, 'tf_template_part_custom_css_class', true);
     echo TF_Form::open(array('id' => 'tf_template_part_duplicate_form'));
     echo sprintf('<input type="hidden" name="_template_part_id" value="%d">', $template_part_id);
     echo TF_Form::render($this->fields(), $data);
     echo TF_Form::submit_button(__('Duplicate', 'themify-flow'));
     echo TF_Form::close();
 }
 /**
  * Fires to render row option form.
  * 
  * @since 1.0.0
  * @access public
  * @param string $method Form state method (add|edit|delete)
  */
 public function render_row_option_form($method)
 {
     $label_submit_btn = 'add' == $method ? __('Add', 'themify-flow') : __('Update', 'themify-flow');
     $data = array();
     $shortcode = isset($_POST['shortcode']) ? $_POST['shortcode'] : '';
     $atts = isset($_POST['shortcode_params']) ? $_POST['shortcode_params'] : array();
     $shortcode_id = isset($atts['sc_id']) ? $atts['sc_id'] : TF_Model::generate_block_id();
     $template_id = isset($_POST['template_id']) ? $_POST['template_id'] : 0;
     $mode = isset($_POST['mode']) ? $_POST['mode'] : 'frontend';
     // proses data here
     if ('edit' == $method) {
         $data = stripslashes_deep($atts);
     }
     echo TF_Form::open(array('id' => 'tf_row_option_form'));
     echo sprintf('<input type="hidden" name="_state" value="%s">', $method);
     echo sprintf('<input type="hidden" name="_shortcode_name" value="%s">', $shortcode);
     echo sprintf('<input type="hidden" name="_template_id" value="%d">', $template_id);
     echo sprintf('<input type="hidden" name="sc_id" value="%s">', $shortcode_id);
     echo sprintf('<input type="hidden" name="_mode" value="%s">', $mode);
     echo TF_Form::render(TF_Shortcodes::row_fields(), $data);
     echo TF_Form::submit_button($label_submit_btn);
     echo TF_Form::close();
 }