Moves orphaned sidebars to main content area above Inactive Widgets, props aaroncampbell, see #17979
git-svn-id: http://svn.automattic.com/wordpress/trunk@18631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4852c5887f
commit
d83b14c165
File diff suppressed because one or more lines are too long
|
@ -408,7 +408,7 @@ table.ie-fixed {
|
|||
width: 99%;
|
||||
}
|
||||
|
||||
#wp_inactive_widgets {
|
||||
.inactive-sidebar .widgets-sortables {
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
|
@ -437,7 +437,7 @@ table.ie-fixed {
|
|||
}
|
||||
|
||||
.widget-liquid-right .widget,
|
||||
#wp_inactive_widgets .widget {
|
||||
.inactive-sidebar .widget {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -2160,7 +2160,7 @@ div.widget-liquid-right {
|
|||
clear: left;
|
||||
}
|
||||
|
||||
#wp_inactive_widgets .widget {
|
||||
.inactive-sidebar .widget {
|
||||
float: right;
|
||||
}
|
||||
|
||||
|
@ -2172,7 +2172,7 @@ div.sidebar-name h3 {
|
|||
float: right;
|
||||
}
|
||||
|
||||
#wp_inactive_widgets .widget-placeholder {
|
||||
.inactive-sidebar .widget-placeholder {
|
||||
float: right;
|
||||
}
|
||||
|
||||
|
@ -2189,4 +2189,3 @@ div.sidebar-name h3 {
|
|||
float: left;
|
||||
}
|
||||
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -7285,7 +7285,7 @@ div.widget-liquid-right {
|
|||
}
|
||||
|
||||
.widget-liquid-right .widget,
|
||||
#wp_inactive_widgets .widget,
|
||||
.inactive-sidebar .widget,
|
||||
.widget-liquid-right .sidebar-description {
|
||||
width: 250px;
|
||||
margin: 0 auto 20px;
|
||||
|
@ -7296,7 +7296,7 @@ div.widget-liquid-right {
|
|||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#wp_inactive_widgets .widget {
|
||||
.inactive-sidebar .widget {
|
||||
margin: 0 10px 20px;
|
||||
float: left;
|
||||
}
|
||||
|
@ -7370,7 +7370,7 @@ div.sidebar-name {
|
|||
box-shadow: none;
|
||||
}
|
||||
|
||||
#wp_inactive_widgets {
|
||||
.inactive-sidebar {
|
||||
padding: 5px 5px 0;
|
||||
}
|
||||
|
||||
|
@ -7403,7 +7403,7 @@ div.sidebar-name {
|
|||
width: 250px;
|
||||
}
|
||||
|
||||
#wp_inactive_widgets .widget-placeholder {
|
||||
.inactive-sidebar .widget-placeholder {
|
||||
margin: 0 10px 20px;
|
||||
float: left;
|
||||
}
|
||||
|
@ -7542,7 +7542,7 @@ a.widget-control-edit {
|
|||
|
||||
#available-widgets .widget-control-edit .add,
|
||||
#widgets-right .widget-control-edit .edit,
|
||||
#wp_inactive_widgets .widget-control-edit .edit {
|
||||
.inactive-sidebar .widget-control-edit .edit {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
|
@ -7562,7 +7562,7 @@ a.widget-control-edit {
|
|||
}
|
||||
|
||||
.inactive p.description {
|
||||
margin: 5px 15px 8px;
|
||||
margin: 5px 15px 10px;
|
||||
}
|
||||
|
||||
#available-widgets p.description {
|
||||
|
@ -7636,4 +7636,3 @@ a.widget-control-edit {
|
|||
.widgets_access .widget .widget-top {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
|
|
|
@ -135,8 +135,8 @@ wpWidgets = {
|
|||
wpWidgets.saveOrder(sb);
|
||||
},
|
||||
receive: function(e, ui) {
|
||||
if ( !$(this).is(':visible') )
|
||||
$(this).sortable('cancel');
|
||||
if ( !$(this).is(':visible') || this.id.indexOf('orphaned_widgets') != -1 )
|
||||
$(ui.sender).sortable('cancel');
|
||||
}
|
||||
}).sortable('option', 'connectWith', 'div.widgets-sortables').parent().filter('.closed').children('.widgets-sortables').sortable('disable');
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -50,25 +50,16 @@ $sidebars_widgets = wp_get_sidebars_widgets();
|
|||
if ( empty( $sidebars_widgets ) )
|
||||
$sidebars_widgets = wp_get_widget_defaults();
|
||||
|
||||
// register the inactive_widgets area as sidebar
|
||||
register_sidebar(array(
|
||||
'name' => __('Inactive Widgets'),
|
||||
'id' => 'wp_inactive_widgets',
|
||||
'class' => 'inactive',
|
||||
'description' => '',
|
||||
'before_widget' => '',
|
||||
'after_widget' => '',
|
||||
'before_title' => '',
|
||||
'after_title' => '',
|
||||
));
|
||||
|
||||
foreach ( $sidebars_widgets as $sidebar_id => $widgets ) {
|
||||
if ( 'wp_inactive_widgets' == $sidebar_id )
|
||||
continue;
|
||||
|
||||
if ( empty( $wp_registered_sidebars[ $sidebar_id ] ) && ! empty( $widgets ) ) {
|
||||
// register the inactive_widgets area as sidebar
|
||||
register_sidebar(array(
|
||||
'name' => __( 'Inactive Widgets (Previous Theme)' ),
|
||||
'name' => __( 'Inactive Sidebar (from previous theme)' ),
|
||||
'id' => $sidebar_id,
|
||||
'class' => 'orphaned',
|
||||
'class' => 'inactive-sidebar orphan-sidebar',
|
||||
'description' => __( 'This is a left over sidebar from an old theme and does not show anywhere on your site' ),
|
||||
'before_widget' => '',
|
||||
'after_widget' => '',
|
||||
|
@ -78,6 +69,18 @@ foreach ( $sidebars_widgets as $sidebar_id => $widgets ) {
|
|||
}
|
||||
}
|
||||
|
||||
// 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();
|
||||
|
||||
if ( count($wp_registered_sidebars) == 1 ) {
|
||||
|
@ -228,7 +231,7 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) {
|
|||
<?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 ) {
|
||||
if ( 'wp_inactive_widgets' == $sbname || 'orphaned_widgets' == substr( $sbname, 0, 16 ) ) {
|
||||
echo ' ';
|
||||
} else {
|
||||
if ( !isset($sidebars_widgets[$sbname]) || !is_array($sidebars_widgets[$sbname]) ) {
|
||||
|
@ -317,17 +320,32 @@ require_once( './admin-header.php' ); ?>
|
|||
<br class="clear" />
|
||||
</div>
|
||||
|
||||
<div class="widgets-holder-wrap">
|
||||
<?php
|
||||
foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) {
|
||||
if ( 'wp_inactive_widgets' == $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 esc_attr_e( $wrap_class ); ?>">
|
||||
<div class="sidebar-name">
|
||||
<div class="sidebar-name-arrow"><br /></div>
|
||||
<h3><?php _e('Inactive Widgets'); ?>
|
||||
<span><img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-feedback" title="" alt="" /></span></h3></div>
|
||||
<h3><?php esc_html_e( $registered_sidebar['name'] ); ?>
|
||||
<span><img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-feedback" title="" alt="" /></span>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="widget-holder inactive">
|
||||
<p class="description"><?php _e('Drag widgets here to remove them from the sidebar but keep their settings.'); ?></p>
|
||||
<?php wp_list_widget_controls('wp_inactive_widgets'); ?>
|
||||
<?php wp_list_widget_controls( $registered_sidebar['id'] ); ?>
|
||||
<br class="clear" />
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -336,7 +354,7 @@ require_once( './admin-header.php' ); ?>
|
|||
<?php
|
||||
$i = 0;
|
||||
foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) {
|
||||
if ( 'wp_inactive_widgets' == $sidebar )
|
||||
if ( 'wp_inactive_widgets' == $sidebar || 'orphaned_widgets' == substr( $sidebar, 0, 16 ) )
|
||||
continue;
|
||||
|
||||
$wrap_class = 'widgets-holder-wrap';
|
||||
|
|
|
@ -313,7 +313,7 @@ function wp_default_scripts( &$scripts ) {
|
|||
|
||||
$scripts->add( 'admin-gallery', "/wp-admin/js/gallery$suffix.js", array( 'jquery-ui-sortable' ), '20110414' );
|
||||
|
||||
$scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), '20110601', 1 );
|
||||
$scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), '20110902', 1 );
|
||||
|
||||
$scripts->add( 'theme', "/wp-admin/js/theme$suffix.js", array( 'thickbox' ), '20110118', 1 );
|
||||
|
||||
|
@ -402,9 +402,9 @@ function wp_default_styles( &$styles ) {
|
|||
// Any rtl stylesheets that don't have a .dev version for ltr
|
||||
$no_suffix = array( 'farbtastic' );
|
||||
|
||||
$styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array(), '20110830' );
|
||||
$styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array(), '20110902' );
|
||||
|
||||
$styles->add( 'ie', "/wp-admin/css/ie$suffix.css", array('wp-admin'), '20110711' );
|
||||
$styles->add( 'ie', "/wp-admin/css/ie$suffix.css", array('wp-admin'), '20110902' );
|
||||
$styles->add_data( 'ie', 'conditional', 'lte IE 7' );
|
||||
|
||||
// all colors stylesheets need to have the same query strings (cache manifest compat)
|
||||
|
|
Loading…
Reference in New Issue