@@ -84,7 +84,7 @@ |
||
| 84 | 84 | * @see \Gamajo_Template_Loader::set_template_data |
| 85 | 85 | * @see \GV\Template::pop_template_data |
| 86 | 86 | * |
| 87 | - * @return \Gamajo_Template_Loader The current instance. |
|
| 87 | + * @return Template The current instance. |
|
| 88 | 88 | */ |
| 89 | 89 | public function push_template_data( $data, $var_name = 'data' ) { |
| 90 | 90 | if ( ! isset( self::$data_stack[ $var_name ] ) ) { |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | function modify_entry_value_workflow_final_status( $output, $entry, $field_settings, $field ) { |
| 43 | 43 | |
| 44 | - if( ! empty( $output ) ) { |
|
| 44 | + if ( ! empty( $output ) ) { |
|
| 45 | 45 | $output = gravity_flow()->translate_status_label( $output ); |
| 46 | 46 | } |
| 47 | 47 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | foreach ( $search_fields as & $search_field ) { |
| 66 | 66 | if ( $this->name === \GV\Utils::get( $search_field, 'key' ) ) { |
| 67 | - $search_field['choices'] = GravityView_Plugin_Hooks_Gravity_Flow::get_status_options(); |
|
| 67 | + $search_field[ 'choices' ] = GravityView_Plugin_Hooks_Gravity_Flow::get_status_options(); |
|
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
@@ -7,15 +7,15 @@ discard block |
||
| 7 | 7 | <div id="publishing-action"> |
| 8 | 8 | <?php |
| 9 | 9 | |
| 10 | - /** |
|
| 11 | - * @filter `gravityview/edit_entry/cancel_link` Modify the cancel button link URL |
|
| 12 | - * @since 1.11.1 |
|
| 13 | - * @param string $back_link Existing URL of the Cancel link |
|
| 14 | - * @param array $form The Gravity Forms form |
|
| 15 | - * @param array $entry The Gravity Forms entry |
|
| 16 | - * @param int $view_id The current View ID |
|
| 17 | - */ |
|
| 18 | - $back_link = apply_filters( 'gravityview/edit_entry/cancel_link', remove_query_arg( array( 'page', 'view', 'edit' ) ), $object->form, $object->entry, $object->view_id ); |
|
| 10 | + /** |
|
| 11 | + * @filter `gravityview/edit_entry/cancel_link` Modify the cancel button link URL |
|
| 12 | + * @since 1.11.1 |
|
| 13 | + * @param string $back_link Existing URL of the Cancel link |
|
| 14 | + * @param array $form The Gravity Forms form |
|
| 15 | + * @param array $entry The Gravity Forms entry |
|
| 16 | + * @param int $view_id The current View ID |
|
| 17 | + */ |
|
| 18 | + $back_link = apply_filters( 'gravityview/edit_entry/cancel_link', remove_query_arg( array( 'page', 'view', 'edit' ) ), $object->form, $object->entry, $object->view_id ); |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * @action `gravityview/edit-entry/publishing-action/before` Triggered before the submit buttons in the Edit Entry screen, inside the `<div id="publishing-action">` container. |
@@ -53,11 +53,11 @@ discard block |
||
| 53 | 53 | /** |
| 54 | 54 | * @action `gravityview/edit-entry/publishing-action/after` Triggered after the submit buttons in the Edit Entry screen, inside the `<div id="publishing-action">` container. |
| 55 | 55 | * @since 1.5.1 |
| 56 | - * @since 2.0.13 Added $post_id |
|
| 56 | + * @since 2.0.13 Added $post_id |
|
| 57 | 57 | * @param array $form The Gravity Forms form |
| 58 | 58 | * @param array $entry The Gravity Forms entry |
| 59 | 59 | * @param int $view_id The current View ID |
| 60 | - * @param int $post_id The current Post ID |
|
| 60 | + * @param int $post_id The current Post ID |
|
| 61 | 61 | */ |
| 62 | 62 | do_action( 'gravityview/edit-entry/publishing-action/after', $object->form, $object->entry, $object->view_id, $object->post_id ); |
| 63 | 63 | |
@@ -60,28 +60,28 @@ discard block |
||
| 60 | 60 | if ( $object->show_previous_button ) { |
| 61 | 61 | $previous_tabindex = GFCommon::get_tabindex(); |
| 62 | 62 | ?> |
| 63 | - <input id="gform_previous_button_<?php echo esc_attr( $object->form['id'] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-previous" type="submit" <?php echo $previous_tabindex; ?> value="<?php echo esc_attr( $labels['previous'] ); ?>" name="save" /> |
|
| 63 | + <input id="gform_previous_button_<?php echo esc_attr( $object->form[ 'id' ] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-previous" type="submit" <?php echo $previous_tabindex; ?> value="<?php echo esc_attr( $labels[ 'previous' ] ); ?>" name="save" /> |
|
| 64 | 64 | <?php |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | if ( $object->show_next_button ) { |
| 68 | - $next_tabindex = GFCommon::get_tabindex(); |
|
| 68 | + $next_tabindex = GFCommon::get_tabindex(); |
|
| 69 | 69 | ?> |
| 70 | - <input id="gform_next_button_<?php echo esc_attr( $object->form['id'] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-next" type="submit" <?php echo $next_tabindex; ?> value="<?php echo esc_attr( $labels['next'] ); ?>" name="save" /> |
|
| 70 | + <input id="gform_next_button_<?php echo esc_attr( $object->form[ 'id' ] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-next" type="submit" <?php echo $next_tabindex; ?> value="<?php echo esc_attr( $labels[ 'next' ] ); ?>" name="save" /> |
|
| 71 | 71 | <?php |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | if ( $object->show_update_button ) { |
| 75 | - $update_tabindex = GFCommon::get_tabindex(); |
|
| 75 | + $update_tabindex = GFCommon::get_tabindex(); |
|
| 76 | 76 | ?> |
| 77 | - <input id="gform_submit_button_<?php echo esc_attr( $object->form['id'] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-update" type="submit" <?php echo $update_tabindex; ?> value="<?php echo esc_attr( $labels['submit'] ); ?>" name="save" /> |
|
| 77 | + <input id="gform_submit_button_<?php echo esc_attr( $object->form[ 'id' ] ); ?>" class="btn btn-lg button button-large gform_button button-primary gv-button-update" type="submit" <?php echo $update_tabindex; ?> value="<?php echo esc_attr( $labels[ 'submit' ] ); ?>" name="save" /> |
|
| 78 | 78 | <?php |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - $cancel_tabindex = GFCommon::get_tabindex(); |
|
| 81 | + $cancel_tabindex = GFCommon::get_tabindex(); |
|
| 82 | 82 | |
| 83 | 83 | ?> |
| 84 | - <a class="btn btn-sm button button-small gv-button-cancel" <?php echo $cancel_tabindex; ?> href="<?php echo esc_url( $back_link ); ?>"><?php echo esc_attr( $labels['cancel'] ); ?></a> |
|
| 84 | + <a class="btn btn-sm button button-small gv-button-cancel" <?php echo $cancel_tabindex; ?> href="<?php echo esc_url( $back_link ); ?>"><?php echo esc_attr( $labels[ 'cancel' ] ); ?></a> |
|
| 85 | 85 | <?php |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -97,5 +97,5 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | ?> |
| 99 | 99 | <input type="hidden" name="action" value="update" /> |
| 100 | - <input type="hidden" name="lid" value="<?php echo esc_attr( $object->entry['id'] ); ?>" /> |
|
| 100 | + <input type="hidden" name="lid" value="<?php echo esc_attr( $object->entry[ 'id' ] ); ?>" /> |
|
| 101 | 101 | </div> |
@@ -4,10 +4,10 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | function __construct() { |
| 6 | 6 | |
| 7 | - if( ! is_admin() ) { return; } |
|
| 7 | + if ( ! is_admin() ) { return; } |
|
| 8 | 8 | |
| 9 | 9 | // If Gravity Forms isn't active or compatibile, stop loading |
| 10 | - if( false === GravityView_Compatibility::is_valid() ) { |
|
| 10 | + if ( false === GravityView_Compatibility::is_valid() ) { |
|
| 11 | 11 | return; |
| 12 | 12 | } |
| 13 | 13 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) ); |
| 49 | 49 | add_filter( 'bulk_post_updated_messages', array( $this, 'post_updated_messages' ) ); |
| 50 | 50 | |
| 51 | - add_filter( 'plugin_action_links_'. plugin_basename( GRAVITYVIEW_FILE ) , array( $this, 'plugin_action_links' ) ); |
|
| 51 | + add_filter( 'plugin_action_links_' . plugin_basename( GRAVITYVIEW_FILE ), array( $this, 'plugin_action_links' ) ); |
|
| 52 | 52 | |
| 53 | 53 | add_action( 'plugins_loaded', array( $this, 'backend_actions' ), 100 ); |
| 54 | 54 | |
@@ -64,9 +64,9 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public static function no_views_text() { |
| 66 | 66 | |
| 67 | - if ( isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status'] ) { |
|
| 67 | + if ( isset( $_REQUEST[ 'post_status' ] ) && 'trash' === $_REQUEST[ 'post_status' ] ) { |
|
| 68 | 68 | return __( 'No Views found in Trash', 'gravityview' ); |
| 69 | - } elseif( ! empty( $_GET['s'] ) ) { |
|
| 69 | + } elseif ( ! empty( $_GET[ 's' ] ) ) { |
|
| 70 | 70 | return __( 'No Views found.', 'gravityview' ); |
| 71 | 71 | } |
| 72 | 72 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | $error .= ' ' . esc_html__( 'or select another form.', 'gravityview' ); |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - if( $error ) { |
|
| 113 | + if ( $error ) { |
|
| 114 | 114 | ?> |
| 115 | 115 | <div class="wp-dialog notice-warning inline error wp-clearfix"> |
| 116 | 116 | <?php echo gravityview_get_floaty(); ?> |
@@ -129,23 +129,23 @@ discard block |
||
| 129 | 129 | public function backend_actions() { |
| 130 | 130 | |
| 131 | 131 | /** @define "GRAVITYVIEW_DIR" "../" */ |
| 132 | - include_once( GRAVITYVIEW_DIR .'includes/admin/class.field.type.php' ); |
|
| 133 | - include_once( GRAVITYVIEW_DIR .'includes/admin/class.render.settings.php' ); |
|
| 134 | - include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-item.php' ); |
|
| 135 | - include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-field.php' ); |
|
| 136 | - include_once( GRAVITYVIEW_DIR .'includes/admin/class-gravityview-admin-view-widget.php' ); |
|
| 137 | - include_once( GRAVITYVIEW_DIR .'includes/class-admin-views.php' ); |
|
| 138 | - include_once( GRAVITYVIEW_DIR .'includes/class-admin-welcome.php' ); |
|
| 139 | - include_once( GRAVITYVIEW_DIR .'includes/class-admin-installer.php' ); |
|
| 140 | - include_once( GRAVITYVIEW_DIR .'includes/class-admin-add-shortcode.php' ); |
|
| 141 | - include_once( GRAVITYVIEW_DIR .'includes/class-admin-approve-entries.php' ); |
|
| 132 | + include_once( GRAVITYVIEW_DIR . 'includes/admin/class.field.type.php' ); |
|
| 133 | + include_once( GRAVITYVIEW_DIR . 'includes/admin/class.render.settings.php' ); |
|
| 134 | + include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-item.php' ); |
|
| 135 | + include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-field.php' ); |
|
| 136 | + include_once( GRAVITYVIEW_DIR . 'includes/admin/class-gravityview-admin-view-widget.php' ); |
|
| 137 | + include_once( GRAVITYVIEW_DIR . 'includes/class-admin-views.php' ); |
|
| 138 | + include_once( GRAVITYVIEW_DIR . 'includes/class-admin-welcome.php' ); |
|
| 139 | + include_once( GRAVITYVIEW_DIR . 'includes/class-admin-installer.php' ); |
|
| 140 | + include_once( GRAVITYVIEW_DIR . 'includes/class-admin-add-shortcode.php' ); |
|
| 141 | + include_once( GRAVITYVIEW_DIR . 'includes/class-admin-approve-entries.php' ); |
|
| 142 | 142 | |
| 143 | 143 | /** |
| 144 | 144 | * @action `gravityview_include_backend_actions` Triggered after all GravityView admin files are loaded |
| 145 | 145 | * |
| 146 | 146 | * Nice place to insert extensions' backend stuff |
| 147 | 147 | */ |
| 148 | - do_action('gravityview_include_backend_actions'); |
|
| 148 | + do_action( 'gravityview_include_backend_actions' ); |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | /** |
@@ -161,12 +161,12 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | $actions = array(); |
| 163 | 163 | |
| 164 | - if( GVCommon::has_cap( 'gravityview_view_settings' ) ) { |
|
| 165 | - $actions[] = sprintf( '<a href="%s">%s</a>', admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ), esc_html__( 'Settings', 'gravityview' ) ); |
|
| 164 | + if ( GVCommon::has_cap( 'gravityview_view_settings' ) ) { |
|
| 165 | + $actions[ ] = sprintf( '<a href="%s">%s</a>', admin_url( 'edit.php?post_type=gravityview&page=gravityview_settings' ), esc_html__( 'Settings', 'gravityview' ) ); |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | - if( GVCommon::has_cap( 'gravityview_support_port' ) ) { |
|
| 169 | - $actions[] = '<a href="https://docs.gravityview.co">' . esc_html__( 'Support', 'gravityview' ) . '</a>'; |
|
| 168 | + if ( GVCommon::has_cap( 'gravityview_support_port' ) ) { |
|
| 169 | + $actions[ ] = '<a href="https://docs.gravityview.co">' . esc_html__( 'Support', 'gravityview' ) . '</a>'; |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | return array_merge( $actions, $links ); |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | // By default, there will only be one item being modified. |
| 195 | 195 | // When in the `bulk_post_updated_messages` filter, there will be passed a number |
| 196 | 196 | // of modified items that will override this array. |
| 197 | - $bulk_counts = is_null( $bulk_counts ) ? array( 'updated' => 1 , 'locked' => 1 , 'deleted' => 1 , 'trashed' => 1, 'untrashed' => 1 ) : $bulk_counts; |
|
| 197 | + $bulk_counts = is_null( $bulk_counts ) ? array( 'updated' => 1, 'locked' => 1, 'deleted' => 1, 'trashed' => 1, 'untrashed' => 1 ) : $bulk_counts; |
|
| 198 | 198 | |
| 199 | 199 | // If we're starting fresh, a new form was created. |
| 200 | 200 | // We should let the user know this is the case. |
@@ -202,60 +202,60 @@ discard block |
||
| 202 | 202 | |
| 203 | 203 | $new_form_text = ''; |
| 204 | 204 | |
| 205 | - if( !empty( $start_fresh ) ) { |
|
| 205 | + if ( ! empty( $start_fresh ) ) { |
|
| 206 | 206 | |
| 207 | 207 | // Get the form that was created |
| 208 | 208 | $connected_form = gravityview_get_form_id( $post_id ); |
| 209 | 209 | |
| 210 | - if( !empty( $connected_form ) ) { |
|
| 210 | + if ( ! empty( $connected_form ) ) { |
|
| 211 | 211 | $form = gravityview_get_form( $connected_form ); |
| 212 | - $form_name = esc_attr( $form['title'] ); |
|
| 212 | + $form_name = esc_attr( $form[ 'title' ] ); |
|
| 213 | 213 | $image = self::get_floaty(); |
| 214 | - $new_form_text .= '<h3>'.$image.sprintf( __( 'A new form was created for this View: "%s"', 'gravityview' ), $form_name ).'</h3>'; |
|
| 215 | - $new_form_text .= sprintf( __( '%sThere are no entries for the new form, so the View will also be empty.%s To start collecting entries, you can add submissions through %sthe preview form%s and also embed the form on a post or page using this code: %s |
|
| 214 | + $new_form_text .= '<h3>' . $image . sprintf( __( 'A new form was created for this View: "%s"', 'gravityview' ), $form_name ) . '</h3>'; |
|
| 215 | + $new_form_text .= sprintf( __( '%sThere are no entries for the new form, so the View will also be empty.%s To start collecting entries, you can add submissions through %sthe preview form%s and also embed the form on a post or page using this code: %s |
|
| 216 | 216 | |
| 217 | 217 | You can %sedit the form%s in Gravity Forms and the updated fields will be available here. Don’t forget to %scustomize the form settings%s. |
| 218 | - ', 'gravityview' ), '<strong>', '</strong>', '<a href="'.site_url( '?gf_page=preview&id='.$connected_form ).'">', '</a>', '<code>[gravityform id="'.$connected_form.'" name="'.$form_name.'"]</code>', '<a href="'.admin_url( 'admin.php?page=gf_edit_forms&id='.$connected_form ).'">', '</a>', '<a href="'.admin_url( 'admin.php?page=gf_edit_forms&view=settings&id='.$connected_form ).'">', '</a>'); |
|
| 218 | + ', 'gravityview' ), '<strong>', '</strong>', '<a href="' . site_url( '?gf_page=preview&id=' . $connected_form ) . '">', '</a>', '<code>[gravityform id="' . $connected_form . '" name="' . $form_name . '"]</code>', '<a href="' . admin_url( 'admin.php?page=gf_edit_forms&id=' . $connected_form ) . '">', '</a>', '<a href="' . admin_url( 'admin.php?page=gf_edit_forms&view=settings&id=' . $connected_form ) . '">', '</a>' ); |
|
| 219 | 219 | $new_form_text = wpautop( $new_form_text ); |
| 220 | 220 | |
| 221 | 221 | delete_post_meta( $post_id, '_gravityview_start_fresh' ); |
| 222 | 222 | } |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | - $messages['gravityview'] = array( |
|
| 225 | + $messages[ 'gravityview' ] = array( |
|
| 226 | 226 | 0 => '', // Unused. Messages start at index 1. |
| 227 | 227 | /* translators: %s and %s are HTML tags linking to the View on the website */ |
| 228 | - 1 => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'), |
|
| 228 | + 1 => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ), |
|
| 229 | 229 | /* translators: %s and %s are HTML tags linking to the View on the website */ |
| 230 | - 2 => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'), |
|
| 230 | + 2 => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ), |
|
| 231 | 231 | 3 => __( 'View deleted.', 'gravityview' ), |
| 232 | 232 | /* translators: %s and %s are HTML tags linking to the View on the website */ |
| 233 | - 4 => sprintf(__( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>'), |
|
| 233 | + 4 => sprintf( __( 'View updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ), |
|
| 234 | 234 | /* translators: %s: date and time of the revision */ |
| 235 | - 5 => isset( $_GET['revision'] ) ? sprintf( __( 'View restored to revision from %s', 'gravityview' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, |
|
| 235 | + 5 => isset( $_GET[ 'revision' ] ) ? sprintf( __( 'View restored to revision from %s', 'gravityview' ), wp_post_revision_title( (int)$_GET[ 'revision' ], false ) ) : false, |
|
| 236 | 236 | /* translators: %s and %s are HTML tags linking to the View on the website */ |
| 237 | - 6 => sprintf(__( 'View published. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text, |
|
| 237 | + 6 => sprintf( __( 'View published. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text, |
|
| 238 | 238 | /* translators: %s and %s are HTML tags linking to the View on the website */ |
| 239 | - 7 => sprintf(__( 'View saved. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text, |
|
| 239 | + 7 => sprintf( __( 'View saved. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text, |
|
| 240 | 240 | 8 => __( 'View submitted.', 'gravityview' ), |
| 241 | 241 | 9 => sprintf( |
| 242 | 242 | /* translators: Date and time the View is scheduled to be published */ |
| 243 | 243 | __( 'View scheduled for: %1$s.', 'gravityview' ), |
| 244 | 244 | // translators: Publish box date format, see http://php.net/date |
| 245 | - date_i18n( __( 'M j, Y @ G:i', 'gravityview' ), strtotime( ( isset( $post->post_date ) ? $post->post_date : NULL ) ) ) |
|
| 245 | + date_i18n( __( 'M j, Y @ G:i', 'gravityview' ), strtotime( ( isset( $post->post_date ) ? $post->post_date : NULL ) ) ) |
|
| 246 | 246 | ) . $new_form_text, |
| 247 | 247 | /* translators: %s and %s are HTML tags linking to the View on the website */ |
| 248 | - 10 => sprintf(__( 'View draft updated. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text, |
|
| 248 | + 10 => sprintf( __( 'View draft updated. %sView on website.%s', 'gravityview' ), '<a href="' . get_permalink( $post_id ) . '">', '</a>' ) . $new_form_text, |
|
| 249 | 249 | |
| 250 | 250 | /** |
| 251 | 251 | * These apply to `bulk_post_updated_messages` |
| 252 | 252 | * @file wp-admin/edit.php |
| 253 | 253 | */ |
| 254 | - 'updated' => _n( '%s View updated.', '%s Views updated.', $bulk_counts['updated'], 'gravityview' ), |
|
| 255 | - 'locked' => _n( '%s View not updated, somebody is editing it.', '%s Views not updated, somebody is editing them.', $bulk_counts['locked'], 'gravityview' ), |
|
| 256 | - 'deleted' => _n( '%s View permanently deleted.', '%s Views permanently deleted.', $bulk_counts['deleted'], 'gravityview' ), |
|
| 257 | - 'trashed' => _n( '%s View moved to the Trash.', '%s Views moved to the Trash.', $bulk_counts['trashed'], 'gravityview' ), |
|
| 258 | - 'untrashed' => _n( '%s View restored from the Trash.', '%s Views restored from the Trash.', $bulk_counts['untrashed'], 'gravityview' ), |
|
| 254 | + 'updated' => _n( '%s View updated.', '%s Views updated.', $bulk_counts[ 'updated' ], 'gravityview' ), |
|
| 255 | + 'locked' => _n( '%s View not updated, somebody is editing it.', '%s Views not updated, somebody is editing them.', $bulk_counts[ 'locked' ], 'gravityview' ), |
|
| 256 | + 'deleted' => _n( '%s View permanently deleted.', '%s Views permanently deleted.', $bulk_counts[ 'deleted' ], 'gravityview' ), |
|
| 257 | + 'trashed' => _n( '%s View moved to the Trash.', '%s Views moved to the Trash.', $bulk_counts[ 'trashed' ], 'gravityview' ), |
|
| 258 | + 'untrashed' => _n( '%s View restored from the Trash.', '%s Views restored from the Trash.', $bulk_counts[ 'untrashed' ], 'gravityview' ), |
|
| 259 | 259 | ); |
| 260 | 260 | |
| 261 | 261 | return $messages; |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * @return void |
| 93 | 93 | */ |
| 94 | 94 | public static function connected_form_warning( $form_id = 0 ) { |
| 95 | - global $pagenow; |
|
| 95 | + global $pagenow; |
|
| 96 | 96 | |
| 97 | 97 | if ( empty( $form_id ) || $pagenow === 'post-new.php' ) { |
| 98 | 98 | return; |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | <?php |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - remove_action( 'gravityview/metaboxes/data-source/before', array( 'GravityView_Admin', 'connected_form_warning' ) ); |
|
| 122 | + remove_action( 'gravityview/metaboxes/data-source/before', array( 'GravityView_Admin', 'connected_form_warning' ) ); |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | /** |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | 7 => sprintf(__( 'View saved. %sView on website.%s', 'gravityview' ), '<a href="'.get_permalink( $post_id ).'">', '</a>') . $new_form_text, |
| 242 | 242 | 8 => __( 'View submitted.', 'gravityview' ), |
| 243 | 243 | 9 => sprintf( |
| 244 | - /* translators: Date and time the View is scheduled to be published */ |
|
| 244 | + /* translators: Date and time the View is scheduled to be published */ |
|
| 245 | 245 | __( 'View scheduled for: %1$s.', 'gravityview' ), |
| 246 | 246 | // translators: Publish box date format, see http://php.net/date |
| 247 | 247 | date_i18n( __( 'M j, Y @ G:i', 'gravityview' ), strtotime( ( isset( $post->post_date ) ? $post->post_date : NULL ) ) ) |
@@ -298,7 +298,6 @@ discard block |
||
| 298 | 298 | * |
| 299 | 299 | * @deprecated since 1.12 |
| 300 | 300 | * @see GravityView_Compatibility::get_plugin_status() |
| 301 | - |
|
| 302 | 301 | * @return boolean|string True: plugin is active; False: plugin file doesn't exist at path; 'inactive' it's inactive |
| 303 | 302 | */ |
| 304 | 303 | static function get_plugin_status( $location = '' ) { |
@@ -7,15 +7,15 @@ |
||
| 7 | 7 | |
| 8 | 8 | $gravityview_view = GravityView_View::getInstance(); |
| 9 | 9 | $view_id = $gravityview_view->getViewId(); |
| 10 | -$value = $gravityview_view->search_field['value']; |
|
| 11 | -$label = $gravityview_view->search_field['label']; |
|
| 10 | +$value = $gravityview_view->search_field[ 'value' ]; |
|
| 11 | +$label = $gravityview_view->search_field[ 'label' ]; |
|
| 12 | 12 | |
| 13 | 13 | $html_input_type = RGFormsModel::is_html5_enabled() ? 'search' : 'text'; |
| 14 | 14 | ?> |
| 15 | 15 | |
| 16 | 16 | <div class="gv-search-box gv-search-field-text gv-search-field-search_all"> |
| 17 | 17 | <div class="gv-search"> |
| 18 | - <?php if( ! gv_empty( $label, false, false ) ) { ?> |
|
| 18 | + <?php if ( ! gv_empty( $label, false, false ) ) { ?> |
|
| 19 | 19 | <label for="gv_search_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label> |
| 20 | 20 | <?php } ?> |
| 21 | 21 | <p><input type="<?php echo $html_input_type; ?>" name="gv_search" id="gv_search_<?php echo $view_id; ?>" value="<?php echo esc_attr( $value ); ?>" /></p> |
@@ -7,13 +7,13 @@ |
||
| 7 | 7 | |
| 8 | 8 | $gravityview_view = GravityView_View::getInstance(); |
| 9 | 9 | $view_id = $gravityview_view->getViewId(); |
| 10 | -$value = $gravityview_view->search_field['value']; |
|
| 11 | -$label = $gravityview_view->search_field['label']; |
|
| 10 | +$value = $gravityview_view->search_field[ 'value' ]; |
|
| 11 | +$label = $gravityview_view->search_field[ 'label' ]; |
|
| 12 | 12 | ?> |
| 13 | 13 | |
| 14 | 14 | <div class="gv-search-box gv-search-field-entry_id"> |
| 15 | 15 | <div class="gv-search"> |
| 16 | - <?php if( ! gv_empty( $label, false, false ) ) { ?> |
|
| 16 | + <?php if ( ! gv_empty( $label, false, false ) ) { ?> |
|
| 17 | 17 | <label for="gv_entry_id_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label> |
| 18 | 18 | <?php } ?> |
| 19 | 19 | <p><input type="text" name="gv_id" id="gv_entry_id_<?php echo $view_id; ?>" value="<?php echo esc_attr( $value ); ?>" /></p> |
@@ -7,17 +7,17 @@ |
||
| 7 | 7 | |
| 8 | 8 | $gravityview_view = GravityView_View::getInstance(); |
| 9 | 9 | $view_id = $gravityview_view->getViewId(); |
| 10 | -$value = $gravityview_view->search_field['value']; |
|
| 11 | -$label = $gravityview_view->search_field['label']; |
|
| 10 | +$value = $gravityview_view->search_field[ 'value' ]; |
|
| 11 | +$label = $gravityview_view->search_field[ 'label' ]; |
|
| 12 | 12 | |
| 13 | 13 | ?> |
| 14 | 14 | |
| 15 | 15 | <div class="gv-search-box gv-search-date gv-search-date-range gv-search-field-entry_date"> |
| 16 | - <?php if( ! gv_empty( $label, false, false ) ) { ?> |
|
| 16 | + <?php if ( ! gv_empty( $label, false, false ) ) { ?> |
|
| 17 | 17 | <label for="gv_start_date_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label> |
| 18 | 18 | <?php } ?> |
| 19 | 19 | <p> |
| 20 | - <input name="gv_start" id="gv_start_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_attr( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e('Start date', 'gravityview' ); ?>" value="<?php echo $value['start']; ?>"> |
|
| 21 | - <input name="gv_end" id="gv_end_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_attr( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e('End date', 'gravityview' ); ?>" value="<?php echo $value['end']; ?>"> |
|
| 20 | + <input name="gv_start" id="gv_start_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_attr( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'Start date', 'gravityview' ); ?>" value="<?php echo $value[ 'start' ]; ?>"> |
|
| 21 | + <input name="gv_end" id="gv_end_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_attr( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'End date', 'gravityview' ); ?>" value="<?php echo $value[ 'end' ]; ?>"> |
|
| 22 | 22 | </p> |
| 23 | 23 | </div> |
| 24 | 24 | \ No newline at end of file |
@@ -7,17 +7,17 @@ |
||
| 7 | 7 | |
| 8 | 8 | $gravityview_view = GravityView_View::getInstance(); |
| 9 | 9 | $view_id = $gravityview_view->getViewId(); |
| 10 | -$value = $gravityview_view->search_field['value']; |
|
| 11 | -$label = $gravityview_view->search_field['label']; |
|
| 12 | -$name = $gravityview_view->search_field['name']; |
|
| 10 | +$value = $gravityview_view->search_field[ 'value' ]; |
|
| 11 | +$label = $gravityview_view->search_field[ 'label' ]; |
|
| 12 | +$name = $gravityview_view->search_field[ 'name' ]; |
|
| 13 | 13 | ?> |
| 14 | 14 | |
| 15 | 15 | <div class="gv-search-box gv-search-date gv-search-date-range"> |
| 16 | - <?php if( ! gv_empty( $label, false, false ) ) { ?> |
|
| 17 | - <label for="search-box-<?php echo esc_attr( $name ).'-start'; ?>"><?php echo esc_html( $label ); ?></label> |
|
| 16 | + <?php if ( ! gv_empty( $label, false, false ) ) { ?> |
|
| 17 | + <label for="search-box-<?php echo esc_attr( $name ) . '-start'; ?>"><?php echo esc_html( $label ); ?></label> |
|
| 18 | 18 | <?php } ?> |
| 19 | 19 | <p> |
| 20 | - <input name="<?php echo esc_attr( $name ).'[start]'; ?>" id="search-box-<?php echo esc_attr( $name ).'-start'; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e('Start date', 'gravityview' ); ?>" value="<?php echo esc_attr( $value['start'] ); ?>"> |
|
| 21 | - <input name="<?php echo esc_attr( $name ).'[end]'; ?>" id="search-box-<?php echo esc_attr( $name ).'-end'; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e('End date', 'gravityview' ); ?>" value="<?php echo esc_attr( $value['end'] ); ?>"> |
|
| 20 | + <input name="<?php echo esc_attr( $name ) . '[start]'; ?>" id="search-box-<?php echo esc_attr( $name ) . '-start'; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'Start date', 'gravityview' ); ?>" value="<?php echo esc_attr( $value[ 'start' ] ); ?>"> |
|
| 21 | + <input name="<?php echo esc_attr( $name ) . '[end]'; ?>" id="search-box-<?php echo esc_attr( $name ) . '-end'; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'End date', 'gravityview' ); ?>" value="<?php echo esc_attr( $value[ 'end' ] ); ?>"> |
|
| 22 | 22 | </p> |
| 23 | 23 | </div> |
| 24 | 24 | \ No newline at end of file |
@@ -79,8 +79,9 @@ |
||
| 79 | 79 | * Check permissions. |
| 80 | 80 | */ |
| 81 | 81 | while ( $error = $view->can_render( array( 'shortcode' ), $request ) ) { |
| 82 | - if ( ! is_wp_error( $error ) ) |
|
| 83 | - break; |
|
| 82 | + if ( ! is_wp_error( $error ) ) { |
|
| 83 | + break; |
|
| 84 | + } |
|
| 84 | 85 | |
| 85 | 86 | switch ( str_replace( 'gravityview/', '', $error->get_error_code() ) ) { |
| 86 | 87 | case 'post_password_required': |
@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | 'class' => '', |
| 44 | 44 | ) ); |
| 45 | 45 | |
| 46 | - if ( ! $view_id = $atts['id'] ? : $atts['view_id'] ) { |
|
| 47 | - if ( $atts['detail'] && $view = $request->is_view() ) { |
|
| 46 | + if ( ! $view_id = $atts[ 'id' ] ?: $atts[ 'view_id' ] ) { |
|
| 47 | + if ( $atts[ 'detail' ] && $view = $request->is_view() ) { |
|
| 48 | 48 | $view_id = $view->ID; |
| 49 | 49 | } |
| 50 | 50 | } |
@@ -114,12 +114,12 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - $is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap('gravityview_moderate_entries', $view->ID ); |
|
| 117 | + $is_admin_and_can_view = $view->settings->get( 'admin_show_all_statuses' ) && \GVCommon::has_cap( 'gravityview_moderate_entries', $view->ID ); |
|
| 118 | 118 | |
| 119 | 119 | /** |
| 120 | 120 | * View details. |
| 121 | 121 | */ |
| 122 | - if ( $atts['detail'] ) { |
|
| 122 | + if ( $atts[ 'detail' ] ) { |
|
| 123 | 123 | $entries = $view->get_entries( $request ); |
| 124 | 124 | return self::_return( $this->detail( $view, $entries, $atts ) ); |
| 125 | 125 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | return self::_return( '' ); |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | - if ( $entry['status'] != 'active' ) { |
|
| 139 | + if ( $entry[ 'status' ] != 'active' ) { |
|
| 140 | 140 | gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $entry->ID ) ); |
| 141 | 141 | return self::_return( __( 'You are not allowed to view this content.', 'gravityview' ) ); |
| 142 | 142 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | if ( $view->settings->get( 'show_only_approved' ) && ! $is_admin_and_can_view ) { |
| 150 | - if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
| 150 | + if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
| 151 | 151 | gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $entry->ID ) ); |
| 152 | 152 | return self::_return( __( 'You are not allowed to view this content.', 'gravityview' ) ); |
| 153 | 153 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $entryset = $entry->is_multi() ? $entry->entries : array( $entry ); |
| 171 | 171 | |
| 172 | 172 | foreach ( $entryset as $e ) { |
| 173 | - if ( $e['status'] != 'active' ) { |
|
| 173 | + if ( $e[ 'status' ] != 'active' ) { |
|
| 174 | 174 | gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $e->ID ) ); |
| 175 | 175 | return self::_return( __( 'You are not allowed to view this content.', 'gravityview' ) ); |
| 176 | 176 | } |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | if ( $view->settings->get( 'show_only_approved' ) && ! $is_admin_and_can_view ) { |
| 184 | - if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $e->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
| 184 | + if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $e->ID, \GravityView_Entry_Approval::meta_key ) ) ) { |
|
| 185 | 185 | gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $e->ID ) ); |
| 186 | 186 | return self::_return( __( 'You are not allowed to view this content.', 'gravityview' ) ); |
| 187 | 187 | } |
@@ -206,10 +206,10 @@ discard block |
||
| 206 | 206 | |
| 207 | 207 | // Mock the request with the actual View, not the global one |
| 208 | 208 | $mock_request = new \GV\Mock_Request(); |
| 209 | - $mock_request->returns['is_view'] = $view; |
|
| 210 | - $mock_request->returns['is_entry'] = $request->is_entry( $view->form ? $view->form->ID : 0 ); |
|
| 211 | - $mock_request->returns['is_edit_entry'] = $request->is_edit_entry( $view->form ? $view->form->ID : 0 ); |
|
| 212 | - $mock_request->returns['is_search'] = $request->is_search(); |
|
| 209 | + $mock_request->returns[ 'is_view' ] = $view; |
|
| 210 | + $mock_request->returns[ 'is_entry' ] = $request->is_entry( $view->form ? $view->form->ID : 0 ); |
|
| 211 | + $mock_request->returns[ 'is_edit_entry' ] = $request->is_edit_entry( $view->form ? $view->form->ID : 0 ); |
|
| 212 | + $mock_request->returns[ 'is_search' ] = $request->is_search(); |
|
| 213 | 213 | |
| 214 | 214 | $request = $mock_request; |
| 215 | 215 | } |
@@ -245,16 +245,16 @@ discard block |
||
| 245 | 245 | $filtered_atts = shortcode_atts( $supported_atts, $passed_atts, 'gravityview' ); |
| 246 | 246 | |
| 247 | 247 | // Only keep the passed attributes after making sure that they're valid pairs |
| 248 | - $filtered_atts = array_intersect_key( (array) $passed_atts, $filtered_atts ); |
|
| 248 | + $filtered_atts = array_intersect_key( (array)$passed_atts, $filtered_atts ); |
|
| 249 | 249 | |
| 250 | 250 | $atts = array(); |
| 251 | 251 | |
| 252 | - foreach( $filtered_atts as $key => $passed_value ) { |
|
| 252 | + foreach ( $filtered_atts as $key => $passed_value ) { |
|
| 253 | 253 | |
| 254 | 254 | // Allow using GravityView merge tags in shortcode attributes, like {get} and {created_by} |
| 255 | 255 | $passed_value = \GravityView_Merge_Tags::replace_variables( $passed_value ); |
| 256 | 256 | |
| 257 | - switch( $defaults[ $key ]['type'] ) { |
|
| 257 | + switch ( $defaults[ $key ][ 'type' ] ) { |
|
| 258 | 258 | |
| 259 | 259 | /** |
| 260 | 260 | * Make sure number fields are numeric. |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | * @see http://php.net/manual/en/function.is-numeric.php#107326 |
| 263 | 263 | */ |
| 264 | 264 | case 'number': |
| 265 | - if( is_numeric( $passed_value ) ) { |
|
| 265 | + if ( is_numeric( $passed_value ) ) { |
|
| 266 | 266 | $atts[ $key ] = ( $passed_value + 0 ); |
| 267 | 267 | } |
| 268 | 268 | break; |
@@ -277,8 +277,8 @@ discard block |
||
| 277 | 277 | */ |
| 278 | 278 | case 'select': |
| 279 | 279 | case 'radio': |
| 280 | - $options = isset( $defaults[ $key ]['choices'] ) ? $defaults[ $key ]['choices'] : $defaults[ $key ]['options']; |
|
| 281 | - if( in_array( $passed_value, array_keys( $options ) ) ) { |
|
| 280 | + $options = isset( $defaults[ $key ][ 'choices' ] ) ? $defaults[ $key ][ 'choices' ] : $defaults[ $key ][ 'options' ]; |
|
| 281 | + if ( in_array( $passed_value, array_keys( $options ) ) ) { |
|
| 282 | 282 | $atts[ $key ] = $passed_value; |
| 283 | 283 | } |
| 284 | 284 | break; |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | } |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | - $atts['detail'] = \GV\Utils::get( $passed_atts, 'detail', null ); |
|
| 293 | + $atts[ 'detail' ] = \GV\Utils::get( $passed_atts, 'detail', null ); |
|
| 294 | 294 | |
| 295 | 295 | return $atts; |
| 296 | 296 | } |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | private function detail( $view, $entries, $atts ) { |
| 308 | 308 | $output = ''; |
| 309 | 309 | |
| 310 | - switch ( $key = $atts['detail'] ): |
|
| 310 | + switch ( $key = $atts[ 'detail' ] ): |
|
| 311 | 311 | case 'total_entries': |
| 312 | 312 | $output = number_format_i18n( $entries->total() ); |
| 313 | 313 | break; |