= 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
|
||||
Tags: order pages, ajax, re-order, drag-and-drop, admin, manage, page, pages, sidebar, header, hide,
|
||||
Requires at least: 2.1
|
||||
Tested up to: 2.7
|
||||
Stable tag: 1.2.2
|
||||
Tested up to: 2.7.1
|
||||
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.
|
||||
|
||||
|
@ -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.
|
||||
|
||||
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'); ?>`
|
||||
|
||||
|
@ -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.
|
||||
|
||||
= 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 ==
|
||||
|
||||
|
@ -55,6 +55,11 @@ Any good up-to-date browser should work fine. I test in Firefox, IE7, Safari and
|
|||
|
||||
|
||||
==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 =
|
||||
- Additional multi-lingual support
|
||||
- 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: =
|
||||
- English
|
||||
- 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.
|
||||
|
|
|
@ -210,7 +210,13 @@ var Nested = new Class({
|
|||
sub = (sub > 0) ? sub-over.getTop() : over.offsetHeight;
|
||||
abort += (event.page.y < (sub-el.offsetHeight)+over.getTop());
|
||||
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.moved = true;
|
||||
if (!prevParent.getFirst()) prevParent.remove();
|
||||
|
|
28
pagemash.php
28
pagemash.php
|
@ -2,9 +2,9 @@
|
|||
/*
|
||||
Plugin Name: 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
|
||||
Version: 1.2.2
|
||||
Version: 1.3.0
|
||||
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.
|
||||
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'] ?>
|
||||
<?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 ?>>
|
||||
<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_more">»</span>
|
||||
<span class="pageMash_pageFunctions">
|
||||
|
@ -107,14 +109,14 @@ function pageMash_main(){
|
|||
<div id="debug_list"<?php if(false==$ShowDegubInfo) echo' style="display:none;"'; ?>></div>
|
||||
<div id="pageMash" class="wrap">
|
||||
<div id="pageMash_checkVersion" style="float:right; font-size:.7em; margin-top:5px;">
|
||||
version [1.2.2]
|
||||
version [1.3.0]
|
||||
</div>
|
||||
<h2 style="margin-bottom:0; clear:none;"><?php _e('pageMash - pageManagement ','pmash');?></h2>
|
||||
<p style="margin-top:4px;">
|
||||
<?php _e('Just drag the pages <strong>up</strong> or <strong>down</strong> to change the page order and <strong>left</strong> or <strong>right</strong> to change the page`s parent, then hit "update". ','pmash');?> <br />
|
||||
<?php _e('The icon to the left of each page shows if it has child pages, <strong>double click</strong> on that item to toggle <strong>expand|collapse</strong> of it`s children. ','pmash');?> <br />
|
||||
</p>
|
||||
<p><a href="#" id="expand_all"><?php _e('Expand All ','pmash');?></a> | <a href="#" id="collapse_all"><?php _e('Collapse All ','pmash');?></a></p>
|
||||
<p><a href="#" id="expand_all"><?php _e('Expand All','pmash');?></a> | <a href="#" id="collapse_all"><?php _e('Collapse All ','pmash');?></a></p>
|
||||
|
||||
<?php pageMash_getPages(0); //pass 0, as initial parent ?>
|
||||
|
||||
|
@ -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" id="pageMashInfo" style="margin-top:-1px;">
|
||||
<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 style="margin-bottom:0; font-weight:bold;">Code:</p>
|
||||
<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', $pageMash_url.'/pagemash.js', array('pagemash_mootools'), false);
|
||||
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(){
|
||||
|
@ -178,9 +173,8 @@ function pageMash_add_css(){
|
|||
}
|
||||
</script>
|
||||
<?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 | \/ | | |
|
||||
_ __ __ _ __ _ ___| \ / | __ _ ___| |__
|
||||
|
@ -208,9 +202,9 @@ function pageMash_add_pages(){
|
|||
//add menu link
|
||||
global $minlevel, $wp_version;
|
||||
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{
|
||||
$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
|
||||
}
|
||||
|
|
BIN
pmash-de_DE.mo
BIN
pmash-de_DE.mo
Binary file not shown.
|
@ -29,7 +29,7 @@ msgid "The icon to the left of each page shows if it has child pages, <strong>do
|
|||
msgstr "Das Symbol links an jeder Seite zeigt an, ob Unterseiten vorhanden sind. Mit einem <strong>Doppel Klick</strong> können diese <strong>ein- oder ausgeklappen</strong>. Am Ende auf \"Aktualisieren\". klicken."
|
||||
|
||||
#: pagemash.php:118
|
||||
msgid "Expand All "
|
||||
msgid "Expand All"
|
||||
msgstr "Alle aufklappen"
|
||||
|
||||
#: pagemash.php:118
|
||||
|
@ -45,7 +45,7 @@ msgid "How to Use "
|
|||
msgstr "Anleitung"
|
||||
|
||||
#: 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!"
|
||||
|
||||
#: pagemash.php:133
|
||||
|
|
BIN
pmash-tr_TR.mo
BIN
pmash-tr_TR.mo
Binary file not shown.
|
@ -29,7 +29,7 @@ msgid "The icon to the left of each page shows if it has child pages, <strong>do
|
|||
msgstr "Eğer bir iconun üzerinde + işareti görünüyorsa, bu, o sayfanın alt sayfaları var anlamına gelir, Alt sayfalarını görmek için veya kapatmak için o sayfanın iconuna <strong>çift tıklayın</strong>. Hepsini açıp kapatmak için tıkla <strong>Hepsini Aç/Hepsini Kapat</strong> seçeneklerine tıklayın."
|
||||
|
||||
#: pagemash.php:118
|
||||
msgid "Expand All "
|
||||
msgid "Expand All"
|
||||
msgstr "Hepsini Aç"
|
||||
|
||||
#: pagemash.php:118
|
||||
|
@ -45,8 +45,8 @@ msgid "How to Use "
|
|||
msgstr "Nasıl Kullanılır"
|
||||
|
||||
#: 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. "
|
||||
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."
|
||||
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."
|
||||
|
||||
#: 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:"
|
||||
|
|
28
savelist.php
28
savelist.php
|
@ -11,12 +11,13 @@
|
|||
>>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);
|
||||
require_once('myjson.php'); //JSON decode lib
|
||||
|
||||
$root = dirname(dirname(dirname(dirname(__FILE__))));
|
||||
if (file_exists($root.'/wp-load.php')) {
|
||||
if(file_exists($root.'/wp-load.php')) {
|
||||
require_once($root.'/wp-load.php');
|
||||
} else {
|
||||
// Pre-2.6 compatibility
|
||||
|
@ -24,12 +25,14 @@ if (file_exists($root.'/wp-load.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;
|
||||
$excludePages = array();
|
||||
|
||||
// fetch JSON object from $_POST['m']
|
||||
$json = new Services_JSON();
|
||||
$aMenu = (array) $json->decode(stripslashes($_POST['m']));
|
||||
$data = (array) $json->decode(stripslashes($_POST['m']));
|
||||
|
||||
function saveList($parent, $children) {
|
||||
global $wpdb, $excludePages;
|
||||
|
@ -37,7 +40,7 @@ function saveList($parent, $children) {
|
|||
$parent = (int) $parent;
|
||||
$result = array();
|
||||
$i = 1;
|
||||
foreach ($children as $k => $v) {
|
||||
foreach($children as $k => $v) {
|
||||
|
||||
//IDs are 'JM_#' so strip first 3 characters
|
||||
$id = (int) substr($children[$k]->id, 3);
|
||||
|
@ -48,24 +51,25 @@ function saveList($parent, $children) {
|
|||
//update pages in db
|
||||
$postquery = "UPDATE $wpdb->posts SET ";
|
||||
$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'";
|
||||
|
||||
$wpdb->query($postquery); //$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET menu_order = %d, post_parent = %s WHERE ID = %d" ), $i, $parent, $id );
|
||||
echo $postquery;
|
||||
echo "\n";
|
||||
$wpdb->show_errors();
|
||||
$wpdb->query($postquery);
|
||||
echo $postquery."\n";
|
||||
|
||||
if (isset($v->children[0])) {saveList($id, $v->children);}
|
||||
$i++;
|
||||
if(isset($v->children[0])) saveList($id, $v->children);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$wp_rewrite->flush_rules();
|
||||
|
||||
echo "Update Pages: \n";
|
||||
echo saveList(0, $aMenu);
|
||||
echo saveList(0, $data);
|
||||
$wpdb->print_error();
|
||||
echo "\n \nExclude Pages: \n";
|
||||
|
||||
echo "\n\nExclude Pages: \n";
|
||||
print_r($excludePages);
|
||||
|
||||
//update excludePages option in database
|
||||
|
|
Loading…
Reference in New Issue