Exemplo n.º 1
0
	/**
	* wpv_get_list_item_ui_post_status
	*
	* Render status filter item content in the filters list
	*
	* @param $view_settings
	*
	* @since unknown
	*/
	
	static function wpv_get_list_item_ui_post_status( $view_settings = array() ) {
		if ( ! isset( $view_settings['post_status'] ) || ! is_array( $view_settings['post_status'] ) ) {
			$view_settings['post_status'] = array();
		}
		ob_start();
		?>
		<p class='wpv-filter-post-status-summary js-wpv-filter-summary js-wpv-filter-post-status-summary'>
			<?php echo wpv_get_filter_status_summary_txt( $view_settings ); ?>
		</p>
		<?php
		WPV_Filter_Item::simple_filter_list_item_buttons( 'post-status', 'wpv_filter_post_status_update', wp_create_nonce( 'wpv_view_filter_post_status_nonce' ), 'wpv_filter_post_status_delete', wp_create_nonce( 'wpv_view_filter_post_status_delete_nonce' ) );
		?>
		<div id="wpv-filter-post-status-edit" class="wpv-filter-edit js-wpv-filter-edit">
			<div id="wpv-filter-post-status" class="js-wpv-filter-options js-wpv-filter-post-status-options js-filter-post-status-list">
				<?php WPV_Status_Filter::wpv_render_post_status_options( $view_settings ); ?>
			</div>
			<div class="js-wpv-filter-toolset-messages"></div>
		</div>
		<?php
		$res = ob_get_clean();
		return $res;
	}
Exemplo n.º 2
0
	/**
	* wpv_get_list_item_ui_post_id
	*
	* Render ID filter item content in the filters list
	*
	* @param $view_settings
	*
	* @since unknown
	*/

	static function wpv_get_list_item_ui_post_id( $view_settings = array() ) {
		if ( isset( $view_settings['id_mode'] ) && is_array( $view_settings['id_mode'] ) ) {
			$view_settings['id_mode'] = $view_settings['id_mode'][0];
		}
		if ( 
			isset( $view_settings['post_id_ids_list'] ) 
			&& ! empty( $view_settings['post_id_ids_list'] ) 
		) {
			// Adjust for WPML support
			$id_ids_list = explode( ',', $view_settings['post_id_ids_list'] );
			$id_ids_list = array_map( 'esc_attr', $id_ids_list );
			$id_ids_list = array_map( 'trim', $id_ids_list );
			// is_numeric does sanitization
			$id_ids_list = array_filter( $id_ids_list, 'is_numeric' );
			$id_ids_list = array_map( 'intval', $id_ids_list );
			$trans_ids = array();
			if ( ! empty ( $id_ids_list ) ) {
				foreach ( $id_ids_list as $id_ids_item ) {
					// Adjust for WPML support
					$id_ids_item = apply_filters( 'translate_object_id', $id_ids_item, 'any', true, null );
					$trans_ids[] = $id_ids_item;
				}
			}
			if ( count( $trans_ids ) > 0 ) {
				$view_settings['post_id_ids_list'] = implode( ",", $trans_ids );
			}
			
		}
		ob_start();
		?>
		<p class='wpv-filter-post-id-edit-summary js-wpv-filter-summary js-wpv-filter-post-id-summary'>
			<?php echo wpv_get_filter_post_id_summary_txt( $view_settings ); ?>
		</p>
		<?php
		WPV_Filter_Item::simple_filter_list_item_buttons( 'post-id', 'wpv_filter_post_id_update', wp_create_nonce( 'wpv_view_filter_post_id_nonce' ), 'wpv_filter_post_id_delete', wp_create_nonce( 'wpv_view_filter_post_id_delete_nonce' ) );
		?>
		<div id="wpv-filter-post-id-edit" class="wpv-filter-edit js-wpv-filter-edit" style="padding-bottom:28px;">
			<div id="wpv-filter-post-id" class="js-wpv-filter-options js-wpv-filter-post-id-options">
				<?php WPV_ID_Filter::wpv_render_post_id_options( $view_settings ); ?>
			</div>
			<div class="js-wpv-filter-toolset-messages"></div>
			<span class="filter-doc-help">
				<?php echo sprintf(__('%sLearn about filtering by Post ID%s', 'wpv-views'),
					'<a class="wpv-help-link" href="' . WPV_FILTER_BY_POST_ID_LINK . '" target="_blank">',
					' &raquo;</a>'
				); ?>
			</span>
		</div>
		<?php
		$res = ob_get_clean();
		return $res;
	}
Exemplo n.º 3
0
	/**
	* wpv_get_list_item_ui_taxonomy_parent
	*
	* Render taxonomy parent filter item content in the filters list
	*
	* @param $view_settings
	*
	* @since unknown
	*/

	static function wpv_get_list_item_ui_taxonomy_parent( $view_settings = array() ) {
		if ( isset( $view_settings['taxonomy_type'] ) && is_array( $view_settings['taxonomy_type'] ) && sizeof( $view_settings['taxonomy_type'] ) > 0 ) {
			$view_settings['taxonomy_type'] = $view_settings['taxonomy_type'][0];
			if ( ! taxonomy_exists( $view_settings['taxonomy_type'] ) ) {
				return '<p class="toolset-alert">' . __( 'This View has a filter for a taxonomy that no longer exists. Please select one taxonomy and update the Content Selection section.', 'wpv-views' ) . '</p>';
			}
		}
		if ( isset( $view_settings['taxonomy_parent_mode'] ) && is_array( $view_settings['taxonomy_parent_mode'] ) ) {
			$view_settings['taxonomy_parent_mode'] = $view_settings['taxonomy_parent_mode'][0];
		}
		if ( 
			isset( $view_settings['taxonomy_type'] )
			&& isset( $view_settings['taxonomy_parent_id'] )
			&& ! empty( $view_settings['taxonomy_parent_id'] ) 
		) {
			// WordPress 4.2 compatibility - split terms
			$candidate_term_id_splitted = wpv_compat_get_split_term( $view_settings['taxonomy_parent_id'], $view_settings['taxonomy_type'] );
			if ( $candidate_term_id_splitted ) {
				$view_settings['taxonomy_parent_id'] = $candidate_term_id_splitted;
			}
			// Adjust for WPML support
			$view_settings['taxonomy_parent_id'] = apply_filters( 'translate_object_id', $view_settings['taxonomy_parent_id'], $view_settings['taxonomy_type'], true, null );
		}
		ob_start();
		?>
		<p class='wpv-filter-taxonomy-parent-edit-summary js-wpv-filter-summary js-wpv-filter-taxonomy-parent-summary'>
			<?php echo wpv_get_filter_taxonomy_parent_summary_txt( $view_settings ); ?>
		</p>
		<?php
		WPV_Filter_Item::simple_filter_list_item_buttons( 'taxonomy-parent', 'wpv_filter_taxonomy_parent_update', wp_create_nonce( 'wpv_view_filter_taxonomy_parent_nonce' ), 'wpv_filter_taxonomy_parent_delete', wp_create_nonce( 'wpv_view_filter_taxonomy_parent_delete_nonce' ) );
		?>
		<span class="wpv-filter-title-notice js-wpv-filter-taxonomy-parent-notice hidden">
			<i class="icon-bookmark icon-rotate-270 icon-large" title="<?php echo esc_attr( __( 'This filters needs some action', 'wpv-views' ) ); ?>"></i>
		</span>
		<div id="wpv-filter-taxonomy-parent-edit" class="wpv-filter-edit js-wpv-filter-edit">
			<div id="wpv-filter-taxonomy-parent" class="js-wpv-filter-options js-wpv-filter-taxonomy-parent-options">
				<?php WPV_Parent_Filter::wpv_render_taxonomy_parent_options( $view_settings ); ?>
			</div>
			<div class="js-wpv-filter-toolset-messages"></div>
		</div>
		<?php
		$res = ob_get_clean();
		return $res;
		
	}
	/**
	* wpv_get_list_item_ui_post_post_relationship
	*
	* Render post relationship filter item content in the filters list
	*
	* @param $view_settings
	*
	* @since unknown
	*/

	static function wpv_get_list_item_ui_post_post_relationship( $view_settings = array() ) {
		if ( isset( $view_settings['post_relationship_mode'] ) && is_array( $view_settings['post_relationship_mode'] ) ) {
			$view_settings['post_relationship_mode'] = $view_settings['post_relationship_mode'][0];
		}
		if (
			isset( $view_settings['post_relationship_id'] ) 
			&& ! empty( $view_settings['post_relationship_id'] )
		) {
			// Adjust for WPML support
			$view_settings['post_relationship_id'] = apply_filters( 'translate_object_id', $view_settings['post_relationship_id'], 'any', true, null );
		}
		if ( ! isset( $view_settings['post_type'] ) ) {
			$view_settings['post_type'] = array();
		}
		ob_start()
		?>
		<p class='wpv-filter-post-relationship-edit-summary js-wpv-filter-summary js-wpv-filter-post-relationship-summary'>
			<?php echo wpv_get_filter_post_relationship_summary_txt( $view_settings ); ?>
		</p>
		<?php
		WPV_Filter_Item::simple_filter_list_item_buttons( 'post-relationship', 'wpv_filter_post_relationship_update', wp_create_nonce( 'wpv_view_filter_post_relationship_nonce' ), 'wpv_filter_post_relationship_delete', wp_create_nonce( 'wpv_view_filter_post_relationship_delete_nonce' ) );
		?>
		<span class="wpv-filter-title-notice js-wpv-filter-post-relationship-notice hidden">
			<i class="icon-bookmark icon-rotate-270 icon-large" title="<?php echo esc_attr( __( 'This filters needs some action', 'wpv-views' ) ); ?>"></i>
		</span>
		<div id="wpv-filter-post-relationship-edit" class="wpv-filter-edit js-wpv-filter-edit" style="padding-bottom:28px;">
			<div id="wpv-filter-post-relationship" class="js-wpv-filter-options js-wpv-filter-post-relationship-options">
				<?php WPV_Post_Relationship_Filter::wpv_render_post_relationship( $view_settings ); ?>
			</div>
			<div class="js-wpv-filter-toolset-messages"></div>
			<span class="filter-doc-help">
				<a class="wpv-help-link" target="_blank" href="http://wp-types.com/documentation/user-guides/querying-and-displaying-child-posts/?utm_source=viewsplugin&utm_campaign=views&utm_medium=edit-view-relationships-filter&utm_term=Querying and Displaying Child Posts">
					<?php _e('Querying and Displaying Child Posts', 'wpv-views'); ?>
				 &raquo;</a>
			</span>
		</div>
		<?php
		$res = ob_get_clean();
		return $res;
	}
	/**
	* wpv_get_list_item_ui_taxonomy_term
	*
	* Render taxonomy term filter item content in the filters list
	*
	* @param $view_settings
	*
	* @since unknown
	*/

	static function wpv_get_list_item_ui_taxonomy_term( $view_settings = array() ) {
		if ( isset( $view_settings['taxonomy_type'] ) && is_array( $view_settings['taxonomy_type'] ) ) {
            $view_settings['taxonomy_type'] = $view_settings['taxonomy_type'][0];
        }
        if ( ! isset( $view_settings['taxonomy_terms_mode'] ) ) {
			$view_settings['taxonomy_terms_mode'] = 'THESE';
		}
        if ( ! isset( $view_settings['taxonomy_terms'] ) ) {
			$view_settings['taxonomy_terms'] = array();
        }
		if ( ! empty( $view_settings['taxonomy_terms'] ) ) {
			$adjusted_term_ids = array();
			foreach ( $view_settings['taxonomy_terms'] as $candidate_term_id ) {
				// WordPress 4.2 compatibility - split terms
				$candidate_term_id_splitted = wpv_compat_get_split_term( $candidate_term_id, $view_settings['taxonomy_type'] );
				if ( $candidate_term_id_splitted ) {
					$candidate_term_id = $candidate_term_id_splitted;
				}
				// WPML support
				$candidate_term_id = apply_filters( 'translate_object_id', $candidate_term_id, $view_settings['taxonomy_type'], true, null );
				$adjusted_term_ids[] = $candidate_term_id;
			}
			$view_settings['taxonomy_terms'] = $adjusted_term_ids;
		}
		ob_start()
		?>
		<p class='wpv-filter-taxonomy-term-summary js-wpv-filter-summary js-wpv-filter-taxonomy-term-summary'>
			<?php echo wpv_get_filter_taxonomy_term_summary_txt( $view_settings ); ?>
		</p>
		<?php
		WPV_Filter_Item::simple_filter_list_item_buttons( 'taxonomy-term', 'wpv_filter_taxonomy_term_update', wp_create_nonce( 'wpv_view_filter_taxonomy_term_nonce' ), 'wpv_filter_taxonomy_term_delete', wp_create_nonce( 'wpv_view_filter_taxonomy_term_delete_nonce' ) );
		?>
		<div id="wpv-filter-taxonomy-term-edit" class="wpv-filter-edit js-wpv-filter-edit">
			<div id="wpv-filter-taxonomy-term" class="js-wpv-filter-options js-wpv-filter-taxonomy-term-options">
				<?php WPV_Taxonomy_Term_Filter::wpv_render_taxonomy_term_options( $view_settings ); ?>
			</div>
			<div class="js-wpv-filter-toolset-messages"></div>
		</div>
		<?php
		$res = ob_get_clean();
		return $res;
    }
Exemplo n.º 6
0
	/**
	* wpv_get_list_item_ui_taxonomy_search
	*
	* Render taxonomy search filter item content in the filters list
	*
	* @param $view_settings
	*
	* @since unknown
	*/

	static function wpv_get_list_item_ui_taxonomy_search( $selected, $view_settings = array() ) {
		if ( isset( $view_settings['taxonomy_search_mode'] ) && is_array( $view_settings['taxonomy_search_mode'] ) ) {
			$view_settings['taxonomy_search_mode'] = $view_settings['taxonomy_search_mode'][0];
		}
		if ( !isset( $view_settings['taxonomy_search_value'] ) ) {
			$view_settings['taxonomy_search_value'] = '';
		}
		ob_start();
		?>
		<p class='wpv-filter-taxonomy-search-summary js-wpv-filter-summary js-wpv-filter-taxonomy-search-summary'>
			<?php echo wpv_get_filter_taxonomy_search_summary_txt( $view_settings ); ?>
		</p>
		<?php
		WPV_Filter_Item::simple_filter_list_item_buttons( 'taxonomy-search', 'wpv_filter_taxonomy_search_update', wp_create_nonce( 'wpv_view_filter_taxonomy_search_nonce' ), 'wpv_filter_taxonomy_search_delete', wp_create_nonce( 'wpv_view_filter_taxonomy_search_delete_nonce' ) );
		?>
		<div id="wpv-filter-taxonomy-search-edit" class="wpv-filter-edit js-wpv-filter-edit">
			<div id="wpv-filter-taxonomy-search" class="js-wpv-filter-options js-wpv-filter-taxonomy-search-options">
				<?php WPV_Search_Filter::wpv_render_taxonomy_search_options( $view_settings ); ?>
			</div>
			<div class="js-wpv-filter-toolset-messages"></div>
		</div>
		<?php
		$res = ob_get_clean();
		return $res;
	}
Exemplo n.º 7
0
	/**
	* wpv_get_list_item_ui_post_author
	*
	* Render author filter item content in the filters list
	*
	* @param $view_settings
	*
	* @since unknown
	*/

	static function wpv_get_list_item_ui_post_author( $view_settings = array() ) {
		if ( isset( $view_settings['author_mode'] ) && is_array( $view_settings['author_mode'] ) ) {
			$view_settings['author_mode'] = $view_settings['author_mode'][0];
		}
		ob_start();
		?>
		<p class='wpv-filter-post-author-edit-summary js-wpv-filter-summary js-wpv-filter-post-author-summary'>
			<?php echo wpv_get_filter_post_author_summary_txt( $view_settings ); ?>
		</p>
		<?php
		WPV_Filter_Item::simple_filter_list_item_buttons( 'post-author', 'wpv_filter_post_author_update', wp_create_nonce( 'wpv_view_filter_post_author_nonce' ), 'wpv_filter_post_author_delete', wp_create_nonce( 'wpv_view_filter_post_author_delete_nonce' ) );
		?>
		<div id="wpv-filter-post-author-edit" class="wpv-filter-edit js-wpv-filter-edit" style="padding-bottom:28px;">
			<div id="wpv-filter-post-author" class="js-wpv-filter-options js-wpv-filter-post-author-options">
				<?php WPV_Author_Filter::wpv_render_post_author_options( $view_settings ); ?>
			</div>
			<div class="js-wpv-filter-toolset-messages"></div>
			<span class="filter-doc-help">
				<?php echo sprintf(__('%sLearn about filtering by Post Author%s', 'wpv-views'),
					'<a class="wpv-help-link" href="' . WPV_FILTER_BY_AUTHOR_LINK . '" target="_blank">',
					' &raquo;</a>'
				); ?>
			</span>
		</div>
		<?php
		$res = ob_get_clean();
		return $res;
	}
Exemplo n.º 8
0
	/**
	* wpv_get_list_item_ui_users
	*
	* Render users filter item content in the filters list
	*
	* @param $view_settings
	*
	* @since unknown
	*/

	static function wpv_get_list_item_ui_users( $view_settings = array() ) {
		if ( isset( $view_settings['users_mode'] ) && is_array( $view_settings['users_mode'] ) ) {
			$view_settings['users_mode'] = $view_settings['users_mode'][0];
		}
		ob_start();
		?>
		<p class='wpv-filter-users-edit-summary js-wpv-filter-summary js-wpv-filter-users-summary'>
			<?php echo wpv_get_filter_users_summary_txt( $view_settings ); ?>
		</p>
		<?php
		WPV_Filter_Item::simple_filter_list_item_buttons( 'users', 'wpv_filter_users_update', wp_create_nonce( 'wpv_view_filter_users_nonce' ), 'wpv_filter_users_delete', wp_create_nonce( 'wpv_view_filter_users_delete_nonce' ) );
		?>
		<div id="wpv-filter-users-edit" class="wpv-filter-users-edit wpv-filter-edit js-wpv-filter-edit">
			<div id="wpv-filter-users" class="js-wpv-filter-options js-wpv-filter-users-options">
				<?php WPV_Users_Filter::wpv_render_users_options( $view_settings ); ?>
			</div>
			<div class="js-wpv-filter-toolset-messages"></div>
		</div>
		<?php
		$res = ob_get_clean();
		return $res;
	}