Plugin Directory

Changeset 779738


Ignore:
Timestamp:
09/28/2013 11:08:42 PM (11 years ago)
Author:
lessbloat
Message:

Couple of changes:

  • Per Nacin's suggestion, we are overiding the current dashboard with dashboard-override.php
  • Couple of CSS tweaks to Kelly's Right now changes. Changed name of that widget to "Site Content". Removed clear divs
  • Removed unused dashboard files
Location:
dashboard/trunk
Files:
1 added
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • dashboard/trunk/css/rightnow.css

    r779007 r779738  
    33#dash-right-now .inside {
    44    margin-bottom: 0;
     5    overflow: hidden;
    56    padding: 0;
    67}
     
    89#dash-right-now .main {
    910    padding: 0 12px;
     11}
     12
     13#dash-right-now .main p {
     14    margin-top: 10px;
     15}
     16
     17#dash-right-now ul,
     18.mu-storage {
     19    overflow: hidden;
    1020}
    1121
  • dashboard/trunk/dashboard.php

    r779007 r779738  
    1717
    1818        private $active_modules = array(
    19             'dashboard',
    2019            //'combinednews',
    2120            'quickdraft',
     
    2625            self::$instance = $this;
    2726           
    28             add_action( 'admin_menu', array( $this , 'dash_add_menu' ) );
     27            // Override dashboard temporarily
     28            add_action( 'load-index.php', array( $this , 'override_dashboard' ) );
     29           
     30            // Load JS & CSS
    2931            add_action( 'admin_enqueue_scripts', array( $this , 'enqueue_scripts' ) );
    3032           
     33            // Load new module files
    3134            foreach ( $this->active_modules as $module_slug ) include plugin_dir_path( __FILE__ ) . $module_slug . '.php';
    3235            $this->screen = 'dashboard';
    3336        }
    34        
     37
    3538        function enqueue_scripts() {
    3639            if ( get_current_screen()->base !== $this->screen && get_current_screen()->base !== 'dashboard' )
     
    4548        }
    4649       
    47         function dash_add_menu() {
    48             $this->screen = add_dashboard_page( 'Dash', 'Dash', 'read', 'dash-dash', array( $this, 'dash_page' ) );
    49         }
    50        
    51         function dash_page() {
    52         ?>
    53         <div class="wrap">
    54 
    55             <h2><?php $words = array( 'Hola', 'Bonjour', 'Aloha', 'Ahoy There', "G'day", "It's Go Time", 'Break a Leg', 'Go For Broke' ); echo esc_html( $words[ mt_rand( 0, count( $words) -1 ) ] ); ?></h2>
    56 
    57         </div><!-- .wrap -->
    58         <?php
    59         }
     50        function override_dashboard() {
     51            if ( get_current_screen()->in_admin( 'site' ) ) {
     52                require dirname( __FILE__ ) . '/dashboard-override.php';
     53                exit;
     54            }
     55        }
    6056    }
    6157    new Plugin_Dashboard;
  • dashboard/trunk/quickdraft.php

    r767441 r779738  
    11<?php
    2 
    3 // Remove the QuickPress widget from the dashboard
    4 add_action( 'wp_dashboard_setup', 'remove_quickpress_and_recent_drafts_dashboard_widgets' );
    5 
    6 function remove_quickpress_and_recent_drafts_dashboard_widgets() {
    7     remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
    8     remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' );
    9 }
    102
    113// Add the QuickDraft widget to the dashboard
     
    135
    146function add_quickdraft_dashboard_widget() {
    15     if ( is_blog_admin() && current_user_can( 'edit_posts' ) ) {
    16         wp_add_dashboard_widget( 'dashboard_quick_draft', __( 'QuickDraft' ), 'wp_dashboard_quick_draft' ); 
    17     }   
     7    if ( is_blog_admin() && current_user_can( 'edit_posts' ) )
     8        add_meta_box('dashboard_quick_draft', __( 'Quick Draft' ), 'wp_dashboard_quick_draft', 'dashboard', 'side', 'high');
    189}
    1910
  • dashboard/trunk/rightnow.php

    r779007 r779738  
    3939        </li>
    4040    </ul>
    41     <div style="clear:both;"></div>
    4241    </div>
    4342    <?php
     
    4645function dash_add_new_right_now() {
    4746    remove_meta_box( 'dashboard_right_now', 'dashboard', 'side' );
    48     wp_add_dashboard_widget( 'dash-right-now', 'New Right Now', 'dash_new_right_now' );
     47    add_meta_box('dash-right-now', 'Site Content', 'dash_new_right_now', 'dashboard', 'normal', 'high');
    4948    remove_action( 'activity_box_end', 'wp_dashboard_quota' );
    5049    add_action( 'activity_box_end', 'dash_new_dashboard_quota' );
     
    9897    ?>
    9998    </ul>
    100     <div style="clear:both;"></div>
    10199    <p><?php printf( __('<b>WordPress %1$s</b> running %2$s theme.' ), get_bloginfo( 'version', 'display' ), $theme_name ); ?></p>
    102100    </div>
Note: See TracChangeset for help on using the changeset viewer.