Changeset 2722201
- Timestamp:
- 05/11/2022 06:35:24 PM (4 years ago)
- Location:
- visual-form-builder/trunk
- Files:
-
- 1 deleted
- 5 edited
-
admin/class-admin-menu.php (modified) (2 diffs)
-
admin/class-entries-detail.php (modified) (1 diff)
-
admin/class-entries-list.php (modified) (4 diffs)
-
admin/class-forms-list.php (modified) (3 diffs)
-
inc/class-list-table.php (deleted)
-
visual-form-builder.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
visual-form-builder/trunk/admin/class-admin-menu.php
r2722102 r2722201 147 147 if ( isset( $_POST['s'] ) && !empty( $_POST['s'] ) ) 148 148 echo '<span class="subtitle">' . sprintf( __( 'Search results for "%s"' , 'visual-form-builder'), esc_html( $_POST['s'] ) ); 149 150 $form_nav_selected_id = isset( $_GET['form'] ) ? $_GET['form'] : '0';151 149 ?> 152 150 </h1> … … 257 255 </h1> 258 256 <?php 259 if ( isset( $_GET[' action'] ) && in_array( $_GET['action'], array( 'view', 'edit', 'update_entry' ) ) ) :257 if ( isset( $_GET['vfb-action'] ) && in_array( $_GET['vfb-action'], array( 'view', 'edit', 'update_entry' ) ) ) : 260 258 $entries_detail->entries_detail(); 261 259 else : -
visual-form-builder/trunk/admin/class-entries-detail.php
r2722102 r2722201 31 31 ?> 32 32 <form id="entry-edit" method="post" action=""> 33 <h3><span><?php echo stripslashes( $entry->form_title ); ?> : <?php _e( 'Entry' , 'visual-form-builder'); ?> # <?php echo $entry->entries_id; ?></span></h3>33 <h3><span><?php echo esc_html( $entry->form_title ); ?> : <?php _e( 'Entry' , 'visual-form-builder'); ?> # <?php echo absint( $entry->entries_id ); ?></span></h3> 34 34 <div id="vfb-poststuff" class="metabox-holder has-right-sidebar"> 35 35 <div id="side-info-column" class="inner-sidebar"> -
visual-form-builder/trunk/admin/class-entries-list.php
r2722102 r2722201 5 5 * @since 1.2 6 6 */ 7 class Visual_Form_Builder_Entries_List extends Visual_Form_Builder_List_Table {7 class Visual_Form_Builder_Entries_List extends WP_List_Table { 8 8 /** 9 9 * [__construct description] … … 302 302 if ( isset( $_POST['entry'] ) ) { 303 303 if ( is_array( $_POST['entry'] ) ) { 304 $entry_id = array_map( ' esc_html', $_POST['entry'] );304 $entry_id = array_map( 'sanitize_text_field', $_POST['entry'] ); 305 305 } else { 306 $entry_id = array_map( ' esc_html', (array) $_POST['entry'] );306 $entry_id = array_map( 'sanitize_text_field', (array) $_POST['entry'] ); 307 307 } 308 308 } … … 355 355 return; 356 356 357 $action = esc_html( $_GET['vfb-action'] );357 $action = sanitize_text_field( $_GET['vfb-action'] ); 358 358 $entry_id = absint( $_GET['entry'] ); 359 359 … … 603 603 ) ); 604 604 } 605 606 /**607 * Display the pagination.608 * Customize default function to work with months and form drop down filters609 *610 * @since 3.1.0611 * @access protected612 */613 function pagination( $which ) {614 if ( empty( $this->_pagination_args ) )615 return;616 617 extract( $this->_pagination_args, EXTR_SKIP );618 619 $output = '<span class="displaying-num">' . sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';620 621 $current = $this->get_pagenum();622 $removable_query_args = wp_removable_query_args();623 624 $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );625 626 $current_url = remove_query_arg( $removable_query_args, $current_url );627 628 $page_links = array();629 630 // Added to pick up the months dropdown631 $m = isset( $_POST['m'] ) ? (int) $_POST['m'] : 0;632 633 $disable_first = $disable_last = '';634 if ( $current == 1 )635 $disable_first = ' disabled';636 if ( $current == $total_pages )637 $disable_last = ' disabled';638 639 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",640 'first-page' . $disable_first,641 esc_attr__( 'Go to the first page' ),642 esc_url( remove_query_arg( 'paged', $current_url ) ),643 '«'644 );645 646 // Modified the add_query_args to include my custom dropdowns647 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",648 'prev-page' . $disable_first,649 esc_attr__( 'Go to the previous page' ),650 esc_url( add_query_arg( array( 'paged' => max( 1, $current-1 ), 'm' => $m, 'form-filter' => $this->current_filter_action() ), $current_url ) ),651 '‹'652 );653 654 if ( 'bottom' == $which )655 $html_current_page = $current;656 else657 $html_current_page = sprintf( "<input class='current-page' title='%s' type='text' name='paged' value='%s' size='%d' />",658 esc_attr__( 'Current page' ),659 $current,660 strlen( $total_pages )661 );662 663 $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );664 $page_links[] = '<span class="paging-input">' . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . '</span>';665 666 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",667 'next-page' . $disable_last,668 esc_attr__( 'Go to the next page' ),669 esc_url( add_query_arg( array( 'paged' => min( $total_pages, $current+1 ), 'm' => $m, 'form-filter' => $this->current_filter_action() ), $current_url ) ),670 '›'671 );672 673 // Modified the add_query_args to include my custom dropdowns674 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",675 'last-page' . $disable_last,676 esc_attr__( 'Go to the last page' ),677 esc_url( add_query_arg( array( 'paged' => $total_pages, 'm' => $m, 'form-filter' => $this->current_filter_action() ), $current_url ) ),678 '»'679 );680 681 $pagination_links_class = 'pagination-links';682 if ( ! empty( $infinite_scroll ) )683 $pagination_links_class = ' hide-if-js';684 $output .= "\n<span class='$pagination_links_class'>" . join( "\n", $page_links ) . '</span>';685 686 if ( $total_pages )687 $page_class = $total_pages < 2 ? ' one-page' : '';688 else689 $page_class = ' no-pages';690 691 $this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";692 693 echo $this->_pagination;694 }695 605 } -
visual-form-builder/trunk/admin/class-forms-list.php
r2722137 r2722201 5 5 * @since 1.2 6 6 */ 7 class Visual_Form_Builder_Forms_List extends Visual_Form_Builder_List_Table {7 class Visual_Form_Builder_Forms_List extends WP_List_Table { 8 8 /** 9 9 * errors … … 412 412 413 413 // Set our ORDER BY and ASC/DESC to sort the entries 414 $orderby = ( !empty( $_GET['orderby'] ) ) ? $_GET['orderby']: 'form_id';415 $order = ( !empty( $_GET['order'] ) ) ? $_GET['order']: 'desc';414 $orderby = !empty( $_GET['orderby'] ) ? sanitize_text_field( $_GET['orderby'] ) : 'form_id'; 415 $order = !empty( $_GET['order'] ) ? sanitize_text_field( $_GET['order'] ) : 'desc'; 416 416 417 417 // Get the sorted entries … … 459 459 ) ); 460 460 } 461 462 /**463 * Display the pagination.464 * Customize default function to work with months and form drop down filters465 *466 * @since 3.1.0467 * @access protected468 */469 function pagination( $which ) {470 471 if ( empty( $this->_pagination_args ) )472 return;473 474 extract( $this->_pagination_args, EXTR_SKIP );475 476 $output = '<span class="displaying-num">' . sprintf( _n( '1 form', '%s forms', $total_items ), number_format_i18n( $total_items ) ) . '</span>';477 478 $current = $this->get_pagenum();479 $removable_query_args = wp_removable_query_args();480 481 $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );482 483 $current_url = remove_query_arg( $removable_query_args, $current_url );484 485 $page_links = array();486 487 // Added to pick up the months dropdown488 $m = isset( $_POST['m'] ) ? (int) $_POST['m'] : 0;489 490 $disable_first = $disable_last = '';491 if ( $current == 1 )492 $disable_first = ' disabled';493 if ( $current == $total_pages )494 $disable_last = ' disabled';495 496 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",497 'first-page' . $disable_first,498 esc_attr__( 'Go to the first page' ),499 esc_url( remove_query_arg( 'paged', $current_url ) ),500 '«'501 );502 503 // Modified the add_query_args to include my custom dropdowns504 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",505 'prev-page' . $disable_first,506 esc_attr__( 'Go to the previous page' ),507 esc_url( add_query_arg( array( 'paged' => max( 1, $current-1 ), 'm' => $m, 'form-filter' => $this->current_filter_action() ), $current_url ) ),508 '‹'509 );510 511 if ( 'bottom' == $which )512 $html_current_page = $current;513 else514 $html_current_page = sprintf( "<input class='current-page' title='%s' type='text' name='paged' value='%s' size='%d' />",515 esc_attr__( 'Current page' ),516 $current,517 strlen( $total_pages )518 );519 520 $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );521 $page_links[] = '<span class="paging-input">' . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . '</span>';522 523 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",524 'next-page' . $disable_last,525 esc_attr__( 'Go to the next page' ),526 esc_url( add_query_arg( array( 'paged' => min( $total_pages, $current+1 ), 'm' => $m, 'form-filter' => $this->current_filter_action() ), $current_url ) ),527 '›'528 );529 530 // Modified the add_query_args to include my custom dropdowns531 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",532 'last-page' . $disable_last,533 esc_attr__( 'Go to the last page' ),534 esc_url( add_query_arg( array( 'paged' => $total_pages, 'm' => $m, 'form-filter' => $this->current_filter_action() ), $current_url ) ),535 '»'536 );537 538 $pagination_links_class = 'pagination-links';539 if ( ! empty( $infinite_scroll ) )540 $pagination_links_class = ' hide-if-js';541 $output .= "\n<span class='$pagination_links_class'>" . join( "\n", $page_links ) . '</span>';542 543 if ( $total_pages )544 $page_class = $total_pages < 2 ? ' one-page' : '';545 else546 $page_class = ' no-pages';547 548 $this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";549 550 echo $this->_pagination;551 }552 461 } -
visual-form-builder/trunk/visual-form-builder.php
r2722102 r2722201 150 150 require_once( VFB_WP_PLUGIN_DIR . 'inc/class-uninstall.php' ); 151 151 require_once( VFB_WP_PLUGIN_DIR . 'inc/class-i18n.php' ); 152 require_once( VFB_WP_PLUGIN_DIR . 'inc/class-list-table.php' ); 152 if ( !class_exists( 'WP_List_Table' ) ) { 153 require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); 154 } 153 155 require_once( VFB_WP_PLUGIN_DIR . 'admin/class-admin-menu.php' ); 154 156 require_once( VFB_WP_PLUGIN_DIR . 'admin/class-admin-notices.php' );
Note: See TracChangeset
for help on using the changeset viewer.