WordPress.org

Plugin Directory

Changeset 636337


Ignore:
Timestamp:
12/09/12 23:18:09 (17 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

    r631434 r636337  
    215215    $options = cms_tpv_get_options(); 
    216216    $post_type = cms_tpv_get_selected_post_type(); 
    217     $current_screen = get_current_screen(); # sf_d($current_screen); 
     217 
     218    if (! function_exists("get_current_screen")) return FALSE; 
     219     
     220    $current_screen = get_current_screen(); 
    218221    $is_plugin_page = FALSE; 
    219222 
     
    447450function cms_tpv_get_options() { 
    448451    $arr_options = (array) get_option('cms_tpv_options'); 
    449     $arr_options["dashboard"] = (array) $arr_options["dashboard"]; 
    450     $arr_options["menu"] = (array) $arr_options["menu"]; 
     452    $arr_options["dashboard"] = (array) @$arr_options["dashboard"]; 
     453    $arr_options["menu"] = (array) @$arr_options["menu"]; 
    451454    return $arr_options; 
    452455} 
     
    484487} 
    485488 
    486  
     489/** 
     490 * Get number of posts from WPML 
     491 */ 
    487492function cms_tpv_get_wpml_post_counts($post_type) { 
    488493 
     
    511516        $res = $wpdb->get_results($sql); 
    512517 
     518        $langs = array(); 
    513519        $langs['all'] = 0; 
    514520        foreach($res as $r) { 
     
    571577        foreach ($wpml_post_counts["publish"] as $one_wpml_lang => $one_wpml_lang_count) { 
    572578            if ("all" === $one_wpml_lang) continue; 
    573             $lang_post_count_all        = $wpml_post_counts["publish"][$one_wpml_lang] + $wpml_post_counts["draft"][$one_wpml_lang]; 
    574             $lang_post_count_publish    = $wpml_post_counts["publish"][$one_wpml_lang]; 
    575             $lang_post_count_trash      = $wpml_post_counts["trash"][$one_wpml_lang]; 
     579            $lang_post_count_all        = (int) @$wpml_post_counts["publish"][$one_wpml_lang] + (int) @$wpml_post_counts["draft"][$one_wpml_lang]; 
     580            $lang_post_count_publish    = (int) @$wpml_post_counts["publish"][$one_wpml_lang]; 
     581            $lang_post_count_trash      = (int) @$wpml_post_counts["trash"][$one_wpml_lang]; 
    576582            $status_data_attributes["all"]      .= " data-post-count-{$one_wpml_lang}='{$lang_post_count_all}' "; 
    577583            $status_data_attributes["publish"]  .= " data-post-count-{$one_wpml_lang}='{$lang_post_count_publish}' "; 
     
    688694                        <input type="text" name="search" class="cms_tree_view_search" /> 
    689695                        <a title="<?php _e("Clear search", 'cms-tree-page-view') ?>" class="cms_tree_view_search_form_reset" href="#">x</a> 
    690                         <input type="submit" class="cms_tree_view_search_submit" value="<?php _e("Search", 'cms-tree-page-view') ?>" /> 
     696                        <input type="submit" class="cms_tree_view_search_submit button button-small" value="<?php _e("Search", 'cms-tree-page-view') ?>" /> 
    691697                        <span class="cms_tree_view_search_form_working"><?php _e("Searching...", 'cms-tree-page-view') ?></span> 
    692698                        <span class="cms_tree_view_search_form_no_hits"><?php _e("Nothing found.", 'cms-tree-page-view') ?></span> 
     
    942948    #do_action_ref_array('parse_query', array(&$this)); 
    943949    #print_r($get_posts_args); 
     950 
    944951    $pages = get_posts($get_posts_args); 
    945952 
     
    11501157 
    11511158// Act on AJAX-call 
     1159// Get pages 
    11521160function cms_tpv_get_childs() { 
    11531161 
  • cms-tree-page-view/trunk/readme.txt

    r634491 r636337  
    110110== Changelog == 
    111111 
     112= 1.x = 
     113- Fixed so search button now looks more like the rest of the WordPress GUI 
     114- Fixed a undefined index warning 
     115- Fixed wrong language count for WPML-enabled post types 
     116- Perhaps fixed a problem with some other plugins, for example Formidable Pro 
     117 
    112118= 1.1 = 
    113119- Added "Add new"-link next to headline, to better match the regular post overview page + it makes it possible to add new pages/posts when there are no pages/posts added (previously there needed to be at least one post added to be able to add new posts) 
  • cms-tree-page-view/trunk/scripts/cms_tree_page_view.js

    r631434 r636337  
    758758        var $a = jQuery(a_tag); 
    759759        var link_count = $a.data("post-count-" + lang_code); 
    760         if ("undefined" === typeof(link_count)) return; 
     760        if ("undefined" === typeof(link_count)) link_count = 0; 
    761761 
    762762        $a.find(".count").text("(" + link_count + ")"); 
  • cms-tree-page-view/trunk/styles/styles.css

    r629831 r636337  
    161161.cms_tree_view_search { 
    162162    width: 130px; 
     163    height: 21px; 
     164    line-height: 20px; 
    163165} 
    164166.cms_tree_view_search_form_working, 
Note: See TracChangeset for help on using the changeset viewer.