pageManagement [WP_Admin > Manage > pageMash] Author: Joel Starnes Version: 1.1.3 Author URI: http://joelstarnes.co.uk/ CHANGELOG: Release: Date: Description: 0.1.0 10 Feb 2008 Initial release 0.1.1 12 Feb 2008 Minor fixes > Removed external include 0.1.2 15 Feb 2008 Minor fixes > Fixed CSS&JS headers to only display on pagemash 1.0.0 beta 19 Feb 2008 Major update > Recusive page handles unlimited nested children, collapsable list items, interface makeover... 1.0.1 beta 14 Mar 2008 Fixed IE > drag selects text 1.0.2 16 Mar 2008 Major code rewrite for exclude pages, funct hooks onto wp_list_pages 1.0.3 18 Mar 2008 Fixed datatype bug causing array problems 1.0.4 11 Apr 2008 removed shorthand PHP and updated CSS and JS headers to admin_print_scripts hook. 1.1.0 24 Apr 2008 Added quick rename, externalised scripts, changed display of edit|hide|rename links, deregisters prototype 1.1.1 29 Apr 2008 Fix a bug with console.log for safari, removed php code from js&css scripts to fix error 1.1.2 24 May 2008 Added Expand all | Collapse all buttons 1.1.3 04 Jun 2008 Fixed hide bug that appeared on some systems */ #########CONFIG OPTIONS############################################ $minlevel = 7; /*[deafult=7]*/ /* Minimum user level to access page order */ $excludePagesFeature = true; /*[deafult=true]*/ /* Allows you to set pages not to be listed */ $renamePagesFeature = true; /*[deafult=true]*/ /* Lets you rename pages */ $CollapsePagesOnLoad = false; /*[deafult=true]*/ /* Collapse all parent pages on load */ ################################################################### /* INSPIRATIONS/CREDITS: Valerio Proietti - Mootools JS Framework [http://mootools.net/] Stefan Lange-Hegermann - Mootools AJAX timeout class extension [http://www.blackmac.de/archives/44-Mootools-AJAX-timeout.html] vladimir - Mootools Sortables class extension [http://vladimir.akilles.cl/scripts/sortables/] ShiftThis - WP Page Order Plugin [http://www.shiftthis.net/wordpress-order-pages-plugin/] Garrett Murphey - Page Link Manager [http://gmurphey.com/2006/10/05/wordpress-plugin-page-link-manager/] */ /* Copyright 2008 Joel Starnes (email : joel@joelstarnes.co.uk) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ //Global Vars $pageMash_rel_dir = 'wp-content/plugins/pagemash/'; $pageMash_abs_dir = get_bloginfo('wpurl').'/'.$pageMash_rel_dir; function pageMash_getPages($post_parent){ //this is a recurrsive function which calls itself to produce a nested list of elements //$post_parent should be 0 for root pages, or contain a pageID to return it's sub-pages global $wpdb, $wp_version, $excludePagesFeature, $excludePagesList, $renamePagesFeature; if($wp_version >= 2.1){ //get pages from database $pageposts = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'page' AND post_parent = '$post_parent' ORDER BY menu_order"); }else{ $pageposts = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_status = 'static' AND post_parent = '$post_parent' ORDER BY menu_order"); } if ($pageposts == true){ //if $pageposts == true then it does have sub-page(s), so list them. echo (0 === $post_parent) ? '