Skip to content
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Update CMS Tree Page View to 1.2.7
  • Loading branch information
craigcook committed Apr 3, 2013
1 parent e87ca29 commit 1fd82c4
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 12 deletions.
29 changes: 24 additions & 5 deletions plugins/cms-tree-page-view/functions.php
Expand Up @@ -506,9 +506,9 @@ function cms_tpv_save_settings() {
if (isset($_POST["cms_tpv_action"]) && $_POST["cms_tpv_action"] == "save_settings" && check_admin_referer('update-options')) {

$options = array();
$options["dashboard"] = (array) $_POST["post-type-dashboard"];
$options["dashboard"] = isset( $_POST["post-type-dashboard"] ) ? (array) $_POST["post-type-dashboard"] : array();
$options["menu"] = isset( $_POST["post-type-menu"] ) ? (array) $_POST["post-type-menu"] : array();
$options["postsoverview"] = (array) $_POST["post-type-postsoverview"];
$options["postsoverview"] = isset( $_POST["post-type-postsoverview"] ) ? (array) $_POST["post-type-postsoverview"] : array();

update_option('cms_tpv_options', $options); // enable this to show box

Expand Down Expand Up @@ -663,6 +663,7 @@ function cms_tpv_options() {

<input type="hidden" name="action" value="update" />
<input type="hidden" name="cms_tpv_action" value="save_settings" />
<?php // TODO: why is the line below needed? gives deprecated errors ?>
<input type="hidden" name="page_options" value="<?php echo join($arr_page_options, ",") ?>" />
<p class="submit">
<input type="submit" class="button-primary" value="<?php _e('Save Changes', 'cms-tree-page-view') ?>" />
Expand All @@ -680,11 +681,29 @@ function cms_tpv_options() {
* @return array with options
*/
function cms_tpv_get_options() {

$arr_options = (array) get_option('cms_tpv_options');
$arr_options["dashboard"] = (array) @$arr_options["dashboard"];
$arr_options["menu"] = (array) @$arr_options["menu"];
$arr_options["postsoverview"] = (array) @$arr_options["postsoverview"];

if (array_key_exists('dashboard', $arr_options)) {
$arr_options['dashboard'] = (array) @$arr_options['dashboard'];
} else {
$arr_options['dashboard'] = array();
}

if (array_key_exists('menu', $arr_options)) {
$arr_options['menu'] = (array) @$arr_options['menu'];
} else {
$arr_options['menu'] = array();
}

if (array_key_exists('postsoverview', $arr_options)) {
$arr_options['postsoverview'] = (array) @$arr_options['postsoverview'];
} else {
$arr_options['postsoverview'] = array();
}

return $arr_options;

}

function cms_tpv_get_selected_post_type() {
Expand Down
4 changes: 2 additions & 2 deletions plugins/cms-tree-page-view/index.php
Expand Up @@ -3,7 +3,7 @@
Plugin Name: CMS Tree Page View
Plugin URI: http://eskapism.se/code-playground/cms-tree-page-view/
Description: Adds a CMS-like tree view of all your pages, like the view often found in a page-focused CMS. Use the tree view to edit, view, add pages and search pages (very useful if you have many pages). And with drag and drop you can rearrange the order of your pages. Page management won't get any easier than this!
Version: 1.2.5
Version: 1.2.7
Author: Pär Thernström
Author URI: http://eskapism.se/
License: GPL2
Expand All @@ -27,7 +27,7 @@

#require("functions.php");

define( "CMS_TPV_VERSION", "1.2.5");
define( "CMS_TPV_VERSION", "1.2.7");
define( "CMS_TPV_NAME", "CMS Tree Page View");

require(dirname(__FILE__)."/functions.php");
Expand Down
19 changes: 16 additions & 3 deletions plugins/cms-tree-page-view/readme.txt
Expand Up @@ -4,7 +4,7 @@ Donate link: http://eskapism.se/sida/donate/
Tags: page, pages, posts, custom posts, tree, cms, dashboard, overview, drag-and-drop, rearrange, management, manage, admin
Requires at least: 3.5.1
Tested up to: 3.5.1
Stable tag: 1.2.5
Stable tag: 1.2.7

Adds a tree view of all pages & custom posts. Get a great overview + options to drag & drop to reorder & option to add multiple pages.

Expand Down Expand Up @@ -41,14 +41,19 @@ sort them by "menu order".
`
// Example using query_posts
$args = array(
'post_type' => 'page',
'orderby'=> 'menu_order',
'order'=>'ASC',
'post_type' => 'page',
);
$posts = query_posts($args);

// Example using wp_query
$query = new WP_Query( array( 'post_type' => 'page', 'orderby' => 'title menu_order', 'order' => 'ASC' ) );
$args = array(
'post_type' => 'page',
'orderby' => 'menu_order',
'order' => 'ASC',
);
$query = new WP_Query( $args );

`

Expand Down Expand Up @@ -106,6 +111,14 @@ Now the tree with the pages will be visible both on the dashboard and in the men

== Changelog ==

= 1.2.7 =
- Fix some notice errors/warning. Props damienwhaley. Fixes http://wordpress.org/support/topic/fix-for-three-non-fatal-errors.

= 1.2.6 =
- Fixed loading CSS over HTTPS.
Fixes http://wordpress.org/support/topic/update-noticonscss-reference-in-stylescss-for-https-sites-too.
- Fixed some styling issues in IE 8.

= 1.2.5 =
- Fixed some notice warnings
- Added Finnish translation
Expand Down
7 changes: 5 additions & 2 deletions plugins/cms-tree-page-view/styles/styles.css
Expand Up @@ -5,8 +5,7 @@
}
*/

@import url("http://s0.wordpress.com/i/noticons/noticons.css");

@import url("https://secure.wordpress.com/i/noticons/noticons.css");

.cms_tpv_wrapper {
z-index: 10;
Expand Down Expand Up @@ -53,6 +52,7 @@

.cms-tpv-subsubsub li:first-child {
margin-left: 0;
margin-right: 1px;
}

.cms-tpv-subsubsub li a {
Expand Down Expand Up @@ -118,6 +118,7 @@


.tree-default span.post_type {
background-color: rgb(248, 98, 16);
background-color: rgba(248, 98, 16, .75);
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
Expand All @@ -134,11 +135,13 @@
}
.tree-default span.post_type_password,
.tree-default span.post_type_private {
background-color: rgb(37, 182, 26);
background-color: rgba(37, 182, 26, .75);
}
.tree-default span.post_type_pending,
.tree-default span.post_type_future
{
background-color: rgb(0, 105, 224);
background-color: rgba(0, 105, 224, .75);
}

Expand Down

0 comments on commit 1fd82c4

Please sign in to comment.