Version Description
- Some CSS changes. The icons and text and smaller now. I think it's better this way, you can fit so many more pages in the tree now.
- Now you can add new pages below or as a child to a page. For me this has been the feature I've missed the most.
Download this release
Release Info
| Developer | eskapism |
| Plugin | |
| Version | 0.2 |
| Comparing to | |
| See all releases | |
Version 0.2
- arrow-left.gif +0 -0
- index.php +355 -0
- lock.png +0 -0
- page-small.gif +0 -0
- page_white_text.png +0 -0
- readme.txt +43 -0
- screenshot-1.jpg +0 -0
- screenshot-2.png +0 -0
- styles.css +210 -0
arrow-left.gif
ADDED
|
Binary file
|
index.php
ADDED
|
@@ -0,0 +1,355 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/*
|
| 3 |
+
Plugin Name: Admin Menu Tree Page View
|
| 4 |
+
Plugin URI: http://eskapism.se/code-playground/admin-menu-tree-page-view/
|
| 5 |
+
Description: Adds a tree of all your pages or custom posts. Use drag & drop to reorder your pages, and edit, view, add, and search your pages.
|
| 6 |
+
Version: 0.2
|
| 7 |
+
Author: Pär Thernström
|
| 8 |
+
Author URI: http://eskapism.se/
|
| 9 |
+
License: GPL2
|
| 10 |
+
*/
|
| 11 |
+
|
| 12 |
+
/* Copyright 2010 Pär Thernström (email: par.thernstrom@gmail.com)
|
| 13 |
+
|
| 14 |
+
This program is free software; you can redistribute it and/or modify
|
| 15 |
+
it under the terms of the GNU General Public License, version 2, as
|
| 16 |
+
published by the Free Software Foundation.
|
| 17 |
+
|
| 18 |
+
This program is distributed in the hope that it will be useful,
|
| 19 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 20 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 21 |
+
GNU General Public License for more details.
|
| 22 |
+
|
| 23 |
+
You should have received a copy of the GNU General Public License
|
| 24 |
+
along with this program; if not, write to the Free Software
|
| 25 |
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
| 26 |
+
*/
|
| 27 |
+
|
| 28 |
+
/*
|
| 29 |
+
Admin Menu Tree Page View
|
| 30 |
+
admin-menu-tree-page-view
|
| 31 |
+
*/
|
| 32 |
+
add_action('admin_menu', 'admin_menu_tree_page_view_admin_menu');
|
| 33 |
+
add_action("admin_head", "admin_menu_tree_page_view_admin_head");
|
| 34 |
+
add_action("admin_init", "admin_menu_tree_page_view_admin_init");
|
| 35 |
+
add_action('wp_ajax_admin_menu_tree_page_view_add_page', 'admin_menu_tree_page_view_add_page');
|
| 36 |
+
|
| 37 |
+
function admin_menu_tree_page_view_admin_init() {
|
| 38 |
+
define( "admin_menu_tree_page_view_URL", WP_PLUGIN_URL . '/admin-menu-tree-page-view/' );
|
| 39 |
+
define( "admin_menu_tree_page_view_VERSION", "0.2" );
|
| 40 |
+
wp_enqueue_style( "admin_menu_tree_page_view_styles", admin_menu_tree_page_view_URL . "styles.css", false, admin_menu_tree_page_view_VERSION );
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
function admin_menu_tree_page_view_admin_head() {
|
| 44 |
+
?>
|
| 45 |
+
<script type="text/javascript">
|
| 46 |
+
jQuery(function($) {
|
| 47 |
+
|
| 48 |
+
setTimeout(function() {
|
| 49 |
+
jQuery("#toplevel_page_admin-menu-tree-page-tree_main").addClass("wp-menu-open");
|
| 50 |
+
}, 100);
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
// show menu when menu icon is clicked
|
| 54 |
+
jQuery(".admin-menu-tree-page-view-edit").click(function() {
|
| 55 |
+
|
| 56 |
+
var $this = $(this);
|
| 57 |
+
|
| 58 |
+
// check if this tree has a menu div defined
|
| 59 |
+
var wpsubmenu = $(this).closest("div.wp-submenu");
|
| 60 |
+
if (wpsubmenu.length == 1) {
|
| 61 |
+
|
| 62 |
+
var div_popup = wpsubmenu.find(".admin-menu-tree-page-view-popup");
|
| 63 |
+
var do_show = true;
|
| 64 |
+
if (div_popup.length == 0) {
|
| 65 |
+
// no menu div yet, create it
|
| 66 |
+
var html = "";
|
| 67 |
+
html += "<div class='admin-menu-tree-page-view-popup'><span class='admin-menu-tree-page-view-popup-arrow'></span><span class='admin-menu-tree-page-view-popup-page'></span>";
|
| 68 |
+
html += "<ul>";
|
| 69 |
+
html += "<li class='admin-menu-tree-page-view-popup-edit'><a href=''>Edit</a></li>";
|
| 70 |
+
html += "<li class='admin-menu-tree-page-view-popup-view'><a href=''>View</a></li>";
|
| 71 |
+
html += "<li class='admin-menu-tree-page-view-popup-add-here'><a href=''>Add new page here</a></li>";
|
| 72 |
+
html += "<li class='admin-menu-tree-page-view-popup-add-inside'><a href=''>Add new page inside</a></li>";
|
| 73 |
+
html += "</ul></div>";
|
| 74 |
+
var div_popup = $(html).appendTo(wpsubmenu);
|
| 75 |
+
div_popup.show(); // must do this..
|
| 76 |
+
div_popup.hide(); // ..or fade does not work first time
|
| 77 |
+
} else {
|
| 78 |
+
if (div_popup.is(":visible")) {
|
| 79 |
+
//do_show = false;
|
| 80 |
+
}
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
var a = $this.closest("a");
|
| 84 |
+
var link_text = a.text();
|
| 85 |
+
if (div_popup.find(".admin-menu-tree-page-view-popup-page").text() == link_text) {
|
| 86 |
+
do_show = false;
|
| 87 |
+
}
|
| 88 |
+
div_popup.find(".admin-menu-tree-page-view-popup-page").text( link_text );
|
| 89 |
+
var offset = $this.offset();
|
| 90 |
+
offset.top = (offset.top-3);
|
| 91 |
+
offset.left = (offset.left-3);
|
| 92 |
+
|
| 93 |
+
// store post_id
|
| 94 |
+
var post_id = a.attr("href").match(/post=([\w]+)/);
|
| 95 |
+
post_id = post_id[1];
|
| 96 |
+
div_popup.data("admin-menu-tree-page-view-current-post-id", post_id);
|
| 97 |
+
|
| 98 |
+
// setup edit and view links
|
| 99 |
+
var edit_link = "post.php?post="+post_id+"&action=edit";
|
| 100 |
+
div_popup.find(".admin-menu-tree-page-view-popup-edit a").attr("href", edit_link);
|
| 101 |
+
|
| 102 |
+
// view link, this is probably not such a safe way to this this. but let's try! :)
|
| 103 |
+
var view_link = "../?p=" + post_id;
|
| 104 |
+
div_popup.find(".admin-menu-tree-page-view-popup-view a").attr("href", view_link);
|
| 105 |
+
|
| 106 |
+
if (do_show) {
|
| 107 |
+
//console.log("show");
|
| 108 |
+
div_popup.fadeIn("fast");
|
| 109 |
+
} else {
|
| 110 |
+
// same popup, so close it
|
| 111 |
+
//console.log("hide");
|
| 112 |
+
div_popup.fadeOut("fast");
|
| 113 |
+
div_popup.find(".admin-menu-tree-page-view-popup-page").text("");
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
div_popup.offset( offset ); // must be last or position gets wrong somehow
|
| 117 |
+
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
return false;
|
| 121 |
+
});
|
| 122 |
+
|
| 123 |
+
// hide menu
|
| 124 |
+
$(".admin-menu-tree-page-view-popup-arrow").live("click", function() {
|
| 125 |
+
$(this).closest(".admin-menu-tree-page-view-popup").fadeOut("fast");
|
| 126 |
+
return false;
|
| 127 |
+
});
|
| 128 |
+
|
| 129 |
+
// add page
|
| 130 |
+
$(".admin-menu-tree-page-view-popup-add-here, .admin-menu-tree-page-view-popup-add-inside").live("click", function() {
|
| 131 |
+
var div_popup = $(this).closest(".admin-menu-tree-page-view-popup");
|
| 132 |
+
var post_id = div_popup.data("admin-menu-tree-page-view-current-post-id");
|
| 133 |
+
|
| 134 |
+
var type = "after";
|
| 135 |
+
if ($(this).hasClass("admin-menu-tree-page-view-popup-add-inside")) {
|
| 136 |
+
type = "inside";
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
var page_title = prompt("Enter name of new page", "Untitled");
|
| 140 |
+
if (page_title) {
|
| 141 |
+
|
| 142 |
+
var data = {
|
| 143 |
+
"action": 'admin_menu_tree_page_view_add_page',
|
| 144 |
+
"pageID": post_id,
|
| 145 |
+
"type": type,
|
| 146 |
+
"page_title": page_title,
|
| 147 |
+
"post_type": "page"
|
| 148 |
+
};
|
| 149 |
+
jQuery.post(ajaxurl, data, function(response) {
|
| 150 |
+
//alert(response);
|
| 151 |
+
if (response != "0") {
|
| 152 |
+
document.location = response;
|
| 153 |
+
}
|
| 154 |
+
});
|
| 155 |
+
|
| 156 |
+
} else {
|
| 157 |
+
return false;
|
| 158 |
+
}
|
| 159 |
+
|
| 160 |
+
});
|
| 161 |
+
|
| 162 |
+
|
| 163 |
+
});
|
| 164 |
+
|
| 165 |
+
</script>
|
| 166 |
+
|
| 167 |
+
<?php
|
| 168 |
+
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
function admin_menu_tree_page_view_get_pages($args) {
|
| 172 |
+
|
| 173 |
+
|
| 174 |
+
#$pages = get_pages($args);
|
| 175 |
+
|
| 176 |
+
$defaults = array(
|
| 177 |
+
"post_type" => "page",
|
| 178 |
+
"parent" => "0",
|
| 179 |
+
"post_parent" => "0",
|
| 180 |
+
"numberposts" => "-1",
|
| 181 |
+
"orderby" => "menu_order",
|
| 182 |
+
"order" => "ASC",
|
| 183 |
+
"post_status" => "any"
|
| 184 |
+
);
|
| 185 |
+
$args = wp_parse_args( $args, $defaults );
|
| 186 |
+
|
| 187 |
+
$pages = get_posts($args);
|
| 188 |
+
#bonny_d($pages);
|
| 189 |
+
foreach ($pages as $one_page) {
|
| 190 |
+
$edit_link = get_edit_post_link($one_page->ID);
|
| 191 |
+
$title = get_the_title($one_page->ID);
|
| 192 |
+
$class = "";
|
| 193 |
+
if (isset($_GET["action"]) && $_GET["action"] == "edit" && isset($_GET["post"]) && $_GET["post"] == $one_page->ID) {
|
| 194 |
+
$class = "current";
|
| 195 |
+
}
|
| 196 |
+
$status_span = "";
|
| 197 |
+
if ($one_page->post_password) {
|
| 198 |
+
$status_span .= "<span class='admin-menu-tree-page-view-protected'></span>";
|
| 199 |
+
}
|
| 200 |
+
if ($one_page->post_status != "publish") {
|
| 201 |
+
$status_span .= "<span class='admin-menu-tree-page-view-status admin-menu-tree-page-view-status-{$one_page->post_status}'>{$one_page->post_status}</span>";
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
$output .= "<li class='$class $css_status'>";
|
| 205 |
+
$output .= "<a href='$edit_link'>$status_span";
|
| 206 |
+
$output .= $title;
|
| 207 |
+
|
| 208 |
+
$output .= "<span class='admin-menu-tree-page-view-edit'></span>";
|
| 209 |
+
|
| 210 |
+
$output .= "</a>";
|
| 211 |
+
|
| 212 |
+
// now fetch child articles
|
| 213 |
+
#print_r($one_page);
|
| 214 |
+
$args_childs = $args;
|
| 215 |
+
$args_childs["parent"] = $one_page->ID;
|
| 216 |
+
$args_childs["post_parent"] = $one_page->ID;
|
| 217 |
+
$args_childs["child_of"] = $one_page->ID;
|
| 218 |
+
#echo "<pre>";print_r($args_childs);
|
| 219 |
+
$output .= admin_menu_tree_page_view_get_pages($args_childs);
|
| 220 |
+
|
| 221 |
+
$output .= "</li>";
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
// if this is a child listing, add ul
|
| 225 |
+
if ($args["child_of"]) {
|
| 226 |
+
$output = "<ul class='admin-menu-tree-page-tree_childs'>$output</ul>";
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
return $output;
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
function admin_menu_tree_page_view_admin_menu() {
|
| 233 |
+
|
| 234 |
+
// add main menu
|
| 235 |
+
#add_menu_page( "title", "Simple Menu Pages", "edit_pages", "admin-menu-tree-page-tree_main", "bonnyFunction", null, 5);
|
| 236 |
+
|
| 237 |
+
// end link that is written automatically by WP, and begin ul
|
| 238 |
+
$output = "
|
| 239 |
+
</a>
|
| 240 |
+
<ul class='admin-menu-tree-page-tree'>
|
| 241 |
+
<li class='admin-menu-tree-page-tree_headline'>Pages</li>
|
| 242 |
+
";
|
| 243 |
+
|
| 244 |
+
// get root items
|
| 245 |
+
$args = array(
|
| 246 |
+
"echo" => 0,
|
| 247 |
+
"sort_order" => "ASC",
|
| 248 |
+
"sort_column" => "menu_order",
|
| 249 |
+
"parent" => 0
|
| 250 |
+
);
|
| 251 |
+
|
| 252 |
+
$output .= admin_menu_tree_page_view_get_pages($args);
|
| 253 |
+
|
| 254 |
+
// end our ul and add the a-tag that wp automatically will close
|
| 255 |
+
$output .= "
|
| 256 |
+
</ul>
|
| 257 |
+
<a href='#'>
|
| 258 |
+
";
|
| 259 |
+
|
| 260 |
+
// add subitems to main menu
|
| 261 |
+
add_submenu_page("edit.php?post_type=page", "Tree View", $output, "edit_pages", "admin-menu-tree-page-tree", "admin_menu_tree_page_page");
|
| 262 |
+
|
| 263 |
+
}
|
| 264 |
+
|
| 265 |
+
function admin_menu_tree_page_page() {
|
| 266 |
+
?>
|
| 267 |
+
|
| 268 |
+
<h2>Simple Admin Menu Tree</h2>
|
| 269 |
+
<p>Nothing to see here. Move along! :)</p>
|
| 270 |
+
|
| 271 |
+
<?php
|
| 272 |
+
}
|
| 273 |
+
|
| 274 |
+
|
| 275 |
+
|
| 276 |
+
/**
|
| 277 |
+
* Code from plugin CMS Tree Page View
|
| 278 |
+
* http://wordpress.org/extend/plugins/cms-tree-page-view/
|
| 279 |
+
* Used with permission! :)
|
| 280 |
+
*/
|
| 281 |
+
function admin_menu_tree_page_view_add_page() {
|
| 282 |
+
|
| 283 |
+
global $wpdb;
|
| 284 |
+
|
| 285 |
+
/*
|
| 286 |
+
(
|
| 287 |
+
[action] => cms_tpv_add_page
|
| 288 |
+
[pageID] => cms-tpv-1318
|
| 289 |
+
type
|
| 290 |
+
)
|
| 291 |
+
*/
|
| 292 |
+
$type = $_POST["type"];
|
| 293 |
+
$pageID = (int) $_POST["pageID"];
|
| 294 |
+
#$pageID = str_replace("cms-tpv-", "", $pageID);
|
| 295 |
+
$page_title = trim($_POST["page_title"]);
|
| 296 |
+
$post_type = $_POST["post_type"];
|
| 297 |
+
$wpml_lang = $_POST["wpml_lang"];
|
| 298 |
+
if (!$page_title) { $page_title = __("New page", 'cms-tree-page-view'); }
|
| 299 |
+
|
| 300 |
+
$ref_post = get_post($pageID);
|
| 301 |
+
|
| 302 |
+
if ("after" == $type) {
|
| 303 |
+
|
| 304 |
+
/*
|
| 305 |
+
add page under/below ref_post
|
| 306 |
+
*/
|
| 307 |
+
|
| 308 |
+
// update menu_order of all pages below our page
|
| 309 |
+
$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET menu_order = menu_order+2 WHERE post_parent = %d AND menu_order >= %d AND id <> %d ", $ref_post->post_parent, $ref_post->menu_order, $ref_post->ID ) );
|
| 310 |
+
|
| 311 |
+
// create a new page and then goto it
|
| 312 |
+
$post_new = array();
|
| 313 |
+
$post_new["menu_order"] = $ref_post->menu_order+1;
|
| 314 |
+
$post_new["post_parent"] = $ref_post->post_parent;
|
| 315 |
+
$post_new["post_type"] = "page";
|
| 316 |
+
$post_new["post_status"] = "draft";
|
| 317 |
+
$post_new["post_title"] = $page_title;
|
| 318 |
+
$post_new["post_content"] = "";
|
| 319 |
+
$post_new["post_type"] = $post_type;
|
| 320 |
+
$newPostID = wp_insert_post($post_new);
|
| 321 |
+
|
| 322 |
+
} else if ( "inside" == $type ) {
|
| 323 |
+
|
| 324 |
+
/*
|
| 325 |
+
add page inside ref_post
|
| 326 |
+
*/
|
| 327 |
+
|
| 328 |
+
// update menu_order, so our new post is the only one with order 0
|
| 329 |
+
$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET menu_order = menu_order+1 WHERE post_parent = %d", $ref_post->ID) );
|
| 330 |
+
|
| 331 |
+
$post_new = array();
|
| 332 |
+
$post_new["menu_order"] = 0;
|
| 333 |
+
$post_new["post_parent"] = $ref_post->ID;
|
| 334 |
+
$post_new["post_type"] = "page";
|
| 335 |
+
$post_new["post_status"] = "draft";
|
| 336 |
+
$post_new["post_title"] = $page_title;
|
| 337 |
+
$post_new["post_content"] = "";
|
| 338 |
+
$post_new["post_type"] = $post_type;
|
| 339 |
+
$newPostID = wp_insert_post($post_new);
|
| 340 |
+
|
| 341 |
+
}
|
| 342 |
+
if ($newPostID) {
|
| 343 |
+
// return editlink for the newly created page
|
| 344 |
+
$editLink = get_edit_post_link($newPostID, '');
|
| 345 |
+
if ($wpml_lang) {
|
| 346 |
+
$editLink = add_query_arg("lang", $wpml_lang, $editLink);
|
| 347 |
+
}
|
| 348 |
+
echo $editLink;
|
| 349 |
+
} else {
|
| 350 |
+
// fail, tell js
|
| 351 |
+
echo "0";
|
| 352 |
+
}
|
| 353 |
+
#print_r($post_new);
|
| 354 |
+
exit;
|
| 355 |
+
}
|
lock.png
ADDED
|
Binary file
|
page-small.gif
ADDED
|
Binary file
|
page_white_text.png
ADDED
|
Binary file
|
readme.txt
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
=== Admin Menu Tree Page View ===
|
| 2 |
+
Contributors: eskapism, MarsApril
|
| 3 |
+
Donate link: http://eskapism.se/sida/donate/
|
| 4 |
+
Tags: admin, page, pages, tree, view, admin menu, menu
|
| 5 |
+
Requires at least: 3.0
|
| 6 |
+
Tested up to: 3.0
|
| 7 |
+
Stable tag: trunk
|
| 8 |
+
|
| 9 |
+
Get a tree view of all your pages directly in the admin menu. Edit, view and add pages - all is available just one click away!
|
| 10 |
+
|
| 11 |
+
== Description ==
|
| 12 |
+
|
| 13 |
+
This WordPress plugin adds all your pages to the admin menu, so all your pages will always be available within just one click.
|
| 14 |
+
You can also add pages directly in the tree.
|
| 15 |
+
|
| 16 |
+
Probably most suitable for CMS-like installations with lots of pages.
|
| 17 |
+
|
| 18 |
+
#### Donation and more plugins
|
| 19 |
+
* If you like this plugin don't forget to [donate to support further development](http://eskapism.se/sida/donate/).
|
| 20 |
+
* Check out some [more plugins](http://wordpress.org/extend/plugins/profile/eskapism) by the same author.
|
| 21 |
+
|
| 22 |
+
== Installation ==
|
| 23 |
+
|
| 24 |
+
1. Upload the folder "cms-tree-page-view" to "/wp-content/plugins/"
|
| 25 |
+
1. Activate the plugin through the "Plugins" menu in WordPress
|
| 26 |
+
1. Done!
|
| 27 |
+
|
| 28 |
+
Now the tree with the pages will be visible both on the dashboard and in the menu under pages.
|
| 29 |
+
|
| 30 |
+
== Screenshots ==
|
| 31 |
+
|
| 32 |
+
1. The menu page tree with all your pages. Pretty neat, eh?
|
| 33 |
+
2. Since version 0.2 you can easily add new pages too. This will make you a page kung fu master.
|
| 34 |
+
|
| 35 |
+
== Changelog ==
|
| 36 |
+
|
| 37 |
+
= 0.2 =
|
| 38 |
+
- Some CSS changes. The icons and text and smaller now. I think it's better this way, you can fit so many more pages in the tree now.
|
| 39 |
+
- Now you can add new pages below or as a child to a page. For me this has been the feature I've missed the most.
|
| 40 |
+
|
| 41 |
+
= 0.1 =
|
| 42 |
+
- It's alive!
|
| 43 |
+
|
screenshot-1.jpg
ADDED
|
Binary file
|
screenshot-2.png
ADDED
|
Binary file
|
styles.css
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
| 5 |
+
border-left-style: solid;
|
| 6 |
+
xbackground: transparent url(page-small.gif) no-repeat 7px 2px !important;
|
| 7 |
+
xbackground: transparent url(http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.3/themes/ui-darkness/images/ui-icons_cccccc_256x240.png) no-repeat -16px -126px;
|
| 8 |
+
padding-left: 19px;
|
| 9 |
+
}
|
| 10 |
+
#adminmenu li.wp-has-current-submenu ul.admin-menu-tree-page-tree {
|
| 11 |
+
border-bottom-width: 0;
|
| 12 |
+
}
|
| 13 |
+
li.toplevel_page_admin-menu-tree-page-tree_main .wp-first-item {
|
| 14 |
+
display: none;
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
li.toplevel_page_admin-menu-tree-page-tree_main .wp-submenu a {
|
| 18 |
+
background-image: none;
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
#adminmenu li.wp-has-current-submenu ul.admin-menu-tree-page-tree {
|
| 23 |
+
border-left: 1px solid #aaa;
|
| 24 |
+
border-right: 1px solid #aaa;
|
| 25 |
+
padding-top: 5px;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
#adminmenu li .wp-submenu ul.admin-menu-tree-page-tree li {
|
| 30 |
+
position: relative;
|
| 31 |
+
}
|
| 32 |
+
#adminmenu li .wp-submenu ul.admin-menu-tree-page-tree li a {
|
| 33 |
+
border-left-width: 1px;
|
| 34 |
+
border-left-style: solid;
|
| 35 |
+
border-right-width: 1px;
|
| 36 |
+
border-right-style: solid;
|
| 37 |
+
|
| 38 |
+
background: transparent url(page-small.gif) no-repeat 7px 2px !important;
|
| 39 |
+
|
| 40 |
+
padding-left: 19px;
|
| 41 |
+
padding-right: 8px;
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
#adminmenu li .wp-submenu ul.admin-menu-tree-page-tree li a:hover {
|
| 45 |
+
background-color: #eaf2fa !important;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
#adminmenu li.wp-has-current-submenu ul.admin-menu-tree-page-tree li a {
|
| 49 |
+
border-left-width: 0;
|
| 50 |
+
border-right-width: 0;
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
#adminmenu li ul.admin-menu-tree-page-tree li a {
|
| 54 |
+
font-size: 10px;
|
| 55 |
+
line-height: 13px;
|
| 56 |
+
padding-top: 2px;
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
#adminmenu li.wp-has-current-submenu ul li a {
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
#adminmenu li ul.admin-menu-tree-page-tree a .admin-menu-tree-page-view-edit {
|
| 63 |
+
display: none;
|
| 64 |
+
position: absolute;
|
| 65 |
+
top: -2px;
|
| 66 |
+
right: 0px;
|
| 67 |
+
width: 16px;
|
| 68 |
+
height: 16px;
|
| 69 |
+
background: transparent url(http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.3/themes/ui-darkness/images/ui-icons_cccccc_256x240.png) no-repeat -16px -126px;
|
| 70 |
+
padding: 2px;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
#adminmenu li ul.admin-menu-tree-page-tree a:hover .admin-menu-tree-page-view-edit {
|
| 74 |
+
display: block;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
#adminmenu li ul.admin-menu-tree-page-tree a:hover .admin-menu-tree-page-view-edit:hover {
|
| 78 |
+
background-image: url(http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.3/themes/ui-darkness/images/ui-icons_222222_256x240.png);
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
li.admin-menu-tree-page-tree_headline {
|
| 82 |
+
text-transform: uppercase;
|
| 83 |
+
color: #666;
|
| 84 |
+
font-size: 9px;
|
| 85 |
+
margin: 0 0 0 0 !important;
|
| 86 |
+
padding-left: 6px !important;
|
| 87 |
+
border-left-style: solid;
|
| 88 |
+
border-left-width: 1px;
|
| 89 |
+
border-right-style: solid;
|
| 90 |
+
border-right-width: 1px;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
.wp-has-current-submenu li.admin-menu-tree-page-tree_headline {
|
| 94 |
+
border-left-width: 0px;
|
| 95 |
+
border-right-width: 0px;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
/* child-pages */
|
| 99 |
+
#adminmenu li .wp-submenu ul.admin-menu-tree-page-tree li ul {
|
| 100 |
+
border-bottom: none;
|
| 101 |
+
}
|
| 102 |
+
#adminmenu li .wp-submenu ul.admin-menu-tree-page-tree li ul li a,
|
| 103 |
+
#adminmenu li .wp-submenu ul.admin-menu-tree-page-tree li ul li a:hover
|
| 104 |
+
{
|
| 105 |
+
padding-left: 27px;
|
| 106 |
+
padding-right: 8px;
|
| 107 |
+
background-position: 15px 1px !important;
|
| 108 |
+
font-weight: normal;
|
| 109 |
+
color: #21759B;
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
#adminmenu li .wp-submenu ul.admin-menu-tree-page-tree li ul li li a,
|
| 113 |
+
#adminmenu li .wp-submenu ul.admin-menu-tree-page-tree li ul li li a:hover
|
| 114 |
+
{
|
| 115 |
+
padding-left: 37px;
|
| 116 |
+
padding-right: 8px;
|
| 117 |
+
background-position: 25px 1px !important;
|
| 118 |
+
font-weight: normal;
|
| 119 |
+
color: #21759B;
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
#adminmenu li .wp-submenu ul.admin-menu-tree-page-tree li ul li li li a,
|
| 123 |
+
#adminmenu li .wp-submenu ul.admin-menu-tree-page-tree li ul li li li a:hover
|
| 124 |
+
{
|
| 125 |
+
padding-left: 47px;
|
| 126 |
+
padding-right: 8px;
|
| 127 |
+
background-position: 35px 1px !important;
|
| 128 |
+
font-weight: normal;
|
| 129 |
+
color: #21759B;
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
|
| 133 |
+
/* make them bold too */
|
| 134 |
+
#adminmenu li .wp-submenu ul.admin-menu-tree-page-tree li ul li.current a,
|
| 135 |
+
#adminmenu li .wp-submenu ul.admin-menu-tree-page-tree li ul li.current a:hover
|
| 136 |
+
{
|
| 137 |
+
font-weight: bold;
|
| 138 |
+
color: black;
|
| 139 |
+
}
|
| 140 |
+
#adminmenu li .wp-submenu ul.admin-menu-tree-page-tree li ul li.current li a,
|
| 141 |
+
#adminmenu li .wp-submenu ul.admin-menu-tree-page-tree li ul li.current li a:hover
|
| 142 |
+
{
|
| 143 |
+
font-weight: normal;
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
.admin-menu-tree-page-view-popup {
|
| 147 |
+
position: absolute;
|
| 148 |
+
background-color: white;
|
| 149 |
+
border: 1px solid #ccc;
|
| 150 |
+
padding: 8px 8px 8px 15px;
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
#adminmenu li.wp-has-current-submenu .wp-submenu .admin-menu-tree-page-view-popup ul li a,
|
| 154 |
+
#adminmenu li.wp-has-current-submenu .admin-menu-tree-page-view-popup ul li a,
|
| 155 |
+
#adminmenu .wp-submenu .admin-menu-tree-page-view-popup ul li a
|
| 156 |
+
{
|
| 157 |
+
border: none !important;
|
| 158 |
+
background-image: none !important;
|
| 159 |
+
}
|
| 160 |
+
#adminmenu .admin-menu-tree-page-view-popup ul {
|
| 161 |
+
border: none !important;
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
.admin-menu-tree-page-view-popup-arrow {
|
| 165 |
+
position: absolute;
|
| 166 |
+
width: 16px;
|
| 167 |
+
height: 16px;
|
| 168 |
+
/* background: transparent url(arrow-left.gif) no-repeat top left; */
|
| 169 |
+
background: transparent url(http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.3/themes/ui-darkness/images/ui-icons_222222_256x240.png) no-repeat -16px -126px;
|
| 170 |
+
top: 3px;
|
| 171 |
+
left: 3px;
|
| 172 |
+
}
|
| 173 |
+
.admin-menu-tree-page-view-popup-page {
|
| 174 |
+
display: none;
|
| 175 |
+
}
|
| 176 |
+
.admin-menu-tree-page-view-popup li {
|
| 177 |
+
text-decoration: underline;
|
| 178 |
+
white-space: nowrap;
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
.admin-menu-tree-page-view-status {
|
| 182 |
+
-moz-border-radius: 3px;
|
| 183 |
+
-webkit-border-radius: 3px;
|
| 184 |
+
border-radius: 3px;
|
| 185 |
+
background-color: #F85B11;
|
| 186 |
+
border: medium none;
|
| 187 |
+
color: white;
|
| 188 |
+
display: inline;
|
| 189 |
+
font-size: 0.8em;
|
| 190 |
+
margin-right: 0.75ex;
|
| 191 |
+
padding: 1px 4px;
|
| 192 |
+
}
|
| 193 |
+
.admin-menu-tree-page-view-status-password {
|
| 194 |
+
background-color: #25b61a;
|
| 195 |
+
}
|
| 196 |
+
.admin-menu-tree-page-view-status-private {
|
| 197 |
+
background-color: #25b61a;
|
| 198 |
+
}
|
| 199 |
+
.admin-menu-tree-page-view-status-pending,
|
| 200 |
+
.admin-menu-tree-page-view-status-future
|
| 201 |
+
{
|
| 202 |
+
background-color: #0069e0;
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
.admin-menu-tree-page-view-protected {
|
| 206 |
+
width: 13px;
|
| 207 |
+
height: 11px;
|
| 208 |
+
float: left;
|
| 209 |
+
background: url(http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.3/themes/ui-darkness/images/ui-icons_cccccc_256x240.png) no-repeat -194px -98px;
|
| 210 |
+
}
|
