Plugin Directory

Changeset 2722201


Ignore:
Timestamp:
05/11/2022 06:35:24 PM (4 years ago)
Author:
mmuro
Message:

More changes

Location:
visual-form-builder/trunk
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • visual-form-builder/trunk/admin/class-admin-menu.php

    r2722102 r2722201  
    147147      if ( isset( $_POST['s'] ) && !empty( $_POST['s'] ) )
    148148        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';
    151149    ?>
    152150    </h1>
     
    257255    </h1>
    258256    <?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' ) ) ) :
    260258      $entries_detail->entries_detail();
    261259    else :
  • visual-form-builder/trunk/admin/class-entries-detail.php

    r2722102 r2722201  
    3131?>
    3232      <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>
    3434            <div id="vfb-poststuff" class="metabox-holder has-right-sidebar">
    3535        <div id="side-info-column" class="inner-sidebar">
  • visual-form-builder/trunk/admin/class-entries-list.php

    r2722102 r2722201  
    55 * @since 1.2
    66 */
    7 class Visual_Form_Builder_Entries_List extends Visual_Form_Builder_List_Table {
     7class Visual_Form_Builder_Entries_List extends WP_List_Table {
    88  /**
    99   * [__construct description]
     
    302302    if ( isset( $_POST['entry'] ) ) {
    303303      if ( is_array( $_POST['entry'] ) ) {
    304         $entry_id = array_map( 'esc_html', $_POST['entry'] );
     304        $entry_id = array_map( 'sanitize_text_field', $_POST['entry'] );
    305305      } else {
    306         $entry_id = array_map( 'esc_html', (array) $_POST['entry'] );
     306        $entry_id = array_map( 'sanitize_text_field', (array) $_POST['entry'] );
    307307      }
    308308    }
     
    355355      return;
    356356
    357     $action  = esc_html( $_GET['vfb-action'] );
     357    $action  = sanitize_text_field( $_GET['vfb-action'] );
    358358    $entry_id = absint( $_GET['entry'] );
    359359
     
    603603    ) );
    604604  }
    605 
    606   /**
    607    * Display the pagination.
    608    * Customize default function to work with months and form drop down filters
    609    *
    610    * @since 3.1.0
    611    * @access protected
    612    */
    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 dropdown
    631     $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       '&laquo;'
    644     );
    645 
    646     // Modified the add_query_args to include my custom dropdowns
    647     $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       '&lsaquo;'
    652     );
    653 
    654     if ( 'bottom' == $which )
    655       $html_current_page = $current;
    656     else
    657       $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       '&rsaquo;'
    671     );
    672 
    673     // Modified the add_query_args to include my custom dropdowns
    674     $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       '&raquo;'
    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     else
    689       $page_class = ' no-pages';
    690 
    691     $this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
    692 
    693     echo $this->_pagination;
    694   }
    695605}
  • visual-form-builder/trunk/admin/class-forms-list.php

    r2722137 r2722201  
    55 * @since 1.2
    66 */
    7 class Visual_Form_Builder_Forms_List extends Visual_Form_Builder_List_Table {
     7class Visual_Form_Builder_Forms_List extends WP_List_Table {
    88  /**
    99   * errors
     
    412412
    413413    // 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';
    416416
    417417    // Get the sorted entries
     
    459459    ) );
    460460  }
    461 
    462   /**
    463    * Display the pagination.
    464    * Customize default function to work with months and form drop down filters
    465    *
    466    * @since 3.1.0
    467    * @access protected
    468    */
    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 dropdown
    488     $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       '&laquo;'
    501     );
    502 
    503     // Modified the add_query_args to include my custom dropdowns
    504     $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       '&lsaquo;'
    509     );
    510 
    511     if ( 'bottom' == $which )
    512       $html_current_page = $current;
    513     else
    514       $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       '&rsaquo;'
    528     );
    529 
    530     // Modified the add_query_args to include my custom dropdowns
    531     $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       '&raquo;'
    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     else
    546       $page_class = ' no-pages';
    547 
    548     $this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
    549 
    550     echo $this->_pagination;
    551   }
    552461}
  • visual-form-builder/trunk/visual-form-builder.php

    r2722102 r2722201  
    150150    require_once( VFB_WP_PLUGIN_DIR . 'inc/class-uninstall.php' );
    151151    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    }
    153155    require_once( VFB_WP_PLUGIN_DIR . 'admin/class-admin-menu.php' );
    154156    require_once( VFB_WP_PLUGIN_DIR . 'admin/class-admin-notices.php' );
Note: See TracChangeset for help on using the changeset viewer.