Make WordPress Core


Ignore:
Timestamp:
10/16/2008 10:35:53 PM (17 years ago)
Author:
ryan
Message:

Dashboard updates from mdawaffe. see #7552

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/dashboard.php

    r9208 r9219  
    2929
    3030    // QuickPress Widget
    31     wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press', 'wp_dashboard_empty_control' );
     31    wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press' );
    3232
    3333    // Recent Drafts
     
    185185        </div>
    186186
    187         <h4><label for="quickpress-content"><?php _e('Post') ?></label></h4>
     187        <div id="add-media-button" class="alignright">
     188            <a class="thickbox button" href="http://hacek.local/wordpress/wp-admin/media-upload.php?TB_iframe=true" id="add-media-link"><?php _e( 'Insert Media' ); ?></a>
     189        </div>
     190
     191        <h4 id="content-label"><label for="content"><?php _e('Post') ?></label></h4>
    188192        <div class="textarea-wrap">
    189             <textarea name="content" id="quickpress-content" class="mceEditor" rows="3" cols="15"><?php echo $post->post_content; ?></textarea>
     193            <textarea name="content" id="content" class="mceEditor" rows="3" cols="15"><?php echo $post->post_content; ?></textarea>
    190194        </div>
    191195
     
    316320        $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a>';
    317321        $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>';
    318         $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\');return false;" class="vim-r" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
     322        $actions['quickedit'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\',\'edit\');return false;" class="vim-q" title="'.__('Quick Edit').'" href="#">' . __('Quick Edit') . '</a>';
     323        $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\');return false;" class="vim-r hide-if-no-js" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
    319324
    320325        $actions = apply_filters( 'comment_row_actions', $actions, $comment );
     
    327332
    328333            // Reply and quickedit need a hide-if-no-js span
    329             if ( 'reply' == $action || 'quickedit' == $action )
     334            if ( 'reply' == $action )
    330335                $action .= ' hide-if-no-js';
     336            elseif ( 'quickedit' == $action )
     337                $action .= ' hide-if-no-js hide-if-js'; // hah
    331338
    332339            $actions_string .= "<span class='$action'>$sep$link</span>";
     
    362369            <blockquote><p><?php comment_excerpt(); ?></p></blockquote>
    363370            <p class="comment-actions"><?php echo $actions_string; ?></p>
     371
     372            <div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden">
     373                <textarea class="comment"><?php echo $comment->comment_content; ?></textarea>
     374                <div class="author-email"><?php echo attribute_escape( $comment->comment_author_email ); ?></div>
     375                <div class="author"><?php echo attribute_escape( $comment->comment_author ); ?></div>
     376                <div class="author-url"><?php echo attribute_escape( $comment->comment_author_url ); ?></div>
     377                <div class="comment_status"><?php echo $comment->comment_approved; ?></div>
     378            </div>
     379
    364380        </div>
    365381<?php
     
    455471function wp_dashboard_rss_output( $widget_id ) {
    456472    $widgets = get_option( 'dashboard_widget_options' );
     473    echo "<div class='rss-widget'>";
    457474    wp_widget_rss_output( $widgets[$widget_id] );
     475    echo "</div>";
    458476}
    459477
     
    463481
    464482function wp_dashboard_secondary_control() {
    465     wp_dashboard_rss_control( 'dashboard_secondary', array( 'show_summary' => false, 'show_author' => false, 'show_date' => false ) );
     483    wp_dashboard_rss_control( 'dashboard_secondary' );
    466484}
    467485
     
    477495    @extract( @$widgets['dashboard_secondary'], EXTR_SKIP );
    478496    $rss = @fetch_rss( $url );
     497
    479498    if ( !isset($rss->items) || 0 == count($rss->items) )
    480499        return false;
    481500
    482     echo "<ul id='planetnews'>\n";
    483 
    484501    $rss->items = array_slice($rss->items, 0, $items);
    485     foreach ($rss->items as $item ) {
    486         $title = wp_specialchars($item['title']);
    487         list($author,$post) = explode( ':', $title, 2 );
    488         $link = clean_url($item['link']);
    489 
    490         echo "\t<li><a href='$link'><span class='post'>$post</span><span class='hidden'> - </span><cite>$author</cite></a></li>\n";
    491     }
    492 
    493     echo "</ul>\n<br class='clear' />\n";
     502
     503    if ( 'http://planet.wordpress.org/' == $rss->channel['link'] ) {
     504        foreach ( array_keys($rss->items) as $i ) {
     505            list($site, $description) = explode( ':', wp_specialchars($rss->items[$i]['title']), 2 );
     506            $rss->items[$i]['dc']['creator'] = trim($site);
     507            $rss->items[$i]['title'] = trim($description);
     508        }
     509    }
     510
     511    echo "<div class='rss-widget'>";
     512    wp_widget_rss_output( $rss, $widgets['dashboard_secondary'] );
     513    echo "</div>";
    494514}
    495515
     
    605625
    606626/* Dashboard Widgets Controls */
    607 
    608 // Temp
    609 function wp_dashboard_empty_control() {
    610     echo "This feature isn't enabled in this prototype.";
    611 }
    612627
    613628// Calls widget_control callback
Note: See TracChangeset for help on using the changeset viewer.