= 1.3.0 =
- Important core fix - Pages show 'draft' and 'pending review' tags - Fix for nested sorting bug in safari git-svn-id: https://plugins.svn.wordpress.org/pagemash/trunk@96315 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
parent
6aeac3b4f0
commit
d2ae891ca9
16
README.txt
16
README.txt
|
@ -1,9 +1,9 @@
|
||||||
=== pageMash > pageManagement ===
|
=== pageMash > Page Management ===
|
||||||
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.7
|
Tested up to: 2.7.1
|
||||||
Stable tag: 1.2.2
|
Stable tag: 1.3.0
|
||||||
|
|
||||||
Manage your multitude of pages with pageMash's slick drag-and-drop style, ajax interface. Allows for quick sorting, hiding and organising of page parenting structure in a simple intuative manner.
|
Manage your multitude of pages with pageMash's slick drag-and-drop style, ajax interface. Allows for quick sorting, hiding and organising of page parenting structure in a simple intuative manner.
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ Feedback is greatly appreciated: http://joelstarnes.co.uk/contact
|
||||||
|
|
||||||
pageMash works with the `wp_list_pages` function. The easiest way to use it is to put the standard WordPress pages widget in your sidebar. Click the configure button on the widget and ensure that 'sort by' is set to 'page order'. Hey presto, you're done.
|
pageMash works with the `wp_list_pages` function. The easiest way to use it is to put the standard WordPress pages widget in your sidebar. Click the configure button on the widget and ensure that 'sort by' is set to 'page order'. Hey presto, you're done.
|
||||||
|
|
||||||
You can also use the function anywhere in your theme code. e.g. in your sidebar.php file (but the code in here will not run if you're using any widgets) or your header.php file (somewhere under the body tag, you may want to use the depth=1 parameter to only show top levle pages). The code should look something like the following:
|
You can also use the function anywhere in your theme code. e.g. in your sidebar.php file (but the code in here will not run if you're using any widgets) or your header.php file (somewhere under the body tag, you may want to use the depth=1 parameter to only show top level pages). The code should look something like the following:
|
||||||
|
|
||||||
`<?php wp_list_pages('title_li=<h2>Pages</h2>&depth=0'); ?>`
|
`<?php wp_list_pages('title_li=<h2>Pages</h2>&depth=0'); ?>`
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ Try opening up your WP admin and browse to your pageMash page, then take a look
|
||||||
No. As of v1.0.2 you no longer need to add any code to your template. PageMash adds a filter to the wp_list_pages() function and will also work just fine with the pages widget.
|
No. As of v1.0.2 you no longer need to add any code to your template. PageMash adds a filter to the wp_list_pages() function and will also work just fine with the pages widget.
|
||||||
|
|
||||||
= Which browsers are supported =
|
= Which browsers are supported =
|
||||||
Any good up-to-date browser should work fine. I test in Firefox, IE7, Safari and Opera. (NB in IE7 you need to use the page name as a drag handle.)
|
Any good up-to-date browser should work fine. I test in Firefox, IE7, Safari and Opera. (NB in IE you might need to use the page name as a drag handle.)
|
||||||
|
|
||||||
== Screenshots ==
|
== Screenshots ==
|
||||||
|
|
||||||
|
@ -55,6 +55,11 @@ Any good up-to-date browser should work fine. I test in Firefox, IE7, Safari and
|
||||||
|
|
||||||
|
|
||||||
==Change Log==
|
==Change Log==
|
||||||
|
= 1.3.0 =
|
||||||
|
- Important core fix ~ good call Alex!
|
||||||
|
- Pages show 'draft' and 'pending review' tags
|
||||||
|
- Fix for nested sorting bug in safari
|
||||||
|
|
||||||
= 1.2.2 =
|
= 1.2.2 =
|
||||||
- Additional multi-lingual support
|
- Additional multi-lingual support
|
||||||
- Adds turkish translation ~ by Ömer Faruk [ramerta.com]
|
- Adds turkish translation ~ by Ömer Faruk [ramerta.com]
|
||||||
|
@ -133,5 +138,6 @@ Any good up-to-date browser should work fine. I test in Firefox, IE7, Safari and
|
||||||
= pageMash is available in: =
|
= pageMash is available in: =
|
||||||
- English
|
- English
|
||||||
- German :: courtesy of Tom [www.outsourcetoasia.de]
|
- German :: courtesy of Tom [www.outsourcetoasia.de]
|
||||||
|
- Turkish :: courtesy of Ömer Faruk [ramerta.com]
|
||||||
|
|
||||||
If you'd like to translate pageMash into your own language get in touch and I'll be happy to add it in.
|
If you'd like to translate pageMash into your own language get in touch and I'll be happy to add it in.
|
||||||
|
|
|
@ -210,7 +210,13 @@ var Nested = new Class({
|
||||||
sub = (sub > 0) ? sub-over.getTop() : over.offsetHeight;
|
sub = (sub > 0) ? sub-over.getTop() : over.offsetHeight;
|
||||||
abort += (event.page.y < (sub-el.offsetHeight)+over.getTop());
|
abort += (event.page.y < (sub-el.offsetHeight)+over.getTop());
|
||||||
if (!abort) {
|
if (!abort) {
|
||||||
if (move == 'inside') dest = new Element(this.options.parentTag).injectInside(dest);
|
if (move == 'inside') {
|
||||||
|
if(dest.getElement(this.options.parentTag)) {
|
||||||
|
dest = dest.getElement(this.options.parentTag);
|
||||||
|
} else {
|
||||||
|
dest = new Element(this.options.parentTag).injectInside(dest);
|
||||||
|
}
|
||||||
|
}
|
||||||
$(el).inject(dest, move);
|
$(el).inject(dest, move);
|
||||||
el.moved = true;
|
el.moved = true;
|
||||||
if (!prevParent.getFirst()) prevParent.remove();
|
if (!prevParent.getFirst()) prevParent.remove();
|
||||||
|
|
24
pagemash.php
24
pagemash.php
|
@ -2,9 +2,9 @@
|
||||||
/*
|
/*
|
||||||
Plugin Name: pageMash
|
Plugin Name: pageMash
|
||||||
Plugin URI: http://joelstarnes.co.uk/pagemash/
|
Plugin URI: http://joelstarnes.co.uk/pagemash/
|
||||||
Description: Manage your multitude of pages with pageMash's slick drag-and-drop style, ajax interface. Allows quick sorting, hiding and organising of page structure.
|
Description: Manage your multitude of pages with pageMash's slick drag-and-drop style, ajax interface. Allows quick sorting, hiding and organising of parenting.
|
||||||
Author: Joel Starnes
|
Author: Joel Starnes
|
||||||
Version: 1.2.2
|
Version: 1.3.0
|
||||||
Author URI: http://joelstarnes.co.uk/
|
Author URI: http://joelstarnes.co.uk/
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -75,8 +75,10 @@ function pageMash_getPages($post_parent){
|
||||||
if ($pageposts == true){ //if $pageposts == true then it does have sub-page(s), so list them.
|
if ($pageposts == true){ //if $pageposts == true then it does have sub-page(s), so list them.
|
||||||
echo (0 === $post_parent) ? '<ul id="pageMash_pages">' : '<ul>'; //add this ID only to root 'ul' element
|
echo (0 === $post_parent) ? '<ul id="pageMash_pages">' : '<ul>'; //add this ID only to root 'ul' element
|
||||||
foreach ($pageposts as $page): //list pages, [the 'li' ID must be pm_'page ID'] ?>
|
foreach ($pageposts as $page): //list pages, [the 'li' ID must be pm_'page ID'] ?>
|
||||||
|
<?php $status = $page->post_status; ?>
|
||||||
<li id="pm_<?php echo $page->ID; ?>"<?php if(get_option('exclude_pages')){ if(in_array($page->ID, $excludePagesList)) echo ' class="remove"'; }//if page is in exclude list, add class remove ?>>
|
<li id="pm_<?php echo $page->ID; ?>"<?php if(get_option('exclude_pages')){ if(in_array($page->ID, $excludePagesList)) echo ' class="remove"'; }//if page is in exclude list, add class remove ?>>
|
||||||
<span class="title"><?php echo $page->post_title;?></span>
|
<span class="title"><?php echo $page->post_title;?></span>
|
||||||
|
<?php if ($status == 'draft' || $status == 'pending') { print ' <span class="pm_status">('.__($status).')</span>'; } ?>
|
||||||
<span class="pageMash_box">
|
<span class="pageMash_box">
|
||||||
<span class="pageMash_more">»</span>
|
<span class="pageMash_more">»</span>
|
||||||
<span class="pageMash_pageFunctions">
|
<span class="pageMash_pageFunctions">
|
||||||
|
@ -107,7 +109,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.2.2]
|
version [1.3.0]
|
||||||
</div>
|
</div>
|
||||||
<h2 style="margin-bottom:0; clear:none;"><?php _e('pageMash - pageManagement ','pmash');?></h2>
|
<h2 style="margin-bottom:0; clear:none;"><?php _e('pageMash - pageManagement ','pmash');?></h2>
|
||||||
<p style="margin-top:4px;">
|
<p style="margin-top:4px;">
|
||||||
|
@ -128,7 +130,7 @@ function pageMash_main(){
|
||||||
<div class="wrap" style="width:160px; margin-bottom:0; padding:0;"><p><a href="#" id="pageMashInfo_toggle">Show|Hide Further Info</a></p></div>
|
<div class="wrap" style="width:160px; margin-bottom:0; padding:0;"><p><a href="#" id="pageMashInfo_toggle">Show|Hide Further Info</a></p></div>
|
||||||
<div class="wrap" id="pageMashInfo" style="margin-top:-1px;">
|
<div class="wrap" id="pageMashInfo" style="margin-top:-1px;">
|
||||||
<h2><?php _e('How to Use ','pmash');?></h2>
|
<h2><?php _e('How to Use ','pmash');?></h2>
|
||||||
<p><?php _e('pageMash works with the wp_list_pages function. The easiest way to use it is to put the pages widget in your sidebar \'WP admin page \> Presentation \> Widgets\'. Click the configure button on the widget and ensure that \'sort by\' is set to \'page order\'. Hey presto, you\'re done. ','pmash');?></p>
|
<p><?php _e('pageMash works with the wp_list_pages function. The easiest way to use it is to put the pages widget in your sidebar [WP admin page > Appeaarance > Widgets]. Click the configure button on the widget and ensure that \'sort by\' is set to \'page order\'. Hey presto, you\'re done. ','pmash');?></p>
|
||||||
<p><?php _e('You can also use the function anywhere in your theme code. e.g. in your sidebar.php file (but the code in here will not run if you\'re using any widgets) or your header.php file (somewhere under the body tag, you may want to use the depth=1 parameter to only show top level pages). The code should look something like the following:','pmash');?></p>
|
<p><?php _e('You can also use the function anywhere in your theme code. e.g. in your sidebar.php file (but the code in here will not run if you\'re using any widgets) or your header.php file (somewhere under the body tag, you may want to use the depth=1 parameter to only show top level pages). The code should look something like the following:','pmash');?></p>
|
||||||
<p style="margin-bottom:0; font-weight:bold;">Code:</p>
|
<p style="margin-bottom:0; font-weight:bold;">Code:</p>
|
||||||
<code id="pageMash_code">
|
<code id="pageMash_code">
|
||||||
|
@ -151,13 +153,6 @@ function pageMash_head(){
|
||||||
wp_enqueue_script('pagemash_inline_edit', $pageMash_url.'/inline-edit.v1.2.js', array('pagemash_mootools'), false);
|
wp_enqueue_script('pagemash_inline_edit', $pageMash_url.'/inline-edit.v1.2.js', array('pagemash_mootools'), false);
|
||||||
wp_enqueue_script('pagemash', $pageMash_url.'/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(){
|
||||||
|
@ -178,9 +173,8 @@ function pageMash_add_css(){
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
// if(!function_exists('wp_enqueue_style')) // Pre-2.6 compatibility
|
|
||||||
printf('<link rel="stylesheet" type="text/css" href="%s/pagemash.css" />', $pageMash_url);
|
printf('<link rel="stylesheet" type="text/css" href="%s/pagemash.css" />', $pageMash_url);
|
||||||
// ?>
|
?>
|
||||||
<!-- __ __ _
|
<!-- __ __ _
|
||||||
WordPress Plugin | \/ | | |
|
WordPress Plugin | \/ | | |
|
||||||
_ __ __ _ __ _ ___| \ / | __ _ ___| |__
|
_ __ __ _ __ _ ___| \ / | __ _ ___| |__
|
||||||
|
@ -208,9 +202,9 @@ function pageMash_add_pages(){
|
||||||
//add menu link
|
//add menu link
|
||||||
global $minlevel, $wp_version;
|
global $minlevel, $wp_version;
|
||||||
if($wp_version >= 2.7){
|
if($wp_version >= 2.7){
|
||||||
$page = add_submenu_page('edit-pages.php', 'pageMash page order', __('pageMash ','pmash'), $minlevel, __FILE__, 'pageMash_main');
|
$page = add_submenu_page('edit-pages.php', 'pageMash: Page Management', __('pageMash ','pmash'), $minlevel, __FILE__, 'pageMash_main');
|
||||||
}else{
|
}else{
|
||||||
$page = add_management_page('pageMash page order', 'pageMash', $minlevel, __FILE__, 'pageMash_main');
|
$page = add_management_page('pageMash: Page Management', 'pageMash', $minlevel, __FILE__, 'pageMash_main');
|
||||||
}
|
}
|
||||||
add_action("admin_print_scripts-$page", 'pageMash_head'); //add css styles and JS code to head
|
add_action("admin_print_scripts-$page", 'pageMash_head'); //add css styles and JS code to head
|
||||||
}
|
}
|
||||||
|
|
BIN
pmash-de_DE.mo
BIN
pmash-de_DE.mo
Binary file not shown.
|
@ -45,7 +45,7 @@ msgid "How to Use "
|
||||||
msgstr "Anleitung"
|
msgstr "Anleitung"
|
||||||
|
|
||||||
#: pagemash.php:132
|
#: pagemash.php:132
|
||||||
msgid "pageMash works with the wp_list_pages function. The easiest way to use it is to put the pages widget in your sidebar 'WP admin page \\> Presentation \\> Widgets'. Click the configure button on the widget and ensure that 'sort by' is set to 'page order'. Hey presto, you're done. "
|
msgid "pageMash works with the wp_list_pages function. The easiest way to use it is to put the pages widget in your sidebar [WP admin page > Appeaarance > Widgets]. Click the configure button on the widget and ensure that 'sort by' is set to 'page order'. Hey presto, you're done. "
|
||||||
msgstr "pageMash arbeitet mit der wp_list_pages Funktion. Die einfachste Methode ist, den Seiten Widget in der Sidebar zu aktivieren. [WP Admin > Darstellung > Widgets]. Klicke Konfiguration und stell sicher, dass die Sortierung auf \"Seiten Sortierung\" steht. Fertig!"
|
msgstr "pageMash arbeitet mit der wp_list_pages Funktion. Die einfachste Methode ist, den Seiten Widget in der Sidebar zu aktivieren. [WP Admin > Darstellung > Widgets]. Klicke Konfiguration und stell sicher, dass die Sortierung auf \"Seiten Sortierung\" steht. Fertig!"
|
||||||
|
|
||||||
#: pagemash.php:133
|
#: pagemash.php:133
|
||||||
|
|
BIN
pmash-tr_TR.mo
BIN
pmash-tr_TR.mo
Binary file not shown.
|
@ -45,8 +45,8 @@ msgid "How to Use "
|
||||||
msgstr "Nasıl Kullanılır"
|
msgstr "Nasıl Kullanılır"
|
||||||
|
|
||||||
#: pagemash.php:132
|
#: pagemash.php:132
|
||||||
msgid "pageMash works with the wp_list_pages function. The easiest way to use it is to put the pages widget in your sidebar 'WP admin page \\> Presentation \\> Widgets'. Click the configure button on the widget and ensure that 'sort by' is set to 'page order'. Hey presto, you're done. "
|
msgid "pageMash works with the wp_list_pages function. The easiest way to use it is to put the pages widget in your sidebar [WP admin page > Appeaarance > Widgets]. Click the configure button on the widget and ensure that 'sort by' is set to 'page order'. Hey presto, you're done. "
|
||||||
msgstr "pageMash. wp_list_pages function ile birlikte çalışmaktadır. Yan menüde bu eklentiyi kullanmanın kolay yolu şu 'WP Admin Sayfası\\> Görünüm \\> Bileşenler'. Ayarlar butonuna tıkla ve 'sort by' kısmını 'sayfa düzenine' ayarla ve olduğunu garantiye al."
|
msgstr "pageMash. wp_list_pages function ile birlikte çalışmaktadır. Yan menüde bu eklentiyi kullanmanın kolay yolu şu 'WP Admin Sayfası > Görünüm > Bileşenler'. Ayarlar butonuna tıkla ve 'sort by' kısmını 'sayfa düzenine' ayarla ve olduğunu garantiye al."
|
||||||
|
|
||||||
#: pagemash.php:133
|
#: pagemash.php:133
|
||||||
msgid "You can also use the function anywhere in your theme code. e.g. in your sidebar.php file (but the code in here will not run if you're using any widgets) or your header.php file (somewhere under the body tag, you may want to use the depth=1 parameter to only show top level pages). The code should look something like the following:"
|
msgid "You can also use the function anywhere in your theme code. e.g. in your sidebar.php file (but the code in here will not run if you're using any widgets) or your header.php file (somewhere under the body tag, you may want to use the depth=1 parameter to only show top level pages). The code should look something like the following:"
|
||||||
|
|
20
savelist.php
20
savelist.php
|
@ -11,7 +11,8 @@
|
||||||
>>Decodes JSON data and updates database accordingly
|
>>Decodes JSON data and updates database accordingly
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
@ -24,12 +25,14 @@ if (file_exists($root.'/wp-load.php')) {
|
||||||
require_once($root.'/wp-settings.php');
|
require_once($root.'/wp-settings.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!current_user_can('edit_pages')) die("You don't have the correct priviledges.");
|
||||||
|
|
||||||
global $wpdb, $excludePages, $wp_rewrite;
|
global $wpdb, $excludePages, $wp_rewrite;
|
||||||
$excludePages = array();
|
$excludePages = array();
|
||||||
|
|
||||||
// fetch JSON object from $_POST['m']
|
// fetch JSON object from $_POST['m']
|
||||||
$json = new Services_JSON();
|
$json = new Services_JSON();
|
||||||
$aMenu = (array) $json->decode(stripslashes($_POST['m']));
|
$data = (array) $json->decode(stripslashes($_POST['m']));
|
||||||
|
|
||||||
function saveList($parent, $children) {
|
function saveList($parent, $children) {
|
||||||
global $wpdb, $excludePages;
|
global $wpdb, $excludePages;
|
||||||
|
@ -48,14 +51,14 @@ function saveList($parent, $children) {
|
||||||
//update pages in db
|
//update pages in db
|
||||||
$postquery = "UPDATE $wpdb->posts SET ";
|
$postquery = "UPDATE $wpdb->posts SET ";
|
||||||
$postquery .= "menu_order='$i', post_parent='$parent'";
|
$postquery .= "menu_order='$i', post_parent='$parent'";
|
||||||
if (isset($v->renamed)) $postquery .= ", post_title='$v->renamed'";
|
if(isset($v->renamed)) $postquery .= ", post_title='".$wpdb->escape($v->renamed)."'";
|
||||||
$postquery .= " WHERE ID='$id'";
|
$postquery .= " WHERE ID='$id'";
|
||||||
|
|
||||||
$wpdb->query($postquery); //$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET menu_order = %d, post_parent = %s WHERE ID = %d" ), $i, $parent, $id );
|
$wpdb->show_errors();
|
||||||
echo $postquery;
|
$wpdb->query($postquery);
|
||||||
echo "\n";
|
echo $postquery."\n";
|
||||||
|
|
||||||
if (isset($v->children[0])) {saveList($id, $v->children);}
|
if(isset($v->children[0])) saveList($id, $v->children);
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,8 +66,9 @@ function saveList($parent, $children) {
|
||||||
$wp_rewrite->flush_rules();
|
$wp_rewrite->flush_rules();
|
||||||
|
|
||||||
echo "Update Pages: \n";
|
echo "Update Pages: \n";
|
||||||
echo saveList(0, $aMenu);
|
echo saveList(0, $data);
|
||||||
$wpdb->print_error();
|
$wpdb->print_error();
|
||||||
|
|
||||||
echo "\n\nExclude Pages: \n";
|
echo "\n\nExclude Pages: \n";
|
||||||
print_r($excludePages);
|
print_r($excludePages);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue