git-svn-id: https://plugins.svn.wordpress.org/pagemash/trunk@62770 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
jmash 2008-09-04 19:12:35 +00:00
parent adaf02dd61
commit e6ffec40b3
3 changed files with 76 additions and 72 deletions

View File

@ -2,8 +2,8 @@
Contributors: JoelStarnes Contributors: JoelStarnes
Tags: order pages, ajax, re-order, drag-and-drop, admin, manage, page, pages, sidebar, header, hide, Tags: order pages, ajax, re-order, drag-and-drop, admin, manage, page, pages, sidebar, header, hide,
Requires at least: 2.1 Requires at least: 2.1
Tested up to: 2.5 Tested up to: 2.6
Stable tag: 1.1.4 Stable tag: 1.1.5
Organise page order and manage page structure with this simple drag-and-drop Ajax interface. Organise page order and manage page structure with this simple drag-and-drop Ajax interface.
@ -55,59 +55,61 @@ Any good up-to-date browser should work fine. I test in Firefox, IE7, Safari and
==Change Log== ==Change Log==
= 1.1.5 =
- Updated for WP 2.6
* 1.1.4 = 1.1.4 =
* Add config option to show debug info. - Add config option to show debug info.
* 1.1.3 = 1.1.3 =
* Fixed hide bug that appeared on some systems - Fixed hide bug that appeared on some systems
* 1.1.2 = 1.1.2 =
* Added Expand all | Collapse all buttons - Added Expand all | Collapse all buttons
* 1.1.1 = 1.1.1 =
* Fix a bug with console.log for safari - Fix a bug with console.log for safari
* Removed php code from js&css scripts to fix error - Removed php code from js&css scripts to fix error
* 1.1.0 = 1.1.0 =
* Added quick rename - Added quick rename
* Externalised scripts - Externalised scripts
* Changed display of edit|hide|rename links - Changed display of edit|hide|rename links
* Deregisters prototypes - Deregisters prototypes
* 1.0.4 = 1.0.4 =
* Removed shorthand PHP - Removed shorthand PHP
* Updated CSS and JS headers to admin_print_scripts hook. - Updated CSS and JS headers to admin_print_scripts hook.
* 1.0.3 = 1.0.3 =
* Fixed datatype bug causing array problems - Fixed datatype bug causing array problems
* 1.0.3 = 1.0.3 =
* Fixed datatype bug causing array problems - Fixed datatype bug causing array problems
* 1.0.2 = 1.0.2 =
* Major code rewrite for exclude pages - Major code rewrite for exclude pages
* 1.0.1 beta = 1.0.1 beta =
* fixed IE drag selects text - fixed IE drag selects text =
* 1.0.0 beta = 1.0.0 beta =
* Major rebuild to use vladimir's sortables class extension - Major rebuild to use vladimir's sortables class extension
* Recusive page handles unlimited nested children - Recusive page handles unlimited nested children
* Collapsable list items - Collapsable list items
* Interface makeover... - Interface makeover...
* 0.1.3 = 0.1.3 =
* Fixed exclude pages feature - Fixed exclude pages feature
* 0.1.2 = 0.1.2 =
* Fixed CSS&JS headers to only display on pageMash admin - Fixed CSS&JS headers to only display on pageMash admin
* 0.1.1 = 0.1.1 =
* Removed version check since some hosts will not allow external includes. - Removed version check since some hosts will not allow external includes.
* 0.1.0 = 0.1.0 =
* Initial Release - Initial Release
== Localization == == Localization ==

View File

@ -4,24 +4,8 @@ Plugin Name: pageMash
Plugin URI: http://joelstarnes.co.uk/pagemash/ Plugin URI: http://joelstarnes.co.uk/pagemash/
Description: pageMash > pageManagement [WP_Admin > Manage > pageMash] Description: pageMash > pageManagement [WP_Admin > Manage > pageMash]
Author: Joel Starnes Author: Joel Starnes
Version: 1.1.4 Version: 1.1.5
Author URI: http://joelstarnes.co.uk/ 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
1.1.4 05 Jun 2008 Add config option to show debug info.
*/ */
#########CONFIG OPTIONS############################################ #########CONFIG OPTIONS############################################
@ -67,9 +51,14 @@ Garrett Murphey - Page Link Manager [http://gmurphey.com/2006/10/05/wordpress-pl
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
//Global Vars // Pre-2.6 compatibility
$pageMash_rel_dir = 'wp-content/plugins/pagemash/'; if ( !defined('WP_CONTENT_URL') )
$pageMash_abs_dir = get_bloginfo('wpurl').'/'.$pageMash_rel_dir; define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
if ( !defined('WP_CONTENT_DIR') )
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
// Guess the location
$codeWord_path = WP_CONTENT_DIR.'/plugins/'.plugin_basename(dirname(__FILE__));
$pageMash_url = WP_CONTENT_URL.'/plugins/'.plugin_basename(dirname(__FILE__));
function pageMash_getPages($post_parent){ function pageMash_getPages($post_parent){
//this is a recurrsive function which calls itself to produce a nested list of elements //this is a recurrsive function which calls itself to produce a nested list of elements
@ -116,7 +105,7 @@ function pageMash_main(){
<div id="debug_list"<?php if(false==$ShowDegubInfo) echo' style="display:none;"'; ?>></div> <div id="debug_list"<?php if(false==$ShowDegubInfo) echo' style="display:none;"'; ?>></div>
<div id="pageMash" class="wrap"> <div id="pageMash" class="wrap">
<div id="pageMash_checkVersion" style="float:right; font-size:.7em; margin-top:5px;"> <div id="pageMash_checkVersion" style="float:right; font-size:.7em; margin-top:5px;">
version [1.1.4] version [1.1.5]
</div> </div>
<h2 style="margin-bottom:0; clear:none;">pageMash - pageManagement</h2> <h2 style="margin-bottom:0; clear:none;">pageMash - pageManagement</h2>
<p style="margin-top:4px;"> <p style="margin-top:4px;">
@ -152,19 +141,25 @@ function pageMash_main(){
function pageMash_head(){ function pageMash_head(){
//stylesheet & javascript to go in page header //stylesheet & javascript to go in page header
global $pageMash_rel_dir, $CollapsePagesOnLoad; global $pageMash_url, $CollapsePagesOnLoad;
wp_deregister_script('prototype');//remove prototype since it is incompatible with mootools wp_deregister_script('prototype');//remove prototype since it is incompatible with mootools
wp_enqueue_script('pagemash_mootools', '/'.$pageMash_rel_dir.'nest-mootools.v1.11.js', false, false); //code is not compatible with other releases of moo wp_enqueue_script('pagemash_mootools', $pageMash_url.'/nest-mootools.v1.11.js', false, false); //code is not compatible with other releases of moo
wp_enqueue_script('pagemash_nested', '/'.$pageMash_rel_dir.'nested.js', array('pagemash_mootools'), false); wp_enqueue_script('pagemash_nested', $pageMash_url.'/nested.js', array('pagemash_mootools'), false);
wp_enqueue_script('pagemash_inlineEdit', '/'.$pageMash_rel_dir.'inlineEdit.v1.2.js', array('pagemash_mootools'), false); wp_enqueue_script('pagemash_inlineEdit', $pageMash_url.'/inlineEdit.v1.2.js', array('pagemash_mootools'), false);
wp_enqueue_script('pagemash', '/'.$pageMash_rel_dir.'pagemash.js', array('pagemash_mootools'), false); wp_enqueue_script('pagemash', $pageMash_url.'/pagemash.js', array('pagemash_mootools'), false);
add_action('admin_head', 'pageMash_add_css', 1); add_action('admin_head', 'pageMash_add_css', 1);
if(function_exists('wp_enqueue_style')){
// wp_enqueue_style('pagemash','/wp-content/plugins/pagemash/pagemash.css', array(), '1.0');
// $styles->add('codeword', $pageMash_url.'/pagemash.css');
// wp_enqueue_style('codeword', $pageMash_url.'/pagemash.css', array(), '1.0');
// wp_enqueue_style('codeword');
}
} }
function pageMash_add_css(){ function pageMash_add_css(){
global $pageMash_abs_dir, $CollapsePagesOnLoad; global $pageMash_url, $CollapsePagesOnLoad;
if($CollapsePagesOnLoad): ?> if($CollapsePagesOnLoad): ?>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
window.addEvent('domready', function(){ window.addEvent('domready', function(){
@ -174,8 +169,9 @@ function pageMash_add_css(){
}); });
</script> </script>
<?php endif; <?php endif;
?> // if(!function_exists('wp_enqueue_style')) // Pre-2.6 compatibility
<link rel="stylesheet" type="text/css" href="<?php echo $pageMash_abs_dir ?>pagemash.css" /> printf('<link rel="stylesheet" type="text/css" href="%s/pagemash.css" />', $pageMash_url);
// ?>
<!-- __ __ _ <!-- __ __ _
WordPress Plugin | \/ | | | WordPress Plugin | \/ | | |
_ __ __ _ __ _ ___| \ / | __ _ ___| |__ _ __ __ _ __ _ ___| \ / | __ _ ___| |__

View File

@ -14,9 +14,15 @@
if(!$_POST['m']) die('no data'); //die if no data is sent if(!$_POST['m']) die('no data'); //die if no data is sent
error_reporting(E_ALL); error_reporting(E_ALL);
require_once('myjson.php'); //JSON decode lib require_once('myjson.php'); //JSON decode lib
//require_once('./../../../wp-config.php'); //config to connect to database
include_once "../../../wp-config.php"; $root = dirname(dirname(dirname(dirname(__FILE__))));
include_once "../../../wp-settings.php"; if (file_exists($root.'/wp-load.php')) {
require_once($root.'/wp-load.php');
} else {
// Pre-2.6 compatibility
require_once($root.'/wp-config.php');
require_once($root.'/wp-settings.php');
}
global $wpdb, $excludePages; global $wpdb, $excludePages;
$excludePages = array(); $excludePages = array();