Plugin Directory

Changeset 766285


Ignore:
Timestamp:
09/03/2013 01:11:05 PM (12 years ago)
Author:
lessbloat
Message:

Initial base scaffold for core dashboard plugin.

Location:
dashboard/trunk
Files:
11 added
2 edited

Legend:

Unmodified
Added
Removed
  • dashboard/trunk/dashboard.php

    r753902 r766285  
    11<?php
    2 /*
    3 Plugin Name: Dashboard Redux
    4 Plugin URI: http://wordpress.org/plugins/dashboard
    5 Description: Feature dev plugin for an action-oriented dashboard. Potentially a failure.
    6 Author: Helen Hou-Sandi
    7 Version: 0.1
    8 Author URI: http://profiles.wordpress.org/helen/
    9 */
     2/* Plugin Name: Dashboard
     3 * Description: Refresh WordPress dashboard screen
     4 * Author: Core Volunteers
     5 * Author URI: http://make.wordpress.org/ui/tag/dash/
     6 * Version: 0.1
     7 * License: GPLv2 or later
     8 * License URI: http://www.gnu.org/licenses/gpl-2.0.html
     9 */
    1010
    11 function dddd_admin_menu() {
    12     add_dashboard_page( 'Dashboard Redux', 'Dashboard Redux', 'read', 'dddd-dashboard-redux', 'dddd_admin_page' );
     11if ( !class_exists( 'Plugin_Dashboard' ) ) {
     12    class Plugin_Dashboard {
     13       
     14        const version = '0.1';
     15        static $instance;
     16        private $screen;
     17       
     18        function __construct() {       
     19            self::$instance = $this;
     20           
     21            add_action( 'admin_menu', array( $this , 'dash_add_menu' ) );
     22            add_action( 'admin_enqueue_scripts', array( $this , 'enqueue_scripts' ) );
     23           
     24            include( plugin_dir_path( __FILE__ ) . 'combinednews.php' );
     25            include( plugin_dir_path( __FILE__ ) . 'quickdraft.php' );
     26            include( plugin_dir_path( __FILE__ ) . 'rightnow.php' );
     27        }
     28       
     29        function enqueue_scripts() {
     30            if ( get_current_screen()->base !== $this->screen )
     31                return;
     32
     33            // JS
     34            wp_enqueue_script( 'combinednews-js', dirname(__FILE__) . '/js/combinednews.js', array( 'jquery' ), self::version, true );
     35            wp_enqueue_script( 'quickdraft-js', dirname(__FILE__) . '/js/quickdraft.js', array( 'jquery' ), self::version, true );
     36            wp_enqueue_script( 'rightnow-js', dirname(__FILE__) . '/js/rightnow.js', array( 'jquery' ), self::version, true );
     37            // CSS
     38            wp_enqueue_style( 'combinednews-css', dirname(__FILE__) . '/css/combinednews.css', array(), self::version );
     39            wp_enqueue_style( 'quickdraft-css', dirname(__FILE__) . '/css/quickdraft.css', array(), self::version );
     40            wp_enqueue_style( 'rightnow-css', dirname(__FILE__) . '/css/rightnow.css', array(), self::version );
     41        }
     42       
     43        function dash_add_menu() {
     44            $this->screen = add_dashboard_page( 'Dash', 'Dash', 'read', 'dash-dash', array( __CLASS__, 'dash_page' ) );
     45        }
     46       
     47        function dash_page() {
     48        ?>
     49        <div class="wrap">
     50
     51            <?php screen_icon(); ?>
     52
     53            <h2><?php esc_html_e( 'Dash' ); ?></h2>
     54
     55        </div><!-- .wrap -->
     56        <?php
     57        }
     58    }
     59    new Plugin_Dashboard;
    1360}
    14 add_action( 'admin_menu', 'dddd_admin_menu' );
    15 
    16 function dddd_admin_page() {
    17 ?>
    18 <div class="wrap">
    19 
    20     <?php screen_icon(); ?>
    21 
    22     <h2><?php esc_html_e( 'Dashboard Redux', 'dddd' ); ?></h2>
    23 
    24 </div><!-- .wrap -->
    25 <?php
    26 }
  • dashboard/trunk/readme.txt

    r753902 r766285  
    1 === D ===
    2 Contributors: helen, ryelle, melchoyce, sillybean
    3 Tags: feature-dev
    4 Requires at least: trunk
    5 Tested up to: trunk
     1=== Dashboard ===
     2Contributors: lessbloat, joen, helen, dabar, kraftbj
     3Tags: dashboard, right now, dashboard widgets
     4Requires at least: 3.7
     5Tested up to: 3.7
    66Stable tag: trunk
    7 
    8 Feature dev plugin for an action-oriented dashboard. Potentially a failure.
     7License: GPLv2 or later
     8License URI: http://www.gnu.org/licenses/gpl-2.0.html
    99
    1010== Description ==
    1111
    12 Sometimes some of us wish the dashboard were more action-oriented. Wishing doesn't do anything, but dev-ing a feature in a plugin does.
     12Refresh WordPress dashboard screen.  Clean things up. 
     13Move a few things around.  Make it more actionable and relevant for users.
    1314
    1415== Changelog ==
    1516
    16 = 0.1=
    17 * Skeleton
     17= 0.1 =
     18* First version Aug 2013
Note: See TracChangeset for help on using the changeset viewer.