diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-10-12 16:21:15 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-10-12 16:21:15 +0000 |
commit | 3a4570b0fc8b3d6339bef71d17d7701554e0bbf7 (patch) | |
tree | 2a06e5261263c68d8afd95a6328879dc289cb909 /wp-admin/post-new.php | |
parent | b83c34a7010faee0223f6037025c350da12e05e6 (diff) | |
download | wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.tar.gz wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.tar.xz wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.zip |
Merge with WP 2.3 - testing use only!
Move pluggable functions out of wpmu-functions and into pluggable.php, fixes #439
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1069 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/post-new.php')
-rw-r--r-- | wp-admin/post-new.php | 87 |
1 files changed, 59 insertions, 28 deletions
diff --git a/wp-admin/post-new.php b/wp-admin/post-new.php index fd8a046..c6b709b 100644 --- a/wp-admin/post-new.php +++ b/wp-admin/post-new.php @@ -10,7 +10,7 @@ require_once ('./admin-header.php'); if ( ! current_user_can('edit_posts') ) { ?> <div class="wrap"> -<p><?php printf(__('Since you’re a newcomer, you’ll have to wait for an admin to raise your level to 1, in order to be authorized to post.<br /> +<p><?php printf(__('Since you’re a newcomer, you’ll have to wait for an admin to add the <code>edit_posts</code> capability to your user, in order to be authorized to post.<br /> You can also <a href="mailto:%s?subject=Promotion?">e-mail the admin</a> to ask for a promotion.<br /> When you’re promoted, just reload this page and you’ll be able to blog. :)'), get_option('admin_email')); ?> </p> @@ -21,34 +21,65 @@ When you’re promoted, just reload this page and you’ll be able to bl } if ( isset($_GET['posted']) && $_GET['posted'] ) : ?> -<div id="message" class="updated fade"><p><strong><?php _e('Post saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View post'); ?> »</a></p></div> +<div id="message" class="updated fade"><p><strong><?php _e('Post saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View post »'); ?></a></p></div> <?php endif; +?> -if ( $drafts = get_users_drafts( $user_ID ) ) { ?> -<div class="wrap"> -<p><strong><?php _e('Your Drafts:') ?></strong> -<?php -// Show drafts. - $num_drafts = count($drafts); - if ( $num_drafts > 15 ) $num_drafts = 15; - for ( $i = 0; $i < $num_drafts; $i++ ) { - $draft = $drafts[$i]; - if ( 0 != $i ) - echo ', '; - if ( empty($draft->post_title) ) - $draft->post_title = sprintf(__('Post # %s'), $draft->ID); - echo "<a href='post.php?action=edit&post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>"; - } - if ( 15 < count($drafts) ) { ?> - , <a href="edit.php"><?php echo sprintf(__('and %s more'), (count($drafts) - 15) ); ?> »</a> - <?php } ?> -.</p> -</div> <?php +$my_drafts = get_users_drafts($user_ID); +$pending = get_others_pending($user_ID); +$others_drafts = get_others_drafts($user_ID); + +$nag_posts_limit = (int) apply_filters('nag_posts_limit', 3); + +$nag_posts = array( + array( + 'my_drafts', + __('Your Drafts:'), + 'edit.php?post_status=draft&author=' . $user_ID, + count($my_drafts)), + array( + 'pending', + __('Pending Review:'), + 'edit.php?post_status=pending', + count($pending)), + array( + 'others_drafts', + __('Others’ Drafts:'), + 'edit.php?post_status=draft&author=-' . $user_ID, + count($others_drafts)) + ); + +if ( !empty($my_drafts) || !empty($pending) || !empty($others_drafts) ) { + echo '<div class="wrap" id="draft-nag">'; + + foreach ( $nag_posts as $nag ) { + if ( ${$nag[0]} ) { + echo '<p><strong>' . wp_specialchars($nag[1]) . '</strong> '; + $i = 0; + foreach ( ${$nag[0]} as $post ) { + $i++; + if ( $i > $nag_posts_limit ) + break; + echo '<a href="post.php?action=edit&post=' . $post->ID . '">'; + ( '' == the_title('', '', FALSE) ) ? printf( __('Post #%s'), $post->ID ) : the_title(); + echo '</a>'; + if ( $i < min($nag[3], $nag_posts_limit) ) + echo ', '; + } + if ( $nag[3] > $nag_posts_limit ) + printf(__(', and <a href="%s">%d more</a>'), $nag[2], $nag[3] - $nag_posts_limit); + echo '.</p>'; + } + } + echo "</div>\n"; } +?> + +<?php // Show post form. $post = get_default_post_to_edit(); include('edit-form-advanced.php'); @@ -57,17 +88,17 @@ include('edit-form-advanced.php'); <?php if ( $is_NS4 || $is_gecko || $is_winIE ) { ?> <div id="wp-bookmarklet" class="wrap"> <h3><?php _e('WordPress Bookmarklet'); ?></h3> -<p><?php _e('Right click on the following link and choose "Add to favorites" to create a posting shortcut.'); ?></p> +<p><?php _e('Right click on the following link and choose “Bookmark This Link...” or “Add to Favorites...” to create a posting shortcut.'); ?></p> <p> <?php if ($is_NS4 || $is_gecko) { ?> -<a href="javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}location.href='<?php echo get_option('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&popupurl='+encodeURIComponent(location.href)+'&popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press It - %s'), wp_specialchars(get_option('blogname'))); ?></a> +<a href="javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}location.href='<?php echo get_option('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&popupurl='+encodeURIComponent(location.href)+'&popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press It - %s'), get_bloginfo('name', 'display')); ?></a> <?php } else if ($is_winIE) { ?> -<a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;location.href='<?php echo get_option('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&popupurl='+encodeURIComponent(location.href)+'&popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press it - %s'), get_option('blogname')); ?></a> +<a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;location.href='<?php echo get_option('siteurl') ?>/wp-admin/post-new.php?text='+encodeURIComponent(Q)+'&popupurl='+encodeURIComponent(location.href)+'&popuptitle='+encodeURIComponent(document.title);"><?php printf(__('Press it - %s'), get_bloginfo('name', 'display')); ?></a> <script type="text/javascript"> <!-- function oneclickbookmarklet(blah) { @@ -78,15 +109,15 @@ window.open ("profile.php?action=IErightclick", "oneclickbookmarklet", "width=50 <br /> <br /> <?php _e('One-click bookmarklet:') ?><br /> -<a href="javascript:oneclickbookmarklet(0);"><?php _e('click here') ?></a> +<a href="javascript:oneclickbookmarklet(0);"><?php _e('click here') ?></a> <?php } else if ($is_opera) { ?> -<a href="javascript:location.href='<?php echo get_option('siteurl'); ?>/wp-admin/post-new.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_option('blogname')); ?></a> +<a href="javascript:location.href='<?php echo get_option('siteurl'); ?>/wp-admin/post-new.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_option('blogname')); ?></a> <?php } else if ($is_macIE) { ?> -<a href="javascript:Q='';location.href='<?php echo get_option('siteurl'); ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_option('blogname')); ?></a> +<a href="javascript:Q='';location.href='<?php echo get_option('siteurl'); ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title);"><?php printf(__('Press it - %s'), get_option('blogname')); ?></a> <?php } ?> |