WordPress.org

Plugin Directory

Changeset 659176


Ignore:
Timestamp:
01/26/13 09:02:50 (15 months ago)
Author:
eskapism
Message:

fixes

Location:
cms-tree-page-view/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cms-tree-page-view/trunk/functions.php

    r655809 r659176  
    9393    // increased by the same number as the number of new posts we're gonna add 
    9494     
     95    $ok_to_continue_by_permission = TRUE; 
     96    $post_type_object = get_post_type_object($ref_post->post_type); 
     97 
    9598    $post_parent = 0; 
    9699    if ("after" === $post_position) { 
    97100        $post_parent = $ref_post->post_parent; 
     101        $ok_to_continue_by_permission = apply_filters("cms_tree_page_view_post_user_can_add_after", current_user_can( $post_type_object->cap->create_posts, $ref_post_id), $ref_post_id);    
    98102    } elseif ("inside" === $post_position) { 
    99103        $post_parent = $ref_post->ID; 
    100     } 
     104        $ok_to_continue_by_permission = apply_filters("cms_tree_page_view_post_user_can_add_inside", current_user_can( $post_type_object->cap->create_posts, $ref_post_id), $ref_post_id); 
     105    } 
     106 
     107    if ( ! $ok_to_continue_by_permission ) { 
     108        wp_die( __( 'Cheatin’ uh?' ) ); 
     109        return FALSE; 
     110    } 
     111 
     112//  $user_can_edit_page = apply_filters("cms_tree_page_view_post_can_edit", current_user_can( $post_type_object->cap->edit_post, $ref_post_id), $ref_post_id); 
     113 
    101114 
    102115 
     
    137150                    ); 
    138151                    $return_id = wp_update_post($post_update); 
    139                     if (0 ===$return_id) die("Error: could not update post with id " . $post_update->ID); 
     152                    if (0 ===$return_id) die( "Error: could not update post with id " . $post_update->ID . "<br>Technical details: " . print_r($post_update) ); 
    140153 
    141154                } 
    142155 
    143                 if ( ! $has_passed_ref_post && $ref_post->ID === $one_post->ID) { 
     156                if ( ! $has_passed_ref_post && $ref_post->ID === $one_post->ID ) { 
    144157                    $has_passed_ref_post = TRUE; 
    145158                }            
     
    492505        $options["menu"] = (array) $_POST["post-type-menu"]; 
    493506        $options["postsoverview"] = (array) $_POST["post-type-postsoverview"]; 
    494          
     507 
    495508        update_option('cms_tpv_options', $options); // enable this to show box 
    496509 
     
    744757    global $sitepress, $cms_tpv_view, $wpdb; 
    745758 
    746     if (!$post_type) { 
     759    if ( ! $post_type ) { 
    747760        $post_type = cms_tpv_get_selected_post_type(); 
    748761    } 
     
    12081221            $arr_page_css_styles = array(); 
    12091222            $user_can_edit_page = apply_filters("cms_tree_page_view_post_can_edit", current_user_can( $post_type_object->cap->edit_post, $page_id), $page_id); 
    1210             $user_can_add_inside = apply_filters("cms_tree_page_view_post_user_can_add_inside", current_user_can( $post_type_object->cap->edit_post, $page_id), $page_id); 
    1211             $user_can_add_after = apply_filters("cms_tree_page_view_post_user_can_add_after", current_user_can( $post_type_object->cap->edit_post, $page_id), $page_id);     
     1223            $user_can_add_inside = apply_filters("cms_tree_page_view_post_user_can_add_inside", current_user_can( $post_type_object->cap->create_posts, $page_id), $page_id); 
     1224            $user_can_add_after = apply_filters("cms_tree_page_view_post_user_can_add_after", current_user_can( $post_type_object->cap->create_posts, $page_id), $page_id);  
    12121225 
    12131226            if ( $user_can_edit_page ) { 
     
    14251438} 
    14261439 
     1440/** 
     1441 * @TODO: check if this is used any longer? If not then delete it! 
     1442 */ 
    14271443function cms_tpv_add_page() { 
    14281444    global $wpdb; 
     
    16801696    update_option('cms_tpv_version', CMS_TPV_VERSION); 
    16811697} 
    1682 #cms_tpv_install(); 
     1698 
     1699// cms_tpv_install(); 
    16831700 
    16841701/** 
  • cms-tree-page-view/trunk/readme.txt

    r655814 r659176  
    106106== Changelog == 
    107107 
     108= 1.2.x = 
     109- Small design changes for the icons in the post overview screen 
     110- Added actions to check permissions when adding pages with AJAX 
     111 
    108112= 1.2.3 = 
    109113- Removed an ugly pixel in the tree icon 
  • cms-tree-page-view/trunk/scripts/cms_tree_page_view.js

    r646324 r659176  
    898898 
    899899        view_switch.append(view_switch_list_a); 
     900        view_switch.append(" "); 
    900901 
    901902    } 
  • cms-tree-page-view/trunk/styles/styles.css

    r655809 r659176  
    479479 
    480480.view-switch-cstpv-icon-added a { 
    481     display: inline-block; 
     481    display: inline-block !important; 
    482482} 
    483483 
Note: See TracChangeset for help on using the changeset viewer.