]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/widgets.php
Wordpress 2.6.2
[autoinstalls/wordpress.git] / wp-admin / includes / widgets.php
index da8b822777f73e4316b4216feaca611e6af40785..52d1d7b1ca9f8d3171e11f4e66d344f42f7977ef 100644 (file)
@@ -64,7 +64,7 @@ function wp_list_widgets( $show = 'all', $_search = false ) {
                                if ( 'all' == $show && $is_multi ) {
                                        // it's a multi-widget.  We only need to show it in the list once.
                                        $already_shown[] = $widget['callback'];
-                                       $num = (int) array_pop( explode( '-', $widget['id'] ) );
+                                       $num = (int) array_pop( $ids = explode( '-', $widget['id'] ) );
                                        $id_base = $wp_registered_widget_controls[$widget['id']]['id_base'];
                                        // so that we always add a new one when clicking "add"
                                        while ( isset($wp_registered_widgets["$id_base-$num"]) )
@@ -76,7 +76,7 @@ function wp_list_widgets( $show = 'all', $_search = false ) {
                                }
                                $add_query['add'] = $widget['id'];
                                $action = 'add';
-                               $add_url = wp_nonce_url( add_query_arg( $add_query ), "add-widget_$widget[id]" );
+                               $add_url = clean_url( wp_nonce_url( add_query_arg( $add_query ), "add-widget_$widget[id]" ) );
                        } else {
                                $action = 'edit';
                                $edit_url = clean_url( add_query_arg( array(
@@ -102,7 +102,7 @@ function wp_list_widgets( $show = 'all', $_search = false ) {
                <li id="widget-list-item-<?php echo attribute_escape( $widget['id'] ); ?>" class="widget-list-item">
                        <h4 class="widget-title widget-draggable">
 
-                               <?php echo $widget_title; ?>
+                               <span><?php echo $widget_title; ?></span>
 
                                <?php if ( 'add' == $action ) : ?>
 
@@ -116,6 +116,8 @@ function wp_list_widgets( $show = 'all', $_search = false ) {
 
                                <?php endif; ?>
 
+                               <br class="clear" />
+
                        </h4>
 
 
@@ -227,11 +229,12 @@ function wp_widget_control( $sidebar_args ) {
        if ( empty($sidebar_args['_display']) || 'template' != $sidebar_args['_display'] )
                echo $sidebar_args['before_widget'];
 ?>
-               <h4 class="widget-title"><?php echo $widget_title ?>
+               <div class="widget-top">
+               <h4 class="widget-title"><span><?php echo $widget_title ?></span>
 
                        <?php if ( $edit ) : ?>
 
-                       <a class="widget-action widget-control-edit" href="<?php echo remove_query_arg( array( 'edit', 'key' ) ); ?>"><?php _e('Cancel'); ?></a>
+                       <a class="widget-action widget-control-edit" href="<?php echo clean_url( remove_query_arg( array( 'edit', 'key' ) ) ); ?>"><?php _e('Cancel'); ?></a>
 
                        <?php else : ?>
 
@@ -239,7 +242,9 @@ function wp_widget_control( $sidebar_args ) {
 
                        <?php endif; ?>
 
-               </h4>
+                       <br class="clear" />
+
+               </h4></div>
 
                <div class="widget-control"<?php if ( $edit ) echo ' style="display: block;"'; ?>>
 
@@ -281,10 +286,4 @@ function wp_widget_control_ob_filter( $string ) {
        return trim( wp_specialchars( strip_tags( $string ) ) );
 }
 
-function widget_css() {
-       wp_admin_css( 'css/widgets' );
-}
-
-add_action( 'admin_head', 'widget_css' );
-
 ?>