/** * get the pagination display returned by ajax. */ function wpv_ajax_pagination() { if (wp_verify_nonce($_POST['wpv_nonce'], 'wpv_pagination_nonce') && !empty($_POST['_wpv_settings'])) { $settings['posts_per_page'] = $_POST['_wpv_settings']['posts_per_page']; if (isset($_POST['_wpv_settings']['include_page_selector_control'])) { $settings['include_page_selector_control'] = $_POST['_wpv_settings']['include_page_selector_control']; } if (isset($_POST['_wpv_settings']['include_prev_next_page_controls'])) { $settings['include_prev_next_page_controls'] = $_POST['_wpv_settings']['include_prev_next_page_controls']; } $settings['pagination'] = $_POST['_wpv_settings']['pagination']; $settings['ajax_pagination'] = $_POST['_wpv_settings']['ajax_pagination']; $settings['rollover'] = $_POST['_wpv_settings']['rollover']; $settings = apply_filters('wpv_view_settings_save', $settings); $view_settings = apply_filters('wpv_view_settings', $settings); wpv_pagination_admin($view_settings); } die; }
/** * Output the view query metabox on the view edit page. * */ function settings_box($post) { // DEPRECATED global $WPV_view_archive_loop; ?> <div id="wpv_view_query_controls" style="position: relative"> <span id="wpv_view_query_controls_over" class="wpv_view_overlay" style="display:none"> <p><strong><?php echo __('The view query settings will be copied from the original', 'wpv-views'); ?> </strong></p> </span> <?php global $wp_version, $pagenow; if (version_compare($wp_version, '3.2', '<')) { echo '<p style="color:red;"><strong>'; _e('* Requires WordPress 3.2 or greater for best results.', 'wpv-views'); echo '</strong></p>'; } $this->include_admin_css(); wp_nonce_field('wpv_get_table_row_ui_nonce', 'wpv_get_table_row_ui_nonce'); ?> <script type="text/javascript"> var wpv_confirm_filter_change = '<?php _e("Are you sure you want to change the filter?\\n\\nIt appears that you made modifications to the filter.", 'wpv-views'); ?> '; <?php if ($pagenow == 'post-new.php') { ?> jQuery(document).ready(function($){ wpv_add_initial_filter_shortcode(); }); <?php } ?> var wpv_save_button_text = '<?php _e("Save View", 'wpv-views'); ?> '; </script> <?php global $WP_Views; $view_settings = $WP_Views->get_view_settings($post->ID); // check for creating a new view for an archive loop. if (isset($_GET['view_archive']) || isset($_GET['view_archive_taxonomy'])) { $view_settings['view-query-mode'] = 'archive'; global $wpv_wp_pointer; $wpv_wp_pointer->add_pointer('View Layout', 'This View displays results for an existing WordPress query.</p><p>Now choose the layout style and then add the fields you wish to display.', 'select[name="_wpv_layout_settings[style]"]', 'bottom', 'wpv_layout'); } ?> <p><span style="font-size:1.1em;font-weight:bold;">Does this View query it's own data or replace a standard WordPress archive?</span> <img src="<?php echo WPV_URL_EMBEDDED; ?> /common/res/images/question.png" style="position:relative;top:2px;" /> <a href="http://wp-types.com/documentation/user-guides/normal-vs-archive-views/" target="_blank"><?php _e('Learn about Normal and Archive Views »', 'wpv-views'); ?> </a></p> <ul style="margin-bottom:10px"> <?php $checked = $view_settings['view-query-mode'] == 'normal' ? 'checked="checked"' : ''; ?> <li><label><input type="radio" name="_wpv_settings[view-query-mode]" value="normal" <?php echo $checked; ?> onclick="jQuery('#wpv-normal-view-mode').show();jQuery('#wpv-archive-view-mode').hide()" /> <?php _e('<strong>Normal View:</strong> This View queries content from the database (good for inserting Views into content or widgets)', 'wpv-views'); ?> </label></li> <?php $checked = $view_settings['view-query-mode'] == 'archive' ? 'checked="checked"' : ''; ?> <li><label><input type="radio" name="_wpv_settings[view-query-mode]" value="archive" <?php echo $checked; ?> onclick="jQuery('#wpv-normal-view-mode').hide();jQuery('#wpv-archive-view-mode').show()" /> <?php _e('<strong>Archive View:</strong> This View displays results for an existing WordPress query (good for archive pages, taxonomy listing, search, etc.)', 'wpv-views'); ?> </label></li> </ul> <div id="wpv-normal-view-mode"<?php if ($view_settings['view-query-mode'] != 'normal') { echo ' style="display:none;"'; } ?> > <table id="wpv_filter_table" class="widefat fixed"> <thead> <tr> <th width="20px"></th> <th width="100%"> <?php _e('Filter', 'wpv-views'); ?>  <a class="wpv-help-link" target="_blank" href="http://wp-types.com/documentation/user-guides/views/"> <?php _e('Querying the database', 'wpv-views'); ?> </a> </th> </tr> </thead> <tbody> <tr id="wpv_filter_type"> <?php wpv_filter_types_admin($view_settings); ?> </tr> <?php global $view_settings_table_row; $view_settings_table_row = 0; do_action('wpv_add_filter_table_row', $view_settings); ?> </tbody> </table> <?php $view_settings = wpv_types_defaults($view_settings); wpv_filter_add_filter_admin($view_settings, null, 'popup_add_filter', '', 'wpv_add_filters', $view_settings['query_type'][0] == 'posts'); wpv_filter_add_filter_admin($view_settings, null, 'popup_add_filter_taxonomy', '', 'wpv_add_filters_taxonomy', $view_settings['query_type'][0] == 'taxonomy'); wpv_filter_controls_admin($view_settings); ?> <p> <span style="font-size:1.1em;font-weight:bold;"><?php _e('Pagination and Sliders settings', 'wpv-views'); ?> </span> <img src="<?php echo WPV_URL_EMBEDDED; ?> /common/res/images/question.png" style="position:relative;top:2px;" /> <a href="http://wp-types.com/documentation/user-guides/views-pagination/" target="_blank"><?php _e('Everything about Views pagination »', 'wpv-views'); ?> </a> </p> <?php wpv_pagination_admin($view_settings); wpv_filter_meta_html_admin($view_settings); ?> </div> <?php $WPV_view_archive_loop->view_edit_admin($post->ID, $view_settings); ?> </div> <?php }