WordPress.org

Plugin Directory

Changeset 644827


Ignore:
Timestamp:
12/26/12 22:59:07 (16 months ago)
Author:
eskapism
Message:

show message ey

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

Legend:

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

    r644785 r644827  
    299299            "Adding_page" => __("Adding page...", 'cms-tree-page-view'), 
    300300            "Adding" => __("Adding ...", 'cms-tree-page-view'), 
     301            "No posts found" => __("No posts found.", 'cms-tree-page-view') 
    301302        ); 
    302303        wp_localize_script( "cms_tree_page_view", 'cmstpv_l10n', $oLocale); 
     
    658659    global $wpdb; 
    659660 
    660     $arr_statuses = array("publish", "draft", "trash"); 
     661    $arr_statuses = array("publish", "draft", "trash", "future", "private"); 
    661662    $arr_counts = array(); 
    662663 
     
    678679            GROUP BY language_code 
    679680        "; 
     681 
    680682        $res = $wpdb->get_results($sql); 
    681683 
     
    734736         
    735737        $wpml_post_counts = cms_tpv_get_wpml_post_counts($post_type); 
    736          
    737         $post_count_all = @$wpml_post_counts["publish"][$wpml_current_lang] + @$wpml_post_counts["draft"][$wpml_current_lang]; 
    738         $post_count_publish = @$wpml_post_counts["publish"][$wpml_current_lang]; 
    739         $post_count_trash   = @$wpml_post_counts["trash"][$wpml_current_lang]; 
    740      
     738 
     739        $post_count_all = (int) @$wpml_post_counts["private"][$wpml_current_lang] + (int) @$wpml_post_counts["future"][$wpml_current_lang] + (int) @$wpml_post_counts["publish"][$wpml_current_lang] + (int) @$wpml_post_counts["draft"][$wpml_current_lang]; 
     740        $post_count_publish = (int) @$wpml_post_counts["publish"][$wpml_current_lang]; 
     741        $post_count_trash   = (int) @$wpml_post_counts["trash"][$wpml_current_lang]; 
     742 
    741743        foreach ($wpml_post_counts["publish"] as $one_wpml_lang => $one_wpml_lang_count) { 
    742744            if ("all" === $one_wpml_lang) continue; 
     
    798800                    } 
    799801 
    800                     $lang_count = @$wpml_post_counts["publish"][$one_lang["language_code"]] + @$wpml_post_counts["draft"][$one_lang["language_code"]]; 
     802                    $lang_count = (int) @$wpml_post_counts["publish"][$one_lang["language_code"]] + (int) @$wpml_post_counts["draft"][$one_lang["language_code"]]; 
    801803 
    802804                    $lang_out .= " 
     
    812814            } 
    813815 
    814         } 
    815  
    816         if (empty($pages)) { 
    817          
    818             echo '<div class="updated fade below-h2"><p>' . __("No posts found.", 'cms-tree-page-view') . '</p></div>'; 
    819          
    820816        } 
    821817 
     
    968964            <?php 
    969965        } 
     966 
     967        if (empty($pages)) { 
     968         
     969            echo '<div class="updated fade below-h2"><p>' . __("No posts found.", 'cms-tree-page-view') . '</p></div>'; 
     970         
     971        } 
     972 
    970973        ?> 
    971974         
  • cms-tree-page-view/trunk/readme.txt

    r644798 r644827  
    106106 
    107107= 1.x = 
     108- Fixed wrong count if WPML where activated and future or private posts existed for a language 
     109- Show info message if no posts found after fetching posts with AJAX 
    108110- Updated Swedish translation 
    109111- Updated POT file 
  • cms-tree-page-view/trunk/scripts/cms_tree_page_view.js

    r643452 r644827  
    174174    cms_tpv_tree = $("div.cms_tpv_container"); 
    175175    div_actions = $("div.cms_tpv_page_actions"); 
     176    cms_tpv_message = $("div.cms_tpv_message"); 
    176177 
    177178    // try to override css 
     
    216217                        }; 
    217218                    } 
     219                }, 
     220                "success": function(data, status) { 
     221                     
     222                    // If data is null or empty = show message about no nodes 
     223                    if (data === null || !data) { 
     224                        cms_tpv_message.html( "<p>" + cmstpv_l10n["No posts found"] + "</p>" ); 
     225                        cms_tpv_message.show(); 
     226                    } /*else { 
     227                        cms_tpv_message.hide(); 
     228                    }*/ 
     229 
     230                }, 
     231                "error": function(data, status) { 
    218232                } 
    219233 
     
    289303/** 
    290304 * When tree is loaded: start hoverindenting stuff 
     305 * Is only fired when tree was loaded and contained stuff 
    291306 */ 
    292307function cms_tpv_tree_loaded(event, data) { 
    293  
     308         
    294309    var $container = jQuery(event.target); 
    295310    var actions_div_doit = cms_tpv_get_page_actions_div_doit(event.target); 
     
    798813function cms_tvp_set_view(view, elm) { 
    799814 
    800     var $wrapper = jQuery(elm).closest(".cms_tpv_wrapper"); 
    801  
    802     var div_actions_for_post_type = cms_tpv_get_page_actions_div(elm); 
     815    var $wrapper = jQuery(elm).closest(".cms_tpv_wrapper"), 
     816        div_actions_for_post_type = cms_tpv_get_page_actions_div(elm); 
     817 
     818    cms_tpv_message.hide(); 
    803819 
    804820    $wrapper.append(div_actions_for_post_type); 
  • cms-tree-page-view/trunk/styles/styles.css

    r643452 r644827  
    4040    margin-top: 8px; 
    4141    color: #666; 
     42    margin-bottom: 0; 
     43} 
     44 
     45.cms_tvp_switch_langs + .cms-tpv-subsubsub { 
     46    margin-top: 0; 
    4247} 
    4348 
Note: See TracChangeset for help on using the changeset viewer.