]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/widgets.php
Wordpress 3.0.6
[autoinstalls/wordpress.git] / wp-admin / widgets.php
index e28f46ae9712529f3c90542b84e8bd3085dd8a90..d3c401b19fbc0978246a7db9ee2183d124319970 100644 (file)
@@ -7,12 +7,12 @@
  */
 
 /** WordPress Administration Bootstrap */
-require_once( 'admin.php' );
+require_once( './admin.php' );
 
 /** WordPress Administration Widgets API */
 require_once(ABSPATH . 'wp-admin/includes/widgets.php');
 
-if ( ! current_user_can('switch_themes') )
+if ( ! current_user_can('edit_theme_options') )
        wp_die( __( 'Cheatin’ uh?' ));
 
 wp_admin_css( 'widgets' );
@@ -33,6 +33,19 @@ do_action( 'sidebar_admin_setup' );
 $title = __( 'Widgets' );
 $parent_file = 'themes.php';
 
+$help = '
+       <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>' . __('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>
+       <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&#8217;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>
+       <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>
+';
+$help .= '<p><strong>' . __('For more information:') . '</strong></p>';
+$help .= '<p>' . __('<a href="http://codex.wordpress.org/Appearance_Widgets_SubPanel" target="_blank">Widgets Documentation</a>') . '</p>';
+$help .= '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>';
+add_contextual_help($current_screen, $help);
+
 // register the inactive_widgets area as sidebar
 register_sidebar(array(
        'name' => __('Inactive Widgets'),
@@ -120,7 +133,7 @@ retrieve_widgets();
 
 if ( count($wp_registered_sidebars) == 1 ) {
        // If only "wp_inactive_widgets" is defined the theme has no sidebars, die.
-       require_once( 'admin-header.php' );
+       require_once( './admin-header.php' );
 ?>
 
        <div class="wrap">
@@ -133,7 +146,7 @@ if ( count($wp_registered_sidebars) == 1 ) {
        </div>
 
 <?php
-       require_once( 'admin-footer.php' );
+       require_once( './admin-footer.php' );
        exit;
 }
 
@@ -244,7 +257,7 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) {
        $width = ' style="width:' . max($control['width'], 350) . 'px"';
        $key = isset($_GET['key']) ? (int) $_GET['key'] : 0;
 
-       require_once( 'admin-header.php' ); ?>
+       require_once( './admin-header.php' ); ?>
        <div class="wrap">
        <?php screen_icon(); ?>
        <h2><?php echo esc_html( $title ); ?></h2>
@@ -279,7 +292,7 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) {
                        }
                        $selected = '';
                        echo "\t\t<select name='{$sbname}_position'>\n";
-                       echo "\t\t<option value=''>" . __('-- select --') . "</option>\n";
+                       echo "\t\t<option value=''>" . __('&mdash; Select &mdash;') . "</option>\n";
                        for ( $i = 1; $i <= $j; $i++ ) {
                                if ( in_array($widget_id, $sidebars_widgets[$sbname], true) )
                                        $selected = selected( $i, $key + 1, false );
@@ -309,7 +322,7 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) {
        </div>
        </div>
 <?php
-       require_once( 'admin-footer.php' );
+       require_once( './admin-footer.php' );
        exit;
 }
 
@@ -322,19 +335,21 @@ $errors = array(
        __('Error in displaying the widget settings form.')
 );
 
-require_once( 'admin-header.php' ); ?>
+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 fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
+<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">
@@ -355,7 +370,7 @@ require_once( 'admin-header.php' ); ?>
                <div class="sidebar-name">
                <div class="sidebar-name-arrow"><br /></div>
                <h3><?php _e('Inactive Widgets'); ?>
-               <span><img src="images/wpspin_light.gif" class="ajax-feedback" title="" alt="" /></span></h3></div>
+               <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'); ?>
@@ -377,7 +392,7 @@ foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) {
        <div class="sidebar-name">
        <div class="sidebar-name-arrow"><br /></div>
        <h3><?php echo esc_html( $registered_sidebar['name'] ); ?>
-       <span><img src="images/wpspin_dark.gif" class="ajax-feedback" title="" alt="" /></span></h3></div>
+       <span><img src="<?php echo esc_url( admin_url( 'images/wpspin_dark.gif' ) ); ?>" class="ajax-feedback" title="" alt="" /></span></h3></div>
        <?php wp_list_widget_controls( $sidebar ); // Show the control forms for each of the widgets in this sidebar ?>
        </div>
 <?php
@@ -393,4 +408,4 @@ foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) {
 
 <?php
 do_action( 'sidebar_admin_page' );
-require_once( 'admin-footer.php' );
+require_once( './admin-footer.php' );