Exemplo n.º 1
0
 public static function get_form($form_id, $display_title = true, $display_description = true, $force_display = false, $field_values = null, $ajax = false, $tabindex = 1)
 {
     require_once GFCommon::get_base_path() . '/form_display.php';
     return GFFormDisplay::get_form($form_id, $display_title, $display_description, $force_display, $field_values, $ajax, $tabindex);
 }
 /**
  * Display the Edit Entry form in the original Gravity Forms format
  *
  * @since 1.9
  *
  * @param $form
  * @param $lead
  * @param $view_id
  *
  * @return void
  */
 private function render_edit_form()
 {
     add_filter('gform_pre_render', array($this, 'filter_modify_form_fields'), 5000, 3);
     add_filter('gform_submit_button', array($this, 'render_form_buttons'));
     add_filter('gform_disable_view_counter', '__return_true');
     add_filter('gform_field_input', array($this, 'modify_edit_field_input'), 10, 5);
     // We need to remove the fake $_GET['page'] arg to avoid rendering form as if in admin.
     unset($_GET['page']);
     // TODO: Make sure validation isn't handled by GF
     // TODO: Include CSS for file upload fields
     // TODO: Verify multiple-page forms
     // TODO: Product fields are not editable
     // TODO: Check Updated and Error messages
     $html = GFFormDisplay::get_form($this->form['id'], false, false, true, $this->entry);
     $html = str_replace('{all_fields:nohidden,noadmin}', '', $html);
     remove_filter('gform_pre_render', array($this, 'filter_modify_form_fields'), 5000);
     remove_filter('gform_submit_button', array($this, 'render_form_buttons'));
     remove_filter('gform_disable_view_counter', '__return_true');
     remove_filter('gform_field_input', array($this, 'modify_edit_field_input'), 10);
     echo $html;
 }
Exemplo n.º 3
0
 public static function get_form($form_id, $display_title = true, $display_description = true, $force_display = false, $field_values = null)
 {
     require_once GFCommon::get_base_path() . "/form_display.php";
     return GFFormDisplay::get_form($form_id, $display_title, $display_description, $force_display, $field_values);
 }
 function get_gf_form($id, $display_title = true, $display_description = true, $force_display = false, $field_values = null)
 {
     if (class_exists('GFFormDisplay')) {
         return GFFormDisplay::get_form($id, $display_title = true, $display_description = true, $force_display = false, $field_values = null);
     } else {
         return RGFormsModel::get_form($id, $display_title, $display_description);
     }
 }
 /**
  * Display the Edit Entry form in the original Gravity Forms format
  *
  * @since 1.9
  *
  * @return void
  */
 private function render_edit_form()
 {
     /**
      * @action `gravityview/edit-entry/render/before` Before rendering the Edit Entry form
      * @since 1.17
      * @param GravityView_Edit_Entry_Render $this
      */
     do_action('gravityview/edit-entry/render/before', $this);
     add_filter('gform_pre_render', array($this, 'filter_modify_form_fields'), 5000, 3);
     add_filter('gform_submit_button', array($this, 'render_form_buttons'));
     add_filter('gform_disable_view_counter', '__return_true');
     add_filter('gform_field_input', array($this, 'verify_user_can_edit_post'), 5, 5);
     add_filter('gform_field_input', array($this, 'modify_edit_field_input'), 10, 5);
     add_filter('gform_field_value', array($this, 'fix_survey_fields_value'), 10, 3);
     // We need to remove the fake $_GET['page'] arg to avoid rendering form as if in admin.
     unset($_GET['page']);
     // TODO: Verify multiple-page forms
     // TODO: Product fields are not editable
     $html = GFFormDisplay::get_form($this->form['id'], false, false, true, $this->entry);
     remove_filter('gform_field_value', array($this, 'fix_survey_fields_value'), 10);
     remove_filter('gform_pre_render', array($this, 'filter_modify_form_fields'), 5000);
     remove_filter('gform_submit_button', array($this, 'render_form_buttons'));
     remove_filter('gform_disable_view_counter', '__return_true');
     remove_filter('gform_field_input', array($this, 'verify_user_can_edit_post'), 5);
     remove_filter('gform_field_input', array($this, 'modify_edit_field_input'), 10);
     echo $html;
     /**
      * @action `gravityview/edit-entry/render/after` After rendering the Edit Entry form
      * @since 1.17
      * @param GravityView_Edit_Entry_Render $this
      */
     do_action('gravityview/edit-entry/render/after', $this);
 }