WordPress.org

Plugin Directory

Changeset 641987


Ignore:
Timestamp:
12/19/12 21:54:37 (16 months ago)
Author:
eskapism
Message:

can view tree in post overview now. it's funky

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

Legend:

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

    r641321 r641987  
    335335        // it's the code that gets the links for the current views filters 
    336336         
    337         add_filter("views_" . $current_screen->id, "cmstpv_filter_views_edit"); 
     337        // works, but to high up 
     338        #add_filter("views_" . $current_screen->id, "cmstpv_filter_views_edit"); 
    338339        // filter: views_edit-page $this->screen->id 
    339340 
    340     } 
    341      
    342 } 
    343  
    344 function cmstpv_filter_views_edit($views) { 
     341        cmstpv_postoverview_head(); 
     342 
     343        #class wp_list_table 
     344        #$_sortable = apply_filters( "manage_{$this->screen->id}_sortable_columns", $this->get_sortable_columns() ); 
     345        add_filter("manage_" . $current_screen->id . "_sortable_columns", "cmstpv_filter_views_edit_postsoverview"); 
     346        // manage_edit-page_sortable_columns 
     347 
     348 
     349    } 
     350     
     351} 
     352 
     353/** 
     354 * Add style etc to wp head to minimize flashing content 
     355 */ 
     356function cmstpv_postoverview_head() { 
     357 
     358    if ( isset($_GET["mode"]) && $_GET["mode"] === "tree" ) { 
     359        ?> 
     360        <style> 
     361            /* hide and position WP things */ 
     362            /* TODO: move this to wp head so we don't have time to see wps own stuff */ 
     363            .subsubsub, .tablenav.bottom, .tablenav .actions, .wp-list-table, .search-box { display: none; } 
     364            .tablenav.top { float: right; } 
     365        </style> 
     366        <?php 
     367    } 
     368 
     369} 
     370 
     371/** 
     372 * Output tree and html code for post overview page 
     373 */ 
     374function cmstpv_filter_views_edit_postsoverview($filter_var) { 
    345375     
    346376    $current_screen = get_current_screen(); 
     
    394424    echo $out; 
    395425 
    396     return $views; 
     426    return $filter_var; 
    397427 
    398428} 
  • cms-tree-page-view/trunk/scripts/cms_tree_page_view.js

    r641321 r641987  
    140140 
    141141            //e.preventDefault(); 
    142  
     142            my.log("submitting form"); 
    143143            var $form = $(this); 
    144144            $form.find("input[type='submit']").val( cmstpv_l10n.Adding ).attr("disabled", true); 
     
    831831 
    832832 
    833  
     833/** 
     834 * Stuff for the posts overview setting 
     835 */ 
    834836jQuery(function($) { 
    835837 
    836838    // Move tree link into position 
    837839    var tree_view_switch = $("#view-switch-tree"), 
    838         tree_view_switch_a = tree_view_switch.closest("a"); 
    839  
    840     // Check if view-switch exists and add if not 
     840        tree_view_switch_a = tree_view_switch.closest("a"), 
     841        cmstpv_postsoverview_wrap = $("div.cmstpv-postsoverview-wrap"); 
     842 
     843    // Check if view-switch exists and add it if it does not 
     844    // It must exist because that's where we have our swithc to tree-icon 
    841845    var view_switch = $("div.view-switch"); 
    842846    if (! view_switch.length) { 
     
    854858    // Add our link inside view switch 
    855859    view_switch.append(tree_view_switch_a); 
    856  
    857  
     860     
     861    // add a class to wpbody so we can style things 
     862    if (cmstpv_postsoverview_wrap.length) { 
     863        $wp_body = $("#wpbody"); 
     864        $wp_body.addClass("cmstpv_postsoverview_enabled"); 
     865    } 
    858866 
    859867    /* 
  • cms-tree-page-view/trunk/styles/styles.css

    r641321 r641987  
    465465 
    466466/* 
    467  
     467for posts overview enabled mode 
    468468*/ 
    469469#view-switch-tree { 
    470470    background: url(images/switch-view-icons.png) 0 0; 
    471  
     471    visibility: hidden; 
    472472} 
    473473.current #view-switch-tree { 
    474474    background-position: -20px 0; 
    475475} 
     476.view-switch #view-switch-tree { 
     477    visibility: visible; 
     478} 
     479 
Note: See TracChangeset for help on using the changeset viewer.