@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | /** |
| 215 | 215 | * Generate the script tags necessary for the Gravity Forms Merge Tag picker to work. |
| 216 | 216 | * |
| 217 | - * @param mixed $curr_form Form ID |
|
| 217 | + * @param string $curr_form Form ID |
|
| 218 | 218 | * @return null|string Merge tags html; NULL if $curr_form isn't defined. |
| 219 | 219 | */ |
| 220 | 220 | public static function render_merge_tags_scripts( $curr_form ) { |
@@ -290,7 +290,6 @@ discard block |
||
| 290 | 290 | * Render shortcode hint in the Publish metabox |
| 291 | 291 | * |
| 292 | 292 | * @access public |
| 293 | - * @param object $post |
|
| 294 | 293 | * @return void |
| 295 | 294 | */ |
| 296 | 295 | function render_shortcode_hint() { |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | if( !GravityView_Compatibility::is_valid() ) { return; } |
| 16 | 16 | |
| 17 | - self::$metaboxes_dir = GRAVITYVIEW_DIR . 'includes/admin/metaboxes/'; |
|
| 17 | + self::$metaboxes_dir = GRAVITYVIEW_DIR . 'includes/admin/metaboxes/'; |
|
| 18 | 18 | |
| 19 | 19 | include_once self::$metaboxes_dir . 'class-gravityview-metabox-tab.php'; |
| 20 | 20 | |
@@ -228,13 +228,13 @@ discard block |
||
| 228 | 228 | $get_id_backup = isset($_GET['id']) ? $_GET['id'] : NULL; |
| 229 | 229 | |
| 230 | 230 | if( isset( $form['id'] ) ) { |
| 231 | - $form_script = 'var form = ' . GFCommon::json_encode($form) . ';'; |
|
| 231 | + $form_script = 'var form = ' . GFCommon::json_encode($form) . ';'; |
|
| 232 | 232 | |
| 233 | - // The `gf_vars()` method needs a $_GET[id] variable set with the form ID. |
|
| 234 | - $_GET['id'] = $form['id']; |
|
| 233 | + // The `gf_vars()` method needs a $_GET[id] variable set with the form ID. |
|
| 234 | + $_GET['id'] = $form['id']; |
|
| 235 | 235 | |
| 236 | 236 | } else { |
| 237 | - $form_script = 'var form = new Form();'; |
|
| 237 | + $form_script = 'var form = new Form();'; |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | $output = '<script type="text/javascript" data-gv-merge-tags="1">' . $form_script . "\n" . GFCommon::gf_vars(false) . '</script>'; |
@@ -95,7 +95,7 @@ |
||
| 95 | 95 | * @param string $icon_class_name Icon class used in vertical tabs. Supports non-dashicon. If dashicons, no need for `dashicons ` prefix |
| 96 | 96 | * @param string $callback Function to render the metabox, if $file is not defined. |
| 97 | 97 | * @param null $callback_args Arguments passed to the callback |
| 98 | - * @return void |
|
| 98 | + * @return GravityView_Metabox_Tab |
|
| 99 | 99 | */ |
| 100 | 100 | function __construct( $id, $title = '', $file = '', $icon_class_name = '', $callback = '', $callback_args = null ) { |
| 101 | 101 | |
@@ -144,7 +144,6 @@ |
||
| 144 | 144 | * Enqueue scripts and styles |
| 145 | 145 | * |
| 146 | 146 | * @access public |
| 147 | - * @param mixed $hook |
|
| 148 | 147 | * @return void |
| 149 | 148 | */ |
| 150 | 149 | function add_scripts_and_styles() { |
@@ -1,15 +1,15 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Adds a button to add the View shortcode into the post content |
|
| 4 | - * |
|
| 5 | - * @package GravityView |
|
| 6 | - * @license GPL2+ |
|
| 7 | - * @author Katz Web Services, Inc. |
|
| 8 | - * @link http://gravityview.co |
|
| 9 | - * @copyright Copyright 2014, Katz Web Services, Inc. |
|
| 10 | - * |
|
| 11 | - * @since 1.0.0 |
|
| 12 | - */ |
|
| 3 | + * Adds a button to add the View shortcode into the post content |
|
| 4 | + * |
|
| 5 | + * @package GravityView |
|
| 6 | + * @license GPL2+ |
|
| 7 | + * @author Katz Web Services, Inc. |
|
| 8 | + * @link http://gravityview.co |
|
| 9 | + * @copyright Copyright 2014, Katz Web Services, Inc. |
|
| 10 | + * |
|
| 11 | + * @since 1.0.0 |
|
| 12 | + */ |
|
| 13 | 13 | |
| 14 | 14 | /** If this file is called directly, abort. */ |
| 15 | 15 | if ( ! defined( 'ABSPATH' ) ) { |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | * |
| 171 | 171 | * @uses GravityView_frontend::get_search_criteria() Convert the $_POST search request into a properly formatted request. |
| 172 | 172 | * @access public |
| 173 | - * @return void|boolean |
|
| 173 | + * @return null|false |
|
| 174 | 174 | */ |
| 175 | 175 | public function process_bulk_action() { |
| 176 | 176 | if ( ! class_exists( 'RGForms' ) ) { |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | * @param array|boolean $entries If array, array of entry IDs that are to be updated. If true: update all entries. |
| 253 | 253 | * @param int $approved Approved status. If `0`: unapproved, if not empty, `Approved` |
| 254 | 254 | * @param int $form_id The Gravity Forms Form ID |
| 255 | - * @return boolean|void |
|
| 255 | + * @return false|null |
|
| 256 | 256 | */ |
| 257 | 257 | private static function update_bulk( $entries, $approved, $form_id ) { |
| 258 | 258 | |
@@ -284,7 +284,6 @@ discard block |
||
| 284 | 284 | * |
| 285 | 285 | * @access public |
| 286 | 286 | * @static |
| 287 | - * @param int $lead_id (default: 0) |
|
| 288 | 287 | * @param int $approved (default: 0) |
| 289 | 288 | * @param int $form_id (default: 0) |
| 290 | 289 | * @param int $approvedcolumn (default: 0) |
@@ -470,7 +469,7 @@ discard block |
||
| 470 | 469 | * @access public |
| 471 | 470 | * @static |
| 472 | 471 | * @param mixed $form GF Form or Form ID |
| 473 | - * @return false|null|string Returns the input ID of the approved field. Returns NULL if no approved fields were found. Returns false if $form_id wasn't set. |
|
| 472 | + * @return integer Returns the input ID of the approved field. Returns NULL if no approved fields were found. Returns false if $form_id wasn't set. |
|
| 474 | 473 | */ |
| 475 | 474 | static public function get_approved_column( $form ) { |
| 476 | 475 | |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | |
| 322 | 322 | if( class_exists( 'GravityView_Entry_Notes' ) ){ |
| 323 | 323 | global $current_user; |
| 324 | - get_currentuserinfo(); |
|
| 324 | + get_currentuserinfo(); |
|
| 325 | 325 | GravityView_Entry_Notes::add_note( $entry_id, $current_user->ID, $current_user->display_name, $note ); |
| 326 | 326 | } |
| 327 | 327 | |
@@ -356,12 +356,12 @@ discard block |
||
| 356 | 356 | |
| 357 | 357 | $approvedcolumn = self::get_approved_column( $form['id'] ); |
| 358 | 358 | |
| 359 | - /** |
|
| 360 | - * If the form doesn't contain the approve field, don't assume anything. |
|
| 361 | - */ |
|
| 362 | - if( empty( $approvedcolumn ) ) { |
|
| 363 | - return; |
|
| 364 | - } |
|
| 359 | + /** |
|
| 360 | + * If the form doesn't contain the approve field, don't assume anything. |
|
| 361 | + */ |
|
| 362 | + if( empty( $approvedcolumn ) ) { |
|
| 363 | + return; |
|
| 364 | + } |
|
| 365 | 365 | |
| 366 | 366 | $entry = GFAPI::get_entry( $entry_id ); |
| 367 | 367 | |
@@ -474,17 +474,17 @@ discard block |
||
| 474 | 474 | */ |
| 475 | 475 | static public function get_approved_column( $form ) { |
| 476 | 476 | |
| 477 | - if( empty( $form ) ) { |
|
| 478 | - return null; |
|
| 479 | - } |
|
| 477 | + if( empty( $form ) ) { |
|
| 478 | + return null; |
|
| 479 | + } |
|
| 480 | 480 | |
| 481 | - if( !is_array( $form ) ) { |
|
| 482 | - $form = GVCommon::get_form( $form ); |
|
| 483 | - } |
|
| 481 | + if( !is_array( $form ) ) { |
|
| 482 | + $form = GVCommon::get_form( $form ); |
|
| 483 | + } |
|
| 484 | 484 | |
| 485 | 485 | foreach( $form['fields'] as $key => $field ) { |
| 486 | 486 | |
| 487 | - $field = (array) $field; |
|
| 487 | + $field = (array) $field; |
|
| 488 | 488 | |
| 489 | 489 | if( !empty( $field['gravityview_approved'] ) ) { |
| 490 | 490 | if( !empty($field['inputs'][0]['id']) ) { |
@@ -492,14 +492,14 @@ discard block |
||
| 492 | 492 | } |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | - // Note: This is just for backward compatibility from GF Directory plugin and old GV versions - when using i18n it may not work.. |
|
| 496 | - if( 'checkbox' == $field['type'] && isset( $field['inputs'] ) && is_array( $field['inputs'] ) ) { |
|
| 497 | - foreach ( $field['inputs'] as $key2 => $input ) { |
|
| 498 | - if ( strtolower( $input['label'] ) == 'approved' ) { |
|
| 499 | - return $input['id']; |
|
| 500 | - } |
|
| 501 | - } |
|
| 502 | - } |
|
| 495 | + // Note: This is just for backward compatibility from GF Directory plugin and old GV versions - when using i18n it may not work.. |
|
| 496 | + if( 'checkbox' == $field['type'] && isset( $field['inputs'] ) && is_array( $field['inputs'] ) ) { |
|
| 497 | + foreach ( $field['inputs'] as $key2 => $input ) { |
|
| 498 | + if ( strtolower( $input['label'] ) == 'approved' ) { |
|
| 499 | + return $input['id']; |
|
| 500 | + } |
|
| 501 | + } |
|
| 502 | + } |
|
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | return null; |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | |
| 327 | 327 | /** |
| 328 | 328 | * Get HTML links relating to a connected form, like Edit, Entries, Settings, Preview |
| 329 | - * @param array|int $form_id Gravity Forms forms array, or the form ID |
|
| 329 | + * @param array|int $form Gravity Forms forms array, or the form ID |
|
| 330 | 330 | * @param boolean $include_form_link Whether to include the bold name of the form in the output |
| 331 | 331 | * @return string HTML links |
| 332 | 332 | */ |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | * $blacklist_field_types - contains the field types which are not proper to be shown in a directory. |
| 548 | 548 | * |
| 549 | 549 | * @access public |
| 550 | - * @param int $form_id Gravity Forms Form ID (default: '') |
|
| 550 | + * @param int $form Gravity Forms Form ID (default: '') |
|
| 551 | 551 | * @param string $context (default: 'single') |
| 552 | 552 | * @return void |
| 553 | 553 | */ |
@@ -592,6 +592,10 @@ discard block |
||
| 592 | 592 | $this->render_additional_fields( $form, $context ); |
| 593 | 593 | } |
| 594 | 594 | |
| 595 | + /** |
|
| 596 | + * @param string $form |
|
| 597 | + * @param string $context |
|
| 598 | + */ |
|
| 595 | 599 | function render_additional_fields( $form, $context ) { |
| 596 | 600 | |
| 597 | 601 | /** |
@@ -790,6 +794,7 @@ discard block |
||
| 790 | 794 | * @param string $zone Either 'single', 'directory', 'header', 'footer' |
| 791 | 795 | * @param array $rows The layout structure: rows, columns and areas |
| 792 | 796 | * @param array $values Saved objects |
| 797 | + * @param string $template_id |
|
| 793 | 798 | * @return void |
| 794 | 799 | */ |
| 795 | 800 | function render_active_areas( $template_id, $type, $zone, $rows, $values ) { |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | * Start using GravityView_Render_Settings::render_setting_row |
| 111 | 111 | */ |
| 112 | 112 | public static function render_setting_row( $key = '', $current_settings = array(), $override_input = null, $name = 'template_settings[%s]', $id = 'gravityview_se_%s' ) { |
| 113 | - _deprecated_function( 'GravityView_Admin_Views::render_setting_row', '1.1.7', 'GravityView_Render_Settings::render_setting_row' ); |
|
| 113 | + _deprecated_function( 'GravityView_Admin_Views::render_setting_row', '1.1.7', 'GravityView_Render_Settings::render_setting_row' ); |
|
| 114 | 114 | GravityView_Render_Settings::render_setting_row( $key, $current_settings, $override_input, $name , $id ); |
| 115 | 115 | } |
| 116 | 116 | |
@@ -688,22 +688,22 @@ discard block |
||
| 688 | 688 | /** |
| 689 | 689 | * @since 1.7.2 |
| 690 | 690 | */ |
| 691 | - 'other_entries' => array( |
|
| 692 | - 'label' => __('Other Entries', 'gravityview'), |
|
| 693 | - 'type' => 'other_entries', |
|
| 694 | - 'desc' => __('Display other entries created by the entry creator.', 'gravityview'), |
|
| 695 | - ), |
|
| 696 | - ); |
|
| 691 | + 'other_entries' => array( |
|
| 692 | + 'label' => __('Other Entries', 'gravityview'), |
|
| 693 | + 'type' => 'other_entries', |
|
| 694 | + 'desc' => __('Display other entries created by the entry creator.', 'gravityview'), |
|
| 695 | + ), |
|
| 696 | + ); |
|
| 697 | 697 | |
| 698 | 698 | |
| 699 | 699 | if( 'single' !== $zone) { |
| 700 | 700 | |
| 701 | - $entry_default_fields['entry_link'] = array( |
|
| 702 | - 'label' => __('Link to Entry', 'gravityview'), |
|
| 703 | - 'desc' => __('A dedicated link to the single entry with customizable text.', 'gravityview'), |
|
| 704 | - 'type' => 'entry_link', |
|
| 705 | - ); |
|
| 706 | - } |
|
| 701 | + $entry_default_fields['entry_link'] = array( |
|
| 702 | + 'label' => __('Link to Entry', 'gravityview'), |
|
| 703 | + 'desc' => __('A dedicated link to the single entry with customizable text.', 'gravityview'), |
|
| 704 | + 'type' => 'entry_link', |
|
| 705 | + ); |
|
| 706 | + } |
|
| 707 | 707 | |
| 708 | 708 | } // if not zone directory or single |
| 709 | 709 | |
@@ -714,7 +714,7 @@ discard block |
||
| 714 | 714 | * @param string|array $form form_ID or form object |
| 715 | 715 | * @param string $zone Either 'single', 'directory', 'header', 'footer' |
| 716 | 716 | */ |
| 717 | - return apply_filters( 'gravityview_entry_default_fields', $entry_default_fields, $form, $zone); |
|
| 717 | + return apply_filters( 'gravityview_entry_default_fields', $entry_default_fields, $form, $zone); |
|
| 718 | 718 | } |
| 719 | 719 | |
| 720 | 720 | /** |
@@ -1028,15 +1028,15 @@ discard block |
||
| 1028 | 1028 | GFForms::register_scripts(); |
| 1029 | 1029 | |
| 1030 | 1030 | $scripts = array( |
| 1031 | - 'sack', |
|
| 1032 | - 'gform_gravityforms', |
|
| 1033 | - 'gform_forms', |
|
| 1034 | - 'gform_form_admin', |
|
| 1035 | - 'jquery-ui-autocomplete' |
|
| 1031 | + 'sack', |
|
| 1032 | + 'gform_gravityforms', |
|
| 1033 | + 'gform_forms', |
|
| 1034 | + 'gform_form_admin', |
|
| 1035 | + 'jquery-ui-autocomplete' |
|
| 1036 | 1036 | ); |
| 1037 | 1037 | |
| 1038 | 1038 | if ( wp_is_mobile() ) |
| 1039 | - $scripts[] = 'jquery-touch-punch'; |
|
| 1039 | + $scripts[] = 'jquery-touch-punch'; |
|
| 1040 | 1040 | |
| 1041 | 1041 | foreach ($scripts as $script) { |
| 1042 | 1042 | wp_enqueue_script( $script ); |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | * Remove any style or script non-registered in the no conflict mode |
| 312 | 312 | * @todo Move this to GravityView_Admin_Views |
| 313 | 313 | * @param WP_Dependencies $wp_objects Object of WP_Styles or WP_Scripts |
| 314 | - * @param array $required_objects List of registered script/style handles |
|
| 314 | + * @param string[] $required_objects List of registered script/style handles |
|
| 315 | 315 | * @param string $type Either 'styles' or 'scripts' |
| 316 | 316 | * @return void |
| 317 | 317 | */ |
@@ -472,6 +472,9 @@ discard block |
||
| 472 | 472 | |
| 473 | 473 | new GravityView_Admin; |
| 474 | 474 | |
| 475 | +/** |
|
| 476 | + * @param string $page |
|
| 477 | + */ |
|
| 475 | 478 | function gravityview_is_admin_page($hook = '', $page = NULL) { |
| 476 | 479 | return GravityView_Admin::is_admin_page( $hook, $page ); |
| 477 | 480 | } |
@@ -215,39 +215,39 @@ discard block |
||
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | $wp_allowed_scripts = array( |
| 218 | - 'common', |
|
| 219 | - 'admin-bar', |
|
| 220 | - 'autosave', |
|
| 221 | - 'post', |
|
| 218 | + 'common', |
|
| 219 | + 'admin-bar', |
|
| 220 | + 'autosave', |
|
| 221 | + 'post', |
|
| 222 | 222 | 'inline-edit-post', |
| 223 | - 'utils', |
|
| 224 | - 'svg-painter', |
|
| 225 | - 'wp-auth-check', |
|
| 226 | - 'heartbeat', |
|
| 223 | + 'utils', |
|
| 224 | + 'svg-painter', |
|
| 225 | + 'wp-auth-check', |
|
| 226 | + 'heartbeat', |
|
| 227 | 227 | 'media-editor', |
| 228 | 228 | 'media-upload', |
| 229 | - 'thickbox', |
|
| 229 | + 'thickbox', |
|
| 230 | 230 | 'wp-color-picker', |
| 231 | 231 | |
| 232 | - // Settings |
|
| 232 | + // Settings |
|
| 233 | 233 | 'gv-admin-edd-license', |
| 234 | 234 | |
| 235 | - // Common |
|
| 236 | - 'select2-js', |
|
| 237 | - 'qtip-js', |
|
| 235 | + // Common |
|
| 236 | + 'select2-js', |
|
| 237 | + 'qtip-js', |
|
| 238 | 238 | |
| 239 | - // jQuery |
|
| 239 | + // jQuery |
|
| 240 | 240 | 'jquery', |
| 241 | - 'jquery-ui-core', |
|
| 242 | - 'jquery-ui-sortable', |
|
| 243 | - 'jquery-ui-datepicker', |
|
| 244 | - 'jquery-ui-dialog', |
|
| 245 | - 'jquery-ui-slider', |
|
| 241 | + 'jquery-ui-core', |
|
| 242 | + 'jquery-ui-sortable', |
|
| 243 | + 'jquery-ui-datepicker', |
|
| 244 | + 'jquery-ui-dialog', |
|
| 245 | + 'jquery-ui-slider', |
|
| 246 | 246 | 'jquery-ui-dialog', |
| 247 | 247 | 'jquery-ui-tabs', |
| 248 | 248 | 'jquery-ui-draggable', |
| 249 | 249 | 'jquery-ui-droppable', |
| 250 | - 'jquery-ui-accordion', |
|
| 250 | + 'jquery-ui-accordion', |
|
| 251 | 251 | ); |
| 252 | 252 | |
| 253 | 253 | $this->remove_conflicts( $wp_scripts, $wp_allowed_scripts, 'scripts' ); |
@@ -281,23 +281,23 @@ discard block |
||
| 281 | 281 | return; |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | - $wp_allowed_styles = array( |
|
| 285 | - 'admin-bar', |
|
| 286 | - 'colors', |
|
| 287 | - 'ie', |
|
| 288 | - 'wp-auth-check', |
|
| 289 | - 'media-views', |
|
| 284 | + $wp_allowed_styles = array( |
|
| 285 | + 'admin-bar', |
|
| 286 | + 'colors', |
|
| 287 | + 'ie', |
|
| 288 | + 'wp-auth-check', |
|
| 289 | + 'media-views', |
|
| 290 | 290 | 'thickbox', |
| 291 | 291 | 'dashicons', |
| 292 | - 'wp-jquery-ui-dialog', |
|
| 293 | - 'jquery-ui-sortable', |
|
| 292 | + 'wp-jquery-ui-dialog', |
|
| 293 | + 'jquery-ui-sortable', |
|
| 294 | 294 | |
| 295 | - // Settings |
|
| 296 | - 'gravityview_settings', |
|
| 295 | + // Settings |
|
| 296 | + 'gravityview_settings', |
|
| 297 | 297 | |
| 298 | - // @todo qTip styles not loading for some reason! |
|
| 299 | - 'jquery-qtip.js', |
|
| 300 | - ); |
|
| 298 | + // @todo qTip styles not loading for some reason! |
|
| 299 | + 'jquery-qtip.js', |
|
| 300 | + ); |
|
| 301 | 301 | |
| 302 | 302 | $this->remove_conflicts( $wp_styles, $wp_allowed_styles, 'styles' ); |
| 303 | 303 | |
@@ -317,32 +317,32 @@ discard block |
||
| 317 | 317 | */ |
| 318 | 318 | private function remove_conflicts( &$wp_objects, $required_objects, $type = 'scripts' ) { |
| 319 | 319 | |
| 320 | - /** |
|
| 321 | - * @filter `gravityview_noconflict_{$type}` Modify the list of no conflict scripts or styles\n |
|
| 322 | - * Filter is `gravityview_noconflict_scripts` or `gravityview_noconflict_styles` |
|
| 323 | - * @param array $required_objects |
|
| 324 | - */ |
|
| 325 | - $required_objects = apply_filters( "gravityview_noconflict_{$type}", $required_objects ); |
|
| 326 | - |
|
| 327 | - //reset queue |
|
| 328 | - $queue = array(); |
|
| 329 | - foreach( $wp_objects->queue as $object ) { |
|
| 330 | - if( in_array( $object, $required_objects ) || preg_match('/gravityview|gf_|gravityforms/ism', $object ) ) { |
|
| 331 | - $queue[] = $object; |
|
| 332 | - } |
|
| 333 | - } |
|
| 334 | - $wp_objects->queue = $queue; |
|
| 335 | - |
|
| 336 | - $required_objects = $this->add_script_dependencies( $wp_objects->registered, $required_objects ); |
|
| 337 | - |
|
| 338 | - //unregistering scripts |
|
| 339 | - $registered = array(); |
|
| 340 | - foreach( $wp_objects->registered as $handle => $script_registration ){ |
|
| 341 | - if( in_array( $handle, $required_objects ) ){ |
|
| 342 | - $registered[ $handle ] = $script_registration; |
|
| 343 | - } |
|
| 344 | - } |
|
| 345 | - $wp_objects->registered = $registered; |
|
| 320 | + /** |
|
| 321 | + * @filter `gravityview_noconflict_{$type}` Modify the list of no conflict scripts or styles\n |
|
| 322 | + * Filter is `gravityview_noconflict_scripts` or `gravityview_noconflict_styles` |
|
| 323 | + * @param array $required_objects |
|
| 324 | + */ |
|
| 325 | + $required_objects = apply_filters( "gravityview_noconflict_{$type}", $required_objects ); |
|
| 326 | + |
|
| 327 | + //reset queue |
|
| 328 | + $queue = array(); |
|
| 329 | + foreach( $wp_objects->queue as $object ) { |
|
| 330 | + if( in_array( $object, $required_objects ) || preg_match('/gravityview|gf_|gravityforms/ism', $object ) ) { |
|
| 331 | + $queue[] = $object; |
|
| 332 | + } |
|
| 333 | + } |
|
| 334 | + $wp_objects->queue = $queue; |
|
| 335 | + |
|
| 336 | + $required_objects = $this->add_script_dependencies( $wp_objects->registered, $required_objects ); |
|
| 337 | + |
|
| 338 | + //unregistering scripts |
|
| 339 | + $registered = array(); |
|
| 340 | + foreach( $wp_objects->registered as $handle => $script_registration ){ |
|
| 341 | + if( in_array( $handle, $required_objects ) ){ |
|
| 342 | + $registered[ $handle ] = $script_registration; |
|
| 343 | + } |
|
| 344 | + } |
|
| 345 | + $wp_objects->registered = $registered; |
|
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | /** |
@@ -405,7 +405,6 @@ discard block |
||
| 405 | 405 | * |
| 406 | 406 | * @deprecated since 1.12 |
| 407 | 407 | * @see GravityView_Compatibility::get_plugin_status() |
| 408 | - |
|
| 409 | 408 | * @return boolean|string True: plugin is active; False: plugin file doesn't exist at path; 'inactive' it's inactive |
| 410 | 409 | */ |
| 411 | 410 | static function get_plugin_status( $location = '' ) { |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * @since 1.15 |
| 29 | 29 | * @param bool|false $mixed |
| 30 | 30 | * |
| 31 | - * @return bool |
|
| 31 | + * @return boolean|null |
|
| 32 | 32 | */ |
| 33 | 33 | private function _exit( $mixed = NULL ) { |
| 34 | 34 | |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | * Import Gravity Form XML or JSON |
| 201 | 201 | * |
| 202 | 202 | * @param string $xml_or_json_path Path to form XML or JSON file |
| 203 | - * @return int|bool Imported form ID or false |
|
| 203 | + * @return false|string Imported form ID or false |
|
| 204 | 204 | */ |
| 205 | 205 | function import_form( $xml_or_json_path = '' ) { |
| 206 | 206 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | // template areas |
| 138 | 138 | $template_areas_directory = apply_filters( 'gravityview_template_active_areas', array(), $template_id, 'directory' ); |
| 139 | - $template_areas_single = apply_filters( 'gravityview_template_active_areas', array(), $template_id, 'single' ); |
|
| 139 | + $template_areas_single = apply_filters( 'gravityview_template_active_areas', array(), $template_id, 'single' ); |
|
| 140 | 140 | |
| 141 | 141 | // widget areas |
| 142 | 142 | $default_widget_areas = GravityView_Plugin::get_default_widget_areas(); |
@@ -328,40 +328,40 @@ discard block |
||
| 328 | 328 | // load file |
| 329 | 329 | $xmlstr = file_get_contents( $form_file ); |
| 330 | 330 | |
| 331 | - $options = array( |
|
| 332 | - "page" => array("unserialize_as_array" => true), |
|
| 333 | - "form"=> array("unserialize_as_array" => true), |
|
| 334 | - "field"=> array("unserialize_as_array" => true), |
|
| 335 | - "rule"=> array("unserialize_as_array" => true), |
|
| 336 | - "choice"=> array("unserialize_as_array" => true), |
|
| 337 | - "input"=> array("unserialize_as_array" => true), |
|
| 338 | - "routing_item"=> array("unserialize_as_array" => true), |
|
| 339 | - "creditCard"=> array("unserialize_as_array" => true), |
|
| 340 | - "routin"=> array("unserialize_as_array" => true), |
|
| 341 | - "confirmation" => array("unserialize_as_array" => true), |
|
| 342 | - "notification" => array("unserialize_as_array" => true) |
|
| 343 | - ); |
|
| 331 | + $options = array( |
|
| 332 | + "page" => array("unserialize_as_array" => true), |
|
| 333 | + "form"=> array("unserialize_as_array" => true), |
|
| 334 | + "field"=> array("unserialize_as_array" => true), |
|
| 335 | + "rule"=> array("unserialize_as_array" => true), |
|
| 336 | + "choice"=> array("unserialize_as_array" => true), |
|
| 337 | + "input"=> array("unserialize_as_array" => true), |
|
| 338 | + "routing_item"=> array("unserialize_as_array" => true), |
|
| 339 | + "creditCard"=> array("unserialize_as_array" => true), |
|
| 340 | + "routin"=> array("unserialize_as_array" => true), |
|
| 341 | + "confirmation" => array("unserialize_as_array" => true), |
|
| 342 | + "notification" => array("unserialize_as_array" => true) |
|
| 343 | + ); |
|
| 344 | 344 | |
| 345 | 345 | $xml = new RGXML($options); |
| 346 | - $forms = $xml->unserialize($xmlstr); |
|
| 346 | + $forms = $xml->unserialize($xmlstr); |
|
| 347 | 347 | |
| 348 | - if( !$forms ) { |
|
| 349 | - do_action( 'gravityview_log_error', '[pre_get_available_fields] Importing Form Fields for preset ['. $template_id .']. Error importing file. (File)', $form_file ); |
|
| 350 | - return false; |
|
| 351 | - } |
|
| 348 | + if( !$forms ) { |
|
| 349 | + do_action( 'gravityview_log_error', '[pre_get_available_fields] Importing Form Fields for preset ['. $template_id .']. Error importing file. (File)', $form_file ); |
|
| 350 | + return false; |
|
| 351 | + } |
|
| 352 | 352 | |
| 353 | - if( !empty( $forms[0] ) && is_array( $forms[0] ) ) { |
|
| 354 | - $form = $forms[0]; |
|
| 355 | - } |
|
| 353 | + if( !empty( $forms[0] ) && is_array( $forms[0] ) ) { |
|
| 354 | + $form = $forms[0]; |
|
| 355 | + } |
|
| 356 | 356 | |
| 357 | - if( empty( $form ) ) { |
|
| 358 | - do_action( 'gravityview_log_error', '[pre_get_available_fields] $form not set.', $forms ); |
|
| 359 | - return false; |
|
| 360 | - } |
|
| 357 | + if( empty( $form ) ) { |
|
| 358 | + do_action( 'gravityview_log_error', '[pre_get_available_fields] $form not set.', $forms ); |
|
| 359 | + return false; |
|
| 360 | + } |
|
| 361 | 361 | |
| 362 | - do_action( 'gravityview_log_debug', '[pre_get_available_fields] Importing Form Fields for preset ['. $template_id .']. (Form)', $form ); |
|
| 362 | + do_action( 'gravityview_log_debug', '[pre_get_available_fields] Importing Form Fields for preset ['. $template_id .']. (Form)', $form ); |
|
| 363 | 363 | |
| 364 | - return $form; |
|
| 364 | + return $form; |
|
| 365 | 365 | |
| 366 | 366 | } |
| 367 | 367 | |
@@ -113,6 +113,9 @@ discard block |
||
| 113 | 113 | return ( sizeof( $ids ) === 1 ) ? $ids[0] : $ids; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | + /** |
|
| 117 | + * @return GravityView_View_Data |
|
| 118 | + */ |
|
| 116 | 119 | public static function getInstance( $passed_post = NULL ) { |
| 117 | 120 | |
| 118 | 121 | if( empty( self::$instance ) ) { |
@@ -152,7 +155,7 @@ discard block |
||
| 152 | 155 | * within the WordPress database. |
| 153 | 156 | * |
| 154 | 157 | * @see http://tommcfarlin.com/wordpress-post-exists-by-id/ Fastest check available |
| 155 | - * @param int $id The ID of the post to check |
|
| 158 | + * @param integer $view_id |
|
| 156 | 159 | * @return bool True if the post exists; otherwise, false. |
| 157 | 160 | * @since 1.0.0 |
| 158 | 161 | */ |
@@ -299,7 +302,7 @@ discard block |
||
| 299 | 302 | * |
| 300 | 303 | * @access public |
| 301 | 304 | * @param array $properties |
| 302 | - * @return void|boolean (field should be hidden) or false (field should be presented) |
|
| 305 | + * @return boolean (field should be hidden) or false (field should be presented) |
|
| 303 | 306 | */ |
| 304 | 307 | private function hide_field_check_conditions( $properties ) { |
| 305 | 308 | |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Should the panel be shown? If there are notices or warnings, yes. |
| 51 | - * @return boolean true: show panel; false: hide panel |
|
| 51 | + * @return boolean|null true: show panel; false: hide panel |
|
| 52 | 52 | */ |
| 53 | 53 | function set_visible( $visible = '' ) { |
| 54 | 54 | $this->_visible = ( count( $this->get_notices() ) || count( $this->get_warnings() ) ); |