pageMash > Page Management - Version 1.0.4

Version Description

Download this release

Release Info

Developer jmash
Plugin Icon wp plugin pageMash > Page Management
Version 1.0.4
Comparing to
See all releases

Code changes from version 1.0.3 to 1.0.4

Files changed (2) hide show
  1. README.txt +5 -3
  2. pagemash.php +17 -18
README.txt CHANGED
@@ -1,9 +1,9 @@
1
  === pageMash > pageManagement ===
2
  Contributors: JoelStarnes
3
  Tags: order pages, ajax, re-order, drag-and-drop, admin, manage, page, pages, sidebar, header, hide,
4
- Requires at least: 2.0
5
- Tested up to: 2.4-bleeding
6
- Stable tag: 1.0.3
7
 
8
  Organise page order and manage page structure with this simple drag-and-drop Ajax interface.
9
 
@@ -66,6 +66,8 @@ No. You no longer need to add the pageMash parameter as you did with the previou
66
 
67
  1.0.3 > Fixed datatype bug causing array problems
68
 
 
 
69
 
70
  == Localization ==
71
 
1
  === pageMash > pageManagement ===
2
  Contributors: JoelStarnes
3
  Tags: order pages, ajax, re-order, drag-and-drop, admin, manage, page, pages, sidebar, header, hide,
4
+ Requires at least: 2.1
5
+ Tested up to: 2.5
6
+ Stable tag: 1.0.4
7
 
8
  Organise page order and manage page structure with this simple drag-and-drop Ajax interface.
9
 
66
 
67
  1.0.3 > Fixed datatype bug causing array problems
68
 
69
+ 1.0.4 > Removed shorthand PHP and updated CSS and JS headers to admin_print_scripts hook.
70
+
71
 
72
  == Localization ==
73
 
pagemash.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: pageMash
4
  Plugin URI: http://joelstarnes.co.uk/pagemash/
5
  Description: pageMash > pageManagement [WP_Admin > Manage > pageMash]
6
  Author: Joel Starnes
7
- Version: 1.0.3
8
  Author URI: http://joelstarnes.co.uk/
9
 
10
  CHANGELOG:
@@ -17,6 +17,7 @@ Release: Date: Description:
17
  1.0.1 beta 14 Mar 2008 Fixed IE > drag selects text
18
  1.0.2 16 Mar 2008 Major code rewrite for exclude pages, funct hooks onto wp_list_pages
19
  1.0.3 18 Mar 2008 Fixed datatype bug causing array problems
 
20
 
21
  FIXME:
22
  @fixme with instantUpdateFeature hide will not send the update
@@ -79,11 +80,11 @@ function pageMash_getPages($post_parent){
79
  echo '>';
80
 
81
  foreach ($pageposts as $page): //list pages, [the 'li' ID must be the page ID] ?>
82
- <li id="pm_<?=$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 ?>>
83
- <span class="title"><?=$page->post_title;?></span>
84
  <span class="pageMash_pageFunctions">
85
- id:<?=$page->ID;?>
86
- [<a href="<?=get_settings('siteurl').'/wp-admin/post.php?action=edit&post='.$page->ID; ?>" title="Edit This Page">edit</a>]
87
  <?php if($excludePagesFeature): ?>
88
  [<a href="#" title="Show|Hide" class="excludeLink" onclick="toggleRemove(this); return false">hide</a>]
89
  <?php endif; ?>
@@ -105,7 +106,7 @@ function pageMash_main(){
105
  <div id="debug_list"></div>
106
  <div id="pageMash" class="wrap">
107
  <div id="pageMash_checkVersion" style="float:right; font-size:.7em; margin-top:5px;">
108
- version [1.0.3]
109
  </div>
110
  <h2 style="margin-bottom:0; clear:none;">pageMash - pageManagement</h2>
111
  <p style="margin-top:4px;">
@@ -142,7 +143,6 @@ function pageMash_main(){
142
  }
143
 
144
  function pageMash_head(){
145
- if(strrpos('>'.$_GET["page"], 'pagemash')): // only include header stuff on pagemash admin page
146
  //stylesheet & javascript to go in page header
147
  global $instantUpdateFeature, $excludePagesFeature;
148
  ?>
@@ -153,17 +153,17 @@ if(strrpos('>'.$_GET["page"], 'pagemash')): // only include header stuff on page
153
  }
154
  ul#pageMash_pages li.collapsed ul { display:none; }
155
  ul#pageMash_pages li.children {
156
- background-image: url('<?=get_settings("siteurl")?>/wp-content/plugins/pagemash/collapse.png');
157
  }
158
  ul#pageMash_pages li.collapsed.children {
159
- background-image: url('<?=get_settings("siteurl")?>/wp-content/plugins/pagemash/expand.png');
160
  }
161
  ul#pageMash_pages li {
162
  display:block;
163
  margin:2px 0 0 0;
164
  border-bottom:1px solid #aaa; border-right:1px solid #aaa; border-top:1px solid #ccc; border-left:1px solid #ccc;
165
  padding:4px 6px 4px 24px;
166
- background:#F1F1F1 url('<?=get_settings("siteurl")?>/wp-content/plugins/pagemash/page.png') no-repeat 4px 4px;
167
  list-style-type:none;
168
  }
169
  ul#pageMash_pages li span.title { font-weight: bold; }
@@ -214,8 +214,8 @@ if(strrpos('>'.$_GET["page"], 'pagemash')): // only include header stuff on page
214
  #pageMash_code .orange{color:#EC9E00;}
215
  </style>
216
  <!-- Current code not compatible with newer releases of moo -->
217
- <script type="text/javascript" src="<?=get_settings('siteurl')?>/wp-content/plugins/pagemash/nest-mootools.v1.11.js"></script>
218
- <script type="text/javascript" src="<?=get_settings('siteurl')?>/wp-content/plugins/pagemash/nested.js"></script>
219
  <script type="text/javascript">
220
 
221
  /* add timeout to Ajax class */
@@ -241,7 +241,7 @@ Ajax = Ajax.extend({
241
  /* function to retrieve list data and send to server in JSON format */
242
  var SaveList = function() {
243
  var theDump = sortIt.serialize();
244
- new Ajax('<?=get_settings("siteurl")?>/wp-content/plugins/pagemash/saveList.php', {
245
  method: 'post',
246
  postBody: 'm='+Json.toString(theDump),
247
  // update: "debug_list",
@@ -348,10 +348,9 @@ window.addEvent('domready', function(){
348
  }); /* close dom ready */
349
  </script>
350
  <?php
351
- endif; //main function only display head if jmash admin page
352
  }
353
 
354
- function pageMash_add_excludes($excludes) {
355
  //merge array of hardcoded exclude pages with pageMash ones
356
  if(is_array(get_option('exclude_pages'))){
357
  $excludes = array_merge( get_option('exclude_pages'), $excludes );
@@ -359,15 +358,15 @@ function pageMash_add_excludes($excludes) {
359
  sort($excludes);
360
  return $excludes;
361
  }
 
362
  function pageMash_add_pages(){
363
  //add link in the management tab
364
  global $minlevel;
365
- add_management_page('pageMash page order', 'pageMash', $minlevel, __FILE__, 'pageMash_main');
 
366
  }
367
 
368
  add_action('admin_menu', 'pageMash_add_pages'); //add admin menu under management tab
369
- add_action('admin_head', 'pageMash_head'); //add css styles and JS code to head
370
  add_filter('wp_list_pages_excludes', 'pageMash_add_excludes'); //add exclude pages to wp_list_pages funct
371
 
372
-
373
  ?>
4
  Plugin URI: http://joelstarnes.co.uk/pagemash/
5
  Description: pageMash > pageManagement [WP_Admin > Manage > pageMash]
6
  Author: Joel Starnes
7
+ Version: 1.0.4
8
  Author URI: http://joelstarnes.co.uk/
9
 
10
  CHANGELOG:
17
  1.0.1 beta 14 Mar 2008 Fixed IE > drag selects text
18
  1.0.2 16 Mar 2008 Major code rewrite for exclude pages, funct hooks onto wp_list_pages
19
  1.0.3 18 Mar 2008 Fixed datatype bug causing array problems
20
+ 1.0.4 11 Apr 2008 removed shorthand PHP and updated CSS and JS headers to admin_print_scripts hook.
21
 
22
  FIXME:
23
  @fixme with instantUpdateFeature hide will not send the update
80
  echo '>';
81
 
82
  foreach ($pageposts as $page): //list pages, [the 'li' ID must be the page ID] ?>
83
+ <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 ?>>
84
+ <span class="title"><?php echo $page->post_title; ?></span>
85
  <span class="pageMash_pageFunctions">
86
+ id:<?php echo $page->ID; ?>
87
+ [<a href="<?php echo get_settings('siteurl').'/wp-admin/post.php?action=edit&post='.$page->ID; ?>" title="Edit This Page">edit</a>]
88
  <?php if($excludePagesFeature): ?>
89
  [<a href="#" title="Show|Hide" class="excludeLink" onclick="toggleRemove(this); return false">hide</a>]
90
  <?php endif; ?>
106
  <div id="debug_list"></div>
107
  <div id="pageMash" class="wrap">
108
  <div id="pageMash_checkVersion" style="float:right; font-size:.7em; margin-top:5px;">
109
+ version [1.0.4]
110
  </div>
111
  <h2 style="margin-bottom:0; clear:none;">pageMash - pageManagement</h2>
112
  <p style="margin-top:4px;">
143
  }
144
 
145
  function pageMash_head(){
 
146
  //stylesheet & javascript to go in page header
147
  global $instantUpdateFeature, $excludePagesFeature;
148
  ?>
153
  }
154
  ul#pageMash_pages li.collapsed ul { display:none; }
155
  ul#pageMash_pages li.children {
156
+ background-image: url('<?php echo get_settings("siteurl") ?>/wp-content/plugins/pagemash/collapse.png');
157
  }
158
  ul#pageMash_pages li.collapsed.children {
159
+ background-image: url('<?php echo get_settings("siteurl") ?>/wp-content/plugins/pagemash/expand.png');
160
  }
161
  ul#pageMash_pages li {
162
  display:block;
163
  margin:2px 0 0 0;
164
  border-bottom:1px solid #aaa; border-right:1px solid #aaa; border-top:1px solid #ccc; border-left:1px solid #ccc;
165
  padding:4px 6px 4px 24px;
166
+ background:#F1F1F1 url('<?php echo get_settings("siteurl") ?>/wp-content/plugins/pagemash/page.png') no-repeat 4px 4px;
167
  list-style-type:none;
168
  }
169
  ul#pageMash_pages li span.title { font-weight: bold; }
214
  #pageMash_code .orange{color:#EC9E00;}
215
  </style>
216
  <!-- Current code not compatible with newer releases of moo -->
217
+ <script type="text/javascript" src="<?php echo get_settings('siteurl') ?>/wp-content/plugins/pagemash/nest-mootools.v1.11.js"></script>
218
+ <script type="text/javascript" src="<?php echo get_settings('siteurl') ?>/wp-content/plugins/pagemash/nested.js"></script>
219
  <script type="text/javascript">
220
 
221
  /* add timeout to Ajax class */
241
  /* function to retrieve list data and send to server in JSON format */
242
  var SaveList = function() {
243
  var theDump = sortIt.serialize();
244
+ new Ajax('<?php echo get_settings("siteurl") ?>/wp-content/plugins/pagemash/saveList.php', {
245
  method: 'post',
246
  postBody: 'm='+Json.toString(theDump),
247
  // update: "debug_list",
348
  }); /* close dom ready */
349
  </script>
350
  <?php
 
351
  }
352
 
353
+ function pageMash_add_excludes($excludes){
354
  //merge array of hardcoded exclude pages with pageMash ones
355
  if(is_array(get_option('exclude_pages'))){
356
  $excludes = array_merge( get_option('exclude_pages'), $excludes );
358
  sort($excludes);
359
  return $excludes;
360
  }
361
+
362
  function pageMash_add_pages(){
363
  //add link in the management tab
364
  global $minlevel;
365
+ $page = add_management_page('pageMash page order', 'pageMash', $minlevel, __FILE__, 'pageMash_main');
366
+ add_action( "admin_print_scripts-$page", 'pageMash_head' ); //add css styles and JS code to head
367
  }
368
 
369
  add_action('admin_menu', 'pageMash_add_pages'); //add admin menu under management tab
 
370
  add_filter('wp_list_pages_excludes', 'pageMash_add_excludes'); //add exclude pages to wp_list_pages funct
371
 
 
372
  ?>