[ Index ]

PHP Cross Reference of Wordpress 2.9.1

title

Body

[close]

/wp-admin/ -> sidebar.php (source)

   1  <?php
   2  /**
   3   * Quick way to create a WordPress Post.
   4   *
   5   * @package WordPress
   6   * @subpackage Administration
   7   */
   8  
   9  /**
  10   * @var string
  11   * @name $mode
  12   */
  13  $mode = 'sidebar';
  14  
  15  /** WordPress Administration Bootstrap */
  16  require_once ('admin.php');
  17  
  18  if ( ! current_user_can('edit_posts') )
  19      wp_die(__('Cheatin&#8217; uh?'));
  20  
  21  $post = get_default_post_to_edit();
  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=<?php bloginfo('blog_charset'); ?>" />
  27  <title><?php bloginfo('name') ?> &rsaquo; <?php _e('Sidebar'); ?></title>
  28  <style type="text/css" media="screen">
  29  body {
  30      font-size: 0.9em;
  31      margin: 0;
  32      padding: 0;
  33  }
  34  form {
  35      padding: 1%;
  36  }
  37  .tags-wrap p {
  38      font-size: 0.75em;
  39      margin-top: 0.4em;
  40  }
  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;
  83  }
  84  </style>
  85  </head>
  86  <body id="sidebar">
  87  <div id="wphead"><p><?php bloginfo('name') ?> &rsaquo; <?php _e('Sidebar'); ?></p></div>
  88  <form name="post" action="post.php" method="post">
  89  <div>
  90  <input type="hidden" name="action" value="post" />
  91  <input type="hidden" name="user_ID" value="<?php echo esc_attr($user_ID) ?>" />
  92  <input type="hidden" name="mode" value="sidebar" />
  93  <input type="hidden" name="ping_status" value="<?php echo esc_attr($post->ping_status); ?>" />
  94  <input type="hidden" name="comment_status" value="<?php echo esc_attr($post->comment_status); ?>" />
  95  <?php wp_nonce_field('add-post');
  96  
  97  if ( 'b' == $_GET['a'] )
  98      echo '<div class="updated"><p>' . __('Post published.') . '</p></div>';
  99  elseif ( '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="" />
 105  </p>
 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>
 110  </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  
 118  <p>
 119  <input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" accesskey="s" class="button" value="<?php esc_attr_e('Save as Draft'); ?>" />
 120  <?php if ( current_user_can('publish_posts') ) : ?>
 121  <input name="publish" type="submit" id="publish" tabindex="6" accesskey="p" value="<?php esc_attr_e('Publish') ?>" class="button button-highlighted" />
 122  <?php endif; ?>
 123  </p>
 124  </div>
 125  </form>
 126  
 127  </body>
 128  </html>


Generated: Fri Jan 8 00:19:48 2010 Cross-referenced by PHPXref 0.7