wordpress/wp-content/plugins/cms-tree-page-view/functions.php
/**
 * Output tree and html code for post overview page
 */
Output tree and html code for post overview page
Output tree and html code for post overview page
function cmstpv_filter_views_edit_postsoverview($filter_var) {
	$current_screen = get_current_screen();
	ob_start();
	cms_tpv_print_common_tree_stuff();
	$tree_common_stuff = ob_get_clean();
	$mode = "tree";
	$class = isset($_GET["mode"]) && $_GET["mode"] == $mode ? " class='current' " : "";
	$title = __("Tree View", 'cms-tree-page-view');
	$tree_a = "<a href='" . esc_url( add_query_arg( 'mode', $mode, $_SERVER['REQUEST_URI'] ) ) . "' $class> <img id='view-switch-$mode' src='" . esc_url( includes_url( 'images/blank.gif' ) ) . "' width='20' height='20' title='$title' alt='$title' /></a>\n";
	$wp_list_a = "";
	if (is_post_type_hierarchical( $current_screen->post_type ) ) {
		$mode = "list";
		$class = isset($_GET["mode"]) && $_GET["mode"] != $mode ? " class='cmstpv_add_list_view' " : " class='cmstpv_add_list_view current' ";
		$title = __("List View"); 
		$wp_list_a = "<a href='" . esc_url( add_query_arg( 'mode', $mode, $_SERVER['REQUEST_URI'] ) ) . "' $class><img id='view-switch-$mode' src='" . esc_url( includes_url( 'images/blank.gif' ) ) . "' width='20' height='20' title='$title' alt='$title' /></a>\n";
	}
	$out = "";
	$out .= $tree_a;
	$out .= $wp_list_a;
	if (isset($_GET["mode"]) && $_GET["mode"] === "tree") {
		$out .= sprintf('
			<div class="cmstpv-postsoverview-wrap">
				%1$s
			</div>
		', $tree_common_stuff);
	}
	echo $out;
	return $filter_var;
}
function cmstpv_filter_views_edit_postsoverview ( $ filter_var ) { $ current_screen = get_current_screen ( ) ; ob_start ( ) ; cms_tpv_print_common_tree_stuff ( ) ; $ tree_common_stuff = ob_get_clean ( ) ; $ mode = " tree " ; $ class = isset ( $ _GET [ " mode " ] ) && $ _GET [ " mode " ] == $ mode ? "  class='current'  " : " " ; $ title = __ ( " Tree View " , 'cms-tree-page-view' ) ; $ tree_a = " <a href=' " . esc_url ( add_query_arg ( 'mode' , $ mode , $ _SERVER [ 'REQUEST_URI' ] ) ) . " '  $ class > <img id='view-switch- $ mode ' src=' " . esc_url ( includes_url ( 'images/blank.gif' ) ) . " ' width='20' height='20' title=' $ title ' alt=' $ title ' /></a> \n " ; $ wp_list_a = " " ; if ( is_post_type_hierarchical ( $ current_screen -> post_type ) ) { $ mode = " list " ; $ class = isset ( $ _GET [ " mode " ] ) && $ _GET [ " mode " ] != $ mode ? "  class='cmstpv_add_list_view'  " : "  class='cmstpv_add_list_view current'  " ; $ title = __ ( " List View " ) ; $ wp_list_a = " <a href=' " . esc_url ( add_query_arg ( 'mode' , $ mode , $ _SERVER [ 'REQUEST_URI' ] ) ) . " '  $ class ><img id='view-switch- $ mode ' src=' " . esc_url ( includes_url ( 'images/blank.gif' ) ) . " ' width='20' height='20' title=' $ title ' alt=' $ title ' /></a> \n " ; } $ out = " " ; $ out .= $ tree_a ; $ out .= $ wp_list_a ; if ( isset ( $ _GET [ " mode " ] ) && $ _GET [ " mode " ] === " tree " ) { $ out .= sprintf ( '
			<div class="cmstpv-postsoverview-wrap">
				%1$s
			</div>
		' , $ tree_common_stuff ) ; } echo $ out ; return $ filter_var ; }
Output tree and html code for post overview page
Output tree and html code for post overview page
/*
	on non hierarcical post types this one exists:
	tablenav-pages one-page
	then after:
	<div class="view-switch">

	if view-switch exists: add item to it
	if view-switch not exists: add it + item to it

	*/ // Copy of wordpress own, if it does not exist /* translation not missing - exists in wp */ // Output tree related stuff if that view/mode is selected