Changeset 9103
- Timestamp:
- 10/08/2008 11:32:34 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r9098 r9103 466 466 if ( ! $comment ) die('1'); 467 467 468 $mode = ( isset($_POST['mode']) && 'single' == $_POST['mode'] ) ? 'single' : 'detail'; 468 $modes = array( 'single', 'detail', 'dashboard' ); 469 $mode = isset($_POST['mode']) && in_array( $_POST['mode'], $modes ) ? $_POST['mode'] : 'detail'; 469 470 $position = ( isset($_POST['position']) && (int) $_POST['position']) ? (int) $_POST['position'] : '-1'; 470 471 $checkbox = ( isset($_POST['checkbox']) && true == $_POST['checkbox'] ) ? 1 : 0; … … 476 477 477 478 ob_start(); 478 _wp_comment_row( $comment->comment_ID, $mode, false, $checkbox ); 479 if ( 'dashboard' == $mode ) { 480 require_once( ABSPATH . 'wp-admin/includes/dashboard.php' ); 481 _wp_dashboard_recent_comments_row( $comment, false ); 482 } else { 483 _wp_comment_row( $comment->comment_ID, $mode, false, $checkbox ); 484 } 479 485 $comment_list_item = ob_get_contents(); 480 486 ob_end_clean(); -
trunk/wp-admin/admin-header.php
r9068 r9103 81 81 } 82 82 83 $settings_pages = array( 'categories.php', 'edit.php', 'edit-comments.php', 'edit-form-advanced.php', 'edit-link-categories.php', 'edit-link-form.php', 'edit-page-form.php', 'edit-tags.php', 'link-manager.php', 'upload.php', 'users.php', 'edit-pages.php', 'post-new.php', 'post.php', 'page-new.php', 'page.php' );83 $settings_pages = array( 'categories.php', 'edit.php', 'edit-comments.php', 'edit-form-advanced.php', 'edit-link-categories.php', 'edit-link-form.php', 'edit-page-form.php', 'edit-tags.php', 'link-manager.php', 'upload.php', 'users.php', 'edit-pages.php', 'post-new.php', 'post.php', 'page-new.php', 'page.php', 'index.php' ); 84 84 ?> 85 85 -
trunk/wp-admin/css/colors-classic-rtl.css
r8632 r9103 8 8 background-position:99% 10px; 9 9 } 10 #poststuff .closed .togbox, #poststuff .togbox {10 .metabox-holder .closed .togbox, .metabox-holder .togbox, #poststuff .closed .togbox, #poststuff .togbox { 11 11 background-image: url(../images/toggle-arrow-rtl.gif) !important; 12 12 } -
trunk/wp-admin/css/colors-classic.css
r9098 r9103 63 63 64 64 li.widget-list-control-item, div.nav, .tablenav, #dashboard-widgets p.dashboard-widget-links, 65 .form-table tr, #poststuff h3, #replyhandle,65 .form-table tr, #poststuff h3, .metabox-holder h3, #replyhandle, 66 66 .login form, h3.info-box-title, #post-status-info, #edit-settings-wrap, 67 67 #wpbody-content .describe tr, #edithead, #replyhead { … … 499 499 } 500 500 501 #poststuff .closed .togbox {501 .metabox-holder .closed .togbox, #poststuff .closed .togbox { 502 502 background-color: #2583ad; 503 503 background-image: url(../images/toggle-arrow.gif); 504 504 } 505 505 506 #poststuff .postbox, #titlediv, #poststuff .postarea, #poststuff .stuffbox {506 .metabox-holder .postbox, #poststuff .postbox, #titlediv, #poststuff .postarea, #poststuff .stuffbox { 507 507 border-color: #ebebeb; 508 508 border-right-color: #ccc; … … 510 510 } 511 511 512 #poststuff .togbox {512 .metabox-holder .togbox, #poststuff .togbox { 513 513 background-color: #b2b2b2; 514 514 background-image: url(../images/toggle-arrow.gif); 515 515 } 516 516 517 #poststuff .postbox {517 .metabox-holder .postbox, #poststuff .postbox { 518 518 background-color: #FFF; 519 519 } -
trunk/wp-admin/css/colors-fresh-rtl.css
r8632 r9103 16 16 border-left-color: #ccc; 17 17 } 18 #poststuff .closed .togbox, #poststuff .togbox {18 .metabox-holder .closed .togbox, .metabox-holder .togbox, #poststuff .closed .togbox, #poststuff .togbox { 19 19 background-image: url(../images/toggle-arrow-rtl.gif); 20 20 } -
trunk/wp-admin/css/colors-fresh.css
r9098 r9103 63 63 64 64 li.widget-list-control-item, div.nav, .tablenav, #dashboard-widgets p.dashboard-widget-links, 65 .form-table tr, #poststuff h3, #replyhandle,65 .form-table tr, #poststuff h3, .metabox-holder h3, #replyhandle, 66 66 .login form, h3.info-box-title, #post-status-info, #edit-settings-wrap, 67 67 #wpbody-content .describe tr, #edithead, #replyhead { … … 483 483 } 484 484 485 #poststuff .closed .togbox {485 .metabox-holder .closed .togbox, #poststuff .closed .togbox { 486 486 background-color: #2583ad; 487 487 background-image: url(../images/toggle-arrow.gif); 488 488 } 489 489 490 #poststuff .postbox, #titlediv, #poststuff .postarea, #poststuff .stuffbox {490 .metabox-holder .postbox, #poststuff .postbox, #titlediv, #poststuff .postarea, #poststuff .stuffbox { 491 491 border-color: #ebebeb; 492 492 border-right-color: #ccc; … … 494 494 } 495 495 496 #poststuff .togbox {496 .metabox-holder .togbox, #poststuff .togbox { 497 497 background-color: #b2b2b2; 498 498 background-image: url(../images/toggle-arrow.gif); 499 499 } 500 500 501 #poststuff .postbox {501 .metabox-holder .postbox, #poststuff .postbox { 502 502 background-color: #FFF; 503 503 } -
trunk/wp-admin/css/dashboard-rtl.css
r8632 r9103 1 /* Right Now */ 2 #rightnow { 3 margin-right:0; 4 margin-left: 7px; 5 } 6 #rightnow .reallynow span { 7 text-align: right; 8 float: right; 9 } 10 #rightnow .reallynow a { 11 text-align: left; 12 float: left; 13 margin: 1px 0 0 6px; 14 } 15 /* Widgets */ 16 div#dashboard-widgets-wrap { 17 margin-right:0; 18 margin-left:-13px; 19 } 20 div.dashboard-widget-holder { 21 float:right; 22 } 23 div.dashboard-widget { 24 margin-right:0; 25 margin-left: 20px; 26 } 27 h3.dashboard-widget-title span { 28 text-align: right; 29 float: right; 30 } 31 h3.dashboard-widget-title small { 32 text-align: left; 33 float:left; 34 } 35 div.dashboard-widget-submit input { 36 font-family: Tahoma; 37 } 38 div.dashboard-widget-content ul, div.dashboard-widget-content ol, div.dashboard-widget-content dl { 39 padding-left:0; 40 padding-right:15px; 41 } 42 #dashboard_secondary div.dashboard-widget-content ul li { 43 float:right; 44 } 45 #dashboard_secondary div.dashboard-widget-content ul li .post { 46 font-family:arial; 47 } 48 #dashboard_secondary div.dashboard-widget-content ul li a { 49 border-right:0 none; 50 border-left: 1px solid #dadada; 51 height:110px; 52 } 53 #dashboard_secondary div.dashboard-widget-content ul li a cite { 54 font-family: Tahoma; 55 } 56 #dashboard-widgets .widget_rss ul li span.rss-date { 57 float:right; 58 } 59 #dashboard-widgets .widget_rss ul li a { 60 float: right; 61 margin: 0 0 .2em .5em; 62 } 1 /* TODO */ -
trunk/wp-admin/css/dashboard.css
r9061 r9103 30 30 } 31 31 32 33 /* Widgets */ 34 35 div#dashboard-widgets-wrap { 36 margin-right: -13px; /* 20 (div.dashboard-widget margin-right) - 7 (#rightnow margin-right) */ 37 } 38 39 div#dashboard-widgets { 40 width: 100%; 41 } 42 43 div.dashboard-widget-holder { 44 margin-bottom: 20px; 45 width: 50%; 46 float: left; 47 } 48 49 div.dashboard-widget-holder.third { 50 width: 33.3%; 51 } 52 53 div.dashboard-widget-holder.fourth { 54 width: 25%; 55 } 56 57 div.dashboard-widget-holder.full { 58 width: 100%; 59 } 60 61 div.dashboard-widget-holder.double div.dashboard-widget { 62 height: 54em; 63 padding-bottom: 28px /* lame */ 64 } 65 66 div.dashboard-widget { 67 position: relative; 68 margin-right: 20px; 69 border-width: 1px; 70 border-style: solid; 71 height: 27em; 72 overflow: auto; 73 font-size: 11px; 74 } 75 76 #dashboard-widgets p.dashboard-widget-links { 77 padding: 2px; 78 font-size: 11px; 79 line-height: 2; 80 border-width: 1px; 81 margin: 0 20px 0 0; 82 padding: 0 7px; 83 border: 1px solid; 84 border-top: none; 85 } 86 87 h3.dashboard-widget-title { 88 margin: 2px; 89 padding: 0 7px; 90 font-size: 14px; 91 line-height: 2; 92 } 93 94 h3.dashboard-widget-title span { 95 display: block; 96 text-align: left; 97 float: left; 98 } 99 100 h3.dashboard-widget-title small { 101 display: block; 102 text-align: right; 103 float: right; 104 font-size: 75%; 105 line-height: 2.67; /* math: it works, bitches */ 106 } 107 108 p.dashboard-widget-links img.rss-icon { 109 vertical-align: middle; 110 } 111 112 div.dashboard-widget-notice { 113 padding: 0 14px; 114 font-size: 1.2em; 115 line-height: 2; 116 } 117 118 div.dashboard-widget-error { 119 padding: 0 20px; 120 font-size: 1.2em; 121 line-height: 2; 122 } 123 124 div.dashboard-widget-content { 125 padding: 10px 15px; 126 } 127 128 div.dashboard-widget-submit { 129 border-top: 1px solid #ccc; 130 padding: 1em 0 0 0; 131 margin: 10px 0 0 0; 132 } 133 div.dashboard-widget-submit input { 134 font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; 135 padding: 4px 6px; 136 border: none; 137 font-size: 13px; 138 -moz-border-radius: 3px; 139 -khtml-border-radius: 3px; 140 -webkit-border-radius: 3px; 141 border-radius: 3px; 142 cursor: pointer; 143 text-decoration: none; 144 } 145 146 div.dashboard-widget-content ul, div.dashboard-widget-content ol, div.dashboard-widget-content dl { 32 form p.field-tip { 33 font-size: .9em; 34 font-style: italic; 147 35 margin: 0; 148 text-indent: 0;149 padding-left: 15px;150 }151 div.dashboard-widget-content li {152 margin: .5em 0 1em;153 }154 155 div.dashboard-widget-content blockquote {156 margin: -1em 0;157 }158 159 div#dashboard_recent_comments p {160 font-size: 14px;161 }162 163 div.dashboard-widget-content p.comment-meta {164 font-size: 11px !important;165 }166 167 #dashboard_secondary div.dashboard-widget {168 height: auto;169 }170 171 #dashboard_secondary div.dashboard-widget-content ul {172 list-style: none;173 36 padding: 0; 174 37 } 175 38 176 #dashboard_secondary div.dashboard-widget-content ul li { 177 display: block; 178 width: 19.95%; 179 padding-bottom: 10px; 180 margin: 0; 181 float: left; 182 font-size: 95%; 39 #dashboard-widgets .postbox form .submit { 40 float: none; 41 margin: .5em 0 0; 42 padding: 0; 43 border: none; 183 44 } 184 45 185 #dashboard_secondary div.dashboard-widget-content { 186 margin: 10px 5px; 46 #dashboard-widgets-wrap #dashboard-widgets .postbox form .submit input { 47 margin: 0; 48 } 49 50 #dashboard-widgets-wrap #dashboard-widgets .postbox form .submit #publish { 51 min-width: 0; 52 } 53 54 div.postbox div.inside { 55 margin: 0 10px 10px; 56 position: relative; 57 } 58 59 .view-all { 60 position: absolute; 61 top: 0; 62 right: 0; 63 padding: 0; 64 margin: 0; 65 } 66 67 #dashboard-widgets h4 { 68 font-size: 1em; 69 margin: 0 0 .2em; 187 70 padding: 0; 188 71 } 189 72 190 #dashboard_secondary div.dashboard-widget-content ul li .post { 191 display:block; 192 font-family:Georgia,"Times New Roman",Times,serif; 193 font-size:18px; 194 line-height: 1.2em; 195 height:90px; 196 overflow:hidden; 73 /* Recent Comments */ 74 75 #the-comment-list { 76 position: relative; 197 77 } 198 78 199 #dashboard_secondary div.dashboard-widget-content ul li a { 200 display: block; 201 height:100%; 202 overflow:hidden; 203 margin: 5px 10px; 204 text-decoration: none; 205 padding: .5em; 206 border-right: 1px solid #dadada; 207 border-bottom: 1px solid #dadada; 79 #the-comment-list .comment-item { 80 padding: 5px 5px 5px 47px; 208 81 } 209 82 210 # dashboard_secondary div.dashboard-widget-content ul li a cite{211 display: block;212 font-family: "Lucida Sans", "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;83 #the-comment-list .comment-item .avatar { 84 position: absolute; 85 left: 5px; 213 86 } 214 87 215 #dashboard-widgets .widget_rss ul { 216 list-style: none; 88 #the-comment-list .comment-item blockquote, #the-comment-list .comment-item blockquote p { 89 margin: 0; 90 padding: 0; 91 display: inline; 92 } 93 94 #dashboard_recent_comments #the-comment-list .trackback blockquote, #dashboard_recent_comments #the-comment-list .pingback blockquote { 95 display: block; 96 } 97 98 #the-comment-list .comment-item p.comment-actions { 99 margin: 0; 217 100 padding: 0; 218 101 } 219 102 220 #dashboard-widgets .widget_rss ul li { 221 clear: both; 222 } 223 224 #dashboard-widgets .widget_rss ul li span.rss-date { 225 float: left; 226 margin: 0; 227 } 228 229 #dashboard-widgets .widget_rss ul li a { 230 float: left; 231 margin: 0 .5em .2em 0; 232 font-weight: bold; 233 } 234 235 #dashboard-widgets .widget_rss ul li div { 236 clear: both; 237 line-height: 1.5em; 238 } 103 /* Primary Feed */ 239 104 240 105 #dashboard_primary a.rsswidget, #dashboard_plugins h5 { … … 246 111 } 247 112 248 #dashboard_plugins h4 { 249 font-size: 1em; 250 margin: 0 0 .1em; 251 } 113 /* Plugins */ 252 114 253 115 #dashboard_plugins h5 { … … 261 123 line-height: 1.5em; 262 124 } 263 264 #dashboard_inbox div.dashboard-widget, #dashboard_quick_press div.dashboard-widget {265 height: 35em;266 padding-bottom: 0;267 }268 269 #dashboard_quick_press div.dashboard-widget-content {270 padding-bottom: 0;271 }272 273 #dashboard_inbox p.actions {274 margin-bottom:0pt;275 margin-top: 0;276 float:left;277 }278 279 #dashboard_quick_press h3 {280 margin-bottom: 3px;281 }282 283 #dashboard_quick_press h3#quick-post-title {284 margin-top: 0;285 }286 287 #dashboard_quick_press p.field-tip {288 margin-top: 0;289 font-style: italic;290 }291 292 #dashboard_quick_press .submit {293 padding: 0 0 1em 0;294 border-top: none;295 border-bottom: 1px solid #ccc;296 }297 298 #dashboard_quick_press p#recent-drafts {299 margin: 0;300 } -
trunk/wp-admin/css/ie-rtl.css
r9018 r9103 1 #poststuff .postbox h3 {1 .metabox-holder .postbox h3, #poststuff .postbox h3 { 2 2 padding-left:0; 3 3 padding-right: 23px; … … 21 21 margin: 4px -9px 0 0; 22 22 } 23 #poststuff .togbox {23 .metabox-holder .togbox, #poststuff .togbox { 24 24 margin-left:0; 25 25 margin-right: -19px; -
trunk/wp-admin/css/ie.css
r9073 r9103 1 1 /* Fixes for IE bugs */ 2 2 3 #poststuff .postbox h3 {3 .metabox-holder .postbox h3, #poststuff .postbox h3 { 4 4 padding-left: 23px; 5 5 } … … 32 32 } 33 33 34 #wpwrap, #wpcontent, #post, #wrap, #postdivrich, #postdiv, #poststuff, #titlediv, #post-body, #editorcontainer, .tablenav, .widget-control-list, li.widget-list-control-item, #dragHelper, li.widget-list-control-item h4, .widget-sortable, .widget-control-actions {34 #wpwrap, #wpcontent, #post, #wrap, #postdivrich, #postdiv, #poststuff, .metabox-holder, #titlediv, #post-body, #editorcontainer, .tablenav, .widget-control-list, li.widget-list-control-item, #dragHelper, li.widget-list-control-item h4, .widget-sortable, .widget-control-actions { 35 35 display: block; 36 36 zoom: 100%; … … 89 89 } 90 90 91 #poststuff .togbox {91 .metabox-holder .togbox, #poststuff .togbox { 92 92 margin-left: -19px; 93 93 } -
trunk/wp-admin/edit-form-advanced.php
r9055 r9103 446 446 <?php echo $form_extra ?> 447 447 448 <div id="poststuff" >448 <div id="poststuff" class="metabox-holder"> 449 449 450 450 <div id="side-info" style="display: none;"><?php // TODO ?> -
trunk/wp-admin/edit-form-comment.php
r9099 r9103 20 20 <div class="wrap"> 21 21 22 <div id="poststuff" >22 <div id="poststuff" class="metabox-holder"> 23 23 <input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" /> 24 24 <input type="hidden" name="action" value='<?php echo $form_action . $form_extra ?>' /> -
trunk/wp-admin/edit-link-form.php
r9054 r9103 310 310 wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?> 311 311 312 <div id="poststuff" >312 <div id="poststuff" class="metabox-holder"> 313 313 314 314 <div id="side-info-column" class="inner-sidebar"> -
trunk/wp-admin/edit-page-form.php
r9054 r9103 348 348 --> 349 349 350 <div id="poststuff" >350 <div id="poststuff" class="metabox-holder"> 351 351 352 352 <div id="side-info-column" class="inner-sidebar"> -
trunk/wp-admin/includes/dashboard.php
r9078 r9103 15 15 */ 16 16 function wp_dashboard_setup() { 17 global $wpdb, $wp_dashboard_sidebars; 17 global $wp_registered_widgets, $wp_registered_widget_controls, $wp_dashboard_control_callbacks; 18 $wp_dashboard_control_callbacks = array(); 19 18 20 $update = false; 19 21 $widget_options = get_option( 'dashboard_widget_options' ); … … 21 23 $widget_options = array(); 22 24 23 24 /* Register WP Dashboard Dynamic Sidebar */25 register_sidebar( array(26 'name' => 'WordPress Dashboard',27 'id' => 'wp_dashboard',28 'before_widget' => "\t<div class='dashboard-widget-holder %2\$s' id='%1\$s'>\n\n\t\t<div class='dashboard-widget'>\n\n",29 'after_widget' => "\t\t</div>\n\n\t</div>\n\n",30 'before_title' => "\t\t\t<h3 class='dashboard-widget-title'>",31 'after_title' => "</h3>\n\n"32 ) );33 34 35 25 /* Register Widgets and Controls */ 36 26 37 27 // Recent Comments Widget 38 $mod_comments = wp_count_comments(); 39 $mod_comments = $mod_comments->moderated; 40 if ( current_user_can( 'moderate_comments' ) && $mod_comments ) { 41 $notice = sprintf( __ngettext( '%d comment awaiting moderation', '%d comments awaiting moderation', $mod_comments ), $mod_comments ); 42 $notice = "<a href='edit-comments.php?comment_status=moderated'>$notice</a>"; 43 } else { 44 $notice = ''; 45 } 46 wp_register_sidebar_widget( 'dashboard_recent_comments', __( 'Recent Comments' ), 'wp_dashboard_recent_comments', 47 array( 'all_link' => 'edit-comments.php', 'notice' => $notice, 'width' => 'half' ) 48 ); 49 28 wp_add_dashboard_widget( 'dashboard_recent_comments', __( 'Recent Comments' ), 'wp_dashboard_recent_comments' ); 50 29 51 30 // QuickPress Widget 52 if ( 'post' === strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['action'] ) && 0 === strpos( $_POST['action'], 'post-quickpress' ) ) { 53 $view = get_permalink( $_POST['post_ID'] ); 54 $edit = clean_url( get_edit_post_link( $_POST['post_ID'] ) ); 55 if ( 'post-quickpress-publish' == $_POST['action'] ) 56 $notice = sprintf( __( 'Post Published. <a href="%s">View post</a> | <a href="%s">Edit post</a>' ), clean_url( $view ), $edit ); 57 else 58 $notice = sprintf( __( 'Draft Saved. <a href="%s">Preview post</a> | <a href="%s">Edit post</a>' ), clean_url( add_query_arg( 'preview', 1, $view ) ), $edit ); 59 } else { 60 $notice = ''; 61 } 62 wp_register_sidebar_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press', 63 array( 'all_link' => array( 'edit.php?post_status=draft', __('View All Drafts') ), 'width' => 'half', 'height' => 'double', 'notice' => $notice ) 64 ); 65 wp_register_widget_control( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_empty_control', 66 array( 'widget_id' => 'dashboard_quick_press' ) 67 ); 31 wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press', 'wp_dashboard_empty_control' ); 32 33 // Recent Drafts 34 wp_add_dashboard_widget( 'dashboard_recent_drafts', __( 'Recent Drafts' ), 'wp_dashboard_recent_drafts' ); 68 35 69 36 // Incoming Links Widget … … 78 45 ); 79 46 } 80 wp_register_sidebar_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_empty', 81 array( 'all_link' => $widget_options['dashboard_incoming_links']['link'], 'feed_link' => $widget_options['dashboard_incoming_links']['url'], 'width' => 'half' ), 82 'wp_dashboard_cached_rss_widget', 'wp_dashboard_incoming_links_output' 83 ); 84 wp_register_widget_control( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_rss_control', array(), 85 array( 'widget_id' => 'dashboard_incoming_links', 'form_inputs' => array( 'title' => false, 'show_summary' => false, 'show_author' => false ) ) 86 ); 87 47 wp_add_dashboard_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_incoming_links', 'wp_dashboard_incoming_links_control' ); 88 48 89 49 // WP Plugins Widget 90 wp_register_sidebar_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_empty', 91 array( 'all_link' => 'http://wordpress.org/extend/plugins/', 'feed_link' => 'http://wordpress.org/extend/plugins/rss/topics/', 'width' => 'half' ), 92 'wp_dashboard_cached_rss_widget', 'wp_dashboard_plugins_output', 93 array( 'http://wordpress.org/extend/plugins/rss/browse/popular/', 'http://wordpress.org/extend/plugins/rss/browse/new/', 'http://wordpress.org/extend/plugins/rss/browse/updated/' ) 94 ); 50 if ( current_user_can( 'activate_plugins' ) ) 51 wp_add_dashboard_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_plugins' ); 95 52 96 53 // Primary feed (Dev Blog) Widget … … 107 64 ); 108 65 } 109 wp_register_sidebar_widget( 'dashboard_primary', $widget_options['dashboard_primary']['title'], 'wp_dashboard_empty', 110 array( 'all_link' => $widget_options['dashboard_primary']['link'], 'feed_link' => $widget_options['dashboard_primary']['url'], 'width' => 'half', 'class' => 'widget_rss' ), 111 'wp_dashboard_cached_rss_widget', 'wp_dashboard_rss_output' 112 ); 113 wp_register_widget_control( 'dashboard_primary', __( 'Primary Feed' ), 'wp_dashboard_rss_control', array(), 114 array( 'widget_id' => 'dashboard_primary' ) 115 ); 116 66 wp_add_dashboard_widget( 'dashboard_primary', $widget_options['dashboard_primary']['title'], 'wp_dashboard_primary', 'wp_dashboard_primary_control' ); 117 67 118 68 // Secondary Feed (Planet) Widget … … 126 76 ); 127 77 } 128 wp_register_sidebar_widget( 'dashboard_secondary', $widget_options['dashboard_secondary']['title'], 'wp_dashboard_empty', 129 array( 'all_link' => $widget_options['dashboard_secondary']['link'], 'feed_link' => $widget_options['dashboard_secondary']['url'], 'width' => 'full' ), 130 'wp_dashboard_cached_rss_widget', 'wp_dashboard_secondary_output' 131 ); 132 wp_register_widget_control( 'dashboard_secondary', __( 'Secondary Feed' ), 'wp_dashboard_rss_control', array(), 133 array( 'widget_id' => 'dashboard_secondary', 'form_inputs' => array( 'show_summary' => false, 'show_author' => false, 'show_date' => false ) ) 134 ); 135 136 137 /* Dashboard Widget Template 138 wp_register_sidebar_widget( $widget_id (unique slug) , $widget_title, $output_callback, 139 array( 140 'all_link' => full url for "View All" link, 141 'feed_link' => full url for "RSS" link, 142 'width' => 'fourth', 'third', 'half', 'full' (defaults to 'half'), 143 'height' => 'single', 'double' (defaults to 'single'), 144 ), 145 $wp_dashboard_empty_callback (only needed if using 'wp_dashboard_empty' as your $output_callback), 146 $arg, $arg, $arg... (further args passed to callbacks) 147 ); 148 149 // optional: if you want users to be able to edit the settings of your widget, you need to register a widget_control 150 wp_register_widget_control( $widget_id, $widget_control_title, $control_output_callback, 151 array(), // leave an empty array here: oddity in widget code 152 array( 153 'widget_id' => $widget_id, // Yes - again. This is required: oddity in widget code 154 'arg' => an arg to pass to the $control_output_callback, 155 'another' => another arg to pass to the $control_output_callback, 156 ... 157 ) 158 ); 159 */ 78 wp_add_dashboard_widget( 'dashboard_secondary', $widget_options['dashboard_secondary']['title'], 'wp_dashboard_secondary', 'wp_dashboard_secondary_control' ); 160 79 161 80 // Hook to register new widgets 162 81 do_action( 'wp_dashboard_setup' ); 163 82 164 // Hard code the sidebar's widgets and order165 $dashboard_widgets = array();166 $dashboard_widgets[] = 'dashboard_quick_press';167 $dashboard_widgets[] = 'dashboard_recent_comments';168 /*169 $dashboard_widgets[] = 'dashboard_incoming_links';170 $dashboard_widgets[] = 'dashboard_primary';171 if ( current_user_can( 'activate_plugins' ) )172 $dashboard_widgets[] = 'dashboard_plugins';173 */174 $dashboard_widgets[] = 'dashboard_secondary';175 176 83 // Filter widget order 177 $dashboard_widgets = apply_filters( 'wp_dashboard_widgets', $dashboard_widgets ); 178 if ( in_array( 'dashboard_quick_press', $dashboard_widgets ) ) { 179 // add_action( 'admin_head', 'wp_teeny_mce' ); 180 add_action( 'admin_head', 'wp_dashboard_quick_press_js' ); 181 } 182 183 $wp_dashboard_sidebars = array( 'wp_dashboard' => $dashboard_widgets, 'array_version' => 3.5 ); 184 185 add_filter( 'dynamic_sidebar_params', 'wp_dashboard_dynamic_sidebar_params' ); 84 $dashboard_widgets = apply_filters( 'wp_dashboard_widgets', array() ); 186 85 187 86 if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget_id']) ) { … … 195 94 if ( $update ) 196 95 update_option( 'dashboard_widget_options', $widget_options ); 96 97 foreach ( $dashboard_widgets as $widget_id ) 98 wp_add_dashboard_widget( $widget_id, $wp_registered_widgets[$widget_id]['name'], $wp_registered_widgets[$widget_id]['callback'], $wp_registered_widget_controls[$widget_id]['callback'] ); 99 } 100 101 function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_callback = null ) { 102 global $wp_dashboard_control_callbacks; 103 if ( $control_callback && current_user_can( 'edit_dashboard' ) && is_callable( $control_callback ) ) { 104 $wp_dashboard_control_callbacks[$widget_id] = $control_callback; 105 if ( isset( $_GET['edit'] ) && $widget_id == $_GET['edit'] ) { 106 list($url) = explode( '#', add_query_arg( 'edit', false ), 2 ); 107 $widget_name .= ' <a href="' . clean_url( $url ) . '">' . __( 'Cancel' ) . '</a>'; 108 add_meta_box( $widget_id, $widget_name, '_wp_dashboard_control_callback', 'dashboard', 'normal', 'core' ); 109 return; 110 } 111 list($url) = explode( '#', add_query_arg( 'edit', $widget_id ), 2 ); 112 $widget_name .= ' <a href="' . clean_url( "$url#$widget_id" ) . '" class="open-box">' . __( 'Edit' ) . '</a>'; 113 } 114 add_meta_box( $widget_id, $widget_name , $callback, 'dashboard', 'normal', 'core' ); 115 } 116 117 function _wp_dashboard_control_callback( $dashboard, $meta_box ) { 118 echo '<form action="" method="post">'; 119 wp_dashboard_trigger_widget_control( $meta_box['id'] ); 120 echo "<p class='submit'><input type='hidden' name='widget_id' value='$meta_box[id]' /><input type='submit' value='" . __( 'Sumbit' ) . "' /></p>"; 121 122 echo '</form>'; 197 123 } 198 124 … … 203 129 */ 204 130 function wp_dashboard() { 205 echo "<div id='dashboard-widgets'>\n\n"; 206 207 // We're already filtering dynamic_sidebar_params obove 208 add_filter( 'option_sidebars_widgets', 'wp_dashboard_sidebars_widgets' ); // here there be hackery 209 dynamic_sidebar( 'wp_dashboard' ); 210 remove_filter( 'option_sidebars_widgets', 'wp_dashboard_sidebars_widgets' ); 211 212 echo "<br class='clear' />\n</div>\n\n\n"; 213 } 214 215 /** 216 * Makes sidebar_widgets option reflect the dashboard settings. 217 * 218 * @since unknown 219 * 220 * @return array WordPress Dashboard Widgets list. 221 */ 222 function wp_dashboard_sidebars_widgets() { // hackery 223 return $GLOBALS['wp_dashboard_sidebars']; 224 } 225 226 // Modifies sidbar params on the fly to set up ids, class names, titles for each widget (called once per widget) 227 // Switches widget to edit mode if $_GET['edit'] 228 /** 229 * {@internal Missing Short Description}} 230 * 231 * @since unknown 232 * 233 * @param unknown_type $params 234 * @return unknown 235 */ 236 function wp_dashboard_dynamic_sidebar_params( $params ) { 237 global $wp_registered_widgets, $wp_registered_widget_controls; 238 239 $sidebar_defaults = array('widget_id' => 0, 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => ''); 240 extract( $sidebar_defaults, EXTR_PREFIX_ALL, 'sidebar' ); 241 extract( $params[0], EXTR_PREFIX_ALL, 'sidebar' ); 242 243 if ( !isset($wp_registered_widgets[$sidebar_widget_id]) || !is_array($wp_registered_widgets[$sidebar_widget_id]) ) { 244 return $params; 245 } 246 $widget_defaults = array('id' => '', 'width' => '', 'height' => '', 'class' => '', 'feed_link' => '', 'all_link' => '', 'notice' => false, 'error' => false); 247 extract( $widget_defaults, EXTR_PREFIX_ALL, 'widget' ); 248 extract( $wp_registered_widgets[$sidebar_widget_id], EXTR_PREFIX_ALL, 'widget' ); 249 250 $the_classes = array(); 251 if ( in_array($widget_width, array( 'third', 'fourth', 'full' ) ) ) 252 $the_classes[] = $widget_width; 253 254 if ( 'double' == $widget_height ) 255 $the_classes[] = 'double'; 256 257 if ( $widget_class ) 258 $the_classes[] = $widget_class; 259 260 // Add classes to the widget holder 261 if ( $the_classes ) 262 $sidebar_before_widget = str_replace( "<div class='dashboard-widget-holder ", "<div class='dashboard-widget-holder " . join( ' ', $the_classes ) . ' ', $sidebar_before_widget ); 263 264 $top_links = $bottom_links = array(); 265 if ( $widget_all_link ) { 266 $widget_all_link = (array) $widget_all_link; 267 $bottom_links[] = '<a href="' . clean_url( $widget_all_link[0] ) . '">' . ( isset($widget_all_link[1]) ? $widget_all_link[1] : __( 'View All' ) ) . '</a>'; 268 } 269 270 $content_class = 'dashboard-widget-content'; 271 if ( current_user_can( 'edit_dashboard' ) && isset($wp_registered_widget_controls[$widget_id]) && is_callable($wp_registered_widget_controls[$widget_id]['callback']) ) { 272 // Switch this widget to edit mode 273 if ( isset($_GET['edit']) && $_GET['edit'] == $widget_id ) { 274 $content_class .= ' dashboard-widget-control'; 275 $wp_registered_widgets[$widget_id]['callback'] = 'wp_dashboard_empty'; 276 $sidebar_widget_name = $wp_registered_widget_controls[$widget_id]['name']; 277 $params[1] = 'wp_dashboard_trigger_widget_control'; 278 $sidebar_before_widget .= '<form action="' . clean_url(remove_query_arg( 'edit' )) . '" method="post">'; 279 $sidebar_after_widget = "<div class='dashboard-widget-submit'><input type='hidden' name='sidebar' value='wp_dashboard' /><input type='hidden' name='widget_id' value='$widget_id' /><input type='submit' value='" . __( 'Save' ) . "' /></div></form>$sidebar_after_widget"; 280 $top_links[] = '<a href="' . clean_url(remove_query_arg( 'edit' )) . '">' . __( 'Cancel' ) . '</a>'; 131 echo "<div id='dashboard-widgets' class='metabox-holder'>\n\n"; 132 133 echo "<div id='side-info-column' class='inner-sidebar'>\n\n"; 134 $class = do_meta_boxes( 'dashboard', 'side', '' ) ? ' class="has-sidebar"' : ''; 135 echo "</div>\n\n"; 136 137 echo "<div id='post-body'$class>\n\n"; 138 echo "<div id='dashboard-widgets-main-content' class='has-sidebar-content'>\n\n"; 139 do_meta_boxes( 'dashboard', 'normal', '' ); 140 echo "</div>\n\n"; 141 echo "</div>\n\n"; 142 143 echo "<form style='display: none' method='get' action=''>\n<p>\n"; 144 wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); 145 wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); 146 echo "</p>\n</form>\n"; 147 } 148 149 /* Dashboard Widgets */ 150 151 function wp_dashboard_quick_press( $dashboard, $meta_box ) { 152 $drafts = false; 153 if ( 'post' === strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['action'] ) && 0 === strpos( $_POST['action'], 'post-quickpress' ) ) { 154 $view = get_permalink( $_POST['post_ID'] ); 155 $edit = clean_url( get_edit_post_link( $_POST['post_ID'] ) ); 156 if ( 'post-quickpress-publish' == $_POST['action'] ) { 157 printf( __( 'Post Published. <a href="%s">View post</a> | <a href="%s">Edit post</a>' ), clean_url( $view ), $edit ); 281 158 } else { 282 $top_links[] = '<a href="' . clean_url(add_query_arg( 'edit', $widget_id )) . "#$widget_id" . '">' . __( 'Edit' ) . '</a>'; 283 } 284 } 285 286 if ( $widget_feed_link ) 287 $bottom_links[] = '<img class="rss-icon" src="' . includes_url('images/rss.png') . '" alt="' . __( 'rss icon' ) . '" /> <a href="' . clean_url( $widget_feed_link ) . '">' . __( 'RSS' ) . '</a>'; 288 289 $bottom_links = apply_filters( "wp_dashboard_widget_links_$widget_id", $bottom_links ); 290 291 // Could have put this in widget-content. Doesn't really matter 292 if ( $widget_notice ) 293 $sidebar_after_title .= "\t\t\t<div class='dashboard-widget-notice'>$widget_notice</div>\n\n"; 294 295 if ( $widget_error ) 296 $sidebar_after_title .= "\t\t\t<div class='dashboard-widget-error'>$widget_error</div>\n\n"; 297 298 $sidebar_after_title .= "\t\t\t<div class='$content_class'>\n\n"; 299 300 // Add links to widget's title bar 301 if ( $top_links ) { 302 $sidebar_before_title .= '<span>'; 303 $sidebar_after_title = '</span><small>' . join( ' | ', $top_links ) . "</small><br class='clear' />$sidebar_after_title"; 304 } 305 306 // Add links to bottom of widget 307 if ( $bottom_links ) 308 $sidebar_after_widget .= "<p class='dashboard-widget-links'>" . join( ' | ', $bottom_links ) . "</p>"; 309 310 $sidebar_after_widget .= "\t\t\t</div>\n\n"; 311 312 foreach( array_keys( $params[0] ) as $key ) 313 $$key = ${'sidebar_' . $key}; 314 315 $params[0] = compact( array_keys( $params[0] ) ); 316 317 return $params; 318 } 319 320 321 /* Dashboard Widgets */ 322 323 function wp_dashboard_quick_press( $sidebar_args ) { 324 extract( $sidebar_args, EXTR_SKIP ); 325 326 echo $before_widget; 327 328 echo $before_title; 329 echo $widget_name; 330 echo $after_title; 331 332 if ( ( 'post' === strtolower( $_SERVER['REQUEST_METHOD'] ) ) && 'post-quickpress-save-cont' === $_POST['action'] ) { 333 $post = get_post_to_edit( $_POST['post_ID'] ); 334 } else { 335 $_REQUEST = array(); // hack 336 $post = get_default_post_to_edit(); 337 } 159 printf( __( 'Draft Saved. <a href="%s">Preview post</a> | <a href="%s">Edit post</a>' ), clean_url( add_query_arg( 'preview', 1, $view ) ), $edit ); 160 $drafts_query = new WP_Query( array( 161 'post_type' => 'post', 162 'what_to_show' => 'posts', 163 'post_status' => 'draft', 164 'author' => $GLOBALS['current_user']->ID, 165 'posts_per_page' => 1, 166 'orderby' => 'modified', 167 'order' => 'DESC' 168 ) ); 169 170 if ( $drafts_query->posts ) 171 $drafts =& $drafts_query->posts; 172 } 173 $_REQUEST = array(); // hack for get_default_post_to_edit() 174 } 175 176 $post = get_default_post_to_edit(); 338 177 ?> 339 178 340 179 <form name="post" action="<?php echo clean_url( admin_url( 'post.php' ) ); ?>" method="post" id="quick-press"> 341 <h 3 id="quick-post-title"><label for="title"><?php _e('Title') ?></label></h3>180 <h4 id="quick-post-title"><label for="title"><?php _e('Title') ?></label></h4> 342 181 <div class="input-text-wrap"> 343 182 <input type="text" name="post_title" id="title" autocomplete="off" value="<?php echo attribute_escape( $post->post_title ); ?>" /> 344 183 </div> 345 184 346 <h 3><label for="content"><?php _e('Post') ?></label></h3>185 <h4><label for="content"><?php _e('Post') ?></label></h4> 347 186 <div class="textarea-wrap"> 348 187 <textarea name="content" id="quickpress-content" class="mceEditor" rows="3" cols="15"><?php echo $post->post_content; ?></textarea> 349 188 </div> 350 189 351 <h 3><label for="tags-input"><?php _e('Tags') ?></label></h3>190 <h4><label for="tags-input"><?php _e('Tags') ?></label></h4> 352 191 <div class="input-text-wrap"> 353 192 <input type="text" name="tags_input" id="tags-input" value="<?php echo get_tags_to_edit( $post->ID ); ?>" /> … … 359 198 <input type="hidden" name="quickpress_post_ID" value="<?php echo (int) $post->ID; ?>" /> 360 199 <?php wp_nonce_field('add-post'); ?> 361 <input type="submit" name="save" id="save-post" class="button " value="<?php _e('Save'); ?>" />362 <input type="submit" name=" save-cont" id="save-cont" class="button" value="<?php _e('Save and Continue'); ?>" />363 < input type="submit" name="publish" id="publish" accesskey="p" class="button button-highlighted" value="<?php _e('Publish'); ?>" />200 <input type="submit" name="save" id="save-post" class="button alignleft" value="<?php _e('Save Draft'); ?>" /> 201 <input type="submit" name="publish" id="publish" accesskey="p" class="button button-highlighted alignright" value="<?php _e('Publish'); ?>" /> 202 <br class="clear" /> 364 203 </p> 365 204 205 </form> 206 366 207 <?php 367 $drafts_query = new WP_Query( array( 368 'post_type' => 'post', 369 'what_to_show' => 'posts', 370 'post_status' => 'draft', 371 'author' => $GLOBALS['current_user']->ID, 372 'posts_per_page' => 5, 373 'orderby' => 'modified', 374 'order' => 'DESC' 375 ) ); 376 377 if ( $drafts_query->posts ) : 208 if ( $drafts ) 209 wp_dashboard_recent_drafts( $drafts ); 210 } 211 212 function wp_dashboard_recent_drafts( $drafts = false ) { 213 if ( !$drafts ) { 214 $drafts_query = new WP_Query( array( 215 'post_type' => 'post', 216 'what_to_show' => 'posts', 217 'post_status' => 'draft', 218 'author' => $GLOBALS['current_user']->ID, 219 'posts_per_page' => 5, 220 'orderby' => 'modified', 221 'order' => 'DESC' 222 ) ); 223 $drafts =& $drafts_query->posts; 224 } 225 226 if ( $drafts && is_array( $drafts ) ) : 378 227 $list = array(); 379 foreach ( $drafts _query->postsas $draft ) {228 foreach ( $drafts as $draft ) { 380 229 $url = get_edit_post_link( $draft->ID ); 381 230 $title = _draft_or_post_title( $draft->ID ); … … 383 232 } 384 233 ?> 385 386 <h3><?php _e('Recent Drafts'); ?></h3> 387 <p id='recent-drafts'> 388 <?php echo join( ', ', $list ); ?> 389 </p> 234 <ul> 235 <li><?php echo join( "</li>\n<li>", $list ); ?></li> 236 </ul> 390 237 391 238 <?php 392 239 393 240 endif; // drafts 394 241 } 242 243 /** 244 * Display recent comments dashboard widget content. 245 * 246 * @since unknown 247 */ 248 function wp_dashboard_recent_comments() { 249 list($comments, $total) = _wp_get_comment_list( '', false, 0, 5 ); 250 251 if ( $comments ) : 395 252 ?> 396 253 397 </form> 254 <p class="view-all"><a href="edit-comments.php"><?php _e( 'View All Comments' ); ?></a></p> 255 <div id="the-comment-list" class="list:comment"> 398 256 399 257 <?php 400 401 echo $after_widget; 402 } 403 404 function wp_dashboard_quick_press_js() { 258 foreach ( $comments as $comment ) 259 _wp_dashboard_recent_comments_row( $comment ); 405 260 ?> 406 261 407 <script type="text/javascript"> 408 /* <![CDATA[ */ 409 var quickPressLoad = function($) { 410 var act = $('#quickpost-action'); 411 var t = $('#quick-press').submit( function() { 412 if ( 'post-quickpress-save-cont' == act.val() ) { 413 return true; 414 } 415 416 var head = $('#dashboard_quick_press div.dashboard-widget').children( 'div').hide().end().find('h3 small'); 417 head.prepend( '<img src="images/loading.gif" style="margin: 0 6px 0 0; vertical-align: middle" />' ); 418 419 if ( 'post' == act.val() ) { act.val( 'post-quickpress-publish' ); } 420 421 if ( 'undefined' != typeof tinyMCE ) { 422 tinyMCE.get('quickpress-content').save(); 423 tinyMCE.get('quickpress-content').remove(); 424 } 425 426 $('#dashboard_quick_press').load( t.attr( 'action' ) + ' #dashboard_quick_press > *', t.serializeArray(), function() { 427 if ( 'undefined' != typeof wpTeenyMCEInit && $.isFunction( wpTeenyMCEInit ) ) { wpTeenyMCEInit(); } 428 quickPressLoad($); 429 } ); 430 return false; 431 } ); 432 433 $('#publish').click( function() { act.val( 'post-quickpress-publish' ); } ); 434 $('#save-cont').click( function() { act.val( 'post-quickpress-save-cont' ); t.attr( 'action', 'post.php' ); } ); 435 }; 436 jQuery( quickPressLoad ); 437 /* ]]> */ 438 </script> 262 </div> 263 439 264 <?php 440 } 441 442 /** 443 * Display recent comments dashboard widget content. 444 * 445 * @since unknown 446 * 447 * @param unknown_type $sidebar_args 448 */ 449 function wp_dashboard_recent_comments( $sidebar_args ) { 450 global $comment; 451 extract( $sidebar_args, EXTR_SKIP ); 452 453 echo $before_widget; 454 455 echo $before_title; 456 echo $widget_name; 457 echo $after_title; 458 459 $lambda = create_function( '', 'return 5;' ); 460 add_filter( 'option_posts_per_rss', $lambda ); // hack - comments query doesn't accept per_page parameter 461 $comments_query = new WP_Query(array('feed' => 'rss2', 'withcomments' => 1)); 462 remove_filter( 'option_posts_per_rss', $lambda ); 463 464 $is_first = true; 465 466 if ( $comments_query->have_comments() ) { 467 while ( $comments_query->have_comments() ) { $comments_query->the_comment(); 468 469 $comment_post_url = get_permalink( $comment->comment_post_ID ); 470 $comment_post_title = get_the_title( $comment->comment_post_ID ); 471 $comment_post_link = "<a href='$comment_post_url'>$comment_post_title</a>"; 472 $comment_link = '<a class="comment-link" href="' . get_comment_link() . '">#</a>'; 473 $comment_meta = sprintf( __( 'From <strong>%1$s</strong> on %2$s %3$s' ), get_comment_author(), $comment_post_link, $comment_link ); 474 475 if ( $is_first ) : $is_first = false; 265 wp_comment_reply( -1, false, 'dashboard', false ); 266 267 else : 476 268 ?> 477 <blockquote><p>“<?php comment_excerpt(); ?>”</p></blockquote> 478 <p class='comment-meta'><?php echo $comment_meta; ?></p> 269 270 <p><?php _e( 'No comments yet.' ); ?></p> 271 479 272 <?php 480 if ( $comments_query->comment_count > 1 ) : ?> 481 <ul id="dashboard-comments-list"> 273 endif; // $comments; 274 } 275 276 function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) { 277 static $date = false; 278 static $today = false; 279 static $yesterday = false; 280 281 $GLOBALS['comment'] =& $comment; 282 283 if ( $show_date ) { 284 if ( !$today ) 285 $today = gmdate( get_option( 'date_format' ), time() + get_option( 'gmt_offset' ) ); 286 if ( !$yesterday ) 287 $yesterday = gmdate( get_option( 'date_format' ), strtotime( 'yesterday' ) + get_option( 'gmt_offset' ) ); 288 $wordy_dates = array( $today => __( 'Today' ), $yesterday => __( 'Yesterday' ) ); 289 290 $comment_date = gmdate( get_option( 'date_format' ), strtotime( $comment->comment_date ) + get_option( 'gmt_offset' ) ); 291 if ( $comment_date != $date ) { 292 $date = $comment_date; 293 echo '<h4>' . ( isset( $wordy_dates[$date] ) ? $wordy_dates[$date] : $date ) . ":</h4>\n"; 294 } 295 } 296 297 $comment_post_url = get_permalink( $comment->comment_post_ID ); 298 $comment_post_title = get_the_title( $comment->comment_post_ID ); 299 $comment_post_link = "<a href='$comment_post_url'>$comment_post_title</a>"; 300 $comment_link = '<a class="comment-link" href="' . get_comment_link() . '">#</a>'; 301 302 $delete_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) ); 303 $approve_url = clean_url( wp_nonce_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "approve-comment_$comment->comment_ID" ) ); 304 $unapprove_url = clean_url( wp_nonce_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "unapprove-comment_$comment->comment_ID" ) ); 305 $spam_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) ); 306 307 $actions = array(); 308 309 if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 310 $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>'; 311 $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>'; 312 $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>'; 313 $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>'; 314 $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>'; 315 $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>'; 316 317 $actions = apply_filters( 'comment_row_actions', $actions, $comment ); 318 319 $i = 0; 320 $actions_string = ''; 321 foreach ( $actions as $action => $link ) { 322 ++$i; 323 ( ( ('approve' == $action || 'unapprove' == $action) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | '; 324 325 // Reply and quickedit need a hide-if-no-js span 326 if ( 'reply' == $action || 'quickedit' == $action ) 327 $action .= ' hide-if-no-js'; 328 329 $actions_string .= "<span class='$action'>$sep$link</span>"; 330 } 331 } 332 333 ?> 334 335 <div id="comment-<?php echo $comment->comment_ID; ?>" <?php comment_class( array( 'comment-item', wp_get_comment_status() ) ); ?>> 336 <?php if ( !$comment->comment_type || 'comment' == $comment->comment_type ) : ?> 337 338 <?php echo get_avatar( $comment, 32 ); ?> 339 <span class="comment-meta"><?php printf( __( '%1$s in response to %2$s:' ), '<cite>' . get_comment_author() . '</cite>', $comment_post_link ); ?></span> 340 341 <?php 342 else : 343 switch ( $comment->comment_type ) : 344 case 'pingback' : 345 $type = __( 'Pingback' ); 346 break; 347 case 'trackback' : 348 $type = __( 'Trackback' ); 349 break; 350 default : 351 $type = ucwords( $comment->comment_type ); 352 endswitch; 353 $type = wp_specialchars( $type ); 354 ?> 355 356 <span class="comment-meta"><?php printf( __( '%3$s on %2$s: %1$s' ), '<cite>' . get_comment_author() . '</cite>', $comment_post_link, "<strong>$type</strong>" ); ?></span> 357 358 <?php endif; // comment_type ?> 359 <blockquote><p><?php comment_excerpt(); ?></p></blockquote> 360 <p class="comment-actions"><?php echo $actions_string; ?></p> 361 </div> 482 362 <?php 483 endif; // comment_count 484 else : // is_first 485 ?> 486 487 <li class='comment-meta'><?php echo $comment_meta; ?></li> 488 <?php 489 endif; // is_first 490 } 491 492 if ( $comments_query->comment_count > 1 ) : ?> 493 </ul> 494 <?php 495 endif; // comment_count; 496 497 } 498 499 echo $after_widget; 363 } 364 365 function wp_dashboard_incoming_links() { 366 wp_dashboard_cached_rss_widget( 'dashboard_incoming_links', 'wp_dashboard_incoming_links_output' ); 500 367 } 501 368 502 369 /** 503 370 * Display incoming links dashboard widget content. 504 *505 * $sidebar_args are handled by wp_dashboard_empty().506 371 * 507 372 * @since unknown … … 566 431 } 567 432 433 function wp_dashboard_incoming_links_control() { 434 wp_dashboard_rss_control( 'dashboard_incoming_links', array( 'title' => false, 'show_summary' => false, 'show_author' => false ) ); 435 } 436 437 function wp_dashboard_primary() { 438 wp_dashboard_cached_rss_widget( 'dashboard_primary', 'wp_dashboard_rss_output' ); 439 } 440 441 function wp_dashboard_primary_control() { 442 wp_dashboard_rss_control( 'dashboard_primary' ); 443 } 444 568 445 /** 569 446 * {@internal Missing Short Description}} 570 *571 * $sidebar_args are handled by wp_dashboard_empty().572 447 * 573 448 * @since unknown … … 580 455 } 581 456 457 function wp_dashboard_secondary() { 458 wp_dashboard_cached_rss_widget( 'dashboard_secondary', 'wp_dashboard_secondary_output' ); 459 } 460 461 function wp_dashboard_secondary_control() { 462 wp_dashboard_rss_control( 'dashboard_secondary', array( 'show_summary' => false, 'show_author' => false, 'show_date' => false ) ); 463 } 464 582 465 /** 583 466 * Display secondary dashboard RSS widget feed. 584 *585 * $sidebar_args are handled by wp_dashboard_empty().586 467 * 587 468 * @since unknown … … 610 491 } 611 492 493 function wp_dashboard_plugins() { 494 wp_dashboard_cached_rss_widget( 'dashboard_plugins', 'wp_dashboard_plugins_output', array( 495 'http://wordpress.org/extend/plugins/rss/browse/popular/', 496 'http://wordpress.org/extend/plugins/rss/browse/new/', 497 'http://wordpress.org/extend/plugins/rss/browse/updated/' 498 ) ); 499 } 500 612 501 /** 613 502 * Display plugins most popular, newest plugins, and recently updated widget text. 614 *615 * $sidebar_args are handled by wp_dashboard_empty().616 503 * 617 504 * @since unknown … … 714 601 } 715 602 716 /** 717 * Empty widget used for JS/AJAX created output. 718 * 719 * Callback inserts content between before_widget and after_widget. Used when 720 * widget is in edit mode. Can also be used for custom widgets. 721 * 722 * @since unknown 723 * 724 * @param array $sidebar_args 725 * @param callback $callback Optional. Only used in edit mode. 726 */ 727 function wp_dashboard_empty( $sidebar_args, $callback = false ) { 728 extract( $sidebar_args, EXTR_SKIP ); 729 730 echo $before_widget; 731 732 echo $before_title; 733 echo $widget_name; 734 echo $after_title; 735 736 // When in edit mode, the callback passed to this function is the widget_control callback 737 if ( $callback && is_callable( $callback ) ) { 738 $args = array_slice( func_get_args(), 2 ); 739 array_unshift( $args, $widget_id ); 740 call_user_func_array( $callback, $args ); 741 } 742 743 echo $after_widget; 744 } 745 746 /* Dashboard Widgets Controls. See also wp_dashboard_empty() */ 603 /* Dashboard Widgets Controls */ 747 604 748 605 // Temp … … 760 617 */ 761 618 function wp_dashboard_trigger_widget_control( $widget_control_id = false ) { 762 global $wp_registered_widget_controls; 763 if ( is_scalar($widget_control_id) && $widget_control_id && isset($wp_registered_widget_controls[$widget_control_id]) && is_callable($wp_registered_widget_controls[$widget_control_id]['callback']) ) 764 call_user_func_array( $wp_registered_widget_controls[$widget_control_id]['callback'], $wp_registered_widget_controls[$widget_control_id]['params'] ); 619 global $wp_dashboard_control_callbacks; 620 621 if ( is_scalar($widget_control_id) && $widget_control_id && isset($wp_dashboard_control_callbacks[$widget_control_id]) && is_callable($wp_dashboard_control_callbacks[$widget_control_id]) ) { 622 call_user_func( $wp_dashboard_control_callbacks[$widget_control_id], '', array( 'id' => $widget_control_id, 'callback' => $wp_dashboard_control_callbacks[$widget_control_id] ) ); 623 } 765 624 } 766 625 … … 773 632 * @since unknown 774 633 * 775 * @param array $args Expects 'widget_id' and 'form_inputs'. 776 * @return bool|null False if no widget_id is given. Null on success. 777 */ 778 function wp_dashboard_rss_control( $args ) { 779 extract( $args ); 780 if ( !$widget_id ) 781 return false; 782 634 * @param string widget_id 635 * @param array form_inputs 636 */ 637 function wp_dashboard_rss_control( $widget_id, $form_inputs = array() ) { 783 638 if ( !$widget_options = get_option( 'dashboard_widget_options' ) ) 784 639 $widget_options = array(); -
trunk/wp-admin/includes/post.php
r9064 r9103 820 820 */ 821 821 function postbox_classes( $id, $page ) { 822 if ( isset( $_GET['edit'] ) && $_GET['edit'] == $id ) 823 return ''; 822 824 $current_user = wp_get_current_user(); 823 825 if ( $closed = get_usermeta( $current_user->ID, 'closedpostboxes_'.$page ) ) { -
trunk/wp-admin/includes/template.php
r9098 r9103 2059 2059 * @param unknown_type $mode 2060 2060 */ 2061 function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single' ) {2061 function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single', $table_row = true) { 2062 2062 global $current_user; 2063 2063 … … 2070 2070 } 2071 2071 ?> 2072 <form method="get" action=""><table style="display:none;"><tbody id="com-reply"> 2073 <tr id="replyrow"><td colspan="6"> 2072 <form method="get" action=""> 2073 <?php if ( $table_row ) : ?> 2074 <table style="display:none;"><tbody id="com-reply"><tr id="replyrow"><td colspan="6"> 2075 <?php else : ?> 2076 <div id="com-reply" style="display:none;"><div id="replyrow"> 2077 <?php endif; ?> 2074 2078 <div id="replyhead" style="display:none;"><?php _e('Reply to Comment'); ?></div> 2075 2079 … … 2115 2119 <?php wp_nonce_field( 'replyto-comment', '_ajax_nonce', false ); ?> 2116 2120 <?php wp_comment_form_unfiltered_html_nonce(); ?> 2117 </td></tr> 2118 </tbody></table></form> 2121 <?php if ( $table_row ) : ?> 2122 </td></tr></tbody></table></form> 2123 <?php else : ?> 2124 </div></div> 2125 <?php endif; ?> 2119 2126 <?php 2120 2127 } … … 2644 2651 * @param unknown_type $context 2645 2652 * @param unknown_type $object 2646 * @return unknown2653 * @return int number of meta_boxes 2647 2654 */ 2648 2655 function do_meta_boxes($page, $context, $object) { -
trunk/wp-admin/index-extra.php
r8618 r9103 20 20 switch ( $_GET['jax'] ) { 21 21 22 case ' incominglinks' :22 case 'dashboard_incoming_links' : 23 23 wp_dashboard_incoming_links_output(); 24 24 break; 25 25 26 case 'd evnews' :26 case 'dashboard_primary' : 27 27 wp_dashboard_rss_output( 'dashboard_primary' ); 28 28 break; 29 29 30 case ' planetnews' :30 case 'dashboard_secondary' : 31 31 wp_dashboard_secondary_output(); 32 32 break; 33 33 34 case ' plugins' :34 case 'dashboard_plugins' : 35 35 wp_dashboard_plugins_output(); 36 36 break; -
trunk/wp-admin/index.php
r8691 r9103 15 15 wp_dashboard_setup(); 16 16 17 /** 18 * Display dashboard widget custom JavaScript. 19 * 20 * @since unknown 21 */ 22 function index_js() { 23 ?> 24 <script type="text/javascript"> 25 jQuery(function($) { 26 var ajaxWidgets = { 27 dashboard_incoming_links: 'incominglinks', 28 dashboard_primary: 'devnews', 29 dashboard_secondary: 'planetnews', 30 dashboard_plugins: 'plugins' 31 }; 32 $.each( ajaxWidgets, function(i,a) { 33 var e = jQuery('#' + i + ' div.dashboard-widget-content').not('.dashboard-widget-control').find('.widget-loading'); 34 if ( e.size() ) { e.parent().load('index-extra.php?jax=' + a); } 35 } ); 36 }); 37 </script> 38 <?php 39 } 40 add_action( 'admin_head', 'index_js' ); 41 42 wp_enqueue_script( 'jquery' ); 17 wp_enqueue_script( 'dashboard' ); 43 18 wp_enqueue_script( 'plugin-install' ); 44 19 wp_admin_css( 'dashboard' ); … … 53 28 ?> 54 29 30 <div id="edit-settings-wrap" class="hidden"> 31 <h5><?php _e('Show on screen') ?></h5> 32 <form id="adv-settings" action="" method="get"> 33 <div class="metabox-prefs"> 34 <?php meta_box_prefs('dashboard') ?> 35 <br class="clear" /> 36 </div></form> 37 </div> 38 55 39 <div class="wrap"> 56 40 <div id="dashboard-widgets-wrap"> -
trunk/wp-admin/js/postbox.js
r8889 r9103 1 2 1 (function($) { 3 2 postboxes = { 4 add_postbox_toggles : function(page ) {3 add_postbox_toggles : function(page,args) { 5 4 $('.postbox h3').before('<a class="togbox">+</a> '); 6 5 $('.postbox h3, .postbox a.togbox').click( function() { … … 8 7 postboxes.save_state(page); 9 8 }); 9 $('.postbox h3 a').click( function(e) { 10 e.stopPropagation(); 11 } ); 10 12 11 13 $('.hide-postbox-tog').click( function() { 12 14 var box = jQuery(this).val(); 13 var show = jQuery(this).attr('checked'); 14 if ( show ) { 15 if ( jQuery(this).attr('checked') ) { 15 16 jQuery('#' + box).show(); 17 if ( $.isFunction( postboxes.onShow ) ) { 18 postboxes.onShow( box ); 19 } 16 20 } else { 17 21 jQuery('#' + box).hide(); … … 27 31 $('#wpbody-content').css( 'overflow', 'hidden' ); 28 32 29 this.init(page );33 this.init(page,args); 30 34 }, 31 35 … … 40 44 }, 41 45 42 init : function(page) { 46 init : function(page,args) { 47 $.extend( this, args || {} ); 43 48 jQuery('.meta-box-sortables').sortable( { 44 49 connectWith: [ '.meta-box-sortables' ], … … 84 89 page: page 85 90 }); 86 } 91 }, 92 93 /* Callbacks */ 94 onShow : false 87 95 }; 88 96 -
trunk/wp-admin/post.php
r8995 r9103 87 87 case 'post-quickpress-publish': 88 88 case 'post-quickpress-save': 89 case 'post-quickpress-save-cont':90 89 check_admin_referer('add-post'); 91 90 … … 105 104 } 106 105 107 if ( 'post-quickpress-save-cont' != $action &&0 === strpos( $action, 'post-quickpress' ) ) {106 if ( 0 === strpos( $action, 'post-quickpress' ) ) { 108 107 $_POST['post_ID'] = $post_ID; 109 108 // output the quickpress dashboard widget 110 109 require_once(ABSPATH . 'wp-admin/includes/dashboard.php'); 111 add_filter( 'wp_dashboard_widgets', create_function( '$a', 'return array( "dashboard_quick_press" );' ) ); 112 wp_dashboard_setup(); 113 wp_dashboard(); 110 wp_dashboard_quick_press(); 114 111 exit; 115 112 } -
trunk/wp-admin/press-this.php
r9079 r9103 421 421 <input type="hidden" name="post_type" id="post_type" value="text"/> 422 422 423 <div id="poststuff" >423 <div id="poststuff" class="metabox-holder"> 424 424 <div id="side-info-column"> 425 425 <div class="sleeve"> -
trunk/wp-admin/wp-admin.css
r9099 r9103 1223 1223 } 1224 1224 1225 #poststuff h3 {1225 #poststuff h3, .metabox-holder h3 { 1226 1226 font-size: 14px; 1227 1227 font-weight: bold; … … 1230 1230 } 1231 1231 1232 #poststuff .postbox, #poststuff .stuffbox {1232 .metabox-holder .postbox, #poststuff .postbox, #poststuff .stuffbox { 1233 1233 padding: 2px; 1234 1234 margin-bottom: 20px; … … 1369 1369 } 1370 1370 1371 #poststuff .togbox {1371 .metabox-holder .togbox, #poststuff .togbox { 1372 1372 background-position: -10px 16px; 1373 1373 background-repeat: no-repeat; … … 1389 1389 } 1390 1390 1391 #poststuff .closed .inside {1391 .metabox-holder .closed .inside, #poststuff .closed .inside { 1392 1392 display: none; 1393 1393 } 1394 1394 1395 #poststuff .closed h3 {1396 margin: 0; 1397 } 1398 1399 #poststuff .closed .togbox {1395 .metabox-holder .closed h3, #poststuff .closed h3 { 1396 margin: 0; 1397 } 1398 1399 .metabox-holder .closed .togbox, #poststuff .closed .togbox { 1400 1400 background-position: 4px 15px; 1401 1401 } … … 2126 2126 } 2127 2127 2128 .metabox-prefs label a { 2129 display: none; 2130 } 2128 2131 2129 2132 /* Inline Editor */ -
trunk/wp-includes/script-loader.php
r9098 r9103 280 280 281 281 $scripts->add( 'settings-box', '/wp-admin/js/settings-box.js', array( 'jquery' ), '20080925' ); 282 283 $scripts->add( 'dashboard', '/wp-admin/js/dashboard.js', array( 'jquery', 'admin-comments', 'postbox', 'settings-box' ), '20081008' ); 282 284 } 283 285 } … … 310 312 $rtl_styles = array( 'global', 'colors', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets', 'press-this', 'press-this-ie' ); 311 313 312 $styles->add( 'wp-admin', '/wp-admin/wp-admin.css', array(), '2008100 1' );314 $styles->add( 'wp-admin', '/wp-admin/wp-admin.css', array(), '20081008' ); 313 315 $styles->add_data( 'wp-admin', 'rtl', '/wp-admin/rtl.css' ); 314 316 … … 323 325 $styles->add( 'media', '/wp-admin/css/media.css', array(), '20080709' ); 324 326 $styles->add( 'widgets', '/wp-admin/css/widgets.css' ); 325 $styles->add( 'dashboard', '/wp-admin/css/dashboard.css', array(), '2008100 1' );327 $styles->add( 'dashboard', '/wp-admin/css/dashboard.css', array(), '20081008' ); 326 328 $styles->add( 'install', '/wp-admin/css/install.css', array(), '20080708' ); 327 329 $styles->add( 'theme-editor', '/wp-admin/css/theme-editor.css' );
Note: See TracChangeset
for help on using the changeset viewer.