mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 15:08:10 +01:00
More theme install styling, see #8652
git-svn-id: http://svn.automattic.com/wordpress/trunk@10823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
782b99b451
commit
fb0c5fbe97
@ -76,7 +76,7 @@ do_action('admin_head');
|
|||||||
<style type="text/css">.row-actions{visibility:visible;}</style>
|
<style type="text/css">.row-actions{visibility:visible;}</style>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</head>
|
</head>
|
||||||
<body class="wp-admin <?php echo apply_filters( 'admin_body_class', '' ); ?>">
|
<body class="wp-admin <?php echo apply_filters( 'admin_body_class', preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix) ); ?>">
|
||||||
|
|
||||||
<div id="wpwrap">
|
<div id="wpwrap">
|
||||||
<div id="wpcontent">
|
<div id="wpcontent">
|
||||||
|
@ -1581,3 +1581,16 @@ fieldset.inline-edit-col-right .inline-edit-col {
|
|||||||
input[readonly] {
|
input[readonly] {
|
||||||
background-color: #eee;
|
background-color: #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p.popular-tags {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
border-color: #DFDFDF;
|
||||||
|
}
|
||||||
|
|
||||||
|
#theme-information .action-button {
|
||||||
|
border-top-color: #DFDFDF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-listing br.line {
|
||||||
|
border-bottom-color: #ccc;
|
||||||
|
}
|
||||||
|
@ -1581,3 +1581,16 @@ fieldset.inline-edit-col-right .inline-edit-col {
|
|||||||
input[readonly] {
|
input[readonly] {
|
||||||
background-color: #eee;
|
background-color: #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p.popular-tags {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
border-color: #DFDFDF;
|
||||||
|
}
|
||||||
|
|
||||||
|
#theme-information .action-button {
|
||||||
|
border-top-color: #DFDFDF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-listing br.line {
|
||||||
|
border-bottom-color: #ccc;
|
||||||
|
}
|
||||||
|
@ -72,28 +72,43 @@ div.star img {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.theme-listing br.line {
|
.theme-listing br.line {
|
||||||
border-bottom: thin solid #ccc;
|
border-bottom-width: 1px;
|
||||||
|
border-bottom-style: solid;
|
||||||
margin-bottom: 3px;
|
margin-bottom: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#search-field {
|
|
||||||
padding: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
p.popular-tags {
|
|
||||||
line-height: 1.8em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.available-theme {
|
.available-theme {
|
||||||
text-align: center;
|
padding: 20px 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#theme-information .available-theme a.screenshot {
|
#theme-information .theme-preview-img {
|
||||||
border: 0 none;
|
float: left;
|
||||||
display: inline;
|
margin: 5px 25px 10px 15px;
|
||||||
|
width: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#theme-information .action-button {
|
||||||
|
border-top-width: 1px;
|
||||||
|
border-top-style: solid;
|
||||||
|
margin: 10px 5px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#theme-information .action-button #cancel {
|
||||||
|
float: left;
|
||||||
|
margin: 10px 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#theme-information .action-button #install {
|
||||||
|
float: right;
|
||||||
|
margin: 10px 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#theme-information .available-theme h3 {
|
#theme-information .available-theme h3 {
|
||||||
margin: 1em 0;
|
margin: 1em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body#theme-information {
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -125,10 +125,11 @@ function install_dashboard() {
|
|||||||
<p><?php _e('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 this page.') ?></p>
|
<p><?php _e('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 this page.') ?></p>
|
||||||
|
|
||||||
<h4><?php _e('Search') ?></h4>
|
<h4><?php _e('Search') ?></h4>
|
||||||
|
<p class="install-help"><?php _e('Search for plugins by keyword, author, or tag.') ?></p>
|
||||||
<?php install_search_form(); ?>
|
<?php install_search_form(); ?>
|
||||||
|
|
||||||
<h4><?php _e('Install a plugin in .zip format') ?></h4>
|
<h4><?php _e('Install a plugin in .zip format') ?></h4>
|
||||||
<p><?php _e('If you have a plugin in a .zip format, You may install it by uploading it here.') ?></p>
|
<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" action="<?php echo admin_url('plugin-install.php?tab=upload') ?>">
|
<form method="post" enctype="multipart/form-data" action="<?php echo admin_url('plugin-install.php?tab=upload') ?>">
|
||||||
<?php wp_nonce_field( 'plugin-upload') ?>
|
<?php wp_nonce_field( 'plugin-upload') ?>
|
||||||
<input type="file" name="pluginzip" />
|
<input type="file" name="pluginzip" />
|
||||||
@ -136,7 +137,7 @@ function install_dashboard() {
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
<h4><?php _e('Popular tags') ?></h4>
|
<h4><?php _e('Popular tags') ?></h4>
|
||||||
<p><?php _e('You may also browse based on the most popular tags in the Plugin Directory:') ?></p>
|
<p class="install-help"><?php _e('You may also browse based on the most popular tags in the Plugin Directory:') ?></p>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$api_tags = install_popular_tags();
|
$api_tags = install_popular_tags();
|
||||||
@ -149,7 +150,7 @@ function install_dashboard() {
|
|||||||
'name' => $tag['name'],
|
'name' => $tag['name'],
|
||||||
'id' => sanitize_title_with_dashes($tag['name']),
|
'id' => sanitize_title_with_dashes($tag['name']),
|
||||||
'count' => $tag['count'] );
|
'count' => $tag['count'] );
|
||||||
echo '<p>';
|
echo '<p class="popular-tags">';
|
||||||
echo wp_generate_tag_cloud($tags, array( 'single_text' => __('%d plugin'), 'multiple_text' => __('%d plugins') ) );
|
echo wp_generate_tag_cloud($tags, array( 'single_text' => __('%d plugin'), 'multiple_text' => __('%d plugins') ) );
|
||||||
echo '</p><br class="clear" />';
|
echo '</p><br class="clear" />';
|
||||||
}
|
}
|
||||||
@ -169,7 +170,7 @@ function install_search_form(){
|
|||||||
<option value="author"<?php selected('author', $type) ?>><?php _e('Author') ?></option>
|
<option value="author"<?php selected('author', $type) ?>><?php _e('Author') ?></option>
|
||||||
<option value="tag"<?php selected('tag', $type) ?>><?php _e('Tag') ?></option>
|
<option value="tag"<?php selected('tag', $type) ?>><?php _e('Tag') ?></option>
|
||||||
</select>
|
</select>
|
||||||
<input type="text" name="s" id="search-field" value="<?php echo attribute_escape($term) ?>" />
|
<input type="text" name="s" class="search-input" value="<?php echo attribute_escape($term) ?>" />
|
||||||
<input type="submit" name="search" value="<?php echo attribute_escape(__('Search')) ?>" class="button" />
|
<input type="submit" name="search" value="<?php echo attribute_escape(__('Search')) ?>" class="button" />
|
||||||
</form><?php
|
</form><?php
|
||||||
}
|
}
|
||||||
|
@ -3243,13 +3243,14 @@ function iframe_header( $title = '', $limit_styles = false) {
|
|||||||
<title><?php bloginfo('name') ?> › <?php echo $title ?> — <?php _e('WordPress'); ?></title>
|
<title><?php bloginfo('name') ?> › <?php echo $title ?> — <?php _e('WordPress'); ?></title>
|
||||||
<?php
|
<?php
|
||||||
wp_enqueue_style( 'global' );
|
wp_enqueue_style( 'global' );
|
||||||
wp_enqueue_style( 'colors' );
|
|
||||||
if ( ! $limit_styles )
|
if ( ! $limit_styles )
|
||||||
wp_enqueue_style( 'wp-admin' );
|
wp_enqueue_style( 'wp-admin' );
|
||||||
|
wp_enqueue_style( 'colors' );
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
function addLoadEvent(func) {if ( typeof wpOnload!='function'){wpOnload=func;}else{ var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}
|
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();}}};
|
||||||
|
function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_remove();}
|
||||||
//]]>
|
//]]>
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
@ -3270,6 +3271,7 @@ do_action('admin_head');
|
|||||||
*/
|
*/
|
||||||
function iframe_footer() {
|
function iframe_footer() {
|
||||||
echo '
|
echo '
|
||||||
|
<script type="text/javascript">if(typeof wpOnload=="function")wpOnload();</script>
|
||||||
</body>
|
</body>
|
||||||
</html>';
|
</html>';
|
||||||
}
|
}
|
||||||
|
@ -140,15 +140,12 @@ function install_theme_search($page) {
|
|||||||
add_action('install_themes_dashboard', 'install_themes_dashboard');
|
add_action('install_themes_dashboard', 'install_themes_dashboard');
|
||||||
function install_themes_dashboard() {
|
function install_themes_dashboard() {
|
||||||
?>
|
?>
|
||||||
<p><?php _e('Search for themes by keyword, author, or tag.') ?></p>
|
<p class="install-help"><?php _e('Search for themes by keyword, author, or tag.') ?></p>
|
||||||
|
|
||||||
<?php install_theme_search_form(); ?>
|
<?php install_theme_search_form(); ?>
|
||||||
|
|
||||||
<h4><?php _e('Advanced Search') ?></h4>
|
|
||||||
<p><?php _e('Tag filter goes here') ?></p>
|
|
||||||
|
|
||||||
<h4><?php _e('Popular tags') ?></h4>
|
<h4><?php _e('Popular tags') ?></h4>
|
||||||
<p><?php _e('You may also browse based on the most popular tags in the Theme Directory:') ?></p>
|
<p class="install-help"><?php _e('You may also browse based on the most popular tags in the Theme Directory:') ?></p>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$api_tags = install_themes_popular_tags();
|
$api_tags = install_themes_popular_tags();
|
||||||
@ -183,7 +180,7 @@ function install_theme_search_form(){
|
|||||||
<option value="term" <?php selected('term', $type) ?>><?php _e('Term') ?></option>
|
<option value="term" <?php selected('term', $type) ?>><?php _e('Term') ?></option>
|
||||||
<option value="author" <?php selected('author', $type) ?>><?php _e('Author') ?></option>
|
<option value="author" <?php selected('author', $type) ?>><?php _e('Author') ?></option>
|
||||||
<option value="tag" <?php selected('tag', $type) ?>><?php _e('Tag') ?></option>
|
<option value="tag" <?php selected('tag', $type) ?>><?php _e('Tag') ?></option>
|
||||||
</select> <input type="text" name="s" id="search-field"
|
</select> <input type="text" name="s" class="search-input"
|
||||||
value="<?php echo attribute_escape($term) ?>" /> <input type="submit"
|
value="<?php echo attribute_escape($term) ?>" /> <input type="submit"
|
||||||
name="search" value="<?php echo attribute_escape(__('Search')) ?>"
|
name="search" value="<?php echo attribute_escape(__('Search')) ?>"
|
||||||
class="button" /></form>
|
class="button" /></form>
|
||||||
@ -258,7 +255,7 @@ add_action('install_themes_upload', 'install_themes_upload', 10, 1);
|
|||||||
function install_themes_upload($page = 1) {
|
function install_themes_upload($page = 1) {
|
||||||
?>
|
?>
|
||||||
<h4><?php _e('Install a theme in .zip format') ?></h4>
|
<h4><?php _e('Install a theme in .zip format') ?></h4>
|
||||||
<p><?php _e('If you have a theme in a .zip format, you may install it by uploading it here.') ?></p>
|
<p class="install-help"><?php _e('If you have a theme in a .zip format, you may install it by uploading it here.') ?></p>
|
||||||
<form method="post" enctype="multipart/form-data"
|
<form method="post" enctype="multipart/form-data"
|
||||||
action="<?php echo admin_url('theme-install.php?tab=do_upload') ?>"><?php wp_nonce_field( 'theme-upload') ?>
|
action="<?php echo admin_url('theme-install.php?tab=do_upload') ?>"><?php wp_nonce_field( 'theme-upload') ?>
|
||||||
<input type="file" name="themezip" /> <input type="submit"
|
<input type="file" name="themezip" /> <input type="submit"
|
||||||
@ -279,10 +276,10 @@ function display_theme($theme, $actions = null, $show_details = true) {
|
|||||||
// $desc = substr($desc, 0, 30) . '<span class="dots">...</span><span>' . substr($desc, 30) . '</span>';
|
// $desc = substr($desc, 0, 30) . '<span class="dots">...</span><span>' . substr($desc, 30) . '</span>';
|
||||||
|
|
||||||
$preview_link = $theme->preview_url . '?TB_iframe=true&width=600&height=400';
|
$preview_link = $theme->preview_url . '?TB_iframe=true&width=600&height=400';
|
||||||
if ( empty($actions) ) {
|
if ( !is_array($actions) ) {
|
||||||
$actions = array();
|
$actions = array();
|
||||||
$actions[] = '<a href="' . admin_url('theme-install.php?tab=theme-information&theme=' . $theme->slug .
|
$actions[] = '<a href="' . admin_url('theme-install.php?tab=theme-information&theme=' . $theme->slug .
|
||||||
'&TB_iframe=true&width=600&height=800') . '" class="thickbox onclick" title="' . attribute_escape(sprintf(__('Install "%s"'), $name)) . '">' . __('Install') . '</a>';
|
'&TB_iframe=true&tbWidth=500&tbHeight=350') . '" class="thickbox thickbox-preview onclick" title="' . attribute_escape(sprintf(__('Install "%s"'), $name)) . '">' . __('Install') . '</a>';
|
||||||
$actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview onclick previewlink" title="' . attribute_escape(sprintf(__('Preview "%s"'), $name)) . '">' . __('Preview') . '</a>';
|
$actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview onclick previewlink" title="' . attribute_escape(sprintf(__('Preview "%s"'), $name)) . '">' . __('Preview') . '</a>';
|
||||||
$actions = apply_filters('theme_install_action_links', $actions, $theme);
|
$actions = apply_filters('theme_install_action_links', $actions, $theme);
|
||||||
}
|
}
|
||||||
@ -290,9 +287,9 @@ function display_theme($theme, $actions = null, $show_details = true) {
|
|||||||
$actions = implode ( ' | ', $actions );
|
$actions = implode ( ' | ', $actions );
|
||||||
?>
|
?>
|
||||||
<a class='thickbox thickbox-preview screenshot'
|
<a class='thickbox thickbox-preview screenshot'
|
||||||
href='<? echo clean_url($preview_link) ?>'
|
href='<? echo clean_url($preview_link); ?>'
|
||||||
title='<?php attribute_escape(sprintf(__('Preview "%s"'), $name)) ?>'>
|
title='<?php echo attribute_escape(sprintf(__('Preview "%s"'), $name)); ?>'>
|
||||||
<img src='<?php echo clean_url($theme->screenshot_url) ?>' width='150' />
|
<img src='<?php echo clean_url($theme->screenshot_url); ?>' width='150' />
|
||||||
</a>
|
</a>
|
||||||
<h3><?php echo $name ?></h3>
|
<h3><?php echo $name ?></h3>
|
||||||
<span class='action-links'><?php echo $actions ?></span>
|
<span class='action-links'><?php echo $actions ?></span>
|
||||||
@ -431,7 +428,7 @@ add_action('install_themes_pre_theme-information', 'install_theme_information');
|
|||||||
*/
|
*/
|
||||||
function install_theme_information() {
|
function install_theme_information() {
|
||||||
//TODO: This function needs a LOT of UI work :)
|
//TODO: This function needs a LOT of UI work :)
|
||||||
global $tab, $themes_allowedtags;;
|
global $tab, $themes_allowedtags;
|
||||||
|
|
||||||
$api = themes_api('theme_information', array('slug' => stripslashes( $_REQUEST['theme'] ) ));
|
$api = themes_api('theme_information', array('slug' => stripslashes( $_REQUEST['theme'] ) ));
|
||||||
|
|
||||||
@ -444,67 +441,88 @@ function install_theme_information() {
|
|||||||
foreach ( array('version', 'author', 'requires', 'tested', 'homepage', 'downloaded', 'slug') as $key )
|
foreach ( array('version', 'author', 'requires', 'tested', 'homepage', 'downloaded', 'slug') as $key )
|
||||||
$api->$key = wp_kses($api->$key, $themes_allowedtags);
|
$api->$key = wp_kses($api->$key, $themes_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( __('Theme Install') );
|
iframe_header( __('Theme Install') );
|
||||||
|
|
||||||
|
if ( empty($api->download_link) ) {
|
||||||
|
echo '<div id="message" class="error"><p>' . __('<strong>Error:</strong> This theme is currently not available. Please try again later.') . '</p></div>';
|
||||||
|
iframe_footer();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
if ( version_compare($GLOBALS['wp_version'], $api->tested, '>') )
|
if ( version_compare($GLOBALS['wp_version'], $api->tested, '>') )
|
||||||
echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This theme has <strong>not been tested</strong> with your current version of WordPress.') . '</p></div>';
|
echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This theme has <strong>not been tested</strong> with your current version of WordPress.') . '</p></div>';
|
||||||
else if ( version_compare($GLOBALS['wp_version'], $api->requires, '<') )
|
else if ( version_compare($GLOBALS['wp_version'], $api->requires, '<') )
|
||||||
echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This theme has not been marked as <strong>compatible</strong> with your version of WordPress.') . '</p></div>';
|
echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This theme has not been marked as <strong>compatible</strong> with your version of WordPress.') . '</p></div>';
|
||||||
|
|
||||||
if ( empty($api->download_link) ) {
|
|
||||||
// No go
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<p class="action-button"><?php
|
|
||||||
// Default to a "new" theme
|
// Default to a "new" theme
|
||||||
$type = 'install';
|
$type = 'install';
|
||||||
// Check to see if this theme is known to be installed, and has an update awaiting it.
|
// Check to see if this theme is known to be installed, and has an update awaiting it.
|
||||||
$update_themes = get_option('update_themes');
|
$update_themes = get_transient('update_themes');
|
||||||
foreach ( (array)$update_themes->response as $file => $theme ) {
|
if ( is_object($update_themes) ) {
|
||||||
if ( $theme->slug === $api->slug ) {
|
foreach ( (array)$update_themes->response as $file => $theme ) {
|
||||||
$type = 'update_available';
|
if ( $theme->slug === $api->slug ) {
|
||||||
$update_file = $file;
|
$type = 'update_available';
|
||||||
break;
|
$update_file = $file;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$action = '';
|
$themes = get_themes();
|
||||||
|
foreach ( $themes as $this_theme ) {
|
||||||
|
if ( is_array($this_theme) && $this_theme['Stylesheet'] == $api->slug ) {
|
||||||
|
if ( $this_theme['Version'] == $api->version ) {
|
||||||
|
$type = 'latest_installed';
|
||||||
|
} elseif ( $this_theme['Version'] > $api->version ) {
|
||||||
|
$type = 'newer_installed';
|
||||||
|
$newer_version = $this_theme['Version'];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class='available-theme'>
|
||||||
|
<img src='<?php echo clean_url($api->screenshot_url) ?>' width='300' class="theme-preview-img" />
|
||||||
|
<h3><?php echo $api->name; ?></h3>
|
||||||
|
<p><?php printf(__('by %s'), $api->author); ?></p>
|
||||||
|
<p><?php printf(__('Version: %s'), $api->version); ?></p>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$buttons = '<a class="button" id="cancel" href="#" onclick="tb_close();return false;">' . __('Cancel') . '</a> ';
|
||||||
|
|
||||||
switch ( $type ) {
|
switch ( $type ) {
|
||||||
default:
|
default:
|
||||||
case 'install':
|
case 'install':
|
||||||
if ( current_user_can('install_themes') ) :
|
if ( current_user_can('install_themes') ) :
|
||||||
$action = '<a class="button" href="' . wp_nonce_url(admin_url('theme-install.php?tab=install&theme=' . $api->slug), 'install-theme_' . $api->slug) . '" target="_parent">' . __('Install Now') . '</a>';
|
$buttons .= '<a class="button-primary" id="install" href="' . wp_nonce_url(admin_url('theme-install.php?tab=install&theme=' . $api->slug), 'install-theme_' . $api->slug) . '" target="_parent">' . __('Install Now') . '</a>';
|
||||||
endif;
|
endif;
|
||||||
break;
|
break;
|
||||||
case 'update_available':
|
case 'update_available':
|
||||||
if ( current_user_can('update_themes') ) :
|
if ( current_user_can('update_themes') ) :
|
||||||
?><a class="button"
|
$buttons .= '<a class="button-primary" id="install" href="' . wp_nonce_url(admin_url('update.php?action=upgrade-theme&theme=' . $update_file), 'upgrade-theme_' . $update_file) . '" target="_parent">' . __('Install Update Now') . '</a>';
|
||||||
href="<?php echo wp_nonce_url(admin_url('update.php?action=upgrade-theme&theme=' . $update_file), 'upgrade-theme_' . $update_file) ?>"
|
|
||||||
target="_parent"><?php _e('Install Update Now') ?></a><?php
|
|
||||||
endif;
|
endif;
|
||||||
break;
|
break;
|
||||||
case 'newer_installed':
|
case 'newer_installed':
|
||||||
if ( current_user_can('install_themes') || current_user_can('update_themes') ) :
|
if ( current_user_can('install_themes') || current_user_can('update_themes') ) :
|
||||||
?><a><?php printf(__('Newer Version (%s) Installed'), $newer_version) ?></a><?php
|
?><p><?php printf(__('Newer version (%s) is installed.'), $newer_version); ?></p><?php
|
||||||
endif;
|
endif;
|
||||||
break;
|
break;
|
||||||
case 'latest_installed':
|
case 'latest_installed':
|
||||||
if ( current_user_can('install_themes') || current_user_can('update_themes') ) :
|
if ( current_user_can('install_themes') || current_user_can('update_themes') ) :
|
||||||
?><a><?php _e('Latest Version Installed') ?></a><?php
|
?><p><?php _e('This version is already installed.'); ?></p><?php
|
||||||
endif;
|
endif;
|
||||||
break;
|
break;
|
||||||
} ?></p>
|
} ?>
|
||||||
<div class='available-theme'>
|
<br class="clear" />
|
||||||
<?php
|
|
||||||
display_theme($api, array($action), false);
|
|
||||||
?>
|
|
||||||
</div>
|
</div>
|
||||||
<?php
|
|
||||||
|
<p class="action-button">
|
||||||
|
<?php echo $buttons; ?>
|
||||||
|
<br class="clear" />
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<?php
|
||||||
iframe_footer();
|
iframe_footer();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
@ -1,54 +1,61 @@
|
|||||||
|
|
||||||
var thickDims;
|
var thickDims, tbWidth, tbHeight;
|
||||||
jQuery(document).ready(function($) {
|
jQuery(document).ready(function($) {
|
||||||
|
|
||||||
thickDims = function() {
|
thickDims = function() {
|
||||||
var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width();
|
var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
|
||||||
|
|
||||||
|
w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 90;
|
||||||
|
h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 60;
|
||||||
|
|
||||||
if ( tbWindow.size() ) {
|
if ( tbWindow.size() ) {
|
||||||
tbWindow.width( W - 90 ).height( H - 60 );
|
tbWindow.width(w).height(h);
|
||||||
$('#TB_iframeContent').width( W - 90 ).height( H - 90 );
|
$('#TB_iframeContent').width(w).height(h - 27);
|
||||||
tbWindow.css({'margin-left': '-' + parseInt((( W - 90 ) / 2),10) + 'px'});
|
tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'});
|
||||||
if ( typeof document.body.style.maxWidth != 'undefined' )
|
if ( typeof document.body.style.maxWidth != 'undefined' )
|
||||||
tbWindow.css({'top':'30px','margin-top':'0'});
|
tbWindow.css({'top':'30px','margin-top':'0'});
|
||||||
};
|
}
|
||||||
|
|
||||||
return $('a.thickbox-preview').each( function() {
|
|
||||||
var href = $(this).parents('.available-theme').find('.previewlink').attr('href');
|
|
||||||
if ( ! href ) return;
|
|
||||||
href = href.replace(/&width=[0-9]+/g, '');
|
|
||||||
href = href.replace(/&height=[0-9]+/g, '');
|
|
||||||
$(this).attr( 'href', href + '&width=' + ( W - 110 ) + '&height=' + ( H - 100 ) );
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
thickDims()
|
thickDims();
|
||||||
.click( function() {
|
$(window).resize( function() { thickDims() } );
|
||||||
var alink = $(this).parents('.available-theme').find('.activatelink'), url = '', text = '';
|
|
||||||
|
$('a.thickbox-preview').click( function() {
|
||||||
|
var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
|
||||||
|
|
||||||
|
if ( tbWidth = href.match(/&tbWidth=[0-9]+/) )
|
||||||
|
tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
|
||||||
|
else
|
||||||
|
tbWidth = $(window).width() - 90;
|
||||||
|
|
||||||
|
if ( tbHeight = href.match(/&tbHeight=[0-9]+/) )
|
||||||
|
tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
|
||||||
|
else
|
||||||
|
tbHeight = $(window).height() - 60;
|
||||||
|
|
||||||
if ( alink.length ) {
|
if ( alink.length ) {
|
||||||
url = alink.attr('href') || '';
|
url = alink.attr('href') || '';
|
||||||
text = alink.html() || '';
|
text = alink.attr('title') || '';
|
||||||
|
link = ' <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
|
||||||
|
} else {
|
||||||
|
text = $(this).attr('title') || '';
|
||||||
|
link = ' <span class="tb-theme-preview-link">' + text + '</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
|
$('#TB_title').css({'background-color':'#222','color':'#dfdfdf'});
|
||||||
$('#TB_closeAjaxWindow').css({'float':'left'});
|
$('#TB_closeAjaxWindow').css({'float':'left'});
|
||||||
$('#TB_ajaxWindowTitle').css({'float':'right'})
|
$('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
|
||||||
.append(' <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>');
|
|
||||||
|
|
||||||
$('#TB_iframeContent').width('100%');
|
$('#TB_iframeContent').width('100%');
|
||||||
|
thickDims();
|
||||||
return false;
|
return false;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
$(window).resize( function() { thickDims() } );
|
// Theme details
|
||||||
|
|
||||||
// Theme details disclosure
|
|
||||||
$('.theme-detail').click(function () {
|
$('.theme-detail').click(function () {
|
||||||
$(this).siblings('.themedetaildiv').toggle();
|
$(this).siblings('.themedetaildiv').toggle();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function tb_position() {
|
|
||||||
thickDims();
|
|
||||||
}
|
|
||||||
|
@ -1 +1 @@
|
|||||||
var thickDims;jQuery(document).ready(function(a){thickDims=function(){var d=a("#TB_window"),c=a(window).height(),b=a(window).width();if(d.size()){d.width(b-90).height(c-60);a("#TB_iframeContent").width(b-90).height(c-90);d.css({"margin-left":"-"+parseInt(((b-90)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){d.css({top:"30px","margin-top":"0"})}}return a("a.thickbox-preview").each(function(){var e=a(this).parents(".available-theme").find(".previewlink").attr("href");if(!e){return}e=e.replace(/&width=[0-9]+/g,"");e=e.replace(/&height=[0-9]+/g,"");a(this).attr("href",e+"&width="+(b-110)+"&height="+(c-100))})};thickDims().click(function(){var c=a(this).parents(".available-theme").find(".activatelink"),b="",d="";if(c.length){b=c.attr("href")||"";d=c.html()||""}a("#TB_title").css({"background-color":"#222",color:"#cfcfcf"});a("#TB_closeAjaxWindow").css({"float":"left"});a("#TB_ajaxWindowTitle").css({"float":"right"}).append(' <a href="'+b+'" target="_top" class="tb-theme-preview-link">'+d+"</a>");a("#TB_iframeContent").width("100%");return false});a(window).resize(function(){thickDims()});a(".theme-detail").click(function(){a(this).siblings(".themedetaildiv").toggle();return false})});function tb_position(){thickDims()};
|
var thickDims,tbWidth,tbHeight;jQuery(document).ready(function(a){thickDims=function(){var f=a("#TB_window"),d=a(window).height(),b=a(window).width(),c,e;c=(tbWidth&&tbWidth<b-90)?tbWidth:b-90;e=(tbHeight&&tbHeight<d-60)?tbHeight:d-60;if(f.size()){f.width(c).height(e);a("#TB_iframeContent").width(c).height(e-27);f.css({"margin-left":"-"+parseInt((c/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){f.css({top:"30px","margin-top":"0"})}}};thickDims();a(window).resize(function(){thickDims()});a("a.thickbox-preview").click(function(){var d=a(this).parents(".available-theme").find(".activatelink"),e="",b=a(this).attr("href"),c,f;if(tbWidth=b.match(/&tbWidth=[0-9]+/)){tbWidth=parseInt(tbWidth[0].replace(/[^0-9]+/g,""),10)}else{tbWidth=a(window).width()-90}if(tbHeight=b.match(/&tbHeight=[0-9]+/)){tbHeight=parseInt(tbHeight[0].replace(/[^0-9]+/g,""),10)}else{tbHeight=a(window).height()-60}if(d.length){c=d.attr("href")||"";f=d.attr("title")||"";e=' <a href="'+c+'" target="_top" class="tb-theme-preview-link">'+f+"</a>"}else{f=a(this).attr("title")||"";e=' <span class="tb-theme-preview-link">'+f+"</span>"}a("#TB_title").css({"background-color":"#222",color:"#dfdfdf"});a("#TB_closeAjaxWindow").css({"float":"left"});a("#TB_ajaxWindowTitle").css({"float":"right"}).html(e);a("#TB_iframeContent").width("100%");thickDims();return false});a(".theme-detail").click(function(){a(this).siblings(".themedetaildiv").toggle();return false})});
|
@ -181,14 +181,14 @@ foreach ( $cols as $col => $theme_name ) {
|
|||||||
$screenshot = $themes[$theme_name]['Screenshot'];
|
$screenshot = $themes[$theme_name]['Screenshot'];
|
||||||
$stylesheet_dir = $themes[$theme_name]['Stylesheet Dir'];
|
$stylesheet_dir = $themes[$theme_name]['Stylesheet Dir'];
|
||||||
$preview_link = clean_url( get_option('home') . '/');
|
$preview_link = clean_url( get_option('home') . '/');
|
||||||
$preview_link = htmlspecialchars( add_query_arg( array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true', 'width' => 600, 'height' => 400 ), $preview_link ) );
|
$preview_link = htmlspecialchars( add_query_arg( array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true' ), $preview_link ) );
|
||||||
$preview_text = attribute_escape( sprintf( __('Preview of "%s"'), $title ) );
|
$preview_text = attribute_escape( sprintf( __('Preview of "%s"'), $title ) );
|
||||||
$tags = $themes[$theme_name]['Tags'];
|
$tags = $themes[$theme_name]['Tags'];
|
||||||
$thickbox_class = 'thickbox thickbox-preview';
|
$thickbox_class = 'thickbox thickbox-preview';
|
||||||
$activate_link = wp_nonce_url("themes.php?action=activate&template=".urlencode($template)."&stylesheet=".urlencode($stylesheet), 'switch-theme_' . $template);
|
$activate_link = wp_nonce_url("themes.php?action=activate&template=".urlencode($template)."&stylesheet=".urlencode($stylesheet), 'switch-theme_' . $template);
|
||||||
$activate_text = attribute_escape( sprintf( __('Activate "%s"'), $title ) );
|
$activate_text = attribute_escape( sprintf( __('Activate "%s"'), $title ) );
|
||||||
$actions = array();
|
$actions = array();
|
||||||
$actions[] = '<a href="' . $activate_link . '" title="' . $activate_text . '">' . __('Activate') . '</a>';
|
$actions[] = '<a href="' . $activate_link . '" class="activatelink" title="' . $activate_text . '">' . __('Activate') . '</a>';
|
||||||
$actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . attribute_escape(sprintf(__('Preview "%s"'), $theme_name)) . '">' . __('Preview') . '</a>';
|
$actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . attribute_escape(sprintf(__('Preview "%s"'), $theme_name)) . '">' . __('Preview') . '</a>';
|
||||||
if ( current_user_can('update_themes') )
|
if ( current_user_can('update_themes') )
|
||||||
$actions[] = '<a class="submitdelete deletion" href="' . wp_nonce_url("themes.php?action=delete&template=$template", 'delete-theme_' . $template) . '" onclick="' . "if ( confirm('" . js_escape(sprintf( __("You are about to delete this theme '%s'\n 'Cancel' to stop, 'OK' to delete."), $theme_name )) . "') ) {return true;}return false;" . '">' . __('Delete') . '</a>';
|
$actions[] = '<a class="submitdelete deletion" href="' . wp_nonce_url("themes.php?action=delete&template=$template", 'delete-theme_' . $template) . '" onclick="' . "if ( confirm('" . js_escape(sprintf( __("You are about to delete this theme '%s'\n 'Cancel' to stop, 'OK' to delete."), $theme_name )) . "') ) {return true;}return false;" . '">' . __('Delete') . '</a>';
|
||||||
@ -196,7 +196,7 @@ foreach ( $cols as $col => $theme_name ) {
|
|||||||
|
|
||||||
$actions = implode ( ' | ', $actions );
|
$actions = implode ( ' | ', $actions );
|
||||||
?>
|
?>
|
||||||
<a href="<?php echo $activate_link; ?>" class="<?php echo $thickbox_class; ?> screenshot">
|
<a href="<?php echo $preview_link; ?>" class="<?php echo $thickbox_class; ?> screenshot">
|
||||||
<?php if ( $screenshot ) : ?>
|
<?php if ( $screenshot ) : ?>
|
||||||
<img src="<?php echo WP_CONTENT_URL . $stylesheet_dir . '/' . $screenshot; ?>" alt="" />
|
<img src="<?php echo WP_CONTENT_URL . $stylesheet_dir . '/' . $screenshot; ?>" alt="" />
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
@ -208,8 +208,6 @@ foreach ( $cols as $col => $theme_name ) {
|
|||||||
<p><?php _e('Tags:'); ?> <?php echo join(', ', $tags); ?></p>
|
<p><?php _e('Tags:'); ?> <?php echo join(', ', $tags); ?></p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php theme_update_available( $themes[$theme_name] ); ?>
|
<?php theme_update_available( $themes[$theme_name] ); ?>
|
||||||
<noscript><p class="themeactions"><a href="<?php echo $preview_link; ?>" title="<?php echo $preview_text; ?>"><?php _e('Preview'); ?></a> <a href="<?php echo $activate_link; ?>" title="<?php echo $activate_text; ?>"><?php _e('Activate'); ?></a></p></noscript>
|
|
||||||
<div style="display:none;"><a class="previewlink" href="<?php echo $preview_link; ?>"><?php echo $preview_text; ?></a> <a class="activatelink" href="<?php echo $activate_link; ?>"><?php echo $activate_text; ?></a></div>
|
|
||||||
<?php endif; // end if not empty theme_name ?>
|
<?php endif; // end if not empty theme_name ?>
|
||||||
</td>
|
</td>
|
||||||
<?php } // end foreach $cols ?>
|
<?php } // end foreach $cols ?>
|
||||||
|
@ -3006,3 +3006,29 @@ ol {
|
|||||||
.columns-prefs label {
|
.columns-prefs label {
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.theme-install-php h4,
|
||||||
|
.plugin-install-php h4 {
|
||||||
|
margin: 2.5em 0 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p.install-help {
|
||||||
|
margin: 8px 0;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
p.popular-tags {
|
||||||
|
-moz-border-radius: 8px;
|
||||||
|
-khtml-border-radius: 8px;
|
||||||
|
-webkit-border-radius: 8px;
|
||||||
|
border-radius: 8px;
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
line-height: 2em;
|
||||||
|
padding: 8px 12px 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p.popular-tags a {
|
||||||
|
padding: 0 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -353,7 +353,7 @@ function wp_default_scripts( &$scripts ) {
|
|||||||
'l10n_print_after' => 'try{convertEntities(wpGearsL10n);}catch(e){};'
|
'l10n_print_after' => 'try{convertEntities(wpGearsL10n);}catch(e){};'
|
||||||
));
|
));
|
||||||
|
|
||||||
$scripts->add( 'theme-preview', "/wp-admin/js/theme-preview$suffix.js", array( 'thickbox', 'jquery' ), '20090314' );
|
$scripts->add( 'theme-preview', "/wp-admin/js/theme-preview$suffix.js", array( 'thickbox', 'jquery' ), '20090319' );
|
||||||
$scripts->add_data( 'theme-preview', 'group', 1 );
|
$scripts->add_data( 'theme-preview', 'group', 1 );
|
||||||
|
|
||||||
$scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery-form', 'suggest' ), '20090125' );
|
$scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery-form', 'suggest' ), '20090125' );
|
||||||
@ -446,7 +446,7 @@ function wp_default_styles( &$styles ) {
|
|||||||
$styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array(), '20081210' );
|
$styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array(), '20081210' );
|
||||||
$styles->add( 'login', '/wp-admin/css/login.css', array(), '20081210' );
|
$styles->add( 'login', '/wp-admin/css/login.css', array(), '20081210' );
|
||||||
$styles->add( 'plugin-install', '/wp-admin/css/plugin-install.css', array(), '20081210' );
|
$styles->add( 'plugin-install', '/wp-admin/css/plugin-install.css', array(), '20081210' );
|
||||||
$styles->add( 'theme-install', '/wp-admin/css/theme-install.css', array(), '20090314' );
|
$styles->add( 'theme-install', '/wp-admin/css/theme-install.css', array(), '20090319' );
|
||||||
$styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.2' );
|
$styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.2' );
|
||||||
|
|
||||||
foreach ( $rtl_styles as $rtl_style )
|
foreach ( $rtl_styles as $rtl_style )
|
||||||
|
Loading…
Reference in New Issue
Block a user