function wpv_views_editor_hidden_messages_boxes_pointers( $view_settings, $view_layout_settings, $view_id, $user_id ) { $dismissed_pointers = get_user_meta( $user_id, '_wpv_dismissed_pointers', true ); if ( ! is_array( $dismissed_pointers ) || empty( $dismissed_pointers ) ) { $dismissed_pointers = array(); } $dismissed_dialogs = get_user_meta( $user_id, '_wpv_dismissed_dialogs', true ); if ( ! is_array( $dismissed_dialogs ) || empty( $dismissed_dialogs ) ) { $dismissed_dialogs = array(); } wp_nonce_field( 'wpv-editor-dismiss-message-box-pointer', 'wpv-editor-dismiss-message-box-pointer' ); ?> <div id="js-hidden-messages-boxes-pointers-container" class="popup-window-container"> <?php // ------------------------------------------ // Elements exclusively for Views // ------------------------------------------ if ( isset( $view_settings['view-query-mode'] ) && 'normal' == $view_settings['view-query-mode'] ) { $query_type = ''; if ( isset( $view_settings['query_type'] ) && is_array( $view_settings['query_type'] ) ) { $query_type = $view_settings['query_type'][0]; } // ======= // Pointers // ======= // Enabled pagination pointer $dismissed_classname = ''; if ( isset( $dismissed_pointers['enabled-view-pagination'] ) ) { $dismissed_classname = ' js-wpv-pointer-dismissed'; } ?> <div class="js-wpv-enabled-view-pagination-pointer<?php echo $dismissed_classname; ?>"> <h3><?php _e( 'Pagination enabled', 'wpv-views' ); ?></h3> <p> <?php _e( 'This View uses pagination, but pagination controls are still not inserted into the filter HTML section.', 'wpv-views' ); ?> </p> <p> <?php _e( 'To add them, just place your cursor between the [wpv-filter-start] and the [wpv-filter-end] shortcodes and click on the <strong>Pagination controls</strong> button.', 'wpv-views' ); ?> </p> <p> <label> <input type="checkbox" class="js-wpv-dismiss-pointer" data-pointer="enabled-view-pagination" id="wpv-dismiss-enabled-view-pagination-pointer" /> <?php _e( 'Don\'t show this again', 'wpv-views' ); ?> </label> </p> </div> <?php // ======= // Dialogs // ======= // Query filters dialog ?> <div id="js-wpv-filter-add-filter-form-dialog"> <div class="wpv-dialog wpv-dialog-query-filter"> <label for="filter-add-select" class="label-alignleft"><?php _e('Select what to filter by:', 'wpv-views'); ?></label> <?php wpv_filters_add_filter_select( $view_settings ); ?> </div> </div> <?php // Insert pagination dialog ?> <div class="js-wpv-pagination-form-dialog"> <div class="wpv-dialog wpv-dialog-pagination-wizard js-wpv-dialog-pagination-wizard"> <div class="wpv-dialog-sidebar filter-preview"> <h3> <?php _e('Preview', 'wpv-views'); ?> </h3> <div class="js-pagination-preview pagination-preview"> <p class="js-pagination-preview-element" data-name="current-page-number"> <?php _e('Showing page','wpv-views'); ?>: 2 </p> <p class="js-pagination-preview-element next-previous-controls" data-name="next-previous-controls"> <a href="#" class="js-disable-events">« <?php _e('Previous','wpv-views') ?></a> <a href="#" class="js-disable-events"><?php _e('Next','wpv-views') ?> »</a> </p> <p> <span class="js-pagination-preview-element" data-name="page-selector" data-type="page-selector-link page-selector-select"><?php _e('Choose page','wpv-views'); ?></span> <select class="js-disable-events js-pagination-preview-element" disabled data-name="page-selector" data-type="page-selector-select"> <option>2</option> </select> <span data-name="page-selector" data-type="page-selector-link" class="js-pagination-preview-element hidden"> <img src="<?php echo (WPV_URL . '/res/img/dots.png'); ?>" alt="dots" style="vertical-align: middle" /> </span> <span class="js-pagination-preview-element" data-name="total-pages"><?php _e('of','wpv-views'); ?> 3</span> </p> </div> </div> <div class="wpv-dialog-content"> <h3><?php _e('Pagination controls', 'wpv-views'); ?></h3> <ul> <li> <input type="checkbox" name="pagination_control" class="js-wpv-pagination-dialog-control" id="pagination-include-page-num" value="page_num" data-target="current-page-number" /> <label for="pagination-include-page-num"><?php _e('Current page number','wpv-views'); ?></label> </li> <li> <input type="checkbox" name="pagination_control" class="js-wpv-pagination-dialog-control" id="pagination-include-controls" value="page_controls" data-target="next-previous-controls" /> <label for="pagination-include-controls"><?php _e('Next and previous page controls','wpv-views'); ?></label> </li> <li> <input type="checkbox" name="pagination_control" class="js-wpv-pagination-dialog-control" id="pagination-include-page-selector" value="page_selector" data-target="page-selector"/> <label for="pagination-include-page-selector"><?php _e('Page number selector using','wpv-views'); ?></label> <ul style="margin: 8px 0 0 25px;"> <li> <input type="radio" value="drop_down" name="pagination_controls_type" id="pagination-controls-type-dropdown" class="js-pagination-control-type js-pagination-control-type-dropdown" /> <label for="pagination-controls-type-dropdown"><?php _e('dropdown','wpv-views') ?></label> </li> <li> <input type="radio" value="link" name="pagination_controls_type" id="pagination-controls-type-link" class="js-pagination-control-type js-pagination-control-type-link" /> <label for="pagination-controls-type-link"><?php _e('links','wpv-views') ?></label> </li> </ul> </li> <li> <input type="checkbox" name="pagination_control" class="js-wpv-pagination-dialog-control" id="pagination-include-page-total" value="page_total" data-target="total-pages" /> <label for="pagination-include-page-total"><?php _e('Total pages count','wpv-views'); ?></label> </li> </ul> </div> <div style="clear:both;border-top:solid 1px #ededed;"> <h3><?php _e('Pagination display', 'wpv-views'); ?></h3> <p> <input type="checkbox" name="pagination_display" class="js-wpv-pagination-dialog-display" id="pagination-include-wrapper" /> <label for="pagination-include-wrapper"><?php _e('Don\'t show pagination controls if there is only one page','wpv-views'); ?></label> </p> </div> </div> </div> <?php // Insert frontend events dialog ?> <div id="js-wpv-dialog-views-frontend-events" class="toolset-shortcode-gui-dialog-container wpv-shortcode-gui-dialog-container wpv-dialog-frontend-events"> <div class="wpv-dialog wpv-shortcode-gui-content-wrapper"> <p class="toolset-alert toolset-alert-info" style="margin-top:0;"> <i class="icon-fire toolset-rounded-icon"></i> <?php _e( 'You can add javascript callbacks when some events are triggered', 'wpv-views' ); ?> </p> <h3><?php _e( 'Pagination events', 'wpv-views' ); ?></h3> <p> <?php _e( 'The Views AJAX pagination triggers some events.', 'wpv-views' ); ?> </p> <ul> <li> <input type="checkbox" id="wpv-frontent-event-pagination-completed" value="1" class="js-wpv-frontend-event-gui" data-event="js_event_wpv_pagination_completed" /> <label for="wpv-frontent-event-pagination-completed"><?php _e( 'The AJAX pagination has been completed', 'wpv-views' ); ?></label> <span class="wpv-helper-text"><?php _e( 'This happens after the Views AJAX pagination has been completed', 'wpv-views' ); ?></span> </li> </ul> <div class="wpv-settings-query-type-posts<?php if ( $query_type != 'posts' ) { echo ' hidden'; } ?>"> <h3><?php _e( 'Parametric search events', 'wpv-views' ); ?></h3> <p> <?php _e( 'The Views parametric search triggers some events when set to update options or results automatically.', 'wpv-views' ); ?> </p> <ul> <li> <input type="checkbox" id="wpv-frontent-event-parametric-search-triggered" value="1" class="js-wpv-frontend-event-gui" data-event="js_event_wpv_parametric_search_triggered" /> <label for="wpv-frontent-event-parametric-search-triggered"><?php _e( 'The parametric search has been triggered', 'wpv-views' ); ?></label> <span class="wpv-helper-text"><?php _e( 'This happens before Views collects any form data', 'wpv-views' ); ?></span> </li> <li> <input type="checkbox" id="wpv-frontend-event-parametric-search-started" value="1" class="js-wpv-frontend-event-gui" data-event="js_event_wpv_parametric_search_started" /> <label for="wpv-frontend-event-parametric-search-started"><?php _e( 'The parametric search data has been collected', 'wpv-views' ); ?></label> <span class="wpv-helper-text"><?php _e( 'This happens after the data has been collected, but before performing any action', 'wpv-views' ); ?></span> </li> <li> <input type="checkbox" id="wpv-frontend-event-parametric-search-form-updated" value="1" class="js-wpv-frontend-event-gui" data-event="js_event_wpv_parametric_search_form_updated" /> <label for="wpv-frontend-event-parametric-search-form-updated"><?php _e( 'The parametric search form has been updated', 'wpv-views' ); ?></label> <span class="wpv-helper-text"><?php _e( 'This happens after Views updates the form to show only relevant options', 'wpv-views' ); ?></span> </li> <li> <input type="checkbox" id="wpv-frontend-event-parametric-search-results-updated" value="1" class="js-wpv-frontend-event-gui" data-event="js_event_wpv_parametric_search_results_updated" /> <label for="wpv-frontend-event-parametric-search-results-updated"><?php _e( 'The parametric search results have been updated', 'wpv-views' ); ?></label> <span class="wpv-helper-text"><?php _e( 'This happens after Views updates the search results', 'wpv-views' ); ?></span> </li> </ul> </div> </div> </div> <?php // Delete or edit taxonomy filters on bulk delete ?> <div id="js-wpv-filter-taxonomy-delete-filter-row-dialog" class="toolset-shortcode-gui-dialog-container wpv-shortcode-gui-dialog-container wpv-dialog-frontend-events"> <div class="wpv-dialog"> <h3><?php _e('There are more than one taxonomy filters', 'wpv-views'); ?></h3> <p> <?php _e( 'You can delete them all at once or open the editor and delete individual filters.', 'wpv-views' ); ?> </p> </div> </div> <?php // Delete or edit custom field filters on bulk delete ?> <div id="js-wpv-filter-custom-field-delete-filter-row-dialog" class="toolset-shortcode-gui-dialog-container wpv-shortcode-gui-dialog-container wpv-dialog-frontend-events"> <div class="wpv-dialog"> <h3><?php _e('There are more than one custom field filters', 'wpv-views'); ?></h3> <p> <?php _e( 'You can delete them all at once or open the editor and delete individual filters.', 'wpv-views' ); ?> </p> </div> </div> <?php // Delete or edit custom field filters on bulk delete ?> <div id="js-wpv-filter-usermeta-field-delete-filter-row-dialog" class="toolset-shortcode-gui-dialog-container wpv-shortcode-gui-dialog-container wpv-dialog-frontend-events"> <div class="wpv-dialog"> <h3><?php _e('There are more than one usermeta field filters', 'wpv-views'); ?></h3> <p> <?php _e( 'You can delete them all at once or open the editor and delete individual filters.', 'wpv-views' ); ?> </p> </div> </div> <?php } // ------------------------------------------ // Elements exclusively for Archives // ------------------------------------------ if ( isset( $view_settings['view-query-mode'] ) && ( 'archive' == $view_settings['view-query-mode'] || 'layouts-loop' == $view_settings['view-query-mode'] ) ) { // ======= // Pointers // ======= // ======= // Dialogs // ======= // Archive pagination controls dialog ?> <div class="js-wpv-archive-pagination-dialog" class="toolset-shortcode-gui-dialog-container wpv-shortcode-gui-dialog-container"> <div class="wpv-dialog"> <p><?php _e( 'Which pagination controls do you want to insert?', 'wpv-views' ); ?></p> <p> <input type="checkbox" checked="checked" name="archive_pagination_insert_prev" id="archive-pagination-insert-prev" class="js-wpv-archive-pagination-option" /> <label for="archive-pagination-insert-prev"><?php _e( 'Link to previous page','wpv-views' ); ?></label> </p> <p> <input type="checkbox" checked="checked" name="archive_pagination_insert_next" id="archive-pagination-insert-next" class="js-wpv-archive-pagination-option" /> <label for="archive-pagination-insert-next"><?php _e( 'Link to next page','wpv-views' ); ?></label> </p> </div> </div> <?php } // ------------------------------------------ // Elements for both Views and Archives // ------------------------------------------ // ======= // Pointers // ======= $dismissed_classname = ''; if ( isset( $dismissed_pointers['inserted-layout-loop-content-template'] ) ) { $dismissed_classname = ' js-wpv-pointer-dismissed'; } ?> <div class="js-wpv-inserted-layout-loop-content-template-pointer<?php echo $dismissed_classname; ?>"> <h3><?php _e( 'Content Template used as a View loop', 'wpv-views' ); ?></h3> <p> <?php _e( 'The Loop Wizard just updated the editor and created a Content Template.', 'wpv-views' ); echo WPV_MESSAGE_SPACE_CHAR; _e( 'The HTML box includes the View loop and the Content Template contains the fields that you added.', 'wpv-views' ); echo WPV_MESSAGE_SPACE_CHAR; _e( 'You can change the appearance by adding HTML and CSS.', 'wpv-views' ); ?> </p> <p> <label> <input type="checkbox" class="js-wpv-dismiss-pointer" data-pointer="inserted-layout-loop-content-template" id="wpv-dismiss-inserted-layout-loop-content-template-pointer" /> <?php _e( 'Don\'t show this again', 'wpv-views' ); ?> </label> </p> </div> <?php $dismissed_classname = ''; if ( isset( $dismissed_pointers['inserted-layout-loop'] ) ) { $dismissed_classname = ' js-wpv-pointer-dismissed'; } ?> <div class="js-wpv-inserted-layout-loop-pointer<?php echo $dismissed_classname; ?>"> <h3><?php _e( 'Fields updated in the Loop Output', 'wpv-views' ); ?></h3> <p> <?php _e( 'The Loop Wizard just updated the editor with the fields that you added.', 'wpv-views' ); echo WPV_MESSAGE_SPACE_CHAR; _e( 'You can change the appearance by adding HTML and CSS.', 'wpv-views' ); ?> </p> <p> <label> <input type="checkbox" class="js-wpv-dismiss-pointer" data-pointer="inserted-layout-loop" id="wpv-dismiss-inserted-layout-loop-pointer" /> <?php _e( 'Don\'t show this again', 'wpv-views' ); ?> </label> </p> </div> <?php // ======= // Dialogs // ======= ?> <?php $dismissed_classname = ''; if ( isset( $dismissed_dialogs['remove-content-template-from-view'] ) ) { $dismissed_classname = ' js-wpv-dialog-dismissed'; } // Remove CT from View or WPA assignment ?> <div id="js-wpv-dialog-remove-content-template-from-view-dialog" class="toolset-shortcode-gui-dialog-container wpv-shortcode-gui-dialog-container<?php echo $dismissed_classname; ?>"> <div class="wpv-dialog"> <p class="toolset-alert toolset-alert-info"> <?php _e( "This will not delete the Content Template, it will just remove the link between it and the current View." ) ?> </p> <p> <input type="checkbox" id="wpv-dettach-inline-content-template-dismiss" class="js-wpv-dettach-inline-content-template-dismiss" /> <label for="wpv-dettach-inline-content-template-dismiss"> <?php _e("Don't show this message again",'wpv-views') ?> </label> </p> </div> </div> </div> <?php }
function wpv_filters_upate_filters_select_callback() { $nonce = $_POST["wpnonce"]; if (!wp_verify_nonce($nonce, 'wpv_view_filter_add_filter')) { die("Security check"); } $view_array = get_post_meta($_POST["id"], '_wpv_settings', true); wpv_filters_add_filter_select($view_array); die; }
function wpv_filters_upate_filters_select_callback() { if (!current_user_can('manage_options')) { die("Security check"); } if (!wp_verify_nonce($_POST["wpnonce"], 'wpv_view_filter_add_filter')) { die("Security check"); } if (!isset($_POST["id"]) || !is_numeric($_POST["id"]) || intval($_POST['id']) < 1) { die("Security check"); } $view_array = get_post_meta($_POST["id"], '_wpv_settings', true); wpv_filters_add_filter_select($view_array); die; }