Some UI cleanups, changes, and various miscellany.

git-svn-id: http://svn.automattic.com/wordpress/trunk@4349 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2006-10-06 01:14:47 +00:00
parent 7757b7ff4e
commit c437b9c9b0
27 changed files with 2105 additions and 1955 deletions

View File

@ -1,13 +1,10 @@
<div id="footer">
<p><a href="http://wordpress.org/" id="wordpress-logo"><img src="images/wordpress-logo.png" alt="WordPress" /></a></p>
<p>
<?php _e('<a href="http://codex.wordpress.org/">Documentation</a>'); ?> &#8212; <?php _e('<a href="http://wordpress.org/support/">Support Forums</a>'); ?> <br />
<?php bloginfo('version'); ?> &#8212; <?php printf(__('%s seconds'), timer_stop(0, 2)); ?>
</p>
<p class="logo"><a href="http://wordpress.org/" id="wordpress-logo"><img src="images/wordpress-logo.png" alt="WordPress" /></a></p>
<p class="docs"><?php _e('<a href="http://codex.wordpress.org/">Documentation</a>'); ?> &#8212; <?php _e('<a href="http://wordpress.org/support/">Support Forums</a>'); ?><br />
<?php bloginfo('version'); ?> &#8212; <?php printf(__('%s seconds'), timer_stop(0, 2)); ?></p>
</div>
<?php do_action('admin_footer', ''); ?>
<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>
</body>
</html>
</html>

View File

@ -82,7 +82,8 @@ if (isset($plugin_page)) {
include(ABSPATH . "wp-admin/import/$importer.php");
$parent_file = 'import.php';
$parent_file = 'edit.php';
$submenu_file = 'import.php';
$title = __('Import');
if (! isset($_GET['noheader']))

View File

@ -14,8 +14,6 @@ $messages[3] = __('Custom field deleted.');
<?php endif; ?>
<div class="wrap">
<h2 id="write-post"><?php _e('Write Post'); ?><?php if ( 0 != $post_ID ) : ?>
<small class="quickjump"><a href="#preview-post"><?php _e('preview &darr;'); ?></a></small><?php endif; ?></h2>
<?php
if (0 == $post_ID) {

View File

@ -77,7 +77,7 @@ if ( is_month() ) {
<fieldset>
<legend><?php _e('Search Posts&hellip;') ?></legend>
<input type="text" name="s" value="<?php if (isset($s)) echo wp_specialchars($s, 1); ?>" size="17" />
<input type="submit" name="submit" value="<?php _e('Search') ?>" />
<input type="submit" name="submit" value="<?php _e('Search') ?>" class="button" />
</fieldset>
</form>
@ -106,7 +106,7 @@ if ( count($arc_result) ) { ?>
}
?>
</select>
<input type="submit" name="submit" value="<?php _e('Show Month') ?>" />
<input type="submit" name="submit" value="<?php _e('Show Month') ?>" class="button" />
</fieldset>
</form>
@ -116,7 +116,7 @@ if ( count($arc_result) ) { ?>
<fieldset>
<legend><?php _e('Browse Category&hellip;') ?></legend>
<?php wp_dropdown_categories('show_option_all='.__('All').'&hide_empty=1&hierarchical=1&show_count=1&selected='.$cat);?>
<input type="submit" name="submit" value="<?php _e('Show Category') ?>" />
<input type="submit" name="submit" value="<?php _e('Show Category') ?>" class="button" />
</fieldset>
</form>

View File

@ -11,14 +11,16 @@ require_once ('admin-header.php');
<div class="wrap">
<h2><?php _e('Export'); ?></h2>
<p><?php _e('This will allow you to download an export of your WordPress posts and comments in a XML format.'); ?></p>
<p>We need some more text here. Maybe talking about the export file or how to save it.</p>
<div class="narrow">
<p><?php _e('When you click the button below WordPress will create a XML file for you to save to your computer.'); ?></p>
<p><?php _e('This format, which we call WordPress eXtended RSS or WXR, will contain your posts, comments, custom fields, and categories.'); ?></p>
<form action="" method="get">
<p class="submit"><input type="submit" name="submit" value="<?php _e('Download Export File'); ?> &raquo;" />
<input type="hidden" name="download" value="true" />
</p>
</form>
</div>
</div>
<?php

View File

@ -22,8 +22,10 @@ class BW_Import {
}
function greet() {
echo '<div class="narrow">';
echo '<p>'.__('Howdy! This importer allows you to extract posts from Blogware XML export file into your blog. Pick a Blogware file to upload and click Import.').'</p>';
wp_import_upload_form("admin.php?import=blogware&amp;step=1");
echo '</div>';
}
function import_posts() {

File diff suppressed because it is too large Load Diff

View File

@ -20,8 +20,10 @@ class LJ_Import {
}
function greet() {
echo '<div class="narrow">';
echo '<p>'.__('Howdy! This importer allows you to extract posts from LiveJournal XML export file into your blog. Pick a LiveJournal file to upload and click Import.').'</p>';
wp_import_upload_form("admin.php?import=livejournal&amp;step=1");
echo '</div>';
}
function import_posts() {

View File

@ -21,9 +21,11 @@ class MT_Import {
function greet() {
$this->header();
?>
<div class="narrow">
<p><?php _e('Howdy! We&#8217;re about to begin the process to import all of your Movable Type entries into WordPress. To begin, select a file to upload and click Import.'); ?></p>
<?php wp_import_upload_form( add_query_arg('step', 1) ); ?>
<p><?php _e('The importer is smart enough not to import duplicates, so you can run this multiple times without worry if&#8212;for whatever reason&#8212;it doesn\'t finish. If you get an <strong>out of memory</strong> error try splitting up the import file into pieces.'); ?> </p>
</div>
<?php
$this->footer();
}

View File

@ -21,8 +21,10 @@ class RSS_Import {
}
function greet() {
echo '<div class="narrow">';
echo '<p>'.__('Howdy! This importer allows you to extract posts from any RSS 2.0 file into your blog. This is useful if you want to import your posts from a system that is not handled by a custom import tool. Pick an RSS file to upload and click Import.').'</p>';
wp_import_upload_form("admin.php?import=rss&amp;step=1");
echo '</div>';
}
function get_posts() {

View File

@ -50,14 +50,15 @@ class Textpattern_Import {
echo '</div>';
}
function greet()
{
function greet() {
echo '<div class="narrow">';
echo '<p>'.__('Howdy! This importer allows you to extract posts from any Textpattern 4.0.2+ into your blog. This has not been tested on previous versions of Textpattern. Mileage may vary.').'</p>';
echo '<p>'.__('Your Textpattern Configuration settings are as follows:').'</p>';
echo '<form action="admin.php?import=textpattern&amp;step=1" method="post">';
$this->db_form();
echo '<input type="submit" name="submit" value="'.__('Import Categories').'" />';
echo '<p class="submit"><input type="submit" name="submit" value="'.__('Import Categories').' &raquo;" /></p>';
echo '</form>';
echo '</div>';
}
function get_txp_cats()
@ -568,13 +569,13 @@ class Textpattern_Import {
function db_form()
{
echo '<ul>';
printf('<li><label for="dbuser">%s</label> <input type="text" name="dbuser" id="dbuser" /></li>', __('Textpattern Database User:'));
printf('<li><label for="dbpass">%s</label> <input type="password" name="dbpass" id="dbpass" /></li>', __('Textpattern Database Password:'));
printf('<li><label for="dbname">%s</label> <input type="text" id="dbname" name="dbname" /></li>', __('Textpattern Database Name:'));
printf('<li><label for="dbhost">%s</label> <input type="text" id="dbhost" name="dbhost" value="localhost" /></li>', __('Textpattern Database Host:'));
printf('<li><label for="dbprefix">%s</label> <input type="text" name="dbprefix" id="dbprefix" /></li>', __('Textpattern Table prefix (if any):'));
echo '</ul>';
echo '<table class="editform">';
printf('<tr><th scope="row"><label for="dbuser">%s</label></th><td><input type="text" name="dbuser" id="dbuser" /></td></tr>', __('Textpattern Database User:'));
printf('<tr><th scope="row"><label for="dbpass">%s</label></th><td><input type="password" name="dbpass" id="dbpass" /></td></tr>', __('Textpattern Database Password:'));
printf('<tr><th scope="row"><label for="dbname">%s</label></th><td><input type="text" id="dbname" name="dbname" /></td></tr>', __('Textpattern Database Name:'));
printf('<tr><th scope="row"><label for="dbhost">%s</label></th><td><input type="text" id="dbhost" name="dbhost" value="localhost" /></td></tr>', __('Textpattern Database Host:'));
printf('<tr><th scope="row"><label for="dbprefix">%s</label></th><td><input type="text" name="dbprefix" id="dbprefix" /></td></tr>', __('Textpattern Table prefix (if any):'));
echo '</table>';
}
function dispatch()

View File

@ -25,8 +25,10 @@ class WP_Import {
}
function greet() {
echo '<div class="narrow">';
echo '<p>'.__('Howdy! Upload your WordPress eXtended RSS (WXR) file and we&#8217;ll import the posts and comments into this blog.').'</p>';
wp_import_upload_form("admin.php?import=wordpress&amp;step=1");
echo '</div>';
}
function get_tag( $string, $tag ) {

View File

@ -132,7 +132,8 @@ if (0 < $numcats) $numcats = number_format($numcats);
$rss = @fetch_rss('http://wordpress.org/development/feed/');
if ( isset($rss->items) && 0 != count($rss->items) ) {
?>
<h3><?php _e('WordPress Development News'); ?></h3>
<div id="devnews">
<h3><?php _e('WordPress Development Blog'); ?></h3>
<?php
$rss->items = array_slice($rss->items, 0, 3);
foreach ($rss->items as $item ) {
@ -143,24 +144,28 @@ foreach ($rss->items as $item ) {
}
}
?>
</div>
<?php
$rss = @fetch_rss('http://planet.wordpress.org/feed/');
if ( isset($rss->items) && 0 != count($rss->items) ) {
?>
<div id="planetnews">
<h3><?php _e('Other WordPress News'); ?> <a href="http://planet.wordpress.org/"><?php _e('more'); ?> &raquo;</a></h3>
<h3><?php _e('Other WordPress News'); ?></h3>
<ul>
<?php
$rss->items = array_slice($rss->items, 0, 20);
foreach ($rss->items as $item ) {
$title = wp_specialchars($item['title']);
$author = preg_replace( '|(.+?):.+|s', '$1', $item['title'] );
$post = preg_replace( '|.+?:(.+)|s', '$1', $item['title'] );
?>
<li><a href='<?php echo wp_filter_kses($item['link']); ?>'><?php echo wp_specialchars($item['title']); ?></a></li>
<li><a href='<?php echo wp_filter_kses($item['link']); ?>'><span class="post"><?php echo $post; ?></span><span class="hidden"> - </span><cite><?php echo $author; ?></cite></a></li>
<?php
}
?>
</ul>
<p class="readmore"><a href="http://planet.wordpress.org/"><?php _e('Read more'); ?> &raquo;</a></p>
</div>
<?php
}

View File

@ -53,6 +53,10 @@ endforeach;
</ul>
<?php
else :
?>
<div id="minisub"></div>
<?php
endif;

View File

@ -1,160 +1,160 @@
<?php
require_once('admin.php');
$parent_file = 'edit.php';
$submenu_file = 'edit-pages.php';
wp_reset_vars(array('action'));
if (isset($_POST['deletepost'])) {
$action = "delete";
}
switch($action) {
case 'post':
check_admin_referer('add-page');
$page_ID = write_post();
// Redirect.
if (!empty($_POST['mode'])) {
switch($_POST['mode']) {
case 'bookmarklet':
$location = $_POST['referredby'];
break;
case 'sidebar':
$location = 'sidebar.php?a=b';
break;
default:
$location = 'page-new.php';
break;
}
} else {
$location = "page-new.php?posted=$page_ID";
}
if ( isset($_POST['save']) )
$location = "page.php?action=edit&post=$page_ID";
wp_redirect($location);
exit();
break;
case 'edit':
$title = __('Edit');
$editing = true;
$page_ID = $post_ID = $p = (int) $_GET['post'];
$post = get_post_to_edit($page_ID);
if($post->post_status == 'draft') {
wp_enqueue_script('prototype');
wp_enqueue_script('autosave');
}
require_once('admin-header.php');
if ( !current_user_can('edit_page', $page_ID) )
die ( __('You are not allowed to edit this page.') );
include('edit-page-form.php');
?>
<div id='preview' class='wrap'>
<h2 id="preview-post"><?php _e('Page Preview (updated when page is saved)'); ?> <small class="quickjump"><a href="#write-post"><?php _e('edit &uarr;'); ?></a></small></h2>
<iframe src="<?php echo wp_specialchars(apply_filters('preview_page_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" width="100%" height="600" ></iframe>
</div>
<?php
break;
case 'editattachment':
$page_id = $post_ID = (int) $_POST['post_ID'];
check_admin_referer('update-attachment_' . $page_id);
// Don't let these be changed
unset($_POST['guid']);
$_POST['post_type'] = 'attachment';
// Update the thumbnail filename
$oldmeta = $newmeta = get_post_meta($page_id, '_wp_attachment_metadata', true);
$newmeta['thumb'] = $_POST['thumb'];
if ( '' !== $oldmeta )
update_post_meta($page_id, '_wp_attachment_metadata', $newmeta, $oldmeta);
else
add_post_meta($page_id, '_wp_attachment_metadata', $newmeta);
case 'editpost':
$page_ID = (int) $_POST['post_ID'];
check_admin_referer('update-page_' . $page_ID);
$page_ID = edit_post();
if ( 'post' == $_POST['originalaction'] ) {
if (!empty($_POST['mode'])) {
switch($_POST['mode']) {
case 'bookmarklet':
$location = $_POST['referredby'];
break;
case 'sidebar':
$location = 'sidebar.php?a=b';
break;
default:
$location = 'page-new.php';
break;
}
} else {
$location = "page-new.php?posted=$page_ID";
}
if ( isset($_POST['save']) )
$location = "page.php?action=edit&post=$page_ID";
} else {
if ($_POST['save']) {
$location = "page.php?action=edit&post=$page_ID";
} elseif ($_POST['updatemeta']) {
$location = wp_get_referer() . '&message=2#postcustom';
} elseif ($_POST['deletemeta']) {
$location = wp_get_referer() . '&message=3#postcustom';
} elseif (!empty($_POST['referredby']) && $_POST['referredby'] != wp_get_referer()) {
$location = $_POST['referredby'];
if ( $_POST['referredby'] == 'redo' )
$location = get_permalink( $page_ID );
} elseif ($action == 'editattachment') {
$location = 'attachments.php';
} else {
$location = 'page-new.php';
}
}
wp_redirect($location); // Send user on their way while we keep working
exit();
break;
case 'delete':
$page_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']);
check_admin_referer('delete-page_' . $page_id);
$page = & get_post($page_id);
if ( !current_user_can('delete_page', $page_id) )
wp_die( __('You are not allowed to delete this page.') );
if ( $page->post_type == 'attachment' ) {
if ( ! wp_delete_attachment($page_id) )
wp_die( __('Error in deleting...') );
} else {
if ( !wp_delete_post($page_id) )
wp_die( __('Error in deleting...') );
}
$sendback = wp_get_referer();
if (strstr($sendback, 'page.php')) $sendback = get_option('siteurl') .'/wp-admin/page.php';
elseif (strstr($sendback, 'attachments.php')) $sendback = get_option('siteurl') .'/wp-admin/attachments.php';
$sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback);
wp_redirect($sendback);
exit();
break;
default:
wp_redirect('edit-pages.php');
exit();
break;
} // end switch
include('admin-footer.php');
?>
<?php
require_once('admin.php');
$parent_file = 'edit.php';
$submenu_file = 'edit-pages.php';
wp_reset_vars(array('action'));
if (isset($_POST['deletepost'])) {
$action = "delete";
}
switch($action) {
case 'post':
check_admin_referer('add-page');
$page_ID = write_post();
// Redirect.
if (!empty($_POST['mode'])) {
switch($_POST['mode']) {
case 'bookmarklet':
$location = $_POST['referredby'];
break;
case 'sidebar':
$location = 'sidebar.php?a=b';
break;
default:
$location = 'page-new.php';
break;
}
} else {
$location = "page-new.php?posted=$page_ID";
}
if ( isset($_POST['save']) )
$location = "page.php?action=edit&post=$page_ID";
wp_redirect($location);
exit();
break;
case 'edit':
$title = __('Edit');
$editing = true;
$page_ID = $post_ID = $p = (int) $_GET['post'];
$post = get_post_to_edit($page_ID);
if($post->post_status == 'draft') {
wp_enqueue_script('prototype');
wp_enqueue_script('autosave');
}
require_once('admin-header.php');
if ( !current_user_can('edit_page', $page_ID) )
die ( __('You are not allowed to edit this page.') );
include('edit-page-form.php');
?>
<div id='preview' class='wrap'>
<h2 id="preview-post"><?php _e('Page Preview (updated when page is saved)'); ?></h2>
<iframe src="<?php echo wp_specialchars(apply_filters('preview_page_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" width="100%" height="600" ></iframe>
</div>
<?php
break;
case 'editattachment':
$page_id = $post_ID = (int) $_POST['post_ID'];
check_admin_referer('update-attachment_' . $page_id);
// Don't let these be changed
unset($_POST['guid']);
$_POST['post_type'] = 'attachment';
// Update the thumbnail filename
$oldmeta = $newmeta = get_post_meta($page_id, '_wp_attachment_metadata', true);
$newmeta['thumb'] = $_POST['thumb'];
if ( '' !== $oldmeta )
update_post_meta($page_id, '_wp_attachment_metadata', $newmeta, $oldmeta);
else
add_post_meta($page_id, '_wp_attachment_metadata', $newmeta);
case 'editpost':
$page_ID = (int) $_POST['post_ID'];
check_admin_referer('update-page_' . $page_ID);
$page_ID = edit_post();
if ( 'post' == $_POST['originalaction'] ) {
if (!empty($_POST['mode'])) {
switch($_POST['mode']) {
case 'bookmarklet':
$location = $_POST['referredby'];
break;
case 'sidebar':
$location = 'sidebar.php?a=b';
break;
default:
$location = 'page-new.php';
break;
}
} else {
$location = "page-new.php?posted=$page_ID";
}
if ( isset($_POST['save']) )
$location = "page.php?action=edit&post=$page_ID";
} else {
if ($_POST['save']) {
$location = "page.php?action=edit&post=$page_ID";
} elseif ($_POST['updatemeta']) {
$location = wp_get_referer() . '&message=2#postcustom';
} elseif ($_POST['deletemeta']) {
$location = wp_get_referer() . '&message=3#postcustom';
} elseif (!empty($_POST['referredby']) && $_POST['referredby'] != wp_get_referer()) {
$location = $_POST['referredby'];
if ( $_POST['referredby'] == 'redo' )
$location = get_permalink( $page_ID );
} elseif ($action == 'editattachment') {
$location = 'attachments.php';
} else {
$location = 'page-new.php';
}
}
wp_redirect($location); // Send user on their way while we keep working
exit();
break;
case 'delete':
$page_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']);
check_admin_referer('delete-page_' . $page_id);
$page = & get_post($page_id);
if ( !current_user_can('delete_page', $page_id) )
wp_die( __('You are not allowed to delete this page.') );
if ( $page->post_type == 'attachment' ) {
if ( ! wp_delete_attachment($page_id) )
wp_die( __('Error in deleting...') );
} else {
if ( !wp_delete_post($page_id) )
wp_die( __('Error in deleting...') );
}
$sendback = wp_get_referer();
if (strstr($sendback, 'page.php')) $sendback = get_option('siteurl') .'/wp-admin/page.php';
elseif (strstr($sendback, 'attachments.php')) $sendback = get_option('siteurl') .'/wp-admin/attachments.php';
$sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback);
wp_redirect($sendback);
exit();
break;
default:
wp_redirect('edit-pages.php');
exit();
break;
} // end switch
include('admin-footer.php');
?>

View File

@ -78,7 +78,7 @@ if (empty($plugins)) {
echo '</p>';
} else {
?>
<table class="widefat">
<table class="widefat plugins">
<thead>
<tr>
<th><?php _e('Plugin'); ?></th>
@ -112,7 +112,7 @@ if (empty($plugins)) {
<tr $style>
<td class='name'>{$plugin_data['Title']}</td>
<td class='vers'>{$plugin_data['Version']}</td>
<td class='desc'>{$plugin_data['Description']} <cite>".sprintf(__('By %s'), $plugin_data['Author']).".</cite></td>
<td class='desc'><p>{$plugin_data['Description']} <cite>".sprintf(__('By %s'), $plugin_data['Author']).".</cite></p></td>
<td class='togl'>$toggle</td>";
if ( current_user_can('edit_plugins') )
echo "
@ -130,7 +130,8 @@ if (empty($plugins)) {
<p><?php _e(sprintf('If something goes wrong with a plugin and you can&#8217;t use WordPress, delete or rename that file in the <code>%s</code> directory and it will be automatically deactivated.', PLUGINDIR)); ?></p>
<h2><?php _e('Get More Plugins'); ?></h2>
<p><?php _e(sprintf('You can find additional plugins for your site in the <a href="http://wordpress.org/extend/plugins/">WordPress plugin directory</a>. To install a plugin you generally just need to upload the plugin file into your <code>%s</code> directory. Once a plugin is uploaded, you may activate it here.', PLUGINDIR)); ?></p>
<p><?php _e('You can find additional plugins for your site in the <a href="http://wordpress.org/extend/plugins/">WordPress plugin directory</a>.'); ?></p>
<p><?php _e(sprintf('To install a plugin you generally just need to upload the plugin file into your <code>%s</code> directory. Once a plugin is uploaded, you may activate it here.', PLUGINDIR)); ?></p>
</div>

View File

@ -62,7 +62,7 @@ case 'edit':
?>
<div id='preview' class='wrap'>
<h2 id="preview-post"><?php _e('Post Preview (updated when post is saved)'); ?> <small class="quickjump"><a href="#write-post"><?php _e('edit &uarr;'); ?></a></small></h2>
<h2 id="preview-post"><?php _e('Post Preview (updated when post is saved)'); ?></h2>
<iframe src="<?php echo wp_specialchars(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" width="100%" height="600" ></iframe>
</div>
<?php

View File

@ -35,6 +35,8 @@ $bookmarklet_height= 440;
<?php do_action('profile_personal_options'); ?>
<p class="submit"><input type="submit" value="<?php _e('Update Profile &raquo;') ?>" name="submit" /></p>
<fieldset>
<legend><?php _e('Name'); ?></legend>
<p><label><?php _e('Username: (no editing)'); ?><br />
@ -138,9 +140,7 @@ if ( $show_password_fields ) :
endif;
?>
</table>
<p class="submit">
<input type="submit" value="<?php _e('Update Profile &raquo;') ?>" name="submit" />
</p>
<p class="submit"><input type="submit" value="<?php _e('Update Profile &raquo;') ?>" name="submit" /></p>
</form>
</div>

View File

@ -1,223 +1,223 @@
#viewarc, #viewcat, #namediv, #emaildiv, #uridiv, #planetnews li, #login ul li, #your-profile fieldset, .alignleft .available-theme {
float: right
}
#templateside, .alignright {
float: left;
}
#login, #send, .widefat th {
text-align: right
}
#postcustomsubmit, h2 small.quickjump, form#upload th, .submit, .editform th {
text-align: left
}
body, td {
font: 13px Tahoma, "Lucida Grande", "Lucida Sans Unicode", Verdana;
}
fieldset.options legend {
font-family: Tahoma, Georgia, "Times New Roman", Times, serif;
}
textarea, input, select {
font: 13px Tahoma, Verdana, Arial, Helvetica, sans-serif;
}
.quicktags, .search {
font: 12px Tahoma, Georgia, "Times New Roman", Times, serif;
}
.submit input, .submit input:focus, .button {
border-right-color: #ccc;
}
.submit input:active, .button:active {
border-right-color: #999;
}
.updated, .confirm {
padding: 0 3em 0 1em;
}
#adminmenu {
padding: .2em 2em .3em .2em;
height: 30px;
}
#adminmenu a {
margin: 0 0 0 10px;
display: block;
float: right;
}
#submenu {
height: 21px;
padding: 3px 3em 0 2em;
}
#submenu .current {
border-left: 2px solid #045290;
}
#submenu a {
padding: .3em .4em .33em .4em;
margin: 0 0 0 10px;
display: block;
float: right;
}
#submenu li {
line-height: 100%;
}
#postdiv , #titlediv, #guiddiv {
margin: 0 0 0 8px;
}
#currenttheme img {
float: right;
margin-right: auto;
margin-left: 1em;
}
#postdiv #quicktags {
padding-right: auto;
padding-left: 6px;
}
#quicktags #ed_toolbar {
padding: 0px 0 0 2px;
}
#ed_toolbar input {
margin: 3px 0 2px 2px;
}
* html #postexcerpt .dbx-toggle-open, * html #postexcerpt .dbx-toggle-open, #postexcerpt div, #attachmentlinks div {
padding-right: auto;
padding-left: 8px;
}
#login h1 {
left: auto;
right: 137px;
}
#login h1 a {
display: none;
}
#searchform {
float: right;
margin-right: auto;
margin-left: 3em;
}
#poststuff {
margin-right: auto;
margin-left: 16em;
}
#template div {
margin-right: auto;
margin-left: 190px;
}
* html #template div {
margin-right: auto;
margin-left: 0px;
}
#user_info {
right: auto;
left: 1em;
}
#wphead {
padding: .8em 2em .8em 19em;
}
#wphead h1 {
font-size: 2.4em;
font-family: Tahoma, Georgia, "Times New Roman", Times, serif
}
#zeitgeist {
float: left;
margin-left: auto;
margin-right: 1em;
}
#zeitgeist ul {
margin: 0 .6em .3em 0;
padding: 0 .6em 0 0;
}
#moremeta fieldset div {
margin: 2px 0px 0 0;
}
#moremeta {
margin-right: auto;
margin-left: 15px;
right: auto;
left: 5%;
}
#categorydiv ul {
margin-left: auto;
margin-right: 10px;
}
#your-profile legend {
font-family: Tahoma, Georgia, "Times New Roman", Times, serif;
}
#moremeta .dbx-content {
background: url(images/box-butt.gif) no-repeat bottom left;
padding-right: auto;
padding-left: 2px;
}
#moremeta .dbx-handle {
background: #2685af url(images/box-head.gif) no-repeat left;
}
#moremeta .dbx-box {
background: url(images/box-bg.gif) repeat-y left;
}
a.dbx-toggle, a.dbx-toggle:visited {
right: auto;
left: 2px;
}
#advancedstuff a.dbx-toggle, #advancedstuff a.dbx-toggle-open:visited {
right: auto;
left: 5px;
}
#advancedstuff a.dbx-toggle-open, #advancedstuff a.dbx-toggle-open:visited {
right: auto;
left: 5px;
}
#categorychecklist {
margin-right: auto;
margin-left: 6px;
}
#ajax-response.alignleft {
margin-left: auto;
margin-right: 2em;
}
#postdivrich #edButtons {
padding-left: auto;
padding-right: 3px;
}
#edButtons input, #edButtons input:active {
margin: 0px 0 -1px 2px;
}
#viewarc, #viewcat, #namediv, #emaildiv, #uridiv, #planetnews li, #login ul li, #your-profile fieldset, .alignleft .available-theme {
float: right
}
#templateside, .alignright {
float: left;
}
#login, #send, .widefat th {
text-align: right
}
#postcustomsubmit, form#upload th, .submit, .editform th {
text-align: left
}
body, td {
font: 13px Tahoma, "Lucida Grande", "Lucida Sans Unicode", Verdana;
}
fieldset.options legend {
font-family: Tahoma, Georgia, "Times New Roman", Times, serif;
}
textarea, input, select {
font: 13px Tahoma, Verdana, Arial, Helvetica, sans-serif;
}
.quicktags, .search {
font: 12px Tahoma, Georgia, "Times New Roman", Times, serif;
}
.submit input, .submit input:focus, .button {
border-right-color: #ccc;
}
.submit input:active, .button:active {
border-right-color: #999;
}
.updated, .confirm {
padding: 0 3em 0 1em;
}
#adminmenu {
padding: .2em 2em .3em .2em;
height: 30px;
}
#adminmenu a {
margin: 0 0 0 10px;
display: block;
float: right;
}
#submenu {
height: 21px;
padding: 3px 3em 0 2em;
}
#submenu .current {
border-left: 2px solid #045290;
}
#submenu a {
padding: .3em .4em .33em .4em;
margin: 0 0 0 10px;
display: block;
float: right;
}
#submenu li {
line-height: 100%;
}
#postdiv , #titlediv, #guiddiv {
margin: 0 0 0 8px;
}
#currenttheme img {
float: right;
margin-right: auto;
margin-left: 1em;
}
#postdiv #quicktags {
padding-right: auto;
padding-left: 6px;
}
#quicktags #ed_toolbar {
padding: 0px 0 0 2px;
}
#ed_toolbar input {
margin: 3px 0 2px 2px;
}
* html #postexcerpt .dbx-toggle-open, * html #postexcerpt .dbx-toggle-open, #postexcerpt div, #attachmentlinks div {
padding-right: auto;
padding-left: 8px;
}
#login h1 {
left: auto;
right: 137px;
}
#login h1 a {
display: none;
}
#searchform {
float: right;
margin-right: auto;
margin-left: 3em;
}
#poststuff {
margin-right: auto;
margin-left: 16em;
}
#template div {
margin-right: auto;
margin-left: 190px;
}
* html #template div {
margin-right: auto;
margin-left: 0px;
}
#user_info {
right: auto;
left: 1em;
}
#wphead {
padding: .8em 2em .8em 19em;
}
#wphead h1 {
font-size: 2.4em;
font-family: Tahoma, Georgia, "Times New Roman", Times, serif
}
#zeitgeist {
float: left;
margin-left: auto;
margin-right: 1em;
}
#zeitgeist ul {
margin: 0 .6em .3em 0;
padding: 0 .6em 0 0;
}
#moremeta fieldset div {
margin: 2px 0px 0 0;
}
#moremeta {
margin-right: auto;
margin-left: 15px;
right: auto;
left: 5%;
}
#categorydiv ul {
margin-left: auto;
margin-right: 10px;
}
#your-profile legend {
font-family: Tahoma, Georgia, "Times New Roman", Times, serif;
}
#moremeta .dbx-content {
background: url(images/box-butt.gif) no-repeat bottom left;
padding-right: auto;
padding-left: 2px;
}
#moremeta .dbx-handle {
background: #2685af url(images/box-head.gif) no-repeat left;
}
#moremeta .dbx-box {
background: url(images/box-bg.gif) repeat-y left;
}
a.dbx-toggle, a.dbx-toggle:visited {
right: auto;
left: 2px;
}
#advancedstuff a.dbx-toggle, #advancedstuff a.dbx-toggle-open:visited {
right: auto;
left: 5px;
}
#advancedstuff a.dbx-toggle-open, #advancedstuff a.dbx-toggle-open:visited {
right: auto;
left: 5px;
}
#categorychecklist {
margin-right: auto;
margin-left: 6px;
}
#ajax-response.alignleft {
margin-left: auto;
margin-right: 2em;
}
#postdivrich #edButtons {
padding-left: auto;
padding-right: 3px;
}
#edButtons input, #edButtons input:active {
margin: 0px 0 -1px 2px;
}

View File

@ -93,7 +93,7 @@ default:
}
?>
</select>
<input type="submit" name="Submit" value="<?php _e('Select &raquo;') ?>" />
<input type="submit" name="Submit" value="<?php _e('Select &raquo;') ?>" class="button" />
</form>
</div>

View File

@ -1,362 +1,358 @@
<?php
function wp_upload_display( $dims = false, $href = '' ) {
global $post;
$id = get_the_ID();
$attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true );
if ( isset($attachment_data['width']) )
list($width,$height) = wp_shrink_dimensions($attachment_data['width'], $attachment_data['height'], 171, 128);
ob_start();
the_title();
$post_title = wp_specialchars( ob_get_contents(), 1 );
ob_end_clean();
$post_content = apply_filters( 'content_edit_pre', $post->post_content );
$class = 'text';
$thumb_src = '';
$innerHTML = get_attachment_innerHTML( $id, false, $dims );
if ( $image_src = strstr($innerHTML, 'src="') ) {
$image_src = explode('"', $image_src);
$image_src = $image_src[1];
$thumb_src = wp_make_link_relative($image_src);
$class = 'image';
$innerHTML = '&nbsp;' . str_replace($image_src, $thumb_src, $innerHTML);
}
$src = wp_make_link_relative( get_the_guid() );
$r = '';
if ( $href )
$r .= "<a id='file-link-$id' href='$href' title='$post_title' class='file-link $class'>\n";
if ( $href || $image_src )
$r .= "\t\t\t$innerHTML";
if ( $href )
$r .= "</a>\n";
$r .= "\n\t\t<div class='upload-file-data'>\n\t\t\t<p>\n";
$r .= "\t\t\t\t<input type='hidden' name='attachment-url-$id' id='attachment-url-$id' value='$src' />\n";
if ( $image_src )
$r .= "\t\t\t\t<input type='hidden' name='attachment-thumb-url-$id' id='attachment-thumb-url-$id' value='$thumb_src' />\n";
if ( isset($width) ) {
$r .= "\t\t\t\t<input type='hidden' name='attachment-width-$id' id='attachment-width-$id' value='$width' />\n";
$r .= "\t\t\t\t<input type='hidden' name='attachment-height-$id' id='attachment-height-$id' value='$height' />\n";
}
$r .= "\t\t\t\t<input type='hidden' name='attachment-page-url-$id' id='attachment-page-url-$id' value='" . get_attachment_link( $id ) . "' />\n";
$r .= "\t\t\t\t<input type='hidden' name='attachment-title-$id' id='attachment-title-$id' value='$post_title' />\n";
$r .= "\t\t\t\t<input type='hidden' name='attachment-description-$id' id='attachment-description-$id' value='$post_content' />\n";
$r .= "\t\t\t</p>\n\t\t</div>\n";
return $r;
}
function wp_upload_view() {
global $style, $post_id;
$id = get_the_ID();
$attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true );
?>
<div id="upload-file">
<div id="file-title">
<h2><?php if ( !isset($attachment_data['width']) )
echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>";
the_title();
if ( !isset($attachment_data['width']) )
echo '</a>';
?></h2>
<span><?php
echo '[&nbsp;';
echo '<a href="' . get_permalink() . '">' . __('view') . '</a>';
echo '&nbsp;|&nbsp;';
echo '<a href="' . wp_specialchars( add_query_arg( 'action', 'edit' ), 1 ) . '" title="' . __('Edit this file') . '">' . __('edit') . '</a>';
echo '&nbsp;|&nbsp;';
echo '<a href="' . wp_specialchars( remove_query_arg( array('action', 'ID') ), 1 ) . '" title="' . __('Browse your files') . '">' . __('cancel') . '</a>';
echo '&nbsp;]'; ?></span>
</div>
<div id="upload-file-view" class="alignleft">
<?php if ( isset($attachment_data['width']) )
echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>";
echo wp_upload_display( array(171, 128) );
if ( isset($attachment_data['width']) )
echo '</a>'; ?>
</div>
<?php the_attachment_links( $id ); ?>
</div>
<?php
}
function wp_upload_form() {
$id = get_the_ID();
global $post_id, $tab, $style;
$enctype = $id ? '' : ' enctype="multipart/form-data"';
?>
<form<?php echo $enctype; ?> id="upload-file" method="post" action="<?php echo get_option('siteurl') . "/wp-admin/upload.php?style=$style&amp;tab=upload&amp;post_id=$post_id"; ?>">
<?php
if ( $id ) :
$attachment = get_post_to_edit( $id );
$attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true );
?>
<div id="file-title">
<h2><?php if ( !isset($attachment_data['width']) )
echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>";
the_title();
if ( !isset($attachment_data['width']) )
echo '</a>';
?></h2>
<span><?php
echo '[&nbsp;';
echo '<a href="' . get_permalink() . '">' . __('view') . '</a>';
echo '&nbsp;|&nbsp;';
echo '<a href="' . wp_specialchars( add_query_arg( 'action', 'view' ), 1 ) . '">' . __('links') . '</a>';
echo '&nbsp;|&nbsp;';
echo '<a href="' . wp_specialchars( remove_query_arg( array('action','ID') ), 1 ) . '" title="' . __('Browse your files') . '">' . __('cancel') . '</a>';
echo '&nbsp;]'; ?></span>
</div>
<div id="upload-file-view" class="alignleft">
<?php if ( isset($attachment_data['width']) )
echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>";
echo wp_upload_display( array(171, 128) );
if ( isset($attachment_data['width']) )
echo '</a>'; ?>
</div>
<?php endif; ?>
<table>
<?php if ( !$id ): ?>
<tr>
<th scope="row"><label for="upload"><?php _e('File:'); ?></label></th>
<td><input type="file" id="upload" name="image" /></td>
</tr>
<?php endif; ?>
<tr>
<th scope="row"><label for="post_title"><?php _e('Title:'); ?></label></th>
<td><input type="text" id="post_title" name="post_title" value="<?php echo $attachment->post_title; ?>" /></td>
</tr>
<tr>
<th scope="row"><label for="post_content"><?php _e('Description:'); ?></label></th>
<td><textarea name="post_content" id="post_content"><?php echo $attachment->post_content; ?></textarea></td>
</tr>
<tr id="buttons">
<th></th>
<td>
<input type="hidden" name="from_tab" value="<?php echo $tab; ?>" />
<input type="hidden" name="action" value="<?php echo $id ? 'save' : 'upload'; ?>" />
<?php if ( $post_id ) : ?>
<input type="hidden" name="post_id" value="<?php echo $post_id; ?>" />
<?php endif; if ( $id ) : ?>
<input type="hidden" name="ID" value="<?php echo $id; ?>" />
<?php endif; ?>
<?php wp_nonce_field( 'inlineuploading' ); ?>
<div class="submit">
<input type="submit" value="<?php $id ? _e('Save') : _e('Upload'); ?>" />
<?php if ( $id ) : ?>
<input type="submit" name="delete" class="delete" value="<?php _e('Delete'); ?>" />
<?php endif; ?>
</div>
</td>
</tr>
</table>
</form>
<?php
}
function wp_upload_tab_upload() {
wp_upload_form();
}
function wp_upload_tab_upload_action() {
global $action;
if ( isset($_POST['delete']) )
$action = 'delete';
switch ( $action ) :
case 'upload' :
global $from_tab, $post_id, $style;
if ( !$from_tab )
$from_tab = 'upload';
check_admin_referer( 'inlineuploading' );
global $post_id, $post_title, $post_content;
if ( !current_user_can( 'upload_files' ) )
wp_die( __('You are not allowed to upload files.')
. " <a href='" . get_option('siteurl') . "/wp-admin/upload.php?style=$style&amp;tab=browse-all&amp;post_id=$post_id'>"
. __('Browse Files') . '</a>'
);
$overrides = array('action'=>'upload');
$file = wp_handle_upload($_FILES['image'], $overrides);
if ( isset($file['error']) )
wp_die($file['error'] . "<br /><a href='" . get_option('siteurl')
. "/wp-admin/upload.php?style=$style&amp;tab=$from_tab&amp;post_id=$post_id'>'" . __('Back to Image Uploading') . '</a>'
);
$url = $file['url'];
$type = $file['type'];
$file = $file['file'];
$filename = basename($file);
// Construct the attachment array
$attachment = array(
'post_title' => $post_title ? $post_title : $filename,
'post_content' => $post_content,
'post_type' => 'attachment',
'post_parent' => $post_id,
'post_mime_type' => $type,
'guid' => $url
);
// Save the data
$id = wp_insert_attachment($attachment, $file, $post_id);
if ( preg_match('!^image/!', $attachment['post_mime_type']) ) {
// Generate the attachment's postmeta.
$imagesize = getimagesize($file);
$imagedata['width'] = $imagesize['0'];
$imagedata['height'] = $imagesize['1'];
list($uwidth, $uheight) = get_udims($imagedata['width'], $imagedata['height']);
$imagedata['hwstring_small'] = "height='$uheight' width='$uwidth'";
$imagedata['file'] = $file;
add_post_meta($id, '_wp_attachment_metadata', $imagedata);
if ( $imagedata['width'] * $imagedata['height'] < 3 * 1024 * 1024 ) {
if ( $imagedata['width'] > 128 && $imagedata['width'] >= $imagedata['height'] * 4 / 3 )
$thumb = wp_create_thumbnail($file, 128);
elseif ( $imagedata['height'] > 96 )
$thumb = wp_create_thumbnail($file, 96);
if ( @file_exists($thumb) ) {
$newdata = $imagedata;
$newdata['thumb'] = basename($thumb);
update_post_meta($id, '_wp_attachment_metadata', $newdata, $imagedata);
} else {
$error = $thumb;
}
}
} else {
add_post_meta($id, '_wp_attachment_metadata', array());
}
wp_redirect( get_option('siteurl') . "/wp-admin/upload.php?style=$style&tab=browse&action=view&ID=$id&post_id=$post_id");
die;
break;
case 'save' :
global $from_tab, $post_id, $style;
if ( !$from_tab )
$from_tab = 'upload';
check_admin_referer( 'inlineuploading' );
wp_update_post($_POST);
wp_redirect( get_option('siteurl') . "/wp-admin/upload.php?style=$style&tab=$from_tab&post_id=$post_id");
die;
break;
case 'delete' :
global $ID, $post_id, $from_tab, $style;
if ( !$from_tab )
$from_tab = 'upload';
check_admin_referer( 'inlineuploading' );
if ( !current_user_can('edit_post', (int) $ID) )
wp_die( __('You are not allowed to delete this attachment.')
. " <a href='" . get_option('siteurl') . "/wp-admin/upload.php?style=$style&amp;tab=$from_tab&amp;post_id=$post_id'>"
. __('Go back') . '</a>'
);
wp_delete_attachment($ID);
wp_redirect( get_option('siteurl') . "/wp-admin/upload.php?style=$style&tab=$from_tab&post_id=$post_id" );
die;
break;
endswitch;
}
add_action( 'upload_files_upload', 'wp_upload_tab_upload_action' );
function wp_upload_grab_attachments( $obj ) {
$obj->is_attachment = true;
}
function wp_upload_posts_where( $where ) {
global $post_id;
return $where . " AND post_parent = '" . (int) $post_id . "'";
}
function wp_upload_tab_browse() {
global $wpdb, $action, $paged;
$old_vars = compact( 'paged' );
switch ( $action ) :
case 'edit' :
case 'view' :
global $ID;
$attachments = query_posts("attachment_id=$ID");
if ( have_posts() ) : while ( have_posts() ) : the_post();
'edit' == $action ? wp_upload_form() : wp_upload_view();
endwhile; endif;
break;
default :
global $tab, $post_id, $style;
add_action( 'pre_get_posts', 'wp_upload_grab_attachments' );
if ( 'browse' == $tab && $post_id )
add_filter( 'posts_where', 'wp_upload_posts_where' );
$attachments = query_posts("what_to_show=posts&posts_per_page=10&paged=$paged");
$count_query = "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'attachment'";
if ( $post_id )
$count_query .= " AND post_parent = '$post_id'";
$total = $wpdb->get_var($count_query);
echo "<ul id='upload-files'>\n";
if ( have_posts() ) : while ( have_posts() ) : the_post();
$href = wp_specialchars( add_query_arg( array(
'action' => 'inline' == $style ? 'view' : 'edit',
'ID' => get_the_ID())
), 1 );
echo "\t<li id='file-";
the_ID();
echo "' class='alignleft'>\n";
echo wp_upload_display( array(128,128), $href );
echo "\t</li>\n";
endwhile;
else :
echo "\t<li>" . __('There are no attachments to show.') . "</li>\n";
endif;
echo "</ul>\n\n";
echo "<form action='' id='browse-form'><input type='hidden' id='nonce-value' value='" . wp_create_nonce( 'inlineuploading' ) . "' /></form>\n";
break;
endswitch;
extract($old_vars);
}
function wp_upload_tab_browse_action() {
global $style;
if ( 'inline' == $style )
wp_enqueue_script('upload');
}
add_action( 'upload_files_browse', 'wp_upload_tab_browse_action' );
add_action( 'upload_files_browse-all', 'wp_upload_tab_browse_action' );
function wp_upload_admin_head() {
global $wp_locale;
echo "<link rel='stylesheet' href='" . get_option('siteurl') . '/wp-admin/upload.css?version=' . get_bloginfo('version') . "' type='text/css' />\n";
if ( 'rtl' == $wp_locale->text_direction )
echo "<link rel='stylesheet' href='" . get_option('siteurl') . '/wp-admin/upload-rtl.css?version=' . get_bloginfo('version') . "' type='text/css' />\n";
if ( 'inline' == @$_GET['style'] ) {
echo "<style type='text/css'>\n";
echo "\tbody { height: 14em; overflow: hidden; }\n";
echo "\t#upload-content { overflow-y: auto; }\n";
echo "\t#upload-file { position: absolute; }\n";
echo "</style>";
}
}
<?php
function wp_upload_display( $dims = false, $href = '' ) {
global $post;
$id = get_the_ID();
$attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true );
if ( isset($attachment_data['width']) )
list($width,$height) = wp_shrink_dimensions($attachment_data['width'], $attachment_data['height'], 171, 128);
ob_start();
the_title();
$post_title = wp_specialchars( ob_get_contents(), 1 );
ob_end_clean();
$post_content = apply_filters( 'content_edit_pre', $post->post_content );
$class = 'text';
$innerHTML = get_attachment_innerHTML( $id, false, $dims );
if ( $image_src = strstr($innerHTML, 'src="') ) {
$image_src = explode('"', $image_src);
$image_src = $image_src[1];
$class = 'image';
$innerHTML = '&nbsp;' . $innerHTML;
}
$r = '';
if ( $href )
$r .= "<a id='file-link-$id' href='$href' title='$post_title' class='file-link $class'>\n";
if ( $href || $image_src )
$r .= "\t\t\t$innerHTML";
if ( $href )
$r .= "</a>\n";
$r .= "\n\t\t<div class='upload-file-data'>\n\t\t\t<p>\n";
$r .= "\t\t\t\t<input type='hidden' name='attachment-url-$id' id='attachment-url-$id' value='" . get_the_guid() . "' />\n";
if ( $image_src )
$r .= "\t\t\t\t<input type='hidden' name='attachment-thumb-url-$id' id='attachment-thumb-url-$id' value='$image_src' />\n";
if ( isset($width) ) {
$r .= "\t\t\t\t<input type='hidden' name='attachment-width-$id' id='attachment-width-$id' value='$width' />\n";
$r .= "\t\t\t\t<input type='hidden' name='attachment-height-$id' id='attachment-height-$id' value='$height' />\n";
}
$r .= "\t\t\t\t<input type='hidden' name='attachment-page-url-$id' id='attachment-page-url-$id' value='" . get_attachment_link( $id ) . "' />\n";
$r .= "\t\t\t\t<input type='hidden' name='attachment-title-$id' id='attachment-title-$id' value='$post_title' />\n";
$r .= "\t\t\t\t<input type='hidden' name='attachment-description-$id' id='attachment-description-$id' value='$post_content' />\n";
$r .= "\t\t\t</p>\n\t\t</div>\n";
return $r;
}
function wp_upload_view() {
global $style, $post_id;
$id = get_the_ID();
$attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true );
?>
<div id="upload-file">
<div id="file-title">
<h2><?php if ( !isset($attachment_data['width']) )
echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>";
the_title();
if ( !isset($attachment_data['width']) )
echo '</a>';
?></h2>
<span><?php
echo '[&nbsp;';
echo '<a href="' . get_permalink() . '">' . __('view') . '</a>';
echo '&nbsp;|&nbsp;';
echo '<a href="' . wp_specialchars( add_query_arg( 'action', 'edit' ), 1 ) . '" title="' . __('Edit this file') . '">' . __('edit') . '</a>';
echo '&nbsp;|&nbsp;';
echo '<a href="' . wp_specialchars( remove_query_arg( array('action', 'ID') ), 1 ) . '" title="' . __('Browse your files') . '">' . __('cancel') . '</a>';
echo '&nbsp;]'; ?></span>
</div>
<div id="upload-file-view" class="alignleft">
<?php if ( isset($attachment_data['width']) )
echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>";
echo wp_upload_display( array(171, 128) );
if ( isset($attachment_data['width']) )
echo '</a>'; ?>
</div>
<?php the_attachment_links( $id ); ?>
</div>
<?php
}
function wp_upload_form() {
$id = get_the_ID();
global $post_id, $tab, $style;
$enctype = $id ? '' : ' enctype="multipart/form-data"';
?>
<form<?php echo $enctype; ?> id="upload-file" method="post" action="<?php echo get_option('siteurl') . "/wp-admin/upload.php?style=$style&amp;tab=upload&amp;post_id=$post_id"; ?>">
<?php
if ( $id ) :
$attachment = get_post_to_edit( $id );
$attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true );
?>
<div id="file-title">
<h2><?php if ( !isset($attachment_data['width']) )
echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>";
the_title();
if ( !isset($attachment_data['width']) )
echo '</a>';
?></h2>
<span><?php
echo '[&nbsp;';
echo '<a href="' . get_permalink() . '">' . __('view') . '</a>';
echo '&nbsp;|&nbsp;';
echo '<a href="' . wp_specialchars( add_query_arg( 'action', 'view' ), 1 ) . '">' . __('links') . '</a>';
echo '&nbsp;|&nbsp;';
echo '<a href="' . wp_specialchars( remove_query_arg( array('action','ID') ), 1 ) . '" title="' . __('Browse your files') . '">' . __('cancel') . '</a>';
echo '&nbsp;]'; ?></span>
</div>
<div id="upload-file-view" class="alignleft">
<?php if ( isset($attachment_data['width']) )
echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>";
echo wp_upload_display( array(171, 128) );
if ( isset($attachment_data['width']) )
echo '</a>'; ?>
</div>
<?php endif; ?>
<table>
<?php if ( !$id ): ?>
<tr>
<th scope="row"><label for="upload"><?php _e('File:'); ?></label></th>
<td><input type="file" id="upload" name="image" /></td>
</tr>
<?php endif; ?>
<tr>
<th scope="row"><label for="post_title"><?php _e('Title:'); ?></label></th>
<td><input type="text" id="post_title" name="post_title" value="<?php echo $attachment->post_title; ?>" /></td>
</tr>
<tr>
<th scope="row"><label for="post_content"><?php _e('Description:'); ?></label></th>
<td><textarea name="post_content" id="post_content"><?php echo $attachment->post_content; ?></textarea></td>
</tr>
<tr id="buttons">
<th></th>
<td>
<input type="hidden" name="from_tab" value="<?php echo $tab; ?>" />
<input type="hidden" name="action" value="<?php echo $id ? 'save' : 'upload'; ?>" />
<?php if ( $post_id ) : ?>
<input type="hidden" name="post_id" value="<?php echo $post_id; ?>" />
<?php endif; if ( $id ) : ?>
<input type="hidden" name="ID" value="<?php echo $id; ?>" />
<?php endif; ?>
<?php wp_nonce_field( 'inlineuploading' ); ?>
<div class="submit">
<input type="submit" value="<?php $id ? _e('Save') : _e('Upload'); ?> &raquo;" />
<?php if ( $id ) : ?>
<input type="submit" name="delete" class="delete" value="<?php _e('Delete'); ?>" />
<?php endif; ?>
</div>
</td>
</tr>
</table>
</form>
<?php
}
function wp_upload_tab_upload() {
wp_upload_form();
}
function wp_upload_tab_upload_action() {
global $action;
if ( isset($_POST['delete']) )
$action = 'delete';
switch ( $action ) :
case 'upload' :
global $from_tab, $post_id, $style;
if ( !$from_tab )
$from_tab = 'upload';
check_admin_referer( 'inlineuploading' );
global $post_id, $post_title, $post_content;
if ( !current_user_can( 'upload_files' ) )
wp_die( __('You are not allowed to upload files.')
. " <a href='" . get_option('siteurl') . "/wp-admin/upload.php?style=$style&amp;tab=browse-all&amp;post_id=$post_id'>"
. __('Browse Files') . '</a>'
);
$overrides = array('action'=>'upload');
$file = wp_handle_upload($_FILES['image'], $overrides);
if ( isset($file['error']) )
wp_die($file['error'] . "<br /><a href='" . get_option('siteurl')
. "/wp-admin/upload.php?style=$style&amp;tab=$from_tab&amp;post_id=$post_id'>'" . __('Back to Image Uploading') . '</a>'
);
$url = $file['url'];
$type = $file['type'];
$file = $file['file'];
$filename = basename($file);
// Construct the attachment array
$attachment = array(
'post_title' => $post_title ? $post_title : $filename,
'post_content' => $post_content,
'post_type' => 'attachment',
'post_parent' => $post_id,
'post_mime_type' => $type,
'guid' => $url
);
// Save the data
$id = wp_insert_attachment($attachment, $file, $post_id);
if ( preg_match('!^image/!', $attachment['post_mime_type']) ) {
// Generate the attachment's postmeta.
$imagesize = getimagesize($file);
$imagedata['width'] = $imagesize['0'];
$imagedata['height'] = $imagesize['1'];
list($uwidth, $uheight) = get_udims($imagedata['width'], $imagedata['height']);
$imagedata['hwstring_small'] = "height='$uheight' width='$uwidth'";
$imagedata['file'] = $file;
add_post_meta($id, '_wp_attachment_metadata', $imagedata);
if ( $imagedata['width'] * $imagedata['height'] < 3 * 1024 * 1024 ) {
if ( $imagedata['width'] > 128 && $imagedata['width'] >= $imagedata['height'] * 4 / 3 )
$thumb = wp_create_thumbnail($file, 128);
elseif ( $imagedata['height'] > 96 )
$thumb = wp_create_thumbnail($file, 96);
if ( @file_exists($thumb) ) {
$newdata = $imagedata;
$newdata['thumb'] = basename($thumb);
update_post_meta($id, '_wp_attachment_metadata', $newdata, $imagedata);
} else {
$error = $thumb;
}
}
} else {
add_post_meta($id, '_wp_attachment_metadata', array());
}
wp_redirect( get_option('siteurl') . "/wp-admin/upload.php?style=$style&tab=browse&action=view&ID=$id&post_id=$post_id");
die;
break;
case 'save' :
global $from_tab, $post_id, $style;
if ( !$from_tab )
$from_tab = 'upload';
check_admin_referer( 'inlineuploading' );
wp_update_post($_POST);
wp_redirect( get_option('siteurl') . "/wp-admin/upload.php?style=$style&tab=$from_tab&post_id=$post_id");
die;
break;
case 'delete' :
global $ID, $post_id, $from_tab, $style;
if ( !$from_tab )
$from_tab = 'upload';
check_admin_referer( 'inlineuploading' );
if ( !current_user_can('edit_post', (int) $ID) )
wp_die( __('You are not allowed to delete this attachment.')
. " <a href='" . get_option('siteurl') . "/wp-admin/upload.php?style=$style&amp;tab=$from_tab&amp;post_id=$post_id'>"
. __('Go back') . '</a>'
);
wp_delete_attachment($ID);
wp_redirect( get_option('siteurl') . "/wp-admin/upload.php?style=$style&tab=$from_tab&post_id=$post_id" );
die;
break;
endswitch;
}
add_action( 'upload_files_upload', 'wp_upload_tab_upload_action' );
function wp_upload_grab_attachments( $obj ) {
$obj->is_attachment = true;
}
function wp_upload_posts_where( $where ) {
global $post_id;
return $where . " AND post_parent = '" . (int) $post_id . "'";
}
function wp_upload_tab_browse() {
global $wpdb, $action, $paged;
$old_vars = compact( 'paged' );
switch ( $action ) :
case 'edit' :
case 'view' :
global $ID;
$attachments = query_posts("attachment_id=$ID");
if ( have_posts() ) : while ( have_posts() ) : the_post();
'edit' == $action ? wp_upload_form() : wp_upload_view();
endwhile; endif;
break;
default :
global $tab, $post_id, $style;
add_action( 'pre_get_posts', 'wp_upload_grab_attachments' );
if ( 'browse' == $tab && $post_id )
add_filter( 'posts_where', 'wp_upload_posts_where' );
$attachments = query_posts("what_to_show=posts&posts_per_page=10&paged=$paged");
$count_query = "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'attachment'";
if ( $post_id )
$count_query .= " AND post_parent = '$post_id'";
$total = $wpdb->get_var($count_query);
echo "<ul id='upload-files'>\n";
if ( have_posts() ) : while ( have_posts() ) : the_post();
$href = wp_specialchars( add_query_arg( array(
'action' => 'inline' == $style ? 'view' : 'edit',
'ID' => get_the_ID())
), 1 );
echo "\t<li id='file-";
the_ID();
echo "' class='alignleft'>\n";
echo wp_upload_display( array(128,128), $href );
echo "\t</li>\n";
endwhile;
else :
echo "\t<li>" . __('There are no attachments to show.') . "</li>\n";
endif;
echo "</ul>\n\n";
echo "<form action='' id='browse-form'><input type='hidden' id='nonce-value' value='" . wp_create_nonce( 'inlineuploading' ) . "' /></form>\n";
break;
endswitch;
extract($old_vars);
}
function wp_upload_tab_browse_action() {
global $style;
if ( 'inline' == $style )
wp_enqueue_script('upload');
}
add_action( 'upload_files_browse', 'wp_upload_tab_browse_action' );
add_action( 'upload_files_browse-all', 'wp_upload_tab_browse_action' );
function wp_upload_admin_head() {
global $wp_locale;
echo "<link rel='stylesheet' href='" . get_option('siteurl') . '/wp-admin/upload.css?version=' . get_bloginfo('version') . "' type='text/css' />\n";
if ( 'rtl' == $wp_locale->text_direction )
echo "<link rel='stylesheet' href='" . get_option('siteurl') . '/wp-admin/upload-rtl.css?version=' . get_bloginfo('version') . "' type='text/css' />\n";
if ( 'inline' == @$_GET['style'] ) {
echo "<style type='text/css'>\n";
echo "\tbody { height: 14em; overflow: hidden; }\n";
echo "\t#upload-content { overflow-y: auto; }\n";
echo "\t#upload-file { position: absolute; }\n";
echo "</style>";
}
}

View File

@ -1,242 +1,239 @@
<?php require_once('admin.php'); cache_javascript_headers(); ?>
addLoadEvent( function() {
theFileList = {
currentImage: {ID: 0},
nonce: '',
tab: '',
postID: 0,
initializeVars: function() {
this.urlData = document.location.href.split('?');
this.params = this.urlData[1].toQueryParams();
this.postID = this.params['post_id'];
this.tab = this.params['tab'];
this.style = this.params['style'];
this.ID = this.params['ID'];
if ( !this.style )
this.style = 'default';
var nonceEl = $('nonce-value');
if ( nonceEl )
this.nonce = nonceEl.value;
if ( this.ID ) {
this.grabImageData( this.ID );
this.imageView( this.ID );
}
},
initializeLinks: function() {
if ( this.ID )
return;
$$('a.file-link').each( function(i) {
var id = i.id.split('-').pop();
i.onclick = function(e) { theFileList[ 'inline' == theFileList.style ? 'imageView' : 'editView' ](id, e); }
} );
},
grabImageData: function(id) {
if ( id == this.currentImage.ID )
return;
var thumbEl = $('attachment-thumb-url-' + id);
if ( thumbEl )
this.currentImage.thumb = ( 0 == id ? '' : thumbEl.value );
else
this.currentImage.thumb = false;
this.currentImage.src = ( 0 == id ? '' : $('attachment-url-' + id).value );
this.currentImage.page = ( 0 == id ? '' : $('attachment-page-url-' + id).value );
this.currentImage.title = ( 0 == id ? '' : $('attachment-title-' + id).value );
this.currentImage.description = ( 0 == id ? '' : $('attachment-description-' + id).value );
var widthEl = $('attachment-width-' + id);
if ( widthEl ) {
this.currentImage.width = ( 0 == id ? '' : widthEl.value );
this.currentImage.height = ( 0 == id ? '' : $('attachment-height-' + id).value );
} else {
this.currentImage.width = false;
this.currentImage.height = false;
}
this.currentImage.ID = id;
},
imageView: function(id, e) {
this.prepView(id);
var h = '';
h += "<div id='upload-file'>"
h += "<div id='file-title'>"
if ( !this.currentImage.thumb )
h += "<h2><a href='" + this.currentImage.src + "' title='Direct link to file'>" + this.currentImage.title + "</a></h2>";
else
h += "<h2>" + this.currentImage.title + "</h2>";
h += "<span>[&nbsp;";
h += "<a href='#' onclick='theFileList.editView(" + id + ")'>edit</a>"
h += '&nbsp;|&nbsp;';
if ( this.ID ) {
var params = $H(this.params);
params.ID = '';
params.action = '';
h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "' title='Browse your files'>cancel</a>";
} else {
h += "<a href='#' onclick='theFileList.cancelView()' title='Browse your files'>cancel</a>";
}
h += "&nbsp;]</span>";
h += '</div>'
h += "<div id='upload-file-view' class='alignleft'>";
if ( this.currentImage.thumb )
h += "<a href='" + this.currentImage.src + "' title='Direct link to file'><img src='" + this.currentImage.thumb + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' /></a>";
else
h += '&nbsp;';
h += "</div>";
h += "<form name='uploadoptions' id='uploadoptions' class='alignleft'>";
h += "<table>";
if ( this.currentImage.thumb ) {
h += "<tr><th style='padding-bottom:.5em'>Show</th><td style='padding-bottom:.5em'>";
h += "<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' checked='checked' /> thumbnail</label><br />";
h += "<label for='display-full'><input type='radio' name='display' id='display-full' value='full' /> full size</label>";
h += "</td></tr>";
}
h += "<tr><th>Link</th><td>";
h += "<label for='link-file'><input type='radio' name='link' id='link-file' value='file' checked='checked'/> file</label><br />";
h += "<label for='link-page'><input type='radio' name='link' id='link-page' value='page' /> page</label><br />";
h += "<label for='link-none'><input type='radio' name='link' id='link-none' value='none' /> none</label>";
h += "</td></tr>";
h += "<tr><td colspan='2'>";
h += "<input type='button' class='button' name='send' onclick='theFileList.sendToEditor(" + id + ")' value='Send to editor &raquo;' />";
h += "</td></tr></table>";
h += "</form>";
h += "</div>";
new Insertion.Top('upload-content', h);
if (e) Event.stop(e);
return false;
},
editView: function(id, e) {
this.prepView(id);
var h = '';
var action = 'upload.php?style=' + this.style + '&amp;tab=upload';
if ( this.postID )
action += '&amp;post_id=' + this.postID;
h += "<form id='upload-file' method='post' action='" + action + "'>";
h += "<div id='file-title'>"
if ( !this.currentImage.thumb )
h += "<h2><a href='" + this.currentImage.src + "' title='Direct link to file'>" + this.currentImage.title + "</a></h2>";
else
h += "<h2>" + this.currentImage.title + "</h2>";
h += "<span>[&nbsp;";
h += "<a href='#' onclick='theFileList.imageView(" + id + ")'>options</a>"
h += '&nbsp;|&nbsp;';
if ( this.ID ) {
var params = $H(this.params);
params.ID = '';
params.action = '';
h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "' title='Browse your files'>cancel</a>";
} else {
h += "<a href='#' onclick='theFileList.cancelView()' title='Browse your files'>cancel</a>";
}
h += "&nbsp;]</span>";
h += '</div>'
h += "<div id='upload-file-view' class='alignleft'>";
if ( this.currentImage.thumb )
h += "<a href='" + this.currentImage.src + "' title='Direct link to file'><img src='" + this.currentImage.thumb + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' /></a>";
else
h += '&nbsp;';
h += "</div>";
h += "<table><tr>"
h += "<th scope='row'><label for='post_title'>Title:</label></th>";
h += "<td><input type='text' id='post_title' name='post_title' value='" + this.currentImage.title + "' /></td>";
h += "</tr><tr>";
h += "<th scope='row'><label for='post_content'>Description:</label></th>";
h += "<td><textarea name='post_content' id='post_content'>" + this.currentImage.description + "</textarea></td>";
h += "</tr><tr id='buttons'><th></th><td>";
h += "<input type='hidden' name='from_tab' value='" + this.tab + "' />";
h += "<input type='hidden' name='action' id='action-value' value='save' />";
h += "<input type='hidden' name='ID' value='" + id + "' />";
h += "<input type='hidden' name='_wpnonce' value='" + this.nonce + "' />";
h += "<div class='submit'><input type='submit' value='Save' />";
h += "<input type='button' name='delete' class='delete' value='Delete' onclick='theFileList.deleteFile(" + id + ");' />";
h += "</div></td></tr></table></form>";
new Insertion.Top('upload-content', h);
if (e) Event.stop(e);
return false;
},
prepView: function(id) {
this.cancelView( true );
var filesEl = $('upload-files');
if ( filesEl )
filesEl.hide();
var navEl = $('current-tab-nav');
if ( navEl )
navEl.hide();
this.grabImageData(id);
},
cancelView: function( prep ) {
if ( !prep ) {
var filesEl = $('upload-files');
if ( filesEl )
filesEl.show();
var navEl = $('current-tab-nav');
if ( navEl )
navEl.show();
}
if ( !this.ID )
this.grabImageData(0);
var div = $('upload-file');
if ( div )
div.remove();
return false;
},
sendToEditor: function(id) {
this.grabImageData(id);
var link = '';
var display = '';
var h = '';
link = $A(document.forms.uploadoptions.elements.link).detect( function(i) { return i.checked; } ).value;
displayEl = $A(document.forms.uploadoptions.elements.display).detect( function(i) { return i.checked; } )
if ( displayEl )
display = displayEl.value;
if ( 'none' != link )
h += "<a href='" + ( 'file' == link ? this.currentImage.src : this.currentImage.page ) + "' title='" + this.currentImage.title + "'>";
if ( display )
h += "<img src='" + ( 'thumb' == display ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' />";
else
h += this.currentImage.title;
if ( 'none' != link )
h += "</a>";
var win = window.opener ? window.opener : window.dialogArguments;
if ( !win )
win = top;
tinyMCE = win.tinyMCE;
if ( typeof tinyMCE != 'undefined' && tinyMCE.getInstanceById('content') )
win.tinyMCE.execCommand('mceInsertContent', false, h);
else
win.edInsertContent(win.edCanvas, h);
this.cancelView();
return false;
},
deleteFile: function(id) {
if ( confirm("Are you sure you want to delete the file '" + this.currentImage.title + "'?\nClick ok to delete or cancel to go back.") ) {
$('action-value').value = 'delete';
$('upload-file').submit();
return true;
}
return false;
}
};
theFileList.initializeVars();
theFileList.initializeLinks();
} );
<?php require_once('admin.php'); cache_javascript_headers(); ?>
addLoadEvent( function() {
theFileList = {
currentImage: {ID: 0},
nonce: '',
tab: '',
postID: 0,
initializeVars: function() {
this.urlData = document.location.href.split('?');
this.params = this.urlData[1].toQueryParams();
this.postID = this.params['post_id'];
this.tab = this.params['tab'];
this.style = this.params['style'];
this.ID = this.params['ID'];
if ( !this.style )
this.style = 'default';
var nonceEl = $('nonce-value');
if ( nonceEl )
this.nonce = nonceEl.value;
if ( this.ID ) {
this.grabImageData( this.ID );
this.imageView( this.ID );
}
},
initializeLinks: function() {
if ( this.ID )
return;
$$('a.file-link').each( function(i) {
var id = i.id.split('-').pop();
i.onclick = function(e) { theFileList[ 'inline' == theFileList.style ? 'imageView' : 'editView' ](id, e); }
} );
},
grabImageData: function(id) {
if ( id == this.currentImage.ID )
return;
var thumbEl = $('attachment-thumb-url-' + id);
if ( thumbEl )
this.currentImage.thumb = ( 0 == id ? '' : thumbEl.value );
else
this.currentImage.thumb = false;
this.currentImage.src = ( 0 == id ? '' : $('attachment-url-' + id).value );
this.currentImage.page = ( 0 == id ? '' : $('attachment-page-url-' + id).value );
this.currentImage.title = ( 0 == id ? '' : $('attachment-title-' + id).value );
this.currentImage.description = ( 0 == id ? '' : $('attachment-description-' + id).value );
var widthEl = $('attachment-width-' + id);
if ( widthEl ) {
this.currentImage.width = ( 0 == id ? '' : widthEl.value );
this.currentImage.height = ( 0 == id ? '' : $('attachment-height-' + id).value );
} else {
this.currentImage.width = false;
this.currentImage.height = false;
}
this.currentImage.ID = id;
},
imageView: function(id, e) {
this.prepView(id);
var h = '';
h += "<div id='upload-file'>"
if ( this.ID ) {
var params = $H(this.params);
params.ID = '';
params.action = '';
h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "' title='Browse your files' class='back'>&laquo; Back</a>";
} else {
h += "<a href='#' onclick='theFileList.cancelView()' title='Browse your files' class='back'>&laquo; Back</a>";
}
h += "<div id='file-title'>"
if ( !this.currentImage.thumb )
h += "<h2><a href='" + this.currentImage.src + "' title='Direct link to file'>" + this.currentImage.title + "</a></h2>";
else
h += "<h2>" + this.currentImage.title + "</h2>";
h += " &#8212; <span>";
h += "<a href='#' onclick='theFileList.editView(" + id + ")'>Edit</a>"
h += "</span>";
h += '</div>'
h += "<div id='upload-file-view' class='alignleft'>";
if ( this.currentImage.thumb )
h += "<a href='" + this.currentImage.src + "' title='Direct link to file'><img src='" + this.currentImage.thumb + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' /></a>";
else
h += '&nbsp;';
h += "</div>";
h += "<form name='uploadoptions' id='uploadoptions' class='alignleft'>";
h += "<table>";
if ( this.currentImage.thumb ) {
h += "<tr><th style='padding-bottom:.5em'>Show:</th><td style='padding-bottom:.5em'>";
h += "<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' checked='checked' /> Thumbnail</label><br />";
h += "<label for='display-full'><input type='radio' name='display' id='display-full' value='full' /> Full size</label>";
h += "</td></tr>";
}
h += "<tr><th>Link to:</th><td>";
h += "<label for='link-file'><input type='radio' name='link' id='link-file' value='file' checked='checked'/> File</label><br />";
h += "<label for='link-page'><input type='radio' name='link' id='link-page' value='page' /> Page</label><br />";
h += "<label for='link-none'><input type='radio' name='link' id='link-none' value='none' /> None</label>";
h += "</td></tr>";
h += "<tr><td colspan='2'><p class='submit'>";
h += "<input type='button' class='button' name='send' onclick='theFileList.sendToEditor(" + id + ")' value='Send to editor &raquo;' />";
h += "</p></td></tr></table>";
h += "</form>";
h += "</div>";
new Insertion.Top('upload-content', h);
if (e) Event.stop(e);
return false;
},
editView: function(id, e) {
this.prepView(id);
var h = '';
var action = 'upload.php?style=' + this.style + '&amp;tab=upload';
if ( this.postID )
action += '&amp;post_id=' + this.postID;
h += "<form id='upload-file' method='post' action='" + action + "'>";
if ( this.ID ) {
var params = $H(this.params);
params.ID = '';
params.action = '';
h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "' title='Browse your files' class='back'>&laquo; Back</a>";
} else {
h += "<a href='#' onclick='theFileList.cancelView()' title='Browse your files' class='back'>&laquo; Back</a>";
}
h += "<div id='file-title'>"
if ( !this.currentImage.thumb )
h += "<h2><a href='" + this.currentImage.src + "' title='Direct link to file'>" + this.currentImage.title + "</a></h2>";
else
h += "<h2>" + this.currentImage.title + "</h2>";
h += " &#8212; <span>";
h += "<a href='#' onclick='theFileList.imageView(" + id + ")'>Insert</a>"
h += "</span>";
h += '</div>'
h += "<div id='upload-file-view' class='alignleft'>";
if ( this.currentImage.thumb )
h += "<a href='" + this.currentImage.src + "' title='Direct link to file'><img src='" + this.currentImage.thumb + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' /></a>";
else
h += '&nbsp;';
h += "</div>";
h += "<table><tr>"
h += "<th scope='row'><label for='post_title'>Title:</label></th>";
h += "<td><input type='text' id='post_title' name='post_title' value='" + this.currentImage.title + "' /></td>";
h += "</tr><tr>";
h += "<th scope='row'><label for='post_content'>Description:</label></th>";
h += "<td><textarea name='post_content' id='post_content'>" + this.currentImage.description + "</textarea></td>";
h += "</tr><tr id='buttons'><th><input type='button' name='delete' class='delete button' value='Delete' onclick='theFileList.deleteFile(" + id + ");' /></th><td>";
h += "<input type='hidden' name='from_tab' value='" + this.tab + "' />";
h += "<input type='hidden' name='action' id='action-value' value='save' />";
h += "<input type='hidden' name='ID' value='" + id + "' />";
h += "<input type='hidden' name='_wpnonce' value='" + this.nonce + "' />";
h += "<div class='submit'><input type='submit' value='Save &raquo;' />";
h += "</div></td></tr></table></form>";
new Insertion.Top('upload-content', h);
if (e) Event.stop(e);
return false;
},
prepView: function(id) {
this.cancelView( true );
var filesEl = $('upload-files');
if ( filesEl )
filesEl.hide();
var navEl = $('current-tab-nav');
if ( navEl )
navEl.hide();
this.grabImageData(id);
},
cancelView: function( prep ) {
if ( !prep ) {
var filesEl = $('upload-files');
if ( filesEl )
filesEl.show();
var navEl = $('current-tab-nav');
if ( navEl )
navEl.show();
}
if ( !this.ID )
this.grabImageData(0);
var div = $('upload-file');
if ( div )
div.remove();
return false;
},
sendToEditor: function(id) {
this.grabImageData(id);
var link = '';
var display = '';
var h = '';
link = $A(document.forms.uploadoptions.elements.link).detect( function(i) { return i.checked; } ).value;
displayEl = $A(document.forms.uploadoptions.elements.display).detect( function(i) { return i.checked; } )
if ( displayEl )
display = displayEl.value;
if ( 'none' != link )
h += "<a href='" + ( 'file' == link ? this.currentImage.src : this.currentImage.page ) + "' title='" + this.currentImage.title + "'>";
if ( display )
h += "<img src='" + ( 'thumb' == display ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' />";
else
h += this.currentImage.title;
if ( 'none' != link )
h += "</a>";
var win = window.opener ? window.opener : window.dialogArguments;
if ( !win )
win = top;
tinyMCE = win.tinyMCE;
if ( typeof tinyMCE != 'undefined' && tinyMCE.getInstanceById('content') )
win.tinyMCE.execCommand('mceInsertContent', false, h);
else
win.edInsertContent(win.edCanvas, h);
this.cancelView();
return false;
},
deleteFile: function(id) {
if ( confirm("Are you sure you want to delete the file '" + this.currentImage.title + "'?\nClick ok to delete or cancel to go back.") ) {
$('action-value').value = 'delete';
$('upload-file').submit();
return true;
}
return false;
}
};
theFileList.initializeVars();
theFileList.initializeLinks();
} );

View File

@ -1,137 +1,175 @@
body { background: #dfe8f1; }
.upload-file-data { display: none; }
#upload-menu {
background: #fff;
margin: 0px;
padding: 0;
list-style: none;
height: 2em;
border-bottom: 1px solid #448abd;
width: 100%;
}
#upload-menu li { margin: 0 0 0 .75em; }
#upload-menu li div {
color: #000;
padding: 5px;
border-top: 3px solid #fff;
}
#upload-menu li a {
color: #000;
text-decoration: none;
border-bottom: none;
}
#upload-menu li span a.page-numbers { color: #00019b; }
#upload-menu .current div {
background: #dfe8f1;
border-right: 2px solid #448abd;
}
#upload-menu div:hover {
background: #dfe8f1;
color: #000;
}
#upload-content {
position: relative;
clear: both;
margin: 0;
padding: 0;
border: none;
width: 100%;
height: 100%;
background: none;
}
#upload-file {
position: relative;
margin: 0;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #dfe8f1;
}
form#upload-file input, form#upload-file textarea, div#upload-content.upload table { width: 100%; }
form#upload-file div.submit input { width: auto; }
#upload-file-view { padding: 0 0 0 15px; }
#file-title {
margin: 0 0 .2em 15px;
padding: 0;
display: block;
}
h2 {
margin: 0 .2em 0 0;
padding: 0;
display: inline;
border: none;
color: #000;
font-weight: bold;
font-size: 1.4em;
line-height: 1.4em;
}
#upload-files {
list-style-type: none;
margin: 0;
padding: 15px 0 0;
}
#upload-files li { margin: 0 0 15px 15px; }
#upload-files a, #upload-file-view a, a.file-link {
border: none;
text-decoration: none;
}
#upload-file-view a img { padding-bottom: .2em; border-bottom: 1px solid #6699CC; }
#upload-files a.file-link {
display: block;
width: 130px;
height: 128px;
background-color: rgb(209, 226, 239);
text-align: center;
overflow-y: hidden;
}
#upload-files a.file-link.image {
line-height: 128px;
font-size: 2px;
letter-spacing: 0;
}
#upload-files a.file-link img { vertical-align: middle; }
#the-attachment-links { float: right; }
#the-attachment-links textarea {
font-size: 10px;
overflow: hidden;
}
form table { float: none; padding: 0 15px; }
table {
float: left;
margin: 0;
padding: 0;
}
th { text-align: right; vertical-align: text-top; }
tr, td, th {
margin-top: 0;
padding-top: 0;
}
body { background: #f9fcfe; }
.upload-file-data { display: none; }
#upload-menu {
background: #247fab;
margin: 0px;
padding: 0;
list-style: none;
height: 2em;
border-bottom: 1px solid #448abd;
width: 100%;
}
#upload-menu li { margin: 0 0 0 .75em; }
#upload-menu li div {
padding: 5px;
border-top: 3px solid #247fab;
}
#upload-menu li a {
text-decoration: none;
border-bottom: none;
color: #fff;
}
#upload-menu li span a.page-numbers { color: #00019b; }
#upload-menu .current div {
background: #f9fcfe;
border-right: 2px solid #448abd;
color: #000;
}
#upload-menu .current div a, #upload-menu div:hover a {
color: #000;
}
#upload-menu div:hover {
background: #f9fcfe;
color: #000;
}
#upload-content {
position: relative;
clear: both;
margin: 0;
padding: 0;
border: none;
width: 100%;
height: 100%;
background: none;
}
#upload-file {
margin: 0 auto;
top: 0;
left: 0;
width: 45em;
height: 100%;
background: #f9fcfe;
}
#upload-file th {
width: 8em;
}
form#upload-file input, form#upload-file textarea, div#upload-content.upload table { width: 100%; }
form#upload-file div.submit input { width: auto; }
#upload-file-view { padding: 0 0 0 75px; }
#file-title {
margin: 0 0 .2em 75px;
padding: 0;
display: block;
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 16px;
}
h2 {
margin: 0 .2em 0 0;
padding: 0;
display: inline;
border: none;
color: #000;
font-size: 1.4em;
line-height: 1.4em;
}
.back {
display: block;
position: absolute;
left: 14px;
top: 10px;
}
#upload-files {
list-style-type: none;
margin: 0;
padding: 15px 0 0;
}
#upload-files li { margin: 0 0 15px 15px; }
#upload-files a, #upload-file-view a, a.file-link {
border: none;
text-decoration: none;
}
#upload-file-view a img { padding-bottom: .2em; border-bottom: 1px solid #6699CC; }
#upload-files a.file-link {
display: block;
width: 130px;
height: 128px;
background-color: rgb(209, 226, 239);
text-align: center;
overflow: hidden;
}
#upload-files a.text {
padding-top: 40px;
height: 88px;
font-size: 16px;
}
#upload-files a.file-link.image {
line-height: 128px;
font-size: 2px;
letter-spacing: 0;
}
#upload-files a.file-link img { vertical-align: middle; }
#the-attachment-links { float: right; }
#the-attachment-links textarea {
font-size: 10px;
overflow: hidden;
}
form table { float: none; padding: 0 15px; }
table {
float: left;
margin: 0;
padding: 0;
}
th { text-align: right; vertical-align: text-top; }
tr, td, th {
margin-top: 0;
padding-top: 0;
}
#uploadoptions th {
width: 80px;
}
#uploadoptions p {
margin: 0;
padding: 0;
}
#uploadoptions td {
padding-left: 1em;
line-height: 140%;
}
#uploadoptions table {
width: 300px;
}

View File

@ -71,6 +71,7 @@ function addLoadEvent(func) {if ( typeof wpOnload!='function'){wpOnload=func;}el
else :
add_action( 'admin_head', 'wp_upload_admin_head' );
include_once('admin-header.php');
echo "<div class='wrap'>";
endif;
echo "<ul id='upload-menu'>\n";
@ -116,6 +117,7 @@ call_user_func( $wp_upload_tabs[$tab][2] );
echo "</div>\n";
if ( 'inline' != $style ) :
echo "<div class='clear'></div></div>";
include_once('admin-footer.php');
else : ?>
<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>

View File

@ -64,8 +64,6 @@ class WP_User_Search {
}
$this->query_from_where = "FROM $wpdb->users WHERE 1=1 $search_sql";
if ( !$_GET['update'] && !$this->search_term && !$this->raw_page && $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users") > $this->users_per_page )
$this->too_many_total_users = sprintf(__('Because this blog has more than %s users, they cannot all be shown on one page. Use the paging or search functionality in order to find the user you want to edit.'), $this->users_per_page);
}
function query() {
@ -326,12 +324,6 @@ default:
</div>
<?php endif; ?>
<?php if ( $wp_user_search->too_many_total_users ) : ?>
<div id="message" class="updated">
<p><?php echo $wp_user_search->too_many_total_users; ?></p>
</div>
<?php endif; ?>
<div class="wrap">
<?php if ( $wp_user_search->is_search() ) : ?>
@ -341,7 +333,7 @@ default:
<?php endif; ?>
<form action="" method="get" name="search" id="search">
<p><input type="text" name="usersearch" id="usersearch" value="<?php echo wp_specialchars($wp_user_search->search_term, 1); ?>" /> <input type="submit" value="<?php _e('Search for users &raquo;'); ?>" /></p>
<p><input type="text" name="usersearch" id="usersearch" value="<?php echo wp_specialchars($wp_user_search->search_term, 1); ?>" /> <input type="submit" value="<?php _e('Search users &raquo;'); ?>" class="button" /></p>
</form>
<?php if ( is_wp_error( $wp_user_search->search_errors ) ) : ?>
@ -362,10 +354,14 @@ default:
<p><a href="users.php"><?php _e('&laquo; Back to All Users'); ?></a></p>
<?php endif; ?>
<h3><?php printf(__('%1$s &#8211; %2$s of %3$s shown below'), $wp_user_search->first_user + 1, min($wp_user_search->first_user + $wp_user_search->users_per_page, $wp_user_search->total_users_for_query), $wp_user_search->total_users_for_query); ?></h3>
<h3><?php
if ( 0 == $wp_user_search->first_user && $wp_user_search->total_users_for_query <= 50 )
printf(__('%3$s shown below'), $wp_user_search->first_user + 1, min($wp_user_search->first_user + $wp_user_search->users_per_page, $wp_user_search->total_users_for_query), $wp_user_search->total_users_for_query);
else
printf(__('%1$s &#8211; %2$s of %3$s shown below'), $wp_user_search->first_user + 1, min($wp_user_search->first_user + $wp_user_search->users_per_page, $wp_user_search->total_users_for_query), $wp_user_search->total_users_for_query); ?></h3>
<?php if ( $wp_user_search->results_are_paged() ) : ?>
<div class="user-paging-text"><?php $wp_user_search->page_links(); ?></p></div>
<div class="user-paging-text"><p><?php $wp_user_search->page_links(); ?></p></div>
<?php endif; ?>
<form action="" method="post" name="updateusers" id="updateusers">
@ -405,7 +401,7 @@ foreach ( (array) $roleclass as $user_object ) {
</table>
<?php if ( $wp_user_search->results_are_paged() ) : ?>
<div class="user-paging-text"><?php $wp_user_search->page_links(); ?></div>
<div class="user-paging-text"><p><?php $wp_user_search->page_links(); ?></p></div>
<?php endif; ?>
<h3><?php _e('Update Selected'); ?></h3>
@ -436,6 +432,7 @@ foreach ( (array) $roleclass as $user_object ) {
<div class="wrap">
<h2 id="add-new-user"><?php _e('Add New User') ?></h2>
<div class="narrow">
<?php echo '<p>'.sprintf(__('Users can <a href="%1$s">register themselves</a> or you can manually create users here.'), get_option('siteurl').'/wp-register.php').'</p>'; ?>
<form action="#add-new-user" method="post" name="adduser" id="adduser">
<?php wp_nonce_field('add-user') ?>
@ -486,6 +483,7 @@ foreach ( (array) $roleclass as $user_object ) {
<?php echo $referer; ?>
<input name="adduser" type="submit" id="addusersub" value="<?php _e('Add User &raquo;') ?>" />
</p>
</div>
</form>
<?php if ( is_wp_error( $add_user_errors ) ) : ?>

View File

@ -20,6 +20,12 @@ a.delete:hover {
color: #fff;
}
#devnews h4 {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 18px;
font-weight: normal;
}
#planetnews ul {
list-style: none;
margin: 0;
@ -40,6 +46,23 @@ a.delete:hover {
overflow: hidden;
}
#planetnews li .post {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 18px;
display: block;
height: 60px;
}
#planetnews .hidden {
display: none;
}
.readmore {
clear: both;
text-align: right;
margin-right: 5em;
}
.widefat {
width: 100%;
}
@ -52,6 +75,15 @@ a.delete:hover {
text-align: left;
}
.plugins p {
margin: 4px;
padding: 0;
}
.plugins .name {
font-size: 16px;
}
.import-system {
font-size: 16px;
}
@ -61,9 +93,9 @@ thead, .thead {
}
#import-upload-form {
width: 300px;
margin: auto;
text-align: center;
background: #eee;
padding: 1em;
}
a.edit, a.delete, a.edit:hover, a.delete:hover {
@ -133,25 +165,12 @@ form, label input {
}
h2 {
border-bottom: .5em solid #f0f8ff;
border-bottom: .5em solid #e5f3ff;
color: #333;
font: normal 30px/5px serif;
font: normal 32px/5px serif;
margin: 5px 10px;
}
h2 small.quickjump {
display: block;
text-align: right;
}
h2 small.quickjump a {
text-decoration: none;
border-bottom: 0;
font-size: 15px;
background: #f0f8ff;
padding: 5px 10px;
}
img, #footer a {
border: 0;
}
@ -170,7 +189,7 @@ li, dd {
}
p, li, dl, dd, dt {
line-height: 130%;
line-height: 140%;
}
textarea, input, select {
@ -306,7 +325,7 @@ form#upload #post_content {
font: 12px Georgia, "Times New Roman", Times, serif;
}
.submit input, .submit input:focus, .button {
.submit input, .submit input:focus, .button, .button:focus {
background: url( images/fade-butt.png );
border: 3px double #999;
border-left-color: #ccc;
@ -322,6 +341,14 @@ form#upload #post_content {
border-top-color: #999;
}
.button, .button:focus {
padding: 0.15em;
}
* html .button {
padding: 0;
}
.submit, .editform th, #postcustomsubmit {
text-align: right;
}
@ -388,14 +415,27 @@ form#upload #post_content {
border: 1px solid #ccc;
clear: both;
margin: 15px 5%;
padding: .5em 1em;
padding: 1em;
}
.narrow {
width: 450px;
margin: auto;
}
.narrow p {
line-height: 150%;
}
.wrap h2 {
margin: .8em 0 .5em;
margin: .4em 0 .5em;
clear: both;
}
* html .wrap h2 {
margin-top: 1em;
}
table .vers {
text-align: center;
}
@ -411,6 +451,7 @@ textarea.all-options, input.all-options {
padding: .2em .2em .3em 2em;
}
#adminmenu .current, #submenu .current {
font-weight: bold;
text-decoration: none;
@ -422,7 +463,6 @@ textarea.all-options, input.all-options {
font-weight: normal;
margin: 0;
padding: 3px 5px;
text-decoration: underline;
border-bottom: none;
}
@ -438,11 +478,24 @@ textarea.all-options, input.all-options {
text-align: center;
}
#submenu {
#adminmenu a.current {
background: #0d324f;
border-right: 2px solid #4f96c8;
border-top: 1px solid #96c0de;
color: #fff;
padding-bottom: 8px;
}
#submenu, #minisub {
background: #0d324f;
border-bottom: none;
margin: 0;
padding: 3px 2em 0 3em;
height: 25px;
}
#minisub {
height: 6px;
}
#submenu .current {
@ -456,7 +509,7 @@ textarea.all-options, input.all-options {
border: none;
color: #fff;
font-size: 12px;
padding: .3em .4em .33em;
padding: .3em .4em .4em;
}
#submenu a:hover {
@ -465,7 +518,7 @@ textarea.all-options, input.all-options {
}
#submenu li {
line-height: 170%;
line-height: 180%;
}
@ -493,6 +546,11 @@ textarea.all-options, input.all-options {
width: 100%;
}
#postdivrich #content {
padding: .7em;
line-height: 140%;
}
#titlediv input, #guiddiv input {
margin: 0px;
width: 100%;
@ -563,7 +621,8 @@ input.delete:hover {
}
#title {
font-size: 1.5em;
font-size: 1.7em;
padding: 4px;
}
#postexcerpt div, #attachmentlinks div {
@ -589,6 +648,23 @@ input.delete:hover {
#footer {
clear: both;
text-align: center;
width: 500px;
margin: auto;
height: 100px;
}
#footer .docs {
padding-top: 19px;
line-height: 160%;
}
#footer .docs a {
text-decoration: underline;
}
#footer .logo {
float: left;
margin: 0;
padding: 0;
}
#login {
@ -698,6 +774,8 @@ input.delete:hover {
margin: 0;
font-size: 15px;
}
.plugins p {
}
#login .fullwidth {
width: 320px;
@ -705,13 +783,13 @@ input.delete:hover {
#searchform {
float: left;
margin-right: 3em;
width: 16em;
margin-right: 1em;
width: 18em;
}
#viewarc {
float: left;
width: 20em;
width: 23em;
margin-bottom: 1em;
}
@ -763,6 +841,7 @@ input.delete:hover {
#templateside {
float: right;
width: 170px;
overflow: hidden;
}
#templateside h3, #postcustom p.submit {
@ -812,7 +891,7 @@ input.delete:hover {
#zeitgeist {
background: #eee;
border: 1px solid #69c;
border: 1px solid #c5c5c5;
float: right;
font-size: 90%;
margin-bottom: .5em;
@ -826,6 +905,10 @@ input.delete:hover {
border-bottom: none;
}
* html #zeitgeist h2 {
padding-top: 10px;
}
#zeitgeist h2 {
margin-top: .4em;
}
@ -1216,3 +1299,22 @@ input #catadd {
background: #fff url( images/fade-butt.png ) repeat-x 0px 15px;
border-bottom: 1px solid #ccc;
}
.page-numbers {
padding: 4px 7px;
border: 1px solid #fff;
margin-right: 3px;
}
a.page-numbers {
border: 1px solid #ccc;
}
a.page-numbers:hover {
border: 1px solid #999;
}
.page-numbers.current {
border: 1px solid #999;
font-weight: bold;
}

View File

@ -24,11 +24,9 @@
/* You can extend this CSS by adding your own CSS file with the the content_css option */
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 0.9em;
line-height: 1.2em;
padding: .3em;
background-color: #FFFFFF;
background: #fff;
font: 1em/1.3em Georgia, "Times New Roman", Times, serif;
padding: .5em;
}
td {