Changeset 8834

Show
Ignore:
Timestamp:
09/06/08 06:10:38 (3 months ago)
Author:
azaozz
Message:

Few sidebar.php updates, functionality and look similar to the quick-post dashboard widget

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/post.php

    r8832 r8834  
    3535        $location = $_POST['referredby']; 
    3636    } elseif ( !empty($_POST['mode']) && 'sidebar' == $_POST['mode'] ) { 
    37         $location = 'sidebar.php?a=b'; 
     37        if ( isset($_POST['saveasdraft']) ) 
     38            $location = 'sidebar.php?a=c'; 
     39        elseif ( isset($_POST['publish']) ) 
     40            $location = 'sidebar.php?a=b'; 
    3841    } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) { 
    3942        if ( $_POST['_wp_original_http_referer'] && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post.php') === false && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post-new.php') === false ) 
  • trunk/wp-admin/sidebar.php

    r8674 r8834  
    1919    wp_die(__('Cheatin’ uh?')); 
    2020 
    21 if ('b' == $_GET['a']) { 
    22  
    23 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    24 <html xmlns="http://www.w3.org/1999/xhtml"> 
    25 <head> 
    26 <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=UTF-8" /> 
    27 <title><?php _e('WordPress &#8250; Posted'); ?></title> 
    28 <?php 
    29 wp_admin_css( 'global', true ); 
    30 wp_admin_css( 'wp-admin', true ); 
    31 wp_admin_css( 'colors', true ); 
    32 ?> 
    33 </head> 
    34 <body> 
    35     <p><?php _e('Posted !'); ?></p> 
    36     <p><?php printf(__('<a href="%s">Click here</a> to post again.'), 'sidebar.php'); ?></p> 
    37 </body> 
    38 </html><?php 
    39  
    40 } else { 
     21$post = get_default_post_to_edit(); 
    4122 
    4223?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     
    4425<head> 
    4526<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('blog_charset'); ?>" /> 
    46 <title><?php _e('WordPress &#8250; Sidebar'); ?></title> 
    47 <?php 
    48 wp_admin_css( 'global', true ); 
    49 wp_admin_css( 'wp-admin', true ); 
    50 wp_admin_css( 'colors', true ); 
    51 ?> 
     27<title><?php bloginfo('name') ?> &rsaquo; <?php _e('Sidebar'); ?></title> 
    5228<style type="text/css" media="screen"> 
     29body { 
     30    font-size: 0.9em; 
     31    margin: 0; 
     32    padding: 0; 
     33} 
    5334form { 
    54     padding: 3px
     35    padding: 1%
    5536} 
    56 .sidebar-categories { 
    57     display: block; 
    58     height: 6.6em; 
    59     overflow: auto; 
    60     background-color: #f4f4f4; 
     37.tags-wrap p { 
     38    font-size: 0.75em; 
     39    margin-top: 0.4em; 
    6140} 
    62 .sidebar-categories label { 
    63     font-size: 10px; 
    64     display: block; 
    65     width: 90%; 
     41.button-highlighted, #wphead, label { 
     42    font-weight: bold; 
     43
     44#post-title, #tags-input, #content { 
     45    width: 99%; 
     46    padding: 2px; 
     47
     48#wphead { 
     49    font-size: 1.4em; 
     50    background-color: #E4F2FD; 
     51    color: #555555; 
     52    padding: 0.2em 1%; 
     53
     54#wphead p { 
     55    margin: 3px; 
     56
     57.button { 
     58    font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; 
     59    padding: 3px 5px; 
     60    margin-right: 5px; 
     61    font-size: 0.75em; 
     62    line-height: 1.5em; 
     63    border: 1px solid #80b5d0; 
     64    -moz-border-radius: 3px; 
     65    -khtml-border-radius: 3px; 
     66    -webkit-border-radius: 3px; 
     67    border-radius: 3px; 
     68    cursor: pointer; 
     69    background-color: #e5e5e5; 
     70    color: #246; 
     71
     72.button:hover { 
     73    border-color: #535353; 
     74
     75.updated { 
     76    background-color: #FFFBCC; 
     77    border: 1px solid #E6DB55; 
     78    margin-bottom: 1em; 
     79    padding: 0 0.6em; 
     80
     81.updated p { 
     82    margin: 0.6em; 
    6683} 
    6784</style> 
    6885</head> 
    6986<body id="sidebar"> 
    70 <h1 id="wphead"><a href="http://wordpress.org/" rel="external">WordPress</a></h1
     87<div id="wphead"><p><?php bloginfo('name') ?> &rsaquo; <?php _e('Sidebar'); ?></p></div
    7188<form name="post" action="post.php" method="post"> 
    7289<div> 
     
    7491<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" /> 
    7592<input type="hidden" name="mode" value="sidebar" /> 
    76 <?php wp_nonce_field('add-post'); ?> 
    77 <p><label for="post_title"><?php _e('Title:'); ?></label> 
    78 <input type="text" name="post_title" id="post_title" size="20" tabindex="1" style="width: 100%;" /> 
     93<input type="hidden" name="ping_status" value="<?php echo $post->ping_status; ?>" /> 
     94<input type="hidden" name="comment_status" value="<?php echo $post->comment_status; ?>" /> 
     95<?php wp_nonce_field('add-post'); 
     96 
     97if ( 'b' == $_GET['a'] ) 
     98    echo '<div class="updated"><p>' . __('Post published.') . '</p></div>'; 
     99elseif ( 'c' == $_GET['a'] ) 
     100    echo '<div class="updated"><p>' . __('Post saved.') . '</p></div>'; 
     101?> 
     102<p> 
     103<label for="post-title"><?php _e('Title:'); ?></label> 
     104<input type="text" name="post_title" id="post-title" size="20" tabindex="1" autocomplete="off" value="" /> 
    79105</p> 
    80 <p><?php _e('Categories:'); ?> 
    81 <span class="sidebar-categories"
    82 <?php dropdown_categories(); ?
    83 </span
     106 
     107<p
     108<label for="content"><?php _e('Post:'); ?></label
     109<textarea rows="8" cols="12" name="content" id="content" style="height:10em;line-height:1.4em;" tabindex="2"></textarea
    84110</p> 
     111 
     112<div class="tags-wrap"> 
     113<label for="tags-input"><?php _e('Tags:') ?></label> 
     114<input type="text" name="tags_input" id="tags-input" tabindex="3" value="" /> 
     115<p><?php _e('Separate tags with commas'); ?></p> 
     116</div> 
     117 
    85118<p> 
    86 <label for="content">Post:</label> 
    87 <textarea rows="8" cols="12" style="width: 100%" name="content" id="content" tabindex="2"></textarea> 
    88 </p> 
    89 <p> 
    90     <input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="<?php _e('Save as Draft'); ?>" /> 
     119<input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" accesskey="s" class="button" value="<?php _e('Save as Draft'); ?>" /> 
    91120<?php if ( current_user_can('publish_posts') ) : ?> 
    92    <input name="publish" type="submit" id="publish" tabindex="6" value="<?php _e('Publish') ?>" class="button button-highlighted" /> 
     121<input name="publish" type="submit" id="publish" tabindex="6" accesskey="p" value="<?php _e('Publish') ?>" class="button button-highlighted" /> 
    93122<?php endif; ?> 
    94123</p> 
     
    98127</body> 
    99128</html> 
    100 <?php 
    101 } 
    102 ?>