code stringlengths 1 2.01M | repo_name stringlengths 3 62 | path stringlengths 1 267 | language stringclasses 231
values | license stringclasses 13
values | size int64 1 2.01M |
|---|---|---|---|---|---|
<?php
/**
* Manage media uploaded file.
*
* There are many filters in here for media. Plugins can extend functionality
* by hooking into the filters.
*
* @package WordPress
* @subpackage Administration
*/
/** Load WordPress Administration Bootstrap */
require_once('./admin.php');
if (!current_user_can('upload_files'))
wp_die(__('You do not have permission to upload files.'));
wp_enqueue_script('plupload-handlers');
$post_id = 0;
if ( isset( $_REQUEST['post_id'] ) ) {
$post_id = absint( $_REQUEST['post_id'] );
if ( ! get_post( $post_id ) || ! current_user_can( 'edit_post', $post_id ) )
$post_id = 0;
}
if ( $_POST ) {
$location = 'upload.php';
if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
check_admin_referer('media-form');
// Upload File button was clicked
$id = media_handle_upload( 'async-upload', $post_id );
if ( is_wp_error( $id ) )
$location .= '?message=3';
}
wp_redirect( admin_url( $location ) );
exit;
}
$title = __('Upload New Media');
$parent_file = 'upload.php';
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __('You can upload media files here without creating a post first. This allows you to upload files to use with posts and pages later and/or to get a web link for a particular file that you can share. There are three options for uploading files:') . '</p>' .
'<ul>' .
'<li>' . __('<strong>Drag and drop</strong> your files into the area below. Multiple files are allowed.') . '</li>' .
'<li>' . __('Clicking <strong>Select Files</strong> opens a navigation window showing you files in your operating system. Selecting <strong>Open</strong> after clicking on the file you want activates a progress bar on the uploader screen.') . '</li>' .
'<li>' . __('Revert to the <strong>Browser Uploader</strong> by clicking the link below the drag and drop box.') . '</li>' .
'</ul>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Media_Add_New_Screen" target="_blank">Documentation on Uploading Media Files</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
require_once( ABSPATH . 'wp-admin/admin-header.php' );
$form_class = 'media-upload-form type-form validate';
if ( get_user_setting('uploader') || isset( $_GET['browser-uploader'] ) )
$form_class .= ' html-uploader';
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<form enctype="multipart/form-data" method="post" action="<?php echo admin_url('media-new.php'); ?>" class="<?php echo $form_class; ?>" id="file-form">
<?php media_upload_form(); ?>
<script type="text/javascript">
var post_id = <?php echo $post_id; ?>, shortform = 3;
</script>
<input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id; ?>" />
<?php wp_nonce_field('media-form'); ?>
<div id="media-items" class="hide-if-no-js"></div>
</form>
</div>
<?php
include( ABSPATH . 'wp-admin/admin-footer.php' );
| zyblog | trunk/zyblog/wp-admin/media-new.php | PHP | asf20 | 3,126 |
<?php
/**
* WordPress Administration Generic POST Handler.
*
* @package WordPress
* @subpackage Administration
*/
/** We are located in WordPress Administration Screens */
define('WP_ADMIN', true);
if ( defined('ABSPATH') )
require_once(ABSPATH . 'wp-load.php');
else
require_once('../wp-load.php');
require_once(ABSPATH . 'wp-admin/includes/admin.php');
nocache_headers();
do_action('admin_init');
$action = 'admin_post';
if ( !wp_validate_auth_cookie() )
$action .= '_nopriv';
if ( !empty($_REQUEST['action']) )
$action .= '_' . $_REQUEST['action'];
do_action($action);
| zyblog | trunk/zyblog/wp-admin/admin-post.php | PHP | asf20 | 590 |
<?php
/**
* Parse OPML XML files and store in globals.
*
* @package WordPress
* @subpackage Administration
*/
if ( ! defined('ABSPATH') )
die();
global $opml, $map;
// columns we wish to find are: link_url, link_name, link_target, link_description
// we need to map XML attribute names to our columns
$opml_map = array('URL' => 'link_url',
'HTMLURL' => 'link_url',
'TEXT' => 'link_name',
'TITLE' => 'link_name',
'TARGET' => 'link_target',
'DESCRIPTION' => 'link_description',
'XMLURL' => 'link_rss'
);
$map = $opml_map;
/**
* XML callback function for the start of a new XML tag.
*
* @since 0.71
* @access private
*
* @uses $updated_timestamp Not used inside function.
* @uses $all_links Not used inside function.
* @uses $map Stores names of attributes to use.
* @global array $names
* @global array $urls
* @global array $targets
* @global array $descriptions
* @global array $feeds
*
* @param mixed $parser XML Parser resource.
* @param string $tagName XML element name.
* @param array $attrs XML element attributes.
*/
function startElement($parser, $tagName, $attrs) {
global $updated_timestamp, $all_links, $map;
global $names, $urls, $targets, $descriptions, $feeds;
if ($tagName == 'OUTLINE') {
foreach (array_keys($map) as $key) {
if (isset($attrs[$key])) {
$$map[$key] = $attrs[$key];
}
}
//echo("got data: link_url = [$link_url], link_name = [$link_name], link_target = [$link_target], link_description = [$link_description]<br />\n");
// save the data away.
$names[] = $link_name;
$urls[] = $link_url;
$targets[] = $link_target;
$feeds[] = $link_rss;
$descriptions[] = $link_description;
} // end if outline
}
/**
* XML callback function that is called at the end of a XML tag.
*
* @since 0.71
* @access private
* @package WordPress
* @subpackage Dummy
*
* @param mixed $parser XML Parser resource.
* @param string $tagName XML tag name.
*/
function endElement($parser, $tagName) {
// nothing to do.
}
// Create an XML parser
$xml_parser = xml_parser_create();
// Set the functions to handle opening and closing tags
xml_set_element_handler($xml_parser, "startElement", "endElement");
if (!xml_parse($xml_parser, $opml, true)) {
echo(sprintf(__('XML error: %1$s at line %2$s'),
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
}
// Free up memory used by the XML parser
xml_parser_free($xml_parser);
| zyblog | trunk/zyblog/wp-admin/link-parse-opml.php | PHP | asf20 | 2,482 |
<?php
/**
* Options Management Administration Screen.
*
* If accessed directly in a browser this page shows a list of all saved options
* along with editable fields for their values. Serialized data is not supported
* and there is no way to remove options via this page. It is not linked to from
* anywhere else in the admin.
*
* This file is also the target of the forms in core and custom options pages
* that use the Settings API. In this case it saves the new option values
* and returns the user to their page of origin.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once('./admin.php');
$title = __('Settings');
$this_file = 'options.php';
$parent_file = 'options-general.php';
wp_reset_vars(array('action', 'option_page'));
$capability = 'manage_options';
if ( empty($option_page) ) // This is for back compat and will eventually be removed.
$option_page = 'options';
else
$capability = apply_filters( "option_page_capability_{$option_page}", $capability );
if ( !current_user_can( $capability ) )
wp_die(__('Cheatin’ uh?'));
// Handle admin email change requests
if ( is_multisite() ) {
if ( ! empty($_GET[ 'adminhash' ] ) ) {
$new_admin_details = get_option( 'adminhash' );
$redirect = 'options-general.php?updated=false';
if ( is_array( $new_admin_details ) && $new_admin_details[ 'hash' ] == $_GET[ 'adminhash' ] && !empty($new_admin_details[ 'newemail' ]) ) {
update_option( 'admin_email', $new_admin_details[ 'newemail' ] );
delete_option( 'adminhash' );
delete_option( 'new_admin_email' );
$redirect = 'options-general.php?updated=true';
}
wp_redirect( admin_url( $redirect ) );
exit;
} elseif ( ! empty( $_GET['dismiss'] ) && 'new_admin_email' == $_GET['dismiss'] ) {
delete_option( 'adminhash' );
delete_option( 'new_admin_email' );
wp_redirect( admin_url( 'options-general.php?updated=true' ) );
exit;
}
}
if ( is_multisite() && !is_super_admin() && 'update' != $action )
wp_die(__('Cheatin’ uh?'));
$whitelist_options = array(
'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string' ),
'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_whitelist', 'comment_max_links', 'moderation_keys', 'blacklist_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', 'default_comments_page', 'comment_order', 'comment_registration' ),
'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type' ),
'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'show_on_front', 'page_on_front', 'page_for_posts', 'blog_public' ),
'writing' => array( 'use_smilies', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'default_post_format' )
);
$whitelist_options['misc'] = $whitelist_options['options'] = $whitelist_options['privacy'] = array();
$mail_options = array('mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass');
if ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) )
$whitelist_options['reading'][] = 'blog_charset';
if ( !is_multisite() ) {
if ( !defined( 'WP_SITEURL' ) )
$whitelist_options['general'][] = 'siteurl';
if ( !defined( 'WP_HOME' ) )
$whitelist_options['general'][] = 'home';
$whitelist_options['general'][] = 'admin_email';
$whitelist_options['general'][] = 'users_can_register';
$whitelist_options['general'][] = 'default_role';
$whitelist_options['writing'] = array_merge($whitelist_options['writing'], $mail_options);
$whitelist_options['writing'][] = 'ping_sites';
$whitelist_options['media'][] = 'uploads_use_yearmonth_folders';
// If upload_url_path and upload_path are both default values, they're locked.
if ( get_option( 'upload_url_path' ) || ( get_option('upload_path') != 'wp-content/uploads' && get_option('upload_path') ) ) {
$whitelist_options['media'][] = 'upload_path';
$whitelist_options['media'][] = 'upload_url_path';
}
} else {
$whitelist_options['general'][] = 'new_admin_email';
$whitelist_options['general'][] = 'WPLANG';
if ( apply_filters( 'enable_post_by_email_configuration', true ) )
$whitelist_options['writing'] = array_merge($whitelist_options['writing'], $mail_options);
}
$whitelist_options = apply_filters( 'whitelist_options', $whitelist_options );
/*
* If $_GET['action'] == 'update' we are saving settings sent from a settings page
*/
if ( 'update' == $action ) {
if ( 'options' == $option_page && !isset( $_POST['option_page'] ) ) { // This is for back compat and will eventually be removed.
$unregistered = true;
check_admin_referer( 'update-options' );
} else {
$unregistered = false;
check_admin_referer( $option_page . '-options' );
}
if ( !isset( $whitelist_options[ $option_page ] ) )
wp_die( __( '<strong>ERROR</strong>: options page not found.' ) );
if ( 'options' == $option_page ) {
if ( is_multisite() && ! is_super_admin() )
wp_die( __( 'You do not have sufficient permissions to modify unregistered settings for this site.' ) );
$options = explode( ',', stripslashes( $_POST[ 'page_options' ] ) );
} else {
$options = $whitelist_options[ $option_page ];
}
// Handle custom date/time formats
if ( 'general' == $option_page ) {
if ( !empty($_POST['date_format']) && isset($_POST['date_format_custom']) && '\c\u\s\t\o\m' == stripslashes( $_POST['date_format'] ) )
$_POST['date_format'] = $_POST['date_format_custom'];
if ( !empty($_POST['time_format']) && isset($_POST['time_format_custom']) && '\c\u\s\t\o\m' == stripslashes( $_POST['time_format'] ) )
$_POST['time_format'] = $_POST['time_format_custom'];
// Map UTC+- timezones to gmt_offsets and set timezone_string to empty.
if ( !empty($_POST['timezone_string']) && preg_match('/^UTC[+-]/', $_POST['timezone_string']) ) {
$_POST['gmt_offset'] = $_POST['timezone_string'];
$_POST['gmt_offset'] = preg_replace('/UTC\+?/', '', $_POST['gmt_offset']);
$_POST['timezone_string'] = '';
}
}
if ( $options ) {
foreach ( $options as $option ) {
if ( $unregistered )
_deprecated_argument( 'options.php', '2.7', sprintf( __( 'The <code>%1$s</code> setting is unregistered. Unregistered settings are deprecated. See http://codex.wordpress.org/Settings_API' ), $option, $option_page ) );
$option = trim( $option );
$value = null;
if ( isset( $_POST[ $option ] ) ) {
$value = $_POST[ $option ];
if ( ! is_array( $value ) )
$value = trim( $value );
$value = stripslashes_deep( $value );
}
update_option( $option, $value );
}
}
/**
* Handle settings errors and return to options page
*/
// If no settings errors were registered add a general 'updated' message.
if ( !count( get_settings_errors() ) )
add_settings_error('general', 'settings_updated', __('Settings saved.'), 'updated');
set_transient('settings_errors', get_settings_errors(), 30);
/**
* Redirect back to the settings page that was submitted
*/
$goback = add_query_arg( 'settings-updated', 'true', wp_get_referer() );
wp_redirect( $goback );
exit;
}
include('./admin-header.php'); ?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php esc_html_e('All Settings'); ?></h2>
<form name="form" action="options.php" method="post" id="all-options">
<?php wp_nonce_field('options-options') ?>
<input type="hidden" name="action" value="update" />
<input type='hidden' name='option_page' value='options' />
<table class="form-table">
<?php
$options = $wpdb->get_results( "SELECT * FROM $wpdb->options ORDER BY option_name" );
foreach ( (array) $options as $option ) :
$disabled = false;
if ( $option->option_name == '' )
continue;
if ( is_serialized( $option->option_value ) ) {
if ( is_serialized_string( $option->option_value ) ) {
// this is a serialized string, so we should display it
$value = maybe_unserialize( $option->option_value );
$options_to_update[] = $option->option_name;
$class = 'all-options';
} else {
$value = 'SERIALIZED DATA';
$disabled = true;
$class = 'all-options disabled';
}
} else {
$value = $option->option_value;
$options_to_update[] = $option->option_name;
$class = 'all-options';
}
$name = esc_attr( $option->option_name );
echo "
<tr>
<th scope='row'><label for='$name'>" . esc_html( $option->option_name ) . "</label></th>
<td>";
if ( strpos( $value, "\n" ) !== false )
echo "<textarea class='$class' name='$name' id='$name' cols='30' rows='5'>" . esc_textarea( $value ) . "</textarea>";
else
echo "<input class='regular-text $class' type='text' name='$name' id='$name' value='" . esc_attr( $value ) . "'" . disabled( $disabled, true, false ) . " />";
echo "</td>
</tr>";
endforeach;
?>
</table>
<input type="hidden" name="page_options" value="<?php echo esc_attr( implode( ',', $options_to_update ) ); ?>" />
<?php submit_button( __( 'Save Changes' ), 'primary', 'Update' ); ?>
</form>
</div>
<?php
include('./admin-footer.php');
| zyblog | trunk/zyblog/wp-admin/options.php | PHP | asf20 | 9,432 |
<?php
/**
* Upgrade WordPress Page.
*
* @package WordPress
* @subpackage Administration
*/
/**
* We are upgrading WordPress.
*
* @since 1.5.1
* @var bool
*/
define( 'WP_INSTALLING', true );
/** Load WordPress Bootstrap */
require( '../wp-load.php' );
nocache_headers();
timer_start();
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
delete_site_transient('update_core');
if ( isset( $_GET['step'] ) )
$step = $_GET['step'];
else
$step = 0;
// Do it. No output.
if ( 'upgrade_db' === $step ) {
wp_upgrade();
die( '0' );
}
$step = (int) $step;
$php_version = phpversion();
$mysql_version = $wpdb->db_version();
$php_compat = version_compare( $php_version, $required_php_version, '>=' );
if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) )
$mysql_compat = true;
else
$mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' );
@header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php echo get_option( 'blog_charset' ); ?>" />
<title><?php _e( 'WordPress › Update' ); ?></title>
<?php
wp_admin_css( 'install', true );
wp_admin_css( 'ie', true );
?>
</head>
<body class="wp-core-ui">
<h1 id="logo"><a href="<?php esc_attr_e( 'http://wordpress.org/' ); ?>"><?php _e( 'WordPress' ); ?></a></h1>
<?php if ( get_option( 'db_version' ) == $wp_db_version || !is_blog_installed() ) : ?>
<h2><?php _e( 'No Update Required' ); ?></h2>
<p><?php _e( 'Your WordPress database is already up-to-date!' ); ?></p>
<p class="step"><a class="button button-large" href="<?php echo get_option( 'home' ); ?>/"><?php _e( 'Continue' ); ?></a></p>
<?php elseif ( !$php_compat || !$mysql_compat ) :
if ( !$mysql_compat && !$php_compat )
printf( __('You cannot update because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.'), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version );
elseif ( !$php_compat )
printf( __('You cannot update because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version );
elseif ( !$mysql_compat )
printf( __('You cannot update because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version );
?>
<?php else :
switch ( $step ) :
case 0:
$goback = stripslashes( wp_get_referer() );
$goback = esc_url_raw( $goback );
$goback = urlencode( $goback );
?>
<h2><?php _e( 'Database Update Required' ); ?></h2>
<p><?php _e( 'WordPress has been updated! Before we send you on your way, we have to update your database to the newest version.' ); ?></p>
<p><?php _e( 'The update process may take a little while, so please be patient.' ); ?></p>
<p class="step"><a class="button button-large" href="upgrade.php?step=1&backto=<?php echo $goback; ?>"><?php _e( 'Update WordPress Database' ); ?></a></p>
<?php
break;
case 1:
wp_upgrade();
$backto = !empty($_GET['backto']) ? stripslashes( urldecode( $_GET['backto'] ) ) : __get_option( 'home' ) . '/';
$backto = esc_url( $backto );
$backto = wp_validate_redirect($backto, __get_option( 'home' ) . '/');
?>
<h2><?php _e( 'Update Complete' ); ?></h2>
<p><?php _e( 'Your WordPress database has been successfully updated!' ); ?></p>
<p class="step"><a class="button button-large" href="<?php echo $backto; ?>"><?php _e( 'Continue' ); ?></a></p>
<!--
<pre>
<?php printf( __( '%s queries' ), $wpdb->num_queries ); ?>
<?php printf( __( '%s seconds' ), timer_stop( 0 ) ); ?>
</pre>
-->
<?php
break;
endswitch;
endif;
?>
</body>
</html>
| zyblog | trunk/zyblog/wp-admin/upgrade.php | PHP | asf20 | 4,107 |
<?php
/**
* Add Link Administration Screen.
*
* @package WordPress
* @subpackage Administration
*/
/** Load WordPress Administration Bootstrap */
require_once('./admin.php');
if ( ! current_user_can('manage_links') )
wp_die(__('You do not have sufficient permissions to add links to this site.'));
$title = __('Add New Link');
$parent_file = 'link-manager.php';
wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image',
'description', 'visible', 'target', 'category', 'link_id',
'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel',
'notes', 'linkcheck[]'));
wp_enqueue_script('link');
wp_enqueue_script('xfn');
if ( wp_is_mobile() )
wp_enqueue_script( 'jquery-touch-punch' );
$link = get_default_link_to_edit();
include('./edit-link-form.php');
require('./admin-footer.php');
| zyblog | trunk/zyblog/wp-admin/link-add.php | PHP | asf20 | 811 |
<?php
/**
* Themes administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once('./admin.php');
if ( !current_user_can('switch_themes') && !current_user_can('edit_theme_options') )
wp_die( __( 'Cheatin’ uh?' ) );
$wp_list_table = _get_list_table('WP_Themes_List_Table');
if ( current_user_can( 'switch_themes' ) && isset($_GET['action'] ) ) {
if ( 'activate' == $_GET['action'] ) {
check_admin_referer('switch-theme_' . $_GET['stylesheet']);
$theme = wp_get_theme( $_GET['stylesheet'] );
if ( ! $theme->exists() || ! $theme->is_allowed() )
wp_die( __( 'Cheatin’ uh?' ) );
switch_theme( $theme->get_stylesheet() );
wp_redirect( admin_url('themes.php?activated=true') );
exit;
} elseif ( 'delete' == $_GET['action'] ) {
check_admin_referer('delete-theme_' . $_GET['stylesheet']);
$theme = wp_get_theme( $_GET['stylesheet'] );
if ( !current_user_can('delete_themes') || ! $theme->exists() )
wp_die( __( 'Cheatin’ uh?' ) );
delete_theme($_GET['stylesheet']);
wp_redirect( admin_url('themes.php?deleted=true') );
exit;
}
}
$wp_list_table->prepare_items();
$title = __('Manage Themes');
$parent_file = 'themes.php';
if ( current_user_can( 'switch_themes' ) ) :
$help_manage = '<p>' . __('Aside from the default theme included with your WordPress installation, themes are designed and developed by third parties.') . '</p>' .
'<p>' . __('You can see your active theme at the top of the screen. Below are the other themes you have installed that are not currently in use. You can see what your site would look like with one of these themes by clicking the Live Preview link (see "Previewing and Customizing" help tab). To change themes, click the Activate link.') . '</p>';
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' => $help_manage
) );
if ( current_user_can( 'install_themes' ) ) {
if ( is_multisite() ) {
$help_install = '<p>' . __('Installing themes on Multisite can only be done from the Network Admin section.') . '</p>';
} else {
$help_install = '<p>' . sprintf( __('If you would like to see more themes to choose from, click on the “Install Themes” tab and you will be able to browse or search for additional themes from the <a href="%s" target="_blank">WordPress.org Theme Directory</a>. Themes in the WordPress.org Theme Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they’re free!'), 'http://wordpress.org/extend/themes/' ) . '</p>';
}
get_current_screen()->add_help_tab( array(
'id' => 'adding-themes',
'title' => __('Adding Themes'),
'content' => $help_install
) );
}
add_thickbox();
endif; // switch_themes
if ( current_user_can( 'edit_theme_options' ) ) {
$help_customize =
'<p>' . __('Click on the "Live Preview" link under any theme to preview that theme and change theme options in a separate, full-screen view. Any installed theme can be previewed and customized in this way.') . '</p>'.
'<p>' . __('The theme being previewed is fully interactive — navigate to different pages to see how the theme handles posts, archives, and other page templates.') . '</p>' .
'<p>' . __('In the left-hand pane you can edit the theme settings. The settings will differ, depending on what theme features the theme being previewed supports. To accept the new settings and activate the theme all in one step, click the "Save & Activate" button at the top of the left-hand pane.') . '</p>' .
'<p>' . __('When previewing on smaller monitors, you can use the "Collapse" icon at the bottom of the left-hand pane. This will hide the pane, giving you more room to preview your site in the new theme. To bring the pane back, click on the Collapse icon again.') . '</p>';
get_current_screen()->add_help_tab( array(
'id' => 'customize-preview-themes',
'title' => __('Previewing and Customizing'),
'content' => $help_customize
) );
}
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Using_Themes" target="_blank">Documentation on Using Themes</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
wp_enqueue_script( 'theme' );
wp_enqueue_script( 'customize-loader' );
require_once('./admin-header.php');
?>
<div class="wrap"><?php
screen_icon();
if ( ! is_multisite() && current_user_can( 'install_themes' ) ) : ?>
<h2 class="nav-tab-wrapper">
<a href="themes.php" class="nav-tab nav-tab-active"><?php echo esc_html( $title ); ?></a><a href="<?php echo admin_url( 'theme-install.php'); ?>" class="nav-tab"><?php echo esc_html_x('Install Themes', 'theme'); ?></a>
<?php else : ?>
<h2><?php echo esc_html( $title ); ?>
<?php endif; ?>
</h2>
<?php
if ( ! validate_current_theme() || isset( $_GET['broken'] ) ) : ?>
<div id="message1" class="updated"><p><?php _e('The active theme is broken. Reverting to the default theme.'); ?></p></div>
<?php elseif ( isset($_GET['activated']) ) :
if ( isset( $_GET['previewed'] ) ) { ?>
<div id="message2" class="updated"><p><?php printf( __( 'Settings saved and theme activated. <a href="%s">Visit site</a>' ), home_url( '/' ) ); ?></p></div>
<?php } else { ?>
<div id="message2" class="updated"><p><?php printf( __( 'New theme activated. <a href="%s">Visit site</a>' ), home_url( '/' ) ); ?></p></div><?php
}
elseif ( isset($_GET['deleted']) ) : ?>
<div id="message3" class="updated"><p><?php _e('Theme deleted.') ?></p></div>
<?php
endif;
$ct = wp_get_theme();
$screenshot = $ct->get_screenshot();
$class = $screenshot ? 'has-screenshot' : '';
$customize_title = sprintf( __( 'Customize “%s”' ), $ct->display('Name') );
?>
<div id="current-theme" class="<?php echo esc_attr( $class ); ?>">
<?php if ( $screenshot ) : ?>
<?php if ( current_user_can( 'edit_theme_options' ) ) : ?>
<a href="<?php echo wp_customize_url(); ?>" class="load-customize hide-if-no-customize" title="<?php echo esc_attr( $customize_title ); ?>">
<img src="<?php echo esc_url( $screenshot ); ?>" alt="<?php esc_attr_e( 'Current theme preview' ); ?>" />
</a>
<?php endif; ?>
<img class="hide-if-customize" src="<?php echo esc_url( $screenshot ); ?>" alt="<?php esc_attr_e( 'Current theme preview' ); ?>" />
<?php endif; ?>
<h3><?php _e('Current Theme'); ?></h3>
<h4>
<?php echo $ct->display('Name'); ?>
</h4>
<div>
<ul class="theme-info">
<li><?php printf( __('By %s'), $ct->display('Author') ); ?></li>
<li><?php printf( __('Version %s'), $ct->display('Version') ); ?></li>
</ul>
<p class="theme-description"><?php echo $ct->display('Description'); ?></p>
<?php if ( $ct->parent() ) {
printf( ' <p class="howto">' . __( 'This <a href="%1$s">child theme</a> requires its parent theme, %2$s.' ) . '</p>',
__( 'http://codex.wordpress.org/Child_Themes' ),
$ct->parent()->display( 'Name' ) );
} ?>
<?php theme_update_available( $ct ); ?>
</div>
<?php
// Pretend you didn't see this.
$options = array();
if ( is_array( $submenu ) && isset( $submenu['themes.php'] ) ) {
foreach ( (array) $submenu['themes.php'] as $item) {
$class = '';
if ( 'themes.php' == $item[2] || 'theme-editor.php' == $item[2] )
continue;
// 0 = name, 1 = capability, 2 = file
if ( ( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file)) )
$class = ' class="current"';
if ( !empty($submenu[$item[2]]) ) {
$submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index.
$menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]);
if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook))
$options[] = "<a href='admin.php?page={$submenu[$item[2]][0][2]}'$class>{$item[0]}</a>";
else
$options[] = "<a href='{$submenu[$item[2]][0][2]}'$class>{$item[0]}</a>";
} else if ( current_user_can($item[1]) ) {
$menu_file = $item[2];
if ( false !== ( $pos = strpos( $menu_file, '?' ) ) )
$menu_file = substr( $menu_file, 0, $pos );
if ( file_exists( ABSPATH . "wp-admin/$menu_file" ) ) {
$options[] = "<a href='{$item[2]}'$class>{$item[0]}</a>";
} else {
$options[] = "<a href='themes.php?page={$item[2]}'$class>{$item[0]}</a>";
}
}
}
}
if ( $options || current_user_can( 'edit_theme_options' ) ) :
?>
<div class="theme-options">
<?php if ( current_user_can( 'edit_theme_options' ) ) : ?>
<a id="customize-current-theme-link" href="<?php echo wp_customize_url(); ?>" class="load-customize hide-if-no-customize" title="<?php echo esc_attr( $customize_title ); ?>"><?php _e( 'Customize' ); ?></a>
<?php
endif; // edit_theme_options
if ( $options ) :
?>
<span><?php _e( 'Options:' )?></span>
<ul>
<?php foreach ( $options as $option ) : ?>
<li><?php echo $option; ?></li>
<?php endforeach; ?>
</ul>
<?php
endif; // options
?>
</div>
<?php
endif; // options || edit_theme_options
?>
</div>
<br class="clear" />
<?php
if ( ! current_user_can( 'switch_themes' ) ) {
echo '</div>';
require( './admin-footer.php' );
exit;
}
?>
<form class="search-form filter-form" action="" method="get">
<h3 class="available-themes"><?php _e('Available Themes'); ?></h3>
<?php if ( !empty( $_REQUEST['s'] ) || !empty( $_REQUEST['features'] ) || $wp_list_table->has_items() ) : ?>
<p class="search-box">
<label class="screen-reader-text" for="theme-search-input"><?php _e('Search Installed Themes'); ?>:</label>
<input type="search" id="theme-search-input" name="s" value="<?php _admin_search_query(); ?>" />
<?php submit_button( __( 'Search Installed Themes' ), 'button', false, false, array( 'id' => 'search-submit' ) ); ?>
<a id="filter-click" href="?filter=1"><?php _e( 'Feature Filter' ); ?></a>
</p>
<div id="filter-box" style="<?php if ( empty($_REQUEST['filter']) ) echo 'display: none;'; ?>">
<?php $feature_list = get_theme_feature_list(); ?>
<div class="feature-filter">
<p class="install-help"><?php _e('Theme filters') ?></p>
<?php if ( !empty( $_REQUEST['filter'] ) ) : ?>
<input type="hidden" name="filter" value="1" />
<?php endif; ?>
<?php foreach ( $feature_list as $feature_name => $features ) :
$feature_name = esc_html( $feature_name ); ?>
<div class="feature-container">
<div class="feature-name"><?php echo $feature_name ?></div>
<ol class="feature-group">
<?php foreach ( $features as $key => $feature ) :
$feature_name = $feature;
$feature_name = esc_html( $feature_name );
$feature = esc_attr( $feature );
?>
<li>
<input type="checkbox" name="features[]" id="feature-id-<?php echo $key; ?>" value="<?php echo $key; ?>" <?php checked( in_array( $key, $wp_list_table->features ) ); ?>/>
<label for="feature-id-<?php echo $key; ?>"><?php echo $feature_name; ?></label>
</li>
<?php endforeach; ?>
</ol>
</div>
<?php endforeach; ?>
<div class="feature-container">
<?php submit_button( __( 'Apply Filters' ), 'button-secondary submitter', false, false, array( 'id' => 'filter-submit' ) ); ?>
<a id="mini-filter-click" href="<?php echo esc_url( remove_query_arg( array('filter', 'features', 'submit') ) ); ?>"><?php _e( 'Close filters' )?></a>
</div>
<br/>
</div>
<br class="clear"/>
</div>
<?php endif; ?>
<br class="clear" />
<?php $wp_list_table->display(); ?>
</form>
<br class="clear" />
<?php
// List broken themes, if any.
if ( ! is_multisite() && current_user_can('edit_themes') && $broken_themes = wp_get_themes( array( 'errors' => true ) ) ) {
?>
<h3><?php _e('Broken Themes'); ?></h3>
<p><?php _e('The following themes are installed but incomplete. Themes must have a stylesheet and a template.'); ?></p>
<table id="broken-themes">
<tr>
<th><?php _ex('Name', 'theme name'); ?></th>
<th><?php _e('Description'); ?></th>
</tr>
<?php
$alt = '';
foreach ( $broken_themes as $broken_theme ) {
$alt = ('class="alternate"' == $alt) ? '' : 'class="alternate"';
echo "
<tr $alt>
<td>" . $broken_theme->get('Name') ."</td>
<td>" . $broken_theme->errors()->get_error_message() . "</td>
</tr>";
}
?>
</table>
<?php
}
?>
</div>
<?php require('./admin-footer.php'); ?>
| zyblog | trunk/zyblog/wp-admin/themes.php | PHP | asf20 | 12,382 |
<?php
/**
* Multisite network settings administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.0.0
*/
require_once( './admin.php' );
wp_redirect( network_admin_url('settings.php') ); | zyblog | trunk/zyblog/wp-admin/ms-options.php | PHP | asf20 | 214 |
<?php
/**
* Manage media uploaded file.
*
* There are many filters in here for media. Plugins can extend functionality
* by hooking into the filters.
*
* @package WordPress
* @subpackage Administration
*/
if ( ! isset( $_GET['inline'] ) )
define( 'IFRAME_REQUEST' , true );
/** Load WordPress Administration Bootstrap */
require_once('./admin.php');
if (!current_user_can('upload_files'))
wp_die(__('You do not have permission to upload files.'));
wp_enqueue_script('plupload-handlers');
wp_enqueue_script('image-edit');
wp_enqueue_script('set-post-thumbnail' );
wp_enqueue_style('imgareaselect');
wp_enqueue_script( 'media-gallery' );
@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
// IDs should be integers
$ID = isset($ID) ? (int) $ID : 0;
$post_id = isset($post_id)? (int) $post_id : 0;
// Require an ID for the edit screen
if ( isset($action) && $action == 'edit' && !$ID )
wp_die( __( 'Cheatin’ uh?' ) );
if ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post' , $_REQUEST['post_id'] ) )
wp_die( __( 'Cheatin’ uh?' ) );
// upload type: image, video, file, ..?
if ( isset($_GET['type']) )
$type = strval($_GET['type']);
else
$type = apply_filters('media_upload_default_type', 'file');
// tab: gallery, library, or type-specific
if ( isset($_GET['tab']) )
$tab = strval($_GET['tab']);
else
$tab = apply_filters('media_upload_default_tab', 'type');
$body_id = 'media-upload';
// let the action code decide how to handle the request
if ( $tab == 'type' || $tab == 'type_url' || ! array_key_exists( $tab , media_upload_tabs() ) )
do_action("media_upload_$type");
else
do_action("media_upload_$tab");
| zyblog | trunk/zyblog/wp-admin/media-upload.php | PHP | asf20 | 1,727 |
<?php
/**
* Multisite themes administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.0.0
*/
require_once( './admin.php' );
wp_redirect( network_admin_url('themes.php') );
exit;
| zyblog | trunk/zyblog/wp-admin/ms-themes.php | PHP | asf20 | 209 |
<?php
/**
* Writing settings administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once('./admin.php');
if ( ! current_user_can( 'manage_options' ) )
wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );
$title = __('Writing Settings');
$parent_file = 'options-general.php';
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' => '<p>' . __('You can submit content in several different ways; this screen holds the settings for all of them. The top section controls the editor within the dashboard, while the rest control external publishing methods. For more information on any of these methods, use the documentation links.') . '</p>' .
'<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>',
) );
get_current_screen()->add_help_tab( array(
'id' => 'options-press',
'title' => __('Press This'),
'content' => '<p>' . __('Press This is a bookmarklet that makes it easy to blog about something you come across on the web. You can use it to just grab a link, or to post an excerpt. Press This will even allow you to choose from images included on the page and use them in your post. Just drag the Press This link on this screen to your bookmarks bar in your browser, and you’ll be on your way to easier content creation. Clicking on it while on another website opens a popup window with all these options.') . '</p>',
) );
if ( apply_filters( 'enable_post_by_email_configuration', true ) ) {
get_current_screen()->add_help_tab( array(
'id' => 'options-postemail',
'title' => __( 'Post Via Email' ),
'content' => '<p>' . __( 'Post via email settings allow you to send your WordPress install an email with the content of your post. You must set up a secret e-mail account with POP3 access to use this, and any mail received at this address will be posted, so it’s a good idea to keep this address very secret.' ) . '</p>',
) );
}
if ( apply_filters( 'enable_update_services_configuration', true ) ) {
get_current_screen()->add_help_tab( array(
'id' => 'options-services',
'title' => __( 'Update Services' ),
'content' => '<p>' . __( 'If desired, WordPress will automatically alert various services of your new posts.' ) . '</p>',
) );
}
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Settings_Writing_Screen" target="_blank">Documentation on Writing Settings</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
include('./admin-header.php');
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<form method="post" action="options.php">
<?php settings_fields('writing'); ?>
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e('Formatting') ?></th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e('Formatting') ?></span></legend>
<label for="use_smilies">
<input name="use_smilies" type="checkbox" id="use_smilies" value="1" <?php checked('1', get_option('use_smilies')); ?> />
<?php _e('Convert emoticons like <code>:-)</code> and <code>:-P</code> to graphics on display') ?></label><br />
<label for="use_balanceTags"><input name="use_balanceTags" type="checkbox" id="use_balanceTags" value="1" <?php checked('1', get_option('use_balanceTags')); ?> /> <?php _e('WordPress should correct invalidly nested XHTML automatically') ?></label>
</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><label for="default_category"><?php _e('Default Post Category') ?></label></th>
<td>
<?php
wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'default_category', 'orderby' => 'name', 'selected' => get_option('default_category'), 'hierarchical' => true));
?>
</td>
</tr>
<?php
if ( current_theme_supports( 'post-formats' ) ) :
$post_formats = get_theme_support( 'post-formats' );
if ( is_array( $post_formats[0] ) ) :
?>
<tr valign="top">
<th scope="row"><label for="default_post_format"><?php _e('Default Post Format') ?></label></th>
<td>
<select name="default_post_format" id="default_post_format">
<option value="0"><?php _e('Standard'); ?></option>
<?php foreach ( $post_formats[0] as $format ): ?>
<option<?php selected( get_option('default_post_format'), $format ); ?> value="<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></option>
<?php endforeach; ?>
</select>
</td>
</tr>
<?php endif; endif;
if ( get_option( 'link_manager_enabled' ) ) :
?>
<tr valign="top">
<th scope="row"><label for="default_link_category"><?php _e('Default Link Category') ?></label></th>
<td>
<?php
wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'default_link_category', 'orderby' => 'name', 'selected' => get_option('default_link_category'), 'hierarchical' => true, 'taxonomy' => 'link_category'));
?>
</td>
</tr>
<?php endif; ?>
<?php
do_settings_fields('writing', 'default');
do_settings_fields('writing', 'remote_publishing'); // A deprecated section.
?>
</table>
<h3 class="title"><?php _e('Press This') ?></h3>
<p><?php _e('Press This is a bookmarklet: a little app that runs in your browser and lets you grab bits of the web.');?></p>
<p><?php _e('Use Press This to clip text, images and videos from any web page. Then edit and add more straight from Press This before you save or publish it in a post on your site.'); ?></p>
<p><?php _e('Drag-and-drop the following link to your bookmarks bar or right click it and add it to your favorites for a posting shortcut.') ?></p>
<p class="pressthis"><a onclick="return false;" oncontextmenu="if(window.navigator.userAgent.indexOf('WebKit')!=-1||window.navigator.userAgent.indexOf('MSIE')!=-1)jQuery('.pressthis-code').show().find('textarea').focus().select();return false;" href="<?php echo htmlspecialchars( get_shortcut_link() ); ?>"><span><?php _e('Press This') ?></span></a></p>
<div class="pressthis-code" style="display:none;">
<p class="description"><?php _e('If your bookmarks toolbar is hidden: copy the code below, open your Bookmarks manager, create new bookmark, type Press This into the name field and paste the code into the URL field.') ?></p>
<p><textarea rows="5" cols="120" readonly="readonly"><?php echo htmlspecialchars( get_shortcut_link() ); ?></textarea></p>
</div>
<?php if ( apply_filters( 'enable_post_by_email_configuration', true ) ) { ?>
<h3><?php _e('Post via e-mail') ?></h3>
<p><?php printf(__('To post to WordPress by e-mail you must set up a secret e-mail account with POP3 access. Any mail received at this address will be posted, so it’s a good idea to keep this address very secret. Here are three random strings you could use: <kbd>%s</kbd>, <kbd>%s</kbd>, <kbd>%s</kbd>.'), wp_generate_password(8, false), wp_generate_password(8, false), wp_generate_password(8, false)) ?></p>
<table class="form-table">
<tr valign="top">
<th scope="row"><label for="mailserver_url"><?php _e('Mail Server') ?></label></th>
<td><input name="mailserver_url" type="text" id="mailserver_url" value="<?php form_option('mailserver_url'); ?>" class="regular-text code" />
<label for="mailserver_port"><?php _e('Port') ?></label>
<input name="mailserver_port" type="text" id="mailserver_port" value="<?php form_option('mailserver_port'); ?>" class="small-text" />
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mailserver_login"><?php _e('Login Name') ?></label></th>
<td><input name="mailserver_login" type="text" id="mailserver_login" value="<?php form_option('mailserver_login'); ?>" class="regular-text ltr" /></td>
</tr>
<tr valign="top">
<th scope="row"><label for="mailserver_pass"><?php _e('Password') ?></label></th>
<td>
<input name="mailserver_pass" type="text" id="mailserver_pass" value="<?php form_option('mailserver_pass'); ?>" class="regular-text ltr" />
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="default_email_category"><?php _e('Default Mail Category') ?></label></th>
<td>
<?php
wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'default_email_category', 'orderby' => 'name', 'selected' => get_option('default_email_category'), 'hierarchical' => true));
?>
</td>
</tr>
<?php do_settings_fields('writing', 'post_via_email'); ?>
</table>
<?php } ?>
<?php if ( apply_filters( 'enable_update_services_configuration', true ) ) { ?>
<h3><?php _e('Update Services') ?></h3>
<?php if ( 1 == get_option('blog_public') ) : ?>
<p><label for="ping_sites"><?php _e('When you publish a new post, WordPress automatically notifies the following site update services. For more about this, see <a href="http://codex.wordpress.org/Update_Services">Update Services</a> on the Codex. Separate multiple service <abbr title="Universal Resource Locator">URL</abbr>s with line breaks.') ?></label></p>
<textarea name="ping_sites" id="ping_sites" class="large-text code" rows="3"><?php echo esc_textarea( get_option('ping_sites') ); ?></textarea>
<?php else : ?>
<p><?php printf(__('WordPress is not notifying any <a href="http://codex.wordpress.org/Update_Services">Update Services</a> because of your site’s <a href="%s">visibility settings</a>.'), 'options-reading.php'); ?></p>
<?php endif; ?>
<?php } // multisite ?>
<?php do_settings_sections('writing'); ?>
<?php submit_button(); ?>
</form>
</div>
<?php include('./admin-footer.php') ?>
| zyblog | trunk/zyblog/wp-admin/options-writing.php | PHP | asf20 | 9,567 |
<?php
/**
* Update/Install Plugin/Theme administration panel.
*
* @package WordPress
* @subpackage Administration
*/
if ( ! defined( 'IFRAME_REQUEST' ) && isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'update-selected', 'activate-plugin', 'update-selected-themes' ) ) )
define( 'IFRAME_REQUEST', true );
/** WordPress Administration Bootstrap */
require_once('./admin.php');
include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
if ( isset($_GET['action']) ) {
$plugin = isset($_REQUEST['plugin']) ? trim($_REQUEST['plugin']) : '';
$theme = isset($_REQUEST['theme']) ? urldecode($_REQUEST['theme']) : '';
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
if ( 'update-selected' == $action ) {
if ( ! current_user_can( 'update_plugins' ) )
wp_die( __( 'You do not have sufficient permissions to update plugins for this site.' ) );
check_admin_referer( 'bulk-update-plugins' );
if ( isset( $_GET['plugins'] ) )
$plugins = explode( ',', stripslashes($_GET['plugins']) );
elseif ( isset( $_POST['checked'] ) )
$plugins = (array) $_POST['checked'];
else
$plugins = array();
$plugins = array_map('urldecode', $plugins);
$url = 'update.php?action=update-selected&plugins=' . urlencode(implode(',', $plugins));
$nonce = 'bulk-update-plugins';
wp_enqueue_script('jquery');
iframe_header();
$upgrader = new Plugin_Upgrader( new Bulk_Plugin_Upgrader_Skin( compact( 'nonce', 'url' ) ) );
$upgrader->bulk_upgrade( $plugins );
iframe_footer();
} elseif ( 'upgrade-plugin' == $action ) {
if ( ! current_user_can('update_plugins') )
wp_die(__('You do not have sufficient permissions to update plugins for this site.'));
check_admin_referer('upgrade-plugin_' . $plugin);
$title = __('Update Plugin');
$parent_file = 'plugins.php';
$submenu_file = 'plugins.php';
require_once(ABSPATH . 'wp-admin/admin-header.php');
$nonce = 'upgrade-plugin_' . $plugin;
$url = 'update.php?action=upgrade-plugin&plugin=' . $plugin;
$upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact('title', 'nonce', 'url', 'plugin') ) );
$upgrader->upgrade($plugin);
include(ABSPATH . 'wp-admin/admin-footer.php');
} elseif ('activate-plugin' == $action ) {
if ( ! current_user_can('update_plugins') )
wp_die(__('You do not have sufficient permissions to update plugins for this site.'));
check_admin_referer('activate-plugin_' . $plugin);
if ( ! isset($_GET['failure']) && ! isset($_GET['success']) ) {
wp_redirect( admin_url('update.php?action=activate-plugin&failure=true&plugin=' . $plugin . '&_wpnonce=' . $_GET['_wpnonce']) );
activate_plugin( $plugin, '', ! empty( $_GET['networkwide'] ), true );
wp_redirect( admin_url('update.php?action=activate-plugin&success=true&plugin=' . $plugin . '&_wpnonce=' . $_GET['_wpnonce']) );
die();
}
iframe_header( __('Plugin Reactivation'), true );
if ( isset($_GET['success']) )
echo '<p>' . __('Plugin reactivated successfully.') . '</p>';
if ( isset($_GET['failure']) ){
echo '<p>' . __('Plugin failed to reactivate due to a fatal error.') . '</p>';
error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
@ini_set('display_errors', true); //Ensure that Fatal errors are displayed.
include(WP_PLUGIN_DIR . '/' . $plugin);
}
iframe_footer();
} elseif ( 'install-plugin' == $action ) {
if ( ! current_user_can('install_plugins') )
wp_die( __( 'You do not have sufficient permissions to install plugins on this site.' ) );
include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; //for plugins_api..
check_admin_referer('install-plugin_' . $plugin);
$api = plugins_api('plugin_information', array('slug' => $plugin, 'fields' => array('sections' => false) ) ); //Save on a bit of bandwidth.
if ( is_wp_error($api) )
wp_die($api);
$title = __('Plugin Install');
$parent_file = 'plugins.php';
$submenu_file = 'plugin-install.php';
require_once(ABSPATH . 'wp-admin/admin-header.php');
$title = sprintf( __('Installing Plugin: %s'), $api->name . ' ' . $api->version );
$nonce = 'install-plugin_' . $plugin;
$url = 'update.php?action=install-plugin&plugin=' . $plugin;
if ( isset($_GET['from']) )
$url .= '&from=' . urlencode(stripslashes($_GET['from']));
$type = 'web'; //Install plugin type, From Web or an Upload.
$upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) );
$upgrader->install($api->download_link);
include(ABSPATH . 'wp-admin/admin-footer.php');
} elseif ( 'upload-plugin' == $action ) {
if ( ! current_user_can('install_plugins') )
wp_die( __( 'You do not have sufficient permissions to install plugins on this site.' ) );
check_admin_referer('plugin-upload');
$file_upload = new File_Upload_Upgrader('pluginzip', 'package');
$title = __('Upload Plugin');
$parent_file = 'plugins.php';
$submenu_file = 'plugin-install.php';
require_once(ABSPATH . 'wp-admin/admin-header.php');
$title = sprintf( __('Installing Plugin from uploaded file: %s'), basename( $file_upload->filename ) );
$nonce = 'plugin-upload';
$url = add_query_arg(array('package' => $file_upload->id), 'update.php?action=upload-plugin');
$type = 'upload'; //Install plugin type, From Web or an Upload.
$upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact('type', 'title', 'nonce', 'url') ) );
$result = $upgrader->install( $file_upload->package );
if ( $result || is_wp_error($result) )
$file_upload->cleanup();
include(ABSPATH . 'wp-admin/admin-footer.php');
} elseif ( 'upgrade-theme' == $action ) {
if ( ! current_user_can('update_themes') )
wp_die(__('You do not have sufficient permissions to update themes for this site.'));
check_admin_referer('upgrade-theme_' . $theme);
wp_enqueue_script( 'customize-loader' );
$title = __('Update Theme');
$parent_file = 'themes.php';
$submenu_file = 'themes.php';
require_once(ABSPATH . 'wp-admin/admin-header.php');
$nonce = 'upgrade-theme_' . $theme;
$url = 'update.php?action=upgrade-theme&theme=' . $theme;
$upgrader = new Theme_Upgrader( new Theme_Upgrader_Skin( compact('title', 'nonce', 'url', 'theme') ) );
$upgrader->upgrade($theme);
include(ABSPATH . 'wp-admin/admin-footer.php');
} elseif ( 'update-selected-themes' == $action ) {
if ( ! current_user_can( 'update_themes' ) )
wp_die( __( 'You do not have sufficient permissions to update themes for this site.' ) );
check_admin_referer( 'bulk-update-themes' );
if ( isset( $_GET['themes'] ) )
$themes = explode( ',', stripslashes($_GET['themes']) );
elseif ( isset( $_POST['checked'] ) )
$themes = (array) $_POST['checked'];
else
$themes = array();
$themes = array_map('urldecode', $themes);
$url = 'update.php?action=update-selected-themes&themes=' . urlencode(implode(',', $themes));
$nonce = 'bulk-update-themes';
wp_enqueue_script('jquery');
iframe_header();
$upgrader = new Theme_Upgrader( new Bulk_Theme_Upgrader_Skin( compact( 'nonce', 'url' ) ) );
$upgrader->bulk_upgrade( $themes );
iframe_footer();
} elseif ( 'install-theme' == $action ) {
if ( ! current_user_can('install_themes') )
wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) );
include_once ABSPATH . 'wp-admin/includes/theme-install.php'; //for themes_api..
check_admin_referer('install-theme_' . $theme);
$api = themes_api('theme_information', array('slug' => $theme, 'fields' => array('sections' => false, 'tags' => false) ) ); //Save on a bit of bandwidth.
if ( is_wp_error($api) )
wp_die($api);
wp_enqueue_script( 'customize-loader' );
$title = __('Install Themes');
$parent_file = 'themes.php';
$submenu_file = 'themes.php';
require_once(ABSPATH . 'wp-admin/admin-header.php');
$title = sprintf( __('Installing Theme: %s'), $api->name . ' ' . $api->version );
$nonce = 'install-theme_' . $theme;
$url = 'update.php?action=install-theme&theme=' . $theme;
$type = 'web'; //Install theme type, From Web or an Upload.
$upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) );
$upgrader->install($api->download_link);
include(ABSPATH . 'wp-admin/admin-footer.php');
} elseif ( 'upload-theme' == $action ) {
if ( ! current_user_can('install_themes') )
wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) );
check_admin_referer('theme-upload');
$file_upload = new File_Upload_Upgrader('themezip', 'package');
wp_enqueue_script( 'customize-loader' );
$title = __('Upload Theme');
$parent_file = 'themes.php';
$submenu_file = 'theme-install.php';
require_once(ABSPATH . 'wp-admin/admin-header.php');
$title = sprintf( __('Installing Theme from uploaded file: %s'), basename( $file_upload->filename ) );
$nonce = 'theme-upload';
$url = add_query_arg(array('package' => $file_upload->id), 'update.php?action=upload-theme');
$type = 'upload'; //Install plugin type, From Web or an Upload.
$upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact('type', 'title', 'nonce', 'url') ) );
$result = $upgrader->install( $file_upload->package );
if ( $result || is_wp_error($result) )
$file_upload->cleanup();
include(ABSPATH . 'wp-admin/admin-footer.php');
} else {
do_action('update-custom_' . $action);
}
}
| zyblog | trunk/zyblog/wp-admin/update.php | PHP | asf20 | 9,554 |
<?php
/**
* WordPress Options Header.
*
* Resets variables: 'action', 'standalone', and 'option_group_id'. Displays
* updated message, if updated variable is part of the URL query.
*
* @package WordPress
* @subpackage Administration
*/
wp_reset_vars(array('action', 'standalone', 'option_group_id'));
if ( isset( $_GET['updated'] ) && isset( $_GET['page'] ) ) {
// For backwards compat with plugins that don't use the Settings API and just set updated=1 in the redirect
add_settings_error('general', 'settings_updated', __('Settings saved.'), 'updated');
}
settings_errors();
| zyblog | trunk/zyblog/wp-admin/options-head.php | PHP | asf20 | 589 |
<?php
/**
* Install theme administration panel.
*
* @package WordPress
* @subpackage Administration
*/
if ( !defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && ( 'theme-information' == $_GET['tab'] ) )
define( 'IFRAME_REQUEST', true );
/** WordPress Administration Bootstrap */
require_once('./admin.php');
if ( ! current_user_can('install_themes') )
wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) );
if ( is_multisite() && ! is_network_admin() ) {
wp_redirect( network_admin_url( 'theme-install.php' ) );
exit();
}
$wp_list_table = _get_list_table('WP_Theme_Install_List_Table');
$pagenum = $wp_list_table->get_pagenum();
$wp_list_table->prepare_items();
$title = __('Install Themes');
$parent_file = 'themes.php';
if ( !is_network_admin() )
$submenu_file = 'themes.php';
wp_enqueue_script( 'theme-install' );
wp_enqueue_script( 'theme' );
$body_id = $tab;
do_action('install_themes_pre_' . $tab); //Used to override the general interface, Eg, install or theme information.
$help_overview =
'<p>' . sprintf(__('You can find additional themes for your site by using the Theme Browser/Installer on this screen, which will display themes from the <a href="%s" target="_blank">WordPress.org Theme Directory</a>. These themes are designed and developed by third parties, are available free of charge, and are compatible with the license WordPress uses.'), 'http://wordpress.org/extend/themes/') . '</p>' .
'<p>' . __('You can Search for themes by keyword, author, or tag, or can get more specific and search by criteria listed in the feature filter. Alternately, you can browse the themes that are Featured, Newest, or Recently Updated. When you find a theme you like, you can preview it or install it.') . '</p>' .
'<p>' . __('You can Upload a theme manually if you have already downloaded its ZIP archive onto your computer (make sure it is from a trusted and original source). You can also do it the old-fashioned way and copy a downloaded theme’s folder via FTP into your <code>/wp-content/themes</code> directory.') . '</p>';
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' => $help_overview
) );
$help_installing =
'<p>' . __('Once you have generated a list of themes, you can preview and install any of them. Click on the thumbnail of the theme you’re interested in previewing. It will open up in a full-screen Preview page to give you a better idea of how that theme will look.') . '</p>' .
'<p>' . __('To install the theme so you can preview it with your site’s content and customize its theme options, click the "Install" button at the top of the left-hand pane. The theme files will be downloaded to your website automatically. When this is complete, the theme is now available for activation, which you can do by clicking the "Activate" link, or by navigating to your Manage Themes screen and clicking the "Live Preview" link under any installed theme’s thumbnail image.') . '</p>';
get_current_screen()->add_help_tab( array(
'id' => 'installing',
'title' => __('Previewing and Installing'),
'content' => $help_installing
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Using_Themes#Adding_New_Themes" target="_blank">Documentation on Adding New Themes</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
include(ABSPATH . 'wp-admin/admin-header.php');
?>
<div class="wrap">
<?php
screen_icon();
if ( is_network_admin() ) : ?>
<h2><?php echo esc_html( $title ); ?></h2>
<?php else : ?>
<h2 class="nav-tab-wrapper"><a href="themes.php" class="nav-tab"><?php echo esc_html_x('Manage Themes', 'theme'); ?></a><a href="theme-install.php" class="nav-tab nav-tab-active"><?php echo esc_html( $title ); ?></a></h2>
<?php
endif;
$wp_list_table->views(); ?>
<br class="clear" />
<?php do_action('install_themes_' . $tab, $paged); ?>
</div>
<?php
include(ABSPATH . 'wp-admin/admin-footer.php');
| zyblog | trunk/zyblog/wp-admin/theme-install.php | PHP | asf20 | 4,146 |
<?php
/**
* Reading settings administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! current_user_can( 'manage_options' ) )
wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );
$title = __( 'Reading Settings' );
$parent_file = 'options-general.php';
/**
* Display JavaScript on the page.
*
* @since 3.5.0
*/
function options_reading_add_js() {
?>
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function($){
var section = $('#front-static-pages'),
staticPage = section.find('input:radio[value="page"]'),
selects = section.find('select'),
check_disabled = function(){
selects.prop( 'disabled', ! staticPage.prop('checked') );
};
check_disabled();
section.find('input:radio').change(check_disabled);
});
//]]>
</script>
<?php
}
add_action('admin_head', 'options_reading_add_js');
/**
* Render the blog charset setting.
*
* @since 3.5.0
*/
function options_reading_blog_charset() {
echo '<input name="blog_charset" type="text" id="blog_charset" value="' . esc_attr( get_option( 'blog_charset' ) ) . '" class="regular-text" />';
echo '<p class="description">' . __( 'The <a href="http://codex.wordpress.org/Glossary#Character_set">character encoding</a> of your site (UTF-8 is recommended)' ) . '</p>';
}
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' => '<p>' . __('This screen contains the settings that affect the display of your content.') . '</p>' .
'<p>' . sprintf(__('You can choose what’s displayed on the front page of your site. It can be posts in reverse chronological order (classic blog), or a fixed/static page. To set a static home page, you first need to create two <a href="%s">Pages</a>. One will become the front page, and the other will be where your posts are displayed.'), 'post-new.php?post_type=page') . '</p>' .
'<p>' . __('You can also control the display of your content in RSS feeds, including the maximum numbers of posts to display and whether to show full text or a summary.') . '</p>' .
'<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>',
) );
get_current_screen()->add_help_tab( array(
'id' => 'site-visibility',
'title' => has_action( 'blog_privacy_selector' ) ? __( 'Site Visibility' ) : __( 'Search Engine Visibility' ),
'content' => '<p>' . __( 'You can choose whether or not your site will be crawled by robots, ping services, and spiders. If you want those services to ignore your site, click the checkbox next to “Discourage search engines from indexing this site” and click the Save Changes button at the bottom of the screen. Note that your privacy is not complete; your site is still visible on the web.' ) . '</p>' .
'<p>' . __( 'When this setting is in effect, a reminder is shown in the Right Now box of the Dashboard that says, “Search Engines Discouraged,” to remind you that your site is not being crawled.' ) . '</p>',
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Settings_Reading_Screen" target="_blank">Documentation on Reading Settings</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
include( './admin-header.php' );
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<form method="post" action="options.php">
<?php
settings_fields( 'reading' );
if ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) )
add_settings_field( 'blog_charset', __( 'Encoding for pages and feeds' ), 'options_reading_blog_charset', 'reading', 'default', array( 'label_for' => 'blog_charset' ) );
?>
<?php if ( ! get_pages() ) : ?>
<input name="show_on_front" type="hidden" value="posts" />
<table class="form-table">
<?php
if ( 'posts' != get_option( 'show_on_front' ) ) :
update_option( 'show_on_front', 'posts' );
endif;
else :
if ( 'page' == get_option( 'show_on_front' ) && ! get_option( 'page_on_front' ) && ! get_option( 'page_for_posts' ) )
update_option( 'show_on_front', 'posts' );
?>
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e( 'Front page displays' ); ?></th>
<td id="front-static-pages"><fieldset><legend class="screen-reader-text"><span><?php _e( 'Front page displays' ); ?></span></legend>
<p><label>
<input name="show_on_front" type="radio" value="posts" class="tog" <?php checked( 'posts', get_option( 'show_on_front' ) ); ?> />
<?php _e( 'Your latest posts' ); ?>
</label>
</p>
<p><label>
<input name="show_on_front" type="radio" value="page" class="tog" <?php checked( 'page', get_option( 'show_on_front' ) ); ?> />
<?php printf( __( 'A <a href="%s">static page</a> (select below)' ), 'edit.php?post_type=page' ); ?>
</label>
</p>
<ul>
<li><label for="page_on_front"><?php printf( __( 'Front page: %s' ), wp_dropdown_pages( array( 'name' => 'page_on_front', 'echo' => 0, 'show_option_none' => __( '— Select —' ), 'option_none_value' => '0', 'selected' => get_option( 'page_on_front' ) ) ) ); ?></label></li>
<li><label for="page_for_posts"><?php printf( __( 'Posts page: %s' ), wp_dropdown_pages( array( 'name' => 'page_for_posts', 'echo' => 0, 'show_option_none' => __( '— Select —' ), 'option_none_value' => '0', 'selected' => get_option( 'page_for_posts' ) ) ) ); ?></label></li>
</ul>
<?php if ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) == get_option( 'page_on_front' ) ) : ?>
<div id="front-page-warning" class="error inline"><p><?php _e( '<strong>Warning:</strong> these pages should not be the same!' ); ?></p></div>
<?php endif; ?>
</fieldset></td>
</tr>
<?php endif; ?>
<tr valign="top">
<th scope="row"><label for="posts_per_page"><?php _e( 'Blog pages show at most' ); ?></label></th>
<td>
<input name="posts_per_page" type="number" step="1" min="1" id="posts_per_page" value="<?php form_option( 'posts_per_page' ); ?>" class="small-text" /> <?php _e( 'posts' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="posts_per_rss"><?php _e( 'Syndication feeds show the most recent' ); ?></label></th>
<td><input name="posts_per_rss" type="number" step="1" min="1" id="posts_per_rss" value="<?php form_option( 'posts_per_rss' ); ?>" class="small-text" /> <?php _e( 'items' ); ?></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e( 'For each article in a feed, show' ); ?> </th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'For each article in a feed, show' ); ?> </span></legend>
<p><label><input name="rss_use_excerpt" type="radio" value="0" <?php checked( 0, get_option( 'rss_use_excerpt' ) ); ?> /> <?php _e( 'Full text' ); ?></label><br />
<label><input name="rss_use_excerpt" type="radio" value="1" <?php checked( 1, get_option( 'rss_use_excerpt' ) ); ?> /> <?php _e( 'Summary' ); ?></label></p>
</fieldset></td>
</tr>
<tr valign="top" class="option-site-visibility">
<th scope="row"><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?> </th>
<td><fieldset><legend class="screen-reader-text"><span><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?> </span></legend>
<?php if ( has_action( 'blog_privacy_selector' ) ) : ?>
<input id="blog-public" type="radio" name="blog_public" value="1" <?php checked('1', get_option('blog_public')); ?> />
<label for="blog-public"><?php _e( 'Allow search engines to index this site' );?></label><br/>
<input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked('0', get_option('blog_public')); ?> />
<label for="blog-norobots"><?php _e( 'Discourage search engines from indexing this site' ); ?></label>
<p class="description"><?php _e( 'Note: Neither of these options blocks access to your site — it is up to search engines to honor your request.' ); ?></p>
<?php do_action('blog_privacy_selector'); ?>
<?php else : ?>
<label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="0" <?php checked( '0', get_option( 'blog_public' ) ); ?> />
<?php _e( 'Discourage search engines from indexing this site' ); ?></label>
<p class="description"><?php _e( 'It is up to search engines to honor this request.' ); ?></p>
<?php endif; ?>
</fieldset></td>
</tr>
<?php do_settings_fields( 'reading', 'default' ); ?>
</table>
<?php do_settings_sections( 'reading' ); ?>
<?php submit_button(); ?>
</form>
</div>
<?php include( './admin-footer.php' ); ?>
| zyblog | trunk/zyblog/wp-admin/options-reading.php | PHP | asf20 | 8,813 |
<?php
/**
* Revisions administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once('./admin.php');
wp_enqueue_script('list-revisions');
wp_reset_vars(array('revision', 'left', 'right', 'action'));
$revision_id = absint($revision);
$left = absint($left);
$right = absint($right);
$redirect = 'edit.php';
switch ( $action ) :
case 'restore' :
if ( !$revision = wp_get_post_revision( $revision_id ) )
break;
if ( !current_user_can( 'edit_post', $revision->post_parent ) )
break;
if ( !$post = get_post( $revision->post_parent ) )
break;
// Revisions disabled and we're not looking at an autosave
if ( ( ! WP_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions') ) && !wp_is_post_autosave( $revision ) ) {
$redirect = 'edit.php?post_type=' . $post->post_type;
break;
}
check_admin_referer( "restore-post_$post->ID|$revision->ID" );
wp_restore_post_revision( $revision->ID );
$redirect = add_query_arg( array( 'message' => 5, 'revision' => $revision->ID ), get_edit_post_link( $post->ID, 'url' ) );
break;
case 'diff' :
if ( !$left_revision = get_post( $left ) )
break;
if ( !$right_revision = get_post( $right ) )
break;
if ( !current_user_can( 'read_post', $left_revision->ID ) || !current_user_can( 'read_post', $right_revision->ID ) )
break;
// If we're comparing a revision to itself, redirect to the 'view' page for that revision or the edit page for that post
if ( $left_revision->ID == $right_revision->ID ) {
$redirect = get_edit_post_link( $left_revision->ID );
include( './js/revisions-js.php' );
break;
}
// Don't allow reverse diffs?
if ( strtotime($right_revision->post_modified_gmt) < strtotime($left_revision->post_modified_gmt) ) {
$redirect = add_query_arg( array( 'left' => $right, 'right' => $left ) );
break;
}
if ( $left_revision->ID == $right_revision->post_parent ) // right is a revision of left
$post =& $left_revision;
elseif ( $left_revision->post_parent == $right_revision->ID ) // left is a revision of right
$post =& $right_revision;
elseif ( $left_revision->post_parent == $right_revision->post_parent ) // both are revisions of common parent
$post = get_post( $left_revision->post_parent );
else
break; // Don't diff two unrelated revisions
if ( ! WP_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions') ) { // Revisions disabled
if (
// we're not looking at an autosave
( !wp_is_post_autosave( $left_revision ) && !wp_is_post_autosave( $right_revision ) )
||
// we're not comparing an autosave to the current post
( $post->ID !== $left_revision->ID && $post->ID !== $right_revision->ID )
) {
$redirect = 'edit.php?post_type=' . $post->post_type;
break;
}
}
if (
// They're the same
$left_revision->ID == $right_revision->ID
||
// Neither is a revision
( !wp_get_post_revision( $left_revision->ID ) && !wp_get_post_revision( $right_revision->ID ) )
)
break;
$post_title = '<a href="' . get_edit_post_link() . '">' . get_the_title() . '</a>';
$h2 = sprintf( __( 'Compare Revisions of “%1$s”' ), $post_title );
$title = __( 'Revisions' );
$left = $left_revision->ID;
$right = $right_revision->ID;
$redirect = false;
break;
case 'view' :
default :
if ( !$revision = wp_get_post_revision( $revision_id ) )
break;
if ( !$post = get_post( $revision->post_parent ) )
break;
if ( !current_user_can( 'read_post', $revision->ID ) || !current_user_can( 'read_post', $post->ID ) )
break;
// Revisions disabled and we're not looking at an autosave
if ( ( ! WP_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions') ) && !wp_is_post_autosave( $revision ) ) {
$redirect = 'edit.php?post_type=' . $post->post_type;
break;
}
$post_title = '<a href="' . get_edit_post_link() . '">' . get_the_title() . '</a>';
$revision_title = wp_post_revision_title( $revision, false );
$h2 = sprintf( __( 'Revision for “%1$s” created on %2$s' ), $post_title, $revision_title );
$title = __( 'Revisions' );
// Sets up the diff radio buttons
$left = $revision->ID;
$right = $post->ID;
$redirect = false;
break;
endswitch;
// Empty post_type means either malformed object found, or no valid parent was found.
if ( !$redirect && empty($post->post_type) )
$redirect = 'edit.php';
if ( !empty($redirect) ) {
wp_redirect( $redirect );
exit;
}
// This is so that the correct "Edit" menu item is selected.
if ( !empty($post->post_type) && 'post' != $post->post_type )
$parent_file = $submenu_file = 'edit.php?post_type=' . $post->post_type;
else
$parent_file = $submenu_file = 'edit.php';
require_once( './admin-header.php' );
?>
<div class="wrap">
<h2 class="long-header"><?php echo $h2; ?></h2>
<table class="form-table ie-fixed">
<col class="th" />
<?php if ( 'diff' == $action ) : ?>
<tr id="revision">
<th scope="row"></th>
<th scope="col" class="th-full">
<span class="alignleft"><?php printf( __('Older: %s'), wp_post_revision_title( $left_revision ) ); ?></span>
<span class="alignright"><?php printf( __('Newer: %s'), wp_post_revision_title( $right_revision ) ); ?></span>
</th>
</tr>
<?php endif;
// use get_post_to_edit filters?
$identical = true;
foreach ( _wp_post_revision_fields() as $field => $field_title ) :
if ( 'diff' == $action ) {
$left_content = apply_filters( "_wp_post_revision_field_$field", $left_revision->$field, $field );
$right_content = apply_filters( "_wp_post_revision_field_$field", $right_revision->$field, $field );
if ( !$content = wp_text_diff( $left_content, $right_content ) )
continue; // There is no difference between left and right
$identical = false;
} else {
add_filter( "_wp_post_revision_field_$field", 'htmlspecialchars' );
$content = apply_filters( "_wp_post_revision_field_$field", $revision->$field, $field );
}
?>
<tr id="revision-field-<?php echo $field; ?>">
<th scope="row"><?php echo esc_html( $field_title ); ?></th>
<td><div class="pre"><?php echo $content; ?></div></td>
</tr>
<?php
endforeach;
if ( 'diff' == $action && $identical ) :
?>
<tr><td colspan="2"><div class="updated"><p><?php _e( 'These revisions are identical.' ); ?></p></div></td></tr>
<?php
endif;
?>
</table>
<br class="clear" />
<h3><?php echo $title; ?></h3>
<?php
$args = array( 'format' => 'form-table', 'parent' => true, 'right' => $right, 'left' => $left );
if ( ! WP_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions') )
$args['type'] = 'autosave';
wp_list_post_revisions( $post, $args );
?>
</div>
<?php
require_once( './admin-footer.php' );
| zyblog | trunk/zyblog/wp-admin/revision.php | PHP | asf20 | 6,667 |
<?php
/**
* Post advanced form for inclusion in the administration panels.
*
* @package WordPress
* @subpackage Administration
*/
// don't load directly
if ( !defined('ABSPATH') )
die('-1');
wp_enqueue_script('post');
if ( wp_is_mobile() )
wp_enqueue_script( 'jquery-touch-punch' );
/**
* Post ID global
* @name $post_ID
* @var int
*/
$post_ID = isset($post_ID) ? (int) $post_ID : 0;
$user_ID = isset($user_ID) ? (int) $user_ID : 0;
$action = isset($action) ? $action : '';
if ( post_type_supports($post_type, 'editor') || post_type_supports($post_type, 'thumbnail') ) {
add_thickbox();
wp_enqueue_media( array( 'post' => $post_ID ) );
}
$messages = array();
$messages['post'] = array(
0 => '', // Unused. Messages start at index 1.
1 => sprintf( __('Post updated. <a href="%s">View post</a>'), esc_url( get_permalink($post_ID) ) ),
2 => __('Custom field updated.'),
3 => __('Custom field deleted.'),
4 => __('Post updated.'),
/* translators: %s: date and time of the revision */
5 => isset($_GET['revision']) ? sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
6 => sprintf( __('Post published. <a href="%s">View post</a>'), esc_url( get_permalink($post_ID) ) ),
7 => __('Post saved.'),
8 => sprintf( __('Post submitted. <a target="_blank" href="%s">Preview post</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),
9 => sprintf( __('Post scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview post</a>'),
// translators: Publish box date format, see http://php.net/date
date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post_ID) ) ),
10 => sprintf( __('Post draft updated. <a target="_blank" href="%s">Preview post</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),
);
$messages['page'] = array(
0 => '', // Unused. Messages start at index 1.
1 => sprintf( __('Page updated. <a href="%s">View page</a>'), esc_url( get_permalink($post_ID) ) ),
2 => __('Custom field updated.'),
3 => __('Custom field deleted.'),
4 => __('Page updated.'),
5 => isset($_GET['revision']) ? sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
6 => sprintf( __('Page published. <a href="%s">View page</a>'), esc_url( get_permalink($post_ID) ) ),
7 => __('Page saved.'),
8 => sprintf( __('Page submitted. <a target="_blank" href="%s">Preview page</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),
9 => sprintf( __('Page scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview page</a>'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post_ID) ) ),
10 => sprintf( __('Page draft updated. <a target="_blank" href="%s">Preview page</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),
);
$messages['attachment'] = array_fill( 1, 10, __( 'Media attachment updated.' ) ); // Hack, for now.
$messages = apply_filters( 'post_updated_messages', $messages );
$message = false;
if ( isset($_GET['message']) ) {
$_GET['message'] = absint( $_GET['message'] );
if ( isset($messages[$post_type][$_GET['message']]) )
$message = $messages[$post_type][$_GET['message']];
elseif ( !isset($messages[$post_type]) && isset($messages['post'][$_GET['message']]) )
$message = $messages['post'][$_GET['message']];
}
$notice = false;
$form_extra = '';
if ( 'auto-draft' == $post->post_status ) {
if ( 'edit' == $action )
$post->post_title = '';
$autosave = false;
$form_extra .= "<input type='hidden' id='auto_draft' name='auto_draft' value='1' />";
} else {
$autosave = wp_get_post_autosave( $post_ID );
}
$form_action = 'editpost';
$nonce_action = 'update-post_' . $post_ID;
$form_extra .= "<input type='hidden' id='post_ID' name='post_ID' value='" . esc_attr($post_ID) . "' />";
// Detect if there exists an autosave newer than the post and if that autosave is different than the post
if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) {
foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) {
if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) {
$notice = sprintf( __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>' ), get_edit_post_link( $autosave->ID ) );
break;
}
}
unset($autosave_field, $_autosave_field);
}
$post_type_object = get_post_type_object($post_type);
// All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action).
require_once('./includes/meta-boxes.php');
if ( 'attachment' == $post_type ) {
wp_enqueue_script( 'image-edit' );
wp_enqueue_style( 'imgareaselect' );
add_meta_box( 'submitdiv', __('Save'), 'attachment_submit_meta_box', null, 'side', 'core' );
add_action( 'edit_form_after_title', 'edit_form_image_editor' );
} else {
add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', null, 'side', 'core' );
}
if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 'post-formats' ) )
add_meta_box( 'formatdiv', _x( 'Format', 'post format' ), 'post_format_meta_box', null, 'side', 'core' );
// all taxonomies
foreach ( get_object_taxonomies( $post ) as $tax_name ) {
$taxonomy = get_taxonomy($tax_name);
if ( ! $taxonomy->show_ui )
continue;
$label = $taxonomy->labels->name;
if ( !is_taxonomy_hierarchical($tax_name) )
add_meta_box('tagsdiv-' . $tax_name, $label, 'post_tags_meta_box', null, 'side', 'core', array( 'taxonomy' => $tax_name ));
else
add_meta_box($tax_name . 'div', $label, 'post_categories_meta_box', null, 'side', 'core', array( 'taxonomy' => $tax_name ));
}
if ( post_type_supports($post_type, 'page-attributes') )
add_meta_box('pageparentdiv', 'page' == $post_type ? __('Page Attributes') : __('Attributes'), 'page_attributes_meta_box', null, 'side', 'core');
if ( current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' ) )
add_meta_box('postimagediv', __('Featured Image'), 'post_thumbnail_meta_box', null, 'side', 'low');
if ( post_type_supports($post_type, 'excerpt') )
add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', null, 'normal', 'core');
if ( post_type_supports($post_type, 'trackbacks') )
add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', null, 'normal', 'core');
if ( post_type_supports($post_type, 'custom-fields') )
add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', null, 'normal', 'core');
do_action('dbx_post_advanced');
if ( post_type_supports($post_type, 'comments') )
add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', null, 'normal', 'core');
if ( ( 'publish' == get_post_status( $post ) || 'private' == get_post_status( $post ) ) && post_type_supports($post_type, 'comments') )
add_meta_box('commentsdiv', __('Comments'), 'post_comment_meta_box', null, 'normal', 'core');
if ( ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) )
add_meta_box('slugdiv', __('Slug'), 'post_slug_meta_box', null, 'normal', 'core');
if ( post_type_supports($post_type, 'author') ) {
if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) )
add_meta_box('authordiv', __('Author'), 'post_author_meta_box', null, 'normal', 'core');
}
if ( post_type_supports($post_type, 'revisions') && 0 < $post_ID && wp_get_post_revisions( $post_ID ) )
add_meta_box('revisionsdiv', __('Revisions'), 'post_revisions_meta_box', null, 'normal', 'core');
do_action('add_meta_boxes', $post_type, $post);
do_action('add_meta_boxes_' . $post_type, $post);
do_action('do_meta_boxes', $post_type, 'normal', $post);
do_action('do_meta_boxes', $post_type, 'advanced', $post);
do_action('do_meta_boxes', $post_type, 'side', $post);
add_screen_option('layout_columns', array('max' => 2, 'default' => 2) );
if ( 'post' == $post_type ) {
$customize_display = '<p>' . __('The title field and the big Post Editing Area are fixed in place, but you can reposition all the other boxes using drag and drop. You can also minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.') . '</p>';
get_current_screen()->add_help_tab( array(
'id' => 'customize-display',
'title' => __('Customizing This Display'),
'content' => $customize_display,
) );
$title_and_editor = '<p>' . __('<strong>Title</strong> - Enter a title for your post. After you enter a title, you’ll see the permalink below, which you can edit.') . '</p>';
$title_and_editor .= '<p>' . __('<strong>Post editor</strong> - Enter the text for your post. There are two modes of editing: Visual and Text. Choose the mode by clicking on the appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last icon in the row to get a second row of controls. The Text mode allows you to enter HTML along with your post text. Line breaks will be converted to paragraphs automatically. You can insert media files by clicking the icons above the post editor and following the directions. You can go to the distraction-free writing screen via the Fullscreen icon in Visual mode (second to last in the top row) or the Fullscreen button in Text mode (last in the row). Once there, you can make buttons visible by hovering over the top area. Exit Fullscreen back to the regular post editor.') . '</p>';
get_current_screen()->add_help_tab( array(
'id' => 'title-post-editor',
'title' => __('Title and Post Editor'),
'content' => $title_and_editor,
) );
get_current_screen()->set_help_sidebar(
'<p>' . sprintf(__('You can also create posts with the <a href="%s">Press This bookmarklet</a>.'), 'options-writing.php') . '</p>' .
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Posts_Add_New_Screen" target="_blank">Documentation on Writing and Editing Posts</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
} elseif ( 'page' == $post_type ) {
$about_pages = '<p>' . __('Pages are similar to Posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest Pages under other Pages by making one the “Parent” of the other, creating a group of Pages.') . '</p>' .
'<p>' . __('Creating a Page is very similar to creating a Post, and the screens can be customized in the same way using drag and drop, the Screen Options tab, and expanding/collapsing boxes as you choose. This screen also has the distraction-free writing space, available in both the Visual and Text modes via the Fullscreen buttons. The Page editor mostly works the same as the Post editor, but there are some Page-specific features in the Page Attributes box:') . '</p>';
get_current_screen()->add_help_tab( array(
'id' => 'about-pages',
'title' => __('About Pages'),
'content' => $about_pages,
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Pages_Add_New_Screen" target="_blank">Documentation on Adding New Pages</a>') . '</p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Pages_Screen#Editing_Individual_Pages" target="_blank">Documentation on Editing Pages</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
} elseif ( 'attachment' == $post_type ) {
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __('This screen allows you to edit four fields for metadata in a file within the media library.') . '</p>' .
'<p>' . __('For images only, you can click on Edit Image under the thumbnail to expand out an inline image editor with icons for cropping, rotating, or flipping the image as well as for undoing and redoing. The boxes on the right give you more options for scaling the image, for cropping it, and for cropping the thumbnail in a different way than you crop the original image. You can click on Help in those boxes to get more information.') . '</p>' .
'<p>' . __('Note that you crop the image by clicking on it (the Crop icon is already selected) and dragging the cropping frame to select the desired part. Then click Save to retain the cropping.') . '</p>' .
'<p>' . __('Remember to click Update Media to save metadata entered or changed.') . '</p>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Media_Add_New_Screen#Edit_Media" target="_blank">Documentation on Edit Media</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
}
if ( 'post' == $post_type || 'page' == $post_type ) {
$inserting_media = '<p>' . __( 'You can upload and insert media (images, audio, documents, etc.) by clicking the Add Media button. You can select from the images and files already uploaded to the Media Library, or upload new media to add to your page or post. To create an image gallery, select the images to add and click the “Create a new gallery” button.' ) . '</p>';
$inserting_media .= '<p>' . __( 'You can also embed media from many popular websites including Twitter, YouTube, Flickr and others by pasting the media URL on its own line into the content of your post/page. Please refer to the Codex to <a href="http://codex.wordpress.org/Embeds">learn more about embeds</a>.' ) . '</p>';
get_current_screen()->add_help_tab( array(
'id' => 'inserting-media',
'title' => __( 'Inserting Media' ),
'content' => $inserting_media,
) );
}
if ( 'post' == $post_type ) {
$publish_box = '<p>' . __('Several boxes on this screen contain settings for how your content will be published, including:') . '</p>';
$publish_box .= '<ul><li>' . __('<strong>Publish</strong> - You can set the terms of publishing your post in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a post or making it stay at the top of your blog indefinitely (sticky). Publish (immediately) allows you to set a future or past date and time, so you can schedule a post to be published in the future or backdate a post.') . '</li>';
if ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) {
$publish_box .= '<li>' . __( '<strong>Format</strong> - Post Formats designate how your theme will display a specific post. For example, you could have a <em>standard</em> blog post with a title and paragraphs, or a short <em>aside</em> that omits the title and contains a short text blurb. Please refer to the Codex for <a href="http://codex.wordpress.org/Post_Formats#Supported_Formats">descriptions of each post format</a>. Your theme could enable all or some of 10 possible formats.' ) . '</li>';
}
if ( current_theme_supports( 'post-thumbnails' ) && post_type_supports( 'post', 'thumbnail' ) ) {
$publish_box .= '<li>' . __('<strong>Featured Image</strong> - This allows you to associate an image with your post without inserting it. This is usually useful only if your theme makes use of the featured image as a post thumbnail on the home page, a custom header, etc.') . '</li>';
}
$publish_box .= '</ul>';
get_current_screen()->add_help_tab( array(
'id' => 'publish-box',
'title' => __('Publish Settings'),
'content' => $publish_box,
) );
$discussion_settings = '<p>' . __('<strong>Send Trackbacks</strong> - Trackbacks are a way to notify legacy blog systems that you’ve linked to them. Enter the URL(s) you want to send trackbacks. If you link to other WordPress sites they’ll be notified automatically using pingbacks, and this field is unnecessary.') . '</p>';
$discussion_settings .= '<p>' . __('<strong>Discussion</strong> - You can turn comments and pings on or off, and if there are comments on the post, you can see them here and moderate them.') . '</p>';
get_current_screen()->add_help_tab( array(
'id' => 'discussion-settings',
'title' => __('Discussion Settings'),
'content' => $discussion_settings,
) );
} elseif ( 'page' == $post_type ) {
$page_attributes = '<p>' . __('<strong>Parent</strong> - You can arrange your pages in hierarchies. For example, you could have an “About” page that has “Life Story” and “My Dog” pages under it. There are no limits to how many levels you can nest pages.') . '</p>' .
'<p>' . __('<strong>Template</strong> - Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you’ll see them in this dropdown menu.') . '</p>' .
'<p>' . __('<strong>Order</strong> - Pages are usually ordered alphabetically, but you can choose your own order by entering a number (1 for first, etc.) in this field.') . '</p>';
get_current_screen()->add_help_tab( array(
'id' => 'page-attributes',
'title' => __('Page Attributes'),
'content' => $page_attributes,
) );
}
require_once('./admin-header.php');
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php
echo esc_html( $title );
if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create_posts ) )
echo ' <a href="' . esc_url( $post_new_file ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
?></h2>
<?php if ( $notice ) : ?>
<div id="notice" class="error"><p><?php echo $notice ?></p></div>
<?php endif; ?>
<?php if ( $message ) : ?>
<div id="message" class="updated"><p><?php echo $message; ?></p></div>
<?php endif; ?>
<form name="post" action="post.php" method="post" id="post"<?php do_action('post_edit_form_tag'); ?>>
<?php wp_nonce_field($nonce_action); ?>
<input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID ?>" />
<input type="hidden" id="hiddenaction" name="action" value="<?php echo esc_attr( $form_action ) ?>" />
<input type="hidden" id="originalaction" name="originalaction" value="<?php echo esc_attr( $form_action ) ?>" />
<input type="hidden" id="post_author" name="post_author" value="<?php echo esc_attr( $post->post_author ); ?>" />
<input type="hidden" id="post_type" name="post_type" value="<?php echo esc_attr( $post_type ) ?>" />
<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo esc_attr( $post->post_status) ?>" />
<input type="hidden" id="referredby" name="referredby" value="<?php echo esc_url(stripslashes(wp_get_referer())); ?>" />
<?php if ( ! empty( $active_post_lock ) ) { ?>
<input type="hidden" id="active_post_lock" value="<?php echo esc_attr( implode( ':', $active_post_lock ) ); ?>" />
<?php
}
if ( 'draft' != get_post_status( $post ) )
wp_original_referer_field(true, 'previous');
echo $form_extra;
wp_nonce_field( 'autosave', 'autosavenonce', false );
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
?>
<div id="poststuff">
<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
<div id="post-body-content">
<?php if ( post_type_supports($post_type, 'title') ) { ?>
<div id="titlediv">
<div id="titlewrap">
<label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label>
<input type="text" name="post_title" size="30" value="<?php echo esc_attr( htmlspecialchars( $post->post_title ) ); ?>" id="title" autocomplete="off" />
</div>
<div class="inside">
<?php
$sample_permalink_html = $post_type_object->public ? get_sample_permalink_html($post->ID) : '';
$shortlink = wp_get_shortlink($post->ID, 'post');
if ( !empty($shortlink) )
$sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr($shortlink) . '" /><a href="#" class="button button-small" onclick="prompt('URL:', jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>';
if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?>
<div id="edit-slug-box" class="hide-if-no-js">
<?php
if ( $sample_permalink_html && 'auto-draft' != $post->post_status )
echo $sample_permalink_html;
?>
</div>
<?php
}
?>
</div>
<?php
wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false );
?>
</div><!-- /titlediv -->
<?php
}
do_action( 'edit_form_after_title' );
if ( post_type_supports($post_type, 'editor') ) {
?>
<div id="postdivrich" class="postarea">
<?php wp_editor($post->post_content, 'content', array('dfw' => true, 'tabfocus_elements' => 'sample-permalink,post-preview', 'editor_height' => 360) ); ?>
<table id="post-status-info" cellspacing="0"><tbody><tr>
<td id="wp-word-count"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></td>
<td class="autosave-info">
<span class="autosave-message"> </span>
<?php
if ( 'auto-draft' != $post->post_status ) {
echo '<span id="last-edit">';
if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
$last_user = get_userdata($last_id);
printf(__('Last edited by %1$s on %2$s at %3$s'), esc_html( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
} else {
printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
}
echo '</span>';
} ?>
</td>
</tr></tbody></table>
</div>
<?php } ?>
<?php do_action( 'edit_form_after_editor' ); ?>
</div><!-- /post-body-content -->
<div id="postbox-container-1" class="postbox-container">
<?php
if ( 'page' == $post_type )
do_action('submitpage_box');
else
do_action('submitpost_box');
do_meta_boxes($post_type, 'side', $post);
?>
</div>
<div id="postbox-container-2" class="postbox-container">
<?php
do_meta_boxes(null, 'normal', $post);
if ( 'page' == $post_type )
do_action('edit_page_form');
else
do_action('edit_form_advanced');
do_meta_boxes(null, 'advanced', $post);
?>
</div>
<?php
do_action('dbx_post_sidebar');
?>
</div><!-- /post-body -->
<br class="clear" />
</div><!-- /poststuff -->
</form>
</div>
<?php
if ( post_type_supports( $post_type, 'comments' ) )
wp_comment_reply();
?>
<?php if ( (isset($post->post_title) && '' == $post->post_title) || (isset($_GET['message']) && 2 > $_GET['message']) ) : ?>
<script type="text/javascript">
try{document.post.title.focus();}catch(e){}
</script>
<?php endif; ?>
| zyblog | trunk/zyblog/wp-admin/edit-form-advanced.php | PHP | asf20 | 23,571 |
<?php
/**
* Retrieves and creates the wp-config.php file.
*
* The permissions for the base directory must allow for writing files in order
* for the wp-config.php to be created using this page.
*
* @internal This file must be parsable by PHP4.
*
* @package WordPress
* @subpackage Administration
*/
/**
* We are installing.
*
* @package WordPress
*/
define('WP_INSTALLING', true);
/**
* We are blissfully unaware of anything.
*/
define('WP_SETUP_CONFIG', true);
/**
* Disable error reporting
*
* Set this to error_reporting( E_ALL ) or error_reporting( E_ALL | E_STRICT ) for debugging
*/
error_reporting(0);
/**#@+
* These three defines are required to allow us to use require_wp_db() to load
* the database class while being wp-content/db.php aware.
* @ignore
*/
define('ABSPATH', dirname(dirname(__FILE__)).'/');
define('WPINC', 'wp-includes');
define('WP_CONTENT_DIR', ABSPATH . 'wp-content');
define('WP_DEBUG', false);
/**#@-*/
require(ABSPATH . WPINC . '/load.php');
require(ABSPATH . WPINC . '/version.php');
// Check for the required PHP version and for the MySQL extension or a database drop-in.
wp_check_php_mysql_versions();
require_once(ABSPATH . WPINC . '/functions.php');
// Also loads plugin.php, l10n.php, pomo/mo.php (all required by setup-config.php)
wp_load_translations_early();
// Turn register_globals off.
wp_unregister_GLOBALS();
require_once(ABSPATH . WPINC . '/compat.php');
require_once(ABSPATH . WPINC . '/class-wp-error.php');
require_once(ABSPATH . WPINC . '/formatting.php');
// Add magic quotes and set up $_REQUEST ( $_GET + $_POST )
wp_magic_quotes();
if ( ! file_exists( ABSPATH . 'wp-config-sample.php' ) )
wp_die( __( 'Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.' ) );
$config_file = file(ABSPATH . 'wp-config-sample.php');
// Check if wp-config.php has been created
if ( file_exists( ABSPATH . 'wp-config.php' ) )
wp_die( '<p>' . sprintf( __( "The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='%s'>installing now</a>." ), 'install.php' ) . '</p>' );
// Check if wp-config.php exists above the root directory but is not part of another install
if ( file_exists(ABSPATH . '../wp-config.php' ) && ! file_exists( ABSPATH . '../wp-settings.php' ) )
wp_die( '<p>' . sprintf( __( "The file 'wp-config.php' already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>."), 'install.php' ) . '</p>' );
$step = isset( $_GET['step'] ) ? (int) $_GET['step'] : 0;
/**
* Display setup wp-config.php file header.
*
* @ignore
* @since 2.3.0
* @package WordPress
* @subpackage Installer_WP_Config
*/
function setup_config_display_header() {
global $wp_version;
header( 'Content-Type: text/html; charset=utf-8' );
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"<?php if ( is_rtl() ) echo ' dir="rtl"'; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php _e( 'WordPress › Setup Configuration File' ); ?></title>
<link rel="stylesheet" href="css/install.css?ver=<?php echo preg_replace( '/[^0-9a-z\.-]/i', '', $wp_version ); ?>" type="text/css" />
<link rel="stylesheet" href="../wp-includes/css/buttons.css?ver=<?php echo preg_replace( '/[^0-9a-z\.-]/i', '', $wp_version ); ?>" type="text/css" />
</head>
<body class="wp-core-ui<?php if ( is_rtl() ) echo ' rtl'; ?>">
<h1 id="logo"><a href="<?php esc_attr_e( 'http://wordpress.org/' ); ?>"><?php _e( 'WordPress' ); ?></a></h1>
<?php
} // end function setup_config_display_header();
switch($step) {
case 0:
setup_config_display_header();
?>
<p><?php _e( 'Welcome to WordPress. Before getting started, we need some information on the database. You will need to know the following items before proceeding.' ) ?></p>
<ol>
<li><?php _e( 'Database name' ); ?></li>
<li><?php _e( 'Database username' ); ?></li>
<li><?php _e( 'Database password' ); ?></li>
<li><?php _e( 'Database host' ); ?></li>
<li><?php _e( 'Table prefix (if you want to run more than one WordPress in a single database)' ); ?></li>
</ol>
<p><strong><?php _e( "If for any reason this automatic file creation doesn’t work, don’t worry. All this does is fill in the database information to a configuration file. You may also simply open <code>wp-config-sample.php</code> in a text editor, fill in your information, and save it as <code>wp-config.php</code>." ); ?></strong></p>
<p><?php _e( "In all likelihood, these items were supplied to you by your Web Host. If you do not have this information, then you will need to contact them before you can continue. If you’re all ready…" ); ?></p>
<p class="step"><a href="setup-config.php?step=1<?php if ( isset( $_GET['noapi'] ) ) echo '&noapi'; ?>" class="button button-large"><?php _e( 'Let’s go!' ); ?></a></p>
<?php
break;
case 1:
setup_config_display_header();
?>
<form method="post" action="setup-config.php?step=2">
<p><?php _e( "Below you should enter your database connection details. If you’re not sure about these, contact your host." ); ?></p>
<table class="form-table">
<tr>
<th scope="row"><label for="dbname"><?php _e( 'Database Name' ); ?></label></th>
<td><input name="dbname" id="dbname" type="text" size="25" value="wordpress" /></td>
<td><?php _e( 'The name of the database you want to run WP in.' ); ?></td>
</tr>
<tr>
<th scope="row"><label for="uname"><?php _e( 'User Name' ); ?></label></th>
<td><input name="uname" id="uname" type="text" size="25" value="<?php echo htmlspecialchars( _x( 'username', 'example username' ), ENT_QUOTES ); ?>" /></td>
<td><?php _e( 'Your MySQL username' ); ?></td>
</tr>
<tr>
<th scope="row"><label for="pwd"><?php _e( 'Password' ); ?></label></th>
<td><input name="pwd" id="pwd" type="text" size="25" value="<?php echo htmlspecialchars( _x( 'password', 'example password' ), ENT_QUOTES ); ?>" /></td>
<td><?php _e( '…and your MySQL password.' ); ?></td>
</tr>
<tr>
<th scope="row"><label for="dbhost"><?php _e( 'Database Host' ); ?></label></th>
<td><input name="dbhost" id="dbhost" type="text" size="25" value="localhost" /></td>
<td><?php _e( 'You should be able to get this info from your web host, if <code>localhost</code> does not work.' ); ?></td>
</tr>
<tr>
<th scope="row"><label for="prefix"><?php _e( 'Table Prefix' ); ?></label></th>
<td><input name="prefix" id="prefix" type="text" value="wp_" size="25" /></td>
<td><?php _e( 'If you want to run multiple WordPress installations in a single database, change this.' ); ?></td>
</tr>
</table>
<?php if ( isset( $_GET['noapi'] ) ) { ?><input name="noapi" type="hidden" value="1" /><?php } ?>
<p class="step"><input name="submit" type="submit" value="<?php echo htmlspecialchars( __( 'Submit' ), ENT_QUOTES ); ?>" class="button button-large" /></p>
</form>
<?php
break;
case 2:
foreach ( array( 'dbname', 'uname', 'pwd', 'dbhost', 'prefix' ) as $key )
$$key = trim( stripslashes( $_POST[ $key ] ) );
$tryagain_link = '</p><p class="step"><a href="setup-config.php?step=1" onclick="javascript:history.go(-1);return false;" class="button button-large">' . __( 'Try again' ) . '</a>';
if ( empty( $prefix ) )
wp_die( __( '<strong>ERROR</strong>: "Table Prefix" must not be empty.' . $tryagain_link ) );
// Validate $prefix: it can only contain letters, numbers and underscores.
if ( preg_match( '|[^a-z0-9_]|i', $prefix ) )
wp_die( __( '<strong>ERROR</strong>: "Table Prefix" can only contain numbers, letters, and underscores.' . $tryagain_link ) );
// Test the db connection.
/**#@+
* @ignore
*/
define('DB_NAME', $dbname);
define('DB_USER', $uname);
define('DB_PASSWORD', $pwd);
define('DB_HOST', $dbhost);
/**#@-*/
// We'll fail here if the values are no good.
require_wp_db();
if ( ! empty( $wpdb->error ) )
wp_die( $wpdb->error->get_error_message() . $tryagain_link );
// Fetch or generate keys and salts.
$no_api = isset( $_POST['noapi'] );
if ( ! $no_api ) {
require_once( ABSPATH . WPINC . '/class-http.php' );
require_once( ABSPATH . WPINC . '/http.php' );
wp_fix_server_vars();
/**#@+
* @ignore
*/
function get_bloginfo() {
return ( ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . str_replace( $_SERVER['PHP_SELF'], '/wp-admin/setup-config.php', '' ) );
}
/**#@-*/
$secret_keys = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' );
}
if ( $no_api || is_wp_error( $secret_keys ) ) {
$secret_keys = array();
require_once( ABSPATH . WPINC . '/pluggable.php' );
for ( $i = 0; $i < 8; $i++ ) {
$secret_keys[] = wp_generate_password( 64, true, true );
}
} else {
$secret_keys = explode( "\n", wp_remote_retrieve_body( $secret_keys ) );
foreach ( $secret_keys as $k => $v ) {
$secret_keys[$k] = substr( $v, 28, 64 );
}
}
$key = 0;
// Not a PHP5-style by-reference foreach, as this file must be parseable by PHP4.
foreach ( $config_file as $line_num => $line ) {
if ( '$table_prefix =' == substr( $line, 0, 16 ) ) {
$config_file[ $line_num ] = '$table_prefix = \'' . addcslashes( $prefix, "\\'" ) . "';\r\n";
continue;
}
if ( ! preg_match( '/^define\(\'([A-Z_]+)\',([ ]+)/', $line, $match ) )
continue;
$constant = $match[1];
$padding = $match[2];
switch ( $constant ) {
case 'DB_NAME' :
case 'DB_USER' :
case 'DB_PASSWORD' :
case 'DB_HOST' :
$config_file[ $line_num ] = "define('" . $constant . "'," . $padding . "'" . addcslashes( constant( $constant ), "\\'" ) . "');\r\n";
break;
case 'AUTH_KEY' :
case 'SECURE_AUTH_KEY' :
case 'LOGGED_IN_KEY' :
case 'NONCE_KEY' :
case 'AUTH_SALT' :
case 'SECURE_AUTH_SALT' :
case 'LOGGED_IN_SALT' :
case 'NONCE_SALT' :
$config_file[ $line_num ] = "define('" . $constant . "'," . $padding . "'" . $secret_keys[$key++] . "');\r\n";
break;
}
}
unset( $line );
if ( ! is_writable(ABSPATH) ) :
setup_config_display_header();
?>
<p><?php _e( "Sorry, but I can’t write the <code>wp-config.php</code> file." ); ?></p>
<p><?php _e( 'You can create the <code>wp-config.php</code> manually and paste the following text into it.' ); ?></p>
<textarea id="wp-config" cols="98" rows="15" class="code" readonly="readonly"><?php
foreach( $config_file as $line ) {
echo htmlentities($line, ENT_COMPAT, 'UTF-8');
}
?></textarea>
<p><?php _e( 'After you’ve done that, click “Run the install.”' ); ?></p>
<p class="step"><a href="install.php" class="button button-large"><?php _e( 'Run the install' ); ?></a></p>
<script>
(function(){
var el=document.getElementById('wp-config');
el.focus();
el.select();
})();
</script>
<?php
else :
$handle = fopen(ABSPATH . 'wp-config.php', 'w');
foreach( $config_file as $line ) {
fwrite($handle, $line);
}
fclose($handle);
chmod(ABSPATH . 'wp-config.php', 0666);
setup_config_display_header();
?>
<p><?php _e( "All right sparky! You’ve made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to…" ); ?></p>
<p class="step"><a href="install.php" class="button button-large"><?php _e( 'Run the install' ); ?></a></p>
<?php
endif;
break;
}
?>
</body>
</html>
| zyblog | trunk/zyblog/wp-admin/setup-config.php | PHP | asf20 | 11,560 |
<?php
/**
* Credits administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once( './admin.php' );
$title = __( 'Credits' );
function wp_credits() {
global $wp_version;
$locale = get_locale();
$results = get_site_transient( 'wordpress_credits_' . $locale );
if ( ! is_array( $results )
|| ( isset( $results['data']['version'] ) && strpos( $wp_version, $results['data']['version'] ) !== 0 )
) {
$response = wp_remote_get( "http://api.wordpress.org/core/credits/1.0/?version=$wp_version&locale=$locale" );
if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
return false;
$results = maybe_unserialize( wp_remote_retrieve_body( $response ) );
if ( ! is_array( $results ) )
return false;
set_site_transient( 'wordpress_credits_' . $locale, $results, DAY_IN_SECONDS );
}
return $results;
}
function _wp_credits_add_profile_link( &$display_name, $username, $profiles ) {
$display_name = '<a href="' . esc_url( sprintf( $profiles, $username ) ) . '">' . esc_html( $display_name ) . '</a>';
}
function _wp_credits_build_object_link( &$data ) {
$data = '<a href="' . esc_url( $data[1] ) . '">' . $data[0] . '</a>';
}
list( $display_version ) = explode( '-', $wp_version );
include( ABSPATH . 'wp-admin/admin-header.php' );
?>
<div class="wrap about-wrap">
<h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
<div class="about-text"><?php printf( __( 'Thank you for updating to the latest version! WordPress %s is more polished and enjoyable than ever before. We hope you like it.' ), $display_version ); ?></div>
<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
<h2 class="nav-tab-wrapper">
<a href="about.php" class="nav-tab">
<?php _e( 'What’s New' ); ?>
</a><a href="credits.php" class="nav-tab nav-tab-active">
<?php _e( 'Credits' ); ?>
</a><a href="freedoms.php" class="nav-tab">
<?php _e( 'Freedoms' ); ?>
</a>
</h2>
<?php
$credits = wp_credits();
if ( ! $credits ) {
echo '<p class="about-description">' . sprintf( __( 'WordPress is created by a <a href="%1$s">worldwide team</a> of passionate individuals. <a href="%2$s">Get involved in WordPress</a>.' ),
'http://wordpress.org/about/',
/* translators: Url to the codex documentation on contributing to WordPress used on the credits page */
__( 'http://codex.wordpress.org/Contributing_to_WordPress' ) ) . '</p>';
include( ABSPATH . 'wp-admin/admin-footer.php' );
exit;
}
echo '<p class="about-description">' . __( 'WordPress is created by a worldwide team of passionate individuals.' ) . "</p>\n";
$gravatar = is_ssl() ? 'https://secure.gravatar.com/avatar/' : 'http://0.gravatar.com/avatar/';
foreach ( $credits['groups'] as $group_slug => $group_data ) {
if ( $group_data['name'] ) {
if ( 'Translators' == $group_data['name'] ) {
// Considered a special slug in the API response. (Also, will never be returned for en_US.)
$title = _x( 'Translators', 'Translate this to be the equivalent of English Translators in your language for the credits page Translators section' );
} elseif ( isset( $group_data['placeholders'] ) ) {
$title = vsprintf( translate( $group_data['name'] ), $group_data['placeholders'] );
} else {
$title = translate( $group_data['name'] );
}
echo '<h4 class="wp-people-group">' . $title . "</h4>\n";
}
if ( ! empty( $group_data['shuffle'] ) )
shuffle( $group_data['data'] ); // We were going to sort by ability to pronounce "hierarchical," but that wouldn't be fair to Matt.
switch ( $group_data['type'] ) {
case 'list' :
array_walk( $group_data['data'], '_wp_credits_add_profile_link', $credits['data']['profiles'] );
echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
break;
case 'libraries' :
array_walk( $group_data['data'], '_wp_credits_build_object_link' );
echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
break;
default:
$compact = 'compact' == $group_data['type'];
$classes = 'wp-people-group ' . ( $compact ? 'compact' : '' );
echo '<ul class="' . $classes . '" id="wp-people-group-' . $group_slug . '">' . "\n";
foreach ( $group_data['data'] as $person_data ) {
echo '<li class="wp-person" id="wp-person-' . $person_data[2] . '">' . "\n\t";
echo '<a href="' . sprintf( $credits['data']['profiles'], $person_data[2] ) . '">';
$size = 'compact' == $group_data['type'] ? '30' : '60';
echo '<img src="' . $gravatar . $person_data[1] . '?s=' . $size . '" class="gravatar" alt="' . esc_attr( $person_data[0] ) . '" /></a>' . "\n\t";
echo '<a class="web" href="' . sprintf( $credits['data']['profiles'], $person_data[2] ) . '">' . $person_data[0] . "</a>\n\t";
if ( ! $compact )
echo '<span class="title">' . translate( $person_data[3] ) . "</span>\n";
echo "</li>\n";
}
echo "</ul>\n";
break;
}
}
?>
<p class="clear"><?php printf( __( 'Want to see your name in lights on this page? <a href="%s">Get involved in WordPress</a>.' ),
/* translators: Url to the codex documentation on contributing to WordPress used on the credits page */
__( 'http://codex.wordpress.org/Contributing_to_WordPress' ) ); ?></p>
</div>
<?php
include( ABSPATH . 'wp-admin/admin-footer.php' );
return;
// These are strings returned by the API that we want to be translatable
__( 'Project Leaders' );
__( 'Extended Core Team' );
__( 'Core Developers' );
__( 'Recent Rockstars' );
__( 'Core Contributors to WordPress %s' );
__( 'Contributing Developers' );
__( 'Cofounder, Project Lead' );
__( 'Lead Developer' );
__( 'User Experience Lead' );
__( 'Core Developer' );
__( 'Core Committer' );
__( 'Guest Committer' );
__( 'Developer' );
__( 'Designer' );
__( 'XML-RPC' );
__( 'Internationalization' );
__( 'External Libraries' );
__( 'Icon Design' );
| zyblog | trunk/zyblog/wp-admin/credits.php | PHP | asf20 | 5,950 |
<?php
/**
* WordPress Installer
*
* @package WordPress
* @subpackage Administration
*/
// Sanity check.
if ( false ) {
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Error: PHP is not running</title>
</head>
<body class="wp-core-ui">
<h1 id="logo"><a href="http://wordpress.org/">WordPress</a></h1>
<h2>Error: PHP is not running</h2>
<p>WordPress requires that your web server is running PHP. Your server does not have PHP installed, or PHP is turned off.</p>
</body>
</html>
<?php
}
/**
* We are installing WordPress.
*
* @since 1.5.1
* @var bool
*/
define( 'WP_INSTALLING', true );
/** Load WordPress Bootstrap */
require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
/** Load WordPress Administration Upgrade API */
require_once( dirname( __FILE__ ) . '/includes/upgrade.php' );
/** Load wpdb */
require_once(dirname(dirname(__FILE__)) . '/wp-includes/wp-db.php');
$step = isset( $_GET['step'] ) ? (int) $_GET['step'] : 0;
/**
* Display install header.
*
* @since 2.5.0
* @package WordPress
* @subpackage Installer
*/
function display_header() {
header( 'Content-Type: text/html; charset=utf-8' );
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php _e( 'WordPress › Installation' ); ?></title>
<?php
wp_admin_css( 'install', true );
?>
</head>
<body class="wp-core-ui<?php if ( is_rtl() ) echo ' rtl'; ?>">
<h1 id="logo"><a href="<?php esc_attr_e( 'http://wordpress.org/' ); ?>"><?php _e( 'WordPress' ); ?></a></h1>
<?php
} // end display_header()
/**
* Display installer setup form.
*
* @since 2.8.0
* @package WordPress
* @subpackage Installer
*/
function display_setup_form( $error = null ) {
global $wpdb;
$user_table = ( $wpdb->get_var("SHOW TABLES LIKE '$wpdb->users'") != null );
// Ensure that Blogs appear in search engines by default
$blog_public = 1;
if ( ! empty( $_POST ) )
$blog_public = isset( $_POST['blog_public'] );
$weblog_title = isset( $_POST['weblog_title'] ) ? trim( stripslashes( $_POST['weblog_title'] ) ) : '';
$user_name = isset($_POST['user_name']) ? trim( stripslashes( $_POST['user_name'] ) ) : 'admin';
$admin_password = isset($_POST['admin_password']) ? trim( stripslashes( $_POST['admin_password'] ) ) : '';
$admin_email = isset( $_POST['admin_email'] ) ? trim( stripslashes( $_POST['admin_email'] ) ) : '';
if ( ! is_null( $error ) ) {
?>
<p class="message"><?php printf( __( '<strong>ERROR</strong>: %s' ), $error ); ?></p>
<?php } ?>
<form id="setup" method="post" action="install.php?step=2">
<table class="form-table">
<tr>
<th scope="row"><label for="weblog_title"><?php _e( 'Site Title' ); ?></label></th>
<td><input name="weblog_title" type="text" id="weblog_title" size="25" value="<?php echo esc_attr( $weblog_title ); ?>" /></td>
</tr>
<tr>
<th scope="row"><label for="user_name"><?php _e('Username'); ?></label></th>
<td>
<?php
if ( $user_table ) {
_e('User(s) already exists.');
} else {
?><input name="user_name" type="text" id="user_login" size="25" value="<?php echo esc_attr( sanitize_user( $user_name, true ) ); ?>" />
<p><?php _e( 'Usernames can have only alphanumeric characters, spaces, underscores, hyphens, periods and the @ symbol.' ); ?></p>
<?php
} ?>
</td>
</tr>
<?php if ( ! $user_table ) : ?>
<tr>
<th scope="row">
<label for="admin_password"><?php _e('Password, twice'); ?></label>
<p><?php _e('A password will be automatically generated for you if you leave this blank.'); ?></p>
</th>
<td>
<input name="admin_password" type="password" id="pass1" size="25" value="" />
<p><input name="admin_password2" type="password" id="pass2" size="25" value="" /></p>
<div id="pass-strength-result"><?php _e('Strength indicator'); ?></div>
<p><?php _e('Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ & ).'); ?></p>
</td>
</tr>
<?php endif; ?>
<tr>
<th scope="row"><label for="admin_email"><?php _e( 'Your E-mail' ); ?></label></th>
<td><input name="admin_email" type="text" id="admin_email" size="25" value="<?php echo esc_attr( $admin_email ); ?>" />
<p><?php _e( 'Double-check your email address before continuing.' ); ?></p></td>
</tr>
<tr>
<th scope="row"><label for="blog_public"><?php _e( 'Privacy' ); ?></label></th>
<td colspan="2"><label><input type="checkbox" name="blog_public" value="1" <?php checked( $blog_public ); ?> /> <?php _e( 'Allow search engines to index this site.' ); ?></label></td>
</tr>
</table>
<p class="step"><input type="submit" name="Submit" value="<?php esc_attr_e( 'Install WordPress' ); ?>" class="button button-large" /></p>
</form>
<?php
} // end display_setup_form()
// Let's check to make sure WP isn't already installed.
if ( is_blog_installed() ) {
display_header();
die( '<h1>' . __( 'Already Installed' ) . '</h1><p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p><p class="step"><a href="../wp-login.php" class="button button-large">' . __( 'Log In' ) . '</a></p></body></html>' );
}
$php_version = phpversion();
$mysql_version = $wpdb->db_version();
$php_compat = version_compare( $php_version, $required_php_version, '>=' );
$mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' );
if ( !$mysql_compat && !$php_compat )
$compat = sprintf( __( 'You cannot install because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.' ), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version );
elseif ( !$php_compat )
$compat = sprintf( __( 'You cannot install because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_php_version, $php_version );
elseif ( !$mysql_compat )
$compat = sprintf( __( 'You cannot install because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires MySQL version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_mysql_version, $mysql_version );
if ( !$mysql_compat || !$php_compat ) {
display_header();
die( '<h1>' . __( 'Insufficient Requirements' ) . '</h1><p>' . $compat . '</p></body></html>' );
}
if ( ! is_string( $wpdb->base_prefix ) || '' === $wpdb->base_prefix ) {
display_header();
die( '<h1>' . __( 'Configuration Error' ) . '</h1><p>' . __( 'Your <code>wp-config.php</code> file has an empty database table prefix, which is not supported.' ) . '</p></body></html>' );
}
switch($step) {
case 0: // Step 1
case 1: // Step 1, direct link.
display_header();
?>
<h1><?php _ex( 'Welcome', 'Howdy' ); ?></h1>
<p><?php printf( __( 'Welcome to the famous five minute WordPress installation process! You may want to browse the <a href="%s">ReadMe documentation</a> at your leisure. Otherwise, just fill in the information below and you’ll be on your way to using the most extendable and powerful personal publishing platform in the world.' ), '../readme.html' ); ?></p>
<h1><?php _e( 'Information needed' ); ?></h1>
<p><?php _e( 'Please provide the following information. Don’t worry, you can always change these settings later.' ); ?></p>
<?php
display_setup_form();
break;
case 2:
if ( ! empty( $wpdb->error ) )
wp_die( $wpdb->error->get_error_message() );
display_header();
// Fill in the data we gathered
$weblog_title = isset( $_POST['weblog_title'] ) ? trim( stripslashes( $_POST['weblog_title'] ) ) : '';
$user_name = isset($_POST['user_name']) ? trim( stripslashes( $_POST['user_name'] ) ) : 'admin';
$admin_password = isset($_POST['admin_password']) ? $_POST['admin_password'] : '';
$admin_password_check = isset($_POST['admin_password2']) ? $_POST['admin_password2'] : '';
$admin_email = isset( $_POST['admin_email'] ) ?trim( stripslashes( $_POST['admin_email'] ) ) : '';
$public = isset( $_POST['blog_public'] ) ? (int) $_POST['blog_public'] : 0;
// check e-mail address
$error = false;
if ( empty( $user_name ) ) {
// TODO: poka-yoke
display_setup_form( __('you must provide a valid username.') );
$error = true;
} elseif ( $user_name != sanitize_user( $user_name, true ) ) {
display_setup_form( __('the username you provided has invalid characters.') );
$error = true;
} elseif ( $admin_password != $admin_password_check ) {
// TODO: poka-yoke
display_setup_form( __( 'your passwords do not match. Please try again' ) );
$error = true;
} else if ( empty( $admin_email ) ) {
// TODO: poka-yoke
display_setup_form( __( 'you must provide an e-mail address.' ) );
$error = true;
} elseif ( ! is_email( $admin_email ) ) {
// TODO: poka-yoke
display_setup_form( __( 'that isn’t a valid e-mail address. E-mail addresses look like: <code>username@example.com</code>' ) );
$error = true;
}
if ( $error === false ) {
$wpdb->show_errors();
$result = wp_install($weblog_title, $user_name, $admin_email, $public, '', $admin_password);
extract( $result, EXTR_SKIP );
?>
<h1><?php _e( 'Success!' ); ?></h1>
<p><?php _e( 'WordPress has been installed. Were you expecting more steps? Sorry to disappoint.' ); ?></p>
<table class="form-table install-success">
<tr>
<th><?php _e( 'Username' ); ?></th>
<td><?php echo esc_html( sanitize_user( $user_name, true ) ); ?></td>
</tr>
<tr>
<th><?php _e( 'Password' ); ?></th>
<td><?php
if ( ! empty( $password ) && empty($admin_password_check) )
echo '<code>'. esc_html($password) .'</code><br />';
echo "<p>$password_message</p>"; ?>
</td>
</tr>
</table>
<p class="step"><a href="../wp-login.php" class="button button-large"><?php _e( 'Log In' ); ?></a></p>
<?php
}
break;
}
?>
<script type="text/javascript">var t = document.getElementById('weblog_title'); if (t){ t.focus(); }</script>
<?php wp_print_scripts( 'user-profile' ); ?>
</body>
</html>
| zyblog | trunk/zyblog/wp-admin/install.php | PHP | asf20 | 10,424 |
<?php
/**
* Customize Controls
*
* @package WordPress
* @subpackage Customize
* @since 3.4.0
*/
define( 'IFRAME_REQUEST', true );
require_once( './admin.php' );
if ( ! current_user_can( 'edit_theme_options' ) )
wp_die( __( 'Cheatin’ uh?' ) );
wp_reset_vars( array( 'url', 'return' ) );
$url = urldecode( $url );
$url = wp_validate_redirect( $url, home_url( '/' ) );
if ( $return )
$return = wp_validate_redirect( urldecode( $return ) );
if ( ! $return )
$return = $url;
global $wp_scripts, $wp_customize;
$registered = $wp_scripts->registered;
$wp_scripts = new WP_Scripts;
$wp_scripts->registered = $registered;
add_action( 'customize_controls_print_scripts', 'print_head_scripts', 20 );
add_action( 'customize_controls_print_footer_scripts', '_wp_footer_scripts' );
add_action( 'customize_controls_print_styles', 'print_admin_styles', 20 );
do_action( 'customize_controls_init' );
wp_enqueue_script( 'customize-controls' );
wp_enqueue_style( 'customize-controls' );
do_action( 'customize_controls_enqueue_scripts' );
// Let's roll.
@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
wp_user_settings();
_wp_admin_html_begin();
$body_class = 'wp-core-ui';
if ( wp_is_mobile() ) :
$body_class .= ' mobile';
?><meta name="viewport" id="viewport-meta" content="width=device-width, initial-scale=0.8, minimum-scale=0.5, maximum-scale=1.2"><?php
endif;
$is_ios = wp_is_mobile() && preg_match( '/iPad|iPod|iPhone/', $_SERVER['HTTP_USER_AGENT'] );
if ( $is_ios )
$body_class .= ' ios';
if ( is_rtl() )
$body_class .= ' rtl';
$body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
$admin_title = sprintf( __( '%1$s — WordPress' ), strip_tags( sprintf( __( 'Customize %s' ), $wp_customize->theme()->display('Name') ) ) );
?><title><?php echo $admin_title; ?></title><?php
do_action( 'customize_controls_print_styles' );
do_action( 'customize_controls_print_scripts' );
?>
</head>
<body class="<?php echo esc_attr( $body_class ); ?>">
<div class="wp-full-overlay expanded">
<form id="customize-controls" class="wrap wp-full-overlay-sidebar">
<div id="customize-header-actions" class="wp-full-overlay-header">
<?php
$save_text = $wp_customize->is_theme_active() ? __( 'Save & Publish' ) : __( 'Save & Activate' );
submit_button( $save_text, 'primary save', 'save', false );
?>
<span class="spinner"></span>
<a class="back button" href="<?php echo esc_url( $return ? $return : admin_url( 'themes.php' ) ); ?>">
<?php _e( 'Cancel' ); ?>
</a>
</div>
<?php
$screenshot = $wp_customize->theme()->get_screenshot();
$cannot_expand = ! ( $screenshot || $wp_customize->theme()->get('Description') );
?>
<div class="wp-full-overlay-sidebar-content" tabindex="-1">
<div id="customize-info" class="customize-section<?php if ( $cannot_expand ) echo ' cannot-expand'; ?>">
<div class="customize-section-title" aria-label="<?php esc_attr_e( 'Theme Customizer Options' ); ?>" tabindex="0">
<span class="preview-notice"><?php
/* translators: %s is the theme name in the Customize/Live Preview pane */
echo sprintf( __( 'You are previewing %s' ), '<strong class="theme-name">' . $wp_customize->theme()->display('Name') . '</strong>' );
?></span>
</div>
<?php if ( ! $cannot_expand ) : ?>
<div class="customize-section-content">
<?php if ( $screenshot ) : ?>
<img class="theme-screenshot" src="<?php echo esc_url( $screenshot ); ?>" />
<?php endif; ?>
<?php if ( $wp_customize->theme()->get('Description') ): ?>
<div class="theme-description"><?php echo $wp_customize->theme()->display('Description'); ?></div>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<div id="customize-theme-controls"><ul>
<?php
foreach ( $wp_customize->sections() as $section )
$section->maybe_render();
?>
</ul></div>
</div>
<div id="customize-footer-actions" class="wp-full-overlay-footer">
<a href="#" class="collapse-sidebar button-secondary" title="<?php esc_attr_e('Collapse Sidebar'); ?>">
<span class="collapse-sidebar-arrow"></span>
<span class="collapse-sidebar-label"><?php _e('Collapse'); ?></span>
</a>
</div>
</form>
<div id="customize-preview" class="wp-full-overlay-main"></div>
<?php
do_action( 'customize_controls_print_footer_scripts' );
// If the frontend and the admin are served from the same domain, load the
// preview over ssl if the customizer is being loaded over ssl. This avoids
// insecure content warnings. This is not attempted if the admin and frontend
// are on different domains to avoid the case where the frontend doesn't have
// ssl certs. Domain mapping plugins can allow other urls in these conditions
// using the customize_allowed_urls filter.
$allowed_urls = array( home_url('/') );
$admin_origin = parse_url( admin_url() );
$home_origin = parse_url( home_url() );
$cross_domain = ( strtolower( $admin_origin[ 'host' ] ) != strtolower( $home_origin[ 'host' ] ) );
if ( is_ssl() && ! $cross_domain )
$allowed_urls[] = home_url( '/', 'https' );
$allowed_urls = array_unique( apply_filters( 'customize_allowed_urls', $allowed_urls ) );
$fallback_url = add_query_arg( array(
'preview' => 1,
'template' => $wp_customize->get_template(),
'stylesheet' => $wp_customize->get_stylesheet(),
'preview_iframe' => true,
'TB_iframe' => 'true'
), home_url( '/' ) );
$login_url = add_query_arg( array(
'interim-login' => 1,
'customize-login' => 1
), wp_login_url() );
$settings = array(
'theme' => array(
'stylesheet' => $wp_customize->get_stylesheet(),
'active' => $wp_customize->is_theme_active(),
),
'url' => array(
'preview' => esc_url( $url ? $url : home_url( '/' ) ),
'parent' => esc_url( admin_url() ),
'activated' => admin_url( 'themes.php?activated=true&previewed' ),
'ajax' => esc_url( admin_url( 'admin-ajax.php', 'relative' ) ),
'allowed' => array_map( 'esc_url', $allowed_urls ),
'isCrossDomain' => $cross_domain,
'fallback' => $fallback_url,
'home' => esc_url( home_url( '/' ) ),
'login' => $login_url,
),
'browser' => array(
'mobile' => wp_is_mobile(),
'ios' => $is_ios,
),
'settings' => array(),
'controls' => array(),
'nonce' => array(
'save' => wp_create_nonce( 'save-customize_' . $wp_customize->get_stylesheet() ),
'preview' => wp_create_nonce( 'preview-customize_' . $wp_customize->get_stylesheet() )
),
);
foreach ( $wp_customize->settings() as $id => $setting ) {
$settings['settings'][ $id ] = array(
'value' => $setting->js_value(),
'transport' => $setting->transport,
);
}
foreach ( $wp_customize->controls() as $id => $control ) {
$control->to_json();
$settings['controls'][ $id ] = $control->json;
}
?>
<script type="text/javascript">
var _wpCustomizeSettings = <?php echo json_encode( $settings ); ?>;
</script>
</div>
</body>
</html>
| zyblog | trunk/zyblog/wp-admin/customize.php | PHP | asf20 | 7,124 |
<?php
/**
* The custom header image script.
*
* @package WordPress
* @subpackage Administration
*/
/**
* The custom header image class.
*
* @since 2.1.0
* @package WordPress
* @subpackage Administration
*/
class Custom_Image_Header {
/**
* Callback for administration header.
*
* @var callback
* @since 2.1.0
* @access private
*/
var $admin_header_callback;
/**
* Callback for header div.
*
* @var callback
* @since 3.0.0
* @access private
*/
var $admin_image_div_callback;
/**
* Holds default headers.
*
* @var array
* @since 3.0.0
* @access private
*/
var $default_headers = array();
/**
* Holds custom headers uploaded by the user
*
* @var array
* @since 3.2.0
* @access private
*/
var $uploaded_headers = array();
/**
* Holds the page menu hook.
*
* @var string
* @since 3.0.0
* @access private
*/
var $page = '';
/**
* Constructor - Register administration header callback.
*
* @since 2.1.0
* @param callback $admin_header_callback
* @param callback $admin_image_div_callback Optional custom image div output callback.
* @return Custom_Image_Header
*/
function __construct($admin_header_callback, $admin_image_div_callback = '') {
$this->admin_header_callback = $admin_header_callback;
$this->admin_image_div_callback = $admin_image_div_callback;
add_action( 'admin_menu', array( $this, 'init' ) );
}
/**
* Set up the hooks for the Custom Header admin page.
*
* @since 2.1.0
*/
function init() {
if ( ! current_user_can('edit_theme_options') )
return;
$this->page = $page = add_theme_page(__('Header'), __('Header'), 'edit_theme_options', 'custom-header', array(&$this, 'admin_page'));
add_action("admin_print_scripts-$page", array(&$this, 'js_includes'));
add_action("admin_print_styles-$page", array(&$this, 'css_includes'));
add_action("admin_head-$page", array(&$this, 'help') );
add_action("admin_head-$page", array(&$this, 'take_action'), 50);
add_action("admin_head-$page", array(&$this, 'js'), 50);
if ( $this->admin_header_callback )
add_action("admin_head-$page", $this->admin_header_callback, 51);
}
/**
* Adds contextual help.
*
* @since 3.0.0
*/
function help() {
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __( 'This screen is used to customize the header section of your theme.') . '</p>' .
'<p>' . __( 'You can choose from the theme’s default header images, or use one of your own. You can also customize how your Site Title and Tagline are displayed.') . '<p>'
) );
get_current_screen()->add_help_tab( array(
'id' => 'set-header-image',
'title' => __('Header Image'),
'content' =>
'<p>' . __( 'You can set a custom image header for your site. Simply upload the image and crop it, and the new header will go live immediately. Alternatively, you can use an image that has already been uploaded to your Media Library by clicking the “Choose Image” button.' ) . '</p>' .
'<p>' . __( 'Some themes come with additional header images bundled. If you see multiple images displayed, select the one you’d like and click the “Save Changes” button.' ) . '</p>' .
'<p>' . __( 'If your theme has more than one default header image, or you have uploaded more than one custom header image, you have the option of having WordPress display a randomly different image on each page of your site. Click the “Random” radio button next to the Uploaded Images or Default Images section to enable this feature.') . '</p>' .
'<p>' . __( 'If you don’t want a header image to be displayed on your site at all, click the “Remove Header Image” button at the bottom of the Header Image section of this page. If you want to re-enable the header image later, you just have to select one of the other image options and click “Save Changes”.') . '</p>'
) );
get_current_screen()->add_help_tab( array(
'id' => 'set-header-text',
'title' => __('Header Text'),
'content' =>
'<p>' . sprintf( __( 'For most themes, the header text is your Site Title and Tagline, as defined in the <a href="%1$s">General Settings</a> section.' ), admin_url( 'options-general.php' ) ) . '<p>' .
'<p>' . __( 'In the Header Text section of this page, you can choose whether to display this text or hide it. You can also choose a color for the text by clicking the Select Color button and either typing in a legitimate HTML hex value, e.g. “#ff0000” for red, or by choosing a color using the color picker.' ) . '</p>' .
'<p>' . __( 'Don’t forget to click “Save Changes” when you’re done!') . '</p>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="http://codex.wordpress.org/Appearance_Header_Screen" target="_blank">Documentation on Custom Header</a>' ) . '</p>' .
'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
);
}
/**
* Get the current step.
*
* @since 2.6.0
*
* @return int Current step
*/
function step() {
if ( ! isset( $_GET['step'] ) )
return 1;
$step = (int) $_GET['step'];
if ( $step < 1 || 3 < $step ||
( 2 == $step && ! wp_verify_nonce( $_REQUEST['_wpnonce-custom-header-upload'], 'custom-header-upload' ) ) ||
( 3 == $step && ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'custom-header-crop-image' ) )
)
return 1;
return $step;
}
/**
* Set up the enqueue for the JavaScript files.
*
* @since 2.1.0
*/
function js_includes() {
$step = $this->step();
if ( ( 1 == $step || 3 == $step ) ) {
wp_enqueue_media();
wp_enqueue_script( 'custom-header' );
if ( current_theme_supports( 'custom-header', 'header-text' ) )
wp_enqueue_script( 'wp-color-picker' );
} elseif ( 2 == $step ) {
wp_enqueue_script('imgareaselect');
}
}
/**
* Set up the enqueue for the CSS files
*
* @since 2.7
*/
function css_includes() {
$step = $this->step();
if ( ( 1 == $step || 3 == $step ) && current_theme_supports( 'custom-header', 'header-text' ) )
wp_enqueue_style( 'wp-color-picker' );
elseif ( 2 == $step )
wp_enqueue_style('imgareaselect');
}
/**
* Execute custom header modification.
*
* @since 2.6.0
*/
function take_action() {
if ( ! current_user_can('edit_theme_options') )
return;
if ( empty( $_POST ) )
return;
$this->updated = true;
if ( isset( $_POST['resetheader'] ) ) {
check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );
$this->reset_header_image();
return;
}
if ( isset( $_POST['removeheader'] ) ) {
check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );
$this->remove_header_image();
return;
}
if ( isset( $_POST['text-color'] ) && ! isset( $_POST['display-header-text'] ) ) {
check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );
set_theme_mod( 'header_textcolor', 'blank' );
} elseif ( isset( $_POST['text-color'] ) ) {
check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );
$_POST['text-color'] = str_replace( '#', '', $_POST['text-color'] );
$color = preg_replace('/[^0-9a-fA-F]/', '', $_POST['text-color']);
if ( strlen($color) == 6 || strlen($color) == 3 )
set_theme_mod('header_textcolor', $color);
elseif ( ! $color )
set_theme_mod( 'header_textcolor', 'blank' );
}
if ( isset( $_POST['default-header'] ) ) {
check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );
$this->set_header_image( $_POST['default-header'] );
return;
}
}
/**
* Process the default headers
*
* @since 3.0.0
*/
function process_default_headers() {
global $_wp_default_headers;
if ( !empty($this->headers) )
return;
if ( !isset($_wp_default_headers) )
return;
$this->default_headers = $_wp_default_headers;
$template_directory_uri = get_template_directory_uri();
$stylesheet_directory_uri = get_stylesheet_directory_uri();
foreach ( array_keys($this->default_headers) as $header ) {
$this->default_headers[$header]['url'] = sprintf( $this->default_headers[$header]['url'], $template_directory_uri, $stylesheet_directory_uri );
$this->default_headers[$header]['thumbnail_url'] = sprintf( $this->default_headers[$header]['thumbnail_url'], $template_directory_uri, $stylesheet_directory_uri );
}
}
/**
* Display UI for selecting one of several default headers.
*
* Show the random image option if this theme has multiple header images.
* Random image option is on by default if no header has been set.
*
* @since 3.0.0
*/
function show_header_selector( $type = 'default' ) {
if ( 'default' == $type ) {
$headers = $this->default_headers;
} else {
$headers = get_uploaded_header_images();
$type = 'uploaded';
}
if ( 1 < count( $headers ) ) {
echo '<div class="random-header">';
echo '<label><input name="default-header" type="radio" value="random-' . $type . '-image"' . checked( is_random_header_image( $type ), true, false ) . ' />';
echo __( '<strong>Random:</strong> Show a different image on each page.' );
echo '</label>';
echo '</div>';
}
echo '<div class="available-headers">';
foreach ( $headers as $header_key => $header ) {
$header_thumbnail = $header['thumbnail_url'];
$header_url = $header['url'];
$header_desc = empty( $header['description'] ) ? '' : $header['description'];
echo '<div class="default-header">';
echo '<label><input name="default-header" type="radio" value="' . esc_attr( $header_key ) . '" ' . checked( $header_url, get_theme_mod( 'header_image' ), false ) . ' />';
$width = '';
if ( !empty( $header['attachment_id'] ) )
$width = ' width="230"';
echo '<img src="' . set_url_scheme( $header_thumbnail ) . '" alt="' . esc_attr( $header_desc ) .'" title="' . esc_attr( $header_desc ) . '"' . $width . ' /></label>';
echo '</div>';
}
echo '<div class="clear"></div></div>';
}
/**
* Execute Javascript depending on step.
*
* @since 2.1.0
*/
function js() {
$step = $this->step();
if ( ( 1 == $step || 3 == $step ) && current_theme_supports( 'custom-header', 'header-text' ) )
$this->js_1();
elseif ( 2 == $step )
$this->js_2();
}
/**
* Display Javascript based on Step 1 and 3.
*
* @since 2.6.0
*/
function js_1() { ?>
<script type="text/javascript">
/* <![CDATA[ */
(function($){
var default_color = '#<?php echo get_theme_support( 'custom-header', 'default-text-color' ); ?>',
header_text_fields;
function pickColor(color) {
$('#name').css('color', color);
$('#desc').css('color', color);
$('#text-color').val(color);
}
function toggle_text() {
var checked = $('#display-header-text').prop('checked'),
text_color;
header_text_fields.toggle( checked );
if ( ! checked )
return;
text_color = $('#text-color');
if ( '' == text_color.val().replace('#', '') ) {
text_color.val( default_color );
pickColor( default_color );
} else {
pickColor( text_color.val() );
}
}
$(document).ready(function() {
var text_color = $('#text-color');
header_text_fields = $('.displaying-header-text');
text_color.wpColorPicker({
change: function( event, ui ) {
pickColor( text_color.wpColorPicker('color') );
},
clear: function() {
pickColor( '' );
}
});
$('#display-header-text').click( toggle_text );
<?php if ( ! display_header_text() ) : ?>
toggle_text();
<?php endif; ?>
});
})(jQuery);
/* ]]> */
</script>
<?php
}
/**
* Display Javascript based on Step 2.
*
* @since 2.6.0
*/
function js_2() { ?>
<script type="text/javascript">
/* <![CDATA[ */
function onEndCrop( coords ) {
jQuery( '#x1' ).val(coords.x);
jQuery( '#y1' ).val(coords.y);
jQuery( '#width' ).val(coords.w);
jQuery( '#height' ).val(coords.h);
}
jQuery(document).ready(function() {
var xinit = <?php echo absint( get_theme_support( 'custom-header', 'width' ) ); ?>;
var yinit = <?php echo absint( get_theme_support( 'custom-header', 'height' ) ); ?>;
var ratio = xinit / yinit;
var ximg = jQuery('img#upload').width();
var yimg = jQuery('img#upload').height();
if ( yimg < yinit || ximg < xinit ) {
if ( ximg / yimg > ratio ) {
yinit = yimg;
xinit = yinit * ratio;
} else {
xinit = ximg;
yinit = xinit / ratio;
}
}
jQuery('img#upload').imgAreaSelect({
handles: true,
keys: true,
show: true,
x1: 0,
y1: 0,
x2: xinit,
y2: yinit,
<?php
if ( ! current_theme_supports( 'custom-header', 'flex-height' ) && ! current_theme_supports( 'custom-header', 'flex-width' ) ) {
?>
aspectRatio: xinit + ':' + yinit,
<?php
}
if ( ! current_theme_supports( 'custom-header', 'flex-height' ) ) {
?>
maxHeight: <?php echo get_theme_support( 'custom-header', 'height' ); ?>,
<?php
}
if ( ! current_theme_supports( 'custom-header', 'flex-width' ) ) {
?>
maxWidth: <?php echo get_theme_support( 'custom-header', 'width' ); ?>,
<?php
}
?>
onInit: function () {
jQuery('#width').val(xinit);
jQuery('#height').val(yinit);
},
onSelectChange: function(img, c) {
jQuery('#x1').val(c.x1);
jQuery('#y1').val(c.y1);
jQuery('#width').val(c.width);
jQuery('#height').val(c.height);
}
});
});
/* ]]> */
</script>
<?php
}
/**
* Display first step of custom header image page.
*
* @since 2.1.0
*/
function step_1() {
$this->process_default_headers();
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php _e('Custom Header'); ?></h2>
<?php if ( ! empty( $this->updated ) ) { ?>
<div id="message" class="updated">
<p><?php printf( __( 'Header updated. <a href="%s">Visit your site</a> to see how it looks.' ), home_url( '/' ) ); ?></p>
</div>
<?php } ?>
<h3><?php _e( 'Header Image' ); ?></h3>
<table class="form-table">
<tbody>
<tr valign="top">
<th scope="row"><?php _e( 'Preview' ); ?></th>
<td>
<?php if ( $this->admin_image_div_callback ) {
call_user_func( $this->admin_image_div_callback );
} else {
$custom_header = get_custom_header();
$header_image_style = 'background-image:url(' . esc_url( get_header_image() ) . ');';
if ( $custom_header->width )
$header_image_style .= 'max-width:' . $custom_header->width . 'px;';
if ( $custom_header->height )
$header_image_style .= 'height:' . $custom_header->height . 'px;';
?>
<div id="headimg" style="<?php echo $header_image_style; ?>">
<?php
if ( display_header_text() )
$style = ' style="color:#' . get_header_textcolor() . ';"';
else
$style = ' style="display:none;"';
?>
<h1><a id="name" class="displaying-header-text" <?php echo $style; ?> onclick="return false;" href="<?php bloginfo('url'); ?>"><?php bloginfo( 'name' ); ?></a></h1>
<div id="desc" class="displaying-header-text" <?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>
</div>
<?php } ?>
</td>
</tr>
<?php if ( current_theme_supports( 'custom-header', 'uploads' ) ) : ?>
<tr valign="top">
<th scope="row"><?php _e( 'Select Image' ); ?></th>
<td>
<p><?php _e( 'You can select an image to be shown at the top of your site by uploading from your computer or choosing from your media library. After selecting an image you will be able to crop it.' ); ?><br />
<?php
if ( ! current_theme_supports( 'custom-header', 'flex-height' ) && ! current_theme_supports( 'custom-header', 'flex-width' ) ) {
printf( __( 'Images of exactly <strong>%1$d × %2$d pixels</strong> will be used as-is.' ) . '<br />', get_theme_support( 'custom-header', 'width' ), get_theme_support( 'custom-header', 'height' ) );
} elseif ( current_theme_supports( 'custom-header', 'flex-height' ) ) {
if ( ! current_theme_supports( 'custom-header', 'flex-width' ) )
printf( __( 'Images should be at least <strong>%1$d pixels</strong> wide.' ) . ' ', get_theme_support( 'custom-header', 'width' ) );
} elseif ( current_theme_supports( 'custom-header', 'flex-width' ) ) {
if ( ! current_theme_supports( 'custom-header', 'flex-height' ) )
printf( __( 'Images should be at least <strong>%1$d pixels</strong> tall.' ) . ' ', get_theme_support( 'custom-header', 'height' ) );
}
if ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) {
if ( current_theme_supports( 'custom-header', 'width' ) )
printf( __( 'Suggested width is <strong>%1$d pixels</strong>.' ) . ' ', get_theme_support( 'custom-header', 'width' ) );
if ( current_theme_supports( 'custom-header', 'height' ) )
printf( __( 'Suggested height is <strong>%1$d pixels</strong>.' ) . ' ', get_theme_support( 'custom-header', 'height' ) );
}
?></p>
<form enctype="multipart/form-data" id="upload-form" class="wp-upload-form" method="post" action="<?php echo esc_url( add_query_arg( 'step', 2 ) ) ?>">
<p>
<label for="upload"><?php _e( 'Choose an image from your computer:' ); ?></label><br />
<input type="file" id="upload" name="import" />
<input type="hidden" name="action" value="save" />
<?php wp_nonce_field( 'custom-header-upload', '_wpnonce-custom-header-upload' ); ?>
<?php submit_button( __( 'Upload' ), 'button', 'submit', false ); ?>
</p>
<?php
$modal_update_href = esc_url( add_query_arg( array(
'page' => 'custom-header',
'step' => 2,
'_wpnonce-custom-header-upload' => wp_create_nonce('custom-header-upload'),
), admin_url('themes.php') ) );
?>
<p>
<label for="choose-from-library-link"><?php _e( 'Or choose an image from your media library:' ); ?></label><br />
<a id="choose-from-library-link" class="button"
data-update-link="<?php echo esc_attr( $modal_update_href ); ?>"
data-choose="<?php esc_attr_e( 'Choose a Custom Header' ); ?>"
data-update="<?php esc_attr_e( 'Set as header' ); ?>"><?php _e( 'Choose Image' ); ?></a>
</p>
</form>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
<form method="post" action="<?php echo esc_url( add_query_arg( 'step', 1 ) ) ?>">
<table class="form-table">
<tbody>
<?php if ( get_uploaded_header_images() ) : ?>
<tr valign="top">
<th scope="row"><?php _e( 'Uploaded Images' ); ?></th>
<td>
<p><?php _e( 'You can choose one of your previously uploaded headers, or show a random one.' ) ?></p>
<?php
$this->show_header_selector( 'uploaded' );
?>
</td>
</tr>
<?php endif;
if ( ! empty( $this->default_headers ) ) : ?>
<tr valign="top">
<th scope="row"><?php _e( 'Default Images' ); ?></th>
<td>
<?php if ( current_theme_supports( 'custom-header', 'uploads' ) ) : ?>
<p><?php _e( 'If you don‘t want to upload your own image, you can use one of these cool headers, or show a random one.' ) ?></p>
<?php else: ?>
<p><?php _e( 'You can use one of these cool headers or show a random one on each page.' ) ?></p>
<?php endif; ?>
<?php
$this->show_header_selector( 'default' );
?>
</td>
</tr>
<?php endif;
if ( get_header_image() ) : ?>
<tr valign="top">
<th scope="row"><?php _e( 'Remove Image' ); ?></th>
<td>
<p><?php _e( 'This will remove the header image. You will not be able to restore any customizations.' ) ?></p>
<?php submit_button( __( 'Remove Header Image' ), 'button', 'removeheader', false ); ?>
</td>
</tr>
<?php endif;
$default_image = get_theme_support( 'custom-header', 'default-image' );
if ( $default_image && get_header_image() != $default_image ) : ?>
<tr valign="top">
<th scope="row"><?php _e( 'Reset Image' ); ?></th>
<td>
<p><?php _e( 'This will restore the original header image. You will not be able to restore any customizations.' ) ?></p>
<?php submit_button( __( 'Restore Original Header Image' ), 'button', 'resetheader', false ); ?>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
<?php if ( current_theme_supports( 'custom-header', 'header-text' ) ) : ?>
<h3><?php _e( 'Header Text' ); ?></h3>
<table class="form-table">
<tbody>
<tr valign="top">
<th scope="row"><?php _e( 'Header Text' ); ?></th>
<td>
<p>
<label><input type="checkbox" name="display-header-text" id="display-header-text"<?php checked( display_header_text() ); ?> /> <?php _e( 'Show header text with your image.' ); ?></label>
</p>
</td>
</tr>
<tr valign="top" class="displaying-header-text">
<th scope="row"><?php _e( 'Text Color' ); ?></th>
<td>
<p>
<?php
$header_textcolor = display_header_text() ? get_header_textcolor() : get_theme_support( 'custom-header', 'default-text-color' );
$default_color = '';
if ( current_theme_supports( 'custom-header', 'default-text-color' ) ) {
$default_color = '#' . get_theme_support( 'custom-header', 'default-text-color' );
$default_color_attr = ' data-default-color="' . esc_attr( $default_color ) . '"';
echo '<input type="text" name="text-color" id="text-color" value="#' . esc_attr( $header_textcolor ) . '"' . $default_color_attr . ' />';
if ( $default_color )
echo ' <span class="description hide-if-js">' . sprintf( _x( 'Default: %s', 'color' ), $default_color ) . '</span>';
}
?>
</p>
</td>
</tr>
</tbody>
</table>
<?php endif;
do_action( 'custom_header_options' );
wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?>
<?php submit_button( null, 'primary', 'save-header-options' ); ?>
</form>
</div>
<?php }
/**
* Display second step of custom header image page.
*
* @since 2.1.0
*/
function step_2() {
check_admin_referer('custom-header-upload', '_wpnonce-custom-header-upload');
if ( ! current_theme_supports( 'custom-header', 'uploads' ) )
wp_die( __( 'Cheatin’ uh?' ) );
if ( empty( $_POST ) && isset( $_GET['file'] ) ) {
$attachment_id = absint( $_GET['file'] );
$file = get_attached_file( $attachment_id, true );
$url = wp_get_attachment_image_src( $attachment_id, 'full');
$url = $url[0];
} elseif ( isset( $_POST ) ) {
extract($this->step_2_manage_upload());
}
if ( file_exists( $file ) ) {
list( $width, $height, $type, $attr ) = getimagesize( $file );
} else {
$data = wp_get_attachment_metadata( $attachment_id );
$height = $data[ 'height' ];
$width = $data[ 'width' ];
unset( $data );
}
$max_width = 0;
// For flex, limit size of image displayed to 1500px unless theme says otherwise
if ( current_theme_supports( 'custom-header', 'flex-width' ) )
$max_width = 1500;
if ( current_theme_supports( 'custom-header', 'max-width' ) )
$max_width = max( $max_width, get_theme_support( 'custom-header', 'max-width' ) );
$max_width = max( $max_width, get_theme_support( 'custom-header', 'width' ) );
// If flexible height isn't supported and the image is the exact right size
if ( ! current_theme_supports( 'custom-header', 'flex-height' ) && ! current_theme_supports( 'custom-header', 'flex-width' )
&& $width == get_theme_support( 'custom-header', 'width' ) && $height == get_theme_support( 'custom-header', 'height' ) )
{
// Add the meta-data
if ( file_exists( $file ) )
wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $file ) );
$this->set_header_image( compact( 'url', 'attachment_id', 'width', 'height' ) );
do_action('wp_create_file_in_uploads', $file, $attachment_id); // For replication
return $this->finished();
} elseif ( $width > $max_width ) {
$oitar = $width / $max_width;
$image = wp_crop_image($attachment_id, 0, 0, $width, $height, $max_width, $height / $oitar, false, str_replace(basename($file), 'midsize-'.basename($file), $file));
if ( ! $image || is_wp_error( $image ) )
wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) );
$image = apply_filters('wp_create_file_in_uploads', $image, $attachment_id); // For replication
$url = str_replace(basename($url), basename($image), $url);
$width = $width / $oitar;
$height = $height / $oitar;
} else {
$oitar = 1;
}
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php _e( 'Crop Header Image' ); ?></h2>
<form method="post" action="<?php echo esc_url(add_query_arg('step', 3)); ?>">
<p class="hide-if-no-js"><?php _e('Choose the part of the image you want to use as your header.'); ?></p>
<p class="hide-if-js"><strong><?php _e( 'You need Javascript to choose a part of the image.'); ?></strong></p>
<div id="crop_image" style="position: relative">
<img src="<?php echo esc_url( $url ); ?>" id="upload" width="<?php echo $width; ?>" height="<?php echo $height; ?>" />
</div>
<input type="hidden" name="x1" id="x1" value="0"/>
<input type="hidden" name="y1" id="y1" value="0"/>
<input type="hidden" name="width" id="width" value="<?php echo esc_attr( $width ); ?>"/>
<input type="hidden" name="height" id="height" value="<?php echo esc_attr( $height ); ?>"/>
<input type="hidden" name="attachment_id" id="attachment_id" value="<?php echo esc_attr( $attachment_id ); ?>" />
<input type="hidden" name="oitar" id="oitar" value="<?php echo esc_attr( $oitar ); ?>" />
<?php if ( empty( $_POST ) && isset( $_GET['file'] ) ) { ?>
<input type="hidden" name="create-new-attachment" value="true" />
<?php } ?>
<?php wp_nonce_field( 'custom-header-crop-image' ) ?>
<p class="submit">
<?php submit_button( __( 'Crop and Publish' ), 'primary', 'submit', false ); ?>
<?php
if ( isset( $oitar ) && 1 == $oitar && ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) )
submit_button( __( 'Skip Cropping, Publish Image as Is' ), 'secondary', 'skip-cropping', false );
?>
</p>
</form>
</div>
<?php
}
/**
* Upload the file to be cropped in the second step.
*
* @since 3.4.0
*/
function step_2_manage_upload() {
$overrides = array('test_form' => false);
$uploaded_file = $_FILES['import'];
$wp_filetype = wp_check_filetype_and_ext( $uploaded_file['tmp_name'], $uploaded_file['name'], false );
if ( ! wp_match_mime_types( 'image', $wp_filetype['type'] ) )
wp_die( __( 'The uploaded file is not a valid image. Please try again.' ) );
$file = wp_handle_upload($uploaded_file, $overrides);
if ( isset($file['error']) )
wp_die( $file['error'], __( 'Image Upload Error' ) );
$url = $file['url'];
$type = $file['type'];
$file = $file['file'];
$filename = basename($file);
// Construct the object array
$object = array(
'post_title' => $filename,
'post_content' => $url,
'post_mime_type' => $type,
'guid' => $url,
'context' => 'custom-header'
);
// Save the data
$attachment_id = wp_insert_attachment( $object, $file );
return compact( 'attachment_id', 'file', 'filename', 'url', 'type' );
}
/**
* Display third step of custom header image page.
*
* @since 2.1.0
*/
function step_3() {
check_admin_referer( 'custom-header-crop-image' );
if ( ! current_theme_supports( 'custom-header', 'uploads' ) )
wp_die( __( 'Cheatin’ uh?' ) );
if ( ! empty( $_POST['skip-cropping'] ) && ! ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) )
wp_die( __( 'Cheatin’ uh?' ) );
if ( $_POST['oitar'] > 1 ) {
$_POST['x1'] = $_POST['x1'] * $_POST['oitar'];
$_POST['y1'] = $_POST['y1'] * $_POST['oitar'];
$_POST['width'] = $_POST['width'] * $_POST['oitar'];
$_POST['height'] = $_POST['height'] * $_POST['oitar'];
}
$attachment_id = absint( $_POST['attachment_id'] );
$original = get_attached_file($attachment_id);
$max_width = 0;
// For flex, limit size of image displayed to 1500px unless theme says otherwise
if ( current_theme_supports( 'custom-header', 'flex-width' ) )
$max_width = 1500;
if ( current_theme_supports( 'custom-header', 'max-width' ) )
$max_width = max( $max_width, get_theme_support( 'custom-header', 'max-width' ) );
$max_width = max( $max_width, get_theme_support( 'custom-header', 'width' ) );
if ( ( current_theme_supports( 'custom-header', 'flex-height' ) && ! current_theme_supports( 'custom-header', 'flex-width' ) ) || $_POST['width'] > $max_width )
$dst_height = absint( $_POST['height'] * ( $max_width / $_POST['width'] ) );
elseif ( current_theme_supports( 'custom-header', 'flex-height' ) && current_theme_supports( 'custom-header', 'flex-width' ) )
$dst_height = absint( $_POST['height'] );
else
$dst_height = get_theme_support( 'custom-header', 'height' );
if ( ( current_theme_supports( 'custom-header', 'flex-width' ) && ! current_theme_supports( 'custom-header', 'flex-height' ) ) || $_POST['width'] > $max_width )
$dst_width = absint( $_POST['width'] * ( $max_width / $_POST['width'] ) );
elseif ( current_theme_supports( 'custom-header', 'flex-width' ) && current_theme_supports( 'custom-header', 'flex-height' ) )
$dst_width = absint( $_POST['width'] );
else
$dst_width = get_theme_support( 'custom-header', 'width' );
if ( empty( $_POST['skip-cropping'] ) )
$cropped = wp_crop_image( $attachment_id, (int) $_POST['x1'], (int) $_POST['y1'], (int) $_POST['width'], (int) $_POST['height'], $dst_width, $dst_height );
elseif ( ! empty( $_POST['create-new-attachment'] ) )
$cropped = _copy_image_file( $attachment_id );
else
$cropped = get_attached_file( $attachment_id );
if ( ! $cropped || is_wp_error( $cropped ) )
wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) );
$cropped = apply_filters('wp_create_file_in_uploads', $cropped, $attachment_id); // For replication
$parent = get_post($attachment_id);
$parent_url = $parent->guid;
$url = str_replace( basename( $parent_url ), basename( $cropped ), $parent_url );
$size = @getimagesize( $cropped );
$image_type = ( $size ) ? $size['mime'] : 'image/jpeg';
// Construct the object array
$object = array(
'ID' => $attachment_id,
'post_title' => basename($cropped),
'post_content' => $url,
'post_mime_type' => $image_type,
'guid' => $url,
'context' => 'custom-header'
);
if ( ! empty( $_POST['create-new-attachment'] ) )
unset( $object['ID'] );
// Update the attachment
$attachment_id = wp_insert_attachment( $object, $cropped );
wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $cropped ) );
$width = $dst_width;
$height = $dst_height;
$this->set_header_image( compact( 'url', 'attachment_id', 'width', 'height' ) );
// cleanup
$medium = str_replace( basename( $original ), 'midsize-' . basename( $original ), $original );
if ( file_exists( $medium ) )
@unlink( apply_filters( 'wp_delete_file', $medium ) );
if ( empty( $_POST['create-new-attachment'] ) && empty( $_POST['skip-cropping'] ) )
@unlink( apply_filters( 'wp_delete_file', $original ) );
return $this->finished();
}
/**
* Display last step of custom header image page.
*
* @since 2.1.0
*/
function finished() {
$this->updated = true;
$this->step_1();
}
/**
* Display the page based on the current step.
*
* @since 2.1.0
*/
function admin_page() {
if ( ! current_user_can('edit_theme_options') )
wp_die(__('You do not have permission to customize headers.'));
$step = $this->step();
if ( 2 == $step )
$this->step_2();
elseif ( 3 == $step )
$this->step_3();
else
$this->step_1();
}
/**
* Unused since 3.5.0.
*
* @since 3.4.0
*/
function attachment_fields_to_edit( $form_fields ) {
return $form_fields;
}
/**
* Unused since 3.5.0.
*
* @since 3.4.0
*/
function filter_upload_tabs( $tabs ) {
return $tabs;
}
/**
* Choose a header image, selected from existing uploaded and default headers,
* or provide an array of uploaded header data (either new, or from media library).
*
* @param mixed $choice Which header image to select. Allows for values of 'random-default-image',
* for randomly cycling among the default images; 'random-uploaded-image', for randomly cycling
* among the uploaded images; the key of a default image registered for that theme; and
* the key of an image uploaded for that theme (the basename of the URL).
* Or an array of arguments: attachment_id, url, width, height. All are required.
*
* @since 3.4.0
*/
final public function set_header_image( $choice ) {
if ( is_array( $choice ) || is_object( $choice ) ) {
$choice = (array) $choice;
if ( ! isset( $choice['attachment_id'] ) || ! isset( $choice['url'] ) )
return;
$choice['url'] = esc_url_raw( $choice['url'] );
$header_image_data = (object) array(
'attachment_id' => $choice['attachment_id'],
'url' => $choice['url'],
'thumbnail_url' => $choice['url'],
'height' => $choice['height'],
'width' => $choice['width'],
);
update_post_meta( $choice['attachment_id'], '_wp_attachment_is_custom_header', get_stylesheet() );
set_theme_mod( 'header_image', $choice['url'] );
set_theme_mod( 'header_image_data', $header_image_data );
return;
}
if ( in_array( $choice, array( 'remove-header', 'random-default-image', 'random-uploaded-image' ) ) ) {
set_theme_mod( 'header_image', $choice );
remove_theme_mod( 'header_image_data' );
return;
}
$uploaded = get_uploaded_header_images();
if ( $uploaded && isset( $uploaded[ $choice ] ) ) {
$header_image_data = $uploaded[ $choice ];
} else {
$this->process_default_headers();
if ( isset( $this->default_headers[ $choice ] ) )
$header_image_data = $this->default_headers[ $choice ];
else
return;
}
set_theme_mod( 'header_image', esc_url_raw( $header_image_data['url'] ) );
set_theme_mod( 'header_image_data', $header_image_data );
}
/**
* Remove a header image.
*
* @since 3.4.0
*/
final public function remove_header_image() {
return $this->set_header_image( 'remove-header' );
}
/**
* Reset a header image to the default image for the theme.
*
* This method does not do anything if the theme does not have a default header image.
*
* @since 3.4.0
*/
final public function reset_header_image() {
$this->process_default_headers();
$default = get_theme_support( 'custom-header', 'default-image' );
if ( ! $default )
return $this->remove_header_image();
$default = sprintf( $default, get_template_directory_uri(), get_stylesheet_directory_uri() );
foreach ( $this->default_headers as $header => $details ) {
if ( $details['url'] == $default ) {
$default_data = $details;
break;
}
}
set_theme_mod( 'header_image', $default );
set_theme_mod( 'header_image_data', (object) $default_data );
}
}
| zyblog | trunk/zyblog/wp-admin/custom-header.php | PHP | asf20 | 34,671 |
<?php
/**
* Edit Comments Administration Screen.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once('./admin.php');
if ( !current_user_can('edit_posts') )
wp_die(__('Cheatin’ uh?'));
$wp_list_table = _get_list_table('WP_Comments_List_Table');
$pagenum = $wp_list_table->get_pagenum();
$doaction = $wp_list_table->current_action();
if ( $doaction ) {
check_admin_referer( 'bulk-comments' );
if ( 'delete_all' == $doaction && !empty( $_REQUEST['pagegen_timestamp'] ) ) {
$comment_status = $wpdb->escape( $_REQUEST['comment_status'] );
$delete_time = $wpdb->escape( $_REQUEST['pagegen_timestamp'] );
$comment_ids = $wpdb->get_col( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = '$comment_status' AND '$delete_time' > comment_date_gmt" );
$doaction = 'delete';
} elseif ( isset( $_REQUEST['delete_comments'] ) ) {
$comment_ids = $_REQUEST['delete_comments'];
$doaction = ( $_REQUEST['action'] != -1 ) ? $_REQUEST['action'] : $_REQUEST['action2'];
} elseif ( isset( $_REQUEST['ids'] ) ) {
$comment_ids = array_map( 'absint', explode( ',', $_REQUEST['ids'] ) );
} elseif ( wp_get_referer() ) {
wp_safe_redirect( wp_get_referer() );
exit;
}
$approved = $unapproved = $spammed = $unspammed = $trashed = $untrashed = $deleted = 0;
$redirect_to = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'spammed', 'unspammed', 'approved', 'unapproved', 'ids' ), wp_get_referer() );
$redirect_to = add_query_arg( 'paged', $pagenum, $redirect_to );
foreach ( $comment_ids as $comment_id ) { // Check the permissions on each
if ( !current_user_can( 'edit_comment', $comment_id ) )
continue;
switch ( $doaction ) {
case 'approve' :
wp_set_comment_status( $comment_id, 'approve' );
$approved++;
break;
case 'unapprove' :
wp_set_comment_status( $comment_id, 'hold' );
$unapproved++;
break;
case 'spam' :
wp_spam_comment( $comment_id );
$spammed++;
break;
case 'unspam' :
wp_unspam_comment( $comment_id );
$unspammed++;
break;
case 'trash' :
wp_trash_comment( $comment_id );
$trashed++;
break;
case 'untrash' :
wp_untrash_comment( $comment_id );
$untrashed++;
break;
case 'delete' :
wp_delete_comment( $comment_id );
$deleted++;
break;
}
}
if ( $approved )
$redirect_to = add_query_arg( 'approved', $approved, $redirect_to );
if ( $unapproved )
$redirect_to = add_query_arg( 'unapproved', $unapproved, $redirect_to );
if ( $spammed )
$redirect_to = add_query_arg( 'spammed', $spammed, $redirect_to );
if ( $unspammed )
$redirect_to = add_query_arg( 'unspammed', $unspammed, $redirect_to );
if ( $trashed )
$redirect_to = add_query_arg( 'trashed', $trashed, $redirect_to );
if ( $untrashed )
$redirect_to = add_query_arg( 'untrashed', $untrashed, $redirect_to );
if ( $deleted )
$redirect_to = add_query_arg( 'deleted', $deleted, $redirect_to );
if ( $trashed || $spammed )
$redirect_to = add_query_arg( 'ids', join( ',', $comment_ids ), $redirect_to );
wp_safe_redirect( $redirect_to );
exit;
} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) );
exit;
}
$wp_list_table->prepare_items();
wp_enqueue_script('admin-comments');
enqueue_comment_hotkeys_js();
if ( $post_id )
$title = sprintf(__('Comments on “%s”'), wp_html_excerpt(_draft_or_post_title($post_id), 50));
else
$title = __('Comments');
add_screen_option( 'per_page', array('label' => _x( 'Comments', 'comments per page (screen options)' )) );
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __( 'You can manage comments made on your site similar to the way you manage posts and other content. This screen is customizable in the same ways as other management screens, and you can act on comments using the on-hover action links or the Bulk Actions.' ) . '</p>'
) );
get_current_screen()->add_help_tab( array(
'id' => 'moderating-comments',
'title' => __('Moderating Comments'),
'content' =>
'<p>' . __( 'A yellow row means the comment is waiting for you to moderate it.' ) . '</p>' .
'<p>' . __( 'In the <strong>Author</strong> column, in addition to the author’s name, email address, and blog URL, the commenter’s IP address is shown. Clicking on this link will show you all the comments made from this IP address.' ) . '</p>' .
'<p>' . __( 'In the <strong>Comment</strong> column, above each comment it says “Submitted on,” followed by the date and time the comment was left on your site. Clicking on the date/time link will take you to that comment on your live site. Hovering over any comment gives you options to approve, reply (and approve), quick edit, edit, spam mark, or trash that comment.' ) . '</p>' .
'<p>' . __( 'In the <strong>In Response To</strong> column, there are three elements. The text is the name of the post that inspired the comment, and links to the post editor for that entry. The View Post link leads to that post on your live site. The small bubble with the number in it shows the number of approved comments that post has received. If the bubble is gray, you have moderated all comments for that post. If it is blue, there are pending comments. Clicking the bubble will filter the comments screen to show only comments on that post.' ) . '</p>' .
'<p>' . __( 'Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link to the side to learn more.' ) . '</p>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="http://codex.wordpress.org/Administration_Screens#Comments" target="_blank">Documentation on Comments</a>' ) . '</p>' .
'<p>' . __( '<a href="http://codex.wordpress.org/Comment_Spam" target="_blank">Documentation on Comment Spam</a>' ) . '</p>' .
'<p>' . __( '<a href="http://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">Documentation on Keyboard Shortcuts</a>' ) . '</p>' .
'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
);
require_once('./admin-header.php');
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php
if ( $post_id )
echo sprintf(__('Comments on “%s”'),
sprintf('<a href="%s">%s</a>',
get_edit_post_link($post_id),
wp_html_excerpt(_draft_or_post_title($post_id), 50)
)
);
else
echo __('Comments');
if ( isset($_REQUEST['s']) && $_REQUEST['s'] )
printf( '<span class="subtitle">' . sprintf( __( 'Search results for “%s”' ), wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50 ) ) . '</span>' ); ?>
</h2>
<?php
if ( isset( $_REQUEST['error'] ) ) {
$error = (int) $_REQUEST['error'];
$error_msg = '';
switch ( $error ) {
case 1 :
$error_msg = __( 'Oops, no comment with this ID.' );
break;
case 2 :
$error_msg = __( 'You are not allowed to edit comments on this post.' );
break;
}
if ( $error_msg )
echo '<div id="moderated" class="error"><p>' . $error_msg . '</p></div>';
}
if ( isset($_REQUEST['approved']) || isset($_REQUEST['deleted']) || isset($_REQUEST['trashed']) || isset($_REQUEST['untrashed']) || isset($_REQUEST['spammed']) || isset($_REQUEST['unspammed']) || isset($_REQUEST['same']) ) {
$approved = isset( $_REQUEST['approved'] ) ? (int) $_REQUEST['approved'] : 0;
$deleted = isset( $_REQUEST['deleted'] ) ? (int) $_REQUEST['deleted'] : 0;
$trashed = isset( $_REQUEST['trashed'] ) ? (int) $_REQUEST['trashed'] : 0;
$untrashed = isset( $_REQUEST['untrashed'] ) ? (int) $_REQUEST['untrashed'] : 0;
$spammed = isset( $_REQUEST['spammed'] ) ? (int) $_REQUEST['spammed'] : 0;
$unspammed = isset( $_REQUEST['unspammed'] ) ? (int) $_REQUEST['unspammed'] : 0;
$same = isset( $_REQUEST['same'] ) ? (int) $_REQUEST['same'] : 0;
if ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 || $same > 0 ) {
if ( $approved > 0 )
$messages[] = sprintf( _n( '%s comment approved', '%s comments approved', $approved ), $approved );
if ( $spammed > 0 ) {
$ids = isset($_REQUEST['ids']) ? $_REQUEST['ids'] : 0;
$messages[] = sprintf( _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ), $spammed ) . ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=unspam&ids=$ids", "bulk-comments" ) ) . '">' . __('Undo') . '</a><br />';
}
if ( $unspammed > 0 )
$messages[] = sprintf( _n( '%s comment restored from the spam', '%s comments restored from the spam', $unspammed ), $unspammed );
if ( $trashed > 0 ) {
$ids = isset($_REQUEST['ids']) ? $_REQUEST['ids'] : 0;
$messages[] = sprintf( _n( '%s comment moved to the Trash.', '%s comments moved to the Trash.', $trashed ), $trashed ) . ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=untrash&ids=$ids", "bulk-comments" ) ) . '">' . __('Undo') . '</a><br />';
}
if ( $untrashed > 0 )
$messages[] = sprintf( _n( '%s comment restored from the Trash', '%s comments restored from the Trash', $untrashed ), $untrashed );
if ( $deleted > 0 )
$messages[] = sprintf( _n( '%s comment permanently deleted', '%s comments permanently deleted', $deleted ), $deleted );
if ( $same > 0 && $comment = get_comment( $same ) ) {
switch ( $comment->comment_approved ) {
case '1' :
$messages[] = __('This comment is already approved.') . ' <a href="' . esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ) . '">' . __( 'Edit comment' ) . '</a>';
break;
case 'trash' :
$messages[] = __( 'This comment is already in the Trash.' ) . ' <a href="' . esc_url( admin_url( 'edit-comments.php?comment_status=trash' ) ) . '"> ' . __( 'View Trash' ) . '</a>';
break;
case 'spam' :
$messages[] = __( 'This comment is already marked as spam.' ) . ' <a href="' . esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ) . '">' . __( 'Edit comment' ) . '</a>';
break;
}
}
echo '<div id="moderated" class="updated"><p>' . implode( "<br/>\n", $messages ) . '</p></div>';
}
}
?>
<?php $wp_list_table->views(); ?>
<form id="comments-form" action="" method="get">
<?php $wp_list_table->search_box( __( 'Search Comments' ), 'comment' ); ?>
<?php if ( $post_id ) : ?>
<input type="hidden" name="p" value="<?php echo esc_attr( intval( $post_id ) ); ?>" />
<?php endif; ?>
<input type="hidden" name="comment_status" value="<?php echo esc_attr($comment_status); ?>" />
<input type="hidden" name="pagegen_timestamp" value="<?php echo esc_attr(current_time('mysql', 1)); ?>" />
<input type="hidden" name="_total" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg('total_items') ); ?>" />
<input type="hidden" name="_per_page" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg('per_page') ); ?>" />
<input type="hidden" name="_page" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg('page') ); ?>" />
<?php if ( isset($_REQUEST['paged']) ) { ?>
<input type="hidden" name="paged" value="<?php echo esc_attr( absint( $_REQUEST['paged'] ) ); ?>" />
<?php } ?>
<?php $wp_list_table->display(); ?>
</form>
</div>
<div id="ajax-response"></div>
<?php
wp_comment_reply('-1', true, 'detail');
wp_comment_trashnotice();
include('./admin-footer.php'); ?>
| zyblog | trunk/zyblog/wp-admin/edit-comments.php | PHP | asf20 | 11,553 |
<?php
/**
* WordPress AJAX Process Execution.
*
* @package WordPress
* @subpackage Administration
*
* @link http://codex.wordpress.org/AJAX_in_Plugins
*/
/**
* Executing AJAX process.
*
* @since 2.1.0
*/
define( 'DOING_AJAX', true );
define( 'WP_ADMIN', true );
/** Load WordPress Bootstrap */
require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
/** Allow for cross-domain requests (from the frontend). */
send_origin_headers();
// Require an action parameter
if ( empty( $_REQUEST['action'] ) )
die( '0' );
/** Load WordPress Administration APIs */
require_once( ABSPATH . 'wp-admin/includes/admin.php' );
/** Load Ajax Handlers for WordPress Core */
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
@header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
@header( 'X-Robots-Tag: noindex' );
send_nosniff_header();
nocache_headers();
do_action( 'admin_init' );
$core_actions_get = array(
'fetch-list', 'ajax-tag-search', 'wp-compression-test', 'imgedit-preview', 'oembed-cache',
'autocomplete-user', 'dashboard-widgets', 'logged-in',
);
$core_actions_post = array(
'oembed-cache', 'image-editor', 'delete-comment', 'delete-tag', 'delete-link',
'delete-meta', 'delete-post', 'trash-post', 'untrash-post', 'delete-page', 'dim-comment',
'add-link-category', 'add-tag', 'get-tagcloud', 'get-comments', 'replyto-comment',
'edit-comment', 'add-menu-item', 'add-meta', 'add-user', 'autosave', 'closed-postboxes',
'hidden-columns', 'update-welcome-panel', 'menu-get-metabox', 'wp-link-ajax',
'menu-locations-save', 'menu-quick-search', 'meta-box-order', 'get-permalink',
'sample-permalink', 'inline-save', 'inline-save-tax', 'find_posts', 'widgets-order',
'save-widget', 'set-post-thumbnail', 'date_format', 'time_format', 'wp-fullscreen-save-post',
'wp-remove-post-lock', 'dismiss-wp-pointer', 'upload-attachment', 'get-attachment',
'query-attachments', 'save-attachment', 'save-attachment-compat', 'send-link-to-editor',
'send-attachment-to-editor', 'save-attachment-order',
);
// Register core Ajax calls.
if ( ! empty( $_GET['action'] ) && in_array( $_GET['action'], $core_actions_get ) )
add_action( 'wp_ajax_' . $_GET['action'], 'wp_ajax_' . str_replace( '-', '_', $_GET['action'] ), 1 );
if ( ! empty( $_POST['action'] ) && in_array( $_POST['action'], $core_actions_post ) )
add_action( 'wp_ajax_' . $_POST['action'], 'wp_ajax_' . str_replace( '-', '_', $_POST['action'] ), 1 );
add_action( 'wp_ajax_nopriv_autosave', 'wp_ajax_nopriv_autosave', 1 );
if ( is_user_logged_in() )
do_action( 'wp_ajax_' . $_REQUEST['action'] ); // Authenticated actions
else
do_action( 'wp_ajax_nopriv_' . $_REQUEST['action'] ); // Non-admin actions
// Default status
die( '0' );
| zyblog | trunk/zyblog/wp-admin/admin-ajax.php | PHP | asf20 | 2,755 |
<?php
/**
* Edit tag form for inclusion in administration panels.
*
* @package WordPress
* @subpackage Administration
*/
// don't load directly
if ( !defined('ABSPATH') )
die('-1');
if ( empty($tag_ID) ) { ?>
<div id="message" class="updated"><p><strong><?php _e( 'You did not select an item for editing.' ); ?></strong></p></div>
<?php
return;
}
// Back compat hooks
if ( 'category' == $taxonomy )
do_action('edit_category_form_pre', $tag );
elseif ( 'link_category' == $taxonomy )
do_action('edit_link_category_form_pre', $tag );
else
do_action('edit_tag_form_pre', $tag);
do_action($taxonomy . '_pre_edit_form', $tag, $taxonomy); ?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo $tax->labels->edit_item; ?></h2>
<div id="ajax-response"></div>
<form name="edittag" id="edittag" method="post" action="edit-tags.php" class="validate">
<input type="hidden" name="action" value="editedtag" />
<input type="hidden" name="tag_ID" value="<?php echo esc_attr($tag->term_id) ?>" />
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy) ?>" />
<?php wp_original_referer_field(true, 'previous'); wp_nonce_field('update-tag_' . $tag_ID); ?>
<table class="form-table">
<tr class="form-field form-required">
<th scope="row" valign="top"><label for="name"><?php _ex('Name', 'Taxonomy Name'); ?></label></th>
<td><input name="name" id="name" type="text" value="<?php if ( isset( $tag->name ) ) echo esc_attr($tag->name); ?>" size="40" aria-required="true" />
<p class="description"><?php _e('The name is how it appears on your site.'); ?></p></td>
</tr>
<?php if ( !global_terms_enabled() ) { ?>
<tr class="form-field">
<th scope="row" valign="top"><label for="slug"><?php _ex('Slug', 'Taxonomy Slug'); ?></label></th>
<td><input name="slug" id="slug" type="text" value="<?php if ( isset( $tag->slug ) ) echo esc_attr(apply_filters('editable_slug', $tag->slug)); ?>" size="40" />
<p class="description"><?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p></td>
</tr>
<?php } ?>
<?php if ( is_taxonomy_hierarchical($taxonomy) ) : ?>
<tr class="form-field">
<th scope="row" valign="top"><label for="parent"><?php _ex('Parent', 'Taxonomy Parent'); ?></label></th>
<td>
<?php wp_dropdown_categories(array('hide_empty' => 0, 'hide_if_empty' => false, 'name' => 'parent', 'orderby' => 'name', 'taxonomy' => $taxonomy, 'selected' => $tag->parent, 'exclude_tree' => $tag->term_id, 'hierarchical' => true, 'show_option_none' => __('None'))); ?>
<?php if ( 'category' == $taxonomy ) : ?>
<p class="description"><?php _e('Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.'); ?></p>
<?php endif; ?>
</td>
</tr>
<?php endif; // is_taxonomy_hierarchical() ?>
<tr class="form-field">
<th scope="row" valign="top"><label for="description"><?php _ex('Description', 'Taxonomy Description'); ?></label></th>
<td><textarea name="description" id="description" rows="5" cols="50" class="large-text"><?php echo $tag->description; // textarea_escaped ?></textarea><br />
<span class="description"><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></span></td>
</tr>
<?php
// Back compat hooks
if ( 'category' == $taxonomy )
do_action('edit_category_form_fields', $tag);
elseif ( 'link_category' == $taxonomy )
do_action('edit_link_category_form_fields', $tag);
else
do_action('edit_tag_form_fields', $tag);
do_action($taxonomy . '_edit_form_fields', $tag, $taxonomy);
?>
</table>
<?php
// Back compat hooks
if ( 'category' == $taxonomy )
do_action('edit_category_form', $tag);
elseif ( 'link_category' == $taxonomy )
do_action('edit_link_category_form', $tag);
else
do_action('edit_tag_form', $tag);
do_action($taxonomy . '_edit_form', $tag, $taxonomy);
submit_button( __('Update') );
?>
</form>
</div>
<script type="text/javascript">
try{document.forms.edittag.name.focus();}catch(e){}
</script>
| zyblog | trunk/zyblog/wp-admin/edit-tag-form.php | PHP | asf20 | 4,170 |
<?php
/**
* Edit Posts Administration Screen.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! $typenow )
wp_die( __( 'Invalid post type' ) );
$post_type = $typenow;
$post_type_object = get_post_type_object( $post_type );
if ( ! $post_type_object )
wp_die( __( 'Invalid post type' ) );
if ( ! current_user_can( $post_type_object->cap->edit_posts ) )
wp_die( __( 'Cheatin’ uh?' ) );
$wp_list_table = _get_list_table('WP_Posts_List_Table');
$pagenum = $wp_list_table->get_pagenum();
// Back-compat for viewing comments of an entry
foreach ( array( 'p', 'attachment_id', 'page_id' ) as $_redirect ) {
if ( ! empty( $_REQUEST[ $_redirect ] ) ) {
wp_redirect( admin_url( 'edit-comments.php?p=' . absint( $_REQUEST[ $_redirect ] ) ) );
exit;
}
}
unset( $_redirect );
if ( 'post' != $post_type ) {
$parent_file = "edit.php?post_type=$post_type";
$submenu_file = "edit.php?post_type=$post_type";
$post_new_file = "post-new.php?post_type=$post_type";
} else {
$parent_file = 'edit.php';
$submenu_file = 'edit.php';
$post_new_file = 'post-new.php';
}
$doaction = $wp_list_table->current_action();
if ( $doaction ) {
check_admin_referer('bulk-posts');
$sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() );
if ( ! $sendback )
$sendback = admin_url( $parent_file );
$sendback = add_query_arg( 'paged', $pagenum, $sendback );
if ( strpos($sendback, 'post.php') !== false )
$sendback = admin_url($post_new_file);
if ( 'delete_all' == $doaction ) {
$post_status = preg_replace('/[^a-z0-9_-]+/i', '', $_REQUEST['post_status']);
if ( get_post_status_object($post_status) ) // Check the post status exists first
$post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type=%s AND post_status = %s", $post_type, $post_status ) );
$doaction = 'delete';
} elseif ( isset( $_REQUEST['media'] ) ) {
$post_ids = $_REQUEST['media'];
} elseif ( isset( $_REQUEST['ids'] ) ) {
$post_ids = explode( ',', $_REQUEST['ids'] );
} elseif ( !empty( $_REQUEST['post'] ) ) {
$post_ids = array_map('intval', $_REQUEST['post']);
}
if ( !isset( $post_ids ) ) {
wp_redirect( $sendback );
exit;
}
switch ( $doaction ) {
case 'trash':
$trashed = 0;
foreach( (array) $post_ids as $post_id ) {
if ( !current_user_can($post_type_object->cap->delete_post, $post_id) )
wp_die( __('You are not allowed to move this item to the Trash.') );
if ( !wp_trash_post($post_id) )
wp_die( __('Error in moving to Trash.') );
$trashed++;
}
$sendback = add_query_arg( array('trashed' => $trashed, 'ids' => join(',', $post_ids) ), $sendback );
break;
case 'untrash':
$untrashed = 0;
foreach( (array) $post_ids as $post_id ) {
if ( !current_user_can($post_type_object->cap->delete_post, $post_id) )
wp_die( __('You are not allowed to restore this item from the Trash.') );
if ( !wp_untrash_post($post_id) )
wp_die( __('Error in restoring from Trash.') );
$untrashed++;
}
$sendback = add_query_arg('untrashed', $untrashed, $sendback);
break;
case 'delete':
$deleted = 0;
foreach( (array) $post_ids as $post_id ) {
$post_del = get_post($post_id);
if ( !current_user_can($post_type_object->cap->delete_post, $post_id) )
wp_die( __('You are not allowed to delete this item.') );
if ( $post_del->post_type == 'attachment' ) {
if ( ! wp_delete_attachment($post_id) )
wp_die( __('Error in deleting...') );
} else {
if ( !wp_delete_post($post_id) )
wp_die( __('Error in deleting...') );
}
$deleted++;
}
$sendback = add_query_arg('deleted', $deleted, $sendback);
break;
case 'edit':
if ( isset($_REQUEST['bulk_edit']) ) {
$done = bulk_edit_posts($_REQUEST);
if ( is_array($done) ) {
$done['updated'] = count( $done['updated'] );
$done['skipped'] = count( $done['skipped'] );
$done['locked'] = count( $done['locked'] );
$sendback = add_query_arg( $done, $sendback );
}
}
break;
}
$sendback = remove_query_arg( array('action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view'), $sendback );
wp_redirect($sendback);
exit();
} elseif ( ! empty($_REQUEST['_wp_http_referer']) ) {
wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
exit;
}
$wp_list_table->prepare_items();
wp_enqueue_script('inline-edit-post');
$title = $post_type_object->labels->name;
if ( 'post' == $post_type ) {
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __('This screen provides access to all of your posts. You can customize the display of this screen to suit your workflow.') . '</p>'
) );
get_current_screen()->add_help_tab( array(
'id' => 'screen-content',
'title' => __('Screen Content'),
'content' =>
'<p>' . __('You can customize the display of this screen’s contents in a number of ways:') . '</p>' .
'<ul>' .
'<li>' . __('You can hide/display columns based on your needs and decide how many posts to list per screen using the Screen Options tab.') . '</li>' .
'<li>' . __('You can filter the list of posts by post status using the text links in the upper left to show All, Published, Draft, or Trashed posts. The default view is to show all posts.') . '</li>' .
'<li>' . __('You can view posts in a simple title list or with an excerpt. Choose the view you prefer by clicking on the icons at the top of the list on the right.') . '</li>' .
'<li>' . __('You can refine the list to show only posts in a specific category or from a specific month by using the dropdown menus above the posts list. Click the Filter button after making your selection. You also can refine the list by clicking on the post author, category or tag in the posts list.') . '</li>' .
'</ul>'
) );
get_current_screen()->add_help_tab( array(
'id' => 'action-links',
'title' => __('Available Actions'),
'content' =>
'<p>' . __('Hovering over a row in the posts list will display action links that allow you to manage your post. You can perform the following actions:') . '</p>' .
'<ul>' .
'<li>' . __('<strong>Edit</strong> takes you to the editing screen for that post. You can also reach that screen by clicking on the post title.') . '</li>' .
'<li>' . __('<strong>Quick Edit</strong> provides inline access to the metadata of your post, allowing you to update post details without leaving this screen.') . '</li>' .
'<li>' . __('<strong>Trash</strong> removes your post from this list and places it in the trash, from which you can permanently delete it.') . '</li>' .
'<li>' . __('<strong>Preview</strong> will show you what your draft post will look like if you publish it. View will take you to your live site to view the post. Which link is available depends on your post’s status.') . '</li>' .
'</ul>'
) );
get_current_screen()->add_help_tab( array(
'id' => 'bulk-actions',
'title' => __('Bulk Actions'),
'content' =>
'<p>' . __('You can also edit or move multiple posts to the trash at once. Select the posts you want to act on using the checkboxes, then select the action you want to take from the Bulk Actions menu and click Apply.') . '</p>' .
'<p>' . __('When using Bulk Edit, you can change the metadata (categories, author, etc.) for all selected posts at once. To remove a post from the grouping, just click the x next to its name in the Bulk Edit area that appears.') . '</p>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Posts_Screen" target="_blank">Documentation on Managing Posts</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
} elseif ( 'page' == $post_type ) {
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __('Pages are similar to posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest pages under other pages by making one the “Parent” of the other, creating a group of pages.') . '</p>'
) );
get_current_screen()->add_help_tab( array(
'id' => 'managing-pages',
'title' => __('Managing Pages'),
'content' =>
'<p>' . __('Managing pages is very similar to managing posts, and the screens can be customized in the same way.') . '</p>' .
'<p>' . __('You can also perform the same types of actions, including narrowing the list by using the filters, acting on a page using the action links that appear when you hover over a row, or using the Bulk Actions menu to edit the metadata for multiple pages at once.') . '</p>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Pages_Screen" target="_blank">Documentation on Managing Pages</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
}
add_screen_option( 'per_page', array( 'label' => $title, 'default' => 20, 'option' => 'edit_' . $post_type . '_per_page' ) );
require_once('./admin-header.php');
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php
echo esc_html( $post_type_object->labels->name );
if ( current_user_can( $post_type_object->cap->create_posts ) )
echo ' <a href="' . esc_url( $post_new_file ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
if ( ! empty( $_REQUEST['s'] ) )
printf( ' <span class="subtitle">' . __('Search results for “%s”') . '</span>', get_search_query() );
?></h2>
<?php if ( isset( $_REQUEST['locked'] ) || isset( $_REQUEST['updated'] ) || isset( $_REQUEST['deleted'] ) || isset( $_REQUEST['trashed'] ) || isset( $_REQUEST['untrashed'] ) ) {
$messages = array();
?>
<div id="message" class="updated"><p>
<?php if ( isset( $_REQUEST['updated'] ) && $updated = absint( $_REQUEST['updated'] ) ) {
$messages[] = sprintf( _n( '%s post updated.', '%s posts updated.', $updated ), number_format_i18n( $updated ) );
}
if ( isset( $_REQUEST['locked'] ) && $locked = absint( $_REQUEST['locked'] ) ) {
$messages[] = sprintf( _n( '%s item not updated, somebody is editing it.', '%s items not updated, somebody is editing them.', $locked ), number_format_i18n( $locked ) );
}
if ( isset( $_REQUEST['deleted'] ) && $deleted = absint( $_REQUEST['deleted'] ) ) {
$messages[] = sprintf( _n( 'Item permanently deleted.', '%s items permanently deleted.', $deleted ), number_format_i18n( $deleted ) );
}
if ( isset( $_REQUEST['trashed'] ) && $trashed = absint( $_REQUEST['trashed'] ) ) {
$messages[] = sprintf( _n( 'Item moved to the Trash.', '%s items moved to the Trash.', $trashed ), number_format_i18n( $trashed ) );
$ids = isset($_REQUEST['ids']) ? $_REQUEST['ids'] : 0;
$messages[] = '<a href="' . esc_url( wp_nonce_url( "edit.php?post_type=$post_type&doaction=undo&action=untrash&ids=$ids", "bulk-posts" ) ) . '">' . __('Undo') . '</a>';
}
if ( isset( $_REQUEST['untrashed'] ) && $untrashed = absint( $_REQUEST['untrashed'] ) ) {
$messages[] = sprintf( _n( 'Item restored from the Trash.', '%s items restored from the Trash.', $untrashed ), number_format_i18n( $untrashed ) );
}
if ( $messages )
echo join( ' ', $messages );
unset( $messages );
$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed' ), $_SERVER['REQUEST_URI'] );
?>
</p></div>
<?php } ?>
<?php $wp_list_table->views(); ?>
<form id="posts-filter" action="" method="get">
<?php $wp_list_table->search_box( $post_type_object->labels->search_items, 'post' ); ?>
<input type="hidden" name="post_status" class="post_status_page" value="<?php echo !empty($_REQUEST['post_status']) ? esc_attr($_REQUEST['post_status']) : 'all'; ?>" />
<input type="hidden" name="post_type" class="post_type_page" value="<?php echo $post_type; ?>" />
<?php if ( ! empty( $_REQUEST['show_sticky'] ) ) { ?>
<input type="hidden" name="show_sticky" value="1" />
<?php } ?>
<?php $wp_list_table->display(); ?>
</form>
<?php
if ( $wp_list_table->has_items() )
$wp_list_table->inline_edit();
?>
<div id="ajax-response"></div>
<br class="clear" />
</div>
<?php
include('./admin-footer.php');
| zyblog | trunk/zyblog/wp-admin/edit.php | PHP | asf20 | 12,734 |
<?php
/**
* Theme editor administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once('./admin.php');
if ( is_multisite() && ! is_network_admin() ) {
wp_redirect( network_admin_url( 'theme-editor.php' ) );
exit();
}
if ( !current_user_can('edit_themes') )
wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site.').'</p>');
$title = __("Edit Themes");
$parent_file = 'themes.php';
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __('You can use the Theme Editor to edit the individual CSS and PHP files which make up your theme.') . '</p>
<p>' . __('Begin by choosing a theme to edit from the dropdown menu and clicking Select. A list then appears of all the template files. Clicking once on any file name causes the file to appear in the large Editor box.') . '</p>
<p>' . __('For PHP files, you can use the Documentation dropdown to select from functions recognized in that file. Lookup takes you to a web page with reference material about that particular function.') . '</p>
<p id="newcontent-description">' . __('In the editing area the Tab key enters a tab character. To move below this area by pressing Tab, press the Esc key followed by the Tab key.') . '</p>
<p>' . __('After typing in your edits, click Update File.') . '</p>
<p>' . __('<strong>Advice:</strong> think very carefully about your site crashing if you are live-editing the theme currently in use.') . '</p>
<p>' . __('Upgrading to a newer version of the same theme will override changes made here. To avoid this, consider creating a <a href="http://codex.wordpress.org/Child_Themes" target="_blank">child theme</a> instead.') . '</p>' .
( is_network_admin() ? '<p>' . __('Any edits to files from this screen will be reflected on all sites in the network.') . '</p>' : '' )
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Theme_Development" target="_blank">Documentation on Theme Development</a>') . '</p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Using_Themes" target="_blank">Documentation on Using Themes</a>') . '</p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Editing_Files" target="_blank">Documentation on Editing Files</a>') . '</p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Template_Tags" target="_blank">Documentation on Template Tags</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
wp_reset_vars( array( 'action', 'error', 'file', 'theme' ) );
if ( $theme )
$stylesheet = $theme;
else
$stylesheet = get_stylesheet();
$theme = wp_get_theme( $stylesheet );
if ( ! $theme->exists() )
wp_die( __( 'The requested theme does not exist.' ) );
if ( $theme->errors() && 'theme_no_stylesheet' == $theme->errors()->get_error_code() )
wp_die( __( 'The requested theme does not exist.' ) . ' ' . $theme->errors()->get_error_message() );
$allowed_files = $theme->get_files( 'php', 1 );
$has_templates = ! empty( $allowed_files );
$style_files = $theme->get_files( 'css' );
$allowed_files['style.css'] = $style_files['style.css'];
$allowed_files += $style_files;
if ( empty( $file ) ) {
$relative_file = 'style.css';
$file = $allowed_files['style.css'];
} else {
$relative_file = stripslashes( $file );
$file = $theme->get_stylesheet_directory() . '/' . $relative_file;
}
validate_file_to_edit( $file, $allowed_files );
$scrollto = isset( $_REQUEST['scrollto'] ) ? (int) $_REQUEST['scrollto'] : 0;
switch( $action ) {
case 'update':
check_admin_referer( 'edit-theme_' . $file . $stylesheet );
$newcontent = stripslashes( $_POST['newcontent'] );
$location = 'theme-editor.php?file=' . urlencode( $relative_file ) . '&theme=' . urlencode( $stylesheet ) . '&scrollto=' . $scrollto;
if ( is_writeable( $file ) ) {
//is_writable() not always reliable, check return value. see comments @ http://uk.php.net/is_writable
$f = fopen( $file, 'w+' );
if ( $f !== false ) {
fwrite( $f, $newcontent );
fclose( $f );
$location .= '&updated=true';
$theme->cache_delete();
}
}
wp_redirect( $location );
exit;
break;
default:
require_once( ABSPATH . 'wp-admin/admin-header.php' );
update_recently_edited( $file );
if ( ! is_file( $file ) )
$error = true;
$content = '';
if ( ! $error && filesize( $file ) > 0 ) {
$f = fopen($file, 'r');
$content = fread($f, filesize($file));
if ( '.php' == substr( $file, strrpos( $file, '.' ) ) ) {
$functions = wp_doc_link_parse( $content );
$docs_select = '<select name="docs-list" id="docs-list">';
$docs_select .= '<option value="">' . esc_attr__( 'Function Name...' ) . '</option>';
foreach ( $functions as $function ) {
$docs_select .= '<option value="' . esc_attr( urlencode( $function ) ) . '">' . htmlspecialchars( $function ) . '()</option>';
}
$docs_select .= '</select>';
}
$content = esc_textarea( $content );
}
?>
<?php if ( isset( $_GET['updated'] ) ) : ?>
<div id="message" class="updated"><p><?php _e( 'File edited successfully.' ) ?></p></div>
<?php endif;
$description = get_file_description( $file );
$file_show = array_search( $file, array_filter( $allowed_files ) );
if ( $description != $file_show )
$description .= ' <span>(' . $file_show . ')</span>';
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<div class="fileedit-sub">
<div class="alignleft">
<h3><?php echo $theme->display('Name'); if ( $description ) echo ': ' . $description; ?></h3>
</div>
<div class="alignright">
<form action="theme-editor.php" method="post">
<strong><label for="theme"><?php _e('Select theme to edit:'); ?> </label></strong>
<select name="theme" id="theme">
<?php
foreach ( wp_get_themes( array( 'errors' => null ) ) as $a_stylesheet => $a_theme ) {
if ( $a_theme->errors() && 'theme_no_stylesheet' == $a_theme->errors()->get_error_code() )
continue;
$selected = $a_stylesheet == $stylesheet ? ' selected="selected"' : '';
echo "\n\t" . '<option value="' . esc_attr( $a_stylesheet ) . '"' . $selected . '>' . $a_theme->display('Name') . '</option>';
}
?>
</select>
<?php submit_button( __( 'Select' ), 'button', 'Submit', false ); ?>
</form>
</div>
<br class="clear" />
</div>
<?php
if ( $theme->errors() )
echo '<div class="error"><p><strong>' . __( 'This theme is broken.' ) . '</strong> ' . $theme->errors()->get_error_message() . '</p></div>';
?>
<div id="templateside">
<?php
if ( $allowed_files ) :
if ( $has_templates || $theme->parent() ) :
?>
<h3><?php _e('Templates'); ?></h3>
<?php if ( $theme->parent() ) : ?>
<p class="howto"><?php printf( __( 'This child theme inherits templates from a parent theme, %s.' ), '<a href="' . self_admin_url('theme-editor.php?theme=' . urlencode( $theme->get_template() ) ) . '">' . $theme->parent()->display('Name') . '</a>' ); ?></p>
<?php endif; ?>
<ul>
<?php
endif;
foreach ( $allowed_files as $filename => $absolute_filename ) :
if ( 'style.css' == $filename )
echo "\t</ul>\n\t<h3>" . _x( 'Styles', 'Theme stylesheets in theme editor' ) . "</h3>\n\t<ul>\n";
$file_description = get_file_description( $absolute_filename );
if ( $file_description != basename( $filename ) )
$file_description .= '<br /><span class="nonessential">(' . $filename . ')</span>';
if ( $absolute_filename == $file )
$file_description = '<span class="highlight">' . $file_description . '</span>';
?>
<li><a href="theme-editor.php?file=<?php echo urlencode( $filename ) ?>&theme=<?php echo urlencode( $stylesheet ) ?>"><?php echo $file_description; ?></a></li>
<?php
endforeach;
?>
</ul>
<?php endif; ?>
</div>
<?php if ( $error ) :
echo '<div class="error"><p>' . __('Oops, no such file exists! Double check the name and try again, merci.') . '</p></div>';
else : ?>
<form name="template" id="template" action="theme-editor.php" method="post">
<?php wp_nonce_field( 'edit-theme_' . $file . $stylesheet ); ?>
<div><textarea cols="70" rows="30" name="newcontent" id="newcontent" aria-describedby="newcontent-description"><?php echo $content; ?></textarea>
<input type="hidden" name="action" value="update" />
<input type="hidden" name="file" value="<?php echo esc_attr( $relative_file ); ?>" />
<input type="hidden" name="theme" value="<?php echo esc_attr( $theme->get_stylesheet() ); ?>" />
<input type="hidden" name="scrollto" id="scrollto" value="<?php echo $scrollto; ?>" />
</div>
<?php if ( ! empty( $functions ) ) : ?>
<div id="documentation" class="hide-if-no-js">
<label for="docs-list"><?php _e('Documentation:') ?></label>
<?php echo $docs_select; ?>
<input type="button" class="button" value=" <?php esc_attr_e( 'Lookup' ); ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'http://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&locale=<?php echo urlencode( get_locale() ) ?>&version=<?php echo urlencode( $wp_version ) ?>&redirect=true'); }" />
</div>
<?php endif; ?>
<div>
<?php if ( is_child_theme() && $theme->get_stylesheet() == get_template() ) : ?>
<p><?php if ( is_writeable( $file ) ) { ?><strong><?php _e( 'Caution:' ); ?></strong><?php } ?>
<?php _e( 'This is a file in your current parent theme.' ); ?></p>
<?php endif; ?>
<?php
if ( is_writeable( $file ) ) :
submit_button( __( 'Update File' ), 'primary', 'submit', true );
else : ?>
<p><em><?php _e('You need to make this file writable before you can save your changes. See <a href="http://codex.wordpress.org/Changing_File_Permissions">the Codex</a> for more information.'); ?></em></p>
<?php endif; ?>
</div>
</form>
<?php
endif; // $error
?>
<br class="clear" />
</div>
<script type="text/javascript">
/* <![CDATA[ */
jQuery(document).ready(function($){
$('#template').submit(function(){ $('#scrollto').val( $('#newcontent').scrollTop() ); });
$('#newcontent').scrollTop( $('#scrollto').val() );
});
/* ]]> */
</script>
<?php
break;
}
include(ABSPATH . 'wp-admin/admin-footer.php' );
| zyblog | trunk/zyblog/wp-admin/theme-editor.php | PHP | asf20 | 10,197 |
<?php
/**
* Edit links form for inclusion in administration panels.
*
* @package WordPress
* @subpackage Administration
*/
// don't load directly
if ( !defined('ABSPATH') )
die('-1');
if ( ! empty($link_id) ) {
$heading = sprintf( __( '<a href="%s">Links</a> / Edit Link' ), 'link-manager.php' );
$submit_text = __('Update Link');
$form = '<form name="editlink" id="editlink" method="post" action="link.php">';
$nonce_action = 'update-bookmark_' . $link_id;
} else {
$heading = sprintf( __( '<a href="%s">Links</a> / Add New Link' ), 'link-manager.php' );
$submit_text = __('Add Link');
$form = '<form name="addlink" id="addlink" method="post" action="link.php">';
$nonce_action = 'add-bookmark';
}
require_once('./includes/meta-boxes.php');
add_meta_box('linksubmitdiv', __('Save'), 'link_submit_meta_box', null, 'side', 'core');
add_meta_box('linkcategorydiv', __('Categories'), 'link_categories_meta_box', null, 'normal', 'core');
add_meta_box('linktargetdiv', __('Target'), 'link_target_meta_box', null, 'normal', 'core');
add_meta_box('linkxfndiv', __('Link Relationship (XFN)'), 'link_xfn_meta_box', null, 'normal', 'core');
add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', null, 'normal', 'core');
do_action('add_meta_boxes', 'link', $link);
do_action('add_meta_boxes_link', $link);
do_action('do_meta_boxes', 'link', 'normal', $link);
do_action('do_meta_boxes', 'link', 'advanced', $link);
do_action('do_meta_boxes', 'link', 'side', $link);
add_screen_option('layout_columns', array('max' => 2, 'default' => 2) );
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __( 'You can add or edit links on this screen by entering information in each of the boxes. Only the link’s web address and name (the text you want to display on your site as the link) are required fields.' ) . '</p>' .
'<p>' . __( 'The boxes for link name, web address, and description have fixed positions, while the others may be repositioned using drag and drop. You can also hide boxes you don’t use in the Screen Options tab, or minimize boxes by clicking on the title bar of the box.' ) . '</p>' .
'<p>' . __( 'XFN stands for <a href="http://gmpg.org/xfn/" target="_blank">XHTML Friends Network</a>, which is optional. WordPress allows the generation of XFN attributes to show how you are related to the authors/owners of the site to which you are linking.' ) . '</p>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="http://codex.wordpress.org/Links_Add_New_Screen" target="_blank">Documentation on Creating Links</a>' ) . '</p>' .
'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
);
require_once ('admin-header.php');
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?> <a href="link-add.php" class="add-new-h2"><?php echo esc_html_x('Add New', 'link'); ?></a></h2>
<?php if ( isset( $_GET['added'] ) ) : ?>
<div id="message" class="updated"><p><?php _e('Link added.'); ?></p></div>
<?php endif; ?>
<?php
if ( !empty($form) )
echo $form;
if ( !empty($link_added) )
echo $link_added;
wp_nonce_field( $nonce_action );
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
<div id="poststuff">
<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
<div id="post-body-content">
<div id="namediv" class="stuffbox">
<h3><label for="link_name"><?php _ex('Name', 'link name') ?></label></h3>
<div class="inside">
<input type="text" name="link_name" size="30" value="<?php echo esc_attr($link->link_name); ?>" id="link_name" />
<p><?php _e('Example: Nifty blogging software'); ?></p>
</div>
</div>
<div id="addressdiv" class="stuffbox">
<h3><label for="link_url"><?php _e('Web Address') ?></label></h3>
<div class="inside">
<input type="text" name="link_url" size="30" class="code" value="<?php echo esc_attr($link->link_url); ?>" id="link_url" />
<p><?php _e('Example: <code>http://wordpress.org/</code> — don’t forget the <code>http://</code>'); ?></p>
</div>
</div>
<div id="descriptiondiv" class="stuffbox">
<h3><label for="link_description"><?php _e('Description') ?></label></h3>
<div class="inside">
<input type="text" name="link_description" size="30" value="<?php echo isset($link->link_description) ? esc_attr($link->link_description) : ''; ?>" id="link_description" />
<p><?php _e('This will be shown when someone hovers over the link in the blogroll, or optionally below the link.'); ?></p>
</div>
</div>
</div><!-- /post-body-content -->
<div id="postbox-container-1" class="postbox-container">
<?php
do_action('submitlink_box');
$side_meta_boxes = do_meta_boxes( 'link', 'side', $link );
?>
</div>
<div id="postbox-container-2" class="postbox-container">
<?php
do_meta_boxes(null, 'normal', $link);
do_meta_boxes(null, 'advanced', $link);
?>
</div>
<?php
if ( $link_id ) : ?>
<input type="hidden" name="action" value="save" />
<input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" />
<input type="hidden" name="order_by" value="<?php echo esc_attr($order_by); ?>" />
<input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" />
<?php else: ?>
<input type="hidden" name="action" value="add" />
<?php endif; ?>
</div>
</div>
</form>
</div>
| zyblog | trunk/zyblog/wp-admin/edit-link-form.php | PHP | asf20 | 5,559 |
<?php
/**
* Permalink Settings Administration Screen.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once('./admin.php');
if ( ! current_user_can( 'manage_options' ) )
wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );
$title = __('Permalink Settings');
$parent_file = 'options-general.php';
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' => '<p>' . __('Permalinks are the permanent URLs to your individual pages and blog posts, as well as your category and tag archives. A permalink is the web address used to link to your content. The URL to each post should be permanent, and never change — hence the name permalink.') . '</p>' .
'<p>' . __('This screen allows you to choose your default permalink structure. You can choose from common settings or create custom URL structures.') . '</p>' .
'<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>',
) );
get_current_screen()->add_help_tab( array(
'id' => 'common-settings',
'title' => __('Common Settings'),
'content' => '<p>' . __('Many people choose to use “pretty permalinks,” URLs that contain useful information such as the post title rather than generic post ID numbers. You can choose from any of the permalink formats under Common Settings, or can craft your own if you select Custom Structure.') . '</p>' .
'<p>' . __('If you pick an option other than Default, your general URL path with structure tags, terms surrounded by <code>%</code>, will also appear in the custom structure field and your path can be further modified there.') . '</p>' .
'<p>' . __('When you assign multiple categories or tags to a post, only one can show up in the permalink: the lowest numbered category. This applies if your custom structure includes <code>%category%</code> or <code>%tag%</code>.') . '</p>' .
'<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>',
) );
get_current_screen()->add_help_tab( array(
'id' => 'custom-structures',
'title' => __('Custom Structures'),
'content' => '<p>' . __('The Optional fields let you customize the “category” and “tag” base names that will appear in archive URLs. For example, the page listing all posts in the “Uncategorized” category could be <code>/topics/uncategorized</code> instead of <code>/category/uncategorized</code>.') . '</p>' .
'<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>',
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Settings_Permalinks_Screen" target="_blank">Documentation on Permalinks Settings</a>') . '</p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Using_Permalinks" target="_blank">Documentation on Using Permalinks</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
/**
* Display JavaScript on the page.
*
* @since 3.5.0
*/
function options_permalink_add_js() {
?>
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function() {
jQuery('.permalink-structure input:radio').change(function() {
if ( 'custom' == this.value )
return;
jQuery('#permalink_structure').val( this.value );
});
jQuery('#permalink_structure').focus(function() {
jQuery("#custom_selection").attr('checked', 'checked');
});
});
//]]>
</script>
<?php
}
add_filter('admin_head', 'options_permalink_add_js');
include('./admin-header.php');
$home_path = get_home_path();
$iis7_permalinks = iis7_supports_permalinks();
$prefix = $blog_prefix = '';
if ( ! got_mod_rewrite() && ! $iis7_permalinks )
$prefix = '/index.php';
if ( is_multisite() && !is_subdomain_install() && is_main_site() )
$blog_prefix = '/blog';
if ( isset($_POST['permalink_structure']) || isset($_POST['category_base']) ) {
check_admin_referer('update-permalink');
if ( isset( $_POST['permalink_structure'] ) ) {
if ( isset( $_POST['selection'] ) && 'custom' != $_POST['selection'] )
$permalink_structure = $_POST['selection'];
else
$permalink_structure = $_POST['permalink_structure'];
if ( ! empty( $permalink_structure ) ) {
$permalink_structure = preg_replace( '#/+#', '/', '/' . str_replace( '#', '', $permalink_structure ) );
if ( $prefix && $blog_prefix )
$permalink_structure = $prefix . preg_replace( '#^/?index\.php#', '', $permalink_structure );
else
$permalink_structure = $blog_prefix . $permalink_structure;
}
$wp_rewrite->set_permalink_structure( $permalink_structure );
}
if ( isset( $_POST['category_base'] ) ) {
$category_base = $_POST['category_base'];
if ( ! empty( $category_base ) )
$category_base = $blog_prefix . preg_replace('#/+#', '/', '/' . str_replace( '#', '', $category_base ) );
$wp_rewrite->set_category_base( $category_base );
}
if ( isset( $_POST['tag_base'] ) ) {
$tag_base = $_POST['tag_base'];
if ( ! empty( $tag_base ) )
$tag_base = $blog_prefix . preg_replace('#/+#', '/', '/' . str_replace( '#', '', $tag_base ) );
$wp_rewrite->set_tag_base( $tag_base );
}
create_initial_taxonomies();
}
$permalink_structure = get_option('permalink_structure');
$category_base = get_option('category_base');
$tag_base = get_option( 'tag_base' );
if ( $iis7_permalinks ) {
if ( ( ! file_exists($home_path . 'web.config') && win_is_writable($home_path) ) || win_is_writable($home_path . 'web.config') )
$writable = true;
else
$writable = false;
} else {
if ( ( ! file_exists($home_path . '.htaccess') && is_writable($home_path) ) || is_writable($home_path . '.htaccess') )
$writable = true;
else
$writable = false;
}
if ( $wp_rewrite->using_index_permalinks() )
$usingpi = true;
else
$usingpi = false;
flush_rewrite_rules();
if (isset($_POST['submit'])) : ?>
<div id="message" class="updated"><p><?php
if ( ! is_multisite() ) {
if ( $iis7_permalinks ) {
if ( $permalink_structure && ! $usingpi && ! $writable )
_e('You should update your web.config now.');
else if ( $permalink_structure && ! $usingpi && $writable )
_e('Permalink structure updated. Remove write access on web.config file now!');
else
_e('Permalink structure updated.');
} else {
if ( $permalink_structure && ! $usingpi && ! $writable )
_e('You should update your .htaccess now.');
else
_e('Permalink structure updated.');
}
} else {
_e('Permalink structure updated.');
}
?>
</p></div>
<?php endif; ?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<form name="form" action="options-permalink.php" method="post">
<?php wp_nonce_field('update-permalink') ?>
<p><?php _e('By default WordPress uses web <abbr title="Universal Resource Locator">URL</abbr>s which have question marks and lots of numbers in them, however WordPress offers you the ability to create a custom URL structure for your permalinks and archives. This can improve the aesthetics, usability, and forward-compatibility of your links. A <a href="http://codex.wordpress.org/Using_Permalinks">number of tags are available</a>, and here are some examples to get you started.'); ?></p>
<?php
if ( is_multisite() && !is_subdomain_install() && is_main_site() ) {
$permalink_structure = preg_replace( '|^/?blog|', '', $permalink_structure );
$category_base = preg_replace( '|^/?blog|', '', $category_base );
$tag_base = preg_replace( '|^/?blog|', '', $tag_base );
}
$structures = array(
0 => '',
1 => $prefix . '/%year%/%monthnum%/%day%/%postname%/',
2 => $prefix . '/%year%/%monthnum%/%postname%/',
3 => $prefix . '/' . _x( 'archives', 'sample permalink base' ) . '/%post_id%',
4 => $prefix . '/%postname%/',
);
?>
<h3><?php _e('Common Settings'); ?></h3>
<table class="form-table permalink-structure">
<tr>
<th><label><input name="selection" type="radio" value="" <?php checked('', $permalink_structure); ?> /> <?php _e('Default'); ?></label></th>
<td><code><?php echo get_option('home'); ?>/?p=123</code></td>
</tr>
<tr>
<th><label><input name="selection" type="radio" value="<?php echo esc_attr($structures[1]); ?>" <?php checked($structures[1], $permalink_structure); ?> /> <?php _e('Day and name'); ?></label></th>
<td><code><?php echo get_option('home') . $blog_prefix . $prefix . '/' . date('Y') . '/' . date('m') . '/' . date('d') . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>
</tr>
<tr>
<th><label><input name="selection" type="radio" value="<?php echo esc_attr($structures[2]); ?>" <?php checked($structures[2], $permalink_structure); ?> /> <?php _e('Month and name'); ?></label></th>
<td><code><?php echo get_option('home') . $blog_prefix . $prefix . '/' . date('Y') . '/' . date('m') . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>
</tr>
<tr>
<th><label><input name="selection" type="radio" value="<?php echo esc_attr($structures[3]); ?>" <?php checked($structures[3], $permalink_structure); ?> /> <?php _e('Numeric'); ?></label></th>
<td><code><?php echo get_option('home') . $blog_prefix . $prefix . '/' . _x( 'archives', 'sample permalink base' ) . '/123'; ?></code></td>
</tr>
<tr>
<th><label><input name="selection" type="radio" value="<?php echo esc_attr($structures[4]); ?>" <?php checked($structures[4], $permalink_structure); ?> /> <?php _e('Post name'); ?></label></th>
<td><code><?php echo get_option('home') . $blog_prefix . $prefix . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>
</tr>
<tr>
<th>
<label><input name="selection" id="custom_selection" type="radio" value="custom" <?php checked( !in_array($permalink_structure, $structures) ); ?> />
<?php _e('Custom Structure'); ?>
</label>
</th>
<td>
<code><?php echo get_option('home') . $blog_prefix; ?></code>
<input name="permalink_structure" id="permalink_structure" type="text" value="<?php echo esc_attr($permalink_structure); ?>" class="regular-text code" />
</td>
</tr>
</table>
<h3><?php _e('Optional'); ?></h3>
<?php
$suffix = '';
if ( ! $is_apache && ! $iis7_permalinks )
$suffix = 'index.php/';
?>
<p><?php
/* translators: %s is a placeholder that must come at the start of the URL path. */
printf( __('If you like, you may enter custom structures for your category and tag <abbr title="Universal Resource Locator">URL</abbr>s here. For example, using <code>topics</code> as your category base would make your category links like <code>http://example.org/%stopics/uncategorized/</code>. If you leave these blank the defaults will be used.'), $suffix ); ?></p>
<table class="form-table">
<tr>
<th><label for="category_base"><?php /* translators: prefix for category permalinks */ _e('Category base'); ?></label></th>
<td><?php echo $blog_prefix; ?> <input name="category_base" id="category_base" type="text" value="<?php echo esc_attr( $category_base ); ?>" class="regular-text code" /></td>
</tr>
<tr>
<th><label for="tag_base"><?php _e('Tag base'); ?></label></th>
<td><?php echo $blog_prefix; ?> <input name="tag_base" id="tag_base" type="text" value="<?php echo esc_attr($tag_base); ?>" class="regular-text code" /></td>
</tr>
<?php do_settings_fields('permalink', 'optional'); ?>
</table>
<?php do_settings_sections('permalink'); ?>
<?php submit_button(); ?>
</form>
<?php if ( !is_multisite() ) { ?>
<?php if ( $iis7_permalinks ) :
if ( isset($_POST['submit']) && $permalink_structure && ! $usingpi && ! $writable ) :
if ( file_exists($home_path . 'web.config') ) : ?>
<p><?php _e('If your <code>web.config</code> file were <a href="http://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn’t so this is the url rewrite rule you should have in your <code>web.config</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all. Then insert this rule inside of the <code>/<configuration>/<system.webServer>/<rewrite>/<rules></code> element in <code>web.config</code> file.') ?></p>
<form action="options-permalink.php" method="post">
<?php wp_nonce_field('update-permalink') ?>
<p><textarea rows="9" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules() ); ?></textarea></p>
</form>
<p><?php _e('If you temporarily make your <code>web.config</code> file writable for us to generate rewrite rules automatically, do not forget to revert the permissions after rule has been saved.') ?></p>
<?php else : ?>
<p><?php _e('If the root directory of your site were <a href="http://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn’t so this is the url rewrite rule you should have in your <code>web.config</code> file. Create a new file, called <code>web.config</code> in the root directory of your site. Click in the field and press <kbd>CTRL + a</kbd> to select all. Then insert this code into the <code>web.config</code> file.') ?></p>
<form action="options-permalink.php" method="post">
<?php wp_nonce_field('update-permalink') ?>
<p><textarea rows="18" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules(true) ); ?></textarea></p>
</form>
<p><?php _e('If you temporarily make your site’s root directory writable for us to generate the <code>web.config</code> file automatically, do not forget to revert the permissions after the file has been created.') ?></p>
<?php endif; ?>
<?php endif; ?>
<?php else :
if ( $permalink_structure && ! $usingpi && ! $writable ) : ?>
<p><?php _e('If your <code>.htaccess</code> file were <a href="http://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all.') ?></p>
<form action="options-permalink.php" method="post">
<?php wp_nonce_field('update-permalink') ?>
<p><textarea rows="6" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->mod_rewrite_rules() ); ?></textarea></p>
</form>
<?php endif; ?>
<?php endif; ?>
<?php } // multisite ?>
</div>
<?php require('./admin-footer.php'); ?>
| zyblog | trunk/zyblog/wp-admin/options-permalink.php | PHP | asf20 | 14,657 |
<?php
/**
* Discussion settings administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once('./admin.php');
if ( ! current_user_can( 'manage_options' ) )
wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );
$title = __('Discussion Settings');
$parent_file = 'options-general.php';
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' => '<p>' . __('This screen provides many options for controlling the management and display of comments and links to your posts/pages. So many, in fact, they won’t all fit here! :) Use the documentation links to get information on what each discussion setting does.') . '</p>' .
'<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>',
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Settings_Discussion_Screen" target="_blank">Documentation on Discussion Settings</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
include('./admin-header.php');
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<form method="post" action="options.php">
<?php settings_fields('discussion'); ?>
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e('Default article settings'); ?></th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e('Default article settings'); ?></span></legend>
<label for="default_pingback_flag">
<input name="default_pingback_flag" type="checkbox" id="default_pingback_flag" value="1" <?php checked('1', get_option('default_pingback_flag')); ?> />
<?php _e('Attempt to notify any blogs linked to from the article'); ?></label>
<br />
<label for="default_ping_status">
<input name="default_ping_status" type="checkbox" id="default_ping_status" value="open" <?php checked('open', get_option('default_ping_status')); ?> />
<?php _e('Allow link notifications from other blogs (pingbacks and trackbacks)'); ?></label>
<br />
<label for="default_comment_status">
<input name="default_comment_status" type="checkbox" id="default_comment_status" value="open" <?php checked('open', get_option('default_comment_status')); ?> />
<?php _e('Allow people to post comments on new articles'); ?></label>
<br />
<small><em><?php echo '(' . __('These settings may be overridden for individual articles.') . ')'; ?></em></small>
</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Other comment settings'); ?></th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e('Other comment settings'); ?></span></legend>
<label for="require_name_email"><input type="checkbox" name="require_name_email" id="require_name_email" value="1" <?php checked('1', get_option('require_name_email')); ?> /> <?php _e('Comment author must fill out name and e-mail'); ?></label>
<br />
<label for="comment_registration">
<input name="comment_registration" type="checkbox" id="comment_registration" value="1" <?php checked('1', get_option('comment_registration')); ?> />
<?php _e('Users must be registered and logged in to comment'); ?>
<?php if ( !get_option( 'users_can_register' ) && is_multisite() ) echo ' ' . __( '(Signup has been disabled. Only members of this site can comment.)' ); ?>
</label>
<br />
<label for="close_comments_for_old_posts">
<input name="close_comments_for_old_posts" type="checkbox" id="close_comments_for_old_posts" value="1" <?php checked('1', get_option('close_comments_for_old_posts')); ?> />
<?php printf( __('Automatically close comments on articles older than %s days'), '</label><label for="close_comments_days_old"><input name="close_comments_days_old" type="number" min="0" step="1" id="close_comments_days_old" value="' . esc_attr(get_option('close_comments_days_old')) . '" class="small-text" />'); ?>
</label>
<br />
<label for="thread_comments">
<input name="thread_comments" type="checkbox" id="thread_comments" value="1" <?php checked('1', get_option('thread_comments')); ?> />
<?php
$maxdeep = (int) apply_filters( 'thread_comments_depth_max', 10 );
$thread_comments_depth = '</label><label for="thread_comments_depth"><select name="thread_comments_depth" id="thread_comments_depth">';
for ( $i = 2; $i <= $maxdeep; $i++ ) {
$thread_comments_depth .= "<option value='" . esc_attr($i) . "'";
if ( get_option('thread_comments_depth') == $i ) $thread_comments_depth .= " selected='selected'";
$thread_comments_depth .= ">$i</option>";
}
$thread_comments_depth .= '</select>';
printf( __('Enable threaded (nested) comments %s levels deep'), $thread_comments_depth );
?></label>
<br />
<label for="page_comments">
<input name="page_comments" type="checkbox" id="page_comments" value="1" <?php checked('1', get_option('page_comments')); ?> />
<?php
$default_comments_page = '</label><label for="default_comments_page"><select name="default_comments_page" id="default_comments_page"><option value="newest"';
if ( 'newest' == get_option('default_comments_page') ) $default_comments_page .= ' selected="selected"';
$default_comments_page .= '>' . __('last') . '</option><option value="oldest"';
if ( 'oldest' == get_option('default_comments_page') ) $default_comments_page .= ' selected="selected"';
$default_comments_page .= '>' . __('first') . '</option></select>';
printf( __('Break comments into pages with %1$s top level comments per page and the %2$s page displayed by default'), '</label><label for="comments_per_page"><input name="comments_per_page" type="number" step="1" min="0" id="comments_per_page" value="' . esc_attr(get_option('comments_per_page')) . '" class="small-text" />', $default_comments_page );
?></label>
<br />
<label for="comment_order"><?php
$comment_order = '<select name="comment_order" id="comment_order"><option value="asc"';
if ( 'asc' == get_option('comment_order') ) $comment_order .= ' selected="selected"';
$comment_order .= '>' . __('older') . '</option><option value="desc"';
if ( 'desc' == get_option('comment_order') ) $comment_order .= ' selected="selected"';
$comment_order .= '>' . __('newer') . '</option></select>';
printf( __('Comments should be displayed with the %s comments at the top of each page'), $comment_order );
?></label>
</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('E-mail me whenever'); ?></th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e('E-mail me whenever'); ?></span></legend>
<label for="comments_notify">
<input name="comments_notify" type="checkbox" id="comments_notify" value="1" <?php checked('1', get_option('comments_notify')); ?> />
<?php _e('Anyone posts a comment'); ?> </label>
<br />
<label for="moderation_notify">
<input name="moderation_notify" type="checkbox" id="moderation_notify" value="1" <?php checked('1', get_option('moderation_notify')); ?> />
<?php _e('A comment is held for moderation'); ?> </label>
</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Before a comment appears'); ?></th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e('Before a comment appears'); ?></span></legend>
<label for="comment_moderation">
<input name="comment_moderation" type="checkbox" id="comment_moderation" value="1" <?php checked('1', get_option('comment_moderation')); ?> />
<?php _e('An administrator must always approve the comment'); ?> </label>
<br />
<label for="comment_whitelist"><input type="checkbox" name="comment_whitelist" id="comment_whitelist" value="1" <?php checked('1', get_option('comment_whitelist')); ?> /> <?php _e('Comment author must have a previously approved comment'); ?></label>
</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Comment Moderation'); ?></th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e('Comment Moderation'); ?></span></legend>
<p><label for="comment_max_links"><?php printf(__('Hold a comment in the queue if it contains %s or more links. (A common characteristic of comment spam is a large number of hyperlinks.)'), '<input name="comment_max_links" type="number" step="1" min="0" id="comment_max_links" value="' . esc_attr(get_option('comment_max_links')) . '" class="small-text" />' ); ?></label></p>
<p><label for="moderation_keys"><?php _e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be held in the <a href="edit-comments.php?comment_status=moderated">moderation queue</a>. One word or IP per line. It will match inside words, so “press” will match “WordPress”.'); ?></label></p>
<p>
<textarea name="moderation_keys" rows="10" cols="50" id="moderation_keys" class="large-text code"><?php echo esc_textarea( get_option( 'moderation_keys' ) ); ?></textarea>
</p>
</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Comment Blacklist'); ?></th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e('Comment Blacklist'); ?></span></legend>
<p><label for="blacklist_keys"><?php _e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be marked as spam. One word or IP per line. It will match inside words, so “press” will match “WordPress”.'); ?></label></p>
<p>
<textarea name="blacklist_keys" rows="10" cols="50" id="blacklist_keys" class="large-text code"><?php echo esc_textarea( get_option( 'blacklist_keys' ) ); ?></textarea>
</p>
</fieldset></td>
</tr>
<?php do_settings_fields('discussion', 'default'); ?>
</table>
<h3><?php _e('Avatars'); ?></h3>
<p><?php _e('An avatar is an image that follows you from weblog to weblog appearing beside your name when you comment on avatar enabled sites. Here you can enable the display of avatars for people who comment on your site.'); ?></p>
<?php // the above would be a good place to link to codex documentation on the gravatar functions, for putting it in themes. anything like that? ?>
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e('Avatar Display'); ?></th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e('Avatar Display'); ?></span></legend>
<label for="show_avatars">
<input type="checkbox" id="show_avatars" name="show_avatars" value="1" <?php checked( get_option('show_avatars'), 1 ); ?> />
<?php _e( 'Show Avatars' ); ?>
</label>
</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Maximum Rating'); ?></th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e('Maximum Rating'); ?></span></legend>
<?php
$ratings = array(
/* translators: Content suitability rating: http://bit.ly/89QxZA */
'G' => __('G — Suitable for all audiences'),
/* translators: Content suitability rating: http://bit.ly/89QxZA */
'PG' => __('PG — Possibly offensive, usually for audiences 13 and above'),
/* translators: Content suitability rating: http://bit.ly/89QxZA */
'R' => __('R — Intended for adult audiences above 17'),
/* translators: Content suitability rating: http://bit.ly/89QxZA */
'X' => __('X — Even more mature than above')
);
foreach ($ratings as $key => $rating) :
$selected = (get_option('avatar_rating') == $key) ? 'checked="checked"' : '';
echo "\n\t<label><input type='radio' name='avatar_rating' value='" . esc_attr($key) . "' $selected/> $rating</label><br />";
endforeach;
?>
</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Default Avatar'); ?></th>
<td class="defaultavatarpicker"><fieldset><legend class="screen-reader-text"><span><?php _e('Default Avatar'); ?></span></legend>
<?php _e('For users without a custom avatar of their own, you can either display a generic logo or a generated one based on their e-mail address.'); ?><br />
<?php
$avatar_defaults = array(
'mystery' => __('Mystery Man'),
'blank' => __('Blank'),
'gravatar_default' => __('Gravatar Logo'),
'identicon' => __('Identicon (Generated)'),
'wavatar' => __('Wavatar (Generated)'),
'monsterid' => __('MonsterID (Generated)'),
'retro' => __('Retro (Generated)')
);
$avatar_defaults = apply_filters('avatar_defaults', $avatar_defaults);
$default = get_option('avatar_default');
if ( empty($default) )
$default = 'mystery';
$size = 32;
$avatar_list = '';
foreach ( $avatar_defaults as $default_key => $default_name ) {
$selected = ($default == $default_key) ? 'checked="checked" ' : '';
$avatar_list .= "\n\t<label><input type='radio' name='avatar_default' id='avatar_{$default_key}' value='" . esc_attr($default_key) . "' {$selected}/> ";
$avatar = get_avatar( $user_email, $size, $default_key );
$avatar_list .= preg_replace("/src='(.+?)'/", "src='\$1&forcedefault=1'", $avatar);
$avatar_list .= ' ' . $default_name . '</label>';
$avatar_list .= '<br />';
}
echo apply_filters('default_avatar_select', $avatar_list);
?>
</fieldset></td>
</tr>
<?php do_settings_fields('discussion', 'avatars'); ?>
</table>
<?php do_settings_sections('discussion'); ?>
<?php submit_button(); ?>
</form>
</div>
<?php include('./admin-footer.php'); ?>
| zyblog | trunk/zyblog/wp-admin/options-discussion.php | PHP | asf20 | 13,197 |
<?php
/**
* Edit post administration panel.
*
* Manage Post actions: post, edit, delete, etc.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once('./admin.php');
$parent_file = 'edit.php';
$submenu_file = 'edit.php';
wp_reset_vars(array('action', 'safe_mode', 'withcomments', 'posts', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder'));
if ( isset( $_GET['post'] ) )
$post_id = $post_ID = (int) $_GET['post'];
elseif ( isset( $_POST['post_ID'] ) )
$post_id = $post_ID = (int) $_POST['post_ID'];
else
$post_id = $post_ID = 0;
$post = $post_type = $post_type_object = null;
if ( $post_id )
$post = get_post( $post_id );
if ( $post ) {
$post_type = $post->post_type;
$post_type_object = get_post_type_object( $post_type );
}
/**
* Redirect to previous page.
*
* @param int $post_id Optional. Post ID.
*/
function redirect_post($post_id = '') {
if ( isset($_POST['save']) || isset($_POST['publish']) ) {
$status = get_post_status( $post_id );
if ( isset( $_POST['publish'] ) ) {
switch ( $status ) {
case 'pending':
$message = 8;
break;
case 'future':
$message = 9;
break;
default:
$message = 6;
}
} else {
$message = 'draft' == $status ? 10 : 1;
}
$location = add_query_arg( 'message', $message, get_edit_post_link( $post_id, 'url' ) );
} elseif ( isset($_POST['addmeta']) && $_POST['addmeta'] ) {
$location = add_query_arg( 'message', 2, wp_get_referer() );
$location = explode('#', $location);
$location = $location[0] . '#postcustom';
} elseif ( isset($_POST['deletemeta']) && $_POST['deletemeta'] ) {
$location = add_query_arg( 'message', 3, wp_get_referer() );
$location = explode('#', $location);
$location = $location[0] . '#postcustom';
} elseif ( 'post-quickpress-save-cont' == $_POST['action'] ) {
$location = "post.php?action=edit&post=$post_id&message=7";
} else {
$location = add_query_arg( 'message', 4, get_edit_post_link( $post_id, 'url' ) );
}
wp_redirect( apply_filters( 'redirect_post_location', $location, $post_id ) );
exit;
}
if ( isset( $_POST['deletepost'] ) )
$action = 'delete';
elseif ( isset($_POST['wp-preview']) && 'dopreview' == $_POST['wp-preview'] )
$action = 'preview';
$sendback = wp_get_referer();
if ( ! $sendback ||
strpos( $sendback, 'post.php' ) !== false ||
strpos( $sendback, 'post-new.php' ) !== false ) {
if ( 'attachment' == $post_type ) {
$sendback = admin_url( 'upload.php' );
} else {
$sendback = admin_url( 'edit.php' );
$sendback .= ( ! empty( $post_type ) ) ? '?post_type=' . $post_type : '';
}
} else {
$sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), $sendback );
}
switch($action) {
case 'postajaxpost':
case 'post':
case 'post-quickpress-publish':
case 'post-quickpress-save':
check_admin_referer('add-' . $post_type);
if ( 'post-quickpress-publish' == $action )
$_POST['publish'] = 'publish'; // tell write_post() to publish
if ( 'post-quickpress-publish' == $action || 'post-quickpress-save' == $action ) {
$_POST['comment_status'] = get_option('default_comment_status');
$_POST['ping_status'] = get_option('default_ping_status');
$post_id = edit_post();
} else {
$post_id = 'postajaxpost' == $action ? edit_post() : write_post();
}
if ( 0 === strpos( $action, 'post-quickpress' ) ) {
$_POST['post_ID'] = $post_id;
// output the quickpress dashboard widget
require_once(ABSPATH . 'wp-admin/includes/dashboard.php');
wp_dashboard_quick_press();
exit;
}
redirect_post($post_id);
exit();
break;
case 'edit':
$editing = true;
if ( empty( $post_id ) ) {
wp_redirect( admin_url('post.php') );
exit();
}
$p = $post_id;
if ( empty($post->ID) )
wp_die( __('You attempted to edit an item that doesn’t exist. Perhaps it was deleted?') );
if ( null == $post_type_object )
wp_die( __('Unknown post type.') );
if ( !current_user_can($post_type_object->cap->edit_post, $post_id) )
wp_die( __('You are not allowed to edit this item.') );
if ( 'trash' == $post->post_status )
wp_die( __('You can’t edit this item because it is in the Trash. Please restore it and try again.') );
$post_type = $post->post_type;
if ( 'post' == $post_type ) {
$parent_file = "edit.php";
$submenu_file = "edit.php";
$post_new_file = "post-new.php";
} elseif ( 'attachment' == $post_type ) {
$parent_file = 'upload.php';
$submenu_file = 'upload.php';
$post_new_file = 'media-new.php';
} else {
if ( isset( $post_type_object ) && $post_type_object->show_in_menu && $post_type_object->show_in_menu !== true )
$parent_file = $post_type_object->show_in_menu;
else
$parent_file = "edit.php?post_type=$post_type";
$submenu_file = "edit.php?post_type=$post_type";
$post_new_file = "post-new.php?post_type=$post_type";
}
if ( $last = wp_check_post_lock( $post->ID ) ) {
add_action('admin_notices', '_admin_notice_post_locked' );
} else {
$active_post_lock = wp_set_post_lock( $post->ID );
if ( 'attachment' !== $post_type )
wp_enqueue_script('autosave');
}
$title = $post_type_object->labels->edit_item;
$post = get_post($post_id, OBJECT, 'edit');
if ( post_type_supports($post_type, 'comments') ) {
wp_enqueue_script('admin-comments');
enqueue_comment_hotkeys_js();
}
include('./edit-form-advanced.php');
break;
case 'editattachment':
check_admin_referer('update-post_' . $post_id);
// Don't let these be changed
unset($_POST['guid']);
$_POST['post_type'] = 'attachment';
// Update the thumbnail filename
$newmeta = wp_get_attachment_metadata( $post_id, true );
$newmeta['thumb'] = $_POST['thumb'];
wp_update_attachment_metadata( $post_id, $newmeta );
case 'editpost':
check_admin_referer('update-post_' . $post_id);
$post_id = edit_post();
redirect_post($post_id); // Send user on their way while we keep working
exit();
break;
case 'trash':
check_admin_referer('trash-post_' . $post_id);
$post = get_post($post_id);
if ( !current_user_can($post_type_object->cap->delete_post, $post_id) )
wp_die( __('You are not allowed to move this item to the Trash.') );
if ( ! wp_trash_post($post_id) )
wp_die( __('Error in moving to Trash.') );
wp_redirect( add_query_arg( array('trashed' => 1, 'ids' => $post_id), $sendback ) );
exit();
break;
case 'untrash':
check_admin_referer('untrash-post_' . $post_id);
if ( !current_user_can($post_type_object->cap->delete_post, $post_id) )
wp_die( __('You are not allowed to move this item out of the Trash.') );
if ( ! wp_untrash_post($post_id) )
wp_die( __('Error in restoring from Trash.') );
wp_redirect( add_query_arg('untrashed', 1, $sendback) );
exit();
break;
case 'delete':
check_admin_referer('delete-post_' . $post_id);
if ( !current_user_can($post_type_object->cap->delete_post, $post_id) )
wp_die( __('You are not allowed to delete this item.') );
$force = !EMPTY_TRASH_DAYS;
if ( $post->post_type == 'attachment' ) {
$force = ( $force || !MEDIA_TRASH );
if ( ! wp_delete_attachment($post_id, $force) )
wp_die( __('Error in deleting.') );
} else {
if ( !wp_delete_post($post_id, $force) )
wp_die( __('Error in deleting.') );
}
wp_redirect( add_query_arg('deleted', 1, $sendback) );
exit();
break;
case 'preview':
check_admin_referer( 'autosave', 'autosavenonce' );
$url = post_preview();
wp_redirect($url);
exit();
break;
default:
wp_redirect( admin_url('edit.php') );
exit();
break;
} // end switch
include('./admin-footer.php');
| zyblog | trunk/zyblog/wp-admin/post.php | PHP | asf20 | 7,632 |
body#media-upload ul#sidemenu {
left: auto;
right: 0;
}
#search-filter {
text-align: left;
}
/* specific to the image upload form */
.align .field label {
padding: 0 23px 0 0;
margin: 0 3px 0 1em;
}
.image-align-none-label, .image-align-left-label, .image-align-center-label, .image-align-right-label {
background-position: center right;
}
tr.image-size label {
margin: 0 5px 0 0;
}
.file-error {
margin: 0 50px 5px 0;
}
.progress {
left: auto;
right: 0;
}
.describe td {
padding: 0 0 0 5px;
}
/* Specific to Uploader */
#media-upload .describe th.label {
text-align: right;
}
.menu_order {
float: left;
}
.media-upload-form label.form-help, td.help, #media-upload p.help, #media-upload label.help {
font-family: Tahoma, Arial;
}
#gallery-settings #basic th.label {
padding: 5px 0 5px 5px;
}
#gallery-settings .title, h3.media-title {
font-family: Tahoma, Arial;
}
#gallery-settings .describe th.label {
text-align: right;
}
#gallery-settings label,
#gallery-settings legend {
margin-right: 0;
margin-left: 15px;
}
#gallery-settings .align .field label {
margin: 0 3px 0 1em;
}
#sort-buttons {
margin: 3px 0 -8px 25px;
text-align: left;
}
#sort-buttons #asc,
#sort-buttons #showall {
padding-left: 0;
padding-right: 5px;
}
#sort-buttons span {
margin-right: 0;
margin-left: 25px;
}
| zyblog | trunk/zyblog/wp-admin/css/media-rtl.css | CSS | asf20 | 1,311 |
body {
overflow: hidden;
}
#customize-controls a {
text-decoration: none;
}
.customize-section {
border-top: 1px solid #fff;
border-bottom: 1px solid #dfdfdf;
margin: 0;
}
.control-section.customize-section:hover,
.control-section.customize-section.open {
border-top-color: #808080;
}
.control-section.customize-section:hover {
border-bottom-color: #6d6d6d;
}
.customize-section.open:hover {
border-bottom-color: #dfdfdf;
}
.customize-section:last-child {
box-shadow: 0 1px 0 0px #fff;
}
.customize-section-title {
margin: 0;
padding: 15px 20px;
position: relative;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.customize-section-title:focus {
outline: none;
}
.cannot-expand .customize-section-title {
cursor: auto;
}
.customize-section-content {
display: none;
padding: 10px 20px 15px;
overflow: hidden;
}
.control-section .customize-section-title {
padding: 10px 20px;
font-size: 15px;
font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
font-weight: normal;
text-shadow: 0 1px 0 #fff;
background: #f5f5f5;
background-image: -webkit-gradient(linear, left bottom, left top, from(#eee), to(#f5f5f5));
background-image: -webkit-linear-gradient(bottom, #eee, #f5f5f5);
background-image: -moz-linear-gradient(bottom, #eee, #f5f5f5);
background-image: -o-linear-gradient(bottom, #eee, #f5f5f5);
background-image: linear-gradient(to top, #eee, #f5f5f5);
}
.control-section:hover .customize-section-title,
.control-section .customize-section-title:hover,
.control-section.open .customize-section-title,
.control-section .customize-section-title:focus {
color: #fff;
text-shadow: 0 -1px 0 #333;
background: #808080;
background-image: -webkit-gradient(linear, left bottom, left top, from(#6d6d6d), to(#808080));
background-image: -webkit-linear-gradient(bottom, #6d6d6d, #808080);
background-image: -moz-linear-gradient(bottom, #6d6d6d, #808080);
background-image: -o-linear-gradient(bottom, #6d6d6d, #808080);
background-image: linear-gradient(to top, #6d6d6d, #808080);
}
.control-section.open .customize-section-title {
border-bottom: 1px solid #6d6d6d;
}
.customize-section.open .customize-section-content {
display: block;
background: #fdfdfd;
}
.customize-section-title:after {
content: '';
width: 0;
height: 0;
border-color: #ccc transparent;
border-style: solid;
border-width: 6px 6px 0;
position: absolute;
top: 25px;
right: 20px;
z-index: 1;
}
.cannot-expand .customize-section-title:after {
display: none;
}
.customize-section-title:hover:after,
.customize-section-title:focus:after {
border-color: #aaa transparent;
}
.control-section .customize-section-title:hover:after,
.control-section .customize-section-title:focus:after {
border-color: #eee transparent;
}
.control-section .customize-section-title:after {
top: 15px;
}
#customize-info .customize-section-content {
background: transparent;
}
#customize-info .preview-notice {
font-size: 13px;
line-height: 24px;
color: #999;
}
#customize-info .theme-name {
font-size: 20px;
font-weight: 200;
line-height: 24px;
color: #333;
display: block;
text-shadow: 0 1px 0 #fff;
}
#customize-info .theme-screenshot {
width: 258px;
border: 1px solid #ccc;
}
#customize-info .theme-description {
margin-top: 1em;
color: #777;
line-height: 20px;
}
#customize-controls .submit {
text-align: center;
}
#customize-theme-controls > ul,
#customize-theme-controls .customize-section-content {
margin: 0;
}
#customize-header-actions .button-primary {
float: right;
margin-top: 10px;
}
#customize-header-actions .spinner {
margin-top: 16px;
margin-right: 4px;
}
.saving #customize-header-actions .spinner {
display: block;
}
.customize-control {
width: 100%;
float: left;
clear: both;
margin-bottom: 8px;
}
.customize-control-title {
display: block;
line-height: 24px;
font-weight: bold;
}
.customize-control select,
.customize-control input[type="text"],
.customize-control input[type="radio"],
.customize-control input[type="checkbox"],
.customize-control-color .color-picker,
.customize-control-checkbox label,
.customize-control-upload div {
line-height: 28px;
}
.customize-control input[type="text"] {
width: 98%;
line-height: 18px;
margin: 0;
}
.customize-control select {
min-width: 50%;
max-width: 100%;
height: 28px;
line-height: 28px;
}
.customize-control-checkbox input {
margin-right: 5px;
}
.customize-control-radio {
padding: 5px 0 10px;
}
.customize-control-radio .customize-control-title {
margin-bottom: 0;
line-height: 22px;
}
.customize-control-radio label {
line-height: 20px;
}
.customize-control-radio input {
margin-right: 5px;
}
#customize-preview iframe {
width: 100%;
height: 100%;
}
/*
* Style for custom settings
*/
/*
* Dropdowns
*/
.customize-section .dropdown {
float: left;
display: block;
position: relative;
cursor: pointer;
-webkit-border-radius: 3px;
border-radius: 3px;
}
.customize-section .dropdown-content {
overflow: hidden;
float: left;
min-width: 30px;
height: 16px;
line-height: 16px;
margin-right: 16px;
padding: 4px 5px;
background-color: #eee;
border: 1px solid #ccc;
-webkit-border-radius: 3px 0 0 3px;
border-radius: 3px 0 0 3px;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.customize-control .dropdown-arrow {
position: absolute;
top: 0;
bottom: 0;
right: 0;
width: 15px;
border-color: #ccc;
border-style: solid;
border-width: 1px 1px 1px 0;
-webkit-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
}
.customize-control .dropdown-arrow:after {
content: '';
width: 0;
height: 0;
border-color: #ccc transparent;
border-style: solid;
border-width: 4px 4px 0 4px;
position: absolute;
top: 50%;
margin-top: -1px;
right: 4px;
z-index: 1;
}
.customize-section .dropdown:hover .dropdown-content,
.customize-control .dropdown:hover .dropdown-arrow {
border-color: #aaa;
}
.customize-section .dropdown:hover .dropdown-arrow:after {
border-color: #aaa transparent;
}
.customize-control .dropdown-status {
display: none;
max-width: 112px;
color: #777;
}
/*
* Color Picker
*/
.customize-control-color .color-picker-hex {
display: none;
}
.customize-control-color.open .color-picker-hex {
display: block;
}
.customize-control-color .dropdown {
margin-right: 5px;
margin-bottom: 5px;
}
.customize-control-color .dropdown .dropdown-content {
background-color: #fff;
border: 1px solid rgba( 0, 0, 0, 0.15 );
}
.customize-control-color .dropdown:hover .dropdown-content {
border-color: rgba( 0, 0, 0, 0.25 );
}
.customize-section input[type="text"].color-picker-hex {
width: 65px;
font-family: monospace;
text-align: center;
line-height: 16px;
}
/* The centered cursor overlaps the placeholder in webkit. Hide it when selected. */
.customize-section input[type="text"].color-picker-hex:focus::-webkit-input-placeholder {
color: transparent;
}
.customize-section input[type="text"].color-picker-hex:-moz-placeholder {
color: #999;
}
/*
* Image Picker
*/
.customize-control-image .library,
.customize-control-image .actions {
display: none;
float: left;
width: 100%;
}
.customize-control-image.open .library,
.customize-control-image.open .actions {
display: block;
}
.customize-section .customize-control-image .dropdown-content {
height: auto;
min-height: 24px;
min-width: 40px;
padding: 0;
}
.customize-section .customize-control-image .dropdown-status {
padding: 4px 5px;
}
.customize-section .customize-control-image .preview-thumbnail img {
display: block;
width: 100%;
max-width: 122px;
max-height: 98px;
margin: 0 auto;
}
.customize-section .customize-control-image .actions {
text-align: right;
}
.customize-section .customize-control-image .library ul {
border-bottom: 1px solid #dfdfdf;
float: left;
width: 100%;
margin: 10px 0 0;
}
.customize-section .customize-control-image .library li {
color: #999;
float: left;
padding: 3px 5px;
margin: 0;
border-style: solid;
border-color: transparent;
border-width: 1px 1px 0 1px;
}
.customize-section .customize-control-image .library li.library-selected {
margin-bottom: -1px;
padding-bottom: 4px;
color: #777;
background: #fdfdfd;
border-color: #dfdfdf;
-webkit-border-radius: 3px 3px 0 0;
border-radius: 3px 3px 0 0 ;
}
.customize-section .customize-control-image .library-content {
display: none;
width: 100%;
float: left;
padding: 10px 0;
}
.customize-section .customize-control-image .library-content.library-selected {
display: block;
}
.customize-section .customize-control-image .library .thumbnail {
display: block;
width: 100%;
}
.customize-section .customize-control-image .library .thumbnail:hover img {
border-color: #21759b;
}
.customize-section .customize-control-image .library .thumbnail img {
display: block;
max-width: 90%;
max-height: 80px;
margin: 5px auto;
padding: 4px;
background: #fff;
border: 1px solid #dfdfdf;
}
.customize-section .customize-control-upload .upload-fallback,
.customize-section .customize-control-image .upload-fallback {
display: none;
}
.customize-section .customize-control-upload .upload-dropzone,
.customize-section .customize-control-image .upload-dropzone {
display: none;
padding: 15px 10px;
border: 3px dashed #dfdfdf;
margin: 5px auto;
text-align: center;
color: #777;
position: relative;
cursor: default;
}
.customize-section .customize-control-upload .upload-dropzone.supports-drag-drop,
.customize-section .customize-control-image .upload-dropzone.supports-drag-drop {
display: block;
-webkit-transition: border-color 0.1s;
-moz-transition: border-color 0.1s;
-ms-transition: border-color 0.1s;
-o-transition: border-color 0.1s;
transition: border-color 0.1s;
}
.customize-section .customize-control-upload .library ul li,
.customize-section .customize-control-image .library ul li {
cursor: pointer;
}
.customize-section .customize-control-upload .upload-dropzone.supports-drag-drop.drag-over,
.customize-section .customize-control-image .upload-dropzone.supports-drag-drop.drag-over {
border-color: #83b4d8;
}
/**
* iOS can't scroll iframes,
* instead it expands the iframe size to match the size of the content
*/
.ios .wp-full-overlay {
position: relative;
}
.ios #customize-preview {
position: relative;
}
.ios #customize-controls .wp-full-overlay-sidebar-content {
-webkit-overflow-scrolling: touch;
}
/**
* Handle cheaters.
*/
body.cheatin {
min-width: 0;
background: #f9f9f9;
padding: 50px;
}
body.cheatin p {
max-width: 700px;
margin: 0 auto;
padding: 2em;
font-size: 14px;
background: #fff;
border: 1px solid #dfdfdf;
-webkit-border-radius: 3px;
border-radius: 3px;
}
| zyblog | trunk/zyblog/wp-admin/css/customize-controls.css | CSS | asf20 | 10,744 |
/*------------------------------------------------------------------------------
Howdy! This is the CSS file that controls the
Blue (classic) color style on the WordPress Dashboard.
This file contains both LTR and RTL styles.
TABLE OF CONTENTS:
------------------
1.0 - Left to Right Styles
2.0 - Right to Left Styles
------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------
1.0 - Left to Right Styles
------------------------------------------------------------------------------*/
.find-box-search,
.find-box-buttons {
background-color: #eff8ff;
border-top: 1px solid #dce6f8;
}
.find-box {
background-color: #5589aa;
}
.find-box-head {
color: #fff;
}
.find-box-inside {
background-color: #fff;
}
a.page-numbers:hover {
border-color: #999;
}
body,
#wpbody,
.form-table .pre,
.ui-autocomplete li a {
color: #333;
}
body > #upload-menu {
border-bottom-color: #fff;
}
#postcustomstuff table,
#your-profile fieldset,
#rightnow,
div.dashboard-widget,
#dashboard-widgets p.dashboard-widget-links {
border-color: #d1e5ee;
}
#poststuff .inside label.spam,
#poststuff .inside label.deleted {
color: red;
}
#poststuff .inside label.waiting {
color: orange;
}
#poststuff .inside label.approved {
color: green;
}
#postcustomstuff table {
border-color: #dfdfdf;
background-color: #f9f9f9;
}
#postcustomstuff thead th {
background-color: #f1f1f1;
}
.widefat {
border-color: #d1e5ee;
background-color: #fff;
}
div.dashboard-widget-error {
background-color: #c43;
}
div.dashboard-widget-notice {
background-color: #cfe1ef;
}
div.dashboard-widget-submit {
border-top-color: #ccc;
}
ul.category-tabs li {
border-color: transparent;
}
div.tabs-panel,
.wp-tab-panel,
ul.add-menu-item-tabs li.tabs,
.wp-tab-active {
border-color: #d1e5ee;
background-color: #fff;
}
ul.category-tabs li.tabs {
border-color: #d1e5ee #d1e5ee #fff;
}
ul.category-tabs li.tabs,
ul.add-menu-item-tabs li.tabs,
.wp-tab-active {
background-color: #fff;
}
kbd,
code {
background: #eff8ff;
}
textarea,
input[type="text"],
input[type="password"],
input[type="file"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
select {
border-color: #d1e5ee;
}
textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
select:focus {
border-color: #b0c8d7;
}
input.disabled,
textarea.disabled {
background-color: #ccc;
}
#plugin-information .action-button a,
#plugin-information .action-button a:hover,
#plugin-information .action-button a:visited {
color: #fff;
}
.widget .widget-top,
.postbox h3,
.stuffbox h3,
.widefat thead tr th,
.widefat tfoot tr th,
h3.dashboard-widget-title,
h3.dashboard-widget-title span,
h3.dashboard-widget-title small,
.sidebar-name,
#nav-menu-header,
#nav-menu-footer,
.menu-item-handle,
#fullscreen-topbar {
background: #f5fafd;
background-image: -webkit-gradient(linear, left bottom, left top, from(#eff8ff), to(#f7fcfe));
background-image: -webkit-linear-gradient(bottom, #eff8ff, #f7fcfe);
background-image: -moz-linear-gradient(bottom, #eff8ff, #f7fcfe);
background-image: -o-linear-gradient(bottom, #eff8ff, #f7fcfe);
background-image: linear-gradient(to top, #eff8ff, #f7fcfe);
}
.widget .widget-top,
.postbox h3,
.stuffbox h3 {
border-bottom-color: #d1e5ee;
text-shadow: #fff 0 1px 0;
-webkit-box-shadow: 0 1px 0 #fff;
box-shadow: 0 1px 0 #fff;
}
.form-table th,
.form-wrap label {
color: #222;
text-shadow: #fff 0 1px 0;
}
.description,
.form-wrap p {
color: #666;
}
strong .post-com-count span {
background-color: #21759b;
}
.sorthelper {
background-color: #ccf3fa;
}
.ac_match,
.subsubsub a.current {
color: #000;
}
.wrap h2 {
color: #174f69;
}
.wrap .add-new-h2,
.wrap .add-new-h2:active {
background: #f1f1f1;
}
.subtitle {
color: #777;
}
.ac_over {
background-color: #f0f0b8;
}
.ac_results {
background-color: #fff;
border-color: #b0c8d7;
}
.ac_results li {
color: #101010;
}
.alternate,
.alt {
background-color: #f7fcfe;
}
.available-theme a.screenshot {
background-color: #eff8ff;
border-color: #acd;
}
#current-theme {
border-bottom-color: #d1e5ee;
}
.bar {
background-color: #e8e8e8;
border-right-color: #99d;
}
#media-upload,
#media-upload .media-item .slidetoggle {
background: #fff;
}
#media-upload .slidetoggle {
border-top-color: #dfdfdf;
}
div.error,
.login #login_error {
background-color: #ffebe8;
border-color: #c00;
}
div.error a {
color: #c00;
}
.form-invalid {
background-color: #ffebe8 !important;
}
.form-invalid input,
.form-invalid select {
border-color: #c00 !important;
}
.submit,
#commentsdiv #add-new-comment {
border-color: #dfdfdf;
}
.highlight {
background-color: #e4f2fd;
color: #000;
}
.howto,
.nonessential,
#edit-slug-box,
.form-input-tip,
.subsubsub {
color: #666;
}
.media-upload-form label.form-help,
td.help {
color: #9a9a9a;
}
.ui-autocomplete {
border-color: #b0c8d7;
background-color: #eff8ff;
}
.ui-autocomplete li a.ui-state-focus {
background-color: #def1ff;
}
.post-com-count {
color: #fff;
}
.post-com-count span {
background-color: #bbb;
color: #fff;
}
.post-com-count:hover span {
background-color: #d54e21;
}
.quicktags, .search {
background-color: #ccc;
color: #000;
}
.side-info h5 {
border-bottom-color: #dadada;
}
.side-info ul {
color: #666;
}
a:hover,
a:active {
color: #d54e21;
}
a:focus {
color: #124964;
}
#adminmenu a:hover,
#adminmenu li.menu-top > a:focus,
#adminmenu .wp-submenu a:hover,
#the-comment-list .comment a:hover,
#rightnow a:hover,
#media-upload a.del-link:hover,
div.dashboard-widget-submit input:hover,
.subsubsub a:hover,
.subsubsub a.current:hover,
.ui-tabs-nav a:hover,
.plugins .inactive a:hover,
#all-plugins-table .plugins .inactive a:hover,
#search-plugins-table .plugins .inactive a:hover {
color: #d54e21;
}
#the-comment-list .comment-item,
#dashboard-widgets #dashboard_quick_press form p.submit {
border-color: #dfdfdf;
}
#side-sortables .category-tabs .tabs a,
#side-sortables .add-menu-item-tabs .tabs a,
.wp-tab-bar .wp-tab-active a {
color: #333;
}
#dashboard_right_now .table_content,
#dashboard_right_now .table_discussion {
border-top-color: #d1e5ee;
}
#rightnow .rbutton {
background-color: #ebebeb;
color: #264761;
}
.submitbox .submit {
background-color: #464646;
color: #ccc;
}
.plugins a.delete:hover,
#all-plugins-table .plugins a.delete:hover,
#search-plugins-table .plugins a.delete:hover,
.submitbox .submitdelete {
color: #f00;
border-bottom-color: #f00;
}
.submitbox .submitdelete:hover,
#media-items a.delete:hover,
#media-items a.delete-permanently:hover {
color: #fff;
background-color: #f00;
border-bottom-color: #f00;
}
#normal-sortables .submitbox .submitdelete:hover {
color: #000;
background-color: #f00;
border-bottom-color: #f00;
}
.tablenav .dots {
border-color: transparent;
}
.tablenav .next,
.tablenav .prev {
border-color: transparent;
color: #21759b;
}
.tablenav .next:hover,
.tablenav .prev:hover {
border-color: transparent;
color: #d54e21;
}
div.updated,
.login .message {
background-color: #ffffe0;
border-color: #e6db55;
}
.update-message {
color: #000;
}
a.page-numbers {
border-bottom-color: #b8d3e2;
}
.commentlist li {
border-bottom-color: #ccc;
}
.widefat td,
.widefat th {
border-top-color: #fff;
border-bottom-color: #d0dfe9;
}
.widefat th {
text-shadow: rgba(255,255,255,0.8) 0 1px 0;
}
.widefat td {
color: #555;
}
.widefat p,
.widefat ol,
.widefat ul {
color: #333;
}
.widefat thead tr th,
.widefat tfoot tr th,
h3.dashboard-widget-title,
h3.dashboard-widget-title span,
h3.dashboard-widget-title small {
color: #333;
}
th.sortable a:hover,
th.sortable a:active,
th.sortable a:focus {
color: #333;
}
th.sortable a:focus {
background: #e1e1e1;
background-image: -webkit-gradient(linear, left bottom, left top, from(#dcdcdc), to(#e9e9e9));
background-image: -webkit-linear-gradient(bottom, #dcdcdc, #e9e9e9);
background-image: -moz-linear-gradient(bottom, #dcdcdc, #e9e9e9);
background-image: -o-linear-gradient(bottom, #dcdcdc, #e9e9e9);
background-image: linear-gradient(to top, #dcdcdc, #e9e9e9);
}
h3.dashboard-widget-title small a {
color: #d7d7d7;
}
h3.dashboard-widget-title small a:hover {
color: #fff;
}
a,
#adminmenu a,
#the-comment-list p.comment-author strong a,
#media-upload a.del-link,
#media-items a.delete,
#media-items a.delete-permanently,
.plugins a.delete,
.ui-tabs-nav a {
color: #21759b;
}
#adminmenu .awaiting-mod,
#adminmenu .update-plugins,
#sidemenu a .update-plugins,
#rightnow .reallynow {
background-color: #464646;
color: #fff;
-webkit-box-shadow: rgba(255,255,255,0.5) 0 1px 0;
box-shadow: rgba(255,255,255,0.5) 0 1px 0;
}
#plugin-information .action-button {
background-color: #d54e21;
color: #fff;
}
#adminmenu li.current a .awaiting-mod,
#adminmenu li a.wp-has-current-submenu .update-plugins{
background-color: #464646;
color: #fff;
-webkit-box-shadow: rgba(255,255,255,0.5) 0 1px 0;
box-shadow: rgba(255,255,255,0.5) 0 1px 0;
}
div#media-upload-header,
div#plugin-information-header {
background-color: #f9f9f9;
border-bottom-color: #dfdfdf;
}
#currenttheme img {
border-color: #666;
}
#dashboard_secondary div.dashboard-widget-content ul li a {
background-color: #f9f9f9;
}
input.readonly, textarea.readonly {
background-color: #ddd;
}
#editable-post-name {
background-color: #fffbcc;
}
#edit-slug-box strong,
.tablenav .displaying-num,
#submitted-on,
.submitted-on {
color: #777;
}
.login #nav a,
.login #backtoblog a {
color: #21759b !important;
}
.login #nav a:hover,
.login #backtoblog a:hover {
color: #d54e21 !important;
}
#wpfooter {
color: #777;
border-color: #b0c8d7;
}
.imgedit-group,
#media-items .media-item,
.media-item .describe {
border-color: #dfdfdf;
}
.checkbox,
.side-info,
.plugins tr,
#your-profile #rich_editing {
background-color: #fcfcfc;
}
.plugins .inactive,
.plugins .inactive th,
.plugins .inactive td,
tr.inactive + tr.plugin-update-tr .plugin-update {
background-color: #f7fcfe;
}
.plugin-update-tr .update-message {
background-color: #fffbe4;
border-color: #dfdfdf;
}
.plugins .active,
.plugins .active th,
.plugins .active td {
color: #000;
}
.plugins .inactive a {
color: #579;
}
#the-comment-list tr.undo,
#the-comment-list div.undo {
background-color: #f4f4f4;
}
#the-comment-list .unapproved {
background-color: #ffffe0;
}
#the-comment-list .approve a {
color: #006505;
}
#the-comment-list .unapprove a {
color: #d98500;
}
table.widefat span.delete a,
table.widefat span.trash a,
table.widefat span.spam a,
#dashboard_recent_comments .delete a,
#dashboard_recent_comments .trash a,
#dashboard_recent_comments .spam a {
color: #bc0b0b;
}
.welcome-panel {
background: #f5fafd;
background-image: -webkit-gradient(linear, left bottom, left top, from(#eff8ff), to(#f7fcfe));
background-image: -webkit-linear-gradient(bottom, #eff8ff, #f7fcfe);
background-image: -moz-linear-gradient(bottom, #eff8ff, #f7fcfe);
background-image: -o-linear-gradient(bottom, #eff8ff, #f7fcfe);
background-image: linear-gradient(to top, #eff8ff, #f7fcfe);
border-color: #d1e5ee;
}
.welcome-panel p {
color: #777;
}
.welcome-panel-column p {
color: #464646;
}
.welcome-panel h3 {
text-shadow: 1px 1px 1px #fff;
}
.widget,
#widget-list .widget-top,
.postbox,
#titlediv,
#poststuff .postarea,
.stuffbox {
border-color: #d1e5ee;
-webkit-box-shadow: inset 0 1px 0 #fff;
box-shadow: inset 0 1px 0 #fff;
-webkit-border-radius: 3px;
border-radius: 3px;
}
.widget,
#widget-list .widget-top,
.postbox,
.menu-item-settings {
background: #f5fafd;
background-image: -webkit-gradient(linear, left bottom, left top, from(#eff8ff), to(#f7fcfe));
background-image: -webkit-linear-gradient(bottom, #eff8ff, #f7fcfe);
background-image: -moz-linear-gradient(bottom, #eff8ff, #f7fcfe);
background-image: -o-linear-gradient(bottom, #eff8ff, #f7fcfe);
background-image: linear-gradient(to top, #eff8ff, #f7fcfe);
}
.postbox h3 {
color: #174f69;
}
.widget .widget-top {
color: #174f69;
}
.js .sidebar-name:hover h3,
.js .postbox h3:hover {
color: #000;
}
.curtime #timestamp {
background-image: url(../images/date-button.gif);
}
#quicktags #ed_link {
color: #00f;
}
#rightnow .youhave {
background-color: #f0f6fb;
}
#rightnow a {
color: #448abd;
}
.tagchecklist span a,
#bulk-titles div a {
background: url(../images/xit.gif) no-repeat;
}
.tagchecklist span a:hover,
#bulk-titles div a:hover {
background: url(../images/xit.gif) no-repeat -10px 0;
}
#update-nag, .update-nag {
background-color: #fffbcc;
border-color: #e6db55;
color: #555;
}
#screen-meta {
background-color: #eff8ff;
border-color: #d1e5ee;
-webkit-box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.05 );
box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.05 );
}
#contextual-help-back {
background: #fff;
}
.contextual-help-tabs a:hover {
background-color: #ceeaff;
color: #333;
}
#contextual-help-back,
.contextual-help-tabs .active {
border-color: #d1e5ee;
}
.contextual-help-tabs .active,
.contextual-help-tabs .active a,
.contextual-help-tabs .active a:hover {
background: #fff;
color: #000;
}
/* screen options and help tabs */
#screen-options-link-wrap,
#contextual-help-link-wrap {
border-right: 1px solid #d1e5ee;
border-left: 1px solid #d1e5ee;
border-bottom: 1px solid #d1e5ee;
background: #eff8ff;
background-image: -webkit-gradient(linear, left bottom, left top, from(#def1ff), to(#eff8ff));
background-image: -webkit-linear-gradient(bottom, #def1ff, #eff8ff);
background-image: -moz-linear-gradient(bottom, #def1ff, #eff8ff);
background-image: -o-linear-gradient(bottom, #def1ff, #eff8ff);
background-image: linear-gradient(to top, #def1ff, #eff8ff);
}
#screen-meta-links a {
color: #606060;
background: transparent url(../images/arrows.png) no-repeat right 4px;
}
#screen-meta-links a:hover,
#screen-meta-links a:active {
color: #000;
background-color: transparent;
}
#screen-meta-links a.screen-meta-active {
background-position: right -31px;
}
/* end screen options and help tabs */
.login #backtoblog a {
color: #464646;
}
#wphead {
border-bottom: 1px solid #d0dfe9;
}
#wphead h1 a {
color: #174f69;
}
#wpfooter a:link,
#wpfooter a:visited {
text-decoration: none;
}
#wpfooter a:hover {
color: #000;
text-decoration: underline;
}
.file-error,
abbr.required,
.widget-control-remove:hover,
table.widefat .delete a:hover,
table.widefat .trash a:hover,
table.widefat .spam a:hover,
#dashboard_recent_comments .delete a:hover,
#dashboard_recent_comments .trash a:hover
#dashboard_recent_comments .spam a:hover {
color: #f00;
}
#pass-strength-result {
background-color: #eee;
border-color: #ddd !important;
}
#pass-strength-result.bad {
background-color: #ffb78c;
border-color: #ff853c !important;
}
#pass-strength-result.good {
background-color: #ffec8b;
border-color: #fc0 !important;
}
#pass-strength-result.short {
background-color: #ffa0a0;
border-color: #f04040 !important;
}
#pass-strength-result.strong {
background-color: #c3ff88;
border-color: #8dff1c !important;
}
/* editors */
#poststuff .wp-editor-wrap .wp_themeSkin .mceStatusbar {
border-color: #d0dfe9;
background-color: #eff8ff;
}
#poststuff .wp-editor-wrap .wp_themeSkin .mceStatusbar * {
color: #555;
}
#poststuff #editor-toolbar .active {
border-color: #d0dfe9 #d0dfe9 #eff8ff;
background-color: #eff8ff;
color: #333;
}
.wp-editor-wrap .wp-editor-container,
.wp-editor-wrap .wp_themeSkin table.mceLayout {
border-color: #d1e5ee #d1e5ee #d0dfe9;
}
#editorcontainer {
border-color: #d1e5ee #d1e5ee #d0dfe9;
}
#post-status-info {
border-color: #d0dfe9 #d1e5ee #d1e5ee;
}
/* TinyMCE */
.wp-admin .wp-editor-wrap .wp-switch-editor {
background-color: #d3e9f2;
border-color: #d1e5ee #d1e5ee #d3e9f2;
color: #174F69;
}
.wp-admin .wp-editor-wrap .wp-switch-editor:active {
background-color: #f5fafd;
}
.wp-admin .wp-editor-wrap.tmce-active .switch-tmce,
.wp-admin .wp-editor-wrap.html-active .switch-html {
background: #f7fcfe;
border-color: #d1e5ee #d1e5ee #f7fcfe;
}
.wp-admin .wp-editor-wrap .quicktags-toolbar,
.wp-admin .wp-editor-wrap .wp_themeSkin tr.mceFirst td.mceToolbar {
border-color: #d0dfe9;
background-color: #f5fafd;
background-image: -webkit-gradient(linear, left bottom, left top, from(#eff8ff), to(#f7fcfe));
background-image: -webkit-linear-gradient(bottom, #eff8ff, #f7fcfe);
background-image: -moz-linear-gradient(bottom, #eff8ff, #f7fcfe);
background-image: -o-linear-gradient(bottom, #eff8ff, #f7fcfe);
background-image: linear-gradient(to top, #eff8ff, #f7fcfe);
}
.wp-admin .wp_themeSkin table.mceListBox {
border-color: #d1e5ee;
}
.wp-admin .wp_themeSkin table.mceListBoxEnabled:hover,
.wp-admin .wp_themeSkin table.mceListBoxEnabled:active,
.wp-admin .wp_themeSkin table.mceListBoxHover,
.wp-admin .wp_themeSkin table.mceListBoxHover:active,
.wp-admin .wp_themeSkin table.mceListBoxSelected {
border-color: #b8cfdf;
}
.wp-admin .wp_themeSkin a.mceButtonEnabled:hover,
.wp-admin .wp_themeSkin table.mceSplitButton:hover {
border-color: #c3d2dc;
background: #f4f9fc;
background-image: -webkit-gradient(linear, left bottom, left top, from(#f4f9fc), to(#fff));
background-image: -webkit-linear-gradient(bottom, #f4f9fc, #fff);
background-image: -moz-linear-gradient(bottom, #f4f9fc, #fff);
background-image: -o-linear-gradient(bottom, #f4f9fc, #fff);
background-image: linear-gradient(to top, #f4f9fc, #fff);
}
.wp-admin .wp_themeSkin a.mceButton:active,
.wp-admin .wp_themeSkin a.mceButtonEnabled:active,
.wp-admin .wp_themeSkin a.mceButtonSelected:active,
.wp-admin .wp_themeSkin a.mceButtonActive,
.wp-admin .wp_themeSkin a.mceButtonActive:active,
.wp-admin .wp_themeSkin a.mceButtonActive:hover,
.wp-admin .wp_themeSkin .mceSplitButtonSelected table,
.wp-admin .wp_themeSkin .mceSplitButtonSelected table:hover {
border-color: #8f9da9 #c3d2dc #c3d2dc #8f9da9;
background: #f4f9fc;
background-image: -webkit-gradient(linear, left bottom, left top, from(#fff), to(#f4f9fc));
background-image: -webkit-linear-gradient(bottom, #fff, #f4f9fc);
background-image: -moz-linear-gradient(bottom, #fff, #f4f9fc);
background-image: -o-linear-gradient(bottom, #fff, #f4f9fc);
background-image: linear-gradient(to top, #fff, #f4f9fc);
}
.wp-admin .wp_themeSkin .mceSplitButtonSelected table a.mceOpen,
.wp-admin .wp_themeSkin .mceSplitButtonSelected table a.mceAction {
border-color: #8f9da9 #c3d2dc #c3d2dc #8f9da9;
}
.wp-admin .wp_themeSkin .mceSplitButton:hover a {
border-color: #c3d2dc;
}
/* end TinyMCE */
.editwidget .widget-inside {
border-color: #d0dfe9;
}
#titlediv #title {
background-color: #fff;
}
#tTips p#tTips_inside {
background-color: #ddd;
color: #333;
}
#poststuff .inside .the-tagcloud {
border-color: #ddd;
}
/* menu */
#adminmenuback,
#adminmenuwrap {
background-color: #eff8ff;
border-color: #d1e5ee;
}
#adminmenushadow,
#adminmenuback {
background-image: url(../images/menu-shadow.png);
background-position: top right;
background-repeat: repeat-y;
}
#adminmenu li.wp-menu-separator {
background: #d1e5ee;
border-color: #bed1dd;
}
#adminmenu div.separator {
border-color: #d1e5ee;
}
#adminmenu a.menu-top,
#adminmenu .wp-submenu .wp-submenu-head {
border-top-color: #fff;
border-bottom-color: #cae6ff;
}
#adminmenu li.wp-menu-open {
border-color: #d1e5ee;
}
#adminmenu li.menu-top:hover,
#adminmenu li.opensub > a.menu-top,
#adminmenu li > a.menu-top:focus {
background-color: #e0f1ff;
color: #d54e21;
text-shadow: 0 1px 0 rgba( 255, 255, 255, 0.4 );
}
/* So it doesn't get applied to the number spans (comments, updates, etc) */
#adminmenu li.menu-top:hover > a span,
#adminmenu li.menu-top > a:focus span {
text-shadow: none;
}
#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
#adminmenu li.current a.menu-top,
.folded #adminmenu li.wp-has-current-submenu,
.folded #adminmenu li.current.menu-top,
#adminmenu .wp-menu-arrow,
#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head {
background: #5589aa;
background-image: -webkit-gradient(linear, left bottom, left top, from(#5589aa), to(#619bbb));
background-image: -webkit-linear-gradient(bottom, #5589aa, #619bbb);
background-image: -moz-linear-gradient(bottom, #5589aa, #619bbb);
background-image: -o-linear-gradient(bottom, #5589aa, #619bbb);
background-image: linear-gradient(to top, #5589aa, #619bbb);
}
#adminmenu .wp-menu-arrow div {
background: #5589aa;
background-image: -webkit-gradient(linear, right bottom, left top, from(#5589aa), to(#619bbb));
background-image: -webkit-linear-gradient(bottom right, #5589aa, #619bbb);
background-image: -moz-linear-gradient(bottom right, #5589aa, #619bbb);
background-image: -o-linear-gradient(bottom right, #5589aa, #619bbb);
background-image: linear-gradient(to top left, #5589aa, #619bbb);
}
#adminmenu li.wp-not-current-submenu .wp-menu-arrow {
border-top-color: #fff;
border-bottom-color: #cae6ff;
background: #e0f1ff;
}
#adminmenu li.wp-not-current-submenu .wp-menu-arrow div {
background: #e0f1ff;
border-color: #cae6ff;
}
.folded #adminmenu li.menu-top li:hover a {
background-image: none;
}
#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
#adminmenu li.current a.menu-top,
#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head {
text-shadow: 0 -1px 0 #333;
color: #fff;
border-top-color: #5a8fad;
border-bottom-color: #5589aa;
}
.folded #adminmenu li.wp-has-current-submenu,
.folded #adminmenu li.current.menu-top {
border-top-color: #5a8fad;
border-bottom-color: #5589aa;
}
#adminmenu .wp-submenu a:hover,
#adminmenu .wp-submenu a:focus {
background-color: #eff8ff;
color: #333;
}
#adminmenu .wp-submenu li.current,
#adminmenu .wp-submenu li.current a,
#adminmenu .wp-submenu li.current a:hover {
color: #333;
}
#adminmenu .wp-submenu,
.folded #adminmenu a.wp-has-current-submenu:focus + .wp-submenu,
.folded #adminmenu .wp-has-current-submenu .wp-submenu {
background-color: #fff;
border-color: #d0dfe9;
-webkit-box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.4);
box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.4);
}
#adminmenu .wp-submenu .wp-submenu-head {
background-color: #e0f1ff;
color: #333;
}
/* collapse menu button */
#collapse-menu {
color: #a0c3d5;
border-top-color: #f9f9f9;
}
#collapse-menu:hover {
color: #5a8fad;
}
#collapse-button {
border-color: #d0dfe9;
background: #eff8ff;
background-image: -webkit-gradient(linear, left bottom, left top, from(#eff8ff), to(#fff));
background-image: -webkit-linear-gradient(bottom, #eff8ff, #fff);
background-image: -moz-linear-gradient(bottom, #eff8ff, #fff);
background-image: -o-linear-gradient(bottom, #eff8ff, #fff);
background-image: linear-gradient(to top, #eff8ff, #fff);
}
#collapse-menu:hover #collapse-button {
border-color: #a0c3d5;
}
#collapse-button div {
background: transparent url(../images/arrows-vs.png) no-repeat 0 -72px;
}
.folded #collapse-button div {
background-position: 0 -108px;
}
/* Auto-folding of the admin menu */
@media only screen and (max-width: 900px) {
.auto-fold #adminmenu li.wp-has-current-submenu,
.auto-fold #adminmenu li.current.menu-top {
background-color: #5589aa;
background-image: -webkit-gradient(linear, left bottom, left top, from(#5589aa), to(#619bbb));
background-image: -webkit-linear-gradient(bottom, #5589aa, #619bbb);
background-image: -moz-linear-gradient(bottom, #5589aa, #619bbb);
background-image: -o-linear-gradient(bottom, #5589aa, #619bbb);
background-image: linear-gradient(bottom, #5589aa, #619bbb);
}
.auto-fold #adminmenu li.wp-has-current-submenu,
.auto-fold #adminmenu li.current.menu-top {
border-top-color: #5a8fad;
border-bottom-color: #5589aa;
}
.auto-fold #adminmenu a.wp-has-current-submenu:focus + .wp-submenu,
.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu {
background-color: #fff;
border-color: #d0dfe9;
-webkit-box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.4);
box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.4);
}
.auto-fold #collapse-button div {
background-position: 0 -108px;
}
}
/* menu and screen icons */
.icon16,
.icon32,
div.wp-menu-image {
background-color: transparent;
background-repeat: no-repeat;
}
.icon16.icon-dashboard,
.menu-icon-dashboard div.wp-menu-image,
.icon16.icon-post,
.menu-icon-post div.wp-menu-image,
.icon16.icon-media,
.menu-icon-media div.wp-menu-image,
.icon16.icon-links,
.menu-icon-links div.wp-menu-image,
.icon16.icon-page,
.menu-icon-page div.wp-menu-image,
.icon16.icon-comments,
.menu-icon-comments div.wp-menu-image,
.icon16.icon-appearance,
.menu-icon-appearance div.wp-menu-image,
.icon16.icon-plugins,
.menu-icon-plugins div.wp-menu-image,
.icon16.icon-users,
.menu-icon-users div.wp-menu-image,
.icon16.icon-tools,
.menu-icon-tools div.wp-menu-image,
.icon16.icon-settings,
.menu-icon-settings div.wp-menu-image,
.icon16.icon-site,
.menu-icon-site div.wp-menu-image,
.icon16.icon-generic,
.menu-icon-generic div.wp-menu-image {
background-image: url(../images/menu-vs.png?ver=20121105);
}
.icon16.icon-dashboard,
#adminmenu .menu-icon-dashboard div.wp-menu-image {
background-position: -59px -33px;
}
#adminmenu .menu-icon-dashboard:hover div.wp-menu-image,
#adminmenu .menu-icon-dashboard.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-dashboard.current div.wp-menu-image {
background-position: -59px -1px;
}
.icon16.icon-post,
#adminmenu .menu-icon-post div.wp-menu-image {
background-position: -269px -33px;
}
#adminmenu .menu-icon-post:hover div.wp-menu-image,
#adminmenu .menu-icon-post.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-post.current div.wp-menu-image {
background-position: -269px -1px;
}
.icon16.icon-media,
#adminmenu .menu-icon-media div.wp-menu-image {
background-position: -119px -33px;
}
#adminmenu .menu-icon-media:hover div.wp-menu-image,
#adminmenu .menu-icon-media.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-media.current div.wp-menu-image {
background-position: -119px -1px;
}
.icon16.icon-links,
#adminmenu .menu-icon-links div.wp-menu-image {
background-position: -89px -33px;
}
#adminmenu .menu-icon-links:hover div.wp-menu-image,
#adminmenu .menu-icon-links.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-links.current div.wp-menu-image {
background-position: -89px -1px;
}
.icon16.icon-page,
#adminmenu .menu-icon-page div.wp-menu-image {
background-position: -149px -33px;
}
#adminmenu .menu-icon-page:hover div.wp-menu-image,
#adminmenu .menu-icon-page.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-page.current div.wp-menu-image {
background-position: -149px -1px;
}
.icon16.icon-comments,
#adminmenu .menu-icon-comments div.wp-menu-image {
background-position: -29px -33px;
}
#adminmenu .menu-icon-comments:hover div.wp-menu-image,
#adminmenu .menu-icon-comments.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-comments.current div.wp-menu-image {
background-position: -29px -1px;
}
.icon16.icon-appearance,
#adminmenu .menu-icon-appearance div.wp-menu-image {
background-position: 1px -33px;
}
#adminmenu .menu-icon-appearance:hover div.wp-menu-image,
#adminmenu .menu-icon-appearance.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-appearance.current div.wp-menu-image {
background-position: 1px -1px;
}
.icon16.icon-plugins,
#adminmenu .menu-icon-plugins div.wp-menu-image {
background-position: -179px -33px;
}
#adminmenu .menu-icon-plugins:hover div.wp-menu-image,
#adminmenu .menu-icon-plugins.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-plugins.current div.wp-menu-image {
background-position: -179px -1px;
}
.icon16.icon-users,
#adminmenu .menu-icon-users div.wp-menu-image {
background-position: -300px -33px;
}
#adminmenu .menu-icon-users:hover div.wp-menu-image,
#adminmenu .menu-icon-users.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-users.current div.wp-menu-image {
background-position: -300px -1px;
}
.icon16.icon-tools,
#adminmenu .menu-icon-tools div.wp-menu-image {
background-position: -209px -33px;
}
#adminmenu .menu-icon-tools:hover div.wp-menu-image,
#adminmenu .menu-icon-tools.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-tools.current div.wp-menu-image {
background-position: -209px -1px;
}
.icon16.icon-settings,
#adminmenu .menu-icon-settings div.wp-menu-image {
background-position: -239px -33px;
}
#adminmenu .menu-icon-settings:hover div.wp-menu-image,
#adminmenu .menu-icon-settings.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-settings.current div.wp-menu-image {
background-position: -239px -1px;
}
.icon16.icon-site,
#adminmenu .menu-icon-site div.wp-menu-image {
background-position: -359px -33px;
}
#adminmenu .menu-icon-site:hover div.wp-menu-image,
#adminmenu .menu-icon-site.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-site.current div.wp-menu-image {
background-position: -359px -1px;
}
.icon16.icon-generic,
#adminmenu .menu-icon-generic div.wp-menu-image {
background-position: -330px -33px;
}
#adminmenu .menu-icon-generic:hover div.wp-menu-image,
#adminmenu .menu-icon-generic.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-generic.current div.wp-menu-image {
background-position: -330px -1px;
}
/* end menu and screen icons */
/* Screen Icons */
.icon32.icon-post,
#icon-edit,
#icon-post,
.icon32.icon-dashboard,
#icon-index,
.icon32.icon-media,
#icon-upload,
.icon32.icon-links,
#icon-link-manager,
#icon-link,
#icon-link-category,
.icon32.icon-page,
#icon-edit-pages,
#icon-page,
.icon32.icon-comments,
#icon-edit-comments,
.icon32.icon-appearance,
#icon-themes,
.icon32.icon-plugins,
#icon-plugins,
.icon32.icon-users,
#icon-users,
#icon-profile,
#icon-user-edit,
.icon32.icon-tools,
#icon-tools,
#icon-admin,
.icon32.icon-settings,
#icon-options-general,
.icon32.icon-site,
#icon-ms-admin,
.icon32.icon-generic,
#icon-generic {
background-image: url(../images/icons32-vs.png?ver=20121105);
}
.icon32.icon-post,
#icon-edit,
#icon-post {
background-position: -552px -5px;
}
.icon32.icon-dashboard,
#icon-index {
background-position: -137px -5px;
}
.icon32.icon-media,
#icon-upload {
background-position: -251px -5px;
}
.icon32.icon-links,
#icon-link-manager,
#icon-link,
#icon-link-category {
background-position: -190px -5px;
}
.icon32.icon-page,
#icon-edit-pages,
#icon-page {
background-position: -312px -5px;
}
.icon32.icon-comments,
#icon-edit-comments {
background-position: -72px -5px;
}
.icon32.icon-appearance,
#icon-themes {
background-position: -11px -5px;
}
.icon32.icon-plugins,
#icon-plugins {
background-position: -370px -5px;
}
.icon32.icon-users,
#icon-users,
#icon-profile,
#icon-user-edit {
background-position: -600px -5px;
}
.icon32.icon-tools,
#icon-tools,
#icon-admin {
background-position: -432px -5px;
}
.icon32.icon-settings,
#icon-options-general {
background-position: -492px -5px;
}
.icon32.icon-site,
#icon-ms-admin {
background-position: -659px -5px;
}
.icon32.icon-generic,
#icon-generic {
background-position: -708px -5px;
}
/* end screen icons */
/* Diff */
table.diff .diff-deletedline {
background-color: #fdd;
}
table.diff .diff-deletedline del {
background-color: #f99;
}
table.diff .diff-addedline {
background-color: #dfd;
}
table.diff .diff-addedline ins {
background-color: #9f9;
}
#att-info {
background-color: #e4f2fd;
}
/* edit image */
#sidemenu a {
background-color: #f9f9f9;
border-color: #f9f9f9;
border-bottom-color: #dfdfdf;
}
#sidemenu a.current {
background-color: #fff;
border-color: #dfdfdf #dfdfdf #fff;
color: #d54e21;
}
#replyerror {
border-color: #ddd;
background-color: #f9f9f9;
}
/* table vim shortcuts */
.vim-current,
.vim-current th,
.vim-current td {
background-color: #e4f2fd !important;
}
/* Install Plugins */
#plugin-information .fyi ul {
background-color: #eaf3fa;
}
#plugin-information .fyi h2.mainheader {
background-color: #cee1ef;
}
#plugin-information pre,
#plugin-information code {
background-color: #ededff;
}
#plugin-information pre {
border: 1px solid #ccc;
}
/* inline editor */
#bulk-titles {
border-color: #ddd;
}
.inline-editor div.title {
background-color: #eaf3fa;
}
.inline-editor ul.cat-checklist {
background-color: #fff;
border-color: #ddd;
}
.inline-editor .categories .catshow,
.inline-editor .categories .cathide {
color: #21759b;
}
.inline-editor .quick-edit-save {
background-color: #f1f1f1;
}
fieldset.inline-edit-col-right .inline-edit-col {
border-color: #dfdfdf;
}
.attention {
color: #d54e21;
}
.js .meta-box-sortables .postbox:hover .handlediv {
background: transparent url(../images/arrows-vs.png) no-repeat 6px 7px;
}
.tablenav .tablenav-pages {
color: #555;
}
.tablenav .tablenav-pages a {
border-color: #d1e5ee;
background: #eee;
-moz-box-shadow: inset 0 1px 0 #fff;
-webkit-box-shadow: inset 0 1px 0 #fff;
box-shadow: inset 0 1px 0 #fff;
}
.tablenav .tablenav-pages a:hover,
.tablenav .tablenav-pages a:focus {
color: #d54e21;
}
.tablenav .tablenav-pages a.disabled,
.tablenav .tablenav-pages a.disabled:hover,
.tablenav .tablenav-pages a.disabled:focus {
color: #aaa;
}
.tablenav .tablenav-pages .current {
background: #dfdfdf;
border-color: #d3d3d3;
}
#availablethemes,
#availablethemes td {
border-color: #acd;
}
#current-theme img {
border-color: #b0c8d7;
}
#TB_window #TB_title a.tb-theme-preview-link,
#TB_window #TB_title a.tb-theme-preview-link:visited {
color: #999;
}
#TB_window #TB_title a.tb-theme-preview-link:hover,
#TB_window #TB_title a.tb-theme-preview-link:focus {
color: #ccc;
}
.misc-pub-section {
border-top-color: #fff;
border-bottom-color: #d1e5ee;
}
#minor-publishing {
border-bottom-color: #cae6ff;
}
#post-body .misc-pub-section {
border-left-color: #eee;
}
.post-com-count span {
background-color: #bbb;
}
.form-table .color-palette td {
border-color: #fff;
}
.sortable-placeholder {
border-color: #bbb;
background-color: #f5f5f5;
}
#post-body ul.category-tabs li.tabs a,
#post-body ul.add-menu-item-tabs li.tabs a,
body.press-this ul.category-tabs li.tabs a {
color: #333;
}
.view-switch #view-switch-list,
.view-switch #view-switch-excerpt {
background-color: transparent;
background-image: url('../images/list.png');
background-repeat: no-repeat;
}
.view-switch #view-switch-list {
background-position: 0 0;
}
.view-switch .current #view-switch-list {
background-position: -40px 0;
}
.view-switch #view-switch-excerpt {
background-position: -20px 0;
}
.view-switch .current #view-switch-excerpt {
background-position: -60px 0;
}
#header-logo {
background: transparent url(../images/wp-logo-vs.png?ver=20101102) no-repeat scroll center center;
}
.popular-tags,
.feature-filter {
background-color: #fff;
border-color: #d1e5ee;
}
div.widgets-sortables,
#widgets-left .inactive,
#available-widgets .widget-holder {
background-color: #f7fcfe;
border-color: #d0dfe9;
}
#available-widgets .widget-description {
color: #555;
}
.sidebar-name {
color: #464646;
text-shadow: #fff 0 1px 0;
border-color: #d0dfe9;
-webkit-box-shadow: inset 0 1px 0 #fff;
box-shadow: inset 0 1px 0 #fff;
}
.js .sidebar-name:hover,
.js #removing-widget {
color: #d54e21;
}
#removing-widget span {
color: black;
}
.js .sidebar-name-arrow {
background: transparent url(../images/arrows-vs.png) no-repeat 5px 9px;
}
.js .sidebar-name:hover .sidebar-name-arrow {
background: transparent url(../images/arrows-dark-vs.png) no-repeat 5px 9px;
}
.in-widget-title {
color: #606060;
}
.deleting .widget-title * {
color: #aaa;
}
.imgedit-menu div {
border-color: #d5d5d5;
background-color: #f1f1f1;
}
.imgedit-menu div:hover {
border-color: #c1c1c1;
background-color: #eaeaea;
}
.imgedit-menu div.disabled {
border-color: #ccc;
background-color: #ddd;
filter: alpha(opacity=50);
opacity: 0.5;
}
#dashboard_recent_comments div.undo {
border-top-color: #dfdfdf;
}
.comment-ays,
.comment-ays th {
border-color: #ddd;
}
.comment-ays th {
background-color: #f1f1f1;
}
/* added from nav-menu.css */
#menu-management .menu-edit {
border-color: #d0dfe9;
}
#post-body {
background: #fff;
border-top-color: #fff;
border-bottom-color: #d0dfe9;
}
#nav-menu-header {
border-bottom-color: #d0dfe9;
}
#nav-menu-footer {
border-top-color: #fff;
}
#menu-management .nav-tabs-arrow a {
color: #c1c1c1;
}
#menu-management .nav-tabs-arrow a:hover {
color: #d54e21;
}
#menu-management .nav-tabs-arrow a:active {
color: #464646;
}
#menu-management .nav-tab-active {
border-color: #dfdfdf;
}
#menu-management .nav-tab {
background: #f7fcfe;
border-color: #d0dfe9;
}
.js .input-with-default-title {
color: #aaa;
}
#cancel-save {
color: #f00;
}
#cancel-save:hover {
background-color: #f00;
color: #fff;
}
.list-container {
border-color: #dfdfdf;
}
.menu-item-handle {
border-color: #d0dfe9;
}
.menu li.deleting .menu-item-handle {
background-color: #f66;
text-shadow: #ccc;
}
.item-type { /* Menu item controls */
color: #999;
}
.item-controls .menu-item-delete:hover {
color: #f00;
}
.nav-menus-php .item-edit {
background: transparent url(../images/arrows-vs.png) no-repeat 8px 10px;
border-bottom-color: #eff8ff;
}
.nav-menus-php .item-edit:hover {
background: transparent url(../images/arrows-dark-vs.png) no-repeat 8px 10px;
}
.menu-item-settings { /* Menu editing */
border-color: #d0dfe9;
}
.link-to-original {
color: #777;
border-color: #d0dfe9;
}
#cancel-save:hover {
color: #fff !important;
}
#update-menu-item {
color: #fff !important;
}
#update-menu-item:hover,
#update-menu-item:active,
#update-menu-item:focus {
color: #eaf2fa !important;
border-color: #13455b !important;
}
.submitbox .submitcancel {
color: #21759b;
border-bottom-color: #21759b;
}
.submitbox .submitcancel:hover {
background: #21759b;
color: #fff;
}
/* end added from nav-menu.css */
.nav-tab {
border-color: #d1e5ee #d1e5ee #fff;
}
.nav-tab:hover,
.nav-tab-active {
border-color: #acd #acd #fff;
}
h2.nav-tab-wrapper, h3.nav-tab-wrapper {
border-bottom-color: #acd;
}
#menu-management .nav-tab-active,
.menu-item-handle,
.menu-item-settings {
-webkit-box-shadow: inset 0 1px 0 #fff;
box-shadow: inset 0 1px 0 #fff;
}
#menu-management .nav-tab-active {
background: #f7fcfe;
border-bottom-color: #f7fcfe;
}
#upload-form label {
color: #777;
}
/* custom header & background pages */
/* full screen */
.fullscreen-overlay {
background: #fff;
}
.wp-fullscreen-focus #wp-fullscreen-title,
.wp-fullscreen-focus #wp-fullscreen-container {
border-color: #bed1dd;
}
#fullscreen-topbar {
border-bottom-color: #d1e5ee;
}
/* Begin About Pages */
.about-wrap h1 {
color: #333;
text-shadow: 1px 1px 1px #fff;
}
.about-text {
color: #777;
}
.wp-badge {
color: #fff;
text-shadow: 0 -1px 0 rgba(22, 57, 81, 0.3);
}
.about-wrap h2 .nav-tab {
color: #21759b;
}
.about-wrap h2 .nav-tab:hover {
color: #d54e21;
}
.about-wrap h2 .nav-tab-active,
.about-wrap h2 .nav-tab-active:hover {
color: #333;
}
.about-wrap h2 .nav-tab-active {
text-shadow: 1px 1px 1px #fff;
color: #464646;
}
.about-wrap h3 {
color: #333;
text-shadow: 1px 1px 1px #fff;
}
.about-wrap .feature-section h4 {
color: #464646;
}
.about-wrap .feature-section img {
background: #fff;
border: 1px #ccc solid;
-webkit-box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.3 );
box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.3 );
}
.about-wrap h4.wp-people-group {
text-shadow: 1px 1px 1px #fff;
}
.about-wrap .point-releases {
border-bottom: 1px solid #dfdfdf;
}
.about-wrap .point-releases h3 {
border-top: 1px solid #dfdfdf;
}
.about-wrap .point-releases h3:first-child {
border: 0;
}
.about-wrap li.wp-person img.gravatar {
-webkit-box-shadow: 0 0 4px rgba( 0, 0, 0, 0.4 );
box-shadow: 0 0 4px rgba( 0, 0, 0, 0.4 );
}
.about-wrap li.wp-person .title {
color: #464646;
text-shadow: 1px 1px 1px #fff;
}
.freedoms-php .about-wrap ol li {
color: #999;
}
.freedoms-php .about-wrap ol p {
color: #464646;
}
/* End About Pages */
/*------------------------------------------------------------------------------
2.0 - Right to Left Styles
------------------------------------------------------------------------------*/
.rtl .bar {
border-right-color: transparent;
border-left-color: #99d;
}
.rtl #screen-meta-links a.show-settings {
background-position: left 3px;
}
.rtl #screen-meta-links a.show-settings.screen-meta-active {
background-position: left -33px;
}
/* Menu */
.rtl #adminmenushadow,
.rtl #adminmenuback {
background-image: url(../images/menu-shadow-rtl.png);
background-position: top left;
}
.rtl #adminmenu .wp-submenu .wp-submenu-head {
border-right-color: transparent;
border-left-color: #d1e5ee;
}
.rtl #adminmenu .wp-submenu,
.rtl.folded #adminmenu .wp-has-current-submenu .wp-submenu {
-webkit-box-shadow: -2px 2px 5px rgba( 0, 0, 0, 0.4 );
box-shadow: -2px 2px 5px rgba( 0, 0, 0, 0.4 );
}
.rtl #adminmenu .wp-has-current-submenu .wp-submenu {
-webkit-box-shadow: none;
box-shadow: none;
}
/* Collapse Menu Button */
.rtl #collapse-button div {
background-position: 0 -108px;
}
.rtl.folded #collapse-button div {
background-position: 0 -72px;
}
/* Auto-folding of the admin menu for RTL */
@media only screen and (max-width: 900px) {
.rtl.auto-fold #adminmenu a.wp-has-current-submenu:focus + .wp-submenu,
.rtl.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu {
-webkit-box-shadow: -2px 2px 5px rgba( 0, 0, 0, 0.4 );
box-shadow: -2px 2px 5px rgba( 0, 0, 0, 0.4 );
}
.rtl.auto-fold #collapse-button div {
background-position: 0 -72px;
}
}
/* edit image */
.js.rtl .meta-box-sortables .postbox:hover .handlediv {
background: transparent url(../images/arrows-vs.png) no-repeat 6px 7px;
}
.rtl #post-body .misc-pub-section {
border-right-color: transparent;
border-left-color: #d1e5ee;
}
.js.rtl .sidebar-name-arrow {
background: transparent url(../images/arrows-vs.png) no-repeat 5px 9px;
}
.js.rtl .sidebar-name:hover .sidebar-name-arrow {
background: transparent url(../images/arrows-dark-vs.png) no-repeat 5px 9px;
}
/**
* HiDPI Displays
*/
@media print,
(-o-min-device-pixel-ratio: 5/4),
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 120dpi) {
.curtime #timestamp {
background-image: url("../images/date-button-2x.gif?ver=20120916");
background-size: 16px auto;
}
.tagchecklist span a,
#bulk-titles div a,
.tagchecklist span a:hover,
#bulk-titles div a:hover {
background-image: url("../images/xit-2x.gif?ver=20120916");
background-size: 20px auto;
}
#screen-meta-links a.show-settings,
#screen-meta-links a.show-settings.screen-meta-active,
#adminmenu .wp-has-submenu:hover .wp-menu-toggle,
#adminmenu .wp-menu-open .wp-menu-toggle,
#collapse-button div,
.nav-menus-php .item-edit,
.js .meta-box-sortables .postbox:hover .handlediv,
.sidebar-name-arrow,
.rtl #adminmenu .wp-has-submenu:hover .wp-menu-toggle,
.rtl #adminmenu .wp-menu-open .wp-menu-toggle,
.js.rtl .meta-box-sortables .postbox:hover .handlediv,
.rtl .sidebar-name-arrow {
background-image: url("../images/arrows-vs-2x.png?ver=20120916");
background-size: 15px 123px;
}
#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,
#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle,
.nav-menus-php .item-edit:hover,
.sidebar-name:hover .sidebar-name-arrow,
.rtl #adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,
.rtl #adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle,
.rtl .sidebar-name:hover .sidebar-name-arrow {
background-image: url("../images/arrows-dark-vs-2x.png?ver=20120916");
background-size: 15px 123px;
}
.view-switch #view-switch-list,
.view-switch #view-switch-excerpt {
background-image: url("../images/list-2x.png?ver=20120916");
background-size: 80px 20px;
}
.icon32.icon-post,
#icon-edit,
#icon-post,
.icon32.icon-dashboard,
#icon-index,
.icon32.icon-media,
#icon-upload,
.icon32.icon-links,
#icon-link-manager,
#icon-link,
#icon-link-category,
.icon32.icon-page,
#icon-edit-pages,
#icon-page,
.icon32.icon-comments,
#icon-edit-comments,
.icon32.icon-appearance,
#icon-themes,
.icon32.icon-plugins,
#icon-plugins,
.icon32.icon-users,
#icon-users,
#icon-profile,
#icon-user-edit,
.icon32.icon-tools,
#icon-tools,
#icon-admin,
.icon32.icon-settings,
#icon-options-general,
.icon32.icon-site,
#icon-ms-admin,
.icon32.icon-generic,
#icon-generic {
background-image: url(../images/icons32-vs-2x.png?ver=20121105);
background-size: 756px 45px;
}
.icon16.icon-dashboard,
.menu-icon-dashboard div.wp-menu-image,
.icon16.icon-post,
.menu-icon-post div.wp-menu-image,
.icon16.icon-media,
.menu-icon-media div.wp-menu-image,
.icon16.icon-links,
.menu-icon-links div.wp-menu-image,
.icon16.icon-page,
.menu-icon-page div.wp-menu-image,
.icon16.icon-comments,
.menu-icon-comments div.wp-menu-image,
.icon16.icon-appearance,
.menu-icon-appearance div.wp-menu-image,
.icon16.icon-plugins,
.menu-icon-plugins div.wp-menu-image,
.icon16.icon-users,
.menu-icon-users div.wp-menu-image,
.icon16.icon-tools,
.menu-icon-tools div.wp-menu-image,
.icon16.icon-settings,
.menu-icon-settings div.wp-menu-image,
.icon16.icon-site,
.menu-icon-site div.wp-menu-image,
.icon16.icon-generic,
.menu-icon-generic div.wp-menu-image {
background-image: url('../images/menu-vs-2x.png?ver=20121105');
background-size: 390px 64px;
}
#header-logo {
background-image: url('../images/wp-logo-vs-2x.png?ver=20120916');
background-size: 16px auto;
}
}
| zyblog | trunk/zyblog/wp-admin/css/colors-classic.css | CSS | asf20 | 45,858 |
.wp-color-result {
margin: 0 0 6px 6px;
padding-left: 0;
padding-right: 30px;
}
.wp-color-result:after {
border-radius: 0 0 1px 1px;
border-left: 0;
border-right: 1px solid #bbb;
left: auto;
right: 0;
}
.wp-color-result:hover {
border-color: #aaa;
}
.wp-color-result:hover:after {
border-left: 0;
border-right: 1px solid #999;
}
.wp-picker-container .button {
margin-left: 0;
margin-right: 6px;
}
| zyblog | trunk/zyblog/wp-admin/css/color-picker-rtl.css | CSS | asf20 | 414 |
body {
direction: rtl;
width: 99.5%;
}
.rtl #adminmenuback {
left: auto;
right: 0;
background-image: none;
}
.rtl #adminmenuback,
.rtl #adminmenuwrap {
border-width: 0 0 0 1px;
}
#plupload-upload-ui {
zoom: 1;
}
.post-com-count-wrapper a.post-com-count {
float: none;
}
#adminmenu .wp-submenu ul {
width: 99%;
}
#adminmenu .wp-submenu .wp-submenu .wp-submenu,
#adminmenu .wp-menu-open .wp-submenu .wp-submenu {
border: 1px solid #dfdfdf;
}
.folded #adminmenu .wp-submenu {
right: 30px;
}
#wpcontent #adminmenu .wp-submenu li.wp-submenu-head {
padding: 3px 10px 4px 4px;
}
div.quicktags-toolbar input {
min-width: 0;
}
.inline-edit-row fieldset label span.title {
float: right;
}
.inline-edit-row fieldset label span.input-text-wrap {
margin-right: 0;
}
p.search-box {
float: left;
}
#bh {
margin: 7px 10px 0 0;
float: left;
}
.postbox div.inside,
.wp-editor-wrap .wp-editor-container .wp-editor-area,
#nav-menu-theme-locations .howto select {
width: 97.5%;
}
/* without this dashboard widgets appear in one column for some screen widths */
div#dashboard-widgets {
padding-right: 0;
padding-left: 1px;
}
.tagchecklist span a {
margin: 4px -9px 0 0;
}
.widefat th input {
margin: 0 5px 0 0;
}
/* ---------- add by navid */
#TB_window {
width: 670px;
position: absolute;
top: 50%;
left: 50%;
margin-right: 335px !important;
}
#dashboard_plugins {
direction: ltr;
}
#dashboard_plugins h3.hndle {
direction: rtl;
}
#dashboard_incoming_links ul li,
#dashboard_secondary ul li,
#dashboard_primary ul li,
p.row-actions {
width: 100%;
}
#post-status-info {
height: 25px;
}
p.submit { /* quick edit and reply in edit-comments.php */
height:22px;
}
.available-theme .action-links li {
padding-left: 7px;
margin-left: 7px;
}
form#widgets-filter { /* fix widget page */
position: static;
}
/* nav menus
.menu-max-depth-0 #menu-management { width: 460px; }
.menu-max-depth-1 #menu-management { width: 490px; }
.menu-max-depth-2 #menu-management { width: 520px; }
.menu-max-depth-3 #menu-management { width: 550px; }
.menu-max-depth-4 #menu-management { width: 580px; }
.menu-max-depth-5 #menu-management { width: 610px; }
.menu-max-depth-6 #menu-management { width: 640px; }
.menu-max-depth-7 #menu-management { width: 670px; }
.menu-max-depth-8 #menu-management { width: 700px; }
.menu-max-depth-9 #menu-management { width: 730px; }
.menu-max-depth-10 #menu-management { width: 760px; }
.menu-max-depth-11 #menu-management { width: 790px; }
*/
.menu-item-depth-0 { margin-left: 0px; }
.menu-item-depth-1 { margin-left: -30px; }
.menu-item-depth-2 { margin-left: -60px; }
.menu-item-depth-3 { margin-left: -90px; }
.menu-item-depth-4 { margin-left: -120px; }
.menu-item-depth-5 { margin-left: -150px; }
.menu-item-depth-6 { margin-left: -180px; }
.menu-item-depth-7 { margin-left: -210px; }
.menu-item-depth-8 { margin-left: -240px; }
.menu-item-depth-9 { margin-left: -270px; }
.menu-item-depth-10 { margin-left: -300px; }
.menu-item-depth-11 { margin-left: -330px; }
/*
#menu-to-edit li dl {
padding: 0 !important;
margin: 0 !important;
}
.ui-sortable-helper .menu-item-transport {
margin-top: 13px;
}
.ui-sortable-helper .menu-item-transport .menu-item-transport {
margin-top: 0;
}
*/
#menu-management,
.nav-menus-php .menu-edit,
#nav-menu-header .submitbox {
zoom: 1;
}
.nav-menus-php label {
max-width: 90% !important;
}
p.button-controls,
.nav-menus-php .tabs-panel {
max-width: 90%;
}
.nav-menus-php .major-publishing-actions .publishing-action {
float: none;
}
#wpbody #nav-menu-header label {
float: none;
}
#nav-menu-header {
margin-top: -10px;
}
#nav-menu-footer {
margin-bottom: -20px;
}
#update-nav-menu .publishing-action {
max-width: 200px;
}
#nav-menus-frame #update-nav-menu .delete-action {
margin-top: -25px;
float: left;
}
#menu-to-edit li {
margin-top: -10px;
margin-bottom: -10px;
}
.sortable-placeholder {
margin-top: 0 !important;
margin-left: 0 !important;
margin-bottom: 13px !important;
padding: 0 !important;
}
.auto-add-pages {
clear: both;
float: none;
}
#nav-menus-frame .open-label span {
float: none;
display: inline-block;
}
#nav-menus-frame .delete-action {
float: none;
}
#title-wrap #title-prompt-text {
right: 0;
}
.screen-reader-text {
right: auto;
text-indent: -1000em;
} | zyblog | trunk/zyblog/wp-admin/css/ie-rtl.css | CSS | asf20 | 4,310 |
/* Styles for the media library iframe (not used on the Library screen) */
div#media-upload-header {
margin: 0;
padding: 5px 5px 0;
font-weight: bold;
position: relative;
border-bottom-width: 1px;
border-bottom-style: solid;
}
body#media-upload ul#sidemenu {
font-weight: normal;
margin: 0 5px;
left: 0;
bottom: -1px;
float: none;
overflow: hidden;
}
form {
margin: 1em;
}
#search-filter {
text-align: right;
}
th {
position: relative;
}
.media-upload-form label.form-help, td.help {
font-family: sans-serif;
font-style: italic;
font-weight: normal;
}
.media-upload-form p.help {
margin: 0;
padding: 0;
}
.media-upload-form fieldset {
width: 100%;
border: none;
text-align: justify;
margin: 0 0 1em 0;
padding: 0;
}
/* specific to the image upload form */
.image-align-none-label {
background: url(../images/align-none.png) no-repeat center left;
}
.image-align-left-label {
background: url(../images/align-left.png) no-repeat center left;
}
.image-align-center-label {
background: url(../images/align-center.png) no-repeat center left;
}
.image-align-right-label {
background: url(../images/align-right.png) no-repeat center left;
}
tr.image-size td {
width: 460px;
}
tr.image-size div.image-size-item {
margin: 0 0 5px;
}
#library-form .progress,
#gallery-form .progress,
.insert-gallery,
.describe.startopen,
.describe.startclosed {
display: none;
}
.media-item .thumbnail {
max-width: 128px;
max-height: 128px;
}
thead.media-item-info tr {
background-color: transparent;
}
.form-table thead.media-item-info {
border: 8px solid #fff;
}
abbr.required {
text-decoration: none;
border: none;
}
.describe label {
display: inline;
}
.describe td.error {
padding: 2px 8px;
}
.describe td.A1 {
width: 132px;
}
.describe input[type="text"],
.describe textarea {
width: 460px;
border-width: 1px;
border-style: solid;
}
/* Specific to Uploader */
#media-upload p.ml-submit {
padding: 1em 0;
}
#media-upload p.help,
#media-upload label.help {
font-family: sans-serif;
font-style: italic;
font-weight: normal;
}
#media-upload .ui-sortable .media-item {
cursor: move;
}
#media-upload tr.image-size {
margin-bottom: 1em;
height: 3em;
}
#media-upload #filter {
width: 623px;
}
#media-upload #filter .subsubsub {
margin: 8px 0;
}
#filter .tablenav select {
border-style: solid;
border-width: 1px;
padding: 2px;
vertical-align: top;
width: auto;
}
#media-upload .del-attachment {
display: none;
margin: 5px 0;
}
.menu_order {
float: right;
font-size: 11px;
margin: 10px 10px 0;
}
.menu_order_input {
border: 1px solid #ddd;
font-size: 10px;
padding: 1px;
width: 23px;
}
.ui-sortable-helper {
background-color: #fff;
border: 1px solid #aaa;
opacity: 0.6;
filter: alpha(opacity=60);
}
#media-upload th.order-head {
width: 20%;
text-align: center;
}
#media-upload th.actions-head {
width: 25%;
text-align: center;
}
#media-upload a.wp-post-thumbnail {
margin: 0 20px;
}
#media-upload .widefat {
width: 626px;
border-style: solid solid none;
}
.sorthelper {
height: 37px;
width: 623px;
display: block;
}
#gallery-settings th.label {
width: 160px;
}
#gallery-settings #basic th.label {
padding: 5px 5px 5px 0;
}
#gallery-settings .title {
clear: both;
padding: 0 0 3px;
font-size: 1.6em;
border-bottom: 1px solid #DADADA;
}
h3.media-title {
font-size: 1.6em;
}
h4.media-sub-title {
border-bottom: 1px solid #DADADA;
font-size: 1.3em;
margin: 12px;
padding: 0 0 3px;
}
#gallery-settings .title,
h3.media-title,
h4.media-sub-title {
font-family: Georgia,"Times New Roman",Times,serif;
font-weight: normal;
color: #5A5A5A;
}
#gallery-settings .describe td {
vertical-align: middle;
height: 3em;
}
#gallery-settings .describe th.label {
padding-top: .5em;
text-align: left;
}
#gallery-settings .describe {
padding: 5px;
width: 615px;
clear: both;
cursor: default;
}
#gallery-settings .describe select {
width: 15em;
}
#gallery-settings .describe select option,
#gallery-settings .describe td {
padding: 0;
}
#gallery-settings label,
#gallery-settings legend {
font-size: 13px;
color: #464646;
margin-right: 15px;
}
#gallery-settings .align .field label {
margin: 0 1em 0 3px;
}
#gallery-settings p.ml-submit {
border-top: 1px solid #dfdfdf;
}
#gallery-settings select#columns {
width: 6em;
}
#sort-buttons {
font-size: 0.8em;
margin: 3px 25px -8px 0;
text-align: right;
max-width: 625px;
}
#sort-buttons a {
text-decoration: none;
}
#sort-buttons #asc,
#sort-buttons #showall {
padding-left: 5px;
}
#sort-buttons span {
margin-right: 25px;
}
p.media-types {
margin: 1em;
}
tr.not-image {
display: none;
}
table.not-image tr.not-image {
display: table-row;
}
table.not-image tr.image-only {
display: none;
}
/**
* HiDPI Displays
*/
@media print,
(-o-min-device-pixel-ratio: 5/4),
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 120dpi) {
.image-align-none-label {
background-image: url("../images/align-none-2x.png?ver=20120916");
background-size: 21px 15px;
}
.image-align-left-label {
background-image: url("../images/align-left-2x.png?ver=20120916");
background-size: 22px 15px;
}
.image-align-center-label {
background-image: url("../images/align-center-2x.png?ver=20120916");
background-size: 21px 15px;
}
.image-align-right-label {
background-image: url("../images/align-right-2x.png?ver=20120916");
background-size: 22px 15px;
}
}
| zyblog | trunk/zyblog/wp-admin/css/media.css | CSS | asf20 | 5,448 |
/*------------------------------------------------------------------------------
Howdy! This is the CSS file that controls the
Gray (fresh) color style on the WordPress Dashboard.
This file contains both LTR and RTL styles.
TABLE OF CONTENTS:
------------------
1.0 - Left to Right Styles
2.0 - Right to Left Styles
------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------
1.0 - Left to Right Styles
------------------------------------------------------------------------------*/
.find-box-search,
.find-box-buttons {
background-color: #f7f7f7;
border-top: 1px solid #ddd;
}
.find-box {
background-color: #444;
}
.find-box-head {
color: #eee;
}
.find-box-inside {
background-color: #fff;
}
a.page-numbers:hover {
border-color: #999;
}
body,
#wpbody,
.form-table .pre,
.ui-autocomplete li a {
color: #333;
}
body > #upload-menu {
border-bottom-color: #fff;
}
#postcustomstuff table,
#your-profile fieldset,
#rightnow,
div.dashboard-widget,
#dashboard-widgets p.dashboard-widget-links {
border-color: #ccc;
}
#poststuff .inside label.spam,
#poststuff .inside label.deleted {
color: red;
}
#poststuff .inside label.waiting {
color: orange;
}
#poststuff .inside label.approved {
color: green;
}
#postcustomstuff table {
border-color: #dfdfdf;
background-color: #f9f9f9;
}
#postcustomstuff thead th {
background-color: #f1f1f1;
}
.widefat {
border-color: #dfdfdf;
background-color: #f9f9f9;
}
textarea.widefat {
background-color: #fff;
}
div.dashboard-widget-error {
background-color: #c43;
}
div.dashboard-widget-notice {
background-color: #cfe1ef;
}
div.dashboard-widget-submit {
border-top-color: #ccc;
}
ul.category-tabs li {
border-color: transparent;
}
div.tabs-panel,
.wp-tab-panel,
ul.add-menu-item-tabs li.tabs,
.wp-tab-active {
border-color: #dfdfdf;
background-color: #fff;
}
ul.category-tabs li.tabs {
border-color: #dfdfdf #dfdfdf #fff;
}
ul.category-tabs li.tabs,
ul.add-menu-item-tabs li.tabs,
.wp-tab-active {
background-color: #fff;
}
kbd,
code {
background: #eaeaea;
}
textarea,
input[type="text"],
input[type="password"],
input[type="file"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
select {
border-color: #dfdfdf;
}
textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
select:focus {
border-color: #aaa;
}
input.disabled,
textarea.disabled {
background-color: #ccc;
}
#plugin-information .action-button a,
#plugin-information .action-button a:hover,
#plugin-information .action-button a:visited {
color: #fff;
}
.widget .widget-top,
.postbox h3,
.stuffbox h3,
.widefat thead tr th,
.widefat tfoot tr th,
h3.dashboard-widget-title,
h3.dashboard-widget-title span,
h3.dashboard-widget-title small,
.sidebar-name,
#nav-menu-header,
#nav-menu-footer,
.menu-item-handle {
background: #f1f1f1;
background-image: -webkit-gradient(linear, left bottom, left top, from(#ececec), to(#f9f9f9));
background-image: -webkit-linear-gradient(bottom, #ececec, #f9f9f9);
background-image: -moz-linear-gradient(bottom, #ececec, #f9f9f9);
background-image: -o-linear-gradient(bottom, #ececec, #f9f9f9);
background-image: linear-gradient(to top, #ececec, #f9f9f9);
}
.widget .widget-top,
.postbox h3,
.stuffbox h3 {
border-bottom-color: #dfdfdf;
text-shadow: #fff 0 1px 0;
-webkit-box-shadow: 0 1px 0 #fff;
box-shadow: 0 1px 0 #fff;
}
.form-table th,
.form-wrap label {
color: #222;
text-shadow: #fff 0 1px 0;
}
.description,
.form-wrap p {
color: #666;
}
strong .post-com-count span {
background-color: #21759b;
}
.sorthelper {
background-color: #ccf3fa;
}
.ac_match,
.subsubsub a.current {
color: #000;
}
.wrap h2 {
color: #464646;
}
.wrap .add-new-h2,
.wrap .add-new-h2:active {
background: #f1f1f1;
}
.subtitle {
color: #777;
}
.ac_over {
background-color: #f0f0b8;
}
.ac_results {
background-color: #fff;
border-color: #808080;
}
.ac_results li {
color: #101010;
}
.alternate,
.alt {
background-color: #fcfcfc;
}
.available-theme a.screenshot {
background-color: #f1f1f1;
border-color: #ddd;
}
#current-theme {
border-bottom-color: #dfdfdf;
}
.bar {
background-color: #e8e8e8;
border-right-color: #99d;
}
#media-upload,
#media-upload .media-item .slidetoggle {
background: #fff;
}
#media-upload .slidetoggle {
border-top-color: #dfdfdf;
}
div.error,
.login #login_error {
background-color: #ffebe8;
border-color: #c00;
}
div.error a {
color: #c00;
}
.form-invalid {
background-color: #ffebe8 !important;
}
.form-invalid input,
.form-invalid select {
border-color: #c00 !important;
}
.submit,
#commentsdiv #add-new-comment {
border-color: #dfdfdf;
}
.highlight {
background-color: #e4f2fd;
color: #000;
}
.howto,
.nonessential,
#edit-slug-box,
.form-input-tip,
.subsubsub {
color: #666;
}
.media-upload-form label.form-help,
td.help {
color: #9a9a9a;
}
.ui-autocomplete {
border-color: #aaa;
background-color: #efefef;
}
.ui-autocomplete li a.ui-state-focus {
background-color: #ddd;
}
.post-com-count {
color: #fff;
}
.post-com-count span {
background-color: #bbb;
color: #fff;
}
.post-com-count:hover span {
background-color: #d54e21;
}
.quicktags, .search {
background-color: #ccc;
color: #000;
}
.side-info h5 {
border-bottom-color: #dadada;
}
.side-info ul {
color: #666;
}
a:hover,
a:active {
color: #d54e21;
}
a:focus {
color: #124964;
}
#adminmenu a:hover,
#adminmenu li.menu-top > a:focus,
#adminmenu .wp-submenu a:hover,
#the-comment-list .comment a:hover,
#rightnow a:hover,
#media-upload a.del-link:hover,
div.dashboard-widget-submit input:hover,
.subsubsub a:hover,
.subsubsub a.current:hover,
.ui-tabs-nav a:hover,
.plugins .inactive a:hover,
#all-plugins-table .plugins .inactive a:hover,
#search-plugins-table .plugins .inactive a:hover {
color: #d54e21;
}
#the-comment-list .comment-item,
#dashboard-widgets #dashboard_quick_press form p.submit {
border-color: #dfdfdf;
}
#side-sortables .category-tabs .tabs a,
#side-sortables .add-menu-item-tabs .tabs a,
.wp-tab-bar .wp-tab-active a {
color: #333;
}
#rightnow .rbutton {
background-color: #ebebeb;
color: #264761;
}
#dashboard_right_now .table_content,
#dashboard_right_now .table_discussion {
border-top-color: #ececec;
}
.submitbox .submit {
background-color: #464646;
color: #ccc;
}
.plugins a.delete:hover,
#all-plugins-table .plugins a.delete:hover,
#search-plugins-table .plugins a.delete:hover,
.submitbox .submitdelete {
color: #f00;
border-bottom-color: #f00;
}
.submitbox .submitdelete:hover,
#media-items a.delete:hover,
#media-items a.delete-permanently:hover {
color: #fff;
background-color: #f00;
border-bottom-color: #f00;
}
#normal-sortables .submitbox .submitdelete:hover {
color: #000;
background-color: #f00;
border-bottom-color: #f00;
}
.tablenav .dots {
border-color: transparent;
}
.tablenav .next,
.tablenav .prev {
border-color: transparent;
color: #21759b;
}
.tablenav .next:hover,
.tablenav .prev:hover {
border-color: transparent;
color: #d54e21;
}
div.updated,
.login .message {
background-color: #ffffe0;
border-color: #e6db55;
}
.update-message {
color: #000;
}
a.page-numbers {
border-bottom-color: #b8d3e2;
}
.commentlist li {
border-bottom-color: #ccc;
}
.widefat td,
.widefat th {
border-top-color: #fff;
border-bottom-color: #dfdfdf;
}
.widefat th {
text-shadow: rgba(255,255,255,0.8) 0 1px 0;
}
.widefat td {
color: #555;
}
.widefat p,
.widefat ol,
.widefat ul {
color: #333;
}
.widefat thead tr th,
.widefat tfoot tr th,
h3.dashboard-widget-title,
h3.dashboard-widget-title span,
h3.dashboard-widget-title small {
color: #333;
}
th.sortable a:hover,
th.sortable a:active,
th.sortable a:focus {
color: #333;
}
th.sortable a:focus {
background: #e1e1e1;
background-image: -webkit-gradient(linear, left bottom, left top, from(#dcdcdc), to(#e9e9e9));
background-image: -webkit-linear-gradient(bottom, #dcdcdc, #e9e9e9);
background-image: -moz-linear-gradient(bottom, #dcdcdc, #e9e9e9);
background-image: -o-linear-gradient(bottom, #dcdcdc, #e9e9e9);
background-image: linear-gradient(to top, #dcdcdc, #e9e9e9);
}
h3.dashboard-widget-title small a {
color: #d7d7d7;
}
h3.dashboard-widget-title small a:hover {
color: #fff;
}
a,
#adminmenu a,
#the-comment-list p.comment-author strong a,
#media-upload a.del-link,
#media-items a.delete,
#media-items a.delete-permanently,
.plugins a.delete,
.ui-tabs-nav a {
color: #21759b;
}
#adminmenu .awaiting-mod,
#adminmenu .update-plugins,
#sidemenu a .update-plugins,
#rightnow .reallynow {
background-color: #464646;
color: #fff;
-webkit-box-shadow: rgba(255,255,255,0.5) 0 1px 0;
box-shadow: rgba(255,255,255,0.5) 0 1px 0;
}
#plugin-information .action-button {
background-color: #d54e21;
color: #fff;
}
#adminmenu li.current a .awaiting-mod,
#adminmenu li a.wp-has-current-submenu .update-plugins{
background-color: #464646;
color: #fff;
-webkit-box-shadow: rgba(255,255,255,0.5) 0 1px 0;
box-shadow: rgba(255,255,255,0.5) 0 1px 0;
}
div#media-upload-header,
div#plugin-information-header {
background-color: #f9f9f9;
border-bottom-color: #dfdfdf;
}
#currenttheme img {
border-color: #666;
}
#dashboard_secondary div.dashboard-widget-content ul li a {
background-color: #f9f9f9;
}
input.readonly, textarea.readonly {
background-color: #ddd;
}
#editable-post-name {
background-color: #fffbcc;
}
#edit-slug-box strong,
.tablenav .displaying-num,
#submitted-on,
.submitted-on {
color: #777;
}
.login #nav a,
.login #backtoblog a {
color: #21759b !important;
}
.login #nav a:hover,
.login #backtoblog a:hover {
color: #d54e21 !important;
}
#wpfooter {
color: #777;
border-color: #dfdfdf;
}
.imgedit-group,
#media-items .media-item,
.media-item .describe {
border-color: #dfdfdf;
}
.checkbox,
.side-info,
.plugins tr,
#your-profile #rich_editing {
background-color: #fcfcfc;
}
.plugins .inactive,
.plugins .inactive th,
.plugins .inactive td,
tr.inactive + tr.plugin-update-tr .plugin-update {
background-color: #f4f4f4;
}
.plugin-update-tr .update-message {
background-color: #fffbe4;
border-color: #dfdfdf;
}
.plugins .active,
.plugins .active th,
.plugins .active td {
color: #000;
}
.plugins .inactive a {
color: #579;
}
#the-comment-list tr.undo,
#the-comment-list div.undo {
background-color: #f4f4f4;
}
#the-comment-list .unapproved {
background-color: #ffffe0;
}
#the-comment-list .approve a {
color: #006505;
}
#the-comment-list .unapprove a {
color: #d98500;
}
table.widefat span.delete a,
table.widefat span.trash a,
table.widefat span.spam a,
#dashboard_recent_comments .delete a,
#dashboard_recent_comments .trash a,
#dashboard_recent_comments .spam a {
color: #bc0b0b;
}
.welcome-panel {
background: #f5f5f5;
background-image: -webkit-gradient(linear, left bottom, left top, from(#f5f5f5), to(#fafafa));
background-image: -webkit-linear-gradient(bottom, #f5f5f5, #fafafa);
background-image: -moz-linear-gradient(bottom, #f5f5f5, #fafafa);
background-image: -o-linear-gradient(bottom, #f5f5f5, #fafafa);
background-image: linear-gradient(to top, #f5f5f5, #fafafa);
border-color: #dfdfdf;
}
.welcome-panel p {
color: #777;
}
.welcome-panel-column p {
color: #464646;
}
.welcome-panel h3 {
text-shadow: 1px 1px 1px #fff;
}
.widget,
#widget-list .widget-top,
.postbox,
#titlediv,
#poststuff .postarea,
.stuffbox {
border-color: #dfdfdf;
-webkit-box-shadow: inset 0 1px 0 #fff;
box-shadow: inset 0 1px 0 #fff;
-webkit-border-radius: 3px;
border-radius: 3px;
}
.widget,
#widget-list .widget-top,
.postbox,
.menu-item-settings {
background: #f5f5f5;
background-image: -webkit-gradient(linear, left bottom, left top, from(#f5f5f5), to(#f9f9f9));
background-image: -webkit-linear-gradient(bottom, #f5f5f5, #f9f9f9);
background-image: -moz-linear-gradient(bottom, #f5f5f5, #f9f9f9);
background-image: -o-linear-gradient(bottom, #f5f5f5, #f9f9f9);
background-image: linear-gradient(to top, #f5f5f5, #f9f9f9);
}
.postbox h3 {
color: #464646;
}
.widget .widget-top {
color: #222;
}
.js .sidebar-name:hover h3,
.js .postbox h3:hover {
color: #000;
}
.curtime #timestamp {
background-image: url(../images/date-button.gif);
}
#rightnow .youhave {
background-color: #f0f6fb;
}
#rightnow a {
color: #448abd;
}
.tagchecklist span a,
#bulk-titles div a {
background: url(../images/xit.gif) no-repeat;
}
.tagchecklist span a:hover,
#bulk-titles div a:hover {
background: url(../images/xit.gif) no-repeat -10px 0;
}
#update-nag, .update-nag {
background-color: #fffbcc;
border-color: #e6db55;
color: #555;
}
#screen-meta {
background-color: #f1f1f1;
border-color: #ccc;
-webkit-box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.05 );
box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.05 );
}
#contextual-help-back {
background: #fff;
}
.contextual-help-tabs a:hover {
color: #333;
}
#contextual-help-back,
.contextual-help-tabs .active {
border-color: #ccc;
}
.contextual-help-tabs .active,
.contextual-help-tabs .active a,
.contextual-help-tabs .active a:hover {
background: #fff;
color: #333;
}
/* screen options and help tabs */
#screen-options-link-wrap,
#contextual-help-link-wrap {
border-right: 1px solid #ccc;
border-left: 1px solid #ccc;
border-bottom: 1px solid #ccc;
background: #e3e3e3;
background-image: -webkit-gradient(linear, left bottom, left top, from(#dfdfdf), to(#f1f1f1));
background-image: -webkit-linear-gradient(bottom, #dfdfdf, #f1f1f1);
background-image: -moz-linear-gradient(bottom, #dfdfdf, #f1f1f1);
background-image: -o-linear-gradient(bottom, #dfdfdf, #f1f1f1);
background-image: linear-gradient(to top, #dfdfdf, #f1f1f1);
}
#screen-meta-links a {
color: #777;
background: transparent url(../images/arrows.png) no-repeat right 4px;
}
#screen-meta-links a:hover,
#screen-meta-links a:active {
color: #333;
background-color: transparent;
}
#screen-meta-links a.screen-meta-active {
background-position: right -31px;
}
/* end screen options and help tabs */
.login #backtoblog a {
color: #464646;
}
#wphead {
border-bottom: #dfdfdf 1px solid;
}
#wphead h1 a {
color: #464646;
}
#wpfooter a:link,
#wpfooter a:visited {
text-decoration: none;
}
#wpfooter a:hover {
text-decoration: underline;
}
.file-error,
abbr.required,
.widget-control-remove:hover,
table.widefat .delete a:hover,
table.widefat .trash a:hover,
table.widefat .spam a:hover,
#dashboard_recent_comments .delete a:hover,
#dashboard_recent_comments .trash a:hover
#dashboard_recent_comments .spam a:hover {
color: #f00;
}
#pass-strength-result {
background-color: #eee;
border-color: #ddd !important;
}
#pass-strength-result.bad {
background-color: #ffb78c;
border-color: #ff853c !important;
}
#pass-strength-result.good {
background-color: #ffec8b;
border-color: #fc0 !important;
}
#pass-strength-result.short {
background-color: #ffa0a0;
border-color: #f04040 !important;
}
#pass-strength-result.strong {
background-color: #c3ff88;
border-color: #8dff1c !important;
}
#post-status-info {
border-color: #dfdfdf #ccc #ccc;
background-color: #eaeaea;
}
.editwidget .widget-inside {
border-color: #dfdfdf;
}
#titlediv #title {
background-color: #fff;
}
#tTips p#tTips_inside {
background-color: #ddd;
color: #333;
}
#poststuff .inside .the-tagcloud {
border-color: #ddd;
}
/* menu */
#adminmenuback,
#adminmenuwrap {
background-color: #ececec;
border-color: #ccc;
}
#adminmenushadow,
#adminmenuback {
background-image: url(../images/menu-shadow.png);
background-position: top right;
background-repeat: repeat-y;
}
#adminmenu li.wp-menu-separator {
background: #dfdfdf;
border-color: #cfcfcf;
}
#adminmenu div.separator {
border-color: #e1e1e1;
}
#adminmenu a.menu-top,
#adminmenu .wp-submenu .wp-submenu-head {
border-top-color: #f9f9f9;
border-bottom-color: #dfdfdf;
}
#adminmenu li.wp-menu-open {
border-color: #dfdfdf;
}
#adminmenu li.menu-top:hover,
#adminmenu li.opensub > a.menu-top,
#adminmenu li > a.menu-top:focus {
background-color: #e4e4e4;
color: #d54e21;
text-shadow: 0 1px 0 rgba( 255, 255, 255, 0.4 );
}
/* So it doesn't get applied to the number spans (comments, updates, etc) */
#adminmenu li.menu-top:hover > a span,
#adminmenu li.menu-top > a:focus span {
text-shadow: none;
}
#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
#adminmenu li.current a.menu-top,
.folded #adminmenu li.wp-has-current-submenu,
.folded #adminmenu li.current.menu-top,
#adminmenu .wp-menu-arrow,
#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head {
background: #777;
background-image: -webkit-gradient(linear, left bottom, left top, from(#6d6d6d), to(#808080));
background-image: -webkit-linear-gradient(bottom, #6d6d6d, #808080);
background-image: -moz-linear-gradient(bottom, #6d6d6d, #808080);
background-image: -o-linear-gradient(bottom, #6d6d6d, #808080);
background-image: linear-gradient(to top, #6d6d6d, #808080);
}
#adminmenu .wp-menu-arrow div {
background: #777;
background-image: -webkit-gradient(linear, right bottom, left top, from(#6d6d6d), to(#808080));
background-image: -webkit-linear-gradient(bottom right, #6d6d6d, #808080);
background-image: -moz-linear-gradient(bottom right, #6d6d6d, #808080);
background-image: -o-linear-gradient(bottom right, #6d6d6d, #808080);
background-image: linear-gradient(to top left, #6d6d6d, #808080);
}
#adminmenu li.wp-not-current-submenu .wp-menu-arrow {
border-top-color: #f9f9f9;
border-bottom-color: #dfdfdf;
background: #e4e4e4;
}
#adminmenu li.wp-not-current-submenu .wp-menu-arrow div {
background: #e4e4e4;
border-color: #ccc;
}
.folded #adminmenu li.menu-top li:hover a {
background-image: none;
}
#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
#adminmenu li.current a.menu-top,
#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head {
text-shadow: 0 -1px 0 #333;
color: #fff;
border-top-color: #808080;
border-bottom-color: #6d6d6d;
}
.folded #adminmenu li.wp-has-current-submenu,
.folded #adminmenu li.current.menu-top {
border-top-color: #808080;
border-bottom-color: #6d6d6d;
}
#adminmenu .wp-submenu a:hover,
#adminmenu .wp-submenu a:focus {
background-color: #eaf2fa;
color: #333;
}
#adminmenu .wp-submenu li.current,
#adminmenu .wp-submenu li.current a,
#adminmenu .wp-submenu li.current a:hover {
color: #333;
}
#adminmenu .wp-submenu,
.folded #adminmenu a.wp-has-current-submenu:focus + .wp-submenu,
.folded #adminmenu .wp-has-current-submenu .wp-submenu {
background-color: #fff;
border-color: #dfdfdf;
-webkit-box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.4);
box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.4);
}
#adminmenu .wp-submenu .wp-submenu-head {
background-color: #e4e4e4;
color: #333;
}
/* collapse menu button */
#collapse-menu {
color: #aaa;
border-top-color: #f9f9f9;
}
#collapse-menu:hover {
color: #999;
}
#collapse-button {
border-color: #ccc;
background: #f4f4f4;
background-image: -webkit-gradient(linear, left bottom, left top, from(#dfdfdf), to(#fff));
background-image: -webkit-linear-gradient(bottom, #dfdfdf, #fff);
background-image: -moz-linear-gradient(bottom, #dfdfdf, #fff);
background-image: -o-linear-gradient(bottom, #dfdfdf, #fff);
background-image: linear-gradient(to top, #dfdfdf, #fff);
}
#collapse-menu:hover #collapse-button {
border-color: #aaa;
}
#collapse-button div {
background: transparent url(../images/arrows.png) no-repeat 0 -72px;
}
.folded #collapse-button div {
background-position: 0 -108px;
}
/* Auto-folding of the admin menu */
@media only screen and (max-width: 900px) {
.auto-fold #adminmenu li.wp-has-current-submenu,
.auto-fold #adminmenu li.current.menu-top {
background-color: #777;
background-image: -webkit-gradient(linear, left bottom, left top, from(#6d6d6d), to(#808080));
background-image: -webkit-linear-gradient(bottom, #6d6d6d, #808080);
background-image: -moz-linear-gradient(bottom, #6d6d6d, #808080);
background-image: -o-linear-gradient(bottom, #6d6d6d, #808080);
background-image: linear-gradient(bottom, #6d6d6d, #808080);
}
.auto-fold #adminmenu li.wp-has-current-submenu,
.auto-fold #adminmenu li.current.menu-top {
border-top-color: #808080;
border-bottom-color: #6d6d6d;
}
.auto-fold #adminmenu a.wp-has-current-submenu:focus + .wp-submenu,
.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu {
background-color: #fff;
border-color: #dfdfdf;
-webkit-box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.4);
box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.4);
}
.auto-fold #collapse-button div {
background-position: 0 -108px;
}
}
/* menu and screen icons */
.icon16,
.icon32,
div.wp-menu-image {
background-color: transparent;
background-repeat: no-repeat;
}
.icon16.icon-dashboard,
.menu-icon-dashboard div.wp-menu-image,
.icon16.icon-post,
.menu-icon-post div.wp-menu-image,
.icon16.icon-media,
.menu-icon-media div.wp-menu-image,
.icon16.icon-links,
.menu-icon-links div.wp-menu-image,
.icon16.icon-page,
.menu-icon-page div.wp-menu-image,
.icon16.icon-comments,
.menu-icon-comments div.wp-menu-image,
.icon16.icon-appearance,
.menu-icon-appearance div.wp-menu-image,
.icon16.icon-plugins,
.menu-icon-plugins div.wp-menu-image,
.icon16.icon-users,
.menu-icon-users div.wp-menu-image,
.icon16.icon-tools,
.menu-icon-tools div.wp-menu-image,
.icon16.icon-settings,
.menu-icon-settings div.wp-menu-image,
.icon16.icon-site,
.menu-icon-site div.wp-menu-image,
.icon16.icon-generic,
.menu-icon-generic div.wp-menu-image {
background-image: url(../images/menu.png?ver=20121105);
}
.icon16.icon-dashboard,
#adminmenu .menu-icon-dashboard div.wp-menu-image {
background-position: -59px -33px;
}
#adminmenu .menu-icon-dashboard:hover div.wp-menu-image,
#adminmenu .menu-icon-dashboard.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-dashboard.current div.wp-menu-image {
background-position: -59px -1px;
}
.icon16.icon-post,
#adminmenu .menu-icon-post div.wp-menu-image {
background-position: -269px -33px;
}
#adminmenu .menu-icon-post:hover div.wp-menu-image,
#adminmenu .menu-icon-post.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-post.current div.wp-menu-image {
background-position: -269px -1px;
}
.icon16.icon-media,
#adminmenu .menu-icon-media div.wp-menu-image {
background-position: -119px -33px;
}
#adminmenu .menu-icon-media:hover div.wp-menu-image,
#adminmenu .menu-icon-media.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-media.current div.wp-menu-image {
background-position: -119px -1px;
}
.icon16.icon-links,
#adminmenu .menu-icon-links div.wp-menu-image {
background-position: -89px -33px;
}
#adminmenu .menu-icon-links:hover div.wp-menu-image,
#adminmenu .menu-icon-links.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-links.current div.wp-menu-image {
background-position: -89px -1px;
}
.icon16.icon-page,
#adminmenu .menu-icon-page div.wp-menu-image {
background-position: -149px -33px;
}
#adminmenu .menu-icon-page:hover div.wp-menu-image,
#adminmenu .menu-icon-page.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-page.current div.wp-menu-image {
background-position: -149px -1px;
}
.icon16.icon-comments,
#adminmenu .menu-icon-comments div.wp-menu-image {
background-position: -29px -33px;
}
#adminmenu .menu-icon-comments:hover div.wp-menu-image,
#adminmenu .menu-icon-comments.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-comments.current div.wp-menu-image {
background-position: -29px -1px;
}
.icon16.icon-appearance,
#adminmenu .menu-icon-appearance div.wp-menu-image {
background-position: 1px -33px;
}
#adminmenu .menu-icon-appearance:hover div.wp-menu-image,
#adminmenu .menu-icon-appearance.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-appearance.current div.wp-menu-image {
background-position: 1px -1px;
}
.icon16.icon-plugins,
#adminmenu .menu-icon-plugins div.wp-menu-image {
background-position: -179px -33px;
}
#adminmenu .menu-icon-plugins:hover div.wp-menu-image,
#adminmenu .menu-icon-plugins.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-plugins.current div.wp-menu-image {
background-position: -179px -1px;
}
.icon16.icon-users,
#adminmenu .menu-icon-users div.wp-menu-image {
background-position: -300px -33px;
}
#adminmenu .menu-icon-users:hover div.wp-menu-image,
#adminmenu .menu-icon-users.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-users.current div.wp-menu-image {
background-position: -300px -1px;
}
.icon16.icon-tools,
#adminmenu .menu-icon-tools div.wp-menu-image {
background-position: -209px -33px;
}
#adminmenu .menu-icon-tools:hover div.wp-menu-image,
#adminmenu .menu-icon-tools.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-tools.current div.wp-menu-image {
background-position: -209px -1px;
}
.icon16.icon-settings,
#adminmenu .menu-icon-settings div.wp-menu-image {
background-position: -239px -33px;
}
#adminmenu .menu-icon-settings:hover div.wp-menu-image,
#adminmenu .menu-icon-settings.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-settings.current div.wp-menu-image {
background-position: -239px -1px;
}
.icon16.icon-site,
#adminmenu .menu-icon-site div.wp-menu-image {
background-position: -359px -33px;
}
#adminmenu .menu-icon-site:hover div.wp-menu-image,
#adminmenu .menu-icon-site.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-site.current div.wp-menu-image {
background-position: -359px -1px;
}
.icon16.icon-generic,
#adminmenu .menu-icon-generic div.wp-menu-image {
background-position: -330px -33px;
}
#adminmenu .menu-icon-generic:hover div.wp-menu-image,
#adminmenu .menu-icon-generic.wp-has-current-submenu div.wp-menu-image,
#adminmenu .menu-icon-generic.current div.wp-menu-image {
background-position: -330px -1px;
}
/* end menu and screen icons */
/* Screen Icons */
.icon32.icon-post,
#icon-edit,
#icon-post,
.icon32.icon-dashboard,
#icon-index,
.icon32.icon-media,
#icon-upload,
.icon32.icon-links,
#icon-link-manager,
#icon-link,
#icon-link-category,
.icon32.icon-page,
#icon-edit-pages,
#icon-page,
.icon32.icon-comments,
#icon-edit-comments,
.icon32.icon-appearance,
#icon-themes,
.icon32.icon-plugins,
#icon-plugins,
.icon32.icon-users,
#icon-users,
#icon-profile,
#icon-user-edit,
.icon32.icon-tools,
#icon-tools,
#icon-admin,
.icon32.icon-settings,
#icon-options-general,
.icon32.icon-site,
#icon-ms-admin,
.icon32.icon-generic,
#icon-generic {
background-image: url(../images/icons32.png?ver=20121105);
}
.icon32.icon-post,
#icon-edit,
#icon-post {
background-position: -552px -5px;
}
.icon32.icon-dashboard,
#icon-index {
background-position: -137px -5px;
}
.icon32.icon-media,
#icon-upload {
background-position: -251px -5px;
}
.icon32.icon-links,
#icon-link-manager,
#icon-link,
#icon-link-category {
background-position: -190px -5px;
}
.icon32.icon-page,
#icon-edit-pages,
#icon-page {
background-position: -312px -5px;
}
.icon32.icon-comments,
#icon-edit-comments {
background-position: -72px -5px;
}
.icon32.icon-appearance,
#icon-themes {
background-position: -11px -5px;
}
.icon32.icon-plugins,
#icon-plugins {
background-position: -370px -5px;
}
.icon32.icon-users,
#icon-users,
#icon-profile,
#icon-user-edit {
background-position: -600px -5px;
}
.icon32.icon-tools,
#icon-tools,
#icon-admin {
background-position: -432px -5px;
}
.icon32.icon-settings,
#icon-options-general {
background-position: -492px -5px;
}
.icon32.icon-site,
#icon-ms-admin {
background-position: -659px -5px;
}
.icon32.icon-generic,
#icon-generic {
background-position: -708px -5px;
}
/* end screen icons */
/* Diff */
table.diff .diff-deletedline {
background-color: #fdd;
}
table.diff .diff-deletedline del {
background-color: #f99;
}
table.diff .diff-addedline {
background-color: #dfd;
}
table.diff .diff-addedline ins {
background-color: #9f9;
}
#att-info {
background-color: #e4f2Fd;
}
/* edit image */
#sidemenu a {
background-color: #f9f9f9;
border-color: #f9f9f9;
border-bottom-color: #dfdfdf;
}
#sidemenu a.current {
background-color: #fff;
border-color: #dfdfdf #dfdfdf #fff;
color: #d54e21;
}
#replyerror {
border-color: #ddd;
background-color: #f9f9f9;
}
/* table vim shortcuts */
.vim-current,
.vim-current th,
.vim-current td {
background-color: #E4F2FD !important;
}
/* Install Plugins */
#plugin-information .fyi ul {
background-color: #eaf3fa;
}
#plugin-information .fyi h2.mainheader {
background-color: #cee1ef;
}
#plugin-information pre,
#plugin-information code {
background-color: #ededff;
}
#plugin-information pre {
border: 1px solid #ccc;
}
/* inline editor */
#bulk-titles {
border-color: #ddd;
}
.inline-editor div.title {
background-color: #eaf3fa;
}
.inline-editor ul.cat-checklist {
background-color: #fff;
border-color: #ddd;
}
.inline-editor .categories .catshow,
.inline-editor .categories .cathide {
color: #21759b;
}
.inline-editor .quick-edit-save {
background-color: #f1f1f1;
}
fieldset.inline-edit-col-right .inline-edit-col {
border-color: #dfdfdf;
}
.attention {
color: #d54e21;
}
.js .meta-box-sortables .postbox:hover .handlediv {
background: transparent url(../images/arrows.png) no-repeat 6px 7px;
}
.tablenav .tablenav-pages {
color: #555;
}
.tablenav .tablenav-pages a {
border-color: #e3e3e3;
background: #eee;
-moz-box-shadow: inset 0 1px 0 #fff;
-webkit-box-shadow: inset 0 1px 0 #fff;
box-shadow: inset 0 1px 0 #fff;
}
.tablenav .tablenav-pages a:hover,
.tablenav .tablenav-pages a:focus {
color: #d54e21;
}
.tablenav .tablenav-pages a.disabled,
.tablenav .tablenav-pages a.disabled:hover,
.tablenav .tablenav-pages a.disabled:focus {
color: #aaa;
}
.tablenav .tablenav-pages .current {
background: #dfdfdf;
border-color: #d3d3d3;
}
#availablethemes,
#availablethemes td {
border-color: #ddd;
}
#current-theme img {
border-color: #999;
}
#TB_window #TB_title a.tb-theme-preview-link,
#TB_window #TB_title a.tb-theme-preview-link:visited {
color: #999;
}
#TB_window #TB_title a.tb-theme-preview-link:hover,
#TB_window #TB_title a.tb-theme-preview-link:focus {
color: #ccc;
}
.misc-pub-section {
border-top-color: #fff;
border-bottom-color: #dfdfdf;
}
#minor-publishing {
border-bottom-color: #dfdfdf;
}
#post-body .misc-pub-section {
border-left-color: #eee;
}
.post-com-count span {
background-color: #bbb;
}
.form-table .color-palette td {
border-color: #fff;
}
.sortable-placeholder {
border-color: #bbb;
background-color: #f5f5f5;
}
#post-body ul.category-tabs li.tabs a,
#post-body ul.add-menu-item-tabs li.tabs a,
body.press-this ul.category-tabs li.tabs a {
color: #333;
}
.view-switch #view-switch-list,
.view-switch #view-switch-excerpt {
background-color: transparent;
background-image: url('../images/list.png');
background-repeat: no-repeat;
}
.view-switch #view-switch-list {
background-position: 0 0;
}
.view-switch .current #view-switch-list {
background-position: -40px 0;
}
.view-switch #view-switch-excerpt {
background-position: -20px 0;
}
.view-switch .current #view-switch-excerpt {
background-position: -60px 0;
}
#header-logo {
background: transparent url(../images/wp-logo.png?ver=20110504) no-repeat scroll center center;
}
.popular-tags,
.feature-filter {
background-color: #fff;
border-color: #dfdfdf;
}
div.widgets-sortables,
#widgets-left .inactive,
#available-widgets .widget-holder {
background-color: #fcfcfc;
border-color: #dfdfdf;
}
#available-widgets .widget-description {
color: #555;
}
.sidebar-name {
color: #464646;
text-shadow: #fff 0 1px 0;
border-color: #dfdfdf;
-webkit-box-shadow: inset 0 1px 0 #fff;
box-shadow: inset 0 1px 0 #fff;
}
.js .sidebar-name:hover,
.js #removing-widget {
color: #d54e21;
}
#removing-widget span {
color: black;
}
.js .sidebar-name-arrow {
background: transparent url(../images/arrows.png) no-repeat 5px 9px;
}
.js .sidebar-name:hover .sidebar-name-arrow {
background: transparent url(../images/arrows-dark.png) no-repeat 5px 9px;
}
.in-widget-title {
color: #606060;
}
.deleting .widget-title * {
color: #aaa;
}
.imgedit-menu div {
border-color: #d5d5d5;
background-color: #f1f1f1;
}
.imgedit-menu div:hover {
border-color: #c1c1c1;
background-color: #eaeaea;
}
.imgedit-menu div.disabled {
border-color: #ccc;
background-color: #ddd;
filter: alpha(opacity=50);
opacity: 0.5;
}
#dashboard_recent_comments div.undo {
border-top-color: #dfdfdf;
}
.comment-ays,
.comment-ays th {
border-color: #ddd;
}
.comment-ays th {
background-color: #f1f1f1;
}
/* added from nav-menu.css */
#menu-management .menu-edit {
border-color: #dfdfdf;
}
#post-body {
background: #fff;
border-top-color: #fff;
border-bottom-color: #dfdfdf;
}
#nav-menu-header {
border-bottom-color: #dfdfdf;
}
#nav-menu-footer {
border-top-color: #fff;
}
#menu-management .nav-tabs-arrow a {
color: #c1c1c1;
}
#menu-management .nav-tabs-arrow a:hover {
color: #d54e21;
}
#menu-management .nav-tabs-arrow a:active {
color: #464646;
}
#menu-management .nav-tab-active {
border-color: #dfdfdf;
}
#menu-management .nav-tab {
background: #fbfbfb;
border-color: #dfdfdf;
}
.js .input-with-default-title {
color: #aaa;
}
#cancel-save {
color: #f00;
}
#cancel-save:hover {
background-color: #f00;
color: #fff;
}
.list-container,
.menu-item-handle {
border-color: #dfdfdf;
}
.menu li.deleting .menu-item-handle {
background-color: #f66;
text-shadow: #ccc;
}
.item-type { /* Menu item controls */
color: #999;
}
.item-controls .menu-item-delete:hover {
color: #f00;
}
.nav-menus-php .item-edit {
background: transparent url(../images/arrows.png) no-repeat 8px 10px;
border-bottom-color: #eee;
}
.nav-menus-php .item-edit:hover {
background: transparent url(../images/arrows-dark.png) no-repeat 8px 10px;
}
.menu-item-settings { /* Menu editing */
border-color: #dfdfdf;
}
.link-to-original {
color: #777;
border-color: #dfdfdf;
}
#cancel-save:hover {
color: #fff !important;
}
#update-menu-item {
color: #fff !important;
}
#update-menu-item:hover,
#update-menu-item:active,
#update-menu-item:focus {
color: #eaf2fa !important;
border-color: #13455b !important;
}
.submitbox .submitcancel {
color: #21759b;
border-bottom-color: #21759b;
}
.submitbox .submitcancel:hover {
background: #21759b;
color: #fff;
}
/* end added from nav-menu.css */
.nav-tab {
border-color: #dfdfdf #dfdfdf #fff;
}
.nav-tab:hover,
.nav-tab-active {
border-color: #ccc #ccc #fff;
}
h2.nav-tab-wrapper, h3.nav-tab-wrapper {
border-bottom-color: #ccc;
}
#menu-management .nav-tab-active,
.menu-item-handle,
.menu-item-settings {
-webkit-box-shadow: inset 0 1px 0 #fff;
box-shadow: inset 0 1px 0 #fff;
}
#menu-management .nav-tab-active {
background: #f9f9f9;
border-bottom-color: #f9f9f9;
}
#upload-form label {
color: #777;
}
/* Begin About Pages */
.about-wrap h1 {
color: #333;
text-shadow: 1px 1px 1px #fff;
}
.about-text {
color: #777;
}
.wp-badge {
color: #fff;
text-shadow: 0 -1px 0 rgba(22, 57, 81, 0.3);
}
.about-wrap h2 .nav-tab {
color: #21759b;
}
.about-wrap h2 .nav-tab:hover {
color: #d54e21;
}
.about-wrap h2 .nav-tab-active,
.about-wrap h2 .nav-tab-active:hover {
color: #333;
}
.about-wrap h2 .nav-tab-active {
text-shadow: 1px 1px 1px #fff;
color: #464646;
}
.about-wrap h3 {
color: #333;
text-shadow: 1px 1px 1px #fff;
}
.about-wrap .feature-section h4 {
color: #464646;
}
.about-wrap .feature-section img {
background: #fff;
border: 1px #ccc solid;
-webkit-box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.3 );
box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.3 );
}
.about-wrap h4.wp-people-group {
text-shadow: 1px 1px 1px #fff;
}
.about-wrap .point-releases {
border-bottom: 1px solid #dfdfdf;
}
.about-wrap .point-releases h3 {
border-top: 1px solid #dfdfdf;
}
.about-wrap .point-releases h3:first-child {
border: 0;
}
.about-wrap li.wp-person img.gravatar {
-webkit-box-shadow: 0 0 4px rgba( 0, 0, 0, 0.4 );
box-shadow: 0 0 4px rgba( 0, 0, 0, 0.4 );
}
.about-wrap li.wp-person .title {
color: #464646;
text-shadow: 1px 1px 1px #fff;
}
.freedoms-php .about-wrap ol li {
color: #999;
}
.freedoms-php .about-wrap ol p {
color: #464646;
}
/* End About Pages */
/*------------------------------------------------------------------------------
2.0 - Right to Left Styles
------------------------------------------------------------------------------*/
.rtl .bar {
border-right-color: transparent;
border-left-color: #99d;
}
.rtl #screen-meta-links a.show-settings {
background-position: left 3px;
}
.rtl #screen-meta-links a.show-settings.screen-meta-active {
background-position: left -33px;
}
/* Menu */
.rtl #adminmenushadow,
.rtl #adminmenuback {
background-image: url(../images/menu-shadow-rtl.png);
background-position: top left;
}
.rtl #adminmenu .wp-submenu .wp-submenu-head {
border-right-color: transparent;
border-left-color: #dfdfdf;
}
.rtl #adminmenu .wp-submenu,
.rtl.folded #adminmenu .wp-has-current-submenu .wp-submenu {
-webkit-box-shadow: -2px 2px 5px rgba( 0, 0, 0, 0.4 );
box-shadow: -2px 2px 5px rgba( 0, 0, 0, 0.4 );
}
.rtl #adminmenu .wp-has-current-submenu .wp-submenu {
-webkit-box-shadow: none;
box-shadow: none;
}
/* Collapse Menu Button */
.rtl #collapse-button div {
background-position: 0 -108px;
}
.rtl.folded #collapse-button div {
background-position: 0 -72px;
}
/* Auto-folding of the admin menu for RTL */
@media only screen and (max-width: 900px) {
.rtl.auto-fold #adminmenu a.wp-has-current-submenu:focus + .wp-submenu,
.rtl.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu {
-webkit-box-shadow: -2px 2px 5px rgba( 0, 0, 0, 0.4 );
box-shadow: -2px 2px 5px rgba( 0, 0, 0, 0.4 );
}
.rtl.auto-fold #collapse-button div {
background-position: 0 -72px;
}
}
/* Edit Image */
.js.rtl .meta-box-sortables .postbox:hover .handlediv {
background: transparent url(../images/arrows.png) no-repeat 6px 7px;
}
.rtl #post-body .misc-pub-section {
border-right-color: transparent;
border-left-color: #eee;
}
.js.rtl .sidebar-name-arrow {
background: transparent url(../images/arrows.png) no-repeat 5px 9px;
}
.js.rtl .sidebar-name:hover .sidebar-name-arrow {
background: transparent url(../images/arrows-dark.png) no-repeat 5px 9px;
}
/**
* HiDPI Displays
*/
@media print,
(-o-min-device-pixel-ratio: 5/4),
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 120dpi) {
.curtime #timestamp {
background-image: url("../images/date-button-2x.gif?ver=20120916");
background-size: 16px auto;
}
.tagchecklist span a,
#bulk-titles div a,
.tagchecklist span a:hover,
#bulk-titles div a:hover {
background-image: url("../images/xit-2x.gif?ver=20120916");
background-size: 20px auto;
}
#screen-meta-links a.show-settings,
#screen-meta-links a.show-settings.screen-meta-active,
#adminmenu .wp-has-submenu:hover .wp-menu-toggle,
#adminmenu .wp-menu-open .wp-menu-toggle,
#collapse-button div,
.nav-menus-php .item-edit,
.js .meta-box-sortables .postbox:hover .handlediv,
.sidebar-name-arrow,
.rtl #adminmenu .wp-has-submenu:hover .wp-menu-toggle,
.rtl #adminmenu .wp-menu-open .wp-menu-toggle,
.js.rtl .meta-box-sortables .postbox:hover .handlediv,
.rtl .sidebar-name-arrow {
background-image: url("../images/arrows-2x.png?ver=20120916");
background-size: 15px 123px;
}
#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,
#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle,
.sidebar-name:hover .sidebar-name-arrow,
.nav-menus-php .item-edit:hover,
.rtl #adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,
.rtl #adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle,
.rtl .sidebar-name:hover .sidebar-name-arrow {
background-image: url("../images/arrows-dark-2x.png?ver=20120916");
background-size: 15px 123px;
}
.view-switch #view-switch-list,
.view-switch #view-switch-excerpt {
background-image: url("../images/list-2x.png?ver=20120916");
background-size: 80px 20px;
}
.icon32.icon-post,
#icon-edit,
#icon-post,
.icon32.icon-dashboard,
#icon-index,
.icon32.icon-media,
#icon-upload,
.icon32.icon-links,
#icon-link-manager,
#icon-link,
#icon-link-category,
.icon32.icon-page,
#icon-edit-pages,
#icon-page,
.icon32.icon-comments,
#icon-edit-comments,
.icon32.icon-appearance,
#icon-themes,
.icon32.icon-plugins,
#icon-plugins,
.icon32.icon-users,
#icon-users,
#icon-profile,
#icon-user-edit,
.icon32.icon-tools,
#icon-tools,
#icon-admin,
.icon32.icon-settings,
#icon-options-general,
.icon32.icon-site,
#icon-ms-admin,
.icon32.icon-generic,
#icon-generic {
background-image: url(../images/icons32-2x.png?ver=20121105);
background-size: 756px 45px;
}
.icon16.icon-dashboard,
.menu-icon-dashboard div.wp-menu-image,
.icon16.icon-post,
.menu-icon-post div.wp-menu-image,
.icon16.icon-media,
.menu-icon-media div.wp-menu-image,
.icon16.icon-links,
.menu-icon-links div.wp-menu-image,
.icon16.icon-page,
.menu-icon-page div.wp-menu-image,
.icon16.icon-comments,
.menu-icon-comments div.wp-menu-image,
.icon16.icon-appearance,
.menu-icon-appearance div.wp-menu-image,
.icon16.icon-plugins,
.menu-icon-plugins div.wp-menu-image,
.icon16.icon-users,
.menu-icon-users div.wp-menu-image,
.icon16.icon-tools,
.menu-icon-tools div.wp-menu-image,
.icon16.icon-settings,
.menu-icon-settings div.wp-menu-image,
.icon16.icon-site,
.menu-icon-site div.wp-menu-image,
.icon16.icon-generic,
.menu-icon-generic div.wp-menu-image {
background-image: url('../images/menu-2x.png?ver=20121105');
background-size: 390px 64px;
}
#header-logo {
background-image: url('../images/wp-logo-2x.png?ver=20120916');
background-size: 16px auto;
}
}
| zyblog | trunk/zyblog/wp-admin/css/colors-fresh.css | CSS | asf20 | 41,970 |
/*------------------------------------------------------------------------------
Hello, this is the main WordPress admin CSS file.
All the important stuff is in here.
TABLE OF CONTENTS:
------------------
1.0 - Text Elements
2.0 - Forms
3.0 - Actions
4.0 - Notifications
5.0 - TinyMCE
6.0 - Admin Header
6.1 - Screen Options Tabs
6.2 - Help Menu
7.0 - Main Navigation
8.0 - Layout Blocks
9.0 - Dashboard
10.0 - List Posts
10.1 - Inline Editing
11.0 - Write/Edit Post Screen
11.1 - Custom Fields
11.2 - Post Revisions
11.3 - Featured Images
12.0 - Categories
13.0 - Tags
14.0 - Media Screen
14.1 - Media Library
14.2 - Image Editor
15.0 - Comments Screen
16.0 - Themes
16.1 - Custom Header
16.2 - Custom Background
16.3 - Tabbed Admin Screen Interface
17.0 - Plugins
18.0 - Users
19.0 - Tools
20.0 - Settings
21.0 - Admin Footer
22.0 - About Pages
23.0 - Full Overlay w/ Sidebar
24.0 - Customize Loader
25.0 - Misc
------------------------------------------------------------------------*/
/* 2 column liquid layout */
#wpwrap {
height: auto;
min-height: 100%;
width: 100%;
position: relative;
}
#wpcontent {
height: 100%;
}
#wpcontent,
#wpfooter {
margin-left: 165px;
}
.folded #wpcontent,
.folded #wpfooter {
margin-left: 52px;
}
#wpbody-content {
padding-bottom: 65px;
float: left;
width: 100%;
}
#adminmenuback,
#adminmenuwrap,
#adminmenu,
#adminmenu .wp-submenu {
width: 145px;
}
#adminmenuback {
position: absolute;
top: 0;
bottom: 0;
z-index: -1;
}
#adminmenu {
clear: left;
margin: 0;
padding: 0;
list-style: none;
}
.folded #adminmenuback,
.folded #adminmenuwrap,
.folded #adminmenu,
.folded #adminmenu li.menu-top {
width: 32px;
}
/* inner 2 column liquid layout */
.inner-sidebar {
float: right;
clear: right;
display: none;
width: 281px;
position: relative;
}
.columns-2 .inner-sidebar {
margin-right: auto;
width: 286px;
display: block;
}
.inner-sidebar #side-sortables,
.columns-2 .inner-sidebar #side-sortables {
min-height: 300px;
width: 280px;
padding: 0;
}
.has-right-sidebar .inner-sidebar {
display: block;
}
.has-right-sidebar #post-body {
float: left;
clear: left;
width: 100%;
margin-right: -2000px;
}
.has-right-sidebar #post-body-content {
margin-right: 300px;
float: none;
width: auto;
}
/* 2 columns main area */
#col-container,
#col-left,
#col-right {
overflow: hidden;
padding: 0;
margin: 0;
}
#col-left {
width: 35%;
}
#col-right {
float: right;
clear: right;
width: 65%;
}
.col-wrap {
padding: 0 7px;
}
/* utility classes */
.alignleft {
float: left;
}
.alignright {
float: right;
}
.textleft {
text-align: left;
}
.textright {
text-align: right;
}
.clear {
clear: both;
}
/* Hide visually but not from screen readers */
.screen-reader-text,
.screen-reader-text span,
.ui-helper-hidden-accessible {
position: absolute;
left: -1000em;
top: -1000em;
height: 1px;
width: 1px;
overflow: hidden;
}
.screen-reader-shortcut {
position: absolute;
top: -1000em;
}
.screen-reader-shortcut:focus {
left: 6px;
top: -21px;
height: auto;
width: auto;
display: block;
font-size: 14px;
font-weight: bold;
padding: 15px 23px 14px;
background: #f1f1f1;
color: #21759b;
border-radius: 3px;
z-index: 100000;
line-height: normal;
-webkit-box-shadow: 0 0 2px 2px rgba(0,0,0,.6);
box-shadow: 0 0 2px 2px rgba(0,0,0,.6);
text-decoration: none;
}
.hidden,
.js .closed .inside,
.js .hide-if-js,
.no-js .hide-if-no-js,
.js.wp-core-ui .hide-if-js,
.js .wp-core-ui .hide-if-js,
.no-js.wp-core-ui .hide-if-no-js,
.no-js .wp-core-ui .hide-if-no-js {
display: none;
}
/* include margin and padding in the width calculation of input and textarea */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="email"],
input[type="url"],
textarea {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-ms-box-sizing: border-box; /* ie8 only */
box-sizing: border-box;
}
input[type="checkbox"],
input[type="radio"] {
vertical-align: text-top;
padding: 0;
margin: 1px 0 0;
}
input[type="search"] {
-webkit-appearance: textfield;
}
input[type="search"]::-webkit-search-decoration {
display: none;
}
/* general */
html,
body {
height: 100%;
margin: 0;
padding: 0;
}
body {
font-family: sans-serif;
font-size: 12px;
line-height: 1.4em;
min-width: 600px;
}
body.iframe {
min-width: 0;
}
body.login {
background: #fbfbfb;
min-width: 0;
}
iframe,
img {
border: 0;
}
td,
textarea,
input,
select,
button {
font-family: inherit;
font-size: inherit;
font-weight: inherit;
}
td,
textarea {
line-height: inherit;
}
input,
select {
line-height: 15px;
}
a,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="email"],
input[type="url"],
select,
textarea,
div {
outline: 0;
}
a:focus,
a:active {
outline: thin dotted;
}
#adminmenu a:focus,
#adminmenu a:active,
.screen-reader-text:focus {
outline: none;
}
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: '';
content: none;
}
p {
margin: 1em 0;
}
blockquote {
margin: 1em;
}
label {
cursor: pointer;
}
li,
dd {
margin-bottom: 6px;
}
textarea,
input,
select {
margin: 1px;
padding: 3px;
}
h1,
h2,
h3,
h4,
h5,
h6 {
display: block;
font-weight: bold;
}
h1 {
font-size: 2em;
margin: .67em 0;
}
h2 {
font-size: 1.5em;
margin: .83em 0;
}
h3 {
font-size: 1.17em;
margin: 1em 0;
}
h4 {
font-size: 1em;
margin: 1.33em 0;
}
h5 {
font-size: 0.83em;
margin: 1.67em 0;
}
h6 {
font-size: 0.67em;
margin: 2.33em 0;
}
ul,
ol {
padding: 0;
}
ul {
list-style: none;
}
ol {
list-style-type: decimal;
margin-left: 2em;
}
ul.ul-disc {
list-style: disc outside;
}
ul.ul-square {
list-style: square outside;
}
ol.ol-decimal {
list-style: decimal outside;
}
ul.ul-disc,
ul.ul-square,
ol.ol-decimal {
margin-left: 1.8em;
}
ul.ul-disc > li,
ul.ul-square > li,
ol.ol-decimal > li {
margin: 0 0 0.5em;
}
.code,
code {
font-family: Consolas, Monaco, monospace;
}
kbd,
code {
padding: 1px 3px;
margin: 0 1px;
font-size: 11px;
}
.subsubsub {
list-style: none;
margin: 8px 0 5px;
padding: 0;
font-size: 12px;
float: left;
}
.subsubsub a {
line-height: 2;
padding: .2em;
text-decoration: none;
}
.subsubsub a .count,
.subsubsub a.current .count {
color: #999;
font-weight: normal;
}
.subsubsub a.current {
font-weight: bold;
border: none;
}
.subsubsub li {
display: inline-block;
margin: 0;
padding: 0;
white-space: nowrap;
}
.widefat,
div.updated,
div.error,
.wrap .add-new-h2,
textarea,
input[type="text"],
input[type="password"],
input[type="file"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
select,
.tablenav .tablenav-pages a,
.tablenav-pages span.current,
#titlediv #title,
.postbox,
#postcustomstuff table,
#postcustomstuff input,
#postcustomstuff textarea,
.imgedit-menu div,
.plugin-update-tr .update-message,
#poststuff .inside .the-tagcloud,
.login form,
#login_error,
.login .message,
#menu-management .menu-edit,
.nav-menus-php .list-container,
.menu-item-handle,
.link-to-original,
.nav-menus-php .major-publishing-actions .form-invalid,
.press-this #message,
#TB_window,
.tbtitle,
.highlight,
.feature-filter,
#widget-list .widget-top,
.editwidget .widget-inside {
-webkit-border-radius: 3px;
border-radius: 3px;
border-width: 1px;
border-style: solid;
}
/* .widefat - main style for tables */
.widefat {
border-spacing: 0;
width: 100%;
clear: both;
margin: 0;
}
.widefat * {
word-wrap: break-word;
}
.widefat a {
text-decoration: none;
}
.widefat thead th:first-of-type {
-webkit-border-top-left-radius: 3px;
border-top-left-radius: 3px;
}
.widefat thead th:last-of-type {
-webkit-border-top-right-radius: 3px;
border-top-right-radius: 3px;
}
.widefat tfoot th:first-of-type {
-webkit-border-bottom-left-radius: 3px;
border-bottom-left-radius: 3px;
}
.widefat tfoot th:last-of-type {
-webkit-border-bottom-right-radius: 3px;
border-bottom-right-radius: 3px;
}
.widefat td,
.widefat th {
border-width: 1px 0;
border-style: solid;
}
.widefat tfoot th {
border-bottom: none;
}
.widefat .no-items td {
border-bottom-width: 0;
}
.widefat td {
font-size: 12px;
padding: 4px 7px 2px;
vertical-align: top;
}
.widefat td p,
.widefat td ol,
.widefat td ul {
font-size: 12px;
}
.widefat th {
padding: 7px 7px 8px;
text-align: left;
line-height: 1.3em;
font-size: 14px;
}
.widefat th input {
margin: 0 0 0 8px;
padding: 0;
vertical-align: text-top;
}
.widefat .check-column {
width: 2.2em;
padding: 6px 0 25px;
vertical-align: top;
}
.widefat tbody th.check-column {
padding: 9px 0 22px;
}
.widefat.media .check-column {
padding-top: 8px;
}
.widefat thead .check-column,
.widefat tfoot .check-column {
padding: 10px 0 0;
}
.no-js .widefat thead .check-column input,
.no-js .widefat tfoot .check-column input {
display: none;
}
.widefat .num,
.column-comments,
.column-links,
.column-posts {
text-align: center;
}
.widefat th#comments {
vertical-align: middle;
}
.wrap {
margin: 4px 15px 0 0;
}
div.updated,
div.error {
padding: 0 0.6em;
margin: 5px 15px 2px;
}
div.updated p,
div.error p {
margin: 0.5em 0;
padding: 2px;
}
.wrap div.updated,
.wrap div.error,
.media-upload-form div.error {
margin: 5px 0 15px;
}
.wrap h2,
.subtitle {
font-weight: normal;
margin: 0;
text-shadow: #fff 0 1px 0;
}
.wrap h2 {
font-size: 23px;
padding: 9px 15px 4px 0;
line-height: 29px;
}
.subtitle {
font-size: 14px;
padding-left: 25px;
}
.wrap .add-new-h2 {
font-family: sans-serif;
margin-left: 4px;
padding: 3px 8px;
position: relative;
top: -3px;
text-decoration: none;
font-size: 12px;
border: 0 none;
}
.wrap h2.long-header {
padding-right: 0;
}
html,
.wp-dialog {
background-color: #fff;
}
textarea,
input[type="text"],
input[type="password"],
input[type="file"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
select {
background-color: #fff;
color: #333;
}
select {
color: #000;
}
select[disabled] {
color: #7f7f7f;
}
select:focus {
border-color: #aaa;
}
textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
select:focus {
-webkit-box-shadow: 1px 1px 2px rgba(0,0,0,0.1);
box-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}
input[readonly] {
background-color: #eee;
}
:-moz-placeholder {
color: #a9a9a9;
}
/*------------------------------------------------------------------------------
1.0 - Text Styles
------------------------------------------------------------------------------*/
div.sidebar-name h3,
#menu-management .nav-tab,
#dashboard_plugins h5,
a.rsswidget,
#dashboard_right_now td.b,
#dashboard-widgets h4,
.tool-box .title,
#poststuff h3,
.metabox-holder h3,
.pressthis a,
#your-profile legend,
.inline-edit-row fieldset span.title,
.inline-edit-row fieldset span.checkbox-title,
.tablenav .displaying-num,
.widefat th,
.quicktags,
.search {
font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
}
h2 .nav-tab,
.wrap h2,
.subtitle,
.login form .input {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
}
.quicktags,
.search {
font-size: 12px;
}
.icon32 {
float: left;
height: 34px;
margin: 7px 8px 0 0;
width: 36px;
}
.icon16 {
height: 18px;
width: 18px;
padding: 6px 6px;
margin: -6px 0 0 -8px;
float: left;
}
.key-labels label {
line-height: 24px;
}
.pre {
/* https://developer.mozilla.org/en-US/docs/CSS/white-space */
white-space: pre-wrap; /* css-3 */
word-wrap: break-word; /* IE 5.5 - 7 */
}
.howto {
font-style: italic;
display: block;
font-family: sans-serif;
}
p.install-help {
margin: 8px 0;
font-style: italic;
}
.no-break {
white-space: nowrap;
}
/*------------------------------------------------------------------------------
2.0 - Forms
------------------------------------------------------------------------------*/
.wp-admin select {
padding: 2px;
height: 2em;
}
.wp-admin select[multiple] {
height: auto;
}
.submit {
padding: 1.5em 0;
margin: 5px 0;
-webkit-border-bottom-left-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
}
form p.submit a.cancel:hover {
text-decoration: none;
}
#minor-publishing-actions input,
#major-publishing-actions input,
#minor-publishing-actions .preview {
text-align: center;
}
textarea.all-options,
input.all-options {
width: 250px;
}
input.large-text,
textarea.large-text {
width: 99%;
}
input.regular-text,
#adduser .form-field input {
width: 25em;
}
input.small-text {
width: 50px;
}
input[type="number"].small-text {
width: 60px;
}
#doaction,
#doaction2,
#post-query-submit {
margin: 1px 8px 0 0;
}
.tablenav #changeit,
.tablenav #delete_all,
.tablenav #clear-recent-list {
margin-top: 1px;
}
.tablenav .actions select {
float: left;
margin-right: 6px;
max-width: 200px;
}
.ie8 .tablenav .actions select {
width: 155px;
}
.ie8 .tablenav .actions select#cat {
width: 200px;
}
#timezone_string option {
margin-left: 1em;
}
label,
#your-profile label + a {
vertical-align: middle;
}
#misc-publishing-actions label {
vertical-align: baseline;
}
#pass-strength-result {
border-style: solid;
border-width: 1px;
float: left;
margin: 13px 5px 5px 1px;
padding: 3px 5px;
text-align: center;
width: 200px;
display: none;
}
.indicator-hint {
padding-top: 8px;
}
p.search-box {
float: right;
margin: 0;
}
.search-box input[name="s"],
#search-plugins input[name="s"],
.tagsdiv .newtag {
float: left;
height: 2em;
margin: 0 4px 0 0;
}
input[type="text"].ui-autocomplete-loading {
background: transparent url('../images/loading.gif') no-repeat right center;
visibility: visible;
}
ul#add-to-blog-users {
margin: 0 0 0 14px;
}
.ui-autocomplete-input.open {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.ui-autocomplete {
padding: 0;
margin: 0;
list-style: none;
position: absolute;
z-index: 10000;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
border-width: 1px;
border-style: solid;
}
.ui-autocomplete li {
margin-bottom: 0;
white-space: nowrap;
text-align: left;
}
.ui-autocomplete li a {
display: block;
height: 100%;
padding: 4px 10px;
}
.ui-autocomplete li a.ui-state-focus {
cursor: pointer;
}
/*------------------------------------------------------------------------------
3.0 - Actions
------------------------------------------------------------------------------*/
#major-publishing-actions {
padding: 10px 10px 8px;
clear: both;
border-top: 1px solid #f5f5f5;
margin-top: -2px;
}
#delete-action {
line-height: 25px;
vertical-align: middle;
text-align: left;
float: left;
}
#publishing-action {
text-align: right;
float: right;
line-height: 23px;
}
#publishing-action .spinner {
float: left;
}
#misc-publishing-actions {
padding: 6px 0 0;
}
.misc-pub-section {
padding: 6px 10px 8px;
border-width: 1px 0;
border-style: solid;
}
.misc-pub-section:first-child {
border-top-width: 0;
}
.misc-pub-section-last {
border-bottom-width: 0;
}
#minor-publishing-actions {
padding: 10px 10px 2px 8px;
text-align: right;
}
#minor-publishing {
border-bottom-width: 1px;
border-bottom-style: solid;
-webkit-box-shadow: 0 1px 0 #fff;
box-shadow: 0 1px 0 #fff;
}
#save-post {
float: left;
}
.preview {
float: right;
}
#sticky-span {
margin-left: 18px;
}
.side-info {
margin: 0;
padding: 4px;
font-size: 11px;
}
.side-info h5 {
padding-bottom: 7px;
font-size: 14px;
margin: 12px 2px 5px;
border-bottom-width: 1px;
border-bottom-style: solid;
}
.side-info ul {
margin: 0;
padding-left: 18px;
list-style: square;
}
.approve,
.unapproved .unapprove {
display: none;
}
.unapproved .approve,
.spam .approve,
.trash .approve {
display: inline;
}
td.action-links,
th.action-links {
text-align: right;
}
/*------------------------------------------------------------------------------
4.0 - Notifications
------------------------------------------------------------------------------*/
#update-nag,
.update-nag {
line-height: 19px;
padding: 5px 0;
font-size: 12px;
text-align: center;
margin: -1px 15px 0 5px;
border-width: 1px;
border-style: solid;
-webkit-border-bottom-right-radius: 3px;
-webkit-border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
}
.plugins .plugin-update {
padding: 0;
}
.plugin-update .update-message {
margin: 0 10px 8px 31px;
font-weight: bold;
}
ul#dismissed-updates {
display: none;
}
form.upgrade {
margin-top: 8px;
}
form.upgrade .hint {
font-style: italic;
font-size: 85%;
margin: -0.5em 0 2em 0;
}
#ajax-loading,
.ajax-loading,
.ajax-feedback,
.imgedit-wait-spin,
.list-ajax-loading { /* deprecated */
visibility: hidden;
}
#ajax-response.alignleft {
margin-left: 2em;
}
/*------------------------------------------------------------------------------
6.0 - Admin Header
------------------------------------------------------------------------------*/
#adminmenu a,
#sidemenu a,
#taglist a,
#catlist a {
text-decoration: none;
}
/*------------------------------------------------------------------------------
6.1 - Screen Options Tabs
------------------------------------------------------------------------------*/
#screen-options-wrap,
#contextual-help-wrap {
margin: 0;
padding: 8px 20px 12px;
position: relative;
}
#contextual-help-wrap {
overflow: auto;
}
#screen-meta .screen-reader-text {
visibility: hidden;
}
#screen-meta-links {
margin: 0 24px 0 0;
}
#screen-meta-links a:focus {
-webkit-box-shadow: 1px 1px 1px rgba(0,0,0,0.4);
box-shadow: 1px 1px 1px rgba(0,0,0,0.4);
outline: none;
}
/* screen options and help tabs revert */
#screen-meta {
display: none;
position: relative;
margin: 0 15px 0 5px;
border-width: 0 1px 1px;
border-style: none solid solid;
}
#screen-options-link-wrap,
#contextual-help-link-wrap {
float: right;
height: 23px;
padding: 0;
margin: 0 0 0 6px;
font-family: sans-serif;
}
#screen-options-link-wrap,
#contextual-help-link-wrap,
#screen-meta {
-webkit-border-bottom-left-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
}
#screen-meta-links .screen-meta-toggle {
position: relative;
top: -1px;
}
#screen-meta-links a.show-settings {
text-decoration: none;
z-index: 1;
padding: 1px 16px 0 6px;
height: 22px;
line-height: 22px;
font-size: 12px;
display: block;
text-shadow: rgba(255,255,255,0.7) 0 1px 0;
}
#screen-meta-links a.show-settings:hover {
text-decoration: none;
}
/* end screen options and help tabs */
.toggle-arrow {
background-repeat: no-repeat;
background-position: top left;
background-color: transparent;
height: 22px;
line-height: 22px;
display: block;
}
.toggle-arrow-active {
background-position: bottom left;
}
#screen-options-wrap h5,
#contextual-help-wrap h5 {
margin: 8px 0;
font-size: 13px;
}
.metabox-prefs label {
display: inline-block;
padding-right: 15px;
white-space: nowrap;
line-height: 30px;
}
.metabox-prefs label input {
margin: 0 5px 0 2px;
}
.metabox-prefs .columns-prefs label input {
margin: 0 2px;
}
.metabox-prefs label a {
display: none;
}
/*------------------------------------------------------------------------------
6.2 - Help Menu
------------------------------------------------------------------------------*/
#contextual-help-wrap {
padding: 0;
margin-left: -4px;
}
#contextual-help-columns {
position: relative;
}
#contextual-help-back {
position: absolute;
top: 0;
bottom: 0;
left: 150px;
right: 170px;
border-width: 0 1px;
border-style: solid;
}
#contextual-help-wrap.no-sidebar #contextual-help-back {
right: 0;
border-right-width: 0;
-webkit-border-bottom-right-radius: 2px;
border-bottom-right-radius: 2px;
}
.contextual-help-tabs {
float: left;
width: 150px;
margin: 0;
}
.contextual-help-tabs ul {
margin: 1em 0;
}
.contextual-help-tabs li {
margin-bottom: 0;
list-style-type: none;
border-style: solid;
border-width: 1px 0;
border-color: transparent;
}
.contextual-help-tabs a {
display: block;
padding: 5px 5px 5px 12px;
line-height: 18px;
text-decoration: none;
}
.contextual-help-tabs .active {
padding: 0;
margin: 0 -1px 0 0;
border-width: 1px 0 1px 1px;
border-style: solid;
}
.contextual-help-tabs-wrap {
padding: 0 20px;
overflow: auto;
}
.help-tab-content {
display: none;
margin: 0 22px 12px 0;
line-height: 1.6em;
}
.help-tab-content.active {
display: block;
}
.help-tab-content li {
list-style-type: disc;
margin-left: 18px;
}
.contextual-help-sidebar {
width: 150px;
float: right;
padding: 0 8px 0 12px;
overflow: auto;
}
/*------------------------------------------------------------------------------
7.0 - Main Navigation (Left Menu)
------------------------------------------------------------------------------*/
#adminmenuback,
#adminmenuwrap {
border-width: 0 1px 0 0;
border-style: solid;
}
#adminmenuwrap {
position: relative;
float: left;
}
#adminmenushadow {
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 6px;
z-index: 20;
}
/* side admin menu */
#adminmenu * {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
#adminmenu li {
margin: 0;
padding: 0;
cursor: pointer;
}
#adminmenu a {
display: block;
line-height: 18px;
padding: 2px 5px;
}
#adminmenu li.menu-top {
min-height: 28px;
position: relative;
}
#adminmenu .wp-submenu {
list-style: none;
padding: 4px 0;
margin: 0;
position: absolute;
top: -1000em;
left: 146px;
z-index: 1000;
overflow: visible;
border-width: 1px;
border-style: solid;
-webkit-border-bottom-right-radius: 3px;
-webkit-border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
}
.js #adminmenu .sub-open,
.js #adminmenu .opensub .wp-submenu,
#adminmenu a.menu-top:focus + .wp-submenu,
.no-js li.wp-has-submenu:hover .wp-submenu {
top: -1px;
}
#adminmenu .wp-has-current-submenu .wp-submenu,
.no-js li.wp-has-current-submenu:hover .wp-submenu,
#adminmenu a.wp-has-current-submenu:focus + .wp-submenu,
#adminmenu .wp-has-current-submenu .wp-submenu.sub-open,
#adminmenu .wp-has-current-submenu.opensub .wp-submenu {
position: relative;
z-index: 2;
top: auto;
left: auto;
right: auto;
bottom: auto;
border: 0 none;
-webkit-box-shadow: none;
box-shadow: none;
}
.folded #adminmenu .wp-submenu.sub-open,
.folded #adminmenu .opensub .wp-submenu,
.folded #adminmenu .wp-has-current-submenu .wp-submenu.sub-open,
.folded #adminmenu .wp-has-current-submenu.opensub .wp-submenu,
.folded #adminmenu a.menu-top:focus + .wp-submenu,
.folded #adminmenu .wp-has-current-submenu a.menu-top:focus + .wp-submenu,
.no-js.folded #adminmenu .wp-has-submenu:hover .wp-submenu {
top: -1px;
left: 32px;
}
.folded #adminmenu a.wp-has-current-submenu:focus + .wp-submenu,
.folded #adminmenu .wp-has-current-submenu .wp-submenu {
border-width: 1px;
border-style: solid;
position: absolute;
top: -1000em;
}
#adminmenu .wp-submenu a {
font-size: 12px;
line-height: 18px;
margin: 0;
padding-left: 12px;
}
#adminmenu .wp-not-current-submenu li > a {
padding-left: 16px;
}
#adminmenu .wp-has-current-submenu ul > li > a,
.folded #adminmenu li.menu-top .wp-submenu > li > a {
padding-left: 12px;
}
#adminmenu a.menu-top,
#adminmenu .wp-submenu-head {
font-size: 13px;
font-weight: bold;
line-height: 18px;
padding: 0;
}
#adminmenu .wp-submenu-head,
.folded #adminmenu .wp-menu-name {
display: none;
}
.folded #adminmenu .wp-submenu-head {
display: block;
}
#adminmenu .wp-submenu li {
padding: 0;
margin: 0;
overflow: hidden;
}
#adminmenu a.menu-top {
border-width: 1px 0;
border-style: solid none;
}
#adminmenu .wp-menu-image img {
padding: 7px 0 0 7px;
opacity: 0.6;
filter: alpha(opacity=60);
}
#adminmenu div.wp-menu-name {
padding: 5px;
}
#adminmenu div.wp-menu-image {
float: left;
width: 28px;
height: 28px;
}
.folded #adminmenu div.wp-menu-image {
width: 32px;
position: absolute;
z-index: 25;
}
.folded #adminmenu a.menu-top {
height: 28px;
}
.wp-menu-arrow {
z-index: 25;
position: absolute;
right: 100%;
margin: 0;
height: 30px;
width: 6px;
-moz-transform: translate( 146px );
-webkit-transform: translate( 146px );
-o-transform: translate( 146px );
-ms-transform: translate( 146px );
transform: translate( 146px );
}
#adminmenu .wp-menu-arrow div {
display: none;
position: absolute;
top: 7px;
left: -1px;
width: 14px;
height: 15px;
-moz-transform: matrix( -0.6, 1, 0.6, 1, 0, 0 );
-webkit-transform: matrix( -0.6, 1, 0.6, 1, 0, 0 );
-o-transform: matrix( -0.6, 1, 0.6, 1, 0, 0 );
-ms-transform: matrix( -0.6, 1, 0.6, 1, 0, 0 );
transform: matrix( -0.6, 1, 0.6, 1, 0, 0 );
}
#adminmenu li.wp-not-current-submenu .wp-menu-arrow {
-moz-transform: translate( 145px );
-webkit-transform: translate( 145px );
-o-transform: translate( 145px );
-ms-transform: translate( 145px );
transform: translate( 145px );
height: 28px;
border-width: 1px 0;
border-style: solid;
top: 0;
}
.folded #adminmenu li .wp-menu-arrow {
-moz-transform: translate( 32px );
-webkit-transform: translate( 32px );
-o-transform: translate( 32px );
-ms-transform: translate( 32px );
transform: translate( 32px );
}
#adminmenu li.current .wp-menu-arrow,
#adminmenu li.wp-has-current-submenu .wp-menu-arrow,
#adminmenu li.wp-has-current-submenu .wp-menu-arrow div,
#adminmenu li.wp-has-submenu .wp-menu-arrow div,
#adminmenu li.current .wp-menu-arrow div,
.no-js #adminmenu li.wp-has-submenu:hover .wp-menu-arrow,
#adminmenu li.wp-has-submenu.opensub .wp-menu-arrow,
#adminmenu a.wp-has-submenu:focus .wp-menu-arrow,
#adminmenu a:hover .wp-menu-arrow {
display: block;
}
#adminmenu li.current .wp-menu-arrow,
#adminmenu li.wp-menu-open .wp-menu-arrow {
top: 0;
}
.no-js #adminmenu li.wp-has-submenu:hover .wp-menu-arrow,
#adminmenu li.wp-has-submenu.opensub .wp-menu-arrow,
#adminmenu a.wp-has-submenu:focus .wp-menu-arrow {
z-index: 1001;
}
.ie8 #adminmenu li.menu-top:hover .wp-menu-arrow {
display: none;
}
#adminmenu .wp-not-current-submenu .wp-menu-arrow div {
width: 15px;
top: 6px;
border-width: 0 0 1px 1px;
border-style: solid;
}
.wp-menu-arrow,
.folded #adminmenu li .wp-menu-arrow div,
.no-js #adminmenu li.wp-not-current-submenu:hover .wp-menu-arrow {
display: none;
}
.folded #adminmenu li.current .wp-menu-arrow,
.folded #adminmenu li.current .wp-menu-arrow div,
.folded #adminmenu li.wp-has-current-submenu .wp-menu-arrow div,
.folded #adminmenu li.wp-menu-open .wp-menu-arrow,
.folded #adminmenu li a:focus .wp-menu-arrow {
display: block;
}
#adminmenu li.menu-top:hover .wp-menu-image img,
#adminmenu li.wp-has-current-submenu .wp-menu-image img {
opacity: 1;
filter: alpha(opacity=100);
}
#adminmenu li.wp-menu-separator {
height: 3px;
padding: 0;
margin: 0;
border-width: 1px 0;
border-style: solid;
cursor: inherit;
}
#adminmenu div.separator {
height: 1px;
padding: 0;
border-width: 1px 0 0 0;
border-style: solid;
}
#adminmenu .wp-submenu .wp-submenu-head {
padding: 5px 4px 5px 10px;
margin: -4px -1px 4px;
border-width: 1px 0;
border-style: solid;
-webkit-border-top-right-radius: 3px;
border-top-right-radius: 3px;
}
#adminmenu li.wp-menu-open {
border-width: 0 0 1px;
border-style: solid;
}
#adminmenu li.current,
.folded #adminmenu li.wp-menu-open {
border: 0 none;
}
.folded #adminmenu li.wp-has-current-submenu {
margin-bottom: 1px;
}
.folded #adminmenu .wp-has-current-submenu.menu-top-last {
margin-bottom: 0;
}
#adminmenu .awaiting-mod,
#adminmenu span.update-plugins,
#sidemenu li a span.update-plugins {
position: absolute;
font-family: sans-serif;
font-size: 9px;
line-height: 17px;
font-weight: bold;
margin-top: 1px;
margin-left: 7px;
-webkit-border-radius: 10px;
border-radius: 10px;
z-index: 26;
}
#adminmenu li .awaiting-mod span,
#adminmenu li span.update-plugins span,
#sidemenu li a span.update-plugins span {
display: block;
padding: 0 6px;
}
#adminmenu li span.count-0,
#sidemenu li a .count-0 {
display: none;
}
#collapse-menu {
font-size: 12px;
line-height: 34px;
border-width: 1px 0 0;
border-style: solid;
}
.folded #collapse-menu span {
display: none;
}
#collapse-button,
#collapse-button div {
width: 15px;
height: 15px;
}
#collapse-button {
float: left;
margin: 8px 6px;
border-width: 1px;
border-style: solid;
-webkit-border-radius: 10px;
border-radius: 10px;
}
/* Auto-folding of the admin menu */
@media only screen and (max-width: 900px) {
.auto-fold #wpcontent,
.auto-fold #wpfooter {
margin-left: 52px;
}
.auto-fold #adminmenuback,
.auto-fold #adminmenuwrap,
.auto-fold #adminmenu,
.auto-fold #adminmenu li.menu-top {
width: 32px;
}
.auto-fold #adminmenu .wp-submenu.sub-open,
.auto-fold #adminmenu .opensub .wp-submenu,
.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu.sub-open,
.auto-fold #adminmenu .wp-has-current-submenu.opensub .wp-submenu,
.auto-fold #adminmenu a.menu-top:focus + .wp-submenu,
.auto-fold #adminmenu .wp-has-current-submenu a.menu-top:focus + .wp-submenu {
top: -1px;
left: 32px;
}
.auto-fold #adminmenu a.wp-has-current-submenu:focus + .wp-submenu,
.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu {
border-width: 1px;
border-style: solid;
position: absolute;
top: -1000em;
}
.auto-fold #adminmenu li.menu-top .wp-submenu > li > a {
padding-left: 12px;
}
.auto-fold #adminmenu .wp-menu-name {
display: none;
}
.auto-fold #adminmenu .wp-submenu-head {
display: block;
}
.auto-fold #adminmenu div.wp-menu-image {
width: 32px;
position: absolute;
z-index: 25;
}
.auto-fold #adminmenu a.menu-top {
height: 28px;
}
.auto-fold #adminmenu li .wp-menu-arrow {
-moz-transform: translate( 32px );
-webkit-transform: translate( 32px );
-o-transform: translate( 32px );
-ms-transform: translate( 32px );
transform: translate( 32px );
}
.auto-fold #adminmenu li .wp-menu-arrow div {
display: none;
}
.auto-fold #adminmenu li.current .wp-menu-arrow,
.auto-fold #adminmenu li.current .wp-menu-arrow div,
.auto-fold #adminmenu li.wp-has-current-submenu .wp-menu-arrow div,
.auto-fold #adminmenu li.wp-menu-open .wp-menu-arrow,
.auto-fold #adminmenu li a:focus .wp-menu-arrow {
display: block;
}
.auto-fold #adminmenu li.wp-menu-open {
border: 0 none;
}
.auto-fold #adminmenu li.wp-has-current-submenu {
margin-bottom: 1px;
}
.auto-fold #adminmenu .wp-has-current-submenu.menu-top-last {
margin-bottom: 0;
}
.auto-fold #collapse-menu span {
display: none;
}
}
/* List table styles */
.post-com-count-wrapper {
min-width: 22px;
font-family: sans-serif;
}
.post-com-count {
background-image: url('../images/bubble_bg.gif');
height: 1.3em;
line-height: 1.1em;
display: block;
text-decoration: none;
padding: 0 0 6px;
cursor: pointer;
background-position: center -80px;
background-repeat: no-repeat;
}
.post-com-count span {
font-size: 11px;
font-weight: bold;
height: 1.4em;
line-height: 1.4em;
min-width: 0.7em;
padding: 0 6px;
display: inline-block;
-webkit-border-radius: 5px;
border-radius: 5px;
}
strong .post-com-count {
background-position: center -55px;
}
.post-com-count:hover {
background-position: center -3px;
}
.column-response .post-com-count {
float: left;
margin-right: 5px;
text-align: center;
}
.response-links {
float: left;
}
#the-comment-list .attachment-80x60 {
padding: 4px 8px;
}
th .comment-grey-bubble {
background-image: url('../images/comment-grey-bubble.png');
background-repeat: no-repeat;
height: 12px;
width: 12px;
}
/*------------------------------------------------------------------------------
8.0 - Layout Blocks
------------------------------------------------------------------------------*/
html.wp-toolbar {
padding-top: 28px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.narrow {
width: 70%;
margin-bottom: 40px;
}
.narrow p {
line-height: 150%;
}
.widefat th,
.widefat td {
overflow: hidden;
}
.widefat th {
font-weight: normal;
}
.widefat td p {
margin: 2px 0 0.8em;
}
.widefat .column-comment p {
margin: 0.6em 0;
}
/* Screens with postboxes */
.postbox-container {
float: left;
}
#dashboard-widgets.columns-1 .postbox-container {
width: 100%;
}
#dashboard-widgets.columns-2 .postbox-container {
width: 49.5%;
}
#dashboard-widgets.columns-2 #postbox-container-2,
#dashboard-widgets.columns-2 #postbox-container-3,
#dashboard-widgets.columns-2 #postbox-container-4 {
float: right;
width: 50.5%;
}
#dashboard-widgets.columns-3 .postbox-container {
width: 33.5%;
}
#dashboard-widgets.columns-3 #postbox-container-1 {
width: 33%;
}
#dashboard-widgets.columns-3 #postbox-container-3,
#dashboard-widgets.columns-3 #postbox-container-4 {
float: right;
}
#dashboard-widgets.columns-4 .postbox-container {
width: 25%;
}
.postbox-container .meta-box-sortables {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
.metabox-holder .postbox-container .empty-container {
border: 3px dashed #CCCCCC;
height: 250px;
}
.metabox-holder.columns-1 .postbox-container .empty-container,
.columns-2 #postbox-container-3 .empty-container,
.columns-2 #postbox-container-4 .empty-container,
.columns-3 #postbox-container-4 .empty-container {
border: 0 none;
height: 0;
min-height: 0;
}
#poststuff {
padding-top: 10px;
}
#poststuff #post-body {
padding: 0;
}
#post-body-content {
width: 100%;
float: left;
}
#poststuff .postbox-container {
width: 100%;
}
#poststuff #post-body.columns-2 {
margin-right: 300px;
}
#post-body.columns-2 #postbox-container-1 {
float: right;
margin-right: -300px;
width: 280px;
}
#post-body.columns-2 #side-sortables {
min-height: 250px;
}
/* one column on the dash */
@media only screen and (max-width: 799px) {
#wpbody-content #dashboard-widgets .postbox-container {
width: 100%;
}
#wpbody-content .metabox-holder .postbox-container .empty-container {
border: 0 none;
height: 0;
min-height: 0;
}
}
/* two columns on the dash, but keep the setting if one is selected */
@media only screen and (min-width: 800px) and (max-width: 1200px) {
#wpbody-content #dashboard-widgets .postbox-container {
width: 49.5%;
}
#wpbody-content #dashboard-widgets #postbox-container-2,
#wpbody-content #dashboard-widgets #postbox-container-3,
#wpbody-content #dashboard-widgets #postbox-container-4 {
float: right;
width: 50.5%;
}
#dashboard-widgets #postbox-container-3 .empty-container,
#dashboard-widgets #postbox-container-4 .empty-container {
border: 0 none;
height: 0;
min-height: 0;
}
#wpbody #wpbody-content #dashboard-widgets.columns-1 .postbox-container {
width: 100%;
}
#wpbody #wpbody-content .metabox-holder.columns-1 .postbox-container .empty-container {
border: 0 none;
height: 0;
min-height: 0;
}
/* show the radio buttons for column prefs only for one or two columns */
.index-php .screen-layout,
.index-php .columns-prefs {
display: block;
}
.columns-prefs .columns-prefs-3,
.columns-prefs .columns-prefs-4 {
display: none;
}
}
/* one column on the post write/edit screen */
@media only screen and (max-width: 850px) {
#wpbody-content #poststuff #post-body {
margin: 0;
}
#wpbody-content #post-body.columns-2 #postbox-container-1 {
margin-right: 0;
width: 100%;
}
#poststuff #postbox-container-1 .empty-container,
#poststuff #postbox-container-1 #side-sortables:empty {
border: 0 none;
height: 0;
min-height: 0;
}
#poststuff #post-body.columns-2 #side-sortables {
min-height: 0;
}
/* hide the radio buttons for column prefs */
.screen-layout,
.columns-prefs {
display: none;
}
}
.postbox .hndle {
-webkit-border-top-left-radius: 3px;
-webkit-border-top-right-radius: 3px;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
.js .postbox .hndle {
cursor: move;
}
.postbox.closed .hndle {
-webkit-border-radius: 3px;
border-radius: 3px;
}
.hndle a {
font-size: 11px;
font-weight: normal;
}
.postbox .handlediv {
float: right;
width: 27px;
height: 30px;
}
.js .postbox .handlediv {
cursor: pointer;
}
.sortable-placeholder {
border-width: 1px;
border-style: dashed;
margin-bottom: 20px;
}
.widget,
.postbox,
.stuffbox {
margin-bottom: 20px;
padding: 0;
border-width: 1px;
border-style: solid;
line-height: 1;
}
.widget .widget-top,
.postbox h3,
.stuffbox h3 {
margin-top: 1px;
border-bottom-width: 1px;
border-bottom-style: solid;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.js .widget .widget-top,
.js .postbox h3 {
cursor: move;
}
.postbox .inside,
.stuffbox .inside {
padding: 0 12px 0 10px;
line-height: 1.4em;
}
.postbox .inside {
margin: 10px 0;
position: relative;
}
.postbox.closed h3 {
border: none;
-webkit-box-shadow: none;
box-shadow: none;
}
.postbox table.form-table {
margin-bottom: 0;
}
.temp-border {
border: 1px dotted #ccc;
}
.columns-prefs label {
padding: 0 5px;
}
/*------------------------------------------------------------------------------
9.0 - Dashboard
------------------------------------------------------------------------------*/
#dashboard-widgets-wrap {
margin: 0 -8px;
}
#wpbody-content .metabox-holder {
padding-top: 10px;
}
#dashboard-widgets .meta-box-sortables {
margin: 0 8px;
}
#dashboard_recent_comments div.undo {
border-top-style: solid;
border-top-width: 1px;
margin: 0 -10px;
padding: 3px 8px;
font-size: 11px;
}
#the-comment-list td.comment p.comment-author {
margin-top: 0;
margin-left: 0;
}
#the-comment-list p.comment-author img {
float: left;
margin-right: 8px;
}
#the-comment-list p.comment-author strong a {
border: none;
}
#the-comment-list td {
vertical-align: top;
}
#the-comment-list td.comment {
word-wrap: break-word;
}
/* Welcome Panel */
.welcome-panel {
position: relative;
overflow: auto;
margin: 20px 0;
padding: 23px 10px 12px;
border-width: 1px;
border-style: solid;
border-radius: 3px;
font-size: 13px;
line-height: 2.1em;
}
.welcome-panel h3 {
margin: 0;
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
font-size: 21px;
font-weight: normal;
line-height: 1.2;
}
.welcome-panel h4 {
margin: 1.33em 0 0;
font-size: 13px;
}
.welcome-panel .about-description {
font-size: 16px;
margin: 0;
}
.welcome-panel .welcome-panel-close {
position: absolute;
top: 5px;
right: 10px;
padding: 8px 3px;
font-size: 13px;
text-decoration: none;
line-height: 1;
}
.welcome-panel .welcome-panel-close:before {
content: ' ';
position: absolute;
left: -12px;
width: 10px;
height: 100%;
background: url('../images/xit.gif') 0 17% no-repeat;
}
.welcome-panel .welcome-panel-close:hover:before {
background-position: 100% 17%;
}
.wp-core-ui .welcome-panel .button.button-hero {
margin: 15px 0 3px;
}
.welcome-panel-content {
margin-left: 13px;
max-width: 1500px;
}
.welcome-panel .welcome-panel-column-container {
clear: both;
overflow: hidden;
position: relative;
}
.welcome-panel .welcome-panel-column {
width: 32%;
min-width: 200px;
float: left;
}
.ie8 .welcome-panel .welcome-panel-column {
min-width: 230px;
}
.welcome-panel .welcome-panel-column:first-child {
width: 36%;
}
.welcome-panel-column p {
margin-top: 7px;
}
.welcome-panel .welcome-icon {
display: block;
padding: 2px 0 8px 32px;
background-image: url('../images/welcome-icons.png');
background-repeat: no-repeat;
background-size: 16px;
}
.welcome-panel .welcome-add-page {
background-position: 0 2px;
}
.welcome-panel .welcome-edit-page {
background-position: 0 -90px;
}
.welcome-panel .welcome-learn-more {
background-position: 0 -136px;
}
.welcome-panel .welcome-comments {
background-position: 0 -182px;
}
.welcome-panel .welcome-view-site {
background-position: 0 -274px;
}
.welcome-panel .welcome-widgets-menus {
background-position: 1px -229px;
line-height: 14px;
}
.welcome-panel .welcome-write-blog {
background-position: 0 -44px;
}
.welcome-panel .welcome-panel-column ul {
margin: 0.8em 1em 1em 0;
}
.welcome-panel .welcome-panel-column li {
line-height: 16px;
list-style-type: none;
}
@media screen and (max-width: 870px) {
.welcome-panel .welcome-panel-column,
.welcome-panel .welcome-panel-column:first-child {
display: block;
float: none;
width: 100%;
}
.welcome-panel .welcome-panel-column li {
display: inline-block;
margin-right: 13px;
}
.welcome-panel .welcome-panel-column ul {
margin: 0.4em 0 0;
}
.welcome-panel .welcome-icon {
padding-left: 25px;
}
}
/*------------------------------------------------------------------------------
10.0 - List Posts (/Pages/etc)
------------------------------------------------------------------------------*/
table.fixed {
table-layout: fixed;
}
.fixed .column-rating,
.fixed .column-visible {
width: 8%;
}
.fixed .column-date,
.fixed .column-parent,
.fixed .column-links {
width: 10%;
}
.fixed .column-response,
.fixed .column-author,
.fixed .column-categories,
.fixed .column-tags,
.fixed .column-rel,
.fixed .column-role {
width: 15%;
}
.fixed .column-comments {
width: 4em;
padding: 8px 0;
text-align: left;
}
.fixed .column-comments .vers {
padding-left: 3px;
}
.fixed .column-comments a {
float: left;
}
.fixed .column-slug {
width: 25%;
}
.fixed .column-posts {
width: 10%;
}
.fixed .column-icon {
width: 80px;
}
#comments-form .fixed .column-author {
width: 20%;
}
#commentsdiv.postbox .inside {
margin: 0;
padding: 0;
}
#commentsdiv .inside .row-actions {
line-height:18px;
}
#commentsdiv .inside .column-author {
width: 25%;
}
#commentsdiv .column-comment p {
margin: 0.6em 0;
padding: 0;
}
#commentsdiv #replyrow td {
padding: 0;
}
#commentsdiv p {
padding: 8px 10px;
margin: 0;
}
#commentsdiv #add-new-comment {
border-width: 0 0 1px;
border-style: none none solid;
}
#commentsdiv .comments-box {
border: 0 none;
}
#commentsdiv .comments-box thead th {
background: transparent;
padding: 0 7px 4px;
font-style: italic;
}
#commentsdiv .comments-box tr:last-child td {
border-bottom: 0 none;
}
#commentsdiv .spinner {
padding-left: 5px;
}
.sorting-indicator {
display: none;
width: 7px;
height: 4px;
margin-top: 8px;
margin-left: 7px;
background-image: url('../images/sort.gif');
background-repeat: no-repeat;
}
.fixed .column-comments .sorting-indicator {
margin-top: 3px;
}
.widefat th.sortable,
.widefat th.sorted {
padding: 0;
}
th.sortable a,
th.sorted a {
display: block;
overflow: hidden;
padding: 7px 7px 8px;
}
.fixed .column-comments.sortable a,
.fixed .column-comments.sorted a {
padding: 8px 0;
}
th.sortable a span,
th.sorted a span {
float: left;
cursor: pointer;
}
th.sorted.asc .sorting-indicator,
th.desc:hover span.sorting-indicator {
display: block;
background-position: 0 0;
}
th.sorted.desc .sorting-indicator,
th.asc:hover span.sorting-indicator {
display: block;
background-position: -7px 0;
}
/* Bulk Actions */
.tablenav-pages a {
border-bottom-style: solid;
border-bottom-width: 2px;
font-weight: bold;
margin-right: 1px;
padding: 0 2px;
}
.tablenav-pages .current-page {
text-align: center;
}
.tablenav-pages .next-page {
margin-left: 2px;
}
.tablenav a.button-secondary {
display: block;
margin: 3px 8px 0 0;
}
.tablenav {
clear: both;
height: 30px;
margin: 6px 0 4px;
vertical-align: middle;
}
.tablenav.themes {
max-width: 98%;
}
.tablenav .tablenav-pages {
float: right;
display: block;
cursor: default;
height: 30px;
line-height: 30px;
font-size: 12px;
}
.tablenav .no-pages,
.tablenav .one-page .pagination-links {
display: none;
}
.tablenav .tablenav-pages a,
.tablenav-pages span.current {
text-decoration: none;
padding: 3px 6px;
}
.tablenav .tablenav-pages a.disabled:hover ,
.tablenav .tablenav-pages a.disabled:active {
cursor: default;
}
.tablenav .displaying-num {
margin-right: 10px;
font-size: 12px;
font-style: italic;
}
.tablenav .actions {
overflow: hidden;
padding: 2px 8px 0 0;
}
.tablenav .delete {
margin-right: 20px;
}
.view-switch {
float: right;
margin: 6px 8px 0;
}
.view-switch a {
text-decoration: none;
}
.filter {
float: left;
margin: -5px 0 0 10px;
}
.filter .subsubsub {
margin-left: -10px;
margin-top: 13px;
}
.screen-per-page {
width: 4em;
}
#posts-filter fieldset {
float: left;
margin: 0 1.5ex 1em 0;
padding: 0;
}
#posts-filter fieldset legend {
padding: 0 0 .2em 1px;
}
span.post-state-format {
font-weight: normal;
}
/*------------------------------------------------------------------------------
10.1 - Inline Editing
------------------------------------------------------------------------------*/
/*
.quick-edit* is for Quick Edit
.bulk-edit* is for Bulk Edit
.inline-edit* is for everything
*/
/* Layout */
#wpbody-content .inline-edit-row fieldset {
font-size: 12px;
float: left;
margin: 0;
padding: 0;
width: 100%;
}
tr.inline-edit-row td,
#wpbody-content .inline-edit-row fieldset .inline-edit-col {
padding: 0 0.5em;
}
#wpbody-content .quick-edit-row-page fieldset.inline-edit-col-right .inline-edit-col {
border-width: 0 0 0 1px;
border-style: none none none solid;
}
#wpbody-content .quick-edit-row-post .inline-edit-col-left {
width: 40%;
}
#wpbody-content .quick-edit-row-post .inline-edit-col-right {
width: 39%;
}
#wpbody-content .inline-edit-row-post .inline-edit-col-center {
width: 20%;
}
#wpbody-content .quick-edit-row-page .inline-edit-col-left {
width: 50%;
}
#wpbody-content .quick-edit-row-page .inline-edit-col-right,
#wpbody-content .bulk-edit-row-post .inline-edit-col-right {
width: 49%;
}
#wpbody-content .bulk-edit-row .inline-edit-col-left {
width: 30%;
}
#wpbody-content .bulk-edit-row-page .inline-edit-col-right {
width: 69%;
}
#wpbody-content .bulk-edit-row .inline-edit-col-bottom {
float: right;
width: 69%;
}
#wpbody-content .inline-edit-row-page .inline-edit-col-right {
margin-top: 27px;
}
.inline-edit-row fieldset .inline-edit-group {
clear: both;
}
.inline-edit-row fieldset .inline-edit-group:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.inline-edit-row p.submit {
clear: both;
padding: 0.5em;
margin: 0.5em 0 0;
}
.inline-edit-row span.error {
line-height: 22px;
margin: 0 15px;
padding: 3px 5px;
}
/* Positioning */
.inline-edit-row h4 {
margin: .2em 0;
padding: 0;
line-height: 23px;
}
.inline-edit-row fieldset span.title,
.inline-edit-row fieldset span.checkbox-title {
margin: 0;
padding: 0;
line-height: 27px;
}
.inline-edit-row fieldset label,
.inline-edit-row fieldset span.inline-edit-categories-label {
display: block;
margin: .2em 0;
}
.inline-edit-row fieldset label.inline-edit-tags {
margin-top: 0;
}
.inline-edit-row fieldset label.inline-edit-tags span.title {
margin: .2em 0;
}
.inline-edit-row fieldset label span.title {
display: block;
float: left;
width: 5em;
}
.inline-edit-row fieldset label span.input-text-wrap {
display: block;
margin-left: 5em;
}
.quick-edit-row-post fieldset.inline-edit-col-right label span.title {
width: auto;
padding-right: 0.5em;
}
.inline-edit-row .input-text-wrap input[type=text] {
width: 100%;
}
.inline-edit-row fieldset label input[type=checkbox] {
vertical-align: text-bottom;
}
.inline-edit-row fieldset label textarea {
width: 100%;
height: 4em;
}
#wpbody-content .bulk-edit-row fieldset .inline-edit-group label {
max-width: 50%;
}
#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child {
margin-right: 0.5em
}
.inline-edit-col-right .input-text-wrap input.inline-edit-menu-order-input {
width: 6em;
}
.inline-edit-save .spinner {
padding: 4px 10px 0;
vertical-align: top;
float: right;
}
/* Styling */
.inline-edit-row h4 {
text-transform: uppercase;
}
.inline-edit-row fieldset span.title,
.inline-edit-row fieldset span.checkbox-title {
font-style: italic;
line-height: 1.8em;
}
/* Specific Elements */
.inline-edit-row fieldset input[type="text"],
.inline-edit-row fieldset textarea {
border-style: solid;
border-width: 1px;
}
.inline-edit-row fieldset .inline-edit-date {
float: left;
}
.inline-edit-row fieldset input[name=jj],
.inline-edit-row fieldset input[name=hh],
.inline-edit-row fieldset input[name=mn] {
font-size: 12px;
width: 2.1em;
}
.inline-edit-row fieldset input[name=aa] {
font-size: 12px;
width: 3.5em;
}
.inline-edit-row fieldset label input.inline-edit-password-input {
width: 8em;
}
.inline-edit-row .catshow,
.inline-edit-row .cathide {
cursor: pointer;
}
ul.cat-checklist {
height: 12em;
border-style: solid;
border-width: 1px;
overflow-y: scroll;
padding: 0 5px;
margin: 0;
}
#bulk-titles {
display: block;
height: 12em;
border-style: solid;
border-width: 1px;
overflow-y: scroll;
padding: 0 5px;
margin: 0 0 5px;
}
.inline-edit-row fieldset ul.cat-checklist li,
.inline-edit-row fieldset ul.cat-checklist input {
margin: 0;
}
.inline-edit-row fieldset ul.cat-checklist label,
.inline-edit-row .catshow,
.inline-edit-row .cathide,
.inline-edit-row #bulk-titles div {
font-family: sans-serif;
font-style: normal;
font-size: 11px;
}
table .inline-edit-row fieldset ul.cat-hover {
height: auto;
max-height: 30em;
overflow-y: auto;
position: absolute;
}
.inline-edit-row fieldset label input.inline-edit-menu-order-input {
width: 3em;
}
.inline-edit-row fieldset label input.inline-edit-slug-input {
width: 75%;
}
.quick-edit-row-post fieldset label.inline-edit-status {
float: left;
}
#bulk-titles {
line-height: 140%;
}
#bulk-titles div {
margin: 0.2em 0.3em;
}
#bulk-titles div a {
cursor: pointer;
display: block;
float: left;
height: 10px;
margin: 3px 3px 0 -2px;
overflow: hidden;
position: relative;
text-indent: -9999px;
width: 10px;
}
/*------------------------------------------------------------------------------
11.0 - Write/Edit Post Screen
------------------------------------------------------------------------------*/
#show-comments {
overflow: hidden;
}
#save-action .spinner,
#show-comments a,
#show-comments .spinner {
float: left;
}
#titlediv {
position: relative;
margin-bottom: 10px;
}
#titlediv label {
cursor: text;
}
#titlediv div.inside {
margin: 0;
}
#poststuff #titlewrap {
border: 0;
padding: 0;
}
#titlediv #title {
padding: 3px 8px;
font-size: 1.7em;
line-height: 100%;
width: 100%;
outline: none;
}
#titlediv #title-prompt-text,
#wp-fullscreen-title-prompt-text {
color: #bbb;
position: absolute;
font-size: 1.7em;
padding: 8px 10px;
}
#wp-fullscreen-save .fs-saved {
color: #999;
float: right;
margin-top: 4px;
}
#wp-fullscreen-title-prompt-text {
padding: 11px;
}
#poststuff .inside-submitbox,
#side-sortables .inside-submitbox {
margin: 0 3px;
font-size: 11px;
}
input#link_description,
input#link_url {
width: 98%;
}
#pending {
background: 0 none;
border: 0 none;
padding: 0;
font-size: 11px;
margin-top: -1px;
}
#edit-slug-box {
line-height: 23px;
min-height: 23px;
margin-top: 5px;
padding: 0 10px;
}
#edit-slug-box .cancel {
margin-right: 10px;
font-size: 11px;
}
#editable-post-name-full {
display: none;
}
#editable-post-name input {
width: 16em;
}
.postarea h3 label {
float: left;
}
.submitbox .submit {
text-align: left;
padding: 12px 10px 10px;
font-size: 11px;
}
.submitbox .submitdelete {
text-decoration: none;
padding: 1px 2px;
}
.submitbox .submitdelete,
.submitbox .submit a:hover {
border-bottom-width: 1px;
border-bottom-style: solid;
}
.submitbox .submit input {
margin-bottom: 8px;
margin-right: 4px;
padding: 6px;
}
.inside-submitbox #post_status {
margin: 2px 0 2px -2px;
}
#post-status-select, #post-format {
line-height: 2.5em;
margin-top: 3px;
}
/* Post Screen */
#post-body #normal-sortables {
min-height: 50px;
}
.postbox {
position: relative;
min-width: 255px;
}
#trackback_url {
width: 99%;
}
#normal-sortables .postbox .submit {
background: transparent none;
border: 0 none;
float: right;
padding: 0 12px;
margin:0;
}
.category-add input[type="text"],
.category-add select {
width: 100%;
max-width: 260px;
}
.press-this #side-sortables .category-tabs li,
ul.category-tabs li,
#side-sortables .add-menu-item-tabs li,
.wp-tab-bar li {
display: inline;
line-height: 1.35em;
}
.no-js .category-tabs li.hide-if-no-js {
display: none;
}
.category-tabs a,
#side-sortables .add-menu-item-tabs a,
.wp-tab-bar a {
text-decoration: none;
}
.category-tabs {
margin: 8px 0 3px;
}
#category-adder h4 {
margin: 10px 0;
}
#side-sortables .add-menu-item-tabs,
.wp-tab-bar {
margin-bottom: 3px;
}
#normal-sortables .postbox #replyrow .submit {
float: none;
margin: 0;
padding: 0 7px 5px;
}
#side-sortables .submitbox .submit input,
#side-sortables .submitbox .submit .preview,
#side-sortables .submitbox .submit a.preview:hover {
border: 0 none;
}
#side-sortables .inside-submitbox .insidebox,
.stuffbox .insidebox {
margin: 11px 0;
}
ul.category-tabs,
ul.add-menu-item-tabs,
ul.wp-tab-bar {
margin-top: 12px;
}
ul.category-tabs li {
border-style: solid;
border-width: 1px;
position: relative;
}
ul.add-menu-item-tabs li.tabs,
.wp-tab-active {
border-style: solid solid none;
border-width: 1px 1px 0;
}
#post-body .add-menu-item-tabs li.tabs {
border-style: solid none solid solid;
border-width: 1px 0 1px 1px;
margin-right: -1px;
}
ul.category-tabs li,
ul.add-menu-item-tabs li,
ul.wp-tab-bar li {
padding: 3px 5px 5px;
-webkit-border-top-left-radius: 3px;
-webkit-border-top-right-radius: 3px;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
/* positioning etc. */
form#tags-filter {
position: relative;
}
/* Edit posts */
td.post-title strong,
td.plugin-title strong {
display: block;
margin-bottom: .2em;
}
td.post-title p,
td.plugin-title p {
margin: 6px 0;
}
/* Global classes */
.wp-hidden-children .wp-hidden-child,
.ui-tabs-hide {
display: none;
}
.commentlist .avatar {
vertical-align: text-top;
}
#post-body .tagsdiv #newtag {
margin-right: 5px;
width: 16em;
}
#side-sortables input#post_password {
width: 94%
}
#side-sortables .tagsdiv #newtag {
width: 68%;
}
#post-status-info {
border-width: 0 1px 1px;
border-style: none solid solid;
width: 100%;
-webkit-border-bottom-left-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
}
#post-status-info td {
font-size: 12px;
}
.autosave-info {
padding: 2px 15px;
text-align: right;
}
#editorcontent #post-status-info {
border: none;
}
#post-body .wp_themeSkin .mceStatusbar a.mceResize {
display: block;
background: transparent url('../images/resize.gif') no-repeat scroll right bottom;
width: 12px;
cursor: se-resize;
margin: 0 1px;
position: relative;
top: -2px;
}
#post-body .postarea .wp_themeSkin .mceStatusbar a.mceResize {
top: 20px;
}
#content-resize-handle {
background: transparent url('../images/resize.gif') no-repeat scroll right bottom;
width: 12px;
cursor: se-resize;
position: absolute;
right: 2px;
height: 19px;
}
.press-this #content-resize-handle {
bottom: 2px;
}
.tmce-active #content-resize-handle {
display: none;
}
#wp-word-count {
display: block;
padding: 2px 10px;
}
#timestampdiv select {
height: 20px;
line-height: 14px;
padding: 0;
vertical-align: top;
}
#aa, #jj, #hh, #mn {
padding: 1px;
font-size: 12px;
}
#jj, #hh, #mn {
width: 2em;
}
#aa {
width: 3.4em;
}
.curtime #timestamp {
background-repeat: no-repeat;
background-position: left center;
padding: 2px 0 1px 20px;
}
#timestampdiv {
padding-top: 5px;
line-height: 23px;
}
#timestampdiv p {
margin: 8px 0 6px;
}
#timestampdiv input {
border-width: 1px;
border-style: solid;
}
/*------------------------------------------------------------------------------
11.1 - Custom Fields
------------------------------------------------------------------------------*/
#postcustomstuff thead th {
padding: 5px 8px 8px;
}
#postcustom #postcustomstuff .submit {
border: 0 none;
float: none;
padding: 0 8px 8px;
}
#side-sortables #postcustom #postcustomstuff .submit {
margin: 0;
padding: 0;
}
#side-sortables #postcustom #postcustomstuff #the-list textarea {
height: 85px;
}
#side-sortables #postcustom #postcustomstuff td.left input,
#side-sortables #postcustom #postcustomstuff td.left select,
#side-sortables #postcustomstuff #newmetaleft a {
margin: 3px 3px 0;
}
#postcustomstuff table {
margin: 0;
width: 100%;
border-width: 1px;
border-style: solid;
border-spacing: 0;
}
#postcustomstuff tr {
vertical-align: top;
}
#postcustomstuff table input,
#postcustomstuff table select,
#postcustomstuff table textarea {
width: 96%;
margin: 8px;
}
#side-sortables #postcustomstuff table input,
#side-sortables #postcustomstuff table select,
#side-sortables #postcustomstuff table textarea {
margin: 3px;
}
#postcustomstuff th.left,
#postcustomstuff td.left {
width: 38%;
}
#postcustomstuff .submit input {
margin: 0;
width: auto;
}
#postcustomstuff #newmetaleft a {
display: inline-block;
margin: 0 8px 8px;
text-decoration: none;
}
.no-js #postcustomstuff #enternew {
display: none;
}
#post-body-content .compat-attachment-fields {
margin-bottom: 20px;
}
.compat-attachment-fields th {
padding-top: 5px;
padding-right: 10px;
}
/*------------------------------------------------------------------------------
11.2 - Post Revisions
------------------------------------------------------------------------------*/
table.diff {
width: 100%;
}
table.diff col.content {
width: 50%;
}
table.diff tr {
background-color: transparent;
}
table.diff td, table.diff th {
padding: .5em;
font-family: Consolas, Monaco, monospace;
border: none;
}
table.diff .diff-deletedline del, table.diff .diff-addedline ins {
text-decoration: none;
}
/*------------------------------------------------------------------------------
11.3 - Featured Images
------------------------------------------------------------------------------*/
#select-featured-image {
padding: 4px 0;
overflow: hidden;
}
#select-featured-image img {
max-width: 100%;
height: auto;
margin-bottom: 10px;
}
#select-featured-image a {
float: left;
clear: both;
}
#select-featured-image .remove {
display: none;
margin-top: 10px;
}
.js #select-featured-image.has-featured-image .remove {
display: inline-block;
}
.no-js #select-featured-image .choose {
display: none;
}
/*------------------------------------------------------------------------------
12.0 - Categories
------------------------------------------------------------------------------*/
.category-adder {
margin-left: 120px;
padding: 4px 0;
}
.category-adder h4 {
margin: 0 0 8px;
}
#side-sortables .category-adder {
margin: 0;
}
#post-body ul.add-menu-item-tabs {
float: left;
width: 120px;
text-align: right;
/* Negative margin for the sake of those without JS: all tabs display */
margin: 0 -120px 0 5px;
padding: 0;
}
#post-body ul.add-menu-item-tabs li {
padding: 8px;
}
#post-body ul.add-menu-item-tabs li.tabs {
-webkit-border-top-left-radius: 3px;
-webkit-border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
}
.wp-tab-panel,
.categorydiv div.tabs-panel,
.customlinkdiv div.tabs-panel,
.posttypediv div.tabs-panel,
.taxonomydiv div.tabs-panel {
min-height: 42px;
max-height: 200px;
overflow: auto;
padding: 0 0.9em;
border-style: solid;
border-width: 1px;
}
div.tabs-panel-active {
display:block;
}
div.tabs-panel-inactive {
display:none;
}
.customlinkdiv ul,
.posttypediv ul,
.taxonomydiv ul {
list-style: none;
padding: 0;
margin: 0;
}
#front-page-warning,
#front-static-pages ul,
ul.export-filters,
.inline-editor ul.cat-checklist ul,
.categorydiv ul.categorychecklist ul,
.customlinkdiv ul.categorychecklist ul,
.posttypediv ul.categorychecklist ul,
.taxonomydiv ul.categorychecklist ul {
margin-left: 18px;
}
ul.categorychecklist li {
margin: 0;
padding: 0;
line-height: 19px;
word-wrap: break-word;
}
.categorydiv .tabs-panel,
.customlinkdiv .tabs-panel,
.posttypediv .tabs-panel,
.taxonomydiv .tabs-panel {
border-width: 3px;
border-style: solid;
}
.form-wrap p,
.form-wrap label {
font-size: 11px;
}
.form-wrap label {
display: block;
padding: 2px;
font-size: 12px;
}
.form-field input,
.form-field textarea {
border-style: solid;
border-width: 1px;
width: 95%;
}
p.description,
.form-wrap p {
margin: 2px 0 5px;
}
p.help,
p.description,
span.description,
.form-wrap p {
font-size: 12px;
font-style: italic;
font-family: sans-serif;
}
.form-wrap .form-field {
margin: 0 0 10px;
padding: 8px 0;
}
.col-wrap h3 {
margin: 12px 0;
font-size: 1.1em;
}
.col-wrap p.submit {
margin-top: -10px;
}
/*------------------------------------------------------------------------------
13.0 - Tags
------------------------------------------------------------------------------*/
#poststuff .taghint {
color: #aaa;
margin: 15px 0 -24px 12px;
}
#poststuff .tagsdiv .howto {
margin: 0 0 6px 8px;
}
.ajaxtag .newtag {
position: relative;
}
.tagsdiv .newtag {
width: 180px;
}
.tagsdiv .the-tags {
display: block;
height: 60px;
margin: 0 auto;
overflow: auto;
width: 260px;
}
#post-body-content .tagsdiv .the-tags {
margin: 0 5px;
}
p.popular-tags {
-webkit-border-radius: 8px;
border-radius: 8px;
border-width: 1px;
border-style: solid;
line-height: 2em;
max-width: 1000px;
padding: 8px 12px 12px;
text-align: justify;
}
p.popular-tags a {
padding: 0 3px;
}
.tagcloud {
width: 97%;
margin: 0 0 40px;
text-align: justify;
}
.tagcloud h3 {
margin: 2px 0 12px;
}
.ac_results {
padding: 0;
margin: 0;
list-style: none;
position: absolute;
z-index: 10000;
display: none;
border-width: 1px;
border-style: solid;
}
.ac_results li {
padding: 2px 5px;
white-space: nowrap;
text-align: left;
}
.ac_over {
cursor: pointer;
}
.ac_match {
text-decoration: underline;
}
/* links tables */
table.links-table {
width: 100%;
}
.links-table th {
font-weight: normal;
text-align: left;
vertical-align: top;
min-width: 80px;
width: 20%;
word-wrap: break-word;
}
.links-table th,
.links-table td {
padding: 5px 0;
}
.links-table td label {
margin-right: 8px;
}
.links-table td input[type="text"],
.links-table td textarea {
width: 100%;
}
.links-table #link_rel {
max-width: 280px;
}
/*------------------------------------------------------------------------------
14.0 - Media Screen
------------------------------------------------------------------------------*/
.media-item .describe {
border-collapse: collapse;
width: 100%;
border-top-style: solid;
border-top-width: 1px;
clear: both;
cursor: default;
}
.media-item.media-blank .describe {
border: 0;
}
.media-item .describe th {
vertical-align: top;
text-align: left;
padding: 5px 10px 10px;
width: 140px;
}
.media-item .describe .align th {
padding-top: 0;
}
.media-item .media-item-info tr {
background-color: transparent;
}
.media-item .describe td {
padding: 0 8px 8px 0;
vertical-align: top;
}
.media-item thead.media-item-info td {
padding: 4px 10px 0;
}
.media-item .media-item-info .A1B1 {
padding: 0 0 0 10px;
}
.media-item td.savesend {
padding-bottom: 15px;
}
.media-item .thumbnail {
max-height: 128px;
max-width: 128px;
}
#wpbody-content #async-upload-wrap a {
display: none;
}
.media-upload-form {
margin-top: 20px;
}
.media-upload-form td label {
margin-right: 6px;
margin-left: 2px;
}
.media-upload-form .align .field label {
display: inline;
padding: 0 0 0 23px;
margin: 0 1em 0 3px;
font-weight: bold;
}
.media-upload-form tr.image-size label {
margin: 0 0 0 5px;
font-weight: bold;
}
.media-upload-form th.label label {
font-weight: bold;
margin: 0.5em;
font-size: 13px;
}
.media-upload-form th.label label span {
padding: 0 5px;
}
abbr.required {
border: medium none;
text-decoration: none;
}
.media-item .describe input[type="text"],
.media-item .describe textarea {
width: 460px;
}
.media-item .describe p.help {
margin: 0;
padding: 0 0 0 5px;
}
.media-item .edit-attachment,
.describe-toggle-on,
.describe-toggle-off {
display: block;
line-height: 36px;
float: right;
margin-right: 15px;
}
.media-item .describe-toggle-off,
.media-item.open .describe-toggle-on {
display: none;
}
.media-item.open .describe-toggle-off {
display: block;
}
#media-items .media-item {
border-style: solid;
border-width: 1px;
min-height: 36px;
position: relative;
margin-top: -1px;
width: 100%;
}
#media-items {
width: 623px;
}
.media-new-php #media-items {
margin: 1em 0;
}
#media-items:empty {
border: 0 none;
}
.media-item .filename {
line-height: 36px;
overflow: hidden;
padding: 0 10px;
}
.media-item .error-div {
padding-left: 10px;
}
.media-item .pinkynail {
float: left;
margin: 2px 2px 0;
max-width: 40px;
max-height: 32px;
}
.media-item .startopen,
.media-item .startclosed {
display: none;
}
.media-item .original {
position: relative;
height: 34px;
}
.media-item .progress {
float: right;
height: 22px;
margin: 6px 10px 0 0;
width: 200px;
line-height: 2em;
padding: 0;
overflow: hidden;
margin-bottom: 2px;
border: 1px solid #d1d1d1;
background: #f7f7f7;
background-image: -webkit-gradient(linear, left bottom, left top, from(#fff), to(#f7f7f7));
background-image: -webkit-linear-gradient(bottom, #fff, #f7f7f7);
background-image: -moz-linear-gradient(bottom, #fff, #f7f7f7);
background-image: -o-linear-gradient(bottom, #fff, #f7f7f7);
background-image: linear-gradient(to top, #fff, #f7f7f7);
-webkit-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: inset 0 0 3px rgba(0,0,0,0.1);
box-shadow: inset 0 0 3px rgba(0,0,0,0.1);
}
.media-item .bar {
z-index: 9;
width: 0;
height: 100%;
margin-top: -24px;
background-color: #8cc1e9;
background-image: -webkit-gradient(linear, left bottom, left top, from(#72a7cf), to(#8cc1e9));
background-image: -webkit-linear-gradient(bottom, #72a7cf, #8cc1e9);
background-image: -moz-linear-gradient(bottom, #72a7cf, #8cc1e9);
background-image: -o-linear-gradient(bottom, #72a7cf, #8cc1e9);
background-image: linear-gradient(to top, #72a7cf, #8cc1e9);
-webkit-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0 0 3px rgba(0,0,0,0.3);
box-shadow: 0 0 3px rgba(0,0,0,0.3);
}
.media-item .progress .percent {
z-index: 10;
position: relative;
width: 200px;
padding: 0 8px;
text-shadow: 0 1px 0 rgba(255,255,255,0.4);
color: rgba(0,0,0,0.6);
}
.upload-php .fixed .column-parent {
width: 15%;
}
.js .html-uploader #plupload-upload-ui {
display: none;
}
.js .html-uploader #html-upload-ui {
display: block;
}
.media-upload-form .media-item.error {
margin: 0;
padding: 0;
}
.media-upload-form .media-item.error p,
.media-item .error-div {
line-height: 16px;
margin: 5px 10px;
padding: 0;
}
.media-item .error-div a.dismiss {
display: block;
float: right;
margin: 5px 4px 0 15px;
}
/*------------------------------------------------------------------------------
14.1 - Media Library
------------------------------------------------------------------------------*/
.find-box {
width: 600px;
height: 300px;
overflow: hidden;
padding: 33px 0 51px;
position: absolute;
z-index: 1000;
}
.find-box-head {
cursor: move;
font-weight: bold;
height: 2em;
line-height: 2em;
padding: 1px 12px;
position: absolute;
top: 5px;
width: 100%;
}
.find-box-inside {
overflow: auto;
padding: 6px;
height: 100%;
}
.find-box-search {
overflow: hidden;
padding: 9px;
position: relative;
}
.find-box-search .spinner {
float: none;
left: 125px;
position: absolute;
top: 9px;
}
#find-posts-input {
float: left;
width: 140px;
height: 24px;
}
#find-posts-search {
float: left;
margin: 1px 4px 0 3px;
}
#find-posts-response {
margin: 8px 0;
padding: 0 1px 6px;
}
#find-posts-response table {
width: 100%;
}
#find-posts-response .found-radio {
padding: 3px 0 0 8px;
width: 15px;
}
.find-box-buttons {
padding: 8px;
overflow: hidden;
}
.find-box #resize-se {
position: absolute;
right: 1px;
bottom: 1px;
}
.ui-find-overlay {
position: absolute;
top: 0;
left: 0;
background-color: #000;
opacity: 0.6;
filter: alpha(opacity=60);
}
ul#dismissed-updates {
display: none;
}
form.upgrade {
margin-top: 8px;
}
form.upgrade .hint {
font-style: italic;
font-size: 85%;
margin: -0.5em 0 2em 0;
}
#poststuff .inside .the-tagcloud {
margin: 5px 0 10px;
padding: 8px;
border-width: 1px;
border-style: solid;
line-height: 1.8em;
word-spacing: 3px;
-webkit-border-radius: 6px;
border-radius: 6px;
}
.drag-drop #drag-drop-area {
border: 4px dashed #DDDDDD;
height: 200px;
}
.drag-drop .drag-drop-inside {
margin: 70px auto 0;
width: 250px;
}
.drag-drop-inside p {
color: #aaa;
font-size: 14px;
margin: 5px 0;
display: none;
}
.drag-drop .drag-drop-inside p {
text-align: center;
}
.drag-drop-inside p.drag-drop-info {
font-size: 20px;
}
.drag-drop .drag-drop-inside p,
.drag-drop-inside p.drag-drop-buttons {
display: block;
}
/*
#drag-drop-area:-moz-drag-over {
border-color: #83b4d8;
}
borger color while dragging a file over the uploader drop area */
.drag-drop.drag-over #drag-drop-area {
border-color: #83b4d8;
}
#plupload-upload-ui {
position: relative;
}
/*------------------------------------------------------------------------------
14.2 - Image Editor
------------------------------------------------------------------------------*/
.describe .image-editor {
vertical-align: top;
}
.imgedit-wrap {
position: relative;
}
.imgedit-settings p {
margin: 8px 0;
}
.post-php .imgedit-wrap table {
width: 100%;
}
.describe .imgedit-wrap table td,
.wp_attachment_holder .imgedit-wrap table td {
vertical-align: top;
padding-top: 0;
}
.describe .imgedit-wrap table td.imgedit-settings {
padding: 0 5px;
}
.wp_attachment_holder .imgedit-wrap table td.imgedit-settings {
width: 250px;
}
td.imgedit-settings input {
margin-top: 0;
vertical-align: middle;
}
.imgedit-wait {
position: absolute;
top: 0;
background: #fff url(../images/wpspin_light.gif) no-repeat scroll 22px 10px;
background-size: 16px 16px;
opacity: 0.7;
filter: alpha(opacity=70);
width: 100%;
height: 500px;
display: none;
}
.spinner {
background: url(../images/wpspin_light.gif) no-repeat;
background-size: 16px 16px;
display: none;
float: right;
opacity: 0.7;
filter: alpha(opacity=70);
width: 16px;
height: 16px;
margin: 5px 5px 0;
}
.no-float {
float: none;
}
.media-disabled,
.imgedit-settings .disabled {
color: grey;
}
.wp_attachment_image,
.A1B1 {
overflow: hidden;
}
.wp_attachment_image .button,
.A1B1 .button {
float: left;
}
.no-js .wp_attachment_image .button {
display: none;
}
.wp_attachment_image .spinner,
.A1B1 .spinner {
float: left;
padding: 0 4px 4px;
vertical-align: bottom;
}
.imgedit-menu {
margin: 0 0 12px;
min-width: 300px;
}
.imgedit-menu div {
float: left;
width: 32px;
height: 32px;
}
.imgedit-crop-wrap {
position: relative;
}
.imgedit-crop {
background: transparent url('../images/imgedit-icons.png') no-repeat scroll -9px -31px;
margin: 0 8px 0 0;
}
.imgedit-crop.disabled:hover {
background-position: -9px -31px;
}
.imgedit-crop:hover {
background-position: -9px -1px;
}
.imgedit-rleft {
background: transparent url('../images/imgedit-icons.png') no-repeat scroll -46px -31px;
margin: 0 3px;
}
.imgedit-rleft.disabled:hover {
background-position: -46px -31px;
}
.imgedit-rleft:hover {
background-position: -46px -1px;
}
.imgedit-rright {
background: transparent url('../images/imgedit-icons.png') no-repeat scroll -77px -31px;
margin: 0 8px 0 3px;
}
.imgedit-rright.disabled:hover {
background-position: -77px -31px;
}
.imgedit-rright:hover {
background-position: -77px -1px;
}
.imgedit-flipv {
background: transparent url('../images/imgedit-icons.png') no-repeat scroll -115px -31px;
margin: 0 3px;
}
.imgedit-flipv.disabled:hover {
background-position: -115px -31px;
}
.imgedit-flipv:hover {
background-position: -115px -1px;
}
.imgedit-fliph {
background: transparent url('../images/imgedit-icons.png') no-repeat scroll -147px -31px;
margin: 0 8px 0 3px;
}
.imgedit-fliph.disabled:hover {
background-position: -147px -31px;
}
.imgedit-fliph:hover {
background-position: -147px -1px;
}
.imgedit-undo {
background: transparent url('../images/imgedit-icons.png') no-repeat scroll -184px -31px;
margin: 0 3px;
}
.imgedit-undo.disabled:hover {
background-position: -184px -31px;
}
.imgedit-undo:hover {
background-position: -184px -1px;
}
.imgedit-redo {
background: transparent url('../images/imgedit-icons.png') no-repeat scroll -215px -31px;
margin: 0 8px 0 3px;
}
.imgedit-redo.disabled:hover {
background-position: -215px -31px;
}
.imgedit-redo:hover {
background-position: -215px -1px;
}
.imgedit-applyto img {
margin: 0 8px 0 0;
}
.imgedit-group-top {
margin: 5px 0;
}
.imgedit-applyto .imgedit-label {
padding: 2px 0 0;
display: block;
}
.imgedit-help {
display: none;
font-style: italic;
margin-bottom: 8px;
}
a.imgedit-help-toggle {
text-decoration: none;
}
.form-table td.imgedit-response {
padding: 0;
}
.imgedit-submit {
margin: 8px 0;
}
.imgedit-submit-btn {
margin-left: 20px;
}
.imgedit-wrap .nowrap {
white-space: nowrap;
}
span.imgedit-scale-warn {
color: red;
font-size: 20px;
font-style: normal;
visibility: hidden;
vertical-align: middle;
}
.imgedit-group {
border-width: 1px;
border-style: solid;
-webkit-border-radius: 3px;
border-radius: 3px;
margin-bottom: 8px;
padding: 2px 10px;
}
.wp_attachment_details {
margin-bottom: 20px;
}
/*------------------------------------------------------------------------------
15.0 - Comments Screen
------------------------------------------------------------------------------*/
.form-table {
border-collapse: collapse;
margin-top: 0.5em;
width: 100%;
margin-bottom: -8px;
clear: both;
}
.form-table td {
margin-bottom: 9px;
padding: 8px 10px;
line-height: 20px;
font-size: 12px;
}
.form-table th,
.form-wrap label {
font-weight: normal;
text-shadow: #fff 0 1px 0;
}
.form-table th {
vertical-align: top;
text-align: left;
padding: 10px;
width: 200px;
}
.form-table th.th-full {
width: auto;
}
.form-table div.color-option {
display: block;
clear: both;
margin-top: 12px;
}
.form-table input.tog {
margin-top: 2px;
margin-right: 2px;
float: left;
}
.form-table td p {
margin-top: 4px;
}
.form-table table.color-palette {
vertical-align: bottom;
float: left;
margin: -12px 3px 11px;
}
.form-table .color-palette td {
border-width: 1px 1px 0;
border-style: solid solid none;
height: 10px;
line-height: 20px;
width: 10px;
}
.commentlist li {
padding: 1em 1em .2em;
margin: 0;
border-bottom-width: 1px;
border-bottom-style: solid;
}
.commentlist li li {
border-bottom: 0;
padding: 0;
}
.commentlist p {
padding: 0;
margin: 0 0 .8em;
}
/* reply to comments */
#replyrow input {
border-width: 1px;
border-style: solid;
}
#replyrow td {
padding: 2px;
}
#replysubmit {
margin: 0;
padding: 0 5px 3px;
text-align: center;
}
#replysubmit .spinner {
padding: 2px 0 0;
vertical-align: top;
float: right;
}
#replysubmit .button {
margin-right: 5px;
}
#replysubmit .error {
color: red;
line-height: 21px;
text-align: center;
}
#replyrow h5 {
margin: .2em 0 0;
padding: 0 5px;
line-height: 1.4em;
font-size: 1em;
}
#edithead .inside {
float: left;
padding: 3px 0 2px 5px;
margin: 0;
text-align: center;
}
#edithead .inside input {
width: 180px;
}
#edithead label {
padding: 2px 0;
}
#replycontainer {
padding: 5px;
}
#replycontent {
height: 120px;
-webkit-box-shadow: none;
box-shadow: none;
}
.comment-php .wp-editor-area {
height: 200px;
}
.comment-ays {
margin-bottom: 0;
border-style: solid;
border-width: 1px;
}
.comment-ays th {
border-right-style: solid;
border-right-width: 1px;
}
.trash-undo-inside,
.spam-undo-inside {
margin: 1px 8px 1px 0;
line-height: 16px;
}
.spam-undo-inside .avatar,
.trash-undo-inside .avatar {
height: 20px;
width: 20px;
margin-right: 8px;
vertical-align: middle;
}
.stuffbox .editcomment {
clear: none;
}
#comment-status-radio p {
margin: 3px 0 5px;
}
#comment-status-radio input {
margin: 2px 3px 5px 0;
vertical-align: middle;
}
#comment-status-radio label {
padding: 5px 0;
}
.commentlist .avatar {
vertical-align: text-top;
}
/*------------------------------------------------------------------------------
16.0 - Themes
------------------------------------------------------------------------------*/
.theme-install-php .tablenav {
height: auto;
}
.theme-install-php .spinner {
margin-top: 9px;
}
h3.available-themes {
margin: 0 0 1em;
float: left;
}
.available-theme {
display: inline-block;
margin-right: 10px;
overflow: hidden;
padding: 20px 20px 20px 0;
vertical-align: top;
width: 300px;
}
.available-theme .screenshot {
width: 300px;
height: 225px;
display: block;
border-width: 1px;
border-style: solid;
margin-bottom: 10px;
overflow: hidden;
}
.available-theme img {
width: 300px;
}
.available-theme h3 {
margin: 15px 0 0;
}
.available-theme .theme-author {
line-height: 18px;
}
.available-theme .action-links {
margin-top: 10px;
overflow: hidden;
}
.available-theme a.screenshot:focus {
border-color: #777;
}
#current-theme .theme-info li,
.theme-options li,
.available-theme .action-links li {
float: left;
padding-right: 10px;
margin-right: 10px;
border-right: 1px solid #dfdfdf;
}
.available-theme .action-links li {
padding-right: 8px;
margin-right: 8px;
}
.ie8 .available-theme .action-links li {
padding-right: 7px;
margin-right: 7px;
}
#current-theme .theme-info li:last-child,
.theme-options li:last-child,
.available-theme .action-links li:last-child {
padding-right: 0;
margin-right: 0;
border-right: 0;
}
.available-theme .action-links .delete-theme {
float: right;
margin-left: 8px;
margin-right: 0;
}
.available-theme .action-links .delete-theme a {
color: red;
padding: 2px;
}
.available-theme .action-links .delete-theme a:hover {
background: red;
color: #fff;
text-decoration: none;
}
.available-theme .action-links p {
float: left;
}
#current-theme {
margin: 20px 0 10px;
padding: 0 0 20px;
border-bottom-width: 1px;
border-bottom-style: solid;
overflow: hidden;
}
#current-theme.has-screenshot {
padding-left: 330px;
}
#current-theme h3 {
margin: 0;
font-size: 12px;
font-weight: normal;
color: #999;
}
#current-theme h4 {
margin: 3px 0 16px;
font-size: 20px;
}
#current-theme h4 span {
margin-left: 20px;
font-size: 12px;
font-weight: normal;
}
#current-theme a {
border-bottom: none;
}
#current-theme .theme-info {
margin: 1em 0;
overflow: hidden;
}
#current-theme .theme-description {
margin-top: 5px;
max-width: 600px;
line-height: 1.6em;
}
#current-theme img {
float: left;
width: 300px;
margin-left: -330px;
border-width: 1px;
border-style: solid;
}
.theme-options {
overflow: hidden;
font-size: 14px;
padding-bottom: 10px;
}
.theme-options .load-customize {
margin-right: 30px;
float: left;
}
.theme-options span {
float: left;
margin-right: 10px;
text-transform: uppercase;
font-size: 11px;
line-height: 18px;
color: #999;
}
.theme-options ul {
float: left;
margin: 0;
}
/* Allow for three-up on 1024px wide screens, e.g. tablets */
@media only screen and (max-width: 1200px) {
.available-theme,
.available-theme .screenshot,
#current-theme img {
width: 240px;
}
.available-theme .screenshot {
height: 180px;
}
.available-theme img {
width: 100%;
}
#current-theme.has-screenshot {
padding-left: 270px;
}
#current-theme img {
margin-left: -270px;
}
}
#post-body ul.add-menu-item-tabs li.tabs a,
#TB_window #TB_title a.tb-theme-preview-link,
#TB_window #TB_title a.tb-theme-preview-link:visited {
font-weight: bold;
text-decoration: none;
}
#TB_window #TB_title {
background-color: #222;
color: #cfcfcf;
}
#broken-themes {
text-align: left;
width: 50%;
border-spacing: 3px;
padding: 3px;
}
.theme-install-php h4 {
margin: 2.5em 0 8px;
}
/*------------------------------------------------------------------------------
16.1 - Custom Header Screen
------------------------------------------------------------------------------*/
.appearance_page_custom-header #headimg {
border: 1px solid #DFDFDF;
overflow: hidden;
width: 100%;
}
.appearance_page_custom-header #upload-form p label {
font-size: 12px;
}
.appearance_page_custom-header .available-headers .default-header {
float: left;
margin: 0 20px 20px 0;
}
.appearance_page_custom-header .random-header {
clear: both;
margin: 0 20px 20px 0;
vertical-align: middle;
}
.appearance_page_custom-header .available-headers label input,
.appearance_page_custom-header .random-header label input {
margin-right: 10px;
}
.appearance_page_custom-header .available-headers label img {
vertical-align: middle;
}
/*------------------------------------------------------------------------------
16.2 - Custom Background Screen
------------------------------------------------------------------------------*/
div#custom-background-image {
min-height: 100px;
border: 1px solid #dfdfdf;
}
div#custom-background-image img {
max-width: 400px;
max-height: 300px;
}
/*------------------------------------------------------------------------------
16.3 - Tabbed Admin Screen Interface (Experimental)
------------------------------------------------------------------------------*/
.nav-tab {
border-style: solid;
border-width: 1px 1px 0;
color: #aaa;
text-shadow: #fff 0 1px 0;
font-size: 12px;
line-height: 16px;
display: inline-block;
padding: 4px 14px 6px;
text-decoration: none;
margin: 0 6px -1px 0;
-webkit-border-top-left-radius: 3px;
-webkit-border-top-right-radius: 3px;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
.nav-tab-active {
border-width: 1px;
color: #464646;
}
h2.nav-tab-wrapper, h3.nav-tab-wrapper {
border-bottom-width: 1px;
border-bottom-style: solid;
padding-bottom: 0;
}
h2 .nav-tab {
padding: 4px 10px 6px;
font-weight: 200;
font-size: 20px;
line-height: 24px;
}
/*------------------------------------------------------------------------------
17.0 - Plugins
------------------------------------------------------------------------------*/
#dashboard_right_now .versions .b,
#post-status-display,
#post-visibility-display,
#adminmenu .wp-submenu li.current,
#adminmenu .wp-submenu li.current a,
#adminmenu .wp-submenu li.current a:hover,
.media-item .percent,
.plugins .name,
#pass-strength-result.strong,
#pass-strength-result.short,
#ed_reply_toolbar #ed_reply_strong,
.item-controls .item-order a,
.feature-filter .feature-name {
font-weight: bold;
}
.plugins p {
margin: 0 4px;
padding: 0;
}
.plugins .desc p {
margin: 0 0 8px;
}
.plugins td.desc {
line-height: 1.5em;
}
.plugins .desc ul,
.plugins .desc ol {
margin: 0 0 0 2em;
}
.plugins .desc ul {
list-style-type: disc;
}
.plugins .row-actions-visible {
padding: 0;
}
.plugins tbody th.check-column {
padding: 7px 0;
}
.plugins .inactive td,
.plugins .inactive th,
.plugins .active td,
.plugins .active th {
border-top-style: solid;
border-top-width: 1px;
padding: 5px 7px 0;
}
.plugins .update th,
.plugins .update td {
border-bottom: 0;
}
.plugin-update-tr td {
border-top: 0;
}
#wpbody-content .plugins .plugin-title,
#wpbody-content .plugins .theme-title {
padding-right: 12px;
white-space:nowrap;
}
.plugins .second,
.plugins .row-actions-visible {
padding: 0 0 5px;
}
.plugins .update .second,
.plugins .update .row-actions-visible {
padding-bottom: 0;
}
.plugins-php .widefat tfoot th,
.plugins-php .widefat tfoot td {
border-top-style: solid;
border-top-width: 1px;
}
.plugin-update-tr .update-message {
margin: 5px;
padding: 3px 5px;
}
.plugin-install-php h4 {
margin: 2.5em 0 8px;
}
/*------------------------------------------------------------------------------
18.0 - Users
------------------------------------------------------------------------------*/
#profile-page .form-table textarea {
width: 500px;
margin-bottom: 6px;
}
#profile-page .form-table #rich_editing {
margin-right: 5px
}
#your-profile legend {
font-size: 22px;
}
#your-profile #rich_editing {
border: none;
}
#display_name {
width: 15em;
}
#createuser .form-field input {
width: 25em;
}
/*------------------------------------------------------------------------------
19.0 - Tools
------------------------------------------------------------------------------*/
.pressthis {
margin: 20px 0;
}
.pressthis a,
.pressthis a:hover,
.pressthis a:focus,
.pressthis a:active {
display: inline-block;
position: relative;
cursor: move;
color: #333;
background: #e6e6e6;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(7%, #e6e6e6), color-stop(77%, #d8d8d8));
background-image: -webkit-linear-gradient(bottom, #e6e6e6 7%, #d8d8d8 77%);
background-image: -moz-linear-gradient(bottom, #e6e6e6 7%, #d8d8d8 77%);
background-image: -o-linear-gradient(bottom, #e6e6e6 7%, #d8d8d8 77%);
background-image: linear-gradient(to top, #e6e6e6 7%, #d8d8d8 77%);
-webkit-border-radius: 5px;
border-radius: 5px;
border: 1px solid #b4b4b4;
font-style: normal;
line-height: 16px;
font-size: 14px;
text-decoration: none;
text-shadow: 0 1px 0px #fff;
}
.pressthis a:active {
outline: none;
}
.pressthis a:hover:after {
-webkit-transform: skew(20deg) rotate(9deg);
-moz-transform: skew(20deg) rotate(9deg);
transform: skew(20deg) rotate(9deg);
-webkit-box-shadow: 0 10px 8px rgba(0, 0, 0, 0.7);
box-shadow: 0 10px 8px rgba(0, 0, 0, 0.7);
}
.pressthis a span {
background: url(../images/press-this.png?v=20120502) no-repeat 0px 5px;
background-size: 24px 20px;
padding: 8px 11px 8px 27px;
margin: 0 5px;
display: inline-block;
}
.pressthis a:after {
content: '';
width: 70%;
height: 55%;
z-index: -1;
position: absolute;
right: 10px;
bottom: 9px;
background: transparent;
-webkit-transform: skew(20deg) rotate(6deg);
-moz-transform: skew(20deg) rotate(6deg);
transform: skew(20deg) rotate(6deg);
-webkit-box-shadow: 0 10px 8px rgba(0, 0, 0, 0.6);
box-shadow: 0 10px 8px rgba(0, 0, 0, 0.6);
}
/*------------------------------------------------------------------------------
20.0 - Settings
------------------------------------------------------------------------------*/
#utc-time, #local-time {
padding-left: 25px;
font-style: italic;
font-family: sans-serif;
}
.defaultavatarpicker .avatar {
margin: 2px 0;
vertical-align: middle;
}
.options-general-php .spinner {
float: none;
margin: -3px 3px;
}
/*------------------------------------------------------------------------------
21.0 - Admin Footer
------------------------------------------------------------------------------*/
#wpfooter {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 10px 0;
margin-right: 20px;
border-top-width: 1px;
border-top-style: solid;
}
#wpfooter p {
margin: 0;
line-height: 20px;
}
#wpfooter a {
text-decoration: none;
}
#wpfooter a:hover {
text-decoration: underline;
}
/*------------------------------------------------------------------------------
22.0 - About Pages
------------------------------------------------------------------------------*/
.about-wrap {
position: relative;
margin: 25px 40px 0 20px;
max-width: 1050px; /* readability */
font-size: 15px;
}
.about-wrap div.updated,
.about-wrap div.error {
display: none !important;
}
/* Typography */
.about-wrap p {
line-height: 1.6em;
}
.about-wrap h1 {
margin: 0.2em 200px 0 0;
line-height: 1.2em;
font-size: 2.8em;
font-weight: 200;
}
.about-text,
.about-description,
.about-wrap li.wp-person a.web {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
font-weight: normal;
line-height: 1.6em;
font-size: 20px;
}
.about-description {
margin-top: 1.4em;
}
.about-text {
margin: 1em 200px 1.4em 0;
min-height: 60px;
font-size: 24px;
}
.about-wrap h3 {
font-size: 24px;
margin-bottom: 1em;
padding-top: 20px;
}
.about-wrap .feature-section {
padding-bottom: 20px;
}
.about-wrap .feature-section h4 {
margin-bottom: 0.6em;
}
.about-wrap .feature-section p {
margin-top: 0.6em;
}
.about-wrap code {
font-size: 14px;
}
/* Point Releases */
.about-wrap .point-releases {
margin-top: 5px;
}
.about-wrap .changelog.point-releases h3 {
padding-top: 35px;
}
.about-wrap .changelog.point-releases h3:first-child {
padding-top: 7px;
}
/* WordPress Version Badge */
.wp-badge {
padding-top: 142px;
height: 50px;
width: 173px;
font-weight: bold;
font-size: 14px;
text-align: center;
margin: 0 -5px;
background: url('../images/wp-badge.png?ver=20111120') no-repeat;
}
.about-wrap .wp-badge {
position: absolute;
top: 0;
right: 0;
}
/* Tabs */
.about-wrap h2.nav-tab-wrapper {
padding-left: 6px;
}
.about-wrap h2 .nav-tab {
padding: 4px 10px 6px;
margin: 0 3px -1px 0;
font-size: 18px;
vertical-align: top;
}
.about-wrap h2 .nav-tab-active {
font-weight: bold;
padding-top: 3px;
}
/* Changelog / Update screen */
.about-wrap .feature-section img {
border: none;
margin: 0 1.94% 10px 0;
-webkit-border-radius: 3px;
border-radius: 3px;
}
.about-wrap .feature-section.three-col img {
margin: 0.5em 0 0.5em 5px;
max-width: 100%;
float: none;
}
.ie8 .about-wrap .feature-section.three-col img {
margin-left: 0;
}
.about-wrap .feature-section.images-stagger-right img {
float: right;
margin: 0 5px 12px 2em;
}
.about-wrap .feature-section.images-stagger-left img {
float: left;
margin: 0 2em 12px 5px;
}
.about-wrap .feature-section img.image-100 {
margin: 0 0 2em 0;
width: 100%;
}
.about-wrap .feature-section img.image-66 {
width: 65%;
}
.about-wrap .feature-section img.image-50 {
max-width: 50%;
}
.about-wrap .feature-section img.image-30 {
max-width: 31.2381%;
}
.ie8 .about-wrap .feature-section img {
border-width: 1px;
border-style: solid;
}
.about-wrap .images-stagger-right img.image-30:nth-child(2) {
margin-left: 1em;
}
.about-wrap .feature-section.col {
margin-bottom: 0;
}
.about-wrap .feature-section.col h4 {
margin: 0 0 0.6em 0;
}
.about-wrap .feature-section.col .last-feature {
margin-right: 0;
}
.about-wrap .feature-section.two-col div {
width: 47%;
margin-right: 4.999999999%;
float: left;
}
.about-wrap .feature-section.three-col div {
width: 30%;
margin-right: 4.999999999%;
float: left;
}
.about-wrap .three-col-images {
text-align: center;
}
.about-wrap .three-col-images img {
margin: 0 0 10px;
}
.about-wrap .three-col-images .last-feature {
float: right;
}
.about-wrap .three-col-images .first-feature {
float: left;
}
.about-wrap .changelog .feature-section {
overflow: hidden;
padding-bottom: 0;
}
.about-wrap .changelog li {
list-style-type: disc;
margin-left: 3em;
}
@media only screen and (max-width: 900px) {
.about-wrap .feature-section.images-stagger-left img,
.about-wrap .feature-section.images-stagger-right img {
clear: both;
}
}
@media only screen and (max-width: 768px) {
.about-wrap .feature-section img.image-66 {
float: none;
width: 98%;
max-width: 98%;
}
.about-wrap .feature-section.images-stagger-right img.image-66 {
margin-left: 3px;
}
.about-wrap .feature-section.images-stagger-left img.image-66 {
margin-right: 3px;
}
}
/* Return to Dashboard Home link */
.about-wrap .return-to-dashboard {
margin: 30px 0 0 -5px;
font-size: 14px;
font-weight: bold;
}
.about-wrap .return-to-dashboard a {
text-decoration: none;
padding: 0 5px;
}
/* Credits */
.about-wrap h4.wp-people-group {
margin-top: 2.6em;
font-size: 16px;
}
.about-wrap ul.wp-people-group {
overflow: hidden;
padding: 5px;
margin: 0 -15px 0 -5px;
}
.about-wrap ul.compact {
margin-bottom: 0
}
.about-wrap li.wp-person {
float: left;
margin-right: 10px;
}
.about-wrap li.wp-person img.gravatar {
float: left;
margin: 0 10px 10px 0;
padding: 2px;
width: 60px;
height: 60px;
}
.about-wrap ul.compact li.wp-person img.gravatar {
width: 30px;
height: 30px;
}
.about-wrap li.wp-person {
height: 70px;
width: 280px;
padding-bottom: 15px;
}
.about-wrap ul.compact li.wp-person {
height: auto;
width: 180px;
padding-bottom: 0;
margin-bottom: 0;
}
.about-wrap #wp-people-group-validators + p.wp-credits-list {
margin-top: 0;
}
.about-wrap li.wp-person a.web {
display: block;
margin: 6px 0 2px;
font-size: 16px;
text-decoration: none;
}
.about-wrap p.wp-credits-list a {
white-space: nowrap;
}
/* Freedoms */
.freedoms-php .about-wrap ol {
margin: 40px 60px;
}
.freedoms-php .about-wrap ol li {
list-style-type: decimal;
font-weight: bold;
}
.freedoms-php .about-wrap ol p {
font-weight: normal;
margin: 0.6em 0;
}
/*------------------------------------------------------------------------------
23.0 - Full Overlay w/ Sidebar
------------------------------------------------------------------------------*/
body.full-overlay-active {
overflow: hidden;
}
.wp-full-overlay {
background: #fff;
z-index: 500000;
position: fixed;
overflow: visible;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100%;
min-width: 0;
}
.wp-full-overlay-sidebar {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
position: fixed;
width: 300px;
height: 100%;
top: 0;
bottom: 0;
left: 0;
padding: 0;
margin: 0;
z-index: 10;
overflow: auto;
background: #f5f5f5;
border-right: 1px solid rgba( 0, 0, 0, 0.2 );
}
.wp-full-overlay.collapsed .wp-full-overlay-sidebar {
overflow: visible;
}
.wp-full-overlay.collapsed,
.wp-full-overlay.expanded .wp-full-overlay-sidebar {
margin-left: 0 !important;
}
.wp-full-overlay.expanded {
margin-left: 300px;
}
.wp-full-overlay.collapsed .wp-full-overlay-sidebar {
margin-left: -300px;
}
.wp-full-overlay-sidebar:after {
content: '';
display: block;
position: absolute;
top: 0;
bottom: 0;
right: 0;
width: 3px;
box-shadow: -5px 0 4px -4px rgba(0, 0, 0, 0.1) inset;
z-index: 1000;
}
.wp-full-overlay-main {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
height: 100%;
}
.wp-full-overlay-sidebar .wp-full-overlay-header {
position: absolute;
left: 0;
right: 0;
height: 45px;
padding: 0 20px;
line-height: 45px;
z-index: 10;
margin: 0;
}
.wp-full-overlay-sidebar .wp-full-overlay-header {
border-top: 0;
border-bottom: 1px solid #fff;
box-shadow: inset 0 -1px 0 0px #dfdfdf;
}
.wp-full-overlay-sidebar .wp-full-overlay-footer {
bottom: 0;
border-bottom: 0;
border-top: 1px solid #dfdfdf;
box-shadow: inset 0 1px 0 0px #fff;
}
.wp-full-overlay-sidebar .wp-full-overlay-sidebar-content {
position: absolute;
top: 45px;
bottom: 45px;
left: 0;
right: 0;
overflow: auto;
}
/* Close Link */
.wp-full-overlay .close-full-overlay {
text-decoration: none;
}
/* Collapse Button */
.wp-full-overlay a.collapse-sidebar {
position: absolute;
bottom: 12px;
left: 0;
z-index: 50;
display: block;
width: 19px;
height: 19px;
margin-left: 15px;
padding: 0;
border-radius: 50%;
text-decoration: none;
}
.wp-full-overlay.collapsed .collapse-sidebar {
position: absolute;
left: 100%;
}
.wp-full-overlay .collapse-sidebar-arrow {
position: absolute;
margin-top: 2px;
margin-left: 2px;
display: block;
width: 15px;
height: 15px;
background: transparent url('../images/arrows.png') no-repeat -1px -73px;
}
.wp-full-overlay.collapsed .collapse-sidebar-arrow {
background-position: -1px -109px;
}
.wp-full-overlay .collapse-sidebar-label {
position: absolute;
left: 100%;
color: #808080;
line-height: 20px;
margin-left: 10px;
}
.wp-full-overlay.collapsed .collapse-sidebar-label {
display: none;
}
.wp-full-overlay .collapse-sidebar:hover .collapse-sidebar-label {
color: #666;
}
/* Animations */
.wp-full-overlay,
.wp-full-overlay-sidebar,
.wp-full-overlay .collapse-sidebar,
.wp-full-overlay-main {
-webkit-transition-property: left, right, top, bottom, width, margin;
-moz-transition-property: left, right, top, bottom, width, margin;
-ms-transition-property: left, right, top, bottom, width, margin;
-o-transition-property: left, right, top, bottom, width, margin;
transition-property: left, right, top, bottom, width, margin;
-webkit-transition-duration: 0.2s;
-moz-transition-duration: 0.2s;
-ms-transition-duration: 0.2s;
-o-transition-duration: 0.2s;
transition-duration: 0.2s;
}
/*------------------------------------------------------------------------------
24.0 - Customize Loader
------------------------------------------------------------------------------*/
.no-customize-support .hide-if-no-customize,
.customize-support .hide-if-customize,
.no-customize-support.wp-core-ui .hide-if-no-customize,
.no-customize-support .wp-core-ui .hide-if-no-customize,
.customize-support.wp-core-ui .hide-if-customize,
.customize-support .wp-core-ui .hide-if-customize {
display: none;
}
#customize-container {
display: none;
background: #fff;
z-index: 500000;
position: fixed;
overflow: visible;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100%;
}
.customize-active #customize-container {
display: block;
}
.customize-loading #customize-container iframe {
opacity: 0;
}
.customize-loading #customize-container {
background: #fff url("../images/wpspin_light.gif") no-repeat fixed center center;
background-size: 16px 16px;
}
#customize-container iframe,
#theme-installer iframe {
height: 100%;
width: 100%;
z-index: 20;
-webkit-transition: opacity 0.3s;
-moz-transition: opacity 0.3s;
-ms-transition: opacity 0.3s;
-o-transition: opacity 0.3s;
transition: opacity 0.3s;
}
#customize-container .collapse-sidebar {
bottom: 16px;
}
#theme-installer {
display: none;
}
#theme-installer.single-theme {
display: block;
}
.install-theme-info {
display: none;
padding: 10px 20px 20px;
}
.single-theme .install-theme-info {
padding-top: 15px;
}
#theme-installer .install-theme-info {
display: block;
}
.install-theme-info .theme-install {
float: right;
margin-top: 18px;
}
.install-theme-info .theme-name {
font-size: 16px;
line-height: 24px;
margin-bottom: 0;
}
.install-theme-info .theme-screenshot {
margin-top: 15px;
width: 258px;
border: 1px solid #ccc;
}
.install-theme-info .theme-details {
overflow: hidden;
}
.theme-details .theme-version {
margin: 15px 0;
float: left;
}
.theme-details .star-holder {
margin: 14px 0;
float: right;
}
.theme-details .theme-description {
float: left;
color: #777;
line-height: 20px;
}
/*------------------------------------------------------------------------------
25.0 - Misc
------------------------------------------------------------------------------*/
#excerpt,
.attachmentlinks {
margin: 0;
height: 4em;
width: 98%;
}
#template div {
margin-right: 190px;
}
p.pagenav {
margin: 0;
display: inline;
}
.pagenav span {
font-weight: bold;
margin: 0 6px;
}
.row-title {
font-size: 13px !important;
font-weight: bold;
}
.column-author img, .column-username img {
float: left;
margin-right: 10px;
margin-top: 1px;
}
.row-actions {
visibility: hidden;
padding: 2px 0 0;
}
.mobile .row-actions {
visibility: visible;
}
tr:hover .row-actions,
div.comment-item:hover .row-actions {
visibility: visible;
}
.row-actions-visible {
padding: 2px 0 0;
}
.form-table .pre {
padding: 8px;
margin: 0;
}
table.form-table td .updated {
font-size: 13px;
}
.tagchecklist {
margin-left: 14px;
font-size: 12px;
overflow: auto;
}
.tagchecklist strong {
margin-left: -8px;
position: absolute;
}
.tagchecklist span {
margin-right: 25px;
display: block;
float: left;
font-size: 11px;
line-height: 1.8em;
white-space: nowrap;
cursor: default;
}
.tagchecklist span a {
margin: 6px 0pt 0pt -9px;
cursor: pointer;
width: 10px;
height: 10px;
display: block;
float: left;
text-indent: -9999px;
overflow: hidden;
position: absolute;
}
#poststuff h2 {
margin-top: 20px;
font-size: 1.5em;
margin-bottom: 15px;
padding: 0 0 3px;
clear: left;
}
#poststuff h3,
.metabox-holder h3 {
font-size: 15px;
font-weight: normal;
padding: 7px 10px;
margin: 0;
line-height: 1;
}
#poststuff .inside {
margin: 6px 0 8px;
}
#poststuff .inside #parent_id,
#poststuff .inside #page_template {
max-width: 100%;
}
.inline-edit-row #post_parent,
.inline-edit-row select[name="page_template"] {
max-width: 80%;
}
.ie8 #poststuff .inside #parent_id,
.ie8 #poststuff .inside #page_template,
.ie8 .inline-edit-row #post_parent,
.ie8 .inline-edit-row select[name="page_template"] {
width: 250px;
}
#post-visibility-select,
#post-formats-select {
line-height: 1.5em;
margin-top: 3px;
}
#poststuff #submitdiv .inside {
margin: 0;
padding: 0;
}
#post-body-content {
margin-bottom: 20px;
}
#templateside ul li a {
text-decoration: none;
}
.tool-box .title {
margin: 8px 0;
font-size: 18px;
font-weight: normal;
line-height: 24px;
}
#sidemenu {
margin: -30px 15px 0 315px;
list-style: none;
position: relative;
float: right;
padding-left: 10px;
font-size: 12px;
}
#sidemenu a {
padding: 0 7px;
display: block;
float: left;
line-height: 28px;
border-top-width: 1px;
border-top-style: solid;
border-bottom-width: 1px;
border-bottom-style: solid;
}
#sidemenu li {
display: inline;
line-height: 200%;
list-style: none;
text-align: center;
white-space: nowrap;
margin: 0;
padding: 0;
}
#sidemenu a.current {
font-weight: normal;
padding-left: 6px;
padding-right: 6px;
-webkit-border-top-left-radius: 3px;
-webkit-border-top-right-radius: 3px;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-width: 1px;
border-style: solid;
}
#sidemenu li a .count-0 {
display: none;
}
.plugin-install #description,
.plugin-install-network #description {
width: 60%;
}
table .vers,
table .column-visible,
table .column-rating {
text-align: left;
}
.error-message {
color: red;
font-weight: bold;
}
/* Scrollbar fix for bulk upgrade iframe */
body.iframe {
height: 98%;
}
/* - Only used once or twice in all of WP - deprecate for global style
------------------------------------------------------------------------------*/
td.media-icon {
text-align: center;
width: 80px;
padding-top: 8px;
padding-bottom: 8px;
}
td.media-icon img {
max-width: 80px;
max-height: 60px;
}
#howto {
font-size: 11px;
margin: 0 5px;
display: block;
}
.importers td {
padding-right: 14px;
}
.importers {
font-size: 16px;
width: auto;
}
#namediv table {
width: 100%;
}
#namediv td.first {
width: 10px;
white-space: nowrap;
}
#namediv input {
width: 98%;
}
#namediv p {
margin: 10px 0;
}
#submitdiv h3 {
margin-bottom: 0 !important;
}
/* - Used - but could/should be deprecated with a CSS reset
------------------------------------------------------------------------------*/
.zerosize {
height: 0;
width: 0;
margin: 0;
border: 0;
padding: 0;
overflow: hidden;
position: absolute;
}
br.clear {
height: 2px;
line-height: 2px;
}
.checkbox {
border: none;
margin: 0;
padding: 0;
}
fieldset {
border: 0;
padding: 0;
margin: 0;
}
.post-categories {
display: inline;
margin: 0;
padding: 0;
}
.post-categories li {
display: inline;
}
/*-----------------------------------------------------------------------------
MERGED
-------------------------------------------------------------------------------*/
/* dashboard */
.edit-box {
display: none;
}
h3:hover .edit-box {
display: inline;
}
#dashboard-widgets form .input-text-wrap input {
width: 100%;
}
#dashboard-widgets form .textarea-wrap textarea {
width: 100%;
}
#dashboard-widgets .postbox form .submit {
float: none;
margin: .5em 0 0;
padding: 0;
border: none;
}
#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit #publish {
min-width: 0;
}
#dashboard-widgets a {
text-decoration: none;
}
#dashboard-widgets h3 a {
text-decoration: underline;
}
#dashboard-widgets h3 .postbox-title-action {
position: absolute;
right: 10px;
padding: 0;
top: 5px;
}
.js #dashboard-widgets h3 .postbox-title-action {
right: 30px;
}
#dashboard-widgets h4 {
font-weight: normal;
font-size: 13px;
margin: 0 0 .2em;
padding: 0;
}
/* Right Now */
#dashboard_right_now p.sub,
#dashboard_right_now .table, #dashboard_right_now .versions {
margin: -12px;
}
#dashboard_right_now .inside {
font-size: 12px;
padding-top: 20px;
}
#dashboard_right_now p.sub {
padding: 5px 0 15px;
color: #8f8f8f;
font-size: 14px;
position: absolute;
top: -17px;
left: 15px;
}
#dashboard_right_now .table {
margin: 0;
padding: 0;
position: relative;
}
#dashboard_right_now .table_content {
float: left;
border-top-width: 1px;
border-top-style: solid;
width: 45%;
}
#dashboard_right_now .table_discussion {
float: right;
border-top-width: 1px;
border-top-style: solid;
width: 45%;
}
#dashboard_right_now table td {
padding: 3px 0;
white-space: nowrap;
}
#dashboard_right_now table tr.first td {
border-top: none;
}
#dashboard_right_now td.b {
padding-right: 6px;
text-align: right;
font-size: 14px;
width: 1%;
}
#dashboard_right_now td.b a {
font-size: 18px;
}
#dashboard_right_now td.b a:hover {
color: #d54e21;
}
#dashboard_right_now .t {
font-size: 12px;
padding-right: 12px;
padding-top: 6px;
color: #777;
}
#dashboard_right_now .t a {
white-space: nowrap;
}
#dashboard_right_now .spam {
color: red;
}
#dashboard_right_now .waiting {
color: #e66f00;
}
#dashboard_right_now .approved {
color: green;
}
#dashboard_right_now .versions {
padding: 6px 10px 12px;
clear: both;
}
#dashboard_right_now a.button {
float: right;
clear: right;
position: relative;
top: -5px;
}
/* Recent Comments */
#dashboard_recent_comments h3 {
margin-bottom: 0;
}
#dashboard_recent_comments .inside {
margin-top: 0;
}
#dashboard_recent_comments .comment-meta .approve {
font-style: italic;
font-family: sans-serif;
font-size: 10px;
}
#dashboard_recent_comments .subsubsub {
float: none;
white-space: normal;
}
#the-comment-list {
position: relative;
}
#the-comment-list .comment-item {
padding: 1em 10px;
border-top: 1px solid;
}
#the-comment-list .pingback {
padding-left: 9px !important;
}
#the-comment-list .comment-item,
#the-comment-list #replyrow {
margin: 0 -10px;
}
#the-comment-list .comment-item:first-child {
border-top: none;
}
#the-comment-list .comment-item .avatar {
float: left;
margin: 0 10px 5px 0;
}
#the-comment-list .comment-item h4 {
line-height: 1.7em;
margin-top: -0.4em;
color: #777;
}
#the-comment-list .comment-item h4 cite {
font-style: normal;
font-weight: normal;
}
#the-comment-list .comment-item blockquote,
#the-comment-list .comment-item blockquote p {
margin: 0;
padding: 0;
display: inline;
}
#dashboard_recent_comments #the-comment-list .trackback blockquote,
#dashboard_recent_comments #the-comment-list .pingback blockquote {
display: block;
}
#the-comment-list .comment-item p.row-actions {
margin: 3px 0 0;
padding: 0;
font-size: 12px;
}
/* QuickPress */
.no-js #dashboard_quick_press {
display: none;
}
#dashboard_quick_press .easy-blogging {
padding: 0 8px;
text-align: left;
}
#dashboard_quick_press .input-text-wrap {
position: relative;
}
#dashboard_quick_press .prompt {
color: #bbb;
position: absolute;
}
#dashboard_quick_press div.updated {
padding: 0 5px;
}
#title-wrap label,
#tags-input-wrap label {
cursor: text;
}
#title-wrap #title {
padding: 2px 6px;
font-size: 1.3em;
line-height: 100%;
outline: none;
}
#tags-input-wrap #tags-input {
outline: none;
}
#title-wrap #title-prompt-text {
font-size: 1.3em;
padding: 5px 8px;
}
#tags-input-wrap #tags-input-prompt-text {
font-size: 1em;
padding: 4px 8px;
}
#dashboard_quick_press .input-text-wrap,
#dashboard_quick_press .textarea-wrap {
margin: 0 0 1em 0;
}
#dashboard_quick_press .wp-media-buttons {
margin: 0 0 .2em 1px;
padding: 0;
}
#dashboard_quick_press .wp-media-buttons a {
color: #777;
}
#dashboard-widgets #dashboard_quick_press form p.submit input {
float: left;
}
#dashboard-widgets #dashboard_quick_press form p.submit #save-post {
margin: 0 0.7em 0 1px;
}
#dashboard-widgets #dashboard_quick_press form p.submit #publish {
float: right;
}
#dashboard-widgets #dashboard_quick_press form p.submit .spinner {
vertical-align: middle;
margin: 4px 6px 0 0;
}
/* Recent Drafts */
#dashboard_recent_drafts ul,
#dashboard_recent_drafts p {
margin: 0;
padding: 0;
word-wrap: break-word;
}
#dashboard_recent_drafts ul {
list-style: none;
}
#dashboard_recent_drafts ul li {
margin-bottom: 1em;
}
#dashboard_recent_drafts h4 {
line-height: 1.7em;
word-wrap: break-word;
}
#dashboard_recent_drafts h4 abbr {
font-weight: normal;
font-family: sans-serif;
font-size: 12px;
color: #999;
margin-left: 3px;
}
/* Feeds */
.rss-widget ul {
margin: 0;
padding: 0;
list-style: none;
}
a.rsswidget {
font-size: 13px;
line-height: 1.7em;
}
.rss-widget ul li {
line-height: 1.5em;
margin-bottom: 12px;
}
.rss-widget span.rss-date {
color: #999;
font-size: 12px;
margin-left: 3px;
}
.rss-widget cite {
display: block;
text-align: right;
margin: 0 0 1em;
padding: 0;
}
.rss-widget cite:before {
content: '\2014';
}
/* Plugins */
#dashboard_plugins h4 {
line-height: 1.7em;
}
#dashboard_plugins h5 {
font-weight: normal;
font-size: 13px;
margin: 0;
display: inline;
line-height: 1.4em;
}
#dashboard_plugins h5 a {
line-height: 1.4em;
}
#dashboard_plugins .inside span {
font-size: 12px;
padding-left: 5px;
}
#dashboard_plugins p {
margin: 0.3em 0 1.4em;
line-height: 1.4em;
}
.dashboard-comment-wrap {
overflow: hidden;
word-wrap: break-word;
}
/* Browser Nag */
#dashboard_browser_nag a.update-browser-link {
font-size: 1.2em;
font-weight: bold;
}
#dashboard_browser_nag a {
text-decoration: underline;
}
#dashboard_browser_nag p.browser-update-nag.has-browser-icon {
padding-right: 125px;
}
#dashboard_browser_nag .browser-icon {
margin-top: -35px;
}
#dashboard_browser_nag.postbox.browser-insecure {
background-color: #ac1b1b;
border-color: #ac1b1b;
}
#dashboard_browser_nag.postbox {
background-color: #e29808;
background-image: none;
border-color: #edc048;
color: #fff;
-webkit-box-shadow: none;
box-shadow: none;
}
#dashboard_browser_nag.postbox.browser-insecure h3 {
border-bottom-color: #cd5a5a;
color: #fff;
}
#dashboard_browser_nag.postbox h3 {
border-bottom-color: #f6e2ac;
text-shadow: none;
background: transparent none;
color: #fff;
-webkit-box-shadow: none;
box-shadow: none;
}
#dashboard_browser_nag a {
color: #fff;
}
#dashboard_browser_nag.browser-insecure a.browse-happy-link,
#dashboard_browser_nag.browser-insecure a.update-browser-link {
text-shadow: #871b15 0 1px 0;
}
#dashboard_browser_nag a.browse-happy-link,
#dashboard_browser_nag a.update-browser-link {
text-shadow: #d29a04 0 1px 0;
}
/* login */
.login * {
margin: 0;
padding: 0;
}
.login form {
margin-left: 8px;
padding: 26px 24px 46px;
font-weight: normal;
background: #fff;
border: 1px solid #e5e5e5;
-webkit-box-shadow: rgba(200, 200, 200, 0.7) 0px 4px 10px -1px;
box-shadow: rgba(200, 200, 200, 0.7) 0px 4px 10px -1px;
}
.login form .forgetmenot {
font-weight: normal;
float: left;
margin-bottom: 0;
}
.login .button-primary {
float: right;
}
#login form p {
margin-bottom: 0;
}
#login form p.submit {
padding: 0;
}
.login label {
color: #777;
font-size: 14px;
}
.login form .forgetmenot label {
font-size: 12px;
line-height: 19px;
}
.login h1 a {
background-image: url('../images/wordpress-logo.png?ver=20120216');
background-size: 274px 63px;
background-position: top center;
background-repeat: no-repeat;
width: 326px;
height: 67px;
text-indent: -9999px;
outline: none;
overflow: hidden;
padding-bottom: 15px;
display: block;
}
#login {
width: 320px;
padding: 114px 0 0;
margin: auto;
}
#login_error,
.login .message {
margin: 0 0 16px 8px;
padding: 12px;
}
.login #nav,
.login #backtoblog {
text-shadow: #fff 0 1px 0;
margin: 0 0 0 16px;
padding: 16px 16px 0;
}
#backtoblog {
padding: 12px 16px 0;
}
.login form .input,
.login input[type="text"] {
color: #555;
font-weight: 200;
font-size: 24px;
line-height: 1;
width: 100%;
padding: 3px;
margin-top: 2px;
margin-right: 6px;
margin-bottom: 16px;
border: 1px solid #e5e5e5;
background: #fbfbfb;
outline: none;
-webkit-box-shadow: inset 1px 1px 2px rgba(200, 200, 200, 0.2);
box-shadow: inset 1px 1px 2px rgba(200, 200, 200, 0.2);
}
.login #pass-strength-result {
width: 250px;
font-weight: bold;
border-style: solid;
border-width: 1px;
margin: 12px 0 6px;
padding: 6px 5px;
text-align: center;
}
.mobile #login {
padding: 20px 0;
}
.mobile #login form,
.mobile #login .message,
.mobile #login_error {
margin-left: 0;
}
.mobile #login #nav,
.mobile #login #backtoblog {
margin-left: 8px;
}
.mobile #login h1 a {
width: auto;
}
/* ms */
/* Dashboard: MS Specific Data */
#dashboard_right_now p.musub {
margin-top: 12px;
border-top: 1px solid #ececec;
padding-left: 16px;
position: static;
}
.rtl #dashboard_right_now p.musub {
padding-left: 0;
padding-right: 16px;
}
#dashboard_right_now td.b a.musublink {
font-size: 16px;
}
#dashboard_right_now div.musubtable {
border-top: none;
}
#dashboard_right_now div.musubtable .t {
white-space: normal;
}
/* Background Color for Site Status */
.wp-list-table .site-deleted {
background: #ff8573;
}
.wp-list-table .site-spammed {
background: #faafaa;
}
.wp-list-table .site-archived {
background: #ffebe8;
}
.wp-list-table .site-mature {
background: #fecac2;
}
/* nav-menu */
#nav-menus-frame {
margin-left: 300px;
}
#wpbody-content #menu-settings-column {
display:inline;
width:281px;
margin-left: -300px;
clear: both;
float: left;
padding-top: 24px;
}
.no-js #wpbody-content #menu-settings-column {
padding-top: 31px;
}
#menu-settings-column .inside {
clear: both;
margin: 10px 0 0;
}
.metabox-holder-disabled .postbox {
opacity: 0.5;
filter: alpha(opacity=50);
}
.metabox-holder-disabled .button-controls .select-all {
display: none;
}
#wpbody {
position: relative;
}
/* Menu Container */
#menu-management-liquid {
float: left;
min-width: 100%;
}
#menu-management {
position: relative;
margin-right: 20px;
margin-top: -3px;
width: 100%;
}
#menu-management .menu-edit {
margin-bottom: 20px;
}
.nav-menus-php #post-body {
padding: 10px;
border-width: 1px 0;
border-style: solid;
}
#nav-menu-header,
#nav-menu-footer {
padding: 0 10px;
}
#nav-menu-header {
border-bottom: 1px solid;
}
#nav-menu-footer {
border-top: 1px solid;
}
.nav-menus-php #post-body div.updated,
.nav-menus-php #post-body div.error {
margin: 0;
}
.nav-menus-php #post-body-content {
position: relative;
float: none;
}
#menu-management .menu-add-new abbr {
font-weight:bold;
}
/* Menu Tabs */
#menu-management .nav-tabs-nav {
margin: 0 20px;
}
#menu-management .nav-tabs-arrow {
width: 10px;
padding: 0 5px 4px;
cursor: pointer;
position: absolute;
top: 0;
line-height: 22px;
font-size: 18px;
text-shadow: 0 1px 0 #fff;
}
#menu-management .nav-tabs-arrow-left {
left: 0;
}
#menu-management .nav-tabs-arrow-right {
right: 0;
text-align: right;
}
#menu-management .nav-tabs-wrapper {
width: 100%;
height: 28px;
margin-bottom: -1px;
overflow: hidden;
}
#menu-management .nav-tabs {
padding-left: 20px;
padding-right: 10px;
}
.js #menu-management .nav-tabs {
float: left;
margin-left: 0px;
margin-right: -400px;
}
#menu-management .nav-tab {
margin-bottom: 0;
font-size: 14px;
}
#select-nav-menu-container {
text-align: right;
padding: 0 10px 3px 10px;
margin-bottom: 5px;
}
#select-nav-menu {
width: 100px;
display: inline;
}
#menu-name-label {
margin-top: -2px;
}
#wpbody .open-label {
display: block;
float:left;
}
#wpbody .open-label span {
padding-right: 10px;
}
.js .input-with-default-title {
font-style: italic;
}
#menu-management .inside {
padding: 0 10px;
}
/* Add Menu Item Boxes */
.postbox .howto input {
width: 180px;
float: right;
}
.customlinkdiv .howto input {
width: 200px;
}
#nav-menu-theme-locations .howto select {
width: 100%;
}
#nav-menu-theme-locations .button-controls {
text-align: right;
}
.add-menu-item-view-all {
height: 400px;
}
/* Button Primary Actions */
#menu-container .submit {
margin: 0px 0px 10px;
padding: 0px;
}
.nav-menus-php .meta-sep,
.nav-menus-php .submitdelete,
.nav-menus-php .submitcancel {
display: block;
float: left;
margin: 4px 0;
line-height: 15px;
}
.meta-sep {
padding: 0 2px;
}
#cancel-save {
text-decoration: underline;
font-size: 12px;
margin-left: 20px;
margin-top: 5px;
}
.button.right, .button-secondary.right, .button-primary.right {
float: right;
}
/* Button Secondary Actions */
.list-controls {
float: left;
margin-top: 5px;
}
.add-to-menu {
float: right;
}
.postbox .spinner {
display: none;
vertical-align: middle;
}
.button-controls {
clear:both;
margin: 10px 0;
}
.show-all,
.hide-all {
cursor: pointer;
}
.hide-all {
display: none;
}
/* Create Menu */
#menu-name {
width: 270px;
}
#manage-menu .inside {
padding: 0px 0px;
}
/* Custom Links */
#available-links dt {
display: block;
}
#add-custom-link .howto {
font-size: 12px;
}
#add-custom-link label span {
display: block;
float: left;
margin-top: 5px;
padding-right: 5px;
}
.menu-item-textbox {
width: 180px;
}
.nav-menus-php .howto span {
margin-top: 4px;
display: block;
float: left;
}
/* Menu item types */
.quick-search {
width: 190px;
}
.nav-menus-php .list-wrap {
display: none;
clear: both;
margin-bottom: 10px;
}
.nav-menus-php .list-container {
max-height: 200px;
overflow-y: auto;
padding: 10px 10px 5px;
}
.nav-menus-php .postbox p.submit {
margin-bottom: 0;
}
/* Listings */
.nav-menus-php .list li {
display: none;
margin: 0;
margin-bottom: 5px;
}
.nav-menus-php .list li .menu-item-title {
cursor: pointer;
display: block;
}
.nav-menus-php .list li .menu-item-title input {
margin-right: 3px;
margin-top: -3px;
}
/* Nav Menu */
#menu-container .inside {
padding-bottom: 10px;
}
.menu {
padding-top:1em;
}
#menu-to-edit {
padding: 1em 0;
}
.menu ul {
width: 100%;
}
.menu li {
margin-bottom: 0;
position:relative;
}
.menu-item-bar {
clear:both;
line-height:1.5em;
position:relative;
margin: 13px 0 0 0;
}
.menu-item-handle {
border: 1px solid #dfdfdf;
position: relative;
padding-left: 10px;
height: auto;
width: 400px;
line-height: 35px;
text-shadow: 0 1px 0 #FFFFFF;
overflow: hidden;
word-wrap: break-word;
}
#menu-to-edit .menu-item-invalid .menu-item-handle {
background: #f6c9cc;
background-image: -webkit-gradient(linear, left bottom, left top, from(#f6c9cc), to(#fdf8ff));
background-image: -webkit-linear-gradient(bottom, #f6c9cc, #fdf8ff);
background-image: -moz-linear-gradient(bottom, #f6c9cc, #fdf8ff);
background-image: -o-linear-gradient(bottom, #f6c9cc, #fdf8ff);
background-image: linear-gradient(to top, #f6c9cc, #fdf8ff);
}
.menu-item-edit-active .menu-item-handle {
-webkit-border-bottom-right-radius: 0;
-webkit-border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.no-js .menu-item-edit-active .item-edit {
display: none;
}
.js .menu-item-handle {
cursor: move;
}
.menu li.deleting .menu-item-handle {
background-image: none;
text-shadow: 0 0 0;
}
.menu-item-handle .item-title {
font-size: 12px;
font-weight: bold;
padding: 7px 0;
line-height: 20px;
display:block;
margin-right:13em;
}
/* Sortables */
li.menu-item.ui-sortable-helper dl {
margin-top: 0;
}
li.menu-item.ui-sortable-helper .menu-item-transport dl {
margin-top: 13px;
}
.menu .sortable-placeholder {
height: 35px;
width: 410px;
margin-top: 13px;
}
/* WARNING: The factor of 30px is hardcoded into the nav-menus javascript. */
.menu-item-depth-0 { margin-left: 0px; }
.menu-item-depth-1 { margin-left: 30px; }
.menu-item-depth-2 { margin-left: 60px; }
.menu-item-depth-3 { margin-left: 90px; }
.menu-item-depth-4 { margin-left: 120px; }
.menu-item-depth-5 { margin-left: 150px; }
.menu-item-depth-6 { margin-left: 180px; }
.menu-item-depth-7 { margin-left: 210px; }
.menu-item-depth-8 { margin-left: 240px; }
.menu-item-depth-9 { margin-left: 270px; }
.menu-item-depth-10 { margin-left: 300px; }
.menu-item-depth-11 { margin-left: 330px; }
.menu-item-depth-0 .menu-item-transport { margin-left: 0px; }
.menu-item-depth-1 .menu-item-transport { margin-left: -30px; }
.menu-item-depth-2 .menu-item-transport { margin-left: -60px; }
.menu-item-depth-3 .menu-item-transport { margin-left: -90px; }
.menu-item-depth-4 .menu-item-transport { margin-left: -120px; }
.menu-item-depth-5 .menu-item-transport { margin-left: -150px; }
.menu-item-depth-6 .menu-item-transport { margin-left: -180px; }
.menu-item-depth-7 .menu-item-transport { margin-left: -210px; }
.menu-item-depth-8 .menu-item-transport { margin-left: -240px; }
.menu-item-depth-9 .menu-item-transport { margin-left: -270px; }
.menu-item-depth-10 .menu-item-transport { margin-left: -300px; }
.menu-item-depth-11 .menu-item-transport { margin-left: -330px; }
body.menu-max-depth-0 { min-width: 950px !important; }
body.menu-max-depth-1 { min-width: 980px !important; }
body.menu-max-depth-2 { min-width: 1010px !important; }
body.menu-max-depth-3 { min-width: 1040px !important; }
body.menu-max-depth-4 { min-width: 1070px !important; }
body.menu-max-depth-5 { min-width: 1100px !important; }
body.menu-max-depth-6 { min-width: 1130px !important; }
body.menu-max-depth-7 { min-width: 1160px !important; }
body.menu-max-depth-8 { min-width: 1190px !important; }
body.menu-max-depth-9 { min-width: 1220px !important; }
body.menu-max-depth-10 { min-width: 1250px !important; }
body.menu-max-depth-11 { min-width: 1280px !important; }
/* Menu item controls */
.item-type {
font-size: 12px;
padding-right: 10px;
}
.item-controls {
font-size: 12px;
position: absolute;
right: 20px;
top: -1px;
}
.item-controls a {
text-decoration: none;
}
.item-controls a:hover {
cursor: pointer;
}
.item-controls .item-order {
padding-right: 10px;
}
.nav-menus-php .item-edit {
position: absolute;
right: -20px;
top: 0;
display: block;
width: 30px;
height: 36px;
overflow: hidden;
text-indent:-999em;
border-bottom: 1px solid;
-webkit-border-bottom-left-radius: 3px;
border-bottom-left-radius: 3px;
}
/* Menu editing */
.menu-instructions-inactive {
display: none;
}
.menu-item-settings {
display: block;
width: 400px;
padding: 10px 0 10px 10px;
border: solid;
border-width: 0 1px 1px 1px;
-webkit-border-bottom-right-radius: 3px;
-webkit-border-bottom-left-radius: 3px;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
}
.menu-item-edit-active .menu-item-settings {
display: block;
}
.menu-item-edit-inactive .menu-item-settings {
display: none;
}
.add-menu-item-pagelinks {
margin: .5em auto;
text-align: center;
}
.link-to-original {
display: block;
margin: 0 0 10px;
padding: 3px 5px 5px;
font-size: 12px;
font-style: italic;
}
.link-to-original a {
padding-left: 4px;
font-style: normal;
}
.hidden-field {
display: none;
}
.menu-item-settings .description-thin,
.menu-item-settings .description-wide {
margin-right: 10px;
float: left;
}
.description-thin {
width: 190px;
height: 40px;
}
.description-wide {
width: 390px;
}
.menu-item-actions {
padding-top: 15px;
}
#cancel-save {
cursor: pointer;
}
/* Major/minor publishing actions (classes) */
.nav-menus-php .major-publishing-actions {
clear: both;
padding: 3px 0 5px;
}
.nav-menus-php .major-publishing-actions .publishing-action {
text-align: right;
float: right;
line-height: 23px;
margin: 5px 0 1px;
}
.nav-menus-php .major-publishing-actions .delete-action {
vertical-align: middle;
text-align: left;
float: left;
padding-right: 15px;
margin-top: 5px;
}
.menu-name-label span,
.auto-add-pages label {
font-size: 12px;
font-style: normal;
}
.menu-name-label {
margin-right: 15px;
}
.auto-add-pages input {
margin-top: 0;
}
.auto-add-pages {
margin-top: 4px;
float: left;
}
.nav-menus-php .submitbox .submitcancel {
border-bottom: 1px solid;
padding: 1px 2px;
text-decoration: none;
}
.nav-menus-php .major-publishing-actions .form-invalid {
padding-left: 4px;
margin-left: -4px;
border: 0 none;
}
/* Clearfix */
#menu-item-name-wrap:after,
#menu-item-url-wrap:after,
#menu-name-label:after,
#menu-settings-column .inside:after,
#nav-menus-frame:after,
.nav-menus-php #post-body-content:after,
.nav-menus-php .button-controls:after,
.nav-menus-php .major-publishing-actions:after,
.nav-menus-php .menu-item-settings:after {
clear: both;
content: ".";
display: block;
height: 0;
visibility: hidden;
}
#nav-menus-frame,
.button-controls,
#menu-item-url-wrap,
#menu-item-name-wrap {
display: block;
}
/* Star ratings */
div.star-holder {
position: relative;
height: 17px;
width: 100px;
background: url('../images/stars.png?ver=20121108') repeat-x bottom left;
}
div.star-holder .star-rating {
background: url('../images/stars.png?ver=20121108') repeat-x top left;
height: 17px;
float: left;
}
div.action-links {
font-weight: normal;
margin: 6px 0 0;
}
/* Header on thickbox */
#plugin-information-header {
margin: 0;
padding: 0 5px;
font-weight: bold;
position: relative;
border-bottom-width: 1px;
border-bottom-style: solid;
height: 2.5em;
}
#plugin-information ul#sidemenu {
font-weight: normal;
margin: 0 5px;
position: absolute;
left: 0;
bottom: -1px;
}
/* Install sidemenu */
#plugin-information p.action-button {
width: 100%;
padding-bottom: 0;
margin-bottom: 0;
margin-top: 10px;
-webkit-border-top-left-radius: 3px;
-webkit-border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
}
#plugin-information .action-button a {
text-align: center;
font-weight: bold;
text-decoration: none;
display: block;
line-height: 2em;
}
#plugin-information h2 {
clear: none !important;
margin-right: 200px;
}
#plugin-information .fyi {
margin: 0 10px 50px;
width: 210px;
}
#plugin-information .fyi h2 {
font-size: 0.9em;
margin-bottom: 0;
margin-right: 0;
}
#plugin-information .fyi h2.mainheader {
padding: 5px;
-webkit-border-top-left-radius: 3px;
border-top-left-radius: 3px;
}
#plugin-information .fyi ul {
padding: 10px 5px 10px 7px;
margin: 0;
list-style: none;
-webkit-border-bottom-left-radius: 3px;
border-bottom-left-radius: 3px;
}
#plugin-information .fyi li {
margin-right: 0;
}
#plugin-information #section-holder {
padding: 10px;
}
#plugin-information .section ul,
#plugin-information .section ol {
margin-left: 16px;
list-style-type: square;
list-style-image: none;
}
#plugin-information #section-screenshots ol {
list-style: none;
margin: 0;
}
#plugin-information #section-screenshots li img {
vertical-align: text-top;
max-width: 100%;
width: auto;
height: auto;
}
#plugin-information #section-screenshots li p {
font-style: italic;
padding-left: 20px;
padding-bottom: 2em;
}
#plugin-information #section-screenshots ol,
#plugin-information .updated,
#plugin-information pre {
margin-right: 215px;
}
#plugin-information pre {
padding: 7px;
overflow: auto;
}
/* press-this */
body.press-this {
color: #333;
margin: 0;
padding: 0;
min-width: 675px;
min-height: 400px;
}
img {
border: none;
}
/* Header */
.press-this #wphead {
height: 32px;
margin-left: 0;
margin-right: 0;
margin-bottom: 5px;
}
.press-this #header-logo {
float: left;
margin: 7px 7px 0;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.press-this #wphead h1 {
font-weight: normal;
font-size: 16px;
line-height: 32px;
margin: 0;
float: left;
}
.press-this #wphead h1 a {
text-decoration: none;
}
.press-this #wphead h1 a:hover {
text-decoration: underline;
}
.press-this #message {
margin: 10px 0;
}
.press-this-sidebar {
float: right;
width: 200px;
padding-top: 10px;
}
.press-this #title {
margin-left: 0;
margin-right: 0;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
.press-this .tagchecklist span a {
background: transparent url(../images/xit.gif) no-repeat 0 0;
}
.press-this #titlediv {
margin: 0;
}
.press-this .wp-media-buttons {
cursor: default;
padding: 8px 8px 0;
}
.press-this .howto {
margin-top: 2px;
margin-bottom: 3px;
font-size: 12px;
font-style: italic;
display: block;
}
/* Editor/Main Column */
.press-this #poststuff {
margin: 0 10px 10px;
padding: 0;
}
.press-this #photo-add-url-div input[type="text"] {
width: 220px;
}
#poststuff #editor-toolbar {
height: 30px;
}
div.zerosize {
border: 0 none;
height: 0;
margin: 0;
overflow: hidden;
padding: 0;
width: 0;
}
.posting {
margin-right: 212px;
position: relative;
}
.press-this .inner-sidebar {
width: 200px;
}
.press-this .inner-sidebar .sleeve {
padding-top: 5px;
}
.press-this #submitdiv p {
margin: 0;
padding: 6px;
}
.press-this #submitdiv #publishing-actions {
border-bottom: 1px solid #dfdfdf;
}
.press-this #publish {
float: right;
}
.press-this #poststuff h2,
.press-this #poststuff h3 {
font-size: 14px;
line-height: 1;
}
.press-this #tagsdiv-post_tag h3,
.press-this #categorydiv h3 {
cursor: pointer;
}
.press-this #submitdiv h3 {
cursor: default;
}
h3.tb {
text-shadow: 0 1px 0 #fff;
font-weight: bold;
font-size: 12px;
margin-left: 5px;
}
#TB_window {
border: 1px solid #333;
}
.press-this .postbox,
.press-this .stuffbox {
margin-bottom: 10px;
min-width: 0;
}
.js .postbox:hover .handlediv,
.js .stuffbox:hover .handlediv {
background: transparent url(../images/arrows.png) no-repeat 6px 7px;
}
.press-this #submitdiv:hover .handlediv {
background: none;
}
.tbtitle {
font-size: 1.7em;
outline: none;
padding: 3px 4px;
border-color: #dfdfdf;
}
.press-this .actions {
float: right;
margin: -19px 0 0;
}
.press-this #extra-fields .actions {
margin: -32px -7px 0 0;
}
.press-this .actions li {
float: left;
list-style: none;
margin-right: 10px;
}
#extra-fields .button {
margin-right: 5px;
}
/* Photo Styles */
#photo_saving {
margin: 0 8px 8px;
vertical-align: middle;
}
#img_container_container {
overflow: auto;
}
#extra-fields {
margin-top: 10px;
position: relative;
}
#extra-fields h2 {
margin: 12px;
}
#waiting {
margin-top: 10px;
overflow: hidden;
}
#waiting span {
float: right;
margin: 0 0 0 5px;
}
#waiting .spinner {
display: block;
}
#extra-fields .postbox {
margin-bottom: 5px;
}
#extra-fields .titlewrap {
padding: 0;
overflow: auto;
height: 100px;
}
#img_container a {
display: block;
float: left;
overflow: hidden;
}
#img_container img,
#img_container a {
width: 68px;
height: 68px;
}
#img_container img {
border: none;
background-color: #f4f4f4;
cursor: pointer;
}
#img_container a,
#img_container a:link,
#img_container a:visited {
border: 1px solid #ccc;
display: block;
position: relative;
}
#img_container a:hover,
#img_container a:active {
border-color: #000;
z-index: 1000;
border-width: 2px;
margin: -1px;
}
/* Video */
#embed-code {
width: 100%;
height: 98px;
}
/* Categories */
.press-this .categorydiv div.tabs-panel {
height: 100px;
}
/* Tags */
.press-this .tagsdiv .newtag {
width: 120px;
}
.press-this #content {
margin: 5px 0;
padding: 0 5px;
border: 0 none;
height: 345px;
font-family: Consolas, Monaco, monospace;
font-size: 13px;
line-height: 19px;
background: transparent;
}
/* Submit */
.press-this #publishing-actions .spinner {
display: inline;
vertical-align: middle;
}
#TB_ajaxContent #options {
position: absolute;
top: 20px;
right: 25px;
padding: 5px;
}
#TB_ajaxContent h3 {
margin-bottom: .25em;
}
.error a {
text-decoration: underline;
}
.updated a {
text-decoration: none;
padding-bottom: 2px;
}
/* tag hints */
.taghint {
color: #aaa;
margin: -17px 0 0 7px;
visibility: hidden;
}
input.newtag ~ div.taghint {
visibility: visible;
}
input.newtag:focus ~ div.taghint {
visibility: hidden;
}
/* TinyMCE */
#mce_fullscreen_container {
background: #fff;
}
#photo-add-url-div input[type="text"] {
width: 300px;
}
/* theme-editor */
.alignleft h3 {
margin: 0;
}
h3 span {
font-weight: normal;
}
#template textarea {
font-family: Consolas, Monaco, monospace;
font-size: 12px;
width: 97%;
background: #f9f9f9;
outline: none;
}
#template p {
width: 97%;
}
#templateside {
float: right;
width: 190px;
word-wrap: break-word;
}
#templateside h3,
#postcustomstuff p.submit {
margin: 0;
}
#templateside h4 {
margin: 1em 0 0;
}
#templateside ol,
#templateside ul {
margin: .5em;
padding: 0;
}
#templateside li {
margin: 4px 0;
}
#templateside ul li a span.highlight {
display:block;
}
.nonessential {
font-size: 11px;
font-style: italic;
padding-left: 12px;
}
.highlight {
padding: 3px 3px 3px 12px;
margin-left: -12px;
font-weight: bold;
border: 0 none;
}
#documentation {
margin-top: 10px;
}
#documentation label {
line-height: 22px;
vertical-align: top;
font-weight: bold;
}
.fileedit-sub {
padding: 10px 0 8px;
line-height: 180%;
}
#filter-box {
clear: both;
}
.feature-filter {
padding: 8px 12px 0;
}
.feature-filter .feature-group {
float: left;
margin: 5px 10px 10px;
}
.feature-filter .feature-group li {
display: inline-block;
vertical-align: top;
list-style-type: none;
padding-right: 25px;
width: 150px;
}
.feature-container {
width: 100%;
overflow: auto;
margin-bottom: 10px;
}
/* widgets */
/* 2 column liquid layout */
div.widget-liquid-left {
float: left;
clear: left;
width: 100%;
margin-right: -325px;
}
div#widgets-left {
margin-left: 5px;
margin-right: 325px;
}
div#widgets-right {
width: 285px;
margin: 0 auto;
}
div.widget-liquid-right {
float: right;
clear: right;
width: 300px;
}
.widget-liquid-right .widget,
.inactive-sidebar .widget,
.widget-liquid-right .sidebar-description {
width: 250px;
margin: 0 auto 20px;
overflow: hidden;
}
.widget-liquid-right .sidebar-description {
margin-bottom: 10px;
}
.inactive-sidebar .widget {
margin: 0 10px 20px;
display: inline-block;
}
div.sidebar-name h3 {
font-weight: normal;
font-size: 15px;
margin: 0;
padding: 8px 10px;
overflow: hidden;
white-space: nowrap;
}
div.sidebar-name {
font-size: 13px;
border-width: 1px;
border-style: solid;
-webkit-border-top-right-radius: 3px;
-webkit-border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-top-left-radius: 3px;
}
.js .sidebar-name {
cursor: pointer;
}
.js .closed .sidebar-name {
-webkit-border-bottom-right-radius: 3px;
-webkit-border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
}
.widget-liquid-right .widgets-sortables,
#widgets-left .widget-holder {
border-width: 0 1px 1px;
border-style: none solid solid;
-webkit-border-bottom-right-radius: 3px;
-webkit-border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
}
.js .closed .widgets-sortables,
.js .closed .widget-holder {
display: none;
}
.widget-liquid-right .widgets-sortables {
padding: 15px 0 0;
}
#available-widgets .widget-holder {
padding: 7px 5px 0;
}
#available-widgets .widget {
-webkit-box-shadow: none;
box-shadow: none;
}
.inactive-sidebar {
padding: 5px 5px 0;
}
#widget-list .widget {
width: 250px;
margin: 0 10px 15px;
border: 0 none;
background: transparent;
display: inline-block;
vertical-align: top;
}
#widget-list .widget-description {
padding: 5px 8px;
}
.widget-placeholder {
border-width: 1px;
border-style: dashed;
margin: 0 auto 20px;
height: 27px;
width: 250px;
}
.inactive-sidebar .widget-placeholder {
margin: 0 10px 20px;
float: left;
}
div.widgets-holder-wrap {
padding: 0;
margin: 10px 0 20px;
}
#widgets-left #available-widgets {
background-color: transparent;
border: 0 none;
}
ul#widget-list {
list-style: none;
margin: 0;
padding: 0;
min-height: 100px;
}
.widget .widget-top {
margin-bottom: -1px;
font-size: 12px;
font-weight: bold;
height: 26px;
overflow: hidden;
}
.widget-top .widget-title {
padding: 7px 9px;
}
.widget-top .widget-title-action {
float: right;
}
a.widget-action {
display: block;
width: 24px;
height: 26px;
}
#available-widgets a.widget-action {
display: none;
}
.widget-top a.widget-action {
background: transparent url(../images/arrows.png) no-repeat 4px 6px;
}
.widget-top a.widget-action:hover {
background: transparent url(../images/arrows-dark.png) no-repeat 4px 6px;
}
.widget .widget-inside,
.widget .widget-description {
padding: 12px 12px 10px;
font-size: 12px;
line-height: 16px;
}
.widget-inside,
.widget-description {
display: none;
}
#available-widgets .widget-description {
display: block;
}
.widget .widget-inside p {
margin: 0 0 1em;
padding: 0;
}
.widget-title h4 {
margin: 0;
padding-bottom: 0.2em;
line-height: 1;
overflow: hidden;
white-space: nowrap;
}
.widgets-sortables {
min-height: 90px;
}
.widget-control-actions {
margin-top: 8px;
}
.widget-control-actions a {
text-decoration: none;
}
.widget-control-actions a:hover {
text-decoration: underline;
}
.widget-control-actions div.alignleft {
margin-top: 6px;
}
div#sidebar-info {
padding: 0 1em;
margin-bottom: 1em;
font-size: 12px;
}
.widget-title a,
.widget-title a:hover {
text-decoration: none;
border-bottom: none;
}
.widget-control-edit {
display: block;
font-size: 12px;
font-weight: normal;
line-height: 26px;
padding: 0 8px 0 0;
}
a.widget-control-edit {
text-decoration: none;
}
.widget-control-edit .add,
.widget-control-edit .edit {
display: none;
}
#available-widgets .widget-control-edit .add,
#widgets-right .widget-control-edit .edit,
.inactive-sidebar .widget-control-edit .edit {
display: inline;
}
.editwidget {
margin: 0 auto 15px;
}
.editwidget .widget-inside {
display: block;
padding: 10px;
}
.inactive p.description {
margin: 5px 15px 10px;
}
#available-widgets p.description {
margin: 0 12px 12px;
}
.widget-position {
margin-top: 8px;
}
.inactive {
padding-top: 2px;
}
.sidebar-name .spinner {
float: none;
margin: 0 3px -3px;
}
.sidebar-name-arrow {
float: right;
height: 29px;
width: 26px;
}
.widget-title .in-widget-title {
font-size: 12px;
white-space: nowrap;
}
#removing-widget {
display: none;
font-weight: normal;
padding-left: 15px;
font-size: 12px;
line-height: 1;
}
.widget-control-noform,
#access-off,
.widgets_access .widget-action,
.widgets_access .sidebar-name-arrow,
.widgets_access #access-on,
.widgets_access .widget-holder .description {
display: none;
}
.widgets_access .widget-holder,
.widgets_access #widget-list {
padding-top: 10px;
}
.widgets_access #access-off {
display: inline;
}
.widgets_access #wpbody-content .widget-title-action,
.widgets_access #wpbody-content .widget-control-edit,
.widgets_access .closed .widgets-sortables,
.widgets_access .closed .widget-holder {
display: block;
}
.widgets_access .closed .sidebar-name {
-webkit-border-bottom-right-radius: 0;
-webkit-border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.widgets_access .sidebar-name,
.widgets_access .widget .widget-top {
cursor: default;
}
/* Enable draggable on IE10 touch events until it's rolled into jQuery UI core */
.ui-sortable,
.ui-draggable {
-ms-touch-action: none;
}
/* =Media Queries
-------------------------------------------------------------- */
@media only screen and (max-width: 768px) {
/* categories */
#col-left {
width: 100%;
}
#col-right {
width: 100%;
}
}
@media only screen and (min-width: 769px) {
/* categories */
#col-left {
width: 35%;
}
#col-right {
width: 65%;
}
}
@media only screen and (max-width: 860px) {
/* categories */
#col-left {
width: 35%;
}
#col-right {
width: 65%;
}
}
@media only screen and (min-width: 980px) {
/* categories */
#col-left {
width: 35%;
}
#col-right {
width: 65%;
}
}
@media only screen and (max-width: 768px) {
/* categories */
#col-left {
width: 100%;
}
#col-right {
width: 100%;
}
.form-field input,
.form-field textarea {
width: 99%;
}
.form-wrap .form-field {
padding:0;
}
/* users */
#profile-page .form-table textarea {
max-width: 400px;
width: auto;
}
}
/**
* HiDPI Displays
*/
@media print,
(-o-min-device-pixel-ratio: 5/4),
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 120dpi) {
.press-this .tagchecklist span a {
background-image: url('../images/xit-2x.gif');
background-size: 20px auto;
}
.js .postbox:hover .handlediv,
.js .stuffbox:hover .handlediv,
.widget-top a.widget-action {
background-image: url('../images/arrows-2x.png');
background-size: 15px 123px;
}
.widget-top a.widget-action:hover {
background-image: url('../images/arrows-dark-2x.png');
background-size: 15px 123px;
}
.post-com-count {
background-image: url('../images/bubble_bg-2x.gif');
background-size: 18px 100px;
}
th .comment-grey-bubble {
background-image: url('../images/comment-grey-bubble-2x.png');
background-size: 12px 12px;
}
.sorting-indicator {
background-image: url('../images/sort-2x.gif');
background-size: 14px 4px;
}
#content-resize-handle,
#post-body .wp_themeSkin .mceStatusbar a.mceResize {
background: transparent url('../images/resize-2x.gif') no-repeat scroll right bottom;
background-size: 11px 11px;
}
div.star-holder {
background: url('../images/stars-2x.png?ver=20121108') repeat-x bottom left;
background-size: 21px 37px;
}
div.star-holder .star-rating {
background: url('../images/stars-2x.png?ver=20121108') repeat-x top left;
background-size: 21px 37px;
}
.welcome-panel .welcome-panel-close:before {
background-image: url('../images/xit-2x.gif');
background-size: 20px auto;
}
.welcome-panel .welcome-icon {
background-image: url('../images/welcome-icons-2x.png');
}
.login h1 a {
background-image: url('../images/wordpress-logo-2x.png?ver=20120412');
background-size: 274px 63px;
}
.wp-badge {
background-image: url('../images/wp-badge-2x.png?ver=20120516');
background-size: 173px 194px;
}
.wp-full-overlay .collapse-sidebar-arrow {
background-image: url('../images/arrows-2x.png');
background-size: 15px 123px;
}
.pressthis a span {
background-image: url(../images/press-this-2x.png?v=20121105);
}
.imgedit-crop,
.imgedit-rleft,
.imgedit-rright,
.imgedit-flipv,
.imgedit-fliph,
.imgedit-undo,
.imgedit-redo {
background-image: url('../images/imgedit-icons-2x.png');
background-size: 260px 64px;
}
.spinner,
.imgedit-wait,
.customize-loading #customize-container {
background-image: url(../images/wpspin_light-2x.gif);
}
}
/* =Localized CSS
-------------------------------------------------------------- */
/* zh_CN: Remove italic properties. */
.locale-zh-cn .howto,
.locale-zh-cn .tablenav .displaying-num,
.locale-zh-cn .js .input-with-default-title,
.locale-zh-cn .link-to-original,
.locale-zh-cn .inline-edit-row fieldset span.title,
.locale-zh-cn .inline-edit-row fieldset span.checkbox-title,
.locale-zh-cn #utc-time,
.locale-zh-cn #local-time,
.locale-zh-cn p.install-help,
.locale-zh-cn p.help,
.locale-zh-cn p.description,
.locale-zh-cn span.description,
.locale-zh-cn .form-wrap p {
font-style: normal;
}
/* zh_CN: Enlarge dashboard widget 'Configure' link */
.locale-zh-cn .hdnle a { font-size: 12px; }
/* zn_CH: Enlarge font size, set font-size: normal */
.locale-zh-cn form.upgrade .hint { font-style: normal; font-size: 100%; }
/* Zn_CH: Distraction free writing.
* More beautiful font for "Just write."
* Larger text for HTML/Visual mode.
*/
.locale-zh-cn #wp-fullscreen-tagline { font-family: KaiTi, "楷体", sans-serif; }
.locale-zh-cn #wp-fullscreen-modes a { font-size: 12px; }
/* zh_CN: Enlarge font-size. */
.locale-zh-cn #sort-buttons { font-size: 1em !important; }
/* ru_RU: Text needs more room to breathe. */
.locale-ru-ru .inline-edit-row fieldset label span.title {
width: auto; /* default 5em */
min-width: 5em;
}
.locale-ru-ru.press-this .posting {
margin-right: 257px; /* default 212px + 45px */
}
.locale-ru-ru.press-this #photo-add-url-div input[type="text"] {
width: 255px; /* default 300px - 45px */
}
.locale-ru-ru.press-this #side-sortables {
width: 245px; /* default 200px + 45px */
}
.locale-ru-ru #customize-header-actions .button {
padding: 0 8px 1px; /* default 0 10px 1px; */
}
/* lt_LT: QuickEdit */
.locale-lt-lt .inline-edit-row fieldset label span.title {
width: 8em;
}
.locale-lt-lt .inline-edit-row fieldset label span.input-text-wrap {
margin-left: 8em;
}
.update-php .spinner {
float: none;
margin: -4px 0;
}
| zyblog | trunk/zyblog/wp-admin/css/wp-admin.css | CSS | asf20 | 145,132 |
.control-section .customize-section-title {
font-family: Tahoma, Arial, sans-serif;
}
.customize-section-title:after {
right: auto;
left: 20px;
}
#customize-header-actions .button-primary {
float: left;
}
#customize-header-actions .spinner {
float: left;
margin-right: 0;
margin-left: 4px;
}
.customize-control {
float: right;
}
.customize-control-radio input,
.customize-control-checkbox input {
margin-right: 0;
margin-left: 5px;
}
/*
* Dropdowns
*/
.customize-section .dropdown {
float: right;
}
.customize-section .dropdown-content {
float: right;
margin-right: 0px;
margin-left: 16px;
-webkit-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
}
.customize-control .dropdown-arrow {
right: auto;
left: 0;
border-color: #ccc;
border-style: solid;
border-width: 1px 0 1px 1px;
-webkit-border-radius: 3px 0 0 3px;
border-radius: 3px 0 0 3px;
}
.customize-control .dropdown-arrow:after {
right: auto;
left: 4px;
}
/*
* Color Picker
*/
.customize-control-color .dropdown {
margin-right: 0;
margin-left: 5px;
}
.customize-section input[type="text"].color-picker-hex {
float: right;
}
/*
* Image Picker
*/
.customize-section .customize-control-image .actions {
text-align: left;
}
.customize-control-image .library,
.customize-control-image .actions,
.customize-section .customize-control-image .library ul,
.customize-section .customize-control-image .library li,
.customize-section .customize-control-image .library-content {
float: right;
}
| zyblog | trunk/zyblog/wp-admin/css/customize-controls-rtl.css | CSS | asf20 | 1,496 |
.wp-color-picker {
width: 80px;
}
.wp-picker-container .hidden {
display: none;
}
.wp-color-result {
background-color: #f9f9f9;
border: 1px solid #bbb;
border-radius: 2px;
cursor: pointer;
display: inline-block;
height: 22px;
margin: 0 6px 6px 0px;
position: relative;
top: 1px;
user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
vertical-align: bottom;
display: inline-block;
padding-left: 30px;
}
.wp-color-result:after {
background: #f3f3f3;
background-image: -webkit-gradient(linear, left top, left bottom, from(#fefefe), to(#f4f4f4));
background-image: -webkit-linear-gradient(top, #fefefe, #f4f4f4);
background-image: -moz-linear-gradient(top, #fefefe, #f4f4f4);
background-image: -o-linear-gradient(top, #fefefe, #f4f4f4);
background-image: linear-gradient(to bottom, #fefefe, #f4f4f4);
color: #333;
text-shadow: 0 1px 0 #fff;
border-radius: 0 1px 1px 0;
border-left: 1px solid #bbb;
content: attr( title );
display: block;
font-size: 11px;
line-height: 22px;
padding: 0 6px;
position: relative;
right: 0;
text-align: center;
top: 0;
}
.wp-color-result:hover {
border-color: #aaa;
-webkit-box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.2 );
box-shadow: 0 1px 1px rgba( 0, 0, 0, 0.1 );
}
.wp-color-result:hover:after {
color: #222;
border-color: #aaa;
border-left: 1px solid #999;
}
.wp-color-result.wp-picker-open {
top: 0;
}
.wp-color-result.wp-picker-open:after {
content: attr( data-current );
}
.wp-picker-container, .wp-picker-container:active {
display: inline-block;
outline: 0;
}
.wp-color-result:focus {
border-color: #888;
-webkit-box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.2 );
box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.2 );
}
.wp-color-result:focus:after {
border-color: #888;
}
.wp-picker-open + .wp-picker-input-wrap {
display: inline-block;
vertical-align: top;
}
.wp-picker-container .button {
margin-left: 6px;
}
.wp-picker-container .iris-square-slider .ui-slider-handle:focus {
background-color: #555
}
.wp-picker-container .iris-picker {
border-color: #dfdfdf;
margin-top: 6px;
}
input[type="text"].iris-error {
background-color: #ffebe8;
border-color: #c00;
color: #000;
}
| zyblog | trunk/zyblog/wp-admin/css/color-picker.css | CSS | asf20 | 2,214 |
/*------------------------------------------------------------------------------
Hello, this is the RTL version of the main WordPress admin CSS file.
All the important stuff is in here.
TABLE OF CONTENTS:
------------------
1.0 - Text Elements
2.0 - Forms
3.0 - Actions
4.0 - Notifications
5.0 - TinyMCE
6.0 - Admin Header
6.1 - Screen Options Tabs
7.0 - Main Navigation
8.0 - Layout Blocks
9.0 - Dashboard
10.0 - List Posts
10.1 - Inline Editing
11.0 - Write/Edit Post Screen
11.1 - Custom Fields
11.2 - Post Revisions
11.3 - Featured Images
12.0 - Categories
13.0 - Tags
14.0 - Media Screen
14.1 - Media Uploader
14.2 - Image Editor
15.0 - Comments Screen
16.0 - Themes
16.1 - Custom Header
16.2 - Custom Background
16.3 - Tabbed Admin Screen Interface
17.0 - Plugins
18.0 - Users
19.0 - Tools
20.0 - Settings
21.0 - Admin Footer
22.0 - About Pages
23.0 - Misc
24.0 - Dead
25.0 - TinyMCE tweaks
26.0 - Full Overlay w/ Sidebar
27.0 - Customize Loader
------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------
1.0 - Text Styles
------------------------------------------------------------------------------*/
ol {
margin-left: 0;
margin-right: 2em;
}
.code, code {
font-family: monospace;
direction: ltr;
}
.quicktags, .search {
font: 12px Tahoma, Arial, sans-serif;
}
.icon32 {
float: right;
margin-right: 0;
margin-left: 8px;
}
.icon16 {
float: right;
margin-right: -8px;
margin-left: 0;
}
.howto {
font-style: normal;
font-family: Tahoma, Arial, sans-serif;
}
p.install-help {
font-style: normal;
}
/*------------------------------------------------------------------------------
2.0 - Forms
------------------------------------------------------------------------------*/
#doaction,
#doaction2,
#post-query-submit {
margin-right: 0;
margin-left: 8px;
}
#timezone_string option {
margin-left: 0;
margin-right: 1em;
}
#pass-strength-result {
float: right;
margin: 13px 1px 5px 5px;
}
p.search-box {
float: left;
}
.search-box input[name="s"],
#search-plugins input[name="s"],
.tagsdiv .newtag {
float: right;
margin-right: 0;
margin-left: 4px;
}
input[type=password] {
direction: ltr;
}
input[type="text"].ui-autocomplete-loading {
background: transparent url('../images/loading.gif') no-repeat left center;
}
ul#add-to-blog-users {
margin: 0 14px 0 0;
}
.ui-autocomplete li {
text-align: right;
}
/*------------------------------------------------------------------------------
3.0 - Actions
------------------------------------------------------------------------------*/
#delete-action {
float: right;
}
#publishing-action {
float: left;
text-align: left;
}
#publishing-action .spinner {
float: right;
}
#post-body .misc-pub-section {
border-right: 0;
border-left-width: 1px;
border-left-style: solid;
}
#post-body .misc-pub-section-last {
border-left: 0;
}
#minor-publishing-actions {
padding: 10px 8px 2px 10px;
text-align: left;
}
#save-post {
float: right;
}
.preview {
float: left;
}
#sticky-span {
margin-left: 0;
margin-right: 18px;
}
.side-info ul {
padding-left: 0;
padding-right: 18px;
}
td.action-links,
th.action-links {
text-align: left;
}
/*------------------------------------------------------------------------------
4.0 - Notifications
------------------------------------------------------------------------------*/
form.upgrade .hint {
font-style: normal;
}
#ajax-response.alignleft {
margin-left: 0;
margin-right: 2em;
}
/*------------------------------------------------------------------------------
5.0 - TinyMCE
------------------------------------------------------------------------------*/
#quicktags {
background-position: right top;
}
#ed_reply_toolbar input {
margin: 1px 1px 1px 2px;
}
/*------------------------------------------------------------------------------
6.0 - Admin Header
------------------------------------------------------------------------------*/
#wphead {
height: 32px;
margin-left: 15px;
margin-right: 2px;
}
#header-logo {
float: right;
}
#wphead h1 {
float: right;
}
/*------------------------------------------------------------------------------
6.1 - Screen Options Tabs
------------------------------------------------------------------------------*/
#screen-meta-links {
margin-right: 0;
margin-left: 24px;
}
#screen-meta {
margin-right: 5px;
margin-left: 15px;
}
#screen-options-link-wrap,
#contextual-help-link-wrap {
float: left;
margin-left: 0;
margin-right: 6px;
}
#screen-meta-links a.show-settings {
padding-right: 6px;
padding-left: 16px;
}
.toggle-arrow {
background-position: top right;
}
.toggle-arrow-active {
background-position: bottom right;
}
.metabox-prefs label {
padding-right: 0;
padding-left: 15px;
}
.metabox-prefs label input {
margin-right: 2px;
margin-left: 5px;
}
/*------------------------------------------------------------------------------
6.2 - Help Menu
------------------------------------------------------------------------------*/
#contextual-help-wrap {
margin-left: 0;
margin-right: -4px;
}
#contextual-help-back {
left: 170px;
right: 150px;
}
#contextual-help-wrap.no-sidebar #contextual-help-back {
left: 0;
right: 150px;
border-right-width: 1px;
border-left-width: 0;
-webkit-border-bottom-right-radius: 0;
border-bottom-right-radius: 0;
-webkit-border-bottom-left-radius: 2px;
border-bottom-left-radius: 2px;
}
.contextual-help-tabs {
float: right;
}
.contextual-help-tabs a {
padding-left: 5px;
padding-right: 12px;
}
.contextual-help-tabs .active {
margin-right: 0;
margin-left: -1px;
}
.contextual-help-tabs .active,
.contextual-help-tabs-wrap {
border-left: 0;
border-right-width: 1px;
}
.help-tab-content {
margin-right: 0;
margin-left: 22px;
}
.help-tab-content li {
margin-left: 0;
margin-right: 18px;
}
.contextual-help-sidebar {
float: left;
padding-right: 12px;
padding-left: 8px;
}
/*------------------------------------------------------------------------------
7.0 - Main Navigation (Right Menu) (RTL: Left Menu)
------------------------------------------------------------------------------*/
.folded #wpcontent {
margin-left: 0;
margin-right: 52px;
}
.folded.wp-admin #wpfooter {
margin-left: 15px;
margin-right: 52px;
}
#adminmenuback,
#adminmenuwrap {
border-width: 0 0 0 1px;
}
#adminmenushadow {
right: auto;
left: 0;
}
#adminmenu li .wp-submenu {
left: auto;
right: 146px;
}
.folded #adminmenu .wp-submenu.sub-open,
.folded #adminmenu .opensub .wp-submenu,
.folded #adminmenu .wp-has-current-submenu .wp-submenu.sub-open,
.folded #adminmenu .wp-has-current-submenu.opensub .wp-submenu,
.folded #adminmenu a.menu-top:focus + .wp-submenu,
.folded #adminmenu .wp-has-current-submenu a.menu-top:focus + .wp-submenu,
.no-js.folded #adminmenu .wp-has-submenu:hover .wp-submenu {
left: auto;
right: 32px;
}
#adminmenu div.wp-menu-image,
.folded #adminmenu div.wp-menu-image {
float: right;
width: 30px;
}
#adminmenu .wp-submenu a,
#adminmenu li li a,
.folded #adminmenu .wp-not-current-submenu li a {
padding-left: 0;
padding-right: 12px;
}
#adminmenu .wp-not-current-submenu li a {
padding-left: 0;
padding-right: 18px;
}
.wp-menu-arrow {
right: 0;
-moz-transform: translate( -139px );
-webkit-transform: translate( -139px );
-o-transform: translate( -139px );
-ms-transform: translate( -139px );
transform: translate( -139px );
}
.ie8 .wp-menu-arrow {
right: -20px;
}
#adminmenu .wp-menu-arrow div {
left: -8px;
width: 16px;
}
#adminmenu li.wp-not-current-submenu .wp-menu-arrow {
-moz-transform: translate( -138px );
-webkit-transform: translate( -138px );
-o-transform: translate( -138px );
-ms-transform: translate( -138px );
transform: translate( -138px );
}
.folded #adminmenu li .wp-menu-arrow {
-moz-transform: translate( -26px );
-webkit-transform: translate( -26px );
-o-transform: translate( -26px );
-ms-transform: translate( -26px );
transform: translate( -26px );
}
#adminmenu .wp-not-current-submenu .wp-menu-arrow div {
border-style: solid solid none none;
border-width: 1px 1px 0 0;
}
#adminmenu .wp-menu-image img {
padding: 7px 7px 0 0;
}
#adminmenu .wp-submenu .wp-submenu-head {
padding: 5px 10px 5px 4px;
-webkit-border-top-right-radius: 0;
-webkit-border-top-left-radius: 3px;
border-top-right-radius: 0;
border-top-left-radius: 3px;
}
.folded #adminmenu li.wp-has-current-submenu .wp-submenu {
border-width: 1px;
border-style: solid;
-webkit-border-bottom-right-radius: 0;
-webkit-border-bottom-left-radius: 3px;
-webkit-border-top-right-radius: 0;
-webkit-border-top-left-radius: 3px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 3px;
border-top-right-radius: 0;
border-top-left-radius: 3px;
}
#adminmenu .awaiting-mod,
#adminmenu span.update-plugins,
#sidemenu li a span.update-plugins {
font-family: Tahoma, Arial, sans-serif;
margin-left: 0;
margin-right: 7px;
}
#collapse-button {
float: right;
}
/* Auto-folding of the admin menu */
@media only screen and (max-width: 900px) {
.auto-fold #wpcontent {
margin-left: 0;
margin-right: 52px;
}
.auto-fold.wp-admin #wpfooter {
margin-left: 15px;
margin-right: 52px;
}
.auto-fold #adminmenu div.wp-menu-image {
float: right;
width: 30px;
}
.auto-fold #adminmenu .wp-submenu.sub-open,
.auto-fold #adminmenu .opensub .wp-submenu,
.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu.sub-open,
.auto-fold #adminmenu .wp-has-current-submenu.opensub .wp-submenu,
.auto-fold #adminmenu a.menu-top:focus + .wp-submenu,
.auto-fold #adminmenu .wp-has-current-submenu a.menu-top:focus + .wp-submenu,
.no-js.auto-fold #adminmenu .wp-has-submenu:hover .wp-submenu {
left: auto;
right: 32px;
}
.auto-fold #adminmenu .wp-not-current-submenu li a {
padding-left: 0;
padding-right: 12px;
}
.auto-fold #adminmenu li .wp-menu-arrow {
-moz-transform: translate( -27px );
-webkit-transform: translate( -27px );
-o-transform: translate( -27px );
-ms-transform: translate( -27px );
transform: translate( -27px );
}
.auto-fold #adminmenu li.wp-has-current-submenu .wp-submenu {
border-width: 1px;
border-style: solid;
-webkit-border-bottom-right-radius: 0;
-webkit-border-bottom-left-radius: 3px;
-webkit-border-top-right-radius: 0;
-webkit-border-top-left-radius: 3px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 3px;
border-top-right-radius: 0;
border-top-left-radius: 3px;
}
}
/* List table styles */
.post-com-count-wrapper {
font-family: Tahoma, Arial, sans-serif;
}
.post-com-count {
background-image: url('../images/bubble_bg-rtl.gif');
}
.column-response .post-com-count {
float: right;
margin-right: 0;
margin-left: 5px;
}
.response-links {
float: right;
}
/*------------------------------------------------------------------------------
8.0 - Layout Blocks
------------------------------------------------------------------------------*/
.widefat th {
font-family: Tahoma, Arial, sans-serif;
}
.postbox-container {
float: right;
}
#post-body-content {
float: right;
}
#poststuff #post-body.columns-2 {
margin-left: 300px;
margin-right: 0;
}
#post-body.columns-2 #postbox-container-1 {
float: left;
margin-left: -300px;
margin-right: 0;
}
@media only screen and (max-width: 850px) {
#wpbody-content #post-body.columns-2 #postbox-container-1 {
margin-left: 0;
}
}
.postbox .handlediv {
float: left;
}
/*------------------------------------------------------------------------------
9.0 - Dashboard
------------------------------------------------------------------------------*/
#the-comment-list p.comment-author img {
float: right;
margin-right: 0;
margin-left: 8px;
}
/* Browser Nag */
#dashboard_browser_nag p.browser-update-nag.has-browser-icon {
padding-right: 0;
padding-left: 125px;
}
/* Welcome Panel */
.welcome-panel .welcome-panel-close {
right: auto;
left: 10px;
}
.welcome-panel .welcome-panel-close:before {
left: auto;
right: -12px;
}
.welcome-panel-content {
margin-left: 0;
margin-right: 13px;
}
.welcome-panel .welcome-panel-column {
float: right;
}
.welcome-panel .welcome-panel-column ul {
margin-right: 0;
margin-left: 1em;
}
.welcome-panel .welcome-panel-column li {
padding-left: 0;
padding-right: 2px;
}
.welcome-panel .welcome-add-page {
background-position: right 2px;
}
.welcome-panel .welcome-edit-page {
background-position: right -90px;
}
.welcome-panel .welcome-learn-more {
background-position: right -136px;
}
.welcome-panel .welcome-comments {
background-position: right -182px;
}
.welcome-panel .welcome-view-site {
background-position: right -274px;
}
.welcome-panel .welcome-widgets-menus {
background-position: right -229px;
line-height: 14px;
}
.welcome-panel .welcome-write-blog {
background-position: right -44px;
}
.welcome-panel .welcome-icon {
padding: 2px 32px 8px 0;
}
@media screen and (max-width: 870px) {
.welcome-panel .welcome-panel-column li {
margin-right: 0;
margin-left: 13px;
}
.welcome-panel .welcome-icon {
padding-right: 25px;
padding-left: 0;
}
}
/*------------------------------------------------------------------------------
10.0 - List Posts (/Pages/etc)
------------------------------------------------------------------------------*/
.fixed .column-comments {
text-align: right;
}
.fixed .column-comments .vers {
padding-left: 0;
padding-right: 3px;
}
.fixed .column-comments a {
float: right;
}
.sorting-indicator {
margin-left: 0;
margin-right: 7px;
}
th.sortable a span,
th.sorted a span {
float: right;
}
/* Bulk Actions */
.tablenav-pages a {
margin-right: 0;
margin-left: 1px;
}
.tablenav-pages .next-page {
margin-left: 0;
margin-right: 2px;
}
.tablenav a.button-secondary {
margin: 3px 0 0 8px;
}
.tablenav .tablenav-pages {
float: left;
}
.tablenav .displaying-num {
margin-right: 0;
margin-left: 10px;
font-family: Tahoma, Arial, sans-serif;
font-style: normal;
}
.tablenav .actions {
padding: 2px 0 0 8px;
}
.tablenav .actions select {
float: right;
margin-right: 0;
margin-left: 6px;
}
.tablenav .delete {
margin-right: 0;
margin-left: 20px;
}
.view-switch {
float: left;
}
.filter {
float: right;
margin: -5px 10px 0 0;
}
.filter .subsubsub {
margin-left: 0;
margin-right: -10px;
}
#posts-filter fieldset {
float: right;
margin: 0 0 1em 1.5ex;
}
#posts-filter fieldset legend {
padding: 0 1px .2em 0;
}
/*------------------------------------------------------------------------------
10.1 - Inline Editing
------------------------------------------------------------------------------*/
#wpbody-content .inline-edit-row fieldset {
float: right;
}
#wpbody-content .quick-edit-row-page fieldset.inline-edit-col-right .inline-edit-col {
border-width: 0 1px 0 0;
}
#wpbody-content .bulk-edit-row .inline-edit-col-bottom {
float: left;
}
.inline-edit-row fieldset label span.title {
float: right;
}
.inline-edit-row fieldset label span.input-text-wrap {
margin-left: 0;
margin-right: 5em;
}
.quick-edit-row-post fieldset.inline-edit-col-right label span.title {
padding-right: 0;
padding-left: 0.5em;
}
#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child {
margin-right: 0;
margin-left: 0.5em
}
/* Styling */
.inline-edit-row fieldset span.title,
.inline-edit-row fieldset span.checkbox-title {
font-family: Tahoma, Arial, sans-serif;
font-style: normal;
}
.inline-edit-row fieldset .inline-edit-date {
float: right;
}
.inline-edit-row fieldset ul.cat-checklist label,
.inline-edit-row .catshow,
.inline-edit-row .cathide,
.inline-edit-row #bulk-titles div {
font-family: Tahoma, Arial, sans-serif;
}
.quick-edit-row-post fieldset label.inline-edit-status {
float: right;
}
#bulk-titles div a {
float: right;
margin: 3px -2px 0 3px;
overflow: hidden;
text-indent: -9999px;
}
/*------------------------------------------------------------------------------
11.0 - Write/Edit Post Screen
------------------------------------------------------------------------------*/
#save-action .spinner,
#show-comments a,
#show-comments .spinner {
float: right;
}
#titlediv #title-prompt-text,
#wp-fullscreen-title-prompt-text {
right: 0;
}
#sample-permalink {
direction: ltr;
}
#sample-permalink #editable-post-name {
unicode-bidi: embed;
}
#wp-fullscreen-title-prompt-text {
left: auto;
right: 0;
}
#wp-fullscreen-save .spinner,
#wp-fullscreen-save .fs-saved {
float: left;
}
#edit-slug-box .cancel {
margin-right: 0;
margin-left: 10px;
}
.postarea h3 label {
float: right;
}
.submitbox .submit {
text-align: right;
}
.inside-submitbox #post_status {
margin: 2px -2px 2px 0;
}
.submitbox .submit input {
margin-right: 0;
margin-left: 4px;
}
#normal-sortables .postbox .submit {
float: left;
}
.taxonomy div.tabs-panel {
margin: 0 125px 0 5px;
}
#side-sortables .comments-box thead th,
#normal-sortables .comments-box thead th {
font-style: normal;
}
#commentsdiv .spinner {
padding-left: 0;
padding-right: 5px;
}
#post-body .add-menu-item-tabs li.tabs {
border-width: 1px 1px 1px 0;
margin-right: 0;
margin-left: -1px;
}
/* Global classes */
#post-body .tagsdiv #newtag {
margin-right: 0;
margin-left: 5px;
}
.autosave-info {
padding: 2px 2px 2px 15px;
text-align: left;
}
#post-body .wp_themeSkin .mceStatusbar a.mceResize {
background: transparent url('../images/resize-rtl.gif') no-repeat scroll left bottom;
cursor: sw-resize;
}
.curtime #timestamp {
background-position: right top;
padding-left: 0;
padding-right: 18px;
}
.compat-attachment-fields th {
padding-right: 0;
padding-left: 10px;
}
/*------------------------------------------------------------------------------
11.1 - Custom Fields
------------------------------------------------------------------------------*/
/* No RTL for now, this space intentionally left blank */
/*------------------------------------------------------------------------------
11.2 - Post Revisions
------------------------------------------------------------------------------*/
table.diff td, table.diff th {
font-family: Consolas, Monaco, monospace;
}
/*------------------------------------------------------------------------------
11.3 - Featured Images
------------------------------------------------------------------------------*/
#select-featured-image a {
float: right;
}
/*------------------------------------------------------------------------------
12.0 - Categories
------------------------------------------------------------------------------*/
.category-adder {
margin-left: 0;
margin-right: 120px;
}
#post-body ul.add-menu-item-tabs {
float: right;
text-align: left;
/* Negative margin for the sake of those without JS: all tabs display */
margin: 0 5px 0 -120px;
}
#post-body ul.add-menu-item-tabs li.tabs {
-webkit-border-top-left-radius: 0;
-webkit-border-top-right-radius: 3px;
-webkit-border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 3px;
border-top-left-radius: 0;
border-top-right-radius: 3px;
border-bottom-left-radius: 0;
border-bottom-right-radius: 3px;
}
#front-page-warning,
#front-static-pages ul,
ul.export-filters,
.inline-editor ul.cat-checklist ul,
.categorydiv ul.categorychecklist ul,
.customlinkdiv ul.categorychecklist ul,
.posttypediv ul.categorychecklist ul,
.taxonomydiv ul.categorychecklist ul {
margin-left: 0;
margin-right: 18px;
}
#post-body .add-menu-item-tabs li.tabs {
border-style: solid solid solid none;
border-width: 1px 1px 1px 0;
margin-right: 0;
margin-left: -1px;
}
p.help,
p.description,
span.description,
.form-wrap p {
font-style: normal;
font-family: Tahoma, Arial, sans-serif;
}
/*------------------------------------------------------------------------------
13.0 - Tags
------------------------------------------------------------------------------*/
.taghint {
margin: 15px 12px -24px 0;
}
#poststuff .tagsdiv .howto {
margin: 0 8px 6px 0;
}
.ac_results li {
text-align: right;
}
.links-table th {
text-align: right;
}
/*------------------------------------------------------------------------------
14.0 - Media Screen
------------------------------------------------------------------------------*/
#wpbody-content .describe th {
text-align: right;
}
.describe .media-item-info .A1B1 {
padding: 0 10px 0 0;
}
.media-upload-form td label {
margin-left: 6px;
margin-right: 2px;
}
.media-upload-form .align .field label {
padding: 0 23px 0 0;
margin: 0 3px 0 1em;
}
.media-upload-form tr.image-size label {
margin: 0 5px 0 0;
}
#wpbody-content .describe p.help {
padding: 0 5px 0 0;
}
.media-item .edit-attachment,
.media-item .error-div a.dismiss,
.describe-toggle-on,
.describe-toggle-off {
float: left;
margin-right: 0;
margin-left: 15px;
}
.media-item .error-div a.dismiss {
padding: 0 15px 0 0;
}
.media-item .error-div {
padding-left: 0;
padding-right: 10px;
}
.media-item .pinkynail {
float: right;
}
.media-item .describe td {
padding: 0 0 8px 8px;
}
.media-item .progress {
float: left;
margin: 6px 0 0 10px;
}
/*------------------------------------------------------------------------------
14.1 - Media Uploader
------------------------------------------------------------------------------*/
#find-posts-input {
float: right;
}
#find-posts-search {
float: right;
margin-right: 3px;
margin-left: 4px;
}
.find-box-search .spinner {
left: auto;
right: 115px;
}
#find-posts-response .found-radio {
padding: 5px 8px 0 0;
}
.find-box-search label {
padding-right: 0;
padding-left: 6px;
}
.find-box #resize-se {
right: auto;
left: 1px;
}
form.upgrade .hint {
font-style: normal;
}
/*------------------------------------------------------------------------------
14.2 - Image Editor
------------------------------------------------------------------------------*/
.wp_attachment_image .button,
.A1B1 .button {
float: right;
}
.wp_attachment_image .spinner,
.A1B1 .spinner {
float: right;
}
.imgedit-menu div {
float: right;
}
.imgedit-crop {
margin: 0;
}
.imgedit-rleft,
.imgedit-flipv,
.imgedit-undo {
margin: 0 8px 0 3px;
}
.imgedit-rright,
.imgedit-fliph,
.imgedit-redo {
margin: 0 3px;
}
.imgedit-applyto img {
margin: 0 0 0 8px;
}
.imgedit-help {
font-style: normal;
}
.imgedit-submit-btn {
margin-left: 0;
margin-right: 20px;
}
/*------------------------------------------------------------------------------
15.0 - Comments Screen
------------------------------------------------------------------------------*/
.form-table th {
text-align: right;
}
.form-table input.tog {
margin-right: 0;
margin-left: 2px;
float: right;
}
.form-table table.color-palette {
float: right;
}
/* reply to comments */
#replysubmit .spinner,
.inline-edit-save .spinner {
float: left;
}
#replysubmit .button {
margin-right: 0;
margin-left: 5px;
}
#edithead .inside {
float: right;
padding: 3px 5px 2px 0;
}
.comment-ays th {
border-right-style: none;
border-left-style: solid;
border-right-width: 0;
border-left-width: 1px;
}
.spam-undo-inside .avatar,
.trash-undo-inside .avatar {
margin-left: 8px;
}
#comment-status-radio input {
margin: 2px 0 5px 3px;
}
/*------------------------------------------------------------------------------
16.0 - Themes
------------------------------------------------------------------------------*/
h3.available-themes {
float: right;
}
.available-theme {
margin-right: 0;
margin-left: 10px;
padding: 20px 0 20px 20px;
}
#current-theme .theme-info li,
.theme-options li,
.available-theme .action-links li {
float: right;
padding-right: 0;
padding-left: 10px;
margin-right: 0;
margin-left: 10px;
border-right: none;
border-left: 1px solid #dfdfdf;
}
.available-theme .action-links li {
padding-left: 8px;
margin-left: 8px;
}
.ie8 .available-theme .action-links li {
padding-left: 7px;
margin-left: 7px;
}
#current-theme .theme-info li:last-child,
.theme-options li:last-child,
.available-theme .action-links li:last-child {
padding-left: 0;
margin-right: 0;
border-left: 0;
}
.available-theme .action-links .delete-theme {
float: left;
margin-left: 0;
margin-right: 8px;
}
.available-theme .action-links p {
float: right;
}
#current-theme.has-screenshot {
padding-left: 0;
padding-right: 330px;
}
#current-theme h4 span {
margin-left: 0;
margin-right: 20px;
}
#current-theme img {
float: right;
width: 300px;
margin-left: 0;
margin-right: -330px;
}
.theme-options .load-customize {
margin-right: 0;
margin-left: 30px;
float: right;
}
.theme-options span {
float: right;
margin-right: 0;
margin-left: 10px;
}
.theme-options ul {
float: right;
}
/* Allow for three-up on 1024px wide screens, e.g. tablets */
@media only screen and (max-width: 1200px) {
#current-theme.has-screenshot {
padding-right: 270px;
}
#current-theme img {
margin-right: -270px;
width: 240px;
}
}
#broken-themes {
text-align: right;
}
/*------------------------------------------------------------------------------
16.1 - Custom Header Screen
------------------------------------------------------------------------------*/
.appearance_page_custom-header .available-headers .default-header {
float: right;
margin: 0 0 20px 20px;
}
.appearance_page_custom-header .random-header {
margin: 0 0 20px 20px;
}
.appearance_page_custom-header .available-headers label input,
.appearance_page_custom-header .random-header label input {
margin-right: 0;
margin-left: 10px;
}
/*------------------------------------------------------------------------------
16.2 - Custom Background Screen
------------------------------------------------------------------------------*/
/* No RTL for now, this space intentionally left blank */
/*------------------------------------------------------------------------------
16.3 - Tabbed Admin Screen Interface (Experimental)
------------------------------------------------------------------------------*/
.nav-tab {
margin: 0 0 -1px 6px;
}
h2 .nav-tab {
font-family: Tahoma, Arial, sans-serif;
}
/*------------------------------------------------------------------------------
17.0 - Plugins
------------------------------------------------------------------------------*/
.plugins .desc ul,
.plugins .desc ol {
margin: 0 2em 0 0;
}
#wpbody-content .plugins .plugin-title, #wpbody-content .plugins .theme-title {
padding-right: 0;
padding-left: 12px;
}
/*------------------------------------------------------------------------------
18.0 - Users
------------------------------------------------------------------------------*/
#profile-page .form-table #rich_editing {
margin-right: 0;
margin-left: 5px
}
#profile-page #pass1,
#profile-page #pass2,
#profile-page #user_login {
direction: ltr;
}
#your-profile legend {
font-family: Tahoma, Arial, sans-serif;
}
/*------------------------------------------------------------------------------
19.0 - Tools
------------------------------------------------------------------------------*/
.pressthis a span {
background-position: right 5px;
padding: 8px 27px 8px 11px;
}
.pressthis a:after {
right: auto;
left: 10px;
background: transparent;
transform: skew(-20deg) rotate(-6deg);
-webkit-transform: skew(-20deg) rotate(-6deg);
-moz-transform: skew(-20deg) rotate(-6deg);
}
.pressthis a:hover:after {
transform: skew(-20deg) rotate(-9deg);
-webkit-transform: skew(-20deg) rotate(-9deg);
-moz-transform: skew(-20deg) rotate(-9deg);
}
/*------------------------------------------------------------------------------
20.0 - Settings
------------------------------------------------------------------------------*/
#utc-time, #local-time {
padding-left: 0;
padding-right: 25px;
font-style: normal;
font-family: Tahoma, Arial, sans-serif;
}
/*------------------------------------------------------------------------------
21.0 - Admin Footer
------------------------------------------------------------------------------*/
#wpfooter {
margin-left: 20px;
}
#wpcontent,
#wpfooter {
margin-right: 165px;
}
/*------------------------------------------------------------------------------
22.0 - About Pages
------------------------------------------------------------------------------*/
.wrap.about-wrap {
margin-left: 40px;
margin-right: 20px;
}
.about-wrap h1,
.about-text {
margin-right: 0;
margin-left: 200px;
}
.about-wrap h2.nav-tab-wrapper {
padding-left: 0px;
padding-right: 6px;
}
.about-wrap .wp-badge {
right: auto;
left: 0;
}
.about-wrap h2 .nav-tab {
margin-right: 0;
margin-left: 3px;
}
.about-wrap .changelog li {
margin-left: 0;
margin-right: 3em;
}
.about-wrap .three-col-images .last-feature {
float: left;
}
.about-wrap .three-col-images .first-feature {
float: right;
}
.about-wrap .feature-section.three-col div {
margin-right: 0;
margin-left: 4.999999999%;
float: right;
}
.about-wrap .feature-section.three-col h4 {
text-align: right;
}
.about-wrap .feature-section.three-col img {
margin-right: 5px;
margin-left: 0;
}
.about-wrap .feature-section.three-col .last-feature {
margin-left: 0;
}
.about-wrap .feature-section img {
margin: 0 0 10px 0.7%;
}
.about-wrap .feature-section.images-stagger-right img {
float: left;
margin: 0 2em 12px 5px;
}
.about-wrap .feature-section.images-stagger-left img {
float: right;
margin: 0 5px 12px 2em;
}
.about-wrap li.wp-person,
.about-wrap li.wp-person img.gravatar {
float: right;
margin-right: 0;
margin-left: 10px;
}
@media only screen and (max-width: 768px) {
.about-wrap .feature-section img.image-66 {
float: none;
}
.about-wrap .feature-section.images-stagger-right img.image-66 {
margin-right: 3px;
}
.about-wrap .feature-section.images-stagger-left img.image-66 {
margin-left: 3px;
}
}
/*------------------------------------------------------------------------------
23.0 - Misc
------------------------------------------------------------------------------*/
#template div {
margin-right: 0;
margin-left: 190px;
}
.column-author img, .column-username img {
float: right;
margin-right: 0;
margin-left: 10px;
}
.tagchecklist {
margin-left: 0;
margin-right: 14px;
}
.tagchecklist strong {
margin-left: 0;
margin-right: -8px;
}
.tagchecklist span {
margin-right: 0;
margin-left: 25px;
float: right;
}
.tagchecklist span a {
margin: 6px -9px 0pt 0pt;
float: right;
}
#poststuff h2 {
clear: right;
}
#poststuff h3,
.metabox-holder h3 {
font-family: Tahoma, Arial, sans-serif;
}
.tool-box .title {
font-family: Tahoma, Arial, sans-serif;
}
#sidemenu {
margin: -30px 315px 0 15px;
float: left;
padding-left: 0;
padding-right: 10px;
}
#sidemenu a {
float: right;
}
table .vers,
table .column-visible,
table .column-rating {
text-align: right;
}
.screen-meta-toggle {
right: auto;
left: 15px;
}
.screen-reader-text,
.screen-reader-text span,
.ui-helper-hidden-accessible {
left: auto;
right: -1000em;
}
.screen-reader-shortcut:focus {
left: auto;
right: 6px;
}
/*------------------------------------------------------------------------------
24.0 - Dead
------------------------------------------------------------------------------*/
/* - Not used anywhere in WordPress - verify and then deprecate
------------------------------------------------------------------------------*/
/* No RTL for now, this space intentionally left blank */
/* - Only used once or twice in all of WP - deprecate for global style
------------------------------------------------------------------------------*/
* html #template div {margin-left: 0;}
/* - Used - but could/should be deprecated with a CSS reset
------------------------------------------------------------------------------*/
/* No RTL for now, this space intentionally left blank */
/*------------------------------------------------------------------------------
25.0 - TinyMCE tweaks
Small tweaks for until tinymce css files are proprely RTLized
------------------------------------------------------------------------------*/
#editorcontainer .wp_themeSkin .mceStatusbar {
padding-left: 0;
padding-right: 5px;
}
#editorcontainer .wp_themeSkin .mceStatusbar div {
float: right;
}
#editorcontainer .wp_themeSkin .mceStatusbar a.mceResize {
float: left;
}
#content-resize-handle {
background: transparent url('../images/resize-rtl.gif') no-repeat scroll left bottom;
right: auto;
left: 2px;
cursor: sw-resize;
}
/*------------------------------------------------------------------------------
26.0 - Full Overlay w/ Sidebar
------------------------------------------------------------------------------*/
.wp-full-overlay .wp-full-overlay-sidebar {
margin: 0;
left: auto;
right: 0;
border-right: 0;
border-left: 1px solid rgba( 0, 0, 0, 0.2 );
}
.wp-full-overlay-sidebar:after {
right: auto;
left: 0;
box-shadow: inset 5px 0 4px -4px rgba(0, 0, 0, 0.1);
}
.wp-full-overlay.collapsed,
.wp-full-overlay.expanded .wp-full-overlay-sidebar {
margin-right: 0 !important;
}
.wp-full-overlay.expanded {
margin-right: 300px;
margin-left: 0;
}
.wp-full-overlay.collapsed .wp-full-overlay-sidebar {
margin-right: -300px;
margin-left: 0;
}
/* Collapse Button */
.wp-full-overlay .collapse-sidebar {
right: 0;
left: auto;
margin-right: 15px;
}
.wp-full-overlay.collapsed .collapse-sidebar {
right: 100%;
}
.wp-full-overlay .collapse-sidebar-arrow {
margin-right: 2px;
margin-left: 0;
background: transparent url('../images/arrows.png') no-repeat 0 -108px;
}
.wp-full-overlay.collapsed .collapse-sidebar-arrow {
background-position: 0 -72px;
}
.wp-full-overlay .collapse-sidebar-label {
right: 100%;
left: auto;
margin-right: 10px;
margin-left: 0;
}
/*------------------------------------------------------------------------------
27.0 - Customize Loader
------------------------------------------------------------------------------*/
.install-theme-info .theme-install {
float: left;
}
/* MERGED */
/* global */
/* 2 column liquid layout */
#wpcontent {
margin-left: 0;
margin-right: 165px;
}
#wpbody-content {
float: right;
}
#adminmenuwrap {
float: right;
}
#adminmenu {
clear: right;
}
/* inner 2 column liquid layout */
.inner-sidebar {
float: left;
clear: left;
}
.has-right-sidebar #post-body {
float: right;
clear: right;
margin-right: 0;
margin-left: -340px;
}
.has-right-sidebar #post-body-content {
margin-right: 0;
margin-left: 300px;
}
/* 2 columns main area */
#col-right {
float: left;
clear: left;
}
/* utility classes*/
.alignleft {
float: right;
}
.alignright {
float: left;
}
.textleft {
text-align: right;
}
.textright {
text-align: left;
}
/* styles for use by people extending the WordPress interface */
body,
td,
textarea,
input,
select {
font-family: Tahoma, Arial, sans-serif;
}
ul.ul-disc,
ul.ul-square,
ol.ol-decimal {
margin-left: 0;
margin-right: 1.8em;
}
.subsubsub {
float: right;
}
.widefat thead th:first-of-type {
-webkit-border-top-left-radius: 0;
-webkit-border-top-right-radius: 3px;
border-top-left-radius: 0;
border-top-right-radius: 3px;
}
.widefat thead th:last-of-type {
-webkit-border-top-right-radius: 0;
-webkit-border-top-left-radius: 3px;
border-top-right-radius: 0;
border-top-left-radius: 3px;
}
.widefat tfoot th:first-of-type {
-webkit-border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 3px;
border-bottom-left-radius: 0;
border-bottom-right-radius: 3px;
}
.widefat tfoot th:last-of-type {
-webkit-border-bottom-right-radius: 0;
-webkit-border-bottom-left-radius: 3px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 3px;
}
.widefat th {
text-align: right;
}
.widefat th input {
margin: 0 8px 0 0;
}
.wrap {
margin-right: 0;
margin-left: 15px;
}
.wrap h2,
.subtitle {
font-family: Tahoma, Arial, sans-serif;
}
.wrap h2 {
padding-right: 0;
padding-left: 15px;
}
.subtitle {
padding-left: 0;
padding-right: 25px;
}
.wrap .add-new-h2 {
font-family: Tahoma, Arial, sans-serif;
margin-left: 0;
margin-right: 4px;
}
.wrap h2.long-header {
padding-left: 0;
}
/* dashboard */
#dashboard-widgets-wrap .has-sidebar {
margin-right: 0;
margin-left: -51%;
}
#dashboard-widgets-wrap .has-sidebar .has-sidebar-content {
margin-right: 0;
margin-left: 51%;
}
.view-all {
right: auto;
left: 0;
}
#dashboard_right_now p.sub,
#dashboard-widgets h4,
a.rsswidget,
#dashboard_plugins h4,
#dashboard_plugins h5,
#dashboard_recent_comments .comment-meta .approve,
#dashboard_right_now td.b,
#dashboard_right_now .versions a {
font-family: Tahoma, Arial, sans-serif;
}
#dashboard_right_now p.sub {
left:auto;
right:15px;
}
#dashboard_right_now td.b {
padding-right: 0;
padding-left: 6px;
text-align: left;
}
#dashboard_right_now .t {
padding-right: 0;
padding-left: 12px;
}
#dashboard_right_now .table_content {
float:right;
}
#dashboard_right_now .table_discussion {
float:left;
}
#dashboard_right_now a.button {
float: left;
clear: left;
}
#dashboard_plugins .inside span {
padding-left: 0;
padding-right: 5px;
}
#dashboard-widgets h3 .postbox-title-action {
right: auto;
left: 10px;
}
.js #dashboard-widgets h3 .postbox-title-action {
right: auto;
left: 30px;
}
#the-comment-list .pingback {
padding-left: 0 !important;
padding-right: 9px !important;
}
/* Recent Comments */
#the-comment-list .comment-item {
padding: 1em 70px 1em 10px;
}
#the-comment-list .comment-item .avatar {
float: right;
margin-left: 0;
margin-right: -60px;
}
/* Feeds */
.rss-widget cite {
text-align: left;
}
.rss-widget span.rss-date {
font-family: Tahoma, Arial, sans-serif;
margin-left: 0;
margin-right: 3px;
}
/* QuickPress */
#dashboard-widgets #dashboard_quick_press form p.submit input {
float: right;
}
#dashboard-widgets #dashboard_quick_press form p.submit #save-post {
margin: 0 1px 0 0.7em;
}
#dashboard-widgets #dashboard_quick_press form p.submit #publish {
float: left;
}
#dashboard-widgets #dashboard_quick_press form p.submit .spinner {
margin: 4px 0 0 6px;
}
/* Recent Drafts */
#dashboard_recent_drafts h4 abbr {
font-family: Tahoma, Arial, sans-serif;
margin-left:0;
margin-right: 3px;
}
/* login */
body.login {
font-family: Tahoma, Arial, sans-serif;
}
.login form {
margin-right: 8px;
margin-left: 0;
}
.login form .forgetmenot {
float: right;
}
.login form .submit {
float: left;
}
#login form .submit input {
font-family: Tahoma, Arial, sans-serif;
}
.login #nav,
.login #backtoblog {
margin: 0 16px 0 0;
}
#login_error,
.login .message {
margin: 0 8px 16px 0;
}
.login #user_pass,
.login #user_login,
.login #user_email {
margin-left: 6px;
margin-right: 0;
direction: ltr;
}
.login h1 a {
text-decoration: none;
}
.login .button-primary {
float: left;
}
/* nav-menu */
#nav-menus-frame {
margin-right: 300px;
margin-left: 0;
}
#wpbody-content #menu-settings-column {
margin-right: -300px;
margin-left: 0;
float: right;
}
/* Menu Container */
#menu-management-liquid {
float: right;
}
#menu-management {
margin-left: 20px;
margin-right: 0;
}
.post-body-plain {
padding: 10px 0 0 10px;
}
/* Menu Tabs */
#menu-management .nav-tabs-arrow-left {
right: 0;
left:auto;
}
#menu-management .nav-tabs-arrow-right {
left: 0;
right:auto;
text-align: left;
font-family: Tahoma, Arial, sans-serif;
}
#menu-management .nav-tabs {
padding-right: 20px;
padding-left: 10px;
}
.js #menu-management .nav-tabs {
float: right;
margin-right: 0px;
margin-left: -400px;
}
#select-nav-menu-container {
text-align: left;
}
#wpbody .open-label {
float:right;
}
#wpbody .open-label span {
padding-left: 10px;
padding-right:0;
}
.js .input-with-default-title {
font-style: normal;
font-weight: bold;
}
/* Add Menu Item Boxes */
.postbox .howto input {
float: left;
}
#nav-menu-theme-locations .button-controls {
text-align: left;
}
/* Button Primary Actions */
.meta-sep,
.submitcancel {
float: right;
}
#cancel-save {
margin-left: 0;
margin-right: 20px;
}
.button.right, .button-secondary.right, .button-primary.right {
float: left;
}
/* Button Secondary Actions */
.list-controls {
float: right;
}
.add-to-menu {
float: left;
}
/* Custom Links */
#add-custom-link label span {
float: right;
padding-left: 5px;
padding-right: 0;
}
.nav-menus-php .howto span {
float: right;
}
.list li .menu-item-title input {
margin-left: 3px;
margin-right: 0;
}
/* Nav Menu */
.menu-item-handle {
padding-right: 10px;
padding-left: 0;
}
.menu-item-edit-active .menu-item-handle {
-webkit-border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.menu-item-handle .item-title {
margin-left:13em;
margin-right:0;
}
.menu-item-handle .item-edit {
right: auto;
left: -20px;
}
/* WARNING: The factor of 30px is hardcoded into the nav-menus javascript. */
.menu-item-depth-0 { margin-right: 0px; margin-left:0;}
.menu-item-depth-1 { margin-right: 30px; margin-left:0;}
.menu-item-depth-2 { margin-right: 60px; margin-left:0;}
.menu-item-depth-3 { margin-right: 90px; margin-left:0;}
.menu-item-depth-4 { margin-right: 120px; margin-left:0;}
.menu-item-depth-5 { margin-right: 150px; margin-left:0;}
.menu-item-depth-6 { margin-right: 180px; margin-left:0;}
.menu-item-depth-7 { margin-right: 210px; margin-left:0;}
.menu-item-depth-8 { margin-right: 240px; margin-left:0;}
.menu-item-depth-9 { margin-right: 270px; margin-left:0;}
.menu-item-depth-10 { margin-right: 300px; margin-left:0;}
.menu-item-depth-11 { margin-right: 330px; margin-left:0;}
.menu-item-depth-0 .menu-item-transport { margin-right: 0px; margin-left:0;}
.menu-item-depth-1 .menu-item-transport { margin-right: -30px; margin-left:0;}
.menu-item-depth-2 .menu-item-transport { margin-right: -60px; margin-left:0;}
.menu-item-depth-3 .menu-item-transport { margin-right: -90px; margin-left:0;}
.menu-item-depth-4 .menu-item-transport { margin-right: -120px; margin-left:0;}
.menu-item-depth-5 .menu-item-transport { margin-right: -150px; margin-left:0;}
.menu-item-depth-6 .menu-item-transport { margin-right: -180px; margin-left:0;}
.menu-item-depth-7 .menu-item-transport { margin-right: -210px; margin-left:0;}
.menu-item-depth-8 .menu-item-transport { margin-right: -240px; margin-left:0;}
.menu-item-depth-9 .menu-item-transport { margin-right: -270px; margin-left:0;}
.menu-item-depth-10 .menu-item-transport { margin-right: -300px; margin-left:0;}
.menu-item-depth-11 .menu-item-transport { margin-right: -330px; margin-left:0;}
/* Menu item controls */
.item-type {
padding-left: 10px;
padding-right:0;
}
.item-controls {
left: 20px;
right: auto;
}
.item-controls .item-order {
padding-left: 10px;
padding-right: 0;
}
.item-edit {
left: -20px;
right:auto;
-webkit-border-bottom-right-radius: 3px;
-webkit-border-bottom-left-radius: 0;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 0;
}
/* Menu editing */
.menu-item-settings {
padding: 10px 10px 10px 0;
border-width: 0 1px 1px 1px;
}
#custom-menu-item-url {
direction: ltr;
}
.link-to-original {
font-style: normal;
font-weight: bold;
}
.link-to-original a {
padding-right: 4px;
padding-left:0;
}
.menu-item-settings .description-thin,
.menu-item-settings .description-wide {
margin-left: 10px;
margin-right:0;
float: right;
}
/* Major/minor publishing actions (classes) */
.major-publishing-actions .publishing-action {
text-align: left;
float: left;
}
.major-publishing-actions .delete-action {
text-align: right;
float: right;
padding-left: 15px;
padding-right:0;
}
.menu-name-label {
margin-left: 15px;
margin-right:0;
}
.auto-add-pages {
float: right;
}
/* Star ratings */
div.star-holder {
background: url('../images/stars-rtl.png?ver=20121108') repeat-x bottom right;
}
div.star-holder .star-rating {
background: url('../images/stars-rtl.png?ver=20121108') repeat-x top right;
float: right;
}
#plugin-information ul#sidemenu {
left: auto;
right: 0;
}
#plugin-information h2 {
margin-right: 0;
margin-left: 200px;
}
#plugin-information .fyi {
margin-left: 5px;
margin-right: 20px;
}
#plugin-information .fyi h2 {
margin-left: 0;
}
#plugin-information .fyi ul {
padding: 10px 7px 10px 5px;
}
#plugin-information #section-screenshots li p {
padding-left: 0;
padding-right: 20px;
}
#plugin-information #section-screenshots ol,
#plugin-information .updated,
#plugin-information pre {
margin-right: 0;
margin-left: 215px;
}
#plugin-information .updated,
#plugin-information .error {
clear: none;
direction: rtl;
}
#plugin-information #section-holder .section {
direction: ltr;
}
/* Editor/Main Column */
.posting {
margin-left: 212px;
margin-right: 0;
position: relative;
}
h3.tb {
margin-left: 0;
margin-right: 5px;
}
#publish {
float: left;
}
.postbox .handlediv {
float: left;
}
.actions li {
float: right;
margin-right: 0;
margin-left: 10px;
}
#extra-fields .actions {
margin: -23px 0 0 -7px;
}
/* Photo Styles */
#img_container a {
float: right;
}
#category-add input,
#category-add select {
font-family: Tahoma, Arial, sans-serif;
}
/* Tags */
#tagsdiv #newtag {
margin-right: 0;
margin-left: 5px;
}
#tagadd {
margin-left: 0;
margin-right: 3px;
}
#tagchecklist span {
margin-left: .5em;
margin-right: 10px;
float: right;
}
#tagchecklist span a {
margin: 6px -9px 0 0;
float: right;
}
.submit input,
.button,
.button-primary,
.button-secondary,
#postcustomstuff .submit input {
font-family: Tahoma, Arial, sans-serif;
}
.ac_results li {
text-align: right;
}
#TB_ajaxContent #options {
right: auto;
left: 25px;
}
#post_status {
margin-left: 0;
margin-right: 10px;
}
/* theme-editor, plugin-editor */
#templateside {
float: left;
}
#template textarea,
#docs-list {
direction: ltr;
}
/* theme-install */
.theme-details .theme-version {
float: right;
}
.theme-details .star-holder {
float: left;
}
.feature-filter .feature-group {
float: right;
}
.feature-filter .feature-group li {
padding-right: 0;
padding-left: 25px;
}
/* widgets */
/* 2 column liquid layout */
div.widget-liquid-left {
float: right;
clear: right;
margin-right: 0;
margin-left: -325px;
}
div#widgets-left {
margin-right: 5px;
margin-left: 325px;
}
div.widget-liquid-right {
float: left;
clear: left;
}
.inactive-sidebar .widget {
float: right;
}
div.sidebar-name h3 {
font-family: Tahoma, Arial, sans-serif;
}
#widget-list .widget {
float: right;
}
.inactive-sidebar .widget-placeholder {
float: right;
}
.widget-top .widget-title-action {
float: left;
}
.widget-control-edit {
padding: 0 0 0 8px;
}
.sidebar-name-arrow {
float: left;
}
/* Press This */
.press-this-sidebar {
float: left;
}
.press-this #header-logo,
.press-this #wphead h1 {
float: right;
}
/* RTL */
.ltr {
direction: ltr;
}
/**
* HiDPI Displays
*/
@media print,
(-o-min-device-pixel-ratio: 5/4),
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 120dpi) {
.post-com-count {
background-image: url('../images/bubble_bg-rtl-2x.gif');
background-size: 18px 100px;
}
#content-resize-handle, #post-body .wp_themeSkin .mceStatusbar a.mceResize {
background: transparent url('../images/resize-rtl-2x.gif') no-repeat scroll right bottom;
background-size: 11px 11px;
}
.wp-full-overlay .collapse-sidebar-arrow {
background-image: url('../images/arrows-2x.png');
background-size: 15px 123px;
}
div.star-holder {
background: url('../images/stars-rtl-2x.png?ver=20121108') repeat-x bottom right;
background-size: 21px 37px;
}
div.star-holder .star-rating {
background: url('../images/stars-rtl-2x.png?ver=20121108') repeat-x top right;
background-size: 21px 37px;
}
#post-body .wp_themeSkin .mceStatusbar a.mceResize,
#content-resize-handle {
background: transparent url('../images/resize-rtl-2x.gif') no-repeat scroll left bottom;
}
}
/* =Localized CSS
-------------------------------------------------------------- */
/* he_IL: Remove Tahoma from the font stack. Arial is best for Hebrew. */
body.locale-he-il,
.locale-he-il .quicktags, .locale-he-il .search,
.locale-he-il .howto,
.locale-he-il #adminmenu .awaiting-mod,
.locale-he-il #adminmenu span.update-plugins,
.locale-he-il #sidemenu li a span.update-plugins,
.locale-he-il .post-com-count-wrapper,
.locale-he-il .widefat th,
.locale-he-il .tablenav .displaying-num,
.locale-he-il .inline-edit-row fieldset span.title,
.locale-he-il .inline-edit-row fieldset span.checkbox-title,
.locale-he-il .inline-edit-row fieldset ul.cat-checklist label,
.locale-he-il .inline-edit-row .catshow,
.locale-he-il .inline-edit-row .cathide,
.locale-he-il .inline-edit-row #bulk-titles div,
.locale-he-il p.help,
.locale-he-il p.description,
.locale-he-il span.description,
.locale-he-il .form-wrap p,
.locale-he-il h2 .nav-tab,
.locale-he-il #your-profile legend,
.locale-he-il #utc-time, .locale-he-il #local-time,
.locale-he-il #poststuff h3,
.locale-he-il .metabox-holder h3,
.locale-he-il .tool-box .title,
.locale-he-il td,
.locale-he-il textarea,
.locale-he-il input,
.locale-he-il select,
.locale-he-il .wrap h2,
.locale-he-il .subtitle,
.locale-he-il .wrap .add-new-h2,
.locale-he-il #dashboard_right_now p.sub,
.locale-he-il #dashboard-widgets h4,
.locale-he-il a.rsswidget,
.locale-he-il #dashboard_plugins h4,
.locale-he-il #dashboard_plugins h5,
.locale-he-il #dashboard_recent_comments .comment-meta .approve,
.locale-he-il #dashboard_right_now td.b,
.locale-he-il #dashboard_right_now .versions a,
.locale-he-il .rss-widget span.rss-date,
.locale-he-il #dashboard_recent_drafts h4 abbr,
body.login.locale-he-il,
.locale-he-il #login form .submit input,
.locale-he-il #menu-management .nav-tabs-arrow-right,
.locale-he-il #category-add input,
.locale-he-il #category-add select,
.locale-he-il .submit input,
.locale-he-il .button,
.locale-he-il .button-primary,
.locale-he-il .button-secondary,
.locale-he-il #postcustomstuff .submit input,
.locale-he-il div.sidebar-name h3 {
font-family: Arial, sans-serif;
}
/* he_IL: Have <em> be bold rather than italic. */
.locale-he-il em {
font-style: normal;
font-weight: bold;
}
| zyblog | trunk/zyblog/wp-admin/css/wp-admin-rtl.css | CSS | asf20 | 50,174 |
/* Fixes for IE 7 bugs */
#dashboard-widgets form .input-text-wrap input,
#dashboard-widgets form .textarea-wrap textarea {
width: 99%;
}
#dashboard-widgets form #title {
width: 98%;
}
.wp-editor-wrap .wp-editor-container textarea.wp-editor-area {
width: 97%;
}
#post-body.columns-2 #postbox-container-1 {
padding-left: 19px;
}
.welcome-panel .wp-badge {
position: absolute;
}
.welcome-panel .welcome-panel-column:first-child {
width: 35%;
}
#wp-fullscreen-title {
width: 97%;
}
#wp_mce_fullscreen_ifr {
background-color: #f9f9f9;
}
#wp-fullscreen-tagline {
color: #888;
font-size: 14px;
}
#adminmenushadow {
display: none;
}
#adminmenuback {
left: 0;
background-image: none;
}
#adminmenuwrap {
position: static;
}
#adminmenu {
position: relative;
}
#adminmenu,
#adminmenu a {
cursor: pointer;
}
#adminmenu li.wp-menu-separator,
#adminmenu li.wp-menu-separator-last {
font-size: 1px;
line-height: 1;
}
#adminmenu a.menu-top {
border-bottom: 0 none;
border-top: 1px solid #ddd;
}
#adminmenu .separator {
font-size: 1px;
line-height: 1px;
}
#adminmenu .wp-submenu ul {
margin: 0;
}
.folded #adminmenu .wp-submenu {
border-top-color: transparent;
}
#adminmenu .wp-submenu .wp-submenu-head {
border-top-color: #ddd;
}
.folded #adminmenu .wp-submenu ul {
margin-left: 5px;
}
#adminmenu li.menu-top {
margin-bottom: -2px;
}
#adminmenu .wp-menu-arrow {
display: none !important;
}
.js.folded #adminmenu li.menu-top {
display: block;
zoom: 100%;
}
ul#adminmenu {
z-index: 99;
}
#adminmenu li.menu-top a.menu-top {
min-width: auto;
width: auto;
}
#wpcontent #adminmenu li.wp-has-current-submenu a.wp-has-submenu {
font-style: normal;
}
#wpcontent #adminmenu .wp-submenu li {
padding: 0;
}
#collapse-menu {
line-height: 23px;
}
#wpadminbar .ab-comments-icon {
padding-top: 7px;
}
table.fixed th,
table.fixed td {
border-top: 1px solid #ddd;
}
#wpbody-content input.button,
#wpbody-content input.button-primary,
#wpbody-content input.button-secondary {
overflow: visible;
}
#dashboard-widgets #dashboard_quick_press form p.submit #publish {
float: none;
}
#dashboard-widgets h3 a {
height: 14px;
line-height: 14px;
}
#dashboard_browser_nag {
color: #fff;
}
#dashboard_browser_nag .browser-icon {
position: relative;
}
.tablenav-pages .current-page {
vertical-align: middle;
}
#wpbody-content .postbox {
border: 1px solid #dfdfdf;
}
#wpbody-content .postbox h3 {
margin-bottom: -1px;
}
.major-publishing-actions,
.wp-submenu,
.wp-submenu li,
#template,
#template div,
#editcat,
#addcat {
zoom: 100%;
}
.wp-menu-arrow {
height: 28px;
}
.submitbox {
margin-top: 10px;
}
/* Inline Editor */
#wpbody-content .quick-edit-row-post .inline-edit-col-left {
width: 39%;
}
#wpbody-content .inline-edit-row-post .inline-edit-col-center {
width: 19%;
}
#wpbody-content .quick-edit-row-page .inline-edit-col-left {
width: 49%;
}
#wpbody-content .bulk-edit-row .inline-edit-col-left {
width: 29%;
}
.inline-edit-row p.submit {
zoom: 100%;
}
.inline-edit-row fieldset label span.title {
display: block;
float: left;
width: 5em;
}
.inline-edit-row fieldset label span.input-text-wrap {
margin-left: 0;
zoom: 100%;
}
#wpbody-content .inline-edit-row fieldset label span.input-text-wrap input {
line-height: 130%;
}
#wpbody-content .inline-edit-row .input-text-wrap input {
width: 95%;
}
#wpbody-content .inline-edit-row .input-text-wrap input.inline-edit-password-input {
width: 8em;
}
/* end Inline Editor */
#titlediv #title {
width: 98%;
}
.button,
input[type="reset"],
input[type="button"],
input[type="submit"] {
padding: 0 8px;
line-height: 20px;
height: auto;
}
.button.button-large,
input[type="reset"].button-large,
input[type="button"].button-large,
input[type="submit"].button-large {
padding: 0 10px;
line-height: 24px;
height: auto;
}
.button.button-small,
input[type="reset"].button-small,
input[type="button"].button-small,
input[type="submit"].button-small {
padding: 0 6px;
line-height: 16px;
height: auto;
}
a.button {
margin: 1px;
padding: 1px 9px 2px;
}
a.button.button-large {
padding: 1px 11px 2px;
}
a.button.button-small {
padding: 1px 7px 2px;
}
#screen-options-wrap {
overflow: hidden;
}
#the-comment-list .comment-item,
#post-status-info,
#wpwrap,
#wrap,
#postdivrich,
#postdiv,
#poststuff,
.metabox-holder,
#titlediv,
#post-body,
#editorcontainer,
.tablenav,
.widget-liquid-left,
.widget-liquid-right,
#widgets-left,
.widgets-sortables,
#dragHelper,
.widget .widget-top,
.widget-control-actions,
.tagchecklist,
#col-container,
#col-left,
#col-right,
.fileedit-sub {
display: block;
zoom: 100%;
}
p.search-box {
position: static;
float: right;
margin: -3px 0 4px;
}
#widget-list .widget,
.feature-filter .feature-group li {
display: inline;
}
.feature-filter .feature-group li input {
vertical-align: middle;
}
#editorcontainer #content {
overflow: auto;
margin: auto;
width: 98%;
}
form#template div {
width: 100%;
}
.wp-editor-container .quicktags-toolbar input {
overflow: visible;
padding: 0 4px;
}
#poststuff h2 {
font-size: 1.6em;
}
#poststuff .inside #parent_id,
#poststuff .inside #page_template,
.inline-edit-row #post_parent,
.inline-edit-row select[name="page_template"] {
width: 250px;
}
#submitdiv input,
#submitdiv select,
#submitdiv a.button {
position: relative;
}
#bh {
margin: 7px 10px 0 0;
float: right;
}
/* without this dashboard widgets appear in one column for some screen widths */
div#dashboard-widgets {
padding-right: 1px;
}
.tagchecklist span, .tagchecklist span a {
display: inline-block;
display: block;
}
.tagchecklist span a {
margin: 4px 0 0 -9px;
}
.tablenav .button-secondary,
.nav .button-secondary {
padding-top: 2px;
padding-bottom: 2px;
}
.tablenav select {
font-size: 13px;
display: inline-block;
vertical-align: top;
margin-top: 2px;
}
.tablenav .actions select {
width: 155px;
}
.subsubsub li {
display: inline;
}
table.ie-fixed {
table-layout: fixed;
}
.widefat tr,
.widefat th {
margin-bottom: 0;
border-spacing: 0;
}
.widefat th input {
margin: 0 0 0 5px;
}
.widefat thead .check-column,
.widefat tfoot .check-column {
padding-top: 6px;
}
.widefat tbody th.check-column,
.media.widefat tbody th.check-column {
padding: 4px 0 0;
}
.widefat {
empty-cells: show;
border-collapse: collapse;
}
.tablenav a.button-secondary {
display: inline-block;
padding: 2px 5px;
}
.inactive-sidebar .widgets-sortables {
padding-bottom: 8px;
}
#available-widgets .widget-holder {
padding-bottom: 65px;
}
#widgets-left .inactive {
padding-bottom: 10px;
}
.widget-liquid-right .widget,
.inactive-sidebar .widget {
position: relative;
}
.inactive-sidebar .widget {
display: block;
float: left;
}
#wpcontent .button-primary-disabled {
color: #9FD0D5;
background: #298CBA;
}
#the-comment-list .unapproved tr,
#the-comment-list .unapproved td {
background-color: #ffffe0;
}
.imgedit-submit {
width: 300px;
}
#nav-menus-frame,
#wpbody,
.menu li {
zoom: 100%;
}
#update-nav-menu #post-body {
overflow:hidden;
}
.menu li {
min-width: 100%;
}
.menu li.sortable-placeholder {
min-width: 400px;
}
.about-wrap img.element-screenshot {
padding: 2px;
}
.about-wrap .feature-section img,
.about-wrap .feature-section .image-mask {
border-width: 1px;
border-style: solid;
}
.about-wrap .feature-section.three-col img {
margin-left: 0;
}
.available-theme {
display: inline;
}
.available-theme ul {
margin: 0;
}
.available-theme .action-links li {
padding-right: 7px;
margin-right: 7px;
}
.about-wrap .three-col-images img {
margin: 0 0.6% 10px;
}
.about-wrap .three-col-images .last-feature,
.about-wrap .three-col-images .first-feature {
float: none;
}
/* IE6 leftovers */
* html .row-actions {
visibility: visible;
}
* html div.widget-liquid-left,
* html div.widget-liquid-right {
display: block;
position: relative;
}
* html #editorcontainer {
padding: 0;
}
* html #poststuff h2 {
margin-left: 0;
}
* html .stuffbox,
* html .stuffbox input,
* html .stuffbox textarea {
border: 1px solid #DFDFDF;
}
* html .feature-filter .feature-group li {
width: 145px;
}
* html div.widget-liquid-left {
width: 99%;
}
* html .widgets-sortables {
height: 50px;
}
* html a#content_resize {
right: -2px;
}
* html .widget-title h4 {
width: 205px;
}
* html #removing-widget .in-widget-title {
display: none;
}
* html .media-item .pinkynail {
height: 32px;
width: 40px;
}
* html .describe .field input.text,
* html .describe .field textarea {
width: 440px;
}
* html input {
border: 1px solid #dfdfdf;
}
* html .edit-box {
display: inline;
}
* html .postbox-container .meta-box-sortables {
height: 300px;
}
* html #wpbody-content #screen-options-link-wrap {
display: inline-block;
width: 150px;
text-align: center;
}
* html #wpbody-content #contextual-help-link-wrap {
display: inline-block;
width: 100px;
text-align: center;
}
* html #adminmenu {
margin-left: -80px;
}
* html .folded #adminmenu {
margin-left: -22px;
}
* html #wpcontent #adminmenu li.menu-top {
display: inline;
padding: 0;
margin: 0;
}
* html #wpfooter {
margin: 0;
}
* html #adminmenu div.wp-menu-image {
height: 29px;
}
| zyblog | trunk/zyblog/wp-admin/css/ie.css | CSS | asf20 | 9,179 |
.farbtastic {
position: relative;
}
.farbtastic * {
position: absolute;
cursor: crosshair;
}
.farbtastic,
.farbtastic .wheel {
width: 195px;
height: 195px;
}
.farbtastic .color,
.farbtastic .overlay {
top: 47px;
left: 47px;
width: 101px;
height: 101px;
}
.farbtastic .wheel {
background: url(../images/wheel.png) no-repeat;
width: 195px;
height: 195px;
}
.farbtastic .overlay {
background: url(../images/mask.png) no-repeat;
}
.farbtastic .marker {
width: 17px;
height: 17px;
margin: -8px 0 0 -8px;
overflow: hidden;
background: url(../images/marker.png) no-repeat;
}
/* farbtastic-rtl */
.rtl .farbtastic .color,
.rtl .farbtastic .overlay {
left: 0;
right: 47px;
}
.rtl .farbtastic .marker {
margin: -8px -8px 0 0;
}
| zyblog | trunk/zyblog/wp-admin/css/farbtastic.css | CSS | asf20 | 766 |
html {
background: #f9f9f9;
}
body {
background: #fff;
color: #333;
font-family: sans-serif;
margin: 2em auto;
padding: 1em 2em;
-webkit-border-radius: 3px;
border-radius: 3px;
border: 1px solid #dfdfdf;
max-width: 700px;
}
a {
color: #21759b;
text-decoration: none;
}
a:hover {
color: #d54e21;
}
h1 {
border-bottom: 1px solid #dadada;
clear: both;
color: #666;
font: 24px Georgia, "Times New Roman", Times, serif;
margin: 30px 0 0 0;
padding: 0;
padding-bottom: 7px;
}
h2 {
font-size: 16px;
}
p, li, dd, dt {
padding-bottom: 2px;
font-size: 14px;
line-height: 1.5;
}
code, .code {
font-size: 14px;
}
ul, ol, dl {
padding: 5px 5px 5px 22px;
}
a img {
border:0
}
abbr {
border: 0;
font-variant: normal;
}
#logo {
margin: 6px 0 14px 0;
border-bottom: none;
text-align:center
}
#logo a {
background-image: url('../images/wordpress-logo.png?ver=20120216');
background-size: 274px 63px;
background-position: top center;
background-repeat: no-repeat;
height: 67px;
text-indent: -9999px;
outline: none;
overflow: hidden;
display: block;
}
@media print,
(-o-min-device-pixel-ratio: 5/4),
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 120dpi) {
#logo a {
background-image: url('../images/wordpress-logo-2x.png?ver=20120412');
background-size: 274px 63px;
}
}
.step {
margin: 20px 0 15px;
}
.step, th {
text-align: left;
padding: 0;
}
.step .button-large {
font-size: 14px;
}
textarea {
border: 1px solid #dfdfdf;
-webkit-border-radius: 3px;
border-radius: 3px;
font-family: sans-serif;
width: 695px;
}
.form-table {
border-collapse: collapse;
margin-top: 1em;
width: 100%;
}
.form-table td {
margin-bottom: 9px;
padding: 10px 20px 10px 0;
border-bottom: 8px solid #fff;
font-size: 14px;
vertical-align: top
}
.form-table th {
font-size: 14px;
text-align: left;
padding: 16px 20px 10px 0;
border-bottom: 8px solid #fff;
width: 140px;
vertical-align: top;
}
.form-table code {
line-height: 18px;
font-size: 14px;
}
.form-table p {
margin: 4px 0 0 0;
font-size: 11px;
}
.form-table input {
line-height: 20px;
font-size: 15px;
padding: 2px;
border: 1px #dfdfdf solid;
-webkit-border-radius: 3px;
border-radius: 3px;
font-family: sans-serif;
}
.form-table input[type=text],
.form-table input[type=password] {
width: 206px;
}
.form-table th p {
font-weight: normal;
}
.form-table.install-success td {
vertical-align: middle;
padding: 16px 20px 10px 0;
}
.form-table.install-success td p {
margin: 0;
font-size: 14px;
}
.form-table.install-success td code {
margin: 0;
font-size: 18px;
}
#error-page {
margin-top: 50px;
}
#error-page p {
font-size: 14px;
line-height: 18px;
margin: 25px 0 20px;
}
#error-page code, .code {
font-family: Consolas, Monaco, monospace;
}
#pass-strength-result {
background-color: #eee;
border-color: #ddd !important;
border-style: solid;
border-width: 1px;
margin: 5px 5px 5px 0;
padding: 5px;
text-align: center;
width: 200px;
display: none;
}
#pass-strength-result.bad {
background-color: #ffb78c;
border-color: #ff853c !important;
}
#pass-strength-result.good {
background-color: #ffec8b;
border-color: #ffcc00 !important;
}
#pass-strength-result.short {
background-color: #ffa0a0;
border-color: #f04040 !important;
}
#pass-strength-result.strong {
background-color: #c3ff88;
border-color: #8dff1c !important;
}
.message {
border: 1px solid #e6db55;
padding: 0.3em 0.6em;
margin: 5px 0 15px;
background-color: #ffffe0;
}
/* install-rtl */
body.rtl {
font-family: Tahoma, arial;
}
.rtl h1 {
font-family: arial;
margin: 5px -4px 0 0;
}
.rtl ul,
.rtl ol {
padding: 5px 22px 5px 5px;
}
.rtl .step,
.rtl th,
.rtl .form-table th {
text-align: right;
}
.rtl .submit input,
.rtl .button,
.rtl .button-secondary {
margin-right: 0;
}
.rtl #dbname,
.rtl #uname,
.rtl #pwd,
.rtl #dbhost,
.rtl #prefix,
.rtl #user_login,
.rtl #admin_email,
.rtl #pass1,
.rtl #pass2 {
direction: ltr;
}
| zyblog | trunk/zyblog/wp-admin/css/install.css | CSS | asf20 | 3,963 |
<?php
/**
* Tools Administration Screen.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once('./admin.php');
$title = __('Tools');
get_current_screen()->add_help_tab( array(
'id' => 'press-this',
'title' => __('Press This'),
'content' => '<p>' . __('Press This is a bookmarklet that makes it easy to blog about something you come across on the web. You can use it to just grab a link, or to post an excerpt. Press This will even allow you to choose from images included on the page and use them in your post. Just drag the Press This link on this screen to your bookmarks bar in your browser, and you’ll be on your way to easier content creation. Clicking on it while on another website opens a popup window with all these options.') . '</p>',
) );
get_current_screen()->add_help_tab( array(
'id' => 'converter',
'title' => __('Categories and Tags Converter'),
'content' => '<p>' . __('Categories have hierarchy, meaning that you can nest sub-categories. Tags do not have hierarchy and cannot be nested. Sometimes people start out using one on their posts, then later realize that the other would work better for their content.' ) . '</p>' .
'<p>' . __( 'The Categories and Tags Converter link on this screen will take you to the Import screen, where that Converter is one of the plugins you can install. Once that plugin is installed, the Activate Plugin & Run Importer link will take you to a screen where you can choose to convert tags into categories or vice versa.' ) . '</p>',
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Tools_Screen" target="_blank">Documentation on Tools</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
require_once('./admin-header.php');
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<?php if ( current_user_can('edit_posts') ) : ?>
<div class="tool-box">
<h3 class="title"><?php _e('Press This') ?></h3>
<p><?php _e('Press This is a bookmarklet: a little app that runs in your browser and lets you grab bits of the web.');?></p>
<p><?php _e('Use Press This to clip text, images and videos from any web page. Then edit and add more straight from Press This before you save or publish it in a post on your site.'); ?></p>
<p class="description"><?php _e('Drag-and-drop the following link to your bookmarks bar or right click it and add it to your favorites for a posting shortcut.') ?></p>
<p class="pressthis"><a onclick="return false;" oncontextmenu="if(window.navigator.userAgent.indexOf('WebKit')!=-1||window.navigator.userAgent.indexOf('MSIE')!=-1)jQuery('.pressthis-code').show().find('textarea').focus().select();return false;" href="<?php echo htmlspecialchars( get_shortcut_link() ); ?>"><span><?php _e('Press This') ?></span></a></p>
<div class="pressthis-code" style="display:none;">
<p class="description"><?php _e('If your bookmarks toolbar is hidden: copy the code below, open your Bookmarks manager, create new bookmark, type Press This into the name field and paste the code into the URL field.') ?></p>
<p><textarea rows="5" cols="120" readonly="readonly"><?php echo htmlspecialchars( get_shortcut_link() ); ?></textarea></p>
</div>
</div>
<?php
endif;
if ( current_user_can( 'import' ) ) :
$cats = get_taxonomy('category');
$tags = get_taxonomy('post_tag');
if ( current_user_can($cats->cap->manage_terms) || current_user_can($tags->cap->manage_terms) ) : ?>
<div class="tool-box">
<h3 class="title"><?php _e( 'Categories and Tags Converter' ) ?></h3>
<p><?php printf( __('If you want to convert your categories to tags (or vice versa), use the <a href="%s">Categories and Tags Converter</a> available from the Import screen.'), 'import.php' ); ?></p>
</div>
<?php
endif;
endif;
do_action( 'tool_box' );
?>
</div>
<?php
include('./admin-footer.php');
| zyblog | trunk/zyblog/wp-admin/tools.php | PHP | asf20 | 4,044 |
<?php
/**
* Action handler for Multisite administration panels.
*
* @package WordPress
* @subpackage Multisite
* @since 3.0.0
*/
require_once( './admin.php' );
wp_redirect( network_admin_url() );
exit;
| zyblog | trunk/zyblog/wp-admin/ms-edit.php | PHP | asf20 | 210 |
<?php
/**
* Comment Moderation Administration Screen.
*
* Redirects to edit-comments.php?comment_status=moderated.
*
* @package WordPress
* @subpackage Administration
*/
require_once('../wp-load.php');
wp_redirect( admin_url('edit-comments.php?comment_status=moderated') );
exit;
| zyblog | trunk/zyblog/wp-admin/moderation.php | PHP | asf20 | 287 |
<?php
/**
* Plugins may load this file to gain access to special helper functions for
* plugin installation. This file is not included by WordPress and it is
* recommended, to prevent fatal errors, that this file is included using
* require_once().
*
* These functions are not optimized for speed, but they should only be used
* once in a while, so speed shouldn't be a concern. If it is and you are
* needing to use these functions a lot, you might experience time outs. If you
* do, then it is advised to just write the SQL code yourself.
*
* <code>
* check_column('wp_links', 'link_description', 'mediumtext');
* if (check_column($wpdb->comments, 'comment_author', 'tinytext'))
* echo "ok\n";
*
* $error_count = 0;
* $tablename = $wpdb->links;
* // check the column
* if (!check_column($wpdb->links, 'link_description', 'varchar(255)')) {
* $ddl = "ALTER TABLE $wpdb->links MODIFY COLUMN link_description varchar(255) NOT NULL DEFAULT '' ";
* $q = $wpdb->query($ddl);
* }
*
* if (check_column($wpdb->links, 'link_description', 'varchar(255)')) {
* $res .= $tablename . ' - ok <br />';
* } else {
* $res .= 'There was a problem with ' . $tablename . '<br />';
* ++$error_count;
* }
* </code>
*
* @package WordPress
* @subpackage Plugin
*/
/** Load WordPress Bootstrap */
require_once(dirname(dirname(__FILE__)).'/wp-load.php');
if ( ! function_exists('maybe_create_table') ) :
/**
* Create database table, if it doesn't already exist.
*
* @since 1.0.0
* @package WordPress
* @subpackage Plugin
* @uses $wpdb
*
* @param string $table_name Database table name.
* @param string $create_ddl Create database table SQL.
* @return bool False on error, true if already exists or success.
*/
function maybe_create_table($table_name, $create_ddl) {
global $wpdb;
foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {
if ($table == $table_name) {
return true;
}
}
//didn't find it try to create it.
$wpdb->query($create_ddl);
// we cannot directly tell that whether this succeeded!
foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {
if ($table == $table_name) {
return true;
}
}
return false;
}
endif;
if ( ! function_exists('maybe_add_column') ) :
/**
* Add column to database table, if column doesn't already exist in table.
*
* @since 1.0.0
* @package WordPress
* @subpackage Plugin
* @uses $wpdb
*
* @param string $table_name Database table name
* @param string $column_name Table column name
* @param string $create_ddl SQL to add column to table.
* @return bool False on failure. True, if already exists or was successful.
*/
function maybe_add_column($table_name, $column_name, $create_ddl) {
global $wpdb;
foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
if ($column == $column_name) {
return true;
}
}
//didn't find it try to create it.
$wpdb->query($create_ddl);
// we cannot directly tell that whether this succeeded!
foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
if ($column == $column_name) {
return true;
}
}
return false;
}
endif;
/**
* Drop column from database table, if it exists.
*
* @since 1.0.0
* @package WordPress
* @subpackage Plugin
* @uses $wpdb
*
* @param string $table_name Table name
* @param string $column_name Column name
* @param string $drop_ddl SQL statement to drop column.
* @return bool False on failure, true on success or doesn't exist.
*/
function maybe_drop_column($table_name, $column_name, $drop_ddl) {
global $wpdb;
foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
if ($column == $column_name) {
//found it try to drop it.
$wpdb->query($drop_ddl);
// we cannot directly tell that whether this succeeded!
foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
if ($column == $column_name) {
return false;
}
}
}
}
// else didn't find it
return true;
}
/**
* Check column matches criteria.
*
* Uses the SQL DESC for retrieving the table info for the column. It will help
* understand the parameters, if you do more research on what column information
* is returned by the SQL statement. Pass in null to skip checking that
* criteria.
*
* Column names returned from DESC table are case sensitive and are listed:
* Field
* Type
* Null
* Key
* Default
* Extra
*
* @since 1.0.0
* @package WordPress
* @subpackage Plugin
*
* @param string $table_name Table name
* @param string $col_name Column name
* @param string $col_type Column type
* @param bool $is_null Optional. Check is null.
* @param mixed $key Optional. Key info.
* @param mixed $default Optional. Default value.
* @param mixed $extra Optional. Extra value.
* @return bool True, if matches. False, if not matching.
*/
function check_column($table_name, $col_name, $col_type, $is_null = null, $key = null, $default = null, $extra = null) {
global $wpdb;
$diffs = 0;
$results = $wpdb->get_results("DESC $table_name");
foreach ($results as $row ) {
if ($row->Field == $col_name) {
// got our column, check the params
if (($col_type != null) && ($row->Type != $col_type)) {
++$diffs;
}
if (($is_null != null) && ($row->Null != $is_null)) {
++$diffs;
}
if (($key != null) && ($row->Key != $key)) {
++$diffs;
}
if (($default != null) && ($row->Default != $default)) {
++$diffs;
}
if (($extra != null) && ($row->Extra != $extra)) {
++$diffs;
}
if ($diffs > 0) {
return false;
}
return true;
} // end if found our column
}
return false;
}
| zyblog | trunk/zyblog/wp-admin/install-helper.php | PHP | asf20 | 5,590 |
<?php
/**
* About This Version administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once( './admin.php' );
$title = __( 'About' );
list( $display_version ) = explode( '-', $wp_version );
include( ABSPATH . 'wp-admin/admin-header.php' );
?>
<div class="wrap about-wrap">
<h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
<div class="about-text"><?php printf( __( 'Thank you for updating to the latest version! WordPress %s is more polished and enjoyable than ever before. We hope you like it.' ), $display_version ); ?></div>
<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
<h2 class="nav-tab-wrapper">
<a href="about.php" class="nav-tab nav-tab-active">
<?php _e( 'What’s New' ); ?>
</a><a href="credits.php" class="nav-tab">
<?php _e( 'Credits' ); ?>
</a><a href="freedoms.php" class="nav-tab">
<?php _e( 'Freedoms' ); ?>
</a>
</h2>
<div class="changelog">
<h3><?php _e( 'New Media Manager' ); ?></h3>
<div class="feature-section col two-col">
<img alt="" src="<?php echo esc_url( admin_url( 'images/screenshots/about-media.png' ) ); ?>" class="image-100" />
<div>
<h4><?php _e( 'Beautiful Interface' ); ?></h4>
<p><?php _e( 'Adding media has been streamlined with an all-new experience, making it a breeze to upload files and place them into your posts.' ); ?></p>
</div>
<div class="last-feature">
<h4><?php _e( 'Picturesque Galleries' ); ?></h4>
<p><?php _e( 'Creating image galleries is faster with drag and drop reordering, inline caption editing, and simplified controls for layout.' ); ?></p>
</div>
</div>
</div>
<div class="changelog">
<h3><?php _e( 'New Default Theme' ); ?></h3>
<div class="feature-section images-stagger-right">
<img alt="" src="<?php echo esc_url( admin_url( 'images/screenshots/about-twenty-twelve.png' ) ); ?>" class="image-66" />
<h4><?php _e( 'Introducing Twenty Twelve' ); ?></h4>
<p><?php _e( 'The newest default theme for WordPress is simple, flexible, and elegant.' ); ?></p>
<p><?php _e( 'What makes it really shine are the design details, like the gorgeous Open Sans typeface and a fully responsive design that looks great on any device.' ); ?></p>
<p><?php _e( 'Naturally, Twenty Twelve supports all the theme features you’ve come to know and love, but it is also designed to be as great for a website as it is for a blog.' ); ?></p>
</div>
</div>
<div class="changelog">
<h3><?php _e( 'Retina Ready' ); ?></h3>
<div class="feature-section images-stagger-right">
<img alt="" src="<?php echo esc_url( admin_url( 'images/screenshots/about-retina.png' ) ); ?>" class="image-66" />
<h4><?php _e( 'So Sharp You Can’t See the Pixels' ); ?></h4>
<p><?php _e( 'The WordPress dashboard now looks beautiful on high-resolution screens like those found on the iPad, Kindle Fire HD, Nexus 10, and MacBook Pro with Retina Display. Icons and other visual elements are crystal clear and full of detail.' ); ?></p>
</div>
</div>
<div class="changelog">
<h3><?php _e( 'Smoother Experience' ); ?></h3>
<div class="feature-section images-stagger-right">
<img alt="" src="<?php echo esc_url( admin_url( 'images/screenshots/about-color-picker.png' ) ); ?>" class="image-30" />
<h4><?php _e( 'Better Accessibility' ); ?></h4>
<p><?php _e( 'WordPress supports more usage modes than ever before. Screenreaders, touch devices, and mouseless workflows all have improved ease of use and accessibility.' ); ?></p>
<h4><?php _e( 'More Polish' ); ?></h4>
<p><?php _e( 'A number of screens and controls have been refined. For example, a new color picker makes it easier for you to choose that perfect shade of blue.' ); ?></p>
</div>
</div>
<div class="changelog">
<h3><?php _e( 'Under the Hood' ); ?></h3>
<div class="feature-section col three-col">
<div>
<h4><?php _e( 'Meta Query Additions' ); ?></h4>
<p><?php _e( 'The <code>WP_Comment_Query</code> and <code>WP_User_Query</code> classes now support meta queries just like <code>WP_Query.</code> Meta queries now support querying for objects without a particular meta key.' ); ?></p>
</div>
<div>
<h4><?php _e( 'Post Objects' ); ?></h4>
<p><?php _e( 'Post objects are now instances of a <code>WP_Post</code> class, which improves performance by loading selected properties on demand.' ); ?></p>
</div>
<div class="last-feature">
<h4><?php _e( 'Image Editing API' ); ?></h4>
<p><?php _e( 'The <code>WP_Image_Editor</code> class abstracts image editing functionality such as cropping and scaling, and uses ImageMagick when available.' ); ?></p>
</div>
</div>
<div class="feature-section col three-col">
<div>
<h4><?php _e( 'Multisite Improvements' ); ?></h4>
<p><?php _e( '<code>switch_to_blog()</code> is now significantly faster and more reliable.' ); ?></p>
</div>
<div>
<h4><?php _e( 'XML-RPC API' ); ?></h4>
<p><?php printf( __( 'The <a href="%s">WordPress API</a> is now always enabled, and supports fetching users, editing profiles, managing post revisions, and searching posts.' ), __( 'http://codex.wordpress.org/XML-RPC_WordPress_API' ) ); ?></p>
</div>
<div class="last-feature">
<h4><?php _e( 'External Libraries' ); ?></h4>
<p><?php printf( __( 'WordPress now includes the <a href="%1$s">Underscore</a> and <a href="%2$s">Backbone</a> JavaScript libraries. TinyMCE, jQuery, jQuery UI, and SimplePie have all been updated to the latest versions.' ), 'http://underscorejs.org/', 'http://backbonejs.org/' ); ?></p>
</div>
</div>
</div>
<div class="return-to-dashboard">
<?php if ( current_user_can( 'update_core' ) && isset( $_GET['updated'] ) ) : ?>
<a href="<?php echo esc_url( self_admin_url( 'update-core.php' ) ); ?>"><?php
is_multisite() ? _e( 'Return to Updates' ) : _e( 'Return to Dashboard → Updates' );
?></a> |
<?php endif; ?>
<a href="<?php echo esc_url( self_admin_url() ); ?>"><?php
is_blog_admin() ? _e( 'Go to Dashboard → Home' ) : _e( 'Go to Dashboard' ); ?></a>
</div>
</div>
<?php
include( ABSPATH . 'wp-admin/admin-footer.php' );
// These are strings we may use to describe maintenance/security releases, where we aim for no new strings.
return;
_n_noop( 'Maintenance Release', 'Maintenance Releases' );
_n_noop( 'Security Release', 'Security Releases' );
_n_noop( 'Maintenance and Security Release', 'Maintenance and Security Releases' );
/* translators: 1: WordPress version number. */
_n_noop( '<strong>Version %1$s</strong> addressed a security issue.',
'<strong>Version %1$s</strong> addressed some security issues.' );
/* translators: 1: WordPress version number, 2: plural number of bugs. */
_n_noop( '<strong>Version %1$s</strong> addressed %2$s bug.',
'<strong>Version %1$s</strong> addressed %2$s bugs.' );
/* translators: 1: WordPress version number, 2: plural number of bugs. Singular security issue. */
_n_noop( '<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bug.',
'<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bugs.' );
/* translators: 1: WordPress version number, 2: plural number of bugs. More than one security issue. */
_n_noop( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.' );
__( 'For more information, see <a href="%s">the release notes</a>.' );
| zyblog | trunk/zyblog/wp-admin/about.php | PHP | asf20 | 7,515 |
<?php
/**
* Edit comment form for inclusion in another file.
*
* @package WordPress
* @subpackage Administration
*/
// don't load directly
if ( !defined('ABSPATH') )
die('-1');
?>
<form name="post" action="comment.php" method="post" id="post">
<?php wp_nonce_field('update-comment_' . $comment->comment_ID) ?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php _e('Edit Comment'); ?></h2>
<div id="poststuff">
<input type="hidden" name="user_ID" value="<?php echo (int) $user_ID; ?>" />
<input type="hidden" name="action" value="editedcomment" />
<input type="hidden" name="comment_ID" value="<?php echo esc_attr( $comment->comment_ID ); ?>" />
<input type="hidden" name="comment_post_ID" value="<?php echo esc_attr( $comment->comment_post_ID ); ?>" />
<div id="post-body" class="metabox-holder columns-2">
<div id="post-body-content">
<div id="namediv" class="stuffbox">
<h3><label for="name"><?php _e( 'Author' ) ?></label></h3>
<div class="inside">
<table class="form-table editcomment">
<tbody>
<tr valign="top">
<td class="first"><?php _e( 'Name:' ); ?></td>
<td><input type="text" name="newcomment_author" size="30" value="<?php echo esc_attr( $comment->comment_author ); ?>" id="name" /></td>
</tr>
<tr valign="top">
<td class="first">
<?php
if ( $comment->comment_author_email ) {
printf( __( 'E-mail (%s):' ), get_comment_author_email_link( __( 'send e-mail' ), '', '' ) );
} else {
_e( 'E-mail:' );
}
?></td>
<td><input type="text" name="newcomment_author_email" size="30" value="<?php echo $comment->comment_author_email; ?>" id="email" /></td>
</tr>
<tr valign="top">
<td class="first">
<?php
if ( ! empty( $comment->comment_author_url ) && 'http://' != $comment->comment_author_url ) {
$link = '<a href="' . $comment->comment_author_url . '" rel="external nofollow" target="_blank">' . __('visit site') . '</a>';
printf( __( 'URL (%s):' ), apply_filters('get_comment_author_link', $link ) );
} else {
_e( 'URL:' );
} ?></td>
<td><input type="text" id="newcomment_author_url" name="newcomment_author_url" size="30" class="code" value="<?php echo esc_attr($comment->comment_author_url); ?>" /></td>
</tr>
</tbody>
</table>
<br />
</div>
</div>
<div id="postdiv" class="postarea">
<?php
$quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close' );
wp_editor( $comment->comment_content, 'content', array( 'media_buttons' => false, 'tinymce' => false, 'quicktags' => $quicktags_settings ) );
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
</div>
</div><!-- /post-body-content -->
<div id="postbox-container-1" class="postbox-container">
<div id="submitdiv" class="stuffbox" >
<h3><span class='hndle'><?php _e('Status') ?></span></h3>
<div class="inside">
<div class="submitbox" id="submitcomment">
<div id="minor-publishing">
<div id="minor-publishing-actions">
<div id="preview-action">
<a class="preview button" href="<?php echo get_comment_link(); ?>" target="_blank"><?php _e('View Comment'); ?></a>
</div>
<div class="clear"></div>
</div>
<div id="misc-publishing-actions">
<div class="misc-pub-section" id="comment-status-radio">
<label class="approved"><input type="radio"<?php checked( $comment->comment_approved, '1' ); ?> name="comment_status" value="1" /><?php /* translators: comment type radio button */ _ex('Approved', 'adjective') ?></label><br />
<label class="waiting"><input type="radio"<?php checked( $comment->comment_approved, '0' ); ?> name="comment_status" value="0" /><?php /* translators: comment type radio button */ _ex('Pending', 'adjective') ?></label><br />
<label class="spam"><input type="radio"<?php checked( $comment->comment_approved, 'spam' ); ?> name="comment_status" value="spam" /><?php /* translators: comment type radio button */ _ex('Spam', 'adjective'); ?></label>
</div>
<div class="misc-pub-section curtime">
<?php
// translators: Publish box date format, see http://php.net/date
$datef = __( 'M j, Y @ G:i' );
$stamp = __('Submitted on: <b>%1$s</b>');
$date = date_i18n( $datef, strtotime( $comment->comment_date ) );
?>
<span id="timestamp"><?php printf($stamp, $date); ?></span> <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><?php _e('Edit') ?></a>
<div id='timestampdiv' class='hide-if-js'><?php touch_time(('editcomment' == $action), 0); ?></div>
</div>
</div> <!-- misc actions -->
<div class="clear"></div>
</div>
<div id="major-publishing-actions">
<div id="delete-action">
<?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url("comment.php?action=" . ( !EMPTY_TRASH_DAYS ? 'deletecomment' : 'trashcomment' ) . "&c=$comment->comment_ID&_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "'>" . ( !EMPTY_TRASH_DAYS ? __('Delete Permanently') : __('Move to Trash') ) . "</a>\n"; ?>
</div>
<div id="publishing-action">
<?php submit_button( __( 'Update' ), 'primary', 'save', false ); ?>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div><!-- /submitdiv -->
</div>
<div id="postbox-container-2" class="postbox-container">
<?php
do_action('add_meta_boxes', 'comment', $comment);
do_action('add_meta_boxes_comment', $comment);
do_meta_boxes(null, 'normal', $comment);
?>
</div>
<input type="hidden" name="c" value="<?php echo esc_attr($comment->comment_ID) ?>" />
<input type="hidden" name="p" value="<?php echo esc_attr($comment->comment_post_ID) ?>" />
<input name="referredby" type="hidden" id="referredby" value="<?php echo esc_url(stripslashes(wp_get_referer())); ?>" />
<?php wp_original_referer_field(true, 'previous'); ?>
<input type="hidden" name="noredir" value="1" />
</div><!-- /post-body -->
</div>
</div>
</form>
<script type="text/javascript">
try{document.post.name.focus();}catch(e){}
</script>
| zyblog | trunk/zyblog/wp-admin/edit-form-comment.php | PHP | asf20 | 5,805 |
<?php
/**
* Press This Display and Handler.
*
* @package WordPress
* @subpackage Press_This
*/
define('IFRAME_REQUEST' , true);
/** WordPress Administration Bootstrap */
require_once('./admin.php');
header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
if ( ! current_user_can( 'edit_posts' ) || ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) )
wp_die( __( 'Cheatin’ uh?' ) );
/**
* Press It form handler.
*
* @package WordPress
* @subpackage Press_This
* @since 2.6.0
*
* @return int Post ID
*/
function press_it() {
$post = get_default_post_to_edit();
$post = get_object_vars($post);
$post_ID = $post['ID'] = (int) $_POST['post_id'];
if ( !current_user_can('edit_post', $post_ID) )
wp_die(__('You are not allowed to edit this post.'));
$post['post_category'] = isset($_POST['post_category']) ? $_POST['post_category'] : '';
$post['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : '';
$post['post_title'] = isset($_POST['title']) ? $_POST['title'] : '';
$content = isset($_POST['content']) ? $_POST['content'] : '';
$upload = false;
if ( !empty($_POST['photo_src']) && current_user_can('upload_files') ) {
foreach( (array) $_POST['photo_src'] as $key => $image) {
// see if files exist in content - we don't want to upload non-used selected files.
if ( strpos($_POST['content'], htmlspecialchars($image)) !== false ) {
$desc = isset($_POST['photo_description'][$key]) ? $_POST['photo_description'][$key] : '';
$upload = media_sideload_image($image, $post_ID, $desc);
// Replace the POSTED content <img> with correct uploaded ones. Regex contains fix for Magic Quotes
if ( !is_wp_error($upload) )
$content = preg_replace('/<img ([^>]*)src=\\\?(\"|\')'.preg_quote(htmlspecialchars($image), '/').'\\\?(\2)([^>\/]*)\/*>/is', $upload, $content);
}
}
}
// set the post_content and status
$post['post_content'] = $content;
if ( isset( $_POST['publish'] ) && current_user_can( 'publish_posts' ) )
$post['post_status'] = 'publish';
elseif ( isset( $_POST['review'] ) )
$post['post_status'] = 'pending';
else
$post['post_status'] = 'draft';
// error handling for media_sideload
if ( is_wp_error($upload) ) {
wp_delete_post($post_ID);
wp_die($upload);
} else {
// Post formats
if ( isset( $_POST['post_format'] ) ) {
if ( current_theme_supports( 'post-formats', $_POST['post_format'] ) )
set_post_format( $post_ID, $_POST['post_format'] );
elseif ( '0' == $_POST['post_format'] )
set_post_format( $post_ID, false );
}
$post_ID = wp_update_post($post);
}
return $post_ID;
}
// For submitted posts.
if ( isset($_REQUEST['action']) && 'post' == $_REQUEST['action'] ) {
check_admin_referer('press-this');
$posted = $post_ID = press_it();
} else {
$post = get_default_post_to_edit('post', true);
$post_ID = $post->ID;
}
// Set Variables
$title = isset( $_GET['t'] ) ? trim( strip_tags( html_entity_decode( stripslashes( $_GET['t'] ) , ENT_QUOTES) ) ) : '';
$selection = '';
if ( !empty($_GET['s']) ) {
$selection = str_replace(''', "'", stripslashes($_GET['s']));
$selection = trim( htmlspecialchars( html_entity_decode($selection, ENT_QUOTES) ) );
}
if ( ! empty($selection) ) {
$selection = preg_replace('/(\r?\n|\r)/', '</p><p>', $selection);
$selection = '<p>' . str_replace('<p></p>', '', $selection) . '</p>';
}
$url = isset($_GET['u']) ? esc_url($_GET['u']) : '';
$image = isset($_GET['i']) ? $_GET['i'] : '';
if ( !empty($_REQUEST['ajax']) ) {
switch ($_REQUEST['ajax']) {
case 'video': ?>
<script type="text/javascript">
/* <![CDATA[ */
jQuery('.select').click(function() {
append_editor(jQuery('#embed-code').val());
jQuery('#extra-fields').hide();
jQuery('#extra-fields').html('');
});
jQuery('.close').click(function() {
jQuery('#extra-fields').hide();
jQuery('#extra-fields').html('');
});
/* ]]> */
</script>
<div class="postbox">
<h2><label for="embed-code"><?php _e('Embed Code') ?></label></h2>
<div class="inside">
<textarea name="embed-code" id="embed-code" rows="8" cols="40"><?php echo esc_textarea( $selection ); ?></textarea>
<p id="options"><a href="#" class="select button"><?php _e('Insert Video'); ?></a> <a href="#" class="close button"><?php _e('Cancel'); ?></a></p>
</div>
</div>
<?php break;
case 'photo_thickbox': ?>
<script type="text/javascript">
/* <![CDATA[ */
jQuery('.cancel').click(function() {
tb_remove();
});
jQuery('.select').click(function() {
image_selector(this);
});
/* ]]> */
</script>
<h3 class="tb"><label for="tb_this_photo_description"><?php _e('Description') ?></label></h3>
<div class="titlediv">
<div class="titlewrap">
<input id="tb_this_photo_description" name="photo_description" class="tb_this_photo_description tbtitle text" onkeypress="if(event.keyCode==13) image_selector(this);" value="<?php echo esc_attr($title);?>"/>
</div>
</div>
<p class="centered">
<input type="hidden" name="this_photo" value="<?php echo esc_attr($image); ?>" id="tb_this_photo" class="tb_this_photo" />
<a href="#" class="select">
<img src="<?php echo esc_url($image); ?>" alt="<?php echo esc_attr(__('Click to insert.')); ?>" title="<?php echo esc_attr(__('Click to insert.')); ?>" />
</a>
</p>
<p id="options"><a href="#" class="select button"><?php _e('Insert Image'); ?></a> <a href="#" class="cancel button"><?php _e('Cancel'); ?></a></p>
<?php break;
case 'photo_images':
/**
* Retrieve all image URLs from given URI.
*
* @package WordPress
* @subpackage Press_This
* @since 2.6.0
*
* @param string $uri
* @return string
*/
function get_images_from_uri($uri) {
$uri = preg_replace('/\/#.+?$/','', $uri);
if ( preg_match( '/\.(jpe?g|jpe|gif|png)\b/i', $uri ) && !strpos( $uri, 'blogger.com' ) )
return "'" . esc_attr( html_entity_decode($uri) ) . "'";
$content = wp_remote_fopen($uri);
if ( false === $content )
return '';
$host = parse_url($uri);
$pattern = '/<img ([^>]*)src=(\"|\')([^<>\'\"]+)(\2)([^>]*)\/*>/i';
$content = str_replace(array("\n","\t","\r"), '', $content);
preg_match_all($pattern, $content, $matches);
if ( empty($matches[0]) )
return '';
$sources = array();
foreach ($matches[3] as $src) {
// if no http in url
if (strpos($src, 'http') === false)
// if it doesn't have a relative uri
if ( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === 0)
$src = 'http://'.str_replace('//','/', $host['host'].'/'.$src);
else
$src = 'http://'.str_replace('//','/', $host['host'].'/'.dirname($host['path']).'/'.$src);
$sources[] = esc_url($src);
}
return "'" . implode("','", $sources) . "'";
}
$url = wp_kses(urldecode($url), null);
echo 'new Array('.get_images_from_uri($url).')';
break;
case 'photo_js': ?>
// gather images and load some default JS
var last = null
var img, img_tag, aspect, w, h, skip, i, strtoappend = "";
if(photostorage == false) {
var my_src = eval(
jQuery.ajax({
type: "GET",
url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>",
cache : false,
async : false,
data: "ajax=photo_images&u=<?php echo urlencode($url); ?>",
dataType : "script"
}).responseText
);
if(my_src.length == 0) {
var my_src = eval(
jQuery.ajax({
type: "GET",
url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>",
cache : false,
async : false,
data: "ajax=photo_images&u=<?php echo urlencode($url); ?>",
dataType : "script"
}).responseText
);
if(my_src.length == 0) {
strtoappend = '<?php _e('Unable to retrieve images or no images on page.'); ?>';
}
}
}
for (i = 0; i < my_src.length; i++) {
img = new Image();
img.src = my_src[i];
img_attr = 'id="img' + i + '"';
skip = false;
maybeappend = '<a href="?ajax=photo_thickbox&i=' + encodeURIComponent(img.src) + '&u=<?php echo urlencode($url); ?>&height=400&width=500" title="" class="thickbox"><img src="' + img.src + '" ' + img_attr + '/></a>';
if (img.width && img.height) {
if (img.width >= 30 && img.height >= 30) {
aspect = img.width / img.height;
scale = (aspect > 1) ? (71 / img.width) : (71 / img.height);
w = img.width;
h = img.height;
if (scale < 1) {
w = parseInt(img.width * scale);
h = parseInt(img.height * scale);
}
img_attr += ' style="width: ' + w + 'px; height: ' + h + 'px;"';
strtoappend += maybeappend;
}
} else {
strtoappend += maybeappend;
}
}
function pick(img, desc) {
if (img) {
if('object' == typeof jQuery('.photolist input') && jQuery('.photolist input').length != 0) length = jQuery('.photolist input').length;
if(length == 0) length = 1;
jQuery('.photolist').append('<input name="photo_src[' + length + ']" value="' + img +'" type="hidden"/>');
jQuery('.photolist').append('<input name="photo_description[' + length + ']" value="' + desc +'" type="hidden"/>');
insert_editor( "\n\n" + encodeURI('<p style="text-align: center;"><a href="<?php echo $url; ?>"><img src="' + img +'" alt="' + desc + '" /></a></p>'));
}
return false;
}
function image_selector(el) {
var desc, src, parent = jQuery(el).closest('#photo-add-url-div');
if ( parent.length ) {
desc = parent.find('input.tb_this_photo_description').val() || '';
src = parent.find('input.tb_this_photo').val() || ''
} else {
desc = jQuery('#tb_this_photo_description').val() || '';
src = jQuery('#tb_this_photo').val() || ''
}
tb_remove();
pick(src, desc);
jQuery('#extra-fields').hide();
jQuery('#extra-fields').html('');
return false;
}
jQuery('#extra-fields').html('<div class="postbox"><h2><?php _e( 'Add Photos' ); ?> <small id="photo_directions">(<?php _e("click images to select") ?>)</small></h2><ul class="actions"><li><a href="#" id="photo-add-url" class="button button-small"><?php _e("Add from URL") ?> +</a></li></ul><div class="inside"><div class="titlewrap"><div id="img_container"></div></div><p id="options"><a href="#" class="close button"><?php _e('Cancel'); ?></a><a href="#" class="refresh button"><?php _e('Refresh'); ?></a></p></div>');
jQuery('#img_container').html(strtoappend);
<?php break;
}
die;
}
wp_enqueue_style( 'colors' );
wp_enqueue_script( 'post' );
_wp_admin_html_begin();
?>
<title><?php _e('Press This') ?></title>
<script type="text/javascript">
//<![CDATA[
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time() ?>'};
var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', pagenow = 'press-this', isRtl = <?php echo (int) is_rtl(); ?>;
var photostorage = false;
//]]>
</script>
<?php
do_action('admin_print_styles');
do_action('admin_print_scripts');
do_action('admin_head');
?>
<script type="text/javascript">
var wpActiveEditor = 'content';
function insert_plain_editor(text) {
if ( typeof(QTags) != 'undefined' )
QTags.insertContent(text);
}
function set_editor(text) {
if ( '' == text || '<p></p>' == text )
text = '<p><br /></p>';
if ( tinyMCE.activeEditor )
tinyMCE.execCommand('mceSetContent', false, text);
}
function insert_editor(text) {
if ( '' != text && tinyMCE.activeEditor && ! tinyMCE.activeEditor.isHidden()) {
tinyMCE.execCommand('mceInsertContent', false, '<p>' + decodeURI(tinymce.DOM.decode(text)) + '</p>', {format : 'raw'});
} else {
insert_plain_editor(decodeURI(text));
}
}
function append_editor(text) {
if ( '' != text && tinyMCE.activeEditor && ! tinyMCE.activeEditor.isHidden()) {
tinyMCE.execCommand('mceSetContent', false, tinyMCE.activeEditor.getContent({format : 'raw'}) + '<p>' + text + '</p>');
} else {
insert_plain_editor(text);
}
}
function show(tab_name) {
jQuery('#extra-fields').html('');
switch(tab_name) {
case 'video' :
jQuery('#extra-fields').load('<?php echo esc_url($_SERVER['PHP_SELF']); ?>', { ajax: 'video', s: '<?php echo esc_attr($selection); ?>'}, function() {
<?php
$content = '';
if ( preg_match("/youtube\.com\/watch/i", $url) ) {
list($domain, $video_id) = explode("v=", $url);
$video_id = esc_attr($video_id);
$content = '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/' . $video_id . '"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/' . $video_id . '" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>';
} elseif ( preg_match("/vimeo\.com\/[0-9]+/i", $url) ) {
list($domain, $video_id) = explode(".com/", $url);
$video_id = esc_attr($video_id);
$content = '<object width="400" height="225"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&server=www.vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" /> <embed src="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&server=www.vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object>';
if ( trim($selection) == '' )
$selection = '<p><a href="http://www.vimeo.com/' . $video_id . '?pg=embed&sec=' . $video_id . '">' . $title . '</a> on <a href="http://vimeo.com?pg=embed&sec=' . $video_id . '">Vimeo</a></p>';
} elseif ( strpos( $selection, '<object' ) !== false ) {
$content = $selection;
}
?>
jQuery('#embed-code').prepend('<?php echo htmlentities($content); ?>');
});
jQuery('#extra-fields').show();
return false;
break;
case 'photo' :
function setup_photo_actions() {
jQuery('.close').click(function() {
jQuery('#extra-fields').hide();
jQuery('#extra-fields').html('');
});
jQuery('.refresh').click(function() {
photostorage = false;
show('photo');
});
jQuery('#photo-add-url').click(function(){
var form = jQuery('#photo-add-url-div').clone();
jQuery('#img_container').empty().append( form.show() );
});
jQuery('#waiting').hide();
jQuery('#extra-fields').show();
}
jQuery('#waiting').show();
if(photostorage == false) {
jQuery.ajax({
type: "GET",
cache : false,
url: "<?php echo esc_url($_SERVER['PHP_SELF']); ?>",
data: "ajax=photo_js&u=<?php echo urlencode($url)?>",
dataType : "script",
success : function(data) {
eval(data);
photostorage = jQuery('#extra-fields').html();
setup_photo_actions();
}
});
} else {
jQuery('#extra-fields').html(photostorage);
setup_photo_actions();
}
return false;
break;
}
}
jQuery(document).ready(function($) {
//resize screen
window.resizeTo(740,580);
// set button actions
jQuery('#photo_button').click(function() { show('photo'); return false; });
jQuery('#video_button').click(function() { show('video'); return false; });
// auto select
<?php if ( preg_match("/youtube\.com\/watch/i", $url) ) { ?>
show('video');
<?php } elseif ( preg_match("/vimeo\.com\/[0-9]+/i", $url) ) { ?>
show('video');
<?php } elseif ( preg_match("/flickr\.com/i", $url) ) { ?>
show('photo');
<?php } ?>
jQuery('#title').unbind();
jQuery('#publish, #save').click(function() { jQuery('.press-this #publishing-actions .spinner').css('display', 'inline-block'); });
$('#tagsdiv-post_tag, #categorydiv').children('h3, .handlediv').click(function(){
$(this).siblings('.inside').toggle();
});
});
</script>
</head>
<?php
$admin_body_class = ( is_rtl() ) ? 'rtl' : '';
$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
?>
<body class="press-this wp-admin wp-core-ui <?php echo $admin_body_class; ?>">
<form action="press-this.php?action=post" method="post">
<div id="poststuff" class="metabox-holder">
<div id="side-sortables" class="press-this-sidebar">
<div class="sleeve">
<?php wp_nonce_field('press-this') ?>
<input type="hidden" name="post_type" id="post_type" value="text"/>
<input type="hidden" name="autosave" id="autosave" />
<input type="hidden" id="original_post_status" name="original_post_status" value="draft" />
<input type="hidden" id="prev_status" name="prev_status" value="draft" />
<input type="hidden" id="post_id" name="post_id" value="<?php echo (int) $post_ID; ?>" />
<!-- This div holds the photo metadata -->
<div class="photolist"></div>
<div id="submitdiv" class="postbox">
<div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div>
<h3 class="hndle"><?php _e('Press This') ?></h3>
<div class="inside">
<p id="publishing-actions">
<?php
submit_button( __( 'Save Draft' ), 'button', 'draft', false, array( 'id' => 'save' ) );
if ( current_user_can('publish_posts') ) {
submit_button( __( 'Publish' ), 'primary', 'publish', false );
} else {
echo '<br /><br />';
submit_button( __( 'Submit for Review' ), 'primary', 'review', false );
} ?>
<span class="spinner" style="display: none;"></span>
</p>
<?php if ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) :
$post_formats = get_theme_support( 'post-formats' );
if ( is_array( $post_formats[0] ) ) :
$default_format = get_option( 'default_post_format', '0' );
?>
<p>
<label for="post_format"><?php _e( 'Post Format:' ); ?>
<select name="post_format" id="post_format">
<option value="0"><?php _ex( 'Standard', 'Post format' ); ?></option>
<?php foreach ( $post_formats[0] as $format ): ?>
<option<?php selected( $default_format, $format ); ?> value="<?php echo esc_attr( $format ); ?>"> <?php echo esc_html( get_post_format_string( $format ) ); ?></option>
<?php endforeach; ?>
</select></label>
</p>
<?php endif; endif; ?>
</div>
</div>
<?php $tax = get_taxonomy( 'category' ); ?>
<div id="categorydiv" class="postbox">
<div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div>
<h3 class="hndle"><?php _e('Categories') ?></h3>
<div class="inside">
<div id="taxonomy-category" class="categorydiv">
<ul id="category-tabs" class="category-tabs">
<li class="tabs"><a href="#category-all"><?php echo $tax->labels->all_items; ?></a></li>
<li class="hide-if-no-js"><a href="#category-pop"><?php _e( 'Most Used' ); ?></a></li>
</ul>
<div id="category-pop" class="tabs-panel" style="display: none;">
<ul id="categorychecklist-pop" class="categorychecklist form-no-clear" >
<?php $popular_ids = wp_popular_terms_checklist( 'category' ); ?>
</ul>
</div>
<div id="category-all" class="tabs-panel">
<ul id="categorychecklist" data-wp-lists="list:category" class="categorychecklist form-no-clear">
<?php wp_terms_checklist($post_ID, array( 'taxonomy' => 'category', 'popular_cats' => $popular_ids ) ) ?>
</ul>
</div>
<?php if ( !current_user_can($tax->cap->assign_terms) ) : ?>
<p><em><?php _e('You cannot modify this Taxonomy.'); ?></em></p>
<?php endif; ?>
<?php if ( current_user_can($tax->cap->edit_terms) ) : ?>
<div id="category-adder" class="wp-hidden-children">
<h4>
<a id="category-add-toggle" href="#category-add" class="hide-if-no-js">
<?php printf( __( '+ %s' ), $tax->labels->add_new_item ); ?>
</a>
</h4>
<p id="category-add" class="category-add wp-hidden-child">
<label class="screen-reader-text" for="newcategory"><?php echo $tax->labels->add_new_item; ?></label>
<input type="text" name="newcategory" id="newcategory" class="form-required form-input-tip" value="<?php echo esc_attr( $tax->labels->new_item_name ); ?>" aria-required="true"/>
<label class="screen-reader-text" for="newcategory_parent">
<?php echo $tax->labels->parent_item_colon; ?>
</label>
<?php wp_dropdown_categories( array( 'taxonomy' => 'category', 'hide_empty' => 0, 'name' => 'newcategory_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '— ' . $tax->labels->parent_item . ' —' ) ); ?>
<input type="button" id="category-add-submit" data-wp-lists="add:categorychecklist:category-add" class="button category-add-submit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" />
<?php wp_nonce_field( 'add-category', '_ajax_nonce-add-category', false ); ?>
<span id="category-ajax-response"></span>
</p>
</div>
<?php endif; ?>
</div>
</div>
</div>
<div id="tagsdiv-post_tag" class="postbox">
<div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div>
<h3><span><?php _e('Tags'); ?></span></h3>
<div class="inside">
<div class="tagsdiv" id="post_tag">
<div class="jaxtag">
<label class="screen-reader-text" for="newtag"><?php _e('Tags'); ?></label>
<input type="hidden" name="tax_input[post_tag]" class="the-tags" id="tax-input[post_tag]" value="" />
<div class="ajaxtag">
<input type="text" name="newtag[post_tag]" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
<input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" />
</div>
</div>
<div class="tagchecklist"></div>
</div>
<p class="tagcloud-link"><a href="#titlediv" class="tagcloud-link" id="link-post_tag"><?php _e('Choose from the most used tags'); ?></a></p>
</div>
</div>
</div>
</div>
<div class="posting">
<div id="wphead">
<img id="header-logo" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" alt="" width="16" height="16" />
<h1 id="site-heading">
<a href="<?php echo get_option('home'); ?>/" target="_blank">
<span id="site-title"><?php bloginfo('name'); ?></span>
</a>
</h1>
</div>
<?php
if ( isset($posted) && intval($posted) ) {
$post_ID = intval($posted); ?>
<div id="message" class="updated">
<p><strong><?php _e('Your post has been saved.'); ?></strong>
<a onclick="window.opener.location.replace(this.href); window.close();" href="<?php echo get_permalink($post_ID); ?>"><?php _e('View post'); ?></a>
| <a href="<?php echo get_edit_post_link( $post_ID ); ?>" onclick="window.opener.location.replace(this.href); window.close();"><?php _e('Edit Post'); ?></a>
| <a href="#" onclick="window.close();"><?php _e('Close Window'); ?></a></p>
</div>
<?php } ?>
<div id="titlediv">
<div class="titlewrap">
<input name="title" id="title" class="text" value="<?php echo esc_attr($title);?>"/>
</div>
</div>
<div id="waiting" style="display: none"><span class="spinner"></span> <span><?php esc_html_e( 'Loading...' ); ?></span></div>
<div id="extra-fields" style="display: none"></div>
<div class="postdivrich">
<?php
$editor_settings = array(
'teeny' => true,
'textarea_rows' => '15'
);
$content = '';
if ( $selection )
$content .= $selection;
if ( $url ) {
$content .= '<p>';
if ( $selection )
$content .= __('via ');
$content .= sprintf( "<a href='%s'>%s</a>.</p>", esc_url( $url ), esc_html( $title ) );
}
remove_action( 'media_buttons', 'media_buttons' );
add_action( 'media_buttons', 'press_this_media_buttons' );
function press_this_media_buttons() {
_e( 'Add:' );
if ( current_user_can('upload_files') ) {
?>
<a id="photo_button" title="<?php esc_attr_e('Insert an Image'); ?>" href="#">
<img alt="<?php esc_attr_e('Insert an Image'); ?>" src="<?php echo esc_url( admin_url( 'images/media-button-image.gif?ver=20100531' ) ); ?>"/></a>
<?php
}
?>
<a id="video_button" title="<?php esc_attr_e('Embed a Video'); ?>" href="#"><img alt="<?php esc_attr_e('Embed a Video'); ?>" src="<?php echo esc_url( admin_url( 'images/media-button-video.gif?ver=20100531' ) ); ?>"/></a>
<?php
}
wp_editor( $content, 'content', $editor_settings );
?>
</div>
</div>
</div>
</form>
<div id="photo-add-url-div" style="display:none;">
<table><tr>
<td><label for="this_photo"><?php _e('URL') ?></label></td>
<td><input type="text" id="this_photo" name="this_photo" class="tb_this_photo text" onkeypress="if(event.keyCode==13) image_selector(this);" /></td>
</tr><tr>
<td><label for="this_photo_description"><?php _e('Description') ?></label></td>
<td><input type="text" id="this_photo_description" name="photo_description" class="tb_this_photo_description text" onkeypress="if(event.keyCode==13) image_selector(this);" value="<?php echo esc_attr($title);?>"/></td>
</tr><tr>
<td><input type="button" class="button" onclick="image_selector(this)" value="<?php esc_attr_e('Insert Image'); ?>" /></td>
</tr></table>
</div>
<?php
do_action('admin_footer');
do_action('admin_print_footer_scripts');
?>
<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>
</body>
</html>
| zyblog | trunk/zyblog/wp-admin/press-this.php | PHP | asf20 | 25,852 |
<?php
/**
* Edit user network administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
require( '../user-edit.php' ); | zyblog | trunk/zyblog/wp-admin/network/user-edit.php | PHP | asf20 | 312 |
<?php
/**
* Multisite users administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.0.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can( 'manage_network_users' ) )
wp_die( __( 'You do not have permission to access this page.' ) );
function confirm_delete_users( $users ) {
$current_user = wp_get_current_user();
if ( !is_array( $users ) )
return false;
screen_icon();
?>
<h2><?php esc_html_e( 'Users' ); ?></h2>
<p><?php _e( 'Transfer or delete posts before deleting users.' ); ?></p>
<form action="users.php?action=dodelete" method="post">
<input type="hidden" name="dodelete" />
<?php
wp_nonce_field( 'ms-users-delete' );
$site_admins = get_super_admins();
$admin_out = "<option value='$current_user->ID'>$current_user->user_login</option>";
foreach ( ( $allusers = (array) $_POST['allusers'] ) as $key => $val ) {
if ( $val != '' && $val != '0' ) {
$delete_user = get_userdata( $val );
if ( ! current_user_can( 'delete_user', $delete_user->ID ) )
wp_die( sprintf( __( 'Warning! User %s cannot be deleted.' ), $delete_user->user_login ) );
if ( in_array( $delete_user->user_login, $site_admins ) )
wp_die( sprintf( __( 'Warning! User cannot be deleted. The user %s is a network administrator.' ), $delete_user->user_login ) );
echo "<input type='hidden' name='user[]' value='{$val}'/>\n";
$blogs = get_blogs_of_user( $val, true );
if ( !empty( $blogs ) ) {
?>
<br /><fieldset><p><legend><?php printf( __( "What should be done with posts owned by <em>%s</em>?" ), $delete_user->user_login ); ?></legend></p>
<?php
foreach ( (array) $blogs as $key => $details ) {
$blog_users = get_users( array( 'blog_id' => $details->userblog_id ) );
if ( is_array( $blog_users ) && !empty( $blog_users ) ) {
$user_site = "<a href='" . esc_url( get_home_url( $details->userblog_id ) ) . "'>{$details->blogname}</a>";
$user_dropdown = "<select name='blog[$val][{$key}]'>";
$user_list = '';
foreach ( $blog_users as $user ) {
if ( ! in_array( $user->ID, $allusers ) )
$user_list .= "<option value='{$user->ID}'>{$user->user_login}</option>";
}
if ( '' == $user_list )
$user_list = $admin_out;
$user_dropdown .= $user_list;
$user_dropdown .= "</select>\n";
?>
<ul style="list-style:none;">
<li><?php printf( __( 'Site: %s' ), $user_site ); ?></li>
<li><label><input type="radio" id="delete_option0" name="delete[<?php echo $details->userblog_id . '][' . $delete_user->ID ?>]" value="delete" checked="checked" />
<?php _e( 'Delete all posts.' ); ?></label></li>
<li><label><input type="radio" id="delete_option1" name="delete[<?php echo $details->userblog_id . '][' . $delete_user->ID ?>]" value="reassign" />
<?php echo __( 'Attribute all posts to:' ) . '</label>' . $user_dropdown; ?></li>
</ul>
<?php
}
}
echo "</fieldset>";
}
}
}
submit_button( __('Confirm Deletion'), 'delete' );
?>
</form>
<?php
return true;
}
if ( isset( $_GET['action'] ) ) {
do_action( 'wpmuadminedit' , '' );
switch ( $_GET['action'] ) {
case 'deleteuser':
if ( ! current_user_can( 'manage_network_users' ) )
wp_die( __( 'You do not have permission to access this page.' ) );
check_admin_referer( 'deleteuser' );
$id = intval( $_GET['id'] );
if ( $id != '0' && $id != '1' ) {
$_POST['allusers'] = array( $id ); // confirm_delete_users() can only handle with arrays
$title = __( 'Users' );
$parent_file = 'users.php';
require_once( '../admin-header.php' );
echo '<div class="wrap">';
confirm_delete_users( $_POST['allusers'] );
echo '</div>';
require_once( '../admin-footer.php' );
} else {
wp_redirect( network_admin_url( 'users.php' ) );
}
exit();
break;
case 'allusers':
if ( !current_user_can( 'manage_network_users' ) )
wp_die( __( 'You do not have permission to access this page.' ) );
if ( ( isset( $_POST['action']) || isset($_POST['action2'] ) ) && isset( $_POST['allusers'] ) ) {
check_admin_referer( 'bulk-users-network' );
$doaction = $_POST['action'] != -1 ? $_POST['action'] : $_POST['action2'];
$userfunction = '';
foreach ( (array) $_POST['allusers'] as $key => $val ) {
if ( !empty( $val ) ) {
switch ( $doaction ) {
case 'delete':
if ( ! current_user_can( 'delete_users' ) )
wp_die( __( 'You do not have permission to access this page.' ) );
$title = __( 'Users' );
$parent_file = 'users.php';
require_once( '../admin-header.php' );
echo '<div class="wrap">';
confirm_delete_users( $_POST['allusers'] );
echo '</div>';
require_once( '../admin-footer.php' );
exit();
break;
case 'spam':
$user = get_userdata( $val );
if ( is_super_admin( $user->ID ) )
wp_die( sprintf( __( 'Warning! User cannot be modified. The user %s is a network administrator.' ), esc_html( $user->user_login ) ) );
$userfunction = 'all_spam';
$blogs = get_blogs_of_user( $val, true );
foreach ( (array) $blogs as $key => $details ) {
if ( $details->userblog_id != $current_site->blog_id ) // main blog not a spam !
update_blog_status( $details->userblog_id, 'spam', '1' );
}
update_user_status( $val, 'spam', '1' );
break;
case 'notspam':
$userfunction = 'all_notspam';
$blogs = get_blogs_of_user( $val, true );
foreach ( (array) $blogs as $key => $details )
update_blog_status( $details->userblog_id, 'spam', '0' );
update_user_status( $val, 'spam', '0' );
break;
}
}
}
wp_safe_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $userfunction ), wp_get_referer() ) );
} else {
$location = network_admin_url( 'users.php' );
if ( ! empty( $_REQUEST['paged'] ) )
$location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location );
wp_redirect( $location );
}
exit();
break;
case 'dodelete':
check_admin_referer( 'ms-users-delete' );
if ( ! ( current_user_can( 'manage_network_users' ) && current_user_can( 'delete_users' ) ) )
wp_die( __( 'You do not have permission to access this page.' ) );
if ( ! empty( $_POST['blog'] ) && is_array( $_POST['blog'] ) ) {
foreach ( $_POST['blog'] as $id => $users ) {
foreach ( $users as $blogid => $user_id ) {
if ( ! current_user_can( 'delete_user', $id ) )
continue;
if ( ! empty( $_POST['delete'] ) && 'reassign' == $_POST['delete'][$blogid][$id] )
remove_user_from_blog( $id, $blogid, $user_id );
else
remove_user_from_blog( $id, $blogid );
}
}
}
$i = 0;
if ( is_array( $_POST['user'] ) && ! empty( $_POST['user'] ) )
foreach( $_POST['user'] as $id ) {
if ( ! current_user_can( 'delete_user', $id ) )
continue;
wpmu_delete_user( $id );
$i++;
}
if ( $i == 1 )
$deletefunction = 'delete';
else
$deletefunction = 'all_delete';
wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $deletefunction ), network_admin_url( 'users.php' ) ) );
exit();
break;
}
}
$wp_list_table = _get_list_table('WP_MS_Users_List_Table');
$pagenum = $wp_list_table->get_pagenum();
$wp_list_table->prepare_items();
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
if ( $pagenum > $total_pages && $total_pages > 0 ) {
wp_redirect( add_query_arg( 'paged', $total_pages ) );
exit;
}
$title = __( 'Users' );
$parent_file = 'users.php';
add_screen_option( 'per_page', array('label' => _x( 'Users', 'users per page (screen options)' )) );
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __('This table shows all users across the network and the sites to which they are assigned.') . '</p>' .
'<p>' . __('Hover over any user on the list to make the edit links appear. The Edit link on the left will take you to his or her Edit User profile page; the Edit link on the right by any site name goes to an Edit Site screen for that site.') . '</p>' .
'<p>' . __('You can also go to the user’s profile page by clicking on the individual username.') . '</p>' .
'<p>' . __('You can sort the table by clicking on any of the bold headings and switch between list and excerpt views by using the icons in the upper right.') . '</p>' .
'<p>' . __('The bulk action will permanently delete selected users, or mark/unmark those selected as spam. Spam users will have posts removed and will be unable to sign up again with the same email addresses.') . '</p>' .
'<p>' . __('You can make an existing user an additional super admin by going to the Edit User profile page and checking the box to grant that privilege.') . '</p>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Users_Screen" target="_blank">Documentation on Network Users</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
);
require_once( '../admin-header.php' );
if ( isset( $_REQUEST['updated'] ) && $_REQUEST['updated'] == 'true' && ! empty( $_REQUEST['action'] ) ) {
?>
<div id="message" class="updated"><p>
<?php
switch ( $_REQUEST['action'] ) {
case 'delete':
_e( 'User deleted.' );
break;
case 'all_spam':
_e( 'Users marked as spam.' );
break;
case 'all_notspam':
_e( 'Users removed from spam.' );
break;
case 'all_delete':
_e( 'Users deleted.' );
break;
case 'add':
_e( 'User added.' );
break;
}
?>
</p></div>
<?php
}
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php esc_html_e( 'Users' );
if ( current_user_can( 'create_users') ) : ?>
<a href="<?php echo network_admin_url('user-new.php'); ?>" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'user' ); ?></a><?php
endif;
if ( !empty( $usersearch ) )
printf( '<span class="subtitle">' . __( 'Search results for “%s”' ) . '</span>', esc_html( $usersearch ) );
?>
</h2>
<?php $wp_list_table->views(); ?>
<form action="" method="get" class="search-form">
<?php $wp_list_table->search_box( __( 'Search Users' ), 'all-user' ); ?>
</form>
<form id="form-user-list" action='users.php?action=allusers' method='post'>
<?php $wp_list_table->display(); ?>
</form>
</div>
<?php require_once( '../admin-footer.php' ); ?>
| zyblog | trunk/zyblog/wp-admin/network/users.php | PHP | asf20 | 10,803 |
<?php
/**
* Install plugin network administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
if ( isset( $_GET['tab'] ) && ( 'plugin-information' == $_GET['tab'] ) )
define( 'IFRAME_REQUEST', true );
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
require( '../plugin-install.php' ); | zyblog | trunk/zyblog/wp-admin/network/plugin-install.php | PHP | asf20 | 431 |
<?php
/**
* User profile network administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
require( '../profile.php' ); | zyblog | trunk/zyblog/wp-admin/network/profile.php | PHP | asf20 | 313 |
<?php
/**
* Edit Site Info Administration Screen
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can( 'manage_sites' ) )
wp_die( __( 'You do not have sufficient permissions to edit this site.' ) );
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.') . '</p>' .
'<p>' . __('<strong>Info</strong> - The domain and path are rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.') . '</p>' .
'<p>' . __('<strong>Users</strong> - This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.') . '</p>' .
'<p>' . sprintf( __('<strong>Themes</strong> - This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site’s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ), network_admin_url( 'themes.php' ) ) . '</p>' .
'<p>' . __('<strong>Settings</strong> - This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.') . '</p>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Sites_Screen" target="_blank">Documentation on Site Management</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
);
$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
if ( ! $id )
wp_die( __('Invalid site ID.') );
$details = get_blog_details( $id );
if ( !can_edit_network( $details->site_id ) )
wp_die( __( 'You do not have permission to access this page.' ) );
$is_main_site = is_main_site( $id );
if ( isset($_REQUEST['action']) && 'update-site' == $_REQUEST['action'] ) {
check_admin_referer( 'edit-site' );
switch_to_blog( $id );
if ( isset( $_POST['update_home_url'] ) && $_POST['update_home_url'] == 'update' ) {
$blog_address = get_blogaddress_by_domain( $_POST['blog']['domain'], $_POST['blog']['path'] );
if ( get_option( 'siteurl' ) != $blog_address )
update_option( 'siteurl', $blog_address );
if ( get_option( 'home' ) != $blog_address )
update_option( 'home', $blog_address );
}
// rewrite rules can't be flushed during switch to blog
delete_option( 'rewrite_rules' );
// update blogs table
$blog_data = stripslashes_deep( $_POST['blog'] );
$existing_details = get_blog_details( $id, false );
$blog_data_checkboxes = array( 'public', 'archived', 'spam', 'mature', 'deleted' );
foreach ( $blog_data_checkboxes as $c ) {
if ( ! in_array( $existing_details->$c, array( 0, 1 ) ) )
$blog_data[ $c ] = $existing_details->$c;
else
$blog_data[ $c ] = isset( $_POST['blog'][ $c ] ) ? 1 : 0;
}
update_blog_details( $id, $blog_data );
restore_current_blog();
wp_redirect( add_query_arg( array( 'update' => 'updated', 'id' => $id ), 'site-info.php') );
exit;
}
if ( isset($_GET['update']) ) {
$messages = array();
if ( 'updated' == $_GET['update'] )
$messages[] = __('Site info updated.');
}
$site_url_no_http = preg_replace( '#^http(s)?://#', '', get_blogaddress_by_id( $id ) );
$title_site_url_linked = sprintf( __('Edit Site: <a href="%1$s">%2$s</a>'), get_blogaddress_by_id( $id ), $site_url_no_http );
$title = sprintf( __('Edit Site: %s'), $site_url_no_http );
$parent_file = 'sites.php';
$submenu_file = 'sites.php';
require('../admin-header.php');
?>
<div class="wrap">
<?php screen_icon('ms-admin'); ?>
<h2 id="edit-site"><?php echo $title_site_url_linked ?></h2>
<h3 class="nav-tab-wrapper">
<?php
$tabs = array(
'site-info' => array( 'label' => __( 'Info' ), 'url' => 'site-info.php' ),
'site-users' => array( 'label' => __( 'Users' ), 'url' => 'site-users.php' ),
'site-themes' => array( 'label' => __( 'Themes' ), 'url' => 'site-themes.php' ),
'site-settings' => array( 'label' => __( 'Settings' ), 'url' => 'site-settings.php' ),
);
foreach ( $tabs as $tab_id => $tab ) {
$class = ( $tab['url'] == $pagenow ) ? ' nav-tab-active' : '';
echo '<a href="' . $tab['url'] . '?id=' . $id .'" class="nav-tab' . $class . '">' . esc_html( $tab['label'] ) . '</a>';
}
?>
</h3>
<?php
if ( ! empty( $messages ) ) {
foreach ( $messages as $msg )
echo '<div id="message" class="updated"><p>' . $msg . '</p></div>';
} ?>
<form method="post" action="site-info.php?action=update-site">
<?php wp_nonce_field( 'edit-site' ); ?>
<input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
<table class="form-table">
<tr class="form-field form-required">
<th scope="row"><?php _e( 'Domain' ) ?></th>
<?php
$protocol = is_ssl() ? 'https://' : 'http://';
if ( $is_main_site ) { ?>
<td><code><?php echo $protocol; echo esc_attr( $details->domain ) ?></code></td>
<?php } else { ?>
<td><?php echo $protocol; ?><input name="blog[domain]" type="text" id="domain" value="<?php echo esc_attr( $details->domain ) ?>" size="33" /></td>
<?php } ?>
</tr>
<tr class="form-field form-required">
<th scope="row"><?php _e( 'Path' ) ?></th>
<?php if ( $is_main_site ) { ?>
<td><code><?php echo esc_attr( $details->path ) ?></code></td>
<?php
} else {
switch_to_blog( $id );
?>
<td><input name="blog[path]" type="text" id="path" value="<?php echo esc_attr( $details->path ) ?>" size="40" style='margin-bottom:5px;' />
<br /><input type="checkbox" style="width:20px;" name="update_home_url" value="update" <?php if ( get_option( 'siteurl' ) == untrailingslashit( get_blogaddress_by_id ($id ) ) || get_option( 'home' ) == untrailingslashit( get_blogaddress_by_id( $id ) ) ) echo 'checked="checked"'; ?> /> <?php _e( 'Update <code>siteurl</code> and <code>home</code> as well.' ); ?></td>
<?php
restore_current_blog();
} ?>
</tr>
<tr class="form-field">
<th scope="row"><?php _ex( 'Registered', 'site' ) ?></th>
<td><input name="blog[registered]" type="text" id="blog_registered" value="<?php echo esc_attr( $details->registered ) ?>" size="40" /></td>
</tr>
<tr class="form-field">
<th scope="row"><?php _e( 'Last Updated' ); ?></th>
<td><input name="blog[last_updated]" type="text" id="blog_last_updated" value="<?php echo esc_attr( $details->last_updated ) ?>" size="40" /></td>
</tr>
<?php
$attribute_fields = array( 'public' => __( 'Public' ) );
if ( ! $is_main_site ) {
$attribute_fields['archived'] = __( 'Archived' );
$attribute_fields['spam'] = _x( 'Spam', 'site' );
$attribute_fields['deleted'] = __( 'Deleted' );
}
$attribute_fields['mature'] = __( 'Mature' );
?>
<tr>
<th scope="row"><?php _e( 'Attributes' ); ?></th>
<td>
<?php foreach ( $attribute_fields as $field_key => $field_label ) : ?>
<label><input type="checkbox" name="blog[<?php echo $field_key; ?>]" value="1" <?php checked( (bool) $details->$field_key, true ); disabled( ! in_array( $details->$field_key, array( 0, 1 ) ) ); ?> />
<?php echo $field_label; ?></label><br/>
<?php endforeach; ?>
</td>
</tr>
</table>
<?php submit_button(); ?>
</form>
</div>
<?php
require('../admin-footer.php');
| zyblog | trunk/zyblog/wp-admin/network/site-info.php | PHP | asf20 | 8,073 |
<?php
/**
* Updates network administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
require( '../update-core.php' ); | zyblog | trunk/zyblog/wp-admin/network/update-core.php | PHP | asf20 | 312 |
<?php
/**
* WordPress Network Administration Bootstrap
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
define( 'WP_NETWORK_ADMIN', true );
/** Load WordPress Administration Bootstrap */
require_once( dirname( dirname( __FILE__ ) ) . '/admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
$redirect_network_admin_request = ( ( $current_blog->domain != $current_site->domain ) || ( $current_blog->path != $current_site->path ) );
$redirect_network_admin_request = apply_filters( 'redirect_network_admin_request', $redirect_network_admin_request );
if ( $redirect_network_admin_request ) {
wp_redirect( network_admin_url() );
exit;
}
unset( $redirect_network_admin_request );
| zyblog | trunk/zyblog/wp-admin/network/admin.php | PHP | asf20 | 741 |
<?php
/**
* Edit Site Users Administration Screen
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can('manage_sites') )
wp_die(__('You do not have sufficient permissions to edit this site.'));
$wp_list_table = _get_list_table('WP_Users_List_Table');
$wp_list_table->prepare_items();
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.') . '</p>' .
'<p>' . __('<strong>Info</strong> - The domain and path are rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.') . '</p>' .
'<p>' . __('<strong>Users</strong> - This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.') . '</p>' .
'<p>' . sprintf( __('<strong>Themes</strong> - This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site’s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ), network_admin_url( 'themes.php' ) ) . '</p>' .
'<p>' . __('<strong>Settings</strong> - This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.') . '</p>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Sites_Screen" target="_blank">Documentation on Site Management</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
);
$_SERVER['REQUEST_URI'] = remove_query_arg( 'update', $_SERVER['REQUEST_URI'] );
$referer = remove_query_arg( 'update', wp_get_referer() );
$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
if ( ! $id )
wp_die( __('Invalid site ID.') );
$details = get_blog_details( $id );
if ( ! can_edit_network( $details->site_id ) )
wp_die( __( 'You do not have permission to access this page.' ) );
$is_main_site = is_main_site( $id );
switch_to_blog( $id );
$editblog_roles = $wp_roles->roles;
$default_role = get_option( 'default_role' );
$action = $wp_list_table->current_action();
if ( $action ) {
switch ( $action ) {
case 'newuser':
check_admin_referer( 'add-user', '_wpnonce_add-new-user' );
$user = $_POST['user'];
if ( ! is_array( $_POST['user'] ) || empty( $user['username'] ) || empty( $user['email'] ) ) {
$update = 'err_new';
} else {
$password = wp_generate_password( 12, false);
$user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) );
if ( false == $user_id ) {
$update = 'err_new_dup';
} else {
wp_new_user_notification( $user_id, $password );
add_user_to_blog( $id, $user_id, $_POST['new_role'] );
$update = 'newuser';
}
}
break;
case 'adduser':
check_admin_referer( 'add-user', '_wpnonce_add-user' );
if ( !empty( $_POST['newuser'] ) ) {
$update = 'adduser';
$newuser = $_POST['newuser'];
$userid = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . $wpdb->users . " WHERE user_login = %s", $newuser ) );
if ( $userid ) {
$blog_prefix = $wpdb->get_blog_prefix( $id );
$user = $wpdb->get_var( "SELECT user_id FROM " . $wpdb->usermeta . " WHERE user_id='$userid' AND meta_key='{$blog_prefix}capabilities'" );
if ( $user == false )
add_user_to_blog( $id, $userid, $_POST['new_role'] );
else
$update = 'err_add_member';
} else {
$update = 'err_add_notfound';
}
} else {
$update = 'err_add_notfound';
}
break;
case 'remove':
if ( ! current_user_can( 'remove_users' ) )
die(__('You can’t remove users.'));
check_admin_referer( 'bulk-users' );
$update = 'remove';
if ( isset( $_REQUEST['users'] ) ) {
$userids = $_REQUEST['users'];
foreach ( $userids as $user_id ) {
$user_id = (int) $user_id;
remove_user_from_blog( $user_id, $id );
}
} elseif ( isset( $_GET['user'] ) ) {
remove_user_from_blog( $_GET['user'] );
} else {
$update = 'err_remove';
}
break;
case 'promote':
check_admin_referer( 'bulk-users' );
$editable_roles = get_editable_roles();
if ( empty( $editable_roles[$_REQUEST['new_role']] ) )
wp_die(__('You can’t give users that role.'));
if ( isset( $_REQUEST['users'] ) ) {
$userids = $_REQUEST['users'];
$update = 'promote';
foreach ( $userids as $user_id ) {
$user_id = (int) $user_id;
// If the user doesn't already belong to the blog, bail.
if ( !is_user_member_of_blog( $user_id ) )
wp_die(__('Cheatin’ uh?'));
$user = get_userdata( $user_id );
$user->set_role( $_REQUEST['new_role'] );
}
} else {
$update = 'err_promote';
}
break;
}
wp_safe_redirect( add_query_arg( 'update', $update, $referer ) );
exit();
}
restore_current_blog();
if ( isset( $_GET['action'] ) && 'update-site' == $_GET['action'] ) {
wp_safe_redirect( $referer );
exit();
}
add_screen_option( 'per_page', array( 'label' => _x( 'Users', 'users per page (screen options)' ) ) );
$site_url_no_http = preg_replace( '#^http(s)?://#', '', get_blogaddress_by_id( $id ) );
$title_site_url_linked = sprintf( __('Edit Site: <a href="%1$s">%2$s</a>'), get_blogaddress_by_id( $id ), $site_url_no_http );
$title = sprintf( __('Edit Site: %s'), $site_url_no_http );
$parent_file = 'sites.php';
$submenu_file = 'sites.php';
if ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) )
wp_enqueue_script( 'user-suggest' );
require('../admin-header.php'); ?>
<script type='text/javascript'>
/* <![CDATA[ */
var current_site_id = <?php echo $id; ?>;
/* ]]> */
</script>
<div class="wrap">
<?php screen_icon('ms-admin'); ?>
<h2 id="edit-site"><?php echo $title_site_url_linked ?></h2>
<h3 class="nav-tab-wrapper">
<?php
$tabs = array(
'site-info' => array( 'label' => __( 'Info' ), 'url' => 'site-info.php' ),
'site-users' => array( 'label' => __( 'Users' ), 'url' => 'site-users.php' ),
'site-themes' => array( 'label' => __( 'Themes' ), 'url' => 'site-themes.php' ),
'site-settings' => array( 'label' => __( 'Settings' ), 'url' => 'site-settings.php' ),
);
foreach ( $tabs as $tab_id => $tab ) {
$class = ( $tab['url'] == $pagenow ) ? ' nav-tab-active' : '';
echo '<a href="' . $tab['url'] . '?id=' . $id .'" class="nav-tab' . $class . '">' . esc_html( $tab['label'] ) . '</a>';
}
?>
</h3><?php
if ( isset($_GET['update']) ) :
switch($_GET['update']) {
case 'adduser':
echo '<div id="message" class="updated"><p>' . __( 'User added.' ) . '</p></div>';
break;
case 'err_add_member':
echo '<div id="message" class="error"><p>' . __( 'User is already a member of this site.' ) . '</p></div>';
break;
case 'err_add_notfound':
echo '<div id="message" class="error"><p>' . __( 'Enter the username of an existing user.' ) . '</p></div>';
break;
case 'promote':
echo '<div id="message" class="updated"><p>' . __( 'Changed roles.' ) . '</p></div>';
break;
case 'err_promote':
echo '<div id="message" class="error"><p>' . __( 'Select a user to change role.' ) . '</p></div>';
break;
case 'remove':
echo '<div id="message" class="updated"><p>' . __( 'User removed from this site.' ) . '</p></div>';
break;
case 'err_remove':
echo '<div id="message" class="error"><p>' . __( 'Select a user to remove.' ) . '</p></div>';
break;
case 'newuser':
echo '<div id="message" class="updated"><p>' . __( 'User created.' ) . '</p></div>';
break;
case 'err_new':
echo '<div id="message" class="error"><p>' . __( 'Enter the username and email.' ) . '</p></div>';
break;
case 'err_new_dup':
echo '<div id="message" class="error"><p>' . __( 'Duplicated username or email address.' ) . '</p></div>';
break;
}
endif; ?>
<form class="search-form" action="" method="get">
<?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?>
<input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
</form>
<?php $wp_list_table->views(); ?>
<form method="post" action="site-users.php?action=update-site">
<input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
<?php $wp_list_table->display(); ?>
</form>
<?php do_action( 'network_site_users_after_list_table', '' );?>
<?php if ( current_user_can( 'promote_users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) : ?>
<h3 id="add-existing-user"><?php _e( 'Add Existing User' ); ?></h3>
<form action="site-users.php?action=adduser" id="adduser" method="post">
<input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
<table class="form-table">
<tr>
<th scope="row"><?php _e( 'Username' ); ?></th>
<td><input type="text" class="regular-text wp-suggest-user" name="newuser" id="newuser" /></td>
</tr>
<tr>
<th scope="row"><?php _e( 'Role' ); ?></th>
<td><select name="new_role" id="new_role_0">
<?php
reset( $editblog_roles );
foreach ( $editblog_roles as $role => $role_assoc ) {
$name = translate_user_role( $role_assoc['name'] );
echo '<option ' . selected( $default_role, $role, false ) . ' value="' . esc_attr( $role ) . '">' . esc_html( $name ) . '</option>';
}
?>
</select></td>
</tr>
</table>
<?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?>
<?php submit_button( __( 'Add User' ), 'primary', 'add-user', true, array( 'id' => 'submit-add-existing-user' ) ); ?>
</form>
<?php endif; ?>
<?php if ( current_user_can( 'create_users' ) && apply_filters( 'show_network_site_users_add_new_form', true ) ) : ?>
<h3 id="add-new-user"><?php _e( 'Add New User' ); ?></h3>
<form action="<?php echo network_admin_url('site-users.php?action=newuser'); ?>" id="newuser" method="post">
<input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
<table class="form-table">
<tr>
<th scope="row"><?php _e( 'Username' ) ?></th>
<td><input type="text" class="regular-text" name="user[username]" /></td>
</tr>
<tr>
<th scope="row"><?php _e( 'Email' ) ?></th>
<td><input type="text" class="regular-text" name="user[email]" /></td>
</tr>
<tr>
<th scope="row"><?php _e( 'Role' ); ?></th>
<td><select name="new_role" id="new_role_0">
<?php
reset( $editblog_roles );
foreach ( $editblog_roles as $role => $role_assoc ) {
$name = translate_user_role( $role_assoc['name'] );
echo '<option ' . selected( $default_role, $role, false ) . ' value="' . esc_attr( $role ) . '">' . esc_html( $name ) . '</option>';
}
?>
</select></td>
</tr>
<tr class="form-field">
<td colspan="2"><?php _e( 'Username and password will be mailed to the above email address.' ) ?></td>
</tr>
</table>
<?php wp_nonce_field( 'add-user', '_wpnonce_add-new-user' ) ?>
<?php submit_button( __( 'Add New User' ), 'primary', 'add-user', true, array( 'id' => 'submit-add-user' ) ); ?>
</form>
<?php endif; ?>
</div>
<?php
require('../admin-footer.php');
| zyblog | trunk/zyblog/wp-admin/network/site-users.php | PHP | asf20 | 11,914 |
<?php
/**
* Multisite sites administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.0.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can( 'manage_sites' ) )
wp_die( __( 'You do not have permission to access this page.' ) );
$wp_list_table = _get_list_table( 'WP_MS_Sites_List_Table' );
$pagenum = $wp_list_table->get_pagenum();
$title = __( 'Sites' );
$parent_file = 'sites.php';
add_screen_option( 'per_page', array( 'label' => _x( 'Sites', 'sites per page (screen options)' ) ) );
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __('Add New takes you to the Add New Site screen. You can search for a site by Name, ID number, or IP address. Screen Options allows you to choose how many sites to display on one page.') . '</p>' .
'<p>' . __('This is the main table of all sites on this network. Switch between list and excerpt views by using the icons above the right side of the table.') . '</p>' .
'<p>' . __('Hovering over each site reveals seven options (three for the primary site):') . '</p>' .
'<ul><li>' . __('An Edit link to a separate Edit Site screen.') . '</li>' .
'<li>' . __('Dashboard leads to the Dashboard for that site.') . '</li>' .
'<li>' . __('Deactivate, Archive, and Spam which lead to confirmation screens. These actions can be reversed later.') . '</li>' .
'<li>' . __('Delete which is a permanent action after the confirmation screens.') . '</li>' .
'<li>' . __('Visit to go to the frontend site live.') . '</li></ul>' .
'<p>' . __('The site ID is used internally, and is not shown on the front end of the site or to users/viewers.') . '</p>' .
'<p>' . __('Clicking on bold headings can re-sort this table.') . '</p>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Sites_Screen" target="_blank">Documentation on Site Management</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
);
$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
if ( isset( $_GET['action'] ) ) {
do_action( 'wpmuadminedit' , '' );
if ( 'confirm' === $_GET['action'] ) {
check_admin_referer( 'confirm' );
if ( ! headers_sent() ) {
nocache_headers();
header( 'Content-Type: text/html; charset=utf-8' );
}
if ( $current_site->blog_id == $id )
wp_die( __( 'You are not allowed to change the current site.' ) );
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head>
<title><?php _e( 'WordPress › Confirm your action' ); ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
wp_admin_css( 'install', true );
wp_admin_css( 'ie', true );
?>
</head>
<body class="wp-core-ui">
<h1 id="logo"><a href="<?php esc_attr_e( 'http://wordpress.org/' ); ?>"><?php _e( 'WordPress' ); ?></a></h1>
<form action="sites.php?action=<?php echo esc_attr( $_GET['action2'] ) ?>" method="post">
<input type="hidden" name="action" value="<?php echo esc_attr( $_GET['action2'] ) ?>" />
<input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
<input type="hidden" name="_wp_http_referer" value="<?php echo esc_attr( wp_get_referer() ); ?>" />
<?php wp_nonce_field( $_GET['action2'], '_wpnonce', false ); ?>
<p><?php echo esc_html( stripslashes( $_GET['msg'] ) ); ?></p>
<?php submit_button( __('Confirm'), 'button' ); ?>
</form>
</body>
</html>
<?php
exit();
}
$updated_action = '';
$manage_actions = array( 'deleteblog', 'allblogs', 'archiveblog', 'unarchiveblog', 'activateblog', 'deactivateblog', 'unspamblog', 'spamblog', 'unmatureblog', 'matureblog' );
if ( in_array( $_GET['action'], $manage_actions ) ) {
$action = $_GET['action'];
if ( 'allblogs' === $action )
$action = 'bulk-sites';
check_admin_referer( $action );
}
switch ( $_GET['action'] ) {
case 'deleteblog':
if ( ! current_user_can( 'delete_sites' ) )
wp_die( __( 'You do not have permission to access this page.' ) );
$updated_action = 'not_deleted';
if ( $id != '0' && $id != $current_site->blog_id && current_user_can( 'delete_site', $id ) ) {
wpmu_delete_blog( $id, true );
$updated_action = 'delete';
}
break;
case 'allblogs':
if ( ( isset( $_POST['action'] ) || isset( $_POST['action2'] ) ) && isset( $_POST['allblogs'] ) ) {
$doaction = $_POST['action'] != -1 ? $_POST['action'] : $_POST['action2'];
foreach ( (array) $_POST['allblogs'] as $key => $val ) {
if ( $val != '0' && $val != $current_site->blog_id ) {
switch ( $doaction ) {
case 'delete':
if ( ! current_user_can( 'delete_site', $val ) )
wp_die( __( 'You are not allowed to delete the site.' ) );
$updated_action = 'all_delete';
wpmu_delete_blog( $val, true );
break;
case 'spam':
case 'notspam':
$updated_action = ( 'spam' === $doaction ) ? 'all_spam' : 'all_notspam';
update_blog_status( $val, 'spam', ( 'spam' === $doaction ) ? '1' : '0' );
break;
}
} else {
wp_die( __( 'You are not allowed to change the current site.' ) );
}
}
} else {
wp_redirect( network_admin_url( 'sites.php' ) );
exit();
}
break;
case 'archiveblog':
case 'unarchiveblog':
update_blog_status( $id, 'archived', ( 'archiveblog' === $_GET['action'] ) ? '1' : '0' );
break;
case 'activateblog':
update_blog_status( $id, 'deleted', '0' );
do_action( 'activate_blog', $id );
break;
case 'deactivateblog':
do_action( 'deactivate_blog', $id );
update_blog_status( $id, 'deleted', '1' );
break;
case 'unspamblog':
case 'spamblog':
update_blog_status( $id, 'spam', ( 'spamblog' === $_GET['action'] ) ? '1' : '0' );
break;
case 'unmatureblog':
case 'matureblog':
update_blog_status( $id, 'mature', ( 'matureblog' === $_GET['action'] ) ? '1' : '0' );
break;
}
if ( empty( $updated_action ) && in_array( $_GET['action'], $manage_actions ) )
$updated_action = $_GET['action'];
if ( ! empty( $updated_action ) ) {
wp_safe_redirect( add_query_arg( array( 'updated' => $updated_action ), wp_get_referer() ) );
exit();
}
}
$msg = '';
if ( isset( $_GET['updated'] ) ) {
switch ( $_GET['updated'] ) {
case 'all_notspam':
$msg = __( 'Sites removed from spam.' );
break;
case 'all_spam':
$msg = __( 'Sites marked as spam.' );
break;
case 'all_delete':
$msg = __( 'Sites deleted.' );
break;
case 'delete':
$msg = __( 'Site deleted.' );
break;
case 'not_deleted':
$msg = __( 'You do not have permission to delete that site.' );
break;
case 'archiveblog':
$msg = __( 'Site archived.' );
break;
case 'unarchiveblog':
$msg = __( 'Site unarchived.' );
break;
case 'activateblog':
$msg = __( 'Site activated.' );
break;
case 'deactivateblog':
$msg = __( 'Site deactivated.' );
break;
case 'unspamblog':
$msg = __( 'Site removed from spam.' );
break;
case 'spamblog':
$msg = __( 'Site marked as spam.' );
break;
default:
$msg = apply_filters( 'network_sites_updated_message_' . $_GET['updated'], __( 'Settings saved.' ) );
break;
}
if ( ! empty( $msg ) )
$msg = '<div class="updated" id="message"><p>' . $msg . '</p></div>';
}
$wp_list_table->prepare_items();
require_once( '../admin-header.php' );
?>
<div class="wrap">
<?php screen_icon( 'ms-admin' ); ?>
<h2><?php _e( 'Sites' ) ?>
<?php if ( current_user_can( 'create_sites') ) : ?>
<a href="<?php echo network_admin_url('site-new.php'); ?>" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'site' ); ?></a>
<?php endif; ?>
<?php if ( isset( $_REQUEST['s'] ) && $_REQUEST['s'] ) {
printf( '<span class="subtitle">' . __( 'Search results for “%s”' ) . '</span>', esc_html( $s ) );
} ?>
</h2>
<?php echo $msg; ?>
<form action="" method="get" id="ms-search">
<?php $wp_list_table->search_box( __( 'Search Sites' ), 'site' ); ?>
<input type="hidden" name="action" value="blogs" />
</form>
<form id="form-site-list" action="sites.php?action=allblogs" method="post">
<?php $wp_list_table->display(); ?>
</form>
</div>
<?php
require_once( '../admin-footer.php' ); ?>
| zyblog | trunk/zyblog/wp-admin/network/sites.php | PHP | asf20 | 8,551 |
<?php
/**
* Plugin editor network administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
require( '../plugin-editor.php' );
| zyblog | trunk/zyblog/wp-admin/network/plugin-editor.php | PHP | asf20 | 321 |
<?php
/**
* Add Site Administration Screen
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can('create_users') )
wp_die(__('You do not have sufficient permissions to add users to this network.'));
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __('Add User will set up a new user account on the network and send that person an email with username and password.') . '</p>' .
'<p>' . __('Users who are signed up to the network without a site are added as subscribers to the main or primary dashboard site, giving them profile pages to manage their accounts. These users will only see Dashboard and My Sites in the main navigation until a site is created for them.') . '</p>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Users_Screen" target="_blank">Documentation on Network Users</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
);
if ( isset($_REQUEST['action']) && 'add-user' == $_REQUEST['action'] ) {
check_admin_referer( 'add-user', '_wpnonce_add-user' );
if ( ! current_user_can( 'manage_network_users' ) )
wp_die( __( 'You do not have permission to access this page.' ) );
if ( ! is_array( $_POST['user'] ) )
wp_die( __( 'Cannot create an empty user.' ) );
$user = $_POST['user'];
$user_details = wpmu_validate_user_signup( $user['username'], $user['email'] );
if ( is_wp_error( $user_details[ 'errors' ] ) && ! empty( $user_details[ 'errors' ]->errors ) ) {
$add_user_errors = $user_details[ 'errors' ];
} else {
$password = wp_generate_password( 12, false);
$user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) );
if ( ! $user_id ) {
$add_user_errors = new WP_Error( 'add_user_fail', __( 'Cannot add user.' ) );
} else {
wp_new_user_notification( $user_id, $password );
wp_redirect( add_query_arg( array('update' => 'added'), 'user-new.php' ) );
exit;
}
}
}
if ( isset($_GET['update']) ) {
$messages = array();
if ( 'added' == $_GET['update'] )
$messages[] = __('User added.');
}
$title = __('Add New User');
$parent_file = 'users.php';
require('../admin-header.php'); ?>
<div class="wrap">
<?php screen_icon(); ?>
<h2 id="add-new-user"><?php _e('Add New User') ?></h2>
<?php
if ( ! empty( $messages ) ) {
foreach ( $messages as $msg )
echo '<div id="message" class="updated"><p>' . $msg . '</p></div>';
}
if ( isset( $add_user_errors ) && is_wp_error( $add_user_errors ) ) { ?>
<div class="error">
<?php
foreach ( $add_user_errors->get_error_messages() as $message )
echo "<p>$message</p>";
?>
</div>
<?php } ?>
<form action="<?php echo network_admin_url('user-new.php?action=add-user'); ?>" id="adduser" method="post">
<table class="form-table">
<tr class="form-field form-required">
<th scope="row"><?php _e( 'Username' ) ?></th>
<td><input type="text" class="regular-text" name="user[username]" /></td>
</tr>
<tr class="form-field form-required">
<th scope="row"><?php _e( 'Email' ) ?></th>
<td><input type="text" class="regular-text" name="user[email]" /></td>
</tr>
<tr class="form-field">
<td colspan="2"><?php _e( 'Username and password will be mailed to the above email address.' ) ?></td>
</tr>
</table>
<?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?>
<?php submit_button( __('Add User'), 'primary', 'add-user' ); ?>
</form>
</div>
<?php
require('../admin-footer.php');
| zyblog | trunk/zyblog/wp-admin/network/user-new.php | PHP | asf20 | 3,852 |
<?php
/**
* Edit Site Themes Administration Screen
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can( 'manage_sites' ) )
wp_die( __( 'You do not have sufficient permissions to manage themes for this site.' ) );
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.') . '</p>' .
'<p>' . __('<strong>Info</strong> - The domain and path are rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.') . '</p>' .
'<p>' . __('<strong>Users</strong> - This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.') . '</p>' .
'<p>' . sprintf( __('<strong>Themes</strong> - This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site’s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ), network_admin_url( 'themes.php' ) ) . '</p>' .
'<p>' . __('<strong>Settings</strong> - This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.') . '</p>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Sites_Screen" target="_blank">Documentation on Site Management</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
);
$wp_list_table = _get_list_table('WP_MS_Themes_List_Table');
$action = $wp_list_table->current_action();
$s = isset($_REQUEST['s']) ? $_REQUEST['s'] : '';
// Clean up request URI from temporary args for screen options/paging uri's to work as expected.
$temp_args = array( 'enabled', 'disabled', 'error' );
$_SERVER['REQUEST_URI'] = remove_query_arg( $temp_args, $_SERVER['REQUEST_URI'] );
$referer = remove_query_arg( $temp_args, wp_get_referer() );
$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
if ( ! $id )
wp_die( __('Invalid site ID.') );
$wp_list_table->prepare_items();
$details = get_blog_details( $id );
if ( !can_edit_network( $details->site_id ) )
wp_die( __( 'You do not have permission to access this page.' ) );
$is_main_site = is_main_site( $id );
if ( $action ) {
switch_to_blog( $id );
$allowed_themes = get_option( 'allowedthemes' );
switch ( $action ) {
case 'enable':
check_admin_referer( 'enable-theme_' . $_GET['theme'] );
$theme = $_GET['theme'];
$action = 'enabled';
$n = 1;
if ( !$allowed_themes )
$allowed_themes = array( $theme => true );
else
$allowed_themes[$theme] = true;
break;
case 'disable':
check_admin_referer( 'disable-theme_' . $_GET['theme'] );
$theme = $_GET['theme'];
$action = 'disabled';
$n = 1;
if ( !$allowed_themes )
$allowed_themes = array();
else
unset( $allowed_themes[$theme] );
break;
case 'enable-selected':
check_admin_referer( 'bulk-themes' );
if ( isset( $_POST['checked'] ) ) {
$themes = (array) $_POST['checked'];
$action = 'enabled';
$n = count( $themes );
foreach( (array) $themes as $theme )
$allowed_themes[ $theme ] = true;
} else {
$action = 'error';
$n = 'none';
}
break;
case 'disable-selected':
check_admin_referer( 'bulk-themes' );
if ( isset( $_POST['checked'] ) ) {
$themes = (array) $_POST['checked'];
$action = 'disabled';
$n = count( $themes );
foreach( (array) $themes as $theme )
unset( $allowed_themes[ $theme ] );
} else {
$action = 'error';
$n = 'none';
}
break;
}
update_option( 'allowedthemes', $allowed_themes );
restore_current_blog();
wp_safe_redirect( add_query_arg( array( 'id' => $id, $action => $n ), $referer ) );
exit;
}
if ( isset( $_GET['action'] ) && 'update-site' == $_GET['action'] ) {
wp_safe_redirect( $referer );
exit();
}
add_thickbox();
add_screen_option( 'per_page', array( 'label' => _x( 'Themes', 'themes per page (screen options)' ) ) );
$site_url_no_http = preg_replace( '#^http(s)?://#', '', get_blogaddress_by_id( $id ) );
$title_site_url_linked = sprintf( __('Edit Site: <a href="%1$s">%2$s</a>'), get_blogaddress_by_id( $id ), $site_url_no_http );
$title = sprintf( __('Edit Site: %s'), $site_url_no_http );
$parent_file = 'sites.php';
$submenu_file = 'sites.php';
require('../admin-header.php'); ?>
<div class="wrap">
<?php screen_icon('ms-admin'); ?>
<h2 id="edit-site"><?php echo $title_site_url_linked ?></h2>
<h3 class="nav-tab-wrapper">
<?php
$tabs = array(
'site-info' => array( 'label' => __( 'Info' ), 'url' => 'site-info.php' ),
'site-users' => array( 'label' => __( 'Users' ), 'url' => 'site-users.php' ),
'site-themes' => array( 'label' => __( 'Themes' ), 'url' => 'site-themes.php' ),
'site-settings' => array( 'label' => __( 'Settings' ), 'url' => 'site-settings.php' ),
);
foreach ( $tabs as $tab_id => $tab ) {
$class = ( $tab['url'] == $pagenow ) ? ' nav-tab-active' : '';
echo '<a href="' . $tab['url'] . '?id=' . $id .'" class="nav-tab' . $class . '">' . esc_html( $tab['label'] ) . '</a>';
}
?>
</h3><?php
if ( isset( $_GET['enabled'] ) ) {
$_GET['enabled'] = absint( $_GET['enabled'] );
echo '<div id="message" class="updated"><p>' . sprintf( _n( 'Theme enabled.', '%s themes enabled.', $_GET['enabled'] ), number_format_i18n( $_GET['enabled'] ) ) . '</p></div>';
} elseif ( isset( $_GET['disabled'] ) ) {
$_GET['disabled'] = absint( $_GET['disabled'] );
echo '<div id="message" class="updated"><p>' . sprintf( _n( 'Theme disabled.', '%s themes disabled.', $_GET['disabled'] ), number_format_i18n( $_GET['disabled'] ) ) . '</p></div>';
} elseif ( isset( $_GET['error'] ) && 'none' == $_GET['error'] ) {
echo '<div id="message" class="error"><p>' . __( 'No theme selected.' ) . '</p></div>';
} ?>
<p><?php _e( 'Network enabled themes are not shown on this screen.' ) ?></p>
<form method="get" action="">
<?php $wp_list_table->search_box( __( 'Search Installed Themes' ), 'theme' ); ?>
<input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
</form>
<?php $wp_list_table->views(); ?>
<form method="post" action="site-themes.php?action=update-site">
<input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
<?php $wp_list_table->display(); ?>
</form>
</div>
<?php include(ABSPATH . 'wp-admin/admin-footer.php'); ?>
| zyblog | trunk/zyblog/wp-admin/network/site-themes.php | PHP | asf20 | 7,303 |
<?php
/**
* Multisite network settings administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.0.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can( 'manage_network_options' ) )
wp_die( __( 'You do not have permission to access this page.' ) );
$title = __( 'Network Settings' );
$parent_file = 'settings.php';
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __('This screen sets and changes options for the network as a whole. The first site is the main site in the network and network options are pulled from that original site’s options.') . '</p>' .
'<p>' . __('Operational settings has fields for the network’s name and admin email.') . '</p>' .
'<p>' . __('Dashboard Site is an option to give a site to users who do not have a site on the system. Their default role is Subscriber, but that default can be changed. The Admin Notice Feed can provide a notice on all dashboards of the latest post via RSS or Atom, or provide no such notice if left blank.') . '</p>' .
'<p>' . __('Registration settings can disable/enable public signups. If you let others sign up for a site, install spam plugins. Spaces, not commas, should separate names banned as sites for this network.') . '</p>' .
'<p>' . __('New site settings are defaults applied when a new site is created in the network. These include welcome email for when a new site or user account is registered, and what᾿s put in the first post, page, comment, comment author, and comment URL.') . '</p>' .
'<p>' . __('Upload settings control the size of the uploaded files and the amount of available upload space for each site. You can change the default value for specific sites when you edit a particular site. Allowed file types are also listed (space separated only).') . '</p>' .
'<p>' . __('Menu setting enables/disables the plugin menus from appearing for non super admins, so that only super admins, not site admins, have access to activate plugins.') . '</p>' .
'<p>' . __('Super admins can no longer be added on the Options screen. You must now go to the list of existing users on Network Admin > Users and click on Username or the Edit action link below that name. This goes to an Edit User page where you can check a box to grant super admin privileges.') . '</p>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Settings_Screen" target="_blank">Documentation on Network Settings</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
if ( $_POST ) {
do_action( 'wpmuadminedit' , '' );
check_admin_referer( 'siteoptions' );
$checked_options = array( 'menu_items' => array(), 'registrationnotification' => 'no', 'upload_space_check_disabled' => 1, 'add_new_users' => 0 );
foreach ( $checked_options as $option_name => $option_unchecked_value ) {
if ( ! isset( $_POST[$option_name] ) )
$_POST[$option_name] = $option_unchecked_value;
}
$options = array(
'registrationnotification', 'registration', 'add_new_users', 'menu_items',
'upload_space_check_disabled', 'blog_upload_space', 'upload_filetypes', 'site_name',
'first_post', 'first_page', 'first_comment', 'first_comment_url', 'first_comment_author',
'welcome_email', 'welcome_user_email', 'fileupload_maxk', 'global_terms_enabled',
'illegal_names', 'limited_email_domains', 'banned_email_domains', 'WPLANG', 'admin_email',
);
foreach ( $options as $option_name ) {
if ( ! isset($_POST[$option_name]) )
continue;
$value = stripslashes_deep( $_POST[$option_name] );
update_site_option( $option_name, $value );
}
// Update more options here
do_action( 'update_wpmu_options' );
wp_redirect( add_query_arg( 'updated', 'true', network_admin_url( 'settings.php' ) ) );
exit();
}
include( '../admin-header.php' );
if ( isset( $_GET['updated'] ) ) {
?><div id="message" class="updated"><p><?php _e( 'Options saved.' ) ?></p></div><?php
}
?>
<div class="wrap">
<?php screen_icon('options-general'); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<form method="post" action="settings.php">
<?php wp_nonce_field( 'siteoptions' ); ?>
<h3><?php _e( 'Operational Settings' ); ?></h3>
<table class="form-table">
<tr valign="top">
<th scope="row"><label for="site_name"><?php _e( 'Network Name' ) ?></label></th>
<td>
<input name="site_name" type="text" id="site_name" class="regular-text" value="<?php echo esc_attr( $current_site->site_name ) ?>" />
<br />
<?php _e( 'What you would like to call this network.' ) ?>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="admin_email"><?php _e( 'Network Admin Email' ) ?></label></th>
<td>
<input name="admin_email" type="text" id="admin_email" class="regular-text" value="<?php echo esc_attr( get_site_option('admin_email') ) ?>" />
<br />
<?php printf( __( 'Registration and support emails will come from this address. An address such as <code>support@%s</code> is recommended.' ), $current_site->domain ); ?>
</td>
</tr>
</table>
<h3><?php _e( 'Registration Settings' ); ?></h3>
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e( 'Allow new registrations' ) ?></th>
<?php
if ( !get_site_option( 'registration' ) )
update_site_option( 'registration', 'none' );
$reg = get_site_option( 'registration' );
?>
<td>
<label><input name="registration" type="radio" id="registration1" value="none"<?php checked( $reg, 'none') ?> /> <?php _e( 'Registration is disabled.' ); ?></label><br />
<label><input name="registration" type="radio" id="registration2" value="user"<?php checked( $reg, 'user') ?> /> <?php _e( 'User accounts may be registered.' ); ?></label><br />
<label><input name="registration" type="radio" id="registration3" value="blog"<?php checked( $reg, 'blog') ?> /> <?php _e( 'Logged in users may register new sites.' ); ?></label><br />
<label><input name="registration" type="radio" id="registration4" value="all"<?php checked( $reg, 'all') ?> /> <?php _e( 'Both sites and user accounts can be registered.' ); ?></label><br />
<?php if ( is_subdomain_install() )
_e( 'If registration is disabled, please set <code>NOBLOGREDIRECT</code> in <code>wp-config.php</code> to a URL you will redirect visitors to if they visit a non-existent site.' );
?>
</td>
</tr>
<tr valign="top">
<th scope="row"><?php _e( 'Registration notification' ) ?></th>
<?php
if ( !get_site_option( 'registrationnotification' ) )
update_site_option( 'registrationnotification', 'yes' );
?>
<td>
<label><input name="registrationnotification" type="checkbox" id="registrationnotification" value="yes"<?php checked( get_site_option( 'registrationnotification' ), 'yes' ) ?> /> <?php _e( 'Send the network admin an email notification every time someone registers a site or user account.' ) ?></label>
</td>
</tr>
<tr valign="top" id="addnewusers">
<th scope="row"><?php _e( 'Add New Users' ) ?></th>
<td>
<label><input name="add_new_users" type="checkbox" id="add_new_users" value="1"<?php checked( get_site_option( 'add_new_users' ) ) ?> /> <?php _e( 'Allow site administrators to add new users to their site via the "Users → Add New" page.' ); ?></label>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="illegal_names"><?php _e( 'Banned Names' ) ?></label></th>
<td>
<input name="illegal_names" type="text" id="illegal_names" class="large-text" value="<?php echo esc_attr( implode( " ", (array) get_site_option( 'illegal_names' ) ) ); ?>" size="45" />
<br />
<?php _e( 'Users are not allowed to register these sites. Separate names by spaces.' ) ?>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="limited_email_domains"><?php _e( 'Limited Email Registrations' ) ?></label></th>
<td>
<?php $limited_email_domains = get_site_option( 'limited_email_domains' );
$limited_email_domains = str_replace( ' ', "\n", $limited_email_domains ); ?>
<textarea name="limited_email_domains" id="limited_email_domains" cols="45" rows="5">
<?php echo esc_textarea( $limited_email_domains == '' ? '' : implode( "\n", (array) $limited_email_domains ) ); ?></textarea>
<br />
<?php _e( 'If you want to limit site registrations to certain domains. One domain per line.' ) ?>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="banned_email_domains"><?php _e('Banned Email Domains') ?></label></th>
<td>
<textarea name="banned_email_domains" id="banned_email_domains" cols="45" rows="5">
<?php echo esc_textarea( get_site_option( 'banned_email_domains' ) == '' ? '' : implode( "\n", (array) get_site_option( 'banned_email_domains' ) ) ); ?></textarea>
<br />
<?php _e( 'If you want to ban domains from site registrations. One domain per line.' ) ?>
</td>
</tr>
</table>
<h3><?php _e('New Site Settings'); ?></h3>
<table class="form-table">
<tr valign="top">
<th scope="row"><label for="welcome_email"><?php _e( 'Welcome Email' ) ?></label></th>
<td>
<textarea name="welcome_email" id="welcome_email" rows="5" cols="45" class="large-text">
<?php echo esc_textarea( stripslashes( get_site_option( 'welcome_email' ) ) ) ?></textarea>
<br />
<?php _e( 'The welcome email sent to new site owners.' ) ?>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="welcome_user_email"><?php _e( 'Welcome User Email' ) ?></label></th>
<td>
<textarea name="welcome_user_email" id="welcome_user_email" rows="5" cols="45" class="large-text">
<?php echo esc_textarea( stripslashes( get_site_option( 'welcome_user_email' ) ) ) ?></textarea>
<br />
<?php _e( 'The welcome email sent to new users.' ) ?>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="first_post"><?php _e( 'First Post' ) ?></label></th>
<td>
<textarea name="first_post" id="first_post" rows="5" cols="45" class="large-text">
<?php echo esc_textarea( stripslashes( get_site_option( 'first_post' ) ) ) ?></textarea>
<br />
<?php _e( 'The first post on a new site.' ) ?>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="first_page"><?php _e( 'First Page' ) ?></label></th>
<td>
<textarea name="first_page" id="first_page" rows="5" cols="45" class="large-text">
<?php echo esc_textarea( stripslashes( get_site_option('first_page') ) ) ?></textarea>
<br />
<?php _e( 'The first page on a new site.' ) ?>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="first_comment"><?php _e( 'First Comment' ) ?></label></th>
<td>
<textarea name="first_comment" id="first_comment" rows="5" cols="45" class="large-text">
<?php echo esc_textarea( stripslashes( get_site_option('first_comment') ) ) ?></textarea>
<br />
<?php _e( 'The first comment on a new site.' ) ?>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="first_comment_author"><?php _e( 'First Comment Author' ) ?></label></th>
<td>
<input type="text" size="40" name="first_comment_author" id="first_comment_author" value="<?php echo get_site_option('first_comment_author') ?>" />
<br />
<?php _e( 'The author of the first comment on a new site.' ) ?>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="first_comment_url"><?php _e( 'First Comment URL' ) ?></label></th>
<td>
<input type="text" size="40" name="first_comment_url" id="first_comment_url" value="<?php echo esc_attr( get_site_option( 'first_comment_url' ) ) ?>" />
<br />
<?php _e( 'The URL for the first comment on a new site.' ) ?>
</td>
</tr>
</table>
<h3><?php _e( 'Upload Settings' ); ?></h3>
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e( 'Site upload space' ) ?></th>
<td>
<label><input type="checkbox" id="upload_space_check_disabled" name="upload_space_check_disabled" value="0"<?php checked( get_site_option( 'upload_space_check_disabled' ), 0 ) ?>/> <?php printf( __( 'Limit total size of files uploaded to %s MB' ), '</label><label><input name="blog_upload_space" type="number" min="0" style="width: 100px" id="blog_upload_space" value="' . esc_attr( get_site_option('blog_upload_space', 100) ) . '" />' ); ?></label><br />
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="upload_filetypes"><?php _e( 'Upload file types' ) ?></label></th>
<td><input name="upload_filetypes" type="text" id="upload_filetypes" class="large-text" value="<?php echo esc_attr( get_site_option('upload_filetypes', 'jpg jpeg png gif') ) ?>" size="45" /></td>
</tr>
<tr valign="top">
<th scope="row"><label for="fileupload_maxk"><?php _e( 'Max upload file size' ) ?></label></th>
<td><?php printf( _x( '%s KB', 'File size in kilobytes' ), '<input name="fileupload_maxk" type="number" min="0" style="width: 100px" id="fileupload_maxk" value="' . esc_attr( get_site_option( 'fileupload_maxk', 300 ) ) . '" />' ); ?></td>
</tr>
</table>
<?php
$languages = get_available_languages();
if ( ! empty( $languages ) ) {
$lang = get_site_option( 'WPLANG' );
?>
<h3><?php _e( 'Language Settings' ); ?></h3>
<table class="form-table">
<tr valign="top">
<th><label for="WPLANG"><?php _e( 'Default Language' ); ?></label></th>
<td>
<select name="WPLANG" id="WPLANG">
<?php mu_dropdown_languages( $languages, get_site_option( 'WPLANG' ) ); ?>
</select>
</td>
</tr>
</table>
<?php
} // languages
?>
<h3><?php _e( 'Menu Settings' ); ?></h3>
<table id="menu" class="form-table">
<tr valign="top">
<th scope="row"><?php _e( 'Enable administration menus' ); ?></th>
<td>
<?php
$menu_perms = get_site_option( 'menu_items' );
$menu_items = apply_filters( 'mu_menu_items', array( 'plugins' => __( 'Plugins' ) ) );
foreach ( (array) $menu_items as $key => $val ) {
echo "<label><input type='checkbox' name='menu_items[" . $key . "]' value='1'" . ( isset( $menu_perms[$key] ) ? checked( $menu_perms[$key], '1', false ) : '' ) . " /> " . esc_html( $val ) . "</label><br/>";
}
?>
</td>
</tr>
</table>
<?php do_action( 'wpmu_options' ); // Add more options here ?>
<?php submit_button(); ?>
</form>
</div>
<?php include( '../admin-footer.php' ); ?>
| zyblog | trunk/zyblog/wp-admin/network/settings.php | PHP | asf20 | 14,772 |
<?php
/**
* Multisite upgrade administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.0.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
require_once( ABSPATH . WPINC . '/http.php' );
$title = __( 'Update Network' );
$parent_file = 'upgrade.php';
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __('Only use this screen once you have updated to a new version of WordPress through Updates/Available Updates (via the Network Administration navigation menu or the Toolbar). Clicking the Update Network button will step through each site in the network, five at a time, and make sure any database updates are applied.') . '</p>' .
'<p>' . __('If a version update to core has not happened, clicking this button won’t affect anything.') . '</p>' .
'<p>' . __('If this process fails for any reason, users logging in to their sites will force the same update.') . '</p>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Updates_Screen" target="_blank">Documentation on Update Network</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
require_once('../admin-header.php');
if ( ! current_user_can( 'manage_network' ) )
wp_die( __( 'You do not have permission to access this page.' ) );
echo '<div class="wrap">';
screen_icon('tools');
echo '<h2>' . __( 'Update Network' ) . '</h2>';
$action = isset($_GET['action']) ? $_GET['action'] : 'show';
switch ( $action ) {
case "upgrade":
$n = ( isset($_GET['n']) ) ? intval($_GET['n']) : 0;
if ( $n < 5 ) {
global $wp_db_version;
update_site_option( 'wpmu_upgrade_site', $wp_db_version );
}
$blogs = $wpdb->get_results( "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' AND spam = '0' AND deleted = '0' AND archived = '0' ORDER BY registered DESC LIMIT {$n}, 5", ARRAY_A );
if ( empty( $blogs ) ) {
echo '<p>' . __( 'All done!' ) . '</p>';
break;
}
echo "<ul>";
foreach ( (array) $blogs as $details ) {
switch_to_blog( $details['blog_id'] );
$siteurl = site_url();
$upgrade_url = admin_url( 'upgrade.php?step=upgrade_db' );
restore_current_blog();
echo "<li>$siteurl</li>";
$response = wp_remote_get( $upgrade_url, array( 'timeout' => 120, 'httpversion' => '1.1' ) );
if ( is_wp_error( $response ) )
wp_die( sprintf( __( 'Warning! Problem updating %1$s. Your server may not be able to connect to sites running on it. Error message: <em>%2$s</em>' ), $siteurl, $response->get_error_message() ) );
do_action( 'after_mu_upgrade', $response );
do_action( 'wpmu_upgrade_site', $details[ 'blog_id' ] );
}
echo "</ul>";
?><p><?php _e( 'If your browser doesn’t start loading the next page automatically, click this link:' ); ?> <a class="button" href="upgrade.php?action=upgrade&n=<?php echo ($n + 5) ?>"><?php _e("Next Sites"); ?></a></p>
<script type='text/javascript'>
<!--
function nextpage() {
location.href = "upgrade.php?action=upgrade&n=<?php echo ($n + 5) ?>";
}
setTimeout( "nextpage()", 250 );
//-->
</script><?php
break;
case 'show':
default:
?><p><?php _e( 'You can update all the sites on your network through this page. It works by calling the update script of each site automatically. Hit the link below to update.' ); ?></p>
<p><a class="button" href="upgrade.php?action=upgrade"><?php _e("Update Network"); ?></a></p><?php
do_action( 'wpmu_upgrade_page' );
break;
}
?>
</div>
<?php include('../admin-footer.php'); ?>
| zyblog | trunk/zyblog/wp-admin/network/upgrade.php | PHP | asf20 | 3,812 |
<?php
/**
* Multisite themes administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
if ( !current_user_can('manage_network_themes') )
wp_die( __( 'You do not have sufficient permissions to manage network themes.' ) );
$wp_list_table = _get_list_table('WP_MS_Themes_List_Table');
$pagenum = $wp_list_table->get_pagenum();
$action = $wp_list_table->current_action();
$s = isset($_REQUEST['s']) ? $_REQUEST['s'] : '';
// Clean up request URI from temporary args for screen options/paging uri's to work as expected.
$temp_args = array( 'enabled', 'disabled', 'deleted', 'error' );
$_SERVER['REQUEST_URI'] = remove_query_arg( $temp_args, $_SERVER['REQUEST_URI'] );
$referer = remove_query_arg( $temp_args, wp_get_referer() );
if ( $action ) {
$allowed_themes = get_site_option( 'allowedthemes' );
switch ( $action ) {
case 'enable':
check_admin_referer('enable-theme_' . $_GET['theme']);
$allowed_themes[ $_GET['theme'] ] = true;
update_site_option( 'allowedthemes', $allowed_themes );
if ( false === strpos( $referer, '/network/themes.php' ) )
wp_redirect( network_admin_url( 'themes.php?enabled=1' ) );
else
wp_safe_redirect( add_query_arg( 'enabled', 1, $referer ) );
exit;
break;
case 'disable':
check_admin_referer('disable-theme_' . $_GET['theme']);
unset( $allowed_themes[ $_GET['theme'] ] );
update_site_option( 'allowedthemes', $allowed_themes );
wp_safe_redirect( add_query_arg( 'disabled', '1', $referer ) );
exit;
break;
case 'enable-selected':
check_admin_referer('bulk-themes');
$themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
if ( empty($themes) ) {
wp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );
exit;
}
foreach( (array) $themes as $theme )
$allowed_themes[ $theme ] = true;
update_site_option( 'allowedthemes', $allowed_themes );
wp_safe_redirect( add_query_arg( 'enabled', count( $themes ), $referer ) );
exit;
break;
case 'disable-selected':
check_admin_referer('bulk-themes');
$themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
if ( empty($themes) ) {
wp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );
exit;
}
foreach( (array) $themes as $theme )
unset( $allowed_themes[ $theme ] );
update_site_option( 'allowedthemes', $allowed_themes );
wp_safe_redirect( add_query_arg( 'disabled', count( $themes ), $referer ) );
exit;
break;
case 'update-selected' :
check_admin_referer( 'bulk-themes' );
if ( isset( $_GET['themes'] ) )
$themes = explode( ',', $_GET['themes'] );
elseif ( isset( $_POST['checked'] ) )
$themes = (array) $_POST['checked'];
else
$themes = array();
$title = __( 'Update Themes' );
$parent_file = 'themes.php';
require_once(ABSPATH . 'wp-admin/admin-header.php');
echo '<div class="wrap">';
screen_icon();
echo '<h2>' . esc_html( $title ) . '</h2>';
$url = self_admin_url('update.php?action=update-selected-themes&themes=' . urlencode( join(',', $themes) ));
$url = wp_nonce_url($url, 'bulk-update-themes');
echo "<iframe src='$url' style='width: 100%; height:100%; min-height:850px;'></iframe>";
echo '</div>';
require_once(ABSPATH . 'wp-admin/admin-footer.php');
exit;
break;
case 'delete-selected':
if ( ! current_user_can( 'delete_themes' ) )
wp_die( __('You do not have sufficient permissions to delete themes for this site.') );
check_admin_referer( 'bulk-themes' );
$themes = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array();
unset( $themes[ get_option( 'stylesheet' ) ], $themes[ get_option( 'template' ) ] );
if ( empty( $themes ) ) {
wp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );
exit;
}
$files_to_delete = $theme_info = array();
foreach ( $themes as $key => $theme ) {
$theme_info[ $theme ] = wp_get_theme( $theme );
$files_to_delete = array_merge( $files_to_delete, list_files( $theme_info[ $theme ]->get_stylesheet_directory() ) );
}
if ( empty( $themes ) ) {
wp_safe_redirect( add_query_arg( 'error', 'main', $referer ) );
exit;
}
include(ABSPATH . 'wp-admin/update.php');
$parent_file = 'themes.php';
if ( ! isset( $_REQUEST['verify-delete'] ) ) {
wp_enqueue_script( 'jquery' );
require_once( ABSPATH . 'wp-admin/admin-header.php' );
?>
<div class="wrap">
<?php
$themes_to_delete = count( $themes );
screen_icon();
echo '<h2>' . _n( 'Delete Theme', 'Delete Themes', $themes_to_delete ) . '</h2>';
?>
<div class="error"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php echo _n( 'This theme may be active on other sites in the network.', 'These themes may be active on other sites in the network.', $themes_to_delete ); ?></p></div>
<p><?php echo _n( 'You are about to remove the following theme:', 'You are about to remove the following themes:', $themes_to_delete ); ?></p>
<ul class="ul-disc">
<?php foreach ( $theme_info as $theme )
echo '<li>', sprintf( __('<strong>%1$s</strong> by <em>%2$s</em>' ), $theme->display('Name'), $theme->display('Author') ), '</li>'; /* translators: 1: theme name, 2: theme author */ ?>
</ul>
<p><?php _e('Are you sure you wish to delete these themes?'); ?></p>
<form method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>" style="display:inline;">
<input type="hidden" name="verify-delete" value="1" />
<input type="hidden" name="action" value="delete-selected" />
<?php
foreach ( (array) $themes as $theme )
echo '<input type="hidden" name="checked[]" value="' . esc_attr($theme) . '" />';
?>
<?php wp_nonce_field('bulk-themes') ?>
<?php submit_button( _n( 'Yes, Delete this theme', 'Yes, Delete these themes', $themes_to_delete ), 'button', 'submit', false ); ?>
</form>
<form method="post" action="<?php echo esc_url(wp_get_referer()); ?>" style="display:inline;">
<?php submit_button( __( 'No, Return me to the theme list' ), 'button', 'submit', false ); ?>
</form>
<p><a href="#" onclick="jQuery('#files-list').toggle(); return false;"><?php _e('Click to view entire list of files which will be deleted'); ?></a></p>
<div id="files-list" style="display:none;">
<ul class="code">
<?php
foreach ( (array) $files_to_delete as $file )
echo '<li>' . esc_html( str_replace( WP_CONTENT_DIR . "/themes", '', $file) ) . '</li>';
?>
</ul>
</div>
</div>
<?php
require_once(ABSPATH . 'wp-admin/admin-footer.php');
exit;
} // Endif verify-delete
foreach ( $themes as $theme ) {
$delete_result = delete_theme( $theme, esc_url( add_query_arg( array(
'verify-delete' => 1,
'action' => 'delete-selected',
'checked' => $_REQUEST['checked'],
'_wpnonce' => $_REQUEST['_wpnonce']
), network_admin_url( 'themes.php' ) ) ) );
}
$paged = ( $_REQUEST['paged'] ) ? $_REQUEST['paged'] : 1;
wp_redirect( add_query_arg( array(
'deleted' => count( $themes ),
'paged' => $paged,
's' => $s
), network_admin_url( 'themes.php' ) ) );
exit;
break;
}
}
$wp_list_table->prepare_items();
add_thickbox();
add_screen_option( 'per_page', array('label' => _x( 'Themes', 'themes per page (screen options)' )) );
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __('This screen enables and disables the inclusion of themes available to choose in the Appearance menu for each site. It does not activate or deactivate which theme a site is currently using.') . '</p>' .
'<p>' . __('If the network admin disables a theme that is in use, it can still remain selected on that site. If another theme is chosen, the disabled theme will not appear in the site’s Appearance > Themes screen.') . '</p>' .
'<p>' . __('Themes can be enabled on a site by site basis by the network admin on the Edit Site screen (which has a Themes tab); get there via the Edit action link on the All Sites screen. Only network admins are able to install or edit themes.') . '</p>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Themes_Screen" target="_blank">Documentation on Network Themes</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
$title = __('Themes');
$parent_file = 'themes.php';
require_once(ABSPATH . 'wp-admin/admin-header.php');
?>
<div class="wrap">
<?php screen_icon('themes'); ?>
<h2><?php echo esc_html( $title ); if ( current_user_can('install_themes') ) { ?> <a href="theme-install.php" class="add-new-h2"><?php echo esc_html_x('Add New', 'theme'); ?></a><?php }
if ( $s )
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( $s ) ); ?>
</h2>
<?php
if ( isset( $_GET['enabled'] ) ) {
$_GET['enabled'] = absint( $_GET['enabled'] );
echo '<div id="message" class="updated"><p>' . sprintf( _n( 'Theme enabled.', '%s themes enabled.', $_GET['enabled'] ), number_format_i18n( $_GET['enabled'] ) ) . '</p></div>';
} elseif ( isset( $_GET['disabled'] ) ) {
$_GET['disabled'] = absint( $_GET['disabled'] );
echo '<div id="message" class="updated"><p>' . sprintf( _n( 'Theme disabled.', '%s themes disabled.', $_GET['disabled'] ), number_format_i18n( $_GET['disabled'] ) ) . '</p></div>';
} elseif ( isset( $_GET['deleted'] ) ) {
$_GET['deleted'] = absint( $_GET['deleted'] );
echo '<div id="message" class="updated"><p>' . sprintf( _nx( 'Theme deleted.', '%s themes deleted.', $_GET['deleted'], 'network' ), number_format_i18n( $_GET['deleted'] ) ) . '</p></div>';
} elseif ( isset( $_GET['error'] ) && 'none' == $_GET['error'] ) {
echo '<div id="message" class="error"><p>' . __( 'No theme selected.' ) . '</p></div>';
} elseif ( isset( $_GET['error'] ) && 'main' == $_GET['error'] ) {
echo '<div class="error"><p>' . __( 'You cannot delete a theme while it is active on the main site.' ) . '</p></div>';
}
?>
<form method="get" action="">
<?php $wp_list_table->search_box( __( 'Search Installed Themes' ), 'theme' ); ?>
</form>
<?php
$wp_list_table->views();
if ( 'broken' == $status )
echo '<p class="clear">' . __('The following themes are installed but incomplete. Themes must have a stylesheet and a template.') . '</p>';
?>
<form method="post" action="">
<input type="hidden" name="theme_status" value="<?php echo esc_attr($status) ?>" />
<input type="hidden" name="paged" value="<?php echo esc_attr($page) ?>" />
<?php $wp_list_table->display(); ?>
</form>
</div>
<?php
include(ABSPATH . 'wp-admin/admin-footer.php');
| zyblog | trunk/zyblog/wp-admin/network/themes.php | PHP | asf20 | 11,011 |
<?php
/**
* Update/Install Plugin/Theme network administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
if ( isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'update-selected', 'activate-plugin', 'update-selected-themes' ) ) )
define( 'IFRAME_REQUEST', true );
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
require( '../update.php' );
| zyblog | trunk/zyblog/wp-admin/network/update.php | PHP | asf20 | 500 |
<?php
/**
* Install theme network administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
if ( isset( $_GET['tab'] ) && ( 'theme-information' == $_GET['tab'] ) )
define( 'IFRAME_REQUEST', true );
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
require( '../theme-install.php' ); | zyblog | trunk/zyblog/wp-admin/network/theme-install.php | PHP | asf20 | 428 |
<?php
/**
* Add Site Administration Screen
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can( 'manage_sites' ) )
wp_die( __( 'You do not have sufficient permissions to add sites to this network.' ) );
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __('This screen is for Super Admins to add new sites to the network. This is not affected by the registration settings.') . '</p>' .
'<p>' . __('If the admin email for the new site does not exist in the database, a new user will also be created.') . '</p>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Sites_Screen" target="_blank">Documentation on Site Management</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
);
if ( isset($_REQUEST['action']) && 'add-site' == $_REQUEST['action'] ) {
check_admin_referer( 'add-blog', '_wpnonce_add-blog' );
if ( ! current_user_can( 'manage_sites' ) )
wp_die( __( 'You do not have permission to access this page.' ) );
if ( ! is_array( $_POST['blog'] ) )
wp_die( __( 'Can’t create an empty site.' ) );
$blog = $_POST['blog'];
$domain = '';
if ( preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) )
$domain = strtolower( $blog['domain'] );
// If not a subdomain install, make sure the domain isn't a reserved word
if ( ! is_subdomain_install() ) {
$subdirectory_reserved_names = apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed' ) );
if ( in_array( $domain, $subdirectory_reserved_names ) )
wp_die( sprintf( __('The following words are reserved for use by WordPress functions and cannot be used as blog names: <code>%s</code>' ), implode( '</code>, <code>', $subdirectory_reserved_names ) ) );
}
$email = sanitize_email( $blog['email'] );
$title = $blog['title'];
if ( empty( $domain ) )
wp_die( __( 'Missing or invalid site address.' ) );
if ( empty( $email ) )
wp_die( __( 'Missing email address.' ) );
if ( !is_email( $email ) )
wp_die( __( 'Invalid email address.' ) );
if ( is_subdomain_install() ) {
$newdomain = $domain . '.' . preg_replace( '|^www\.|', '', $current_site->domain );
$path = $current_site->path;
} else {
$newdomain = $current_site->domain;
$path = $current_site->path . $domain . '/';
}
$password = 'N/A';
$user_id = email_exists($email);
if ( !$user_id ) { // Create a new user with a random password
$password = wp_generate_password( 12, false );
$user_id = wpmu_create_user( $domain, $password, $email );
if ( false == $user_id )
wp_die( __( 'There was an error creating the user.' ) );
else
wp_new_user_notification( $user_id, $password );
}
$wpdb->hide_errors();
$id = wpmu_create_blog( $newdomain, $path, $title, $user_id , array( 'public' => 1 ), $current_site->id );
$wpdb->show_errors();
if ( !is_wp_error( $id ) ) {
if ( !is_super_admin( $user_id ) && !get_user_option( 'primary_blog', $user_id ) )
update_user_option( $user_id, 'primary_blog', $id, true );
$content_mail = sprintf( __( 'New site created by %1$s
Address: %2$s
Name: %3$s' ), $current_user->user_login , get_site_url( $id ), stripslashes( $title ) );
wp_mail( get_site_option('admin_email'), sprintf( __( '[%s] New Site Created' ), $current_site->site_name ), $content_mail, 'From: "Site Admin" <' . get_site_option( 'admin_email' ) . '>' );
wpmu_welcome_notification( $id, $user_id, $password, $title, array( 'public' => 1 ) );
wp_redirect( add_query_arg( array( 'update' => 'added', 'id' => $id ), 'site-new.php' ) );
exit;
} else {
wp_die( $id->get_error_message() );
}
}
if ( isset($_GET['update']) ) {
$messages = array();
if ( 'added' == $_GET['update'] )
$messages[] = sprintf( __( 'Site added. <a href="%1$s">Visit Dashboard</a> or <a href="%2$s">Edit Site</a>' ), esc_url( get_admin_url( absint( $_GET['id'] ) ) ), network_admin_url( 'site-info.php?id=' . absint( $_GET['id'] ) ) );
}
$title = __('Add New Site');
$parent_file = 'sites.php';
require('../admin-header.php');
?>
<div class="wrap">
<?php screen_icon('ms-admin'); ?>
<h2 id="add-new-site"><?php _e('Add New Site') ?></h2>
<?php
if ( ! empty( $messages ) ) {
foreach ( $messages as $msg )
echo '<div id="message" class="updated"><p>' . $msg . '</p></div>';
} ?>
<form method="post" action="<?php echo network_admin_url('site-new.php?action=add-site'); ?>">
<?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ) ?>
<table class="form-table">
<tr class="form-field form-required">
<th scope="row"><?php _e( 'Site Address' ) ?></th>
<td>
<?php if ( is_subdomain_install() ) { ?>
<input name="blog[domain]" type="text" class="regular-text" title="<?php esc_attr_e( 'Domain' ) ?>"/><span class="no-break">.<?php echo preg_replace( '|^www\.|', '', $current_site->domain ); ?></span>
<?php } else {
echo $current_site->domain . $current_site->path ?><input name="blog[domain]" class="regular-text" type="text" title="<?php esc_attr_e( 'Domain' ) ?>"/>
<?php }
echo '<p>' . __( 'Only lowercase letters (a-z) and numbers are allowed.' ) . '</p>';
?>
</td>
</tr>
<tr class="form-field form-required">
<th scope="row"><?php _e( 'Site Title' ) ?></th>
<td><input name="blog[title]" type="text" class="regular-text" title="<?php esc_attr_e( 'Title' ) ?>"/></td>
</tr>
<tr class="form-field form-required">
<th scope="row"><?php _e( 'Admin Email' ) ?></th>
<td><input name="blog[email]" type="text" class="regular-text" title="<?php esc_attr_e( 'Email' ) ?>"/></td>
</tr>
<tr class="form-field">
<td colspan="2"><?php _e( 'A new user will be created if the above email address is not in the database.' ) ?><br /><?php _e( 'The username and password will be mailed to this email address.' ) ?></td>
</tr>
</table>
<?php submit_button( __('Add Site'), 'primary', 'add-site' ); ?>
</form>
</div>
<?php
require('../admin-footer.php');
| zyblog | trunk/zyblog/wp-admin/network/site-new.php | PHP | asf20 | 6,316 |
<?php
/**
* Network Credits administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.4.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
require( '../credits.php' ); | zyblog | trunk/zyblog/wp-admin/network/credits.php | PHP | asf20 | 308 |
<?php
/**
* Network Setup administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
require( '../network.php' ); | zyblog | trunk/zyblog/wp-admin/network/setup.php | PHP | asf20 | 306 |
<?php
/**
* Action handler for Multisite administration panels.
*
* @package WordPress
* @subpackage Multisite
* @since 3.0.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
if ( empty( $_GET['action'] ) ) {
wp_redirect( network_admin_url() );
exit;
}
do_action( 'wpmuadminedit' , '' );
// Let plugins use us as a post handler easily
do_action( 'network_admin_edit_' . $_GET['action'] );
wp_redirect( network_admin_url() );
exit();
| zyblog | trunk/zyblog/wp-admin/network/edit.php | PHP | asf20 | 557 |
<?php
/**
* Theme editor network administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
require( '../theme-editor.php' ); | zyblog | trunk/zyblog/wp-admin/network/theme-editor.php | PHP | asf20 | 318 |
<?php
/**
* Network About administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.4.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
require( '../about.php' ); | zyblog | trunk/zyblog/wp-admin/network/about.php | PHP | asf20 | 304 |
<?php
/**
* Network Freedoms administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.4.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
require( '../freedoms.php' ); | zyblog | trunk/zyblog/wp-admin/network/freedoms.php | PHP | asf20 | 310 |
<?php
/**
* Edit Site Settings Administration Screen
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can( 'manage_sites' ) )
wp_die( __( 'You do not have sufficient permissions to edit this site.' ) );
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.') . '</p>' .
'<p>' . __('<strong>Info</strong> - The domain and path are rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.') . '</p>' .
'<p>' . __('<strong>Users</strong> - This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.') . '</p>' .
'<p>' . sprintf( __('<strong>Themes</strong> - This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site’s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ), network_admin_url( 'themes.php' ) ) . '</p>' .
'<p>' . __('<strong>Settings</strong> - This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.') . '</p>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Sites_Screen" target="_blank">Documentation on Site Management</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
);
$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
if ( ! $id )
wp_die( __('Invalid site ID.') );
$details = get_blog_details( $id );
if ( !can_edit_network( $details->site_id ) )
wp_die( __( 'You do not have permission to access this page.' ) );
$is_main_site = is_main_site( $id );
if ( isset($_REQUEST['action']) && 'update-site' == $_REQUEST['action'] && is_array( $_POST['option'] ) ) {
check_admin_referer( 'edit-site' );
switch_to_blog( $id );
$c = 1;
$count = count( $_POST['option'] );
$skip_options = array( 'allowedthemes' ); // Don't update these options since they are handled elsewhere in the form.
foreach ( (array) $_POST['option'] as $key => $val ) {
if ( $key === 0 || is_array( $val ) || in_array($key, $skip_options) )
continue; // Avoids "0 is a protected WP option and may not be modified" error when edit blog options
if ( $c == $count )
update_option( $key, stripslashes( $val ) );
else
update_option( $key, stripslashes( $val ), false ); // no need to refresh blog details yet
$c++;
}
do_action( 'wpmu_update_blog_options' );
restore_current_blog();
wp_redirect( add_query_arg( array( 'update' => 'updated', 'id' => $id ), 'site-settings.php') );
exit;
}
if ( isset($_GET['update']) ) {
$messages = array();
if ( 'updated' == $_GET['update'] )
$messages[] = __('Site options updated.');
}
$site_url_no_http = preg_replace( '#^http(s)?://#', '', get_blogaddress_by_id( $id ) );
$title_site_url_linked = sprintf( __('Edit Site: <a href="%1$s">%2$s</a>'), get_blogaddress_by_id( $id ), $site_url_no_http );
$title = sprintf( __('Edit Site: %s'), $site_url_no_http );
$parent_file = 'sites.php';
$submenu_file = 'sites.php';
require('../admin-header.php');
?>
<div class="wrap">
<?php screen_icon('ms-admin'); ?>
<h2 id="edit-site"><?php echo $title_site_url_linked ?></h2>
<h3 class="nav-tab-wrapper">
<?php
$tabs = array(
'site-info' => array( 'label' => __( 'Info' ), 'url' => 'site-info.php' ),
'site-users' => array( 'label' => __( 'Users' ), 'url' => 'site-users.php' ),
'site-themes' => array( 'label' => __( 'Themes' ), 'url' => 'site-themes.php' ),
'site-settings' => array( 'label' => __( 'Settings' ), 'url' => 'site-settings.php' ),
);
foreach ( $tabs as $tab_id => $tab ) {
$class = ( $tab['url'] == $pagenow ) ? ' nav-tab-active' : '';
echo '<a href="' . $tab['url'] . '?id=' . $id .'" class="nav-tab' . $class . '">' . esc_html( $tab['label'] ) . '</a>';
}
?>
</h3>
<?php
if ( ! empty( $messages ) ) {
foreach ( $messages as $msg )
echo '<div id="message" class="updated"><p>' . $msg . '</p></div>';
} ?>
<form method="post" action="site-settings.php?action=update-site">
<?php wp_nonce_field( 'edit-site' ); ?>
<input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
<table class="form-table">
<?php
$blog_prefix = $wpdb->get_blog_prefix( $id );
$options = $wpdb->get_results( "SELECT * FROM {$blog_prefix}options WHERE option_name NOT LIKE '\_%' AND option_name NOT LIKE '%user_roles'" );
foreach ( $options as $option ) {
if ( $option->option_name == 'default_role' )
$editblog_default_role = $option->option_value;
$disabled = false;
$class = 'all-options';
if ( is_serialized( $option->option_value ) ) {
if ( is_serialized_string( $option->option_value ) ) {
$option->option_value = esc_html( maybe_unserialize( $option->option_value ), 'single' );
} else {
$option->option_value = 'SERIALIZED DATA';
$disabled = true;
$class = 'all-options disabled';
}
}
if ( strpos( $option->option_value, "\n" ) !== false ) {
?>
<tr class="form-field">
<th scope="row"><?php echo ucwords( str_replace( "_", " ", $option->option_name ) ) ?></th>
<td><textarea class="<?php echo $class; ?>" rows="5" cols="40" name="option[<?php echo esc_attr( $option->option_name ) ?>]" id="<?php echo esc_attr( $option->option_name ) ?>"<?php disabled( $disabled ) ?>><?php echo esc_textarea( $option->option_value ) ?></textarea></td>
</tr>
<?php
} else {
?>
<tr class="form-field">
<th scope="row"><?php echo esc_html( ucwords( str_replace( "_", " ", $option->option_name ) ) ); ?></th>
<?php if ( $is_main_site && in_array( $option->option_name, array( 'siteurl', 'home' ) ) ) { ?>
<td><code><?php echo esc_html( $option->option_value ) ?></code></td>
<?php } else { ?>
<td><input class="<?php echo $class; ?>" name="option[<?php echo esc_attr( $option->option_name ) ?>]" type="text" id="<?php echo esc_attr( $option->option_name ) ?>" value="<?php echo esc_attr( $option->option_value ) ?>" size="40" <?php disabled( $disabled ) ?> /></td>
<?php } ?>
</tr>
<?php
}
} // End foreach
do_action( 'wpmueditblogaction', $id );
?>
</table>
<?php submit_button(); ?>
</form>
</div>
<?php
require('../admin-footer.php');
| zyblog | trunk/zyblog/wp-admin/network/site-settings.php | PHP | asf20 | 7,264 |
<?php
/**
* Build Network Administration Menu.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/* translators: Network menu item */
$menu[2] = array(__('Dashboard'), 'manage_network', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'div');
$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
/* translators: Sites menu item */
$menu[5] = array(__('Sites'), 'manage_sites', 'sites.php', '', 'menu-top menu-icon-site', 'menu-site', 'div');
$submenu['sites.php'][5] = array( __('All Sites'), 'manage_sites', 'sites.php' );
$submenu['sites.php'][10] = array( _x('Add New', 'site'), 'create_sites', 'site-new.php' );
$menu[10] = array(__('Users'), 'manage_network_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'div');
$submenu['users.php'][5] = array( __('All Users'), 'manage_network_users', 'users.php' );
$submenu['users.php'][10] = array( _x('Add New', 'user'), 'create_users', 'user-new.php' );
$update_data = wp_get_update_data();
if ( $update_data['counts']['themes'] ) {
$menu[15] = array(sprintf( __( 'Themes %s' ), "<span class='update-plugins count-{$update_data['counts']['themes']}'><span class='theme-count'>" . number_format_i18n( $update_data['counts']['themes'] ) . "</span></span>" ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' );
} else {
$menu[15] = array( __( 'Themes' ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' );
}
$submenu['themes.php'][5] = array( __('Installed Themes'), 'manage_network_themes', 'themes.php' );
$submenu['themes.php'][10] = array( _x('Add New', 'theme'), 'install_themes', 'theme-install.php' );
$submenu['themes.php'][15] = array( _x('Editor', 'theme editor'), 'edit_themes', 'theme-editor.php' );
if ( current_user_can( 'update_plugins' ) ) {
$menu[20] = array( sprintf( __( 'Plugins %s' ), "<span class='update-plugins count-{$update_data['counts']['plugins']}'><span class='plugin-count'>" . number_format_i18n( $update_data['counts']['plugins'] ) . "</span></span>" ), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'div');
} else {
$menu[20] = array( __('Plugins'), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'div' );
}
$submenu['plugins.php'][5] = array( __('Installed Plugins'), 'manage_network_plugins', 'plugins.php' );
$submenu['plugins.php'][10] = array( _x('Add New', 'plugin'), 'install_plugins', 'plugin-install.php' );
$submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' );
$menu[25] = array(__('Settings'), 'manage_network_options', 'settings.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'div');
if ( defined( 'MULTISITE' ) && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) {
$submenu['settings.php'][5] = array( __('Network Settings'), 'manage_network_options', 'settings.php' );
$submenu['settings.php'][10] = array( __('Network Setup'), 'manage_network_options', 'setup.php' );
}
if ( $update_data['counts']['total'] ) {
$menu[30] = array( sprintf( __( 'Updates %s' ), "<span class='update-plugins count-{$update_data['counts']['total']}' title='{$update_data['title']}'><span class='update-count'>" . number_format_i18n($update_data['counts']['total']) . "</span></span>" ), 'manage_network', 'upgrade.php', '', 'menu-top menu-icon-tools', 'menu-update', 'div' );
} else {
$menu[30] = array( __( 'Updates' ), 'manage_network', 'upgrade.php', '', 'menu-top menu-icon-tools', 'menu-update', 'div' );
}
unset($update_data);
$submenu[ 'upgrade.php' ][10] = array( __( 'Available Updates' ), 'update_core', 'update-core.php' );
$submenu[ 'upgrade.php' ][15] = array( __( 'Update Network' ), 'manage_network', 'upgrade.php' );
$menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator-last' );
require_once(ABSPATH . 'wp-admin/includes/menu.php');
| zyblog | trunk/zyblog/wp-admin/network/menu.php | PHP | asf20 | 4,025 |
<?php
/**
* Network Plugins administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
require( '../plugins.php' ); | zyblog | trunk/zyblog/wp-admin/network/plugins.php | PHP | asf20 | 308 |
<?php
/**
* Multisite administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.0.0
*/
/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );
/** Load WordPress dashboard API */
require_once( ABSPATH . 'wp-admin/includes/dashboard.php' );
if ( !is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
if ( ! current_user_can( 'manage_network' ) )
wp_die( __( 'You do not have permission to access this page.' ) );
$title = __( 'Dashboard' );
$parent_file = 'index.php';
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __('Until WordPress 3.0, running multiple sites required using WordPress MU instead of regular WordPress. In version 3.0, these applications have merged. If you are a former MU user, you should be aware of the following changes:') . '</p>' .
'<ul><li>' . __('Site Admin is now Super Admin (we highly encourage you to get yourself a cape!).') . '</li>' .
'<li>' . __('Blogs are now called Sites; Site is now called Network.') . '</li></ul>' .
'<p>' . __('The Right Now box provides the network administrator with links to the screens to either create a new site or user, or to search existing users and sites. Screens for Sites and Users are also accessible through the left-hand navigation in the Network Admin section.') . '</p>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Network_Admin" target="_blank">Documentation on the Network Admin</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
);
wp_dashboard_setup();
wp_enqueue_script( 'dashboard' );
wp_enqueue_script( 'plugin-install' );
add_thickbox();
add_screen_option('layout_columns', array('max' => 4, 'default' => 2) );
require_once( '../admin-header.php' );
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<div id="dashboard-widgets-wrap">
<?php wp_dashboard(); ?>
<div class="clear"></div>
</div><!-- dashboard-widgets-wrap -->
</div><!-- wrap -->
<?php include( '../admin-footer.php' ); ?>
| zyblog | trunk/zyblog/wp-admin/network/index.php | PHP | asf20 | 2,281 |
<?php
/**
* Multisite upgrade administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.0.0
*/
require_once('admin.php');
wp_redirect( network_admin_url('upgrade.php') );
exit;
| zyblog | trunk/zyblog/wp-admin/ms-upgrade-network.php | PHP | asf20 | 207 |
<?php
/**
* Import WordPress Administration Screen
*
* @package WordPress
* @subpackage Administration
*/
define('WP_LOAD_IMPORTERS', true);
/** Load WordPress Bootstrap */
require_once ('admin.php');
if ( !current_user_can('import') )
wp_die(__('You do not have sufficient permissions to import content in this site.'));
$title = __('Import');
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' => '<p>' . __('This screen lists links to plugins to import data from blogging/content management platforms. Choose the platform you want to import from, and click Install Now when you are prompted in the popup window. If your platform is not listed, click the link to search the plugin directory for other importer plugins to see if there is one for your platform.') . '</p>' .
'<p>' . __('In previous versions of WordPress, all importers were built-in. They have been turned into plugins since most people only use them once or infrequently.') . '</p>',
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Tools_Import_Screen" target="_blank">Documentation on Import</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
if ( current_user_can( 'install_plugins' ) )
$popular_importers = wp_get_popular_importers();
else
$popular_importers = array();
// Detect and redirect invalid importers like 'movabletype', which is registered as 'mt'
if ( ! empty( $_GET['invalid'] ) && isset( $popular_importers[ $_GET['invalid'] ] ) ) {
$importer_id = $popular_importers[ $_GET['invalid'] ]['importer-id'];
if ( $importer_id != $_GET['invalid'] ) { // Prevent redirect loops.
wp_redirect( admin_url( 'admin.php?import=' . $importer_id ) );
exit;
}
unset( $importer_id );
}
add_thickbox();
wp_enqueue_script( 'plugin-install' );
require_once ('admin-header.php');
$parent_file = 'tools.php';
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<?php if ( ! empty( $_GET['invalid'] ) ) : ?>
<div class="error"><p><strong><?php _e('ERROR:')?></strong> <?php printf( __('The <strong>%s</strong> importer is invalid or is not installed.'), esc_html( $_GET['invalid'] ) ); ?></p></div>
<?php endif; ?>
<p><?php _e('If you have posts or comments in another system, WordPress can import those into this site. To get started, choose a system to import from below:'); ?></p>
<?php
$importers = get_importers();
// If a popular importer is not registered, create a dummy registration that links to the plugin installer.
foreach ( $popular_importers as $pop_importer => $pop_data ) {
if ( isset( $importers[ $pop_importer ] ) )
continue;
if ( isset( $importers[ $pop_data['importer-id'] ] ) )
continue;
$importers[ $pop_data['importer-id'] ] = array( $pop_data['name'], $pop_data['description'], 'install' => $pop_data['plugin-slug'] );
}
if ( empty( $importers ) ) {
echo '<p>' . __('No importers are available.') . '</p>'; // TODO: make more helpful
} else {
uasort($importers, create_function('$a, $b', 'return strnatcasecmp($a[0], $b[0]);'));
?>
<table class="widefat importers" cellspacing="0">
<?php
$alt = '';
foreach ($importers as $importer_id => $data) {
$action = '';
if ( isset( $data['install'] ) ) {
$plugin_slug = $data['install'];
if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin_slug ) ) {
// Looks like Importer is installed, But not active
$plugins = get_plugins( '/' . $plugin_slug );
if ( !empty($plugins) ) {
$keys = array_keys($plugins);
$plugin_file = $plugin_slug . '/' . $keys[0];
$action = '<a href="' . esc_url(wp_nonce_url(admin_url('plugins.php?action=activate&plugin=' . $plugin_file . '&from=import'), 'activate-plugin_' . $plugin_file)) .
'"title="' . esc_attr__('Activate importer') . '"">' . $data[0] . '</a>';
}
}
if ( empty($action) ) {
if ( is_main_site() ) {
$action = '<a href="' . esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug .
'&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox" title="' .
esc_attr__('Install importer') . '">' . $data[0] . '</a>';
} else {
$action = $data[0];
$data[1] = sprintf( __( 'This importer is not installed. Please install importers from <a href="%s">the main site</a>.' ), get_admin_url( $current_site->blog_id, 'import.php' ) );
}
}
} else {
$action = "<a href='" . esc_url( "admin.php?import=$importer_id" ) . "' title='" . esc_attr( wptexturize( strip_tags( $data[1] ) ) ) ."'>{$data[0]}</a>";
}
$alt = $alt ? '' : ' class="alternate"';
echo "
<tr$alt>
<td class='import-system row-title'>$action</td>
<td class='desc'>{$data[1]}</td>
</tr>";
}
?>
</table>
<?php
}
if ( current_user_can('install_plugins') )
echo '<p>' . sprintf( __('If the importer you need is not listed, <a href="%s">search the plugin directory</a> to see if an importer is available.'), esc_url( network_admin_url( 'plugin-install.php?tab=search&type=tag&s=importer' ) ) ) . '</p>';
?>
</div>
<?php
include ('admin-footer.php');
| zyblog | trunk/zyblog/wp-admin/import.php | PHP | asf20 | 5,278 |
<?php
/**
* Multisite delete site panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.0.0
*/
require_once( './admin.php' );
if ( !is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );
// @todo Create a delete blog cap.
if ( ! current_user_can( 'manage_options' ) )
wp_die(__( 'You do not have sufficient permissions to delete this site.'));
if ( isset( $_GET['h'] ) && $_GET['h'] != '' && get_option( 'delete_blog_hash' ) != false ) {
if ( get_option( 'delete_blog_hash' ) == $_GET['h'] ) {
wpmu_delete_blog( $wpdb->blogid );
wp_die( sprintf( __( 'Thank you for using %s, your site has been deleted. Happy trails to you until we meet again.' ), $current_site->site_name ) );
} else {
wp_die( __( "I'm sorry, the link you clicked is stale. Please select another option." ) );
}
}
$blog = get_blog_details();
$title = __( 'Delete Site' );
$parent_file = 'tools.php';
require_once( './admin-header.php' );
echo '<div class="wrap">';
screen_icon();
echo '<h2>' . esc_html( $title ) . '</h2>';
if ( isset( $_POST['action'] ) && $_POST['action'] == 'deleteblog' && isset( $_POST['confirmdelete'] ) && $_POST['confirmdelete'] == '1' ) {
check_admin_referer( 'delete-blog' );
$hash = wp_generate_password( 20, false );
update_option( 'delete_blog_hash', $hash );
$url_delete = esc_url( admin_url( 'ms-delete-site.php?h=' . $hash ) );
$content = apply_filters( 'delete_site_email_content', __( "Dear User,
You recently clicked the 'Delete Site' link on your site and filled in a
form on that page.
If you really want to delete your site, click the link below. You will not
be asked to confirm again so only click this link if you are absolutely certain:
###URL_DELETE###
If you delete your site, please consider opening a new site here
some time in the future! (But remember your current site and username
are gone forever.)
Thanks for using the site,
Webmaster
###SITE_NAME###" ) );
$content = str_replace( '###URL_DELETE###', $url_delete, $content );
$content = str_replace( '###SITE_NAME###', $current_site->site_name, $content );
wp_mail( get_option( 'admin_email' ), "[ " . get_option( 'blogname' ) . " ] ".__( 'Delete My Site' ), $content );
?>
<p><?php _e( 'Thank you. Please check your email for a link to confirm your action. Your site will not be deleted until this link is clicked. ') ?></p>
<?php } else {
?>
<p><?php printf( __( 'If you do not want to use your %s site any more, you can delete it using the form below. When you click <strong>Delete My Site Permanently</strong> you will be sent an email with a link in it. Click on this link to delete your site.'), $current_site->site_name); ?></p>
<p><?php _e( 'Remember, once deleted your site cannot be restored.' ) ?></p>
<form method="post" name="deletedirect">
<?php wp_nonce_field( 'delete-blog' ) ?>
<input type="hidden" name="action" value="deleteblog" />
<p><input id="confirmdelete" type="checkbox" name="confirmdelete" value="1" /> <label for="confirmdelete"><strong><?php printf( __( "I'm sure I want to permanently disable my site, and I am aware I can never get it back or use %s again." ), is_subdomain_install() ? $blog->domain : $blog->domain . $blog->path ); ?></strong></label></p>
<?php submit_button( __( 'Delete My Site Permanently' ) ); ?>
</form>
<?php
}
echo '</div>';
include( './admin-footer.php' );
| zyblog | trunk/zyblog/wp-admin/ms-delete-site.php | PHP | asf20 | 3,373 |
<?php
/**
* General settings administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once('./admin.php');
if ( ! current_user_can( 'manage_options' ) )
wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );
$title = __('General Settings');
$parent_file = 'options-general.php';
/* translators: date and time format for exact current time, mainly about timezones, see http://php.net/date */
$timezone_format = _x('Y-m-d G:i:s', 'timezone date format');
/**
* Display JavaScript on the page.
*
* @since 3.5.0
*/
function options_general_add_js() {
?>
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function($){
$("input[name='date_format']").click(function(){
if ( "date_format_custom_radio" != $(this).attr("id") )
$("input[name='date_format_custom']").val( $(this).val() ).siblings('.example').text( $(this).siblings('span').text() );
});
$("input[name='date_format_custom']").focus(function(){
$("#date_format_custom_radio").attr("checked", "checked");
});
$("input[name='time_format']").click(function(){
if ( "time_format_custom_radio" != $(this).attr("id") )
$("input[name='time_format_custom']").val( $(this).val() ).siblings('.example').text( $(this).siblings('span').text() );
});
$("input[name='time_format_custom']").focus(function(){
$("#time_format_custom_radio").attr("checked", "checked");
});
$("input[name='date_format_custom'], input[name='time_format_custom']").change( function() {
var format = $(this);
format.siblings('.spinner').css('display', 'inline-block'); // show(); can't be used here
$.post(ajaxurl, {
action: 'date_format_custom' == format.attr('name') ? 'date_format' : 'time_format',
date : format.val()
}, function(d) { format.siblings('.spinner').hide(); format.siblings('.example').text(d); } );
});
});
//]]>
</script>
<?php
}
add_action('admin_head', 'options_general_add_js');
$options_help = '<p>' . __('The fields on this screen determine some of the basics of your site setup.') . '</p>' .
'<p>' . __('Most themes display the site title at the top of every page, in the title bar of the browser, and as the identifying name for syndicated feeds. The tagline is also displayed by many themes.') . '</p>';
if ( ! is_multisite() ) {
$options_help .= '<p>' . __('The WordPress URL and the Site URL can be the same (example.com) or different; for example, having the WordPress core files (example.com/wordpress) in a subdirectory instead of the root directory.') . '</p>' .
'<p>' . __('If you want site visitors to be able to register themselves, as opposed to by the site administrator, check the membership box. A default user role can be set for all new users, whether self-registered or registered by the site admin.') . '</p>';
}
$options_help .= '<p>' . __('UTC means Coordinated Universal Time.') . '</p>' .
'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>';
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' => $options_help,
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Settings_General_Screen" target="_blank">Documentation on General Settings</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
include('./admin-header.php');
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<form method="post" action="options.php">
<?php settings_fields('general'); ?>
<table class="form-table">
<tr valign="top">
<th scope="row"><label for="blogname"><?php _e('Site Title') ?></label></th>
<td><input name="blogname" type="text" id="blogname" value="<?php form_option('blogname'); ?>" class="regular-text" /></td>
</tr>
<tr valign="top">
<th scope="row"><label for="blogdescription"><?php _e('Tagline') ?></label></th>
<td><input name="blogdescription" type="text" id="blogdescription" value="<?php form_option('blogdescription'); ?>" class="regular-text" />
<p class="description"><?php _e('In a few words, explain what this site is about.') ?></p></td>
</tr>
<?php if ( !is_multisite() ) { ?>
<tr valign="top">
<th scope="row"><label for="siteurl"><?php _e('WordPress Address (URL)') ?></label></th>
<td><input name="siteurl" type="text" id="siteurl" value="<?php form_option('siteurl'); ?>"<?php disabled( defined( 'WP_SITEURL' ) ); ?> class="regular-text code<?php if ( defined( 'WP_SITEURL' ) ) echo ' disabled' ?>" /></td>
</tr>
<tr valign="top">
<th scope="row"><label for="home"><?php _e('Site Address (URL)') ?></label></th>
<td><input name="home" type="text" id="home" value="<?php form_option('home'); ?>"<?php disabled( defined( 'WP_HOME' ) ); ?> class="regular-text code<?php if ( defined( 'WP_HOME' ) ) echo ' disabled' ?>" />
<p class="description"><?php _e('Enter the address here if you want your site homepage <a href="http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory">to be different from the directory</a> you installed WordPress.'); ?></p></td>
</tr>
<tr valign="top">
<th scope="row"><label for="admin_email"><?php _e('E-mail Address') ?> </label></th>
<td><input name="admin_email" type="text" id="admin_email" value="<?php form_option('admin_email'); ?>" class="regular-text ltr" />
<p class="description"><?php _e('This address is used for admin purposes, like new user notification.') ?></p></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Membership') ?></th>
<td> <fieldset><legend class="screen-reader-text"><span><?php _e('Membership') ?></span></legend><label for="users_can_register">
<input name="users_can_register" type="checkbox" id="users_can_register" value="1" <?php checked('1', get_option('users_can_register')); ?> />
<?php _e('Anyone can register') ?></label>
</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><label for="default_role"><?php _e('New User Default Role') ?></label></th>
<td>
<select name="default_role" id="default_role"><?php wp_dropdown_roles( get_option('default_role') ); ?></select>
</td>
</tr>
<?php } else { ?>
<tr valign="top">
<th scope="row"><label for="new_admin_email"><?php _e('E-mail Address') ?> </label></th>
<td><input name="new_admin_email" type="text" id="new_admin_email" value="<?php form_option('admin_email'); ?>" class="regular-text ltr" />
<p class="description"><?php _e('This address is used for admin purposes. If you change this we will send you an e-mail at your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>') ?></p>
<?php
$new_admin_email = get_option( 'new_admin_email' );
if ( $new_admin_email && $new_admin_email != get_option('admin_email') ) : ?>
<div class="updated inline">
<p><?php printf( __('There is a pending change of the admin e-mail to <code>%1$s</code>. <a href="%2$s">Cancel</a>'), esc_html( $new_admin_email ), esc_url( admin_url( 'options.php?dismiss=new_admin_email' ) ) ); ?></p>
</div>
<?php endif; ?>
</td>
</tr>
<?php } ?>
<tr>
<?php
$current_offset = get_option('gmt_offset');
$tzstring = get_option('timezone_string');
$check_zone_info = true;
// Remove old Etc mappings. Fallback to gmt_offset.
if ( false !== strpos($tzstring,'Etc/GMT') )
$tzstring = '';
if ( empty($tzstring) ) { // Create a UTC+- zone if no timezone string exists
$check_zone_info = false;
if ( 0 == $current_offset )
$tzstring = 'UTC+0';
elseif ($current_offset < 0)
$tzstring = 'UTC' . $current_offset;
else
$tzstring = 'UTC+' . $current_offset;
}
?>
<th scope="row"><label for="timezone_string"><?php _e('Timezone') ?></label></th>
<td>
<select id="timezone_string" name="timezone_string">
<?php echo wp_timezone_choice($tzstring); ?>
</select>
<span id="utc-time"><?php printf(__('<abbr title="Coordinated Universal Time">UTC</abbr> time is <code>%s</code>'), date_i18n($timezone_format, false, 'gmt')); ?></span>
<?php if ( get_option('timezone_string') || !empty($current_offset) ) : ?>
<span id="local-time"><?php printf(__('Local time is <code>%1$s</code>'), date_i18n($timezone_format)); ?></span>
<?php endif; ?>
<p class="description"><?php _e('Choose a city in the same timezone as you.'); ?></p>
<?php if ($check_zone_info && $tzstring) : ?>
<br />
<span>
<?php
// Set TZ so localtime works.
date_default_timezone_set($tzstring);
$now = localtime(time(), true);
if ( $now['tm_isdst'] )
_e('This timezone is currently in daylight saving time.');
else
_e('This timezone is currently in standard time.');
?>
<br />
<?php
$allowed_zones = timezone_identifiers_list();
if ( in_array( $tzstring, $allowed_zones) ) {
$found = false;
$date_time_zone_selected = new DateTimeZone($tzstring);
$tz_offset = timezone_offset_get($date_time_zone_selected, date_create());
$right_now = time();
foreach ( timezone_transitions_get($date_time_zone_selected) as $tr) {
if ( $tr['ts'] > $right_now ) {
$found = true;
break;
}
}
if ( $found ) {
echo ' ';
$message = $tr['isdst'] ?
__('Daylight saving time begins on: <code>%s</code>.') :
__('Standard time begins on: <code>%s</code>.');
// Add the difference between the current offset and the new offset to ts to get the correct transition time from date_i18n().
printf( $message, date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $tr['ts'] + ($tz_offset - $tr['offset']) ) );
} else {
_e('This timezone does not observe daylight saving time.');
}
}
// Set back to UTC.
date_default_timezone_set('UTC');
?>
</span>
<?php endif; ?>
</td>
</tr>
<tr>
<th scope="row"><?php _e('Date Format') ?></th>
<td>
<fieldset><legend class="screen-reader-text"><span><?php _e('Date Format') ?></span></legend>
<?php
$date_formats = array_unique( apply_filters( 'date_formats', array(
__('F j, Y'),
'Y/m/d',
'm/d/Y',
'd/m/Y',
) ) );
$custom = true;
foreach ( $date_formats as $format ) {
echo "\t<label title='" . esc_attr($format) . "'><input type='radio' name='date_format' value='" . esc_attr($format) . "'";
if ( get_option('date_format') === $format ) { // checked() uses "==" rather than "==="
echo " checked='checked'";
$custom = false;
}
echo ' /> <span>' . date_i18n( $format ) . "</span></label><br />\n";
}
echo ' <label><input type="radio" name="date_format" id="date_format_custom_radio" value="\c\u\s\t\o\m"';
checked( $custom );
echo '/> ' . __('Custom:') . ' </label><input type="text" name="date_format_custom" value="' . esc_attr( get_option('date_format') ) . '" class="small-text" /> <span class="example"> ' . date_i18n( get_option('date_format') ) . "</span> <span class='spinner'></span>\n";
echo "\t<p>" . __('<a href="http://codex.wordpress.org/Formatting_Date_and_Time">Documentation on date and time formatting</a>.') . "</p>\n";
?>
</fieldset>
</td>
</tr>
<tr>
<th scope="row"><?php _e('Time Format') ?></th>
<td>
<fieldset><legend class="screen-reader-text"><span><?php _e('Time Format') ?></span></legend>
<?php
$time_formats = array_unique( apply_filters( 'time_formats', array(
__('g:i a'),
'g:i A',
'H:i',
) ) );
$custom = true;
foreach ( $time_formats as $format ) {
echo "\t<label title='" . esc_attr($format) . "'><input type='radio' name='time_format' value='" . esc_attr($format) . "'";
if ( get_option('time_format') === $format ) { // checked() uses "==" rather than "==="
echo " checked='checked'";
$custom = false;
}
echo ' /> <span>' . date_i18n( $format ) . "</span></label><br />\n";
}
echo ' <label><input type="radio" name="time_format" id="time_format_custom_radio" value="\c\u\s\t\o\m"';
checked( $custom );
echo '/> ' . __('Custom:') . ' </label><input type="text" name="time_format_custom" value="' . esc_attr( get_option('time_format') ) . '" class="small-text" /> <span class="example"> ' . date_i18n( get_option('time_format') ) . "</span> <span class='spinner'></span>\n";
;
?>
</fieldset>
</td>
</tr>
<tr>
<th scope="row"><label for="start_of_week"><?php _e('Week Starts On') ?></label></th>
<td><select name="start_of_week" id="start_of_week">
<?php
for ($day_index = 0; $day_index <= 6; $day_index++) :
$selected = (get_option('start_of_week') == $day_index) ? 'selected="selected"' : '';
echo "\n\t<option value='" . esc_attr($day_index) . "' $selected>" . $wp_locale->get_weekday($day_index) . '</option>';
endfor;
?>
</select></td>
</tr>
<?php do_settings_fields('general', 'default'); ?>
<?php
$languages = get_available_languages();
if ( is_multisite() && !empty( $languages ) ):
?>
<tr valign="top">
<th width="33%" scope="row"><?php _e('Site Language') ?></th>
<td>
<select name="WPLANG" id="WPLANG">
<?php mu_dropdown_languages( $languages, get_option('WPLANG') ); ?>
</select>
</td>
</tr>
<?php
endif;
?>
</table>
<?php do_settings_sections('general'); ?>
<?php submit_button(); ?>
</form>
</div>
<?php include('./admin-footer.php') ?>
| zyblog | trunk/zyblog/wp-admin/options-general.php | PHP | asf20 | 13,128 |
<?php
/**
* Your Rights administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once( './admin.php' );
$title = __( 'Freedoms' );
list( $display_version ) = explode( '-', $wp_version );
include( ABSPATH . 'wp-admin/admin-header.php' );
?>
<div class="wrap about-wrap">
<h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
<div class="about-text"><?php printf( __( 'Thank you for updating to the latest version! WordPress %s is more polished and enjoyable than ever before. We hope you like it.' ), $display_version ); ?></div>
<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
<h2 class="nav-tab-wrapper">
<a href="about.php" class="nav-tab">
<?php _e( 'What’s New' ); ?>
</a><a href="credits.php" class="nav-tab">
<?php _e( 'Credits' ); ?>
</a><a href="freedoms.php" class="nav-tab nav-tab-active">
<?php _e( 'Freedoms' ); ?>
</a>
</h2>
<p class="about-description"><?php printf( __( 'WordPress is Free and open source software, built by a distributed community of mostly volunteer developers from around the world. WordPress comes with some awesome, worldview-changing rights courtesy of its <a href="%s">license</a>, the GPL.' ), 'http://wordpress.org/about/license/' ); ?></p>
<ol start="0">
<li><p><?php _e( 'You have the freedom to run the program, for any purpose.' ); ?></p></li>
<li><p><?php _e( 'You have access to the source code, the freedom to study how the program works, and the freedom to change it to make it do what you wish.' ); ?></p></li>
<li><p><?php _e( 'You have the freedom to redistribute copies of the original program so you can help your neighbor.' ); ?></p></li>
<li><p><?php _e( 'You have the freedom to distribute copies of your modified versions to others. By doing this you can give the whole community a chance to benefit from your changes.' ); ?></p></li>
</ol>
<p><?php printf( __( 'WordPress grows when people like you tell their friends about it, and the thousands of businesses and services that are built on and around WordPress share that fact with their users. We’re flattered every time someone spreads the good word, just make sure to <a href="%s">check out our trademark guidelines</a> first.' ), 'http://wordpressfoundation.org/trademark-policy/' ); ?></p>
<p><?php
$plugins_url = current_user_can( 'activate_plugins' ) ? admin_url( 'plugins.php' ) : 'http://wordpress.org/extend/plugins/';
$themes_url = current_user_can( 'switch_themes' ) ? admin_url( 'themes.php' ) : 'http://wordpress.org/extend/themes/';
printf( __( 'Every plugin and theme in WordPress.org’s directory is 100%% GPL or a similarly free and compatible license, so you can feel safe finding <a href="%1$s">plugins</a> and <a href="%2$s">themes</a> there. If you get a plugin or theme from another source, make sure to <a href="%3$s">ask them if it’s GPL</a> first. If they don’t respect the WordPress license, we don’t recommend them.' ), $plugins_url, $themes_url, 'http://wordpress.org/about/license/' ); ?></p>
<p><?php _e( 'Don’t you wish all software came with these freedoms? So do we! For more information, check out the <a href="http://www.fsf.org/">Free Software Foundation</a>.' ); ?></p>
</div>
<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
| zyblog | trunk/zyblog/wp-admin/freedoms.php | PHP | asf20 | 3,391 |
<?php
/**
* Link Management Administration Screen.
*
* @package WordPress
* @subpackage Administration
*/
/** Load WordPress Administration Bootstrap */
require_once ('admin.php');
if ( ! current_user_can( 'manage_links' ) )
wp_die( __( 'You do not have sufficient permissions to edit the links for this site.' ) );
$wp_list_table = _get_list_table('WP_Links_List_Table');
// Handle bulk deletes
$doaction = $wp_list_table->current_action();
if ( $doaction && isset( $_REQUEST['linkcheck'] ) ) {
check_admin_referer( 'bulk-bookmarks' );
if ( 'delete' == $doaction ) {
$bulklinks = (array) $_REQUEST['linkcheck'];
foreach ( $bulklinks as $link_id ) {
$link_id = (int) $link_id;
wp_delete_link( $link_id );
}
wp_redirect( add_query_arg('deleted', count( $bulklinks ), admin_url( 'link-manager.php' ) ) );
exit;
}
} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) );
exit;
}
$wp_list_table->prepare_items();
$title = __('Links');
$this_file = $parent_file = 'link-manager.php';
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . sprintf(__('You can add links here to be displayed on your site, usually using <a href="%s">Widgets</a>. By default, links to several sites in the WordPress community are included as examples.'), 'widgets.php') . '</p>' .
'<p>' . __('Links may be separated into Link Categories; these are different than the categories used on your posts.') . '</p>' .
'<p>' . __('You can customize the display of this screen using the Screen Options tab and/or the dropdown filters above the links table.') . '</p>'
) );
get_current_screen()->add_help_tab( array(
'id' => 'deleting-links',
'title' => __('Deleting Links'),
'content' =>
'<p>' . __('If you delete a link, it will be removed permanently, as Links do not have a Trash function yet.') . '</p>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Links_Screen" target="_blank">Documentation on Managing Links</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
include_once ('./admin-header.php');
if ( ! current_user_can('manage_links') )
wp_die(__("You do not have sufficient permissions to edit the links for this site."));
?>
<div class="wrap nosubsub">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?> <a href="link-add.php" class="add-new-h2"><?php echo esc_html_x('Add New', 'link'); ?></a> <?php
if ( !empty($_REQUEST['s']) )
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( stripslashes($_REQUEST['s']) ) ); ?>
</h2>
<?php
if ( isset($_REQUEST['deleted']) ) {
echo '<div id="message" class="updated"><p>';
$deleted = (int) $_REQUEST['deleted'];
printf(_n('%s link deleted.', '%s links deleted', $deleted), $deleted);
echo '</p></div>';
$_SERVER['REQUEST_URI'] = remove_query_arg(array('deleted'), $_SERVER['REQUEST_URI']);
}
?>
<form id="posts-filter" action="" method="get">
<?php $wp_list_table->search_box( __( 'Search Links' ), 'link' ); ?>
<?php $wp_list_table->display(); ?>
<div id="ajax-response"></div>
</form>
</div>
<?php
include('./admin-footer.php');
| zyblog | trunk/zyblog/wp-admin/link-manager.php | PHP | asf20 | 3,434 |
<?php
/**
* Widgets administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once( './admin.php' );
/** WordPress Administration Widgets API */
require_once(ABSPATH . 'wp-admin/includes/widgets.php');
if ( ! current_user_can('edit_theme_options') )
wp_die( __( 'Cheatin’ uh?' ));
$widgets_access = get_user_setting( 'widgets_access' );
if ( isset($_GET['widgets-access']) ) {
$widgets_access = 'on' == $_GET['widgets-access'] ? 'on' : 'off';
set_user_setting( 'widgets_access', $widgets_access );
}
function wp_widgets_access_body_class($classes) {
return "$classes widgets_access ";
}
if ( 'on' == $widgets_access ) {
add_filter( 'admin_body_class', 'wp_widgets_access_body_class' );
} else {
wp_enqueue_script('admin-widgets');
if ( wp_is_mobile() )
wp_enqueue_script( 'jquery-touch-punch' );
}
do_action( 'sidebar_admin_setup' );
$title = __( 'Widgets' );
$parent_file = 'themes.php';
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __('Widgets are independent sections of content that can be placed into any widgetized area provided by your theme (commonly called sidebars). To populate your sidebars/widget areas with individual widgets, drag and drop the title bars into the desired area. By default, only the first widget area is expanded. To populate additional widget areas, click on their title bars to expand them.') . '</p>
<p>' . __('The Available Widgets section contains all the widgets you can choose from. Once you drag a widget into a sidebar, it will open to allow you to configure its settings. When you are happy with the widget settings, click the Save button and the widget will go live on your site. If you click Delete, it will remove the widget.') . '</p>'
) );
get_current_screen()->add_help_tab( array(
'id' => 'removing-reusing',
'title' => __('Removing and Reusing'),
'content' =>
'<p>' . __('If you want to remove the widget but save its setting for possible future use, just drag it into the Inactive Widgets area. You can add them back anytime from there. This is especially helpful when you switch to a theme with fewer or different widget areas.') . '</p>
<p>' . __('Widgets may be used multiple times. You can give each widget a title, to display on your site, but it’s not required.') . '</p>
<p>' . __('Enabling Accessibility Mode, via Screen Options, allows you to use Add and Edit buttons instead of using drag and drop.') . '</p>'
) );
get_current_screen()->add_help_tab( array(
'id' => 'missing-widgets',
'title' => __('Missing Widgets'),
'content' =>
'<p>' . __('Many themes show some sidebar widgets by default until you edit your sidebars, but they are not automatically displayed in your sidebar management tool. After you make your first widget change, you can re-add the default widgets by adding them from the Available Widgets area.') . '</p>' .
'<p>' . __('When changing themes, there is often some variation in the number and setup of widget areas/sidebars and sometimes these conflicts make the transition a bit less smooth. If you changed themes and seem to be missing widgets, scroll down on this screen to the Inactive Widgets area, where all of your widgets and their settings will have been saved.') . '</p>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Appearance_Widgets_Screen" target="_blank">Documentation on Widgets</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
if ( ! current_theme_supports( 'widgets' ) ) {
wp_die( __( 'The theme you are currently using isn’t widget-aware, meaning that it has no sidebars that you are able to change. For information on making your theme widget-aware, please <a href="http://codex.wordpress.org/Widgetizing_Themes">follow these instructions</a>.' ) );
}
// These are the widgets grouped by sidebar
$sidebars_widgets = wp_get_sidebars_widgets();
if ( empty( $sidebars_widgets ) )
$sidebars_widgets = wp_get_widget_defaults();
foreach ( $sidebars_widgets as $sidebar_id => $widgets ) {
if ( 'wp_inactive_widgets' == $sidebar_id )
continue;
if ( !isset( $wp_registered_sidebars[ $sidebar_id ] ) ) {
if ( ! empty( $widgets ) ) { // register the inactive_widgets area as sidebar
register_sidebar(array(
'name' => __( 'Inactive Sidebar (not used)' ),
'id' => $sidebar_id,
'class' => 'inactive-sidebar orphan-sidebar',
'description' => __( 'This sidebar is no longer available and does not show anywhere on your site. Remove each of the widgets below to fully remove this inactive sidebar.' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
));
} else {
unset( $sidebars_widgets[ $sidebar_id ] );
}
}
}
// register the inactive_widgets area as sidebar
register_sidebar(array(
'name' => __('Inactive Widgets'),
'id' => 'wp_inactive_widgets',
'class' => 'inactive-sidebar',
'description' => __( 'Drag widgets here to remove them from the sidebar but keep their settings.' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
));
retrieve_widgets();
// We're saving a widget without js
if ( isset($_POST['savewidget']) || isset($_POST['removewidget']) ) {
$widget_id = $_POST['widget-id'];
check_admin_referer("save-delete-widget-$widget_id");
$number = isset($_POST['multi_number']) ? (int) $_POST['multi_number'] : '';
if ( $number ) {
foreach ( $_POST as $key => $val ) {
if ( is_array($val) && preg_match('/__i__|%i%/', key($val)) ) {
$_POST[$key] = array( $number => array_shift($val) );
break;
}
}
}
$sidebar_id = $_POST['sidebar'];
$position = isset($_POST[$sidebar_id . '_position']) ? (int) $_POST[$sidebar_id . '_position'] - 1 : 0;
$id_base = $_POST['id_base'];
$sidebar = isset($sidebars_widgets[$sidebar_id]) ? $sidebars_widgets[$sidebar_id] : array();
// delete
if ( isset($_POST['removewidget']) && $_POST['removewidget'] ) {
if ( !in_array($widget_id, $sidebar, true) ) {
wp_redirect( admin_url('widgets.php?error=0') );
exit;
}
$sidebar = array_diff( $sidebar, array($widget_id) );
$_POST = array('sidebar' => $sidebar_id, 'widget-' . $id_base => array(), 'the-widget-id' => $widget_id, 'delete_widget' => '1');
}
$_POST['widget-id'] = $sidebar;
foreach ( (array) $wp_registered_widget_updates as $name => $control ) {
if ( $name != $id_base || !is_callable($control['callback']) )
continue;
ob_start();
call_user_func_array( $control['callback'], $control['params'] );
ob_end_clean();
break;
}
$sidebars_widgets[$sidebar_id] = $sidebar;
// remove old position
if ( !isset($_POST['delete_widget']) ) {
foreach ( $sidebars_widgets as $key => $sb ) {
if ( is_array($sb) )
$sidebars_widgets[$key] = array_diff( $sb, array($widget_id) );
}
array_splice( $sidebars_widgets[$sidebar_id], $position, 0, $widget_id );
}
wp_set_sidebars_widgets($sidebars_widgets);
wp_redirect( admin_url('widgets.php?message=0') );
exit;
}
// Output the widget form without js
if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) {
$widget_id = $_GET['editwidget'];
if ( isset($_GET['addnew']) ) {
// Default to the first sidebar
$sidebar = array_shift( $keys = array_keys($wp_registered_sidebars) );
if ( isset($_GET['base']) && isset($_GET['num']) ) { // multi-widget
// Copy minimal info from an existing instance of this widget to a new instance
foreach ( $wp_registered_widget_controls as $control ) {
if ( $_GET['base'] === $control['id_base'] ) {
$control_callback = $control['callback'];
$multi_number = (int) $_GET['num'];
$control['params'][0]['number'] = -1;
$widget_id = $control['id'] = $control['id_base'] . '-' . $multi_number;
$wp_registered_widget_controls[$control['id']] = $control;
break;
}
}
}
}
if ( isset($wp_registered_widget_controls[$widget_id]) && !isset($control) ) {
$control = $wp_registered_widget_controls[$widget_id];
$control_callback = $control['callback'];
} elseif ( !isset($wp_registered_widget_controls[$widget_id]) && isset($wp_registered_widgets[$widget_id]) ) {
$name = esc_html( strip_tags($wp_registered_widgets[$widget_id]['name']) );
}
if ( !isset($name) )
$name = esc_html( strip_tags($control['name']) );
if ( !isset($sidebar) )
$sidebar = isset($_GET['sidebar']) ? $_GET['sidebar'] : 'wp_inactive_widgets';
if ( !isset($multi_number) )
$multi_number = isset($control['params'][0]['number']) ? $control['params'][0]['number'] : '';
$id_base = isset($control['id_base']) ? $control['id_base'] : $control['id'];
// show the widget form
$width = ' style="width:' . max($control['width'], 350) . 'px"';
$key = isset($_GET['key']) ? (int) $_GET['key'] : 0;
require_once( './admin-header.php' ); ?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<div class="editwidget"<?php echo $width; ?>>
<h3><?php printf( __( 'Widget %s' ), $name ); ?></h3>
<form action="widgets.php" method="post">
<div class="widget-inside">
<?php
if ( is_callable( $control_callback ) )
call_user_func_array( $control_callback, $control['params'] );
else
echo '<p>' . __('There are no options for this widget.') . "</p>\n"; ?>
</div>
<p class="describe"><?php _e('Select both the sidebar for this widget and the position of the widget in that sidebar.'); ?></p>
<div class="widget-position">
<table class="widefat"><thead><tr><th><?php _e('Sidebar'); ?></th><th><?php _e('Position'); ?></th></tr></thead><tbody>
<?php
foreach ( $wp_registered_sidebars as $sbname => $sbvalue ) {
echo "\t\t<tr><td><label><input type='radio' name='sidebar' value='" . esc_attr($sbname) . "'" . checked( $sbname, $sidebar, false ) . " /> $sbvalue[name]</label></td><td>";
if ( 'wp_inactive_widgets' == $sbname || 'orphaned_widgets' == substr( $sbname, 0, 16 ) ) {
echo ' ';
} else {
if ( !isset($sidebars_widgets[$sbname]) || !is_array($sidebars_widgets[$sbname]) ) {
$j = 1;
$sidebars_widgets[$sbname] = array();
} else {
$j = count($sidebars_widgets[$sbname]);
if ( isset($_GET['addnew']) || !in_array($widget_id, $sidebars_widgets[$sbname], true) )
$j++;
}
$selected = '';
echo "\t\t<select name='{$sbname}_position'>\n";
echo "\t\t<option value=''>" . __('— Select —') . "</option>\n";
for ( $i = 1; $i <= $j; $i++ ) {
if ( in_array($widget_id, $sidebars_widgets[$sbname], true) )
$selected = selected( $i, $key + 1, false );
echo "\t\t<option value='$i'$selected> $i </option>\n";
}
echo "\t\t</select>\n";
}
echo "</td></tr>\n";
} ?>
</tbody></table>
</div>
<div class="widget-control-actions">
<?php
if ( isset($_GET['addnew']) ) { ?>
<a href="widgets.php" class="button alignleft"><?php _e('Cancel'); ?></a>
<?php
} else {
submit_button( __( 'Delete' ), 'button alignleft', 'removewidget', false );
}
submit_button( __( 'Save Widget' ), 'button-primary alignright', 'savewidget', false ); ?>
<input type="hidden" name="widget-id" class="widget-id" value="<?php echo esc_attr($widget_id); ?>" />
<input type="hidden" name="id_base" class="id_base" value="<?php echo esc_attr($id_base); ?>" />
<input type="hidden" name="multi_number" class="multi_number" value="<?php echo esc_attr($multi_number); ?>" />
<?php wp_nonce_field("save-delete-widget-$widget_id"); ?>
<br class="clear" />
</div>
</form>
</div>
</div>
<?php
require_once( './admin-footer.php' );
exit;
}
$messages = array(
__('Changes saved.')
);
$errors = array(
__('Error while saving.'),
__('Error in displaying the widget settings form.')
);
require_once( './admin-header.php' ); ?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<?php if ( isset($_GET['message']) && isset($messages[$_GET['message']]) ) { ?>
<div id="message" class="updated"><p><?php echo $messages[$_GET['message']]; ?></p></div>
<?php } ?>
<?php if ( isset($_GET['error']) && isset($errors[$_GET['error']]) ) { ?>
<div id="message" class="error"><p><?php echo $errors[$_GET['error']]; ?></p></div>
<?php } ?>
<?php do_action( 'widgets_admin_page' ); ?>
<div class="widget-liquid-left">
<div id="widgets-left">
<div id="available-widgets" class="widgets-holder-wrap">
<div class="sidebar-name">
<div class="sidebar-name-arrow"><br /></div>
<h3><?php _e('Available Widgets'); ?> <span id="removing-widget"><?php _ex('Deactivate', 'removing-widget'); ?> <span></span></span></h3></div>
<div class="widget-holder">
<p class="description"><?php _e('Drag widgets from here to a sidebar on the right to activate them. Drag widgets back here to deactivate them and delete their settings.'); ?></p>
<div id="widget-list">
<?php wp_list_widgets(); ?>
</div>
<br class='clear' />
</div>
<br class="clear" />
</div>
<?php
foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) {
if ( false !== strpos( $registered_sidebar['class'], 'inactive-sidebar' ) || 'orphaned_widgets' == substr( $sidebar, 0, 16 ) ) {
$wrap_class = 'widgets-holder-wrap';
if ( !empty( $registered_sidebar['class'] ) )
$wrap_class .= ' ' . $registered_sidebar['class'];
?>
<div class="<?php echo esc_attr( $wrap_class ); ?>">
<div class="sidebar-name">
<div class="sidebar-name-arrow"><br /></div>
<h3><?php echo esc_html( $registered_sidebar['name'] ); ?>
<span class="spinner"></span>
</h3>
</div>
<div class="widget-holder inactive">
<?php wp_list_widget_controls( $registered_sidebar['id'] ); ?>
<div class="clear"></div>
</div>
</div>
<?php
}
}
?>
</div>
</div>
<div class="widget-liquid-right">
<div id="widgets-right">
<?php
$i = 0;
foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) {
if ( false !== strpos( $registered_sidebar['class'], 'inactive-sidebar' ) || 'orphaned_widgets' == substr( $sidebar, 0, 16 ) )
continue;
$wrap_class = 'widgets-holder-wrap';
if ( !empty( $registered_sidebar['class'] ) )
$wrap_class .= ' sidebar-' . $registered_sidebar['class'];
if ( $i )
$wrap_class .= ' closed'; ?>
<div class="<?php echo esc_attr( $wrap_class ); ?>">
<div class="sidebar-name">
<div class="sidebar-name-arrow"><br /></div>
<h3><?php echo esc_html( $registered_sidebar['name'] ); ?>
<span class="spinner"></span></h3></div>
<?php wp_list_widget_controls( $sidebar ); // Show the control forms for each of the widgets in this sidebar ?>
</div>
<?php
$i++;
} ?>
</div>
</div>
<form action="" method="post">
<?php wp_nonce_field( 'save-sidebar-widgets', '_wpnonce_widgets', false ); ?>
</form>
<br class="clear" />
</div>
<?php
do_action( 'sidebar_admin_page' );
require_once( './admin-footer.php' );
| zyblog | trunk/zyblog/wp-admin/widgets.php | PHP | asf20 | 14,966 |
<?php
/**
* Database Repair and Optimization Script.
*
* @package WordPress
* @subpackage Database
*/
define('WP_REPAIRING', true);
require_once('../../wp-load.php');
header( 'Content-Type: text/html; charset=utf-8' );
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php _e( 'WordPress › Database Repair' ); ?></title>
<?php
wp_admin_css( 'install', true );
?>
</head>
<body class="wp-core-ui">
<h1 id="logo"><a href="<?php esc_attr_e( 'http://wordpress.org/' ); ?>"><?php _e( 'WordPress' ); ?></a></h1>
<?php
if ( ! defined( 'WP_ALLOW_REPAIR' ) ) {
echo '<p>' . __( 'To allow use of this page to automatically repair database problems, please add the following line to your <code>wp-config.php</code> file. Once this line is added to your config, reload this page.' ) . "</p><code>define('WP_ALLOW_REPAIR', true);</code>";
} elseif ( isset( $_GET['repair'] ) ) {
$optimize = 2 == $_GET['repair'];
$okay = true;
$problems = array();
$tables = $wpdb->tables();
// Sitecategories may not exist if global terms are disabled.
if ( is_multisite() && ! $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->sitecategories'" ) )
unset( $tables['sitecategories'] );
$tables = array_merge( $tables, (array) apply_filters( 'tables_to_repair', array() ) ); // Return tables with table prefixes.
// Loop over the tables, checking and repairing as needed.
foreach ( $tables as $table ) {
$check = $wpdb->get_row( "CHECK TABLE $table" );
echo '<p>';
if ( 'OK' == $check->Msg_text ) {
/* translators: %s: table name */
printf( __( 'The %s table is okay.' ), "<code>$table</code>" );
} else {
/* translators: 1: table name, 2: error message, */
printf( __( 'The %1$s table is not okay. It is reporting the following error: %2$s. WordPress will attempt to repair this table…' ) , "<code>$table</code>", "<code>$check->Msg_text</code>" );
$repair = $wpdb->get_row( "REPAIR TABLE $table" );
echo '<br /> ';
if ( 'OK' == $check->Msg_text ) {
/* translators: %s: table name */
printf( __( 'Successfully repaired the %s table.' ), "<code>$table</code>" );
} else {
/* translators: 1: table name, 2: error message, */
echo sprintf( __( 'Failed to repair the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$check->Msg_text</code>" ) . '<br />';
$problems[$table] = $check->Msg_text;
$okay = false;
}
}
if ( $okay && $optimize ) {
$check = $wpdb->get_row( "ANALYZE TABLE $table" );
echo '<br /> ';
if ( 'Table is already up to date' == $check->Msg_text ) {
/* translators: %s: table name */
printf( __( 'The %s table is already optimized.' ), "<code>$table</code>" );
} else {
$check = $wpdb->get_row( "OPTIMIZE TABLE $table" );
echo '<br /> ';
if ( 'OK' == $check->Msg_text || 'Table is already up to date' == $check->Msg_text ) {
/* translators: %s: table name */
printf( __( 'Successfully optimized the %s table.' ), "<code>$table</code>" );
} else {
/* translators: 1: table name, 2: error message, */
printf( __( 'Failed to optimize the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$check->Msg_text</code>" );
}
}
}
echo '</p>';
}
if ( $problems ) {
printf( '<p>' . __('Some database problems could not be repaired. Please copy-and-paste the following list of errors to the <a href="%s">WordPress support forums</a> to get additional assistance.') . '</p>', __( 'http://wordpress.org/support/forum/how-to-and-troubleshooting' ) );
$problem_output = '';
foreach ( $problems as $table => $problem )
$problem_output .= "$table: $problem\n";
echo '<p><textarea name="errors" id="errors" rows="20" cols="60">' . esc_textarea( $problem_output ) . '</textarea></p>';
} else {
echo '<p>' . __( 'Repairs complete. Please remove the following line from wp-config.php to prevent this page from being used by unauthorized users.' ) . "</p><code>define('WP_ALLOW_REPAIR', true);</code>";
}
} else {
if ( isset( $_GET['referrer'] ) && 'is_blog_installed' == $_GET['referrer'] )
echo '<p>' . __( 'One or more database tables are unavailable. To allow WordPress to attempt to repair these tables, press the “Repair Database” button. Repairing can take a while, so please be patient.' ) . '</p>';
else
echo '<p>' . __( 'WordPress can automatically look for some common database problems and repair them. Repairing can take a while, so please be patient.' ) . '</p>';
?>
<p class="step"><a class="button button-large" href="repair.php?repair=1"><?php _e( 'Repair Database' ); ?></a></p>
<p><?php _e( 'WordPress can also attempt to optimize the database. This improves performance in some situations. Repairing and optimizing the database can take a long time and the database will be locked while optimizing.' ); ?></p>
<p class="step"><a class="button button-large" href="repair.php?repair=2"><?php _e( 'Repair and Optimize Database' ); ?></a></p>
<?php
}
?>
</body>
</html>
| zyblog | trunk/zyblog/wp-admin/maint/repair.php | PHP | asf20 | 5,172 |
<?php
/**
* Build Administration Menu.
*
* @package WordPress
* @subpackage Administration
*/
/**
* Constructs the admin menu bar.
*
* The elements in the array are :
* 0: Menu item name
* 1: Minimum level or capability required.
* 2: The URL of the item's file
* 3: Class
* 4: ID
* 5: Icon for top level menu
*
* @global array $menu
* @name $menu
* @var array
*/
$menu[2] = array( __('Dashboard'), 'read', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'none' );
$submenu[ 'index.php' ][0] = array( __('Home'), 'read', 'index.php' );
if ( is_multisite() ) {
$submenu[ 'index.php' ][5] = array( __('My Sites'), 'read', 'my-sites.php' );
}
if ( ! is_multisite() || is_super_admin() )
$update_data = wp_get_update_data();
if ( ! is_multisite() ) {
if ( current_user_can( 'update_core' ) )
$cap = 'update_core';
elseif ( current_user_can( 'update_plugins' ) )
$cap = 'update_plugins';
else
$cap = 'update_themes';
$submenu[ 'index.php' ][10] = array( sprintf( __('Updates %s'), "<span class='update-plugins count-{$update_data['counts']['total']}' title='{$update_data['title']}'><span class='update-count'>" . number_format_i18n($update_data['counts']['total']) . "</span></span>" ), $cap, 'update-core.php');
unset( $cap );
}
$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
$menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'open-if-no-js menu-top menu-icon-post', 'menu-posts', 'none' );
$submenu['edit.php'][5] = array( __('All Posts'), 'edit_posts', 'edit.php' );
/* translators: add new post */
$submenu['edit.php'][10] = array( _x('Add New', 'post'), get_post_type_object( 'post' )->cap->create_posts, 'post-new.php' );
$i = 15;
foreach ( get_taxonomies( array(), 'objects' ) as $tax ) {
if ( ! $tax->show_ui || ! in_array('post', (array) $tax->object_type, true) )
continue;
$submenu['edit.php'][$i++] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->name );
}
unset($tax);
$menu[10] = array( __('Media'), 'upload_files', 'upload.php', '', 'menu-top menu-icon-media', 'menu-media', 'none' );
$submenu['upload.php'][5] = array( __('Library'), 'upload_files', 'upload.php');
/* translators: add new file */
$submenu['upload.php'][10] = array( _x('Add New', 'file'), 'upload_files', 'media-new.php');
foreach ( get_taxonomies_for_attachments( 'objects' ) as $tax ) {
if ( ! $tax->show_ui )
continue;
$submenu['upload.php'][$i++] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->name . '&post_type=attachment' );
}
unset($tax);
$menu[15] = array( __('Links'), 'manage_links', 'link-manager.php', '', 'menu-top menu-icon-links', 'menu-links', 'none' );
$submenu['link-manager.php'][5] = array( _x('All Links', 'admin menu'), 'manage_links', 'link-manager.php' );
/* translators: add new links */
$submenu['link-manager.php'][10] = array( _x('Add New', 'link'), 'manage_links', 'link-add.php' );
$submenu['link-manager.php'][15] = array( __('Link Categories'), 'manage_categories', 'edit-tags.php?taxonomy=link_category' );
$menu[20] = array( __('Pages'), 'edit_pages', 'edit.php?post_type=page', '', 'menu-top menu-icon-page', 'menu-pages', 'none' );
$submenu['edit.php?post_type=page'][5] = array( __('All Pages'), 'edit_pages', 'edit.php?post_type=page' );
/* translators: add new page */
$submenu['edit.php?post_type=page'][10] = array( _x('Add New', 'page'), get_post_type_object( 'page' )->cap->create_posts, 'post-new.php?post_type=page' );
$i = 15;
foreach ( get_taxonomies( array(), 'objects' ) as $tax ) {
if ( ! $tax->show_ui || ! in_array('page', (array) $tax->object_type, true) )
continue;
$submenu['edit.php?post_type=page'][$i++] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->name . '&post_type=page' );
}
unset($tax);
$awaiting_mod = wp_count_comments();
$awaiting_mod = $awaiting_mod->moderated;
$menu[25] = array( sprintf( __('Comments %s'), "<span class='awaiting-mod count-$awaiting_mod'><span class='pending-count'>" . number_format_i18n($awaiting_mod) . "</span></span>" ), 'edit_posts', 'edit-comments.php', '', 'menu-top menu-icon-comments', 'menu-comments', 'none' );
unset($awaiting_mod);
$submenu[ 'edit-comments.php' ][0] = array( __('All Comments'), 'edit_posts', 'edit-comments.php' );
$_wp_last_object_menu = 25; // The index of the last top-level menu in the object menu group
foreach ( (array) get_post_types( array('show_ui' => true, '_builtin' => false, 'show_in_menu' => true ) ) as $ptype ) {
$ptype_obj = get_post_type_object( $ptype );
// Check if it should be a submenu.
if ( $ptype_obj->show_in_menu !== true )
continue;
$ptype_menu_position = is_int( $ptype_obj->menu_position ) ? $ptype_obj->menu_position : ++$_wp_last_object_menu; // If we're to use $_wp_last_object_menu, increment it first.
$ptype_for_id = sanitize_html_class( $ptype );
if ( is_string( $ptype_obj->menu_icon ) ) {
$menu_icon = esc_url( $ptype_obj->menu_icon );
$ptype_class = $ptype_for_id;
} else {
$menu_icon = 'none';
$ptype_class = 'post';
}
// if $ptype_menu_position is already populated or will be populated by a hard-coded value below, increment the position.
$core_menu_positions = array(59, 60, 65, 70, 75, 80, 85, 99);
while ( isset($menu[$ptype_menu_position]) || in_array($ptype_menu_position, $core_menu_positions) )
$ptype_menu_position++;
$menu[$ptype_menu_position] = array( esc_attr( $ptype_obj->labels->menu_name ), $ptype_obj->cap->edit_posts, "edit.php?post_type=$ptype", '', 'menu-top menu-icon-' . $ptype_class, 'menu-posts-' . $ptype_for_id, $menu_icon );
$submenu["edit.php?post_type=$ptype"][5] = array( $ptype_obj->labels->all_items, $ptype_obj->cap->edit_posts, "edit.php?post_type=$ptype");
$submenu["edit.php?post_type=$ptype"][10] = array( $ptype_obj->labels->add_new, $ptype_obj->cap->create_posts, "post-new.php?post_type=$ptype" );
$i = 15;
foreach ( get_taxonomies( array(), 'objects' ) as $tax ) {
if ( ! $tax->show_ui || ! in_array($ptype, (array) $tax->object_type, true) )
continue;
$submenu["edit.php?post_type=$ptype"][$i++] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, "edit-tags.php?taxonomy=$tax->name&post_type=$ptype" );
}
}
unset($ptype, $ptype_obj, $ptype_class, $ptype_for_id, $ptype_menu_position, $menu_icon, $i, $tax);
$menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' );
if ( current_user_can( 'switch_themes') ) {
$menu[60] = array( __('Appearance'), 'switch_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'none' );
$submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php');
if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
$submenu['themes.php'][10] = array(__('Menus'), 'edit_theme_options', 'nav-menus.php');
} else {
$menu[60] = array( __('Appearance'), 'edit_theme_options', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'none' );
$submenu['themes.php'][5] = array(__('Themes'), 'edit_theme_options', 'themes.php');
if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
$submenu['themes.php'][10] = array(__('Menus'), 'edit_theme_options', 'nav-menus.php' );
}
// Add 'Editor' to the bottom of the Appearance menu.
if ( ! is_multisite() )
add_action('admin_menu', '_add_themes_utility_last', 101);
function _add_themes_utility_last() {
// Must use API on the admin_menu hook, direct modification is only possible on/before the _admin_menu hook
add_submenu_page('themes.php', _x('Editor', 'theme editor'), _x('Editor', 'theme editor'), 'edit_themes', 'theme-editor.php');
}
$count = '';
if ( ! is_multisite() && current_user_can( 'update_plugins' ) ) {
if ( ! isset( $update_data ) )
$update_data = wp_get_update_data();
$count = "<span class='update-plugins count-{$update_data['counts']['plugins']}'><span class='plugin-count'>" . number_format_i18n($update_data['counts']['plugins']) . "</span></span>";
}
$menu[65] = array( sprintf( __('Plugins %s'), $count ), 'activate_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'none' );
$submenu['plugins.php'][5] = array( __('Installed Plugins'), 'activate_plugins', 'plugins.php' );
if ( ! is_multisite() ) {
/* translators: add new plugin */
$submenu['plugins.php'][10] = array( _x('Add New', 'plugin'), 'install_plugins', 'plugin-install.php' );
$submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' );
}
unset( $update_data );
if ( current_user_can('list_users') )
$menu[70] = array( __('Users'), 'list_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'none' );
else
$menu[70] = array( __('Profile'), 'read', 'profile.php', '', 'menu-top menu-icon-users', 'menu-users', 'none' );
if ( current_user_can('list_users') ) {
$_wp_real_parent_file['profile.php'] = 'users.php'; // Back-compat for plugins adding submenus to profile.php.
$submenu['users.php'][5] = array(__('All Users'), 'list_users', 'users.php');
if ( current_user_can('create_users') )
$submenu['users.php'][10] = array(_x('Add New', 'user'), 'create_users', 'user-new.php');
else
$submenu['users.php'][10] = array(_x('Add New', 'user'), 'promote_users', 'user-new.php');
$submenu['users.php'][15] = array(__('Your Profile'), 'read', 'profile.php');
} else {
$_wp_real_parent_file['users.php'] = 'profile.php';
$submenu['profile.php'][5] = array(__('Your Profile'), 'read', 'profile.php');
if ( current_user_can('create_users') )
$submenu['profile.php'][10] = array(__('Add New User'), 'create_users', 'user-new.php');
else
$submenu['profile.php'][10] = array(__('Add New User'), 'promote_users', 'user-new.php');
}
$menu[75] = array( __('Tools'), 'edit_posts', 'tools.php', '', 'menu-top menu-icon-tools', 'menu-tools', 'none' );
$submenu['tools.php'][5] = array( __('Available Tools'), 'edit_posts', 'tools.php' );
$submenu['tools.php'][10] = array( __('Import'), 'import', 'import.php' );
$submenu['tools.php'][15] = array( __('Export'), 'export', 'export.php' );
if ( is_multisite() && !is_main_site() )
$submenu['tools.php'][25] = array( __('Delete Site'), 'manage_options', 'ms-delete-site.php' );
if ( ! is_multisite() && defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE )
$submenu['tools.php'][50] = array(__('Network Setup'), 'manage_options', 'network.php');
$menu[80] = array( __('Settings'), 'manage_options', 'options-general.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'none' );
$submenu['options-general.php'][10] = array(_x('General', 'settings screen'), 'manage_options', 'options-general.php');
$submenu['options-general.php'][15] = array(__('Writing'), 'manage_options', 'options-writing.php');
$submenu['options-general.php'][20] = array(__('Reading'), 'manage_options', 'options-reading.php');
$submenu['options-general.php'][25] = array(__('Discussion'), 'manage_options', 'options-discussion.php');
$submenu['options-general.php'][30] = array(__('Media'), 'manage_options', 'options-media.php');
$submenu['options-general.php'][40] = array(__('Permalinks'), 'manage_options', 'options-permalink.php');
$_wp_last_utility_menu = 80; // The index of the last top-level menu in the utility menu group
$menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator' );
// Back-compat for old top-levels
$_wp_real_parent_file['post.php'] = 'edit.php';
$_wp_real_parent_file['post-new.php'] = 'edit.php';
$_wp_real_parent_file['edit-pages.php'] = 'edit.php?post_type=page';
$_wp_real_parent_file['page-new.php'] = 'edit.php?post_type=page';
$_wp_real_parent_file['wpmu-admin.php'] = 'tools.php';
$_wp_real_parent_file['ms-admin.php'] = 'tools.php';
// ensure we're backwards compatible
$compat = array(
'index' => 'dashboard',
'edit' => 'posts',
'post' => 'posts',
'upload' => 'media',
'link-manager' => 'links',
'edit-pages' => 'pages',
'page' => 'pages',
'edit-comments' => 'comments',
'options-general' => 'settings',
'themes' => 'appearance',
);
require_once(ABSPATH . 'wp-admin/includes/menu.php');
| zyblog | trunk/zyblog/wp-admin/menu.php | PHP | asf20 | 12,325 |
<?php
/**
* The custom background script.
*
* @package WordPress
* @subpackage Administration
*/
/**
* The custom background class.
*
* @since 3.0.0
* @package WordPress
* @subpackage Administration
*/
class Custom_Background {
/**
* Callback for administration header.
*
* @var callback
* @since 3.0.0
* @access private
*/
var $admin_header_callback;
/**
* Callback for header div.
*
* @var callback
* @since 3.0.0
* @access private
*/
var $admin_image_div_callback;
/**
* Holds the page menu hook.
*
* @var string
* @since 3.0.0
* @access private
*/
var $page = '';
/**
* Constructor - Register administration header callback.
*
* @since 3.0.0
* @param callback $admin_header_callback
* @param callback $admin_image_div_callback Optional custom image div output callback.
* @return Custom_Background
*/
function __construct($admin_header_callback = '', $admin_image_div_callback = '') {
$this->admin_header_callback = $admin_header_callback;
$this->admin_image_div_callback = $admin_image_div_callback;
add_action( 'admin_menu', array( $this, 'init' ) );
add_action( 'wp_ajax_set-background-image', array( $this, 'wp_set_background_image' ) );
}
/**
* Set up the hooks for the Custom Background admin page.
*
* @since 3.0.0
*/
function init() {
if ( ! current_user_can('edit_theme_options') )
return;
$this->page = $page = add_theme_page(__('Background'), __('Background'), 'edit_theme_options', 'custom-background', array(&$this, 'admin_page'));
add_action("load-$page", array(&$this, 'admin_load'));
add_action("load-$page", array(&$this, 'take_action'), 49);
add_action("load-$page", array(&$this, 'handle_upload'), 49);
if ( $this->admin_header_callback )
add_action("admin_head-$page", $this->admin_header_callback, 51);
}
/**
* Set up the enqueue for the CSS & JavaScript files.
*
* @since 3.0.0
*/
function admin_load() {
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __( 'You can customize the look of your site without touching any of your theme’s code by using a custom background. Your background can be an image or a color.' ) . '</p>' .
'<p>' . __( 'To use a background image, simply upload it or choose an image that has already been uploaded to your Media Library by clicking the “Choose Image” button. You can display a single instance of your image, or tile it to fill the screen. You can have your background fixed in place, so your site content moves on top of it, or you can have it scroll with your site.' ) . '</p>' .
'<p>' . __( 'You can also choose a background color by clicking the Select Color button and either typing in a legitimate HTML hex value, e.g. “#ff0000” for red, or by choosing a color using the color picker.' ) . '</p>' .
'<p>' . __( 'Don’t forget to click on the Save Changes button when you are finished.' ) . '</p>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="http://codex.wordpress.org/Appearance_Background_Screen" target="_blank">Documentation on Custom Background</a>' ) . '</p>' .
'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
);
wp_enqueue_media();
wp_enqueue_script('custom-background');
wp_enqueue_style('wp-color-picker');
}
/**
* Execute custom background modification.
*
* @since 3.0.0
*/
function take_action() {
if ( empty($_POST) )
return;
if ( isset($_POST['reset-background']) ) {
check_admin_referer('custom-background-reset', '_wpnonce-custom-background-reset');
remove_theme_mod('background_image');
remove_theme_mod('background_image_thumb');
$this->updated = true;
return;
}
if ( isset($_POST['remove-background']) ) {
// @TODO: Uploaded files are not removed here.
check_admin_referer('custom-background-remove', '_wpnonce-custom-background-remove');
set_theme_mod('background_image', '');
set_theme_mod('background_image_thumb', '');
$this->updated = true;
wp_safe_redirect( $_POST['_wp_http_referer'] );
return;
}
if ( isset($_POST['background-repeat']) ) {
check_admin_referer('custom-background');
if ( in_array($_POST['background-repeat'], array('repeat', 'no-repeat', 'repeat-x', 'repeat-y')) )
$repeat = $_POST['background-repeat'];
else
$repeat = 'repeat';
set_theme_mod('background_repeat', $repeat);
}
if ( isset($_POST['background-position-x']) ) {
check_admin_referer('custom-background');
if ( in_array($_POST['background-position-x'], array('center', 'right', 'left')) )
$position = $_POST['background-position-x'];
else
$position = 'left';
set_theme_mod('background_position_x', $position);
}
if ( isset($_POST['background-attachment']) ) {
check_admin_referer('custom-background');
if ( in_array($_POST['background-attachment'], array('fixed', 'scroll')) )
$attachment = $_POST['background-attachment'];
else
$attachment = 'fixed';
set_theme_mod('background_attachment', $attachment);
}
if ( isset($_POST['background-color']) ) {
check_admin_referer('custom-background');
$color = preg_replace('/[^0-9a-fA-F]/', '', $_POST['background-color']);
if ( strlen($color) == 6 || strlen($color) == 3 )
set_theme_mod('background_color', $color);
else
set_theme_mod('background_color', '');
}
$this->updated = true;
}
/**
* Display the custom background page.
*
* @since 3.0.0
*/
function admin_page() {
?>
<div class="wrap" id="custom-background">
<?php screen_icon(); ?>
<h2><?php _e('Custom Background'); ?></h2>
<?php if ( !empty($this->updated) ) { ?>
<div id="message" class="updated">
<p><?php printf( __( 'Background updated. <a href="%s">Visit your site</a> to see how it looks.' ), home_url( '/' ) ); ?></p>
</div>
<?php }
if ( $this->admin_image_div_callback ) {
call_user_func($this->admin_image_div_callback);
} else {
?>
<h3><?php _e('Background Image'); ?></h3>
<table class="form-table">
<tbody>
<tr valign="top">
<th scope="row"><?php _e('Preview'); ?></th>
<td>
<?php
$background_styles = '';
if ( $bgcolor = get_background_color() )
$background_styles .= 'background-color: #' . $bgcolor . ';';
if ( get_background_image() ) {
// background-image URL must be single quote, see below
$background_styles .= ' background-image: url(\'' . set_url_scheme( get_theme_mod( 'background_image_thumb', get_background_image() ) ) . '\');'
. ' background-repeat: ' . get_theme_mod('background_repeat', 'repeat') . ';'
. ' background-position: top ' . get_theme_mod('background_position_x', 'left');
}
?>
<div id="custom-background-image" style="<?php echo $background_styles; ?>"><?php // must be double quote, see above ?>
<?php if ( get_background_image() ) { ?>
<img class="custom-background-image" src="<?php echo set_url_scheme( get_theme_mod( 'background_image_thumb', get_background_image() ) ); ?>" style="visibility:hidden;" alt="" /><br />
<img class="custom-background-image" src="<?php echo set_url_scheme( get_theme_mod( 'background_image_thumb', get_background_image() ) ); ?>" style="visibility:hidden;" alt="" />
<?php } ?>
</div>
<?php } ?>
</td>
</tr>
<?php if ( get_background_image() ) : ?>
<tr valign="top">
<th scope="row"><?php _e('Remove Image'); ?></th>
<td>
<form method="post" action="">
<?php wp_nonce_field('custom-background-remove', '_wpnonce-custom-background-remove'); ?>
<?php submit_button( __( 'Remove Background Image' ), 'button', 'remove-background', false ); ?><br/>
<?php _e('This will remove the background image. You will not be able to restore any customizations.') ?>
</form>
</td>
</tr>
<?php endif; ?>
<?php $default_image = get_theme_support( 'custom-background', 'default-image' ); ?>
<?php if ( $default_image && get_background_image() != $default_image ) : ?>
<tr valign="top">
<th scope="row"><?php _e('Restore Original Image'); ?></th>
<td>
<form method="post" action="">
<?php wp_nonce_field('custom-background-reset', '_wpnonce-custom-background-reset'); ?>
<?php submit_button( __( 'Restore Original Image' ), 'button', 'reset-background', false ); ?><br/>
<?php _e('This will restore the original background image. You will not be able to restore any customizations.') ?>
</form>
</td>
</tr>
<?php endif; ?>
<tr valign="top">
<th scope="row"><?php _e('Select Image'); ?></th>
<td><form enctype="multipart/form-data" id="upload-form" class="wp-upload-form" method="post" action="">
<p>
<label for="upload"><?php _e( 'Choose an image from your computer:' ); ?></label><br />
<input type="file" id="upload" name="import" />
<input type="hidden" name="action" value="save" />
<?php wp_nonce_field( 'custom-background-upload', '_wpnonce-custom-background-upload' ); ?>
<?php submit_button( __( 'Upload' ), 'button', 'submit', false ); ?>
</p>
<p>
<label for="choose-from-library-link"><?php _e( 'Or choose an image from your media library:' ); ?></label><br />
<a id="choose-from-library-link" class="button"
data-choose="<?php esc_attr_e( 'Choose a Background Image' ); ?>"
data-update="<?php esc_attr_e( 'Set as background' ); ?>"><?php _e( 'Choose Image' ); ?></a>
</p>
</form>
</td>
</tr>
</tbody>
</table>
<h3><?php _e('Display Options') ?></h3>
<form method="post" action="">
<table class="form-table">
<tbody>
<?php if ( get_background_image() ) : ?>
<tr valign="top">
<th scope="row"><?php _e( 'Position' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Position' ); ?></span></legend>
<label>
<input name="background-position-x" type="radio" value="left"<?php checked('left', get_theme_mod('background_position_x', 'left')); ?> />
<?php _e('Left') ?>
</label>
<label>
<input name="background-position-x" type="radio" value="center"<?php checked('center', get_theme_mod('background_position_x', 'left')); ?> />
<?php _e('Center') ?>
</label>
<label>
<input name="background-position-x" type="radio" value="right"<?php checked('right', get_theme_mod('background_position_x', 'left')); ?> />
<?php _e('Right') ?>
</label>
</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e( 'Repeat' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Repeat' ); ?></span></legend>
<label><input type="radio" name="background-repeat" value="no-repeat"<?php checked('no-repeat', get_theme_mod('background_repeat', 'repeat')); ?> /> <?php _e('No Repeat'); ?></label>
<label><input type="radio" name="background-repeat" value="repeat"<?php checked('repeat', get_theme_mod('background_repeat', 'repeat')); ?> /> <?php _e('Tile'); ?></label>
<label><input type="radio" name="background-repeat" value="repeat-x"<?php checked('repeat-x', get_theme_mod('background_repeat', 'repeat')); ?> /> <?php _e('Tile Horizontally'); ?></label>
<label><input type="radio" name="background-repeat" value="repeat-y"<?php checked('repeat-y', get_theme_mod('background_repeat', 'repeat')); ?> /> <?php _e('Tile Vertically'); ?></label>
</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e( 'Attachment' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Attachment' ); ?></span></legend>
<label>
<input name="background-attachment" type="radio" value="scroll" <?php checked('scroll', get_theme_mod('background_attachment', 'scroll')); ?> />
<?php _e('Scroll') ?>
</label>
<label>
<input name="background-attachment" type="radio" value="fixed" <?php checked('fixed', get_theme_mod('background_attachment', 'scroll')); ?> />
<?php _e('Fixed') ?>
</label>
</fieldset></td>
</tr>
<?php endif; // get_background_image() ?>
<tr valign="top">
<th scope="row"><?php _e( 'Background Color' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Color' ); ?></span></legend>
<?php
$default_color = '';
if ( current_theme_supports( 'custom-background', 'default-color' ) )
$default_color = ' data-default-color="#' . esc_attr( get_theme_support( 'custom-background', 'default-color' ) ) . '"';
?>
<input type="text" name="background-color" id="background-color" value="#<?php echo esc_attr( get_background_color() ); ?>"<?php echo $default_color ?> />
</fieldset></td>
</tr>
</tbody>
</table>
<?php wp_nonce_field('custom-background'); ?>
<?php submit_button( null, 'primary', 'save-background-options' ); ?>
</form>
</div>
<?php
}
/**
* Handle an Image upload for the background image.
*
* @since 3.0.0
*/
function handle_upload() {
if ( empty($_FILES) )
return;
check_admin_referer('custom-background-upload', '_wpnonce-custom-background-upload');
$overrides = array('test_form' => false);
$uploaded_file = $_FILES['import'];
$wp_filetype = wp_check_filetype_and_ext( $uploaded_file['tmp_name'], $uploaded_file['name'], false );
if ( ! wp_match_mime_types( 'image', $wp_filetype['type'] ) )
wp_die( __( 'The uploaded file is not a valid image. Please try again.' ) );
$file = wp_handle_upload($uploaded_file, $overrides);
if ( isset($file['error']) )
wp_die( $file['error'] );
$url = $file['url'];
$type = $file['type'];
$file = $file['file'];
$filename = basename($file);
// Construct the object array
$object = array(
'post_title' => $filename,
'post_content' => $url,
'post_mime_type' => $type,
'guid' => $url,
'context' => 'custom-background'
);
// Save the data
$id = wp_insert_attachment($object, $file);
// Add the meta-data
wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
update_post_meta( $id, '_wp_attachment_is_custom_background', get_option('stylesheet' ) );
set_theme_mod('background_image', esc_url_raw($url));
$thumbnail = wp_get_attachment_image_src( $id, 'thumbnail' );
set_theme_mod('background_image_thumb', esc_url_raw( $thumbnail[0] ) );
do_action('wp_create_file_in_uploads', $file, $id); // For replication
$this->updated = true;
}
/**
* Unused since 3.5.0.
*
* @since 3.4.0
*/
function attachment_fields_to_edit( $form_fields ) {
return $form_fields;
}
/**
* Unused since 3.5.0.
*
* @since 3.4.0
*/
function filter_upload_tabs( $tabs ) {
return $tabs;
}
public function wp_set_background_image() {
if ( ! current_user_can('edit_theme_options') || ! isset( $_POST['attachment_id'] ) ) exit;
$attachment_id = absint($_POST['attachment_id']);
$sizes = array_keys(apply_filters( 'image_size_names_choose', array('thumbnail' => __('Thumbnail'), 'medium' => __('Medium'), 'large' => __('Large'), 'full' => __('Full Size')) ));
$size = 'thumbnail';
if ( in_array( $_POST['size'], $sizes ) )
$size = esc_attr( $_POST['size'] );
update_post_meta( $attachment_id, '_wp_attachment_is_custom_background', get_option('stylesheet' ) );
$url = wp_get_attachment_image_src( $attachment_id, $size );
$thumbnail = wp_get_attachment_image_src( $attachment_id, 'thumbnail' );
set_theme_mod( 'background_image', esc_url_raw( $url[0] ) );
set_theme_mod( 'background_image_thumb', esc_url_raw( $thumbnail[0] ) );
exit;
}
}
| zyblog | trunk/zyblog/wp-admin/custom-background.php | PHP | asf20 | 15,238 |
<?php
/**
* Multisite administration functions.
*
* @package WordPress
* @subpackage Multisite
* @since 3.0.0
*/
/**
* Determine if uploaded file exceeds space quota.
*
* @since 3.0.0
*
* @param array $file $_FILES array for a given file.
* @return array $_FILES array with 'error' key set if file exceeds quota. 'error' is empty otherwise.
*/
function check_upload_size( $file ) {
if ( get_site_option( 'upload_space_check_disabled' ) )
return $file;
if ( $file['error'] != '0' ) // there's already an error
return $file;
if ( defined( 'WP_IMPORTING' ) )
return $file;
$space_left = get_upload_space_available();
$file_size = filesize( $file['tmp_name'] );
if ( $space_left < $file_size )
$file['error'] = sprintf( __( 'Not enough space to upload. %1$s KB needed.' ), number_format( ($file_size - $space_left) /1024 ) );
if ( $file_size > ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) )
$file['error'] = sprintf(__('This file is too big. Files must be less than %1$s KB in size.'), get_site_option( 'fileupload_maxk', 1500 ) );
if ( upload_is_user_over_quota( false ) ) {
$file['error'] = __( 'You have used your space quota. Please delete files before uploading.' );
}
if ( $file['error'] != '0' && !isset($_POST['html-upload']) )
wp_die( $file['error'] . ' <a href="javascript:history.go(-1)">' . __( 'Back' ) . '</a>' );
return $file;
}
add_filter( 'wp_handle_upload_prefilter', 'check_upload_size' );
/**
* Delete a blog
*
* @since 3.0.0
*
* @param int $blog_id Blog ID
* @param bool $drop True if blog's table should be dropped. Default is false.
* @return void
*/
function wpmu_delete_blog( $blog_id, $drop = false ) {
global $wpdb, $current_site;
$switch = false;
if ( get_current_blog_id() != $blog_id ) {
$switch = true;
switch_to_blog( $blog_id );
}
$blog = get_blog_details( $blog_id );
do_action( 'delete_blog', $blog_id, $drop );
$users = get_users( array( 'blog_id' => $blog_id, 'fields' => 'ids' ) );
// Remove users from this blog.
if ( ! empty( $users ) ) {
foreach ( $users as $user_id ) {
remove_user_from_blog( $user_id, $blog_id );
}
}
update_blog_status( $blog_id, 'deleted', 1 );
// Don't destroy the initial, main, or root blog.
if ( $drop && ( 1 == $blog_id || is_main_site( $blog_id ) || ( $blog->path == $current_site->path && $blog->domain == $current_site->domain ) ) )
$drop = false;
if ( $drop ) {
$drop_tables = apply_filters( 'wpmu_drop_tables', $wpdb->tables( 'blog' ) );
foreach ( (array) $drop_tables as $table ) {
$wpdb->query( "DROP TABLE IF EXISTS `$table`" );
}
$wpdb->delete( $wpdb->blogs, array( 'blog_id' => $blog_id ) );
$uploads = wp_upload_dir();
$dir = apply_filters( 'wpmu_delete_blog_upload_dir', $uploads['basedir'], $blog_id );
$dir = rtrim( $dir, DIRECTORY_SEPARATOR );
$top_dir = $dir;
$stack = array($dir);
$index = 0;
while ( $index < count( $stack ) ) {
# Get indexed directory from stack
$dir = $stack[$index];
$dh = @opendir( $dir );
if ( $dh ) {
while ( ( $file = @readdir( $dh ) ) !== false ) {
if ( $file == '.' || $file == '..' )
continue;
if ( @is_dir( $dir . DIRECTORY_SEPARATOR . $file ) )
$stack[] = $dir . DIRECTORY_SEPARATOR . $file;
else if ( @is_file( $dir . DIRECTORY_SEPARATOR . $file ) )
@unlink( $dir . DIRECTORY_SEPARATOR . $file );
}
@closedir( $dh );
}
$index++;
}
$stack = array_reverse( $stack ); // Last added dirs are deepest
foreach( (array) $stack as $dir ) {
if ( $dir != $top_dir)
@rmdir( $dir );
}
clean_blog_cache( $blog );
}
if ( $switch )
restore_current_blog();
}
// @todo Merge with wp_delete_user() ?
function wpmu_delete_user( $id ) {
global $wpdb;
$id = (int) $id;
$user = new WP_User( $id );
do_action( 'wpmu_delete_user', $id );
$blogs = get_blogs_of_user( $id );
if ( ! empty( $blogs ) ) {
foreach ( $blogs as $blog ) {
switch_to_blog( $blog->userblog_id );
remove_user_from_blog( $id, $blog->userblog_id );
$post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id ) );
foreach ( (array) $post_ids as $post_id ) {
wp_delete_post( $post_id );
}
// Clean links
$link_ids = $wpdb->get_col( $wpdb->prepare( "SELECT link_id FROM $wpdb->links WHERE link_owner = %d", $id ) );
if ( $link_ids ) {
foreach ( $link_ids as $link_id )
wp_delete_link( $link_id );
}
restore_current_blog();
}
}
$meta = $wpdb->get_col( $wpdb->prepare( "SELECT umeta_id FROM $wpdb->usermeta WHERE user_id = %d", $id ) );
foreach ( $meta as $mid )
delete_metadata_by_mid( 'user', $mid );
$wpdb->delete( $wpdb->users, array( 'ID' => $id ) );
clean_user_cache( $user );
// allow for commit transaction
do_action( 'deleted_user', $id );
return true;
}
function update_option_new_admin_email( $old_value, $value ) {
$email = get_option( 'admin_email' );
if ( $value == get_option( 'admin_email' ) || !is_email( $value ) )
return;
$hash = md5( $value. time() .mt_rand() );
$new_admin_email = array(
'hash' => $hash,
'newemail' => $value
);
update_option( 'adminhash', $new_admin_email );
$content = apply_filters( 'new_admin_email_content', __( "Dear user,
You recently requested to have the administration email address on
your site changed.
If this is correct, please click on the following link to change it:
###ADMIN_URL###
You can safely ignore and delete this email if you do not want to
take this action.
This email has been sent to ###EMAIL###
Regards,
All at ###SITENAME###
###SITEURL### "), $new_admin_email );
$content = str_replace( '###ADMIN_URL###', esc_url( admin_url( 'options.php?adminhash='.$hash ) ), $content );
$content = str_replace( '###EMAIL###', $value, $content );
$content = str_replace( '###SITENAME###', get_site_option( 'site_name' ), $content );
$content = str_replace( '###SITEURL###', network_home_url(), $content );
wp_mail( $value, sprintf( __( '[%s] New Admin Email Address' ), get_option( 'blogname' ) ), $content );
}
add_action( 'update_option_new_admin_email', 'update_option_new_admin_email', 10, 2 );
add_action( 'add_option_new_admin_email', 'update_option_new_admin_email', 10, 2 );
function send_confirmation_on_profile_email() {
global $errors, $wpdb;
$current_user = wp_get_current_user();
if ( ! is_object($errors) )
$errors = new WP_Error();
if ( $current_user->ID != $_POST['user_id'] )
return false;
if ( $current_user->user_email != $_POST['email'] ) {
if ( !is_email( $_POST['email'] ) ) {
$errors->add( 'user_email', __( "<strong>ERROR</strong>: The email address isn’t correct." ), array( 'form-field' => 'email' ) );
return;
}
if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_email FROM {$wpdb->users} WHERE user_email=%s", $_POST['email'] ) ) ) {
$errors->add( 'user_email', __( "<strong>ERROR</strong>: The email address is already used." ), array( 'form-field' => 'email' ) );
delete_option( $current_user->ID . '_new_email' );
return;
}
$hash = md5( $_POST['email'] . time() . mt_rand() );
$new_user_email = array(
'hash' => $hash,
'newemail' => $_POST['email']
);
update_option( $current_user->ID . '_new_email', $new_user_email );
$content = apply_filters( 'new_user_email_content', __( "Dear user,
You recently requested to have the email address on your account changed.
If this is correct, please click on the following link to change it:
###ADMIN_URL###
You can safely ignore and delete this email if you do not want to
take this action.
This email has been sent to ###EMAIL###
Regards,
All at ###SITENAME###
###SITEURL###" ), $new_user_email );
$content = str_replace( '###ADMIN_URL###', esc_url( admin_url( 'profile.php?newuseremail='.$hash ) ), $content );
$content = str_replace( '###EMAIL###', $_POST['email'], $content);
$content = str_replace( '###SITENAME###', get_site_option( 'site_name' ), $content );
$content = str_replace( '###SITEURL###', network_home_url(), $content );
wp_mail( $_POST['email'], sprintf( __( '[%s] New Email Address' ), get_option( 'blogname' ) ), $content );
$_POST['email'] = $current_user->user_email;
}
}
add_action( 'personal_options_update', 'send_confirmation_on_profile_email' );
function new_user_email_admin_notice() {
if ( strpos( $_SERVER['PHP_SELF'], 'profile.php' ) && isset( $_GET['updated'] ) && $email = get_option( get_current_user_id() . '_new_email' ) )
echo "<div class='update-nag'>" . sprintf( __( "Your email address has not been updated yet. Please check your inbox at %s for a confirmation email." ), $email['newemail'] ) . "</div>";
}
add_action( 'admin_notices', 'new_user_email_admin_notice' );
/**
* Check whether a blog has used its allotted upload space.
*
* @since MU
*
* @param bool $echo Optional. If $echo is set and the quota is exceeded, a warning message is echoed. Default is true.
* @return int
*/
function upload_is_user_over_quota( $echo = true ) {
if ( get_site_option( 'upload_space_check_disabled' ) )
return false;
$space_allowed = get_space_allowed();
if ( empty( $space_allowed ) || !is_numeric( $space_allowed ) )
$space_allowed = 10; // Default space allowed is 10 MB
$space_used = get_space_used();
if ( ( $space_allowed - $space_used ) < 0 ) {
if ( $echo )
_e( 'Sorry, you have used your space allocation. Please delete some files to upload more files.' );
return true;
} else {
return false;
}
}
/**
* Displays the amount of disk space used by the current blog. Not used in core.
*
* @since MU
*/
function display_space_usage() {
$space_allowed = get_space_allowed();
$space_used = get_space_used();
$percent_used = ( $space_used / $space_allowed ) * 100;
if ( $space_allowed > 1000 ) {
$space = number_format( $space_allowed / 1024 );
/* translators: Gigabytes */
$space .= __( 'GB' );
} else {
$space = number_format( $space_allowed );
/* translators: Megabytes */
$space .= __( 'MB' );
}
?>
<strong><?php printf( __( 'Used: %1$s%% of %2$s' ), number_format( $percent_used ), $space ); ?></strong>
<?php
}
/**
* Get the remaining upload space for this blog.
*
* @since MU
* @uses upload_is_user_over_quota()
* @uses get_space_allowed()
* @uses get_upload_space_available()
*
* @param int $size Current max size in bytes
* @return int Max size in bytes
*/
function fix_import_form_size( $size ) {
if ( upload_is_user_over_quota( false ) == true )
return 0;
$available = get_upload_space_available();
return min( $size, $available );
}
// Edit blog upload space setting on Edit Blog page
function upload_space_setting( $id ) {
switch_to_blog( $id );
$quota = get_option( 'blog_upload_space' );
restore_current_blog();
if ( !$quota )
$quota = '';
?>
<tr>
<th><?php _e( 'Site Upload Space Quota '); ?></th>
<td><input type="number" step="1" min="0" style="width: 100px" name="option[blog_upload_space]" value="<?php echo $quota; ?>" /> <?php _e( 'MB (Leave blank for network default)' ); ?></td>
</tr>
<?php
}
add_action( 'wpmueditblogaction', 'upload_space_setting' );
function update_user_status( $id, $pref, $value, $deprecated = null ) {
global $wpdb;
if ( null !== $deprecated )
_deprecated_argument( __FUNCTION__, '3.1' );
$wpdb->update( $wpdb->users, array( $pref => $value ), array( 'ID' => $id ) );
$user = new WP_User( $id );
clean_user_cache( $user );
if ( $pref == 'spam' ) {
if ( $value == 1 )
do_action( 'make_spam_user', $id );
else
do_action( 'make_ham_user', $id );
}
return $value;
}
function refresh_user_details( $id ) {
$id = (int) $id;
if ( !$user = get_userdata( $id ) )
return false;
clean_user_cache( $user );
return $id;
}
function format_code_lang( $code = '' ) {
$code = strtolower( substr( $code, 0, 2 ) );
$lang_codes = array(
'aa' => 'Afar', 'ab' => 'Abkhazian', 'af' => 'Afrikaans', 'ak' => 'Akan', 'sq' => 'Albanian', 'am' => 'Amharic', 'ar' => 'Arabic', 'an' => 'Aragonese', 'hy' => 'Armenian', 'as' => 'Assamese', 'av' => 'Avaric', 'ae' => 'Avestan', 'ay' => 'Aymara', 'az' => 'Azerbaijani', 'ba' => 'Bashkir', 'bm' => 'Bambara', 'eu' => 'Basque', 'be' => 'Belarusian', 'bn' => 'Bengali',
'bh' => 'Bihari', 'bi' => 'Bislama', 'bs' => 'Bosnian', 'br' => 'Breton', 'bg' => 'Bulgarian', 'my' => 'Burmese', 'ca' => 'Catalan; Valencian', 'ch' => 'Chamorro', 'ce' => 'Chechen', 'zh' => 'Chinese', 'cu' => 'Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic', 'cv' => 'Chuvash', 'kw' => 'Cornish', 'co' => 'Corsican', 'cr' => 'Cree',
'cs' => 'Czech', 'da' => 'Danish', 'dv' => 'Divehi; Dhivehi; Maldivian', 'nl' => 'Dutch; Flemish', 'dz' => 'Dzongkha', 'en' => 'English', 'eo' => 'Esperanto', 'et' => 'Estonian', 'ee' => 'Ewe', 'fo' => 'Faroese', 'fj' => 'Fijjian', 'fi' => 'Finnish', 'fr' => 'French', 'fy' => 'Western Frisian', 'ff' => 'Fulah', 'ka' => 'Georgian', 'de' => 'German', 'gd' => 'Gaelic; Scottish Gaelic',
'ga' => 'Irish', 'gl' => 'Galician', 'gv' => 'Manx', 'el' => 'Greek, Modern', 'gn' => 'Guarani', 'gu' => 'Gujarati', 'ht' => 'Haitian; Haitian Creole', 'ha' => 'Hausa', 'he' => 'Hebrew', 'hz' => 'Herero', 'hi' => 'Hindi', 'ho' => 'Hiri Motu', 'hu' => 'Hungarian', 'ig' => 'Igbo', 'is' => 'Icelandic', 'io' => 'Ido', 'ii' => 'Sichuan Yi', 'iu' => 'Inuktitut', 'ie' => 'Interlingue',
'ia' => 'Interlingua (International Auxiliary Language Association)', 'id' => 'Indonesian', 'ik' => 'Inupiaq', 'it' => 'Italian', 'jv' => 'Javanese', 'ja' => 'Japanese', 'kl' => 'Kalaallisut; Greenlandic', 'kn' => 'Kannada', 'ks' => 'Kashmiri', 'kr' => 'Kanuri', 'kk' => 'Kazakh', 'km' => 'Central Khmer', 'ki' => 'Kikuyu; Gikuyu', 'rw' => 'Kinyarwanda', 'ky' => 'Kirghiz; Kyrgyz',
'kv' => 'Komi', 'kg' => 'Kongo', 'ko' => 'Korean', 'kj' => 'Kuanyama; Kwanyama', 'ku' => 'Kurdish', 'lo' => 'Lao', 'la' => 'Latin', 'lv' => 'Latvian', 'li' => 'Limburgan; Limburger; Limburgish', 'ln' => 'Lingala', 'lt' => 'Lithuanian', 'lb' => 'Luxembourgish; Letzeburgesch', 'lu' => 'Luba-Katanga', 'lg' => 'Ganda', 'mk' => 'Macedonian', 'mh' => 'Marshallese', 'ml' => 'Malayalam',
'mi' => 'Maori', 'mr' => 'Marathi', 'ms' => 'Malay', 'mg' => 'Malagasy', 'mt' => 'Maltese', 'mo' => 'Moldavian', 'mn' => 'Mongolian', 'na' => 'Nauru', 'nv' => 'Navajo; Navaho', 'nr' => 'Ndebele, South; South Ndebele', 'nd' => 'Ndebele, North; North Ndebele', 'ng' => 'Ndonga', 'ne' => 'Nepali', 'nn' => 'Norwegian Nynorsk; Nynorsk, Norwegian', 'nb' => 'Bokmål, Norwegian, Norwegian Bokmål',
'no' => 'Norwegian', 'ny' => 'Chichewa; Chewa; Nyanja', 'oc' => 'Occitan, Provençal', 'oj' => 'Ojibwa', 'or' => 'Oriya', 'om' => 'Oromo', 'os' => 'Ossetian; Ossetic', 'pa' => 'Panjabi; Punjabi', 'fa' => 'Persian', 'pi' => 'Pali', 'pl' => 'Polish', 'pt' => 'Portuguese', 'ps' => 'Pushto', 'qu' => 'Quechua', 'rm' => 'Romansh', 'ro' => 'Romanian', 'rn' => 'Rundi', 'ru' => 'Russian',
'sg' => 'Sango', 'sa' => 'Sanskrit', 'sr' => 'Serbian', 'hr' => 'Croatian', 'si' => 'Sinhala; Sinhalese', 'sk' => 'Slovak', 'sl' => 'Slovenian', 'se' => 'Northern Sami', 'sm' => 'Samoan', 'sn' => 'Shona', 'sd' => 'Sindhi', 'so' => 'Somali', 'st' => 'Sotho, Southern', 'es' => 'Spanish; Castilian', 'sc' => 'Sardinian', 'ss' => 'Swati', 'su' => 'Sundanese', 'sw' => 'Swahili',
'sv' => 'Swedish', 'ty' => 'Tahitian', 'ta' => 'Tamil', 'tt' => 'Tatar', 'te' => 'Telugu', 'tg' => 'Tajik', 'tl' => 'Tagalog', 'th' => 'Thai', 'bo' => 'Tibetan', 'ti' => 'Tigrinya', 'to' => 'Tonga (Tonga Islands)', 'tn' => 'Tswana', 'ts' => 'Tsonga', 'tk' => 'Turkmen', 'tr' => 'Turkish', 'tw' => 'Twi', 'ug' => 'Uighur; Uyghur', 'uk' => 'Ukrainian', 'ur' => 'Urdu', 'uz' => 'Uzbek',
've' => 'Venda', 'vi' => 'Vietnamese', 'vo' => 'Volapük', 'cy' => 'Welsh','wa' => 'Walloon','wo' => 'Wolof', 'xh' => 'Xhosa', 'yi' => 'Yiddish', 'yo' => 'Yoruba', 'za' => 'Zhuang; Chuang', 'zu' => 'Zulu' );
$lang_codes = apply_filters( 'lang_codes', $lang_codes, $code );
return strtr( $code, $lang_codes );
}
function sync_category_tag_slugs( $term, $taxonomy ) {
if ( global_terms_enabled() && ( $taxonomy == 'category' || $taxonomy == 'post_tag' ) ) {
if ( is_object( $term ) ) {
$term->slug = sanitize_title( $term->name );
} else {
$term['slug'] = sanitize_title( $term['name'] );
}
}
return $term;
}
add_filter( 'get_term', 'sync_category_tag_slugs', 10, 2 );
function _access_denied_splash() {
if ( ! is_user_logged_in() || is_network_admin() )
return;
$blogs = get_blogs_of_user( get_current_user_id() );
if ( wp_list_filter( $blogs, array( 'userblog_id' => get_current_blog_id() ) ) )
return;
$blog_name = get_bloginfo( 'name' );
if ( empty( $blogs ) )
wp_die( sprintf( __( 'You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.' ), $blog_name ) );
$output = '<p>' . sprintf( __( 'You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.' ), $blog_name ) . '</p>';
$output .= '<p>' . __( 'If you reached this screen by accident and meant to visit one of your own sites, here are some shortcuts to help you find your way.' ) . '</p>';
$output .= '<h3>' . __('Your Sites') . '</h3>';
$output .= '<table>';
foreach ( $blogs as $blog ) {
$output .= "<tr>";
$output .= "<td valign='top'>";
$output .= "{$blog->blogname}";
$output .= "</td>";
$output .= "<td valign='top'>";
$output .= "<a href='" . esc_url( get_admin_url( $blog->userblog_id ) ) . "'>" . __( 'Visit Dashboard' ) . "</a> | <a href='" . esc_url( get_home_url( $blog->userblog_id ) ). "'>" . __( 'View Site' ) . "</a>" ;
$output .= "</td>";
$output .= "</tr>";
}
$output .= '</table>';
wp_die( $output );
}
add_action( 'admin_page_access_denied', '_access_denied_splash', 99 );
function check_import_new_users( $permission ) {
if ( !is_super_admin() )
return false;
return true;
}
add_filter( 'import_allow_create_users', 'check_import_new_users' );
// See "import_allow_fetch_attachments" and "import_attachment_size_limit" filters too.
function mu_dropdown_languages( $lang_files = array(), $current = '' ) {
$flag = false;
$output = array();
foreach ( (array) $lang_files as $val ) {
$code_lang = basename( $val, '.mo' );
if ( $code_lang == 'en_US' ) { // American English
$flag = true;
$ae = __( 'American English' );
$output[$ae] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang, false ) . '> ' . $ae . '</option>';
} elseif ( $code_lang == 'en_GB' ) { // British English
$flag = true;
$be = __( 'British English' );
$output[$be] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang, false ) . '> ' . $be . '</option>';
} else {
$translated = format_code_lang( $code_lang );
$output[$translated] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang, false ) . '> ' . esc_html ( $translated ) . '</option>';
}
}
if ( $flag === false ) // WordPress english
$output[] = '<option value=""' . selected( $current, '', false ) . '>' . __( 'English' ) . "</option>";
// Order by name
uksort( $output, 'strnatcasecmp' );
$output = apply_filters( 'mu_dropdown_languages', $output, $lang_files, $current );
echo implode( "\n\t", $output );
}
/* Warn the admin if SECRET SALT information is missing from wp-config.php */
function secret_salt_warning() {
if ( !is_super_admin() )
return;
$secret_keys = array( 'AUTH_KEY', 'SECURE_AUTH_KEY', 'LOGGED_IN_KEY', 'NONCE_KEY', 'AUTH_SALT', 'SECURE_AUTH_SALT', 'LOGGED_IN_SALT', 'NONCE_SALT' );
$out = '';
foreach( $secret_keys as $key ) {
if ( ! defined( $key ) )
$out .= "define( '$key', '" . esc_html( wp_generate_password( 64, true, true ) ) . "' );<br />";
}
if ( $out != '' ) {
$msg = __( 'Warning! WordPress encrypts user cookies, but you must add the following lines to <strong>wp-config.php</strong> for it to be more secure.' );
$msg .= '<br/>' . __( "Before the line <code>/* That's all, stop editing! Happy blogging. */</code> please add this code:" );
$msg .= "<br/><br/><code>$out</code>";
echo "<div class='update-nag'>$msg</div>";
}
}
add_action( 'network_admin_notices', 'secret_salt_warning' );
function site_admin_notice() {
global $wp_db_version;
if ( !is_super_admin() )
return false;
if ( get_site_option( 'wpmu_upgrade_site' ) != $wp_db_version )
echo "<div class='update-nag'>" . sprintf( __( 'Thank you for Updating! Please visit the <a href="%s">Update Network</a> page to update all your sites.' ), esc_url( network_admin_url( 'upgrade.php' ) ) ) . "</div>";
}
add_action( 'admin_notices', 'site_admin_notice' );
add_action( 'network_admin_notices', 'site_admin_notice' );
function avoid_blog_page_permalink_collision( $data, $postarr ) {
if ( is_subdomain_install() )
return $data;
if ( $data['post_type'] != 'page' )
return $data;
if ( !isset( $data['post_name'] ) || $data['post_name'] == '' )
return $data;
if ( !is_main_site() )
return $data;
$post_name = $data['post_name'];
$c = 0;
while( $c < 10 && get_id_from_blogname( $post_name ) ) {
$post_name .= mt_rand( 1, 10 );
$c ++;
}
if ( $post_name != $data['post_name'] ) {
$data['post_name'] = $post_name;
}
return $data;
}
add_filter( 'wp_insert_post_data', 'avoid_blog_page_permalink_collision', 10, 2 );
function choose_primary_blog() {
?>
<table class="form-table">
<tr>
<?php /* translators: My sites label */ ?>
<th scope="row"><?php _e( 'Primary Site' ); ?></th>
<td>
<?php
$all_blogs = get_blogs_of_user( get_current_user_id() );
$primary_blog = get_user_meta( get_current_user_id(), 'primary_blog', true );
if ( count( $all_blogs ) > 1 ) {
$found = false;
?>
<select name="primary_blog">
<?php foreach( (array) $all_blogs as $blog ) {
if ( $primary_blog == $blog->userblog_id )
$found = true;
?><option value="<?php echo $blog->userblog_id ?>"<?php selected( $primary_blog, $blog->userblog_id ); ?>><?php echo esc_url( get_home_url( $blog->userblog_id ) ) ?></option><?php
} ?>
</select>
<?php
if ( !$found ) {
$blog = array_shift( $all_blogs );
update_user_meta( get_current_user_id(), 'primary_blog', $blog->userblog_id );
}
} elseif ( count( $all_blogs ) == 1 ) {
$blog = array_shift( $all_blogs );
echo $blog->domain;
if ( $primary_blog != $blog->userblog_id ) // Set the primary blog again if it's out of sync with blog list.
update_user_meta( get_current_user_id(), 'primary_blog', $blog->userblog_id );
} else {
echo "N/A";
}
?>
</td>
</tr>
<?php if ( in_array( get_site_option( 'registration' ), array( 'all', 'blog' ) ) ) : ?>
<tr>
<th scope="row" colspan="2" class="th-full">
<a href="<?php echo apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) ); ?>"><?php _e( 'Create a New Site' ); ?></a>
</th>
</tr>
<?php endif; ?>
</table>
<?php
}
/**
* Grants super admin privileges.
*
* @since 3.0.0
* @param int $user_id
*/
function grant_super_admin( $user_id ) {
global $super_admins;
// If global super_admins override is defined, there is nothing to do here.
if ( isset($super_admins) )
return false;
do_action( 'grant_super_admin', $user_id );
// Directly fetch site_admins instead of using get_super_admins()
$super_admins = get_site_option( 'site_admins', array( 'admin' ) );
$user = get_userdata( $user_id );
if ( $user && ! in_array( $user->user_login, $super_admins ) ) {
$super_admins[] = $user->user_login;
update_site_option( 'site_admins' , $super_admins );
do_action( 'granted_super_admin', $user_id );
return true;
}
return false;
}
/**
* Revokes super admin privileges.
*
* @since 3.0.0
* @param int $user_id
*/
function revoke_super_admin( $user_id ) {
global $super_admins;
// If global super_admins override is defined, there is nothing to do here.
if ( isset($super_admins) )
return false;
do_action( 'revoke_super_admin', $user_id );
// Directly fetch site_admins instead of using get_super_admins()
$super_admins = get_site_option( 'site_admins', array( 'admin' ) );
$user = get_userdata( $user_id );
if ( $user && $user->user_email != get_site_option( 'admin_email' ) ) {
if ( false !== ( $key = array_search( $user->user_login, $super_admins ) ) ) {
unset( $super_admins[$key] );
update_site_option( 'site_admins', $super_admins );
do_action( 'revoked_super_admin', $user_id );
return true;
}
}
return false;
}
/**
* Whether or not we can edit this network from this page
*
* By default editing of network is restricted to the Network Admin for that site_id this allows for this to be overridden
*
* @since 3.1.0
* @param integer $site_id The network/site id to check.
*/
function can_edit_network( $site_id ) {
global $wpdb;
if ($site_id == $wpdb->siteid )
$result = true;
else
$result = false;
return apply_filters( 'can_edit_network', $result, $site_id );
}
/**
* Thickbox image paths for Network Admin.
*
* @since 3.1.0
* @access private
*/
function _thickbox_path_admin_subfolder() {
?>
<script type="text/javascript">
//<![CDATA[
var tb_pathToImage = "../../wp-includes/js/thickbox/loadingAnimation.gif";
//]]>
</script>
<?php
}
/**
* Whether or not we have a large network.
*
* The default criteria for a large network is either more than 10,000 users or more than 10,000 sites.
* Plugins can alter this criteria using the 'wp_is_large_network' filter.
*
* @since 3.3.0
* @param string $using 'sites or 'users'. Default is 'sites'.
* @return bool True if the network meets the criteria for large. False otherwise.
*/
function wp_is_large_network( $using = 'sites' ) {
if ( 'users' == $using ) {
$count = get_user_count();
return apply_filters( 'wp_is_large_network', $count > 10000, 'users', $count );
}
$count = get_blog_count();
return apply_filters( 'wp_is_large_network', $count > 10000, 'sites', $count );
}
| zyblog | trunk/zyblog/wp-admin/includes/ms.php | PHP | asf20 | 26,154 |
<?php
/**
* WordPress Plugin Administration API
*
* @package WordPress
* @subpackage Administration
*/
/**
* Parse the plugin contents to retrieve plugin's metadata.
*
* The metadata of the plugin's data searches for the following in the plugin's
* header. All plugin data must be on its own line. For plugin description, it
* must not have any newlines or only parts of the description will be displayed
* and the same goes for the plugin data. The below is formatted for printing.
*
* <code>
* /*
* Plugin Name: Name of Plugin
* Plugin URI: Link to plugin information
* Description: Plugin Description
* Author: Plugin author's name
* Author URI: Link to the author's web site
* Version: Must be set in the plugin for WordPress 2.3+
* Text Domain: Optional. Unique identifier, should be same as the one used in
* plugin_text_domain()
* Domain Path: Optional. Only useful if the translations are located in a
* folder above the plugin's base path. For example, if .mo files are
* located in the locale folder then Domain Path will be "/locale/" and
* must have the first slash. Defaults to the base folder the plugin is
* located in.
* Network: Optional. Specify "Network: true" to require that a plugin is activated
* across all sites in an installation. This will prevent a plugin from being
* activated on a single site when Multisite is enabled.
* * / # Remove the space to close comment
* </code>
*
* Plugin data returned array contains the following:
* 'Name' - Name of the plugin, must be unique.
* 'Title' - Title of the plugin and the link to the plugin's web site.
* 'Description' - Description of what the plugin does and/or notes
* from the author.
* 'Author' - The author's name
* 'AuthorURI' - The authors web site address.
* 'Version' - The plugin version number.
* 'PluginURI' - Plugin web site address.
* 'TextDomain' - Plugin's text domain for localization.
* 'DomainPath' - Plugin's relative directory path to .mo files.
* 'Network' - Boolean. Whether the plugin can only be activated network wide.
*
* Some users have issues with opening large files and manipulating the contents
* for want is usually the first 1kiB or 2kiB. This function stops pulling in
* the plugin contents when it has all of the required plugin data.
*
* The first 8kiB of the file will be pulled in and if the plugin data is not
* within that first 8kiB, then the plugin author should correct their plugin
* and move the plugin data headers to the top.
*
* The plugin file is assumed to have permissions to allow for scripts to read
* the file. This is not checked however and the file is only opened for
* reading.
*
* @link http://trac.wordpress.org/ticket/5651 Previous Optimizations.
* @link http://trac.wordpress.org/ticket/7372 Further and better Optimizations.
* @since 1.5.0
*
* @param string $plugin_file Path to the plugin file
* @param bool $markup Optional. If the returned data should have HTML markup applied. Defaults to true.
* @param bool $translate Optional. If the returned data should be translated. Defaults to true.
* @return array See above for description.
*/
function get_plugin_data( $plugin_file, $markup = true, $translate = true ) {
$default_headers = array(
'Name' => 'Plugin Name',
'PluginURI' => 'Plugin URI',
'Version' => 'Version',
'Description' => 'Description',
'Author' => 'Author',
'AuthorURI' => 'Author URI',
'TextDomain' => 'Text Domain',
'DomainPath' => 'Domain Path',
'Network' => 'Network',
// Site Wide Only is deprecated in favor of Network.
'_sitewide' => 'Site Wide Only',
);
$plugin_data = get_file_data( $plugin_file, $default_headers, 'plugin' );
// Site Wide Only is the old header for Network
if ( ! $plugin_data['Network'] && $plugin_data['_sitewide'] ) {
_deprecated_argument( __FUNCTION__, '3.0', sprintf( __( 'The <code>%1$s</code> plugin header is deprecated. Use <code>%2$s</code> instead.' ), 'Site Wide Only: true', 'Network: true' ) );
$plugin_data['Network'] = $plugin_data['_sitewide'];
}
$plugin_data['Network'] = ( 'true' == strtolower( $plugin_data['Network'] ) );
unset( $plugin_data['_sitewide'] );
if ( $markup || $translate ) {
$plugin_data = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup, $translate );
} else {
$plugin_data['Title'] = $plugin_data['Name'];
$plugin_data['AuthorName'] = $plugin_data['Author'];
}
return $plugin_data;
}
/**
* Sanitizes plugin data, optionally adds markup, optionally translates.
*
* @since 2.7.0
* @access private
* @see get_plugin_data()
*/
function _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup = true, $translate = true ) {
// Translate fields
if ( $translate ) {
if ( $textdomain = $plugin_data['TextDomain'] ) {
if ( $plugin_data['DomainPath'] )
load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) . $plugin_data['DomainPath'] );
else
load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) );
} elseif ( in_array( basename( $plugin_file ), array( 'hello.php', 'akismet.php' ) ) ) {
$textdomain = 'default';
}
if ( $textdomain ) {
foreach ( array( 'Name', 'PluginURI', 'Description', 'Author', 'AuthorURI', 'Version' ) as $field )
$plugin_data[ $field ] = translate( $plugin_data[ $field ], $textdomain );
}
}
// Sanitize fields
$allowed_tags = $allowed_tags_in_links = array(
'abbr' => array( 'title' => true ),
'acronym' => array( 'title' => true ),
'code' => true,
'em' => true,
'strong' => true,
);
$allowed_tags['a'] = array( 'href' => true, 'title' => true );
// Name is marked up inside <a> tags. Don't allow these.
// Author is too, but some plugins have used <a> here (omitting Author URI).
$plugin_data['Name'] = wp_kses( $plugin_data['Name'], $allowed_tags_in_links );
$plugin_data['Author'] = wp_kses( $plugin_data['Author'], $allowed_tags );
$plugin_data['Description'] = wp_kses( $plugin_data['Description'], $allowed_tags );
$plugin_data['Version'] = wp_kses( $plugin_data['Version'], $allowed_tags );
$plugin_data['PluginURI'] = esc_url( $plugin_data['PluginURI'] );
$plugin_data['AuthorURI'] = esc_url( $plugin_data['AuthorURI'] );
$plugin_data['Title'] = $plugin_data['Name'];
$plugin_data['AuthorName'] = $plugin_data['Author'];
// Apply markup
if ( $markup ) {
if ( $plugin_data['PluginURI'] && $plugin_data['Name'] )
$plugin_data['Title'] = '<a href="' . $plugin_data['PluginURI'] . '" title="' . esc_attr__( 'Visit plugin homepage' ) . '">' . $plugin_data['Name'] . '</a>';
if ( $plugin_data['AuthorURI'] && $plugin_data['Author'] )
$plugin_data['Author'] = '<a href="' . $plugin_data['AuthorURI'] . '" title="' . esc_attr__( 'Visit author homepage' ) . '">' . $plugin_data['Author'] . '</a>';
$plugin_data['Description'] = wptexturize( $plugin_data['Description'] );
if ( $plugin_data['Author'] )
$plugin_data['Description'] .= ' <cite>' . sprintf( __('By %s.'), $plugin_data['Author'] ) . '</cite>';
}
return $plugin_data;
}
/**
* Get a list of a plugin's files.
*
* @since 2.8.0
*
* @param string $plugin Plugin ID
* @return array List of files relative to the plugin root.
*/
function get_plugin_files($plugin) {
$plugin_file = WP_PLUGIN_DIR . '/' . $plugin;
$dir = dirname($plugin_file);
$plugin_files = array($plugin);
if ( is_dir($dir) && $dir != WP_PLUGIN_DIR ) {
$plugins_dir = @ opendir( $dir );
if ( $plugins_dir ) {
while (($file = readdir( $plugins_dir ) ) !== false ) {
if ( substr($file, 0, 1) == '.' )
continue;
if ( is_dir( $dir . '/' . $file ) ) {
$plugins_subdir = @ opendir( $dir . '/' . $file );
if ( $plugins_subdir ) {
while (($subfile = readdir( $plugins_subdir ) ) !== false ) {
if ( substr($subfile, 0, 1) == '.' )
continue;
$plugin_files[] = plugin_basename("$dir/$file/$subfile");
}
@closedir( $plugins_subdir );
}
} else {
if ( plugin_basename("$dir/$file") != $plugin )
$plugin_files[] = plugin_basename("$dir/$file");
}
}
@closedir( $plugins_dir );
}
}
return $plugin_files;
}
/**
* Check the plugins directory and retrieve all plugin files with plugin data.
*
* WordPress only supports plugin files in the base plugins directory
* (wp-content/plugins) and in one directory above the plugins directory
* (wp-content/plugins/my-plugin). The file it looks for has the plugin data and
* must be found in those two locations. It is recommended that do keep your
* plugin files in directories.
*
* The file with the plugin data is the file that will be included and therefore
* needs to have the main execution for the plugin. This does not mean
* everything must be contained in the file and it is recommended that the file
* be split for maintainability. Keep everything in one file for extreme
* optimization purposes.
*
* @since 1.5.0
*
* @param string $plugin_folder Optional. Relative path to single plugin folder.
* @return array Key is the plugin file path and the value is an array of the plugin data.
*/
function get_plugins($plugin_folder = '') {
if ( ! $cache_plugins = wp_cache_get('plugins', 'plugins') )
$cache_plugins = array();
if ( isset($cache_plugins[ $plugin_folder ]) )
return $cache_plugins[ $plugin_folder ];
$wp_plugins = array ();
$plugin_root = WP_PLUGIN_DIR;
if ( !empty($plugin_folder) )
$plugin_root .= $plugin_folder;
// Files in wp-content/plugins directory
$plugins_dir = @ opendir( $plugin_root);
$plugin_files = array();
if ( $plugins_dir ) {
while (($file = readdir( $plugins_dir ) ) !== false ) {
if ( substr($file, 0, 1) == '.' )
continue;
if ( is_dir( $plugin_root.'/'.$file ) ) {
$plugins_subdir = @ opendir( $plugin_root.'/'.$file );
if ( $plugins_subdir ) {
while (($subfile = readdir( $plugins_subdir ) ) !== false ) {
if ( substr($subfile, 0, 1) == '.' )
continue;
if ( substr($subfile, -4) == '.php' )
$plugin_files[] = "$file/$subfile";
}
closedir( $plugins_subdir );
}
} else {
if ( substr($file, -4) == '.php' )
$plugin_files[] = $file;
}
}
closedir( $plugins_dir );
}
if ( empty($plugin_files) )
return $wp_plugins;
foreach ( $plugin_files as $plugin_file ) {
if ( !is_readable( "$plugin_root/$plugin_file" ) )
continue;
$plugin_data = get_plugin_data( "$plugin_root/$plugin_file", false, false ); //Do not apply markup/translate as it'll be cached.
if ( empty ( $plugin_data['Name'] ) )
continue;
$wp_plugins[plugin_basename( $plugin_file )] = $plugin_data;
}
uasort( $wp_plugins, '_sort_uname_callback' );
$cache_plugins[ $plugin_folder ] = $wp_plugins;
wp_cache_set('plugins', $cache_plugins, 'plugins');
return $wp_plugins;
}
/**
* Check the mu-plugins directory and retrieve all mu-plugin files with any plugin data.
*
* WordPress only includes mu-plugin files in the base mu-plugins directory (wp-content/mu-plugins).
*
* @since 3.0.0
* @return array Key is the mu-plugin file path and the value is an array of the mu-plugin data.
*/
function get_mu_plugins() {
$wp_plugins = array();
// Files in wp-content/mu-plugins directory
$plugin_files = array();
if ( ! is_dir( WPMU_PLUGIN_DIR ) )
return $wp_plugins;
if ( $plugins_dir = @ opendir( WPMU_PLUGIN_DIR ) ) {
while ( ( $file = readdir( $plugins_dir ) ) !== false ) {
if ( substr( $file, -4 ) == '.php' )
$plugin_files[] = $file;
}
} else {
return $wp_plugins;
}
@closedir( $plugins_dir );
if ( empty($plugin_files) )
return $wp_plugins;
foreach ( $plugin_files as $plugin_file ) {
if ( !is_readable( WPMU_PLUGIN_DIR . "/$plugin_file" ) )
continue;
$plugin_data = get_plugin_data( WPMU_PLUGIN_DIR . "/$plugin_file", false, false ); //Do not apply markup/translate as it'll be cached.
if ( empty ( $plugin_data['Name'] ) )
$plugin_data['Name'] = $plugin_file;
$wp_plugins[ $plugin_file ] = $plugin_data;
}
if ( isset( $wp_plugins['index.php'] ) && filesize( WPMU_PLUGIN_DIR . '/index.php') <= 30 ) // silence is golden
unset( $wp_plugins['index.php'] );
uasort( $wp_plugins, '_sort_uname_callback' );
return $wp_plugins;
}
/**
* Callback to sort array by a 'Name' key.
*
* @since 3.1.0
* @access private
*/
function _sort_uname_callback( $a, $b ) {
return strnatcasecmp( $a['Name'], $b['Name'] );
}
/**
* Check the wp-content directory and retrieve all drop-ins with any plugin data.
*
* @since 3.0.0
* @return array Key is the file path and the value is an array of the plugin data.
*/
function get_dropins() {
$dropins = array();
$plugin_files = array();
$_dropins = _get_dropins();
// These exist in the wp-content directory
if ( $plugins_dir = @ opendir( WP_CONTENT_DIR ) ) {
while ( ( $file = readdir( $plugins_dir ) ) !== false ) {
if ( isset( $_dropins[ $file ] ) )
$plugin_files[] = $file;
}
} else {
return $dropins;
}
@closedir( $plugins_dir );
if ( empty($plugin_files) )
return $dropins;
foreach ( $plugin_files as $plugin_file ) {
if ( !is_readable( WP_CONTENT_DIR . "/$plugin_file" ) )
continue;
$plugin_data = get_plugin_data( WP_CONTENT_DIR . "/$plugin_file", false, false ); //Do not apply markup/translate as it'll be cached.
if ( empty( $plugin_data['Name'] ) )
$plugin_data['Name'] = $plugin_file;
$dropins[ $plugin_file ] = $plugin_data;
}
uksort( $dropins, 'strnatcasecmp' );
return $dropins;
}
/**
* Returns drop-ins that WordPress uses.
*
* Includes Multisite drop-ins only when is_multisite()
*
* @since 3.0.0
* @return array Key is file name. The value is an array, with the first value the
* purpose of the drop-in and the second value the name of the constant that must be
* true for the drop-in to be used, or true if no constant is required.
*/
function _get_dropins() {
$dropins = array(
'advanced-cache.php' => array( __( 'Advanced caching plugin.' ), 'WP_CACHE' ), // WP_CACHE
'db.php' => array( __( 'Custom database class.' ), true ), // auto on load
'db-error.php' => array( __( 'Custom database error message.' ), true ), // auto on error
'install.php' => array( __( 'Custom install script.' ), true ), // auto on install
'maintenance.php' => array( __( 'Custom maintenance message.' ), true ), // auto on maintenance
'object-cache.php' => array( __( 'External object cache.' ), true ), // auto on load
);
if ( is_multisite() ) {
$dropins['sunrise.php' ] = array( __( 'Executed before Multisite is loaded.' ), 'SUNRISE' ); // SUNRISE
$dropins['blog-deleted.php' ] = array( __( 'Custom site deleted message.' ), true ); // auto on deleted blog
$dropins['blog-inactive.php' ] = array( __( 'Custom site inactive message.' ), true ); // auto on inactive blog
$dropins['blog-suspended.php'] = array( __( 'Custom site suspended message.' ), true ); // auto on archived or spammed blog
}
return $dropins;
}
/**
* Check whether the plugin is active by checking the active_plugins list.
*
* @since 2.5.0
*
* @param string $plugin Base plugin path from plugins directory.
* @return bool True, if in the active plugins list. False, not in the list.
*/
function is_plugin_active( $plugin ) {
return in_array( $plugin, (array) get_option( 'active_plugins', array() ) ) || is_plugin_active_for_network( $plugin );
}
/**
* Check whether the plugin is inactive.
*
* Reverse of is_plugin_active(). Used as a callback.
*
* @since 3.1.0
* @see is_plugin_active()
*
* @param string $plugin Base plugin path from plugins directory.
* @return bool True if inactive. False if active.
*/
function is_plugin_inactive( $plugin ) {
return ! is_plugin_active( $plugin );
}
/**
* Check whether the plugin is active for the entire network.
*
* @since 3.0.0
*
* @param string $plugin Base plugin path from plugins directory.
* @return bool True, if active for the network, otherwise false.
*/
function is_plugin_active_for_network( $plugin ) {
if ( !is_multisite() )
return false;
$plugins = get_site_option( 'active_sitewide_plugins');
if ( isset($plugins[$plugin]) )
return true;
return false;
}
/**
* Checks for "Network: true" in the plugin header to see if this should
* be activated only as a network wide plugin. The plugin would also work
* when Multisite is not enabled.
*
* Checks for "Site Wide Only: true" for backwards compatibility.
*
* @since 3.0.0
*
* @param string $plugin Plugin to check
* @return bool True if plugin is network only, false otherwise.
*/
function is_network_only_plugin( $plugin ) {
$plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
if ( $plugin_data )
return $plugin_data['Network'];
return false;
}
/**
* Attempts activation of plugin in a "sandbox" and redirects on success.
*
* A plugin that is already activated will not attempt to be activated again.
*
* The way it works is by setting the redirection to the error before trying to
* include the plugin file. If the plugin fails, then the redirection will not
* be overwritten with the success message. Also, the options will not be
* updated and the activation hook will not be called on plugin error.
*
* It should be noted that in no way the below code will actually prevent errors
* within the file. The code should not be used elsewhere to replicate the
* "sandbox", which uses redirection to work.
* {@source 13 1}
*
* If any errors are found or text is outputted, then it will be captured to
* ensure that the success redirection will update the error redirection.
*
* @since 2.5.0
*
* @param string $plugin Plugin path to main plugin file with plugin data.
* @param string $redirect Optional. URL to redirect to.
* @param bool $network_wide Whether to enable the plugin for all sites in the
* network or just the current site. Multisite only. Default is false.
* @param bool $silent Prevent calling activation hooks. Optional, default is false.
* @return WP_Error|null WP_Error on invalid file or null on success.
*/
function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silent = false ) {
$plugin = plugin_basename( trim( $plugin ) );
if ( is_multisite() && ( $network_wide || is_network_only_plugin($plugin) ) ) {
$network_wide = true;
$current = get_site_option( 'active_sitewide_plugins', array() );
$_GET['networkwide'] = 1; // Back compat for plugins looking for this value.
} else {
$current = get_option( 'active_plugins', array() );
}
$valid = validate_plugin($plugin);
if ( is_wp_error($valid) )
return $valid;
if ( !in_array($plugin, $current) ) {
if ( !empty($redirect) )
wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect)); // we'll override this later if the plugin can be included without fatal error
ob_start();
include_once(WP_PLUGIN_DIR . '/' . $plugin);
if ( ! $silent ) {
do_action( 'activate_plugin', $plugin, $network_wide );
do_action( 'activate_' . $plugin, $network_wide );
}
if ( $network_wide ) {
$current[$plugin] = time();
update_site_option( 'active_sitewide_plugins', $current );
} else {
$current[] = $plugin;
sort($current);
update_option('active_plugins', $current);
}
if ( ! $silent ) {
do_action( 'activated_plugin', $plugin, $network_wide );
}
if ( ob_get_length() > 0 ) {
$output = ob_get_clean();
return new WP_Error('unexpected_output', __('The plugin generated unexpected output.'), $output);
}
ob_end_clean();
}
return null;
}
/**
* Deactivate a single plugin or multiple plugins.
*
* The deactivation hook is disabled by the plugin upgrader by using the $silent
* parameter.
*
* @since 2.5.0
*
* @param string|array $plugins Single plugin or list of plugins to deactivate.
* @param bool $silent Prevent calling deactivation hooks. Default is false.
* @param mixed $network_wide Whether to deactivate the plugin for all sites in the network.
* A value of null (the default) will deactivate plugins for both the site and the network.
*/
function deactivate_plugins( $plugins, $silent = false, $network_wide = null ) {
if ( is_multisite() )
$network_current = get_site_option( 'active_sitewide_plugins', array() );
$current = get_option( 'active_plugins', array() );
$do_blog = $do_network = false;
foreach ( (array) $plugins as $plugin ) {
$plugin = plugin_basename( trim( $plugin ) );
if ( ! is_plugin_active($plugin) )
continue;
$network_deactivating = false !== $network_wide && is_plugin_active_for_network( $plugin );
if ( ! $silent )
do_action( 'deactivate_plugin', $plugin, $network_deactivating );
if ( false !== $network_wide ) {
if ( is_plugin_active_for_network( $plugin ) ) {
$do_network = true;
unset( $network_current[ $plugin ] );
} elseif ( $network_wide ) {
continue;
}
}
if ( true !== $network_wide ) {
$key = array_search( $plugin, $current );
if ( false !== $key ) {
$do_blog = true;
unset( $current[ $key ] );
}
}
if ( ! $silent ) {
do_action( 'deactivate_' . $plugin, $network_deactivating );
do_action( 'deactivated_plugin', $plugin, $network_deactivating );
}
}
if ( $do_blog )
update_option('active_plugins', $current);
if ( $do_network )
update_site_option( 'active_sitewide_plugins', $network_current );
}
/**
* Activate multiple plugins.
*
* When WP_Error is returned, it does not mean that one of the plugins had
* errors. It means that one or more of the plugins file path was invalid.
*
* The execution will be halted as soon as one of the plugins has an error.
*
* @since 2.6.0
*
* @param string|array $plugins
* @param string $redirect Redirect to page after successful activation.
* @param bool $network_wide Whether to enable the plugin for all sites in the network.
* @param bool $silent Prevent calling activation hooks. Default is false.
* @return bool|WP_Error True when finished or WP_Error if there were errors during a plugin activation.
*/
function activate_plugins( $plugins, $redirect = '', $network_wide = false, $silent = false ) {
if ( !is_array($plugins) )
$plugins = array($plugins);
$errors = array();
foreach ( $plugins as $plugin ) {
if ( !empty($redirect) )
$redirect = add_query_arg('plugin', $plugin, $redirect);
$result = activate_plugin($plugin, $redirect, $network_wide, $silent);
if ( is_wp_error($result) )
$errors[$plugin] = $result;
}
if ( !empty($errors) )
return new WP_Error('plugins_invalid', __('One of the plugins is invalid.'), $errors);
return true;
}
/**
* Remove directory and files of a plugin for a single or list of plugin(s).
*
* If the plugins parameter list is empty, false will be returned. True when
* completed.
*
* @since 2.6.0
*
* @param array $plugins List of plugin
* @param string $redirect Redirect to page when complete.
* @return mixed
*/
function delete_plugins($plugins, $redirect = '' ) {
global $wp_filesystem;
if ( empty($plugins) )
return false;
$checked = array();
foreach( $plugins as $plugin )
$checked[] = 'checked[]=' . $plugin;
ob_start();
$url = wp_nonce_url('plugins.php?action=delete-selected&verify-delete=1&' . implode('&', $checked), 'bulk-plugins');
if ( false === ($credentials = request_filesystem_credentials($url)) ) {
$data = ob_get_contents();
ob_end_clean();
if ( ! empty($data) ){
include_once( ABSPATH . 'wp-admin/admin-header.php');
echo $data;
include( ABSPATH . 'wp-admin/admin-footer.php');
exit;
}
return;
}
if ( ! WP_Filesystem($credentials) ) {
request_filesystem_credentials($url, '', true); //Failed to connect, Error and request again
$data = ob_get_contents();
ob_end_clean();
if ( ! empty($data) ){
include_once( ABSPATH . 'wp-admin/admin-header.php');
echo $data;
include( ABSPATH . 'wp-admin/admin-footer.php');
exit;
}
return;
}
if ( ! is_object($wp_filesystem) )
return new WP_Error('fs_unavailable', __('Could not access filesystem.'));
if ( is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code() )
return new WP_Error('fs_error', __('Filesystem error.'), $wp_filesystem->errors);
//Get the base plugin folder
$plugins_dir = $wp_filesystem->wp_plugins_dir();
if ( empty($plugins_dir) )
return new WP_Error('fs_no_plugins_dir', __('Unable to locate WordPress Plugin directory.'));
$plugins_dir = trailingslashit( $plugins_dir );
$errors = array();
foreach( $plugins as $plugin_file ) {
// Run Uninstall hook
if ( is_uninstallable_plugin( $plugin_file ) )
uninstall_plugin($plugin_file);
$this_plugin_dir = trailingslashit( dirname($plugins_dir . $plugin_file) );
// If plugin is in its own directory, recursively delete the directory.
if ( strpos($plugin_file, '/') && $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory separator AND that its not the root plugin folder
$deleted = $wp_filesystem->delete($this_plugin_dir, true);
else
$deleted = $wp_filesystem->delete($plugins_dir . $plugin_file);
if ( ! $deleted )
$errors[] = $plugin_file;
}
if ( ! empty($errors) )
return new WP_Error('could_not_remove_plugin', sprintf(__('Could not fully remove the plugin(s) %s.'), implode(', ', $errors)) );
// Force refresh of plugin update information
if ( $current = get_site_transient('update_plugins') ) {
unset( $current->response[ $plugin_file ] );
set_site_transient('update_plugins', $current);
}
return true;
}
/**
* Validate active plugins
*
* Validate all active plugins, deactivates invalid and
* returns an array of deactivated ones.
*
* @since 2.5.0
* @return array invalid plugins, plugin as key, error as value
*/
function validate_active_plugins() {
$plugins = get_option( 'active_plugins', array() );
// validate vartype: array
if ( ! is_array( $plugins ) ) {
update_option( 'active_plugins', array() );
$plugins = array();
}
if ( is_multisite() && is_super_admin() ) {
$network_plugins = (array) get_site_option( 'active_sitewide_plugins', array() );
$plugins = array_merge( $plugins, array_keys( $network_plugins ) );
}
if ( empty( $plugins ) )
return;
$invalid = array();
// invalid plugins get deactivated
foreach ( $plugins as $plugin ) {
$result = validate_plugin( $plugin );
if ( is_wp_error( $result ) ) {
$invalid[$plugin] = $result;
deactivate_plugins( $plugin, true );
}
}
return $invalid;
}
/**
* Validate the plugin path.
*
* Checks that the file exists and {@link validate_file() is valid file}.
*
* @since 2.5.0
*
* @param string $plugin Plugin Path
* @return WP_Error|int 0 on success, WP_Error on failure.
*/
function validate_plugin($plugin) {
if ( validate_file($plugin) )
return new WP_Error('plugin_invalid', __('Invalid plugin path.'));
if ( ! file_exists(WP_PLUGIN_DIR . '/' . $plugin) )
return new WP_Error('plugin_not_found', __('Plugin file does not exist.'));
$installed_plugins = get_plugins();
if ( ! isset($installed_plugins[$plugin]) )
return new WP_Error('no_plugin_header', __('The plugin does not have a valid header.'));
return 0;
}
/**
* Whether the plugin can be uninstalled.
*
* @since 2.7.0
*
* @param string $plugin Plugin path to check.
* @return bool Whether plugin can be uninstalled.
*/
function is_uninstallable_plugin($plugin) {
$file = plugin_basename($plugin);
$uninstallable_plugins = (array) get_option('uninstall_plugins');
if ( isset( $uninstallable_plugins[$file] ) || file_exists( WP_PLUGIN_DIR . '/' . dirname($file) . '/uninstall.php' ) )
return true;
return false;
}
/**
* Uninstall a single plugin.
*
* Calls the uninstall hook, if it is available.
*
* @since 2.7.0
*
* @param string $plugin Relative plugin path from Plugin Directory.
*/
function uninstall_plugin($plugin) {
$file = plugin_basename($plugin);
$uninstallable_plugins = (array) get_option('uninstall_plugins');
if ( file_exists( WP_PLUGIN_DIR . '/' . dirname($file) . '/uninstall.php' ) ) {
if ( isset( $uninstallable_plugins[$file] ) ) {
unset($uninstallable_plugins[$file]);
update_option('uninstall_plugins', $uninstallable_plugins);
}
unset($uninstallable_plugins);
define('WP_UNINSTALL_PLUGIN', $file);
include WP_PLUGIN_DIR . '/' . dirname($file) . '/uninstall.php';
return true;
}
if ( isset( $uninstallable_plugins[$file] ) ) {
$callable = $uninstallable_plugins[$file];
unset($uninstallable_plugins[$file]);
update_option('uninstall_plugins', $uninstallable_plugins);
unset($uninstallable_plugins);
include WP_PLUGIN_DIR . '/' . $file;
add_action( 'uninstall_' . $file, $callable );
do_action( 'uninstall_' . $file );
}
}
//
// Menu
//
/**
* Add a top level menu page
*
* This function takes a capability which will be used to determine whether
* or not a page is included in the menu.
*
* The function which is hooked in to handle the output of the page must check
* that the user has the required capability as well.
*
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
* @param string $menu_title The text to be used for the menu
* @param string $capability The capability required for this menu to be displayed to the user.
* @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
* @param callback $function The function to be called to output the content for this page.
* @param string $icon_url The url to the icon to be used for this menu. Using 'none' would leave div.wp-menu-image empty
* so an icon can be added as background with CSS.
* @param int $position The position in the menu order this one should appear
*
* @return string The resulting page's hook_suffix
*/
function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '', $position = null ) {
global $menu, $admin_page_hooks, $_registered_pages, $_parent_pages;
$menu_slug = plugin_basename( $menu_slug );
$admin_page_hooks[$menu_slug] = sanitize_title( $menu_title );
$hookname = get_plugin_page_hookname( $menu_slug, '' );
if ( !empty( $function ) && !empty( $hookname ) && current_user_can( $capability ) )
add_action( $hookname, $function );
if ( empty($icon_url) ) {
$icon_url = 'none';
$icon_class = 'menu-icon-generic ';
} else {
$icon_url = set_url_scheme( $icon_url );
$icon_class = '';
}
$new_menu = array( $menu_title, $capability, $menu_slug, $page_title, 'menu-top ' . $icon_class . $hookname, $hookname, $icon_url );
if ( null === $position )
$menu[] = $new_menu;
else
$menu[$position] = $new_menu;
$_registered_pages[$hookname] = true;
// No parent as top level
$_parent_pages[$menu_slug] = false;
return $hookname;
}
/**
* Add a top level menu page in the 'objects' section
*
* This function takes a capability which will be used to determine whether
* or not a page is included in the menu.
*
* The function which is hooked in to handle the output of the page must check
* that the user has the required capability as well.
*
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
* @param string $menu_title The text to be used for the menu
* @param string $capability The capability required for this menu to be displayed to the user.
* @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
* @param callback $function The function to be called to output the content for this page.
* @param string $icon_url The url to the icon to be used for this menu
*
* @return string The resulting page's hook_suffix
*/
function add_object_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
global $_wp_last_object_menu;
$_wp_last_object_menu++;
return add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_object_menu);
}
/**
* Add a top level menu page in the 'utility' section
*
* This function takes a capability which will be used to determine whether
* or not a page is included in the menu.
*
* The function which is hooked in to handle the output of the page must check
* that the user has the required capability as well.
*
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
* @param string $menu_title The text to be used for the menu
* @param string $capability The capability required for this menu to be displayed to the user.
* @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
* @param callback $function The function to be called to output the content for this page.
* @param string $icon_url The url to the icon to be used for this menu
*
* @return string The resulting page's hook_suffix
*/
function add_utility_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
global $_wp_last_utility_menu;
$_wp_last_utility_menu++;
return add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_utility_menu);
}
/**
* Add a sub menu page
*
* This function takes a capability which will be used to determine whether
* or not a page is included in the menu.
*
* The function which is hooked in to handle the output of the page must check
* that the user has the required capability as well.
*
* @param string $parent_slug The slug name for the parent menu (or the file name of a standard WordPress admin page)
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
* @param string $menu_title The text to be used for the menu
* @param string $capability The capability required for this menu to be displayed to the user.
* @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
* @param callback $function The function to be called to output the content for this page.
*
* @return string|bool The resulting page's hook_suffix, or false if the user does not have the capability required.
*/
function add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
global $submenu;
global $menu;
global $_wp_real_parent_file;
global $_wp_submenu_nopriv;
global $_registered_pages;
global $_parent_pages;
$menu_slug = plugin_basename( $menu_slug );
$parent_slug = plugin_basename( $parent_slug);
if ( isset( $_wp_real_parent_file[$parent_slug] ) )
$parent_slug = $_wp_real_parent_file[$parent_slug];
if ( !current_user_can( $capability ) ) {
$_wp_submenu_nopriv[$parent_slug][$menu_slug] = true;
return false;
}
// If the parent doesn't already have a submenu, add a link to the parent
// as the first item in the submenu. If the submenu file is the same as the
// parent file someone is trying to link back to the parent manually. In
// this case, don't automatically add a link back to avoid duplication.
if (!isset( $submenu[$parent_slug] ) && $menu_slug != $parent_slug ) {
foreach ( (array)$menu as $parent_menu ) {
if ( $parent_menu[2] == $parent_slug && current_user_can( $parent_menu[1] ) )
$submenu[$parent_slug][] = $parent_menu;
}
}
$submenu[$parent_slug][] = array ( $menu_title, $capability, $menu_slug, $page_title );
$hookname = get_plugin_page_hookname( $menu_slug, $parent_slug);
if (!empty ( $function ) && !empty ( $hookname ))
add_action( $hookname, $function );
$_registered_pages[$hookname] = true;
// backwards-compatibility for plugins using add_management page. See wp-admin/admin.php for redirect from edit.php to tools.php
if ( 'tools.php' == $parent_slug )
$_registered_pages[get_plugin_page_hookname( $menu_slug, 'edit.php')] = true;
// No parent as top level
$_parent_pages[$menu_slug] = $parent_slug;
return $hookname;
}
/**
* Add sub menu page to the tools main menu.
*
* This function takes a capability which will be used to determine whether
* or not a page is included in the menu.
*
* The function which is hooked in to handle the output of the page must check
* that the user has the required capability as well.
*
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
* @param string $menu_title The text to be used for the menu
* @param string $capability The capability required for this menu to be displayed to the user.
* @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
* @param callback $function The function to be called to output the content for this page.
*
* @return string|bool The resulting page's hook_suffix, or false if the user does not have the capability required.
*/
function add_management_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
return add_submenu_page( 'tools.php', $page_title, $menu_title, $capability, $menu_slug, $function );
}
/**
* Add sub menu page to the options main menu.
*
* This function takes a capability which will be used to determine whether
* or not a page is included in the menu.
*
* The function which is hooked in to handle the output of the page must check
* that the user has the required capability as well.
*
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
* @param string $menu_title The text to be used for the menu
* @param string $capability The capability required for this menu to be displayed to the user.
* @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
* @param callback $function The function to be called to output the content for this page.
*
* @return string|bool The resulting page's hook_suffix, or false if the user does not have the capability required.
*/
function add_options_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
return add_submenu_page( 'options-general.php', $page_title, $menu_title, $capability, $menu_slug, $function );
}
/**
* Add sub menu page to the themes main menu.
*
* This function takes a capability which will be used to determine whether
* or not a page is included in the menu.
*
* The function which is hooked in to handle the output of the page must check
* that the user has the required capability as well.
*
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
* @param string $menu_title The text to be used for the menu
* @param string $capability The capability required for this menu to be displayed to the user.
* @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
* @param callback $function The function to be called to output the content for this page.
*
* @return string|bool The resulting page's hook_suffix, or false if the user does not have the capability required.
*/
function add_theme_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
return add_submenu_page( 'themes.php', $page_title, $menu_title, $capability, $menu_slug, $function );
}
/**
* Add sub menu page to the plugins main menu.
*
* This function takes a capability which will be used to determine whether
* or not a page is included in the menu.
*
* The function which is hooked in to handle the output of the page must check
* that the user has the required capability as well.
*
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
* @param string $menu_title The text to be used for the menu
* @param string $capability The capability required for this menu to be displayed to the user.
* @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
* @param callback $function The function to be called to output the content for this page.
*
* @return string|bool The resulting page's hook_suffix, or false if the user does not have the capability required.
*/
function add_plugins_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
return add_submenu_page( 'plugins.php', $page_title, $menu_title, $capability, $menu_slug, $function );
}
/**
* Add sub menu page to the Users/Profile main menu.
*
* This function takes a capability which will be used to determine whether
* or not a page is included in the menu.
*
* The function which is hooked in to handle the output of the page must check
* that the user has the required capability as well.
*
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
* @param string $menu_title The text to be used for the menu
* @param string $capability The capability required for this menu to be displayed to the user.
* @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
* @param callback $function The function to be called to output the content for this page.
*
* @return string|bool The resulting page's hook_suffix, or false if the user does not have the capability required.
*/
function add_users_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
if ( current_user_can('edit_users') )
$parent = 'users.php';
else
$parent = 'profile.php';
return add_submenu_page( $parent, $page_title, $menu_title, $capability, $menu_slug, $function );
}
/**
* Add sub menu page to the Dashboard main menu.
*
* This function takes a capability which will be used to determine whether
* or not a page is included in the menu.
*
* The function which is hooked in to handle the output of the page must check
* that the user has the required capability as well.
*
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
* @param string $menu_title The text to be used for the menu
* @param string $capability The capability required for this menu to be displayed to the user.
* @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
* @param callback $function The function to be called to output the content for this page.
*
* @return string|bool The resulting page's hook_suffix, or false if the user does not have the capability required.
*/
function add_dashboard_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
return add_submenu_page( 'index.php', $page_title, $menu_title, $capability, $menu_slug, $function );
}
/**
* Add sub menu page to the posts main menu.
*
* This function takes a capability which will be used to determine whether
* or not a page is included in the menu.
*
* The function which is hooked in to handle the output of the page must check
* that the user has the required capability as well.
*
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
* @param string $menu_title The text to be used for the menu
* @param string $capability The capability required for this menu to be displayed to the user.
* @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
* @param callback $function The function to be called to output the content for this page.
*
* @return string|bool The resulting page's hook_suffix, or false if the user does not have the capability required.
*/
function add_posts_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
return add_submenu_page( 'edit.php', $page_title, $menu_title, $capability, $menu_slug, $function );
}
/**
* Add sub menu page to the media main menu.
*
* This function takes a capability which will be used to determine whether
* or not a page is included in the menu.
*
* The function which is hooked in to handle the output of the page must check
* that the user has the required capability as well.
*
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
* @param string $menu_title The text to be used for the menu
* @param string $capability The capability required for this menu to be displayed to the user.
* @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
* @param callback $function The function to be called to output the content for this page.
*
* @return string|bool The resulting page's hook_suffix, or false if the user does not have the capability required.
*/
function add_media_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
return add_submenu_page( 'upload.php', $page_title, $menu_title, $capability, $menu_slug, $function );
}
/**
* Add sub menu page to the links main menu.
*
* This function takes a capability which will be used to determine whether
* or not a page is included in the menu.
*
* The function which is hooked in to handle the output of the page must check
* that the user has the required capability as well.
*
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
* @param string $menu_title The text to be used for the menu
* @param string $capability The capability required for this menu to be displayed to the user.
* @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
* @param callback $function The function to be called to output the content for this page.
*
* @return string|bool The resulting page's hook_suffix, or false if the user does not have the capability required.
*/
function add_links_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
return add_submenu_page( 'link-manager.php', $page_title, $menu_title, $capability, $menu_slug, $function );
}
/**
* Add sub menu page to the pages main menu.
*
* This function takes a capability which will be used to determine whether
* or not a page is included in the menu.
*
* The function which is hooked in to handle the output of the page must check
* that the user has the required capability as well.
*
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
* @param string $menu_title The text to be used for the menu
* @param string $capability The capability required for this menu to be displayed to the user.
* @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
* @param callback $function The function to be called to output the content for this page.
*
* @return string|bool The resulting page's hook_suffix, or false if the user does not have the capability required.
*/
function add_pages_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
return add_submenu_page( 'edit.php?post_type=page', $page_title, $menu_title, $capability, $menu_slug, $function );
}
/**
* Add sub menu page to the comments main menu.
*
* This function takes a capability which will be used to determine whether
* or not a page is included in the menu.
*
* The function which is hooked in to handle the output of the page must check
* that the user has the required capability as well.
*
* @param string $page_title The text to be displayed in the title tags of the page when the menu is selected
* @param string $menu_title The text to be used for the menu
* @param string $capability The capability required for this menu to be displayed to the user.
* @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
* @param callback $function The function to be called to output the content for this page.
*
* @return string|bool The resulting page's hook_suffix, or false if the user does not have the capability required.
*/
function add_comments_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
return add_submenu_page( 'edit-comments.php', $page_title, $menu_title, $capability, $menu_slug, $function );
}
/**
* Remove a top level admin menu
*
* @since 3.1.0
*
* @param string $menu_slug The slug of the menu
* @return array|bool The removed menu on success, False if not found
*/
function remove_menu_page( $menu_slug ) {
global $menu;
foreach ( $menu as $i => $item ) {
if ( $menu_slug == $item[2] ) {
unset( $menu[$i] );
return $item;
}
}
return false;
}
/**
* Remove an admin submenu
*
* @since 3.1.0
*
* @param string $menu_slug The slug for the parent menu
* @param string $submenu_slug The slug of the submenu
* @return array|bool The removed submenu on success, False if not found
*/
function remove_submenu_page( $menu_slug, $submenu_slug ) {
global $submenu;
if ( !isset( $submenu[$menu_slug] ) )
return false;
foreach ( $submenu[$menu_slug] as $i => $item ) {
if ( $submenu_slug == $item[2] ) {
unset( $submenu[$menu_slug][$i] );
return $item;
}
}
return false;
}
/**
* Get the url to access a particular menu page based on the slug it was registered with.
*
* If the slug hasn't been registered properly no url will be returned
*
* @since 3.0
*
* @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
* @param bool $echo Whether or not to echo the url - default is true
* @return string the url
*/
function menu_page_url($menu_slug, $echo = true) {
global $_parent_pages;
if ( isset( $_parent_pages[$menu_slug] ) ) {
$parent_slug = $_parent_pages[$menu_slug];
if ( $parent_slug && ! isset( $_parent_pages[$parent_slug] ) ) {
$url = admin_url( add_query_arg( 'page', $menu_slug, $parent_slug ) );
} else {
$url = admin_url( 'admin.php?page=' . $menu_slug );
}
} else {
$url = '';
}
$url = esc_url($url);
if ( $echo )
echo $url;
return $url;
}
//
// Pluggable Menu Support -- Private
//
function get_admin_page_parent( $parent = '' ) {
global $parent_file;
global $menu;
global $submenu;
global $pagenow;
global $typenow;
global $plugin_page;
global $_wp_real_parent_file;
global $_wp_menu_nopriv;
global $_wp_submenu_nopriv;
if ( !empty ( $parent ) && 'admin.php' != $parent ) {
if ( isset( $_wp_real_parent_file[$parent] ) )
$parent = $_wp_real_parent_file[$parent];
return $parent;
}
/*
if ( !empty ( $parent_file ) ) {
if ( isset( $_wp_real_parent_file[$parent_file] ) )
$parent_file = $_wp_real_parent_file[$parent_file];
return $parent_file;
}
*/
if ( $pagenow == 'admin.php' && isset( $plugin_page ) ) {
foreach ( (array)$menu as $parent_menu ) {
if ( $parent_menu[2] == $plugin_page ) {
$parent_file = $plugin_page;
if ( isset( $_wp_real_parent_file[$parent_file] ) )
$parent_file = $_wp_real_parent_file[$parent_file];
return $parent_file;
}
}
if ( isset( $_wp_menu_nopriv[$plugin_page] ) ) {
$parent_file = $plugin_page;
if ( isset( $_wp_real_parent_file[$parent_file] ) )
$parent_file = $_wp_real_parent_file[$parent_file];
return $parent_file;
}
}
if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$pagenow][$plugin_page] ) ) {
$parent_file = $pagenow;
if ( isset( $_wp_real_parent_file[$parent_file] ) )
$parent_file = $_wp_real_parent_file[$parent_file];
return $parent_file;
}
foreach (array_keys( (array)$submenu ) as $parent) {
foreach ( $submenu[$parent] as $submenu_array ) {
if ( isset( $_wp_real_parent_file[$parent] ) )
$parent = $_wp_real_parent_file[$parent];
if ( !empty($typenow) && ($submenu_array[2] == "$pagenow?post_type=$typenow") ) {
$parent_file = $parent;
return $parent;
} elseif ( $submenu_array[2] == $pagenow && empty($typenow) && ( empty($parent_file) || false === strpos($parent_file, '?') ) ) {
$parent_file = $parent;
return $parent;
} else
if ( isset( $plugin_page ) && ($plugin_page == $submenu_array[2] ) ) {
$parent_file = $parent;
return $parent;
}
}
}
if ( empty($parent_file) )
$parent_file = '';
return '';
}
function get_admin_page_title() {
global $title;
global $menu;
global $submenu;
global $pagenow;
global $plugin_page;
global $typenow;
if ( ! empty ( $title ) )
return $title;
$hook = get_plugin_page_hook( $plugin_page, $pagenow );
$parent = $parent1 = get_admin_page_parent();
if ( empty ( $parent) ) {
foreach ( (array)$menu as $menu_array ) {
if ( isset( $menu_array[3] ) ) {
if ( $menu_array[2] == $pagenow ) {
$title = $menu_array[3];
return $menu_array[3];
} else
if ( isset( $plugin_page ) && ($plugin_page == $menu_array[2] ) && ($hook == $menu_array[3] ) ) {
$title = $menu_array[3];
return $menu_array[3];
}
} else {
$title = $menu_array[0];
return $title;
}
}
} else {
foreach ( array_keys( $submenu ) as $parent ) {
foreach ( $submenu[$parent] as $submenu_array ) {
if ( isset( $plugin_page ) &&
( $plugin_page == $submenu_array[2] ) &&
(
( $parent == $pagenow ) ||
( $parent == $plugin_page ) ||
( $plugin_page == $hook ) ||
( $pagenow == 'admin.php' && $parent1 != $submenu_array[2] ) ||
( !empty($typenow) && $parent == $pagenow . '?post_type=' . $typenow)
)
) {
$title = $submenu_array[3];
return $submenu_array[3];
}
if ( $submenu_array[2] != $pagenow || isset( $_GET['page'] ) ) // not the current page
continue;
if ( isset( $submenu_array[3] ) ) {
$title = $submenu_array[3];
return $submenu_array[3];
} else {
$title = $submenu_array[0];
return $title;
}
}
}
if ( empty ( $title ) ) {
foreach ( $menu as $menu_array ) {
if ( isset( $plugin_page ) &&
( $plugin_page == $menu_array[2] ) &&
( $pagenow == 'admin.php' ) &&
( $parent1 == $menu_array[2] ) )
{
$title = $menu_array[3];
return $menu_array[3];
}
}
}
}
return $title;
}
function get_plugin_page_hook( $plugin_page, $parent_page ) {
$hook = get_plugin_page_hookname( $plugin_page, $parent_page );
if ( has_action($hook) )
return $hook;
else
return null;
}
function get_plugin_page_hookname( $plugin_page, $parent_page ) {
global $admin_page_hooks;
$parent = get_admin_page_parent( $parent_page );
$page_type = 'admin';
if ( empty ( $parent_page ) || 'admin.php' == $parent_page || isset( $admin_page_hooks[$plugin_page] ) ) {
if ( isset( $admin_page_hooks[$plugin_page] ) )
$page_type = 'toplevel';
else
if ( isset( $admin_page_hooks[$parent] ))
$page_type = $admin_page_hooks[$parent];
} else if ( isset( $admin_page_hooks[$parent] ) ) {
$page_type = $admin_page_hooks[$parent];
}
$plugin_name = preg_replace( '!\.php!', '', $plugin_page );
return $page_type . '_page_' . $plugin_name;
}
function user_can_access_admin_page() {
global $pagenow;
global $menu;
global $submenu;
global $_wp_menu_nopriv;
global $_wp_submenu_nopriv;
global $plugin_page;
global $_registered_pages;
$parent = get_admin_page_parent();
if ( !isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$parent][$pagenow] ) )
return false;
if ( isset( $plugin_page ) ) {
if ( isset( $_wp_submenu_nopriv[$parent][$plugin_page] ) )
return false;
$hookname = get_plugin_page_hookname($plugin_page, $parent);
if ( !isset($_registered_pages[$hookname]) )
return false;
}
if ( empty( $parent) ) {
if ( isset( $_wp_menu_nopriv[$pagenow] ) )
return false;
if ( isset( $_wp_submenu_nopriv[$pagenow][$pagenow] ) )
return false;
if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$pagenow][$plugin_page] ) )
return false;
if ( isset( $plugin_page ) && isset( $_wp_menu_nopriv[$plugin_page] ) )
return false;
foreach (array_keys( $_wp_submenu_nopriv ) as $key ) {
if ( isset( $_wp_submenu_nopriv[$key][$pagenow] ) )
return false;
if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$key][$plugin_page] ) )
return false;
}
return true;
}
if ( isset( $plugin_page ) && ( $plugin_page == $parent ) && isset( $_wp_menu_nopriv[$plugin_page] ) )
return false;
if ( isset( $submenu[$parent] ) ) {
foreach ( $submenu[$parent] as $submenu_array ) {
if ( isset( $plugin_page ) && ( $submenu_array[2] == $plugin_page ) ) {
if ( current_user_can( $submenu_array[1] ))
return true;
else
return false;
} else if ( $submenu_array[2] == $pagenow ) {
if ( current_user_can( $submenu_array[1] ))
return true;
else
return false;
}
}
}
foreach ( $menu as $menu_array ) {
if ( $menu_array[2] == $parent) {
if ( current_user_can( $menu_array[1] ))
return true;
else
return false;
}
}
return true;
}
/* Whitelist functions */
/**
* Register a setting and its sanitization callback
*
* @since 2.7.0
*
* @param string $option_group A settings group name. Should correspond to a whitelisted option key name.
* Default whitelisted option key names include "general," "discussion," and "reading," among others.
* @param string $option_name The name of an option to sanitize and save.
* @param unknown_type $sanitize_callback A callback function that sanitizes the option's value.
* @return unknown
*/
function register_setting( $option_group, $option_name, $sanitize_callback = '' ) {
global $new_whitelist_options;
if ( 'misc' == $option_group ) {
_deprecated_argument( __FUNCTION__, '3.0', sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), 'misc' ) );
$option_group = 'general';
}
if ( 'privacy' == $option_group ) {
_deprecated_argument( __FUNCTION__, '3.5', sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), 'privacy' ) );
$option_group = 'reading';
}
$new_whitelist_options[ $option_group ][] = $option_name;
if ( $sanitize_callback != '' )
add_filter( "sanitize_option_{$option_name}", $sanitize_callback );
}
/**
* Unregister a setting
*
* @since 2.7.0
*
* @param unknown_type $option_group
* @param unknown_type $option_name
* @param unknown_type $sanitize_callback
* @return unknown
*/
function unregister_setting( $option_group, $option_name, $sanitize_callback = '' ) {
global $new_whitelist_options;
if ( 'misc' == $option_group ) {
_deprecated_argument( __FUNCTION__, '3.0', sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), 'misc' ) );
$option_group = 'general';
}
if ( 'privacy' == $option_group ) {
_deprecated_argument( __FUNCTION__, '3.5', sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), 'privacy' ) );
$option_group = 'reading';
}
$pos = array_search( $option_name, (array) $new_whitelist_options );
if ( $pos !== false )
unset( $new_whitelist_options[ $option_group ][ $pos ] );
if ( $sanitize_callback != '' )
remove_filter( "sanitize_option_{$option_name}", $sanitize_callback );
}
/**
* {@internal Missing Short Description}}
*
* @since 2.7.0
*
* @param unknown_type $options
* @return unknown
*/
function option_update_filter( $options ) {
global $new_whitelist_options;
if ( is_array( $new_whitelist_options ) )
$options = add_option_whitelist( $new_whitelist_options, $options );
return $options;
}
add_filter( 'whitelist_options', 'option_update_filter' );
/**
* {@internal Missing Short Description}}
*
* @since 2.7.0
*
* @param unknown_type $new_options
* @param unknown_type $options
* @return unknown
*/
function add_option_whitelist( $new_options, $options = '' ) {
if ( $options == '' )
global $whitelist_options;
else
$whitelist_options = $options;
foreach ( $new_options as $page => $keys ) {
foreach ( $keys as $key ) {
if ( !isset($whitelist_options[ $page ]) || !is_array($whitelist_options[ $page ]) ) {
$whitelist_options[ $page ] = array();
$whitelist_options[ $page ][] = $key;
} else {
$pos = array_search( $key, $whitelist_options[ $page ] );
if ( $pos === false )
$whitelist_options[ $page ][] = $key;
}
}
}
return $whitelist_options;
}
/**
* {@internal Missing Short Description}}
*
* @since 2.7.0
*
* @param unknown_type $del_options
* @param unknown_type $options
* @return unknown
*/
function remove_option_whitelist( $del_options, $options = '' ) {
if ( $options == '' )
global $whitelist_options;
else
$whitelist_options = $options;
foreach ( $del_options as $page => $keys ) {
foreach ( $keys as $key ) {
if ( isset($whitelist_options[ $page ]) && is_array($whitelist_options[ $page ]) ) {
$pos = array_search( $key, $whitelist_options[ $page ] );
if ( $pos !== false )
unset( $whitelist_options[ $page ][ $pos ] );
}
}
}
return $whitelist_options;
}
/**
* Output nonce, action, and option_page fields for a settings page.
*
* @since 2.7.0
*
* @param string $option_group A settings group name. This should match the group name used in register_setting().
*/
function settings_fields($option_group) {
echo "<input type='hidden' name='option_page' value='" . esc_attr($option_group) . "' />";
echo '<input type="hidden" name="action" value="update" />';
wp_nonce_field("$option_group-options");
}
| zyblog | trunk/zyblog/wp-admin/includes/plugin.php | PHP | asf20 | 61,389 |
<?php
/**
* WP_Importer base class
*/
class WP_Importer {
/**
* Class Constructor
*
* @return void
*/
function __construct() {}
/**
* Returns array with imported permalinks from WordPress database
*
* @param string $bid
* @return array
*/
function get_imported_posts( $importer_name, $bid ) {
global $wpdb;
$hashtable = array();
$limit = 100;
$offset = 0;
// Grab all posts in chunks
do {
$meta_key = $importer_name . '_' . $bid . '_permalink';
$sql = $wpdb->prepare( "SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = '%s' LIMIT %d,%d", $meta_key, $offset, $limit );
$results = $wpdb->get_results( $sql );
// Increment offset
$offset = ( $limit + $offset );
if ( !empty( $results ) ) {
foreach ( $results as $r ) {
// Set permalinks into array
$hashtable[$r->meta_value] = intval( $r->post_id );
}
}
} while ( count( $results ) == $limit );
// unset to save memory
unset( $results, $r );
return $hashtable;
}
/**
* Return count of imported permalinks from WordPress database
*
* @param string $bid
* @return int
*/
function count_imported_posts( $importer_name, $bid ) {
global $wpdb;
$count = 0;
// Get count of permalinks
$meta_key = $importer_name . '_' . $bid . '_permalink';
$sql = $wpdb->prepare( "SELECT COUNT( post_id ) AS cnt FROM $wpdb->postmeta WHERE meta_key = '%s'", $meta_key );
$result = $wpdb->get_results( $sql );
if ( !empty( $result ) )
$count = intval( $result[0]->cnt );
// unset to save memory
unset( $results );
return $count;
}
/**
* Set array with imported comments from WordPress database
*
* @param string $bid
* @return array
*/
function get_imported_comments( $bid ) {
global $wpdb;
$hashtable = array();
$limit = 100;
$offset = 0;
// Grab all comments in chunks
do {
$sql = $wpdb->prepare( "SELECT comment_ID, comment_agent FROM $wpdb->comments LIMIT %d,%d", $offset, $limit );
$results = $wpdb->get_results( $sql );
// Increment offset
$offset = ( $limit + $offset );
if ( !empty( $results ) ) {
foreach ( $results as $r ) {
// Explode comment_agent key
list ( $ca_bid, $source_comment_id ) = explode( '-', $r->comment_agent );
$source_comment_id = intval( $source_comment_id );
// Check if this comment came from this blog
if ( $bid == $ca_bid ) {
$hashtable[$source_comment_id] = intval( $r->comment_ID );
}
}
}
} while ( count( $results ) == $limit );
// unset to save memory
unset( $results, $r );
return $hashtable;
}
function set_blog( $blog_id ) {
if ( is_numeric( $blog_id ) ) {
$blog_id = (int) $blog_id;
} else {
$blog = 'http://' . preg_replace( '#^https?://#', '', $blog_id );
if ( ( !$parsed = parse_url( $blog ) ) || empty( $parsed['host'] ) ) {
fwrite( STDERR, "Error: can not determine blog_id from $blog_id\n" );
exit();
}
if ( empty( $parsed['path'] ) )
$parsed['path'] = '/';
$blog = get_blog_details( array( 'domain' => $parsed['host'], 'path' => $parsed['path'] ) );
if ( !$blog ) {
fwrite( STDERR, "Error: Could not find blog\n" );
exit();
}
$blog_id = (int) $blog->blog_id;
}
if ( function_exists( 'is_multisite' ) ) {
if ( is_multisite() )
switch_to_blog( $blog_id );
}
return $blog_id;
}
function set_user( $user_id ) {
if ( is_numeric( $user_id ) ) {
$user_id = (int) $user_id;
} else {
$user_id = (int) username_exists( $user_id );
}
if ( !$user_id || !wp_set_current_user( $user_id ) ) {
fwrite( STDERR, "Error: can not find user\n" );
exit();
}
return $user_id;
}
/**
* Sort by strlen, longest string first
*
* @param string $a
* @param string $b
* @return int
*/
function cmpr_strlen( $a, $b ) {
return strlen( $b ) - strlen( $a );
}
/**
* GET URL
*
* @param string $url
* @param string $username
* @param string $password
* @param bool $head
* @return array
*/
function get_page( $url, $username = '', $password = '', $head = false ) {
// Increase the timeout
add_filter( 'http_request_timeout', array( &$this, 'bump_request_timeout' ) );
$headers = array();
$args = array();
if ( true === $head )
$args['method'] = 'HEAD';
if ( !empty( $username ) && !empty( $password ) )
$headers['Authorization'] = 'Basic ' . base64_encode( "$username:$password" );
$args['headers'] = $headers;
return wp_remote_request( $url, $args );
}
/**
* Bump up the request timeout for http requests
*
* @param int $val
* @return int
*/
function bump_request_timeout( $val ) {
return 60;
}
/**
* Check if user has exceeded disk quota
*
* @return bool
*/
function is_user_over_quota() {
if ( function_exists( 'upload_is_user_over_quota' ) ) {
if ( upload_is_user_over_quota( 1 ) ) {
echo "Sorry, you have used your upload quota.\n";
return true;
}
}
return false;
}
/**
* Replace newlines, tabs, and multiple spaces with a single space
*
* @param string $string
* @return string
*/
function min_whitespace( $string ) {
return preg_replace( '|[\r\n\t ]+|', ' ', $string );
}
/**
* Reset global variables that grow out of control during imports
*
* @return void
*/
function stop_the_insanity() {
global $wpdb, $wp_actions;
// Or define( 'WP_IMPORTING', true );
$wpdb->queries = array();
// Reset $wp_actions to keep it from growing out of control
$wp_actions = array();
}
}
/**
* Returns value of command line params.
* Exits when a required param is not set.
*
* @param string $param
* @param bool $required
* @return mixed
*/
function get_cli_args( $param, $required = false ) {
$args = $_SERVER['argv'];
$out = array();
$last_arg = null;
$return = null;
$il = sizeof( $args );
for ( $i = 1, $il; $i < $il; $i++ ) {
if ( (bool) preg_match( "/^--(.+)/", $args[$i], $match ) ) {
$parts = explode( "=", $match[1] );
$key = preg_replace( "/[^a-z0-9]+/", "", $parts[0] );
if ( isset( $parts[1] ) ) {
$out[$key] = $parts[1];
} else {
$out[$key] = true;
}
$last_arg = $key;
} else if ( (bool) preg_match( "/^-([a-zA-Z0-9]+)/", $args[$i], $match ) ) {
for ( $j = 0, $jl = strlen( $match[1] ); $j < $jl; $j++ ) {
$key = $match[1]{$j};
$out[$key] = true;
}
$last_arg = $key;
} else if ( $last_arg !== null ) {
$out[$last_arg] = $args[$i];
}
}
// Check array for specified param
if ( isset( $out[$param] ) ) {
// Set return value
$return = $out[$param];
}
// Check for missing required param
if ( !isset( $out[$param] ) && $required ) {
// Display message and exit
echo "\"$param\" parameter is required but was not specified\n";
exit();
}
return $return;
}
| zyblog | trunk/zyblog/wp-admin/includes/class-wp-importer.php | PHP | asf20 | 6,786 |
<?php
/**
* WordPress Plugin Install Administration API
*
* @package WordPress
* @subpackage Administration
*/
/**
* Retrieve plugin installer pages from WordPress Plugins API.
*
* It is possible for a plugin to override the Plugin API result with three
* filters. Assume this is for plugins, which can extend on the Plugin Info to
* offer more choices. This is very powerful and must be used with care, when
* overriding the filters.
*
* The first filter, 'plugins_api_args', is for the args and gives the action as
* the second parameter. The hook for 'plugins_api_args' must ensure that an
* object is returned.
*
* The second filter, 'plugins_api', is the result that would be returned.
*
* @since 2.7.0
*
* @param string $action
* @param array|object $args Optional. Arguments to serialize for the Plugin Info API.
* @return object plugins_api response object on success, WP_Error on failure.
*/
function plugins_api($action, $args = null) {
if ( is_array($args) )
$args = (object)$args;
if ( !isset($args->per_page) )
$args->per_page = 24;
// Allows a plugin to override the WordPress.org API entirely.
// Use the filter 'plugins_api_result' to merely add results.
// Please ensure that a object is returned from the following filters.
$args = apply_filters('plugins_api_args', $args, $action);
$res = apply_filters('plugins_api', false, $action, $args);
if ( false === $res ) {
$request = wp_remote_post('http://api.wordpress.org/plugins/info/1.0/', array( 'timeout' => 15, 'body' => array('action' => $action, 'request' => serialize($args))) );
if ( is_wp_error($request) ) {
$res = new WP_Error('plugins_api_failed', __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="http://wordpress.org/support/">support forums</a>.' ), $request->get_error_message() );
} else {
$res = maybe_unserialize( wp_remote_retrieve_body( $request ) );
if ( ! is_object( $res ) && ! is_array( $res ) )
$res = new WP_Error('plugins_api_failed', __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="http://wordpress.org/support/">support forums</a>.' ), wp_remote_retrieve_body( $request ) );
}
} elseif ( !is_wp_error($res) ) {
$res->external = true;
}
return apply_filters('plugins_api_result', $res, $action, $args);
}
/**
* Retrieve popular WordPress plugin tags.
*
* @since 2.7.0
*
* @param array $args
* @return array
*/
function install_popular_tags( $args = array() ) {
$key = md5(serialize($args));
if ( false !== ($tags = get_site_transient('poptags_' . $key) ) )
return $tags;
$tags = plugins_api('hot_tags', $args);
if ( is_wp_error($tags) )
return $tags;
set_site_transient( 'poptags_' . $key, $tags, 3 * HOUR_IN_SECONDS );
return $tags;
}
function install_dashboard() {
?>
<p><?php printf( __( 'Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="http://wordpress.org/extend/plugins/">WordPress Plugin Directory</a> or upload a plugin in .zip format via <a href="%s">this page</a>.' ), self_admin_url( 'plugin-install.php?tab=upload' ) ); ?></p>
<h4><?php _e('Search') ?></h4>
<?php install_search_form( false ); ?>
<h4><?php _e('Popular tags') ?></h4>
<p class="install-help"><?php _e('You may also browse based on the most popular tags in the Plugin Directory:') ?></p>
<?php
$api_tags = install_popular_tags();
echo '<p class="popular-tags">';
if ( is_wp_error($api_tags) ) {
echo $api_tags->get_error_message();
} else {
//Set up the tags in a way which can be interpreted by wp_generate_tag_cloud()
$tags = array();
foreach ( (array)$api_tags as $tag )
$tags[ $tag['name'] ] = (object) array(
'link' => esc_url( self_admin_url('plugin-install.php?tab=search&type=tag&s=' . urlencode($tag['name'])) ),
'name' => $tag['name'],
'id' => sanitize_title_with_dashes($tag['name']),
'count' => $tag['count'] );
echo wp_generate_tag_cloud($tags, array( 'single_text' => __('%s plugin'), 'multiple_text' => __('%s plugins') ) );
}
echo '</p><br class="clear" />';
}
add_action('install_plugins_dashboard', 'install_dashboard');
/**
* Display search form for searching plugins.
*
* @since 2.7.0
*/
function install_search_form( $type_selector = true ) {
$type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : 'term';
$term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : '';
?><form id="search-plugins" method="get" action="">
<input type="hidden" name="tab" value="search" />
<?php if ( $type_selector ) : ?>
<select name="type" id="typeselector">
<option value="term"<?php selected('term', $type) ?>><?php _e('Keyword'); ?></option>
<option value="author"<?php selected('author', $type) ?>><?php _e('Author'); ?></option>
<option value="tag"<?php selected('tag', $type) ?>><?php _ex('Tag', 'Plugin Installer'); ?></option>
</select>
<?php endif; ?>
<input type="search" name="s" value="<?php echo esc_attr($term) ?>" autofocus="autofocus" />
<label class="screen-reader-text" for="plugin-search-input"><?php _e('Search Plugins'); ?></label>
<?php submit_button( __( 'Search Plugins' ), 'button', 'plugin-search-input', false ); ?>
</form><?php
}
/**
* Upload from zip
* @since 2.8.0
*
* @param string $page
*/
function install_plugins_upload( $page = 1 ) {
?>
<h4><?php _e('Install a plugin in .zip format'); ?></h4>
<p class="install-help"><?php _e('If you have a plugin in a .zip format, you may install it by uploading it here.'); ?></p>
<form method="post" enctype="multipart/form-data" class="wp-upload-form" action="<?php echo self_admin_url('update.php?action=upload-plugin'); ?>">
<?php wp_nonce_field( 'plugin-upload'); ?>
<label class="screen-reader-text" for="pluginzip"><?php _e('Plugin zip file'); ?></label>
<input type="file" id="pluginzip" name="pluginzip" />
<?php submit_button( __( 'Install Now' ), 'button', 'install-plugin-submit', false ); ?>
</form>
<?php
}
add_action('install_plugins_upload', 'install_plugins_upload', 10, 1);
/**
* Show a username form for the favorites page
* @since 3.5.0
*
*/
function install_plugins_favorites_form() {
$user = ! empty( $_GET['user'] ) ? stripslashes( $_GET['user'] ) : get_user_option( 'wporg_favorites' );
?>
<p class="install-help"><?php _e( 'If you have marked plugins as favorites on WordPress.org, you can browse them here.' ); ?></p>
<form method="get" action="">
<input type="hidden" name="tab" value="favorites" />
<p>
<label for="user"><?php _e( 'Your WordPress.org username:' ); ?></label>
<input type="search" id="user" name="user" value="<?php echo esc_attr( $user ); ?>" />
<input type="submit" class="button" value="<?php esc_attr_e( 'Get Favorites' ); ?>" />
</p>
</form>
<?php
}
/**
* Display plugin content based on plugin list.
*
* @since 2.7.0
*/
function display_plugins_table() {
global $wp_list_table;
if ( current_filter() == 'install_plugins_favorites' && empty( $_GET['user'] ) && ! get_user_option( 'wporg_favorites' ) )
return;
$wp_list_table->display();
}
add_action( 'install_plugins_search', 'display_plugins_table' );
add_action( 'install_plugins_featured', 'display_plugins_table' );
add_action( 'install_plugins_popular', 'display_plugins_table' );
add_action( 'install_plugins_new', 'display_plugins_table' );
add_action( 'install_plugins_favorites', 'display_plugins_table' );
/**
* Determine the status we can perform on a plugin.
*
* @since 3.0.0
*/
function install_plugin_install_status($api, $loop = false) {
// this function is called recursively, $loop prevents further loops.
if ( is_array($api) )
$api = (object) $api;
//Default to a "new" plugin
$status = 'install';
$url = false;
//Check to see if this plugin is known to be installed, and has an update awaiting it.
$update_plugins = get_site_transient('update_plugins');
if ( isset( $update_plugins->response ) ) {
foreach ( (array)$update_plugins->response as $file => $plugin ) {
if ( $plugin->slug === $api->slug ) {
$status = 'update_available';
$update_file = $file;
$version = $plugin->new_version;
if ( current_user_can('update_plugins') )
$url = wp_nonce_url(self_admin_url('update.php?action=upgrade-plugin&plugin=' . $update_file), 'upgrade-plugin_' . $update_file);
break;
}
}
}
if ( 'install' == $status ) {
if ( is_dir( WP_PLUGIN_DIR . '/' . $api->slug ) ) {
$installed_plugin = get_plugins('/' . $api->slug);
if ( empty($installed_plugin) ) {
if ( current_user_can('install_plugins') )
$url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . $api->slug), 'install-plugin_' . $api->slug);
} else {
$key = array_shift( $key = array_keys($installed_plugin) ); //Use the first plugin regardless of the name, Could have issues for multiple-plugins in one directory if they share different version numbers
if ( version_compare($api->version, $installed_plugin[ $key ]['Version'], '=') ){
$status = 'latest_installed';
} elseif ( version_compare($api->version, $installed_plugin[ $key ]['Version'], '<') ) {
$status = 'newer_installed';
$version = $installed_plugin[ $key ]['Version'];
} else {
//If the above update check failed, Then that probably means that the update checker has out-of-date information, force a refresh
if ( ! $loop ) {
delete_site_transient('update_plugins');
wp_update_plugins();
return install_plugin_install_status($api, true);
}
}
}
} else {
// "install" & no directory with that slug
if ( current_user_can('install_plugins') )
$url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . $api->slug), 'install-plugin_' . $api->slug);
}
}
if ( isset($_GET['from']) )
$url .= '&from=' . urlencode(stripslashes($_GET['from']));
return compact('status', 'url', 'version');
}
/**
* Display plugin information in dialog box form.
*
* @since 2.7.0
*/
function install_plugin_information() {
global $tab;
$api = plugins_api('plugin_information', array('slug' => stripslashes( $_REQUEST['plugin'] ) ));
if ( is_wp_error($api) )
wp_die($api);
$plugins_allowedtags = array(
'a' => array( 'href' => array(), 'title' => array(), 'target' => array() ),
'abbr' => array( 'title' => array() ), 'acronym' => array( 'title' => array() ),
'code' => array(), 'pre' => array(), 'em' => array(), 'strong' => array(),
'div' => array(), 'p' => array(), 'ul' => array(), 'ol' => array(), 'li' => array(),
'h1' => array(), 'h2' => array(), 'h3' => array(), 'h4' => array(), 'h5' => array(), 'h6' => array(),
'img' => array( 'src' => array(), 'class' => array(), 'alt' => array() )
);
$plugins_section_titles = array(
'description' => _x('Description', 'Plugin installer section title'),
'installation' => _x('Installation', 'Plugin installer section title'),
'faq' => _x('FAQ', 'Plugin installer section title'),
'screenshots' => _x('Screenshots', 'Plugin installer section title'),
'changelog' => _x('Changelog', 'Plugin installer section title'),
'other_notes' => _x('Other Notes', 'Plugin installer section title')
);
//Sanitize HTML
foreach ( (array)$api->sections as $section_name => $content )
$api->sections[$section_name] = wp_kses($content, $plugins_allowedtags);
foreach ( array( 'version', 'author', 'requires', 'tested', 'homepage', 'downloaded', 'slug' ) as $key ) {
if ( isset( $api->$key ) )
$api->$key = wp_kses( $api->$key, $plugins_allowedtags );
}
$section = isset($_REQUEST['section']) ? stripslashes( $_REQUEST['section'] ) : 'description'; //Default to the Description tab, Do not translate, API returns English.
if ( empty($section) || ! isset($api->sections[ $section ]) )
$section = array_shift( $section_titles = array_keys((array)$api->sections) );
iframe_header( __('Plugin Install') );
echo "<div id='$tab-header'>\n";
echo "<ul id='sidemenu'>\n";
foreach ( (array)$api->sections as $section_name => $content ) {
if ( isset( $plugins_section_titles[ $section_name ] ) )
$title = $plugins_section_titles[ $section_name ];
else
$title = ucwords( str_replace( '_', ' ', $section_name ) );
$class = ( $section_name == $section ) ? ' class="current"' : '';
$href = add_query_arg( array('tab' => $tab, 'section' => $section_name) );
$href = esc_url($href);
$san_section = esc_attr( $section_name );
echo "\t<li><a name='$san_section' href='$href' $class>$title</a></li>\n";
}
echo "</ul>\n";
echo "</div>\n";
?>
<div class="alignright fyi">
<?php if ( ! empty($api->download_link) && ( current_user_can('install_plugins') || current_user_can('update_plugins') ) ) : ?>
<p class="action-button">
<?php
$status = install_plugin_install_status($api);
switch ( $status['status'] ) {
case 'install':
if ( $status['url'] )
echo '<a href="' . $status['url'] . '" target="_parent">' . __('Install Now') . '</a>';
break;
case 'update_available':
if ( $status['url'] )
echo '<a href="' . $status['url'] . '" target="_parent">' . __('Install Update Now') .'</a>';
break;
case 'newer_installed':
echo '<a>' . sprintf(__('Newer Version (%s) Installed'), $status['version']) . '</a>';
break;
case 'latest_installed':
echo '<a>' . __('Latest Version Installed') . '</a>';
break;
}
?>
</p>
<?php endif; ?>
<h2 class="mainheader"><?php /* translators: For Your Information */ _e('FYI') ?></h2>
<ul>
<?php if ( ! empty($api->version) ) : ?>
<li><strong><?php _e('Version:') ?></strong> <?php echo $api->version ?></li>
<?php endif; if ( ! empty($api->author) ) : ?>
<li><strong><?php _e('Author:') ?></strong> <?php echo links_add_target($api->author, '_blank') ?></li>
<?php endif; if ( ! empty($api->last_updated) ) : ?>
<li><strong><?php _e('Last Updated:') ?></strong> <span title="<?php echo $api->last_updated ?>"><?php
printf( __('%s ago'), human_time_diff(strtotime($api->last_updated)) ) ?></span></li>
<?php endif; if ( ! empty($api->requires) ) : ?>
<li><strong><?php _e('Requires WordPress Version:') ?></strong> <?php printf(__('%s or higher'), $api->requires) ?></li>
<?php endif; if ( ! empty($api->tested) ) : ?>
<li><strong><?php _e('Compatible up to:') ?></strong> <?php echo $api->tested ?></li>
<?php endif; if ( ! empty($api->downloaded) ) : ?>
<li><strong><?php _e('Downloaded:') ?></strong> <?php printf(_n('%s time', '%s times', $api->downloaded), number_format_i18n($api->downloaded)) ?></li>
<?php endif; if ( ! empty($api->slug) && empty($api->external) ) : ?>
<li><a target="_blank" href="http://wordpress.org/extend/plugins/<?php echo $api->slug ?>/"><?php _e('WordPress.org Plugin Page »') ?></a></li>
<?php endif; if ( ! empty($api->homepage) ) : ?>
<li><a target="_blank" href="<?php echo $api->homepage ?>"><?php _e('Plugin Homepage »') ?></a></li>
<?php endif; ?>
</ul>
<?php if ( ! empty($api->rating) ) : ?>
<h2><?php _e('Average Rating') ?></h2>
<div class="star-holder" title="<?php printf(_n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings)); ?>">
<div class="star star-rating" style="width: <?php echo esc_attr( str_replace( ',', '.', $api->rating ) ); ?>px"></div>
</div>
<small><?php printf(_n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings)); ?></small>
<?php endif; ?>
</div>
<div id="section-holder" class="wrap">
<?php
if ( !empty($api->tested) && version_compare( substr($GLOBALS['wp_version'], 0, strlen($api->tested)), $api->tested, '>') )
echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been tested</strong> with your current version of WordPress.') . '</p></div>';
else if ( !empty($api->requires) && version_compare( substr($GLOBALS['wp_version'], 0, strlen($api->requires)), $api->requires, '<') )
echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been marked as compatible</strong> with your version of WordPress.') . '</p></div>';
foreach ( (array)$api->sections as $section_name => $content ) {
if ( isset( $plugins_section_titles[ $section_name ] ) )
$title = $plugins_section_titles[ $section_name ];
else
$title = ucwords( str_replace( '_', ' ', $section_name ) );
$content = links_add_base_url($content, 'http://wordpress.org/extend/plugins/' . $api->slug . '/');
$content = links_add_target($content, '_blank');
$san_section = esc_attr( $section_name );
$display = ( $section_name == $section ) ? 'block' : 'none';
echo "\t<div id='section-{$san_section}' class='section' style='display: {$display};'>\n";
echo "\t\t<h2 class='long-header'>$title</h2>";
echo $content;
echo "\t</div>\n";
}
echo "</div>\n";
iframe_footer();
exit;
}
add_action('install_plugins_pre_plugin-information', 'install_plugin_information');
| zyblog | trunk/zyblog/wp-admin/includes/plugin-install.php | PHP | asf20 | 17,276 |
<?php
/**
* Themes List Table class.
*
* @package WordPress
* @subpackage List_Table
* @since 3.1.0
* @access private
*/
class WP_Themes_List_Table extends WP_List_Table {
protected $search_terms = array();
var $features = array();
function __construct( $args = array() ) {
parent::__construct( array(
'ajax' => true,
'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
) );
}
function ajax_user_can() {
// Do not check edit_theme_options here. AJAX calls for available themes require switch_themes.
return current_user_can( 'switch_themes' );
}
function prepare_items() {
$themes = wp_get_themes( array( 'allowed' => true ) );
if ( ! empty( $_REQUEST['s'] ) )
$this->search_terms = array_unique( array_filter( array_map( 'trim', explode( ',', strtolower( stripslashes( $_REQUEST['s'] ) ) ) ) ) );
if ( ! empty( $_REQUEST['features'] ) )
$this->features = $_REQUEST['features'];
if ( $this->search_terms || $this->features ) {
foreach ( $themes as $key => $theme ) {
if ( ! $this->search_theme( $theme ) )
unset( $themes[ $key ] );
}
}
unset( $themes[ get_option( 'stylesheet' ) ] );
WP_Theme::sort_by_name( $themes );
$per_page = 36;
$page = $this->get_pagenum();
$start = ( $page - 1 ) * $per_page;
$this->items = array_slice( $themes, $start, $per_page, true );
$this->set_pagination_args( array(
'total_items' => count( $themes ),
'per_page' => $per_page,
'infinite_scroll' => true,
) );
}
function no_items() {
if ( $this->search_terms || $this->features ) {
_e( 'No items found.' );
return;
}
if ( is_multisite() ) {
if ( current_user_can( 'install_themes' ) && current_user_can( 'manage_network_themes' ) ) {
printf( __( 'You only have one theme enabled for this site right now. Visit the Network Admin to <a href="%1$s">enable</a> or <a href="%2$s">install</a> more themes.' ), network_admin_url( 'site-themes.php?id=' . $GLOBALS['blog_id'] ), network_admin_url( 'theme-install.php' ) );
return;
} elseif ( current_user_can( 'manage_network_themes' ) ) {
printf( __( 'You only have one theme enabled for this site right now. Visit the Network Admin to <a href="%1$s">enable</a> more themes.' ), network_admin_url( 'site-themes.php?id=' . $GLOBALS['blog_id'] ) );
return;
}
// else, fallthrough. install_themes doesn't help if you can't enable it.
} else {
if ( current_user_can( 'install_themes' ) ) {
printf( __( 'You only have one theme installed right now. Live a little! You can choose from over 1,000 free themes in the WordPress.org Theme Directory at any time: just click on the <a href="%s">Install Themes</a> tab above.' ), admin_url( 'theme-install.php' ) );
return;
}
}
// Fallthrough.
printf( __( 'Only the current theme is available to you. Contact the %s administrator for information about accessing additional themes.' ), get_site_option( 'site_name' ) );
}
function tablenav( $which = 'top' ) {
if ( $this->get_pagination_arg( 'total_pages' ) <= 1 )
return;
?>
<div class="tablenav themes <?php echo $which; ?>">
<?php $this->pagination( $which ); ?>
<span class="spinner"></span>
<br class="clear" />
</div>
<?php
}
function display() {
wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' );
?>
<?php $this->tablenav( 'top' ); ?>
<div id="availablethemes">
<?php $this->display_rows_or_placeholder(); ?>
</div>
<?php $this->tablenav( 'bottom' ); ?>
<?php
}
function get_columns() {
return array();
}
function display_rows() {
$themes = $this->items;
foreach ( $themes as $theme ):
?><div class="available-theme"><?php
$template = $theme->get_template();
$stylesheet = $theme->get_stylesheet();
$title = $theme->display('Name');
$version = $theme->display('Version');
$author = $theme->display('Author');
$activate_link = wp_nonce_url( "themes.php?action=activate&template=" . urlencode( $template ) . "&stylesheet=" . urlencode( $stylesheet ), 'switch-theme_' . $stylesheet );
$preview_link = esc_url( add_query_arg(
array( 'preview' => 1, 'template' => urlencode( $template ), 'stylesheet' => urlencode( $stylesheet ), 'preview_iframe' => true, 'TB_iframe' => 'true' ),
home_url( '/' ) ) );
$actions = array();
$actions['activate'] = '<a href="' . $activate_link . '" class="activatelink" title="'
. esc_attr( sprintf( __( 'Activate “%s”' ), $title ) ) . '">' . __( 'Activate' ) . '</a>';
$actions['preview'] = '<a href="' . $preview_link . '" class="hide-if-customize" title="'
. esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '">' . __( 'Preview' ) . '</a>';
if ( current_user_can( 'edit_theme_options' ) )
$actions['preview'] .= '<a href="' . wp_customize_url( $stylesheet ) . '" class="load-customize hide-if-no-customize">'
. __( 'Live Preview' ) . '</a>';
if ( ! is_multisite() && current_user_can( 'delete_themes' ) )
$actions['delete'] = '<a class="submitdelete deletion" href="' . wp_nonce_url( 'themes.php?action=delete&stylesheet=' . urlencode( $stylesheet ), 'delete-theme_' . $stylesheet )
. '" onclick="' . "return confirm( '" . esc_js( sprintf( __( "You are about to delete this theme '%s'\n 'Cancel' to stop, 'OK' to delete." ), $title ) )
. "' );" . '">' . __( 'Delete' ) . '</a>';
$actions = apply_filters( 'theme_action_links', $actions, $theme );
$delete_action = isset( $actions['delete'] ) ? '<div class="delete-theme">' . $actions['delete'] . '</div>' : '';
unset( $actions['delete'] );
?>
<a href="<?php echo $preview_link; ?>" class="screenshot hide-if-customize">
<?php if ( $screenshot = $theme->get_screenshot() ) : ?>
<img src="<?php echo esc_url( $screenshot ); ?>" alt="" />
<?php endif; ?>
</a>
<a href="<?php echo wp_customize_url( $stylesheet ); ?>" class="screenshot load-customize hide-if-no-customize">
<?php if ( $screenshot = $theme->get_screenshot() ) : ?>
<img src="<?php echo esc_url( $screenshot ); ?>" alt="" />
<?php endif; ?>
</a>
<h3><?php echo $title; ?></h3>
<div class="theme-author"><?php printf( __( 'By %s' ), $author ); ?></div>
<div class="action-links">
<ul>
<?php foreach ( $actions as $action ): ?>
<li><?php echo $action; ?></li>
<?php endforeach; ?>
<li class="hide-if-no-js"><a href="#" class="theme-detail"><?php _e('Details') ?></a></li>
</ul>
<?php echo $delete_action; ?>
<?php theme_update_available( $theme ); ?>
</div>
<div class="themedetaildiv hide-if-js">
<p><strong><?php _e('Version: '); ?></strong><?php echo $version; ?></p>
<p><?php echo $theme->display('Description'); ?></p>
<?php if ( $theme->parent() ) {
printf( ' <p class="howto">' . __( 'This <a href="%1$s">child theme</a> requires its parent theme, %2$s.' ) . '</p>',
__( 'http://codex.wordpress.org/Child_Themes' ),
$theme->parent()->display( 'Name' ) );
} ?>
</div>
</div>
<?php
endforeach;
}
function search_theme( $theme ) {
// Search the features
foreach ( $this->features as $word ) {
if ( ! in_array( $word, $theme->get('Tags') ) )
return false;
}
// Match all phrases
foreach ( $this->search_terms as $word ) {
if ( in_array( $word, $theme->get('Tags') ) )
continue;
foreach ( array( 'Name', 'Description', 'Author', 'AuthorURI' ) as $header ) {
// Don't mark up; Do translate.
if ( false !== stripos( $theme->display( $header, false, true ), $word ) )
continue 2;
}
if ( false !== stripos( $theme->get_stylesheet(), $word ) )
continue;
if ( false !== stripos( $theme->get_template(), $word ) )
continue;
return false;
}
return true;
}
/**
* Send required variables to JavaScript land
*
* @since 3.4
* @access private
*
* @uses $this->features Array of all feature search terms.
* @uses get_pagenum()
* @uses _pagination_args['total_pages']
*/
function _js_vars( $extra_args = array() ) {
$search_string = isset( $_REQUEST['s'] ) ? esc_attr( stripslashes( $_REQUEST['s'] ) ) : '';
$args = array(
'search' => $search_string,
'features' => $this->features,
'paged' => $this->get_pagenum(),
'total_pages' => ! empty( $this->_pagination_args['total_pages'] ) ? $this->_pagination_args['total_pages'] : 1,
);
if ( is_array( $extra_args ) )
$args = array_merge( $args, $extra_args );
printf( "<script type='text/javascript'>var theme_list_args = %s;</script>\n", json_encode( $args ) );
parent::_js_vars();
}
}
| zyblog | trunk/zyblog/wp-admin/includes/class-wp-themes-list-table.php | PHP | asf20 | 8,660 |
<?php
/**
* Plugin Installer List Table class.
*
* @package WordPress
* @subpackage List_Table
* @since 3.1.0
* @access private
*/
class WP_Plugin_Install_List_Table extends WP_List_Table {
function ajax_user_can() {
return current_user_can('install_plugins');
}
function prepare_items() {
include( ABSPATH . 'wp-admin/includes/plugin-install.php' );
global $tabs, $tab, $paged, $type, $term;
wp_reset_vars( array( 'tab' ) );
$paged = $this->get_pagenum();
$per_page = 30;
// These are the tabs which are shown on the page
$tabs = array();
$tabs['dashboard'] = __( 'Search' );
if ( 'search' == $tab )
$tabs['search'] = __( 'Search Results' );
$tabs['upload'] = __( 'Upload' );
$tabs['featured'] = _x( 'Featured', 'Plugin Installer' );
$tabs['popular'] = _x( 'Popular', 'Plugin Installer' );
$tabs['new'] = _x( 'Newest', 'Plugin Installer' );
$tabs['favorites'] = _x( 'Favorites', 'Plugin Installer' );
$nonmenu_tabs = array( 'plugin-information' ); //Valid actions to perform which do not have a Menu item.
$tabs = apply_filters( 'install_plugins_tabs', $tabs );
$nonmenu_tabs = apply_filters( 'install_plugins_nonmenu_tabs', $nonmenu_tabs );
// If a non-valid menu tab has been selected, And its not a non-menu action.
if ( empty( $tab ) || ( !isset( $tabs[ $tab ] ) && !in_array( $tab, (array) $nonmenu_tabs ) ) )
$tab = key( $tabs );
$args = array( 'page' => $paged, 'per_page' => $per_page );
switch ( $tab ) {
case 'search':
$type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : 'term';
$term = isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '';
switch ( $type ) {
case 'tag':
$args['tag'] = sanitize_title_with_dashes( $term );
break;
case 'term':
$args['search'] = $term;
break;
case 'author':
$args['author'] = $term;
break;
}
add_action( 'install_plugins_table_header', 'install_search_form', 10, 0 );
break;
case 'featured':
case 'popular':
case 'new':
$args['browse'] = $tab;
break;
case 'favorites':
$user = isset( $_GET['user'] ) ? stripslashes( $_GET['user'] ) : get_user_option( 'wporg_favorites' );
update_user_meta( get_current_user_id(), 'wporg_favorites', $user );
if ( $user )
$args['user'] = $user;
else
$args = false;
add_action( 'install_plugins_favorites', 'install_plugins_favorites_form', 9, 0 );
break;
default:
$args = false;
}
if ( !$args )
return;
$api = plugins_api( 'query_plugins', $args );
if ( is_wp_error( $api ) )
wp_die( $api->get_error_message() . '</p> <p class="hide-if-no-js"><a href="#" onclick="document.location.reload(); return false;">' . __( 'Try again' ) . '</a>' );
$this->items = $api->plugins;
$this->set_pagination_args( array(
'total_items' => $api->info['results'],
'per_page' => $per_page,
) );
}
function no_items() {
_e( 'No plugins match your request.' );
}
function get_views() {
global $tabs, $tab;
$display_tabs = array();
foreach ( (array) $tabs as $action => $text ) {
$class = ( $action == $tab ) ? ' class="current"' : '';
$href = self_admin_url('plugin-install.php?tab=' . $action);
$display_tabs['plugin-install-'.$action] = "<a href='$href'$class>$text</a>";
}
return $display_tabs;
}
function display_tablenav( $which ) {
if ( 'top' == $which ) { ?>
<div class="tablenav top">
<div class="alignleft actions">
<?php do_action( 'install_plugins_table_header' ); ?>
</div>
<?php $this->pagination( $which ); ?>
<br class="clear" />
</div>
<?php } else { ?>
<div class="tablenav bottom">
<?php $this->pagination( $which ); ?>
<br class="clear" />
</div>
<?php
}
}
function get_table_classes() {
extract( $this->_args );
return array( 'widefat', $plural );
}
function get_columns() {
return array(
'name' => _x( 'Name', 'plugin name' ),
'version' => __( 'Version' ),
'rating' => __( 'Rating' ),
'description' => __( 'Description' ),
);
}
function display_rows() {
$plugins_allowedtags = array(
'a' => array( 'href' => array(),'title' => array(), 'target' => array() ),
'abbr' => array( 'title' => array() ),'acronym' => array( 'title' => array() ),
'code' => array(), 'pre' => array(), 'em' => array(),'strong' => array(),
'ul' => array(), 'ol' => array(), 'li' => array(), 'p' => array(), 'br' => array()
);
list( $columns, $hidden ) = $this->get_column_info();
$style = array();
foreach ( $columns as $column_name => $column_display_name ) {
$style[ $column_name ] = in_array( $column_name, $hidden ) ? 'style="display:none;"' : '';
}
foreach ( (array) $this->items as $plugin ) {
if ( is_object( $plugin ) )
$plugin = (array) $plugin;
$title = wp_kses( $plugin['name'], $plugins_allowedtags );
//Limit description to 400char, and remove any HTML.
$description = strip_tags( $plugin['description'] );
if ( strlen( $description ) > 400 )
$description = mb_substr( $description, 0, 400 ) . '…';
//remove any trailing entities
$description = preg_replace( '/&[^;\s]{0,6}$/', '', $description );
//strip leading/trailing & multiple consecutive lines
$description = trim( $description );
$description = preg_replace( "|(\r?\n)+|", "\n", $description );
//\n => <br>
$description = nl2br( $description );
$version = wp_kses( $plugin['version'], $plugins_allowedtags );
$name = strip_tags( $title . ' ' . $version );
$author = $plugin['author'];
if ( ! empty( $plugin['author'] ) )
$author = ' <cite>' . sprintf( __( 'By %s' ), $author ) . '.</cite>';
$author = wp_kses( $author, $plugins_allowedtags );
$action_links = array();
$action_links[] = '<a href="' . self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin['slug'] .
'&TB_iframe=true&width=600&height=550' ) . '" class="thickbox" title="' .
esc_attr( sprintf( __( 'More information about %s' ), $name ) ) . '">' . __( 'Details' ) . '</a>';
if ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) {
$status = install_plugin_install_status( $plugin );
switch ( $status['status'] ) {
case 'install':
if ( $status['url'] )
$action_links[] = '<a class="install-now" href="' . $status['url'] . '" title="' . esc_attr( sprintf( __( 'Install %s' ), $name ) ) . '">' . __( 'Install Now' ) . '</a>';
break;
case 'update_available':
if ( $status['url'] )
$action_links[] = '<a href="' . $status['url'] . '" title="' . esc_attr( sprintf( __( 'Update to version %s' ), $status['version'] ) ) . '">' . sprintf( __( 'Update Now' ), $status['version'] ) . '</a>';
break;
case 'latest_installed':
case 'newer_installed':
$action_links[] = '<span title="' . esc_attr__( 'This plugin is already installed and is up to date' ) . ' ">' . _x( 'Installed', 'plugin' ) . '</span>';
break;
}
}
$action_links = apply_filters( 'plugin_install_action_links', $action_links, $plugin );
?>
<tr>
<td class="name column-name"<?php echo $style['name']; ?>><strong><?php echo $title; ?></strong>
<div class="action-links"><?php if ( !empty( $action_links ) ) echo implode( ' | ', $action_links ); ?></div>
</td>
<td class="vers column-version"<?php echo $style['version']; ?>><?php echo $version; ?></td>
<td class="vers column-rating"<?php echo $style['rating']; ?>>
<div class="star-holder" title="<?php printf( _n( '(based on %s rating)', '(based on %s ratings)', $plugin['num_ratings'] ), number_format_i18n( $plugin['num_ratings'] ) ) ?>">
<div class="star star-rating" style="width: <?php echo esc_attr( str_replace( ',', '.', $plugin['rating'] ) ); ?>px"></div>
</div>
</td>
<td class="desc column-description"<?php echo $style['description']; ?>><?php echo $description, $author; ?></td>
</tr>
<?php
}
}
}
| zyblog | trunk/zyblog/wp-admin/includes/class-wp-plugin-install-list-table.php | PHP | asf20 | 8,054 |
<?php
/**
* Helper functions for displaying a list of items in an ajaxified HTML table.
*
* @package WordPress
* @subpackage List_Table
* @since 3.1.0
*/
/**
* Fetch an instance of a WP_List_Table class.
*
* @access private
* @since 3.1.0
*
* @param string $class The type of the list table, which is the class name.
* @param array $args Optional. Arguments to pass to the class. Accepts 'screen'.
* @return object|bool Object on success, false if the class does not exist.
*/
function _get_list_table( $class, $args = array() ) {
$core_classes = array(
//Site Admin
'WP_Posts_List_Table' => 'posts',
'WP_Media_List_Table' => 'media',
'WP_Terms_List_Table' => 'terms',
'WP_Users_List_Table' => 'users',
'WP_Comments_List_Table' => 'comments',
'WP_Post_Comments_List_Table' => 'comments',
'WP_Links_List_Table' => 'links',
'WP_Plugin_Install_List_Table' => 'plugin-install',
'WP_Themes_List_Table' => 'themes',
'WP_Theme_Install_List_Table' => array( 'themes', 'theme-install' ),
'WP_Plugins_List_Table' => 'plugins',
// Network Admin
'WP_MS_Sites_List_Table' => 'ms-sites',
'WP_MS_Users_List_Table' => 'ms-users',
'WP_MS_Themes_List_Table' => 'ms-themes',
);
if ( isset( $core_classes[ $class ] ) ) {
foreach ( (array) $core_classes[ $class ] as $required )
require_once( ABSPATH . 'wp-admin/includes/class-wp-' . $required . '-list-table.php' );
if ( isset( $args['screen'] ) )
$args['screen'] = convert_to_screen( $args['screen'] );
elseif ( isset( $GLOBALS['hook_suffix'] ) )
$args['screen'] = get_current_screen();
else
$args['screen'] = null;
return new $class( $args );
}
return false;
}
/**
* Register column headers for a particular screen.
*
* @since 2.7.0
*
* @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions.
* @param array $columns An array of columns with column IDs as the keys and translated column names as the values
* @see get_column_headers(), print_column_headers(), get_hidden_columns()
*/
function register_column_headers($screen, $columns) {
$wp_list_table = new _WP_List_Table_Compat($screen, $columns);
}
/**
* Prints column headers for a particular screen.
*
* @since 2.7.0
*/
function print_column_headers($screen, $id = true) {
$wp_list_table = new _WP_List_Table_Compat($screen);
$wp_list_table->print_column_headers($id);
}
/**
* Helper class to be used only by back compat functions
*
* @since 3.1.0
*/
class _WP_List_Table_Compat extends WP_List_Table {
var $_screen;
var $_columns;
function _WP_List_Table_Compat( $screen, $columns = array() ) {
if ( is_string( $screen ) )
$screen = convert_to_screen( $screen );
$this->_screen = $screen;
if ( !empty( $columns ) ) {
$this->_columns = $columns;
add_filter( 'manage_' . $screen->id . '_columns', array( &$this, 'get_columns' ), 0 );
}
}
function get_column_info() {
$columns = get_column_headers( $this->_screen );
$hidden = get_hidden_columns( $this->_screen );
$sortable = array();
return array( $columns, $hidden, $sortable );
}
function get_columns() {
return $this->_columns;
}
}
| zyblog | trunk/zyblog/wp-admin/includes/list-table.php | PHP | asf20 | 3,195 |
<?php
/**
* Sites List Table class.
*
* @package WordPress
* @subpackage List_Table
* @since 3.1.0
* @access private
*/
class WP_MS_Sites_List_Table extends WP_List_Table {
function __construct( $args = array() ) {
parent::__construct( array(
'plural' => 'sites',
'screen' => isset( $args['screen'] ) ? $args['screen'] : null,
) );
}
function ajax_user_can() {
return current_user_can( 'manage_sites' );
}
function prepare_items() {
global $s, $mode, $wpdb, $current_site;
$mode = ( empty( $_REQUEST['mode'] ) ) ? 'list' : $_REQUEST['mode'];
$per_page = $this->get_items_per_page( 'sites_network_per_page' );
$pagenum = $this->get_pagenum();
$s = isset( $_REQUEST['s'] ) ? stripslashes( trim( $_REQUEST[ 's' ] ) ) : '';
$wild = '';
if ( false !== strpos($s, '*') ) {
$wild = '%';
$s = trim($s, '*');
}
$like_s = esc_sql( like_escape( $s ) );
// If the network is large and a search is not being performed, show only the latest blogs with no paging in order
// to avoid expensive count queries.
if ( !$s && wp_is_large_network() ) {
if ( !isset($_REQUEST['orderby']) )
$_GET['orderby'] = $_REQUEST['orderby'] = '';
if ( !isset($_REQUEST['order']) )
$_GET['order'] = $_REQUEST['order'] = 'DESC';
}
$query = "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' ";
if ( empty($s) ) {
// Nothing to do.
} elseif ( preg_match( '/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/', $s ) ||
preg_match( '/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.?$/', $s ) ||
preg_match( '/^[0-9]{1,3}\.[0-9]{1,3}\.?$/', $s ) ||
preg_match( '/^[0-9]{1,3}\.$/', $s ) ) {
// IPv4 address
$reg_blog_ids = $wpdb->get_col( "SELECT blog_id FROM {$wpdb->registration_log} WHERE {$wpdb->registration_log}.IP LIKE ( '{$like_s}$wild' )" );
if ( !$reg_blog_ids )
$reg_blog_ids = array( 0 );
$query = "SELECT *
FROM {$wpdb->blogs}
WHERE site_id = '{$wpdb->siteid}'
AND {$wpdb->blogs}.blog_id IN (" . implode( ', ', $reg_blog_ids ) . ")";
} else {
if ( is_numeric($s) && empty( $wild ) ) {
$query .= " AND ( {$wpdb->blogs}.blog_id = '{$like_s}' )";
} elseif ( is_subdomain_install() ) {
$blog_s = str_replace( '.' . $current_site->domain, '', $like_s );
$blog_s .= $wild . '.' . $current_site->domain;
$query .= " AND ( {$wpdb->blogs}.domain LIKE '$blog_s' ) ";
} else {
if ( $like_s != trim('/', $current_site->path) )
$blog_s = $current_site->path . $like_s . $wild . '/';
else
$blog_s = $like_s;
$query .= " AND ( {$wpdb->blogs}.path LIKE '$blog_s' )";
}
}
$order_by = isset( $_REQUEST['orderby'] ) ? $_REQUEST['orderby'] : '';
if ( $order_by == 'registered' ) {
$query .= ' ORDER BY registered ';
} elseif ( $order_by == 'lastupdated' ) {
$query .= ' ORDER BY last_updated ';
} elseif ( $order_by == 'blogname' ) {
if ( is_subdomain_install() )
$query .= ' ORDER BY domain ';
else
$query .= ' ORDER BY path ';
} elseif ( $order_by == 'blog_id' ) {
$query .= ' ORDER BY blog_id ';
} else {
$order_by = null;
}
if ( isset( $order_by ) ) {
$order = ( isset( $_REQUEST['order'] ) && 'DESC' == strtoupper( $_REQUEST['order'] ) ) ? "DESC" : "ASC";
$query .= $order;
}
// Don't do an unbounded count on large networks
if ( ! wp_is_large_network() )
$total = $wpdb->get_var( str_replace( 'SELECT *', 'SELECT COUNT( blog_id )', $query ) );
$query .= " LIMIT " . intval( ( $pagenum - 1 ) * $per_page ) . ", " . intval( $per_page );
$this->items = $wpdb->get_results( $query, ARRAY_A );
if ( wp_is_large_network() )
$total = count($this->items);
$this->set_pagination_args( array(
'total_items' => $total,
'per_page' => $per_page,
) );
}
function no_items() {
_e( 'No sites found.' );
}
function get_bulk_actions() {
$actions = array();
if ( current_user_can( 'delete_sites' ) )
$actions['delete'] = __( 'Delete' );
$actions['spam'] = _x( 'Mark as Spam', 'site' );
$actions['notspam'] = _x( 'Not Spam', 'site' );
return $actions;
}
function pagination( $which ) {
global $mode;
parent::pagination( $which );
if ( 'top' == $which )
$this->view_switcher( $mode );
}
function get_columns() {
$blogname_columns = ( is_subdomain_install() ) ? __( 'Domain' ) : __( 'Path' );
$sites_columns = array(
'cb' => '<input type="checkbox" />',
'blogname' => $blogname_columns,
'lastupdated' => __( 'Last Updated' ),
'registered' => _x( 'Registered', 'site' ),
'users' => __( 'Users' )
);
if ( has_filter( 'wpmublogsaction' ) )
$sites_columns['plugins'] = __( 'Actions' );
$sites_columns = apply_filters( 'wpmu_blogs_columns', $sites_columns );
return $sites_columns;
}
function get_sortable_columns() {
return array(
'blogname' => 'blogname',
'lastupdated' => 'lastupdated',
'registered' => 'blog_id',
);
}
function display_rows() {
global $current_site, $mode;
$status_list = array(
'archived' => array( 'site-archived', __( 'Archived' ) ),
'spam' => array( 'site-spammed', _x( 'Spam', 'site' ) ),
'deleted' => array( 'site-deleted', __( 'Deleted' ) ),
'mature' => array( 'site-mature', __( 'Mature' ) )
);
$class = '';
foreach ( $this->items as $blog ) {
$class = ( 'alternate' == $class ) ? '' : 'alternate';
reset( $status_list );
$blog_states = array();
foreach ( $status_list as $status => $col ) {
if ( get_blog_status( $blog['blog_id'], $status ) == 1 ) {
$class = $col[0];
$blog_states[] = $col[1];
}
}
$blog_state = '';
if ( ! empty( $blog_states ) ) {
$state_count = count( $blog_states );
$i = 0;
$blog_state .= ' - ';
foreach ( $blog_states as $state ) {
++$i;
( $i == $state_count ) ? $sep = '' : $sep = ', ';
$blog_state .= "<span class='post-state'>$state$sep</span>";
}
}
echo "<tr class='$class'>";
$blogname = ( is_subdomain_install() ) ? str_replace( '.'.$current_site->domain, '', $blog['domain'] ) : $blog['path'];
list( $columns, $hidden ) = $this->get_column_info();
foreach ( $columns as $column_name => $column_display_name ) {
$style = '';
if ( in_array( $column_name, $hidden ) )
$style = ' style="display:none;"';
switch ( $column_name ) {
case 'cb': ?>
<th scope="row" class="check-column">
<label class="screen-reader-text" for="blog_<?php echo $blog['blog_id']; ?>"><?php printf( __( 'Select %s' ), $blogname ); ?></label>
<input type="checkbox" id="blog_<?php echo $blog['blog_id'] ?>" name="allblogs[]" value="<?php echo esc_attr( $blog['blog_id'] ) ?>" />
</th>
<?php
break;
case 'id':?>
<th valign="top" scope="row">
<?php echo $blog['blog_id'] ?>
</th>
<?php
break;
case 'blogname':
echo "<td class='column-$column_name $column_name'$style>"; ?>
<a href="<?php echo esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ); ?>" class="edit"><?php echo $blogname . $blog_state; ?></a>
<?php
if ( 'list' != $mode ) {
switch_to_blog( $blog['blog_id'] );
echo '<p>' . sprintf( _x( '%1$s – <em>%2$s</em>', '%1$s: site name. %2$s: site tagline.' ), get_option( 'blogname' ), get_option( 'blogdescription ' ) ) . '</p>';
restore_current_blog();
}
// Preordered.
$actions = array(
'edit' => '', 'backend' => '',
'activate' => '', 'deactivate' => '',
'archive' => '', 'unarchive' => '',
'spam' => '', 'unspam' => '',
'delete' => '',
'visit' => '',
);
$actions['edit'] = '<span class="edit"><a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a></span>';
$actions['backend'] = "<span class='backend'><a href='" . esc_url( get_admin_url( $blog['blog_id'] ) ) . "' class='edit'>" . __( 'Dashboard' ) . '</a></span>';
if ( $current_site->blog_id != $blog['blog_id'] ) {
if ( get_blog_status( $blog['blog_id'], 'deleted' ) == '1' )
$actions['activate'] = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=activateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to activate the site %s' ), $blogname ) ) ), 'confirm' ) ) . '">' . __( 'Activate' ) . '</a></span>';
else
$actions['deactivate'] = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=deactivateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to deactivate the site %s' ), $blogname ) ) ), 'confirm') ) . '">' . __( 'Deactivate' ) . '</a></span>';
if ( get_blog_status( $blog['blog_id'], 'archived' ) == '1' )
$actions['unarchive'] = '<span class="archive"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=unarchiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to unarchive the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . __( 'Unarchive' ) . '</a></span>';
else
$actions['archive'] = '<span class="archive"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=archiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to archive the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . _x( 'Archive', 'verb; site' ) . '</a></span>';
if ( get_blog_status( $blog['blog_id'], 'spam' ) == '1' )
$actions['unspam'] = '<span class="spam"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=unspamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to unspam the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . _x( 'Not Spam', 'site' ) . '</a></span>';
else
$actions['spam'] = '<span class="spam"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=spamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to mark the site %s as spam.' ), $blogname ) ) ), 'confirm') ) . '">' . _x( 'Spam', 'site' ) . '</a></span>';
if ( current_user_can( 'delete_site', $blog['blog_id'] ) )
$actions['delete'] = '<span class="delete"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=deleteblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to delete the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . __( 'Delete' ) . '</a></span>';
}
$actions['visit'] = "<span class='view'><a href='" . esc_url( get_home_url( $blog['blog_id'], '/' ) ) . "' rel='permalink'>" . __( 'Visit' ) . '</a></span>';
$actions = apply_filters( 'manage_sites_action_links', array_filter( $actions ), $blog['blog_id'], $blogname );
echo $this->row_actions( $actions );
?>
</td>
<?php
break;
case 'lastupdated':
echo "<td valign='top' class='$column_name column-$column_name'$style>";
if ( 'list' == $mode )
$date = 'Y/m/d';
else
$date = 'Y/m/d \<\b\r \/\> g:i:s a';
echo ( $blog['last_updated'] == '0000-00-00 00:00:00' ) ? __( 'Never' ) : mysql2date( $date, $blog['last_updated'] ); ?>
</td>
<?php
break;
case 'registered':
echo "<td valign='top' class='$column_name column-$column_name'$style>";
if ( $blog['registered'] == '0000-00-00 00:00:00' )
echo '—';
else
echo mysql2date( $date, $blog['registered'] );
?>
</td>
<?php
break;
case 'users':
echo "<td valign='top' class='$column_name column-$column_name'$style>";
$blogusers = get_users( array( 'blog_id' => $blog['blog_id'], 'number' => 6) );
if ( is_array( $blogusers ) ) {
$blogusers_warning = '';
if ( count( $blogusers ) > 5 ) {
$blogusers = array_slice( $blogusers, 0, 5 );
$blogusers_warning = __( 'Only showing first 5 users.' ) . ' <a href="' . esc_url( network_admin_url( 'site-users.php?id=' . $blog['blog_id'] ) ) . '">' . __( 'More' ) . '</a>';
}
foreach ( $blogusers as $user_object ) {
echo '<a href="' . esc_url( network_admin_url( 'user-edit.php?user_id=' . $user_object->ID ) ) . '">' . esc_html( $user_object->user_login ) . '</a> ';
if ( 'list' != $mode )
echo '( ' . $user_object->user_email . ' )';
echo '<br />';
}
if ( $blogusers_warning != '' )
echo '<strong>' . $blogusers_warning . '</strong><br />';
}
?>
</td>
<?php
break;
case 'plugins': ?>
<?php if ( has_filter( 'wpmublogsaction' ) ) {
echo "<td valign='top' class='$column_name column-$column_name'$style>";
do_action( 'wpmublogsaction', $blog['blog_id'] ); ?>
</td>
<?php }
break;
default:
echo "<td class='$column_name column-$column_name'$style>";
do_action( 'manage_sites_custom_column', $column_name, $blog['blog_id'] );
echo "</td>";
break;
}
}
?>
</tr>
<?php
}
}
}
| zyblog | trunk/zyblog/wp-admin/includes/class-wp-ms-sites-list-table.php | PHP | asf20 | 13,407 |
<?php
/**
* Theme Installer List Table class.
*
* @package WordPress
* @subpackage List_Table
* @since 3.1.0
* @access private
*/
class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
var $features = array();
function ajax_user_can() {
return current_user_can( 'install_themes' );
}
function prepare_items() {
include( ABSPATH . 'wp-admin/includes/theme-install.php' );
global $tabs, $tab, $paged, $type, $theme_field_defaults;
wp_reset_vars( array( 'tab' ) );
$search_terms = array();
$search_string = '';
if ( ! empty( $_REQUEST['s'] ) ){
$search_string = strtolower( stripslashes( $_REQUEST['s'] ) );
$search_terms = array_unique( array_filter( array_map( 'trim', explode( ',', $search_string ) ) ) );
}
if ( ! empty( $_REQUEST['features'] ) )
$this->features = $_REQUEST['features'];
$paged = $this->get_pagenum();
$per_page = 36;
// These are the tabs which are shown on the page,
$tabs = array();
$tabs['dashboard'] = __( 'Search' );
if ( 'search' == $tab )
$tabs['search'] = __( 'Search Results' );
$tabs['upload'] = __( 'Upload' );
$tabs['featured'] = _x( 'Featured','Theme Installer' );
//$tabs['popular'] = _x( 'Popular','Theme Installer' );
$tabs['new'] = _x( 'Newest','Theme Installer' );
$tabs['updated'] = _x( 'Recently Updated','Theme Installer' );
$nonmenu_tabs = array( 'theme-information' ); // Valid actions to perform which do not have a Menu item.
$tabs = apply_filters( 'install_themes_tabs', $tabs );
$nonmenu_tabs = apply_filters( 'install_themes_nonmenu_tabs', $nonmenu_tabs );
// If a non-valid menu tab has been selected, And its not a non-menu action.
if ( empty( $tab ) || ( ! isset( $tabs[ $tab ] ) && ! in_array( $tab, (array) $nonmenu_tabs ) ) )
$tab = key( $tabs );
$args = array( 'page' => $paged, 'per_page' => $per_page, 'fields' => $theme_field_defaults );
switch ( $tab ) {
case 'search':
$type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : 'term';
switch ( $type ) {
case 'tag':
$args['tag'] = array_map( 'sanitize_key', $search_terms );
break;
case 'term':
$args['search'] = $search_string;
break;
case 'author':
$args['author'] = $search_string;
break;
}
if ( ! empty( $this->features ) ) {
$args['tag'] = $this->features;
$_REQUEST['s'] = implode( ',', $this->features );
$_REQUEST['type'] = 'tag';
}
add_action( 'install_themes_table_header', 'install_theme_search_form', 10, 0 );
break;
case 'featured':
//case 'popular':
case 'new':
case 'updated':
$args['browse'] = $tab;
break;
default:
$args = false;
}
if ( ! $args )
return;
$api = themes_api( 'query_themes', $args );
if ( is_wp_error( $api ) )
wp_die( $api->get_error_message() . '</p> <p><a href="#" onclick="document.location.reload(); return false;">' . __( 'Try again' ) . '</a>' );
$this->items = $api->themes;
$this->set_pagination_args( array(
'total_items' => $api->info['results'],
'per_page' => $per_page,
'infinite_scroll' => true,
) );
}
function no_items() {
_e( 'No themes match your request.' );
}
function get_views() {
global $tabs, $tab;
$display_tabs = array();
foreach ( (array) $tabs as $action => $text ) {
$class = ( $action == $tab ) ? ' class="current"' : '';
$href = self_admin_url('theme-install.php?tab=' . $action);
$display_tabs['theme-install-'.$action] = "<a href='$href'$class>$text</a>";
}
return $display_tabs;
}
function display() {
wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' );
?>
<div class="tablenav top themes">
<div class="alignleft actions">
<?php do_action( 'install_themes_table_header' ); ?>
</div>
<?php $this->pagination( 'top' ); ?>
<br class="clear" />
</div>
<div id="availablethemes">
<?php $this->display_rows_or_placeholder(); ?>
</div>
<?php
parent::tablenav( 'bottom' );
}
function display_rows() {
$themes = $this->items;
foreach ( $themes as $theme ) {
?>
<div class="available-theme installable-theme"><?php
$this->single_row( $theme );
?></div>
<?php } // end foreach $theme_names
$this->theme_installer();
}
/*
* Prints a theme from the WordPress.org API.
*
* @param object $theme An object that contains theme data returned by the WordPress.org API.
*
* Example theme data:
* object(stdClass)[59]
* public 'name' => string 'Magazine Basic' (length=14)
* public 'slug' => string 'magazine-basic' (length=14)
* public 'version' => string '1.1' (length=3)
* public 'author' => string 'tinkerpriest' (length=12)
* public 'preview_url' => string 'http://wp-themes.com/?magazine-basic' (length=36)
* public 'screenshot_url' => string 'http://wp-themes.com/wp-content/themes/magazine-basic/screenshot.png' (length=68)
* public 'rating' => float 80
* public 'num_ratings' => int 1
* public 'homepage' => string 'http://wordpress.org/extend/themes/magazine-basic' (length=49)
* public 'description' => string 'A basic magazine style layout with a fully customizable layout through a backend interface. Designed by <a href="http://bavotasan.com">c.bavota</a> of <a href="http://tinkerpriestmedia.com">Tinker Priest Media</a>.' (length=214)
* public 'download_link' => string 'http://wordpress.org/extend/themes/download/magazine-basic.1.1.zip' (length=66)
*/
function single_row( $theme ) {
global $themes_allowedtags;
if ( empty( $theme ) )
return;
$name = wp_kses( $theme->name, $themes_allowedtags );
$author = wp_kses( $theme->author, $themes_allowedtags );
$preview_title = sprintf( __('Preview “%s”'), $name );
$preview_url = add_query_arg( array(
'tab' => 'theme-information',
'theme' => $theme->slug,
) );
$actions = array();
$install_url = add_query_arg( array(
'action' => 'install-theme',
'theme' => $theme->slug,
), self_admin_url( 'update.php' ) );
$update_url = add_query_arg( array(
'action' => 'upgrade-theme',
'theme' => $theme->slug,
), self_admin_url( 'update.php' ) );
$status = $this->_get_theme_status( $theme );
switch ( $status ) {
default:
case 'install':
$actions[] = '<a class="install-now" href="' . esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ) . '" title="' . esc_attr( sprintf( __( 'Install %s' ), $name ) ) . '">' . __( 'Install Now' ) . '</a>';
break;
case 'update_available':
$actions[] = '<a class="install-now" href="' . esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ) . '" title="' . esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ) . '">' . __( 'Update' ) . '</a>';
break;
case 'newer_installed':
case 'latest_installed':
$actions[] = '<span class="install-now" title="' . esc_attr__( 'This theme is already installed and is up to date' ) . '">' . _x( 'Installed', 'theme' ) . '</span>';
break;
}
$actions[] = '<a class="install-theme-preview" href="' . esc_url( $preview_url ) . '" title="' . esc_attr( sprintf( __( 'Preview %s' ), $name ) ) . '">' . __( 'Preview' ) . '</a>';
$actions = apply_filters( 'theme_install_actions', $actions, $theme );
?>
<a class="screenshot install-theme-preview" href="<?php echo esc_url( $preview_url ); ?>" title="<?php echo esc_attr( $preview_title ); ?>">
<img src='<?php echo esc_url( $theme->screenshot_url ); ?>' width='150' />
</a>
<h3><?php echo $name; ?></h3>
<div class="theme-author"><?php printf( __( 'By %s' ), $author ); ?></div>
<div class="action-links">
<ul>
<?php foreach ( $actions as $action ): ?>
<li><?php echo $action; ?></li>
<?php endforeach; ?>
<li class="hide-if-no-js"><a href="#" class="theme-detail"><?php _e('Details') ?></a></li>
</ul>
</div>
<?php
$this->install_theme_info( $theme );
}
/*
* Prints the wrapper for the theme installer.
*/
function theme_installer() {
?>
<div id="theme-installer" class="wp-full-overlay expanded">
<div class="wp-full-overlay-sidebar">
<div class="wp-full-overlay-header">
<a href="#" class="close-full-overlay"><?php _e( '← Close' ); ?></a>
</div>
<div class="wp-full-overlay-sidebar-content">
<div class="install-theme-info"></div>
</div>
<div class="wp-full-overlay-footer">
<a href="#" class="collapse-sidebar button-secondary" title="<?php esc_attr_e('Collapse Sidebar'); ?>">
<span class="collapse-sidebar-label"><?php _e('Collapse'); ?></span>
<span class="collapse-sidebar-arrow"></span>
</a>
</div>
</div>
<div class="wp-full-overlay-main"></div>
</div>
<?php
}
/*
* Prints the wrapper for the theme installer with a provided theme's data.
* Used to make the theme installer work for no-js.
*
* @param object $theme - A WordPress.org Theme API object.
*/
function theme_installer_single( $theme ) {
?>
<div id="theme-installer" class="wp-full-overlay single-theme">
<div class="wp-full-overlay-sidebar">
<?php $this->install_theme_info( $theme ); ?>
</div>
<div class="wp-full-overlay-main">
<iframe src="<?php echo esc_url( $theme->preview_url ); ?>"></iframe>
</div>
</div>
<?php
}
/*
* Prints the info for a theme (to be used in the theme installer modal).
*
* @param object $theme - A WordPress.org Theme API object.
*/
function install_theme_info( $theme ) {
global $themes_allowedtags;
if ( empty( $theme ) )
return;
$name = wp_kses( $theme->name, $themes_allowedtags );
$author = wp_kses( $theme->author, $themes_allowedtags );
$num_ratings = sprintf( _n( '(based on %s rating)', '(based on %s ratings)', $theme->num_ratings ), number_format_i18n( $theme->num_ratings ) );
$install_url = add_query_arg( array(
'action' => 'install-theme',
'theme' => $theme->slug,
), self_admin_url( 'update.php' ) );
$update_url = add_query_arg( array(
'action' => 'upgrade-theme',
'theme' => $theme->slug,
), self_admin_url( 'update.php' ) );
$status = $this->_get_theme_status( $theme );
?>
<div class="install-theme-info"><?php
switch ( $status ) {
default:
case 'install':
echo '<a class="theme-install button-primary" href="' . esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ) . '">' . __( 'Install' ) . '</a>';
break;
case 'update_available':
echo '<a class="theme-install button-primary" href="' . esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ) . '" title="' . esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ) . '">' . __( 'Update' ) . '</a>';
break;
case 'newer_installed':
case 'latest_installed':
echo '<span class="theme-install" title="' . esc_attr__( 'This theme is already installed and is up to date' ) . '">' . _x( 'Installed', 'theme' ) . '</span>';
break;
} ?>
<h3 class="theme-name"><?php echo $name; ?></h3>
<span class="theme-by"><?php printf( __( 'By %s' ), $author ); ?></span>
<?php if ( isset( $theme->screenshot_url ) ): ?>
<img class="theme-screenshot" src="<?php echo esc_url( $theme->screenshot_url ); ?>" />
<?php endif; ?>
<div class="theme-details">
<div class="star-holder" title="<?php echo esc_attr( $num_ratings ); ?>">
<div class="star-rating" style="width:<?php echo esc_attr( intval( $theme->rating ) . 'px' ); ?>;"></div>
</div>
<div class="theme-version">
<strong><?php _e('Version:') ?> </strong>
<?php echo wp_kses( $theme->version, $themes_allowedtags ); ?>
</div>
<div class="theme-description">
<?php echo wp_kses( $theme->description, $themes_allowedtags ); ?>
</div>
</div>
<input class="theme-preview-url" type="hidden" value="<?php echo esc_url( $theme->preview_url ); ?>" />
</div>
<?php
}
/**
* Send required variables to JavaScript land
*
* @since 3.4
* @access private
*
* @uses $tab Global; current tab within Themes->Install screen
* @uses $type Global; type of search.
*/
function _js_vars() {
global $tab, $type;
parent::_js_vars( compact( 'tab', 'type' ) );
}
/**
* Check to see if the theme is already installed.
*
* @since 3.4
* @access private
*
* @param object $theme - A WordPress.org Theme API object.
* @return string Theme status.
*/
private function _get_theme_status( $theme ) {
$status = 'install';
$installed_theme = wp_get_theme( $theme->slug );
if ( $installed_theme->exists() ) {
if ( version_compare( $installed_theme->get('Version'), $theme->version, '=' ) )
$status = 'latest_installed';
elseif ( version_compare( $installed_theme->get('Version'), $theme->version, '>' ) )
$status = 'newer_installed';
else
$status = 'update_available';
}
return $status;
}
}
| zyblog | trunk/zyblog/wp-admin/includes/class-wp-theme-install-list-table.php | PHP | asf20 | 12,950 |
<?php
// -- Post related Meta Boxes
/**
* Display post submit form fields.
*
* @since 2.7.0
*
* @param object $post
*/
function post_submit_meta_box($post) {
global $action;
$post_type = $post->post_type;
$post_type_object = get_post_type_object($post_type);
$can_publish = current_user_can($post_type_object->cap->publish_posts);
?>
<div class="submitbox" id="submitpost">
<div id="minor-publishing">
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
<div style="display:none;">
<?php submit_button( __( 'Save' ), 'button', 'save' ); ?>
</div>
<div id="minor-publishing-actions">
<div id="save-action">
<?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?>
<input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save Draft'); ?>" class="button" />
<?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
<input type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save as Pending'); ?>" class="button" />
<?php } ?>
<span class="spinner"></span>
</div>
<?php if ( $post_type_object->public ) : ?>
<div id="preview-action">
<?php
if ( 'publish' == $post->post_status ) {
$preview_link = esc_url( get_permalink( $post->ID ) );
$preview_button = __( 'Preview Changes' );
} else {
$preview_link = set_url_scheme( get_permalink( $post->ID ) );
$preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) ) );
$preview_button = __( 'Preview' );
}
?>
<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview"><?php echo $preview_button; ?></a>
<input type="hidden" name="wp-preview" id="wp-preview" value="" />
</div>
<?php endif; // public post type ?>
<div class="clear"></div>
</div><!-- #minor-publishing-actions -->
<div id="misc-publishing-actions">
<div class="misc-pub-section"><label for="post_status"><?php _e('Status:') ?></label>
<span id="post-status-display">
<?php
switch ( $post->post_status ) {
case 'private':
_e('Privately Published');
break;
case 'publish':
_e('Published');
break;
case 'future':
_e('Scheduled');
break;
case 'pending':
_e('Pending Review');
break;
case 'draft':
case 'auto-draft':
_e('Draft');
break;
}
?>
</span>
<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
<a href="#post_status" <?php if ( 'private' == $post->post_status ) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js"><?php _e('Edit') ?></a>
<div id="post-status-select" class="hide-if-js">
<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr( ('auto-draft' == $post->post_status ) ? 'draft' : $post->post_status); ?>" />
<select name='post_status' id='post_status'>
<?php if ( 'publish' == $post->post_status ) : ?>
<option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option>
<?php elseif ( 'private' == $post->post_status ) : ?>
<option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option>
<?php elseif ( 'future' == $post->post_status ) : ?>
<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
<?php endif; ?>
<option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
<?php if ( 'auto-draft' == $post->post_status ) : ?>
<option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e('Draft') ?></option>
<?php else : ?>
<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
<?php endif; ?>
</select>
<a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
<a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a>
</div>
<?php } ?>
</div><!-- .misc-pub-section -->
<div class="misc-pub-section" id="visibility">
<?php _e('Visibility:'); ?> <span id="post-visibility-display"><?php
if ( 'private' == $post->post_status ) {
$post->post_password = '';
$visibility = 'private';
$visibility_trans = __('Private');
} elseif ( !empty( $post->post_password ) ) {
$visibility = 'password';
$visibility_trans = __('Password protected');
} elseif ( $post_type == 'post' && is_sticky( $post->ID ) ) {
$visibility = 'public';
$visibility_trans = __('Public, Sticky');
} else {
$visibility = 'public';
$visibility_trans = __('Public');
}
echo esc_html( $visibility_trans ); ?></span>
<?php if ( $can_publish ) { ?>
<a href="#visibility" class="edit-visibility hide-if-no-js"><?php _e('Edit'); ?></a>
<div id="post-visibility-select" class="hide-if-js">
<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr($post->post_password); ?>" />
<?php if ($post_type == 'post'): ?>
<input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked(is_sticky($post->ID)); ?> />
<?php endif; ?>
<input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo esc_attr( $visibility ); ?>" />
<input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e('Public'); ?></label><br />
<?php if ( $post_type == 'post' && current_user_can( 'edit_others_posts' ) ) : ?>
<span id="sticky-span"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked( is_sticky( $post->ID ) ); ?> /> <label for="sticky" class="selectit"><?php _e( 'Stick this post to the front page' ); ?></label><br /></span>
<?php endif; ?>
<input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e('Password protected'); ?></label><br />
<span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo esc_attr($post->post_password); ?>" /><br /></span>
<input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e('Private'); ?></label><br />
<p>
<a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
<a href="#visibility" class="cancel-post-visibility hide-if-no-js"><?php _e('Cancel'); ?></a>
</p>
</div>
<?php } ?>
</div><!-- .misc-pub-section -->
<?php
// translators: Publish box date format, see http://php.net/date
$datef = __( 'M j, Y @ G:i' );
if ( 0 != $post->ID ) {
if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
$stamp = __('Scheduled for: <b>%1$s</b>');
} else if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
$stamp = __('Published on: <b>%1$s</b>');
} else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
$stamp = __('Publish <b>immediately</b>');
} else if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
$stamp = __('Schedule for: <b>%1$s</b>');
} else { // draft, 1 or more saves, date specified
$stamp = __('Publish on: <b>%1$s</b>');
}
$date = date_i18n( $datef, strtotime( $post->post_date ) );
} else { // draft (no saves, and thus no date specified)
$stamp = __('Publish <b>immediately</b>');
$date = date_i18n( $datef, strtotime( current_time('mysql') ) );
}
if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
<div class="misc-pub-section curtime">
<span id="timestamp">
<?php printf($stamp, $date); ?></span>
<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><?php _e('Edit') ?></a>
<div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'), 1); ?></div>
</div><?php // /misc-pub-section ?>
<?php endif; ?>
<?php do_action('post_submitbox_misc_actions'); ?>
</div>
<div class="clear"></div>
</div>
<div id="major-publishing-actions">
<?php do_action('post_submitbox_start'); ?>
<div id="delete-action">
<?php
if ( current_user_can( "delete_post", $post->ID ) ) {
if ( !EMPTY_TRASH_DAYS )
$delete_text = __('Delete Permanently');
else
$delete_text = __('Move to Trash');
?>
<a class="submitdelete deletion" href="<?php echo get_delete_post_link($post->ID); ?>"><?php echo $delete_text; ?></a><?php
} ?>
</div>
<div id="publishing-action">
<span class="spinner"></span>
<?php
if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) {
if ( $can_publish ) :
if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" />
<?php submit_button( __( 'Schedule' ), 'primary button-large', 'publish', false, array( 'accesskey' => 'p' ) ); ?>
<?php else : ?>
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" />
<?php submit_button( __( 'Publish' ), 'primary button-large', 'publish', false, array( 'accesskey' => 'p' ) ); ?>
<?php endif;
else : ?>
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" />
<?php submit_button( __( 'Submit for Review' ), 'primary button-large', 'publish', false, array( 'accesskey' => 'p' ) ); ?>
<?php
endif;
} else { ?>
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" />
<input name="save" type="submit" class="button button-primary button-large" id="publish" accesskey="p" value="<?php esc_attr_e('Update') ?>" />
<?php
} ?>
</div>
<div class="clear"></div>
</div>
</div>
<?php
}
/**
* Display attachment submit form fields.
*
* @since 3.5.0
*
* @param object $post
*/
function attachment_submit_meta_box( $post ) {
global $action;
$post_type = $post->post_type;
$post_type_object = get_post_type_object($post_type);
$can_publish = current_user_can($post_type_object->cap->publish_posts);
?>
<div class="submitbox" id="submitpost">
<div id="minor-publishing">
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
<div style="display:none;">
<?php submit_button( __( 'Save' ), 'button', 'save' ); ?>
</div>
<div id="misc-publishing-actions">
<?php
// translators: Publish box date format, see http://php.net/date
$datef = __( 'M j, Y @ G:i' );
$stamp = __('Uploaded on: <b>%1$s</b>');
$date = date_i18n( $datef, strtotime( $post->post_date ) );
?>
<div class="misc-pub-section curtime">
<span id="timestamp"><?php printf($stamp, $date); ?></span>
</div><!-- .misc-pub-section -->
<?php do_action('attachment_submitbox_misc_actions'); ?>
</div><!-- #misc-publishing-actions -->
<div class="clear"></div>
</div><!-- #minor-publishing -->
<div id="major-publishing-actions">
<div id="delete-action">
<?php
if ( current_user_can( 'delete_post', $post->ID ) )
if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
echo "<a class='submitdelete deletion' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
} else {
$delete_ays = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
echo "<a class='submitdelete deletion'$delete_ays href='" . get_delete_post_link( $post->ID, null, true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
}
?>
</div>
<div id="publishing-action">
<span class="spinner"></span>
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update') ?>" />
<input name="save" type="submit" class="button-primary button-large" id="publish" accesskey="p" value="<?php esc_attr_e('Update') ?>" />
</div>
<div class="clear"></div>
</div><!-- #major-publishing-actions -->
</div>
<?php
}
/**
* Display post format form elements.
*
* @since 3.1.0
*
* @param object $post
*/
function post_format_meta_box( $post, $box ) {
if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) :
$post_formats = get_theme_support( 'post-formats' );
if ( is_array( $post_formats[0] ) ) :
$post_format = get_post_format( $post->ID );
if ( !$post_format )
$post_format = '0';
// Add in the current one if it isn't there yet, in case the current theme doesn't support it
if ( $post_format && !in_array( $post_format, $post_formats[0] ) )
$post_formats[0][] = $post_format;
?>
<div id="post-formats-select">
<input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0"><?php _e('Standard'); ?></label>
<?php foreach ( $post_formats[0] as $format ) : ?>
<br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" <?php checked( $post_format, $format ); ?> /> <label for="post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label>
<?php endforeach; ?><br />
</div>
<?php endif; endif;
}
/**
* Display post tags form fields.
*
* @since 2.6.0
*
* @param object $post
*/
function post_tags_meta_box($post, $box) {
$defaults = array('taxonomy' => 'post_tag');
if ( !isset($box['args']) || !is_array($box['args']) )
$args = array();
else
$args = $box['args'];
extract( wp_parse_args($args, $defaults), EXTR_SKIP );
$tax_name = esc_attr($taxonomy);
$taxonomy = get_taxonomy($taxonomy);
$disabled = !current_user_can($taxonomy->cap->assign_terms) ? 'disabled="disabled"' : '';
$comma = _x( ',', 'tag delimiter' );
?>
<div class="tagsdiv" id="<?php echo $tax_name; ?>">
<div class="jaxtag">
<div class="nojs-tags hide-if-js">
<p><?php echo $taxonomy->labels->add_or_remove_items; ?></p>
<textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php echo $disabled; ?>><?php echo str_replace( ',', $comma . ' ', get_terms_to_edit( $post->ID, $tax_name ) ); // textarea_escaped by esc_attr() ?></textarea></div>
<?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?>
<div class="ajaxtag hide-if-no-js">
<label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label>
<div class="taghint"><?php echo $taxonomy->labels->add_new_item; ?></div>
<p><input type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
<input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" /></p>
</div>
<p class="howto"><?php echo esc_attr( $taxonomy->labels->separate_items_with_commas ); ?></p>
<?php endif; ?>
</div>
<div class="tagchecklist"></div>
</div>
<?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?>
<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->choose_from_most_used; ?></a></p>
<?php endif; ?>
<?php
}
/**
* Display post categories form fields.
*
* @since 2.6.0
*
* @param object $post
*/
function post_categories_meta_box( $post, $box ) {
$defaults = array('taxonomy' => 'category');
if ( !isset($box['args']) || !is_array($box['args']) )
$args = array();
else
$args = $box['args'];
extract( wp_parse_args($args, $defaults), EXTR_SKIP );
$tax = get_taxonomy($taxonomy);
?>
<div id="taxonomy-<?php echo $taxonomy; ?>" class="categorydiv">
<ul id="<?php echo $taxonomy; ?>-tabs" class="category-tabs">
<li class="tabs"><a href="#<?php echo $taxonomy; ?>-all"><?php echo $tax->labels->all_items; ?></a></li>
<li class="hide-if-no-js"><a href="#<?php echo $taxonomy; ?>-pop"><?php _e( 'Most Used' ); ?></a></li>
</ul>
<div id="<?php echo $taxonomy; ?>-pop" class="tabs-panel" style="display: none;">
<ul id="<?php echo $taxonomy; ?>checklist-pop" class="categorychecklist form-no-clear" >
<?php $popular_ids = wp_popular_terms_checklist($taxonomy); ?>
</ul>
</div>
<div id="<?php echo $taxonomy; ?>-all" class="tabs-panel">
<?php
$name = ( $taxonomy == 'category' ) ? 'post_category' : 'tax_input[' . $taxonomy . ']';
echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
?>
<ul id="<?php echo $taxonomy; ?>checklist" data-wp-lists="list:<?php echo $taxonomy?>" class="categorychecklist form-no-clear">
<?php wp_terms_checklist($post->ID, array( 'taxonomy' => $taxonomy, 'popular_cats' => $popular_ids ) ) ?>
</ul>
</div>
<?php if ( current_user_can($tax->cap->edit_terms) ) : ?>
<div id="<?php echo $taxonomy; ?>-adder" class="wp-hidden-children">
<h4>
<a id="<?php echo $taxonomy; ?>-add-toggle" href="#<?php echo $taxonomy; ?>-add" class="hide-if-no-js">
<?php
/* translators: %s: add new taxonomy label */
printf( __( '+ %s' ), $tax->labels->add_new_item );
?>
</a>
</h4>
<p id="<?php echo $taxonomy; ?>-add" class="category-add wp-hidden-child">
<label class="screen-reader-text" for="new<?php echo $taxonomy; ?>"><?php echo $tax->labels->add_new_item; ?></label>
<input type="text" name="new<?php echo $taxonomy; ?>" id="new<?php echo $taxonomy; ?>" class="form-required form-input-tip" value="<?php echo esc_attr( $tax->labels->new_item_name ); ?>" aria-required="true"/>
<label class="screen-reader-text" for="new<?php echo $taxonomy; ?>_parent">
<?php echo $tax->labels->parent_item_colon; ?>
</label>
<?php wp_dropdown_categories( array( 'taxonomy' => $taxonomy, 'hide_empty' => 0, 'name' => 'new'.$taxonomy.'_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '— ' . $tax->labels->parent_item . ' —' ) ); ?>
<input type="button" id="<?php echo $taxonomy; ?>-add-submit" data-wp-lists="add:<?php echo $taxonomy ?>checklist:<?php echo $taxonomy ?>-add" class="button category-add-submit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" />
<?php wp_nonce_field( 'add-'.$taxonomy, '_ajax_nonce-add-'.$taxonomy, false ); ?>
<span id="<?php echo $taxonomy; ?>-ajax-response"></span>
</p>
</div>
<?php endif; ?>
</div>
<?php
}
/**
* Display post excerpt form fields.
*
* @since 2.6.0
*
* @param object $post
*/
function post_excerpt_meta_box($post) {
?>
<label class="screen-reader-text" for="excerpt"><?php _e('Excerpt') ?></label><textarea rows="1" cols="40" name="excerpt" id="excerpt"><?php echo $post->post_excerpt; // textarea_escaped ?></textarea>
<p><?php _e('Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="http://codex.wordpress.org/Excerpt" target="_blank">Learn more about manual excerpts.</a>'); ?></p>
<?php
}
/**
* Display trackback links form fields.
*
* @since 2.6.0
*
* @param object $post
*/
function post_trackback_meta_box($post) {
$form_trackback = '<input type="text" name="trackback_url" id="trackback_url" class="code" value="'. esc_attr( str_replace("\n", ' ', $post->to_ping) ) .'" />';
if ('' != $post->pinged) {
$pings = '<p>'. __('Already pinged:') . '</p><ul>';
$already_pinged = explode("\n", trim($post->pinged));
foreach ($already_pinged as $pinged_url) {
$pings .= "\n\t<li>" . esc_html($pinged_url) . "</li>";
}
$pings .= '</ul>';
}
?>
<p><label for="trackback_url"><?php _e('Send trackbacks to:'); ?></label> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p>
<p><?php _e('Trackbacks are a way to notify legacy blog systems that you’ve linked to them. If you link other WordPress sites they’ll be notified automatically using <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">pingbacks</a>, no other action necessary.'); ?></p>
<?php
if ( ! empty($pings) )
echo $pings;
}
/**
* Display custom fields form fields.
*
* @since 2.6.0
*
* @param object $post
*/
function post_custom_meta_box($post) {
?>
<div id="postcustomstuff">
<div id="ajax-response"></div>
<?php
$metadata = has_meta($post->ID);
foreach ( $metadata as $key => $value ) {
if ( is_protected_meta( $metadata[ $key ][ 'meta_key' ], 'post' ) || ! current_user_can( 'edit_post_meta', $post->ID, $metadata[ $key ][ 'meta_key' ] ) )
unset( $metadata[ $key ] );
}
list_meta( $metadata );
meta_form(); ?>
</div>
<p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
<?php
}
/**
* Display comments status form fields.
*
* @since 2.6.0
*
* @param object $post
*/
function post_comment_status_meta_box($post) {
?>
<input name="advanced_view" type="hidden" value="1" />
<p class="meta-options">
<label for="comment_status" class="selectit"><input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> /> <?php _e( 'Allow comments.' ) ?></label><br />
<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php printf( __( 'Allow <a href="%s" target="_blank">trackbacks and pingbacks</a> on this page.' ), __( 'http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' ) ); ?></label>
<?php do_action('post_comment_status_meta_box-options', $post); ?>
</p>
<?php
}
/**
* Display comments for post table header
*
* @since 3.0.0
*
* @param array $result table header rows
* @return array
*/
function post_comment_meta_box_thead($result) {
unset($result['cb'], $result['response']);
return $result;
}
/**
* Display comments for post.
*
* @since 2.8.0
*
* @param object $post
*/
function post_comment_meta_box( $post ) {
global $wpdb;
wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
?>
<p class="hide-if-no-js" id="add-new-comment"><a href="#commentstatusdiv" onclick="commentReply.addcomment(<?php echo $post->ID; ?>);return false;"><?php _e('Add comment'); ?></a></p>
<?php
$total = get_comments( array( 'post_id' => $post->ID, 'number' => 1, 'count' => true ) );
$wp_list_table = _get_list_table('WP_Post_Comments_List_Table');
$wp_list_table->display( true );
if ( 1 > $total ) {
echo '<p id="no-comments">' . __('No comments yet.') . '</p>';
} else {
$hidden = get_hidden_meta_boxes( get_current_screen() );
if ( ! in_array('commentsdiv', $hidden) ) {
?>
<script type="text/javascript">jQuery(document).ready(function(){commentsBox.get(<?php echo $total; ?>, 10);});</script>
<?php
}
?>
<p class="hide-if-no-js" id="show-comments"><a href="#commentstatusdiv" onclick="commentsBox.get(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <span class="spinner"></span></p>
<?php
}
wp_comment_trashnotice();
}
/**
* Display slug form fields.
*
* @since 2.6.0
*
* @param object $post
*/
function post_slug_meta_box($post) {
?>
<label class="screen-reader-text" for="post_name"><?php _e('Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo esc_attr( apply_filters('editable_slug', $post->post_name) ); ?>" />
<?php
}
/**
* Display form field with list of authors.
*
* @since 2.6.0
*
* @param object $post
*/
function post_author_meta_box($post) {
global $user_ID;
?>
<label class="screen-reader-text" for="post_author_override"><?php _e('Author'); ?></label>
<?php
wp_dropdown_users( array(
'who' => 'authors',
'name' => 'post_author_override',
'selected' => empty($post->ID) ? $user_ID : $post->post_author,
'include_selected' => true
) );
}
/**
* Display list of revisions.
*
* @since 2.6.0
*
* @param object $post
*/
function post_revisions_meta_box($post) {
wp_list_post_revisions();
}
// -- Page related Meta Boxes
/**
* Display page attributes form fields.
*
* @since 2.7.0
*
* @param object $post
*/
function page_attributes_meta_box($post) {
$post_type_object = get_post_type_object($post->post_type);
if ( $post_type_object->hierarchical ) {
$dropdown_args = array(
'post_type' => $post->post_type,
'exclude_tree' => $post->ID,
'selected' => $post->post_parent,
'name' => 'parent_id',
'show_option_none' => __('(no parent)'),
'sort_column' => 'menu_order, post_title',
'echo' => 0,
);
$dropdown_args = apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args, $post );
$pages = wp_dropdown_pages( $dropdown_args );
if ( ! empty($pages) ) {
?>
<p><strong><?php _e('Parent') ?></strong></p>
<label class="screen-reader-text" for="parent_id"><?php _e('Parent') ?></label>
<?php echo $pages; ?>
<?php
} // end empty pages check
} // end hierarchical check.
if ( 'page' == $post->post_type && 0 != count( get_page_templates() ) ) {
$template = !empty($post->page_template) ? $post->page_template : false;
?>
<p><strong><?php _e('Template') ?></strong></p>
<label class="screen-reader-text" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
<option value='default'><?php _e('Default Template'); ?></option>
<?php page_template_dropdown($template); ?>
</select>
<?php
} ?>
<p><strong><?php _e('Order') ?></strong></p>
<p><label class="screen-reader-text" for="menu_order"><?php _e('Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr($post->menu_order) ?>" /></p>
<p><?php if ( 'page' == $post->post_type ) _e( 'Need help? Use the Help tab in the upper right of your screen.' ); ?></p>
<?php
}
// -- Link related Meta Boxes
/**
* Display link create form fields.
*
* @since 2.7.0
*
* @param object $link
*/
function link_submit_meta_box($link) {
?>
<div class="submitbox" id="submitlink">
<div id="minor-publishing">
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
<div style="display:none;">
<?php submit_button( __( 'Save' ), 'button', 'save', false ); ?>
</div>
<div id="minor-publishing-actions">
<div id="preview-action">
<?php if ( !empty($link->link_id) ) { ?>
<a class="preview button" href="<?php echo $link->link_url; ?>" target="_blank"><?php _e('Visit Link'); ?></a>
<?php } ?>
</div>
<div class="clear"></div>
</div>
<div id="misc-publishing-actions">
<div class="misc-pub-section">
<label for="link_private" class="selectit"><input id="link_private" name="link_visible" type="checkbox" value="N" <?php checked($link->link_visible, 'N'); ?> /> <?php _e('Keep this link private') ?></label>
</div>
</div>
</div>
<div id="major-publishing-actions">
<?php do_action('post_submitbox_start'); ?>
<div id="delete-action">
<?php
if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('manage_links') ) { ?>
<a class="submitdelete deletion" href="<?php echo wp_nonce_url("link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>
<?php } ?>
</div>
<div id="publishing-action">
<?php if ( !empty($link->link_id) ) { ?>
<input name="save" type="submit" class="button-large button-primary" id="publish" accesskey="p" value="<?php esc_attr_e('Update Link') ?>" />
<?php } else { ?>
<input name="save" type="submit" class="button-large button-primary" id="publish" accesskey="p" value="<?php esc_attr_e('Add Link') ?>" />
<?php } ?>
</div>
<div class="clear"></div>
</div>
<?php do_action('submitlink_box'); ?>
<div class="clear"></div>
</div>
<?php
}
/**
* Display link categories form fields.
*
* @since 2.6.0
*
* @param object $link
*/
function link_categories_meta_box($link) {
?>
<div id="taxonomy-linkcategory" class="categorydiv">
<ul id="category-tabs" class="category-tabs">
<li class="tabs"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li>
<li class="hide-if-no-js"><a href="#categories-pop"><?php _e( 'Most Used' ); ?></a></li>
</ul>
<div id="categories-all" class="tabs-panel">
<ul id="categorychecklist" data-wp-lists="list:category" class="categorychecklist form-no-clear">
<?php
if ( isset($link->link_id) )
wp_link_category_checklist($link->link_id);
else
wp_link_category_checklist();
?>
</ul>
</div>
<div id="categories-pop" class="tabs-panel" style="display: none;">
<ul id="categorychecklist-pop" class="categorychecklist form-no-clear">
<?php wp_popular_terms_checklist('link_category'); ?>
</ul>
</div>
<div id="category-adder" class="wp-hidden-children">
<h4><a id="category-add-toggle" href="#category-add"><?php _e( '+ Add New Category' ); ?></a></h4>
<p id="link-category-add" class="wp-hidden-child">
<label class="screen-reader-text" for="newcat"><?php _e( '+ Add New Category' ); ?></label>
<input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php esc_attr_e( 'New category name' ); ?>" aria-required="true" />
<input type="button" id="link-category-add-submit" data-wp-lists="add:categorychecklist:link-category-add" class="button" value="<?php esc_attr_e( 'Add' ); ?>" />
<?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
<span id="category-ajax-response"></span>
</p>
</div>
</div>
<?php
}
/**
* Display form fields for changing link target.
*
* @since 2.6.0
*
* @param object $link
*/
function link_target_meta_box($link) { ?>
<fieldset><legend class="screen-reader-text"><span><?php _e('Target') ?></span></legend>
<p><label for="link_target_blank" class="selectit">
<input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />
<?php _e('<code>_blank</code> — new window or tab.'); ?></label></p>
<p><label for="link_target_top" class="selectit">
<input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_top') ? 'checked="checked"' : ''); ?> />
<?php _e('<code>_top</code> — current window or tab, with no frames.'); ?></label></p>
<p><label for="link_target_none" class="selectit">
<input id="link_target_none" type="radio" name="link_target" value="" <?php echo ( isset( $link->link_target ) && ($link->link_target == '') ? 'checked="checked"' : ''); ?> />
<?php _e('<code>_none</code> — same window or tab.'); ?></label></p>
</fieldset>
<p><?php _e('Choose the target frame for your link.'); ?></p>
<?php
}
/**
* Display checked checkboxes attribute for xfn microformat options.
*
* @since 1.0.1
*
* @param string $class
* @param string $value
* @param mixed $deprecated Never used.
*/
function xfn_check( $class, $value = '', $deprecated = '' ) {
global $link;
if ( !empty( $deprecated ) )
_deprecated_argument( __FUNCTION__, '0.0' ); // Never implemented
$link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: '';
$rels = preg_split('/\s+/', $link_rel);
if ('' != $value && in_array($value, $rels) ) {
echo ' checked="checked"';
}
if ('' == $value) {
if ('family' == $class && strpos($link_rel, 'child') === false && strpos($link_rel, 'parent') === false && strpos($link_rel, 'sibling') === false && strpos($link_rel, 'spouse') === false && strpos($link_rel, 'kin') === false) echo ' checked="checked"';
if ('friendship' == $class && strpos($link_rel, 'friend') === false && strpos($link_rel, 'acquaintance') === false && strpos($link_rel, 'contact') === false) echo ' checked="checked"';
if ('geographical' == $class && strpos($link_rel, 'co-resident') === false && strpos($link_rel, 'neighbor') === false) echo ' checked="checked"';
if ('identity' == $class && in_array('me', $rels) ) echo ' checked="checked"';
}
}
/**
* Display xfn form fields.
*
* @since 2.6.0
*
* @param object $link
*/
function link_xfn_meta_box($link) {
?>
<table class="links-table" cellspacing="0">
<tr>
<th scope="row"><label for="link_rel"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('rel:') ?></label></th>
<td><input type="text" name="link_rel" id="link_rel" value="<?php echo ( isset( $link->link_rel ) ? esc_attr($link->link_rel) : ''); ?>" /></td>
</tr>
<tr>
<th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?></th>
<td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?></span></legend>
<label for="me">
<input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> />
<?php _e('another web address of mine') ?></label>
</fieldset></td>
</tr>
<tr>
<th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?></th>
<td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?></span></legend>
<label for="contact">
<input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('contact') ?>
</label>
<label for="acquaintance">
<input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check('friendship', 'acquaintance'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('acquaintance') ?>
</label>
<label for="friend">
<input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friend') ?>
</label>
<label for="friendship">
<input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?>
</label>
</fieldset></td>
</tr>
<tr>
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('physical') ?> </th>
<td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('physical') ?></span></legend>
<label for="met">
<input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check('physical', 'met'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('met') ?>
</label>
</fieldset></td>
</tr>
<tr>
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('professional') ?> </th>
<td><fieldset><legend class="screen-reader-text"><span><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('professional') ?></span></legend>
<label for="co-worker">
<input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check('professional', 'co-worker'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-worker') ?>
</label>
<label for="colleague">
<input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check('professional', 'colleague'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('colleague') ?>
</label>
</fieldset></td>
</tr>
<tr>
<th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?></th>
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?> </span></legend>
<label for="co-resident">
<input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-resident') ?>
</label>
<label for="neighbor">
<input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check('geographical', 'neighbor'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('neighbor') ?>
</label>
<label for="geographical">
<input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?>
</label>
</fieldset></td>
</tr>
<tr>
<th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?></th>
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?> </span></legend>
<label for="child">
<input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('child') ?>
</label>
<label for="kin">
<input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check('family', 'kin'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('kin') ?>
</label>
<label for="parent">
<input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check('family', 'parent'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('parent') ?>
</label>
<label for="sibling">
<input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check('family', 'sibling'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sibling') ?>
</label>
<label for="spouse">
<input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check('family', 'spouse'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('spouse') ?>
</label>
<label for="family">
<input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?>
</label>
</fieldset></td>
</tr>
<tr>
<th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('romantic') ?></th>
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('romantic') ?> </span></legend>
<label for="muse">
<input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check('romantic', 'muse'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('muse') ?>
</label>
<label for="crush">
<input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check('romantic', 'crush'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('crush') ?>
</label>
<label for="date">
<input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check('romantic', 'date'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('date') ?>
</label>
<label for="romantic">
<input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check('romantic', 'sweetheart'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sweetheart') ?>
</label>
</fieldset></td>
</tr>
</table>
<p><?php _e('If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out <a href="http://gmpg.org/xfn/">XFN</a>.'); ?></p>
<?php
}
/**
* Display advanced link options form fields.
*
* @since 2.6.0
*
* @param object $link
*/
function link_advanced_meta_box($link) {
?>
<table class="links-table" cellpadding="0">
<tr>
<th scope="row"><label for="link_image"><?php _e('Image Address') ?></label></th>
<td><input type="text" name="link_image" class="code" id="link_image" value="<?php echo ( isset( $link->link_image ) ? esc_attr($link->link_image) : ''); ?>" /></td>
</tr>
<tr>
<th scope="row"><label for="rss_uri"><?php _e('RSS Address') ?></label></th>
<td><input name="link_rss" class="code" type="text" id="rss_uri" value="<?php echo ( isset( $link->link_rss ) ? esc_attr($link->link_rss) : ''); ?>" /></td>
</tr>
<tr>
<th scope="row"><label for="link_notes"><?php _e('Notes') ?></label></th>
<td><textarea name="link_notes" id="link_notes" rows="10"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : ''); // textarea_escaped ?></textarea></td>
</tr>
<tr>
<th scope="row"><label for="link_rating"><?php _e('Rating') ?></label></th>
<td><select name="link_rating" id="link_rating" size="1">
<?php
for ( $r = 0; $r <= 10; $r++ ) {
echo '<option value="' . $r . '"';
if ( isset($link->link_rating) && $link->link_rating == $r )
echo ' selected="selected"';
echo('>' . $r . '</option>');
}
?></select> <?php _e('(Leave at 0 for no rating.)') ?>
</td>
</tr>
</table>
<?php
}
/**
* Display post thumbnail meta box.
*
* @since 2.9.0
*/
function post_thumbnail_meta_box( $post ) {
$thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true );
echo _wp_post_thumbnail_html( $thumbnail_id, $post->ID );
} | zyblog | trunk/zyblog/wp-admin/includes/meta-boxes.php | PHP | asf20 | 42,002 |