diff --git a/.htaccess.sample b/.htaccess.sample
index 9cd0e98f20a39d4dc745705af278cc8525d47f3a..d6ad2fdfb4baddc26a432bc6df73fb6464f00a6e 100644
--- a/.htaccess.sample
+++ b/.htaccess.sample
@@ -13,9 +13,6 @@ Options -Indexes
 # Follow symbolic links in this directory.
 Options +FollowSymLinks
 
-# Multiviews creates problems with aliased URLs and is not needed for Drupal.
-Options -Multiviews
-
 # Make Drupal handle any 404 errors.
 ErrorDocument 404 /index.php
 
@@ -148,5 +145,3 @@ DirectoryIndex index.php index.html index.htm
     </FilesMatch>
   </IfModule>
 </IfModule>
-
-# $Id: .htaccess,v 1.111 2010/11/23 02:59:05 dries Exp $
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 9807f2eb407c98f59d3c1baa97ef310b36b2d3e3..131e172414fe073a1f7f4fd80fba55f1d28a8806 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,6 +1,23 @@
-// $Id: CHANGELOG.txt,v 1.396 2011/01/05 06:17:58 webchick Exp $
 
-Drupal 7.0, 2011-01-05
+Drupal 7.2, 2011-05-25
+----------------------
+- Added a default .gitignore file.
+- Improved PostgreSQL and SQLite support.
+- Numerous critical performance improvements.
+- Numerous critical fixes to the upgrade path.
+- Numerous fixes to language and translation systems.
+- Numerous fixes to AJAX and #states systems.
+- Improvements to the locking system.
+- Numerous documentation fixes.
+- Numerous styling and theme system fixes.
+- Numerous fixes for schema mis-matches between Drupal 6 and 7.
+- Minor internal API clean-ups.
+
+Drupal 7.1, 2011-05-25
+----------------------
+- Fixed security issues (Cross site scripting, File access bypass), see SA-CORE-2011-001.
+
+Drupal 7.0, 2011-01-05 
 ----------------------
 - Database:
     * Fully rewritten database layer utilizing PHP 5's PDO abstraction layer.
@@ -103,7 +120,7 @@ Drupal 7.0, 2011-01-05
       are available.
 - OpenID:
     * Added support for Gmail and Google Apps for Domain identifiers. Users can
-      now login with their user@domain.com identifier when domain.com is powered
+      now login with their user@example.com identifier when example.com is powered
       by Google.
     * Made the OpenID module more pluggable.
 - Added code registry:
@@ -219,6 +236,156 @@ Drupal 7.0, 2011-01-05
     * Added a locking framework to coordinate long-running operations across
       requests.
 
+Drupal 6.22, 2011-05-25
+-----------------------
+- Made Drupal 6 work better with IIS and Internet Explorer.
+- Fixed .po file imports to work better with custom textgroups.
+- Improved code documentation at various places.
+- Fixed a variety of other bugs.
+
+Drupal 6.21, 2011-05-25
+----------------------
+- Fixed security issues (Cross site scripting), see SA-CORE-2011-001.
+
+Drupal 6.20, 2010-12-15
+----------------------
+- Fixed a variety of small bugs, improved code documentation.
+
+Drupal 6.19, 2010-08-11
+----------------------
+- Fixed a variety of small bugs, improved code documentation.
+
+Drupal 6.18, 2010-08-11
+----------------------
+- Fixed security issues (OpenID authentication bypass, File download access
+  bypass, Comment unpublishing bypass, Actions cross site scripting),
+  see SA-CORE-2010-002.
+
+Drupal 6.17, 2010-06-02
+----------------------
+- Improved PostgreSQL compatibility
+- Better PHP 5.3 and PHP 4 compatibility
+- Better browser compatibility of CSS and JS aggregation
+- Improved logging for login failures
+- Fixed an incompatibility with some contributed modules and the locking system
+- Fixed a variety of other bugs.
+
+Drupal 6.16, 2010-03-03
+----------------------
+- Fixed security issues (Installation cross site scripting, Open redirection,
+  Locale module cross site scripting, Blocked user session regeneration),
+  see SA-CORE-2010-001.
+- Better support for updated jQuery versions.
+- Reduced resource usage of update.module.
+- Fixed several issues relating to support of install profiles and
+  distributions.
+- Added a locking framework to avoid data corruption on long operations.
+- Fixed a variety of other bugs.
+
+Drupal 6.15, 2009-12-16
+----------------------
+- Fixed security issues (Cross site scripting), see SA-CORE-2009-009.
+- Fixed a variety of other bugs.
+
+Drupal 6.14, 2009-09-16
+----------------------
+- Fixed security issues (OpenID association cross site request forgeries,
+  OpenID impersonation and File upload), see SA-CORE-2009-008.
+- Changed the system modules page to not run all cache rebuilds; use the
+  button on the performance settings page to achieve the same effect.
+- Added support for PHP 5.3.0 out of the box.
+- Fixed a variety of small bugs.
+
+Drupal 6.13, 2009-07-01
+----------------------
+- Fixed security issues (Cross site scripting, Input format access bypass and
+  Password leakage in URL), see SA-CORE-2009-007.
+- Fixed a variety of small bugs.
+
+Drupal 6.12, 2009-05-13
+----------------------
+- Fixed security issues (Cross site scripting), see SA-CORE-2009-006.
+- Fixed a variety of small bugs.
+
+Drupal 6.11, 2009-04-29
+----------------------
+- Fixed security issues (Cross site scripting and limited information
+  disclosure), see SA-CORE-2009-005
+- Fixed performance issues with the menu router cache, the update
+  status cache and improved cache invalidation
+- Fixed a variety of small bugs.
+
+Drupal 6.10, 2009-02-25
+----------------------
+- Fixed a security issue, (Local file inclusion on Windows),
+  see SA-CORE-2009-003
+- Fixed node_feed() so custom fields can show up in RSS feeds.
+- Improved PostgreSQL compatibility.
+- Fixed a variety of small bugs.
+
+Drupal 6.9, 2009-01-14
+----------------------
+- Fixed security issues, (Access Bypass, Validation Bypass and Hardening
+  against SQL injection), see SA-CORE-2009-001
+- Made HTTP request checking more robust and informative.
+- Fixed HTTP_HOST checking to work again with HTTP 1.0 clients and
+  basic shell scripts.
+- Removed t() calls from all schema documentation. Suggested best practice
+  changed for contributed modules, see http://drupal.org/node/322731.
+- Fixed a variety of small bugs.
+
+Drupal 6.8, 2008-12-11
+----------------------
+- Removed a previous change incompatible with PHP 5.1.x and lower.
+
+Drupal 6.7, 2008-12-10
+----------------------
+- Fixed security issues, (Cross site request forgery and Cross site scripting), see SA-2008-073
+- Updated robots.txt and .htaccess to match current file use.
+- Fixed a variety of small bugs.
+
+Drupal 6.6, 2008-10-22
+----------------------
+- Fixed security issues, (File inclusion, Cross site scripting), see SA-2008-067
+- Fixed a variety of small bugs.
+
+Drupal 6.5, 2008-10-08
+----------------------
+- Fixed security issues, (File upload access bypass, Access rules bypass,
+  BlogAPI access bypass), see SA-2008-060.
+- Fixed a variety of small bugs.
+
+Drupal 6.4, 2008-08-13
+----------------------
+- Fixed a security issue (Cross site scripting, Arbitrary file uploads via
+  BlogAPI, Cross site request forgeries and Various Upload module
+  vulnerabilities), see SA-2008-047.
+- Improved error messages during installation.
+- Fixed a bug that prevented AHAH handlers to be attached to radios widgets.
+- Fixed a variety of small bugs.
+
+Drupal 6.3, 2008-07-09
+----------------------
+- Fixed security issues, (Cross site scripting, cross site request forgery,
+  session fixation and SQL injection), see SA-2008-044.
+- Slightly modified installation process to prevent file ownership issues on
+  shared hosts.
+- Improved PostgreSQL compatibility (rewritten queries; custom blocks).
+- Upgraded to jQuery 1.2.6.
+- Performance improvements to search, menu handling and form API caches.
+- Fixed Views compatibility issues (Views for Drupal 6 requires Drupal 6.3+).
+- Fixed a variety of small bugs.
+
+Drupal 6.2, 2008-04-09
+----------------------
+- Fixed a variety of small bugs.
+- Fixed a security issue (Access bypasses), see SA-2008-026.
+
+Drupal 6.1, 2008-02-27
+----------------------
+- Fixed a variety of small bugs.
+- Fixed a security issue (Cross site scripting), see SA-2008-018.
+
 Drupal 6.0, 2008-02-13
 ----------------------
 - New, faster and better menu system.
@@ -321,6 +488,95 @@ Drupal 6.0, 2008-02-13
 - Removed old system updates. Updates from Drupal versions prior to 5.x will
   require upgrading to 5.x before upgrading to 6.x.
 
+Drupal 5.23, 2010-08-11
+-----------------------
+- Fixed security issues (File download access bypass, Comment unpublishing
+  bypass), see SA-CORE-2010-002.
+
+Drupal 5.22, 2010-03-03
+-----------------------
+- Fixed security issues (Open redirection, Locale module cross site scripting,
+  Blocked user session regeneration), see SA-CORE-2010-001.
+
+Drupal 5.21, 2009-12-16
+-----------------------
+- Fixed a security issue (Cross site scripting), see SA-CORE-2009-009.
+- Fixed a variety of small bugs.
+
+Drupal 5.20, 2009-09-16
+-----------------------
+- Avoid security problems resulting from writing Drupal 6-style menu
+  declarations.
+- Fixed security issues (session fixation), see SA-CORE-2009-008.
+- Fixed a variety of small bugs.
+
+Drupal 5.19, 2009-07-01
+-----------------------
+- Fixed security issues (Cross site scripting and Password leakage in URL), see
+  SA-CORE-2009-007.          
+- Fixed a variety of small bugs.
+
+Drupal 5.18, 2009-05-13
+-----------------------
+- Fixed security issues (Cross site scripting), see SA-CORE-2009-006.
+- Fixed a variety of small bugs.
+
+Drupal 5.17, 2009-04-29
+-----------------------
+- Fixed security issues (Cross site scripting and limited information
+  disclosure) see SA-CORE-2009-005.
+- Fixed a variety of small bugs.
+
+Drupal 5.16, 2009-02-25
+-----------------------
+- Fixed a security issue, (Local file inclusion on Windows), see SA-CORE-2009-004.
+- Fixed a variety of small bugs.
+
+Drupal 5.15, 2009-01-14
+-----------------------
+- Fixed security issues, (Hardening against SQL injection), see
+  SA-CORE-2009-001
+- Fixed HTTP_HOST checking to work again with HTTP 1.0 clients and basic shell
+  scripts.
+- Fixed a variety of small bugs.
+
+Drupal 5.14, 2008-12-11
+-----------------------
+- removed a previous change incompatible with PHP 5.1.x and lower.
+
+Drupal 5.13, 2008-12-10
+-----------------------
+- fixed a variety of small bugs.
+- fixed security issues, (Cross site request forgery and Cross site scripting), see SA-2008-073
+- updated robots.txt and .htaccess to match current file use.
+
+Drupal 5.12, 2008-10-22
+-----------------------
+- fixed security issues, (File inclusion), see SA-2008-067
+
+Drupal 5.11, 2008-10-08
+-----------------------
+- fixed a variety of small bugs.
+- fixed security issues, (File upload access bypass, Access rules bypass,
+  BlogAPI access bypass, Node validation bypass), see SA-2008-060
+
+Drupal 5.10, 2008-08-13
+-----------------------
+- fixed a variety of small bugs.
+- fixed security issues, (Cross site scripting, Arbitrary file uploads via
+  BlogAPI and Cross site request forgery), see SA-2008-047
+
+Drupal 5.9, 2008-07-23
+----------------------
+- fixed a variety of small bugs.
+- fixed security issues, (Session fixation), see SA-2008-046
+
+Drupal 5.8, 2008-07-09
+----------------------
+- fixed a variety of small bugs.
+- fixed security issues, (Cross site scripting, cross site request forgery, and
+  session fixation), see SA-2008-044
+
 Drupal 5.7, 2008-01-28
 ----------------------
 - fixed the input format configuration page.
diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt
index 3faeeb849f11f73ecfe375a09b40b1f1da7f43ab..e98347441a00afbe68b53021667ab73112d01ec9 100644
--- a/COPYRIGHT.txt
+++ b/COPYRIGHT.txt
@@ -1,10 +1,10 @@
-// $Id: COPYRIGHT.txt,v 1.6 2010/01/02 10:20:21 dries Exp $
 
 All Drupal code is Copyright 2001 - 2010 by the original authors.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation.
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
 
 This program is distributed in the hope that it will be useful, but
 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
diff --git a/INSTALL.mysql.txt b/INSTALL.mysql.txt
index 2bd3a4bc452d12ef80661116cdf814bf66b9eb25..a7c292e3171e1c1b7a6c142b00862b1a94989b8c 100644
--- a/INSTALL.mysql.txt
+++ b/INSTALL.mysql.txt
@@ -1,12 +1,11 @@
-// $Id: INSTALL.mysql.txt,v 1.12 2010/01/11 16:25:15 webchick Exp $
 
 CREATE THE MySQL DATABASE
 --------------------------
 
-This step is only necessary if you don't already have a database set-up (e.g. by
-your host). In the following examples, 'username' is an example MySQL user which
-has the CREATE and GRANT privileges. Use the appropriate user name for your
-system.
+This step is only necessary if you don't already have a database set up (e.g.,
+by your host). In the following examples, 'username' is an example MySQL user
+which has the CREATE and GRANT privileges. Use the appropriate user name for
+your system.
 
 First, you must create a new database for your Drupal site (here, 'databasename'
 is the name of the new database):
diff --git a/INSTALL.pgsql.txt b/INSTALL.pgsql.txt
index c6ee6e75dd7955cc1d39f3bf4f76d2f4483fed92..8fe80433bd67d4659831ceaa729c534c70544c16 100644
--- a/INSTALL.pgsql.txt
+++ b/INSTALL.pgsql.txt
@@ -1,4 +1,3 @@
-// $Id: INSTALL.pgsql.txt,v 1.9 2010/04/07 15:07:58 dries Exp $
 
 CREATE THE PostgreSQL DATABASE
 ------------------------------
@@ -7,38 +6,39 @@ Note that the database must be created with UTF-8 (Unicode) encoding.
 
 1. CREATE DATABASE USER
 
-   This step is only necessary if you don't already have a user set up (e.g.
-   by your host) or you want to create new user for use with Drupal only. The
-   following command creates a new user named "username" and asks for a
-   password for that user:
+   This step is only necessary if you don't already have a user set up (e.g., by
+   your host), or want to create a new user for use with Drupal only. The
+   following command creates a new user named 'username' and asks for a password
+   for that user:
 
      createuser --pwprompt --encrypted --no-createrole --no-createdb username
 
-   If there are no errors then the command was successful
+   If there are no errors, then the command was successful.
 
-2. CREATE THE DRUPAL DATABASE
+2. CREATE DRUPAL DATABASE
 
-   This step is only necessary if you don't already have a database set up (e.g.
-   by your host) or you want to create new database for use with Drupal only.
-   The following command creates a new database named "databasename", which is
-   owned by previously created "username":
+   This step is only necessary if you don't already have a database set up
+   (e.g., by your host) or want to create a new database for use with Drupal
+   only. The following command creates a new database named 'databasename',
+   which is owned by the previously created 'username':
 
      createdb --encoding=UTF8 --owner=username databasename
 
-   If there are no errors then the command was successful
+   If there are no errors, then the command was successful.
 
-3. CREATE A SCHEMA OR SCHEMAS (Optional advanced)
+3. CREATE SCHEMA OR SCHEMAS (Optional advanced step)
 
-  Drupal will run across different schemas within your database if you so wish.
-  By default, Drupal runs inside the 'public' schema but you can use $db_prefix
-  inside settings.php to define a schema for Drupal to inside of or specify tables
-  that are shared inside of a separate schema. Drupal will not create schemas for
-  you, infact the user that Drupal runs as should not be allowed to. You'll need
-  execute the SQL below as a superuser (such as a postgres user) and replace
-  'drupaluser' with the username that Drupal uses to connect to PostgreSQL with
-  and replace schema_name with a schema name you wish to use such as 'shared':
+   Drupal will run across different schemas within your database if you so wish.
+   By default, Drupal runs inside the 'public' schema but you can use $db_prefix
+   inside settings.php to define a schema for Drupal to run inside of, or
+   specify tables that are shared inside of a separate schema. Drupal will not
+   create schemas for you. In fact, the user that Drupal runs as should not be
+   allowed to do this. You'll need to execute the SQL below as a superuser,
+   replace 'username' with the username that Drupal uses to connect to
+   PostgreSQL, and replace 'schema_name' with a schema name you wish to use,
+   such as 'shared':
 
-    CREATE SCHEMA schema_name AUTHORIZATION drupaluser;
+     CREATE SCHEMA schema_name AUTHORIZATION username;
 
-  Do this for as many schemas as you need. See default.settings.php for how to
-  set which tables use which schemas.
+   Do this for as many schemas as you need. See default.settings.php for
+   instructions on how to set which tables use which schemas.
diff --git a/INSTALL.sqlite.txt b/INSTALL.sqlite.txt
index 9c4f754a8c65d7732eeebf3bbd63766f109bcbc5..8e57d60cc0d793862706f41dcfdcef5252fdb1e8 100644
--- a/INSTALL.sqlite.txt
+++ b/INSTALL.sqlite.txt
@@ -1,20 +1,19 @@
-// $Id: INSTALL.sqlite.txt,v 1.4 2010/11/29 02:55:57 webchick Exp $
 
 SQLITE REQUIREMENTS
 -------------------
 
-To use SQLite with your Drupal installation, the following requirements must
-be met: server has PHP 5.2 or later with PDO, and the PDO SQLite driver must
-be enabled.
+To use SQLite with your Drupal installation, the following requirements must be
+met: Server has PHP 5.2 or later with PDO, and the PDO SQLite driver must be
+enabled.
 
 SQLITE DATABASE CREATION
 ------------------------
 
 The Drupal installer will create the SQLite database for you. The only
-requirement is the installer must have write permissions the directory where
-the database file resides. This directory (not just the database file) also has
-to remain writeable by the web server going forward for SQLite to continue to be
-able to operate.
+requirement is that the installer must have write permissions to the directory
+where the database file resides. This directory (not just the database file) also
+has to remain writeable by the web server going forward for SQLite to continue to
+be able to operate.
 
 On the "Database configuration" form in the "Database file" field, you must
 supply the exact path to where you wish your database file to reside. It is
diff --git a/INSTALL.txt b/INSTALL.txt
index 95fa415604dc4959fed1d47507017b959afb72a4..7b526e33c45aa97047b70cda0fd0e6337823f431 100644
--- a/INSTALL.txt
+++ b/INSTALL.txt
@@ -1,4 +1,3 @@
-// $Id: INSTALL.txt,v 1.87 2011/01/01 22:41:24 webchick Exp $
 
 CONTENTS OF THIS FILE
 ---------------------
@@ -10,7 +9,6 @@ CONTENTS OF THIS FILE
  * Multisite configuration
  * More information
 
-
 REQUIREMENTS AND NOTES
 ----------------------
 
@@ -27,24 +25,23 @@ Drupal requires:
 
 For more detailed information about Drupal requirements, including a list of
 PHP extensions and configurations that are required, see "System requirements"
-(http://drupal.org/requirements) in the Drupal handbook.
+(http://drupal.org/requirements) in the Drupal.org online documentation.
 
 For detailed information on how to configure a test server environment using a
 variety of operating systems and web servers, see "Local server setup"
-(http://drupal.org/node/157602) in the Drupal handbook.
+(http://drupal.org/node/157602) in the Drupal.org online documentation.
 
 Note that all directories mentioned in this document are always relative to the
 directory of your Drupal installation, and commands are meant to be run from
 this directory (except for the initial commands that create that directory).
 
-
 OPTIONAL SERVER REQUIREMENTS
 ----------------------------
 
 - If you want to use Drupal's "Clean URLs" feature on an Apache web server, you
   will need the mod_rewrite module and the ability to use local .htaccess
-  files. For Clean URLs support on IIS, see "Using Clean URLs with IIS"
-  (http://drupal.org/node/3854) in the Drupal handbook.
+  files. For Clean URLs support on IIS, see "Clean URLs with IIS"
+  (http://drupal.org/node/3854) in the Drupal.org online documentation.
 
 - If you plan to use XML-based services such as RSS aggregation, you will need
   PHP's XML extension. This extension is enabled by default on most PHP
@@ -60,17 +57,18 @@ OPTIONAL SERVER REQUIREMENTS
   configuration allows the web server to initiate outbound connections. Most web
   hosting setups allow this.
 
-
 INSTALLATION
 ------------
 
 1. Download and extract Drupal.
 
    You can obtain the latest Drupal release from http://drupal.org -- the files
-   are in .tar.gz format and can be extracted using most compression tools.
+   are available in .tar.gz and .zip formats and can be extracted using most
+   compression tools.
 
    To download and extract the files, on a typical Unix/Linux command line, use
-   the following commands (assuming you want version x.y of Drupal):
+   the following commands (assuming you want version x.y of Drupal in .tar.gz
+   format):
 
      wget http://drupal.org/files/projects/drupal-x.y.tar.gz
      tar -zxvf drupal-x.y.tar.gz
@@ -89,7 +87,7 @@ INSTALLATION
    initially:
 
    - Download a translation file for the correct Drupal version and language
-     from the translation server: http://localize.drupal.org/download
+     from the translation server: http://localize.drupal.org/translate/downloads
 
    - Place the file into your installation profile's translations
      directory. For instance, if you are using the Standard install profile,
@@ -257,7 +255,7 @@ INSTALLATION
    For more information on setting file permissions, see "Modifying Linux,
    Unix, and Mac file permissions" (http://drupal.org/node/202483) or
    "Modifying Windows file permissions" (http://drupal.org/node/202491) in the
-   online handbook.
+   Drupal.org online documentation.
 
 8. Set up independent "cron" maintenance jobs.
 
@@ -299,7 +297,6 @@ INSTALLATION
    scripts/ directory. (Note that these scripts must be customized like the
    above example, to add your site-specific cron key and domain name.)
 
-
 BUILDING AND CUSTOMIZING YOUR SITE
 ----------------------------------
 
@@ -317,12 +314,11 @@ multisite installation, you can also place modules and themes in the
 site-specific directories -- see the Multisite Configuration section, below.
 
 Never edit Drupal's core modules and themes; instead, use the hooks available in
-the Drupal API. To modify the behavior of Drupal, develope a module as described
+the Drupal API. To modify the behavior of Drupal, develop a module as described
 at http://drupal.org/developing/modules. To modify the look of Drupal, create a
 subtheme as described at http://drupal.org/node/225125, or a completely new
 theme as described at http://drupal.org/documentation/theme
 
-
 MULTISITE CONFIGURATION
 -----------------------
 
@@ -332,16 +328,15 @@ its own individual configuration.
 Additional site configurations are created in subdirectories within the 'sites'
 directory. Each subdirectory must have a 'settings.php' file, which specifies
 the configuration settings. The easiest way to create additional sites is to
-copy the 'default' directory and modify the 'settings.php' file as
-appropriate. The new directory name is constructed from the site's URL. The
-configuration for www.example.com could be in 'sites/example.com/settings.php'
-(note that 'www.' should be omitted if users can access your site at
-http://example.com/).
+copy the 'default' directory and modify the 'settings.php' file as appropriate.
+The new directory name is constructed from the site's URL. The configuration for
+www.example.com could be in 'sites/example.com/settings.php' (note that 'www.'
+should be omitted if users can access your site at http://example.com/).
 
 Sites do not have to have a different domain. You can also use subdomains and
-subdirectories for Drupal sites. For example, example.com, sub.example.com,
-and sub.example.com/site3 can all be defined as independent Drupal sites. The
-setup for a configuration such as this would look like the following:
+subdirectories for Drupal sites. For example, example.com, sub.example.com, and
+sub.example.com/site3 can all be defined as independent Drupal sites. The setup
+for a configuration such as this would look like the following:
 
   sites/default/settings.php
   sites/example.com/settings.php
@@ -384,15 +379,14 @@ settings, consult http://drupal.org/getting-started/6/install/multi-site
 For more information on configuring Drupal's file system path in a multisite
 configuration, see step 6 above.
 
-
 MORE INFORMATION
 ----------------
 
-- For additional documentation, see the online Drupal handbook:
-  http://drupal.org/handbook
+- See the Drupal.org online documentation:
+  http://drupal.org/documentation
 
-- For a list of security announcements, see the "Security announcements" page
-  at http://drupal.org/security (available as an RSS feed). This page also
+- For a list of security announcements, see the "Security advisories" page at
+  http://drupal.org/security (available as an RSS feed). This page also
   describes how to subscribe to these announcements via e-mail.
 
 - For information about the Drupal security process, or to find out how to
diff --git a/LICENSE.txt b/LICENSE.txt
index 2172520260eaa977b80a6c4a2c89b68af36508a7..2c095c8d3f42488e8168f9710a4ffbfc4125a159 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,340 +1,274 @@
-// $Id: LICENSE.txt,v 1.7 2009/01/26 14:08:40 dries Exp $
-        GNU GENERAL PUBLIC LICENSE
-           Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-          Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-        GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
+GNU GENERAL PUBLIC LICENSE
+
+              Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave,
+Cambridge, MA 02139, USA. Everyone is permitted to copy and distribute
+verbatim copies of this license document, but changing it is not allowed.
+
+                  Preamble
+
+The licenses for most software are designed to take away your freedom to
+share and change it. By contrast, the GNU General Public License is
+intended to guarantee your freedom to share and change free software--to
+make sure the software is free for all its users. This General Public License
+applies to most of the Free Software Foundation's software and to any other
+program whose authors commit to using it. (Some other Free Software
+Foundation software is covered by the GNU Library General Public License
+instead.) You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our
+General Public Licenses are designed to make sure that you have the
+freedom to distribute copies of free software (and charge for this service if
+you wish), that you receive source code or can get it if you want it, that you
+can change the software or use pieces of it in new free programs; and that
+you know you can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to
+deny you these rights or to ask you to surrender the rights. These restrictions
+translate to certain responsibilities for you if you distribute copies of the
+software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for
+a fee, you must give the recipients all the rights that you have. You must make
+sure that they, too, receive or can get the source code. And you must show
+them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and (2)
+offer you this license which gives you legal permission to copy, distribute
+and/or modify the software.
+
+Also, for each author's protection and ours, we want to make certain that
+everyone understands that there is no warranty for this free software. If the
+software is modified by someone else and passed on, we want its recipients
+to know that what they have is not the original, so that any problems
+introduced by others will not reflect on the original authors' reputations.
+
+Finally, any free program is threatened constantly by software patents. We
+wish to avoid the danger that redistributors of a free program will individually
+obtain patent licenses, in effect making the program proprietary. To prevent
+this, we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and modification
+follow.
+
+           GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND
+               MODIFICATION
+
+0. This License applies to any program or other work which contains a notice
+placed by the copyright holder saying it may be distributed under the terms
+of this General Public License. The "Program", below, refers to any such
+program or work, and a "work based on the Program" means either the
+Program or any derivative work under copyright law: that is to say, a work
+containing the Program or a portion of it, either verbatim or with
+modifications and/or translated into another language. (Hereinafter, translation
+is included without limitation in the term "modification".) Each licensee is
+addressed as "you".
+
+Activities other than copying, distribution and modification are not covered
+by this License; they are outside its scope. The act of running the Program is
+not restricted, and the output from the Program is covered only if its contents
+constitute a work based on the Program (independent of having been made
+by running the Program). Whether that is true depends on what the Program
+does.
+
+1. You may copy and distribute verbatim copies of the Program's source
+code as you receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice and
+disclaimer of warranty; keep intact all the notices that refer to this License
+and to the absence of any warranty; and give any other recipients of the
+Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you
+may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of it,
+thus forming a work based on the Program, and copy and distribute such
+modifications or work under the terms of Section 1 above, provided that you
+also meet all of these conditions:
+
+a) You must cause the modified files to carry prominent notices stating that
+you changed the files and the date of any change.
+
+b) You must cause any work that you distribute or publish, that in whole or in
+part contains or is derived from the Program or any part thereof, to be
+licensed as a whole at no charge to all third parties under the terms of this
+License.
+
+c) If the modified program normally reads commands interactively when run,
+you must cause it, when started running for such interactive use in the most
+ordinary way, to print or display an announcement including an appropriate
+copyright notice and a notice that there is no warranty (or else, saying that
+you provide a warranty) and that users may redistribute the program under
+these conditions, and telling the user how to view a copy of this License.
+(Exception: if the Program itself is interactive but does not normally print such
+an announcement, your work based on the Program is not required to print
+an announcement.)
+
+These requirements apply to the modified work as a whole. If identifiable
+sections of that work are not derived from the Program, and can be
+reasonably considered independent and separate works in themselves, then
+this License, and its terms, do not apply to those sections when you distribute
+them as separate works. But when you distribute the same sections as part
+of a whole which is a work based on the Program, the distribution of the
+whole must be on the terms of this License, whose permissions for other
+licensees extend to the entire whole, and thus to each and every part
+regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to
+work written entirely by you; rather, the intent is to exercise the right to
+control the distribution of derivative or collective works based on the
+Program.
 
 In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
+with the Program (or with a work based on the Program) on a volume of a
+storage or distribution medium does not bring the other work under the scope
+of this License.
+
+3. You may copy and distribute the Program (or a work based on it, under
+Section 2) in object code or executable form under the terms of Sections 1
+and 2 above provided that you also do one of the following:
+
+a) Accompany it with the complete corresponding machine-readable source
+code, which must be distributed under the terms of Sections 1 and 2 above
+on a medium customarily used for software interchange; or,
+
+b) Accompany it with a written offer, valid for at least three years, to give
+any third party, for a charge no more than your cost of physically performing
+source distribution, a complete machine-readable copy of the corresponding
+source code, to be distributed under the terms of Sections 1 and 2 above on
+a medium customarily used for software interchange; or,
+
+c) Accompany it with the information you received as to the offer to distribute
+corresponding source code. (This alternative is allowed only for
+noncommercial distribution and only if you received the program in object
+code or executable form with such an offer, in accord with Subsection b
+above.)
 
 The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
+making modifications to it. For an executable work, complete source code
+means all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation and
+installation of the executable. However, as a special exception, the source
+code distributed need not include anything that is normally distributed (in
+either source or binary form) with the major components (compiler, kernel,
+and so on) of the operating system on which the executable runs, unless that
+component itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to
+copy from a designated place, then offering equivalent access to copy the
+source code from the same place counts as distribution of the source code,
+even though third parties are not compelled to copy the source along with the
+object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as
+expressly provided under this License. Any attempt otherwise to copy,
+modify, sublicense or distribute the Program is void, and will automatically
+terminate your rights under this License. However, parties who have received
+copies, or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+5. You are not required to accept this License, since you have not signed it.
+However, nothing else grants you permission to modify or distribute the
+Program or its derivative works. These actions are prohibited by law if you
+do not accept this License. Therefore, by modifying or distributing the
+Program (or any work based on the Program), you indicate your acceptance
+of this License to do so, and all its terms and conditions for copying,
+distributing or modifying the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the original
+licensor to copy, distribute or modify the Program subject to these terms and
+conditions. You may not impose any further restrictions on the recipients'
+exercise of the rights granted herein. You are not responsible for enforcing
+compliance by third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues), conditions
+are imposed on you (whether by court order, agreement or otherwise) that
+contradict the conditions of this License, they do not excuse you from the
+conditions of this License. If you cannot distribute so as to satisfy
+simultaneously your obligations under this License and any other pertinent
+obligations, then as a consequence you may not distribute the Program at all.
+For example, if a patent license would not permit royalty-free redistribution
+of the Program by all those who receive copies directly or indirectly through
+you, then the only way you could satisfy both it and this License would be to
 refrain entirely from distribution of the Program.
 
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-          NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-         END OF TERMS AND CONDITIONS
-
-      How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License along
-    with this program; if not, write to the Free Software Foundation, Inc.,
-    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply and
+the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or
+other property right claims or to contest validity of any such claims; this
+section has the sole purpose of protecting the integrity of the free software
+distribution system, which is implemented by public license practices. Many
+people have made generous contributions to the wide range of software
+distributed through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing to
+distribute software through any other system and a licensee cannot impose
+that choice.
+
+This section is intended to make thoroughly clear what is believed to be a
+consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain
+countries either by patents or by copyrighted interfaces, the original copyright
+holder who places the Program under this License may add an explicit
+geographical distribution limitation excluding those countries, so that
+distribution is permitted only in or among countries not thus excluded. In such
+case, this License incorporates the limitation as if written in the body of this
+License.
+
+9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will be
+similar in spirit to the present version, but may differ in detail to address new
+problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies
+a version number of this License which applies to it and "any later version",
+you have the option of following the terms and conditions either of that
+version or of any later version published by the Free Software Foundation. If
+the Program does not specify a version number of this License, you may
+choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs
+whose distribution conditions are different, write to the author to ask for
+permission. For software which is copyrighted by the Free Software
+Foundation, write to the Free Software Foundation; we sometimes make
+exceptions for this. Our decision will be guided by the two goals of
+preserving the free status of all derivatives of our free software and of
+promoting the sharing and reuse of software generally.
+
+               NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE,
+THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT
+PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
+STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
+WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
+PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
+NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR
+AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR
+ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
+LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
+SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OR INABILITY TO USE THE
+PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
+OR DATA BEING RENDERED INACCURATE OR LOSSES
+SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE
+PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN
+IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.
+
+          END OF TERMS AND CONDITIONS
diff --git a/MAINTAINERS.txt b/MAINTAINERS.txt
index d01cc4cbba6fdfa248a60a5cdec5bb01f8dea040..0af271d4992afde51355437d199c4cf5db16510c 100644
--- a/MAINTAINERS.txt
+++ b/MAINTAINERS.txt
@@ -1,4 +1,3 @@
-// $Id: MAINTAINERS.txt,v 1.53 2011/01/04 01:03:23 webchick Exp $
 
 Drupal core is maintained by the community.  To participate, go to
 
@@ -19,7 +18,7 @@ Drupal 7
 Component maintainers
 ---------------------
 
-AJAX system
+Ajax system
 - Alex Bronstein 'effulgentsia' <http://drupal.org/user/78040>
 - Randy Fay 'rfay' <http://drupal.org/user/30906>
 - Earl Miles 'merlinofchaos' <http://drupal.org/user/26979>
@@ -44,7 +43,7 @@ Database system
 
   - MySQL driver
     - Larry Garfield 'Crell' <http://drupal.org/user/26398>
-    - David Strauss 'David Strauss' <hhttp://drupal.org/user/93254>
+    - David Strauss 'David Strauss' <http://drupal.org/user/93254>
 
   - PostgreSQL driver
     - Damien Tournoud 'DamZ' <http://drupal.org/user/22211>
diff --git a/README.txt b/README.txt
index 4cc75b3abf64968627a270d5732fa6c30cff6fe1..921f99c64adbd1ae0dc593b21b03ca1b17d5ee72 100644
--- a/README.txt
+++ b/README.txt
@@ -1,4 +1,3 @@
-// $Id: README.txt,v 1.1 2010/12/02 00:20:18 webchick Exp $
 
 CONTENTS OF THIS FILE
 ---------------------
@@ -25,14 +24,14 @@ Legal information about Drupal:
 CONFIGURATION AND FEATURES
 --------------------------
 
-Drupal core (what you get when you download and unzip a drupal-x.y.tar.gz file
-from http://drupal.org/project/drupal) has what you need to get started with
-your website. It includes several modules (extensions that add functionality)
-for common website features, such as managing content, user accounts, image
-uploading, and search. Core comes with many options that allow site-specific
-configuration. In addition to the core modules, there are thousands of
-contributed modules (for functionality not included with Drupal core)
-available for download.
+Drupal core (what you get when you download and extract a drupal-x.y.tar.gz or
+drupal-x.y.zip file from http://drupal.org/project/drupal) has what you need to
+get started with your website. It includes several modules (extensions that add
+functionality) for common website features, such as managing content, user
+accounts, image uploading, and search. Core comes with many options that allow
+site-specific configuration. In addition to the core modules, there are
+thousands of contributed modules (for functionality not included with Drupal
+core) available for download.
 
 More about configuration:
  * Install, upgrade, and maintain Drupal:
@@ -49,8 +48,8 @@ APPEARANCE
 
 In Drupal, the appearance of your site is set by the theme (themes are
 extensions that set fonts, colors, and layout). Drupal core comes with several
-themes. More themes are available for download, and you can also create your
-own custom theme.
+themes. More themes are available for download, and you can also create your own
+custom theme.
 
 More about themes:
  * Download contributed themes to sites/all/themes to modify Drupal's
diff --git a/UPGRADE.txt b/UPGRADE.txt
index b84844c05827025b061f62cc1dfa9c9a75fa2478..d4909d8effa6ba00207baeaf775fac3f58fda09d 100644
--- a/UPGRADE.txt
+++ b/UPGRADE.txt
@@ -1,4 +1,3 @@
-// $Id: UPGRADE.txt,v 1.27 2010/10/27 18:32:54 dries Exp $
 
 INTRODUCTION
 ------------
@@ -13,7 +12,7 @@ First steps and definitions:
 
   * If you are upgrading to Drupal version x.y, then x is known as the major
     version number, and y is known as the minor version number. The download
-    file will be named drupal-x.y.tar.gz.
+    file will be named drupal-x.y.tar.gz (or drupal-x.y.zip).
 
   * All directories mentioned in this document are relative to the directory of
     your Drupal installation.
diff --git a/authorize.php b/authorize.php
index 8eeccdd7b10c112d35e5e36fc9f59fddc831114c..cd3df50e653828b78790354a560e64c4c3779762 100644
--- a/authorize.php
+++ b/authorize.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: authorize.php,v 1.12 2010/12/29 04:07:52 webchick Exp $
 
 /**
  * @file
diff --git a/cron.php b/cron.php
index 41b9d11d05c6eb61563a5d431047a1f2b3883836..0dc119ee47e93bfd0b1487fedb19142405777108 100644
--- a/cron.php
+++ b/cron.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: cron.php,v 1.43 2009/11/02 03:30:49 webchick Exp $
 
 /**
  * @file
diff --git a/includes/actions.inc b/includes/actions.inc
index 9331422b9cb5aad7e1ceea16c74387b240a9239e..c2fd4d96c7ac1dd03b77b594832bb2ff4a791897 100644
--- a/includes/actions.inc
+++ b/includes/actions.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: actions.inc,v 1.41 2010/12/11 02:09:00 dries Exp $
 
 /**
  * @file
diff --git a/includes/ajax.inc b/includes/ajax.inc
index cfb71febb0d003bbbb610cb896d46f0a369e1cc6..41c69832a8e072b5c6005c83da86d370c1fdac1c 100644
--- a/includes/ajax.inc
+++ b/includes/ajax.inc
@@ -1,17 +1,16 @@
 <?php
-// $Id: ajax.inc,v 1.42 2011/01/02 17:26:39 webchick Exp $
 
 /**
  * @file
- * Functions for use with Drupal's AJAX framework.
+ * Functions for use with Drupal's Ajax framework.
  */
 
 /**
- * @defgroup ajax AJAX framework
+ * @defgroup ajax Ajax framework
  * @{
- * Functions for Drupal's AJAX framework.
+ * Functions for Drupal's Ajax framework.
  *
- * Drupal's AJAX framework is used to dynamically update parts of a page's HTML
+ * Drupal's Ajax framework is used to dynamically update parts of a page's HTML
  * based on data from the server. Upon a specified event, such as a button
  * click, a callback function is triggered which performs server-side logic and
  * may return updated markup, which is then replaced on-the-fly with no page
@@ -20,33 +19,33 @@
  * This framework creates a PHP macro language that allows the server to
  * instruct JavaScript to perform actions on the client browser. When using
  * forms, it can be used with the #ajax property.
- * The #ajax property can be used to bind events to the AJAX framework. By
+ * The #ajax property can be used to bind events to the Ajax framework. By
  * default, #ajax uses 'system/ajax' as its path for submission and thus calls
  * ajax_form_callback() and a defined #ajax['callback'] function.
  * However, you may optionally specify a different path to request or a
  * different callback function to invoke, which can return updated HTML or can
- * also return a richer set of @link ajax_commands AJAX framework commands @endlink.
+ * also return a richer set of @link ajax_commands Ajax framework commands @endlink.
  *
  * Standard form handling is as follows:
  *   - A form element has a #ajax property that includes #ajax['callback'] and
  *     omits #ajax['path']. See below about using #ajax['path'] to implement
  *     advanced use-cases that require something other than standard form
  *     handling.
- *   - On the specified element, AJAX processing is triggered by a change to
+ *   - On the specified element, Ajax processing is triggered by a change to
  *     that element.
  *   - The browser submits an HTTP POST request to the 'system/ajax' Drupal
  *     path.
  *   - The menu page callback for 'system/ajax', ajax_form_callback(), calls
  *     drupal_process_form() to process the form submission and rebuild the
  *     form if necessary. The form is processed in much the same way as if it
- *     were submitted without AJAX, with the same #process functions and
+ *     were submitted without Ajax, with the same #process functions and
  *     validation and submission handlers called in either case, making it easy
- *     to create AJAX-enabled forms that degrade gracefully when JavaScript is
+ *     to create Ajax-enabled forms that degrade gracefully when JavaScript is
  *     disabled.
  *   - After form processing is complete, ajax_form_callback() calls the
  *     function named by #ajax['callback'], which returns the form element that
  *     has been updated and needs to be returned to the browser, or
- *     alternatively, an array of custom AJAX commands.
+ *     alternatively, an array of custom Ajax commands.
  *   - The page delivery callback for 'system/ajax', ajax_deliver(), renders the
  *     element returned by #ajax['callback'], and returns the JSON string
  *     created by ajax_render() to the browser.
@@ -57,7 +56,7 @@
  *     #ajax['callback'], using a JavaScript animation effect specified by
  *     #ajax['effect'].
  *
- * A simple example of basic AJAX use from the
+ * A simple example of basic Ajax use from the
  * @link http://drupal.org/project/examples Examples module @endlink follows:
  * @code
  * function main_page() {
@@ -99,28 +98,28 @@
  * }
  * @endcode
  *
- * In the above example, the 'changethis' element is AJAX-enabled. The default
+ * In the above example, the 'changethis' element is Ajax-enabled. The default
  * #ajax['event'] is 'change', so when the 'changethis' element changes,
- * an AJAX call is made. The form is submitted and reprocessed, and then the
+ * an Ajax call is made. The form is submitted and reprocessed, and then the
  * callback is called.  In this case, the form has been automatically
  * built changing $form['replace_textfield']['#description'], so the callback
  * just returns that part of the form.
  *
- * To implement AJAX handling in a form, add '#ajax' to the form
- * definition of a field. That field will trigger an AJAX event when it is
+ * To implement Ajax handling in a form, add '#ajax' to the form
+ * definition of a field. That field will trigger an Ajax event when it is
  * clicked (or changed, depending on the kind of field). #ajax supports
  * the following parameters (either 'path' or 'callback' is required at least):
  * - #ajax['callback']: The callback to invoke to handle the server side of the
- *   AJAX event, which will receive a $form and $form_state as arguments, and
+ *   Ajax event, which will receive a $form and $form_state as arguments, and
  *   returns a renderable array (most often a form or form fragment), an HTML
- *   string, or an array of AJAX commands. If returning a renderable array or
+ *   string, or an array of Ajax commands. If returning a renderable array or
  *   a string, the value will replace the original element named in
  *   #ajax['wrapper'], and
  *   theme_status_messages()
  *   will be prepended to that
  *   element. (If the status messages are not wanted, return an array
- *   of AJAX commands instead.)
- *   #ajax['wrapper']. If an array of AJAX commands is returned, it will be
+ *   of Ajax commands instead.)
+ *   #ajax['wrapper']. If an array of Ajax commands is returned, it will be
  *   executed by the calling code.
  * - #ajax['path']: The menu path to use for the request. This is often omitted
  *   and the default is used. This path should map
@@ -155,21 +154,21 @@
  *   More information is available in the
  *   @link http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/7 Form API Reference @endlink
  *
- * In addition to using Form API for doing in-form modification, AJAX may be
+ * In addition to using Form API for doing in-form modification, Ajax may be
  * enabled by adding classes to buttons and links. By adding the 'use-ajax'
- * class to a link, the link will be loaded via an AJAX call. When using this
+ * class to a link, the link will be loaded via an Ajax call. When using this
  * method, the href of the link can contain '/nojs/' as part of the path. When
- * the AJAX framework makes the request, it will convert this to '/ajax/'.
+ * the Ajax framework makes the request, it will convert this to '/ajax/'.
  * The server is then able to easily tell if this request was made through an
- * actual AJAX request or in a degraded state, and respond appropriately.
+ * actual Ajax request or in a degraded state, and respond appropriately.
  *
  * Similarly, submit buttons can be given the class 'use-ajax-submit'. The
- * form will then be submitted via AJAX to the path specified in the #action.
+ * form will then be submitted via Ajax to the path specified in the #action.
  * Like the ajax-submit class above, this path will have '/nojs/' replaced with
  * '/ajax/' so that the submit handler can tell if the form was submitted
  * in a degraded state or not.
  *
- * When responding to AJAX requests, the server should do what it needs to do
+ * When responding to Ajax requests, the server should do what it needs to do
  * for that request, then create a commands array. This commands array will
  * be converted to a JSON object and returned to the client, which will then
  * iterate over the array and process it like a macro language.
@@ -189,14 +188,14 @@
  *   // Add a visual "changed" marker to the '#object-1' element.
  *   $commands[] = ajax_command_changed('#object-1');
  *   // Menu 'page callback' and #ajax['callback'] functions are supposed to
- *   // return render arrays. If returning an AJAX commands array, it must be
+ *   // return render arrays. If returning an Ajax commands array, it must be
  *   // encapsulated in a render array structure.
  *   return array('#type' => 'ajax', '#commands' => $commands);
  * @endcode
  *
- * When returning an AJAX command array, it is often useful to have
+ * When returning an Ajax command array, it is often useful to have
  * status messages rendered along with other tasks in the command array.
- * In that case the the AJAX commands array may be constructed like this:
+ * In that case the the Ajax commands array may be constructed like this:
  * @code
  *   $commands = array();
  *   $commands[] = ajax_command_replace(NULL, $output);
@@ -204,7 +203,7 @@
  *   return array('#type' => 'ajax', '#commands' => $commands);
  * @endcode
  *
- * See @link ajax_commands AJAX framework commands @endlink
+ * See @link ajax_commands Ajax framework commands @endlink
  */
 
 /**
@@ -215,7 +214,7 @@
  *   functions.
  */
 function ajax_render($commands = array()) {
-  // AJAX responses aren't rendered with html.tpl.php, so we have to call
+  // Ajax responses aren't rendered with html.tpl.php, so we have to call
   // drupal_get_css() and drupal_get_js() here, in order to have new files added
   // during this request to be loaded by the page. We only want to send back
   // files that the page hasn't already loaded, so we implement simple diffing
@@ -235,7 +234,7 @@ function ajax_render($commands = array()) {
       // @todo Inline CSS and JS items are indexed numerically. These can't be
       //   reliably diffed with array_diff_key(), since the number can change
       //   due to factors unrelated to the inline content, so for now, we strip
-      //   the inline items from AJAX responses, and can add support for them
+      //   the inline items from Ajax responses, and can add support for them
       //   when drupal_add_css() and drupal_add_js() are changed to using md5()
       //   or some other hash of the inline content.
       foreach ($items[$type] as $key => $item) {
@@ -251,14 +250,14 @@ function ajax_render($commands = array()) {
   // Settings are handled separately, later in this function, so that changes to
   // the ajaxPageState setting that occur during drupal_get_css() and
   // drupal_get_js() get included, and because the jQuery.extend() code produced
-  // by drupal_get_js() for adding settings isn't appropriate during an AJAX
+  // by drupal_get_js() for adding settings isn't appropriate during an Ajax
   // response, because it does not pass TRUE for the "deep" parameter, and
   // therefore, can clobber existing settings on the page.
   if (isset($items['js']['settings'])) {
     unset($items['js']['settings']);
   }
 
-  // Render the HTML to load these files, and add AJAX commands to insert this
+  // Render the HTML to load these files, and add Ajax commands to insert this
   // HTML in the page. We pass TRUE as the $skip_alter argument to prevent the
   // data from being altered again, as we already altered it above.
   $styles = drupal_get_css($items['css'], TRUE);
@@ -287,16 +286,16 @@ function ajax_render($commands = array()) {
     array_unshift($commands, ajax_command_settings(call_user_func_array('array_merge_recursive', $settings['data']), TRUE));
   }
 
-  // Allow modules to alter any AJAX response.
+  // Allow modules to alter any Ajax response.
   drupal_alter('ajax_render', $commands);
 
   return drupal_json_encode($commands);
 }
 
 /**
- * Get a form submitted via #ajax during an AJAX callback.
+ * Get a form submitted via #ajax during an Ajax callback.
  *
- * This will load a form from the form cache used during AJAX operations. It
+ * This will load a form from the form cache used during Ajax operations. It
  * pulls the form info from $_POST.
  *
  * @return
@@ -326,7 +325,7 @@ function ajax_get_form() {
   // Since some of the submit handlers are run, redirects need to be disabled.
   $form_state['no_redirect'] = TRUE;
 
-  // When a form is rebuilt after AJAX processing, its #build_id and #action
+  // When a form is rebuilt after Ajax processing, its #build_id and #action
   // should not change.
   // @see drupal_rebuild_form()
   $form_state['rebuild_info']['copy']['#build_id'] = TRUE;
@@ -341,10 +340,10 @@ function ajax_get_form() {
 }
 
 /**
- * Menu callback; handles AJAX requests for the #ajax Form API property.
+ * Menu callback; handles Ajax requests for the #ajax Form API property.
  *
  * This rebuilds the form from cache and invokes the defined #ajax['callback']
- * to return an AJAX command structure for JavaScript. In case no 'callback' has
+ * to return an Ajax command structure for JavaScript. In case no 'callback' has
  * been defined, nothing will happen.
  *
  * The Form API #ajax property can be set both for buttons and other input
@@ -361,9 +360,9 @@ function ajax_form_callback() {
 
   // We need to return the part of the form (or some other content) that needs
   // to be re-rendered so the browser can update the page with changed content.
-  // Since this is the generic menu callback used by many AJAX elements, it is
+  // Since this is the generic menu callback used by many Ajax elements, it is
   // up to the #ajax['callback'] function of the element (may or may not be a
-  // button) that triggered the AJAX request to determine what needs to be
+  // button) that triggered the Ajax request to determine what needs to be
   // rendered.
   if (!empty($form_state['triggering_element'])) {
     $callback = $form_state['triggering_element']['#ajax']['callback'];
@@ -374,21 +373,21 @@ function ajax_form_callback() {
 }
 
 /**
- * Theme callback for AJAX requests.
+ * Theme callback for Ajax requests.
  *
- * Many different pages can invoke an AJAX request to system/ajax or another
- * generic AJAX path. It is almost always desired for an AJAX response to be
+ * Many different pages can invoke an Ajax request to system/ajax or another
+ * generic Ajax path. It is almost always desired for an Ajax response to be
  * rendered using the same theme as the base page, because most themes are built
  * with the assumption that they control the entire page, so if the CSS for two
  * themes are both loaded for a given page, they may conflict with each other.
  * For example, Bartik is Drupal's default theme, and Seven is Drupal's default
  * administration theme. Depending on whether the "Use the administration theme
  * when editing or creating content" checkbox is checked, the node edit form may
- * be displayed in either theme, but the AJAX response to the Field module's
+ * be displayed in either theme, but the Ajax response to the Field module's
  * "Add another item" button should be rendered using the same theme as the rest
  * of the page. Therefore, system_menu() sets the 'theme callback' for
  * 'system/ajax' to this function, and it is recommended that modules
- * implementing other generic AJAX paths do the same.
+ * implementing other generic Ajax paths do the same.
  */
 function ajax_base_page_theme() {
   if (!empty($_POST['ajax_page_state']['theme']) && !empty($_POST['ajax_page_state']['theme_token'])) {
@@ -407,9 +406,9 @@ function ajax_base_page_theme() {
 }
 
 /**
- * Package and send the result of a page callback to the browser as an AJAX response.
+ * Package and send the result of a page callback to the browser as an Ajax response.
  *
- * This function is the equivalent of drupal_deliver_html_page(), but for AJAX
+ * This function is the equivalent of drupal_deliver_html_page(), but for Ajax
  * requests. Like that function, it:
  * - Adds needed HTTP headers.
  * - Prints rendered output.
@@ -425,36 +424,71 @@ function ajax_base_page_theme() {
  * @see drupal_deliver_html_page()
  */
 function ajax_deliver($page_callback_result) {
+  // Browsers do not allow JavaScript to read the contents of a user's local
+  // files. To work around that, the jQuery Form plugin submits forms containing
+  // a file input element to an IFRAME, instead of using XHR. Browsers do not
+  // normally expect JSON strings as content within an IFRAME, so the response
+  // must be customized accordingly.
+  // @see http://malsup.com/jquery/form/#file-upload
+  // @see Drupal.ajax.prototype.beforeSend()
+  $iframe_upload = !empty($_POST['ajax_iframe_upload']);
+
   // Emit a Content-Type HTTP header if none has been added by the page callback
   // or by a wrapping delivery callback.
   if (is_null(drupal_get_http_header('Content-Type'))) {
-    // The standard header for JSON is application/json.
-    // @see http://www.ietf.org/rfc/rfc4627.txt?number=4627
-    // However, browsers do not allow JavaScript to read the contents of a
-    // user's local files. To work around that, jQuery submits forms containing
-    // a file input element to an IFRAME, instead of using XHR.
-    // @see http://malsup.com/jquery/form/#file-upload
-    // When Internet Explorer receives application/json content in an IFRAME, it
-    // treats it as a file download and prompts the user to save it. To prevent
-    // that, we return the content as text/plain. But only for POST requests,
-    // since jQuery should always use XHR for GET requests and the incorrect
-    // mime type should not end up in page or proxy server caches.
-    // @see http://drupal.org/node/995854
-    $iframe_upload = !isset($_SERVER['HTTP_X_REQUESTED_WITH']) || $_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest';
-    if ($iframe_upload && $_SERVER['REQUEST_METHOD'] == 'POST') {
-      drupal_add_http_header('Content-Type', 'text/plain; charset=utf-8');
+    if (!$iframe_upload) {
+      // Standard JSON can be returned to a browser's XHR object, and to
+      // non-browser user agents.
+      // @see http://www.ietf.org/rfc/rfc4627.txt?number=4627
+      drupal_add_http_header('Content-Type', 'application/json; charset=utf-8');
     }
     else {
-      drupal_add_http_header('Content-Type', 'application/json; charset=utf-8');
+      // Browser IFRAMEs expect HTML. With most other content types, Internet
+      // Explorer presents the user with a download prompt.
+      drupal_add_http_header('Content-Type', 'text/html; charset=utf-8');
     }
   }
 
-  // Normalize whatever was returned by the page callback to an AJAX commands
-  // array.
+  // Print the response.
+  $commands = ajax_prepare_response($page_callback_result);
+  $json = ajax_render($commands);
+  if (!$iframe_upload) {
+    // Standard JSON can be returned to a browser's XHR object, and to
+    // non-browser user agents.
+    print $json;
+  }
+  else {
+    // Browser IFRAMEs expect HTML. Browser extensions, such as Linkification
+    // and Skype's Browser Highlighter, convert URLs, phone numbers, etc. into
+    // links. This corrupts the JSON response. Protect the integrity of the
+    // JSON data by making it the value of a textarea.
+    // @see http://malsup.com/jquery/form/#file-upload
+    // @see http://drupal.org/node/1009382
+    print '<textarea>' . $json . '</textarea>';
+  }
+
+  // Perform end-of-request tasks.
+  ajax_footer();
+}
+
+/**
+ * Converts the return value of a page callback into an Ajax commands array.
+ *
+ * @param $page_callback_result
+ *   The result of a page callback. Can be one of:
+ *   - NULL: to indicate no content.
+ *   - An integer menu status constant: to indicate an error condition.
+ *   - A string of HTML content.
+ *   - A renderable array of content.
+ *
+ * @return
+ *   An Ajax commands array that can be passed to ajax_render().
+ */
+function ajax_prepare_response($page_callback_result) {
   $commands = array();
   if (!isset($page_callback_result)) {
     // Simply delivering an empty commands array is sufficient. This results
-    // in the AJAX request being completed, but nothing being done to the page.
+    // in the Ajax request being completed, but nothing being done to the page.
   }
   elseif (is_int($page_callback_result)) {
     switch ($page_callback_result) {
@@ -473,7 +507,7 @@ function ajax_deliver($page_callback_result) {
     }
   }
   elseif (is_array($page_callback_result) && isset($page_callback_result['#type']) && ($page_callback_result['#type'] == 'ajax')) {
-    // Complex AJAX callbacks can return a result that contains an error message
+    // Complex Ajax callbacks can return a result that contains an error message
     // or a specific set of commands to send to the browser.
     $page_callback_result += element_info('ajax');
     $error = $page_callback_result['#error'];
@@ -488,7 +522,7 @@ function ajax_deliver($page_callback_result) {
     }
   }
   else {
-    // Like normal page callbacks, simple AJAX callbacks can return HTML
+    // Like normal page callbacks, simple Ajax callbacks can return HTML
     // content, as a string or render array. This HTML is inserted in some
     // relationship to #ajax['wrapper'], as determined by which jQuery DOM
     // manipulation method is used. The method used is specified by
@@ -497,28 +531,24 @@ function ajax_deliver($page_callback_result) {
     $html = is_string($page_callback_result) ? $page_callback_result : drupal_render($page_callback_result);
     $commands[] = ajax_command_insert(NULL, $html);
     // Add the status messages inside the new content's wrapper element, so that
-    // on subsequent AJAX requests, it is treated as old content.
+    // on subsequent Ajax requests, it is treated as old content.
     $commands[] = ajax_command_prepend(NULL, theme('status_messages'));
   }
 
-  // Unlike the recommendation in http://malsup.com/jquery/form/#file-upload,
-  // we do not have to wrap the JSON string in a TEXTAREA, because
-  // drupal_json_encode() returns an HTML-safe JSON string.
-  print ajax_render($commands);
-  ajax_footer();
+  return $commands;
 }
 
 /**
- * Perform end-of-AJAX-request tasks.
+ * Perform end-of-Ajax-request tasks.
  *
- * This function is the equivalent of drupal_page_footer(), but for AJAX
+ * This function is the equivalent of drupal_page_footer(), but for Ajax
  * requests.
  *
  * @see drupal_page_footer()
  */
 function ajax_footer() {
-  // Even for AJAX requests, invoke hook_exit() implementations. There may be
-  // modules that need very fast AJAX responses, and therefore, run AJAX
+  // Even for Ajax requests, invoke hook_exit() implementations. There may be
+  // modules that need very fast Ajax responses, and therefore, run Ajax
   // requests with an early bootstrap.
   if (drupal_get_bootstrap_phase() == DRUPAL_BOOTSTRAP_FULL && (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update')) {
     module_invoke_all('exit');
@@ -551,10 +581,10 @@ function ajax_process_form($element, &$form_state) {
 }
 
 /**
- * Add AJAX information about an element to the page to communicate with JavaScript.
+ * Add Ajax information about an element to the page to communicate with JavaScript.
  *
  * If #ajax['path'] is set on an element, this additional JavaScript is added
- * to the page header to attach the AJAX behaviors. See ajax.js for more
+ * to the page header to attach the Ajax behaviors. See ajax.js for more
  * information.
  *
  * @param $element
@@ -591,9 +621,9 @@ function ajax_pre_render_element($element) {
       case 'image_button':
         // Use the mousedown instead of the click event because form
         // submission via pressing the enter key triggers a click event on
-        // submit inputs, inappropriately triggering AJAX behaviors.
+        // submit inputs, inappropriately triggering Ajax behaviors.
         $element['#ajax']['event'] = 'mousedown';
-        // Attach an additional event handler so that AJAX behaviors
+        // Attach an additional event handler so that Ajax behaviors
         // can be triggered still via keyboard input.
         $element['#ajax']['keypress'] = TRUE;
         break;
@@ -642,7 +672,7 @@ function ajax_pre_render_element($element) {
     unset($settings['path'], $settings['options']);
 
     // Add special data to $settings['submit'] so that when this element
-    // triggers an AJAX submission, Drupal's form processing can determine which
+    // triggers an Ajax submission, Drupal's form processing can determine which
     // element triggered it.
     // @see _form_element_triggered_scripted_submission()
     if (isset($settings['trigger_as'])) {
@@ -685,7 +715,7 @@ function ajax_pre_render_element($element) {
       'data' => array('ajax' => array($element['#id'] => $settings)),
     );
 
-    // Indicate that AJAX processing was successful.
+    // Indicate that Ajax processing was successful.
     $element['#ajax_processed'] = TRUE;
   }
   return $element;
@@ -696,16 +726,16 @@ function ajax_pre_render_element($element) {
  */
 
 /**
- * @defgroup ajax_commands AJAX framework commands
+ * @defgroup ajax_commands Ajax framework commands
  * @{
- * Functions to create various AJAX commands.
+ * Functions to create various Ajax commands.
  *
  * These functions can be used to create arrays for use with the
  * ajax_render() function.
  */
 
 /**
- * Creates a Drupal AJAX 'alert' command.
+ * Creates a Drupal Ajax 'alert' command.
  *
  * The 'alert' command instructs the client to display a JavaScript alert
  * dialog box.
@@ -727,7 +757,7 @@ function ajax_command_alert($text) {
 }
 
 /**
- * Creates a Drupal AJAX 'insert' command using the method in #ajax['method'].
+ * Creates a Drupal Ajax 'insert' command using the method in #ajax['method'].
  *
  * This command instructs the client to insert the given HTML using whichever
  * jQuery DOM manipulation method has been specified in the #ajax['method']
@@ -758,7 +788,7 @@ function ajax_command_insert($selector, $html, $settings = NULL) {
 }
 
 /**
- * Creates a Drupal AJAX 'insert/replaceWith' command.
+ * Creates a Drupal Ajax 'insert/replaceWith' command.
  *
  * The 'insert/replaceWith' command instructs the client to use jQuery's
  * replaceWith() method to replace each element matched matched by the given
@@ -791,7 +821,7 @@ function ajax_command_replace($selector, $html, $settings = NULL) {
 }
 
 /**
- * Creates a Drupal AJAX 'insert/html' command.
+ * Creates a Drupal Ajax 'insert/html' command.
  *
  * The 'insert/html' command instructs the client to use jQuery's html()
  * method to set the HTML content of each element matched by the given
@@ -824,7 +854,7 @@ function ajax_command_html($selector, $html, $settings = NULL) {
 }
 
 /**
- * Creates a Drupal AJAX 'insert/prepend' command.
+ * Creates a Drupal Ajax 'insert/prepend' command.
  *
  * The 'insert/prepend' command instructs the client to use jQuery's prepend()
  * method to prepend the given HTML content to the inside each element matched
@@ -857,10 +887,10 @@ function ajax_command_prepend($selector, $html, $settings = NULL) {
 }
 
 /**
- * Creates a Drupal AJAX 'insert/append' command.
+ * Creates a Drupal Ajax 'insert/append' command.
  *
  * The 'insert/append' command instructs the client to use jQuery's append()
- * method to append the given HTML content to the inside each element matched
+ * method to append the given HTML content to the inside of each element matched
  * by the given selector.
  *
  * This command is implemented by Drupal.ajax.prototype.commands.insert()
@@ -890,7 +920,7 @@ function ajax_command_append($selector, $html, $settings = NULL) {
 }
 
 /**
- * Creates a Drupal AJAX 'insert/after' command.
+ * Creates a Drupal Ajax 'insert/after' command.
  *
  * The 'insert/after' command instructs the client to use jQuery's after()
  * method to insert the given HTML content after each element matched by
@@ -923,7 +953,7 @@ function ajax_command_after($selector, $html, $settings = NULL) {
 }
 
 /**
- * Creates a Drupal AJAX 'insert/before' command.
+ * Creates a Drupal Ajax 'insert/before' command.
  *
  * The 'insert/before' command instructs the client to use jQuery's before()
  * method to insert the given HTML content before each of elements matched by
@@ -956,7 +986,7 @@ function ajax_command_before($selector, $html, $settings = NULL) {
 }
 
 /**
- * Creates a Drupal AJAX 'remove' command.
+ * Creates a Drupal Ajax 'remove' command.
  *
  * The 'remove' command instructs the client to use jQuery's remove() method
  * to remove each of elements matched by the given selector, and everything
@@ -982,7 +1012,7 @@ function ajax_command_remove($selector) {
 }
 
 /**
- * Creates a Drupal AJAX 'changed' command.
+ * Creates a Drupal Ajax 'changed' command.
  *
  * This command instructs the client to mark each of the elements matched by the
  * given selector as 'ajax-changed'.
@@ -1009,7 +1039,7 @@ function ajax_command_changed($selector, $asterisk = '') {
 }
 
 /**
- * Creates a Drupal AJAX 'css' command.
+ * Creates a Drupal Ajax 'css' command.
  *
  * The 'css' command will instruct the client to use the jQuery css() method
  * to apply the CSS arguments to elements matched by the given selector.
@@ -1037,7 +1067,7 @@ function ajax_command_css($selector, $argument) {
 }
 
 /**
- * Creates a Drupal AJAX 'settings' command.
+ * Creates a Drupal Ajax 'settings' command.
  *
  * The 'settings' command instructs the client either to use the given array as
  * the settings for ajax-loaded content or to extend Drupal.settings with the
@@ -1068,7 +1098,7 @@ function ajax_command_settings($argument, $merge = FALSE) {
 }
 
 /**
- * Creates a Drupal AJAX 'data' command.
+ * Creates a Drupal Ajax 'data' command.
  *
  * The 'data' command instructs the client to attach the name=value pair of
  * data to the selector via jQuery's data cache.
@@ -1100,7 +1130,7 @@ function ajax_command_data($selector, $name, $value) {
 }
 
 /**
- * Creates a Drupal AJAX 'invoke' command.
+ * Creates a Drupal Ajax 'invoke' command.
  *
  * The 'invoke' command will instruct the client to invoke the given jQuery
  * method with the supplied arguments on the elements matched by the given
@@ -1131,7 +1161,7 @@ function ajax_command_invoke($selector, $method, array $arguments = array()) {
 }
 
 /**
- * Creates a Drupal AJAX 'restripe' command.
+ * Creates a Drupal Ajax 'restripe' command.
  *
  * The 'restripe' command instructs the client to restripe a table. This is
  * usually used after a table has been modified by a replace or append command.
diff --git a/includes/archiver.inc b/includes/archiver.inc
index 05263373d8572018fb2c688c9788d112c8263a04..fec053be62330c4183e7e6656e6b8ec0ffbb94ef 100644
--- a/includes/archiver.inc
+++ b/includes/archiver.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: archiver.inc,v 1.5 2010/02/01 07:17:59 webchick Exp $
 
 /**
  * @file
diff --git a/includes/authorize.inc b/includes/authorize.inc
index b8f2cce554670ac8276ed33c9f296a163db5c398..3617d7d03051c30fa919220976e3f80463637d17 100644
--- a/includes/authorize.inc
+++ b/includes/authorize.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: authorize.inc,v 1.15 2011/01/04 04:37:27 webchick Exp $
 
 /**
  * @file
@@ -160,7 +159,7 @@ function _authorize_filetransfer_connection_settings($backend) {
  * Therefore, to properly add defaults, we need to walk through all the
  * children form elements and process those defaults recursively.
  *
- * @param &$element
+ * @param $element
  *   Reference to the Form API form element we're operating on.
  * @param $key
  *   The key for our current form element, if any.
diff --git a/includes/batch.inc b/includes/batch.inc
index c84df765a9e265e9257b52726f0d94d6f1d9a20b..7011abfbd52015bd753beb16a940f89e40587df9 100644
--- a/includes/batch.inc
+++ b/includes/batch.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: batch.inc,v 1.54 2010/11/30 17:16:37 dries Exp $
 
 
 /**
diff --git a/includes/batch.queue.inc b/includes/batch.queue.inc
index ee2665dcead51726ea009798599aac71eb8004c3..8464836987b703a02e3a8a3819c7a1e6afa59a9b 100644
--- a/includes/batch.queue.inc
+++ b/includes/batch.queue.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: batch.queue.inc,v 1.2 2010/12/01 00:21:02 webchick Exp $
 
 
 /**
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 7791a7e892610d12452a9631515523ef0f0303da..b0e5be83bc0ceda199ccd02b9e40dcece6246bee 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: bootstrap.inc,v 1.462 2011/01/05 06:17:58 webchick Exp $
 
 /**
  * @file
@@ -9,7 +8,7 @@
 /**
  * The current system version.
  */
-define('VERSION', '7.0');
+define('VERSION', '7.2');
 
 /**
  * Core API compatibility.
@@ -1228,185 +1227,64 @@ function drupal_unpack($obj, $field = 'data') {
 /**
  * Translates a string to the current language or to a given language.
  *
- * All human-readable text that will be displayed on the site or sent to a user
- * should be passed through the t() function. This ensures that sites can be
- * fully translated into other languages.
- *
- * Here are some examples of translating static text using t():
- * @code
- *   if (!$info || !$info['extension']) {
- *     form_set_error('picture_upload', t('The uploaded file was not an image.'));
- *   }
- *
- *   $form['submit'] = array(
- *     '#type' => 'submit',
- *     '#value' => t('Log in'),
- *   );
- * @endcode
- *
- * In addition to translating static text, t() can handle text that should not
- * be translated or that might change from time to time (such as link paths)
- * and dynamic text from variables, using special "placeholders". There are
- * three styles of placeholders:
- * - !variable: Indicates that the text should be inserted as-is. This is
- *   useful for inserting variables into things like e-mail. Example:
- *   @code
- *     $message[] = t("If you don't want to receive such e-mails, you can change your settings at !url.", array('!url' => url("user/$account->uid", array('absolute' => TRUE))));
- *   @endcode
- * - @variable: Indicates that the text should be run through check_plain(), to
- *   escape HTML characters. Use this for any output that is displayed within a
- *   Drupal page. Example:
- *   @code
- *     drupal_set_title($title = t("@name's blog", array('@name' => format_username($account))), PASS_THROUGH);
- *   @endcode
- * - %variable: Indicates that the string should be HTML-escaped and highlighted
- *   with drupal_placeholder(), which shows up as <em>emphasized</em>.
- *   @code
- *     $message = t('%name-from sent %name-to an e-mail.', array('%name-from' => format_username($user), '%name-to' => format_username($account)));
- *   @endcode
- *
- * When using t(), try to put entire paragraphs in one t() call. This makes it
- * easier for translators, as it provides context as to what each word refers
- * to (and also allows translators to adjust word order, which may not be the
- * same in all languages). HTML markup within translation strings is allowed,
- * but should be avoided if possible. The exception is embedded links: link
- * titles add context for translators and need to be translated, so they should
- * be kept in the main string, while link URLs should be generated using
- * placeholders.
- * - Incorrect HTML in t():
- *   @code
- *     $output .= t('<p>Go to the @contact-page.</p>', array('@contact-page' => l(t('contact page'), 'contact')));
- *   @endcode
- * - Correct HTML in t():
- *   @code
- *     $output .= '<p>' . t('Go to the <a href="@contact-page">contact page</a>.', array('@contact-page' => url('contact'))) . '</p>';
- *   @endcode
- *
- * Another thing that is helpful is to avoid escaping quotation marks wherever
- * possible, because it can be confusing to translation teams.
- * - Less desirable quotation mark escaping:
- *   @code
- *     $output .= t('Don\'t click me.');
- *   @endcode
- * - Better way to use quotation marks:
- *   @code
- *     $output .= t("Don't click me.");
- *   @endcode
- *
- * It is important that all translation uses the t() mechanism, because in
- * addition to actually translating the text at run-time, the t() function is
- * also used by text-extraction routines to find text that needs to be
- * translated, and build databases of text to be translated for translation
- * teams. For that reason, you must put the actual string into the t() function,
- * in most cases, and not a variable.
- * - Incorrect use of a variable in t():
- *   @code
- *     $message = 'An error occurred.';
- *     drupal_set_message(t($message), 'error');
- *     $output .= t($message);
- *   @endcode
- * - Correct translation of a variable with t():
- *   @code
- *     $message = t('An error occurred.');
- *     drupal_set_message($message, 'error');
- *     $output .= $message;
- *   @endcode
- *
- * The only case in which variables can be passed safely through t() is when
- * code-based versions of the same strings will be passed through t() (or
- * otherwise extracted) elsewhere.
- *
- * Also, you cannot use t() early in the bootstrap process, prior to the
- * DRUPAL_BOOTSTRAP_LANGUAGE phase. The language variables will not be
- * initialized yet, so the string will not be translated into the correct
- * language. Examples of places where t() cannot be used include:
- * - In a PHP define() statement.
- * - In a hook_boot() implementation.
- *
- * In some cases, modules may include strings in code that can't use t()
- * calls. For example, a module may use an external PHP application that
- * produces strings that are loaded into variables in Drupal for output.
- * In these cases, module authors may include a dummy file that passes the
- * relevant strings through t(). This approach will allow the strings to be
- * extracted.
- *
- * Sample external (non-Drupal) code:
- * @code
- *   class Time {
- *     public $yesterday = 'Yesterday';
- *     public $today = 'Today';
- *     public $tomorrow = 'Tomorrow';
- *   }
- * @endcode
- *
- * Sample dummy file:
- * @code
- *   // Dummy function included in example.potx.inc.
- *   function example_potx() {
- *     $strings = array(
- *       t('Yesterday'),
- *       t('Today'),
- *       t('Tomorrow'),
- *     );
- *     // No return value needed, since this is a dummy function.
- *   }
- * @endcode
- *
- * Having passed strings through t() in a dummy function, it is then
- * possible to pass variables through t():
- * @code
- *   $time = new Time();
- *   $output .= t($time->today);
- * @endcode
- *
- * However tempting it is, custom data from user input or other non-code
- * sources should not be passed through t(). Doing so leads to the following
- * problems and errors:
- *  - The t() system doesn't support updates to existing strings. When user
- *    data is updated, the next time it's passed through t(), a new record is
- *    created instead of an update. The database bloats over time and any
- *    existing translations are orphaned with each update.
- *  - The t() system assumes any data it receives is in English. User data may
- *    be in another language, producing translation errors.
- *  - The "Built-in interface" text group in the locale system is used to
- *    produce translations for storage in .po files. When non-code strings are
- *    passed through t(), they are added to this text group, which is rendered
- *    inaccurate since it is a mix of actual interface strings and various user
- *    input strings of uncertain origin.
- * Instead, translation of these data can be done through the locale system,
- * either directly through hook_local() or through helper functions provided by
- * contributed modules.
- *
- * Incorrect:
+ * The t() function serves two purposes. First, at run-time it translates
+ * user-visible text into the appropriate language. Second, various mechanisms
+ * that figure out what text needs to be translated work off t() -- the text
+ * inside t() calls is added to the database of strings to be translated. So,
+ * to enable a fully-translatable site, it is important that all human-readable
+ * text that will be displayed on the site or sent to a user is passed through
+ * the t() function, or a related function. See the
+ * @link http://drupal.org/node/322729 Localization API @endlink pages for
+ * more information, including recommendations on how to break up or not
+ * break up strings for translation.
+ *
+ * You should never use t() to translate variables, such as calling
+ * @code t($text); @endcode, unless the text that the variable holds has been
+ * passed through t() elsewhere (e.g., $text is one of several translated
+ * literal strings in an array). It is especially important never to call
+ * @code t($user_text); @endcode, where $user_text is some text that a user
+ * entered - doing that can lead to cross-site scripting and other security
+ * problems. However, you can use variable substitution in your string, to put
+ * variable text such as user names or link URLs into translated text. Variable
+ * substitution looks like this:
  * @code
- *   $item = item_load();
- *   $output .= check_plain(t($item['title']));
+ * $text = t("@name's blog", array('@name' => format_username($account)));
  * @endcode
+ * Basically, you can put variables like @name into your string, and t() will
+ * substitute their sanitized values at translation time (see $args below or
+ * the Localization API pages referenced above for details). Translators can
+ * then rearrange the string as necessary for the language (e.g., in Spanish,
+ * it might be "blog de @name").
  *
- * During installation, st() is used in place of t(). Code that may be called
- * during installation or during normal operation should use the get_t()
- * helper function.
+ * During the Drupal installation phase, some resources used by t() wil not be
+ * available to code that needs localization. See st() and get_t() for
+ * alternatives.
  *
  * @param $string
  *   A string containing the English string to translate.
  * @param $args
- *   An associative array of replacements to make after translation. Incidences
- *   of any key in this array are replaced with the corresponding value. Based
- *   on the first character of the key, the value is escaped and/or themed:
- *    - !variable: inserted as is
- *    - @variable: escape plain text to HTML (using check_plain())
- *    - %variable: escape text and theme as a placeholder for user-submitted
- *      content (using check_plain() + drupal_placeholder())
+ *   An associative array of replacements to make after translation.
+ *   Occurrences in $string of any key in $args are replaced with the
+ *   corresponding value, after sanitization. The sanitization function depends
+ *   on the first character of the key:
+ *   - !variable: Inserted as is. Use this for text that has already been
+ *     sanitized.
+ *   - @variable: Escaped to HTML using check_plain(). Use this for anything
+ *     displayed on a page on the site.
+ *   - %variable: Escaped as a placeholder for user-submitted content using
+ *     drupal_placeholder(), which shows up as <em>emphasized</em> text.
  * @param $options
- *   An associative array of additional options, with the following keys:
- *     - 'langcode' (defaults to the current language) The language code to
- *       translate to a language other than what is used to display the page.
- *     - 'context' (defaults to the empty context) The context the source string
- *       belongs to.
+ *   An associative array of additional options, with the following elements:
+ *   - 'langcode' (defaults to the current language): The language code to
+ *     translate to a language other than what is used to display the page.
+ *   - 'context' (defaults to the empty context): The context the source string
+ *     belongs to.
  *
  * @return
  *   The translated string.
  *
+ * @see st()
+ * @see get_t()
  * @ingroup sanitization
  */
 function t($string, array $args = array(), array $options = array()) {
@@ -1553,7 +1431,7 @@ function request_uri() {
  *   The exception that is going to be logged.
  * @param $message
  *   The message to store in the log. If empty, a text that contains all useful
- *   information about the passed in exception is used.
+ *   information about the passed-in exception is used.
  * @param $variables
  *   Array of variables to replace in the message on display. Defaults to the
  *   return value of drupal_decode_exception().
@@ -1649,8 +1527,8 @@ function watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NO
  * messages without clearing them.
  *
  * @param $message
- *   The message should begin with a capital letter and always ends with a
- *   period '.'.
+ *   The message to be displayed to the user. For consistency with other
+ *   messages, it should begin with a capital letter and end with a period.
  * @param $type
  *   The type of the message. One of the following values are possible:
  *   - 'status'
@@ -2369,8 +2247,30 @@ function drupal_installation_attempted() {
 }
 
 /**
- * Return the name of the localization function. Use in code that needs to
- * run both during installation and normal operation.
+ * Returns the name of the proper localization function.
+ *
+ * get_t() exists to support localization for code that might run during
+ * the installation phase, when some elements of the system might not have
+ * loaded.
+ *
+ * This would include implementations of hook_install(), which could run
+ * during the Drupal installation phase, and might also be run during
+ * non-installation time, such as while installing the module from the the
+ * module administration page.
+ *
+ * Example useage:
+ * @code
+ *   $t = get_t();
+ *   $translated = $t('translate this');
+ * @endcode
+ *
+ * Use t() if your code will never run during the Drupal installation phase.
+ * Use st() if your code will only run during installation and never any other
+ * time. Use get_t() if your code could run in either circumstance.
+ *
+ * @see t()
+ * @see st()
+ * @ingroup sanitization
  */
 function get_t() {
   static $t;
@@ -2426,6 +2326,9 @@ function drupal_language_types() {
  * Return true if there is more than one language enabled.
  */
 function drupal_multilingual() {
+  // The "language_count" variable stores the number of enabled languages to
+  // avoid unnecessarily querying the database when building the list of
+  // enabled languages on monolingual sites.
   return variable_get('language_count', 1) > 1;
 }
 
@@ -2497,6 +2400,8 @@ function language_default($property = NULL) {
  *   base_path() returns "/drupalfolder/".
  * - http://example.com/path/alias (which is a path alias for node/306) returns
  *   "path/alias" as opposed to the internal path.
+ * - http://example.com/index.php returns an empty string (meaning: front page).
+ * - http://example.com/index.php?page=1 returns an empty string.
  *
  * @return
  *   The requested Drupal URL path.
@@ -2518,11 +2423,19 @@ function request_path() {
     $path = $_GET['q'];
   }
   elseif (isset($_SERVER['REQUEST_URI'])) {
-    // This is a request using a clean URL. Extract the path from REQUEST_URI.
+    // This request is either a clean URL, or 'index.php', or nonsense.
+    // Extract the path from REQUEST_URI.
     $request_path = strtok($_SERVER['REQUEST_URI'], '?');
     $base_path_len = strlen(rtrim(dirname($_SERVER['SCRIPT_NAME']), '\/'));
     // Unescape and strip $base_path prefix, leaving q without a leading slash.
     $path = substr(urldecode($request_path), $base_path_len + 1);
+    // If the path equals the script filename, either because 'index.php' was
+    // explicitly provided in the URL, or because the server added it to
+    // $_SERVER['REQUEST_URI'] even when it wasn't provided in the URL (some
+    // versions of Microsoft IIS do this), the front page should be served.
+    if ($path == basename($_SERVER['PHP_SELF'])) {
+      $path = '';
+    }
   }
   else {
     // This is the front page.
diff --git a/includes/cache-install.inc b/includes/cache-install.inc
index c4cf081ac0365e84d86c0f8fb7c3507661837526..d9bb0f92ea5be05e4ddb53931dd4e6413af7da7c 100644
--- a/includes/cache-install.inc
+++ b/includes/cache-install.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: cache-install.inc,v 1.9 2010/05/18 18:26:30 dries Exp $
 
 /**
  * @file
@@ -31,7 +30,7 @@ class DrupalFakeCache extends DrupalDatabaseCache implements DrupalCacheInterfac
     // If there is a database cache, attempt to clear it whenever possible. The
     // reason for doing this is that the database cache can accumulate data
     // during installation due to any full bootstraps that may occur at the
-    // same time (for example, AJAX requests triggered by the installer). If we
+    // same time (for example, Ajax requests triggered by the installer). If we
     // didn't try to clear it whenever this function is called, the data in the
     // cache would become stale; for example, the installer sometimes calls
     // variable_set(), which updates the {variable} table and then clears the
diff --git a/includes/cache.inc b/includes/cache.inc
index e5d0c4978f1c0e024897191beacf7ae05a516fbd..8666874ac6250efd71ec4ab873e6f0b39ada09b0 100644
--- a/includes/cache.inc
+++ b/includes/cache.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: cache.inc,v 1.51 2010/12/01 00:26:03 webchick Exp $
 
 /**
  * Get the cache object for a cache bin.
@@ -325,10 +324,15 @@ class DrupalDatabaseCache implements DrupalCacheInterface {
     try {
       // Garbage collection necessary when enforcing a minimum cache lifetime.
       $this->garbageCollection($this->bin);
-      $query = db_select($this->bin);
-      $query->fields($this->bin, array('cid', 'data', 'created', 'expire', 'serialized'));
-      $query->condition($this->bin . '.cid', $cids, 'IN');
-      $result = $query->execute();
+
+      // When serving cached pages, the overhead of using db_select() was found
+      // to add around 30% overhead to the request. Since $this->bin is a
+      // variable, this means the call to db_query() here uses a concatenated
+      // string. This is highly discouraged under any other circumstances, and
+      // is used here only due to the performance overhead we would incur
+      // otherwise. When serving an uncached page, the overhead of using
+      // db_select() is a much smaller proportion of the request.
+      $result = db_query('SELECT cid, data, created, expire, serialized FROM {' . db_escape_table($this->bin) . '} WHERE cid IN (:cids)', array(':cids' => $cids));
       $cache = array();
       foreach ($result as $item) {
         $item = $this->prepareItem($item);
diff --git a/includes/common.inc b/includes/common.inc
index 216f1be4d99ec2cea0fd0780ffa115efb3ec85fd..5158c5a9e936232d46670167811c63a3e14d566b 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: common.inc,v 1.1283 2011/01/03 06:51:00 webchick Exp $
 
 /**
  * @file
@@ -915,7 +914,9 @@ function drupal_http_request($url, array $options = array()) {
     return $result;
   }
   // Parse response headers from the response body.
-  list($response, $result->data) = explode("\r\n\r\n", $response, 2);
+  // Be tolerant of malformed HTTP responses that separate header and body with
+  // \n\n or \r\r instead of \r\n\r\n.
+  list($response, $result->data) = preg_split("/\r\n\r\n|\n\n|\r\r/", $response, 2);
   $response = preg_split("/\r\n|\n|\r/", $response);
 
   // Parse the response status line.
@@ -1050,15 +1051,15 @@ function _fix_gpc_magic_files(&$item, $key) {
  * Fix double-escaping problems caused by "magic quotes" in some PHP installations.
  */
 function fix_gpc_magic() {
-  $fixed = &drupal_static(__FUNCTION__, FALSE);
+  static $fixed = FALSE;
   if (!$fixed && ini_get('magic_quotes_gpc')) {
     array_walk($_GET, '_fix_gpc_magic');
     array_walk($_POST, '_fix_gpc_magic');
     array_walk($_COOKIE, '_fix_gpc_magic');
     array_walk($_REQUEST, '_fix_gpc_magic');
     array_walk($_FILES, '_fix_gpc_magic_files');
-    $fixed = TRUE;
   }
+  $fixed = TRUE;
 }
 
 /**
@@ -1974,7 +1975,7 @@ function _format_date_callback(array $matches = NULL, $new_langcode = NULL) {
 /**
  * Format a username.
  *
- * By default, the passed in object's 'name' property is used if it exists, or
+ * By default, the passed-in object's 'name' property is used if it exists, or
  * else, the site-defined value for the 'anonymous' variable. However, a module
  * may override this by implementing hook_username_alter(&$name, $account).
  *
@@ -2241,7 +2242,7 @@ function drupal_http_header_attributes(array $attributes = array()) {
  *   drupal_attributes(array('title' => t('<script>steal_cookie();</script>')));
  *
  *   // The statement below demonstrates dangerous use of drupal_attributes, and
- *   // will return an onmouseout attribute with javascript code that, when used
+ *   // will return an onmouseout attribute with JavaScript code that, when used
  *   // as attribute in a tag, will cause users to be redirected to another site.
  *   //
  *   // In this case, the 'onmouseout' attribute should not be whitelisted --
@@ -2386,9 +2387,9 @@ function l($text, $path, array $options = array()) {
  * basis in hook_page_delivery_callback_alter().
  *
  * For example, the same page callback function can be used for an HTML
- * version of the page and an AJAX version of the page. The page callback
+ * version of the page and an Ajax version of the page. The page callback
  * function just needs to decide what content is to be returned and the
- * delivery callback function will send it as an HTML page or an AJAX
+ * delivery callback function will send it as an HTML page or an Ajax
  * response, as appropriate.
  *
  * In order for page callbacks to be reusable in different delivery formats,
@@ -2605,7 +2606,8 @@ function drupal_exit($destination = NULL) {
  *   A linear array.
  * @param $function
  *   A name of a function to apply to all values before output.
- * @result
+ *
+ * @return
  *   An associative array.
  */
 function drupal_map_assoc($array, $function = NULL) {
@@ -3546,7 +3548,7 @@ function drupal_load_stylesheet_content($contents, $optimize = FALSE) {
     // There are different conditions for removing leading and trailing
     // whitespace.
     // @see http://php.net/manual/en/regexp.reference.subpatterns.php
-    $contents = preg_replace_callback('<
+    $contents = preg_replace('<
       # Strip leading and trailing whitespace.
         \s*([@{};,])\s*
       # Strip only leading whitespace from:
@@ -3557,7 +3559,10 @@ function drupal_load_stylesheet_content($contents, $optimize = FALSE) {
       # - Colon: Retain :pseudo-selectors.
       | ([\(:])\s+
     >xS',
-      '_drupal_load_stylesheet_content',
+      // Only one of the three capturing groups will match, so its reference
+      // will contain the wanted value and the references for the
+      // two non-matching groups will be replaced with empty strings.
+      '$1$2$3',
       $contents
     );
     // End the file with a new line.
@@ -3571,16 +3576,6 @@ function drupal_load_stylesheet_content($contents, $optimize = FALSE) {
   return $contents;
 }
 
-/**
- * Helper for drupal_load_stylesheet_content().
- */
-function _drupal_load_stylesheet_content($matches) {
-  // Discard the full match.
-  unset($matches[0]);
-  // Use the non-empty match.
-  return current(array_filter($matches));
-}
-
 /**
  * Loads stylesheets recursively and returns contents with corrected paths.
  *
@@ -3675,17 +3670,17 @@ function drupal_html_class($class) {
  * blocks, and other content to be output multiple times on the same page,
  * without breaking (X)HTML validation.
  *
- * For already existing ids, a counter is appended to the id string. Therefore,
+ * For already existing IDs, a counter is appended to the ID string. Therefore,
  * JavaScript and CSS code should not rely on any value that was generated by
  * this function and instead should rely on manually added CSS classes or
  * similarly reliable constructs.
  *
- * Two consecutive hyphens separate the counter from the original id. To manage
- * uniqueness across multiple AJAX requests on the same page, AJAX requests
+ * Two consecutive hyphens separate the counter from the original ID. To manage
+ * uniqueness across multiple Ajax requests on the same page, Ajax requests
  * POST an array of all IDs currently present on the page, which are used to
  * prime this function's cache upon first invocation.
  *
- * To allow reverse-parsing of ids submitted via AJAX, any multiple consecutive
+ * To allow reverse-parsing of IDs submitted via Ajax, any multiple consecutive
  * hyphens in the originally passed $id are replaced with a single hyphen.
  *
  * @param $id
@@ -3695,10 +3690,10 @@ function drupal_html_class($class) {
  *   The cleaned ID.
  */
 function drupal_html_id($id) {
-  // If this is an AJAX request, then content returned by this page request will
-  // be merged with content already on the base page. The HTML ids must be
+  // If this is an Ajax request, then content returned by this page request will
+  // be merged with content already on the base page. The HTML IDs must be
   // unique for the fully merged content. Therefore, initialize $seen_ids to
-  // take into account ids that are already in use on the base page.
+  // take into account IDs that are already in use on the base page.
   $seen_ids_init = &drupal_static(__FUNCTION__ . ':init');
   if (!isset($seen_ids_init)) {
     // Ideally, Drupal would provide an API to persist state information about
@@ -3706,7 +3701,7 @@ function drupal_html_id($id) {
     // function's $seen_ids static variable to that state information in order
     // to have it properly initialized for this page request. However, no such
     // page state API exists, so instead, ajax.js adds all of the in-use HTML
-    // ids to the POST data of AJAX submissions. Direct use of $_POST is
+    // IDs to the POST data of Ajax submissions. Direct use of $_POST is
     // normally not recommended as it could open up security risks, but because
     // the raw POST data is cast to a number before being returned by this
     // function, this usage is safe.
@@ -3753,7 +3748,7 @@ function drupal_html_id($id) {
   // The counter needs to be appended with a delimiter that does not exist in
   // the base ID. Requiring a unique delimiter helps ensure that we really do
   // return unique IDs and also helps us re-create the $seen_ids array during
-  // AJAX requests.
+  // Ajax requests.
   if (isset($seen_ids[$id])) {
     $id = $id . '--' . ++$seen_ids[$id];
   }
@@ -3771,7 +3766,7 @@ function drupal_html_id($id) {
  * page region that is output by the theme (Drupal core already handles this in
  * the standard template preprocess implementation). Standardizing the class
  * names in this way allows modules to implement certain features, such as
- * drag-and-drop or dynamic AJAX loading, in a theme-independent way.
+ * drag-and-drop or dynamic Ajax loading, in a theme-independent way.
  *
  * @param $region
  *   The name of the page region (for example, 'page_top' or 'content').
@@ -3956,12 +3951,17 @@ function drupal_add_js($data = NULL, $options = NULL) {
 
   if (isset($data)) {
     // Add jquery.js and drupal.js, as well as the basePath setting, the
-    // first time a Javascript file is added.
+    // first time a JavaScript file is added.
     if (empty($javascript)) {
+      // url() generates the prefix using hook_url_outbound_alter(). Instead of
+      // running the hook_url_outbound_alter() again here, extract the prefix
+      // from url().
+      url('', array('prefix' => &$prefix));
       $javascript = array(
         'settings' => array(
           'data' => array(
             array('basePath' => base_path()),
+            array('pathPrefix' => empty($prefix) ? '' : $prefix),
           ),
           'type' => 'setting',
           'scope' => 'header',
@@ -3999,7 +3999,7 @@ function drupal_add_js($data = NULL, $options = NULL) {
 
       default: // 'file' and 'external'
         // Local and external files must keep their name as the associative key
-        // so the same JavaScript file is not be added twice.
+        // so the same JavaScript file is not added twice.
         $javascript[$options['data']] = $options;
     }
   }
@@ -4097,13 +4097,13 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS
   // page request.
   $default_query_string = variable_get('css_js_query_string', '0');
 
-  // For inline Javascript to validate as XHTML, all Javascript containing
+  // For inline JavaScript to validate as XHTML, all JavaScript containing
   // XHTML needs to be wrapped in CDATA. To make that backwards compatible
   // with HTML 4, we need to comment out the CDATA-tag.
   $embed_prefix = "\n<!--//--><![CDATA[//><!--\n";
   $embed_suffix = "\n//--><!]]>\n";
 
-  // Since Javascript may look for arguments in the url and act on them, some
+  // Since JavaScript may look for arguments in the URL and act on them, some
   // third-party code might require the use of a different query string.
   $js_version_string = variable_get('drupal_js_version_query_string', 'v=');
 
@@ -4321,7 +4321,7 @@ function drupal_process_attached($elements, $group = JS_DEFAULT, $dependency_che
   }
 
   // Add additional types of attachments specified in the render() structure.
-  // Libraries, Javascript and CSS have been added already, as they require
+  // Libraries, JavaScript and CSS have been added already, as they require
   // special handling.
   foreach ($elements['#attached'] as $callback => $options) {
     if (function_exists($callback)) {
@@ -4788,7 +4788,7 @@ function drupal_clear_js_cache() {
 }
 
 /**
- * Converts a PHP variable into its Javascript equivalent.
+ * Converts a PHP variable into its JavaScript equivalent.
  *
  * We use HTML-safe strings, i.e. with <, > and & escaped.
  *
@@ -4884,12 +4884,12 @@ function drupal_valid_token($token, $value = '', $skip_anonymous = FALSE) {
 }
 
 function _drupal_bootstrap_full() {
-  $called = &drupal_static(__FUNCTION__);
+  static $called = FALSE;
 
   if ($called) {
     return;
   }
-  $called = 1;
+  $called = TRUE;
   require_once DRUPAL_ROOT . '/' . variable_get('path_inc', 'includes/path.inc');
   require_once DRUPAL_ROOT . '/includes/theme.inc';
   require_once DRUPAL_ROOT . '/includes/pager.inc';
@@ -5238,7 +5238,7 @@ function drupal_set_page_content($content = NULL) {
  *     browsers, '#browsers' can be set to array('IE' => 'gte IE 8').
  *
  * @return
- *   The passed in element with markup for conditional comments potentially
+ *   The passed-in element with markup for conditional comments potentially
  *   added to '#prefix' and '#suffix'.
  */
 function drupal_pre_render_conditional_comments($elements) {
@@ -5300,7 +5300,7 @@ function drupal_pre_render_conditional_comments($elements) {
  *   - #options: (optional) An array of options to pass to l().
  *
  * @return
- *   The passed in elements containing a rendered link in '#markup'.
+ *   The passed-in elements containing a rendered link in '#markup'.
  */
 function drupal_pre_render_link($element) {
   // By default, link options to pass to l() are normally set in #options.
@@ -5330,7 +5330,7 @@ function drupal_pre_render_link($element) {
     if (!isset($element['#id'])) {
       $element['#id'] = $element['#options']['attributes']['id'] = drupal_html_id('ajax-link');
     }
-    // If #ajax['path] was not specified, use the href as AJAX request URL.
+    // If #ajax['path] was not specified, use the href as Ajax request URL.
     if (!isset($element['#ajax']['path'])) {
       $element['#ajax']['path'] = $element['#href'];
       $element['#ajax']['options'] = $element['#options'];
@@ -5447,7 +5447,7 @@ function drupal_pre_render_links($element) {
  *   A structured array using the #markup key.
  *
  * @return
- *   The passed in elements, but #markup appended to #children.
+ *   The passed-in elements, but #markup appended to #children.
  */
 function drupal_pre_render_markup($elements) {
   $elements['#children'] = $elements['#markup'];
@@ -5578,9 +5578,9 @@ function drupal_render(&$elements) {
     return $cached_output;
   }
 
-  // If #markup is not empty, set #type. This allows to specify just #markup on
-  // an element without setting #type.
-  if (!empty($elements['#markup']) && !isset($elements['#type'])) {
+  // If #markup is set, ensure #type is set. This allows to specify just #markup
+  // on an element without setting #type.
+  if (isset($elements['#markup']) && !isset($elements['#type'])) {
     $elements['#type'] = 'markup';
   }
 
@@ -5697,13 +5697,17 @@ function drupal_render_children(&$element, $children_keys = NULL) {
 }
 
 /**
- * Render and print an element.
+ * Render an element.
  *
  * This function renders an element using drupal_render(). The top level
- * element is always rendered even if hide() had been previously used on it.
+ * element is shown with show() before rendering, so it will always be rendered
+ * even if hide() had been previously used on it.
  *
- * Any nested elements are only rendered if they haven't been rendered before
- * or if they have been re-enabled with show().
+ * @param $element
+ *   The element to be rendered.
+ *
+ * @return
+ *   The rendered element.
  *
  * @see drupal_render()
  * @see show()
@@ -5724,6 +5728,21 @@ function render(&$element) {
 /**
  * Hide an element from later rendering.
  *
+ * The first time render() or drupal_render() is called on an element tree,
+ * as each element in the tree is rendered, it is marked with a #printed flag
+ * and the rendered children of the element are cached. Subsequent calls to
+ * render() or drupal_render() will not traverse the child tree of this element
+ * again: they will just use the cached children. So if you want to hide an
+ * element, be sure to call hide() on the element before its parent tree is
+ * rendered for the first time, as it will have no effect on subsequent
+ * renderings of the parent tree.
+ *
+ * @param $element
+ *   The element to be hidden.
+ *
+ * @return
+ *   The element.
+ *
  * @see render()
  * @see show()
  */
@@ -5733,10 +5752,25 @@ function hide(&$element) {
 }
 
 /**
- * Show a hidden or already printed element from later rendering.
+ * Show a hidden element for later rendering.
+ *
+ * You can also use render($element), which shows the element while rendering
+ * it.
+ *
+ * The first time render() or drupal_render() is called on an element tree,
+ * as each element in the tree is rendered, it is marked with a #printed flag
+ * and the rendered children of the element are cached. Subsequent calls to
+ * render() or drupal_render() will not traverse the child tree of this element
+ * again: they will just use the cached children. So if you want to show an
+ * element, be sure to call show() on the element before its parent tree is
+ * rendered for the first time, as it will have no effect on subsequent
+ * renderings of the parent tree.
+ *
+ * @param $element
+ *   The element to be shown.
  *
- * Alternatively, render($element) could be used which automatically shows the
- * element while rendering it.
+ * @return
+ *   The element.
  *
  * @see render()
  * @see hide()
@@ -5803,14 +5837,58 @@ function drupal_render_cache_set(&$markup, $elements) {
   // be retrieved and used.
   $data['#markup'] = &$markup;
   // Persist attached data associated with this element.
-  if (isset($elements['#attached'])) {
-    $data['#attached'] = $elements['#attached'];
+  $attached = drupal_render_collect_attached($elements, TRUE);
+  if ($attached) {
+    $data['#attached'] = $attached;
   }
   $bin = isset($elements['#cache']['bin']) ? $elements['#cache']['bin'] : 'cache';
   $expire = isset($elements['#cache']['expire']) ? $elements['#cache']['expire'] : CACHE_PERMANENT;
   cache_set($cid, $data, $bin, $expire);
 }
 
+/**
+ * Collect #attached for an element and all child elements into a single array.
+ *
+ * When caching elements, it is necessary to collect all libraries, JavaScript
+ * and CSS into a single array, from both the element itself and all child
+ * elements. This allows drupal_render() to add these back to the page when the
+ * element is returned from cache.
+ *
+ * @param $elements
+ *   The element to collect #attached from.
+ * @param $return
+ *   Whether to return the attached elements and reset the internal static.
+ *
+ * @return
+ *   The #attached array for this element and its descendants.
+ */
+function drupal_render_collect_attached($elements, $return = FALSE) {
+  $attached = &drupal_static(__FUNCTION__, array());
+
+  // Collect all #attached for this element.
+  if (isset($elements['#attached'])) {
+    foreach ($elements['#attached'] as $key => $value) {
+      if (!isset($attached[$key])) {
+        $attached[$key] = array();
+      }
+      $attached[$key] = array_merge($attached[$key], $value);
+    }
+  }
+  if ($children = element_children($elements)) {
+    foreach ($children as $child) {
+      drupal_render_collect_attached($elements[$child]);
+    }
+  }
+
+  // If this was the first call to the function, return all attached elements
+  // and reset the static cache.
+  if ($return) {
+    $return = $attached;
+    $attached = array();
+    return $return;
+  }
+}
+
 /**
  * Prepare an element for caching based on a query. This smart caching strategy
  * saves Drupal from querying and rendering to HTML when the underlying query is
@@ -5833,7 +5911,7 @@ function drupal_render_cache_set(&$markup, $elements) {
  *
  * @return
  *   A renderable array with the following keys and values:
- *   - #query: The passed in $query.
+ *   - #query: The passed-in $query.
  *   - #pre_render: $function with a _pre_render suffix.
  *   - #cache: An associative array prepared for drupal_render_cache_set().
  */
@@ -6240,7 +6318,7 @@ function drupal_array_set_nested_value(array &$array, array $parents, $value, $f
  *   The array from which to get the value.
  * @param $parents
  *   An array of parent keys of the value, starting with the outermost key.
- * @param &$key_exists
+ * @param $key_exists
  *   (optional) If given, an already defined variable that is altered by
  *   reference.
  *
@@ -6654,30 +6732,27 @@ function drupal_schema_fields_sql($table, $prefix = NULL) {
 }
 
 /**
- * Saves a record to the database based upon the schema.
- *
- * Default values are filled in for missing items, and 'serial' (auto increment)
- * types are filled in with IDs.
+ * Saves (inserts or updates) a record to the database based upon the schema.
  *
  * @param $table
  *   The name of the table; this must be defined by a hook_schema()
  *   implementation.
  * @param $record
  *   An object or array representing the record to write, passed in by
- *   reference. The function will fill in defaults from the schema and add an
- *   ID value to serial fields.
+ *   reference. If inserting a new record, values not provided in $record will
+ *   be populated in $record and in the database with the default values from
+ *   the schema, as well as a single serial (auto-increment) field (if present).
+ *   If updating an existing record, only provided values are updated in the
+ *   database, and $record is not modified.
  * @param $primary_keys
- *   If this is an update, specify the primary keys' field names. If this is a
- *   new record, you must not provide this value. If there is only 1 field in
- *   the key, you may pass in a string; if there are multiple fields in the key,
- *   pass in an array.
+ *   To indicate that this is a new record to be inserted, omit this argument.
+ *   If this is an update, this argument specifies the primary keys' field
+ *   names. If there is only 1 field in the key, you may pass in a string; if
+ *   there are multiple fields in the key, pass in an array.
  *
  * @return
- *   Failure to write a record will return FALSE. Otherwise SAVED_NEW or
- *   SAVED_UPDATED is returned depending on the operation performed. The $object
- *   parameter will contain values for any serial fields defined by the $table.
- *   For example, $record->nid or $record['nid'] will be populated after
- *   inserting a new a new node.
+ *   If the record insert or update failed, returns FALSE. If it succeeded,
+ *   returns SAVED_NEW or SAVED_UPDATED, depending on the operation performed.
  */
 function drupal_write_record($table, &$record, $primary_keys = array()) {
   // Standardize $primary_keys to an array.
@@ -6818,7 +6893,7 @@ function drupal_write_record($table, &$record, $primary_keys = array()) {
  */
 
 /**
- * Parse Drupal module and theme info file format.
+ * Parses Drupal module and theme .info files.
  *
  * Info files are NOT for placing arbitrary theme and module-specific settings.
  * Use variable_get() and variable_set() for that.
@@ -6829,35 +6904,42 @@ function drupal_write_record($table, &$record, $primary_keys = array()) {
  * - dependencies: An array of shortnames of other modules this module requires.
  * - package: The name of the package of modules this module belongs to.
  *
- * @see forum.info
+ * See forum.info for an example of a module .info file.
  *
  * Information stored in a theme .info file:
- * - name: The real name of the theme for display purposes
- * - description: Brief description
+ * - name: The real name of the theme for display purposes.
+ * - description: Brief description.
  * - screenshot: Path to screenshot relative to the theme's .info file.
  * - engine: Theme engine; typically phptemplate.
- * - base: Name of a base theme, if applicable, eg: base = zen
- * - regions: Listed regions eg: region[left] = Left sidebar
- * - features: Features available eg: features[] = logo
- * - stylesheets: Theme stylesheets eg: stylesheets[all][] = my-style.css
- * - scripts: Theme scripts eg: scripts[] = my-script.css
+ * - base: Name of a base theme, if applicable; e.g., base = zen.
+ * - regions: Listed regions; e.g., region[left] = Left sidebar.
+ * - features: Features available; e.g., features[] = logo.
+ * - stylesheets: Theme stylesheets; e.g., stylesheets[all][] = my-style.css.
+ * - scripts: Theme scripts; e.g., scripts[] = my-script.js.
  *
- * @see bartik.info
+ * See bartik.info for an example of a theme .info file.
  *
  * @param $filename
  *   The file we are parsing. Accepts file with relative or absolute path.
+ *
  * @return
  *   The info array.
  *
  * @see drupal_parse_info_format()
  */
 function drupal_parse_info_file($filename) {
-  if (!file_exists($filename)) {
-    return array();
-  }
+  $info = &drupal_static(__FUNCTION__, array());
 
-  $data = file_get_contents($filename);
-  return drupal_parse_info_format($data);
+  if (!isset($info[$filename])) {
+    if (!file_exists($filename)) {
+      $info[$filename] = array();
+    }
+    else {
+      $data = file_get_contents($filename);
+      $info[$filename] = drupal_parse_info_format($data);
+    }
+  }
+  return $info[$filename];
 }
 
 /**
@@ -7322,8 +7404,7 @@ function entity_create_stub_entity($entity_type, $ids) {
 /**
  * Load entities from the database.
  *
- * This function should be used whenever you need to load more than one entity
- * from the database. The entities are loaded into memory and will not require
+ * The entities are stored in a static memory cache, and will not require
  * database access if loaded again during the same page request.
  *
  * The actual loading is done through a class that has to implement the
@@ -7418,8 +7499,15 @@ function entity_get_controller($entity_type) {
  *   The type of entity, i.e. 'node', 'user'.
  * @param $entities
  *   The entity objects which are being prepared for view, keyed by object ID.
+ * @param $langcode
+ *   (optional) A language code to be used for rendering. Defaults to the global
+ *   content language of the current request.
  */
-function entity_prepare_view($entity_type, $entities) {
+function entity_prepare_view($entity_type, $entities, $langcode = NULL) {
+  if (!isset($langcode)) {
+    $langcode = $GLOBALS['language_content']->language;
+  }
+
   // To ensure hooks are only run once per entity, check for an
   // entity_view_prepared flag and only process items without it.
   // @todo: resolve this more generally for both entity and field level hooks.
@@ -7435,7 +7523,7 @@ function entity_prepare_view($entity_type, $entities) {
   }
 
   if (!empty($prepare)) {
-    module_invoke_all('entity_prepare_view', $prepare, $entity_type);
+    module_invoke_all('entity_prepare_view', $prepare, $entity_type, $langcode);
   }
 }
 
@@ -7510,7 +7598,7 @@ function entity_label($entity_type, $entity) {
   $label = FALSE;
   $info = entity_get_info($entity_type);
   if (isset($info['label callback']) && function_exists($info['label callback'])) {
-    $label = $info['label callback']($entity);
+    $label = $info['label callback']($entity, $entity_type);
   }
   elseif (!empty($info['entity keys']['label']) && isset($entity->{$info['entity keys']['label']})) {
     $label = $entity->{$info['entity keys']['label']};
diff --git a/includes/database/database.inc b/includes/database/database.inc
index e6cf0d5c3384966849961a140f7481b8c998b369..4cc1a33d75565d11302f02117687b8113690c8b0 100644
--- a/includes/database/database.inc
+++ b/includes/database/database.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: database.inc,v 1.147 2010/12/22 07:48:56 webchick Exp $
 
 /**
  * @file
@@ -321,7 +320,7 @@ abstract class DatabaseConnection extends PDO {
    *   PDO::FETCH_OBJ, PDO::FETCH_NUM, or a string representing the name of a
    *   class. If a string is specified, each record will be fetched into a new
    *   object of that class. The behavior of all other values is defined by PDO.
-   *   See http://www.php.net/PDOStatement-fetch
+   *   See http://php.net/manual/pdostatement.fetch.php
    * - return: Depending on the type of query, different return values may be
    *   meaningful. This directive instructs the system which type of return
    *   value is desired. The system will generally set the correct value
@@ -541,6 +540,63 @@ abstract class DatabaseConnection extends PDO {
     return $this->prefixTables('{' . $table . '}_' . $field . '_seq');
   }
 
+  /**
+   * Flatten an array of query comments into a single comment string.
+   *
+   * The comment string will be sanitized to avoid SQL injection attacks.
+   *
+   * @param $comments
+   *   An array of query comment strings.
+   *
+   * @return
+   *   A sanitized comment string.
+   */
+  public function makeComment($comments) {
+    if (empty($comments))
+      return '';
+
+    // Flatten the array of comments.
+    $comment = implode('; ', $comments);
+
+    // Sanitize the comment string so as to avoid SQL injection attacks.
+    return '/* ' . $this->filterComment($comment) . ' */ ';
+  }
+
+  /**
+   * Sanitize a query comment string.
+   *
+   * Ensure a query comment does not include strings such as "* /" that might
+   * terminate the comment early. This avoids SQL injection attacks via the
+   * query comment. The comment strings in this example are separated by a
+   * space to avoid PHP parse errors.
+   *
+   * For example, the comment:
+   * @code
+   * db_update('example')
+   *  ->condition('id', $id)
+   *  ->fields(array('field2' => 10))
+   *  ->comment('Exploit * / DROP TABLE node; --')
+   *  ->execute()
+   * @endcode
+   *
+   * Would result in the following SQL statement being generated:
+   * @code
+   * "/ * Exploit * / DROP TABLE node; -- * / UPDATE example SET field2=..."
+   * @endcode
+   *
+   * Unless the comment is sanitised first, the SQL server would drop the
+   * node table and ignore the rest of the SQL statement.
+   *
+   * @param $comment
+   *   A query comment string.
+   *
+   * @return
+   *   A sanitized version of the query comment string.
+   */
+  protected function filterComment($comment = '') {
+    return preg_replace('/(\/\*\s*)|(\s*\*\/)/', '', $comment);
+  }
+
   /**
    * Executes a query string against the database.
    *
diff --git a/includes/database/log.inc b/includes/database/log.inc
index e579bbcce322a552c332c2d8e2c2314bdd31af66..ec27ef8e6332ad6543ce7b489b0048b4aa3a8034 100644
--- a/includes/database/log.inc
+++ b/includes/database/log.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: log.inc,v 1.8 2010/03/31 15:09:21 dries Exp $
 
 /**
  * @file
diff --git a/includes/database/mysql/database.inc b/includes/database/mysql/database.inc
index 127c8daf8cec9d312900ffd83c11b1695b3db51b..262cc6051aeb67a31088c29d9ab7446b438528ef 100644
--- a/includes/database/mysql/database.inc
+++ b/includes/database/mysql/database.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: database.inc,v 1.34 2010/10/03 01:29:41 dries Exp $
 
 /**
  * @file
diff --git a/includes/database/mysql/install.inc b/includes/database/mysql/install.inc
index e6075b63ecc1efe15eacaa8e7d992f0012a798d0..75f2ae390504361204acf9bc9c8c4ceb476327b4 100644
--- a/includes/database/mysql/install.inc
+++ b/includes/database/mysql/install.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: install.inc,v 1.7 2010/11/26 21:36:43 webchick Exp $
 
 /**
  * @file
diff --git a/includes/database/mysql/query.inc b/includes/database/mysql/query.inc
index b1f248a5e74abaf8c6e54a7873eca3901c5fdb08..888b6a5a450e613b172814e53b0f53f27e76cf69 100644
--- a/includes/database/mysql/query.inc
+++ b/includes/database/mysql/query.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: query.inc,v 1.18 2010/06/26 01:40:05 dries Exp $
 
 /**
  * @ingroup database
@@ -43,8 +42,8 @@ class InsertQuery_mysql extends InsertQuery {
   }
 
   public function __toString() {
-    // Create a comments string to prepend to the query.
-    $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
+    // Create a sanitized comment string to prepend to the query.
+    $comments = $this->connection->makeComment($this->comments);
 
     // Default fields are always placed first for consistency.
     $insert_fields = array_merge($this->defaultFields, $this->insertFields);
@@ -93,8 +92,8 @@ class TruncateQuery_mysql extends TruncateQuery {
     // not transactional, and result in an implicit COMMIT. When we are in a
     // transaction, fallback to the slower, but transactional, DELETE.
     if ($this->connection->inTransaction()) {
-      // Create a comments string to prepend to the query.
-      $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
+      // Create a comment string to prepend to the query.
+      $comments = $this->connection->makeComment($this->comments);
       return $comments . 'DELETE FROM {' . $this->connection->escapeTable($this->table) . '}';
     }
     else {
diff --git a/includes/database/mysql/schema.inc b/includes/database/mysql/schema.inc
index 94fcb821de316aee3f4c92674872ab5cf539723c..4e88fa169ebeb6dca90fdf66a55f6ffe10f3bc06 100644
--- a/includes/database/mysql/schema.inc
+++ b/includes/database/mysql/schema.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: schema.inc,v 1.44 2010/12/08 06:38:59 webchick Exp $
 
 /**
  * @file
diff --git a/includes/database/pgsql/database.inc b/includes/database/pgsql/database.inc
index 57e77507c7b729c16f259f56c89fcb253bb85244..98b954ffdc029ee3e64de5eeb3ea6a20e430aa6b 100644
--- a/includes/database/pgsql/database.inc
+++ b/includes/database/pgsql/database.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: database.inc,v 1.43 2010/10/03 01:29:41 dries Exp $
 
 /**
  * @file
@@ -35,6 +34,15 @@ class DatabaseConnection_pgsql extends DatabaseConnection {
     if (empty($connection_options['password'])) {
       $connection_options['password'] = NULL;
     }
+    // If the password contains a backslash it is treated as an escape character
+    // http://bugs.php.net/bug.php?id=53217
+    // so backslashes in the password need to be doubled up.
+    // The bug was reported against pdo_pgsql 1.0.2, backslashes in passwords
+    // will break on this doubling up when the bug is fixed, so check the version
+    //elseif (phpversion('pdo_pgsql') < 'version_this_was_fixed_in') {
+    else {
+      $connection_options['password'] = str_replace('\\', '\\\\', $connection_options['password']);
+    }
 
     $this->connectionOptions = $connection_options;
 
diff --git a/includes/database/pgsql/install.inc b/includes/database/pgsql/install.inc
index beb7f53e9bf5492c2b88fbdabb8a99c6ffbf5431..c77f4ea78ce5680fde96fbc013e28f150b57e4aa 100644
--- a/includes/database/pgsql/install.inc
+++ b/includes/database/pgsql/install.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: install.inc,v 1.14 2010/12/21 21:20:04 webchick Exp $
 
 /**
  * @file
diff --git a/includes/database/pgsql/query.inc b/includes/database/pgsql/query.inc
index b18b570051e0d90304bab441b30b33d271700453..f3783a9ca8f9ceb4f745c650fa826ee3271e1df4 100644
--- a/includes/database/pgsql/query.inc
+++ b/includes/database/pgsql/query.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: query.inc,v 1.24 2010/11/29 04:45:10 webchick Exp $
 
 /**
  * @ingroup database
@@ -104,8 +103,8 @@ class InsertQuery_pgsql extends InsertQuery {
   }
 
   public function __toString() {
-    // Create a comments string to prepend to the query.
-    $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
+    // Create a sanitized comment string to prepend to the query.
+    $comments = $this->connection->makeComment($this->comments);
 
     // Default fields are always placed first for consistency.
     $insert_fields = array_merge($this->defaultFields, $this->insertFields);
diff --git a/includes/database/pgsql/schema.inc b/includes/database/pgsql/schema.inc
index 4ceddcb074616193684030a259424b33d92ce203..9ed8a26203275b82d2c6c638ba84f5362265a95d 100644
--- a/includes/database/pgsql/schema.inc
+++ b/includes/database/pgsql/schema.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: schema.inc,v 1.43 2010/12/29 04:03:42 webchick Exp $
 
 /**
  * @file
@@ -528,6 +527,9 @@ class DatabaseSchema_pgsql extends DatabaseSchema {
       $this->connection->query('ALTER TABLE {' . $table . '} DROP CONSTRAINT "' . $check . '"');
     }
 
+    // Remove old default.
+    $this->fieldSetNoDefault($table, $field);
+
     $this->connection->query('ALTER TABLE {' . $table . '} ALTER "' . $field . '" TYPE ' . $typecast . ' USING "' . $field . '"::' . $typecast);
 
     if (isset($spec['not null'])) {
@@ -562,6 +564,11 @@ class DatabaseSchema_pgsql extends DatabaseSchema {
       $this->connection->query('ALTER TABLE {' . $table . '} ADD CHECK ("' . $field_new . '" >= 0)');
     }
 
+    // Add default if necessary.
+    if (isset($spec['default'])) {
+      $this->fieldSetDefault($table, $field_new, $spec['default']);
+    }
+
     // Change description if necessary.
     if (!empty($spec['description'])) {
       $this->connection->query('COMMENT ON COLUMN {' . $table . '}."' . $field_new . '" IS ' . $this->prepareComment($spec['description']));
diff --git a/includes/database/pgsql/select.inc b/includes/database/pgsql/select.inc
index f61ccad0c62f9aa840b6e1a26cb0dd900762211d..d1d83828118d9bbbd3de7cfedd506a8b862fedd8 100644
--- a/includes/database/pgsql/select.inc
+++ b/includes/database/pgsql/select.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: select.inc,v 1.1 2010/11/29 19:57:57 webchick Exp $
 
 /**
  * @file
diff --git a/includes/database/prefetch.inc b/includes/database/prefetch.inc
index a314eacf0a24868a9cd5b9431e4b7a990535d54a..f378d35559ef77a43b3c5d951208e55881029021 100644
--- a/includes/database/prefetch.inc
+++ b/includes/database/prefetch.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: prefetch.inc,v 1.10 2010/04/30 13:47:46 dries Exp $
 
 /**
  * @file
diff --git a/includes/database/query.inc b/includes/database/query.inc
index f2cfc6c33ffc4ea4b4fcbadbb945ce8f09c63fea..23b652f9b4b439114d677db0ddd5f0a75414814a 100644
--- a/includes/database/query.inc
+++ b/includes/database/query.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: query.inc,v 1.60 2010/12/31 20:43:43 webchick Exp $
 
 /**
  * @ingroup database
@@ -362,6 +361,9 @@ abstract class Query implements QueryPlaceholderInterface {
    * for easier debugging and allows you to more easily find where a query
    * with a performance problem is being generated.
    *
+   * The comment string will be sanitized to remove * / and other characters
+   * that may terminate the string early so as to avoid SQL injection attacks.
+   *
    * @param $comment
    *   The comment string to be inserted into the query.
    *
@@ -624,9 +626,8 @@ class InsertQuery extends Query {
    *   The prepared statement.
    */
   public function __toString() {
-
-    // Create a comments string to prepend to the query.
-    $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
+    // Create a sanitized comment string to prepend to the query.
+    $comments = $this->connection->makeComment($this->comments);
 
     // Default fields are always placed first for consistency.
     $insert_fields = array_merge($this->defaultFields, $this->insertFields);
@@ -816,9 +817,8 @@ class DeleteQuery extends Query implements QueryConditionInterface {
    *   The prepared statement.
    */
   public function __toString() {
-
-    // Create a comments string to prepend to the query.
-    $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
+    // Create a sanitized comment string to prepend to the query.
+    $comments = $this->connection->makeComment($this->comments);
 
     $query = $comments . 'DELETE FROM {' . $this->connection->escapeTable($this->table) . '} ';
 
@@ -885,8 +885,8 @@ class TruncateQuery extends Query {
    *   The prepared statement.
    */
   public function __toString() {
-    // Create a comments string to prepend to the query.
-    $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
+    // Create a sanitized comment string to prepend to the query.
+    $comments = $this->connection->makeComment($this->comments);
 
     return $comments . 'TRUNCATE {' . $this->connection->escapeTable($this->table) . '} ';
   }
@@ -1112,9 +1112,8 @@ class UpdateQuery extends Query implements QueryConditionInterface {
    *   The prepared statement.
    */
   public function __toString() {
-
-    // Create a comments string to prepend to the query.
-    $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
+    // Create a sanitized comment string to prepend to the query.
+    $comments = $this->connection->makeComment($this->comments);
 
     // Expressions take priority over literal fields, so we process those first
     // and remove any literal fields that conflict.
diff --git a/includes/database/schema.inc b/includes/database/schema.inc
index 1423f655894b85e40397f543d165970b63ee0b86..de1b2f5b9b863cba5a8b01ca5bc6cc5c67db34b8 100644
--- a/includes/database/schema.inc
+++ b/includes/database/schema.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: schema.inc,v 1.44 2011/01/03 18:03:54 webchick Exp $
 
 /**
  * @file
diff --git a/includes/database/select.inc b/includes/database/select.inc
index 19e0464c2792febe24e63500add7aac3edf5ac21..716c2fc3dbf7f67f82ac361e2c61e2694ddf93bb 100644
--- a/includes/database/select.inc
+++ b/includes/database/select.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: select.inc,v 1.59 2010/12/31 20:43:43 webchick Exp $
 
 /**
  * @ingroup database
@@ -1440,9 +1439,8 @@ class SelectQuery extends Query implements SelectQueryInterface {
   }
 
   public function __toString() {
-
-    // Create a comments string to prepend to the query.
-    $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
+    // Create a sanitized comment string to prepend to the query.
+    $comments = $this->connection->makeComment($this->comments);
 
     // SELECT
     $query = $comments . 'SELECT ';
diff --git a/includes/database/sqlite/database.inc b/includes/database/sqlite/database.inc
index 6163f2e42aac09962f58cdab8160fcf38f0917bb..cf3b9551ffb5fc488dc3fbb8077f666160b2685e 100644
--- a/includes/database/sqlite/database.inc
+++ b/includes/database/sqlite/database.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: database.inc,v 1.41 2010/12/23 05:29:27 webchick Exp $
 
 /**
  * @file
diff --git a/includes/database/sqlite/install.inc b/includes/database/sqlite/install.inc
index a5b0efaca9969bf09acb65e4e254ab0ba38af01d..62cbac381f17c5cad67688540e0ff9a58905caf2 100644
--- a/includes/database/sqlite/install.inc
+++ b/includes/database/sqlite/install.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: install.inc,v 1.6 2010/11/29 02:55:57 webchick Exp $
 
 /**
  * @file
diff --git a/includes/database/sqlite/query.inc b/includes/database/sqlite/query.inc
index b0a62e07220315b39c7ef986be4a56fe368c74f2..6b8a72f2ab46aed8da9f908a7f66f4f71d27b11a 100644
--- a/includes/database/sqlite/query.inc
+++ b/includes/database/sqlite/query.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: query.inc,v 1.15 2010/12/22 01:16:43 webchick Exp $
 
 /**
  * @file
@@ -33,8 +32,8 @@ class InsertQuery_sqlite extends InsertQuery {
   }
 
   public function __toString() {
-    // Create a comments string to prepend to the query.
-    $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
+    // Create a sanitized comment string to prepend to the query.
+    $comments = $this->connection->makeComment($this->comments);
 
     // Produce as many generic placeholders as necessary.
     $placeholders = array_fill(0, count($this->insertFields), '?');
@@ -102,7 +101,7 @@ class UpdateQuery_sqlite extends UpdateQuery {
       }
       elseif (!isset($data)) {
         // The field will be set to NULL.
-        $condition->isNull($field);
+        $condition->isNotNull($field);
       }
       else {
         $condition->condition($field, $data, '<>');
@@ -149,8 +148,8 @@ class DeleteQuery_sqlite extends DeleteQuery {
  */
 class TruncateQuery_sqlite extends TruncateQuery {
   public function __toString() {
-    // Create a comments string to prepend to the query.
-    $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
+    // Create a sanitized comment string to prepend to the query.
+    $comments = $this->connection->makeComment($this->comments);
 
     return $comments . 'DELETE FROM {' . $this->connection->escapeTable($this->table) . '} ';
   }
diff --git a/includes/database/sqlite/schema.inc b/includes/database/sqlite/schema.inc
index 928e34b810412aee5bef6aa032234e87d5ecfbdb..840ba6b5d4ae4f635ee79140dbe09ae30861cc6f 100644
--- a/includes/database/sqlite/schema.inc
+++ b/includes/database/sqlite/schema.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: schema.inc,v 1.23 2010/12/23 01:43:38 webchick Exp $
 
 /**
  * @file
diff --git a/includes/database/sqlite/select.inc b/includes/database/sqlite/select.inc
index 3d89af4d555ca52480674ad526a7de3e097e54c7..fb926ef04d3124d7cb8efe35a7e51a0e81301f6c 100644
--- a/includes/database/sqlite/select.inc
+++ b/includes/database/sqlite/select.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: select.inc,v 1.1 2010/11/29 19:57:57 webchick Exp $
 
 /**
  * @file
diff --git a/includes/date.inc b/includes/date.inc
index 6eaddd80601a2177e508d32f152add7214405a7a..27634f9e39ba308404c60cb4da5d35ac682812a1 100644
--- a/includes/date.inc
+++ b/includes/date.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: date.inc,v 1.2 2010/12/09 01:51:15 dries Exp $
 
 /**
  * @file
diff --git a/includes/entity.inc b/includes/entity.inc
index fbc4f0292fe1baf6bf176376f918783c90c7396f..a3cdf7417367b21977070bd9b30b0286ec359219 100644
--- a/includes/entity.inc
+++ b/includes/entity.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: entity.inc,v 1.19 2010/11/30 19:31:46 dries Exp $
 
 /**
  * Interface for entity controller classes.
@@ -409,7 +408,7 @@ class EntityFieldQueryException extends Exception {}
  * direct access to the collected properties in order to handle alternate
  * execution routines. We therefore use public properties for simplicity. Note
  * that code that is simply creating and running a field query should still use
- * the appropriate methods add conditions on the query.
+ * the appropriate methods to add conditions on the query.
  *
  * Storage engines are not required to support every type of query. By default,
  * an EntityFieldQueryException will be raised if an unsupported condition is
diff --git a/includes/errors.inc b/includes/errors.inc
index 2022fc4f13e6556a730bed70e2500c1dc5badfa1..3a97b6daa036ba414093f3c9422386e890147f24 100644
--- a/includes/errors.inc
+++ b/includes/errors.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: errors.inc,v 1.9 2010/10/16 00:00:16 webchick Exp $
 
 /**
  * @file
diff --git a/includes/file.inc b/includes/file.inc
index 4e9f3a9a38481b3f422ebd23ebb24743ba826b7f..6dc7f88b3f8ac73f17c2942d87b490a8ba9112f3 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: file.inc,v 1.243 2010/12/15 03:39:41 webchick Exp $
 
 /**
  * @file
@@ -202,9 +201,8 @@ function file_stream_wrapper_get_class($scheme) {
  * @see file_uri_target()
  */
 function file_uri_scheme($uri) {
-  $data = explode('://', $uri, 2);
-
-  return count($data) == 2 ? $data[0] : FALSE;
+  $position = strpos($uri, '://');
+  return $position ? substr($uri, 0, $position) : FALSE;
 }
 
 /**
@@ -424,7 +422,7 @@ function file_create_url($uri) {
  * Directories need to have execute permissions to be considered a directory by
  * FTP servers, etc.
  *
- * @param &$directory
+ * @param $directory
  *   A string reference containing the name of a directory path or URI. A
  *   trailing slash will be trimmed from a path.
  * @param $options
diff --git a/includes/file.mimetypes.inc b/includes/file.mimetypes.inc
index 9f2383808d2f96b988c9befcd16e69c50d51048b..cda03fb92b374f6612a353e13b1ec10d697a7b99 100644
--- a/includes/file.mimetypes.inc
+++ b/includes/file.mimetypes.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: file.mimetypes.inc,v 1.5 2010/07/16 02:40:48 dries Exp $
 
 /**
  * @file
diff --git a/includes/filetransfer/filetransfer.inc b/includes/filetransfer/filetransfer.inc
index d7f47e090b9416f5d0fdd7245b33ab8e87a682fd..2083da9d3f802db24f97d814771a03defc0b29f4 100644
--- a/includes/filetransfer/filetransfer.inc
+++ b/includes/filetransfer/filetransfer.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: filetransfer.inc,v 1.14 2011/01/03 02:20:45 webchick Exp $
 
 /*
  * Base FileTransfer class.
diff --git a/includes/filetransfer/ftp.inc b/includes/filetransfer/ftp.inc
index 97a6f9b155182f61e0d815b5352d073d0d0fa20e..838dc7c1e1e560175bda1b2867db4ca1057c0835 100644
--- a/includes/filetransfer/ftp.inc
+++ b/includes/filetransfer/ftp.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: ftp.inc,v 1.16 2011/01/03 02:20:45 webchick Exp $
 
 /**
  * Base class for FTP implementations.
diff --git a/includes/filetransfer/local.inc b/includes/filetransfer/local.inc
index 225a3408cea5a3961e816fb848a0a4228ad2bd19..b1259897331f31669cb9ba812e7e7f52cfa3ba23 100644
--- a/includes/filetransfer/local.inc
+++ b/includes/filetransfer/local.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: local.inc,v 1.7 2010/12/01 00:13:47 webchick Exp $
 
 /**
  * The local connection class for copying files as the httpd user.
diff --git a/includes/filetransfer/ssh.inc b/includes/filetransfer/ssh.inc
index a47e967669802bf15f01a55f4fa3f4ff4c5aaaf9..43ec3249ef0c633d933c07634692d42798b6b881 100644
--- a/includes/filetransfer/ssh.inc
+++ b/includes/filetransfer/ssh.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: ssh.inc,v 1.8 2011/01/03 02:32:27 webchick Exp $
 
 /**
  * The SSH connection class for the update module.
diff --git a/includes/form.inc b/includes/form.inc
index 72a0acbfeb5308b7509d6a49ae70faaf53b3617a..a337b03d1c29b62cf2464b7c583357e1ccc6a7ef 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: form.inc,v 1.520 2011/01/04 16:46:24 webchick Exp $
 
 /**
  * @defgroup forms Form builder functions
@@ -128,9 +127,9 @@
  * - 'triggering_element': (read-only) The form element that triggered
  *   submission. This is the same as the deprecated
  *   $form_state['clicked_button']. It is the element that caused submission,
- *   which may or may not be a button (in the case of AJAX forms.) This is
+ *   which may or may not be a button (in the case of Ajax forms.) This is
  *   often used to distinguish between various buttons in a submit handler,
- *   and is also used in AJAX handlers.
+ *   and is also used in Ajax handlers.
  * - 'cache': The typical form workflow involves two page requests. During the
  *   first page request, a form is built and returned for the user to fill in.
  *   Then the user fills the form in and submits it, triggering a second page
@@ -139,9 +138,9 @@
  *   In some special use-cases, it is necessary or desired to persist the $form
  *   and $form_state variables from the initial page request to the one that
  *   processes the submission. A form builder function can set 'cache' to TRUE
- *   to do this. One example where this is needed is to handle AJAX submissions,
+ *   to do this. One example where this is needed is to handle Ajax submissions,
  *   so ajax_process_form() sets this for all forms that include an element with
- *   a #ajax property. (In AJAX, the handler has no way to build the form
+ *   a #ajax property. (In Ajax, the handler has no way to build the form
  *   itself, so must rely on the cached version created on each page load, so
  *   it's a classic example of this use case.) Note that the persistence of
  *   $form and $form_state across successive submissions of a multi-step form
@@ -202,7 +201,7 @@ function drupal_get_form($form_id) {
  *   can implement hook_forms(), which maps different $form_id values to the
  *   proper form constructor function. Examples may be found in node_forms(),
  *   search_forms(), and user_forms().
- * @param &$form_state
+ * @param $form_state
  *   An array which stores information about the form. This is passed as a
  *   reference so that the caller can use it to examine what in the form changed
  *   when the form submission process is complete. Furthermore, it may be used
@@ -254,7 +253,7 @@ function drupal_get_form($form_id) {
  *   - must_validate: Ordinarily, a form is only validated once but there are
  *     times when a form is resubmitted internally and should be validated
  *     again. Setting this to TRUE will force that to happen. This is most
- *     likely to occur during AHAH or AJAX operations.
+ *     likely to occur during AHAH or Ajax operations.
  *   - temporary: An array holding temporary data accessible during the current
  *     page request only. It may be used to temporary save any data that doesn't
  *     need to or shouldn't be cached during the whole form workflow, e.g. data
@@ -396,9 +395,9 @@ function form_state_defaults() {
  * function is called to generate a new $form, the next step in the form
  * workflow, to be returned for rendering.
  *
- * AJAX form submissions are almost always multi-step workflows, so that is one
+ * Ajax form submissions are almost always multi-step workflows, so that is one
  * common use-case during which form rebuilding occurs. See ajax_form_callback()
- * for more information about creating AJAX-enabled forms.
+ * for more information about creating Ajax-enabled forms.
  *
  * @param $form_id
  *   The unique string identifying the desired form. If a function
@@ -411,7 +410,7 @@ function form_state_defaults() {
  *   A keyed array containing the current state of the form.
  * @param $old_form
  *   (optional) A previously built $form. Used to retain the #build_id and
- *   #action properties in AJAX callbacks and similar partial form rebuilds. The
+ *   #action properties in Ajax callbacks and similar partial form rebuilds. The
  *   only properties copied from $old_form are the ones which both exist in
  *   $old_form and for which $form_state['rebuild_info']['copy'][PROPERTY] is
  *   TRUE. If $old_form is not passed, the entire $form is rebuilt freshly.
@@ -427,7 +426,7 @@ function form_state_defaults() {
 function drupal_rebuild_form($form_id, &$form_state, $old_form = NULL) {
   $form = drupal_retrieve_form($form_id, $form_state);
 
-  // If only parts of the form will be returned to the browser (e.g. AJAX or
+  // If only parts of the form will be returned to the browser (e.g., Ajax or
   // RIA clients), re-use the old #build_id to not require client-side code to
   // manually update the hidden 'build_id' input element.
   // Otherwise, a new #build_id is generated, to not clobber the previous
@@ -441,7 +440,7 @@ function drupal_rebuild_form($form_id, &$form_state, $old_form = NULL) {
     $form['#build_id'] = 'form-' . drupal_hash_base64(uniqid(mt_rand(), TRUE) . mt_rand());
   }
 
-  // #action defaults to request_uri(), but in case of AJAX and other partial
+  // #action defaults to request_uri(), but in case of Ajax and other partial
   // rebuilds, the form is submitted to an alternate URL, and the original
   // #action needs to be retained.
   if (isset($old_form['#action']) && !empty($form_state['rebuild_info']['copy']['#action'])) {
@@ -882,13 +881,13 @@ function drupal_process_form($form_id, &$form, &$form_state) {
     // yet complete. A new $form needs to be constructed based on the changes
     // made to $form_state during this request. Normally, a submit handler sets
     // $form_state['rebuild'] if a fully executed form requires another step.
-    // However, for forms that have not been fully executed (e.g., AJAX
+    // However, for forms that have not been fully executed (e.g., Ajax
     // submissions triggered by non-buttons), there is no submit handler to set
     // $form_state['rebuild']. It would not make sense to redisplay the
     // identical form without an error for the user to correct, so we also
     // rebuild error-free non-executed forms, regardless of
     // $form_state['rebuild'].
-    // @todo D8: Simplify this logic; considering AJAX and non-HTML front-ends,
+    // @todo D8: Simplify this logic; considering Ajax and non-HTML front-ends,
     //   along with element-level #submit properties, it makes no sense to have
     //   divergent form execution based on whether the triggering element has
     //   #executes_submit_callback set to TRUE.
@@ -1146,7 +1145,7 @@ function drupal_validate_form($form_id, &$form, &$form_state) {
  * - If $form_state['no_redirect'] is TRUE, then the callback that originally
  *   built the form explicitly disallows any redirection, regardless of the
  *   redirection value in $form_state['redirect']. For example, ajax_get_form()
- *   defines $form_state['no_redirect'] when building a form in an AJAX
+ *   defines $form_state['no_redirect'] when building a form in an Ajax
  *   callback to prevent any redirection. $form_state['no_redirect'] should NOT
  *   be altered by form builder functions or form validation/submit handlers.
  * - If $form_state['programmed'] is TRUE, the form submission was usually
@@ -1286,7 +1285,7 @@ function _form_validate(&$elements, &$form_state, $form_id = NULL) {
     // If submit handlers won't run (due to the submission having been triggered
     // by an element whose #executes_submit_callback property isn't TRUE), then
     // it's safe to suppress all validation errors, and we do so by default,
-    // which is particularly useful during an AJAX submission triggered by a
+    // which is particularly useful during an Ajax submission triggered by a
     // non-button. An element can override this default by setting the
     // #limit_validation_errors property. For button element types,
     // #limit_validation_errors defaults to FALSE (via system_element_info()),
@@ -1962,12 +1961,12 @@ function _form_builder_handle_input_element($form_id, &$element, &$form_state) {
   // form_state_values_clean(). Enforce the same input processing restrictions
   // as above.
   if ($process_input) {
-    // Detect if the element triggered the submission via AJAX.
+    // Detect if the element triggered the submission via Ajax.
     if (_form_element_triggered_scripted_submission($element, $form_state)) {
       $form_state['triggering_element'] = $element;
     }
 
-    // If the form was submitted by the browser rather than via AJAX, then it
+    // If the form was submitted by the browser rather than via Ajax, then it
     // can only have been triggered by a button, and we need to determine which
     // button within the constraints of how browsers provide this information.
     if (isset($element['#button_type'])) {
@@ -1992,7 +1991,7 @@ function _form_builder_handle_input_element($form_id, &$element, &$form_state) {
  * Helper function to handle the convoluted logic of button click detection.
  *
  * This detects button or non-button controls that trigger a form submission via
- * AJAX or some other scriptable environment. These environments can set the
+ * Ajax or some other scriptable environment. These environments can set the
  * special input key '_triggering_element_name' to identify the triggering
  * element. If the name alone doesn't identify the element uniquely, the input
  * key '_triggering_element_value' may also be set to require a match on element
@@ -2017,7 +2016,7 @@ function _form_element_triggered_scripted_submission($element, &$form_state) {
  * of the POST data, but with extra code to deal with the convoluted way in
  * which browsers submit data for image button clicks.
  *
- * This does not detect button clicks processed by AJAX (that is done in
+ * This does not detect button clicks processed by Ajax (that is done in
  * _form_element_triggered_scripted_submission()) and it does not detect form
  * submissions from Internet Explorer in response to an ENTER key pressed in a
  * textfield (form_builder() has extra code for that).
@@ -2062,7 +2061,7 @@ function _form_button_was_clicked($element, &$form_state) {
  * - form_build_id
  * - op
  *
- * @param &$form_state
+ * @param $form_state
  *   A keyed array containing the current state of the form, including
  *   submitted form values; altered by reference.
  */
@@ -2492,7 +2491,7 @@ function form_process_select($element) {
     if (($required && !isset($element['#default_value'])) || isset($element['#empty_value']) || isset($element['#empty_option'])) {
       $element += array(
         '#empty_value' => '',
-        '#empty_option' => $required ? t('- Select - ') : t('- None -'),
+        '#empty_option' => $required ? t('- Select -') : t('- None -'),
       );
       // The empty option is prepended to #options and purposively not merged
       // to prevent another option in #options mistakenly using the same value
@@ -3378,7 +3377,7 @@ function form_validate_machine_name(&$element, &$form_state) {
  * Adds fieldsets to the specified group or adds group members to this
  * fieldset.
  *
- * @param &$element
+ * @param $element
  *   An associative array containing the properties and children of the
  *   fieldset. Note that $element must be taken by reference here, so processed
  *   child elements are taken over into $form_state.
@@ -3724,7 +3723,7 @@ function theme_textarea($variables) {
 function theme_password($variables) {
   $element = $variables['element'];
   $element['#attributes']['type'] = 'password';
-  element_set_attributes($element, array('id', 'name', 'value', 'size', 'maxlength'));
+  element_set_attributes($element, array('id', 'name', 'size', 'maxlength'));
   _form_set_class($element, array('form-text'));
 
   return '<input' . drupal_attributes($element['#attributes']) . ' />';
@@ -3956,7 +3955,7 @@ function theme_form_element_label($variables) {
  *
  * Adds 'required' and 'error' classes as needed.
  *
- * @param &$element
+ * @param $element
  *   The form element.
  * @param $name
  *   Array of new class names to be added.
@@ -4016,7 +4015,9 @@ function _form_set_class(&$element, $class = array()) {
  * Note: if the batch 'title', 'init_message', 'progress_message', or
  * 'error_message' could contain any user input, it is the responsibility of
  * the code calling batch_set() to sanitize them first with a function like
- * check_plain() or filter_xss().
+ * check_plain() or filter_xss(). Furthermore, if the batch operation
+ * returns any user input in the 'results' or 'message' keys of $context,
+ * it must also sanitize them first.
  *
  * Sample batch operations:
  * @code
@@ -4039,8 +4040,8 @@ function _form_set_class(&$element, $class = array()) {
  *   //   and the batch processing can continue to the next operation.
  *
  *   $node = node_load(array('uid' => $uid, 'type' => $type));
- *   $context['results'][] = $node->nid . ' : ' . $node->title;
- *   $context['message'] = $node->title;
+ *   $context['results'][] = $node->nid . ' : ' . check_plain($node->title);
+ *   $context['message'] = check_plain($node->title);
  * }
  *
  * // More advanced example: multi-step operation - load all nodes, five by five
@@ -4059,10 +4060,10 @@ function _form_set_class(&$element, $class = array()) {
  *     ->execute();
  *   foreach ($result as $row) {
  *     $node = node_load($row->nid, NULL, TRUE);
- *     $context['results'][] = $node->nid . ' : ' . $node->title;
+ *     $context['results'][] = $node->nid . ' : ' . check_plain($node->title);
  *     $context['sandbox']['progress']++;
  *     $context['sandbox']['current_node'] = $node->nid;
- *     $context['message'] = $node->title;
+ *     $context['message'] = check_plain($node->title);
  *   }
  *   if ($context['sandbox']['progress'] != $context['sandbox']['max']) {
  *     $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
diff --git a/includes/graph.inc b/includes/graph.inc
index 01a273391504e35387554ebc091af18d87ae9cf5..416fad6df077f6e2b0cb14bfca1f674ba43e0b66 100644
--- a/includes/graph.inc
+++ b/includes/graph.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: graph.inc,v 1.4 2010/04/22 19:21:12 dries Exp $
 
 /**
  * @file
@@ -33,7 +32,7 @@
  *   @endcode
  *
  * @return
- *   The passed in $graph with more secondary keys filled in:
+ *   The passed-in $graph with more secondary keys filled in:
  *   - 'paths': Contains a list of vertices than can be reached on a path from
  *     this vertex.
  *   - 'reverse_paths': Contains a list of vertices that has a path from them
@@ -75,15 +74,15 @@ function drupal_depth_first_search(&$graph) {
 /**
  * Helper function to perform a depth first sort.
  *
- * @param &$graph
+ * @param $graph
  *   A three dimensional associated graph array.
- * @param &$state
+ * @param $state
  *   An associative array. The key 'last_visit_order' stores a list of the
  *   vertices visited. The key components stores list of vertices belonging
  *   to the same the component.
  * @param $start
  *   An arbitrary vertex where we started traversing the graph.
- * @param &$component
+ * @param $component
  *   The component of the last vertex.
  *
  * @see drupal_depth_first_search()
diff --git a/includes/image.inc b/includes/image.inc
index ce6a5275f9c447d2766e495bfa44ddf3eb9eb84c..b04943b5e619debb30387c3743e91425c8064b20 100644
--- a/includes/image.inc
+++ b/includes/image.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: image.inc,v 1.42 2011/01/02 17:26:39 webchick Exp $
 
 /**
  * @file
diff --git a/includes/install.core.inc b/includes/install.core.inc
index 52ef5935433a7ddffcb83bb49a72f0ca362c9e6a..a74dfdf0f37e5776b6f9187493d288a69194b93b 100644
--- a/includes/install.core.inc
+++ b/includes/install.core.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: install.core.inc,v 1.49 2011/01/03 15:48:11 webchick Exp $
 
 /**
  * @file
diff --git a/includes/install.inc b/includes/install.inc
index 3956ff9f672cdbd50e52b30ae78c82240f450af4..d22f4f9cb8c2b74ec87c54de34b5fac7b9f6a13c 100644
--- a/includes/install.inc
+++ b/includes/install.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: install.inc,v 1.152 2011/01/02 17:23:20 webchick Exp $
 
 /**
  * Indicates that a module has not been installed yet.
@@ -199,7 +198,7 @@ function drupal_install_profile_distribution_name() {
   // At all other times, we load the profile via standard methods.
   else {
     $profile = drupal_get_profile();
-    $info = install_profile_info($profile);
+    $info = system_get_info('module', $profile);
     return $info['distribution_name'];
   }
 }
@@ -548,7 +547,7 @@ abstract class DatabaseTasks {
    *
    * @param $database
    *   An array of driver specific configuration options.
-   * 
+   *
    * @return
    *   An array of driver configuration errors, keyed by form element name.
    */
@@ -783,44 +782,12 @@ function drupal_uninstall_modules($module_list = array(), $uninstall_dependents
   }
 
   foreach ($module_list as $module) {
-    // First, retrieve all the module's menu paths from db.
-    drupal_load('module', $module);
-    $paths = module_invoke($module, 'menu');
-
     // Uninstall the module.
     module_load_install($module);
     module_invoke($module, 'uninstall');
     drupal_uninstall_schema($module);
 
     watchdog('system', '%module module uninstalled.', array('%module' => $module), WATCHDOG_INFO);
-
-    // Now remove the menu links for all paths declared by this module.
-    if (!empty($paths)) {
-      $paths = array_keys($paths);
-      // Clean out the names of load functions.
-      foreach ($paths as $index => $path) {
-        $parts = explode('/', $path, MENU_MAX_PARTS);
-        foreach ($parts as $k => $part) {
-          if (preg_match('/^%[a-z_]*$/', $part)) {
-            $parts[$k] = '%';
-          }
-        }
-        $paths[$index] = implode('/', $parts);
-      }
-
-      $result = db_select('menu_links')
-        ->fields('menu_links')
-        ->condition('router_path', $paths, 'IN')
-        ->condition('external', 0)
-        ->orderBy('depth')
-        ->execute();
-      // Remove all such items. Starting from those with the greatest depth will
-      // minimize the amount of re-parenting done by menu_link_delete().
-      foreach ($result as $item) {
-        _menu_delete_item($item, TRUE);
-      }
-    }
-
     drupal_set_installed_schema_version($module, SCHEMA_UNINSTALLED);
   }
 
@@ -1055,7 +1022,12 @@ function install_goto($path) {
  * Used during the install process, when database, theme, and localization
  * system is possibly not yet available.
  *
+ * Use t() if your code will never run during the Drupal installation phase.
+ * Use st() if your code will only run during installation and never any other
+ * time. Use get_t() if your code could run in either circumstance.
+ *
  * @see t()
+ * @see get_t()
  * @ingroup sanitization
  */
 function st($string, array $args = array(), array $options = array()) {
@@ -1199,6 +1171,10 @@ function drupal_check_module($module) {
  *   installed, to be shown throughout the installation process. Defaults to
  *   'Drupal'.
  *
+ * Note that this function does an expensive file system scan to get info file
+ * information for dependencies. If you only need information from the info
+ * file itself, use system_get_info().
+ *
  * Example of .info file:
  * @code
  *    name = Minimal
diff --git a/includes/iso.inc b/includes/iso.inc
index 5d8a09c078b4af9322ebab62ac16cdf627dbea23..dabbefdd5b6f2acce5341e0142b00056e2f09c99 100644
--- a/includes/iso.inc
+++ b/includes/iso.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: iso.inc,v 1.13 2011/01/04 16:07:48 webchick Exp $
 
 /**
  * @file
diff --git a/includes/language.inc b/includes/language.inc
index 61bbbd76c9261d9ae365fb9180885cc60f624b44..b7057f2a138cc69b64303d45b1ed245ed1f00aad 100644
--- a/includes/language.inc
+++ b/includes/language.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: language.inc,v 1.30 2010/05/12 08:26:14 dries Exp $
 
 /**
  * @file
@@ -84,6 +83,44 @@ function language_types_disable($types) {
   variable_set('language_types', $enabled_types);
 }
 
+/**
+ * Updates the language type configuration.
+ */
+function language_types_set() {
+  // Ensure that we are getting the defined language negotiation information. An
+  // invocation of module_enable() or module_disable() could outdate the cached
+  // information.
+  drupal_static_reset('language_types_info');
+  drupal_static_reset('language_negotiation_info');
+
+  // Determine which language types are configurable and which not by checking
+  // whether the 'fixed' key is defined. Non-configurable (fixed) language types
+  // have their language negotiation settings stored there.
+  $defined_providers = language_negotiation_info();
+  foreach (language_types_info() as $type => $info) {
+    if (isset($info['fixed'])) {
+      $language_types[$type] = FALSE;
+      $negotiation = array();
+      foreach ($info['fixed'] as $weight => $id) {
+        if (isset($defined_providers[$id])) {
+          $negotiation[$id] = $weight;
+        }
+      }
+      language_negotiation_set($type, $negotiation);
+    }
+    else {
+      $language_types[$type] = TRUE;
+    }
+  }
+
+  // Save language types.
+  variable_set('language_types', $language_types);
+
+  // Ensure that subsequent calls of language_types_configurable() return the
+  // updated language type information.
+  drupal_static_reset('language_types_configurable');
+}
+
 /**
  * Check if a language provider is enabled.
  *
@@ -174,6 +211,28 @@ function language_negotiation_get_switch_links($type, $path) {
   return $links;
 }
 
+/**
+ * Updates language configuration to remove any language provider that is no longer defined.
+ */
+function language_negotiation_purge() {
+  // Ensure that we are getting the defined language negotiation information. An
+  // invocation of module_enable() or module_disable() could outdate the cached
+  // information.
+  drupal_static_reset('language_negotiation_info');
+  drupal_static_reset('language_types_info');
+
+  $defined_providers = language_negotiation_info();
+  foreach (language_types_info() as $type => $type_info) {
+    $weight = 0;
+    $negotiation = array();
+    foreach (variable_get("language_negotiation_$type", array()) as $id => $provider) {
+      if (isset($defined_providers[$id])) {
+        $negotiation[$id] = $weight++;
+      }
+    }
+    language_negotiation_set($type, $negotiation);
+  }
+}
 
 /**
  * Save a list of language providers.
@@ -181,7 +240,8 @@ function language_negotiation_get_switch_links($type, $path) {
  * @param $type
  *   The language negotiation type.
  * @param $language_providers
- *   An array of language provider ids.
+ *   An array of language provider weights keyed by id.
+ *   @see language_provider_weight()
  */
 function language_negotiation_set($type, $language_providers) {
   // Save only the necessary fields.
@@ -190,7 +250,7 @@ function language_negotiation_set($type, $language_providers) {
   $negotiation = array();
   $providers_weight = array();
   $defined_providers = language_negotiation_info();
-  $default_types = language_types_configurable();
+  $default_types = language_types_configurable(FALSE);
 
   // Initialize the providers weight list.
   foreach ($language_providers as $id => $provider) {
diff --git a/includes/locale.inc b/includes/locale.inc
index e59e28e2d4ee18a9eebb7431c9100f562bc88f5b..578b1b3c643e071055e91851af49663bc78d145f 100644
--- a/includes/locale.inc
+++ b/includes/locale.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: locale.inc,v 1.266 2011/01/03 18:03:54 webchick Exp $
 
 /**
  * @file
@@ -586,159 +585,250 @@ function _locale_import_po($file, $langcode, $mode, $group = NULL) {
  */
 function _locale_import_read_po($op, $file, $mode = NULL, $lang = NULL, $group = 'default') {
 
-  $fd = fopen($file->uri, "rb"); // File will get closed by PHP on return
+  // The file will get closed by PHP on returning from this function.
+  $fd = fopen($file->uri, 'rb');
   if (!$fd) {
     _locale_import_message('The translation import failed, because the file %filename could not be read.', $file);
     return FALSE;
   }
 
-  $context = "COMMENT"; // Parser context: COMMENT, MSGID, MSGID_PLURAL, MSGSTR and MSGSTR_ARR
-  $current = array();   // Current entry being read
-  $plural = 0;          // Current plural form
-  $lineno = 0;          // Current line
+  /*
+   * The parser context. Can be:
+   *  - 'COMMENT' (#)
+   *  - 'MSGID' (msgid)
+   *  - 'MSGID_PLURAL' (msgid_plural)
+   *  - 'MSGCTXT' (msgctxt)
+   *  - 'MSGSTR' (msgstr or msgstr[])
+   *  - 'MSGSTR_ARR' (msgstr_arg)
+   */
+  $context = 'COMMENT';
+
+  // Current entry being read.
+  $current = array();
+
+  // Current plurality for 'msgstr[]'.
+  $plural = 0;
+
+  // Current line.
+  $lineno = 0;
 
   while (!feof($fd)) {
-    $line = fgets($fd, 10*1024); // A line should not be this long
+    // A line should not be longer than 10 * 1024.
+    $line = fgets($fd, 10 * 1024);
+
     if ($lineno == 0) {
       // The first line might come with a UTF-8 BOM, which should be removed.
       $line = str_replace("\xEF\xBB\xBF", '', $line);
     }
+
     $lineno++;
+
+    // Trim away the linefeed.
     $line = trim(strtr($line, array("\\\n" => "")));
 
-    if (!strncmp("#", $line, 1)) { // A comment
-      if ($context == "COMMENT") { // Already in comment context: add
-        $current["#"][] = substr($line, 1);
+    if (!strncmp('#', $line, 1)) {
+      // Lines starting with '#' are comments.
+
+      if ($context == 'COMMENT') {
+        // Already in comment token, insert the comment.
+        $current['#'][] = substr($line, 1);
       }
-      elseif (($context == "MSGSTR") || ($context == "MSGSTR_ARR")) { // End current entry, start a new one
+      elseif (($context == 'MSGSTR') || ($context == 'MSGSTR_ARR')) {
+        // We are currently in string token, close it out.
         _locale_import_one_string($op, $current, $mode, $lang, $file, $group);
-        $current = array();
-        $current["#"][] = substr($line, 1);
-        $context = "COMMENT";
+
+        // Start a new entry for the comment.
+        $current         = array();
+        $current['#'][]  = substr($line, 1);
+
+        $context = 'COMMENT';
       }
-      else { // Parse error
+      else {
+        // A comment following any other token is a syntax error.
         _locale_import_message('The translation file %filename contains an error: "msgstr" was expected but not found on line %line.', $file, $lineno);
         return FALSE;
       }
     }
-    elseif (!strncmp("msgid_plural", $line, 12)) {
-      if ($context != "MSGID") { // Must be plural form for current entry
+    elseif (!strncmp('msgid_plural', $line, 12)) {
+      // A plural form for the current message.
+
+      if ($context != 'MSGID') {
+        // A plural form cannot be added to anything else but the id directly.
         _locale_import_message('The translation file %filename contains an error: "msgid_plural" was expected but not found on line %line.', $file, $lineno);
         return FALSE;
       }
+
+      // Remove 'msgid_plural' and trim away whitespace.
       $line = trim(substr($line, 12));
+      // At this point, $line should now contain only the plural form.
+
       $quoted = _locale_import_parse_quoted($line);
       if ($quoted === FALSE) {
+        // The plural form must be wrapped in quotes.
         _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno);
         return FALSE;
       }
-      $current["msgid"] = $current["msgid"] . "\0" . $quoted;
-      $context = "MSGID_PLURAL";
+
+      // Append the plural form to the current entry.
+      $current['msgid'] .= "\0" . $quoted;
+
+      $context = 'MSGID_PLURAL';
     }
-    elseif (!strncmp("msgid", $line, 5)) {
-      if (($context == "MSGSTR") || ($context == "MSGSTR_ARR")) {   // End current entry, start a new one
+    elseif (!strncmp('msgid', $line, 5)) {
+      // Starting a new message.
+
+      if (($context == 'MSGSTR') || ($context == 'MSGSTR_ARR')) {
+        // We are currently in a message string, close it out.
         _locale_import_one_string($op, $current, $mode, $lang, $file, $group);
+
+        // Start a new context for the id.
         $current = array();
       }
-      elseif ($context == "MSGID") { // Already in this context? Parse error
+      elseif ($context == 'MSGID') {
+        // We are currently already in the context, meaning we passed an id with no data.
         _locale_import_message('The translation file %filename contains an error: "msgid" is unexpected on line %line.', $file, $lineno);
         return FALSE;
       }
+
+      // Remove 'msgid' and trim away whitespace.
       $line = trim(substr($line, 5));
+      // At this point, $line should now contain only the message id.
+
       $quoted = _locale_import_parse_quoted($line);
       if ($quoted === FALSE) {
+        // The message id must be wrapped in quotes.
         _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno);
         return FALSE;
       }
-      $current["msgid"] = $quoted;
-      $context = "MSGID";
+
+      $current['msgid'] = $quoted;
+      $context = 'MSGID';
     }
-    elseif (!strncmp("msgctxt", $line, 7)) {
-      if (($context == "MSGSTR") || ($context == "MSGSTR_ARR")) {   // End current entry, start a new one
+    elseif (!strncmp('msgctxt', $line, 7)) {
+      // Starting a new context.
+
+      if (($context == 'MSGSTR') || ($context == 'MSGSTR_ARR')) {
+        // We are currently in a message, start a new one.
         _locale_import_one_string($op, $current, $mode, $lang, $file, $group);
         $current = array();
       }
-      elseif (!empty($current["msgctxt"])) { // Already in this context? Parse error
+      elseif (!empty($current['msgctxt'])) {
+        // A context cannot apply to another context.
         _locale_import_message('The translation file %filename contains an error: "msgctxt" is unexpected on line %line.', $file, $lineno);
         return FALSE;
       }
+
+      // Remove 'msgctxt' and trim away whitespaces.
       $line = trim(substr($line, 7));
+      // At this point, $line should now contain the context.
+
       $quoted = _locale_import_parse_quoted($line);
       if ($quoted === FALSE) {
+        // The context string must be quoted.
         _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno);
         return FALSE;
       }
-      $current["msgctxt"] = $quoted;
-      $context = "MSGCTXT";
+
+      $current['msgctxt'] = $quoted;
+
+      $context = 'MSGCTXT';
     }
-    elseif (!strncmp("msgstr[", $line, 7)) {
-      if (($context != "MSGID") && ($context != "MSGCTXT") && ($context != "MSGID_PLURAL") && ($context != "MSGSTR_ARR")) { // Must come after msgid, msgxtxt, msgid_plural, or msgstr[]
+    elseif (!strncmp('msgstr[', $line, 7)) {
+      // A message string for a specific plurality.
+
+      if (($context != 'MSGID') && ($context != 'MSGCTXT') && ($context != 'MSGID_PLURAL') && ($context != 'MSGSTR_ARR')) {
+        // Message strings must come after msgid, msgxtxt, msgid_plural, or other msgstr[] entries.
         _locale_import_message('The translation file %filename contains an error: "msgstr[]" is unexpected on line %line.', $file, $lineno);
         return FALSE;
       }
-      if (strpos($line, "]") === FALSE) {
+
+      // Ensure the plurality is terminated.
+      if (strpos($line, ']') === FALSE) {
         _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno);
         return FALSE;
       }
-      $frombracket = strstr($line, "[");
-      $plural = substr($frombracket, 1, strpos($frombracket, "]") - 1);
+
+      // Extract the plurality.
+      $frombracket = strstr($line, '[');
+      $plural = substr($frombracket, 1, strpos($frombracket, ']') - 1);
+
+      // Skip to the next whitespace and trim away any further whitespace, bringing $line to the message data.
       $line = trim(strstr($line, " "));
+
       $quoted = _locale_import_parse_quoted($line);
       if ($quoted === FALSE) {
+        // The string must be quoted.
         _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno);
         return FALSE;
       }
-      $current["msgstr"][$plural] = $quoted;
-      $context = "MSGSTR_ARR";
+
+      $current['msgstr'][$plural] = $quoted;
+
+      $context = 'MSGSTR_ARR';
     }
     elseif (!strncmp("msgstr", $line, 6)) {
-      if (($context != "MSGID") && ($context != "MSGCTXT")) {   // Should come just after a msgid or msgctxt block
+      // A string for the an id or context.
+
+      if (($context != 'MSGID') && ($context != 'MSGCTXT')) {
+        // Strings are only valid within an id or context scope.
         _locale_import_message('The translation file %filename contains an error: "msgstr" is unexpected on line %line.', $file, $lineno);
         return FALSE;
       }
+
+      // Remove 'msgstr' and trim away away whitespaces.
       $line = trim(substr($line, 6));
+      // At this point, $line should now contain the message.
+
       $quoted = _locale_import_parse_quoted($line);
       if ($quoted === FALSE) {
+        // The string must be quoted.
         _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno);
         return FALSE;
       }
-      $current["msgstr"] = $quoted;
-      $context = "MSGSTR";
+
+      $current['msgstr'] = $quoted;
+
+      $context = 'MSGSTR';
     }
-    elseif ($line != "") {
+    elseif ($line != '') {
+      // Anything that is not a token may be a continuation of a previous token.
+
       $quoted = _locale_import_parse_quoted($line);
       if ($quoted === FALSE) {
+        // The string must be quoted.
         _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno);
         return FALSE;
       }
-      if (($context == "MSGID") || ($context == "MSGID_PLURAL")) {
-        $current["msgid"] .= $quoted;
+
+      // Append the string to the current context.
+      if (($context == 'MSGID') || ($context == 'MSGID_PLURAL')) {
+        $current['msgid'] .= $quoted;
       }
-      elseif ($context == "MSGCTXT") {
-        $current["msgctxt"] .= $quoted;
+      elseif ($context == 'MSGCTXT') {
+        $current['msgctxt'] .= $quoted;
       }
-      elseif ($context == "MSGSTR") {
-        $current["msgstr"] .= $quoted;
+      elseif ($context == 'MSGSTR') {
+        $current['msgstr'] .= $quoted;
       }
-      elseif ($context == "MSGSTR_ARR") {
-        $current["msgstr"][$plural] .= $quoted;
+      elseif ($context == 'MSGSTR_ARR') {
+        $current['msgstr'][$plural] .= $quoted;
       }
       else {
+        // No valid context to append to.
         _locale_import_message('The translation file %filename contains an error: there is an unexpected string on line %line.', $file, $lineno);
         return FALSE;
       }
     }
   }
 
-  // End of PO file, flush last entry.
-  if (($context == "MSGSTR") || ($context == "MSGSTR_ARR")) {
+  // End of PO file, closed out the last entry.
+  if (($context == 'MSGSTR') || ($context == 'MSGSTR_ARR')) {
     _locale_import_one_string($op, $current, $mode, $lang, $file, $group);
   }
-  elseif ($context != "COMMENT") {
+  elseif ($context != 'COMMENT') {
     _locale_import_message('The translation file %filename ended unexpectedly at line %line.', $file, $lineno);
     return FALSE;
   }
-
 }
 
 /**
diff --git a/includes/lock.inc b/includes/lock.inc
index ddf4e7549e8985c9beccdd596e5dd50692071c42..42f1906f2572d4a1aa20c7029ca1588d75b978d9 100644
--- a/includes/lock.inc
+++ b/includes/lock.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: lock.inc,v 1.6 2011/01/02 17:26:39 webchick Exp $
 
 /**
  * @file
@@ -188,7 +187,7 @@ function lock_may_be_available($name) {
  * lock. This will block further execution until the lock is available or the
  * specified delay in seconds is reached. This should not be used with locks
  * that are acquired very frequently, since the lock is likely to be acquired
- * again by a different request during the sleep().
+ * again by a different request while waiting.
  *
  * @param $name
  *   The name of the lock.
@@ -199,12 +198,32 @@ function lock_may_be_available($name) {
  *   TRUE if the lock holds, FALSE if it is available.
  */
 function lock_wait($name, $delay = 30) {
-  $delay = (int) $delay;
-  while ($delay--) {
+  // Pause the process for short periods between calling
+  // lock_may_be_available(). This prevents hitting the database with constant
+  // database queries while waiting, which could lead to performance issues.
+  // However, if the wait period is too long, there is the potential for a
+  // large number of processes to be blocked waiting for a lock, especially
+  // if the item being rebuilt is commonly requested. To address both of these
+  // concerns, begin waiting for 25ms, then add 25ms to the wait period each
+  // time until it reaches 500ms. After this point polling will continue every
+  // 500ms until $delay is reached.
+
+  // $delay is passed in seconds, but we will be using usleep(), which takes
+  // microseconds as a parameter. Multiply it by 1 million so that all
+  // further numbers are equivalent.
+  $delay = (int) $delay * 1000000;
+
+  // Begin sleeping at 25ms.
+  $sleep = 25000;
+  while ($delay > 0) {
     // This function should only be called by a request that failed to get a
     // lock, so we sleep first to give the parallel request a chance to finish
     // and release the lock.
-    sleep(1);
+    usleep($sleep);
+    // After each sleep, increase the value of $sleep until it reaches
+    // 500ms, to reduce the potential for a lock stampede.
+    $delay = $delay - $sleep;
+    $sleep = min(500000, $sleep + 25000, $delay);
     if (lock_may_be_available($name)) {
       // No longer need to wait.
       return FALSE;
diff --git a/includes/mail.inc b/includes/mail.inc
index 6481bac9944de3a269358359e46d9753e41432d4..d2febed39686c9bf3f6f7a2bf99fa1377d09f4de 100644
--- a/includes/mail.inc
+++ b/includes/mail.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: mail.inc,v 1.34 2010/07/28 02:19:56 dries Exp $
 
 /**
  * @file
@@ -123,8 +122,8 @@ function drupal_mail($module, $key, $to, $language, $params = array(), $from = N
   if ($default_from) {
     // To prevent e-mail from looking like spam, the addresses in the Sender and
     // Return-Path headers should have a domain authorized to use the originating
-    // SMTP server. Errors-To is redundant, but shouldn't hurt.
-    $headers['From'] = $headers['Sender'] = $headers['Return-Path'] = $headers['Errors-To'] = $default_from;
+    // SMTP server.
+    $headers['From'] = $headers['Sender'] = $headers['Return-Path'] = $default_from;
   }
   if ($from) {
     $headers['From'] = $from;
diff --git a/includes/menu.inc b/includes/menu.inc
index fb61fd37edd192fbfb517d531bc3c1e1c7415ed3..cfd35c7944a1e03df1242396886e85fae1123db3 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: menu.inc,v 1.431 2011/01/04 06:20:30 dries Exp $
 
 /**
  * @file
@@ -14,7 +13,10 @@
  * The Drupal menu system drives both the navigation system from a user
  * perspective and the callback system that Drupal uses to respond to URLs
  * passed from the browser. For this reason, a good understanding of the
- * menu system is fundamental to the creation of complex modules.
+ * menu system is fundamental to the creation of complex modules. As a note,
+ * this is related to, but separate from menu.module, which allows menus
+ * (which in this context are hierarchical lists of links) to be customized from
+ * the Drupal administrative interface.
  *
  * Drupal's menu system follows a simple hierarchy defined by paths.
  * Implementations of hook_menu() define menu items and assign them to
@@ -125,7 +127,7 @@ define('MENU_IS_LOCAL_ACTION', 0x0100);
 /**
  * @defgroup menu_item_types Menu item types
  * @{
- * Definitions for various menu types.
+ * Definitions for various menu item types.
  *
  * Menu item definitions provide one of these constants, which are shortcuts for
  * combinations of @link menu_flags Menu flags @endlink.
@@ -1042,7 +1044,7 @@ function menu_tree_output($tree) {
     }
 
     // Allow menu-specific theme overrides.
-    $element['#theme'] = 'menu_link__' . $data['link']['menu_name'];
+    $element['#theme'] = 'menu_link__' . strtr($data['link']['menu_name'], '-', '_');
     $element['#attributes']['class'] = $class;
     $element['#title'] = $data['link']['title'];
     $element['#href'] = $data['link']['href'];
@@ -2064,7 +2066,7 @@ function menu_local_tasks($level = 0) {
  *   node or array('system', 'navigation') for a certain block.
  *
  * @return
- *   A list of menu router items that are local tasks for the passed in path.
+ *   A list of menu router items that are local tasks for the passed-in path.
  *
  * @see contextual_links_preprocess()
  */
@@ -2319,11 +2321,11 @@ function menu_set_active_trail($new_trail = NULL) {
       }
       list($key, $curr) = each($tree);
     }
-    // Make sure the current page is in the trail (needed for the page title),
-    // if the link's type allows it to be shown in the breadcrumb. Also exclude
-    // it if we are on the front page.
+    // Make sure the current page is in the trail to build the page title, by
+    // appending either the preferred link or the menu router item for the
+    // current page. Exclude it if we are on the front page.
     $last = end($trail);
-    if ($last['href'] != $preferred_link['href'] && ($preferred_link['type'] & MENU_VISIBLE_IN_BREADCRUMB) == MENU_VISIBLE_IN_BREADCRUMB && !drupal_is_front_page()) {
+    if ($last['href'] != $preferred_link['href'] && !drupal_is_front_page()) {
       $trail[] = $preferred_link;
     }
   }
@@ -2891,11 +2893,12 @@ function _menu_delete_item($item, $force = FALSE) {
         menu_link_save($child);
       }
     }
-    db_delete('menu_links')->condition('mlid', $item['mlid'])->execute();
 
-    // Notify modules we have deleted the item.
+    // Notify modules we are deleting the item.
     module_invoke_all('menu_link_delete', $item);
 
+    db_delete('menu_links')->condition('mlid', $item['mlid'])->execute();
+
     // Update the has_children status of the parent.
     _menu_update_parental_status($item);
     menu_cache_clear($item['menu_name']);
@@ -2904,18 +2907,26 @@ function _menu_delete_item($item, $force = FALSE) {
 }
 
 /**
- * Save a menu link.
+ * Saves a menu link.
+ *
+ * After calling this function, rebuild the menu cache using
+ * menu_cache_clear_all().
  *
  * @param $item
- *   An array representing a menu link item. The only mandatory keys are
- *   link_path and link_title. Possible keys are:
- *   - menu_name: Default is navigation
- *   - weight: Default is 0
- *   - expanded: Whether the item is expanded.
- *   - options: An array of options, see l() for more.
- *   - mlid: Set to an existing value, or 0 or NULL to insert a new link.
- *   - plid: The mlid of the parent.
- *   - router_path: The path of the relevant router item.
+ *   An associative array representing a menu link item, with elements:
+ *   - link_path: (required) The path of the menu item, which should be
+ *     normalized first by calling drupal_get_normal_path() on it.
+ *   - link_title: (required) Title to appear in menu for the link.
+ *   - menu_name: (optional) The machine name of the menu for the link.
+ *     Defaults to 'navigation'.
+ *   - weight: (optional) Integer to determine position in menu. Default is 0.
+ *   - expanded: (optional) Boolean that determines if the item is expanded.
+ *   - options: (optional) An array of options, see l() for more.
+ *   - mlid: (optional) Menu link identifier, the primary integer key for each
+ *     menu link. Can be set to an existing value, or to 0 or NULL
+ *     to insert a new link.
+ *   - plid: (optional) The mlid of the parent.
+ *   - router_path: (optional) The path of the relevant router item.
  *
  * @return
  *   The mlid of the saved menu link, or FALSE if the menu link could not be
diff --git a/includes/module.inc b/includes/module.inc
index 1ae5583de30001f3241ebe5d075031b7674b4f6d..779b668269eb69e7c0cd4a14915242248b67c3fe 100644
--- a/includes/module.inc
+++ b/includes/module.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: module.inc,v 1.209 2010/11/27 20:41:38 dries Exp $
 
 /**
  * @file
@@ -127,6 +126,9 @@ function system_list($type) {
   // if not fetch only the required information to fire bootstrap hooks
   // in case we are going to serve the page from cache.
   if ($type == 'bootstrap') {
+    if (isset($lists['bootstrap'])) {
+      return $lists['bootstrap'];
+    }
     if ($cached = cache_get('bootstrap_modules', 'cache_bootstrap')) {
       $bootstrap_list = $cached->data;
     }
@@ -372,7 +374,7 @@ function module_enable($module_list, $enable_dependencies = TRUE) {
 
       // Add dependencies to the list, with a placeholder weight.
       // The new modules will be processed as the while loop continues.
-      foreach ($module_data[$module]->info['dependencies'] as $dependency) {
+      foreach (array_keys($module_data[$module]->requires) as $dependency) {
         if (!isset($module_list[$dependency])) {
           $module_list[$dependency] = 0;
         }
@@ -854,7 +856,7 @@ function drupal_required_modules() {
 /**
  * Hands off alterable variables to type-specific *_alter implementations.
  *
- * This dispatch function hands off the passed in variables to type-specific
+ * This dispatch function hands off the passed-in variables to type-specific
  * hook_TYPE_alter() implementations in modules. It ensures a consistent
  * interface for all altering operations.
  *
@@ -888,14 +890,14 @@ function drupal_required_modules() {
  *   values in $type. For example, when Form API is using drupal_alter() to
  *   execute both hook_form_alter() and hook_form_FORM_ID_alter()
  *   implementations, it passes array('form', 'form_' . $form_id) for $type.
- * @param &$data
+ * @param $data
  *   The variable that will be passed to hook_TYPE_alter() implementations to be
  *   altered. The type of this variable depends on the value of the $type
  *   argument. For example, when altering a 'form', $data will be a structured
  *   array. When altering a 'profile', $data will be an object.
- * @param &$context1
+ * @param $context1
  *   (optional) An additional variable that is passed by reference.
- * @param &$context2
+ * @param $context2
  *   (optional) An additional variable that is passed by reference. If more
  *   context needs to be provided to implementations, then this should be an
  *   associative array as described above.
diff --git a/includes/pager.inc b/includes/pager.inc
index 1269298614adcc594d15cc6d9437ca991c336169..146033f1b407895d9a36d660fc2dcc19a8d91fb9 100644
--- a/includes/pager.inc
+++ b/includes/pager.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: pager.inc,v 1.87 2011/01/03 18:03:54 webchick Exp $
 
 /**
  * @file
@@ -431,7 +430,7 @@ function theme_pager($variables) {
 /**
  * @defgroup pagerpieces Pager pieces
  * @{
- * Use these pieces to construct your own custom pagers in your theme.
+ * Theme functions for customizing pager elements.
  *
  * Note that you should NOT modify this file to customize your pager.
  */
diff --git a/includes/password.inc b/includes/password.inc
index 131ca63f619e9b34a3225a0a249030fd1358bb1f..93d34f81f373a5318ccc2e08e2f66a921cf70961 100644
--- a/includes/password.inc
+++ b/includes/password.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: password.inc,v 1.9 2010/12/18 00:56:18 dries Exp $
 
 /**
  * @file
diff --git a/includes/path.inc b/includes/path.inc
index 1825c1ab565d1720ce391e65f1750a11487ca4f2..db605370cd496abf33331be2085ec72a599a63ed 100644
--- a/includes/path.inc
+++ b/includes/path.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: path.inc,v 1.72 2010/11/30 01:05:24 dries Exp $
 
 /**
  * @file
diff --git a/includes/registry.inc b/includes/registry.inc
index b0faf2590d463bf5275510d6e20228ba2bb19b4b..3fb14fb31b7f071325027f1591590bcf84971096 100644
--- a/includes/registry.inc
+++ b/includes/registry.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: registry.inc,v 1.34 2010/09/17 14:45:46 dries Exp $
 
 /**
  * @file
@@ -98,7 +97,8 @@ function _registry_update() {
     _registry_check_code(REGISTRY_RESET_LOOKUP_CACHE);
   }
   catch (Exception $e) {
-    $transaction->rollback('registry', $e->getMessage(), array(), WATCHDOG_ERROR);
+    $transaction->rollback();
+    watchdog_exception('registry', $e);
     throw $e;
   }
 
diff --git a/includes/session.inc b/includes/session.inc
index 0ff7c2105231ef9a223c9f1e97c83616d01bbdf3..9061f461ca2de6fbb4247a0cacf5dcf4099725ef 100644
--- a/includes/session.inc
+++ b/includes/session.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: session.inc,v 1.92 2010/11/13 17:40:09 webchick Exp $
 
 /**
  * @file
diff --git a/includes/stream_wrappers.inc b/includes/stream_wrappers.inc
index 081941b0b3f9efb1ede7dee5b8c9d435438e1a02..7df1f9dc6b23a8e4bc3daac7f7ddb626174be5ee 100644
--- a/includes/stream_wrappers.inc
+++ b/includes/stream_wrappers.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: stream_wrappers.inc,v 1.22 2010/12/30 22:33:03 webchick Exp $
 
 /**
  * @file
@@ -384,7 +383,7 @@ abstract class DrupalLocalStreamWrapper implements DrupalStreamWrapperInterface
    *   The file mode ("r", "wb" etc.).
    * @param $options
    *   A bit mask of STREAM_USE_PATH and STREAM_REPORT_ERRORS.
-   * @param &$opened_path
+   * @param $opened_path
    *   A string containing the path actually opened.
    *
    * @return
diff --git a/includes/tablesort.inc b/includes/tablesort.inc
index 327738b5391e04bda70d0bee71162836357be439..121a1b909346fda10c7959ea4344b267d13daa09 100644
--- a/includes/tablesort.inc
+++ b/includes/tablesort.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: tablesort.inc,v 1.61 2010/12/17 19:28:13 webchick Exp $
 
 /**
  * @file
@@ -74,18 +73,7 @@ class TableSort extends SelectQueryExtender {
    *   The current sort direction ("asc" or "desc").
    */
   protected function getSort() {
-    if (isset($_GET['sort'])) {
-      return ($_GET['sort'] == 'desc') ? 'desc' : 'asc';
-    }
-    // User has not specified a sort. Use default if specified; otherwise use "asc".
-    else {
-      foreach ($this->header as $header) {
-        if (is_array($header) && isset($header['sort'])) {
-          return $header['sort'];
-        }
-      }
-    }
-    return 'asc';
+    return tablesort_get_sort($this->header);
   }
 
   /**
@@ -112,32 +100,7 @@ class TableSort extends SelectQueryExtender {
    *   - "sql": The name of the database field to sort on.
    */
   protected function order() {
-    $order = isset($_GET['order']) ? $_GET['order'] : '';
-    foreach ($this->header as $header) {
-      if (isset($header['data']) && $order == $header['data']) {
-        return array('name' => $header['data'], 'sql' => isset($header['field']) ? $header['field'] : '');
-      }
-
-      if (isset($header['sort']) && ($header['sort'] == 'asc' || $header['sort'] == 'desc')) {
-        $default = array('name' => $header['data'], 'sql' => isset($header['field']) ? $header['field'] : '');
-      }
-    }
-
-    if (isset($default)) {
-      return $default;
-    }
-    else {
-      // The first column specified is initial 'order by' field unless otherwise specified
-      $headers = array_values($this->header);
-      $header = $headers[0];
-      if (is_array($header)) {
-        $header += array('data' => NULL, 'field' => NULL);
-        return array('name' => $header['data'], 'sql' => $header['field']);
-      }
-      else {
-        return array('name' => $header);
-      }
-    }
+    return tablesort_get_order($this->header);
   }
 }
 
@@ -239,29 +202,27 @@ function tablesort_get_query_parameters() {
 function tablesort_get_order($headers) {
   $order = isset($_GET['order']) ? $_GET['order'] : '';
   foreach ($headers as $header) {
-    if (isset($header['data']) && $order == $header['data']) {
-      return array('name' => $header['data'], 'sql' => isset($header['field']) ? $header['field'] : '');
-    }
+    if (is_array($header)) {
+      if (isset($header['data']) && $order == $header['data']) {
+        $default = $header;
+        break;
+      }
 
-    if (isset($header['sort']) && ($header['sort'] == 'asc' || $header['sort'] == 'desc')) {
-      $default = array('name' => $header['data'], 'sql' => isset($header['field']) ? $header['field'] : '');
+      if (empty($default) && isset($header['sort']) && ($header['sort'] == 'asc' || $header['sort'] == 'desc')) {
+        $default = $header;
+      }
     }
   }
 
-  if (isset($default)) {
-    return $default;
-  }
-  else {
-    // The first column specified is the initial 'order by' field unless otherwise specified.
-    $first = current($headers);
-    if (is_array($first)) {
-      $first += array('data' => NULL, 'field' => NULL);
-      return array('name' => $first['data'], 'sql' => $first['field']);
-    }
-    else {
-      return array('name' => $first, 'sql' => '');
+  if (!isset($default)) {
+    $default = reset($headers);
+    if (!is_array($default)) {
+      $default = array('data' => $default);
     }
   }
+
+  $default += array('data' => NULL, 'field' => NULL);
+  return array('name' => $default['data'], 'sql' => $default['field']);
 }
 
 /**
@@ -274,12 +235,15 @@ function tablesort_get_order($headers) {
  */
 function tablesort_get_sort($headers) {
   if (isset($_GET['sort'])) {
-    return ($_GET['sort'] == 'desc') ? 'desc' : 'asc';
+    return (strtolower($_GET['sort']) == 'desc') ? 'desc' : 'asc';
   }
-  // User has not specified a sort. Use default if specified; otherwise use "asc".
+  // The user has not specified a sort. Use the default for the currently sorted
+  // header if specified; otherwise use "asc".
   else {
+    // Find out which header is currently being sorted.
+    $ts = tablesort_get_order($headers);
     foreach ($headers as $header) {
-      if (isset($header['sort'])) {
+      if (is_array($header) && isset($header['data']) && $header['data'] == $ts['name'] && isset($header['sort'])) {
         return $header['sort'];
       }
     }
diff --git a/includes/theme.inc b/includes/theme.inc
index 0a82a8ad04c17aadb1cefcf93c16c1338b9d139a..3ae50006aa31fdb28c826e670121a665d41f5ef4 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: theme.inc,v 1.627 2011/01/03 08:02:11 webchick Exp $
 
 /**
  * @file
@@ -104,7 +103,7 @@ function drupal_theme_initialize() {
   drupal_static_reset('drupal_alter');
 
   // Provide the page with information about the theme that's used, so that a
-  // later AJAX request can be rendered using the same theme.
+  // later Ajax request can be rendered using the same theme.
   // @see ajax_base_page_theme()
   $setting['ajaxPageState'] = array(
     'theme' => $theme_key,
@@ -320,8 +319,8 @@ function drupal_theme_rebuild() {
  *   The theme registry that will eventually be cached; It is an associative
  *   array keyed by theme hooks, whose values are associative arrays describing
  *   the hook:
- *   - 'type': The passed in $type.
- *   - 'theme path': The passed in $path.
+ *   - 'type': The passed-in $type.
+ *   - 'theme path': The passed-in $path.
  *   - 'function': The name of the function generating output for this theme
  *     hook. Either defined explicitly in hook_theme() or, if neither 'function'
  *     nor 'template' is defined, then the default theme function name is used.
@@ -363,7 +362,6 @@ function drupal_theme_rebuild() {
  */
 function _theme_process_registry(&$cache, $name, $type, $theme, $path) {
   $result = array();
-  $function = $name . '_theme';
 
   // Processor functions work in two distinct phases with the process
   // functions always being executed after the preprocess functions.
@@ -372,24 +370,43 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) {
     'process functions'    => 'process',
   );
 
+  $hook_defaults = array(
+    'variables' => TRUE,
+    'render element' => TRUE,
+    'pattern' => TRUE,
+    'base hook' => TRUE,
+  );
+
+  // Invoke the hook_theme() implementation, process what is returned, and
+  // merge it into $cache.
+  $function = $name . '_theme';
   if (function_exists($function)) {
     $result = $function($cache, $type, $theme, $path);
     foreach ($result as $hook => $info) {
+      // When a theme or engine overrides a module's theme function
+      // $result[$hook] will only contain key/value pairs for information being
+      // overridden.  Pull the rest of the information from what was defined by
+      // an earlier hook.
+
+      // Fill in the type and path of the module, theme, or engine that
+      // implements this theme function.
       $result[$hook]['type'] = $type;
       $result[$hook]['theme path'] = $path;
-      // if function and file are left out, default to standard naming
+
+      // If function and file are omitted, default to standard naming
       // conventions.
       if (!isset($info['template']) && !isset($info['function'])) {
         $result[$hook]['function'] = ($type == 'module' ? 'theme_' : $name . '_') . $hook;
       }
-      // If a path is set in the info, use what was set. Otherwise use the
-      // default path. This is mostly so system.module can declare theme
-      // functions on behalf of core .include files.
-      // All files are included to be safe. Conditionally included
-      // files can prevent them from getting registered.
+
       if (isset($cache[$hook]['includes'])) {
         $result[$hook]['includes'] = $cache[$hook]['includes'];
       }
+
+      // If the theme implementation defines a file, then also use the path
+      // that it defined. Otherwise use the default path. This allows
+      // system.module to declare theme functions on behalf of core .include
+      // files.
       if (isset($info['file'])) {
         $include_file = isset($info['path']) ? $info['path'] : $path;
         $include_file .= '/' . $info['file'];
@@ -397,14 +414,10 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) {
         $result[$hook]['includes'][] = $include_file;
       }
 
-      // If these keys are left unspecified within overridden entries returned
-      // by hook_theme(), carry them forward from the prior entry. This is so
-      // that themes don't need to specify this information, since the module
-      // that registered the theme hook already has.
-      foreach (array('variables', 'render element', 'pattern', 'base hook') as $key) {
-        if (!isset($info[$key]) && isset($cache[$hook][$key])) {
-          $result[$hook][$key] = $cache[$hook][$key];
-        }
+      // If the default keys are not set, use the default values registered
+      // by the module.
+      if (isset($cache[$hook])) {
+        $result[$hook] += array_intersect_key($cache[$hook], $hook_defaults);
       }
 
       // The following apply only to theming hooks implemented as templates.
@@ -469,7 +482,7 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) {
     }
 
     // Merge the newly created theme hooks into the existing cache.
-    $cache = array_merge($cache, $result);
+    $cache = $result + $cache;
   }
 
   // Let themes have variable processors even if they didn't register a template.
@@ -972,7 +985,7 @@ function drupal_find_theme_functions($cache, $prefixes) {
       // start with. The default is the name of the hook followed by '__'. An
       // 'base hook' key is added to each entry made for a found suggestion,
       // so that common functionality can be implemented for all suggestions of
-      // the same base hook. To keep things simple, deep heirarchy of
+      // the same base hook. To keep things simple, deep hierarchy of
       // suggestions is not supported: each suggestion's 'base hook' key
       // refers to a base hook, not to another suggestion, and all suggestions
       // are found using the base hook's pattern, not a pattern from an
@@ -982,7 +995,7 @@ function drupal_find_theme_functions($cache, $prefixes) {
         $matches = preg_grep('/^' . $prefix . '_' . $pattern . '/', $functions['user']);
         if ($matches) {
           foreach ($matches as $match) {
-            $new_hook = str_replace($prefix . '_', '', $match);
+            $new_hook = substr($match, strlen($prefix) + 1);
             $arg_name = isset($info['variables']) ? 'variables' : 'render element';
             $implementations[$new_hook] = array(
               'function' => $match,
@@ -1256,15 +1269,8 @@ function theme_enable($theme_list) {
   menu_rebuild();
   drupal_theme_rebuild();
 
-  // Notify locale module about new themes being enabled, so translations can
-  // be imported. This might start a batch, and only return to the redirect
-  // path after that.
-  module_invoke('locale', 'system_update', $theme_list);
-
-  // Invoke hook_themes_enabled after the themes have been enabled.
+  // Invoke hook_themes_enabled() after the themes have been enabled.
   module_invoke_all('themes_enabled', $theme_list);
-
-  return;
 }
 
 /**
@@ -1296,10 +1302,8 @@ function theme_disable($theme_list) {
   menu_rebuild();
   drupal_theme_rebuild();
 
-  // Invoke hook_themes_enabled after the themes have been enabled.
+  // Invoke hook_themes_disabled after the themes have been disabled.
   module_invoke_all('themes_disabled', $theme_list);
-
-  return;
 }
 
 /**
@@ -1756,10 +1760,10 @@ function theme_table($variables) {
  */
 function theme_tablesort_indicator($variables) {
   if ($variables['style'] == "asc") {
-    return theme('image', array('path' => 'misc/arrow-asc.png', 'alt' => t('sort ascending'), 'title' => t('sort ascending')));
+    return theme('image', array('path' => 'misc/arrow-asc.png', 'width' => 13, 'height' => 13, 'alt' => t('sort ascending'), 'title' => t('sort ascending')));
   }
   else {
-    return theme('image', array('path' => 'misc/arrow-desc.png', 'alt' => t('sort descending'), 'title' => t('sort descending')));
+    return theme('image', array('path' => 'misc/arrow-desc.png', 'width' => 13, 'height' => 13, 'alt' => t('sort descending'), 'title' => t('sort descending')));
   }
 }
 
@@ -1872,7 +1876,7 @@ function theme_more_help_link($variables) {
  */
 function theme_feed_icon($variables) {
   $text = t('Subscribe to @feed-title', array('@feed-title' => $variables['title']));
-  if ($image = theme('image', array('path' => 'misc/feed.png', 'alt' => $text))) {
+  if ($image = theme('image', array('path' => 'misc/feed.png', 'width' => 16, 'height' => 16, 'alt' => $text))) {
     return l($image, $variables['url'], array('html' => TRUE, 'attributes' => array('class' => array('feed-icon'), 'title' => $text)));
   }
 }
@@ -2042,6 +2046,9 @@ function _theme_table_cell($cell, $header = FALSE) {
  * Adds a default set of helper variables for variable processors and templates.
  * This comes in before any other preprocess function which makes it possible to
  * be used in default theme implementations (non-overridden theme functions).
+ *
+ * For more detailed information, see theme().
+ *
  */
 function template_preprocess(&$variables, $hook) {
   global $user;
@@ -2119,6 +2126,9 @@ function _template_preprocess_default_variables() {
 
 /**
  * A default process function used to alter variables as late as possible.
+ *
+ * For more detailed information, see theme().
+ *
  */
 function template_process(&$variables, $hook) {
   // Flatten out classes.
diff --git a/includes/theme.maintenance.inc b/includes/theme.maintenance.inc
index f165f993ebd9614d3531fba98c7da50109668993..218a8adaa098eec6bb1de95039fcde9e57a6ec33 100644
--- a/includes/theme.maintenance.inc
+++ b/includes/theme.maintenance.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: theme.maintenance.inc,v 1.71 2010/11/29 04:45:10 webchick Exp $
 
 /**
  * @file
diff --git a/includes/token.inc b/includes/token.inc
index 8bd61e9afb07112ece6aa732d5da1215c3755350..edc8a962f9b0ccf91a9985a8a6b5c96c1af65984 100644
--- a/includes/token.inc
+++ b/includes/token.inc
@@ -1,24 +1,23 @@
 <?php
-// $Id: token.inc,v 1.10 2010/10/18 01:13:07 dries Exp $
 
 /**
  * @file
  * Drupal placeholder/token replacement system.
  *
- * Provides a set of extensible API functions for replacing placeholders in text
- * with meaningful values.
+ * API functions for replacing placeholders in text with meaningful values.
  *
- * For example: When configuring automated emails, an administrator enters standard
- * text for the email. Variables like the title of a node and the date the email
- * was sent can be entered as placeholders like [node:title] and [date:short].
- * When a Drupal module prepares to send the email, it can call the token_replace()
- * function, passing in the text. The token system will scan the text for placeholder
- * tokens, give other modules an opportunity to replace them with meaningful text,
- * then return the final product to the original module.
+ * For example: When configuring automated emails, an administrator enters
+ * standard text for the email. Variables like the title of a node and the date
+ * the email was sent can be entered as placeholders like [node:title] and
+ * [date:short]. When a Drupal module prepares to send the email, it can call
+ * the token_replace() function, passing in the text. The token system will
+ * scan the text for placeholder tokens, give other modules an opportunity to
+ * replace them with meaningful text, then return the final product to the
+ * original module.
  *
  * Tokens follow the form: [$type:$name], where $type is a general class of
  * tokens like 'node', 'user', or 'comment' and $name is the name of a given
- * placeholder. For example, [node:title].
+ * placeholder. For example, [node:title] or [node:created:since].
  *
  * In addition to raw text containing placeholders, modules may pass in an array
  * of objects to be used when performing the replacement. The objects should be
@@ -38,8 +37,8 @@
  * Some tokens may be chained in the form of [$type:$pointer:$name], where $type
  * is a normal token type, $pointer is a reference to another token type, and
  * $name is the name of a given placeholder. For example, [node:author:mail]. In
- * that example, 'author' is a pointer to the 'user' account that created the node,
- * and 'mail' is a placeholder available for any 'user'.
+ * that example, 'author' is a pointer to the 'user' account that created the
+ * node, and 'mail' is a placeholder available for any 'user'.
  *
  * @see token_replace()
  * @see hook_tokens()
@@ -47,7 +46,7 @@
  */
 
 /**
- * Replace all tokens in a given string with appropriate values.
+ * Replaces all tokens in a given string with appropriate values.
  *
  * @param $text
  *   A string potentially containing replaceable tokens.
@@ -55,22 +54,25 @@
  *   (optional) An array of keyed objects. For simple replacement scenarios
  *   'node', 'user', and others are common keys, with an accompanying node or
  *   user object being the value. Some token types, like 'site', do not require
- *   any explicit information from $data and can be replaced even if it is empty.
+ *   any explicit information from $data and can be replaced even if it is
+ *   empty.
  * @param $options
  *   (optional) A keyed array of settings and flags to control the token
  *   replacement process. Supported options are:
  *   - language: A language object to be used when generating locale-sensitive
  *     tokens.
  *   - callback: A callback function that will be used to post-process the array
- *     of token replacements after they are generated. For example, a module using
- *     tokens in a text-only email might provide a callback to strip HTML
+ *     of token replacements after they are generated. For example, a module
+ *     using tokens in a text-only email might provide a callback to strip HTML
  *     entities from token values before they are inserted into the final text.
  *   - clear: A boolean flag indicating that tokens should be removed from the
  *     final text if no replacement value can be generated.
  *   - sanitize: A boolean flag indicating that tokens should be sanitized for
- *     display to a web browser. Defaults to TRUE. Developers who set this option
- *     to FALSE assume responsibility for running filter_xss(), check_plain() or
- *     other appropriate scrubbing functions before displaying data to users.
+ *     display to a web browser. Defaults to TRUE. Developers who set this
+ *     option to FALSE assume responsibility for running filter_xss(),
+ *     check_plain() or other appropriate scrubbing functions before displaying
+ *     data to users.
+ *
  * @return
  *   Text with tokens replaced.
  */
@@ -96,17 +98,25 @@ function token_replace($text, array $data = array(), array $options = array()) {
 }
 
 /**
- * Build a list of all token-like patterns that appear in the text.
+ * Builds a list of all token-like patterns that appear in the text.
  *
  * @param $text
  *   The text to be scanned for possible tokens.
+ *
  * @return
  *   An associative array of discovered tokens, grouped by type.
  */
 function token_scan($text) {
-  // Matches tokens with the following pattern: [$type:$token]
-  // $type and $token may not contain white spaces.
-  preg_match_all('/\[([^\s\]:]*):([^\s\]]*)\]/', $text, $matches);
+  // Matches tokens with the following pattern: [$type:$name]
+  // $type and $name may not contain  [ ] or whitespace characters.
+  // $type may not contain : characters, but $name may.
+  preg_match_all('/
+    \[             # [ - pattern start
+    ([^\s\[\]:]*)  # match $type not containing whitespace : [ or ]
+    :              # : - separator
+    ([^\s\[\]]*)   # match $name not containing whitespace [ or ]
+    \]             # ] - pattern end
+    /x', $text, $matches);
 
   $types = $matches[1];
   $tokens = $matches[2];
@@ -123,7 +133,7 @@ function token_scan($text) {
 }
 
 /**
- * Generate replacement values for a list of tokens.
+ * Generates replacement values for a list of tokens.
  *
  * @param $type
  *   The type of token being replaced. 'node', 'user', and 'date' are common.
@@ -134,20 +144,22 @@ function token_scan($text) {
  *   (optional) An array of keyed objects. For simple replacement scenarios
  *   'node', 'user', and others are common keys, with an accompanying node or
  *   user object being the value. Some token types, like 'site', do not require
- *   any explicit information from $data and can be replaced even if it is empty.
+ *   any explicit information from $data and can be replaced even if it is
+ *   empty.
  * @param $options
  *   (optional) A keyed array of settings and flags to control the token
  *   replacement process. Supported options are:
- *   - 'language' A language object to be used when generating locale-sensitive
+ *   - language: A language object to be used when generating locale-sensitive
  *     tokens.
- *   - 'callback' A callback function that will be used to post-process the array
- *     of token replacements after they are generated. Can be used when modules
- *     require special formatting of token text, for example URL encoding or
- *     truncation to a specific length.
- *   - 'sanitize' A boolean flag indicating that tokens should be sanitized for
+ *   - callback: A callback function that will be used to post-process the
+ *     array of token replacements after they are generated. Can be used when
+ *     modules require special formatting of token text, for example URL
+ *     encoding or truncation to a specific length.
+ *   - sanitize: A boolean flag indicating that tokens should be sanitized for
  *     display to a web browser. Developers who set this option to FALSE assume
  *     responsibility for running filter_xss(), check_plain() or other
  *     appropriate scrubbing functions before displaying data to users.
+ *
  * @return
  *   An associative array of replacement values, keyed by the original 'raw'
  *   tokens that were found in the source text. For example:
@@ -173,7 +185,7 @@ function token_generate($type, array $tokens, array $data = array(), array $opti
 }
 
 /**
- * Given a list of tokens, return those that begin with a specific prefix.
+ * Given a list of tokens, returns those that begin with a specific prefix.
  *
  * Used to extract a group of 'chained' tokens (such as [node:author:name]) from
  * the full list of tokens found in text. For example:
@@ -181,7 +193,7 @@ function token_generate($type, array $tokens, array $data = array(), array $opti
  *   $data = array(
  *     'author:name' => '[node:author:name]',
  *     'title'       => '[node:title]',
- *     'created'     => '[node:author:name]',
+ *     'created'     => '[node:created]',
  *   );
  *   $results = token_find_with_prefix($data, 'author');
  *   $results == array('name' => '[node:author:name]');
@@ -194,6 +206,7 @@ function token_generate($type, array $tokens, array $data = array(), array $opti
  * @param $delimiter
  *   An optional string containing the character that separates the prefix from
  *   the rest of the token. Defaults to ':'.
+ *
  * @return
  *   An associative array of discovered tokens, with the prefix and delimiter
  *   stripped from the key.
@@ -230,6 +243,7 @@ function token_find_with_prefix(array $tokens, $prefix, $delimiter = ':') {
  *     'type' => 'user',
  *   );
  * @endcode
+ *
  * @return
  *   An associative array of token information, grouped by token type.
  */
diff --git a/includes/unicode.entities.inc b/includes/unicode.entities.inc
index 7b0a490988dacd52e339a0b6c83e537f8ae6346a..3b1fbb691d7634a295d3595dba1eea8b2a34b793 100644
--- a/includes/unicode.entities.inc
+++ b/includes/unicode.entities.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: unicode.entities.inc,v 1.2 2009/04/26 15:14:55 dries Exp $
 
 /**
  * @file
diff --git a/includes/unicode.inc b/includes/unicode.inc
index 12b801081bc3f4183da5a9bbb08d98673b6f2f0b..9dde2ca70cca8fc8f1710b9ee88cd0ca01fc2a80 100644
--- a/includes/unicode.inc
+++ b/includes/unicode.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: unicode.inc,v 1.48 2010/12/28 18:21:58 webchick Exp $
 
 /**
  * Indicates an error during check for PHP unicode support.
@@ -170,7 +169,7 @@ function unicode_requirements() {
  * This is also where unsupported encodings will be converted. Callers should
  * take this into account: $data might have been changed after the call.
  *
- * @param &$data
+ * @param $data
  *   The XML data which will be parsed later.
  *
  * @return
@@ -221,7 +220,7 @@ function drupal_xml_parser_create(&$data) {
  * @param $data
  *   The data to be converted.
  * @param $encoding
- *   The encoding that the data is in
+ *   The encoding that the data is in.
  *
  * @return
  *   Converted data or FALSE.
diff --git a/includes/update.inc b/includes/update.inc
index 3932bb88beb9e7c60f43179b0ef5e407eed0e82b..192aa1aab0c5a7948de5098d0d92c9aa616e4e2b 100644
--- a/includes/update.inc
+++ b/includes/update.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: update.inc,v 1.87 2011/01/03 18:03:54 webchick Exp $
 
 /**
  * @file
diff --git a/includes/updater.inc b/includes/updater.inc
index ebdd2bc32772dbba38134a31278fb786a7a8d6a4..363c6ebffaae7f8f249f314867b7144db51a900f 100644
--- a/includes/updater.inc
+++ b/includes/updater.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: updater.inc,v 1.8 2011/01/02 23:28:16 webchick Exp $
 
 /**
  * @file
diff --git a/includes/utility.inc b/includes/utility.inc
index 38e7e40c3f22e29b7228da98a2d6818a819f8e66..254313f7338c4a7ec9415883fd529c341291572a 100644
--- a/includes/utility.inc
+++ b/includes/utility.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: utility.inc,v 1.2 2010/07/24 17:28:25 dries Exp $
 
 /**
  * @file
diff --git a/includes/xmlrpc.inc b/includes/xmlrpc.inc
index fccc105dc70fd06dc9b6cd16d9db486f6656fed1..92e5d14f0fc544b2764191957bd069f0e57804a1 100644
--- a/includes/xmlrpc.inc
+++ b/includes/xmlrpc.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: xmlrpc.inc,v 1.69 2010/08/14 03:15:01 dries Exp $
 
 /**
  * @file
diff --git a/includes/xmlrpcs.inc b/includes/xmlrpcs.inc
index b1b2f9f26732e9de347cd43d28e56327cbf1cbf4..70c7cdac3b2e81bc95a4e357248351e78c028738 100644
--- a/includes/xmlrpcs.inc
+++ b/includes/xmlrpcs.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: xmlrpcs.inc,v 1.42 2010/10/02 01:22:41 dries Exp $
 
 /**
  * @file
@@ -337,7 +336,7 @@ function xmlrpc_server_get_capabilities() {
 }
 
 /**
- * Returns the method signature of a function.
+ * Returns one method signature for a function.
  *
  * This is the function mapped to the XML-RPC method system.methodSignature.
  *
@@ -349,8 +348,8 @@ function xmlrpc_server_get_capabilities() {
  *   Name of method to return a method signature for.
  *
  * @return array
- *   An array of types representing the method signature of the function that
- *   $methodname maps to.
+ *   An array of arrays of types, each of the arrays representing one method
+ *   signature of the function that $methodname maps to.
  */
 function xmlrpc_server_method_signature($methodname) {
   $xmlrpc_server = xmlrpc_server_get();
@@ -365,7 +364,7 @@ function xmlrpc_server_method_signature($methodname) {
   foreach ($xmlrpc_server->signatures[$methodname] as $type) {
     $return[] = $type;
   }
-  return $return;
+  return array($return);
 }
 
 /**
diff --git a/index.php b/index.php
index ea72099b49f7e8b6e23d91e10ff9cda9b98984f7..ca3373829e144744e9415a2a74ae3161d63fd937 100644
--- a/index.php
+++ b/index.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: index.php,v 1.99 2009/10/15 14:07:25 dries Exp $
 
 /**
  * @file
diff --git a/install.php b/install.php
index 4b6c677c839659884e9b387431a5fa0d5575945c..881ca5a82beab9796c96f3cc4ba9171958a761eb 100644
--- a/install.php
+++ b/install.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: install.php,v 1.238 2010/10/22 02:53:19 webchick Exp $
 
 /**
  * @file
diff --git a/misc/ajax.js b/misc/ajax.js
index f20d563a2f20ee5b5ff721d4be28839db1486800..fb03e2b30a4ea1d2013ade6fb9f42e37a666d6d1 100644
--- a/misc/ajax.js
+++ b/misc/ajax.js
@@ -1,26 +1,25 @@
-// $Id: ajax.js,v 1.35 2010/12/23 04:26:31 webchick Exp $
 (function ($) {
 
 /**
- * Provides AJAX page updating via jQuery $.ajax (Asynchronous JavaScript and XML).
+ * Provides Ajax page updating via jQuery $.ajax (Asynchronous JavaScript and XML).
  *
- * AJAX is a method of making a request via Javascript while viewing an HTML
+ * Ajax is a method of making a request via JavaScript while viewing an HTML
  * page. The request returns an array of commands encoded in JSON, which is
  * then executed to make any changes that are necessary to the page.
  *
  * Drupal uses this file to enhance form elements with #ajax['path'] and
  * #ajax['wrapper'] properties. If set, this file will automatically be included
- * to provide AJAX capabilities.
+ * to provide Ajax capabilities.
  */
 
 Drupal.ajax = Drupal.ajax || {};
 
 /**
- * Attaches the AJAX behavior to each AJAX form element.
+ * Attaches the Ajax behavior to each Ajax form element.
  */
 Drupal.behaviors.AJAX = {
   attach: function (context, settings) {
-    // Load all AJAX behaviors specified in the settings.
+    // Load all Ajax behaviors specified in the settings.
     for (var base in settings.ajax) {
       if (!$('#' + base + '.ajax-processed').length) {
         var element_settings = settings.ajax[base];
@@ -37,7 +36,7 @@ Drupal.behaviors.AJAX = {
       }
     }
 
-    // Bind AJAX behaviors to all items showing the class.
+    // Bind Ajax behaviors to all items showing the class.
     $('.use-ajax:not(.ajax-processed)').addClass('ajax-processed').each(function () {
       var element_settings = {};
       // Clicked links look better with the throbber than the progress bar.
@@ -53,11 +52,11 @@ Drupal.behaviors.AJAX = {
       Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings);
     });
 
-    // This class means to submit the form to the action using AJAX.
+    // This class means to submit the form to the action using Ajax.
     $('.use-ajax-submit:not(.ajax-processed)').addClass('ajax-processed').each(function () {
       var element_settings = {};
 
-      // AJAX submits specified in this manner automatically submit to the
+      // Ajax submits specified in this manner automatically submit to the
       // normal form action.
       element_settings.url = $(this.form).attr('action');
       // Form submit button clicks need to tell the form what was clicked so
@@ -75,13 +74,13 @@ Drupal.behaviors.AJAX = {
 };
 
 /**
- * AJAX object.
+ * Ajax object.
  *
- * All AJAX objects on a page are accessible through the global Drupal.ajax
+ * All Ajax objects on a page are accessible through the global Drupal.ajax
  * object and are keyed by the submit button's ID. You can access them from
  * your module's JavaScript file to override properties or functions.
  *
- * For example, if your AJAX enabled button has the ID 'edit-submit', you can
+ * For example, if your Ajax enabled button has the ID 'edit-submit', you can
  * redefine the function that is called to insert the new content like this
  * (inside a Drupal.behaviors attach block):
  * @code
@@ -134,7 +133,7 @@ Drupal.ajax = function (base, element, element_settings) {
   this.wrapper = '#' + element_settings.wrapper;
 
   // If there isn't a form, jQuery.ajax() will be used instead, allowing us to
-  // bind AJAX to links as well.
+  // bind Ajax to links as well.
   if (this.element.form) {
     this.form = $(this.element.form);
   }
@@ -179,7 +178,7 @@ Drupal.ajax = function (base, element, element_settings) {
     return ajax.eventResponse(this, event);
   });
 
-  // If necessary, enable keyboard submission so that AJAX behaviors
+  // If necessary, enable keyboard submission so that Ajax behaviors
   // can be triggered through keyboard input as well as e.g. a mousedown
   // action.
   if (element_settings.keypress) {
@@ -192,7 +191,7 @@ Drupal.ajax = function (base, element, element_settings) {
 /**
  * Handle a key press.
  *
- * The AJAX object will, if instructed, bind to a key press response. This
+ * The Ajax object will, if instructed, bind to a key press response. This
  * will test to see if the key press is valid to trigger this event and
  * if it is, trigger it for us and prevent other keypresses from triggering.
  * In this case we're handling RETURN and SPACEBAR keypresses (event codes 13
@@ -214,10 +213,10 @@ Drupal.ajax.prototype.keypressResponse = function (element, event) {
 };
 
 /**
- * Handle an event that triggers an AJAX response.
+ * Handle an event that triggers an Ajax response.
  *
- * When an event that triggers an AJAX response happens, this method will
- * perform the actual AJAX call. It is bound to the event using
+ * When an event that triggers an Ajax response happens, this method will
+ * perform the actual Ajax call. It is bound to the event using
  * bind() in the constructor, and it uses the options specified on the
  * ajax object.
  */
@@ -315,23 +314,41 @@ Drupal.ajax.prototype.beforeSubmit = function (form_values, element, options) {
 }
 
 /**
- * Prepare the AJAX request before it is sent.
+ * Prepare the Ajax request before it is sent.
  */
 Drupal.ajax.prototype.beforeSend = function (xmlhttprequest, options) {
+  // For forms without file inputs, the jQuery Form plugin serializes the form
+  // values, and then calls jQuery's $.ajax() function, which invokes this
+  // handler. In this circumstance, options.extraData is never used. For forms
+  // with file inputs, the jQuery Form plugin uses the browser's normal form
+  // submission mechanism, but captures the response in a hidden IFRAME. In this
+  // circumstance, it calls this handler first, and then appends hidden fields
+  // to the form to submit the values in options.extraData. There is no simple
+  // way to know which submission mechanism will be used, so we add to extraData
+  // regardless, and allow it to be ignored in the former case.
+  if (this.form) {
+    options.extraData = options.extraData || {};
+
+    // Let the server know when the IFRAME submission mechanism is used. The
+    // server can use this information to wrap the JSON response in a TEXTAREA,
+    // as per http://jquery.malsup.com/form/#file-upload.
+    options.extraData.ajax_iframe_upload = '1';
+
+    // The triggering element is about to be disabled (see below), but if it
+    // contains a value (e.g., a checkbox, textfield, select, etc.), ensure that
+    // value is included in the submission. As per above, submissions that use
+    // $.ajax() are already serialized prior to the element being disabled, so
+    // this is only needed for IFRAME submissions.
+    var v = $.fieldValue(this.element);
+    if (v !== null) {
+      options.extraData[this.element.name] = v;
+    }
+  }
+
   // Disable the element that received the change to prevent user interface
-  // interaction while the AJAX request is in progress. ajax.ajaxing prevents
+  // interaction while the Ajax request is in progress. ajax.ajaxing prevents
   // the element from triggering a new request, but does not prevent the user
   // from changing its value.
-  // Forms without file inputs are already serialized before this function is
-  // called. Forms with file inputs use an IFRAME to perform a POST request
-  // similar to a browser, so disabled elements are not contained in the
-  // submitted values. Therefore, we manually add the element's value to
-  // options.extraData.
-  var v = $.fieldValue(this.element);
-  if (v !== null) {
-    options.extraData = options.extraData || {};
-    options.extraData[this.element.name] = v;
-  }
   $(this.element).addClass('progress-disabled').attr('disabled', true);
 
   // Insert progressbar or throbber.
@@ -470,7 +487,7 @@ Drupal.ajax.prototype.commands = {
     // sufficiently tested whether attachBehaviors() can be successfully called
     // with a context object that includes top-level text nodes. However, to
     // give developers full control of the HTML appearing in the page, and to
-    // enable AJAX content to be inserted in places where DIV elements are not
+    // enable Ajax content to be inserted in places where DIV elements are not
     // allowed (e.g., within TABLE, TR, and SPAN parents), we check if the new
     // content satisfies the requirement of a single top-level element, and
     // only use the container DIV created above when it doesn't. For more
diff --git a/misc/authorize.js b/misc/authorize.js
index 904a6e19507547063c015b4f4d9786f387d3d668..66b789791c801c291c3eed8db01b7283b17852b2 100644
--- a/misc/authorize.js
+++ b/misc/authorize.js
@@ -1,4 +1,3 @@
-// $Id: authorize.js,v 1.3 2010/01/04 16:08:52 webchick Exp $
 
 /**
  * @file
diff --git a/misc/autocomplete.js b/misc/autocomplete.js
index 57f3be67fb8449ceb9c49e12253b8492e0cca0b3..5e85be44fc5f372e1d4a6ccc4cef2454e3be7376 100644
--- a/misc/autocomplete.js
+++ b/misc/autocomplete.js
@@ -1,4 +1,3 @@
-// $Id: autocomplete.js,v 1.39 2010/11/20 07:49:56 webchick Exp $
 (function ($) {
 
 /**
diff --git a/misc/batch.js b/misc/batch.js
index 2a4507d4c71dca8430795467c776dbc0f9b21856..fee71a52fd13e1a1320c4fbaa2dd8507ad209472 100644
--- a/misc/batch.js
+++ b/misc/batch.js
@@ -1,4 +1,3 @@
-// $Id: batch.js,v 1.10 2009/08/31 05:51:07 dries Exp $
 (function ($) {
 
 /**
diff --git a/misc/collapse.js b/misc/collapse.js
index c9cde7fd5203524e27ada72eb67d17b3acc324c1..1a98dc0e04cd291d73a4b18ec4f227e9958c01b1 100644
--- a/misc/collapse.js
+++ b/misc/collapse.js
@@ -1,4 +1,3 @@
-// $Id: collapse.js,v 1.32 2010/05/14 16:45:56 dries Exp $
 (function ($) {
 
 /**
diff --git a/misc/drupal.js b/misc/drupal.js
index 9695f5dad8ce0379309271c3fc10fcfed5aa6029..3cebbd28458dedcc7c9c37f39aa72b23ef1bb661 100644
--- a/misc/drupal.js
+++ b/misc/drupal.js
@@ -1,4 +1,3 @@
-// $Id: drupal.js,v 1.72 2011/01/01 04:11:39 webchick Exp $
 
 var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'locale': {} };
 
@@ -11,7 +10,7 @@ jQuery.noConflict();
  * Attach all registered behaviors to a page element.
  *
  * Behaviors are event-triggered actions that attach to page elements, enhancing
- * default non-Javascript UIs. Behaviors are registered in the Drupal.behaviors
+ * default non-JavaScript UIs. Behaviors are registered in the Drupal.behaviors
  * object using the method 'attach' and optionally also 'detach' as follows:
  * @code
  *    Drupal.behaviors.behaviorName = {
@@ -25,7 +24,7 @@ jQuery.noConflict();
  * @endcode
  *
  * Drupal.attachBehaviors is added below to the jQuery ready event and so
- * runs on initial page load. Developers implementing AHAH/AJAX in their
+ * runs on initial page load. Developers implementing AHAH/Ajax in their
  * solutions should also call this function after new page content has been
  * loaded, feeding in an element to be processed, in order to attach all
  * behaviors to the new content.
@@ -61,7 +60,7 @@ Drupal.attachBehaviors = function (context, settings) {
 /**
  * Detach registered behaviors from a page element.
  *
- * Developers implementing AHAH/AJAX in their solutions should call this
+ * Developers implementing AHAH/Ajax in their solutions should call this
  * function before page content is about to be removed, feeding in an element
  * to be processed, in order to allow special behaviors to detach from the
  * content.
@@ -89,7 +88,7 @@ Drupal.attachBehaviors = function (context, settings) {
  *     IFRAME elements reload their "src" when being moved within the DOM,
  *     behaviors bound to IFRAME elements (like WYSIWYG editors) may need to
  *     take some action.
- *   - serialize: When an AJAX form is submitted, this is called with the
+ *   - serialize: When an Ajax form is submitted, this is called with the
  *     form as the context. This provides every behavior within the form an
  *     opportunity to ensure that the field elements have correct content
  *     in them before the form is serialized. The canonical use-case is so
@@ -302,7 +301,7 @@ Drupal.getSelection = function (element) {
 };
 
 /**
- * Build an error message from an AJAX response.
+ * Build an error message from an Ajax response.
  */
 Drupal.ajaxError = function (xmlhttp, uri) {
   var statusCode, statusText, pathText, responseText, readyStateText, message;
diff --git a/misc/farbtastic/farbtastic.css b/misc/farbtastic/farbtastic.css
index 675a5c072115111cae6fe6fb70987b7e3a1975f3..25a68ebf79596f7a28857d38a02385b0b0bc9950 100644
--- a/misc/farbtastic/farbtastic.css
+++ b/misc/farbtastic/farbtastic.css
@@ -1,4 +1,3 @@
-/* $Id: farbtastic.css,v 1.4 2010/04/28 20:08:38 dries Exp $ */
 
 .farbtastic {
   position: relative;
diff --git a/misc/farbtastic/farbtastic.js b/misc/farbtastic/farbtastic.js
index 520f77fb07863feaeaa9fa5abbe6576c95179503..10c9e7635d1459238a7924202fad28a2851dbabb 100644
--- a/misc/farbtastic/farbtastic.js
+++ b/misc/farbtastic/farbtastic.js
@@ -1,4 +1,3 @@
-// $Id: farbtastic.js,v 1.8 2010/01/25 17:02:47 dries Exp $
 (function(e){e.fn.farbtastic=function(f){e.farbtastic(this,f);return this};e.farbtastic=function(f,l){f=e(f).get(0);return f.farbtastic||(f.farbtastic=new e._farbtastic(f,l))};e._farbtastic=function(f,l){var a=this;e(f).html('<div class="farbtastic"><div class="color"></div><div class="wheel"></div><div class="overlay"></div><div class="h-marker marker"></div><div class="sl-marker marker"></div></div>');var k=e(".farbtastic",f);a.wheel=e(".wheel",f).get(0);a.radius=84;a.square=100;a.width=194;navigator.appVersion.match(/MSIE [0-6]\./)&&
 e("*",k).each(function(){if(this.currentStyle.backgroundImage!="none"){var b=this.currentStyle.backgroundImage;b=this.currentStyle.backgroundImage.substring(5,b.length-2);e(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+b+"')"})}});a.linkTo=function(b){typeof a.callback=="object"&&e(a.callback).unbind("keyup",a.updateValue);a.color=null;if(typeof b=="function")a.callback=b;else if(typeof b=="object"||typeof b=="string"){a.callback=
 e(b);a.callback.bind("keyup",a.updateValue);a.callback.get(0).value&&a.setColor(a.callback.get(0).value)}return this};a.updateValue=function(){this.value&&this.value!=a.color&&a.setColor(this.value)};a.setColor=function(b){var c=a.unpack(b);if(a.color!=b&&c){a.color=b;a.rgb=c;a.hsl=a.RGBToHSL(a.rgb);a.updateDisplay()}return this};a.setHSL=function(b){a.hsl=b;a.rgb=a.HSLToRGB(b);a.color=a.pack(a.rgb);a.updateDisplay();return this};a.widgetCoords=function(b){var c=e(a.wheel).offset();return{x:b.pageX-
diff --git a/misc/form.js b/misc/form.js
index e5961f2e0cf1d43201676b2309b36bab41eea631..259b84eb3f86e6ddb5990df291e01b1f5d2c898f 100644
--- a/misc/form.js
+++ b/misc/form.js
@@ -1,4 +1,3 @@
-// $Id: form.js,v 1.15 2010/04/09 12:24:53 dries Exp $
 (function ($) {
 
 /**
diff --git a/misc/jquery.ba-bbq.js b/misc/jquery.ba-bbq.js
index 10b0b0293946c33a7539f09180a86cf9e0f220db..deb9a2fa4bc3a4c99a1195034a0da1feafc9af31 100644
--- a/misc/jquery.ba-bbq.js
+++ b/misc/jquery.ba-bbq.js
@@ -1,4 +1,3 @@
-// $Id: jquery.ba-bbq.js,v 1.3 2010/05/26 11:55:15 dries Exp $
 
 /*
  * jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010
diff --git a/misc/jquery.cookie.js b/misc/jquery.cookie.js
index 9072d9f46304c7a22e1dd17847ba23072b01dc82..79f514c2059e96d6bedf8be9b70aa222d739f709 100644
--- a/misc/jquery.cookie.js
+++ b/misc/jquery.cookie.js
@@ -1,4 +1,3 @@
-// $Id: jquery.cookie.js,v 1.1 2009/07/01 12:16:48 dries Exp $
 
 /**
  * Cookie plugin 1.0
diff --git a/misc/jquery.form.js b/misc/jquery.form.js
index 8457185ff937948bdb44688679b270feed01150b..7a6f1b29fe383de5de0a3e62449fc698b8c8ac0b 100644
--- a/misc/jquery.form.js
+++ b/misc/jquery.form.js
@@ -1,4 +1,3 @@
-// $Id: jquery.form.js,v 1.7 2011/01/03 02:11:27 webchick Exp $
 
 /*!
  * jQuery Form Plugin
diff --git a/misc/jquery.js b/misc/jquery.js
index 94031629329af4ecfe55b94eebe2c84d3edfcaae..e900c19a38f88d662d0dd6fa28a92d0435510524 100644
--- a/misc/jquery.js
+++ b/misc/jquery.js
@@ -1,4 +1,3 @@
-// $Id: jquery.js,v 1.20 2010/11/12 01:36:08 webchick Exp $
 
 /*!
  * jQuery JavaScript Library v1.4.4
diff --git a/misc/jquery.once.js b/misc/jquery.once.js
index fe2bca7a024171788131e99d45f5208546b0fbfd..506fb4867f7c440b491d0787c37bc56028650d2a 100644
--- a/misc/jquery.once.js
+++ b/misc/jquery.once.js
@@ -1,4 +1,3 @@
-// $Id: jquery.once.js,v 1.1 2009/08/31 15:52:26 webchick Exp $
 
 /**
  * jQuery Once Plugin v1.2
diff --git a/misc/machine-name.js b/misc/machine-name.js
index 7d0c0bc5ebe5ff4b88a37f4f549b3aac110debf2..00a648a1b54f2edd22abc1d0d65c681732fc1108 100644
--- a/misc/machine-name.js
+++ b/misc/machine-name.js
@@ -1,4 +1,3 @@
-// $Id: machine-name.js,v 1.2 2010/11/22 00:05:58 dries Exp $
 (function ($) {
 
 /**
diff --git a/misc/print-rtl.css b/misc/print-rtl.css
index ceae5961b88ccd2e8cb5869f35161999228878b3..f99287a572cbceec6325f5a2b8c4701bb5c4a5d3 100644
--- a/misc/print-rtl.css
+++ b/misc/print-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: print-rtl.css,v 1.1 2007/06/10 08:55:55 goba Exp $ */
 
 body {
   direction: rtl;
diff --git a/misc/print.css b/misc/print.css
index c2c22cdc8d57d226c74c593ab378aa1d571c6386..0a56ef13b45e310b4b593e737834314cf3fe7c1f 100644
--- a/misc/print.css
+++ b/misc/print.css
@@ -1,4 +1,3 @@
-/* $Id: print.css,v 1.6 2007/06/10 08:55:55 goba Exp $ */
 
 body {
   margin: 1em;
diff --git a/misc/progress.js b/misc/progress.js
index adaa2ff6959a9c111a113b7f415855858735943e..822666af4b7fb548e40348ca9e1fc08795202af6 100644
--- a/misc/progress.js
+++ b/misc/progress.js
@@ -1,4 +1,3 @@
-// $Id: progress.js,v 1.27 2010/09/09 21:05:11 dries Exp $
 (function ($) {
 
 /**
diff --git a/misc/states.js b/misc/states.js
index 1f99a8c6d6e21e7d5853ce906d2198206e214c01..ec070c9a676a79f26a17833e74dae7501e1c031d 100644
--- a/misc/states.js
+++ b/misc/states.js
@@ -1,4 +1,3 @@
-// $Id: states.js,v 1.5 2010/12/06 16:10:29 webchick Exp $
 (function ($) {
 
 /**
@@ -363,7 +362,12 @@ states.State.prototype = {
 
   $(document).bind('state:required', function(e) {
     if (e.trigger) {
-      $(e.target).closest('.form-item, .form-submit, .form-wrapper')[e.value ? 'addClass' : 'removeClass']('form-required');
+      if (e.value) {
+        $(e.target).closest('.form-item, .form-wrapper').find('label').append('<span class="form-required">*</span>');
+      }
+      else {
+        $(e.target).closest('.form-item, .form-wrapper').find('label .form-required').remove();
+      }
     }
   });
 
diff --git a/misc/tabledrag.js b/misc/tabledrag.js
index ccb9f349fb54b242967125ff6fe11af175d2aec7..b566168c354d786b96135d0c20e95b0b0d27dbec 100644
--- a/misc/tabledrag.js
+++ b/misc/tabledrag.js
@@ -1,4 +1,3 @@
-// $Id: tabledrag.js,v 1.42 2010/09/11 00:03:41 webchick Exp $
 (function ($) {
 
 /**
@@ -1080,7 +1079,7 @@ Drupal.tableDrag.prototype.row.prototype.indent = function (indentDiff) {
 
 /**
  * Find all siblings for a row, either according to its subgroup or indentation.
- * Note that the passed in row is included in the list of siblings.
+ * Note that the passed-in row is included in the list of siblings.
  *
  * @param settings
  *   The field settings we're using to identify what constitutes a sibling.
diff --git a/misc/tableheader.js b/misc/tableheader.js
index a377bd9ce407c7e853a103e58eaabfa12d58cb4f..949ef5212fc8384743de651834a7bdf6fe0bb7e5 100644
--- a/misc/tableheader.js
+++ b/misc/tableheader.js
@@ -1,4 +1,3 @@
-// $Id: tableheader.js,v 1.32 2010/07/28 01:38:28 dries Exp $
 (function ($) {
 
 /**
diff --git a/misc/tableselect.js b/misc/tableselect.js
index 472e1f858648ede5fa9a4d2d8229b6ddc1f5fa36..a50110e94ecb1c47ab52f70254cecf43d052bf83 100644
--- a/misc/tableselect.js
+++ b/misc/tableselect.js
@@ -1,9 +1,8 @@
-// $Id: tableselect.js,v 1.13 2009/08/31 05:51:08 dries Exp $
 (function ($) {
 
 Drupal.behaviors.tableSelect = {
   attach: function (context, settings) {
-    $('form table:has(th.select-all)', context).once('table-select', Drupal.tableSelect);
+    $('table:has(th.select-all)', context).once('table-select', Drupal.tableSelect);
   }
 };
 
diff --git a/misc/textarea.js b/misc/textarea.js
index 3582f4e72d4e86d80d716d919b9040d1245e5c16..0ab5e71201f6f5fcd3904c4d7b1ae84f87af17bb 100644
--- a/misc/textarea.js
+++ b/misc/textarea.js
@@ -1,4 +1,3 @@
-// $Id: textarea.js,v 1.31 2010/03/09 11:45:37 dries Exp $
 (function ($) {
 
 Drupal.behaviors.textarea = {
diff --git a/misc/timezone.js b/misc/timezone.js
index 7c2db90624b854a06467f426c98b7f7362400b47..54497304036047c685eeaef34f808d56093e1bd6 100644
--- a/misc/timezone.js
+++ b/misc/timezone.js
@@ -1,4 +1,3 @@
-// $Id: timezone.js,v 1.7 2009/08/31 05:51:08 dries Exp $
 (function ($) {
 
 /**
diff --git a/misc/ui/jquery.effects.blind.min.js b/misc/ui/jquery.effects.blind.min.js
index f76085c16bfd599de210502c8c6533b6a6fe8c86..ed7c74f100b5ec99a4fb64360ba8149cd9d1d7fa 100644
--- a/misc/ui/jquery.effects.blind.min.js
+++ b/misc/ui/jquery.effects.blind.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.effects.blind.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $
 
 /*
  * jQuery UI Effects Blind 1.8.7
diff --git a/misc/ui/jquery.effects.bounce.min.js b/misc/ui/jquery.effects.bounce.min.js
index a90de0d37276a95bc5161e946d800455b8170f4f..ca63813f7beb64bb39500444d8aa072d03ee65da 100644
--- a/misc/ui/jquery.effects.bounce.min.js
+++ b/misc/ui/jquery.effects.bounce.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.effects.bounce.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $
 
 /*
  * jQuery UI Effects Bounce 1.8.7
diff --git a/misc/ui/jquery.effects.clip.min.js b/misc/ui/jquery.effects.clip.min.js
index 4824d1b3522246693d763774581c1e19ce63cbf8..75966ec4d1f69f6c8d92f3fa77a829cda3efb314 100644
--- a/misc/ui/jquery.effects.clip.min.js
+++ b/misc/ui/jquery.effects.clip.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.effects.clip.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $
 
 /*
  * jQuery UI Effects Clip 1.8.7
diff --git a/misc/ui/jquery.effects.core.min.js b/misc/ui/jquery.effects.core.min.js
index bd57120228b441f9d7b685e55da9c1496b0c6fd0..40c15504ad9986f40f20d59d047447f3c634971b 100644
--- a/misc/ui/jquery.effects.core.min.js
+++ b/misc/ui/jquery.effects.core.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.effects.core.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $
 
 /*
  * jQuery UI Effects 1.8.7
diff --git a/misc/ui/jquery.effects.drop.min.js b/misc/ui/jquery.effects.drop.min.js
index 2b258de72e8b3a7288116c554cfef6021e4952c4..37a034d35906c5d5cc1c98a6f14e6ec1e0fe65ef 100644
--- a/misc/ui/jquery.effects.drop.min.js
+++ b/misc/ui/jquery.effects.drop.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.effects.drop.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $
 
 /*
  * jQuery UI Effects Drop 1.8.7
diff --git a/misc/ui/jquery.effects.explode.min.js b/misc/ui/jquery.effects.explode.min.js
index cb55bc52e0373965441876d3903531000fe2667b..726f3d5b824467c886bc75f1120fe1092744b867 100644
--- a/misc/ui/jquery.effects.explode.min.js
+++ b/misc/ui/jquery.effects.explode.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.effects.explode.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $
 
 /*
  * jQuery UI Effects Explode 1.8.7
diff --git a/misc/ui/jquery.effects.fade.min.js b/misc/ui/jquery.effects.fade.min.js
index 1fde384a6d13e71f653d1c9cd65d4ed0e39061e7..71127f9ad4bf7abe1cac75cb7e644e4444ec800b 100644
--- a/misc/ui/jquery.effects.fade.min.js
+++ b/misc/ui/jquery.effects.fade.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.effects.fade.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $
 
 /*
  * jQuery UI Effects Fade 1.8.7
diff --git a/misc/ui/jquery.effects.fold.min.js b/misc/ui/jquery.effects.fold.min.js
index e3b95d09cbbb059a447e9c529a20d07566e75ac7..ccc6b2949141a0c588fe1883fcb2b8064be06c8c 100644
--- a/misc/ui/jquery.effects.fold.min.js
+++ b/misc/ui/jquery.effects.fold.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.effects.fold.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $
 
 /*
  * jQuery UI Effects Fold 1.8.7
diff --git a/misc/ui/jquery.effects.highlight.min.js b/misc/ui/jquery.effects.highlight.min.js
index 780d15a390c1f783ba6c6d043c8d9046ac9d5600..0ed3d89855a3a4d82525410ffc55d60d8a99a95d 100644
--- a/misc/ui/jquery.effects.highlight.min.js
+++ b/misc/ui/jquery.effects.highlight.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.effects.highlight.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $
 
 /*
  * jQuery UI Effects Highlight 1.8.7
diff --git a/misc/ui/jquery.effects.pulsate.min.js b/misc/ui/jquery.effects.pulsate.min.js
index 1757640f8a92fc0c546e9c610389c6cbf4c26425..658d8d03f77ba948fd71a3ac7554925992e8714b 100644
--- a/misc/ui/jquery.effects.pulsate.min.js
+++ b/misc/ui/jquery.effects.pulsate.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.effects.pulsate.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $
 
 /*
  * jQuery UI Effects Pulsate 1.8.7
diff --git a/misc/ui/jquery.effects.scale.min.js b/misc/ui/jquery.effects.scale.min.js
index 16acd62807f35358faa1e2e29ef8efc0ba6db5a8..206ef12f45b110c542becca9812ce73a0fe5d956 100644
--- a/misc/ui/jquery.effects.scale.min.js
+++ b/misc/ui/jquery.effects.scale.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.effects.scale.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $
 
 /*
  * jQuery UI Effects Scale 1.8.7
diff --git a/misc/ui/jquery.effects.shake.min.js b/misc/ui/jquery.effects.shake.min.js
index 50d62b3c255bf438673db6103a992d2dd2df08e3..44542f32616fa951693750903d32b13b0838ab24 100644
--- a/misc/ui/jquery.effects.shake.min.js
+++ b/misc/ui/jquery.effects.shake.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.effects.shake.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $
 
 /*
  * jQuery UI Effects Shake 1.8.7
diff --git a/misc/ui/jquery.effects.slide.min.js b/misc/ui/jquery.effects.slide.min.js
index 9949129e0e55f7206a15cedaf946f413ae5d7421..94f5906f3ad04931f0a8da6662d4688e0610ed1d 100644
--- a/misc/ui/jquery.effects.slide.min.js
+++ b/misc/ui/jquery.effects.slide.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.effects.slide.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $
 
 /*
  * jQuery UI Effects Slide 1.8.7
diff --git a/misc/ui/jquery.effects.transfer.min.js b/misc/ui/jquery.effects.transfer.min.js
index 94bc8dca3ae696abf9373444113a9deb1acb5945..0addaa8bb210606405ebe2b794a55f66048a9863 100644
--- a/misc/ui/jquery.effects.transfer.min.js
+++ b/misc/ui/jquery.effects.transfer.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.effects.transfer.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $
 
 /*
  * jQuery UI Effects Transfer 1.8.7
diff --git a/misc/ui/jquery.ui.accordion.css b/misc/ui/jquery.ui.accordion.css
index 3d470e0971a6b0f7acc639f626773563bf9b4762..fcd7c55dabda992fa5bc907091380d936df95770 100644
--- a/misc/ui/jquery.ui.accordion.css
+++ b/misc/ui/jquery.ui.accordion.css
@@ -1,4 +1,3 @@
-/* $Id: jquery.ui.accordion.css,v 1.3 2011/01/03 00:03:34 webchick Exp $ */
 
 /*
  * jQuery UI Accordion 1.8.7
diff --git a/misc/ui/jquery.ui.accordion.min.js b/misc/ui/jquery.ui.accordion.min.js
index 402f6a28f28d3fe72caa374d00db12d1d66bbbf1..0e0ee39afc3b64513e45d6ff77a90305e0864b50 100644
--- a/misc/ui/jquery.ui.accordion.min.js
+++ b/misc/ui/jquery.ui.accordion.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.ui.accordion.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $
 
 /*
  * jQuery UI Accordion 1.8.7
diff --git a/misc/ui/jquery.ui.autocomplete.css b/misc/ui/jquery.ui.autocomplete.css
index b0c8b96b88b0ff43ad758b1281f64054847797fb..80a5789eb465789b7ea34864510093e2c3451bbd 100644
--- a/misc/ui/jquery.ui.autocomplete.css
+++ b/misc/ui/jquery.ui.autocomplete.css
@@ -1,4 +1,3 @@
-/* $Id: jquery.ui.autocomplete.css,v 1.3 2011/01/03 00:03:34 webchick Exp $ */
 
 /*
  * jQuery UI Autocomplete 1.8.7
diff --git a/misc/ui/jquery.ui.autocomplete.min.js b/misc/ui/jquery.ui.autocomplete.min.js
index f243dada9be51b4f79fc9115623ee655be46cb70..9983ec770e10eade8aaa8fe4222783cb33fed8aa 100644
--- a/misc/ui/jquery.ui.autocomplete.min.js
+++ b/misc/ui/jquery.ui.autocomplete.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.ui.autocomplete.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $
 
 /*
  * jQuery UI Autocomplete 1.8.7
diff --git a/misc/ui/jquery.ui.button.css b/misc/ui/jquery.ui.button.css
index ca82478964884521d0bf0670aac87b3ef02769d3..973c314532ffa14cbbf5af56342630471261c8fd 100644
--- a/misc/ui/jquery.ui.button.css
+++ b/misc/ui/jquery.ui.button.css
@@ -1,4 +1,3 @@
-/* $Id: jquery.ui.button.css,v 1.3 2011/01/03 00:03:34 webchick Exp $ */
 
 /*
  * jQuery UI Button 1.8.7
diff --git a/misc/ui/jquery.ui.button.min.js b/misc/ui/jquery.ui.button.min.js
index ee04bcb4bf4fe8265d574f764b5444b1d44df5e8..26366aa4b4c1e101ab430301f7a0dd6abc3525bf 100644
--- a/misc/ui/jquery.ui.button.min.js
+++ b/misc/ui/jquery.ui.button.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.ui.button.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $
 
 /*
  * jQuery UI Button 1.8.7
diff --git a/misc/ui/jquery.ui.core.css b/misc/ui/jquery.ui.core.css
index f5acbf0ca6751391025807e968266a92e9226126..d436225e4143c05e8745ff0ad7134d70ee6bc741 100644
--- a/misc/ui/jquery.ui.core.css
+++ b/misc/ui/jquery.ui.core.css
@@ -1,4 +1,3 @@
-/* $Id: jquery.ui.core.css,v 1.3 2011/01/03 00:03:34 webchick Exp $ */
 
 /*
  * jQuery UI CSS Framework 1.8.7
diff --git a/misc/ui/jquery.ui.core.min.js b/misc/ui/jquery.ui.core.min.js
index 87769b48a7a0a8882e3cb35c810ee3ee0692b19c..976e056ff97e0fabea930fd4a09cad91deebcc2f 100644
--- a/misc/ui/jquery.ui.core.min.js
+++ b/misc/ui/jquery.ui.core.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.ui.core.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $
 
 /*!
  * jQuery UI 1.8.7
diff --git a/misc/ui/jquery.ui.datepicker.css b/misc/ui/jquery.ui.datepicker.css
index b7fbb52202153ed288f8360ce3dd95c2808001dc..a90488405f92465f8ea38e3080069ce8a2c9ebe6 100644
--- a/misc/ui/jquery.ui.datepicker.css
+++ b/misc/ui/jquery.ui.datepicker.css
@@ -1,4 +1,3 @@
-/* $Id: jquery.ui.datepicker.css,v 1.3 2011/01/03 00:03:35 webchick Exp $ */
 
 /*
  * jQuery UI Datepicker 1.8.7
diff --git a/misc/ui/jquery.ui.datepicker.min.js b/misc/ui/jquery.ui.datepicker.min.js
index 03de55eef969f6650db24468c6b838e0be3fe1aa..11af4811541a3d4edaaafe202b585502d97b64bf 100644
--- a/misc/ui/jquery.ui.datepicker.min.js
+++ b/misc/ui/jquery.ui.datepicker.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.ui.datepicker.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $
 
 /*
  * jQuery UI Datepicker 1.8.7
diff --git a/misc/ui/jquery.ui.dialog.css b/misc/ui/jquery.ui.dialog.css
index e167b663d75a5e116c69c66c43196cd95503584a..156e03acfc00df67c5d278e23890d0a15672f8cf 100644
--- a/misc/ui/jquery.ui.dialog.css
+++ b/misc/ui/jquery.ui.dialog.css
@@ -1,4 +1,3 @@
-/* $Id: jquery.ui.dialog.css,v 1.3 2011/01/03 00:03:35 webchick Exp $ */
 
 /*
  * jQuery UI Dialog 1.8.7
diff --git a/misc/ui/jquery.ui.dialog.min.js b/misc/ui/jquery.ui.dialog.min.js
index dcbe845c6268490902d068291e595aa5b0467e0b..d60151c20382754fce88f308de2da4454ed2b631 100644
--- a/misc/ui/jquery.ui.dialog.min.js
+++ b/misc/ui/jquery.ui.dialog.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.ui.dialog.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $
 
 /*
  * jQuery UI Dialog 1.8.7
diff --git a/misc/ui/jquery.ui.draggable.min.js b/misc/ui/jquery.ui.draggable.min.js
index 28e072c269f772064d500bfea84574d1439a57f1..59a74182577db91db39080a0540a9bd1487f51da 100644
--- a/misc/ui/jquery.ui.draggable.min.js
+++ b/misc/ui/jquery.ui.draggable.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.ui.draggable.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $
 
 /*
  * jQuery UI Draggable 1.8.7
diff --git a/misc/ui/jquery.ui.droppable.min.js b/misc/ui/jquery.ui.droppable.min.js
index a5e739b8a24e7d3637a856fff04c3e7a9db368ab..12efd10bc4e7d2045715b4b9b9985377e0d454ef 100644
--- a/misc/ui/jquery.ui.droppable.min.js
+++ b/misc/ui/jquery.ui.droppable.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.ui.droppable.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $
 
 /*
  * jQuery UI Droppable 1.8.7
diff --git a/misc/ui/jquery.ui.mouse.min.js b/misc/ui/jquery.ui.mouse.min.js
index dfa32c922c5717e8e81a9910686d1f8cd52f07e9..18057ebd08430d2381b32fa5d788d0cc9f751bab 100644
--- a/misc/ui/jquery.ui.mouse.min.js
+++ b/misc/ui/jquery.ui.mouse.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.ui.mouse.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $
 
 /*!
  * jQuery UI Mouse 1.8.7
diff --git a/misc/ui/jquery.ui.position.min.js b/misc/ui/jquery.ui.position.min.js
index 5d47efbd9de8ad7dee7b4a742caf71b7f6c8a08e..2e1451efc10352317bcd9189309ac4271c789dcf 100644
--- a/misc/ui/jquery.ui.position.min.js
+++ b/misc/ui/jquery.ui.position.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.ui.position.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $
 
 /*
  * jQuery UI Position 1.8.7
diff --git a/misc/ui/jquery.ui.progressbar.css b/misc/ui/jquery.ui.progressbar.css
index 57a7a0bb2f864cbf97902692e2e382dd3adae221..75610308b2a42ff33a6fcba0d0818afd2a497a94 100644
--- a/misc/ui/jquery.ui.progressbar.css
+++ b/misc/ui/jquery.ui.progressbar.css
@@ -1,4 +1,3 @@
-/* $Id: jquery.ui.progressbar.css,v 1.3 2011/01/03 00:03:35 webchick Exp $ */
 
 /*
  * jQuery UI Progressbar 1.8.7
diff --git a/misc/ui/jquery.ui.progressbar.min.js b/misc/ui/jquery.ui.progressbar.min.js
index 4ac85b622abacbaffdd9e877182c662578b9626a..7a8f0b79002efc39bec3bd8a5d4796bc6bb0a64f 100644
--- a/misc/ui/jquery.ui.progressbar.min.js
+++ b/misc/ui/jquery.ui.progressbar.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.ui.progressbar.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $
 
 /*
  * jQuery UI Progressbar 1.8.7
diff --git a/misc/ui/jquery.ui.resizable.css b/misc/ui/jquery.ui.resizable.css
index f9585811cce2fdf8956d1615d6303fd49d8ac1e2..e0f15cc61c594325f07b02d658e0ea824a82629e 100644
--- a/misc/ui/jquery.ui.resizable.css
+++ b/misc/ui/jquery.ui.resizable.css
@@ -1,4 +1,3 @@
-/* $Id: jquery.ui.resizable.css,v 1.3 2011/01/03 00:03:35 webchick Exp $ */
 
 /*
  * jQuery UI Resizable 1.8.7
diff --git a/misc/ui/jquery.ui.resizable.min.js b/misc/ui/jquery.ui.resizable.min.js
index 4cb39c612be1d1519e5bfc0d323828f40953035d..4df6eb770b816f74f2eb99517a461ef0c1e37eda 100644
--- a/misc/ui/jquery.ui.resizable.min.js
+++ b/misc/ui/jquery.ui.resizable.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.ui.resizable.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $
 
 /*
  * jQuery UI Resizable 1.8.7
diff --git a/misc/ui/jquery.ui.selectable.css b/misc/ui/jquery.ui.selectable.css
index 688d8ae91e31a1d9fe7ec4d6233aef06555f0a06..1489dcf36c5784ec5fa9ae417eb44ea0cca1ede0 100644
--- a/misc/ui/jquery.ui.selectable.css
+++ b/misc/ui/jquery.ui.selectable.css
@@ -1,4 +1,3 @@
-/* $Id: jquery.ui.selectable.css,v 1.2 2011/01/03 00:03:35 webchick Exp $ */
 
 /*
  * jQuery UI Selectable 1.8.7
diff --git a/misc/ui/jquery.ui.selectable.min.js b/misc/ui/jquery.ui.selectable.min.js
index d5402bdb79456b702211ae7458f398df2e51af96..e2ec516e0b832d4c37b3a27a875c3f1bb2cabfdc 100644
--- a/misc/ui/jquery.ui.selectable.min.js
+++ b/misc/ui/jquery.ui.selectable.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.ui.selectable.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $
 
 /*
  * jQuery UI Selectable 1.8.7
diff --git a/misc/ui/jquery.ui.slider.css b/misc/ui/jquery.ui.slider.css
index 319603d0e31755d60863d7d6298a44172acaff2a..a56a513849c189f28c8df6302978ca1c000b67d5 100644
--- a/misc/ui/jquery.ui.slider.css
+++ b/misc/ui/jquery.ui.slider.css
@@ -1,4 +1,3 @@
-/* $Id: jquery.ui.slider.css,v 1.3 2011/01/03 00:03:35 webchick Exp $ */
 
 /*
  * jQuery UI Slider 1.8.7
diff --git a/misc/ui/jquery.ui.slider.min.js b/misc/ui/jquery.ui.slider.min.js
index 1867be180af5a71bca95bb1dffab800e3448d1ef..dc36f15fed04765017fc06f2fe13ba2c793708c2 100644
--- a/misc/ui/jquery.ui.slider.min.js
+++ b/misc/ui/jquery.ui.slider.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.ui.slider.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $
 
 /*
  * jQuery UI Slider 1.8.7
diff --git a/misc/ui/jquery.ui.sortable.min.js b/misc/ui/jquery.ui.sortable.min.js
index b394ed1140647f19522ee44c902f56afed3b8879..2cb1eaa54f3761ef86ac8f4d95360a310c9afe79 100644
--- a/misc/ui/jquery.ui.sortable.min.js
+++ b/misc/ui/jquery.ui.sortable.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.ui.sortable.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $
 
 /*
  * jQuery UI Sortable 1.8.7
diff --git a/misc/ui/jquery.ui.tabs.css b/misc/ui/jquery.ui.tabs.css
index c801d735de2989498b9c629d1c643733236bee38..94420e185d90e09a14dcb495c83238bd2959f700 100644
--- a/misc/ui/jquery.ui.tabs.css
+++ b/misc/ui/jquery.ui.tabs.css
@@ -1,4 +1,3 @@
-/* $Id: jquery.ui.tabs.css,v 1.3 2011/01/03 00:03:35 webchick Exp $ */
 
 /*
  * jQuery UI Tabs 1.8.7
diff --git a/misc/ui/jquery.ui.tabs.min.js b/misc/ui/jquery.ui.tabs.min.js
index 6fe9fad1763ad943f5fcb53e802386f647bc7764..aeb42bb4bed93ebf228675f6bac1545ade3f182b 100644
--- a/misc/ui/jquery.ui.tabs.min.js
+++ b/misc/ui/jquery.ui.tabs.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.ui.tabs.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $
 
 /*
  * jQuery UI Tabs 1.8.7
diff --git a/misc/ui/jquery.ui.theme.css b/misc/ui/jquery.ui.theme.css
index 32a1a2a7827fe3df71dade61e7db48017ee1b4fd..1e622b46a87b67ff6d8880ab0070222c588935c1 100644
--- a/misc/ui/jquery.ui.theme.css
+++ b/misc/ui/jquery.ui.theme.css
@@ -1,4 +1,3 @@
-/* $Id: jquery.ui.theme.css,v 1.3 2011/01/03 00:03:35 webchick Exp $ */
 
 /*
  * jQuery UI CSS Framework 1.8.7
diff --git a/misc/ui/jquery.ui.widget.min.js b/misc/ui/jquery.ui.widget.min.js
index d46919917bdbd31009a0ff6c66ccdb55c50490e1..165a272b7886fe5b6e659a879fed1299888881ce 100644
--- a/misc/ui/jquery.ui.widget.min.js
+++ b/misc/ui/jquery.ui.widget.min.js
@@ -1,4 +1,3 @@
-// $Id: jquery.ui.widget.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $
 
 /*!
  * jQuery UI Widget 1.8.7
diff --git a/misc/vertical-tabs-rtl.css b/misc/vertical-tabs-rtl.css
index 5dc8c9895192503b035f9b28a0c8bab541518cb7..7fb0347d4614b21d4383b96ed4a9d64aa1a751f2 100644
--- a/misc/vertical-tabs-rtl.css
+++ b/misc/vertical-tabs-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: vertical-tabs-rtl.css,v 1.3 2010/10/07 15:54:13 webchick Exp $ */
 
 div.vertical-tabs {
   margin-left: 0;
diff --git a/misc/vertical-tabs.css b/misc/vertical-tabs.css
index d350c8e6267a2ae03cd78af20c2f7bd44cc0498d..10e81539176c9849f88e8019593b20c94553c9c9 100644
--- a/misc/vertical-tabs.css
+++ b/misc/vertical-tabs.css
@@ -1,4 +1,3 @@
-/* $Id: vertical-tabs.css,v 1.8 2010/10/07 15:54:13 webchick Exp $ */
 
 div.vertical-tabs {
   margin: 1em 0 1em 15em; /* LTR */
diff --git a/misc/vertical-tabs.js b/misc/vertical-tabs.js
index 7359953114148b52d02020651a09cf7232f9c7d3..82dcd2c62ed91343ef8ceee1e29424e9bfc4f8f6 100644
--- a/misc/vertical-tabs.js
+++ b/misc/vertical-tabs.js
@@ -1,4 +1,3 @@
-// $Id: vertical-tabs.js,v 1.14 2010/07/24 16:56:31 dries Exp $
 
 (function ($) {
 
diff --git a/misc/watchdog-error.png b/misc/watchdog-error.png
index f7e60e5238ee0f613c73d556f69f7ff52be7a8bb..db05365aa51c5d77ebdf732aa642d94da8613f25 100644
Binary files a/misc/watchdog-error.png and b/misc/watchdog-error.png differ
diff --git a/misc/watchdog-ok.png b/misc/watchdog-ok.png
index 6ebea3e53d5fd889eb4ada215506c6e0e48b48bf..1d7baa06e2d09c704e47d4955a763066398e932c 100644
Binary files a/misc/watchdog-ok.png and b/misc/watchdog-ok.png differ
diff --git a/misc/watchdog-warning.png b/misc/watchdog-warning.png
index 5d33a512ee78ecd82a36763d4588ffa9ba45b767..d8dced8890f22165848acc20297fdb93fc2a77ff 100644
Binary files a/misc/watchdog-warning.png and b/misc/watchdog-warning.png differ
diff --git a/modules/README.txt b/modules/README.txt
index d0e7c9d9e01f1a124b9b47a25e0708a1f3f17c6c..8928d8021ba8258aa2a345010c17dbd510ff4061 100644
--- a/modules/README.txt
+++ b/modules/README.txt
@@ -1,4 +1,3 @@
-// $Id: README.txt,v 1.3 2009/10/08 01:44:22 dries Exp $
 
 This directory is reserved for core module files. Custom or contributed modules
 should be placed in their own subdirectory of the sites/all/modules directory.
diff --git a/modules/aggregator/aggregator-feed-source.tpl.php b/modules/aggregator/aggregator-feed-source.tpl.php
index 267265e04b2bde4e1d183f5e88fe4ac9c8db2aac..6a684bdb7faea7d8d35ffd6f96fa6137acc88080 100644
--- a/modules/aggregator/aggregator-feed-source.tpl.php
+++ b/modules/aggregator/aggregator-feed-source.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: aggregator-feed-source.tpl.php,v 1.2 2008/05/15 21:27:32 dries Exp $
 
 /**
  * @file
diff --git a/modules/aggregator/aggregator-item.tpl.php b/modules/aggregator/aggregator-item.tpl.php
index 5d6912fa42d6c5de122d1d5233c74108a6230a7e..c5dd70c67b5d0af3128171f72ea1ce0c63cfc49e 100644
--- a/modules/aggregator/aggregator-item.tpl.php
+++ b/modules/aggregator/aggregator-item.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: aggregator-item.tpl.php,v 1.2 2008/05/15 21:27:32 dries Exp $
 
 /**
  * @file
diff --git a/modules/aggregator/aggregator-rtl.css b/modules/aggregator/aggregator-rtl.css
index 7de7e651c4d2830d82344198770574d169cccebe..ea59ca3a19f10c0103741d0d7f02ca6d1406fc28 100644
--- a/modules/aggregator/aggregator-rtl.css
+++ b/modules/aggregator/aggregator-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: aggregator-rtl.css,v 1.1 2007/05/27 17:57:47 goba Exp $ */
 
 #aggregator .feed-source .feed-icon {
   float: left;
diff --git a/modules/aggregator/aggregator-summary-item.tpl.php b/modules/aggregator/aggregator-summary-item.tpl.php
index 281aa2f893ee40eccee856d385ad6dae2fe6b934..1c8299938be08f6ca0ce40ab4aeeb56b81f79986 100644
--- a/modules/aggregator/aggregator-summary-item.tpl.php
+++ b/modules/aggregator/aggregator-summary-item.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: aggregator-summary-item.tpl.php,v 1.2 2008/05/15 21:27:32 dries Exp $
 
 /**
  * @file
diff --git a/modules/aggregator/aggregator-summary-items.tpl.php b/modules/aggregator/aggregator-summary-items.tpl.php
index eeb259822ae4f2db24a9e03b544fbe12d97536b7..0e2133a1e3b08a3419a003b71df52d2256b8806a 100644
--- a/modules/aggregator/aggregator-summary-items.tpl.php
+++ b/modules/aggregator/aggregator-summary-items.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: aggregator-summary-items.tpl.php,v 1.4 2010/10/15 23:37:55 webchick Exp $
 
 /**
  * @file
diff --git a/modules/aggregator/aggregator-wrapper.tpl.php b/modules/aggregator/aggregator-wrapper.tpl.php
index f49dce3d92e450ac46208eb4586c6c8282e2ccd8..80b903271d4f1974403b9e06b8734be3dce907e8 100644
--- a/modules/aggregator/aggregator-wrapper.tpl.php
+++ b/modules/aggregator/aggregator-wrapper.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: aggregator-wrapper.tpl.php,v 1.3 2009/07/23 22:14:26 webchick Exp $
 
 /**
  * @file
diff --git a/modules/aggregator/aggregator.admin.inc b/modules/aggregator/aggregator.admin.inc
index 7534a9c275b05dc0018af2c415fd115804b5d983..08087afb2b868d2dde47fadc0d63a3ffbcb35bbc 100644
--- a/modules/aggregator/aggregator.admin.inc
+++ b/modules/aggregator/aggregator.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: aggregator.admin.inc,v 1.54 2010/06/26 19:55:47 dries Exp $
 
 /**
  * @file
@@ -350,16 +349,17 @@ function aggregator_form_opml_submit($form, &$form_state) {
 /**
  * Parse an OPML file.
  *
- * Feeds are recognized as <outline> elements with the attributes
- * <em>text</em> and <em>xmlurl</em> set.
+ * Feeds are recognized as <outline> elements with the attributes "text" and
+ * "xmlurl" set.
  *
  * @param $opml
  *   The complete contents of an OPML document.
+ *
  * @return
- *   An array of feeds, each an associative array with a <em>title</em> and
- *   a <em>url</em> element, or NULL if the OPML document failed to be parsed.
- *   An empty array will be returned if the document is valid but contains
- *   no feeds, as some OPML documents do.
+ *   An array of feeds, each an associative array with a "title" and a "url"
+ *   element, or NULL if the OPML document failed to be parsed. An empty
+ *   array will be returned if the document is valid but contains no feeds, as
+ *   some OPML documents do.
  */
 function _aggregator_parse_opml($opml) {
   $feeds = array();
diff --git a/modules/aggregator/aggregator.api.php b/modules/aggregator/aggregator.api.php
index 91f44c34d5afd29967c615092e01ed011d779aec..f31413c4270716e3c1b6dba486d7a1af94a2cf79 100644
--- a/modules/aggregator/aggregator.api.php
+++ b/modules/aggregator/aggregator.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: aggregator.api.php,v 1.7 2010/01/08 11:03:54 dries Exp $
 
 /**
  * @file
diff --git a/modules/aggregator/aggregator.css b/modules/aggregator/aggregator.css
index b50fc8d4f4383732e1ca28f35a4fcd8d79e67568..13c58ffe70eeeb58f82954a4f75c6c224c1c7633 100644
--- a/modules/aggregator/aggregator.css
+++ b/modules/aggregator/aggregator.css
@@ -1,4 +1,3 @@
-/* $Id: aggregator.css,v 1.3 2010/04/28 20:08:38 dries Exp $ */
 
 #aggregator .feed-source .feed-title {
   margin-top: 0;
diff --git a/modules/aggregator/aggregator.fetcher.inc b/modules/aggregator/aggregator.fetcher.inc
index 4695d99438b63a0cbaca5be532e311e2bd1c6c0c..0f728779864f9c28111dff7f2bbd48c5ad3abca6 100644
--- a/modules/aggregator/aggregator.fetcher.inc
+++ b/modules/aggregator/aggregator.fetcher.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: aggregator.fetcher.inc,v 1.12 2010/01/08 11:03:54 dries Exp $
 
 /**
  * @file
diff --git a/modules/aggregator/aggregator.info b/modules/aggregator/aggregator.info
index b31da62ce3864eb832e4035a3c07beac24d301e9..667e77ce9ef07f1c65364ec0402ba4bd399cfbb8 100644
--- a/modules/aggregator/aggregator.info
+++ b/modules/aggregator/aggregator.info
@@ -1,4 +1,3 @@
-; $Id: aggregator.info,v 1.15 2010/12/20 19:59:40 webchick Exp $
 name = Aggregator
 description = "Aggregates syndicated content (RSS, RDF, and Atom feeds)."
 package = Core
@@ -8,8 +7,8 @@ files[] = aggregator.test
 configure = admin/config/services/aggregator/settings
 stylesheets[all][] = aggregator.css
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/aggregator/aggregator.install b/modules/aggregator/aggregator.install
index 8cc421b995aec268b7f148f880f1f1c69e92e9b7..f19d7de9b4fdc280cfdd865a78abdf11a62bf1c6 100644
--- a/modules/aggregator/aggregator.install
+++ b/modules/aggregator/aggregator.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: aggregator.install,v 1.31 2010/08/22 13:55:53 dries Exp $
 
 /**
  * @file
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index 21b21f87cf4c3e45c5c3bbbc8b6385ee00ac5dc0..1e1686af8bf2a671c4a674f3c12777bf0a41d784 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: aggregator.module,v 1.444 2010/09/24 00:37:41 dries Exp $
 
 /**
  * @file
@@ -27,9 +26,9 @@ function aggregator_help($path, $arg) {
       $output .= '<dt>' . t('Adding, editing, and deleting feeds') . '</dt>';
       $output .= '<dd>' . t('Administrators can add, edit, and delete feeds, and choose how often to check each feed for newly updated items on the <a href="@feededit">Feed aggregator administration page</a>.', array('@feededit' => url('admin/config/services/aggregator'))) . '</dd>';
       $output .= '<dt>' . t('OPML integration') . '</dt>';
-      $output .= '<dd>' .  t('A <a href="@aggregator-opml">machine-readable OPML file</a> of all feeds is available. OPML is an XML-based file format used to share outline-structured information such as a list of RSS feeds. Feeds can also be <a href="@import-opml">imported via an OPML file</a>.', array('@aggregator-opml' => url('aggregator/opml'), '@import-opml' => url('admin/config/services/aggregator'))) . '</dd>';
+      $output .= '<dd>' . t('A <a href="@aggregator-opml">machine-readable OPML file</a> of all feeds is available. OPML is an XML-based file format used to share outline-structured information such as a list of RSS feeds. Feeds can also be <a href="@import-opml">imported via an OPML file</a>.', array('@aggregator-opml' => url('aggregator/opml'), '@import-opml' => url('admin/config/services/aggregator'))) . '</dd>';
       $output .= '<dt>' . t('Configuring cron') . '</dt>';
-      $output .= '<dd>' .  t('A correctly configured <a href="@cron">cron maintenance task</a> is required to update feeds automatically.', array('@cron' => 'http://drupal.org/cron')) . '</dd>';
+      $output .= '<dd>' . t('A correctly configured <a href="@cron">cron maintenance task</a> is required to update feeds automatically.', array('@cron' => 'http://drupal.org/cron')) . '</dd>';
       $output .= '</dl>';
       return $output;
     case 'admin/config/services/aggregator':
@@ -195,7 +194,6 @@ function aggregator_menu() {
     'title arguments' => array(2),
     'page callback' => 'aggregator_page_category',
     'page arguments' => array(2),
-    'access callback' => 'user_access',
     'access arguments' => array('access news feeds'),
     'file' => 'aggregator.pages.inc',
   );
@@ -268,7 +266,7 @@ function aggregator_menu() {
 }
 
 /**
- * Menu callback.
+ * Title callback for aggregatory category pages.
  *
  * @return
  *   An aggregator category title.
@@ -281,7 +279,8 @@ function _aggregator_category_title($category) {
  * Find out whether there are any aggregator categories.
  *
  * @return
- *   TRUE if there is at least one category and the user has access to them, FALSE otherwise.
+ *   TRUE if there is at least one category and the user has access to them, FALSE
+ *   otherwise.
  */
 function _aggregator_has_categories() {
   return user_access('access news feeds') && db_query('SELECT COUNT(*) FROM {aggregator_category}')->fetchField();
@@ -307,7 +306,7 @@ function aggregator_permission() {
  * Queues news feeds for updates once their refresh interval has elapsed.
  */
 function aggregator_cron() {
-  $result = db_query('SELECT * FROM {aggregator_feed} WHERE queued = 0 AND checked + refresh < :time AND refresh != :never', array(
+  $result = db_query('SELECT * FROM {aggregator_feed} WHERE queued = 0 AND checked + refresh < :time AND refresh <> :never', array(
     ':time' => REQUEST_TIME,
     ':never' => AGGREGATOR_CLEAR_NEVER
   ));
@@ -344,16 +343,16 @@ function aggregator_cron_queue_info() {
  * Implements hook_block_info().
  */
 function aggregator_block_info() {
-  $block = array();
+  $blocks = array();
   $result = db_query('SELECT cid, title FROM {aggregator_category} ORDER BY title');
   foreach ($result as $category) {
-    $block['category-' . $category->cid]['info'] = t('!title category latest items', array('!title' => $category->title));
+    $blocks['category-' . $category->cid]['info'] = t('!title category latest items', array('!title' => $category->title));
   }
   $result = db_query('SELECT fid, title FROM {aggregator_feed} WHERE block <> 0 ORDER BY fid');
   foreach ($result as $feed) {
-    $block['feed-' . $feed->fid]['info'] = t('!title feed latest items', array('!title' => $feed->title));
+    $blocks['feed-' . $feed->fid]['info'] = t('!title feed latest items', array('!title' => $feed->title));
   }
-  return $block;
+  return $blocks;
 }
 
 /**
@@ -367,7 +366,7 @@ function aggregator_block_configure($delta = '') {
       '#type' => 'select',
       '#title' => t('Number of news items in block'),
       '#default_value' => $value,
-      '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20))
+      '#options' => drupal_map_assoc(range(2, 20)),
     );
     return $form;
   }
@@ -720,7 +719,8 @@ function aggregator_filter_xss($value) {
 /**
  * Check and sanitize aggregator configuration.
  *
- * Goes through all fetchers, parsers and processors and checks whether they are available.
+ * Goes through all fetchers, parsers and processors and checks whether they are
+ * available.
  * If one is missing resets to standard configuration.
  *
  * @return
diff --git a/modules/aggregator/aggregator.pages.inc b/modules/aggregator/aggregator.pages.inc
index 08c2de7cf356ea1779472262eca46048f6817a3e..53ecb3684e612756c767d8a3eba8429036f3750c 100644
--- a/modules/aggregator/aggregator.pages.inc
+++ b/modules/aggregator/aggregator.pages.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: aggregator.pages.inc,v 1.45 2010/10/15 23:37:55 webchick Exp $
 
 /**
  * @file
diff --git a/modules/aggregator/aggregator.parser.inc b/modules/aggregator/aggregator.parser.inc
index 2105aed7826a48c11ef0058ed22f70b7ec22009f..cffd1c3aa49a2a5dc4815e682c7b2b79dc6ab35a 100644
--- a/modules/aggregator/aggregator.parser.inc
+++ b/modules/aggregator/aggregator.parser.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: aggregator.parser.inc,v 1.10 2010/07/24 17:42:22 dries Exp $
 
 /**
  * @file
@@ -125,7 +124,11 @@ function aggregator_parse_feed(&$data, $feed) {
     else {
       $item['link'] = $feed->link;
     }
-    $item['guid'] = isset($item['guid']) ? $item['guid'] : '';
+
+    // Atom feeds have an ID tag instead of a GUID tag.
+    if (!isset($item['guid'])) {
+      $item['guid'] = isset($item['id']) ? $item['id'] : '';
+    }
 
     // Atom feeds have a content and/or summary tag instead of a description tag.
     if (!empty($item['content:encoded'])) {
diff --git a/modules/aggregator/aggregator.processor.inc b/modules/aggregator/aggregator.processor.inc
index fec66e244db035f84e3dc7aed7f3be571a2a2d18..6eb2c662fab594efb7b567fec5e1046231286b18 100644
--- a/modules/aggregator/aggregator.processor.inc
+++ b/modules/aggregator/aggregator.processor.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: aggregator.processor.inc,v 1.14 2010/10/04 18:00:45 dries Exp $
 
 /**
  * @file
@@ -163,8 +162,8 @@ function aggregator_save_item($edit) {
     $result = db_query('SELECT cid FROM {aggregator_category_feed} WHERE fid = :fid', array(':fid' => $edit['fid']));
     foreach ($result as $category) {
       db_merge('aggregator_category_item')
-        ->key(array('iid' => $edit['iid']))
-        ->fields(array(
+        ->key(array(
+          'iid' => $edit['iid'],
           'cid' => $category->cid,
         ))
         ->execute();
diff --git a/modules/aggregator/aggregator.test b/modules/aggregator/aggregator.test
index 2e5260793111d9e0c05e37ac35e6642ead7c6e29..1ab12dc2e704046aa272e126de0f58d3ff3b207c 100644
--- a/modules/aggregator/aggregator.test
+++ b/modules/aggregator/aggregator.test
@@ -1,9 +1,8 @@
 <?php
-// $Id: aggregator.test,v 1.47 2010/10/25 15:51:21 webchick Exp $
 
 /**
  * @file
- * Creates tests for aggregator module.
+ * Tests for aggregator.module.
  */
 
 class AggregatorTestCase extends DrupalWebTestCase {
@@ -854,6 +853,7 @@ class FeedParserTestCase extends AggregatorTestCase {
     $this->assertText('Atom-Powered Robots Run Amok');
     $this->assertLinkByHref('http://example.org/2003/12/13/atom03');
     $this->assertText('Some text.');
+    $this->assertEqual('urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a', db_query('SELECT guid FROM {aggregator_item} WHERE link = :link', array(':link' => 'http://example.org/2003/12/13/atom03'))->fetchField(), 'Atom entry id element is parsed correctly.');
   }
 }
 
diff --git a/modules/aggregator/tests/aggregator_test.info b/modules/aggregator/tests/aggregator_test.info
index 7d79a08b77c8192504dbeee5401643be7b899cd1..31fcf1d59108321ce7383ea6a8432310de5a17b4 100644
--- a/modules/aggregator/tests/aggregator_test.info
+++ b/modules/aggregator/tests/aggregator_test.info
@@ -1,4 +1,3 @@
-; $Id: aggregator_test.info,v 1.2 2010/12/20 19:59:40 webchick Exp $
 name = "Aggregator module tests"
 description = "Support module for aggregator related testing."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/aggregator/tests/aggregator_test.module b/modules/aggregator/tests/aggregator_test.module
index f77e38af6e598c4d07a474be8b1f6c6d8c79671b..2d26a5d9a74332eafff25ecd2d4f4771d53b0d7e 100644
--- a/modules/aggregator/tests/aggregator_test.module
+++ b/modules/aggregator/tests/aggregator_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: aggregator_test.module,v 1.8 2010/05/01 08:12:22 dries Exp $
 
 /**
  * Implements hook_menu().
diff --git a/modules/block/block-admin-display-form.tpl.php b/modules/block/block-admin-display-form.tpl.php
index 5ec8be0393485c1b562c68f71e8095326a1792de..94b610416b22d22095556a4d8104d86de8e4e467 100644
--- a/modules/block/block-admin-display-form.tpl.php
+++ b/modules/block/block-admin-display-form.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: block-admin-display-form.tpl.php,v 1.7 2009/10/05 02:43:01 webchick Exp $
 
 /**
  * @file
diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc
index 72dec8f93aa599d078d57384afe67e0cda06e728..7cf299c0e548b256aab91378a12338152465eb10 100644
--- a/modules/block/block.admin.inc
+++ b/modules/block/block.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: block.admin.inc,v 1.91 2010/11/06 23:24:33 webchick Exp $
 
 /**
  * @file
@@ -17,7 +16,7 @@ function block_admin_demo($theme = NULL) {
 /**
  * Menu callback for admin/structure/block.
  *
- * @param $theme
+ * @param $theme
  *   The theme to display the administration page for. If not provided, defaults
  *   to the currently used theme.
  */
diff --git a/modules/block/block.api.php b/modules/block/block.api.php
index 2df97df8561347b5dfd3c01495f96d3bfdf63e68..d33f59425468bce462b733c6cf3527ff2664a06e 100644
--- a/modules/block/block.api.php
+++ b/modules/block/block.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: block.api.php,v 1.15 2010/11/23 16:12:15 webchick Exp $
 
 /**
  * @file
@@ -34,7 +33,7 @@
  * it is preferable to use descriptive strings whenever possible, and only use a
  * numeric identifier if you have to (for instance if your module allows users
  * to create several similar blocks that you identify within your module code
- * with numeric IDs).
+ * with numeric IDs). The maximum length for delta values is 32 bytes.
  *
  * @return
  *   An associative array whose keys define the delta for each block and whose
@@ -77,12 +76,12 @@
  *     enabled theme, the block will be disabled.
  *   - 'visibility': (optional) Initial value for the visibility flag, which
  *     tells how to interpret the 'pages' value. Possible values are:
- *     - 0: Show on all pages except listed pages. 'pages' lists the paths where
- *       the block should not be shown.
- *     - 1: Show only on listed pages. 'pages' lists the paths where the block
- *       should be shown.
- *     - 2: Use custom PHP code to determine visibility. 'pages' gives the PHP
- *       code to use.
+ *     - BLOCK_VISIBILITY_NOTLISTED: Show on all pages except listed pages.
+ *       'pages' lists the paths where the block should not be shown.
+ *     - BLOCK_VISIBILITY_LISTED: Show only on listed pages. 'pages' lists the
+ *       paths where the block should be shown.
+ *     - BLOCK_VISIBILITY_PHP: Use custom PHP code to determine visibility.
+ *       'pages' gives the PHP code to use.
  *     Most modules do not provide an initial value for 'visibility' or 'pages',
  *     and any value provided can be modified by a user on the block
  *     configuration screen.
@@ -206,23 +205,27 @@ function hook_block_save($delta = '', $edit = array()) {
  * @see hook_block_view_MODULE_DELTA_alter()
  */
 function hook_block_view($delta = '') {
-  // This example comes from node.module. Note that you can also return a
-  // renderable array rather than rendered HTML for 'content'.
+  // This example is adapted from node.module.
   $block = array();
 
   switch ($delta) {
     case 'syndicate':
       $block['subject'] = t('Syndicate');
-      $block['content'] = theme('feed_icon', array('url' => url('rss.xml'), 'title' => t('Syndicate')));
+      $block['content'] = array(
+        '#theme' => 'feed_icon',
+        '#url' => 'rss.xml',
+        '#title' => t('Syndicate'),
+      );
       break;
 
     case 'recent':
       if (user_access('access content')) {
         $block['subject'] = t('Recent content');
         if ($nodes = node_get_recent(variable_get('node_recent_block_count', 10))) {
-          $block['content'] = theme('node_recent_block', array(
-            'nodes' => $nodes,
-          ));
+          $block['content'] = array(
+            '#theme' => 'node_recent_block',
+            '#nodes' => $nodes,
+          );
         } else {
           $block['content'] = t('No content available.');
         }
diff --git a/modules/block/block.css b/modules/block/block.css
index a146be040633bf8d295b62d112e5f8d90d0df809..214c8a25e0a044e9e4491fc64de61c81edc5f5b4 100644
--- a/modules/block/block.css
+++ b/modules/block/block.css
@@ -1,4 +1,3 @@
-/* $Id: block.css,v 1.9 2011/01/03 07:04:48 webchick Exp $ */
 
 #blocks tr.region-title td {
   font-weight: bold;
diff --git a/modules/block/block.info b/modules/block/block.info
index 7e51b488167d6ff440b3780361cffbb89d069df3..b891bf7457f79f41ea762c7947927080013aa669 100644
--- a/modules/block/block.info
+++ b/modules/block/block.info
@@ -1,4 +1,3 @@
-; $Id: block.info,v 1.16 2010/12/20 19:59:40 webchick Exp $
 name = Block
 description = Controls the visual building blocks a page is constructed with. Blocks are boxes of content rendered into an area, or region, of a web page.
 package = Core
@@ -7,8 +6,8 @@ core = 7.x
 files[] = block.test
 configure = admin/structure/block
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/block/block.install b/modules/block/block.install
index dafcfb3ccda741a03cb272756da89b5edc289964..c45b076bf75f75407e8866c2ecd21975c0ca9941 100644
--- a/modules/block/block.install
+++ b/modules/block/block.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: block.install,v 1.48 2011/01/02 17:26:39 webchick Exp $
 
 /**
  * @file
@@ -229,6 +228,7 @@ function block_update_7000() {
  * {boxes} to {block_custom}.
  */
 function block_update_7002() {
+  db_drop_index('blocks', 'list');
   db_rename_table('blocks', 'block');
   db_rename_table('blocks_roles', 'block_role');
   db_rename_table('boxes', 'block_custom');
@@ -238,7 +238,6 @@ function block_update_7002() {
  * Change the weight column to normal int.
  */
 function block_update_7003() {
-  db_drop_index('block', 'list');
   db_change_field('block', 'weight', 'weight', array(
     'type' => 'int',
     'not null' => TRUE,
@@ -461,6 +460,13 @@ function block_update_7007() {
   ));
 }
 
+/**
+ * Update database to match Drupal 7 schema.
+ */
+function block_update_7008() {
+  db_drop_field('block', 'throttle');
+}
+
 /**
  * @} End of "addtogroup updates-6.x-to-7.x"
  */
diff --git a/modules/block/block.js b/modules/block/block.js
index 290106919bd3b784d225cca901e85c8b09012cb5..ce4995dcadf7e94be7510a781ff668578837744a 100644
--- a/modules/block/block.js
+++ b/modules/block/block.js
@@ -1,4 +1,3 @@
-// $Id: block.js,v 1.16 2010/05/09 13:57:59 dries Exp $
 (function ($) {
 
 /**
diff --git a/modules/block/block.module b/modules/block/block.module
index ae4889ee51194c5150d8f6d747d529352b11db5e..73eba3311618f0cbb9d9d1731f5a00c4e568321c 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: block.module,v 1.435 2010/11/23 16:12:15 webchick Exp $
 
 /**
  * @file
@@ -258,7 +257,7 @@ function block_page_build(&$page) {
   // The theme system might not yet be initialized. We need $theme.
   drupal_theme_initialize();
 
-  // Populate all block regions
+  // Fetch a list of regions for the current theme.
   $all_regions = system_region_list($theme);
 
   $item = menu_get_item();
@@ -356,7 +355,7 @@ function _block_get_renderable_array($list = array()) {
 /**
  * Update the 'block' DB table with the blocks currently exported by modules.
  *
- * @param $theme
+ * @param $theme
  *   The theme to rehash blocks for. If not provided, defaults to the currently
  *   used theme.
  *
@@ -944,7 +943,15 @@ function template_preprocess_block(&$variables) {
 
   $variables['theme_hook_suggestions'][] = 'block__' . $variables['block']->region;
   $variables['theme_hook_suggestions'][] = 'block__' . $variables['block']->module;
-  $variables['theme_hook_suggestions'][] = 'block__' . $variables['block']->module . '__' . $variables['block']->delta;
+  // Hyphens (-) and underscores (_) play a special role in theme suggestions.
+  // Theme suggestions should only contain underscores, because within
+  // drupal_find_theme_templates(), underscores are converted to hyphens to
+  // match template file names, and then converted back to underscores to match
+  // pre-processing and other function names. So if your theme suggestion
+  // contains a hyphen, it will end up as an underscore after this conversion,
+  // and your function names won't be recognized. So, we need to convert
+  // hyphens to underscores in block deltas for the theme suggestions.
+  $variables['theme_hook_suggestions'][] = 'block__' . $variables['block']->module . '__' . strtr($variables['block']->delta, '-', '_');
 
   // Create a valid HTML ID and make sure it is unique.
   $variables['block_html_id'] = drupal_html_id('block-' . $variables['block']->module . '-' . $variables['block']->delta);
diff --git a/modules/block/block.test b/modules/block/block.test
index ce0ff8077f4a36b85a20e2e6017fa1a5e5089354..022bf383031d7556d491ae9b6e87e0767a2e54f1 100644
--- a/modules/block/block.test
+++ b/modules/block/block.test
@@ -1,9 +1,8 @@
 <?php
-// $Id: block.test,v 1.64 2010/11/29 06:38:51 webchick Exp $
 
 /**
  * @file
- * Tests for the block module
+ * Tests for block.module.
  */
 
 class BlockTestCase extends DrupalWebTestCase {
@@ -415,7 +414,7 @@ class BlockAdminThemeTestCase extends DrupalWebTestCase {
   public static function getInfo() {
     return array(
       'name' => 'Admin theme block admin accessibility',
-      'description' => "Check whether the block administer page for a disabled theme acccessible if and only if it's the admin theme.",
+      'description' => "Check whether the block administer page for a disabled theme accessible if and only if it's the admin theme.",
       'group' => 'Block',
     );
   }
@@ -667,3 +666,45 @@ class BlockHTMLIdTestCase extends DrupalWebTestCase {
     $this->assertRaw('block-block-test-test-html-id', t('HTML id for test block is valid.'));
   }
 }
+
+
+/**
+ * Unit tests for template_preprocess_block().
+ */
+class BlockTemplateSuggestionsUnitTest extends DrupalUnitTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Block template suggestions',
+      'description' => 'Test the template_preprocess_block() function.',
+      'group' => 'Block',
+    );
+  }
+
+  /**
+   * Test if template_preprocess_block() handles the suggestions right.
+   */
+  function testBlockThemeHookSuggestions() {
+    // Define block delta with underscore to be preprocessed
+    $block1 = new stdClass();
+    $block1->module = 'block';
+    $block1->delta = 'underscore_test';
+    $block1->region = 'footer';
+    $variables1 = array();
+    $variables1['elements']['#block'] = $block1;
+    $variables1['elements']['#children'] = '';
+    template_preprocess_block($variables1);
+    $this->assertEqual($variables1['theme_hook_suggestions'], array('block__footer', 'block__block', 'block__block__underscore_test'), t('Found expected block suggestions for delta with underscore'));
+
+    // Define block delta with hyphens to be preprocessed. Hyphens should be
+    // replaced with underscores.
+    $block2 = new stdClass();
+    $block2->module = 'block';
+    $block2->delta = 'hyphen-test';
+    $block2->region = 'footer';
+    $variables2 = array();
+    $variables2['elements']['#block'] = $block2;
+    $variables2['elements']['#children'] = '';
+    template_preprocess_block($variables2);
+    $this->assertEqual($variables2['theme_hook_suggestions'], array('block__footer', 'block__block', 'block__block__hyphen_test'), t('Hyphens (-) in block delta were replaced by underscore (_)'));
+  }
+}
diff --git a/modules/block/block.tpl.php b/modules/block/block.tpl.php
index 270479d4904aa3d72f2ffafda8abc79622ca740b..b1946374a22ca716f95a6b2f51a52b538f9b3455 100644
--- a/modules/block/block.tpl.php
+++ b/modules/block/block.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: block.tpl.php,v 1.10 2010/04/26 14:10:40 dries Exp $
 
 /**
  * @file
diff --git a/modules/block/tests/block_test.info b/modules/block/tests/block_test.info
index 5c6978c75e2cb656a826aedc510ae70a3e4be0ca..6da4918f11c4b243b5b5a2281874895c1eb77211 100644
--- a/modules/block/tests/block_test.info
+++ b/modules/block/tests/block_test.info
@@ -1,4 +1,3 @@
-; $Id: block_test.info,v 1.2 2010/12/20 19:59:40 webchick Exp $
 name = Block test
 description = Provides test blocks.
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/block/tests/block_test.module b/modules/block/tests/block_test.module
index 1957f24ae3ee54b4c3fc4f6c85520be43dcadd4e..2abc433c98240b6c409ed10a3e27b920e8c154b0 100644
--- a/modules/block/tests/block_test.module
+++ b/modules/block/tests/block_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: block_test.module,v 1.3 2010/06/15 16:19:28 dries Exp $
 
 /**
  * @file
diff --git a/modules/blog/blog.info b/modules/blog/blog.info
index a69e8524e84e47e542967cc8204e3a1185a38a27..3b93b82efd21ffbffbb3b25f6915754995a8df9c 100644
--- a/modules/blog/blog.info
+++ b/modules/blog/blog.info
@@ -1,4 +1,3 @@
-; $Id: blog.info,v 1.12 2010/12/20 19:59:40 webchick Exp $
 name = Blog
 description = Enables multi-user blogs.
 package = Core
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = blog.test
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/blog/blog.install b/modules/blog/blog.install
index 322c21b91dc6bd6f50535aef701809bab45dffb5..fffb14b837c8c34655876d172904829290c21955 100644
--- a/modules/blog/blog.install
+++ b/modules/blog/blog.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: blog.install,v 1.1 2010/05/05 15:11:51 webchick Exp $
 
 /**
  * @file
@@ -15,3 +14,10 @@ function blog_install() {
   $types = node_type_get_types();
   node_add_body_field($types['blog']);
 }
+
+/**
+ * Implements hook_uninstall().
+ */
+function blog_uninstall() {
+  variable_del('blog_block_count');
+}
diff --git a/modules/blog/blog.module b/modules/blog/blog.module
index c9bee7b9e5c2323ce29a9f2c10f10ccb719efbb6..98ebe5159a75e12a22cff597b4760a493c2ea059 100644
--- a/modules/blog/blog.module
+++ b/modules/blog/blog.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: blog.module,v 1.362 2010/11/14 21:04:45 webchick Exp $
 
 /**
  * @file
diff --git a/modules/blog/blog.pages.inc b/modules/blog/blog.pages.inc
index 9270a12a23a9575858be356dc1e13316a349de0c..3684028d05f7d0f54394db8ac2949177fecd02fa 100644
--- a/modules/blog/blog.pages.inc
+++ b/modules/blog/blog.pages.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: blog.pages.inc,v 1.28 2010/08/03 02:02:02 dries Exp $
 
 /**
  * @file
diff --git a/modules/blog/blog.test b/modules/blog/blog.test
index 574e37942645b4f8cbb9b9f8831a51c5c4b6f6d2..6ff66a2abb6dd5fd660c1cd774bbb0cca0176a50 100644
--- a/modules/blog/blog.test
+++ b/modules/blog/blog.test
@@ -1,5 +1,9 @@
 <?php
-// $Id: blog.test,v 1.30 2010/08/30 00:22:03 webchick Exp $
+
+/**
+ * @file
+ * Tests for blog.module.
+ */
 
 class BlogTestCase extends DrupalWebTestCase {
   protected $big_user;
diff --git a/modules/book/book-all-books-block.tpl.php b/modules/book/book-all-books-block.tpl.php
index 1282ce0bd97258ae1aba0e403cb563ffe07624d4..d22ff2ccc972f478228890fdc23949354578f69b 100644
--- a/modules/book/book-all-books-block.tpl.php
+++ b/modules/book/book-all-books-block.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: book-all-books-block.tpl.php,v 1.5 2010/01/30 07:59:24 dries Exp $
 
 /**
  * @file
diff --git a/modules/book/book-export-html.tpl.php b/modules/book/book-export-html.tpl.php
index dffd446b6f800b8639c7ec9baf46fbb7db7dea92..180f3ae7783ff4db419a5f4f2d17d8ae2a14d0d5 100644
--- a/modules/book/book-export-html.tpl.php
+++ b/modules/book/book-export-html.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: book-export-html.tpl.php,v 1.3 2010/10/23 15:35:35 webchick Exp $
 
 /**
  * @file
diff --git a/modules/book/book-navigation.tpl.php b/modules/book/book-navigation.tpl.php
index 1d9dd0806796d0cb45c6a9d60b0208e8e9fab539..e5883dc56ec8eda576784c06a385da2c1ecb5c67 100644
--- a/modules/book/book-navigation.tpl.php
+++ b/modules/book/book-navigation.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: book-navigation.tpl.php,v 1.3 2009/02/18 14:28:21 webchick Exp $
 
 /**
  * @file
diff --git a/modules/book/book-node-export-html.tpl.php b/modules/book/book-node-export-html.tpl.php
index 6a00c6768a7a13598ff357fbdad4c6153cf9a4de..ef6c3224cfb5581f4f046ef79ba55973619c893a 100644
--- a/modules/book/book-node-export-html.tpl.php
+++ b/modules/book/book-node-export-html.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: book-node-export-html.tpl.php,v 1.2 2008/05/15 21:19:24 dries Exp $
 
 /**
  * @file
diff --git a/modules/book/book-rtl.css b/modules/book/book-rtl.css
index a06c4a9dcd7b2170f19e64cef190e1b6f3eb0663..f3a84c20e32f7c2b93b97723e800cece3375bde7 100644
--- a/modules/book/book-rtl.css
+++ b/modules/book/book-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: book-rtl.css,v 1.2 2008/12/19 15:42:26 dries Exp $ */
 
 .book-navigation .menu {
   padding: 1em 3em 0 0;
diff --git a/modules/book/book.admin.inc b/modules/book/book.admin.inc
index 386dfccfd9462baf7d3625bde53d7e62c8b7f981..7b9dea390f5bdc9c66d018b889d41c6d5368bf10 100644
--- a/modules/book/book.admin.inc
+++ b/modules/book/book.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: book.admin.inc,v 1.39 2011/01/03 07:34:46 webchick Exp $
 
 /**
  * @file
diff --git a/modules/book/book.css b/modules/book/book.css
index 42fa885d19daf79134a486d25cad9f03fbbc3abf..a8d2136df0cba6282fb3c881c7973ad1a0124a34 100644
--- a/modules/book/book.css
+++ b/modules/book/book.css
@@ -1,4 +1,3 @@
-/* $Id: book.css,v 1.12 2009/08/24 03:11:34 webchick Exp $ */
 
 .book-navigation .menu {
   border-top: 1px solid #888;
diff --git a/modules/book/book.info b/modules/book/book.info
index 1e05f525ba9c4ae00b12c9f74f9b0718f14ad346..6a7c8d5ec4efff2c555d7d7bc415fe66030ce0ab 100644
--- a/modules/book/book.info
+++ b/modules/book/book.info
@@ -1,4 +1,3 @@
-; $Id: book.info,v 1.15 2010/12/20 19:59:41 webchick Exp $
 name = Book
 description = Allows users to create and organize related content in an outline.
 package = Core
@@ -8,8 +7,8 @@ files[] = book.test
 configure = admin/content/book/settings
 stylesheets[all][] = book.css
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/book/book.install b/modules/book/book.install
index f8782cf1f6c948e269000eddf6204d2873e07516..1bd094c230e55823d4e277a384c296d1a72ecca9 100644
--- a/modules/book/book.install
+++ b/modules/book/book.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: book.install,v 1.36 2010/06/23 19:05:15 dries Exp $
 
 /**
  * @file
diff --git a/modules/book/book.js b/modules/book/book.js
index a7d1b873aa75b0d2408074495eca2a2488eb2bd1..5b953f164ff74c7393a082c90922b530adcaa9a5 100644
--- a/modules/book/book.js
+++ b/modules/book/book.js
@@ -1,4 +1,3 @@
-// $Id: book.js,v 1.8 2010/11/05 19:47:20 dries Exp $
 
 (function ($) {
 
diff --git a/modules/book/book.module b/modules/book/book.module
index 4252f3e9bc1661573f41d99c448be2802e3891fc..de9561fecf1e90dc4134d31fc67d25431431d904 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: book.module,v 1.558 2011/01/03 07:34:46 webchick Exp $
 
 /**
  * @file
@@ -280,10 +279,10 @@ function book_block_view($delta = '') {
   }
   elseif ($current_bid) {
     // Only display this block when the user is browsing a book.
-    $select = db_select('node');
-    $select->addField('node', 'title');
-    $select->condition('nid', $node->book['bid']);
-    $select->addTag('node_access');
+  $select = db_select('node', 'n')
+    ->fields('n', array('title'))
+    ->condition('nid', $node->book['bid'])
+    ->addTag('node_access');
     $title = $select->execute()->fetchField();
     // Only show the block if the user has view access for the top-level node.
     if ($title) {
@@ -419,7 +418,7 @@ function book_form_node_form_alter(&$form, &$form_state, $form_id) {
  * rebuild so that the "Parent item" options are changed to reflect the newly
  * selected book. When JavaScript is enabled, the submit button that triggers
  * this handler is hidden, and the "Book" dropdown directly triggers the
- * book_form_update() AJAX callback instead.
+ * book_form_update() Ajax callback instead.
  *
  * @see book_form_update()
  */
@@ -432,7 +431,7 @@ function book_pick_book_nojs_submit($form, &$form_state) {
  * Build the parent selection form element for the node form or outline tab.
  *
  * This function is also called when generating a new set of options during the
- * AJAX callback, so an array is returned that can be used to replace an existing
+ * Ajax callback, so an array is returned that can be used to replace an existing
  * form element.
  */
 function _book_parent_select($book_link) {
@@ -479,7 +478,7 @@ function _book_parent_select($book_link) {
  * Build the common elements of the book form for the node and outline forms.
  */
 function _book_add_form_elements(&$form, &$form_state, $node) {
-  // If the form is being processed during the AJAX callback of our book bid
+  // If the form is being processed during the Ajax callback of our book bid
   // dropdown, then $form_state will hold the value that was selected.
   if (isset($form_state['values']['book'])) {
     $node->book = $form_state['values']['book'];
@@ -563,7 +562,7 @@ function _book_add_form_elements(&$form, &$form_state, $node) {
 /**
  * Renders a new parent page select element when the book selection changes.
  *
- * This function is called via AJAX when the selected book is changed on a node
+ * This function is called via Ajax when the selected book is changed on a node
  * or book outline form.
  *
  * @return
diff --git a/modules/book/book.pages.inc b/modules/book/book.pages.inc
index 14c8342d715d4e183d0b20ceba9711ed7046ba1e..1617f008503977e66e66e6122444864b9ae4bd9a 100644
--- a/modules/book/book.pages.inc
+++ b/modules/book/book.pages.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: book.pages.inc,v 1.27 2010/07/07 01:07:33 dries Exp $
 
 /**
  * @file
@@ -77,9 +76,11 @@ function book_export_html($nid) {
     if (isset($node->book)) {
       $tree = book_menu_subtree_data($node->book);
       $contents = book_export_traverse($tree, 'book_node_export');
+      return theme('book_export_html', array('title' => $node->title, 'contents' => $contents, 'depth' => $node->book['depth']));
+    }
+    else {
+      drupal_not_found();
     }
-
-    return theme('book_export_html', array('title' => $node->title, 'contents' => $contents, 'depth' => $node->book['depth']));
   }
   else {
     drupal_access_denied();
diff --git a/modules/book/book.test b/modules/book/book.test
index 7f8c8160c85b68a417a7219c1f2ee789dc2eb033..cc61778b9d321f1e4f0b27d14752d4ab7e57dc99 100644
--- a/modules/book/book.test
+++ b/modules/book/book.test
@@ -1,5 +1,9 @@
 <?php
-// $Id: book.test,v 1.28 2010/10/18 05:53:34 webchick Exp $
+
+/**
+ * @file
+ * Tests for book.module.
+ */
 
 class BookTestCase extends DrupalWebTestCase {
   protected $book;
@@ -237,6 +241,10 @@ class BookTestCase extends DrupalWebTestCase {
     $this->drupalGet('book/export/foobar/' . $this->book->nid);
     $this->assertResponse('404', t('Unsupported export format returned "not found".'));
 
+    // Make sure we get a 404 on a not existing book node.
+    $this->drupalGet('book/export/html/123');
+    $this->assertResponse('404', t('Not existing book node returned "not found".'));
+
     // Make sure an anonymous user cannot view printer-friendly version.
     $this->drupalLogout();
 
diff --git a/modules/color/color-rtl.css b/modules/color/color-rtl.css
index beb1b2cc248cd9afcf794b300793811f053bfda5..bfbcd499ff8f12b774b87053fa55f70758462ba5 100644
--- a/modules/color/color-rtl.css
+++ b/modules/color/color-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: color-rtl.css,v 1.4 2010/04/28 20:08:38 dries Exp $ */
 
 #placeholder {
   left: 0;
diff --git a/modules/color/color.css b/modules/color/color.css
index c388d9f361ecb6d3bdab20fc80fe0a0a53011ad0..e513dadf54083053d78fd6937a4cc644ece2592f 100644
--- a/modules/color/color.css
+++ b/modules/color/color.css
@@ -1,4 +1,3 @@
-/* $Id: color.css,v 1.5 2010/04/28 20:08:38 dries Exp $ */
 
 /* Farbtastic placement */
 .color-form {
diff --git a/modules/color/color.info b/modules/color/color.info
index 96a07d6cb4a1b8e903dcd51e43f70de0ca91a514..1ac8728575be80da8cd638dadd6fb1243f49e3da 100644
--- a/modules/color/color.info
+++ b/modules/color/color.info
@@ -1,4 +1,3 @@
-; $Id: color.info,v 1.11 2010/12/20 19:59:41 webchick Exp $
 name = Color
 description = Allows administrators to change the color scheme of compatible themes.
 package = Core
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = color.test
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/color/color.install b/modules/color/color.install
index 83a0780b448189f01578207a64d01332826f1419..b0eb95ef6a57f47f2ce91289e7f01fc8201bbe5a 100644
--- a/modules/color/color.install
+++ b/modules/color/color.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: color.install,v 1.9 2010/11/19 20:37:17 dries Exp $
 
 /**
  * @file
@@ -41,3 +40,18 @@ function color_requirements($phase) {
 
   return $requirements;
 }
+
+/**
+ * Warn site administrator if unsafe CSS color codes are found in the database.
+ */
+function color_update_7001() {
+  $theme_palettes = db_query("SELECT name FROM {variable} WHERE name LIKE 'color_%_palette'")->fetchCol();
+  foreach ($theme_palettes as $name) {
+    $palette = variable_get($name, array());
+    foreach ($palette as $key => $color) {
+      if (!preg_match('/^#([a-f0-9]{3}){1,2}$/iD', $color)) {
+        drupal_set_message('Some of the custom CSS color codes specified via the color module are invalid. Please examine the themes which are making use of the color module at the <a href="'. url('admin/appearance/settings') .'">Appearance settings</a> page to verify their CSS color values.', 'warning');
+      }
+    }
+  }
+}
diff --git a/modules/color/color.js b/modules/color/color.js
index 16515efe498172d916a50d4bf376e94ae4177fea..43099adcabf8304fb33c337633483fe0a8c489f4 100644
--- a/modules/color/color.js
+++ b/modules/color/color.js
@@ -1,4 +1,3 @@
-// $Id: color.js,v 1.18 2010/04/22 05:18:21 webchick Exp $
 (function ($) {
 
 Drupal.behaviors.color = {
diff --git a/modules/color/color.module b/modules/color/color.module
index aa1007c13814a7b5d1121c3c5aac965a66f2ee83..f3fafe7b7e6fbd876b6f1fc022bbf4f1bd515bed 100644
--- a/modules/color/color.module
+++ b/modules/color/color.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: color.module,v 1.92 2010/10/05 19:59:10 dries Exp $
 
 /**
  * Implements hook_help().
@@ -43,6 +42,7 @@ function color_form_system_theme_settings_alter(&$form, &$form_state) {
       '#theme' => 'color_scheme_form',
     );
     $form['color'] += color_scheme_form($form, $form_state, $theme);
+    $form['#validate'][] = 'color_scheme_form_validate';
     $form['#submit'][] = 'color_scheme_form_submit';
   }
 }
@@ -271,6 +271,18 @@ function theme_color_scheme_form($variables) {
   return $output;
 }
 
+/**
+ * Validation handler for color change form.
+ */
+function color_scheme_form_validate($form, &$form_state) {
+  // Only accept hexadecimal CSS color strings to avoid XSS upon use.
+  foreach ($form_state['values']['palette'] as $key => $color) {
+    if (!preg_match('/^#([a-f0-9]{3}){1,2}$/iD', $color)) {
+      form_set_error('palette][' . $key, t('%name must be a valid hexadecimal CSS color value.', array('%name' => $form['color']['palette'][$key]['#title'])));
+    }
+  }
+}
+
 /**
  * Submit handler for color change form.
  */
diff --git a/modules/color/color.test b/modules/color/color.test
index 8f89b4bfc48bd3f2224189687a7427d8c7f48363..1ddfc0647daacb15502f5d815a7bd8d84ba0ccb6 100644
--- a/modules/color/color.test
+++ b/modules/color/color.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: color.test,v 1.8 2010/11/13 14:06:43 dries Exp $
 
 /**
  * @file
diff --git a/modules/color/preview.js b/modules/color/preview.js
index c5e47a08da0ee71a80de1827609aa74a93fe01cc..88ae95fb62c639a64180c04bdeb9b7ad0ec3b37f 100644
--- a/modules/color/preview.js
+++ b/modules/color/preview.js
@@ -1,4 +1,3 @@
-// $Id: preview.js,v 1.2 2010/04/28 20:25:21 dries Exp $
 
 (function ($) {
   Drupal.color = {
diff --git a/modules/comment/comment-node-form.js b/modules/comment/comment-node-form.js
index e8f07b243d033caf21f0cf7915f7946deecd9e33..76db2404ea178fbb74ce51f16567dc30ae63fd78 100644
--- a/modules/comment/comment-node-form.js
+++ b/modules/comment/comment-node-form.js
@@ -1,4 +1,3 @@
-// $Id: comment-node-form.js,v 1.6 2010/11/05 19:47:20 dries Exp $
 
 (function ($) {
 
diff --git a/modules/comment/comment-rtl.css b/modules/comment/comment-rtl.css
index c40a859b7a16b1bc0aaf7ce7ea29a359addb26a7..39c3929651d6e552f9cbf6508907132f5b76282d 100644
--- a/modules/comment/comment-rtl.css
+++ b/modules/comment/comment-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: comment-rtl.css,v 1.2 2007/11/27 12:09:25 goba Exp $ */
 
 .indented {
   margin-left: 0;
diff --git a/modules/comment/comment-wrapper.tpl.php b/modules/comment/comment-wrapper.tpl.php
index d17205cae7ca994580d0e673b1a98779aa096cbe..3293e88aec01167748018f1fd8db9115ea93fc75 100644
--- a/modules/comment/comment-wrapper.tpl.php
+++ b/modules/comment/comment-wrapper.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: comment-wrapper.tpl.php,v 1.10 2010/05/05 06:41:22 webchick Exp $
 
 /**
  * @file
diff --git a/modules/comment/comment.admin.inc b/modules/comment/comment.admin.inc
index 91ce977b8cd07b92dc944b233362588fe4a4626e..4f3d35071536658cda832478b20f6d99ffe2a5ef 100644
--- a/modules/comment/comment.admin.inc
+++ b/modules/comment/comment.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: comment.admin.inc,v 1.53 2011/01/03 05:18:42 webchick Exp $
 
 /**
  * @file
diff --git a/modules/comment/comment.api.php b/modules/comment/comment.api.php
index 648088dd6dcc87eab79a729b4bcb3a2ff432ecee..05912655b1e60cfe28941ddb5143369f863fe43c 100644
--- a/modules/comment/comment.api.php
+++ b/modules/comment/comment.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: comment.api.php,v 1.18 2010/10/23 15:30:34 webchick Exp $
 
 /**
  * @file
diff --git a/modules/comment/comment.css b/modules/comment/comment.css
index d316cba819a1920a889a510e72f250dda9574388..4a2675af858c04ae796d8809983566117a098be0 100644
--- a/modules/comment/comment.css
+++ b/modules/comment/comment.css
@@ -1,4 +1,3 @@
-/* $Id: comment.css,v 1.5 2008/12/31 12:02:21 dries Exp $ */
 
 #comments {
   margin-top: 15px;
diff --git a/modules/comment/comment.info b/modules/comment/comment.info
index aceac3b1d2dfe8f00484bbe39b96f46bef0097a8..85847e6f57e69ba794b433aad5ddd4b5f9dd20e5 100644
--- a/modules/comment/comment.info
+++ b/modules/comment/comment.info
@@ -1,4 +1,3 @@
-; $Id: comment.info,v 1.15 2010/12/20 19:59:41 webchick Exp $
 name = Comment
 description = Allows users to comment on and discuss published content.
 package = Core
@@ -10,8 +9,8 @@ files[] = comment.test
 configure = admin/content/comment
 stylesheets[all][] = comment.css
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/comment/comment.install b/modules/comment/comment.install
index 7959e79d37df90ae06e5c0c2e325090123e40a5c..d64b3acde6223a76b8f4eec81e6ec3949d2111b4 100644
--- a/modules/comment/comment.install
+++ b/modules/comment/comment.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: comment.install,v 1.76 2011/01/02 17:26:39 webchick Exp $
 
 /**
  * @file
@@ -337,6 +336,33 @@ function comment_update_7006(&$sandbox) {
   }
 }
 
+/**
+ * Add an index to the created column.
+ */
+function comment_update_7007() {
+  db_add_index('comment', 'comment_created', array('created'));
+}
+
+/**
+ * Update database to match Drupal 7 schema.
+ */
+function comment_update_7008() {
+  // Update default status to 1.
+  db_change_field('comment', 'status', 'status', array(
+    'type' => 'int',
+    'unsigned' => TRUE,
+    'not null' => TRUE,
+    'default' => 1,
+    'size' => 'tiny',
+  ));
+
+  // Realign indexes.
+  db_drop_index('comment', 'comment_status_pid');
+  db_add_index('comment', 'comment_status_pid', array('pid', 'status'));
+  db_drop_index('comment', 'comment_pid_status');
+  db_drop_index('comment', 'nid');
+}
+
 /**
  * @} End of "addtogroup updates-6.x-to-7.x"
  */
@@ -442,6 +468,7 @@ function comment_schema() {
       'comment_num_new' => array('nid', 'status', 'created', 'cid', 'thread'),
       'comment_uid' => array('uid'),
       'comment_nid_language' => array('nid', 'language'),
+      'comment_created' => array('created'),
     ),
     'primary key' => array('cid'),
     'foreign keys' => array(
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index c295179a35a05fd2f1e3d2e01f4c6cc438b39b03..4a737557d986eb96752ae1ae3efbdfc3b550ce96 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: comment.module,v 1.931 2011/01/02 23:54:05 webchick Exp $
 
 /**
  * @file
@@ -495,6 +494,7 @@ function comment_permalink($cid) {
  *
  * @param integer $number
  *   (optional) The maximum number of comments to find. Defaults to 10.
+ *
  * @return
  *   An array of comment objects or an empty array if there are no recent
  *   comments visible to the current user.
@@ -502,15 +502,12 @@ function comment_permalink($cid) {
 function comment_get_recent($number = 10) {
   $query = db_select('comment', 'c');
   $query->innerJoin('node', 'n', 'n.nid = c.nid');
-  $query->innerJoin('node_comment_statistics', 'ncs', 'ncs.nid = c.nid');
   $query->addTag('node_access');
   $comments = $query
     ->fields('c')
-    ->condition('ncs.comment_count', 0, '>')
     ->condition('c.status', COMMENT_PUBLISHED)
     ->condition('n.status', NODE_PUBLISHED)
-    ->orderBy('ncs.last_comment_timestamp', 'DESC')
-    ->orderBy('c.cid', 'DESC')
+    ->orderBy('c.created', 'DESC')
     ->range(0, $number)
     ->execute()
     ->fetchAll();
@@ -989,8 +986,8 @@ function comment_build_content($comment, $node, $view_mode = 'full', $langcode =
   $comment->content = array();
 
   // Build fields content.
-  field_attach_prepare_view('comment', array($comment->cid => $comment), $view_mode);
-  entity_prepare_view('comment', array($comment->cid => $comment));
+  field_attach_prepare_view('comment', array($comment->cid => $comment), $view_mode, $langcode);
+  entity_prepare_view('comment', array($comment->cid => $comment), $langcode);
   $comment->content += field_attach_view('comment', $comment, $view_mode, $langcode);
 
   $comment->content['links'] = array(
@@ -1092,8 +1089,8 @@ function comment_links($comment, $node) {
  *   An array in the format expected by drupal_render().
  */
 function comment_view_multiple($comments, $node, $view_mode = 'full', $weight = 0, $langcode = NULL) {
-  field_attach_prepare_view('comment', $comments, $view_mode);
-  entity_prepare_view('comment', $comments);
+  field_attach_prepare_view('comment', $comments, $view_mode, $langcode);
+  entity_prepare_view('comment', $comments, $langcode);
 
   $build = array(
     '#sorted' => TRUE,
@@ -1406,15 +1403,15 @@ function comment_user_delete($account) {
 }
 
 /**
- * This is *not* a hook_access() implementation. This function is called
- * to determine whether the current user has access to a particular comment.
+ * Determines whether the current user has access to a particular comment.
  *
  * Authenticated users can edit their comments as long they have not been
- * replied to. This prevents people from changing or revising their
- * statements based on the replies to their posts.
+ * replied to. This prevents people from changing or revising their statements
+ * based on the replies to their posts.
  *
  * @param $op
- *   The operation that is to be performed on the comment. Only 'edit' is recognized now.
+ *   The operation that is to be performed on the comment. Only 'edit' is
+ *   recognized now.
  * @param $comment
  *   The comment object.
  * @return
@@ -1468,28 +1465,15 @@ function comment_save($comment) {
     module_invoke_all('entity_presave', $comment, 'comment');
 
     if ($comment->cid) {
-      // Update the comment in the database.
-      db_update('comment')
-        ->fields(array(
-          'status' => $comment->status,
-          'created' => $comment->created,
-          'changed' => $comment->changed,
-          'subject' => $comment->subject,
-          'uid' => $comment->uid,
-          'name' => $comment->name,
-          'mail' => $comment->mail,
-          'homepage' => $comment->homepage,
-          'language' => $comment->language,
-        ))
-        ->condition('cid', $comment->cid)
-        ->execute();
+
+      drupal_write_record('comment', $comment, 'cid');
 
       // Ignore slave server temporarily to give time for the
       // saved comment to be propagated to the slave.
       db_ignore_slave();
 
       // Update the {node_comment_statistics} table prior to executing hooks.
-       _comment_update_node_statistics($comment->nid);
+      _comment_update_node_statistics($comment->nid);
 
       field_attach_update('comment', $comment);
       // Allow modules to respond to the updating of a comment.
@@ -1554,23 +1538,16 @@ function comment_save($comment) {
         $comment->name = $user->name;
       }
 
-      $comment->cid = db_insert('comment')
-        ->fields(array(
-          'nid' => $comment->nid,
-          'pid' => empty($comment->pid) ? 0 : $comment->pid,
-          'uid' => $comment->uid,
-          'subject' => $comment->subject,
-          'hostname' => ip_address(),
-          'created' => $comment->created,
-          'changed' => $comment->changed,
-          'status' => $comment->status,
-          'thread' => $thread,
-          'name' => $comment->name,
-          'mail' => $comment->mail,
-          'homepage' => $comment->homepage,
-          'language' => $comment->language,
-        ))
-        ->execute();
+      // Ensure the parent id (pid) has a value set.
+      if (empty($comment->pid)) {
+        $comment->pid = 0;
+      }
+
+      // Add the values which aren't passed into the function.
+      $comment->thread = $thread;
+      $comment->hostname = ip_address();
+
+      drupal_write_record('comment', $comment);
 
       // Ignore slave server temporarily to give time for the
       // created comment to be propagated to the slave.
@@ -1929,11 +1906,9 @@ function comment_form($form, &$form_state, $comment) {
       '#default_value' => $author,
       '#maxlength' => 60,
       '#size' => 30,
+      '#description' => t('Leave blank for %anonymous.', array('%anonymous' => variable_get('anonymous', t('Anonymous')))),
+      '#autocomplete_path' => 'user/autocomplete',
     );
-    // If the comment is by a registered user, allow to autocomplete username.
-    if ($comment->registered_name != '') {
-      $form['author']['name']['#autocomplete_path'] = 'user/autocomplete';
-    }
   }
   elseif ($user->uid) {
     $form['author']['_author'] = array(
@@ -2114,18 +2089,21 @@ function comment_form_validate($form, &$form_state) {
   entity_form_field_validate('comment', $form, $form_state);
 
   if (!empty($form_state['values']['cid'])) {
+    // Verify the name in case it is being changed from being anonymous.
+    $account = user_load_by_name($form_state['values']['name']);
+    $form_state['values']['uid'] = $account ? $account->uid : 0;
+
     if ($form_state['values']['date'] && strtotime($form_state['values']['date']) === FALSE) {
       form_set_error('date', t('You have to specify a valid date.'));
     }
-    if ($form_state['values']['name'] && !$form_state['values']['is_anonymous'] && !$account = user_load_by_name($form_state['values']['name'])) {
+    if ($form_state['values']['name'] && !$form_state['values']['is_anonymous'] && !$account) {
       form_set_error('name', t('You have to specify a valid author.'));
     }
   }
-
-  // Validate anonymous comment author fields (if given).
-  if ($form_state['values']['is_anonymous']) {
-    // If the (original) author of this comment was an anonymous user, verify
-    // that no registered user with this name exists.
+  elseif ($form_state['values']['is_anonymous']) {
+    // Validate anonymous comment author fields (if given). If the (original)
+    // author of this comment was an anonymous user, verify that no registered
+    // user with this name exists.
     if ($form_state['values']['name']) {
       $query = db_select('users', 'u');
       $query->addField('u', 'uid', 'uid');
@@ -2216,7 +2194,7 @@ function comment_form_submit($form, &$form_state) {
   $comment = comment_form_submit_build_comment($form, $form_state);
   if (user_access('post comments') && (user_access('administer comments') || $node->comment == COMMENT_NODE_OPEN)) {
     // Save the anonymous user information to a cookie for reuse.
-    if (!$comment->uid) {
+    if (user_is_anonymous()) {
       user_cookie_save(array_intersect_key($form_state['values'], array_flip(array('name', 'mail', 'homepage'))));
     }
 
diff --git a/modules/comment/comment.pages.inc b/modules/comment/comment.pages.inc
index 791974e56144e2e1168f52724888110e4e7d0ef6..7e88bffcb52d0ce6c2657b02c14e45a5e5641301 100644
--- a/modules/comment/comment.pages.inc
+++ b/modules/comment/comment.pages.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: comment.pages.inc,v 1.41 2011/01/02 23:54:05 webchick Exp $
 
 /**
  * @file
diff --git a/modules/comment/comment.test b/modules/comment/comment.test
index 8e3a92ff36e5fe5d5d73bd9288cf13f791b2e541..770e01d4a5fe49f1ab92f7e62f246ea3a3bf855b 100644
--- a/modules/comment/comment.test
+++ b/modules/comment/comment.test
@@ -1,5 +1,9 @@
 <?php
-// $Id: comment.test,v 1.98 2011/01/02 23:54:05 webchick Exp $
+
+/**
+ * @file 
+ * Tests for comment.module.
+ */
 
 class CommentHelperCase extends DrupalWebTestCase {
   protected $admin_user;
@@ -303,6 +307,26 @@ class CommentInterfaceTest extends CommentHelperCase {
     $this->drupalLogin($this->admin_user);
     $this->setCommentSubject(TRUE);
     $this->setCommentPreview(DRUPAL_OPTIONAL);
+
+    // Test changing the comment author to "Anonymous".
+    $this->drupalGet('comment/' . $comment->id . '/edit');
+    $comment = $this->postComment(NULL, $comment->comment, $comment->subject, array('name' => ''));
+    $comment_loaded = comment_load($comment->id);
+    $this->assertTrue(empty($comment_loaded->name) && $comment_loaded->uid == 0, t('Comment author successfully changed to anonymous.'));
+
+    // Test changing the comment author to an unverified user.
+    $random_name = $this->randomName();
+    $this->drupalGet('comment/' . $comment->id . '/edit');
+    $comment = $this->postComment(NULL, $comment->comment, $comment->subject, array('name' => $random_name));
+    $this->drupalGet('node/' . $this->node->nid);
+    $this->assertText($random_name . ' (' . t('not verified') . ')', t('Comment author successfully changed to an unverified user.'));
+
+    // Test changing the comment author to a verified user.
+    $this->drupalGet('comment/' . $comment->id . '/edit');
+    $comment = $this->postComment(NULL, $comment->comment, $comment->subject, array('name' => $this->web_user->name));
+    $comment_loaded = comment_load($comment->id);
+    $this->assertTrue($comment_loaded->name == $this->web_user->name && $comment_loaded->uid == $this->web_user->uid, t('Comment author successfully changed to a registered user.'));
+
     $this->drupalLogout();
 
     // Reply to comment #2 creating comment #3 with optional preview and no
@@ -1694,7 +1718,7 @@ class CommentTokenReplaceTestCase extends CommentHelperCase {
 
     foreach ($tests as $input => $expected) {
       $output = token_replace($input, array('comment' => $comment), array('language' => $language));
-      $this->assertFalse(strcmp($output, $expected), t('Sanitized comment token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, t('Sanitized comment token %token replaced.', array('%token' => $input)));
     }
 
     // Generate and test unsanitized tokens.
@@ -1710,7 +1734,7 @@ class CommentTokenReplaceTestCase extends CommentHelperCase {
 
     foreach ($tests as $input => $expected) {
       $output = token_replace($input, array('comment' => $comment), array('language' => $language, 'sanitize' => FALSE));
-      $this->assertFalse(strcmp($output, $expected), t('Unsanitized comment token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, t('Unsanitized comment token %token replaced.', array('%token' => $input)));
     }
 
     // Load node so comment_count gets computed.
@@ -1723,7 +1747,7 @@ class CommentTokenReplaceTestCase extends CommentHelperCase {
 
     foreach ($tests as $input => $expected) {
       $output = token_replace($input, array('node' => $node), array('language' => $language));
-      $this->assertFalse(strcmp($output, $expected), t('Node comment token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, t('Node comment token %token replaced.', array('%token' => $input)));
     }
   }
 }
diff --git a/modules/comment/comment.tokens.inc b/modules/comment/comment.tokens.inc
index 02e8b96301e74182ded12f511938cf563b400e35..d62b7e2f8f05971cd8476118f80c224bd4da1cda 100644
--- a/modules/comment/comment.tokens.inc
+++ b/modules/comment/comment.tokens.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: comment.tokens.inc,v 1.13 2010/07/07 17:00:42 webchick Exp $
 
 /**
  * @file
diff --git a/modules/comment/comment.tpl.php b/modules/comment/comment.tpl.php
index 3ef3858239841217431e43b49ef045f13d571f11..a483813d236101fa59fdc55f4356379717eefda4 100644
--- a/modules/comment/comment.tpl.php
+++ b/modules/comment/comment.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: comment.tpl.php,v 1.19 2010/12/01 00:18:15 webchick Exp $
 
 /**
  * @file
diff --git a/modules/contact/contact.admin.inc b/modules/contact/contact.admin.inc
index 477a20ce457692b27146eb3253829cf242ea0c1c..9fde037d3454c7ccecea41c69bdd6ac795725b48 100644
--- a/modules/contact/contact.admin.inc
+++ b/modules/contact/contact.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: contact.admin.inc,v 1.24 2010/04/24 14:49:13 dries Exp $
 
 /**
  * @file
diff --git a/modules/contact/contact.info b/modules/contact/contact.info
index f44e025e4e4f2079da8300556a8e9ddbb3f8c080..25cee4947422a748fd989ea2eb9bb0eef337b3c3 100644
--- a/modules/contact/contact.info
+++ b/modules/contact/contact.info
@@ -1,4 +1,3 @@
-; $Id: contact.info,v 1.11 2010/12/20 19:59:41 webchick Exp $
 name = Contact
 description = Enables the use of both personal and site-wide contact forms.
 package = Core
@@ -7,8 +6,8 @@ core = 7.x
 files[] = contact.test
 configure = admin/structure/contact
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/contact/contact.install b/modules/contact/contact.install
index c0e570c33c68eccee0b5bb4d76acbead73a2270d..6e8ec70534ea39adcce8a27842e1edbcdaff02cf 100644
--- a/modules/contact/contact.install
+++ b/modules/contact/contact.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: contact.install,v 1.26 2011/01/02 17:26:39 webchick Exp $
 
 /**
  * @file
diff --git a/modules/contact/contact.module b/modules/contact/contact.module
index 7ecaa671ee0c03c77a5b605f0abf1260fbe9e581..eaae9c62c68988a5ff85abdcfd0e831011542eca 100644
--- a/modules/contact/contact.module
+++ b/modules/contact/contact.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: contact.module,v 1.150 2010/12/20 19:59:41 webchick Exp $
 
 /**
  * @file
diff --git a/modules/contact/contact.pages.inc b/modules/contact/contact.pages.inc
index 21076e906d7ce01a66c7754e6a1b82ce1c3c2472..30b2825045fc6f5a8f3ecc85276f4d5a4497d214 100644
--- a/modules/contact/contact.pages.inc
+++ b/modules/contact/contact.pages.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: contact.pages.inc,v 1.45 2010/11/30 17:16:37 dries Exp $
 
 /**
  * @file
diff --git a/modules/contact/contact.test b/modules/contact/contact.test
index b758a083c4d04f33c589613458bdeeffd0ddd34d..bc44f5a04339843f5e786eb4e5a464a4b633b940 100644
--- a/modules/contact/contact.test
+++ b/modules/contact/contact.test
@@ -1,9 +1,10 @@
 <?php
-// $Id: contact.test,v 1.45 2010/08/05 23:53:37 webchick Exp $
 
 /**
- * Test the sitewide contact form.
+ * @file 
+ * Tests for contact.module.
  */
+
 class ContactSitewideTestCase extends DrupalWebTestCase {
   public static function getInfo() {
     return array(
diff --git a/modules/contextual/contextual-rtl.css b/modules/contextual/contextual-rtl.css
index bf044a344bf4cd2b10a891164f328f41d189ac43..96ffef5cc239b8203be5330ba7b183ebf437509e 100644
--- a/modules/contextual/contextual-rtl.css
+++ b/modules/contextual/contextual-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: contextual-rtl.css,v 1.1 2010/06/04 20:38:55 dries Exp $ */
 
 div.contextual-links-wrapper {
   left: 5px;
diff --git a/modules/contextual/contextual.api.php b/modules/contextual/contextual.api.php
index 6670322acbb7aa3834dbb74a00f51c73b843c6d6..e8f33ee0b6c997390ed93a2c1660c9d26a28d12a 100644
--- a/modules/contextual/contextual.api.php
+++ b/modules/contextual/contextual.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: contextual.api.php,v 1.1 2010/09/11 14:35:13 dries Exp $
 
 /**
  * @file
diff --git a/modules/contextual/contextual.css b/modules/contextual/contextual.css
index 875fb5d6a76dcdb024d0518f3cfce175fe492986..e49eb3755b9d77941e99a9a9295df2b2357715be 100644
--- a/modules/contextual/contextual.css
+++ b/modules/contextual/contextual.css
@@ -1,4 +1,3 @@
-/* $Id: contextual.css,v 1.9 2011/01/03 07:04:48 webchick Exp $ */
 
 /**
  * Contextual links regions.
diff --git a/modules/contextual/contextual.info b/modules/contextual/contextual.info
index a4678d97c9cf7c0521db6630d36d670171ee4440..e279fd293672fcd6ae33e30a2a7054c0d6a57352 100644
--- a/modules/contextual/contextual.info
+++ b/modules/contextual/contextual.info
@@ -1,12 +1,11 @@
-; $Id: contextual.info,v 1.2 2010/12/20 19:59:41 webchick Exp $
 name = Contextual links
 description = Provides contextual links to perform actions related to elements on a page.
 package = Core
 version = VERSION
 core = 7.x
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/contextual/contextual.js b/modules/contextual/contextual.js
index 59d5b0b8210dab54b3f373457280984779f541b0..ee5b7a0545a1c8acf9c8a0074932c72e05b38e8f 100644
--- a/modules/contextual/contextual.js
+++ b/modules/contextual/contextual.js
@@ -1,4 +1,3 @@
-// $Id: contextual.js,v 1.6 2010/11/16 18:43:06 dries Exp $
 (function ($) {
 
 Drupal.contextualLinks = Drupal.contextualLinks || {};
diff --git a/modules/contextual/contextual.module b/modules/contextual/contextual.module
index 8ed4d93aa5fef7a3724668edcbaccaa8a372eaef..0d6b625e7268036dd539d75846580d2e51f52158 100644
--- a/modules/contextual/contextual.module
+++ b/modules/contextual/contextual.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: contextual.module,v 1.9 2010/10/31 03:56:46 dries Exp $
 
 /**
  * @file
diff --git a/modules/dashboard/dashboard-rtl.css b/modules/dashboard/dashboard-rtl.css
new file mode 100644
index 0000000000000000000000000000000000000000..2ab5381879f68793c01bd28f1d8f60901e06fca6
--- /dev/null
+++ b/modules/dashboard/dashboard-rtl.css
@@ -0,0 +1,27 @@
+/* $Id */
+
+#dashboard div.dashboard-region {
+  float: right;
+}
+#dashboard #disabled-blocks .block, #dashboard .block-placeholder {
+  float: right;
+  margin: 3px 0 3px 3px;
+  padding: 6px 8px 6px 4px;
+}
+#dashboard .canvas-content a.button {
+  margin: 0 10px 0 0;
+}
+#dashboard .ui-sortable .block h2 {
+  background-position: right -39px;
+  padding: 0 19px;
+}
+#dashboard.customize-inactive #disabled-blocks .block:hover h2 {
+  background-position: right -39px;
+}
+#dashboard.customize-inactive .dashboard-region .ui-sortable .block:hover h2 {
+  background-position: right -36px;
+}
+#dashboard div#dashboard_main {
+  margin-left: 1%;
+  margin-right: 0;
+}
diff --git a/modules/dashboard/dashboard.api.php b/modules/dashboard/dashboard.api.php
index 9663b66115155d54208dab7a4d9d73a6a9fd8040..00bfde5a30af7eeec75fdda5d9eb90b1246acf45 100644
--- a/modules/dashboard/dashboard.api.php
+++ b/modules/dashboard/dashboard.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: dashboard.api.php,v 1.1 2009/10/18 11:20:26 dries Exp $
 
 /**
  * @file
diff --git a/modules/dashboard/dashboard.css b/modules/dashboard/dashboard.css
index f1c0fcfc2055078aef528619137f490b54cec067..db9243c6198441704239cb0887a93daf4915c342 100644
--- a/modules/dashboard/dashboard.css
+++ b/modules/dashboard/dashboard.css
@@ -1,4 +1,3 @@
-/* $Id: dashboard.css,v 1.16 2011/01/03 07:04:48 webchick Exp $ */
 
 #dashboard div.dashboard-region {
   float: left;
@@ -7,7 +6,7 @@
 
 #dashboard div#dashboard_main {
   width: 65%;
-  margin-right: 1%;
+  margin-right: 1%; /* LTR */
 }
 
 #dashboard div#dashboard_sidebar {
@@ -29,9 +28,9 @@
 #dashboard #disabled-blocks .block,
 #dashboard .block-placeholder {
   background: #e2e1dc;
-  padding: 6px 4px 6px 8px;
-  margin: 3px 3px 3px 0;
-  float: left;
+  padding: 6px 4px 6px 8px; /* LTR */
+  margin: 3px 3px 3px 0; /* LTR */
+  float: left; /* LTR */
   -moz-border-radius: 4px;
   -webkit-border-radius: 4px;
   border-radius: 4px;
@@ -57,7 +56,7 @@
 }
 
 #dashboard .canvas-content a.button {
-  margin: 0 0 0 10px;
+  margin: 0 0 0 10px; /* LTR */
   color: #5a5a5a;
   text-decoration: none;
 }
diff --git a/modules/dashboard/dashboard.info b/modules/dashboard/dashboard.info
index ac7c950974bb7f8ed4c8dff9671406e5a75f51c3..3b12f5277d5062a2bc23cf11765c5ec11da90d62 100644
--- a/modules/dashboard/dashboard.info
+++ b/modules/dashboard/dashboard.info
@@ -1,4 +1,3 @@
-; $Id: dashboard.info,v 1.5 2010/12/20 19:59:41 webchick Exp $
 name = Dashboard
 description = Provides a dashboard page in the administrative interface for organizing administrative tasks and tracking information within your site.
 core = 7.x
@@ -8,8 +7,8 @@ files[] = dashboard.test
 dependencies[] = block
 configure = admin/dashboard/customize
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/dashboard/dashboard.install b/modules/dashboard/dashboard.install
index ab0e6dcb68b7483a0dd2fd46930d71e29d64c689..5021826252324285fe435b4c8c39eac686458b15 100644
--- a/modules/dashboard/dashboard.install
+++ b/modules/dashboard/dashboard.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: dashboard.install,v 1.1 2010/11/01 00:44:31 webchick Exp $
 
 /**
  * @file
diff --git a/modules/dashboard/dashboard.js b/modules/dashboard/dashboard.js
index 7a309c2cfb07b26993da1a9b0052cd478622e90a..ebecbf65a4459a3e214307168b9352d355af6663 100644
--- a/modules/dashboard/dashboard.js
+++ b/modules/dashboard/dashboard.js
@@ -1,4 +1,3 @@
-// $Id: dashboard.js,v 1.13 2010/06/08 05:16:29 webchick Exp $
 (function ($) {
 
 /**
diff --git a/modules/dashboard/dashboard.module b/modules/dashboard/dashboard.module
index d1e3582e388f8d12764b942c4e71b0f7d8dc67d6..08a4cd2b765930db94a7eee9a90bca3062393ee3 100644
--- a/modules/dashboard/dashboard.module
+++ b/modules/dashboard/dashboard.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: dashboard.module,v 1.41 2010/11/06 23:24:33 webchick Exp $
 
 /**
  * Implements hook_help().
@@ -82,6 +81,9 @@ function dashboard_permission() {
   return array(
     'access dashboard' => array(
       'title' => t('View the administrative dashboard'),
+      // Note: We translate the 'Administer blocks' permission string here with
+      // a separate t() call, to make sure it gets the same translation as when
+      // it's in block_permission().
       'description' => t('Customizing the dashboard requires the !permission-name permission.', array(
         '!permission-name' => l(t('Administer blocks'), 'admin/people/permissions', array('fragment' => 'module-block')),
       )),
@@ -483,7 +485,7 @@ function dashboard_dashboard_regions() {
 }
 
 /**
- * AJAX callback to show disabled blocks in the dashboard customization mode.
+ * Ajax callback to show disabled blocks in the dashboard customization mode.
  */
 function dashboard_show_disabled() {
   global $theme_key;
@@ -504,7 +506,7 @@ function dashboard_show_disabled() {
 }
 
 /**
- * AJAX callback to display the rendered contents of a specific block.
+ * Ajax callback to display the rendered contents of a specific block.
  *
  * @param $module
  *   The block's module name.
diff --git a/modules/dashboard/dashboard.test b/modules/dashboard/dashboard.test
index e9b1283249dc3ad93763183b02523f1b4d09b440..7cb93f9f17ff99c8ceafcaa4bfe6d1ad25ccbdf8 100644
--- a/modules/dashboard/dashboard.test
+++ b/modules/dashboard/dashboard.test
@@ -1,9 +1,8 @@
 <?php
-// $Id: dashboard.test,v 1.8 2010/11/06 23:24:33 webchick Exp $
 
 /**
  * @file
- * Tests for the dashboard module.
+ * Tests for dashboard.module.
  */
 
 class DashboardBlocksTestCase extends DrupalWebTestCase {
diff --git a/modules/dblog/dblog-rtl.css b/modules/dblog/dblog-rtl.css
index 40415c7c62eefd90eb1c245b93c26c9ee7c43a48..282fe971ddc3dde27a1121c5a3da8a3ada438563 100644
--- a/modules/dblog/dblog-rtl.css
+++ b/modules/dblog/dblog-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: dblog-rtl.css,v 1.6 2010/04/28 20:08:38 dries Exp $ */
 
 .form-item-type,
 .form-item-severity {
diff --git a/modules/dblog/dblog.admin.inc b/modules/dblog/dblog.admin.inc
index 048a7df1268abdb9a83367f0d8f3556c6aacb24a..947100daa6cf56099f295d607949a1dc4c54beae 100644
--- a/modules/dblog/dblog.admin.inc
+++ b/modules/dblog/dblog.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: dblog.admin.inc,v 1.42 2010/12/04 01:52:15 webchick Exp $
 
 /**
  * @file
@@ -286,7 +285,7 @@ function dblog_filter_form($form) {
     '#type' => 'fieldset',
     '#title' => t('Filter log messages'),
     '#collapsible' => TRUE,
-    '#collapsed' => empty($session),
+    '#collapsed' => empty($_SESSION['dblog_overview_filter']),
   );
   foreach ($filters as $key => $filter) {
     $form['filters']['status'][$key] = array(
diff --git a/modules/dblog/dblog.css b/modules/dblog/dblog.css
index e28e4956dda96e899c6f9c6fc96f7dc08f488eae..ff310e3baa20e38d13b59332bd9b491ae1a0e8f0 100644
--- a/modules/dblog/dblog.css
+++ b/modules/dblog/dblog.css
@@ -1,4 +1,3 @@
-/* $Id: dblog.css,v 1.10 2010/09/09 15:47:03 webchick Exp $ */
 
 .form-item-type,
 .form-item-severity {
diff --git a/modules/dblog/dblog.info b/modules/dblog/dblog.info
index bcdad9180366f62134ab1720ffc2ab381a43687a..85c90aeeecc959bb47bd837b2bdcde7e0076d85c 100644
--- a/modules/dblog/dblog.info
+++ b/modules/dblog/dblog.info
@@ -1,4 +1,3 @@
-; $Id: dblog.info,v 1.8 2010/12/20 19:59:41 webchick Exp $
 name = Database logging
 description = Logs and records system events to the database.
 package = Core
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = dblog.test
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/dblog/dblog.install b/modules/dblog/dblog.install
index 279993e7cb9ed1c95e71966e865023cafd6c66c8..759c7bc1a8dc27e507e3942cd2b245bb654356cf 100644
--- a/modules/dblog/dblog.install
+++ b/modules/dblog/dblog.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: dblog.install,v 1.24 2011/01/02 17:26:39 webchick Exp $
 
 /**
  * @file
@@ -92,6 +91,13 @@ function dblog_schema() {
   return $schema;
 }
 
+/**
+ * Implements hook_uninstall().
+ */
+function dblog_uninstall() {
+  variable_del('dblog_row_limit');
+}
+
 /**
  * @addtogroup updates-6.x-to-7.x
  * @{
diff --git a/modules/dblog/dblog.module b/modules/dblog/dblog.module
index d0e0c40ba4926bb9bd98f061cbe28d7da2a4b7c5..496a043a76a61b0211da64a5a6e630c8a4327b71 100644
--- a/modules/dblog/dblog.module
+++ b/modules/dblog/dblog.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: dblog.module,v 1.57 2010/10/03 02:14:23 dries Exp $
 
 /**
  * @file
@@ -139,9 +138,12 @@ function _dblog_get_message_types() {
  * Note some values may be truncated for database column size restrictions.
  */
 function dblog_watchdog(array $log_entry) {
+  // The user object may not exist in all conditions, so 0 is substituted if needed.
+  $user_uid = isset($log_entry['user']->uid) ? $log_entry['user']->uid : 0;
+
   Database::getConnection('default', 'default')->insert('watchdog')
     ->fields(array(
-      'uid' => $log_entry['user']->uid,
+      'uid' => $user_uid,
       'type' => substr($log_entry['type'], 0, 64),
       'message' => $log_entry['message'],
       'variables' => serialize($log_entry['variables']),
diff --git a/modules/dblog/dblog.test b/modules/dblog/dblog.test
index 019f0194b237756c3521ae3ccfed9908052c0e83..5717455ef8f464d9f582791d57b92c7ae974b786 100644
--- a/modules/dblog/dblog.test
+++ b/modules/dblog/dblog.test
@@ -1,5 +1,9 @@
 <?php
-// $Id: dblog.test,v 1.40 2010/12/04 01:52:15 webchick Exp $
+
+/**
+ * @file
+ * Tests for dblog.module.
+ */
 
 class DBLogTestCase extends DrupalWebTestCase {
   protected $big_user;
diff --git a/modules/field/field.api.php b/modules/field/field.api.php
index 103be8b4ff7eeb6d91b7c097112fce14c564dfc5..9c52d24ef6a756d08b117b168dbadf4dbc167a05 100644
--- a/modules/field/field.api.php
+++ b/modules/field/field.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: field.api.php,v 1.101 2010/12/14 19:50:05 dries Exp $
 
 /**
  * @ingroup field_fieldable_type
@@ -16,7 +15,7 @@
  *
  * Fieldable entities or modules that want to have their components supported
  * should expose them using this hook. The user-defined settings (weight,
- * visibility) are automatically applied on rendered forms and displayed
+ * visible) are automatically applied on rendered forms and displayed
  * entities in a #pre_render callback added by field_attach_form() and
  * field_attach_view().
  *
@@ -758,7 +757,7 @@ function hook_field_widget_info_alter(&$info) {
 /**
  * Return the form for a single field widget.
  *
- * Field widget form elements should be based on the passed in $element, which
+ * Field widget form elements should be based on the passed-in $element, which
  * contains the base form element properties derived from the field
  * configuration.
  *
@@ -1271,7 +1270,7 @@ function hook_field_attach_delete_revision($entity_type, $entity) {
  */
 function hook_field_attach_purge($entity_type, $entity, $field, $instance) {
   // find the corresponding data in mymodule and purge it
-  if($entity_type == 'node' && $field->field_name == 'my_field_name') {
+  if ($entity_type == 'node' && $field->field_name == 'my_field_name') {
     mymodule_remove_mydata($entity->nid);
   }
 }
@@ -1319,7 +1318,7 @@ function hook_field_attach_view_alter(&$output, $context) {
  *
  * This hook is invoked after the field module has performed the operation.
  *
- * @param &$entity
+ * @param $entity
  *   The entity being prepared for translation.
  * @param $context
  *   An associative array containing:
@@ -1362,7 +1361,7 @@ function hook_field_language_alter(&$display_language, $context) {
  * This hook is invoked from field_available_languages() to allow modules to
  * alter the array of available languages for the given field.
  *
- * @param &$languages
+ * @param $languages
  *   A reference to an array of language codes to be made available.
  * @param $context
  *   An associative array containing:
@@ -2205,7 +2204,7 @@ function hook_field_display_ENTITY_TYPE_alter(&$display, $context) {
  */
 function hook_field_extra_fields_display_alter(&$displays, $context) {
   if ($context['entity_type'] == 'taxonomy_term' && $context['view_mode'] == 'full') {
-    $displays['description']['visibility'] = FALSE;
+    $displays['description']['visible'] = FALSE;
   }
 }
 
@@ -2416,7 +2415,7 @@ function hook_field_delete_instance($instance) {
  * @param $field
  *   The field record just read from the database.
  */
-function hook_field_read_field(&$field) {
+function hook_field_read_field($field) {
   // @todo Needs function body.
 }
 
diff --git a/modules/field/field.attach.inc b/modules/field/field.attach.inc
index e2224381785948a381a2e1eb3ce623aa05382637..4ca15f5431fa91b91a6cb83994e3882995d50341 100644
--- a/modules/field/field.attach.inc
+++ b/modules/field/field.attach.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: field.attach.inc,v 1.98 2010/12/07 05:09:58 webchick Exp $
 
 /**
  * @file
@@ -258,9 +257,9 @@ function _field_invoke($op, $entity_type, $entity, &$a = NULL, &$b = NULL, $opti
  *  - 'deleted': If TRUE, the function will operate on deleted fields
  *    as well as non-deleted fields. If unset or FALSE, only
  *    non-deleted fields are operated on.
- *  - 'language': A language code or an array of language codes keyed by field
- *    name. It will be used to narrow down to a single value the available
- *    languages to act on.
+ *  - 'language': A language code or an array of arrays of language codes keyed
+ *    by entity id and field name. It will be used to narrow down to a single
+ *    value the available languages to act on.
  *
  * @return
  *   An array of returned values keyed by entity id.
@@ -312,7 +311,8 @@ function _field_invoke_multiple($op, $entity_type, $entities, &$a = NULL, &$b =
         // Unless a language suggestion is provided we iterate on all the
         // available languages.
         $available_languages = field_available_languages($entity_type, $field);
-        $languages = _field_language_suggestion($available_languages, $options['language'], $field_name);
+        $language = !empty($options['language'][$id]) ? $options['language'][$id] : $options['language'];
+        $languages = _field_language_suggestion($available_languages, $language, $field_name);
         foreach ($languages as $langcode) {
           $grouped_items[$field_id][$langcode][$id] = isset($entity->{$field_name}[$langcode]) ? $entity->{$field_name}[$langcode] : array();
         }
@@ -348,7 +348,7 @@ function _field_invoke_multiple($op, $entity_type, $entities, &$a = NULL, &$b =
     // fields with an empty array (those are not equivalent on update).
     foreach ($grouped_entities[$field_id] as $id => $entity) {
       foreach ($grouped_items[$field_id] as $langcode => $items) {
-        if ($grouped_items[$field_id][$langcode][$id] !== array() || isset($entity->{$field_name}[$langcode])) {
+        if (isset($grouped_items[$field_id][$langcode][$id]) && ($grouped_items[$field_id][$langcode][$id] !== array() || isset($entity->{$field_name}[$langcode]))) {
           $entity->{$field_name}[$langcode] = $grouped_items[$field_id][$langcode][$id];
         }
       }
@@ -780,11 +780,11 @@ function field_attach_validate($entity_type, $entity) {
  * There are two levels of validation for fields in forms: widget
  * validation, and field validation.
  * - Widget validation steps are specific to a given widget's own form
- * structure and UI metaphors. They are executed through FAPI's
- * #element_validate property during normal form validation.
+ *   structure and UI metaphors. They are executed through FAPI's
+ *   #element_validate property during normal form validation.
  * - Field validation steps are common to a given field type, independently of
- * the specific widget being used in a given form. They are defined in the
- * field type's implementation of hook_field_validate().
+ *   the specific widget being used in a given form. They are defined in the
+ *   field type's implementation of hook_field_validate().
  *
  * This function performs field validation in the context of a form
  * submission. It converts field validation errors into form errors
@@ -878,7 +878,7 @@ function field_attach_presave($entity_type, $entity) {
 /**
  * Save field data for a new entity.
  *
- * The passed in entity must already contain its id and (if applicable)
+ * The passed-in entity must already contain its id and (if applicable)
  * revision id attributes.
  * Default values (if any) will be saved for fields not present in the
  * $entity.
@@ -1075,8 +1075,13 @@ function field_attach_delete_revision($entity_type, $entity) {
  *   An array of entities, keyed by entity id.
  * @param $view_mode
  *   View mode, e.g. 'full', 'teaser'...
+ * @param $langcode
+ *   (Optional) The language the field values are to be shown in. If no language
+ *   is provided the current language is used.
  */
-function field_attach_prepare_view($entity_type, $entities, $view_mode) {
+function field_attach_prepare_view($entity_type, $entities, $view_mode, $langcode = NULL) {
+  $options = array('language' => array());
+
   // To ensure hooks are only run once per entity, only process items without
   // the _field_view_prepared flag.
   // @todo: resolve this more generally for both entity and field level hooks.
@@ -1086,17 +1091,22 @@ function field_attach_prepare_view($entity_type, $entities, $view_mode) {
       // Add this entity to the items to be prepared.
       $prepare[$id] = $entity;
 
+      // Determine the actual language to display for each field, given the
+      // languages available in the field data.
+      $options['language'][$id] = field_language($entity_type, $entity, NULL, $langcode);
+
       // Mark this item as prepared.
       $entity->_field_view_prepared = TRUE;
     }
   }
 
+  $null = NULL;
   // First let the field types do their preparation.
-  _field_invoke_multiple('prepare_view', $entity_type, $prepare);
+  _field_invoke_multiple('prepare_view', $entity_type, $prepare, $null, $null, $options);
   // Then let the formatters do their own specific massaging.
   // field_default_prepare_view() takes care of dispatching to the correct
   // formatters according to the display settings for the view mode.
-  _field_invoke_multiple_default('prepare_view', $entity_type, $prepare, $view_mode);
+  _field_invoke_multiple_default('prepare_view', $entity_type, $prepare, $view_mode, $null, $options);
 }
 
 /**
diff --git a/modules/field/field.crud.inc b/modules/field/field.crud.inc
index c2eb3ab6c6fc8f59fab2dbb1aea7f44703ac902b..339e9c4e3de0740719adda4344523ab870bd26d7 100644
--- a/modules/field/field.crud.inc
+++ b/modules/field/field.crud.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: field.crud.inc,v 1.74 2011/01/02 17:26:39 webchick Exp $
 
 /**
  * @file
@@ -422,7 +421,6 @@ function field_delete_field($field_name) {
  *   will be given the following default values:
  *   - label: the field name
  *   - description: empty string
- *   - weight: 0
  *   - required: FALSE
  *   - default_value_function: empty string
  *   - settings: each omitted setting is given the default value specified in
@@ -635,12 +633,11 @@ function _field_write_instance($instance, $update = FALSE) {
 }
 
 /**
- * Reads a single instance record directly from the database.
+ * Reads a single instance record from the database.
  *
- * Generally, you should use the field_info_instance() instead.
- *
- * This function will not return deleted instances. Use
- * field_read_instances() instead for this purpose.
+ * Generally, you should use field_info_instance() instead, as it
+ * provides caching and allows other modules the opportunity to
+ * append additional formatters, widgets, and other information.
  *
  * @param $entity_type
  *   The type of entity to which the field is bound.
diff --git a/modules/field/field.default.inc b/modules/field/field.default.inc
index eb09858a0fadc2ab311af2c6bfca24894da0a158..a10d1387f8cb8a0ec14901f782603406ddedcb0b 100644
--- a/modules/field/field.default.inc
+++ b/modules/field/field.default.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: field.default.inc,v 1.41 2010/11/21 19:09:18 dries Exp $
 
 /**
  * @file
@@ -82,7 +81,7 @@ function field_default_validate($entity_type, $entity, $field, $instance, $langc
   if ($field['cardinality'] != FIELD_CARDINALITY_UNLIMITED && count($items) > $field['cardinality']) {
     $errors[$field['field_name']][$langcode][0][] = array(
       'error' => 'field_cardinality',
-      'message' => t('%name: this field cannot hold more than @count values.', array('%name' => t($instance['label']), '@count' => $field['cardinality'])),
+      'message' => t('%name: this field cannot hold more than @count values.', array('%name' => $instance['label'], '@count' => $field['cardinality'])),
     );
   }
 }
@@ -135,21 +134,25 @@ function field_default_insert($entity_type, $entity, $field, $instance, $langcod
  *   - the name of a view mode
  *   - or an array of display settings to use for display, as found in the
  *     'display' entry of $instance definitions.
-*/
+ */
 function field_default_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items, $display) {
   // Group entities, instances and items by formatter module.
   $modules = array();
   foreach ($instances as $id => $instance) {
     if (is_string($display)) {
       $view_mode = $display;
-      $display = field_get_display($instance, $view_mode, $entities[$id]);
+      $instance_display = field_get_display($instance, $view_mode, $entities[$id]);
+    }
+    else {
+      $instance_display = $display;
     }
-    if ($display['type'] !== 'hidden') {
-      $module = $display['module'];
+
+    if ($instance_display['type'] !== 'hidden') {
+      $module = $instance_display['module'];
       $modules[$module] = $module;
       $grouped_entities[$module][$id] = $entities[$id];
       $grouped_instances[$module][$id] = $instance;
-      $grouped_displays[$module][$id] = $display;
+      $grouped_displays[$module][$id] = $instance_display;
       // hook_field_formatter_prepare_view() alters $items by reference.
       $grouped_items[$module][$id] = &$items[$id];
     }
@@ -211,7 +214,7 @@ function field_default_view($entity_type, $entity, $field, $instance, $langcode,
         $info = array(
           '#theme' => 'field',
           '#weight' => $display['weight'],
-          '#title' => t($instance['label']),
+          '#title' => $instance['label'],
           '#access' => field_access('view', $field, $entity_type, $entity),
           '#label_display' => $display['label'],
           '#view_mode' => $view_mode,
diff --git a/modules/field/field.form.inc b/modules/field/field.form.inc
index 02a8d56d61d781e4bddac1629ee58d63d94b695c..845f041098534d8aca50abbe6fe36c0e4a85dc2e 100644
--- a/modules/field/field.form.inc
+++ b/modules/field/field.form.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: field.form.inc,v 1.54 2010/11/20 19:57:01 webchick Exp $
 
 /**
  * @file
@@ -70,7 +69,7 @@ function field_default_form($entity_type, $entity, $field, $instance, $langcode,
           '#language' => $langcode,
           '#field_parents' => $parents,
           '#columns' => array_keys($field['columns']),
-          '#title' => check_plain(t($instance['label'])),
+          '#title' => check_plain($instance['label']),
           '#description' => field_filter_xss($instance['description']),
           // Only the first widget should be required.
           '#required' => $delta == 0 && $instance['required'],
@@ -152,8 +151,8 @@ function field_multiple_value_form($field, $instance, $langcode, $items, &$form,
       break;
   }
 
-  $title = check_plain(t($instance['label']));
-  $description = field_filter_xss(t($instance['description']));
+  $title = check_plain($instance['label']);
+  $description = field_filter_xss($instance['description']);
 
   $id_prefix = implode('-', array_merge($parents, array($field_name)));
   $wrapper_id = drupal_html_id($id_prefix . '-add-more-wrapper');
@@ -414,7 +413,7 @@ function field_add_more_js($form, $form_state) {
     return;
   }
 
-  // Add a DIV around the delta receiving the AJAX effect.
+  // Add a DIV around the delta receiving the Ajax effect.
   $delta = $element['#max_delta'];
   $element[$delta]['#prefix'] = '<div class="ajax-new-content">' . (isset($element[$delta]['#prefix']) ? $element[$delta]['#prefix'] : '');
   $element[$delta]['#suffix'] = (isset($element[$delta]['#suffix']) ? $element[$delta]['#suffix'] : '') . '</div>';
diff --git a/modules/field/field.info b/modules/field/field.info
index f4416d544cc83ba5037f1c6af89a34ff5464cb37..8a6f0a75a2c3c244d70c27784c0f9194e4e037ac 100644
--- a/modules/field/field.info
+++ b/modules/field/field.info
@@ -1,4 +1,3 @@
-; $Id: field.info,v 1.10 2010/12/20 19:59:41 webchick Exp $
 name = Field
 description = Field API to add fields to entities like nodes and users.
 package = Core
@@ -11,8 +10,8 @@ dependencies[] = field_sql_storage
 required = TRUE
 stylesheets[all][] = theme/field.css
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/field/field.info.inc b/modules/field/field.info.inc
index 40dde2d9ddfc8692b5d3f55e6e810781d76cda89..02707f6d3fc4ed420f7c1da70bba57eda38a87e1 100644
--- a/modules/field/field.info.inc
+++ b/modules/field/field.info.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: field.info.inc,v 1.58 2010/12/17 01:36:04 dries Exp $
 
 /**
  * @file
@@ -287,8 +286,6 @@ function _field_info_prepare_field($field) {
  *   Field instance array.
  */
 function _field_info_prepare_instance($instance, $field) {
-  $field_type = field_info_field_types($field['type']);
-
   // Make sure all expected instance settings are present.
   $instance['settings'] += field_info_instance_settings($field['type']);
 
@@ -735,7 +732,7 @@ function field_info_instance($entity_type, $field_name, $bundle_name) {
  *         'default' => array(
  *           'weight' => The weight of the component in displayed entities in
  *             this view mode,
- *           'visibility' => Whether the component is visible or hidden in
+ *           'visible' => TRUE if the component is visible, FALSE if hidden, in
  *             displayed entities in this view mode,
  *         ),
  *         'teaser' => array(
@@ -793,7 +790,7 @@ function field_info_max_weight($entity_type, $bundle, $context) {
     if ($context == 'form') {
       $weights[] = $instance['widget']['weight'];
     }
-    else {
+    elseif (isset($instance['display'][$context]['weight'])) {
       $weights[] = $instance['display'][$context]['weight'];
     }
   }
diff --git a/modules/field/field.install b/modules/field/field.install
index ab77eb80386e9f7dde01dde5e8e4cc41ee5f037b..d56eb904c52abaa4c7bceff02b3e76a0a05f2e69 100644
--- a/modules/field/field.install
+++ b/modules/field/field.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: field.install,v 1.27 2011/01/02 17:26:39 webchick Exp $
 
 /**
  * @file
@@ -310,18 +309,27 @@ function _update_7000_field_delete_instance($field_name, $entity_type, $bundle)
 /**
  * Utility function: fetch all the field definitions from the database.
  *
+ * Warning: unlike the field_read_fields() API function, this function returns
+ * all fields by default, including deleted and inactive fields, unless
+ * specified otherwise in the $conditions parameter.
+ *
  * @param $conditions
  *   An array of conditions to limit the select query to.
+ * @param $key
+ *   The name of the field property the return array is indexed by. Using
+ *   anything else than 'id' might cause incomplete results if the $conditions
+ *   do not filter out deleted fields.
+ *
+ * @return
+ *   An array of fields matching $conditions, keyed by the property specified
+ *   by the $key parameter.
  */
-function _update_7000_field_read_fields(array $conditions = array()) {
+function _update_7000_field_read_fields(array $conditions = array(), $key = 'id') {
   $fields = array();
   $query = db_select('field_config', 'fc', array('fetch' => PDO::FETCH_ASSOC))
-    ->fields('fc')
-    ->condition('deleted', 0);
-  if (!empty($conditions)) {
-    foreach ($conditions as $column => $value) {
-      $query->condition($column, $value);
-    }
+    ->fields('fc');
+  foreach ($conditions as $column => $value) {
+    $query->condition($column, $value);
   }
   foreach ($query->execute() as $record) {
     $field = unserialize($record['data']);
@@ -338,7 +346,7 @@ function _update_7000_field_read_fields(array $conditions = array()) {
     $field['translatable'] = $record['translatable'];
     $field['deleted'] = $record['deleted'];
 
-    $fields[$field['field_name']] = $field;
+    $fields[$field[$key]] = $field;
   }
   return $fields;
 }
diff --git a/modules/field/field.module b/modules/field/field.module
index 089dccfa15388fe6192dae637c58eabc33028e9c..9e03c8d911dc3dc6ef42eee599752bbc789399ed 100644
--- a/modules/field/field.module
+++ b/modules/field/field.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: field.module,v 1.94 2011/01/02 17:26:39 webchick Exp $
 /**
  * @file
  * Attach custom data fields to Drupal entities.
@@ -559,7 +558,7 @@ function _field_sort_items_value_helper($a, $b) {
  *         // the 'default' mode:
  *         'default' => array(
  *           'weight' => The weight of the pseudo-field,
- *           'visibility' => Whether the pseudo-field is visible or hidden,
+ *           'visible' => TRUE if the pseudo-field is visible, FALSE if hidden,
  *         ),
  *         'full' => ...
  *       ),
diff --git a/modules/field/field.multilingual.inc b/modules/field/field.multilingual.inc
index b2bb36ca3a2e2a18636ba725b87f0a954b28d5e8..00adf9275a6a6a65c6f0a0f7699ba3b2bafe0beb 100644
--- a/modules/field/field.multilingual.inc
+++ b/modules/field/field.multilingual.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: field.multilingual.inc,v 1.15 2011/01/03 18:03:54 webchick Exp $
 
 /**
  * @file
diff --git a/modules/field/modules/field_sql_storage/field_sql_storage.info b/modules/field/modules/field_sql_storage/field_sql_storage.info
index b7e02d5e4d391cbfd82fce60765ab8c621265634..204bdb799569e4c5693685556a185fbdb33e5443 100644
--- a/modules/field/modules/field_sql_storage/field_sql_storage.info
+++ b/modules/field/modules/field_sql_storage/field_sql_storage.info
@@ -1,4 +1,3 @@
-; $Id: field_sql_storage.info,v 1.6 2010/12/20 19:59:41 webchick Exp $
 name = Field SQL storage
 description = Stores field data in an SQL database.
 package = Core
@@ -8,8 +7,8 @@ dependencies[] = field
 files[] = field_sql_storage.test
 required = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/field/modules/field_sql_storage/field_sql_storage.install b/modules/field/modules/field_sql_storage/field_sql_storage.install
index bdb56312033bea12915ccaa56fbe1b794a105d0f..647296e4e691926245f68eee409b05574fd04fbc 100644
--- a/modules/field/modules/field_sql_storage/field_sql_storage.install
+++ b/modules/field/modules/field_sql_storage/field_sql_storage.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: field_sql_storage.install,v 1.14 2011/01/02 17:26:39 webchick Exp $
 
 /**
  * @file
diff --git a/modules/field/modules/field_sql_storage/field_sql_storage.module b/modules/field/modules/field_sql_storage/field_sql_storage.module
index 23f449007e3f65d95bc746efad4682a69f7898f7..6f49167ec0061129207803a05dbff567354c03b4 100644
--- a/modules/field/modules/field_sql_storage/field_sql_storage.module
+++ b/modules/field/modules/field_sql_storage/field_sql_storage.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: field_sql_storage.module,v 1.58 2010/12/21 04:11:12 webchick Exp $
 
 /**
  * @file
diff --git a/modules/field/modules/field_sql_storage/field_sql_storage.test b/modules/field/modules/field_sql_storage/field_sql_storage.test
index e5d626226e4cfdb805054aca3e7c14e867eef096..f94344fa208b4744257b90bf6ac31c821276c19e 100644
--- a/modules/field/modules/field_sql_storage/field_sql_storage.test
+++ b/modules/field/modules/field_sql_storage/field_sql_storage.test
@@ -1,9 +1,8 @@
 <?php
-// $Id: field_sql_storage.test,v 1.23 2010/12/14 19:50:05 dries Exp $
 
 /**
  * @file
- * Unit tests for field_sql_ storage.module
+ * Tests for field_sql_storage.module.
  *
  * Field_sql_storage.module implements the default back-end storage plugin
  * for the Field Strage API.
diff --git a/modules/field/modules/list/list.info b/modules/field/modules/list/list.info
index cefac307f9665b51da6602fac9e0b8879e62af5d..496e76703dc8188d675f0fadc6ad2262ed0b7c87 100644
--- a/modules/field/modules/list/list.info
+++ b/modules/field/modules/list/list.info
@@ -1,4 +1,3 @@
-; $Id: list.info,v 1.10 2010/12/20 19:59:41 webchick Exp $
 name = List
 description = Defines list field types. Use with Options to create selection lists.
 package = Core
@@ -8,8 +7,8 @@ dependencies[] = field
 dependencies[] = options
 files[] = tests/list.test
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/field/modules/list/list.install b/modules/field/modules/list/list.install
index 3642b1d5355f63ac38c6e8fb209fbc6f1b7e3115..91c7649c1a0eede43f383ce3e6ed9ddae017deff 100644
--- a/modules/field/modules/list/list.install
+++ b/modules/field/modules/list/list.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: list.install,v 1.4 2010/12/18 00:50:03 dries Exp $
 
 /**
  * @file
@@ -51,7 +50,7 @@ function list_field_schema($field) {
  */
 function list_update_7001() {
   $fields = _update_7000_field_read_fields(array('module' => 'list'));
-  foreach ($fields as $field_name => $field) {
+  foreach ($fields as $field) {
     $update = array();
 
     // Translate the old string format into the new array format.
@@ -61,7 +60,7 @@ function list_update_7001() {
       $allowed_values = _list_update_7001_extract_allowed_values($allowed_values, $position_keys);
 
       // Additionally, float keys need to be disambiguated ('.5' is '0.5').
-      if ($field['type'] == 'list_number') {
+      if ($field['type'] == 'list_number' && !empty($allowed_values)) {
         $keys = array_map(create_function('$a', 'return (string) (float) $a;'), array_keys($allowed_values));
         $allowed_values = array_combine($keys, array_values($allowed_values));
       }
@@ -116,3 +115,15 @@ function _list_update_7001_extract_allowed_values($string, $position_keys) {
 
   return $values;
 }
+
+/**
+ * Re-apply list_update_7001() for deleted fields.
+ */
+function list_update_7002() {
+  // See http://drupal.org/node/1022924: list_update_7001() intitally
+  // overlooked deleted fields, which then caused fatal errors when the fields
+  // were being purged.
+  // list_update_7001() has the required checks to ensure it is reentrant, so
+  // it can simply be executed once more..
+  list_update_7001();
+}
\ No newline at end of file
diff --git a/modules/field/modules/list/list.module b/modules/field/modules/list/list.module
index ca45e68f3cf5d9ac8230bf452e6c123936d6083d..608679bbb5f958e07dd22f555fdbee2366f06a49 100644
--- a/modules/field/modules/list/list.module
+++ b/modules/field/modules/list/list.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: list.module,v 1.39 2010/12/18 00:50:03 dries Exp $
 
 /**
  * @file
@@ -380,7 +379,7 @@ function list_field_validate($entity_type, $entity, $field, $instance, $langcode
       if (!empty($allowed_values) && !isset($allowed_values[$item['value']])) {
         $errors[$field['field_name']][$langcode][$delta][] = array(
           'error' => 'list_illegal_value',
-          'message' => t('%name: illegal value.', array('%name' => t($instance['label']))),
+          'message' => t('%name: illegal value.', array('%name' => $instance['label'])),
         );
       }
     }
diff --git a/modules/field/modules/list/tests/list.test b/modules/field/modules/list/tests/list.test
index ea23e6cb60c4180570af2041bacf8b40235431e6..941d2b4cb02d8df66bb4e0cc36e4e2ec06f40adc 100644
--- a/modules/field/modules/list/tests/list.test
+++ b/modules/field/modules/list/tests/list.test
@@ -1,9 +1,8 @@
 <?php
-// $Id: list.test,v 1.11 2010/12/18 00:50:03 dries Exp $
 
 /**
  * @file
- * Tests for the 'List' field types.
+ * Tests for list.module.
  */
 
 /**
@@ -98,8 +97,8 @@ class ListFieldTestCase extends FieldTestCase {
 }
 
 /**
-* List module UI tests.
-*/
+ * List module UI tests.
+ */
 class ListFieldUITestCase extends FieldTestCase {
   public static function getInfo() {
     return array(
diff --git a/modules/field/modules/list/tests/list_test.info b/modules/field/modules/list/tests/list_test.info
index 0760a3e7424943c52179ea7be88fe686614e6e25..23cac1e1e28515f732bb8dbdaaac0c49108c6111 100644
--- a/modules/field/modules/list/tests/list_test.info
+++ b/modules/field/modules/list/tests/list_test.info
@@ -1,4 +1,3 @@
-;$Id: list_test.info,v 1.2 2010/12/20 19:59:41 webchick Exp $
 name = "List test"
 description = "Support module for the List module tests."
 core = 7.x
@@ -6,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/field/modules/list/tests/list_test.module b/modules/field/modules/list/tests/list_test.module
index 98fb1721f0d026cf58fc57b6c9b5634db80fce23..8d5340412dac470b273b68b1b0d46ac2a6c15d4e 100644
--- a/modules/field/modules/list/tests/list_test.module
+++ b/modules/field/modules/list/tests/list_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: list_test.module,v 1.1 2009/12/14 20:18:55 dries Exp $
 
 /**
  * @file
diff --git a/modules/field/modules/number/number.info b/modules/field/modules/number/number.info
index 5c39c1fa48b6c52024cc65ee35d93c9c94bfba54..ca9e5fa87933026939b5720198fd9c1e1b0c838d 100644
--- a/modules/field/modules/number/number.info
+++ b/modules/field/modules/number/number.info
@@ -1,4 +1,3 @@
-; $Id: number.info,v 1.9 2010/12/20 19:59:41 webchick Exp $
 name = Number
 description = Defines numeric field types.
 package = Core
@@ -7,8 +6,8 @@ core = 7.x
 dependencies[] = field
 files[] = number.test
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/field/modules/number/number.install b/modules/field/modules/number/number.install
index 3c7e4384994fabf0ec87900080e7655e1f8cb29c..02c7a305750a6514eafb5ff8fdd192ccb0f46986 100644
--- a/modules/field/modules/number/number.install
+++ b/modules/field/modules/number/number.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: number.install,v 1.1 2010/09/04 15:40:51 dries Exp $
 
 /**
  * @file
diff --git a/modules/field/modules/number/number.module b/modules/field/modules/number/number.module
index 591440816ca314a0c04f9295f66c8b5fffdf2727..20e380777f649213f80fcad35dd35c5135f2ef9f 100644
--- a/modules/field/modules/number/number.module
+++ b/modules/field/modules/number/number.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: number.module,v 1.46 2010/10/31 12:11:59 dries Exp $
 
 /**
  * @file
@@ -139,13 +138,13 @@ function number_field_validate($entity_type, $entity, $field, $instance, $langco
       if (is_numeric($instance['settings']['min']) && $item['value'] < $instance['settings']['min']) {
         $errors[$field['field_name']][$langcode][$delta][] = array(
           'error' => 'number_min',
-          'message' => t('%name: the value may be no less than %min.', array('%name' => t($instance['label']), '%min' => $instance['settings']['min'])),
+          'message' => t('%name: the value may be no less than %min.', array('%name' => $instance['label'], '%min' => $instance['settings']['min'])),
         );
       }
       if (is_numeric($instance['settings']['max']) && $item['value'] > $instance['settings']['max']) {
         $errors[$field['field_name']][$langcode][$delta][] = array(
           'error' => 'number_max',
-          'message' => t('%name: the value may be no greater than %max.', array('%name' => t($instance['label']), '%max' => $instance['settings']['max'])),
+          'message' => t('%name: the value may be no greater than %max.', array('%name' => $instance['label'], '%max' => $instance['settings']['max'])),
         );
       }
     }
@@ -368,12 +367,12 @@ function number_field_widget_validate($element, &$form_state) {
       case 'float':
       case 'decimal':
         $regexp = '@[^-0-9\\' . $field['settings']['decimal_separator'] . ']@';
-        $message = t('Only numbers and the decimal separator (@separator) allowed in %field.', array('%field' => t($instance['label']), '@separator' => $field['settings']['decimal_separator']));
+        $message = t('Only numbers and the decimal separator (@separator) allowed in %field.', array('%field' => $instance['label'], '@separator' => $field['settings']['decimal_separator']));
         break;
 
       case 'integer':
         $regexp = '@[^-0-9]@';
-        $message = t('Only numbers are allowed in %field.', array('%field' => t($instance['label'])));
+        $message = t('Only numbers are allowed in %field.', array('%field' => $instance['label']));
         break;
     }
     if ($value != preg_replace($regexp, '', $value)) {
diff --git a/modules/field/modules/number/number.test b/modules/field/modules/number/number.test
index 21a4c94f54dda5e3a197357e485415a7772a0c52..ec100f189796e9179e0167251fbed4c122387d45 100644
--- a/modules/field/modules/number/number.test
+++ b/modules/field/modules/number/number.test
@@ -1,9 +1,8 @@
 <?php
-// $Id: number.test,v 1.1 2010/10/23 21:03:22 webchick Exp $
 
 /**
  * @file
- * Tests for number field types.
+ * Tests for number.module.
  */
 
 /**
diff --git a/modules/field/modules/options/options.api.php b/modules/field/modules/options/options.api.php
index 906c932c627432d198edda57a262cdfd40d75ba8..dfbb631c64ab97057d52d62c1da01a368075abb3 100644
--- a/modules/field/modules/options/options.api.php
+++ b/modules/field/modules/options/options.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: options.api.php,v 1.1 2009/12/14 20:18:55 dries Exp $
 
 /**
  * @file
diff --git a/modules/field/modules/options/options.info b/modules/field/modules/options/options.info
index b99963033a1802c8b75d1310cd62cd692dfa3b54..02263f7c19d0a87b24b02eafd2b37b36e00b5c0f 100644
--- a/modules/field/modules/options/options.info
+++ b/modules/field/modules/options/options.info
@@ -1,4 +1,3 @@
-; $Id: options.info,v 1.8 2010/12/20 19:59:41 webchick Exp $
 name = Options
 description = Defines selection, check box and radio button widgets for text and numeric fields.
 package = Core
@@ -7,8 +6,8 @@ core = 7.x
 dependencies[] = field
 files[] = options.test
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/field/modules/options/options.module b/modules/field/modules/options/options.module
index 0da436c5a269b0627a488c2a6131923ce3ef3d68..385f3f47f6a7e92cda1698a5cec2bba94fb698ae 100644
--- a/modules/field/modules/options/options.module
+++ b/modules/field/modules/options/options.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: options.module,v 1.30 2010/12/06 18:04:27 webchick Exp $
 
 /**
  * @file
diff --git a/modules/field/modules/options/options.test b/modules/field/modules/options/options.test
index e94f4c03299c31e88d6a62c97c3b90371c625f49..ea58f27ff2ea6c5c1db6d3f88001305d50bf34bd 100644
--- a/modules/field/modules/options/options.test
+++ b/modules/field/modules/options/options.test
@@ -1,5 +1,9 @@
 <?php
-// $Id: options.test,v 1.23 2010/12/18 00:50:03 dries Exp $
+
+/**
+ * @file 
+ * Tests for options.module.
+ */
 
 class OptionsWidgetsTestCase extends FieldTestCase {
   public static function getInfo() {
diff --git a/modules/field/modules/text/text.info b/modules/field/modules/text/text.info
index 0b90b111fecc4eb15e7a9f8f543af5b5c295b427..4c5e875dc3e8f981ea8f602b84fc5dcad2baf489 100644
--- a/modules/field/modules/text/text.info
+++ b/modules/field/modules/text/text.info
@@ -1,4 +1,3 @@
-; $Id: text.info,v 1.9 2010/12/20 19:59:41 webchick Exp $
 name = Text
 description = Defines simple text field types.
 package = Core
@@ -8,8 +7,8 @@ dependencies[] = field
 files[] = text.test
 required = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/field/modules/text/text.install b/modules/field/modules/text/text.install
index cbb012c4f264bd32f581c076092067cac26e2c1b..b9bd25f19932640b6e9d6bb878af5c78b43fd208 100644
--- a/modules/field/modules/text/text.install
+++ b/modules/field/modules/text/text.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: text.install,v 1.4 2010/10/20 15:57:42 webchick Exp $
 
 /**
  * @file
@@ -93,7 +92,7 @@ function text_update_7000() {
     'module' => 'text',
     'storage_type' => 'field_sql_storage',
   ));
-  foreach ($fields as $field_name => $field) {
+  foreach ($fields as $field) {
     if ($field['deleted']) {
       $table = "field_deleted_data_{$field['id']}";
       $revision_table = "field_deleted_revision_{$field['id']}";
diff --git a/modules/field/modules/text/text.js b/modules/field/modules/text/text.js
index 5de60b634232a7d7fa830dc2895c1493f4a3fc69..f3ae89430cd3d0de9a65b72490dce42b84e4cf8a 100644
--- a/modules/field/modules/text/text.js
+++ b/modules/field/modules/text/text.js
@@ -1,4 +1,3 @@
-// $Id: text.js,v 1.5 2010/10/24 04:18:10 webchick Exp $
 
 (function ($) {
 
diff --git a/modules/field/modules/text/text.module b/modules/field/modules/text/text.module
index 7d101fdb15e13b67cefc4dff64d54d49a2e70de8..89c605cf2c046eb48d448e20d27a63ef88a8583f 100644
--- a/modules/field/modules/text/text.module
+++ b/modules/field/modules/text/text.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: text.module,v 1.68 2010/11/13 07:39:35 webchick Exp $
 
 /**
  * @file
diff --git a/modules/field/modules/text/text.test b/modules/field/modules/text/text.test
index a2003eebbc6e93fd27e4c0c9e3a90d16d17a1f10..b42fed7e09894d352b3ecdd27431234e6ae77f72 100644
--- a/modules/field/modules/text/text.test
+++ b/modules/field/modules/text/text.test
@@ -1,5 +1,9 @@
 <?php
-// $Id: text.test,v 1.32 2010/10/25 15:51:21 webchick Exp $
+
+/**
+ * @file
+ * Tests for text.module.
+ */
 
 class TextFieldTestCase extends DrupalWebTestCase {
   protected $instance;
diff --git a/modules/field/tests/field.test b/modules/field/tests/field.test
index 79c7c9717f095f939c0ce74830b5c8ef6c7bce1c..9281273f6405229f5338e106ba8176417b4a4634 100644
--- a/modules/field/tests/field.test
+++ b/modules/field/tests/field.test
@@ -1,9 +1,8 @@
 <?php
-// $Id: field.test,v 1.47 2010/12/15 04:13:48 webchick Exp $
 
 /**
  * @file
- * Unit test file for fields in core.
+ * Tests for field.module.
  */
 
 /**
@@ -762,6 +761,55 @@ class FieldAttachOtherTestCase extends FieldAttachTestCase {
     $this->assertTrue($result, t('Variable $@field_name correctly populated.', array('@field_name' => $this->field_name)));
   }
 
+  /**
+   * Tests the 'multiple entity' behavior of field_attach_prepare_view().
+   */
+  function testFieldAttachPrepareViewMultiple() {
+    $entity_type = 'test_entity';
+    $langcode = LANGUAGE_NONE;
+
+    // Set the instance to be hidden.
+    $this->instance['display']['full']['type'] = 'hidden';
+    field_update_instance($this->instance);
+
+    // Set up a second instance on another bundle, with a formatter that uses
+    // hook_field_formatter_prepare_view().
+    field_test_create_bundle('test_bundle_2');
+    $formatter_setting = $this->randomName();
+    $this->instance2 = $this->instance;
+    $this->instance2['bundle'] = 'test_bundle_2';
+    $this->instance2['display']['full'] = array(
+      'type' => 'field_test_with_prepare_view',
+      'settings' => array(
+        'test_formatter_setting_additional' => $formatter_setting,
+      )
+    );
+    field_create_instance($this->instance2);
+
+    // Create one entity in each bundle.
+    $entity1_init = field_test_create_stub_entity(1, 1, 'test_bundle');
+    $values1 = $this->_generateTestFieldValues($this->field['cardinality']);
+    $entity1_init->{$this->field_name}[$langcode] = $values1;
+
+    $entity2_init = field_test_create_stub_entity(2, 2, 'test_bundle_2');
+    $values2 = $this->_generateTestFieldValues($this->field['cardinality']);
+    $entity2_init->{$this->field_name}[$langcode] = $values2;
+
+    // Run prepare_view, and check that the entities come out as expected.
+    $entity1 = clone($entity1_init);
+    $entity2 = clone($entity2_init);
+    field_attach_prepare_view($entity_type, array($entity1->ftid => $entity1, $entity2->ftid => $entity2), 'full');
+    $this->assertFalse(isset($entity1->{$this->field_name}[$langcode][0]['additional_formatter_value']), 'Entity 1 did not run through the prepare_view hook.');
+    $this->assertTrue(isset($entity2->{$this->field_name}[$langcode][0]['additional_formatter_value']), 'Entity 2 ran through the prepare_view hook.');
+
+    // Same thing, reversed order.
+    $entity1 = clone($entity1_init);
+    $entity2 = clone($entity2_init);
+    field_attach_prepare_view($entity_type, array($entity2->ftid => $entity2, $entity1->ftid => $entity1), 'full');
+    $this->assertFalse(isset($entity1->{$this->field_name}[$langcode][0]['additional_formatter_value']), 'Entity 1 did not run through the prepare_view hook.');
+    $this->assertTrue(isset($entity2->{$this->field_name}[$langcode][0]['additional_formatter_value']), 'Entity 2 ran through the prepare_view hook.');
+  }
+
   /**
    * Test field cache.
    */
@@ -1448,7 +1496,7 @@ class FieldFormTestCase extends FieldTestCase {
       $field_values[$weight]['value'] = (string) $value;
       $pattern[$weight] = "<input [^>]*value=\"$value\" [^>]*";
     }
-    // Press 'add more' button through AJAX, and place the expected HTML result
+    // Press 'add more' button through Ajax, and place the expected HTML result
     // as the tested content.
     $commands = $this->drupalPostAJAX(NULL, $edit, $this->field_name . '_add_more');
     $this->content = $commands[1]['data'];
@@ -1568,109 +1616,109 @@ class FieldFormTestCase extends FieldTestCase {
    * Tests Field API form integration within a subform.
    */
   function testNestedFieldForm() {
-     // Add two instances on the 'test_bundle'
-     field_create_field($this->field_single);
-     field_create_field($this->field_unlimited);
-     $this->instance['field_name'] = 'field_single';
-     $this->instance['label'] = 'Single field';
-     field_create_instance($this->instance);
-     $this->instance['field_name'] = 'field_unlimited';
-     $this->instance['label'] = 'Unlimited field';
-     field_create_instance($this->instance);
-
-     // Create two entities.
-     $entity_1 = field_test_create_stub_entity(1, 1);
-     $entity_1->is_new = TRUE;
-     $entity_1->field_single[LANGUAGE_NONE][] = array('value' => 0);
-     $entity_1->field_unlimited[LANGUAGE_NONE][] = array('value' => 1);
-     field_test_entity_save($entity_1);
-
-     $entity_2 = field_test_create_stub_entity(2, 2);
-     $entity_2->is_new = TRUE;
-     $entity_2->field_single[LANGUAGE_NONE][] = array('value' => 10);
-     $entity_2->field_unlimited[LANGUAGE_NONE][] = array('value' => 11);
-     field_test_entity_save($entity_2);
-
-     // Display the 'combined form'.
-     $this->drupalGet('test-entity/nested/1/2');
-     $this->assertFieldByName('field_single[und][0][value]', 0, t('Entity 1: field_single value appears correctly is the form.'));
-     $this->assertFieldByName('field_unlimited[und][0][value]', 1, t('Entity 1: field_unlimited value 0 appears correctly is the form.'));
-     $this->assertFieldByName('entity_2[field_single][und][0][value]', 10, t('Entity 2: field_single value appears correctly is the form.'));
-     $this->assertFieldByName('entity_2[field_unlimited][und][0][value]', 11, t('Entity 2: field_unlimited value 0 appears correctly is the form.'));
-
-     // Submit the form and check that the entities are updated accordingly.
-     $edit = array(
-       'field_single[und][0][value]' => 1,
-       'field_unlimited[und][0][value]' => 2,
-       'field_unlimited[und][1][value]' => 3,
-       'entity_2[field_single][und][0][value]' => 11,
-       'entity_2[field_unlimited][und][0][value]' => 12,
-       'entity_2[field_unlimited][und][1][value]' => 13,
-     );
-     $this->drupalPost(NULL, $edit, t('Save'));
-     field_cache_clear();
-     $entity_1 = field_test_create_stub_entity(1);
-     $entity_2 = field_test_create_stub_entity(2);
-     $this->assertFieldValues($entity_1, 'field_single', LANGUAGE_NONE, array(1));
-     $this->assertFieldValues($entity_1, 'field_unlimited', LANGUAGE_NONE, array(2, 3));
-     $this->assertFieldValues($entity_2, 'field_single', LANGUAGE_NONE, array(11));
-     $this->assertFieldValues($entity_2, 'field_unlimited', LANGUAGE_NONE, array(12, 13));
-
-     // Submit invalid values and check that errors are reported on the
-     // correct widgets.
-     $edit = array(
-       'field_unlimited[und][1][value]' => -1,
-     );
-     $this->drupalPost('test-entity/nested/1/2', $edit, t('Save'));
-     $this->assertRaw(t('%label does not accept the value -1', array('%label' => 'Unlimited field')), t('Entity 1: the field validation error was reported.'));
-     $error_field = $this->xpath('//input[@id=:id and contains(@class, "error")]', array(':id' => 'edit-field-unlimited-und-1-value'));
-     $this->assertTrue($error_field, t('Entity 1: the error was flagged on the correct element.'));
-     $edit = array(
-       'entity_2[field_unlimited][und][1][value]' => -1,
-     );
-     $this->drupalPost('test-entity/nested/1/2', $edit, t('Save'));
-     $this->assertRaw(t('%label does not accept the value -1', array('%label' => 'Unlimited field')), t('Entity 2: the field validation error was reported.'));
-     $error_field = $this->xpath('//input[@id=:id and contains(@class, "error")]', array(':id' => 'edit-entity-2-field-unlimited-und-1-value'));
-     $this->assertTrue($error_field, t('Entity 2: the error was flagged on the correct element.'));
-
-     // Test that reordering works on both entities.
-     $edit = array(
-       'field_unlimited[und][0][_weight]' => 0,
-       'field_unlimited[und][1][_weight]' => -1,
-       'entity_2[field_unlimited][und][0][_weight]' => 0,
-       'entity_2[field_unlimited][und][1][_weight]' => -1,
-     );
-     $this->drupalPost('test-entity/nested/1/2', $edit, t('Save'));
-     field_cache_clear();
-     $this->assertFieldValues($entity_1, 'field_unlimited', LANGUAGE_NONE, array(3, 2));
-     $this->assertFieldValues($entity_2, 'field_unlimited', LANGUAGE_NONE, array(13, 12));
-
-     // Test the 'add more' buttons. Only AJAX submission is tested, because
-     // the two 'add more' buttons present in the form have the same #value,
-     // which confuses drupalPost().
-     // 'Add more' button in the first entity:
-     $this->drupalGet('test-entity/nested/1/2');
-     $this->drupalPostAJAX(NULL, array(), 'field_unlimited_add_more');
-     $this->assertFieldByName('field_unlimited[und][0][value]', 3, t('Entity 1: field_unlimited value 0 appears correctly is the form.'));
-     $this->assertFieldByName('field_unlimited[und][1][value]', 2, t('Entity 1: field_unlimited value 1 appears correctly is the form.'));
-     $this->assertFieldByName('field_unlimited[und][2][value]', '', t('Entity 1: field_unlimited value 2 appears correctly is the form.'));
-     $this->assertFieldByName('field_unlimited[und][3][value]', '', t('Entity 1: an empty widget was added for field_unlimited value 3.'));
-     // 'Add more' button in the first entity (changing field values):
-     $edit = array(
-       'entity_2[field_unlimited][und][0][value]' => 13,
-       'entity_2[field_unlimited][und][1][value]' => 14,
-       'entity_2[field_unlimited][und][2][value]' => 15,
-     );
-     $this->drupalPostAJAX(NULL, $edit, 'entity_2_field_unlimited_add_more');
-     $this->assertFieldByName('entity_2[field_unlimited][und][0][value]', 13, t('Entity 2: field_unlimited value 0 appears correctly is the form.'));
-     $this->assertFieldByName('entity_2[field_unlimited][und][1][value]', 14, t('Entity 2: field_unlimited value 1 appears correctly is the form.'));
-     $this->assertFieldByName('entity_2[field_unlimited][und][2][value]', 15, t('Entity 2: field_unlimited value 2 appears correctly is the form.'));
-     $this->assertFieldByName('entity_2[field_unlimited][und][3][value]', '', t('Entity 2: an empty widget was added for field_unlimited value 3.'));
-     // Save the form and check values are saved correclty.
-     $this->drupalPost(NULL, array(), t('Save'));
-     field_cache_clear();
-     $this->assertFieldValues($entity_1, 'field_unlimited', LANGUAGE_NONE, array(3, 2));
-     $this->assertFieldValues($entity_2, 'field_unlimited', LANGUAGE_NONE, array(13, 14, 15));
+    // Add two instances on the 'test_bundle'
+    field_create_field($this->field_single);
+    field_create_field($this->field_unlimited);
+    $this->instance['field_name'] = 'field_single';
+    $this->instance['label'] = 'Single field';
+    field_create_instance($this->instance);
+    $this->instance['field_name'] = 'field_unlimited';
+    $this->instance['label'] = 'Unlimited field';
+    field_create_instance($this->instance);
+
+    // Create two entities.
+    $entity_1 = field_test_create_stub_entity(1, 1);
+    $entity_1->is_new = TRUE;
+    $entity_1->field_single[LANGUAGE_NONE][] = array('value' => 0);
+    $entity_1->field_unlimited[LANGUAGE_NONE][] = array('value' => 1);
+    field_test_entity_save($entity_1);
+
+    $entity_2 = field_test_create_stub_entity(2, 2);
+    $entity_2->is_new = TRUE;
+    $entity_2->field_single[LANGUAGE_NONE][] = array('value' => 10);
+    $entity_2->field_unlimited[LANGUAGE_NONE][] = array('value' => 11);
+    field_test_entity_save($entity_2);
+
+    // Display the 'combined form'.
+    $this->drupalGet('test-entity/nested/1/2');
+    $this->assertFieldByName('field_single[und][0][value]', 0, t('Entity 1: field_single value appears correctly is the form.'));
+    $this->assertFieldByName('field_unlimited[und][0][value]', 1, t('Entity 1: field_unlimited value 0 appears correctly is the form.'));
+    $this->assertFieldByName('entity_2[field_single][und][0][value]', 10, t('Entity 2: field_single value appears correctly is the form.'));
+    $this->assertFieldByName('entity_2[field_unlimited][und][0][value]', 11, t('Entity 2: field_unlimited value 0 appears correctly is the form.'));
+
+    // Submit the form and check that the entities are updated accordingly.
+    $edit = array(
+      'field_single[und][0][value]' => 1,
+      'field_unlimited[und][0][value]' => 2,
+      'field_unlimited[und][1][value]' => 3,
+      'entity_2[field_single][und][0][value]' => 11,
+      'entity_2[field_unlimited][und][0][value]' => 12,
+      'entity_2[field_unlimited][und][1][value]' => 13,
+    );
+    $this->drupalPost(NULL, $edit, t('Save'));
+    field_cache_clear();
+    $entity_1 = field_test_create_stub_entity(1);
+    $entity_2 = field_test_create_stub_entity(2);
+    $this->assertFieldValues($entity_1, 'field_single', LANGUAGE_NONE, array(1));
+    $this->assertFieldValues($entity_1, 'field_unlimited', LANGUAGE_NONE, array(2, 3));
+    $this->assertFieldValues($entity_2, 'field_single', LANGUAGE_NONE, array(11));
+    $this->assertFieldValues($entity_2, 'field_unlimited', LANGUAGE_NONE, array(12, 13));
+
+    // Submit invalid values and check that errors are reported on the
+    // correct widgets.
+    $edit = array(
+      'field_unlimited[und][1][value]' => -1,
+    );
+    $this->drupalPost('test-entity/nested/1/2', $edit, t('Save'));
+    $this->assertRaw(t('%label does not accept the value -1', array('%label' => 'Unlimited field')), t('Entity 1: the field validation error was reported.'));
+    $error_field = $this->xpath('//input[@id=:id and contains(@class, "error")]', array(':id' => 'edit-field-unlimited-und-1-value'));
+    $this->assertTrue($error_field, t('Entity 1: the error was flagged on the correct element.'));
+    $edit = array(
+      'entity_2[field_unlimited][und][1][value]' => -1,
+    );
+    $this->drupalPost('test-entity/nested/1/2', $edit, t('Save'));
+    $this->assertRaw(t('%label does not accept the value -1', array('%label' => 'Unlimited field')), t('Entity 2: the field validation error was reported.'));
+    $error_field = $this->xpath('//input[@id=:id and contains(@class, "error")]', array(':id' => 'edit-entity-2-field-unlimited-und-1-value'));
+    $this->assertTrue($error_field, t('Entity 2: the error was flagged on the correct element.'));
+
+    // Test that reordering works on both entities.
+    $edit = array(
+      'field_unlimited[und][0][_weight]' => 0,
+      'field_unlimited[und][1][_weight]' => -1,
+      'entity_2[field_unlimited][und][0][_weight]' => 0,
+      'entity_2[field_unlimited][und][1][_weight]' => -1,
+    );
+    $this->drupalPost('test-entity/nested/1/2', $edit, t('Save'));
+    field_cache_clear();
+    $this->assertFieldValues($entity_1, 'field_unlimited', LANGUAGE_NONE, array(3, 2));
+    $this->assertFieldValues($entity_2, 'field_unlimited', LANGUAGE_NONE, array(13, 12));
+
+    // Test the 'add more' buttons. Only Ajax submission is tested, because
+    // the two 'add more' buttons present in the form have the same #value,
+    // which confuses drupalPost().
+    // 'Add more' button in the first entity:
+    $this->drupalGet('test-entity/nested/1/2');
+    $this->drupalPostAJAX(NULL, array(), 'field_unlimited_add_more');
+    $this->assertFieldByName('field_unlimited[und][0][value]', 3, t('Entity 1: field_unlimited value 0 appears correctly is the form.'));
+    $this->assertFieldByName('field_unlimited[und][1][value]', 2, t('Entity 1: field_unlimited value 1 appears correctly is the form.'));
+    $this->assertFieldByName('field_unlimited[und][2][value]', '', t('Entity 1: field_unlimited value 2 appears correctly is the form.'));
+    $this->assertFieldByName('field_unlimited[und][3][value]', '', t('Entity 1: an empty widget was added for field_unlimited value 3.'));
+    // 'Add more' button in the first entity (changing field values):
+    $edit = array(
+      'entity_2[field_unlimited][und][0][value]' => 13,
+      'entity_2[field_unlimited][und][1][value]' => 14,
+      'entity_2[field_unlimited][und][2][value]' => 15,
+    );
+    $this->drupalPostAJAX(NULL, $edit, 'entity_2_field_unlimited_add_more');
+    $this->assertFieldByName('entity_2[field_unlimited][und][0][value]', 13, t('Entity 2: field_unlimited value 0 appears correctly is the form.'));
+    $this->assertFieldByName('entity_2[field_unlimited][und][1][value]', 14, t('Entity 2: field_unlimited value 1 appears correctly is the form.'));
+    $this->assertFieldByName('entity_2[field_unlimited][und][2][value]', 15, t('Entity 2: field_unlimited value 2 appears correctly is the form.'));
+    $this->assertFieldByName('entity_2[field_unlimited][und][3][value]', '', t('Entity 2: an empty widget was added for field_unlimited value 3.'));
+    // Save the form and check values are saved correclty.
+    $this->drupalPost(NULL, array(), t('Save'));
+    field_cache_clear();
+    $this->assertFieldValues($entity_1, 'field_unlimited', LANGUAGE_NONE, array(3, 2));
+    $this->assertFieldValues($entity_2, 'field_unlimited', LANGUAGE_NONE, array(13, 14, 15));
   }
 }
 
@@ -1827,7 +1875,7 @@ class FieldDisplayAPITestCase extends FieldTestCase {
       $item = $this->entity->{$this->field_name}[LANGUAGE_NONE][$delta];
       $output = field_view_value('test_entity', $this->entity, $this->field_name, $item, $display);
       $this->drupalSetContent(drupal_render($output));
-      $this->assertText($setting . '|0:' .  $value['value'], t('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
+      $this->assertText($setting . '|0:' . $value['value'], t('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
     }
 
     // Check that prepare_view steps are invoked.
@@ -1843,7 +1891,7 @@ class FieldDisplayAPITestCase extends FieldTestCase {
       $item = $this->entity->{$this->field_name}[LANGUAGE_NONE][$delta];
       $output = field_view_value('test_entity', $this->entity, $this->field_name, $item, $display);
       $this->drupalSetContent(drupal_render($output));
-      $this->assertText($setting . '|' .  $value['value'] . '|' . ($value['value'] + 1), t('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
+      $this->assertText($setting . '|' . $value['value'] . '|' . ($value['value'] + 1), t('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
     }
 
     // View mode: check that display settings specified in the instance are
@@ -2642,7 +2690,7 @@ class FieldTranslationsTestCase extends FieldTestCase {
     $extra_languages = mt_rand(1, 4);
     $languages = $available_languages = field_available_languages($this->entity_type, $this->field);
     for ($i = 0; $i < $extra_languages; ++$i) {
-      $languages[] = $this->randomString(2);
+      $languages[] = $this->randomName(2);
     }
 
     // For each given language provide some random values.
@@ -2667,10 +2715,14 @@ class FieldTranslationsTestCase extends FieldTestCase {
    * Test the multilanguage logic of _field_invoke_multiple().
    */
   function testFieldInvokeMultiple() {
+    // Enable field translations for the entity.
+    field_test_entity_info_translatable('test_entity', TRUE);
+
     $values = array();
+    $options = array();
     $entities = array();
     $entity_type = 'test_entity';
-    $entity_count = mt_rand(1, 5);
+    $entity_count = mt_rand(2, 5);
     $available_languages = field_available_languages($this->entity_type, $this->field);
 
     for ($id = 1; $id <= $entity_count; ++$id) {
@@ -2681,29 +2733,55 @@ class FieldTranslationsTestCase extends FieldTestCase {
       // correctly uses the result of field_available_languages().
       $extra_languages = mt_rand(1, 4);
       for ($i = 0; $i < $extra_languages; ++$i) {
-        $languages[] = $this->randomString(2);
+        $languages[] = $this->randomName(2);
       }
 
       // For each given language provide some random values.
-      foreach ($languages as $langcode) {
-        for ($delta = 0; $delta < $this->field['cardinality']; $delta++) {
-          $values[$id][$langcode][$delta]['value'] = mt_rand(1, 127);
+      $language_count = count($languages);
+      for ($i = 0; $i < $language_count; ++$i) {
+        $langcode = $languages[$i];
+        // Avoid to populate at least one field translation to check that
+        // per-entity language suggestions work even when available field values
+        // are different for each language.
+        if ($i !== $id) {
+          for ($delta = 0; $delta < $this->field['cardinality']; $delta++) {
+            $values[$id][$langcode][$delta]['value'] = mt_rand(1, 127);
+          }
+        }
+        // Ensure that a language for which there is no field translation is
+        // used as display language to prepare per-entity language suggestions.
+        elseif (!isset($display_language)) {
+          $display_language = $langcode;
         }
       }
+
       $entity->{$this->field_name} = $values[$id];
       $entities[$id] = $entity;
+
+      // Store per-entity language suggestions.
+      $options['language'][$id] = field_language($entity_type, $entity, NULL, $display_language);
     }
 
     $grouped_results = _field_invoke_multiple('test_op_multiple', $entity_type, $entities);
     foreach ($grouped_results as $id => $results) {
       foreach ($results as $langcode => $result) {
-        $hash = hash('sha256', serialize(array($entity_type, $entities[$id], $this->field_name, $langcode, $values[$id][$langcode])));
-        // Check whether the parameters passed to _field_invoke() were correctly
-        // forwarded to the callback function.
-        $this->assertEqual($hash, $result, t('The result for entity %id/%language is correctly stored.', array('%id' => $id, '%language' => $langcode)));
+        if (isset($values[$id][$langcode])) {
+          $hash = hash('sha256', serialize(array($entity_type, $entities[$id], $this->field_name, $langcode, $values[$id][$langcode])));
+          // Check whether the parameters passed to _field_invoke() were correctly
+          // forwarded to the callback function.
+          $this->assertEqual($hash, $result, t('The result for entity %id/%language is correctly stored.', array('%id' => $id, '%language' => $langcode)));
+        }
       }
       $this->assertEqual(count($results), count($available_languages), t('No unavailable language has been processed for entity %id.', array('%id' => $id)));
     }
+
+    $null = NULL;
+    $grouped_results = _field_invoke_multiple('test_op_multiple', $entity_type, $entities, $null, $null, $options);
+    foreach ($grouped_results as $id => $results) {
+      foreach ($results as $langcode => $result) {
+        $this->assertTrue(isset($options['language'][$id]), t('The result language %language for entity %id was correctly suggested (display language: %display_language).', array('%id' => $id, '%language' => $langcode, '%display_language' => $display_language)));
+      }
+    }
   }
 
   /**
@@ -2880,7 +2958,7 @@ class FieldBulkDeleteTestCase extends FieldTestCase {
   public static function getInfo() {
     return array(
       'name' => 'Field bulk delete tests',
-      'description'=> 'Bulk delete fields and instances, and clean up afterwards.',
+      'description' => 'Bulk delete fields and instances, and clean up afterwards.',
       'group' => 'Field API',
     );
   }
@@ -3127,7 +3205,7 @@ class EntityPropertiesTestCase extends FieldTestCase {
   public static function getInfo() {
     return array(
       'name' => 'Entity properties',
-      'description'=> 'Tests entity properties.',
+      'description' => 'Tests entity properties.',
       'group' => 'Entity API',
     );
   }
diff --git a/modules/field/tests/field_test.entity.inc b/modules/field/tests/field_test.entity.inc
index 37c29e221cd4328f26034eae5d0dd1ed1b9b13fc..b7c70a67711505e8effaf2e09cbab87ab433e3d2 100644
--- a/modules/field/tests/field_test.entity.inc
+++ b/modules/field/tests/field_test.entity.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: field_test.entity.inc,v 1.17 2010/11/20 19:57:01 webchick Exp $
 
 /**
  * @file
diff --git a/modules/field/tests/field_test.field.inc b/modules/field/tests/field_test.field.inc
index 46712920eff58a541921f0415d1c77b61e9460ba..b8a2939d64adeabac55595a9e15c8eafbdfd7b2e 100644
--- a/modules/field/tests/field_test.field.inc
+++ b/modules/field/tests/field_test.field.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: field_test.field.inc,v 1.14 2010/10/20 00:13:33 dries Exp $
 
 /**
  * @file
diff --git a/modules/field/tests/field_test.info b/modules/field/tests/field_test.info
index 6de86895fd51fb4f0112f5db0792538dc851c5f0..3ff588501f7b5ab47abd4f76552f15782450d0bd 100644
--- a/modules/field/tests/field_test.info
+++ b/modules/field/tests/field_test.info
@@ -1,4 +1,3 @@
-;$Id: field_test.info,v 1.2 2010/12/20 19:59:41 webchick Exp $
 name = "Field API Test"
 description = "Support module for the Field API tests."
 core = 7.x
@@ -7,8 +6,8 @@ files[] = field_test.entity.inc
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/field/tests/field_test.install b/modules/field/tests/field_test.install
index f92291282f267568dd43bc2fcaf426fa6503269d..59575611033c5fec5f1453b8b3b58c598597588b 100644
--- a/modules/field/tests/field_test.install
+++ b/modules/field/tests/field_test.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: field_test.install,v 1.5 2010/09/11 06:03:11 webchick Exp $
 
 /**
  * @file
diff --git a/modules/field/tests/field_test.module b/modules/field/tests/field_test.module
index 525c028642de0c274e7f5a9df1acb6035c843874..9e2fef62c5307f0c29f6e975b1cf6adc93a09b27 100644
--- a/modules/field/tests/field_test.module
+++ b/modules/field/tests/field_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: field_test.module,v 1.14 2010/12/07 05:09:58 webchick Exp $
 
 /**
  * @file
@@ -89,7 +88,9 @@ function field_test_field_test_op($entity_type, $entity, $field, $instance, $lan
 function field_test_field_test_op_multiple($entity_type, $entities, $field, $instances, $langcode, &$items) {
   $result = array();
   foreach ($entities as $id => $entity) {
-    $result[$id] = array($langcode => hash('sha256', serialize(array($entity_type, $entity, $field['field_name'], $langcode, $items[$id]))));
+    if (isset($items[$id])) {
+      $result[$id] = array($langcode => hash('sha256', serialize(array($entity_type, $entity, $field['field_name'], $langcode, $items[$id]))));
+    }
   }
   return $result;
 }
diff --git a/modules/field/tests/field_test.storage.inc b/modules/field/tests/field_test.storage.inc
index 84b75a4a2b5bdc75bba5a443cefc28f31fa7ac74..3ca322dd74e0f084df8debe5a9cbb3d573685b73 100644
--- a/modules/field/tests/field_test.storage.inc
+++ b/modules/field/tests/field_test.storage.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: field_test.storage.inc,v 1.8 2010/10/13 05:19:26 webchick Exp $
 
 /**
  * @file
@@ -288,7 +287,7 @@ function field_test_field_storage_query($field_id, $conditions, $count, &$cursor
           case '<=':
           case '>':
           case '>=':
-            eval('$match = $match && '. $row->{$column} . ' ' . $operator . ' '. $value);
+            eval('$match = $match && ' . $row->{$column} . ' ' . $operator . ' '. $value);
             break;
           case 'IN':
             $match = $match && in_array($row->{$column}, $value);
diff --git a/modules/field/theme/field-rtl.css b/modules/field/theme/field-rtl.css
index 723eac49590a127db3b0cd9b149364cca9d12628..5d35a86a11cb31e29629fed32e60b3799b7f6975 100644
--- a/modules/field/theme/field-rtl.css
+++ b/modules/field/theme/field-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: field-rtl.css,v 1.2 2010/05/22 20:23:01 dries Exp $ */
 
 form .field-multiple-table th.field-label {
   padding-right: 0;
diff --git a/modules/field/theme/field.css b/modules/field/theme/field.css
index e23f50d21f23b6ad1dd6c7ffd142a7228b8eed59..9eba32f0b7f56b4bc3bbbb9f05c6bf89a74af45c 100644
--- a/modules/field/theme/field.css
+++ b/modules/field/theme/field.css
@@ -1,4 +1,3 @@
-/* $Id: field.css,v 1.9 2010/05/22 20:23:01 dries Exp $ */
 
 /* Field display */
 .field .field-label {
diff --git a/modules/field/theme/field.tpl.php b/modules/field/theme/field.tpl.php
index 56502f065edf6804b0390eb8e02956631f598f11..e4cd85cd025b4803fc9fa8e7d674b91386cb8f16 100644
--- a/modules/field/theme/field.tpl.php
+++ b/modules/field/theme/field.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: field.tpl.php,v 1.13 2010/03/26 17:14:45 dries Exp $
 
 /**
  * @file field.tpl.php
diff --git a/modules/field_ui/field_ui-rtl.css b/modules/field_ui/field_ui-rtl.css
index 456d37f235a3dae0bf607089a3193439834e7a3a..123a840bf8f3a1543cf1329dbfde6e476309a88b 100644
--- a/modules/field_ui/field_ui-rtl.css
+++ b/modules/field_ui/field_ui-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: field_ui-rtl.css,v 1.3 2010/09/11 00:03:42 webchick Exp $ */
 
 /* 'Manage fields' overview */
 table.field-ui-overview tr.add-new .label-input {
diff --git a/modules/field_ui/field_ui.admin.inc b/modules/field_ui/field_ui.admin.inc
index 824709129eddcf5d49d1663f0cbd15c9c14c3d38..96beb13347c4804ce7f558a7188839b7c5b5737e 100644
--- a/modules/field_ui/field_ui.admin.inc
+++ b/modules/field_ui/field_ui.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: field_ui.admin.inc,v 1.88 2010/12/15 04:13:48 webchick Exp $
 
 /**
  * @file
@@ -875,7 +874,7 @@ function field_ui_display_overview_form($form, &$form_state, $entity_type, $bund
       'class' => array('field-ui-overview'),
       'id' => 'field-display-overview',
     ),
-    // Add AJAX wrapper.
+    // Add Ajax wrapper.
     '#prefix' => '<div id="field-display-overview-wrapper">',
     '#suffix' => '</div>',
   );
@@ -1157,7 +1156,7 @@ function field_ui_display_overview_form($form, &$form_state, $entity_type, $bund
       'callback' => 'field_ui_display_overview_multistep_js',
       'wrapper' => 'field-display-overview-wrapper',
       'effect' => 'fade',
-      // The button stays hidden, so we hide the AJAX spinner too. Ad-hoc
+      // The button stays hidden, so we hide the Ajax spinner too. Ad-hoc
       // spinners will be added manually by the client-side script.
       'progress' => 'none',
     ),
@@ -1218,7 +1217,7 @@ function field_ui_display_overview_multistep_submit($form, &$form_state) {
 }
 
 /**
- * AJAX handler for multistep buttons on the 'Manage display' screen.
+ * Ajax handler for multistep buttons on the 'Manage display' screen.
  */
 function field_ui_display_overview_multistep_js($form, &$form_state) {
   $trigger = $form_state['triggering_element'];
@@ -1793,7 +1792,7 @@ function field_ui_field_edit_form($form, &$form_state, $instance) {
     '#default_value' => !empty($instance['description']) ? $instance['description'] : '',
     '#rows' => 5,
     '#description' => t('Instructions to present to the user below this field on the editing form.<br />Allowed HTML tags: @tags', array('@tags' => _field_filter_xss_display_allowed_tags())),
-    '#weight' => 0,
+    '#weight' => -5,
   );
 
   // Build the widget component of the instance.
diff --git a/modules/field_ui/field_ui.api.php b/modules/field_ui/field_ui.api.php
index 0eff874a882aff6b08d00508aa6ec7e597932c55..e07a9373df33fa1fb86e13facadbee2b1a5fdf78 100644
--- a/modules/field_ui/field_ui.api.php
+++ b/modules/field_ui/field_ui.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: field_ui.api.php,v 1.10 2010/11/12 03:10:38 dries Exp $
 
 /**
  * @file
diff --git a/modules/field_ui/field_ui.css b/modules/field_ui/field_ui.css
index f9bc281658914afe04ca535894cc58759f5c54a2..c25d2a436c8dedf4d54469edb524b72d5fd1cc76 100644
--- a/modules/field_ui/field_ui.css
+++ b/modules/field_ui/field_ui.css
@@ -1,4 +1,3 @@
-/* $Id: field_ui.css,v 1.6 2010/11/20 09:06:32 webchick Exp $ */
 
 /* 'Manage fields' and 'Manage display' overviews */
 table.field-ui-overview tr.add-new .label-input {
diff --git a/modules/field_ui/field_ui.info b/modules/field_ui/field_ui.info
index 324dce84b7abdba480469bdeeaf8360f99dffdab..b8b129003bbb881054d1c74385847fccd06af541 100644
--- a/modules/field_ui/field_ui.info
+++ b/modules/field_ui/field_ui.info
@@ -1,4 +1,3 @@
-; $Id: field_ui.info,v 1.5 2010/12/20 19:59:41 webchick Exp $
 name = Field UI
 description = User interface for the Field API.
 package = Core
@@ -7,8 +6,8 @@ core = 7.x
 dependencies[] = field
 files[] = field_ui.test
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/field_ui/field_ui.js b/modules/field_ui/field_ui.js
index cae909f4a5eda32022defabe5fa551e5fc1c5c3b..b63399f3d28dab70a58958f9bc87a1cdbfdc1c87 100644
--- a/modules/field_ui/field_ui.js
+++ b/modules/field_ui/field_ui.js
@@ -1,4 +1,3 @@
-// $Id: field_ui.js,v 1.8 2010/11/21 08:50:49 webchick Exp $
 
 (function($) {
 
@@ -167,7 +166,7 @@ Drupal.fieldUIOverview = {
         refreshRows = rowHandler.regionChange(region);
         // Update the row region.
         rowHandler.region = region;
-        // AJAX-update the rows.
+        // Ajax-update the rows.
         Drupal.fieldUIOverview.AJAXRefreshRows(refreshRows);
       }
     }
@@ -206,7 +205,7 @@ Drupal.fieldUIOverview = {
   },
 
   /**
-   * Triggers AJAX refresh of selected rows.
+   * Triggers Ajax refresh of selected rows.
    *
    * The 'format type' selects can trigger a series of changes in child rows.
    * The #ajax behavior is therefore not attached directly to the selects, but
@@ -215,7 +214,7 @@ Drupal.fieldUIOverview = {
    * @param rows
    *   A hash object, whose keys are the names of the rows to refresh (they
    *   will receive the 'ajax-new-content' effect on the server side), and
-   *   whose values are the DOM element in the row that should get an AJAX
+   *   whose values are the DOM element in the row that should get an Ajax
    *   throbber.
    */
   AJAXRefreshRows: function (rows) {
@@ -234,7 +233,7 @@ Drupal.fieldUIOverview = {
         .addClass('progress-disabled')
         .after($throbber);
 
-      // Fire the AJAX update.
+      // Fire the Ajax update.
       $('input[name=refresh_rows]').val(rowNames.join(' '));
       $('input#edit-refresh').mousedown();
 
@@ -295,7 +294,7 @@ Drupal.fieldUIDisplayOverview.field.prototype = {
    * @param region
    *   The name of the new region for the row.
    * @return
-   *   A hash object indicating which rows should be AJAX-updated as a result
+   *   A hash object indicating which rows should be Ajax-updated as a result
    *   of the change, in the format expected by
    *   Drupal.displayOverview.AJAXRefreshRows().
    */
diff --git a/modules/field_ui/field_ui.module b/modules/field_ui/field_ui.module
index 9af3327adca04cde7393d2084c4b684902a07591..7355e879bc11ae353db20a7660a0978ed7cf003b 100644
--- a/modules/field_ui/field_ui.module
+++ b/modules/field_ui/field_ui.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: field_ui.module,v 1.34 2010/11/21 07:28:39 webchick Exp $
 
 /**
  * @file
@@ -24,7 +23,7 @@ function field_ui_help($path, $arg) {
       $output .= '<dt>' . t('What type of data the field will store') . '</dt>';
       $output .= '<dd>' . t('Each field can store one type of data (text, number, file, etc.). When you define a field, you choose a particular <em>field type</em>, which corresponds to the type of data you want to store. The field type cannot be changed after you have created the field.') . '</dd>';
       $output .= '<dt>' . t('How the data will be input and displayed') . '</dt>';
-      $output .= '<dd>' . t('Each field type has one or more available <em>widgets</em> associated with it; each widget provides a mechanism for data input when you are editing (text box, select list, file upload, etc.). Each field type also has one or more display options, which determine how the field is displayed to site visitors. The widget and display display options can be changed after you have created the field.') . '</dd>';
+      $output .= '<dd>' . t('Each field type has one or more available <em>widgets</em> associated with it; each widget provides a mechanism for data input when you are editing (text box, select list, file upload, etc.). Each field type also has one or more display options, which determine how the field is displayed to site visitors. The widget and display options can be changed after you have created the field.') . '</dd>';
       $output .= '<dt>' . t('How many values the field will store') . '</dt>';
       $output .= '<dd>' . t('You can store one value, a specific maximum number of values, or an unlimited number of values in each field. For example, an employee identification number field might store a single number, whereas a phone number field might store multiple phone numbers. This setting can be changed after you have created the field, but if you reduce the maximum number of values, you may lose information.') . '</dd>';
       $output .= '</dl>';
@@ -234,7 +233,7 @@ function field_ui_menu_load($field_name, $entity_type, $bundle_name, $bundle_pos
  * Menu title callback.
  */
 function field_ui_menu_title($instance) {
-  return t($instance['label']);
+  return $instance['label'];
 }
 
 /**
@@ -363,4 +362,3 @@ function field_ui_form_node_type_form_submit($form, &$form_state) {
     $form_state['redirect'] = _field_ui_bundle_admin_path('node', $form_state['values']['type']) .'/fields';
   }
 }
-
diff --git a/modules/field_ui/field_ui.test b/modules/field_ui/field_ui.test
index 1f1b43f8b8b8a3e37f9b0004046b205156bef739..77f79ce33cdbdb08e57c1f25beb9160adde592a6 100644
--- a/modules/field_ui/field_ui.test
+++ b/modules/field_ui/field_ui.test
@@ -1,9 +1,8 @@
 <?php
-// $Id: field_ui.test,v 1.27 2010/10/27 18:29:17 dries Exp $
 
 /**
  * @file
- * Unit test file for fields in core UI.
+ * Tests for field_ui.module.
  */
 
 /**
@@ -389,7 +388,7 @@ class FieldUIManageFieldsTestCase extends FieldUITestCase {
       'bundle' => $this->type,
       'entity_type' => 'node',
       'label' => t('Hidden field'),
-      'widget_type' => 'test_field_widget',
+      'widget' => array('type' => 'test_field_widget'),
     );
     field_create_instance($instance);
     $this->assertTrue(field_read_instance('node', $field_name, $this->type), t('An instance of the field %field was created programmatically.', array('%field' => $field_name)));
diff --git a/modules/file/file.api.php b/modules/file/file.api.php
index 1d0ee36226c3179328b3b4031f9a5107978bf9f3..76fb9861070a9904eecd93bc9b698be958e6e8b9 100644
--- a/modules/file/file.api.php
+++ b/modules/file/file.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: file.api.php,v 1.1 2010/08/23 14:53:50 webchick Exp $
 
 /**
  * @file
@@ -42,7 +41,7 @@ function hook_file_download_access($field, $entity_type, $entity) {
  *
  * @see hook_file_download_access().
  *
- * @param &$grants
+ * @param $grants
  *   An array of grants gathered by hook_file_download_access(). The array is
  *   keyed by the module that defines the entity type's access control; the
  *   values are Boolean grant responses for each module.
diff --git a/modules/file/file.css b/modules/file/file.css
index e94c8a16704d6cf5f45328c81a1083c5281580d1..aed1a9d34cef5d4bf83c8c49fada501f6f2fae41 100644
--- a/modules/file/file.css
+++ b/modules/file/file.css
@@ -1,4 +1,3 @@
-/* $Id: file.css,v 1.1 2009/08/29 12:52:32 dries Exp $ */
 
 /**
  * Managed file element styles.
diff --git a/modules/file/file.field.inc b/modules/file/file.field.inc
index e58f0877fe4969807b771b266b99b39c7901cb06..2af3cb620be789c4a413dff770eface5327f0ca3 100644
--- a/modules/file/file.field.inc
+++ b/modules/file/file.field.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: file.field.inc,v 1.42 2010/12/24 15:25:28 webchick Exp $
 
 /**
  * @file
@@ -203,9 +202,9 @@ function file_field_prepare_view($entity_type, $entities, $field, $instances, $l
       if (!file_field_displayed($item, $field)) {
         unset($items[$id][$delta]);
       }
-      // Ensure consecutive deltas.
-      $items[$id] = array_values($items[$id]);
     }
+    // Ensure consecutive deltas.
+    $items[$id] = array_values($items[$id]);
   }
 }
 
@@ -448,7 +447,7 @@ function file_field_widget_form(&$form, &$form_state, $field, $instance, $langco
     'description' => '',
   );
 
-  // Retrieve any values set in $form_state, as will be the case during AJAX
+  // Retrieve any values set in $form_state, as will be the case during Ajax
   // rebuilds of this form.
   if (isset($form_state['values'])) {
     $path = array_merge($element['#field_parents'], array($field['field_name'], $langcode));
@@ -568,14 +567,17 @@ function file_field_widget_upload_validators($field, $instance) {
  *   A field array.
  * @param $instance
  *   A field instance array.
+ * @param $data
+ *   An array of token objects to pass to token_replace().
  * @return
  *   A file directory URI with tokens replaced.
+ *
+ * @see token_replace()
  */
-function file_field_widget_uri($field, $instance, $account = NULL) {
+function file_field_widget_uri($field, $instance, $data = array()) {
   $destination = trim($instance['settings']['file_directory'], '/');
 
   // Replace tokens.
-  $data = array('user' => isset($account) ? $account : $GLOBALS['user']);
   $destination = token_replace($destination, $data);
 
   return $field['settings']['uri_scheme'] . '://' . $destination;
@@ -650,7 +652,7 @@ function file_field_widget_process($element, &$form_state, $form) {
     );
   }
 
-  // Adjust the AJAX settings so that on upload and remove of any individual
+  // Adjust the Ajax settings so that on upload and remove of any individual
   // file, the entire group of file fields is updated together.
   if ($field['cardinality'] != 1) {
     $parents = array_slice($element['#array_parents'], 0, -1);
@@ -681,7 +683,7 @@ function file_field_widget_process($element, &$form_state, $form) {
 /**
  * An element #process callback for a group of file_generic fields.
  *
- * Adds the weight field to each row so it can be ordered and adds a new AJAX
+ * Adds the weight field to each row so it can be ordered and adds a new Ajax
  * wrapper around the entire group so it can be replaced all at once.
  */
 function file_field_widget_process_multiple($element, &$form_state, $form) {
@@ -710,7 +712,7 @@ function file_field_widget_process_multiple($element, &$form_state, $form) {
     }
   }
 
-  // Add a new wrapper around all the elements for AJAX replacement.
+  // Add a new wrapper around all the elements for Ajax replacement.
   $element['#prefix'] = '<div id="' . $element['#id'] . '-ajax-wrapper">';
   $element['#suffix'] = '</div>';
 
@@ -770,7 +772,7 @@ function theme_file_widget($variables) {
   $element = $variables['element'];
   $output = '';
 
-  // The "form-managed-file" class is required for proper AJAX functionality.
+  // The "form-managed-file" class is required for proper Ajax functionality.
   $output .= '<div class="file-widget form-managed-file clearfix">';
   if ($element['fid']['#value'] != 0) {
     // Add the file size after the file name.
diff --git a/modules/file/file.info b/modules/file/file.info
index e2b6edeb276c9f81c529595afdcd900a88072e4a..ffb4c7748370cd0a3b4536e5ca04dd05d3279447 100644
--- a/modules/file/file.info
+++ b/modules/file/file.info
@@ -1,4 +1,3 @@
-; $Id: file.info,v 1.3 2010/12/20 19:59:41 webchick Exp $
 name = File
 description = Defines a file field type.
 package = Core
@@ -7,8 +6,8 @@ core = 7.x
 dependencies[] = field
 files[] = tests/file.test
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/file/file.install b/modules/file/file.install
index fab07ed10241f75a6d451d9dd199fe6efac21381..47ee4fd0014b3f29c87da274968a1d969d61224a 100644
--- a/modules/file/file.install
+++ b/modules/file/file.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: file.install,v 1.5 2010/11/21 09:24:41 webchick Exp $
 
 /**
  * @file
diff --git a/modules/file/file.js b/modules/file/file.js
index 19cd8061f96d0e980e91d3fff6b40badf49e24a9..1071384f8a189f7f6d80493230a0081337d338a1 100644
--- a/modules/file/file.js
+++ b/modules/file/file.js
@@ -1,11 +1,10 @@
-// $Id: file.js,v 1.6 2010/11/23 05:51:16 webchick Exp $
 
 /**
  * @file
  * Provides JavaScript additions to the managed file field type.
  *
  * This file provides progress bar support (if available), popup windows for
- * file previews, and disabling of other file fields during AJAX uploads (which
+ * file previews, and disabling of other file fields during Ajax uploads (which
  * prevents separate file fields from accidentally uploading files).
  */
 
@@ -90,7 +89,7 @@ Drupal.file = Drupal.file || {
   disableFields: function (event){
     var clickedButton = this;
 
-    // Only disable upload fields for AJAX buttons.
+    // Only disable upload fields for Ajax buttons.
     if (!$(clickedButton).hasClass('ajax-processed')) {
       return;
     }
@@ -105,7 +104,7 @@ Drupal.file = Drupal.file || {
     // working with. Filter out fields that are already disabled so that they
     // do not get enabled when we re-enable these fields at the end of behavior
     // processing. Re-enable in a setTimeout set to a relatively short amount
-    // of time (1 second). All the other mousedown handlers (like Drupal's AJAX
+    // of time (1 second). All the other mousedown handlers (like Drupal's Ajax
     // behaviors) are excuted before any timeout functions are called, so we
     // don't have to worry about the fields being re-enabled too soon.
     // @todo If the previous sentence is true, why not set the timeout to 0?
diff --git a/modules/file/file.module b/modules/file/file.module
index 2dd2bad312a8ac1aa44850338b9562b7812c8547..3e4525119611cf49c3ff46f864e6a0a72989cf13 100644
--- a/modules/file/file.module
+++ b/modules/file/file.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: file.module,v 1.50 2010/12/29 04:35:23 webchick Exp $
 
 /**
  * @file
@@ -161,7 +160,8 @@ function file_file_download($uri, $field_type = 'file') {
     foreach ($field_references as $entity_type => $type_references) {
       foreach ($type_references as $id => $reference) {
         // Try to load $entity and $field.
-        $entity = reset(entity_load($entity_type, array($id)));
+        $entity = entity_load($entity_type, array($id));
+        $entity = reset($entity);
         $field = NULL;
         if ($entity) {
           // Load all fields for that entity.
@@ -221,7 +221,7 @@ function file_file_download($uri, $field_type = 'file') {
 }
 
 /**
- * Menu callback; Shared AJAX callback for file uploads and deletions.
+ * Menu callback; Shared Ajax callback for file uploads and deletions.
  *
  * This rebuilds the form element for a particular field item. As long as the
  * form processing is properly encapsulated in the widget element the form
@@ -265,7 +265,7 @@ function file_ajax_upload() {
     $form = $form[$parent];
   }
 
-  // Add the special AJAX class if a new file was added.
+  // Add the special Ajax class if a new file was added.
   if (isset($form['#file_upload_delta']) && $current_file_count < $form['#file_upload_delta']) {
     $form[$current_file_count]['#attributes']['class'][] = 'ajax-new-content';
   }
@@ -453,7 +453,7 @@ function file_managed_file_process($element, &$form_state, $form) {
     );
   }
 
-  // Prefix and suffix used for AJAX replacement.
+  // Prefix and suffix used for Ajax replacement.
   $element['#prefix'] = '<div id="' . $element['#id'] . '-ajax-wrapper">';
   $element['#suffix'] = '</div>';
 
@@ -976,7 +976,7 @@ function file_get_file_references($file, $field = NULL, $age = FIELD_LOAD_REVISI
     }
   }
 
-  return isset($field) ? $references[$field['field_name']] : $references;
+  return isset($field) ? $references[$field['field_name']] : array_filter($references);
 }
 
 /**
diff --git a/modules/file/tests/file.test b/modules/file/tests/file.test
index 629119785022852d114531aed0d168208f731ec9..ea8c5c67bb9958feb6fb5b19d779651144ac4b0c 100644
--- a/modules/file/tests/file.test
+++ b/modules/file/tests/file.test
@@ -1,9 +1,8 @@
 <?php
-// $Id: file.test,v 1.29 2010/12/11 01:32:20 dries Exp $
 
 /**
  * @file
- * Tests file uploading through the File module.
+ * Tests for file.module.
  */
 
 /**
@@ -254,7 +253,7 @@ class FileManagedFileElementTestCase extends FileFieldTestCase {
         $this->drupalPost($path . '/' . $last_fid, array(), t('Save'));
         $this->assertRaw(t('The file id is %fid.', array('%fid' => $last_fid)), t('Empty submission did not change an existing file.'));
 
-        // Now, test the Upload and Remove buttons, with and without AJAX.
+        // Now, test the Upload and Remove buttons, with and without Ajax.
         foreach (array(FALSE, TRUE) as $ajax) {
           // Upload, then Submit.
           $last_fid_prior = $this->getLastFileId();
@@ -302,7 +301,7 @@ class FileManagedFileElementTestCase extends FileFieldTestCase {
 }
 
 /**
- * Test class to test file field widget, single and multi-valued, with and without AJAX, with public and private files.
+ * Test class to test file field widget, single and multi-valued, with and without Ajax, with public and private files.
  */
 class FileFieldWidgetTestCase extends FileFieldTestCase {
   public static function getInfo() {
@@ -314,7 +313,7 @@ class FileFieldWidgetTestCase extends FileFieldTestCase {
   }
 
   /**
-   * Tests upload and remove buttons, with and without AJAX, for a single-valued File field.
+   * Tests upload and remove buttons, with and without Ajax, for a single-valued File field.
    */
   function testSingleValuedWidget() {
     // Use 'page' instead of 'article', so that the 'article' image field does
@@ -371,7 +370,7 @@ class FileFieldWidgetTestCase extends FileFieldTestCase {
   }
 
   /**
-   * Tests upload and remove buttons, with and without AJAX, for a multi-valued File field.
+   * Tests upload and remove buttons, with and without Ajax, for a multi-valued File field.
    */
   function testMultiValuedWidget() {
     // Use 'page' instead of 'article', so that the 'article' image field does
@@ -390,7 +389,7 @@ class FileFieldWidgetTestCase extends FileFieldTestCase {
       // Visit the node creation form, and upload 3 files. Since the field has
       // cardinality of 3, ensure the "Upload" button is displayed until after
       // the 3rd file, and after that, isn't displayed.
-      // @todo This is only testing a non-AJAX upload, because drupalPostAJAX()
+      // @todo This is only testing a non-Ajax upload, because drupalPostAJAX()
       //   does not yet emulate jQuery's file upload.
       $this->drupalGet("node/add/$type_name");
       for ($delta = 0; $delta < 3; $delta++) {
@@ -933,7 +932,7 @@ class FileFieldPathTestCase extends FileFieldTestCase {
 
     // Check the path when used with tokens.
     // Change the path to contain multiple token directories.
-    $field = $this->updateFileField($field_name, $type_name, array('file_directory' => '[user:uid]/[user:name]'));
+    $field = $this->updateFileField($field_name, $type_name, array('file_directory' => '[current-user:uid]/[current-user:name]'));
 
     // Upload a new file into the token subdirectories.
     $nid = $this->uploadNodeFile($test_file, $field_name, $type_name);
@@ -941,6 +940,8 @@ class FileFieldPathTestCase extends FileFieldTestCase {
     // Check that the file was uploaded into the subdirectory.
     $node = node_load($nid, NULL, TRUE);
     $node_file = (object) $node->{$field_name}[LANGUAGE_NONE][0];
+    // Do token replacement using the same user which uploaded the file, not
+    // the user running the test case.
     $data = array('user' => $this->admin_user);
     $subdirectory = token_replace('[user:uid]/[user:name]', $data);
     $this->assertPathMatch('public://' . $subdirectory . '/' . $test_file->filename, $node_file->uri, t('The file %file was uploaded to the correct path with token replacements.', array('%file' => $node_file->uri)));
@@ -1027,7 +1028,7 @@ class FileTokenReplaceTestCase extends FileFieldTestCase {
 
     foreach ($tests as $input => $expected) {
       $output = token_replace($input, array('file' => $file), array('language' => $language));
-      $this->assertFalse(strcmp($output, $expected), t('Sanitized file token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, t('Sanitized file token %token replaced.', array('%token' => $input)));
     }
 
     // Generate and test unsanitized tokens.
@@ -1039,7 +1040,7 @@ class FileTokenReplaceTestCase extends FileFieldTestCase {
 
     foreach ($tests as $input => $expected) {
       $output = token_replace($input, array('file' => $file), array('language' => $language, 'sanitize' => FALSE));
-      $this->assertFalse(strcmp($output, $expected), t('Unsanitized file token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, t('Unsanitized file token %token replaced.', array('%token' => $input)));
     }
   }
 }
diff --git a/modules/file/tests/file_module_test.info b/modules/file/tests/file_module_test.info
index 9c6ee0ad00a3306e10a73058f1c62630a1843983..d49bd9a9f9cf456ab9a811982022bb5060a62a56 100644
--- a/modules/file/tests/file_module_test.info
+++ b/modules/file/tests/file_module_test.info
@@ -1,4 +1,3 @@
-; $Id: file_module_test.info,v 1.2 2010/12/20 19:59:41 webchick Exp $
 name = File test
 description = Provides hooks for testing File module functionality.
 package = Core
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/file/tests/file_module_test.module b/modules/file/tests/file_module_test.module
index b02134a47a4b5fb14c326fb74ed9373b70c550bb..ea65981caede245d1b807a7dd8021d99c418d5b6 100644
--- a/modules/file/tests/file_module_test.module
+++ b/modules/file/tests/file_module_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: file_module_test.module,v 1.4 2010/11/13 14:04:08 dries Exp $
 
 /**
  * @file
diff --git a/modules/filter/filter.admin.inc b/modules/filter/filter.admin.inc
index 465d7520c04529d0e103c519c5cf2f9ae5be8de6..5a21e6e2e61067df201f8f8b3505a034377dd6d4 100644
--- a/modules/filter/filter.admin.inc
+++ b/modules/filter/filter.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: filter.admin.inc,v 1.71 2010/12/14 02:40:15 dries Exp $
 
 /**
  * @file
diff --git a/modules/filter/filter.admin.js b/modules/filter/filter.admin.js
index bb90755c687b17aad7623326311ad4dafd58158c..3bc623373ced00c54b81aa3fcd404b464193c227 100644
--- a/modules/filter/filter.admin.js
+++ b/modules/filter/filter.admin.js
@@ -1,4 +1,3 @@
-// $Id: filter.admin.js,v 1.4 2010/04/16 13:55:06 dries Exp $
 (function ($) {
 
 Drupal.behaviors.filterStatus = {
diff --git a/modules/filter/filter.api.php b/modules/filter/filter.api.php
index b43af6f9c6763e193e51ca48d732739035207bf6..6675e4af556d0312599aa41694f0be9ebabacb6a 100644
--- a/modules/filter/filter.api.php
+++ b/modules/filter/filter.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: filter.api.php,v 1.22 2010/12/09 02:04:16 dries Exp $
 
 /**
  * @file
diff --git a/modules/filter/filter.css b/modules/filter/filter.css
index 4fe4af994e128e332bc05ff09c6cd9d4a1dba1ee..f7317338176b16896c60541826fc3a97395857ea 100644
--- a/modules/filter/filter.css
+++ b/modules/filter/filter.css
@@ -1,4 +1,3 @@
-/* $Id: filter.css,v 1.6 2010/09/19 18:10:41 dries Exp $ */
 
 .text-format-wrapper .form-item {
   margin-bottom: 0;
diff --git a/modules/filter/filter.info b/modules/filter/filter.info
index c6b614d273b94c7f1283a27a0167b2d7077c8d24..e60046d4a2c999dc3ecbfca32048e6e61ee0e1d5 100644
--- a/modules/filter/filter.info
+++ b/modules/filter/filter.info
@@ -1,4 +1,3 @@
-; $Id: filter.info,v 1.14 2010/12/20 19:59:42 webchick Exp $
 name = Filter
 description = Filters content in preparation for display.
 package = Core
@@ -8,8 +7,8 @@ files[] = filter.test
 required = TRUE
 configure = admin/config/content/formats
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/filter/filter.install b/modules/filter/filter.install
index b62caef9e045c1d73abb4ee31f12c05e463aac98..84512cd589f404b61d4903e7dc4af8d7e13fd188 100644
--- a/modules/filter/filter.install
+++ b/modules/filter/filter.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: filter.install,v 1.51 2011/01/02 17:26:39 webchick Exp $
 
 /**
  * @file
diff --git a/modules/filter/filter.js b/modules/filter/filter.js
index faee1190e0c76d5c8141996d68857aa731985085..94e01c1af7e3500e8ce9e420c684e19c60d33b9a 100644
--- a/modules/filter/filter.js
+++ b/modules/filter/filter.js
@@ -1,4 +1,3 @@
-// $Id: filter.js,v 1.3 2010/09/13 00:59:47 dries Exp $
 (function ($) {
 
 /**
diff --git a/modules/filter/filter.module b/modules/filter/filter.module
index 5365a2fe6e44f1c4f4f6d4b915ad027bef8a8e49..66fadcba74f2d8650c4da08f76929ef9d0feb7e8 100644
--- a/modules/filter/filter.module
+++ b/modules/filter/filter.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: filter.module,v 1.361 2010/12/09 02:04:16 dries Exp $
 
 /**
  * @file
@@ -1392,7 +1391,7 @@ function _filter_url($text, $filter) {
   $domain = '(?:[A-Za-z0-9._+-]+\.)?[A-Za-z]{2,64}\b';
   $ip = '(?:[0-9]{1,3}\.){3}[0-9]{1,3}';
   $auth = '[a-zA-Z0-9:%_+*~#?&=.,/;-]+@';
-  $trail = '[a-zA-Z0-9:%_+*~#&\[\]=/;?\.,-]*[a-zA-Z0-9:%_+*~#&\[\]=/;-]';
+  $trail = '[a-zA-Z0-9:%_+*~#&\[\]=/;?!\.,-]*[a-zA-Z0-9:%_+*~#&\[\]=/;-]';
 
   // Prepare pattern for optional trailing punctuation.
   // Even these characters could have a valid meaning for the URL, such usage is
@@ -1590,11 +1589,12 @@ function _filter_autop($text) {
   // All block level tags
   $block = '(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|p|h[1-6]|hr)';
 
-  // Split at opening and closing PRE, SCRIPT, STYLE, OBJECT tags and comments.
-  // We don't apply any processing to the contents of these tags to avoid messing
-  // up code. We look for matched pairs and allow basic nesting. For example:
+  // Split at opening and closing PRE, SCRIPT, STYLE, OBJECT, IFRAME tags
+  // and comments. We don't apply any processing to the contents of these tags
+  // to avoid messing up code. We look for matched pairs and allow basic
+  // nesting. For example:
   // "processed <pre> ignored <script> ignored </script> ignored </pre> processed"
-  $chunks = preg_split('@(<!--.*?-->|</?(?:pre|script|style|object|!--)[^>]*>)@i', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
+  $chunks = preg_split('@(<!--.*?-->|</?(?:pre|script|style|object|iframe|!--)[^>]*>)@i', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
   // Note: PHP ensures the array consists of alternating delimiters and literals
   // and begins and ends with a literal (inserting NULL as required).
   $ignore = FALSE;
@@ -1602,9 +1602,14 @@ function _filter_autop($text) {
   $output = '';
   foreach ($chunks as $i => $chunk) {
     if ($i % 2) {
-      // Opening or closing tag?
-      $open = ($chunk[1] != '/' || $chunk[1] != '!');
       $comment = (substr($chunk, 0, 4) == '<!--');
+      if ($comment) {
+        // Nothing to do, this is a comment.
+        $output .= $chunk;
+        continue;
+      }
+      // Opening or closing tag?
+      $open = ($chunk[1] != '/');
       list($tag) = preg_split('/[ >]/', substr($chunk, 2 - $open), 2);
       if (!$ignore) {
         if ($open) {
@@ -1613,7 +1618,7 @@ function _filter_autop($text) {
         }
       }
       // Only allow a matching tag to close it.
-      elseif ((!$open && $ignoretag == $tag) || $comment) {
+      elseif (!$open && $ignoretag == $tag) {
         $ignore = FALSE;
         $ignoretag = '';
       }
diff --git a/modules/filter/filter.pages.inc b/modules/filter/filter.pages.inc
index af32fbf3f9c60aa352831bc9b3f58a8f31e817b9..dbbbe4c5aac129498ed42a319c669c2281639fdd 100644
--- a/modules/filter/filter.pages.inc
+++ b/modules/filter/filter.pages.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: filter.pages.inc,v 1.11 2010/09/16 18:00:43 dries Exp $
 
 /**
  * @file
@@ -40,7 +39,7 @@ function filter_tips_long() {
  *         ),
  *       );
  *     @endcode
- *   - long: (optional) Whether the passed in filter tips contain extended
+ *   - long: (optional) Whether the passed-in filter tips contain extended
  *     explanations, i.e. intended to be output on the path 'filter/tips'
  *     (TRUE), or are in a short format, i.e. suitable to be displayed below a
  *     form element. Defaults to FALSE.
diff --git a/modules/filter/filter.test b/modules/filter/filter.test
index 55d1117976d1cb0924ad7f2c573e387fffc97d30..a3d1bde40573aeb6555e1f9fe6e48405a0c97ba9 100644
--- a/modules/filter/filter.test
+++ b/modules/filter/filter.test
@@ -1,5 +1,9 @@
 <?php
-// $Id: filter.test,v 1.82 2010/12/01 00:00:21 webchick Exp $
+
+/**
+ * @file
+ * Tests for filter.module.
+ */
 
 /**
  * Tests for text format and filter CRUD operations.
@@ -828,6 +832,25 @@ class FilterUnitTestCase extends DrupalUnitTestCase {
       '<blockquote><pre>aaa</pre></blockquote>' => array(
         "<blockquote><pre>aaa</pre></blockquote>" => TRUE,
       ),
+      "<pre>aaa\nbbb\nccc</pre>\nddd\neee" => array(
+        "<pre>aaa\nbbb\nccc</pre>" => TRUE,
+        "<p>ddd<br />\neee</p>" => TRUE,
+      ),
+      // Comments remain unchanged and subsequent lines/paragraphs are
+      // transformed normally.
+      "aaa<!--comment-->\n\nbbb\n\nccc\n\nddd<!--comment\nwith linebreak-->\n\neee\n\nfff" => array(
+        "<p>aaa</p>\n<!--comment--><p>\nbbb</p>\n<p>ccc</p>\n<p>ddd</p>" => TRUE,
+        "<!--comment\nwith linebreak--><p>\neee</p>\n<p>fff</p>" => TRUE,
+      ),
+      // Check that a comment in a PRE will result that the text after
+      // the comment, but still in PRE, is not transformed.
+      "<pre>aaa\nbbb<!-- comment -->\n\nccc</pre>\nddd" => array(
+        "<pre>aaa\nbbb<!-- comment -->\n\nccc</pre>" => TRUE,
+      ),
+      // Bug 810824, paragraphs were appearing around iframe tags.
+      "<iframe>aaa</iframe>\n\n" => array(
+        "<p><iframe>aaa</iframe></p>" => FALSE,
+      ),
     );
     $this->assertFilteredString($filter, $tests);
 
@@ -1176,10 +1199,11 @@ person@example.com or mailto:person2@example.com
         '<a href="mailto:person@example.com">person@example.com</a>' => TRUE,
         '<a href="mailto:person2@example.com">mailto:person2@example.com</a>' => TRUE,
       ),
-      // URI parts.
+      // URI parts and special characters.
       '
 http://trailingslash.com/ or www.trailingslash.com/
 http://host.com/some/path?query=foo&bar[baz]=beer#fragment or www.host.com/some/path?query=foo&bar[baz]=beer#fragment
+http://twitter.com/#!/example/status/22376963142324226
 ftp://user:pass@ftp.example.com/~home/dir1
 sftp://user@nonstandardport:222/dir
 ssh://192.168.0.100/srv/git/drupal.git
@@ -1188,6 +1212,7 @@ ssh://192.168.0.100/srv/git/drupal.git
         '<a href="http://www.trailingslash.com/">www.trailingslash.com/</a>' => TRUE,
         '<a href="http://host.com/some/path?query=foo&amp;bar[baz]=beer#fragment">http://host.com/some/path?query=foo&amp;bar[baz]=beer#fragment</a>' => TRUE,
         '<a href="http://www.host.com/some/path?query=foo&amp;bar[baz]=beer#fragment">www.host.com/some/path?query=foo&amp;bar[baz]=beer#fragment</a>' => TRUE,
+        '<a href="http://twitter.com/#!/example/status/22376963142324226">http://twitter.com/#!/example/status/22376963142324226</a>' => TRUE,
         '<a href="ftp://user:pass@ftp.example.com/~home/dir1">ftp://user:pass@ftp.example.com/~home/dir1</a>' => TRUE,
         '<a href="sftp://user@nonstandardport:222/dir">sftp://user@nonstandardport:222/dir</a>' => TRUE,
         '<a href="ssh://192.168.0.100/srv/git/drupal.git">ssh://192.168.0.100/srv/git/drupal.git</a>' => TRUE,
@@ -1457,7 +1482,7 @@ www.example.com with a newline in comments -->
         if (!$success) {
           $this->verbose('Source:<pre>' . check_plain(var_export($source, TRUE)) . '</pre>'
             . '<hr />' . 'Result:<pre>' . check_plain(var_export($result, TRUE)) . '</pre>'
-            . '<hr />' . ($is_expected ? 'Found:' : 'Not found:')
+            . '<hr />' . ($is_expected ? 'Expected:' : 'Not expected:')
             . '<pre>' . check_plain(var_export($value, TRUE)) . '</pre>'
           );
         }
diff --git a/modules/forum/forum-icon.tpl.php b/modules/forum/forum-icon.tpl.php
index c98eee3e65519c3f478ab3b5a51b1c43c79cbc46..9cf2cd8d3b28984a41d385c45dbbed28e17821ae 100644
--- a/modules/forum/forum-icon.tpl.php
+++ b/modules/forum/forum-icon.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: forum-icon.tpl.php,v 1.8 2010/11/22 08:07:57 webchick Exp $
 
 /**
  * @file
@@ -7,7 +6,7 @@
  *
  * Available variables:
  * - $new_posts: Indicates whether or not the topic contains new posts.
- * - $icon: The icon to display. May be one of 'hot', 'hot-new', 'new',
+ * - $icon_class: The icon to display. May be one of 'hot', 'hot-new', 'new',
  *   'default', 'closed', or 'sticky'.
  * - $first_new: Indicates whether this is the first topic with new posts.
  *
diff --git a/modules/forum/forum-list.tpl.php b/modules/forum/forum-list.tpl.php
index 0c9cbcf95d0f9a2ddb7c5f063c556c1a1711f13b..bc0935f888234303ebc034fa2dc6ba88ee52b5c0 100644
--- a/modules/forum/forum-list.tpl.php
+++ b/modules/forum/forum-list.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: forum-list.tpl.php,v 1.5 2008/10/13 12:31:42 dries Exp $
 
 /**
  * @file
diff --git a/modules/forum/forum-rtl.css b/modules/forum/forum-rtl.css
index 575250eb1579d8cafc23d63a4b534abd4bdc829d..d31c9e7f372effc98e105a292391979a28ce300e 100644
--- a/modules/forum/forum-rtl.css
+++ b/modules/forum/forum-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: forum-rtl.css,v 1.3 2007/11/27 12:09:26 goba Exp $ */
 
 #forum tr td.forum {
   padding-left: 0.5em;
diff --git a/modules/forum/forum-submitted.tpl.php b/modules/forum/forum-submitted.tpl.php
index d67e9cc315e76bdf1153e6a81a9a6a7831da0e31..d310448c7b25c0f11380ad9004ba4dc012de719e 100644
--- a/modules/forum/forum-submitted.tpl.php
+++ b/modules/forum/forum-submitted.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: forum-submitted.tpl.php,v 1.5 2009/07/28 10:41:20 dries Exp $
 
 /**
  * @file
diff --git a/modules/forum/forum-topic-list.tpl.php b/modules/forum/forum-topic-list.tpl.php
index 89566c4685ff05b5f718d39a1d44560913dd58f3..33907036fa13cd064ff123c11e36f4ced2c94287 100644
--- a/modules/forum/forum-topic-list.tpl.php
+++ b/modules/forum/forum-topic-list.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: forum-topic-list.tpl.php,v 1.10 2010/04/28 20:25:21 dries Exp $
 
 /**
  * @file
diff --git a/modules/forum/forum.admin.inc b/modules/forum/forum.admin.inc
index 84a891d22a620e47b112eb88668a9ea97a29ba51..1e6b3655159180758950a4401a2a3f3a8bd07703 100644
--- a/modules/forum/forum.admin.inc
+++ b/modules/forum/forum.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: forum.admin.inc,v 1.36 2010/08/08 19:21:25 dries Exp $
 
 /**
  * @file
diff --git a/modules/forum/forum.css b/modules/forum/forum.css
index eb2544e81ecd675c82ba2550f8dad76c8c60f10c..3f3ed98481ce779676bbf7dc6a7d44964afc7fed 100644
--- a/modules/forum/forum.css
+++ b/modules/forum/forum.css
@@ -1,4 +1,3 @@
-/* $Id: forum.css,v 1.9 2010/10/03 00:41:14 dries Exp $ */
 
 #forum .description {
   font-size: 0.9em;
diff --git a/modules/forum/forum.info b/modules/forum/forum.info
index 2558d70fef82ad5d9f8bb667476f6ddbda7c4c59..6c62fa8fa666d9d0c8a40fb61003dec3e3bf38e5 100644
--- a/modules/forum/forum.info
+++ b/modules/forum/forum.info
@@ -1,4 +1,3 @@
-; $Id: forum.info,v 1.15 2010/12/20 19:59:42 webchick Exp $
 name = Forum
 description = Provides discussion forums.
 dependencies[] = taxonomy
@@ -10,8 +9,8 @@ files[] = forum.test
 configure = admin/structure/forum
 stylesheets[all][] = forum.css
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/forum/forum.install b/modules/forum/forum.install
index f719708797f301268abe0c4bc6e381af48faf36f..60c40879371dd3a5ad4fa9ae5b2d6e7d7757dccf 100644
--- a/modules/forum/forum.install
+++ b/modules/forum/forum.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: forum.install,v 1.52 2010/10/07 00:28:19 webchick Exp $
 
 /**
  * @file
@@ -47,7 +46,7 @@ function forum_enable() {
   // Create the 'taxonomy_forums' field if it doesn't already exist.
   if (!field_info_field('taxonomy_forums')) {
     $field = array(
-      'field_name' => 'taxonomy_' . $vocabulary->machine_name,
+      'field_name' => 'taxonomy_forums',
       'type' => 'taxonomy_term_reference',
       'settings' => array(
         'allowed_values' => array(
@@ -60,8 +59,6 @@ function forum_enable() {
     );
     field_create_field($field);
 
-    variable_set('forum_nav_vocabulary', $vocabulary->vid);
-
     // Create a default forum so forum posts can be created.
     $edit = array(
       'name' => t('General discussion'),
@@ -74,7 +71,7 @@ function forum_enable() {
 
     // Create the instance on the bundle.
     $instance = array(
-      'field_name' => 'taxonomy_' . $vocabulary->machine_name,
+      'field_name' => 'taxonomy_forums',
       'entity_type' => 'node',
       'label' => $vocabulary->name,
       'bundle' => 'forum',
@@ -216,7 +213,7 @@ function forum_schema() {
       ),
     ),
     'indexes' => array(
-      'forum_topics' => array('tid', 'sticky', 'last_comment_timestamp'),
+      'forum_topics' => array('nid', 'tid', 'sticky', 'last_comment_timestamp'),
     ),
     'foreign keys' => array(
       'tracked_node' => array(
@@ -331,3 +328,97 @@ function forum_update_7001() {
     ->from($select)
     ->execute();
 }
+
+/**
+ * Add new index to forum_index table.
+ */
+function forum_update_7002() {
+  db_drop_index('forum_index', 'forum_topics');
+  db_add_index('forum_index', 'forum_topics', array('nid', 'tid', 'sticky', 'last_comment_timestamp'));
+}
+
+/**
+ * @addtogroup updates-7.x-extra
+ * @{
+ */
+
+/**
+ * Rename field to 'taxonomy_forums'.
+ */
+function forum_update_7003() {
+  $messages = array();
+
+  $new_field_name = 'taxonomy_forums';
+
+  // Test to see if the taxonomy_forums field exists.
+  $fields = _update_7000_field_read_fields(array('field_name' => $new_field_name));
+  if ($fields) {
+    // Since the field exists, we're done.
+    return;
+  }
+
+  // Calculate the old field name.
+  $vid = variable_get('forum_nav_vocabulary', 0);
+  $vocabulary_machine_name = db_select('taxonomy_vocabulary', 'tv')
+    ->fields('tv', array('machine_name'))
+    ->condition('vid', $vid)
+    ->execute()
+    ->fetchField();
+  $old_field_name = 'taxonomy_' . $vocabulary_machine_name;
+
+  // Read the old fields.
+  $old_fields = _update_7000_field_read_fields(array('field_name' => $old_field_name));
+  foreach ($old_fields as $old_field) {
+    if ($old_field['storage']['type'] != 'field_sql_storage') {
+      $messages[] = t('Cannot rename field %id (%old_field_name) to %new_field_name because it does not use the field_sql_storage storage type.', array(
+        '%id' => $old_field['id'],
+        '%old_field_name' => $old_field_name,
+        '%new_field_name' => $new_field_name,
+      ));
+      continue;
+    }
+
+    // Update {field_config}.
+    db_update('field_config')
+      ->fields(array('field_name' => $new_field_name))
+      ->condition('id', $old_field['id'])
+      ->execute();
+
+    // Update {field_config_instance}.
+    db_update('field_config_instance')
+      ->fields(array('field_name' => $new_field_name))
+      ->condition('field_id', $old_field['id'])
+      ->execute();
+
+    // The tables that need updating in the form 'old_name' => 'new_name'.
+    $tables = array(
+      'field_data_' . $old_field_name => 'field_data_' . $new_field_name,
+      'field_revision_' . $old_field_name => 'field_revision_' . $new_field_name,
+    );
+    foreach ($tables as $old_table => $new_table) {
+      $old_column_name = $old_field_name . '_tid';
+      $new_column_name = $new_field_name . '_tid';
+
+      // Rename the column.
+      db_drop_index($old_table, $old_column_name);
+      db_change_field($old_table, $old_column_name, $new_column_name, array(
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => FALSE,
+      ));
+      db_drop_index($old_table, $new_column_name);
+      db_add_index($old_table, $new_column_name, array($new_column_name));
+
+      // Rename the table.
+      db_rename_table($old_table, $new_table);
+    }
+  }
+
+  cache_clear_all('*', 'cache_field', TRUE);
+
+  return $messages;
+}
+
+/**
+ * @} End of "addtogroup updates-7.x-extra"
+ */
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index 5c07e885c84394c1a828e2e297bb1e5362c04254..c58b5c905e9b7ca8675160ce0f4365de8e58699d 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: forum.module,v 1.582 2010/11/29 04:53:32 webchick Exp $
 
 /**
  * @file
@@ -170,12 +169,9 @@ function forum_menu_local_tasks_alter(&$data, $router_item, $root_path) {
     $tid = (isset($router_item['page_arguments'][0]) ? $router_item['page_arguments'][0]->tid : 0);
     $forum_term = forum_forum_load($tid);
     if ($forum_term) {
-      $vid = variable_get('forum_nav_vocabulary', 0);
-      $vocabulary = taxonomy_vocabulary_load($vid);
-
       $links = array();
       // Loop through all bundles for forum taxonomy vocabulary field.
-      $field = field_info_field('taxonomy_' . $vocabulary->machine_name);
+      $field = field_info_field('taxonomy_forums');
       foreach ($field['bundles']['node'] as $type) {
         if (node_access('create', $type)) {
           $links[$type] = array(
@@ -611,7 +607,7 @@ function forum_form_alter(&$form, $form_state, $form_id) {
       // ID from the URL (e.g., if we are on a page like node/add/forum/2, we
       // expect "2" to be the ID of the forum that was requested).
       $requested_forum_id = arg(3);
-      $form['taxonomy_forums'][$langcode]['#default_value'] = is_numeric($requested_forum_id) ? $requested_forum_id : NULL;
+      $form['taxonomy_forums'][$langcode]['#default_value'] = is_numeric($requested_forum_id) ? $requested_forum_id : '';
     }
   }
 }
@@ -880,7 +876,6 @@ function forum_get_topics($tid, $sortby, $forum_per_page) {
     ->addTag('node_access')
     ->orderBy('f.sticky', 'DESC')
     ->orderByHeader($forum_topic_list_header)
-    ->orderBy('f.last_comment_timestamp', 'DESC')
     ->limit($forum_per_page);
 
   $count_query = db_select('forum_index', 'f');
@@ -895,7 +890,29 @@ function forum_get_topics($tid, $sortby, $forum_per_page) {
     $nids[] = $record->nid;
   }
   if ($nids) {
-    $result = db_query("SELECT n.title, n.nid, n.type, n.sticky, n.created, n.uid, n.comment AS comment_mode, ncs.*, f.tid AS forum_tid, u.name, CASE ncs.last_comment_uid WHEN 0 THEN ncs.last_comment_name ELSE u2.name END AS last_comment_name FROM {node} n INNER JOIN {node_comment_statistics} ncs ON n.nid = ncs.nid INNER JOIN {forum} f ON n.vid = f.vid INNER JOIN {users} u ON n.uid = u.uid INNER JOIN {users} u2 ON ncs.last_comment_uid = u2.uid WHERE n.nid IN (:nids)", array(':nids' => $nids));
+    $query = db_select('node', 'n')->extend('TableSort');
+    $query->fields('n', array('title', 'nid', 'type', 'sticky', 'created', 'uid'));
+    $query->addField('n', 'comment', 'comment_mode');
+
+    $query->join('node_comment_statistics', 'ncs', 'n.nid = ncs.nid');
+    $query->fields('ncs', array('cid', 'last_comment_uid', 'last_comment_timestamp', 'comment_count'));
+
+    $query->join('forum_index', 'f', 'f.nid = ncs.nid');
+    $query->addField('f', 'tid', 'forum_tid');
+
+    $query->join('users', 'u', 'n.uid = u.uid');
+    $query->addField('u', 'name');
+
+    $query->join('users', 'u2', 'ncs.last_comment_uid = u2.uid');
+
+    $query->addExpression('CASE ncs.last_comment_uid WHEN 0 THEN ncs.last_comment_name ELSE u2.name END', 'last_comment_name');
+
+    $query
+      ->orderBy('f.sticky', 'DESC')
+      ->orderByHeader($forum_topic_list_header)
+      ->condition('n.nid', $nids);
+
+    $result = $query->execute();
   }
   else {
     $result = array();
@@ -1194,16 +1211,16 @@ function _forum_user_last_visit($nid) {
 function _forum_get_topic_order($sortby) {
   switch ($sortby) {
     case 1:
-      return array('field' => 'ncs.last_comment_timestamp', 'sort' => 'desc');
+      return array('field' => 'f.last_comment_timestamp', 'sort' => 'desc');
       break;
     case 2:
-      return array('field' => 'ncs.last_comment_timestamp', 'sort' => 'asc');
+      return array('field' => 'f.last_comment_timestamp', 'sort' => 'asc');
       break;
     case 3:
-      return array('field' => 'ncs.comment_count', 'sort' => 'desc');
+      return array('field' => 'f.comment_count', 'sort' => 'desc');
       break;
     case 4:
-      return array('field' => 'ncs.comment_count', 'sort' => 'asc');
+      return array('field' => 'f.comment_count', 'sort' => 'asc');
       break;
   }
 }
diff --git a/modules/forum/forum.pages.inc b/modules/forum/forum.pages.inc
index 6acdb23ae51a0475299f19e7d877b5c450eef183..29307e7194023964c4c41696ea26e67eff0ed6b3 100644
--- a/modules/forum/forum.pages.inc
+++ b/modules/forum/forum.pages.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: forum.pages.inc,v 1.4 2010/04/28 05:54:55 webchick Exp $
 
 /**
  * @file
diff --git a/modules/forum/forum.test b/modules/forum/forum.test
index 119a7ab90c2ce9dd73277a0b47b23ba218ee5a7d..1dc45c6fdf61b4d13b81acd5b4ec41afdb268532 100644
--- a/modules/forum/forum.test
+++ b/modules/forum/forum.test
@@ -1,5 +1,9 @@
 <?php
-// $Id: forum.test,v 1.65 2010/09/28 02:30:31 dries Exp $
+
+/**
+ * @file
+ * Tests for forum.module.
+ */
 
 class ForumTestCase extends DrupalWebTestCase {
   protected $admin_user;
diff --git a/modules/forum/forums.tpl.php b/modules/forum/forums.tpl.php
index eee9b9f8326241ae32cb7fdf4cb5116c50ed42c9..55a760f57ee61172d94ec2fed24bb78dffbdec44 100644
--- a/modules/forum/forums.tpl.php
+++ b/modules/forum/forums.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: forums.tpl.php,v 1.7 2009/12/03 20:21:50 dries Exp $
 
 /**
  * @file
diff --git a/modules/help/help-rtl.css b/modules/help/help-rtl.css
index 61487afc1466bb970db73360efa96224831e5ea8..8e40a8c255ec88035fcf4c5ead90cb651a31c233 100644
--- a/modules/help/help-rtl.css
+++ b/modules/help/help-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: help-rtl.css,v 1.2 2007/11/27 12:09:26 goba Exp $ */
 
 .help-items {
   float: right;
diff --git a/modules/help/help.admin.inc b/modules/help/help.admin.inc
index 4b783ac91a203b9266feba2aea07153eaf028274..3db06ca1a24599af875f33fd7cea052d0f99069f 100644
--- a/modules/help/help.admin.inc
+++ b/modules/help/help.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: help.admin.inc,v 1.13 2010/10/01 15:24:18 webchick Exp $
 
 /**
  * @file
diff --git a/modules/help/help.api.php b/modules/help/help.api.php
index 36d425a06dd6c2dd9a3eea405357580c40f503b5..ff2f97c6e8c2934a58d4a322f26023739c1cd8b6 100644
--- a/modules/help/help.api.php
+++ b/modules/help/help.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: help.api.php,v 1.11 2010/10/06 03:43:01 webchick Exp $
 
 /**
  * @file
diff --git a/modules/help/help.css b/modules/help/help.css
index 592390f34b3554c68bba9936ac712f6ef01c121b..92281707a5a6ce4daf4deed00749ac56321b77b6 100644
--- a/modules/help/help.css
+++ b/modules/help/help.css
@@ -1,4 +1,3 @@
-/* $Id: help.css,v 1.2 2007/05/27 17:57:48 goba Exp $ */
 
 .help-items {
   float: left; /* LTR */
diff --git a/modules/help/help.info b/modules/help/help.info
index dd45bb54e22562396abad3d0768ee0d60362d0e4..34fb192c86c72591c3d2d0ab416a704a4d3f2ff0 100644
--- a/modules/help/help.info
+++ b/modules/help/help.info
@@ -1,4 +1,3 @@
-; $Id: help.info,v 1.9 2010/12/20 19:59:42 webchick Exp $
 name = Help
 description = Manages the display of online help.
 package = Core
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = help.test
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/help/help.module b/modules/help/help.module
index 6b78a5d6eb12447ef443cf2e990ad61d34378384..773a52df98fe711909d25d1a196067cc6d6a5c81 100644
--- a/modules/help/help.module
+++ b/modules/help/help.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: help.module,v 1.99 2010/10/04 14:54:10 webchick Exp $
 
 /**
  * @file
diff --git a/modules/help/help.test b/modules/help/help.test
index 3725a1a492587ea813231923124f43e546abac2c..73b4dedc86ac2d9e18cd1fe7597af85b2db1a0c5 100644
--- a/modules/help/help.test
+++ b/modules/help/help.test
@@ -1,5 +1,9 @@
 <?php
-// $Id: help.test,v 1.22 2010/11/27 20:25:44 dries Exp $
+
+/**
+ * @file
+ * Tests for help.module.
+ */
 
 class HelpTestCase extends DrupalWebTestCase {
   protected $big_user;
diff --git a/modules/image/image-rtl.css b/modules/image/image-rtl.css
index e068b7e0fb5288db296214e61041cf31357ccf4d..2a7a855ede53c25a841bbc191a5fb0aca28af017 100644
--- a/modules/image/image-rtl.css
+++ b/modules/image/image-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: image-rtl.css,v 1.2 2010/09/27 03:56:14 webchick Exp $ */
 
 /**
  * Image upload widget.
diff --git a/modules/image/image.admin.css b/modules/image/image.admin.css
index f5aa5972b7f940fdf90e5431d1213c314eb6817d..3115c8dce97d7c954d9919cf7997bb2d1fb1029c 100644
--- a/modules/image/image.admin.css
+++ b/modules/image/image.admin.css
@@ -1,4 +1,3 @@
-/* $Id: image.admin.css,v 1.1 2009/07/21 07:09:46 webchick Exp $ */
 
 /**
  * Image style configuration pages.
diff --git a/modules/image/image.admin.inc b/modules/image/image.admin.inc
index 74002bb9361110cd0763286294a4cb0be17be74e..d72fdf4feecbde952e8a561eb4f5081c0f1afb63 100644
--- a/modules/image/image.admin.inc
+++ b/modules/image/image.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: image.admin.inc,v 1.28 2010/11/21 07:24:53 webchick Exp $
 
 /**
  * @file
@@ -227,7 +226,7 @@ function image_style_form_submit($form, &$form_state) {
 
   image_style_save($style);
   if ($form_state['values']['op'] == t('Update style')) {
-    drupal_set_message('Changes to the style have been saved.');
+    drupal_set_message(t('Changes to the style have been saved.'));
   }
   $form_state['redirect'] = 'admin/config/media/image-styles/edit/' . $style['name'];
 }
diff --git a/modules/image/image.api.php b/modules/image/image.api.php
index 67018e5765a3cc8c55d3e28323ba16855fa0fecf..5b635ec749bca7904f66d3141ff02bd04eea6b1c 100644
--- a/modules/image/image.api.php
+++ b/modules/image/image.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: image.api.php,v 1.5 2010/09/11 01:54:43 dries Exp $
 
 /**
  * @file
diff --git a/modules/image/image.css b/modules/image/image.css
index 0ae839bed1ca1c2bfccfa812b4abacbe6eaf6ea9..7db307bf07c877b6cc9b51ab48c296bb8248e941 100644
--- a/modules/image/image.css
+++ b/modules/image/image.css
@@ -1,4 +1,3 @@
-/* $Id: image.css,v 1.2 2010/09/27 03:56:14 webchick Exp $ */
 
 /**
  * Image upload widget.
diff --git a/modules/image/image.effects.inc b/modules/image/image.effects.inc
index 401061f91b41e89d8b0b3af32ed18dbbb3f3a67c..122af6c44f15eebfaa600fda46fdb7fe9e80b926 100644
--- a/modules/image/image.effects.inc
+++ b/modules/image/image.effects.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: image.effects.inc,v 1.5 2010/05/06 05:59:31 webchick Exp $
 
 /**
  * @file
@@ -74,7 +73,7 @@ function image_image_effect_info() {
  */
 function image_resize_effect(&$image, $data) {
   if (!image_resize($image, $data['width'], $data['height'])) {
-    watchdog('image', 'Image resize failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['height'] . 'x' . $image->info['height']), WATCHDOG_ERROR);
+    watchdog('image', 'Image resize failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), WATCHDOG_ERROR);
     return FALSE;
   }
   return TRUE;
@@ -109,7 +108,7 @@ function image_scale_effect(&$image, $data) {
   $data['height'] = empty($data['height']) ? PHP_INT_MAX : $data['height'];
 
   if (!image_scale($image, $data['width'], $data['height'], $data['upscale'])) {
-    watchdog('image', 'Image scale failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['height'] . 'x' . $image->info['height']), WATCHDOG_ERROR);
+    watchdog('image', 'Image scale failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), WATCHDOG_ERROR);
     return FALSE;
   }
   return TRUE;
@@ -143,7 +142,7 @@ function image_crop_effect(&$image, $data) {
   $x = image_filter_keyword($x, $image->info['width'], $data['width']);
   $y = image_filter_keyword($y, $image->info['height'], $data['height']);
   if (!image_crop($image, $x, $y, $data['width'], $data['height'])) {
-    watchdog('image', 'Image crop failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['height'] . 'x' . $image->info['height']), WATCHDOG_ERROR);
+    watchdog('image', 'Image crop failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), WATCHDOG_ERROR);
     return FALSE;
   }
   return TRUE;
@@ -165,7 +164,7 @@ function image_crop_effect(&$image, $data) {
  */
 function image_scale_and_crop_effect(&$image, $data) {
   if (!image_scale_and_crop($image, $data['width'], $data['height'])) {
-    watchdog('image', 'Image scale and crop failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['height'] . 'x' . $image->info['height']), WATCHDOG_ERROR);
+    watchdog('image', 'Image scale and crop failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), WATCHDOG_ERROR);
     return FALSE;
   }
   return TRUE;
@@ -184,7 +183,7 @@ function image_scale_and_crop_effect(&$image, $data) {
  */
 function image_desaturate_effect(&$image, $data) {
   if (!image_desaturate($image)) {
-    watchdog('image', 'Image desaturate failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['height'] . 'x' . $image->info['height']), WATCHDOG_ERROR);
+    watchdog('image', 'Image desaturate failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), WATCHDOG_ERROR);
     return FALSE;
   }
   return TRUE;
@@ -237,7 +236,7 @@ function image_rotate_effect(&$image, $data) {
   }
 
   if (!image_rotate($image, $data['degrees'], $data['bgcolor'])) {
-    watchdog('image', 'Image rotate failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['height'] . 'x' . $image->info['height']), WATCHDOG_ERROR);
+    watchdog('image', 'Image rotate failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), WATCHDOG_ERROR);
     return FALSE;
   }
   return TRUE;
diff --git a/modules/image/image.field.inc b/modules/image/image.field.inc
index a65407f7abd17dcb3f250e71fadd8916a2cba524..07cc1e06b99ed4e4f8c6135afd58a4cb9492a43b 100644
--- a/modules/image/image.field.inc
+++ b/modules/image/image.field.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: image.field.inc,v 1.34 2010/10/31 12:12:00 dries Exp $
 
 /**
  * @file
diff --git a/modules/image/image.info b/modules/image/image.info
index ba007eb84d6c7e80f60131bde78241d862d4f535..0f5afae8e7ce41508fa714c0e5a41c4ba5e31710 100644
--- a/modules/image/image.info
+++ b/modules/image/image.info
@@ -1,4 +1,3 @@
-; $Id: image.info,v 1.6 2010/12/20 19:59:42 webchick Exp $
 name = Image
 description = Provides image manipulation tools.
 package = Core
@@ -8,8 +7,8 @@ dependencies[] = file
 files[] = image.test
 configure = admin/config/media/image-styles
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/image/image.install b/modules/image/image.install
index 07032763a2599d2b34952e853434cd290ac36849..fbd20de500579f0f53cc905bfb9ba3e1adb05842 100644
--- a/modules/image/image.install
+++ b/modules/image/image.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: image.install,v 1.14 2010/11/21 09:24:41 webchick Exp $
 
 /**
  * @file
@@ -228,7 +227,19 @@ function image_update_7000() {
 
     db_create_table('cache_image', $schema['cache_image']);
     db_create_table('image_styles', $schema['image_styles']);
-    db_create_table('image_effect', $schema['image_effects']);
+    db_create_table('image_effects', $schema['image_effects']);
+  }
+}
+
+/**
+ * Rename possibly misnamed {image_effect} table to {image_effects}.
+ */
+function image_update_7001() {
+  // Due to a bug in earlier versions of image_update_7000() it is possible
+  // to end up with an {image_effect} table where there should be an
+  // {image_effects} table.
+  if (!db_table_exists('image_effects') && db_table_exists('image_effect')) {
+    db_rename_table('image_effect', 'image_effects');
   }
 }
 
diff --git a/modules/image/image.module b/modules/image/image.module
index 8afed87906f87c2d5270fc8d1d52277bd6e804d8..d2d081c3ec2de24330b03ec90e85d5caf8ac7d55 100644
--- a/modules/image/image.module
+++ b/modules/image/image.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: image.module,v 1.54 2010/11/18 05:36:27 dries Exp $
 
 /**
  * @file
@@ -189,7 +188,6 @@ function image_theme() {
         'alt' => '',
         'title' => NULL,
         'attributes' => array(),
-        'getsize' => TRUE,
       ),
     ),
 
@@ -714,7 +712,11 @@ function image_style_deliver($style, $scheme) {
 }
 
 /**
- * Create a new image based on an image style.
+ * Creates a new image derivative based on an image style.
+ *
+ * Generates an image derivative by creating the destination folder (if it does
+ * not already exist), applying all image effects defined in $style['effects'],
+ * and saving a cached version of the resulting image.
  *
  * @param $style
  *   An image style array.
@@ -722,9 +724,12 @@ function image_style_deliver($style, $scheme) {
  *   Path of the source file.
  * @param $destination
  *   Path or URI of the destination file.
+ *
  * @return
- *   TRUE if an image derivative is generated, FALSE if no image derivative
- *   is generated. NULL if the derivative is being generated.
+ *   TRUE if an image derivative was generated, or FALSE if the image derivative
+ *   could not be generated.
+ *
+ * @see image_style_load()
  */
 function image_style_create_derivative($style, $source, $destination) {
   // Get the folder for the final location of this style.
@@ -799,16 +804,18 @@ function image_style_flush($style) {
  * @see image_style_deliver()
  */
 function image_style_url($style_name, $path) {
-  $scheme = file_uri_scheme($path);
-  if ($scheme === 'private') {
-    $target = file_uri_target($path);
-    $url = url('system/files/styles/' . $style_name . '/' . $scheme . '/' . $target, array('absolute' => TRUE));
+  $uri = image_style_path($style_name, $path);
+
+  // If not using clean URLs, the image derivative callback is only available
+  // with the query string. If the file does not exist, use url() to ensure
+  // that it is included. Once the file exists it's fine to fall back to the
+  // actual file path, this avoids bootstrapping PHP once the files are built.
+  if (!variable_get('clean_url') && file_uri_scheme($uri) == 'public' && !file_exists($uri)) {
+    $directory_path = file_stream_wrapper_get_instance_by_uri($uri)->getDirectoryPath();
+    return url($directory_path . '/' . file_uri_target($uri), array('absolute' => TRUE));
   }
-  else {
-    $destination = image_style_path($style_name, $path);
-    $url = url(file_stream_wrapper_get_instance_by_scheme($scheme)->getDirectoryPath() . '/' . file_uri_target($destination), array('absolute' => TRUE));
-  }
-  return $url;
+
+  return file_create_url($uri);
 }
 
 /**
@@ -1082,23 +1089,11 @@ function image_effect_apply($image, $effect) {
  *   - title: The title text is displayed when the image is hovered in some
  *     popular browsers.
  *   - attributes: Associative array of attributes to be placed in the img tag.
- *   - getsize: If set to TRUE, the image's dimension are fetched and added as
- *     width/height attributes.
  *
  * @ingroup themeable
  */
 function theme_image_style($variables) {
-  $style_name = $variables['style_name'];
-  $path = $variables['path'];
-
-  // theme_image() can only honor the $getsize parameter with local file paths.
-  // The derivative image is not created until it has been requested so the file
-  // may not yet exist, in this case we just fallback to the URL.
-  $style_path = image_style_path($style_name, $path);
-  if (!file_exists($style_path)) {
-    $style_path = image_style_url($style_name, $path);
-  }
-  $variables['path'] = $style_path;
+  $variables['path'] = image_style_url($variables['style_name'], $variables['path']);
   return theme('image', $variables);
 }
 
diff --git a/modules/image/image.test b/modules/image/image.test
index 483f9fa5851df99f3417e923594930d8f5cab031..00f79d8525c557e1842c5ffe903084c22b2e14af 100644
--- a/modules/image/image.test
+++ b/modules/image/image.test
@@ -1,12 +1,10 @@
 <?php
-// $Id: image.test,v 1.31 2010/09/22 03:24:09 dries Exp $
 
 /**
  * @file
- * Image module tests.
+ * Tests for image.module.
  */
 
-
 /**
  * TODO: Test the following functions.
  *
@@ -155,13 +153,28 @@ class ImageStylesPathAndUrlUnitTest extends DrupalWebTestCase {
     $this->_testImageStyleUrlAndPath('private');
   }
 
+  /**
+   * Test image_style_url() with the "public://" scheme and unclean URLs.
+   */
+   function testImageStylUrlAndPathPublicUnclean() {
+     $this->_testImageStyleUrlAndPath('public', FALSE);
+   }
+
+  /**
+   * Test image_style_url() with the "private://" schema and unclean URLs.
+   */
+  function testImageStyleUrlAndPathPrivateUnclean() {
+    $this->_testImageStyleUrlAndPath('private', FALSE);
+  }
+
   /**
    * Test image_style_url().
    */
-  function _testImageStyleUrlAndPath($scheme) {
+  function _testImageStyleUrlAndPath($scheme, $clean_url = TRUE) {
     // Make the default scheme neither "public" nor "private" to verify the
     // functions work for other than the default scheme.
     variable_set('file_default_scheme', 'temporary');
+    variable_set('clean_url', $clean_url);
 
     // Create the directories for the styles.
     $directory = $scheme . '://styles/' . $this->style_name;
@@ -183,6 +196,10 @@ class ImageStylesPathAndUrlUnitTest extends DrupalWebTestCase {
     $this->assertFalse(file_exists($generated_uri), t('Generated file does not exist.'));
     $generate_url = image_style_url($this->style_name, $original_uri);
 
+    if (!$clean_url) {
+      $this->assertTrue(strpos($generate_url, '?q=') !== FALSE, 'When using non-clean URLS, the system path contains the query string.');
+    }
+
     // Fetch the URL that generates the file.
     $this->drupalGet($generate_url);
     $this->assertResponse(200, t('Image was generated at the URL.'));
@@ -695,7 +712,6 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
     // image style callback paths.
     $this->drupalGet(image_style_url('thumbnail', $image_uri));
     $image_info['path'] = image_style_path('thumbnail', $image_uri);
-    $image_info['getsize'] = FALSE;
     $default_output = theme('image', $image_info);
     $this->drupalGet('node/' . $nid);
     $this->assertRaw($default_output, t('Image style thumbnail formatter displaying correctly on full node view.'));
diff --git a/modules/image/tests/image_module_test.info b/modules/image/tests/image_module_test.info
index 8186eb8139ad401c6577b830aecb4e53fe72d48a..bfbb12178c05c6bed585674c014b9ad880fc9635 100644
--- a/modules/image/tests/image_module_test.info
+++ b/modules/image/tests/image_module_test.info
@@ -1,4 +1,3 @@
-; $Id: image_module_test.info,v 1.1 2010/08/23 09:04:57 dries Exp $
 name = Image test
 description = Provides hook implementations for testing Image module functionality.
 package = Core
@@ -7,8 +6,8 @@ core = 7.x
 files[] = image_module_test.module
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/image/tests/image_module_test.module b/modules/image/tests/image_module_test.module
index 474bc1a56a67385e02826b6a252a7db7c1def094..038bd155c70b72e02aa1c6cc7fde0aba60268e77 100644
--- a/modules/image/tests/image_module_test.module
+++ b/modules/image/tests/image_module_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: image_module_test.module,v 1.1 2010/08/23 09:04:57 dries Exp $
 
 /**
  * @file
diff --git a/modules/locale/locale.admin.inc b/modules/locale/locale.admin.inc
index be511ef5855619dfda110cf9288fa6c1f7ccd782..d8201dbf227bd7cb06799470c951402cf86e80f2 100644
--- a/modules/locale/locale.admin.inc
+++ b/modules/locale/locale.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: locale.admin.inc,v 1.23 2011/01/03 18:03:54 webchick Exp $
 
 /**
  * @file
@@ -468,6 +467,9 @@ function locale_languages_delete_form_submit($form, &$form_state) {
       ->fields(array('language' => ''))
       ->condition('language', $form_state['values']['langcode'])
       ->execute();
+    if ($languages[$form_state['values']['langcode']]->enabled) {
+      variable_set('language_count', variable_get('language_count', 1) - 1);
+    }
     module_invoke_all('multilingual_settings_changed');
     $variables = array('%locale' => $languages[$form_state['values']['langcode']]->name);
     drupal_set_message(t('The language %locale has been removed.', $variables));
@@ -539,6 +541,12 @@ function _locale_languages_configure_form_language_table(&$form, $type) {
   asort($providers_weight);
 
   foreach ($providers_weight as $id => $weight) {
+    // A language provider might be no more available if the defining module has
+    // been disabled after the last configuration saving.
+    if (!isset($language_providers[$id])) {
+      continue;
+    }
+
     $enabled = isset($enabled_providers[$id]);
     $provider = $language_providers[$id];
 
@@ -656,7 +664,6 @@ function theme_locale_languages_configure_form($variables) {
  * Submit handler for language negotiation settings.
  */
 function locale_languages_configure_form_submit($form, &$form_state) {
-  $language_types = array();
   $configurable_types = $form['#language_types'];
 
   foreach ($configurable_types as $type) {
@@ -664,7 +671,6 @@ function locale_languages_configure_form_submit($form, &$form_state) {
     $enabled_providers = $form_state['values'][$type]['enabled'];
     $enabled_providers[LANGUAGE_NEGOTIATION_DEFAULT] = TRUE;
     $providers_weight = $form_state['values'][$type]['weight'];
-    $language_types[$type] = TRUE;
 
     foreach ($providers_weight as $id => $weight) {
       if ($enabled_providers[$id]) {
@@ -678,27 +684,11 @@ function locale_languages_configure_form_submit($form, &$form_state) {
     variable_set("locale_language_providers_weight_$type", $providers_weight);
   }
 
-  // Save non-configurable language types negotiation.
-  $language_types_info = language_types_info();
-  $defined_providers = $form['#language_providers'];
-  foreach ($language_types_info as $type => $info) {
-    if (isset($info['fixed'])) {
-      $language_types[$type] = FALSE;
-      $negotiation = array();
-      foreach ($info['fixed'] as $weight => $id) {
-        if (isset($defined_providers[$id])) {
-          $negotiation[$id] = $defined_providers[$id];
-          $negotiation[$id]['weight'] = $weight;
-        }
-      }
-      language_negotiation_set($type, $negotiation);
-    }
-  }
-
-  // Save language types.
-  variable_set('language_types', $language_types);
+  // Update non-configurable language types and the related language negotiation
+  // configuration.
+  language_types_set();
 
-  $form_state['redirect'] = 'admin/config/regional/language';
+  $form_state['redirect'] = 'admin/config/regional/language/configure';
   drupal_set_message(t('Language negotiation configuration saved.'));
 }
 
diff --git a/modules/locale/locale.api.php b/modules/locale/locale.api.php
index fad2754c0209842be0a364264f0366252e06cbfd..2808f338cd28f7730e8123ad8097fdd424c1c0e5 100644
--- a/modules/locale/locale.api.php
+++ b/modules/locale/locale.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: locale.api.php,v 1.12 2010/07/16 02:37:06 dries Exp $
 
 /**
  * @file
diff --git a/modules/locale/locale.css b/modules/locale/locale.css
index 0c35d7aed9de550191bc53a6d947f6c9edf71489..1d875a2bf4bb007ba3cb5eca734316452b448938 100644
--- a/modules/locale/locale.css
+++ b/modules/locale/locale.css
@@ -1,13 +1,12 @@
-/* $Id: locale.css,v 1.8 2010/10/08 03:30:40 webchick Exp $ */
 
 .locale-untranslated {
   font-style: normal;
   text-decoration: line-through;
 }
 
-.form-item-language,
-.form-item-translation,
-.form-item-group {
+#locale-translation-filter-form .form-item-language,
+#locale-translation-filter-form .form-item-translation,
+#locale-translation-filter-form .form-item-group {
   float: left; /* LTR */
   padding-right: .8em; /* LTR */
   margin: 0.1em;
diff --git a/modules/locale/locale.datepicker.js b/modules/locale/locale.datepicker.js
index 681a2cc0e067feadaec3dc62f5e8fbe07dbe9d86..81f1e17b3cff38ef952ef059cb57e8ae2ee2b221 100644
--- a/modules/locale/locale.datepicker.js
+++ b/modules/locale/locale.datepicker.js
@@ -1,4 +1,3 @@
-// $Id: locale.datepicker.js,v 1.1 2010/04/29 05:15:43 webchick Exp $
 (function ($) {
 
 $.datepicker.regional['drupal-locale'] = {
@@ -36,29 +35,29 @@ $.datepicker.regional['drupal-locale'] = {
   ],
   dayNames: [
     Drupal.t('Sunday'),
-    Drupal.t('Monday')
-    Drupal.t('Tuesday')
-    Drupal.t('Wednesday')
-    Drupal.t('Thursday')
-    Drupal.t('Friday')
+    Drupal.t('Monday'),
+    Drupal.t('Tuesday'),
+    Drupal.t('Wednesday'),
+    Drupal.t('Thursday'),
+    Drupal.t('Friday'),
     Drupal.t('Saturday')
   ],
   dayNamesShort: [
-    Drupal.t('Sun')
-    Drupal.t('Mon')
-    Drupal.t('Tue')
-    Drupal.t('Wed')
-    Drupal.t('Thu')
-    Drupal.t('Fri')
+    Drupal.t('Sun'),
+    Drupal.t('Mon'),
+    Drupal.t('Tue'),
+    Drupal.t('Wed'),
+    Drupal.t('Thu'),
+    Drupal.t('Fri'),
     Drupal.t('Sat')
   ],
   dayNamesMin: [
-    Drupal.t('Su')
-    Drupal.t('Mo')
-    Drupal.t('Tu')
-    Drupal.t('We')
-    Drupal.t('Th')
-    Drupal.t('Fr')
+    Drupal.t('Su'),
+    Drupal.t('Mo'),
+    Drupal.t('Tu'),
+    Drupal.t('We'),
+    Drupal.t('Th'),
+    Drupal.t('Fr'),
     Drupal.t('Sa')
   ],
   dateFormat: Drupal.t('mm/dd/yy'),
diff --git a/modules/locale/locale.info b/modules/locale/locale.info
index 976fff45762b20fab09e3debf7d3493ef52ec769..714eec63b52fdfa40711beb544b9c19b053f2557 100644
--- a/modules/locale/locale.info
+++ b/modules/locale/locale.info
@@ -1,4 +1,3 @@
-; $Id: locale.info,v 1.16 2010/12/20 19:59:42 webchick Exp $
 name = Locale
 description = Adds language handling functionality and enables the translation of the user interface to languages other than English.
 package = Core
@@ -7,8 +6,8 @@ core = 7.x
 files[] = locale.test
 configure = admin/config/regional/language
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/locale/locale.install b/modules/locale/locale.install
index 3f7d99b8f9ad65f2002ec3a8d9a5b3ffb15a3407..80b20c4549b8b260ddc0acb735f534804e19f89f 100644
--- a/modules/locale/locale.install
+++ b/modules/locale/locale.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: locale.install,v 1.72 2011/01/02 17:26:39 webchick Exp $
 
 /**
  * @file
@@ -126,6 +125,14 @@ function locale_update_7002() {
   }
 }
 
+/**
+ * Update "language_count" variable.
+ */
+function locale_update_7003() {
+  $languages = language_list('enabled');
+  variable_set('language_count', count($languages[1]));
+}
+
 /**
  * @} End of "addtogroup updates-6.x-to-7.x"
  */
diff --git a/modules/locale/locale.module b/modules/locale/locale.module
index 8a82d1b02e18d52527d4a9809b3f7f4bb080d22b..07884614a51e6b2d84ae1c91b842bbb83df46200 100644
--- a/modules/locale/locale.module
+++ b/modules/locale/locale.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: locale.module,v 1.307 2010/11/21 07:02:46 webchick Exp $
 
 /**
  * @file
@@ -60,9 +59,9 @@ function locale_help($path, $arg) {
       return '<p>' . t('This page exports the translated strings used by your site. An export file may be in Gettext Portable Object (<em>.po</em>) form, which includes both the original string and the translation (used to share translations with others), or in Gettext Portable Object Template (<em>.pot</em>) form, which includes the original strings only (used to create new translations with a Gettext translation editor).') . '</p>';
     case 'admin/config/regional/translate/translate':
       return '<p>' . t('This page allows a translator to search for specific translated and untranslated strings, and is used when creating or editing translations. (Note: For translation tasks involving many strings, it may be more convenient to <a href="@export">export</a> strings for offline editing in a desktop Gettext translation editor.) Searches may be limited to strings found within a specific text group or in a specific language.', array('@export' => url('admin/config/regional/translate/export'))) . '</p>';
-    case 'admin/structure/block/manage':
-      if ($arg[4] == 'locale' && $arg[5] == 0) {
-        return '<p>' . t('This block is only shown if <a href="@languages">at least two languages are enabled</a> and <a href="@configuration">language negotiation</a> is set to something other than <em>None</em>.', array('@languages' => url('admin/config/regional/language'), '@configuration' => url('admin/config/regional/language/configure'))) . '</p>';
+    case 'admin/structure/block/manage/%/%':
+      if ($arg[4] == 'locale' && $arg[5] == 'language') {
+        return '<p>' . t('This block is only shown if <a href="@languages">at least two languages are enabled</a> and <a href="@configuration">language negotiation</a> is set to <em>URL</em> or <em>Session</em>.', array('@languages' => url('admin/config/regional/language'), '@configuration' => url('admin/config/regional/language/configure'))) . '</p>';
       }
       break;
   }
@@ -514,6 +513,8 @@ function locale_language_types_info() {
       'description' => t('Order of language detection methods for user interface text. If a translation of user interface text is available in the detected language, it will be displayed.'),
     ),
     LANGUAGE_TYPE_CONTENT => array(
+      'name' => t('Content'),
+      'description' => t('Order of language detection methods for content. If a version of content is available in the detected language, it will be displayed.'),
       'fixed' => array(LOCALE_LANGUAGE_NEGOTIATION_INTERFACE),
     ),
     LANGUAGE_TYPE_URL => array(
@@ -594,6 +595,22 @@ function locale_language_negotiation_info() {
   return $providers;
 }
 
+/**
+ * Implements hook_modules_enabled().
+ */
+function locale_modules_enabled($modules) {
+  include_once DRUPAL_ROOT . '/includes/language.inc';
+  language_types_set();
+  language_negotiation_purge();
+}
+
+/**
+ * Implements hook_modules_disabled().
+ */
+function locale_modules_disabled($modules) {
+  locale_modules_enabled($modules);
+}
+
 // ---------------------------------------------------------------------------------
 // Locale core functionality
 
@@ -773,7 +790,24 @@ function locale_language_list($field = 'name', $all = FALSE) {
 }
 
 /**
- * Imports translations when new modules or themes are installed or enabled.
+ * Implements hook_modules_installed().
+ */
+function locale_modules_installed($modules) {
+  locale_system_update($modules);
+}
+
+/**
+ * Implements hook_themes_enabled().
+ *
+ * @todo This is technically wrong. We must not import upon enabling, but upon
+ *   initial installation. The theme system is missing an installation hook.
+ */
+function locale_themes_enabled($themes) {
+  locale_system_update($themes);
+}
+
+/**
+ * Imports translations when new modules or themes are installed.
  *
  * This function will either import translation for the component change
  * right away, or start a batch if more files need to be imported.
@@ -912,7 +946,7 @@ function locale_block_info() {
   include_once DRUPAL_ROOT . '/includes/language.inc';
   $block = array();
   $info = language_types_info();
-  foreach (language_types_configurable() as $type) {
+  foreach (language_types_configurable(FALSE) as $type) {
     $block[$type] = array(
       'info' => t('Language switcher (@type)', array('@type' => $info[$type]['name'])),
       // Not worth caching.
diff --git a/modules/locale/locale.test b/modules/locale/locale.test
index f18ad41b94966946fe8e0029e7979a033d34f191..42a6dbc48063e34adc90df51f88707e0e5d05df3 100644
--- a/modules/locale/locale.test
+++ b/modules/locale/locale.test
@@ -1,9 +1,8 @@
 <?php
-// $Id: locale.test,v 1.88 2010/11/30 01:05:24 dries Exp $
 
 /**
  * @file
- * Tests for Locale module.
+ * Tests for locale.module.
  *
  * The test file includes:
  *  - a functional test for the language configuration forms;
@@ -18,6 +17,7 @@
  *  - a functional test for multilingual support by content type and on nodes.
  *  - a functional test for multilingual fields.
  *  - a functional test for comment language.
+ *  - a functional test fot language types/negotiation info.
  */
 
 
@@ -130,7 +130,7 @@ class LocaleConfigurationTest extends DrupalWebTestCase {
     $this->drupalGet('admin/config/regional/language');
     $this->clickLink(t('delete'));
     $this->assertText(t('Are you sure you want to delete the language'), t('"delete" link is correct.'));
-    // Delete the language.
+    // Delete an enabled language.
     $this->drupalGet('admin/config/regional/language/delete/' . $langcode);
     // First test the 'cancel' link.
     $this->clickLink(t('Cancel'));
@@ -145,6 +145,31 @@ class LocaleConfigurationTest extends DrupalWebTestCase {
     // Verify that language is no longer found.
     $this->drupalGet('admin/config/regional/language/delete/' . $langcode);
     $this->assertResponse(404, t('Language no longer found.'));
+    // Make sure the "language_count" variable has been updated correctly.
+    drupal_static_reset('language_list');
+    $enabled = language_list('enabled');
+    $this->assertEqual(variable_get('language_count', 1), count($enabled[1]), t('Language count is correct.'));
+    // Delete a disabled language.
+    // Disable an enabled language.
+    $edit = array(
+      'enabled[fr]' => FALSE,
+    );
+    $this->drupalPost($path, $edit, t('Save configuration'));
+    $this->assertNoFieldChecked('edit-enabled-fr', t('French language disabled.'));
+    // Get the count of enabled languages.
+    drupal_static_reset('language_list');
+    $enabled = language_list('enabled');
+    // Delete the disabled language.
+    $this->drupalPost('admin/config/regional/language/delete/fr', array(), t('Delete'));
+    // We need raw here because %locale will add HTML.
+    $this->assertRaw(t('The language %locale has been removed.', array('%locale' => 'French')), t('Disabled language has been removed.'));
+    $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
+    // Verify that language is no longer found.
+    $this->drupalGet('admin/config/regional/language/delete/fr');
+    $this->assertResponse(404, t('Language no longer found.'));
+    // Make sure the "language_count" variable has not changed.
+    $this->assertEqual(variable_get('language_count', 1), count($enabled[1]), t('Language count is correct.'));
+
 
     // Ensure we can't delete the English language.
     $this->drupalGet('admin/config/regional/language/delete/en');
@@ -2224,10 +2249,13 @@ class LocaleCommentLanguageFunctionalTest extends DrupalWebTestCase {
     variable_set('locale_test_content_language_type', TRUE);
 
     // Set interface language detection to user and content language detection
-    // to URL.
+    // to URL. Disable inheritance from interface language to ensure content
+    // language will fall back to the default language if no URL language can be
+    // detected.
     $edit = array(
       'language[enabled][locale-user]' => TRUE,
-      'language_content[enabled][locale-url]' => TRUE
+      'language_content[enabled][locale-url]' => TRUE,
+      'language_content[enabled][locale-interface]' => FALSE,
     );
     $this->drupalPost('admin/config/regional/language/configure', $edit, t('Save settings'));
 
@@ -2349,3 +2377,158 @@ class LocaleDateFormatsFunctionalTest extends DrupalWebTestCase {
     $this->assertText($french_date, t('French date format appears'));
   }
 }
+
+/**
+ * Functional test for language types/negotiation info.
+ */
+class LocaleLanguageNegotiationInfoFunctionalTest extends DrupalWebTestCase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Language negotiation info',
+      'description' => 'Tests alterations to language types/negotiation info.',
+      'group' => 'Locale',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('locale');
+    require_once DRUPAL_ROOT .'/includes/language.inc';
+    $admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages', 'view the administration theme'));
+    $this->drupalLogin($admin_user);
+    $this->drupalPost('admin/config/regional/language/add', array('langcode' => 'it'), t('Add language'));
+  }
+
+  /**
+   * Tests alterations to language types/negotiation info.
+   */
+  function testInfoAlterations() {
+    // Enable language type/negotiation info alterations.
+    variable_set('locale_test_language_types', TRUE);
+    variable_set('locale_test_language_negotiation_info', TRUE);
+    $this->languageNegotiationUpdate();
+
+    // Check that fixed language types are properly configured without the need
+    // of saving the language negotiation settings.
+    $this->checkFixedLanguageTypes();
+
+    // Make the content language type configurable by updating the language
+    // negotiation settings with the proper flag enabled.
+    variable_set('locale_test_content_language_type', TRUE);
+    $this->languageNegotiationUpdate();
+    $type = LANGUAGE_TYPE_CONTENT;
+    $language_types = variable_get('language_types', drupal_language_types());
+    $this->assertTrue($language_types[$type], t('Content language type is configurable.'));
+
+    // Enable some core and custom language providers. The test language type is
+    // supposed to be configurable.
+    $test_type = 'test_language_type';
+    $provider = LOCALE_LANGUAGE_NEGOTIATION_INTERFACE;
+    $test_provider = 'test_language_provider';
+    $form_field = $type . '[enabled]['. $provider .']';
+    $edit = array(
+      $form_field => TRUE,
+      $type . '[enabled][' . $test_provider . ']' => TRUE,
+      $test_type . '[enabled][' . $test_provider . ']' => TRUE,
+    );
+    $this->drupalPost('admin/config/regional/language/configure', $edit, t('Save settings'));
+
+    // Remove the interface language provider by updating the language
+    // negotiation settings with the proper flag enabled.
+    variable_set('locale_test_language_negotiation_info_alter', TRUE);
+    $this->languageNegotiationUpdate();
+    $negotiation = variable_get("language_negotiation_$type", array());
+    $this->assertFalse(isset($negotiation[$provider]), t('Interface language provider removed from the stored settings.'));
+    $this->assertNoFieldByXPath("//input[@name=\"$form_field\"]", NULL, t('Interface language provider unavailable.'));
+
+    // Check that type-specific language providers can be assigned only to the
+    // corresponding language types.
+    foreach (language_types_configurable() as $type) {
+      $form_field = $type . '[enabled][test_language_provider_ts]';
+      if ($type == $test_type) {
+        $this->assertFieldByXPath("//input[@name=\"$form_field\"]", NULL, t('Type-specific test language provider available for %type.', array('%type' => $type)));
+      }
+      else {
+        $this->assertNoFieldByXPath("//input[@name=\"$form_field\"]", NULL, t('Type-specific test language provider unavailable for %type.', array('%type' => $type)));
+      }
+    }
+
+    // Check language negotiation results.
+    $this->drupalGet('');
+    $last = variable_get('locale_test_language_negotiation_last', array());
+    foreach (language_types() as $type) {
+      $langcode = $last[$type];
+      $value = $type == LANGUAGE_TYPE_CONTENT || strpos($type, 'test') !== FALSE ? 'it' : 'en';
+      $this->assertEqual($langcode, $value, t('The negotiated language for %type is %language', array('%type' => $type, '%language' => $langcode)));
+    }
+
+    // Disable locale_test and check that everything is set back to the original
+    // status.
+    $this->languageNegotiationUpdate('disable');
+
+    // Check that only the core language types are available.
+    foreach (language_types() as $type) {
+      $this->assertTrue(strpos($type, 'test') === FALSE, t('The %type language is still available', array('%type' => $type)));
+    }
+
+    // Check that fixed language types are properly configured, even those
+    // previously set to configurable.
+    $this->checkFixedLanguageTypes();
+
+    // Check that unavailable language providers are not present in the
+    // negotiation settings.
+    $negotiation = variable_get("language_negotiation_$type", array());
+    $this->assertFalse(isset($negotiation[$test_provider]), t('The disabled test language provider is not part of the content language negotiation settings.'));
+
+    // Check that configuration page presents the correct options and settings.
+    $this->assertNoRaw(t('Test language detection'), t('No test language type configuration available.'));
+    $this->assertNoRaw(t('This is a test language provider'), t('No test language provider available.'));
+  }
+
+  /**
+   * Update language types/negotiation information.
+   *
+   * Manually invoke locale_modules_enabled()/locale_modules_disabled() since
+   * they would not be invoked after enabling/disabling locale_test the first
+   * time.
+   */
+  private function languageNegotiationUpdate($op = 'enable') {
+    static $last_op = NULL;
+    $modules = array('locale_test');
+
+    // Enable/disable locale_test only if we did not already before.
+    if ($last_op != $op) {
+      $function = "module_{$op}";
+      $function($modules);
+      // Reset hook implementation cache.
+      module_implements(NULL, FALSE, TRUE);
+    }
+
+    drupal_static_reset('language_types_info');
+    drupal_static_reset('language_negotiation_info');
+    $function = "locale_modules_{$op}d";
+    if (function_exists($function)) {
+      $function($modules);
+    }
+
+    $this->drupalGet('admin/config/regional/language/configure');
+  }
+
+  /**
+   * Check that language negotiation for fixed types matches the stored one.
+   */
+  private function checkFixedLanguageTypes() {
+    drupal_static_reset('language_types_info');
+    foreach (language_types_info() as $type => $info) {
+      if (isset($info['fixed'])) {
+        $negotiation = variable_get("language_negotiation_$type", array());
+        $equal = count($info['fixed']) == count($negotiation);
+        while ($equal && list($id) = each($negotiation)) {
+          list(, $info_id) = each($info['fixed']);
+          $equal = $info_id == $id;
+        }
+        $this->assertTrue($equal, t('language negotiation for %type is properly set up', array('%type' => $type)));
+      }
+    }
+  }
+}
diff --git a/modules/locale/tests/locale_test.info b/modules/locale/tests/locale_test.info
index 551f1d5616a98f5dcbafa62d693aa541a48f914b..ca297f51852e358270ccca5a9001768ef27ec22e 100644
--- a/modules/locale/tests/locale_test.info
+++ b/modules/locale/tests/locale_test.info
@@ -1,4 +1,3 @@
-; $Id: locale_test.info,v 1.3 2010/12/20 19:59:42 webchick Exp $
 name = "Locale Test"
 description = "Support module for the locale layer tests."
 core = 7.x
@@ -6,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/locale/tests/locale_test.module b/modules/locale/tests/locale_test.module
index e331b29d6628615797278d83c83c2ea5238102ad..14a2588dd739305d16c0f70b26558f7bae48d6ed 100644
--- a/modules/locale/tests/locale_test.module
+++ b/modules/locale/tests/locale_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: locale_test.module,v 1.6 2010/10/09 13:46:09 dries Exp $
 
 /**
  * @file
@@ -28,14 +27,89 @@ function locale_test_boot() {
   }
 }
 
+/**
+ * Implements hook_init().
+ */
+function locale_test_init() {
+  locale_test_store_language_negotiation();
+}
+
+/**
+ * Implements hook_language_types_info().
+ */
+function locale_test_language_types_info() {
+  if (variable_get('locale_test_language_types', FALSE)) {
+    return array(
+      'test_language_type' => array(
+        'name' => t('Test'),
+        'description' => t('A test language type.'),
+      ),
+      'fixed_test_language_type' => array(
+        'fixed' => array('test_language_provider'),
+      ),
+    );
+  }
+}
+
 /**
  * Implements hook_language_types_info_alter().
  */
 function locale_test_language_types_info_alter(array &$language_types) {
   if (variable_get('locale_test_content_language_type', FALSE)) {
-    $language_types[LANGUAGE_TYPE_CONTENT] = array(
-      'name' => t('Content'),
-      'description' => t('Order of language detection methods for content. If a version of content is available in the detected language, it will be displayed.'),
+    unset($language_types[LANGUAGE_TYPE_CONTENT]['fixed']);
+  }
+}
+
+/**
+ * Implements hook_language_negotiation_info().
+ */
+function locale_test_language_negotiation_info() {
+  if (variable_get('locale_test_language_negotiation_info', FALSE)) {
+    $info = array(
+      'callbacks' => array(
+        'language' => 'locale_test_language_provider',
+      ),
+      'file' => drupal_get_path('module', 'locale_test') .'/locale_test.module',
+      'weight' => -10,
+      'description' => t('This is a test language provider.'),
     );
+
+    return array(
+      'test_language_provider' => array(
+        'name' => t('Test'),
+        'types' => array(LANGUAGE_TYPE_CONTENT, 'test_language_type', 'fixed_test_language_type'),
+      ) + $info,
+      'test_language_provider_ts' => array(
+        'name' => t('Type-specific test'),
+        'types' => array('test_language_type'),
+      ) + $info,
+    );
+  }
+}
+
+/**
+ * Implements hook_language_negotiation_info_alter().
+ */
+function locale_test_language_negotiation_info_alter(array &$language_providers) {
+  if (variable_get('locale_test_language_negotiation_info_alter', FALSE)) {
+    unset($language_providers[LOCALE_LANGUAGE_NEGOTIATION_INTERFACE]);
   }
 }
+
+/**
+ * Store the last negotiated languages.
+ */
+function locale_test_store_language_negotiation() {
+  $last = array();
+  foreach (language_types() as $type) {
+    $last[$type] = $GLOBALS[$type]->language;
+  }
+  variable_set('locale_test_language_negotiation_last', $last);
+}
+
+/**
+ * Test language provider.
+ */
+function locale_test_language_provider($languages) {
+  return 'it';
+}
diff --git a/modules/menu/menu.admin.inc b/modules/menu/menu.admin.inc
index 06b3eb3af8aa813a15163c82a6435f95173cd8be..1f3c4f728f31152074b4dbe999fe62d478352054 100644
--- a/modules/menu/menu.admin.inc
+++ b/modules/menu/menu.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: menu.admin.inc,v 1.90 2010/10/20 07:40:59 webchick Exp $
 
 /**
  * @file
diff --git a/modules/menu/menu.admin.js b/modules/menu/menu.admin.js
index 2fca932ac323268728012a4dc28005c3e853c653..15bc2e7c790b751931012cd8bf1132f37ccc8b62 100644
--- a/modules/menu/menu.admin.js
+++ b/modules/menu/menu.admin.js
@@ -1,4 +1,3 @@
-// $Id: menu.admin.js,v 1.1 2009/10/13 01:25:58 dries Exp $
 
 (function ($) {
 
diff --git a/modules/menu/menu.api.php b/modules/menu/menu.api.php
index 12ccabd61641c44d1cf03e1c54c2092176fc77c6..3f3818e17256eddd8607b7ab396fe7d245ee9d74 100644
--- a/modules/menu/menu.api.php
+++ b/modules/menu/menu.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: menu.api.php,v 1.25 2010/04/28 05:08:24 webchick Exp $
 
 /**
  * @file
diff --git a/modules/menu/menu.css b/modules/menu/menu.css
index 68598ef1f83d62dd31fc04c08fd2c773beaf99e0..96f861adbefa0529851301e9c380d7a2212e81a1 100644
--- a/modules/menu/menu.css
+++ b/modules/menu/menu.css
@@ -1,4 +1,3 @@
-/* $Id: menu.css,v 1.7 2009/10/17 12:10:31 dries Exp $ */
 
 .menu-operations {
   width: 100px;
diff --git a/modules/menu/menu.info b/modules/menu/menu.info
index 0d6bf53084b862ccea16d62eb920e68c82b0ed49..c4b24654b1cf9950ca3273532414ff7fee7935c2 100644
--- a/modules/menu/menu.info
+++ b/modules/menu/menu.info
@@ -1,4 +1,3 @@
-; $Id: menu.info,v 1.11 2010/12/20 19:59:42 webchick Exp $
 name = Menu
 description = Allows administrators to customize the site navigation menu.
 package = Core
@@ -7,8 +6,8 @@ core = 7.x
 files[] = menu.test
 configure = admin/structure/menu
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/menu/menu.install b/modules/menu/menu.install
index 7f6a1fa5e360162cd5f73d4b1bb32f3e59a0a8c9..05aed283fae4eb21d033ece93026f05975b9411f 100644
--- a/modules/menu/menu.install
+++ b/modules/menu/menu.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: menu.install,v 1.26 2010/08/23 23:38:06 webchick Exp $
 
 /**
  * @file
diff --git a/modules/menu/menu.js b/modules/menu/menu.js
index 8123ecef27cd548ac6777ba41356cf1adabd49bc..40c1bfe95fa3b3480c94104803bf32dfdd837e72 100644
--- a/modules/menu/menu.js
+++ b/modules/menu/menu.js
@@ -1,4 +1,3 @@
-// $Id: menu.js,v 1.7 2010/11/05 19:47:20 dries Exp $
 
 (function ($) {
 
diff --git a/modules/menu/menu.module b/modules/menu/menu.module
index 44b3772decde94abac404a95e270a7c37b37a472..fc8f68a6cb603629464ecd6ae733e2fe0a6a2ec1 100644
--- a/modules/menu/menu.module
+++ b/modules/menu/menu.module
@@ -1,9 +1,14 @@
 <?php
-// $Id: menu.module,v 1.233 2010/09/24 00:37:43 dries Exp $
 
 /**
  * @file
- * Allows administrators to customize the site navigation menu.
+ * Allows administrators to customize the site's navigation menus.
+ *
+ * A menu (in this context) is a hierarchical collection of links, generally
+ * used for navigation. This is not to be confused with the
+ * @link menu Menu system @endlink of menu.inc and hook_menu(), which defines
+ * page routing requests for Drupal, and also allows the defined page routing
+ * URLs to be added to the main site navigation menu.
  */
 
 /**
@@ -20,7 +25,7 @@ function menu_help($path, $arg) {
     case 'admin/help#menu':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Menu module provides an interface for managing menus. A menu is a hierarchical collection of links, which can be within or external to the site, generally used for navigation. Each menu is rendered in a block that can be enabled and positioned through the <a href="@blocks"">Blocks administration page</a>. You can view and manage menus on the <a href="@menus">Menus administration page</a>. For more information, see the online handbook entry for the <a href="@menu">Menu module</a>.', array('@blocks' => url('admin/structure/block'), '@menus' => url('admin/structure/menu'), '@menu' => 'http://drupal.org/handbook/modules/menu/')) . '</p>';
+      $output .= '<p>' . t('The Menu module provides an interface for managing menus. A menu is a hierarchical collection of links, which can be within or external to the site, generally used for navigation. Each menu is rendered in a block that can be enabled and positioned through the <a href="@blocks">Blocks administration page</a>. You can view and manage menus on the <a href="@menus">Menus administration page</a>. For more information, see the online handbook entry for the <a href="@menu">Menu module</a>.', array('@blocks' => url('admin/structure/block'), '@menus' => url('admin/structure/menu'), '@menu' => 'http://drupal.org/handbook/modules/menu/')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Managing menus') . '</dt>';
@@ -352,7 +357,7 @@ function menu_parent_options($menus, $item) {
 
 /**
  * Page callback.
- * Get all available menus and menu items as Javascript array.
+ * Get all the available menus and menu items as a JavaScript array.
  */
 function menu_parent_options_js() {
   $available_menus = array();
@@ -535,18 +540,23 @@ function menu_node_delete($node) {
 function menu_node_prepare($node) {
   if (empty($node->menu)) {
     // Prepare the node for the edit form so that $node->menu always exists.
-    $menu_name = variable_get('menu_parent_' . $node->type, 'main-menu:0');
+    $menu_name = strtok(variable_get('menu_parent_' . $node->type, 'main-menu:0'), ':');
     $item = array();
     if (isset($node->nid)) {
+      $mlid = FALSE;
       // Give priority to the default menu
-      $mlid = db_query_range("SELECT mlid FROM {menu_links} WHERE link_path = :path AND menu_name = :menu_name AND module = 'menu' ORDER BY mlid ASC", 0, 1, array(
-        ':path' => 'node/' . $node->nid,
-        ':menu_name' => $menu_name,
-      ))->fetchField();
-      // Check all menus if a link does not exist in the default menu.
-      if (!$mlid) {
-        $mlid = db_query_range("SELECT mlid FROM {menu_links} WHERE link_path = :path AND module = 'menu' ORDER BY mlid ASC", 0, 1, array(
+      $type_menus = variable_get('menu_options_' . $node->type, array('main-menu' => 'main-menu'));
+      if (in_array($menu_name, $type_menus)) {
+        $mlid = db_query_range("SELECT mlid FROM {menu_links} WHERE link_path = :path AND menu_name = :menu_name AND module = 'menu' ORDER BY mlid ASC", 0, 1, array(
+          ':path' => 'node/' . $node->nid,
+          ':menu_name' => $menu_name,
+        ))->fetchField();
+      }
+      // Check all allowed menus if a link does not exist in the default menu.
+      if (!$mlid && !empty($type_menus)) {
+        $mlid = db_query_range("SELECT mlid FROM {menu_links} WHERE link_path = :path AND module = 'menu' AND menu_name IN (:type_menus) ORDER BY mlid ASC", 0, 1, array(
           ':path' => 'node/' . $node->nid,
+          ':type_menus' => array_values($type_menus),
         ))->fetchField();
       }
       if ($mlid) {
diff --git a/modules/menu/menu.test b/modules/menu/menu.test
index a2c4ebdc3fa4d5da803b454b44d818ced43b2faf..b457177cdbb0fccd69e0a36d975ab95c54aeb2d1 100644
--- a/modules/menu/menu.test
+++ b/modules/menu/menu.test
@@ -1,9 +1,8 @@
 <?php
-// $Id: menu.test,v 1.42 2010/10/13 13:43:21 dries Exp $
 
 /**
  * @file
- * Tests file for the menu module.
+ * Tests for menu.module.
  */
 
 class MenuTestCase extends DrupalWebTestCase {
@@ -380,7 +379,7 @@ class MenuTestCase extends DrupalWebTestCase {
   /**
    * Modify a menu link using the menu module UI.
    *
-   * @param array &$item Menu link passed by reference.
+   * @param array $item Menu link passed by reference.
    */
   function modifyMenuLink(&$item) {
     $item['link_title'] = $this->randomName(16);
@@ -665,5 +664,21 @@ class MenuNodeTestCase extends DrupalWebTestCase {
     // Assert that there is no link for the node.
     $this->drupalGet('');
     $this->assertNoLink($node_title);
+
+    // Add a menu link to the Management menu.
+    $item = array(
+      'link_path' => 'node/' . $node->nid,
+      'link_title' => $this->randomName(16),
+      'menu_name' => 'management',
+    );
+    menu_link_save($item);
+
+    // Assert that disabled Management menu is not shown on the node/$nid/edit page.
+    $this->drupalGet('node/' . $node->nid . '/edit');
+    $this->assertText('Provide a menu link', t('Link in not allowed menu not shown in node edit form'));
+    // Assert that the link is still in the management menu after save.
+    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+    $link = menu_link_load($item['mlid']);
+    $this->assertTrue($link, t('Link in not allowed menu still exists after saving node'));
   }
 }
diff --git a/modules/node/content_types.inc b/modules/node/content_types.inc
index 67eacad7ace6b341f6d50a427024ffb44a6e019c..11ecc2c38d29fa492f3cc72a4d8ac3fe02bea040 100644
--- a/modules/node/content_types.inc
+++ b/modules/node/content_types.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: content_types.inc,v 1.119 2010/10/13 13:43:21 dries Exp $
 
 /**
  * @file
@@ -70,7 +69,7 @@ function theme_node_admin_overview($variables) {
   $type = $variables['type'];
 
   $output = check_plain($name);
-  $output .= ' <small> (Machine name: ' . check_plain($type->type) . ')</small>';
+  $output .= ' <small>' . t('(Machine name: @type)', array('@type' => $type->type)) . '</small>';
   $output .= '<div class="description">' . filter_xss_admin($type->description) . '</div>';
   return $output;
 }
diff --git a/modules/node/content_types.js b/modules/node/content_types.js
index 94fe1eb89507657ca2ceece6c20cf87738dabd9f..0031c323fac33019341d5aab9757ecf2702b2e8f 100644
--- a/modules/node/content_types.js
+++ b/modules/node/content_types.js
@@ -1,4 +1,3 @@
-// $Id: content_types.js,v 1.10 2010/05/05 06:55:25 webchick Exp $
 (function ($) {
 
 Drupal.behaviors.contentTypes = {
diff --git a/modules/node/node-rtl.css b/modules/node/node-rtl.css
index 169ede7f57cf518499ba3bbca118c116b78bc523..a5fe99eaaa86dedacd5fc6ad6d4183a8f96c69c7 100644
--- a/modules/node/node-rtl.css
+++ b/modules/node/node-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: node-rtl.css,v 1.5 2009/11/17 02:50:41 webchick Exp $ */
 
 #node-admin-content dl.multiselect dd .form-item label {
   display: block;
diff --git a/modules/node/node.admin.inc b/modules/node/node.admin.inc
index 795e8a71a5abe147d080fb448676579c8248ccae..a6ea1b5e5b6de1a2371f473687ecb0c3c42920d8 100644
--- a/modules/node/node.admin.inc
+++ b/modules/node/node.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node.admin.inc,v 1.103 2010/12/09 02:16:21 dries Exp $
 
 /**
  * @file
@@ -388,9 +387,9 @@ function node_admin_nodes() {
     '#submit' => array('node_admin_nodes_submit'),
   );
 
-  // Enable language column if translation module is enabled
-  // or if we have any node with language.
-  $multilanguage = (module_exists('translation') || db_query("SELECT COUNT(*) FROM {node} WHERE language <> :language", array(':language' => LANGUAGE_NONE))->fetchField());
+  // Enable language column if translation module is enabled or if we have any
+  // node with language.
+  $multilanguage = (module_exists('translation') || db_query_range("SELECT 1 FROM {node} WHERE language <> :language", 0, 1, array(':language' => LANGUAGE_NONE))->fetchField());
 
   // Build the sortable table header.
   $header = array(
diff --git a/modules/node/node.api.php b/modules/node/node.api.php
index 8e3c0b0d382c8c29d3a3c430f48a9395bc69258f..3e8029cfc76572a0356510b2c47a44416521486b 100644
--- a/modules/node/node.api.php
+++ b/modules/node/node.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: node.api.php,v 1.83 2011/01/03 18:03:54 webchick Exp $
 
 /**
  * @file
@@ -38,6 +37,7 @@
  * - Creating a new node (calling node_save() on a new node):
  *   - field_attach_presave()
  *   - hook_node_presave() (all)
+ *   - hook_entity_presave() (all)
  *   - Node and revision records are written to the database
  *   - hook_insert() (node-type-specific)
  *   - field_attach_insert()
@@ -48,6 +48,7 @@
  * - Updating an existing node (calling node_save() on an existing node):
  *   - field_attach_presave()
  *   - hook_node_presave() (all)
+ *   - hook_entity_presave() (all)
  *   - Node and revision records are written to the database
  *   - hook_update() (node-type-specific)
  *   - field_attach_update()
@@ -70,6 +71,9 @@
  *   - hook_entity_prepare_view() (all)
  *   - field_attach_view()
  *   - hook_node_view() (all)
+ *   - hook_entity_view() (all)
+ *   - hook_node_view_alter() (all)
+ *   - hook_entity_view_alter() (all)
  * - Viewing multiple nodes (calling node_view_multiple() - note that the input
  *   to node_view_multiple() is a set of loaded nodes, so the Loading steps
  *   above are already done):
@@ -78,13 +82,16 @@
  *   - hook_view() (node-type-specific)
  *   - field_attach_view()
  *   - hook_node_view() (all)
+ *   - hook_entity_view() (all)
  *   - hook_node_view_alter() (all)
+ *   - hook_entity_view_alter() (all)
  * - Deleting a node (calling node_delete() or node_delete_multiple()):
  *   - Node is loaded (see Loading section above)
- *   - Node and revision information is deleted from database
  *   - hook_delete() (node-type-specific)
  *   - hook_node_delete() (all)
+ *   - hook_entity_delete() (all)
  *   - field_attach_delete()
+ *   - Node and revision information are deleted from database
  * - Deleting a node revision (calling node_revision_delete()):
  *   - Node is loaded (see Loading section above)
  *   - Revision information is deleted from database
@@ -315,7 +322,7 @@ function hook_node_access_records($node) {
  * @see hook_node_grants()
  * @see hook_node_grants_alter()
  *
- * @param &$grants
+ * @param $grants
  *   The $grants array returned by hook_node_access_records().
  * @param $node
  *   The node for which the grants were acquired.
@@ -360,7 +367,7 @@ function hook_node_access_records_alter(&$grants, $node) {
  * @see hook_node_access_records()
  * @see hook_node_access_records_alter()
  *
- * @param &$grants
+ * @param $grants
  *   The $grants array returned by hook_node_grants().
  * @param $account
  *   The user account requesting access to content.
@@ -454,9 +461,10 @@ function hook_node_operations() {
 /**
  * Respond to node deletion.
  *
- * This hook is invoked from node_delete_multiple() after the node has been
- * removed from the node table in the database, after the type-specific
- * hook_delete() has been invoked, and before field_attach_delete() is called.
+ * This hook is invoked from node_delete_multiple() after the type-specific
+ * hook_delete() has been invoked, but before hook_entity_delete and
+ * field_attach_delete() are called, and before the node is removed from the
+ * node table in the database.
  *
  * @param $node
  *   The node that is being deleted.
@@ -580,7 +588,7 @@ function hook_node_load($nodes, $types) {
  * @return
  *   NODE_ACCESS_ALLOW if the operation is to be allowed;
  *   NODE_ACCESS_DENY if the operation is to be denied;
- *   NODE_ACCESSS_IGNORE to not affect this operation at all.
+ *   NODE_ACCESS_IGNORE to not affect this operation at all.
  */
 function hook_node_access($node, $op, $account) {
   $type = is_string($node) ? $node : $node->type;
@@ -1057,8 +1065,6 @@ function hook_prepare($node) {
  * displayed automatically by the node module. This hook just needs to
  * return the node title and form editing fields specific to the node type.
  *
- * For a detailed usage example, see node_example.module.
- *
  * @param $node
  *   The node being added or edited.
  * @param $form_state
diff --git a/modules/node/node.css b/modules/node/node.css
index 1df32e34143ac69fb2468d84c898b7d902caf233..07540fa90b94a6138305a7bf573b5a432c662ee5 100644
--- a/modules/node/node.css
+++ b/modules/node/node.css
@@ -1,4 +1,3 @@
-/* $Id: node.css,v 1.18 2010/09/17 14:53:21 dries Exp $ */
 
 .node-unpublished {
   background-color: #fff4f4;
diff --git a/modules/node/node.info b/modules/node/node.info
index 86e60d158a7f6e671981ae533f07a7f3d5956831..d61ee3e6dadd4aacc5501af41e0f713bacc5486d 100644
--- a/modules/node/node.info
+++ b/modules/node/node.info
@@ -1,4 +1,3 @@
-; $Id: node.info,v 1.15 2010/12/20 19:59:42 webchick Exp $
 name = Node
 description = Allows content to be submitted to the site and displayed on pages.
 package = Core
@@ -10,8 +9,8 @@ required = TRUE
 configure = admin/structure/types
 stylesheets[all][] = node.css
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/node/node.install b/modules/node/node.install
index fe6661cdaaafacb928585b4fde1f8470299cc19b..852c1117b11e4e04fd650b1eb7c18b8ece73e039 100644
--- a/modules/node/node.install
+++ b/modules/node/node.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: node.install,v 1.62 2011/01/02 17:26:39 webchick Exp $
 
 /**
  * @file
@@ -396,6 +395,34 @@ function node_schema() {
     ),
   );
 
+  $schema['history'] = array(
+    'description' => 'A record of which {users} have read which {node}s.',
+    'fields' => array(
+      'uid' => array(
+        'description' => 'The {users}.uid that read the {node} nid.',
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'nid' => array(
+        'description' => 'The {node}.nid that was read.',
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+      'timestamp' => array(
+        'description' => 'The Unix timestamp at which the read occurred.',
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
+    ),
+    'primary key' => array('uid', 'nid'),
+    'indexes' => array(
+      'nid' => array('nid'),
+    ),
+  );
+
   return $schema;
 }
 
@@ -442,7 +469,26 @@ function node_update_dependencies() {
  * @ingroup update-api-6.x-to-7.x
  */
 function _update_7000_node_get_types() {
-  return db_query('SELECT * FROM {node_type}')->fetchAllAssoc('type', PDO::FETCH_OBJ);
+  $node_types = db_query('SELECT * FROM {node_type}')->fetchAllAssoc('type', PDO::FETCH_OBJ);
+
+  // Create default settings for orphan nodes.
+  $all_types = db_query('SELECT DISTINCT type FROM {node}')->fetchCol();
+  $extra_types = array_diff($all_types, array_keys($node_types));
+
+  foreach ($extra_types as $type) {
+    $type_object = new stdClass;
+    $type_object->type = $type;
+
+    // In Drupal 6, whether you have a body field or not is a flag in the node
+    // type table. If it's enabled, nodes may or may not have an empty string
+    // for the bodies. As we can't detect what this setting should be in
+    // Drupal 7 without access to the Drupal 6 node type settings, we assume
+    // the default, which is to enable the body field.
+    $type_object->has_body = 1;
+    $type_object->body_label = 'Body';
+    $node_types[$type_object->type] = $type_object;
+  }
+  return $node_types;
 }
 
 /**
@@ -573,19 +619,6 @@ function node_update_7006(&$sandbox) {
     // Get node type info, specifically the body field settings.
     $node_types = _update_7000_node_get_types();
 
-    // Create default settings for orphan nodes.
-    $extra_types = db_query('SELECT DISTINCT type FROM {node} WHERE type NOT IN (:types)', array(':types' => array_keys($node_types)))->fetchCol();
-    foreach ($extra_types as $type) {
-      $type_object = new stdClass;
-      $type_object->type = $type;
-      // Always create a body. Querying node_revisions for a non-empty body
-      // would skip creating body fields for types that have a body but
-      // the nodes of that type so far had empty bodies.
-      $type_object->has_body = 1;
-      $type_object->body_label = 'Body';
-      $node_types[$type_object->type] = $type_object;
-    }
-
     // Add body field instances for existing node types.
     foreach ($node_types as $node_type) {
       if ($node_type->has_body) {
@@ -803,6 +836,29 @@ function node_update_7010() {
   db_create_table('block_node_type', $schema['block_node_type']);
 }
 
+/**
+ * Update the database from Drupal 6 to match the schema.
+ */
+function node_update_7011() {
+  // Drop node moderation field.
+  db_drop_field('node', 'moderate');
+  db_drop_index('node', 'node_moderate');
+
+  // Change {node_revision}.status field to default to 1.
+  db_change_field('node_revision', 'status', 'status', array(
+    'type' => 'int',
+    'not null' => TRUE,
+    'default' => 1,
+  ));
+
+  // Change {node_type}.module field default.
+  db_change_field('node_type', 'module', 'module', array(
+    'type' => 'varchar',
+    'length' => 255,
+    'not null' => TRUE,
+  ));
+}
+
 /**
  * @} End of "addtogroup updates-6.x-to-7.x"
  */
diff --git a/modules/node/node.js b/modules/node/node.js
index a5961f9793d3afb2d26710869c44c7a0314b02a0..ebf68eb3ba2a4e6ff0fdefeb5201fcb0bd678c04 100644
--- a/modules/node/node.js
+++ b/modules/node/node.js
@@ -1,4 +1,3 @@
-// $Id: node.js,v 1.8 2010/12/15 03:42:25 webchick Exp $
 
 (function ($) {
 
diff --git a/modules/node/node.module b/modules/node/node.module
index bafb54f33aa1318cba1c03ed892782930fe593ce..524a57fa7e744d116e9306af60d7a2420f99fb3a 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: node.module,v 1.1336 2011/01/03 18:03:54 webchick Exp $
 
 /**
  * @file
@@ -365,7 +364,7 @@ function node_mark($nid, $timestamp) {
  *   Either a string or object, containing the node type information.
  *
  * @return
- *   Node type of the passed in data.
+ *   Node type of the passed-in data.
  */
 function _node_extract_type($node) {
   return is_object($node) ? $node->type : $node;
@@ -490,7 +489,6 @@ function node_type_load($name) {
  *   Status flag indicating outcome of the operation.
  */
 function node_type_save($info) {
-  $is_existing = FALSE;
   $existing_type = !empty($info->old_type) ? $info->old_type : $info->type;
   $is_existing = (bool) db_query_range('SELECT 1 FROM {node_type} WHERE type = :type', 0, 1, array(':type' => $existing_type))->fetchField();
   $type = node_type_set_defaults($info);
@@ -570,7 +568,7 @@ function node_add_body_field($type, $label = 'Body') {
       'entity_type' => 'node',
       'bundle' => $type->type,
       'label' => $label,
-      'widget_type' => 'text_textarea_with_summary',
+      'widget' => array('type' => 'text_textarea_with_summary'),
       'settings' => array('display_summary' => TRUE),
       'display' => array(
         'default' => array(
@@ -754,17 +752,20 @@ function node_type_cache_reset() {
 }
 
 /**
- * Set the default values for a node type.
+ * Sets the default values for a node type.
  *
- * The defaults are for a type defined through hook_node_info().
- * When populating a custom node type $info should have the 'custom'
- * key set to 1.
+ * The defaults are appropriate for a type defined through hook_node_info(),
+ * since 'custom' is TRUE for types defined in the user interface, and FALSE
+ * for types defined by modules. (The 'custom' flag prevents types from being
+ * deleted through the user interface.) Also, the default for 'locked' is TRUE,
+ * which prevents users from changing the machine name of the type.
  *
  * @param $info
- *   An object or array containing values to override the defaults.
+ *   An object or array containing values to override the defaults. See
+ *   hook_node_info() for details on what the array elements mean.
  *
  * @return
- *   A node type object.
+ *   A node type object, with missing values in $info set to their defaults.
  */
 function node_type_set_defaults($info = array()) {
   $info = (array) $info;
@@ -1349,15 +1350,15 @@ function node_build_content($node, $view_mode = 'full', $langcode = NULL) {
   // The 'view' hook can be implemented to overwrite the default function
   // to display nodes.
   if (node_hook($node, 'view')) {
-    $node = node_invoke($node, 'view', $view_mode);
+    $node = node_invoke($node, 'view', $view_mode, $langcode);
   }
 
   // Build fields content.
   // In case of a multiple view, node_view_multiple() already ran the
   // 'prepare_view' step. An internal flag prevents the operation from running
   // twice.
-  field_attach_prepare_view('node', array($node->nid => $node), $view_mode);
-  entity_prepare_view('node', array($node->nid => $node));
+  field_attach_prepare_view('node', array($node->nid => $node), $view_mode, $langcode);
+  entity_prepare_view('node', array($node->nid => $node), $langcode);
   $node->content += field_attach_view('node', $node, $view_mode, $langcode);
 
   // Always display a read more link on teasers because we have no way
@@ -1411,7 +1412,7 @@ function node_show($node, $message = FALSE) {
 }
 
 /**
- * Returns whether the current page is the full page view of the passed in node.
+ * Returns whether the current page is the full page view of the passed-in node.
  *
  * @param $node
  *   A node object.
@@ -1450,10 +1451,6 @@ function template_preprocess_node(&$variables) {
   $variables['title']     = check_plain($node->title);
   $variables['page']      = $variables['view_mode'] == 'full' && node_is_page($node);
 
-  if (!empty($node->in_preview)) {
-    unset($node->content['links']);
-  }
-
   // Flatten the node object's member fields.
   $variables = array_merge((array) $node, $variables);
 
@@ -2190,7 +2187,7 @@ function node_get_recent($number = 10) {
   }
   $nids = $query
     ->fields('n', array('nid'))
-    ->orderBy('changed', 'DESC')
+    ->orderBy('n.changed', 'DESC')
     ->range(0, $number)
     ->addTag('node_access')
     ->execute()
@@ -2516,8 +2513,8 @@ function node_feed($nids = FALSE, $channel = array()) {
  *   An array in the format expected by drupal_render().
  */
 function node_view_multiple($nodes, $view_mode = 'teaser', $weight = 0, $langcode = NULL) {
-  field_attach_prepare_view('node', $nodes, $view_mode);
-  entity_prepare_view('node', $nodes);
+  field_attach_prepare_view('node', $nodes, $view_mode, $langcode);
+  entity_prepare_view('node', $nodes, $langcode);
   $build = array();
   foreach ($nodes as $node) {
     $build['nodes'][$node->nid] = node_view($node, $view_mode, $langcode);
diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc
index 1b0e3fd03f71f41781a6d159c9eb70b042ce12ee..ed1af3e9bfd9d72e227a971b3f441f7fee70946a 100644
--- a/modules/node/node.pages.inc
+++ b/modules/node/node.pages.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node.pages.inc,v 1.136 2010/11/26 19:23:01 dries Exp $
 
 /**
  * @file
diff --git a/modules/node/node.test b/modules/node/node.test
index 4c189a8306b9f0a839ebab0bdd9f932b50311e97..8a871c0c731fcf61fd5c52d0bb8e962c4e916f46 100644
--- a/modules/node/node.test
+++ b/modules/node/node.test
@@ -1,5 +1,9 @@
 <?php
-// $Id: node.test,v 1.106 2010/12/17 19:28:14 webchick Exp $
+
+/**
+ * @file
+ * Tests for node.module.
+ */
 
 /**
  * Test the node_load_multiple() function.
@@ -2126,7 +2130,7 @@ class NodeTokenReplaceTestCase extends DrupalWebTestCase {
 
     foreach ($tests as $input => $expected) {
       $output = token_replace($input, array('node' => $node), array('language' => $language));
-      $this->assertFalse(strcmp($output, $expected), t('Sanitized node token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, t('Sanitized node token %token replaced.', array('%token' => $input)));
     }
 
     // Generate and test unsanitized tokens.
@@ -2138,7 +2142,7 @@ class NodeTokenReplaceTestCase extends DrupalWebTestCase {
 
     foreach ($tests as $input => $expected) {
       $output = token_replace($input, array('node' => $node), array('language' => $language, 'sanitize' => FALSE));
-      $this->assertFalse(strcmp($output, $expected), t('Unsanitized node token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, t('Unsanitized node token %token replaced.', array('%token' => $input)));
     }
   }
 }
diff --git a/modules/node/node.tokens.inc b/modules/node/node.tokens.inc
index 46d329fcec59f1ca76a0a232f4ee1d000f2fd53e..80dbda517a011d497888ffed124c1486e9fd8442 100644
--- a/modules/node/node.tokens.inc
+++ b/modules/node/node.tokens.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node.tokens.inc,v 1.15 2010/06/29 00:57:19 dries Exp $
 
 /**
  * @file
diff --git a/modules/node/node.tpl.php b/modules/node/node.tpl.php
index a864bb8e650468b48e6e026d7f252656707ad4c6..6d0f489d71df9d4e0dfd4fade820b8c6492f6022 100644
--- a/modules/node/node.tpl.php
+++ b/modules/node/node.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: node.tpl.php,v 1.34 2010/12/01 00:18:15 webchick Exp $
 
 /**
  * @file
diff --git a/modules/node/tests/node_access_test.info b/modules/node/tests/node_access_test.info
index 38bd21d490c215ace8a9bda1e67b99afc6984a62..ee2433c2aab3a1e0ca5a31d6a1dc630edae3e747 100644
--- a/modules/node/tests/node_access_test.info
+++ b/modules/node/tests/node_access_test.info
@@ -1,4 +1,3 @@
-; $Id: node_access_test.info,v 1.2 2010/12/20 19:59:42 webchick Exp $
 name = "Node module access tests"
 description = "Support module for node permission testing."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/node/tests/node_access_test.module b/modules/node/tests/node_access_test.module
index 97defc5371a87d76cf7c8a5366b6bd823516c09b..3004e0c904eb808a1be2b1cd8e8f1d24e2aebad8 100644
--- a/modules/node/tests/node_access_test.module
+++ b/modules/node/tests/node_access_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_access_test.module,v 1.4 2010/11/20 04:33:56 webchick Exp $
 
 /**
  * @file
diff --git a/modules/node/tests/node_test.info b/modules/node/tests/node_test.info
index 7f8e9b53f95d13a7503cf44fd7690742e727b365..29640594bb6bec033416086871e7682726338226 100644
--- a/modules/node/tests/node_test.info
+++ b/modules/node/tests/node_test.info
@@ -1,4 +1,3 @@
-; $Id: node_test.info,v 1.2 2010/12/20 19:59:42 webchick Exp $
 name = "Node module tests"
 description = "Support module for node related testing."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/node/tests/node_test.module b/modules/node/tests/node_test.module
index 76c7074f9d14e348509d34bf6f967366cfa70c8d..b0ebc149a150199121999b6275bc98ecb8ba0019 100644
--- a/modules/node/tests/node_test.module
+++ b/modules/node/tests/node_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_test.module,v 1.14 2010/11/30 19:31:46 dries Exp $
 
 /**
  * @file
diff --git a/modules/node/tests/node_test_exception.info b/modules/node/tests/node_test_exception.info
index 54585b357d93b60b93f9fea05bb496bce1916621..37d2af91f1a70e1fa631f26b22004b5b4ce38834 100644
--- a/modules/node/tests/node_test_exception.info
+++ b/modules/node/tests/node_test_exception.info
@@ -1,4 +1,3 @@
-; $Id: node_test_exception.info,v 1.2 2010/12/20 19:59:42 webchick Exp $
 name = "Node module exception tests"
 description = "Support module for node related exception testing."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/node/tests/node_test_exception.module b/modules/node/tests/node_test_exception.module
index fc26b9e6277d7856dc44a1fc5a29890f2bfe2967..0fe9f35ea564e70e15f9c730183c56453488b812 100644
--- a/modules/node/tests/node_test_exception.module
+++ b/modules/node/tests/node_test_exception.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_test_exception.module,v 1.4 2010/01/09 21:54:01 webchick Exp $
 
 /**
  * @file
diff --git a/modules/openid/openid-rtl.css b/modules/openid/openid-rtl.css
index eac22b0e327f1880e47bae7aeed4aaa85b2e557d..861f6d7d19de04874406c8224d7d1e798a309c4a 100644
--- a/modules/openid/openid-rtl.css
+++ b/modules/openid/openid-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: openid-rtl.css,v 1.1 2010/06/04 20:39:44 dries Exp $ */
 
 #edit-openid-identifier {
   background-position: right 50%;
diff --git a/modules/openid/openid.api.php b/modules/openid/openid.api.php
index b797e807cf95d5a5d0b5450fc984866ff0d85d8d..11faa71efa897c8884acf1430efccf673be3f99d 100644
--- a/modules/openid/openid.api.php
+++ b/modules/openid/openid.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: openid.api.php,v 1.5 2010/05/13 17:37:24 dries Exp $
 
 /**
  * @file
diff --git a/modules/openid/openid.css b/modules/openid/openid.css
index dc587683c5ed6418a8c34eb0135638375bbe7c28..48b170fbb94de3bafdbd26988b89058ef65eb617 100644
--- a/modules/openid/openid.css
+++ b/modules/openid/openid.css
@@ -1,4 +1,3 @@
-/* $Id: openid.css,v 1.11 2010/05/05 16:28:06 dries Exp $ */
 
 #edit-openid-identifier {
   background-image: url("login-bg.png");
diff --git a/modules/openid/openid.inc b/modules/openid/openid.inc
index 9e02f21335a0b7818aa40341cd5917aa96e26ccc..6945f34ed5a8a3a18de3cd7a1e0edf52c4fd9d3f 100644
--- a/modules/openid/openid.inc
+++ b/modules/openid/openid.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: openid.inc,v 1.37 2010/10/28 02:27:09 dries Exp $
 
 /**
  * @file
@@ -189,32 +188,33 @@ function _openid_select_service(array $services) {
   // Extensible Resource Identifier (XRI) Resolution Version 2.0, section 4.3.3:
   // Find the service with the highest priority (lowest integer value). If there
   // is a tie, select a random one, not just the first in the XML document.
-  $selected_service = NULL;
   shuffle($services);
+  $selected_service = NULL;
+  $selected_type_priority = FALSE;
 
   // Search for an OP Identifier Element.
   foreach ($services as $service) {
     if (!empty($service['uri'])) {
+      $type_priority = FALSE;
       if (in_array('http://specs.openid.net/auth/2.0/server', $service['types'])) {
         $service['version'] = 2;
+        $type_priority = 1;
+      }
+      elseif (in_array('http://specs.openid.net/auth/2.0/signon', $service['types'])) {
+        $service['version'] = 2;
+        $type_priority = 2;
       }
       elseif (in_array(OPENID_NS_1_0, $service['types']) || in_array(OPENID_NS_1_1, $service['types'])) {
         $service['version'] = 1;
+        $type_priority = 3;
       }
-      if (isset($service['version']) && (!$selected_service || $service['priority'] < $selected_service['priority'])) {
-        $selected_service = $service;
-      }
-    }
-  }
 
-  if (!$selected_service) {
-    // Search for Claimed Identifier Element.
-    foreach ($services as $service) {
-      if (!empty($service['uri']) && in_array('http://specs.openid.net/auth/2.0/signon', $service['types'])) {
-        $service['version'] = 2;
-        if (!$selected_service || $service['priority'] < $selected_service['priority']) {
-          $selected_service = $service;
-        }
+      if ($type_priority
+          && (!$selected_service
+              || $type_priority < $selected_type_priority
+              || ($type_priority == $selected_type_priority && $service['priority'] < $selected_service['priority']))) {
+        $selected_service = $service;
+        $selected_type_priority = $type_priority;
       }
     }
   }
@@ -448,15 +448,15 @@ function _openid_dh_binary_to_long($str) {
 
   $n = 0;
   foreach ($bytes as $byte) {
-    $n = bcmul($n, pow(2, 8));
-    $n = bcadd($n, $byte);
+    $n = _openid_math_mul($n, pow(2, 8));
+    $n = _openid_math_add($n, $byte);
   }
 
   return $n;
 }
 
 function _openid_dh_long_to_binary($long) {
-  $cmp = bccomp($long, 0);
+  $cmp = _openid_math_cmp($long, 0);
   if ($cmp < 0) {
     return FALSE;
   }
@@ -467,9 +467,9 @@ function _openid_dh_long_to_binary($long) {
 
   $bytes = array();
 
-  while (bccomp($long, 0) > 0) {
-    array_unshift($bytes, bcmod($long, 256));
-    $long = bcdiv($long, pow(2, 8));
+  while (_openid_math_cmp($long, 0) > 0) {
+    array_unshift($bytes, _openid_math_mod($long, 256));
+    $long = _openid_math_div($long, pow(2, 8));
   }
 
   if ($bytes && ($bytes[0] > 127)) {
@@ -512,11 +512,11 @@ function _openid_dh_rand($stop) {
       $nbytes = strlen($rbytes);
     }
 
-    $mxrand = bcpow(256, $nbytes);
+    $mxrand = _openid_math_pow(256, $nbytes);
 
     // If we get a number less than this, then it is in the
     // duplicated range.
-    $duplicate = bcmod($mxrand, $stop);
+    $duplicate = _openid_math_mod($mxrand, $stop);
 
     if (count($duplicate_cache) > 10) {
       $duplicate_cache = array();
@@ -529,9 +529,9 @@ function _openid_dh_rand($stop) {
     $bytes = "\x00" . _openid_get_bytes($nbytes);
     $n = _openid_dh_binary_to_long($bytes);
     // Keep looping if this value is in the low duplicated range.
-  } while (bccomp($n, $duplicate) < 0);
+  } while (_openid_math_cmp($n, $duplicate) < 0);
 
-  return bcmod($n, $stop);
+  return _openid_math_mod($n, $stop);
 }
 
 function _openid_get_bytes($num_bytes) {
@@ -683,3 +683,113 @@ function openid_extract_ax_values($values, $uris) {
   return $output;
 }
 
+/**
+ * Determine the available math library GMP vs. BCMath, favouring GMP for performance.
+ */
+function _openid_get_math_library() {
+  // Not drupal_static(), because a function is not going to disappear and
+  // change the output of this under any circumstances.
+  static $library;
+
+  if (empty($library)) {
+    if (function_exists('gmp_add')) {
+      $library =  'gmp';
+    }
+    elseif (function_exists('bcadd')) {
+      $library = 'bcmath';
+    }
+  }
+
+  return $library;
+}
+
+/**
+ * Calls the add function from the available math library for OpenID.
+ */
+function _openid_math_add($x, $y) {
+  $library = _openid_get_math_library();
+  switch ($library) {
+    case 'gmp':
+      return gmp_strval(gmp_add($x, $y));
+    case 'bcmath':
+      return bcadd($x, $y);
+  }
+}
+
+/**
+ * Calls the mul function from the available math library for OpenID.
+ */
+function _openid_math_mul($x, $y) {
+  $library = _openid_get_math_library();
+  switch ($library) {
+    case 'gmp':
+      return gmp_mul($x, $y);
+    case 'bcmath':
+      return bcmul($x, $y);
+  }
+}
+
+/**
+ * Calls the div function from the available math library for OpenID.
+ */
+function _openid_math_div($x, $y) {
+  $library = _openid_get_math_library();
+  switch ($library) {
+    case 'gmp':
+      return gmp_div($x, $y);
+    case 'bcmath':
+      return bcdiv($x, $y);
+  }
+}
+
+/**
+ * Calls the cmp function from the available math library for OpenID.
+ */
+function _openid_math_cmp($x, $y) {
+  $library = _openid_get_math_library();
+  switch ($library) {
+    case 'gmp':
+      return gmp_cmp($x, $y);
+    case 'bcmath':
+      return bccomp($x, $y);
+  }
+}
+
+/**
+ * Calls the mod function from the available math library for OpenID.
+ */
+function _openid_math_mod($x, $y) {
+  $library = _openid_get_math_library();
+  switch ($library) {
+    case 'gmp':
+      return gmp_mod($x, $y);
+    case 'bcmath':
+      return bcmod($x, $y);
+  }
+}
+
+/**
+ * Calls the pow function from the available math library for OpenID.
+ */
+function _openid_math_pow($x, $y) {
+  $library = _openid_get_math_library();
+  switch ($library) {
+    case 'gmp':
+      return gmp_pow($x, $y);
+    case 'bcmath':
+      return bcpow($x, $y);
+  }
+}
+
+/**
+ * Calls the mul function from the available math library for OpenID.
+ */
+function _openid_math_powmod($x, $y, $z) {
+  $library = _openid_get_math_library();
+  switch ($library) {
+    case 'gmp':
+      return gmp_powm($x, $y, $z);
+    case 'bcmath':
+      return bcpowmod($x, $y, $z);
+  }
+}
diff --git a/modules/openid/openid.info b/modules/openid/openid.info
index 9d5b134c213ecc789ec0432e6d871db7bff0ba8f..69623671d3338a53c62c46dcd14c918e71e0cd4a 100644
--- a/modules/openid/openid.info
+++ b/modules/openid/openid.info
@@ -1,4 +1,3 @@
-; $Id: openid.info,v 1.9 2010/12/20 19:59:42 webchick Exp $
 name = OpenID
 description = "Allows users to log into your site using OpenID."
 version = VERSION
@@ -6,8 +5,8 @@ package = Core
 core = 7.x
 files[] = openid.test
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/openid/openid.install b/modules/openid/openid.install
index 0e396b01f32d2f1d80ede78a30616d4b091f395c..2df39aa6969f609815ffcce64e2ed01044821e3d 100644
--- a/modules/openid/openid.install
+++ b/modules/openid/openid.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: openid.install,v 1.13 2011/01/02 17:26:39 webchick Exp $
 
 /**
  * @file
@@ -92,20 +91,27 @@ function openid_requirements($phase) {
 
   if ($phase == 'runtime') {
     // Check for the PHP BC Math library.
-    if (!function_exists('bcadd')) {
-      $requirements['bcmath'] = array(
+    if (!function_exists('bcadd') && !function_exists('gmp_add')) {
+      $requirements['openid_math'] = array(
         'value' => t('Not installed'),
         'severity' => REQUIREMENT_ERROR,
-        'description' => t('OpenID requires the BC Math library for PHP which is missing or outdated. Check the <a href="@url">PHP BC Math Library documentation</a> for information on how to correct this.', array('@url' => 'http://www.php.net/manual/en/book.bc.php')),
+        'description' => t('OpenID suggests the use of either the <a href="@gmp">GMP Math</a> (recommended for performance) or <a href="@bc">BC Math</a> libraries to enable OpenID associations.', array('@gmp' => 'http://php.net/manual/en/book.gmp.php', '@bc' => 'http://www.php.net/manual/en/book.bc.php')),
+      );
+    }
+    elseif (!function_exists('gmp_add')) {
+      $requirements['openid_math'] = array(
+        'value' => t('Not optimized'),
+        'severity' => REQUIREMENT_WARNING,
+        'description' => t('OpenID suggests the use of the GMP Math library for PHP for optimal performance. Check the <a href="@url">GMP Math Library documentation</a> for installation instructions.', array('@url' => 'http://www.php.net/manual/en/book.gmp.php')),
       );
     }
     else {
-      $requirements['bcmath'] = array(
+      $requirements['openid_math'] = array(
         'value' => t('Installed'),
         'severity' => REQUIREMENT_OK,
       );
     }
-    $requirements['bcmath']['title'] = t('BC Math library');
+    $requirements['openid_math']['title'] = t('OpenID Math library');
   }
 
   return $requirements;
diff --git a/modules/openid/openid.js b/modules/openid/openid.js
index e60f2b77a628bc134f6b784fd8737e92fdd16765..1f204274689294ac9b898926f1b98e5d8e487e17 100644
--- a/modules/openid/openid.js
+++ b/modules/openid/openid.js
@@ -1,4 +1,3 @@
-// $Id: openid.js,v 1.13 2010/03/22 18:55:45 dries Exp $
 (function ($) {
 
 Drupal.behaviors.openid = {
diff --git a/modules/openid/openid.module b/modules/openid/openid.module
index 797ec6ac55da7e8fe692c295d6db71724bc2c1c9..7673de8864aeb8ce1218d1f42e200a1ace492c6a 100644
--- a/modules/openid/openid.module
+++ b/modules/openid/openid.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: openid.module,v 1.98 2010/11/30 17:16:37 dries Exp $
 
 /**
  * @file
@@ -275,9 +274,9 @@ function openid_begin($claimed_id, $return_to = '', $form_values = array()) {
   // user_exteral_login later.
   $_SESSION['openid']['user_login_values'] = $form_values;
 
-  // If bcmath is present, then create an association
+  // If a supported math library is present, then create an association.
   $assoc_handle = '';
-  if (function_exists('bcadd')) {
+  if (_openid_get_math_library()) {
     $assoc_handle = openid_association($service['uri']);
   }
 
@@ -540,8 +539,8 @@ function openid_association($op_endpoint) {
     $mod = OPENID_DH_DEFAULT_MOD;
     $gen = OPENID_DH_DEFAULT_GEN;
     $r = _openid_dh_rand($mod);
-    $private = bcadd($r, 1);
-    $public = bcpowmod($gen, $private, $mod);
+    $private = _openid_math_add($r, 1);
+    $public = _openid_math_powmod($gen, $private, $mod);
 
     // If there is no existing association, then request one
     $assoc_request = openid_association_request($public);
@@ -564,7 +563,7 @@ function openid_association($op_endpoint) {
     if ($assoc_response['session_type'] == 'DH-SHA1') {
       $spub = _openid_dh_base64_to_long($assoc_response['dh_server_public']);
       $enc_mac_key = base64_decode($assoc_response['enc_mac_key']);
-      $shared = bcpowmod($spub, $private, $mod);
+      $shared = _openid_math_powmod($spub, $private, $mod);
       $assoc_response['mac_key'] = base64_encode(_openid_dh_xorsecret($shared, $enc_mac_key));
     }
     db_insert('openid_association')
diff --git a/modules/openid/openid.pages.inc b/modules/openid/openid.pages.inc
index 06738a1e59f8b95db597368d4fdac7f3347c00dc..6e3f096e4699c01c386ff5f9826d48a63a5d407d 100644
--- a/modules/openid/openid.pages.inc
+++ b/modules/openid/openid.pages.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: openid.pages.inc,v 1.28 2010/04/24 14:49:14 dries Exp $
 
 /**
  * @file
diff --git a/modules/openid/openid.test b/modules/openid/openid.test
index b0f88bbbfe8b81bbb791ac7e9ff1d012bf8e6530..202a8355ea2aa1a1459d69d17f98d1bc5af2eb2c 100644
--- a/modules/openid/openid.test
+++ b/modules/openid/openid.test
@@ -1,5 +1,9 @@
 <?php
-// $Id: openid.test,v 1.32 2010/10/08 05:28:30 webchick Exp $
+
+/**
+ * @file
+ * Tests for openid.module.
+ */
 
 /**
  * Base class for OpenID tests.
diff --git a/modules/openid/tests/openid_test.info b/modules/openid/tests/openid_test.info
index 6b33162e9734d726903131912a755a008b3d9584..d9760b96a4a7d6ec5e6bf2710fefe447666dc1ce 100644
--- a/modules/openid/tests/openid_test.info
+++ b/modules/openid/tests/openid_test.info
@@ -1,4 +1,3 @@
-; $Id: openid_test.info,v 1.2 2010/12/20 19:59:42 webchick Exp $
 name = OpenID dummy provider
 description = "OpenID provider used for testing."
 package = Testing
@@ -7,8 +6,8 @@ core = 7.x
 dependencies[] = openid
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/openid/tests/openid_test.install b/modules/openid/tests/openid_test.install
index e68727423091dbf4043fcb42c7c9e1ace3a7c1f5..3bd4978f1a2eeeb0da9331fdeebfb0dc94744abe 100644
--- a/modules/openid/tests/openid_test.install
+++ b/modules/openid/tests/openid_test.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: openid_test.install,v 1.4 2009/12/04 16:49:47 dries Exp $
 
 /**
  * @file
diff --git a/modules/openid/tests/openid_test.module b/modules/openid/tests/openid_test.module
index ce633bee1b8742a3c85941819d352f4eca81e55a..bad1184a311a07c70228fe2d3b99f55f2e01fa12 100644
--- a/modules/openid/tests/openid_test.module
+++ b/modules/openid/tests/openid_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: openid_test.module,v 1.17 2010/07/07 08:05:01 webchick Exp $
 
 /**
  * @file
@@ -106,6 +105,10 @@ function openid_test_yadis_xrds() {
           <Service>
             <Type>http://example.com/this-is-ignored</Type>
           </Service>
+          <Service priority="5">
+            <Type>http://openid.net/signon/1.0</Type>
+            <URI>http://example.com/this-is-only-openid-1.0</URI>
+          </Service>
           <Service priority="10">
             <Type>http://specs.openid.net/auth/2.0/signon</Type>
             <Type>http://openid.net/srv/ax/1.0</Type>
@@ -134,7 +137,7 @@ function openid_test_yadis_xrds() {
     }
     elseif (arg(3) == 'delegate') {
       print '
-          <Service priority="5">
+          <Service priority="0">
             <Type>http://specs.openid.net/auth/2.0/signon</Type>
             <Type>http://openid.net/srv/ax/1.0</Type>
             <URI>' . url('openid-test/endpoint', array('absolute' => TRUE)) . '</URI>
@@ -228,14 +231,14 @@ function _openid_test_endpoint_associate() {
 
   // Generate private Diffie-Helmann key.
   $r = _openid_dh_rand($mod);
-  $private = bcadd($r, 1);
+  $private = _openid_math_add($r, 1);
 
   // Calculate public Diffie-Helmann key.
-  $public = bcpowmod($gen, $private, $mod);
+  $public = _openid_math_powmod($gen, $private, $mod);
 
   // Calculate shared secret based on Relying Party's public key.
   $cpub = _openid_dh_base64_to_long($_REQUEST['openid_dh_consumer_public']);
-  $shared = bcpowmod($cpub, $private, $mod);
+  $shared = _openid_math_powmod($cpub, $private, $mod);
 
   // Encrypt the MAC key using the shared secret.
   $enc_mac_key = base64_encode(_openid_dh_xorsecret($shared, base64_decode(variable_get('mac_key'))));
diff --git a/modules/overlay/overlay-child.css b/modules/overlay/overlay-child.css
index 0ee699c602064114c0cc47fbfeef1adfcad77000..5a297cb4d0bd0b1da0b97f932d12c4fc38ebd93e 100644
--- a/modules/overlay/overlay-child.css
+++ b/modules/overlay/overlay-child.css
@@ -1,4 +1,3 @@
-/* $Id: overlay-child.css,v 1.8 2011/01/03 06:53:35 webchick Exp $ */
 
 html.js {
   background: transparent !important;
diff --git a/modules/overlay/overlay-child.js b/modules/overlay/overlay-child.js
index 468aa29a6b8391b06579c3eec38011a252d62410..e78e3831c9189fde0247c7feefe7c4dfab7df6b2 100644
--- a/modules/overlay/overlay-child.js
+++ b/modules/overlay/overlay-child.js
@@ -1,4 +1,3 @@
-// $Id: overlay-child.js,v 1.11 2010/11/06 00:18:24 dries Exp $
 
 (function ($) {
 
diff --git a/modules/overlay/overlay-parent.css b/modules/overlay/overlay-parent.css
index fc2902dd6899b25bc827915983731a33ae5e5e5d..dad6d5575b564dbcc1a202272722d5429a36e0b1 100644
--- a/modules/overlay/overlay-parent.css
+++ b/modules/overlay/overlay-parent.css
@@ -1,4 +1,3 @@
-/* $Id: overlay-parent.css,v 1.17 2010/11/06 00:18:24 dries Exp $ */
 
 html.overlay-open,
 html.overlay-open body {
diff --git a/modules/overlay/overlay-parent.js b/modules/overlay/overlay-parent.js
index 27a937ff5b69d0c4f0d324f8660229ac1f587224..8f11df6694df0951e9e03232080053cdaaded723 100644
--- a/modules/overlay/overlay-parent.js
+++ b/modules/overlay/overlay-parent.js
@@ -1,4 +1,3 @@
-// $Id: overlay-parent.js,v 1.57 2010/11/06 00:18:24 dries Exp $
 
 (function ($) {
 
@@ -351,8 +350,9 @@ Drupal.overlay.isAdminLink = function (url) {
 
   // Turn the list of administrative paths into a regular expression.
   if (!this.adminPathRegExp) {
-    var adminPaths = '^(' + Drupal.settings.overlay.paths.admin.replace(/\s+/g, ')$|^(') + ')$';
-    var nonAdminPaths = '^(' + Drupal.settings.overlay.paths.non_admin.replace(/\s+/g, ')$|^(') + ')$';
+    var regExpPrefix = '^' + Drupal.settings.pathPrefix + '(';
+    var adminPaths = regExpPrefix + Drupal.settings.overlay.paths.admin.replace(/\s+/g, ')$|' + regExpPrefix) + ')$';
+    var nonAdminPaths = regExpPrefix + Drupal.settings.overlay.paths.non_admin.replace(/\s+/g, ')$|'+ regExpPrefix) + ')$';
     adminPaths = adminPaths.replace(/\*/g, '.*');
     nonAdminPaths = nonAdminPaths.replace(/\*/g, '.*');
     this.adminPathRegExp = new RegExp(adminPaths);
@@ -453,7 +453,7 @@ Drupal.overlay.eventhandlerAlterDisplacedElements = function (event) {
 Drupal.overlay.eventhandlerRestoreDisplacedElements = function (event) {
   var $displacedElements = $('.overlay-displace-top, .overlay-displace-bottom');
   try {
-    $displacedElements.css({ maxWidth: null, clip: null });
+    $displacedElements.css({ maxWidth: '', clip: '' });
   }
   // IE bug that doesn't allow unsetting style.clip (http://dev.jquery.com/ticket/6512).
   catch (err) {
@@ -678,7 +678,7 @@ Drupal.overlay.eventhandlerDispatchEvent = function (event) {
  * Make a regular admin link into a URL that will trigger the overlay to open.
  *
  * @param link
- *   A Javascript Link object (i.e. an <a> element).
+ *   A JavaScript Link object (i.e. an <a> element).
  * @param parentLocation
  *   (optional) URL to override the parent window's location with.
  *
diff --git a/modules/overlay/overlay.api.php b/modules/overlay/overlay.api.php
index c561751d8b23c8e63aabb403d07e4169f3dfa25e..c763d1f5b9bf684a9d9b315453c888f6bb0e713d 100644
--- a/modules/overlay/overlay.api.php
+++ b/modules/overlay/overlay.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: overlay.api.php,v 1.2 2010/07/17 02:12:36 dries Exp $
 
 /**
  * @file
diff --git a/modules/overlay/overlay.info b/modules/overlay/overlay.info
index 8c324fff0a97e925372b48f96d43a0e3166ce40a..c4d05ba2a013e0afe481696ce81586718cbab605 100644
--- a/modules/overlay/overlay.info
+++ b/modules/overlay/overlay.info
@@ -1,12 +1,11 @@
-; $Id: overlay.info,v 1.3 2010/12/20 19:59:42 webchick Exp $
 name = Overlay
 description = Displays the Drupal administration interface in an overlay.
 package = Core
 version = VERSION
 core = 7.x
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/overlay/overlay.install b/modules/overlay/overlay.install
index 77a24b4396cf41cff547b2211b7c2ec77e047fbc..2fa7c84bc658fa15ecf950aa77f1b0e9fb47018b 100644
--- a/modules/overlay/overlay.install
+++ b/modules/overlay/overlay.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: overlay.install,v 1.3 2010/01/18 17:12:04 dries Exp $
 
 /**
  * @file
diff --git a/modules/overlay/overlay.module b/modules/overlay/overlay.module
index 6d62c541c7da81273cde888e41f6fd9329f8961c..84b7554845826451fa908f3ba60855a824ebd270 100644
--- a/modules/overlay/overlay.module
+++ b/modules/overlay/overlay.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: overlay.module,v 1.34 2010/11/30 17:16:37 dries Exp $
 
 /**
  * @file
@@ -626,7 +625,7 @@ function overlay_overlay_parent_initialize() {
     $type = str_replace('<front>', variable_get('site_frontpage', 'node'), $type);
   }
   drupal_add_js(array('overlay' => array('paths' => $paths)), 'setting');
-  // Pass along the AJAX callback for rerendering sections of the parent window.
+  // Pass along the Ajax callback for rerendering sections of the parent window.
   drupal_add_js(array('overlay' => array('ajaxCallback' => 'overlay-ajax')), 'setting');
 }
 
@@ -643,7 +642,7 @@ function overlay_overlay_child_initialize() {
   // the initial rendered content of those regions here, so that we can compare
   // it to the same content rendered in overlay_exit(), at the end of the page
   // request. This allows us to check if anything actually did change, and, if
-  // so, trigger an immediate AJAX refresh of the parent window.
+  // so, trigger an immediate Ajax refresh of the parent window.
   if (!empty($_POST) || isset($_GET['token'])) {
     foreach (overlay_supplemental_regions() as $region) {
       overlay_store_rendered_content($region, overlay_render_region($region));
@@ -945,7 +944,7 @@ function overlay_trigger_refresh() {
 /**
  * Prints the markup obtained by rendering a single region of the page.
  *
- * This function is intended to be called via AJAX.
+ * This function is intended to be called via Ajax.
  *
  * @param $region
  *   The name of the page region to render.
diff --git a/modules/overlay/overlay.tpl.php b/modules/overlay/overlay.tpl.php
index fd48e0a8fbdeef28f8a5c3854aa5798858fe7e13..54b10af1f1c210a22aa3dc5e7ed458e38618cca2 100644
--- a/modules/overlay/overlay.tpl.php
+++ b/modules/overlay/overlay.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: overlay.tpl.php,v 1.5 2010/11/06 00:18:24 dries Exp $
 
 /**
  * @file
diff --git a/modules/path/path.admin.inc b/modules/path/path.admin.inc
index 7e792934a282eeeff250a19f37a751d6232ea827..f10142b56393d5896befa64caab2c3f4c90c2dc5 100644
--- a/modules/path/path.admin.inc
+++ b/modules/path/path.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: path.admin.inc,v 1.45 2010/09/11 03:04:43 dries Exp $
 
 /**
  * @file
diff --git a/modules/path/path.api.php b/modules/path/path.api.php
index d3b00eb42b947fa9de9846fa47f92ab56ecdc53b..d1a007ac8cfa6f9d8ef78b7d17e3f48086e0cfa3 100644
--- a/modules/path/path.api.php
+++ b/modules/path/path.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: path.api.php,v 1.2 2010/12/02 00:22:20 webchick Exp $
 
 /**
  * @file
diff --git a/modules/path/path.info b/modules/path/path.info
index 8c013ca959845214ff1e84cd4abc2c43bdbd3d7f..29903db61fcd65634fa2d5c732ec900c4bfd05e9 100644
--- a/modules/path/path.info
+++ b/modules/path/path.info
@@ -1,4 +1,3 @@
-; $Id: path.info,v 1.10 2010/12/20 19:59:42 webchick Exp $
 name = Path
 description = Allows users to rename URLs.
 package = Core
@@ -7,8 +6,8 @@ core = 7.x
 files[] = path.test
 configure = admin/config/search/path
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/path/path.js b/modules/path/path.js
index 681b5d0a7b8f6033f56727e68f312d93d5b40379..fcc0acc413fad48f25086eeb894c1d6afffc2bc6 100644
--- a/modules/path/path.js
+++ b/modules/path/path.js
@@ -1,4 +1,3 @@
-// $Id: path.js,v 1.5 2010/11/05 19:47:20 dries Exp $
 
 (function ($) {
 
diff --git a/modules/path/path.module b/modules/path/path.module
index d214775327e35e71df5588336578f9f941309879..332287de2c2ed792f345057c523877a869e9031a 100644
--- a/modules/path/path.module
+++ b/modules/path/path.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: path.module,v 1.187 2010/12/01 00:31:38 webchick Exp $
 
 /**
  * @file
@@ -58,7 +57,7 @@ function path_menu() {
     'description' => "Change your site's URL paths by aliasing them.",
     'page callback' => 'path_admin_overview',
     'access arguments' => array('administer url aliases'),
-    'weight' => -10,
+    'weight' => -5,
     'file' => 'path.admin.inc',
   );
   $items['admin/config/search/path/edit/%path'] = array(
diff --git a/modules/path/path.test b/modules/path/path.test
index 9666466b05779e056888a21d9b56a293da2af03a..4112e5f6b1f207a72b6a3c18dfabeba8cfc94611 100644
--- a/modules/path/path.test
+++ b/modules/path/path.test
@@ -1,9 +1,8 @@
 <?php
-// $Id: path.test,v 1.41 2010/10/09 17:38:41 webchick Exp $
 
 /**
  * @file
- * Tests for the path module
+ * Tests for path.module.
  */
 
 class PathTestCase extends DrupalWebTestCase {
diff --git a/modules/php/php.info b/modules/php/php.info
index 1768e192e522d5f6b3b901a79bfb4da38b1c4f99..259e74328d8587ad40b2ae46b8469717b6e2ea80 100644
--- a/modules/php/php.info
+++ b/modules/php/php.info
@@ -1,4 +1,3 @@
-; $Id: php.info,v 1.8 2010/12/20 19:59:42 webchick Exp $
 name = PHP filter
 description = Allows embedded PHP code/snippets to be evaluated.
 package = Core
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = php.test
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/php/php.install b/modules/php/php.install
index b5a4853dcbf728aed1df3b83844a32c49731a496..12944ddd75c4295049e0114e3abf7349f3b12045 100644
--- a/modules/php/php.install
+++ b/modules/php/php.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: php.install,v 1.19 2010/10/20 01:15:58 dries Exp $
 
 /**
  * @file
diff --git a/modules/php/php.module b/modules/php/php.module
index bd72a7294d12ab0ed179aeeefe77f9b2935b95d6..37bf9a1f337f280b8bb34a6d769d795650007038 100644
--- a/modules/php/php.module
+++ b/modules/php/php.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: php.module,v 1.29 2010/12/01 00:31:38 webchick Exp $
 
 /**
  * @file
diff --git a/modules/php/php.test b/modules/php/php.test
index 24886c3f99997c47781115b8aaa3c9ea42686fa9..8ead2ac02ae40346b577e83eba4ffd24f63006f9 100644
--- a/modules/php/php.test
+++ b/modules/php/php.test
@@ -1,5 +1,9 @@
 <?php
-// $Id: php.test,v 1.27 2010/11/29 06:38:51 webchick Exp $
+
+/**
+ * @file
+ * Tests for php.module.
+ */
 
 /**
  * Base PHP test case class.
diff --git a/modules/poll/poll-bar--block.tpl.php b/modules/poll/poll-bar--block.tpl.php
index b67fa6e08bd99ed1f8b102f6c5b82a609446858e..3b91afc3a0523d68410dcde65a22f32d0c27f116 100644
--- a/modules/poll/poll-bar--block.tpl.php
+++ b/modules/poll/poll-bar--block.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: poll-bar--block.tpl.php,v 1.1 2010/01/13 06:07:27 webchick Exp $
 
 /**
  * @file
diff --git a/modules/poll/poll-bar.tpl.php b/modules/poll/poll-bar.tpl.php
index 0345b952d0c8af2c1ce2817008f53fb27ab1b105..9426ff59f2a6c34ce32f3aa9c921dcdad1b7f897 100644
--- a/modules/poll/poll-bar.tpl.php
+++ b/modules/poll/poll-bar.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: poll-bar.tpl.php,v 1.3 2008/10/13 12:31:42 dries Exp $
 
 /**
  * @file
diff --git a/modules/poll/poll-results--block.tpl.php b/modules/poll/poll-results--block.tpl.php
index bf2babd509627181e7a99885d64e9b13019dce02..f8387f5657c8da38b36a67d77cc6a91f296aaa3a 100644
--- a/modules/poll/poll-results--block.tpl.php
+++ b/modules/poll/poll-results--block.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: poll-results--block.tpl.php,v 1.1 2010/01/13 06:07:27 webchick Exp $
 /**
  * @file
  * Default theme implementation to display the poll results in a block.
diff --git a/modules/poll/poll-results.tpl.php b/modules/poll/poll-results.tpl.php
index c894f7f00f93cc11ea5bf3af05535f076ef41874..5e14dec21e420dcb793265cbedbeed8c1f1c05f4 100644
--- a/modules/poll/poll-results.tpl.php
+++ b/modules/poll/poll-results.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: poll-results.tpl.php,v 1.3 2008/10/13 12:31:42 dries Exp $
 
 /**
  * @file
diff --git a/modules/poll/poll-rtl.css b/modules/poll/poll-rtl.css
index 3e7875508599bc44744c4b758285dcb9ef302eb4..14d42e691a76b042041fc34176f2fa5016cc2bf8 100644
--- a/modules/poll/poll-rtl.css
+++ b/modules/poll/poll-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: poll-rtl.css,v 1.2 2007/05/30 18:28:13 goba Exp $ */
 
 .poll .bar .foreground {
   float: right;
diff --git a/modules/poll/poll-vote.tpl.php b/modules/poll/poll-vote.tpl.php
index 8aacc13b711a9636f215e6652f3bc22a6d51c015..068ff7c05352210aea674e53d60b96e14f82c151 100644
--- a/modules/poll/poll-vote.tpl.php
+++ b/modules/poll/poll-vote.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: poll-vote.tpl.php,v 1.4 2009/06/13 19:38:42 dries Exp $
 
 /**
  * @file
diff --git a/modules/poll/poll.css b/modules/poll/poll.css
index fd99c2159ba15a9722cdd727835ed9ddd66521e9..8b04e380911ebcf33a71adc96b63741bf20cf504 100644
--- a/modules/poll/poll.css
+++ b/modules/poll/poll.css
@@ -1,4 +1,3 @@
-/* $Id: poll.css,v 1.8 2010/04/06 15:25:51 dries Exp $ */
 
 .poll {
   overflow: hidden;
diff --git a/modules/poll/poll.info b/modules/poll/poll.info
index 6c4be672b5a370c4d29b156a4cceece3d3ca9c76..16744e8c0def4ad8b670e99c36c3e573267daef7 100644
--- a/modules/poll/poll.info
+++ b/modules/poll/poll.info
@@ -1,4 +1,3 @@
-; $Id: poll.info,v 1.12 2010/12/20 19:59:42 webchick Exp $
 name = Poll
 description = Allows your site to capture votes on different topics in the form of multiple choice questions.
 package = Core
@@ -7,8 +6,8 @@ core = 7.x
 files[] = poll.test
 stylesheets[all][] = poll.css
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/poll/poll.install b/modules/poll/poll.install
index 4d9a814c26e7ba6b23af75ec9466c4ef7779db40..8c73cf43a4c5e1cac67fd936497d16796ad93113 100644
--- a/modules/poll/poll.install
+++ b/modules/poll/poll.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: poll.install,v 1.33 2010/08/22 13:55:53 dries Exp $
 
 /**
  * @file
@@ -197,3 +196,11 @@ function poll_update_7003() {
     'description' => 'The sort order of this choice among all choices for the same node.',
   ));
 }
+
+/**
+ * Update the database to match the schema.
+ */
+function poll_update_7004() {
+  // Remove field default.
+  db_change_field('poll_vote', 'chid', 'chid', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE));
+}
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index 1a8ebe9d0f500b0afc7927d1099f79ef5a365b3a..f45b8bda7863ca9f5c27b3eb906d1b4431c780d7 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: poll.module,v 1.361 2010/11/20 09:25:30 webchick Exp $
 
 /**
  * @file
@@ -242,7 +241,7 @@ function poll_form($node, &$form_state) {
   $type = node_type_get_type($node);
 
   // The submit handlers to add more poll choices require that this form is
-  // cached, regardless of whether AJAX is used.
+  // cached, regardless of whether Ajax is used.
   $form_state['cache'] = TRUE;
 
   $form['title'] = array(
@@ -296,7 +295,7 @@ function poll_form($node, &$form_state) {
   }
 
   // We name our button 'poll_more' to avoid conflicts with other modules using
-  // AJAX-enabled buttons with the id 'more'.
+  // Ajax-enabled buttons with the id 'more'.
   $form['choice_wrapper']['poll_more'] = array(
     '#type' => 'submit',
     '#value' => t('More choices'),
@@ -362,7 +361,7 @@ function poll_form($node, &$form_state) {
  * return just the changed part of the form.
  */
 function poll_more_choices_submit($form, &$form_state) {
-  // If this is a AJAX POST, add 1, otherwise add 5 more choices to the form.
+  // If this is a Ajax POST, add 1, otherwise add 5 more choices to the form.
   if ($form_state['values']['poll_more']) {
     $n = $_GET['q'] == 'system/ajax' ? 1 : 5;
     $form_state['choice_count'] = count($form_state['values']['choice']) + $n;
diff --git a/modules/poll/poll.pages.inc b/modules/poll/poll.pages.inc
index 3b6dcf6e751ddc2819868e9cb808208117c6efbf..15f3ba790554f00fdf62bc02c465cb020621d0ea 100644
--- a/modules/poll/poll.pages.inc
+++ b/modules/poll/poll.pages.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: poll.pages.inc,v 1.28 2010/10/06 13:38:40 dries Exp $
 
 /**
  * @file
diff --git a/modules/poll/poll.test b/modules/poll/poll.test
index a08090db18725327996d099ad07ca4aff028d8b2..6fabf956723f3345a7a2347d183c25e4b606f5b9 100644
--- a/modules/poll/poll.test
+++ b/modules/poll/poll.test
@@ -1,9 +1,8 @@
 <?php
-// $Id: poll.test,v 1.39 2010/10/25 15:51:21 webchick Exp $
 
 /**
  * @file
- * Tests for the poll module.
+ * Tests for poll.module.
  */
 
 class PollTestCase extends DrupalWebTestCase {
@@ -426,7 +425,7 @@ class PollJSAddChoice extends DrupalWebTestCase {
       'choice[new:1][chtext]' => $this->randomName(),
     );
 
-    // Press 'add choice' button through AJAX, and place the expected HTML result
+    // Press 'add choice' button through Ajax, and place the expected HTML result
     // as the tested content.
     $commands = $this->drupalPostAJAX(NULL, $edit, array('op' => t('More choices')));
     $this->content = $commands[1]['data'];
@@ -653,7 +652,7 @@ class PollTokenReplaceTestCase extends PollTestCase {
 
     foreach ($tests as $input => $expected) {
       $output = token_replace($input, array('node' => $poll), array('language' => $language));
-      $this->assertFalse(strcmp($output, $expected), t('Sanitized poll token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, t('Sanitized poll token %token replaced.', array('%token' => $input)));
     }
 
     // Generate and test unsanitized tokens.
@@ -661,7 +660,7 @@ class PollTokenReplaceTestCase extends PollTestCase {
 
     foreach ($tests as $input => $expected) {
       $output = token_replace($input, array('node' => $poll), array('language' => $language, 'sanitize' => FALSE));
-      $this->assertFalse(strcmp($output, $expected), t('Unsanitized poll token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, t('Unsanitized poll token %token replaced.', array('%token' => $input)));
     }
   }
 }
diff --git a/modules/poll/poll.tokens.inc b/modules/poll/poll.tokens.inc
index 26176e100456da0b496d6a815fd1591aff7d0aa1..eda628bacffeb70acb9bcedf062b6f8c019fdafa 100644
--- a/modules/poll/poll.tokens.inc
+++ b/modules/poll/poll.tokens.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: poll.tokens.inc,v 1.6 2010/12/01 00:31:38 webchick Exp $
 
 /**
  * @file
diff --git a/modules/profile/profile-block.tpl.php b/modules/profile/profile-block.tpl.php
index d40356afcb6c5aff9b1e17658ba53e04c7ebd24e..0bd8331486d7882a824c2824b0193b76885acbcd 100644
--- a/modules/profile/profile-block.tpl.php
+++ b/modules/profile/profile-block.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: profile-block.tpl.php,v 1.4 2009/08/06 05:05:59 webchick Exp $
 
 /**
  * @file
diff --git a/modules/profile/profile-listing.tpl.php b/modules/profile/profile-listing.tpl.php
index 7bced7daade901bf1986f2bcfa0ed9be291c36da..d484ed26bec4a719ec059a6f2c479787abe774d7 100644
--- a/modules/profile/profile-listing.tpl.php
+++ b/modules/profile/profile-listing.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: profile-listing.tpl.php,v 1.7 2009/08/06 05:05:59 webchick Exp $
 
 /**
  * @file
diff --git a/modules/profile/profile-wrapper.tpl.php b/modules/profile/profile-wrapper.tpl.php
index 4b9d3ddf2d86e007b51666215a6f6ac67fdef5ad..997ab9860179e7e5dea1dd715928eef4955e24d7 100644
--- a/modules/profile/profile-wrapper.tpl.php
+++ b/modules/profile/profile-wrapper.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: profile-wrapper.tpl.php,v 1.3 2008/10/13 12:31:42 dries Exp $
 
 /**
  * @file
diff --git a/modules/profile/profile.admin.inc b/modules/profile/profile.admin.inc
index b8e029a58df356aeaa2844302c9ac59c017aba1c..d6ac3c310fa06e081067a86c16ff5ba8f7e6f49d 100644
--- a/modules/profile/profile.admin.inc
+++ b/modules/profile/profile.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: profile.admin.inc,v 1.44 2010/10/28 02:27:09 dries Exp $
 
 /**
  * @file
diff --git a/modules/profile/profile.css b/modules/profile/profile.css
index 4b02e7e4b92d37d59e5e7dd51c35c41ead80a8c4..c3132f995e1236b6f884c36add7357a972d1817a 100644
--- a/modules/profile/profile.css
+++ b/modules/profile/profile.css
@@ -1,4 +1,3 @@
-/* $Id: profile.css,v 1.3 2007/11/30 09:02:51 goba Exp $ */
 
 #profile-fields td.category {
   font-weight: bold;
diff --git a/modules/profile/profile.info b/modules/profile/profile.info
index ec50d073782677fe666f75360096c92f56ca4d58..6f89a05c8c047dbe134c058334d7ab511b6b14be 100644
--- a/modules/profile/profile.info
+++ b/modules/profile/profile.info
@@ -1,4 +1,3 @@
-; $Id: profile.info,v 1.12 2010/12/20 19:59:42 webchick Exp $
 name = Profile
 description = Supports configurable user profiles.
 package = Core
@@ -12,8 +11,8 @@ configure = admin/config/people/profile
 ; See user_system_info_alter().
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/profile/profile.install b/modules/profile/profile.install
index dccbb322d129e5c93f87cda0e9df4d4fc78b3aaa..5e4a17c26aa39fada3962844a1d647c615282fe7 100644
--- a/modules/profile/profile.install
+++ b/modules/profile/profile.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: profile.install,v 1.26 2010/08/22 13:55:53 dries Exp $
 
 /**
  * @file
diff --git a/modules/profile/profile.js b/modules/profile/profile.js
index 7ae052555680f26a65380012a5f24bce1599376f..f842aa08a2a26ab13dcb33a1519c6fdd8d899fbf 100644
--- a/modules/profile/profile.js
+++ b/modules/profile/profile.js
@@ -1,4 +1,3 @@
-// $Id: profile.js,v 1.8 2010/01/30 07:59:25 dries Exp $
 (function ($) {
 
 /**
diff --git a/modules/profile/profile.module b/modules/profile/profile.module
index d4855d2c5b6f93db3ab714fb7568ca064d0bdc98..2374fe8ea0712448523774b9e5baca3c0446c7b7 100644
--- a/modules/profile/profile.module
+++ b/modules/profile/profile.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: profile.module,v 1.294 2010/10/01 15:24:18 webchick Exp $
 
 /**
  * @file
diff --git a/modules/profile/profile.pages.inc b/modules/profile/profile.pages.inc
index 993152a1b23872844484b0042d147ca2f5420b02..06f9632384d5f49f1667bccc14623b1d0391a733 100644
--- a/modules/profile/profile.pages.inc
+++ b/modules/profile/profile.pages.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: profile.pages.inc,v 1.28 2010/11/12 02:57:15 dries Exp $
 
 /**
  * @file
diff --git a/modules/profile/profile.test b/modules/profile/profile.test
index 9542623715deecdf2e63e48bb68136bfd28ef8db..83bed25a5840cd8bc1144751f128ee0b970c5652 100644
--- a/modules/profile/profile.test
+++ b/modules/profile/profile.test
@@ -1,5 +1,9 @@
 <?php
-// $Id: profile.test,v 1.30 2010/08/30 00:22:03 webchick Exp $
+
+/**
+ * @file
+ * Tests for profile.module.
+ */
 
 /**
  * A class for common methods for testing profile fields.
diff --git a/modules/rdf/rdf.api.php b/modules/rdf/rdf.api.php
index aed1f4669afb1d0a4694395af279ccdd4e408089..691f7efa8dae7abeb269f4847e1e62d1b853c9a8 100644
--- a/modules/rdf/rdf.api.php
+++ b/modules/rdf/rdf.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: rdf.api.php,v 1.6 2010/10/01 01:44:39 webchick Exp $
 
 /**
  * @file
diff --git a/modules/rdf/rdf.info b/modules/rdf/rdf.info
index 687129d7d58a59cea640e00df4bc8348333d9951..0617577dfab55d38443f8db563cf1dcd077538c3 100644
--- a/modules/rdf/rdf.info
+++ b/modules/rdf/rdf.info
@@ -1,4 +1,3 @@
-; $Id: rdf.info,v 1.4 2010/12/20 19:59:42 webchick Exp $
 name = RDF
 description = Enriches your content with metadata to let other applications (e.g. search engines, aggregators) better understand its relationships and attributes.
 package = Core
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = rdf.test
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/rdf/rdf.install b/modules/rdf/rdf.install
index 04a9c86aa61ae41c8c77fddd2585dbf5edf51e86..10d3f8d94c8a3a5568660bdd8dfe222e70046eb8 100644
--- a/modules/rdf/rdf.install
+++ b/modules/rdf/rdf.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: rdf.install,v 1.5 2010/10/01 01:44:39 webchick Exp $
 
 /**
  * @file
diff --git a/modules/rdf/rdf.module b/modules/rdf/rdf.module
index 26abe6295fc023fd01030a9213577028637358d3..ebecd4237f62064928f59a9cd2c273101074b585 100644
--- a/modules/rdf/rdf.module
+++ b/modules/rdf/rdf.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: rdf.module,v 1.49 2010/12/11 02:38:24 dries Exp $
 
 /**
  * @file
diff --git a/modules/rdf/rdf.test b/modules/rdf/rdf.test
index 8a4a0f6b92b599c4bb5dbd60efc2db914db8cb5f..9f786ab5b50a3cf1b3f297899c79aa50f2d53762 100644
--- a/modules/rdf/rdf.test
+++ b/modules/rdf/rdf.test
@@ -1,9 +1,8 @@
 <?php
-// $Id: rdf.test,v 1.30 2010/12/14 01:04:27 dries Exp $
 
 /**
  * @file
- * Tests for RDF functionality.
+ * Tests for rdf.module.
  */
 
 class RdfMappingHookTestCase extends DrupalWebTestCase {
diff --git a/modules/rdf/tests/rdf_test.info b/modules/rdf/tests/rdf_test.info
index 3d6ef437738140c9c7270483ee76672cabc4ba38..1ace4167ca6a0603819c8f7201cc447fb365ca98 100644
--- a/modules/rdf/tests/rdf_test.info
+++ b/modules/rdf/tests/rdf_test.info
@@ -1,4 +1,3 @@
-; $Id: rdf_test.info,v 1.2 2010/12/20 19:59:42 webchick Exp $
 name = "RDF module tests"
 description = "Support module for RDF module testing."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/rdf/tests/rdf_test.install b/modules/rdf/tests/rdf_test.install
index a60ac50c236b2b20baac82f49d3f2c58acfe22c4..91a33927dac067606ec9828ab087f7f123ecab62 100644
--- a/modules/rdf/tests/rdf_test.install
+++ b/modules/rdf/tests/rdf_test.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: rdf_test.install,v 1.3 2009/12/04 16:49:47 dries Exp $
 
 /**
  * @file
diff --git a/modules/rdf/tests/rdf_test.module b/modules/rdf/tests/rdf_test.module
index 8d005c1a3f73aa2de8885b3ce1bdfd57a677d9a7..c133a33eb3b29cce744a23fe3cfb2ffe525a024f 100644
--- a/modules/rdf/tests/rdf_test.module
+++ b/modules/rdf/tests/rdf_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: rdf_test.module,v 1.4 2010/04/22 21:41:09 webchick Exp $
 
 /**
  * @file
diff --git a/modules/search/search-block-form.tpl.php b/modules/search/search-block-form.tpl.php
index 6ad23e9432a1088ec125ba88b771158aaaf72270..78447463c6f9119fcc804e7bf56b5412e551ce0d 100644
--- a/modules/search/search-block-form.tpl.php
+++ b/modules/search/search-block-form.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: search-block-form.tpl.php,v 1.6 2011/01/03 00:17:55 webchick Exp $
 
 /**
  * @file
diff --git a/modules/search/search-result.tpl.php b/modules/search/search-result.tpl.php
index ea85c06f587650e0763aab6f0496f3b5fd9e4492..30b321fb2bd334aa699b3d191c14c4a7285f6ebc 100644
--- a/modules/search/search-result.tpl.php
+++ b/modules/search/search-result.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: search-result.tpl.php,v 1.9 2010/11/21 20:36:36 dries Exp $
 
 /**
  * @file
diff --git a/modules/search/search-results.tpl.php b/modules/search/search-results.tpl.php
index d299952d047133002598434af1172f55f8cc758f..4de724bec1966147ca159dc4f9fb25771c5ec190 100644
--- a/modules/search/search-results.tpl.php
+++ b/modules/search/search-results.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: search-results.tpl.php,v 1.7 2010/08/18 18:40:50 dries Exp $
 
 /**
  * @file
diff --git a/modules/search/search-rtl.css b/modules/search/search-rtl.css
index 24f7bb0bba5a3118c432058c280a8d503c4dec0d..da9e8d9de548e1a8b13033f8bef434bf4b60e705 100644
--- a/modules/search/search-rtl.css
+++ b/modules/search/search-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: search-rtl.css,v 1.5 2010/05/29 07:50:33 dries Exp $ */
 
 .search-advanced .criterion {
   float: right;
diff --git a/modules/search/search.admin.inc b/modules/search/search.admin.inc
index d3c668fb535a22108e1939acc8fda12c7048e8fe..afa02defb4b099764296e0ae4e204fab14f1c28b 100644
--- a/modules/search/search.admin.inc
+++ b/modules/search/search.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: search.admin.inc,v 1.19 2010/10/20 01:31:07 dries Exp $
 
 /**
  * @file
@@ -32,18 +31,12 @@ function search_reindex_confirm_submit(&$form, &$form_state) {
 function _search_get_module_names() {
 
   $search_info = search_get_info(TRUE);
-  $modules = db_select('system', 's')
-    ->fields('s', array('name', 'info'))
-    ->condition('s.status', 1)
-    ->condition('s.type', 'module')
-    ->condition('s.name', array_keys($search_info), 'IN')
-    ->orderBy('s.name')
-    ->execute();
+  $system_info = system_get_info('module');
   $names = array();
-  foreach ($modules as $item) {
-    $info = unserialize($item->info);
-    $names[$item->name] = $info['name'];
+  foreach ($search_info as $module => $info) {
+    $names[$module] = $system_info[$module]['name'];
   }
+  asort($names, SORT_STRING);
   return $names;
 }
 
@@ -115,19 +108,20 @@ function search_admin_settings($form) {
     '#type' => 'fieldset',
     '#title' => t('Active search modules ')
   );
+  $module_options = _search_get_module_names();
   $form['active']['search_active_modules'] = array(
     '#type' => 'checkboxes',
     '#title' => t('Active modules'),
     '#title_display' => 'invisible',
     '#default_value' => variable_get('search_active_modules', array('node', 'user')),
-    '#options' => _search_get_module_names(),
+    '#options' => $module_options,
     '#description' => t('Choose which search modules are active from the available modules.')
   );
   $form['active']['search_default_module'] = array(
     '#title' => t('Default search module'),
     '#type' => 'radios',
     '#default_value' => variable_get('search_default_module', 'node'),
-    '#options' => _search_get_module_names(),
+    '#options' => $module_options,
     '#description' => t('Choose which search module is the default.')
   );
   $form['#validate'][] = 'search_admin_settings_validate';
diff --git a/modules/search/search.api.php b/modules/search/search.api.php
index 867756472d44d8fb01fd66757327a22d0bcf23f8..557a56e51a5c457e6b8332eeee83e7b14c2f17e9 100644
--- a/modules/search/search.api.php
+++ b/modules/search/search.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: search.api.php,v 1.33 2010/11/21 20:36:36 dries Exp $
 
 /**
  * @file
diff --git a/modules/search/search.css b/modules/search/search.css
index 223c31a89dbcbc1d262a3e96ffb4740e183c1927..ff7230fbc40f7c3ecabd9afd03e60e443c548f90 100644
--- a/modules/search/search.css
+++ b/modules/search/search.css
@@ -1,4 +1,3 @@
-/* $Id: search.css,v 1.5 2010/05/29 07:50:33 dries Exp $ */
 
 .search-form {
   margin-bottom: 1em;
diff --git a/modules/search/search.extender.inc b/modules/search/search.extender.inc
index 7a684a39038bd89e8e61e833a81152b8ea0f37be..b7af4d06ace48c3f31b7febbc790b27a26b73e6c 100644
--- a/modules/search/search.extender.inc
+++ b/modules/search/search.extender.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: search.extender.inc,v 1.10 2010/11/22 07:32:12 webchick Exp $
 
 /**
  * @file
diff --git a/modules/search/search.info b/modules/search/search.info
index 32b6d2ddf5e3cdecd24c29973f06bc199310fc5d..81947389a4b58922d6982313ac6444d92cd9f0b7 100644
--- a/modules/search/search.info
+++ b/modules/search/search.info
@@ -1,4 +1,3 @@
-; $Id: search.info,v 1.13 2010/12/20 19:59:43 webchick Exp $
 name = Search
 description = Enables site-wide keyword searching.
 package = Core
@@ -9,8 +8,8 @@ files[] = search.test
 configure = admin/config/search/settings
 stylesheets[all][] = search.css
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/search/search.install b/modules/search/search.install
index 62cc7d394e1df525c0f93ab29a806f3356287822..f0113b3f0c6957968705bec9cb81f4f9c0683789 100644
--- a/modules/search/search.install
+++ b/modules/search/search.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: search.install,v 1.29 2010/08/22 13:55:53 dries Exp $
 
 /**
  * @file
diff --git a/modules/search/search.module b/modules/search/search.module
index 7cc149e874a5ea10cec6273e704a98909dd82e3a..518272a022f382b2ab37c5748f6712feb7873e7b 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: search.module,v 1.371 2011/01/04 05:31:09 webchick Exp $
 
 /**
  * @file
@@ -1005,7 +1004,6 @@ function search_form($form, &$form_state, $action = '', $keys = '', $module = NU
  *
  * @ingroup forms
  * @see search_box_form_submit()
- * @see search-theme-form.tpl.php
  * @see search-block-form.tpl.php
  */
 function search_box($form, &$form_state, $form_id) {
diff --git a/modules/search/search.pages.inc b/modules/search/search.pages.inc
index 4cdec26acfbd7f0b22eba18abb3295d8d1ffc5de..833ea8bccd5373f1f35400108c328d15f36bc463 100644
--- a/modules/search/search.pages.inc
+++ b/modules/search/search.pages.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: search.pages.inc,v 1.25 2010/11/21 20:36:36 dries Exp $
 
 /**
  * @file
diff --git a/modules/search/search.test b/modules/search/search.test
index c21d5071ee9264fa8f19ca95ba0b1e42f87ed286..4d371331195765bdaeee7a64119a365805ccd33f 100644
--- a/modules/search/search.test
+++ b/modules/search/search.test
@@ -1,5 +1,9 @@
 <?php
-// $Id: search.test,v 1.86 2011/01/04 05:31:09 webchick Exp $
+
+/**
+ * @file
+ * Tests for search.module.
+ */
 
 // The search index can contain different types of content. Typically the type is 'node'.
 // Here we test with _test_ and _test2_ as the type.
diff --git a/modules/search/tests/search_embedded_form.info b/modules/search/tests/search_embedded_form.info
index 1fd889dade364585b273b4ca2d9d0d4c77970dee..be2af5b7ab8276643b702c7d6c320ae6243a84e5 100644
--- a/modules/search/tests/search_embedded_form.info
+++ b/modules/search/tests/search_embedded_form.info
@@ -1,4 +1,3 @@
-; $Id: search_embedded_form.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = "Search embedded form"
 description = "Support module for search module testing of embedded forms."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/search/tests/search_embedded_form.module b/modules/search/tests/search_embedded_form.module
index 2251a9b3fcb890dd14dc4c8bb31e619077e8f5a1..c0058f74d06aa08ddfbed867673635cef13c8ab8 100644
--- a/modules/search/tests/search_embedded_form.module
+++ b/modules/search/tests/search_embedded_form.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: search_embedded_form.module,v 1.1 2010/08/11 14:21:39 dries Exp $
 
 /**
  * @file
diff --git a/modules/search/tests/search_extra_type.info b/modules/search/tests/search_extra_type.info
index 64120eb0a7f96949bd38b7d00ffcd625556a4b19..6ca086e062a857d10b8c564636ae00d4f172c055 100644
--- a/modules/search/tests/search_extra_type.info
+++ b/modules/search/tests/search_extra_type.info
@@ -1,4 +1,3 @@
-; $Id: search_extra_type.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = "Test search type"
 description = "Support module for search module testing."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/search/tests/search_extra_type.module b/modules/search/tests/search_extra_type.module
index 8892a84bea8aa793fd077346708af09f3ea30707..80c050c21f795b063a133a26506ec512920483b3 100644
--- a/modules/search/tests/search_extra_type.module
+++ b/modules/search/tests/search_extra_type.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: search_extra_type.module,v 1.3 2010/08/18 18:40:50 dries Exp $
 
 /**
  * @file
diff --git a/modules/shortcut/shortcut-rtl.css b/modules/shortcut/shortcut-rtl.css
new file mode 100644
index 0000000000000000000000000000000000000000..4a3792797717a0c982422e85768b5e012be9231f
--- /dev/null
+++ b/modules/shortcut/shortcut-rtl.css
@@ -0,0 +1,47 @@
+
+div#toolbar a#edit-shortcuts {
+  position: absolute;
+  left: 0;
+  top: 0;
+  padding: 5px 5px 5px 10px;
+}
+div#toolbar div.toolbar-shortcuts ul {
+  float: none;
+  margin-right: 5px;
+  margin-left: 10em;
+}
+div#toolbar div.toolbar-shortcuts ul li a {
+  margin-left: 5px;
+  margin-right: 0;
+  padding: 0 5px;
+}
+div#toolbar div.toolbar-shortcuts span.icon {
+  float: right;
+}
+div.add-or-remove-shortcuts a span.icon {
+  float: right;
+  margin-right: 8px;
+  margin-left: 0;
+}
+div.add-or-remove-shortcuts a span.text {
+  float: right;
+  padding-right: 10px;
+  padding-left: 0;
+}
+div.add-or-remove-shortcuts a:hover span.text {
+  -moz-border-radius: 5px 0 0 5px;
+  -webkit-border-top-left-radius: 5px;
+  -webkit-border-bottom-left-radius: 5px;
+  border-radius: 5px 0 0 5px;
+  padding-left: 6px;
+}
+#shortcut-set-switch .form-item-new {
+  padding-right: 17px;
+  padding-left: 0;
+}
+div.add-shortcut a:hover span.icon {
+  background-position: 0 -24px;
+}
+div.remove-shortcut a:hover span.icon {
+  background-position: -12px -24px;
+}
diff --git a/modules/shortcut/shortcut.admin.css b/modules/shortcut/shortcut.admin.css
index bb7ba896b9a491af1266e308c419e0f82e569a17..8ca03be87358adce63912325e9ed84d8bc1dcdac 100644
--- a/modules/shortcut/shortcut.admin.css
+++ b/modules/shortcut/shortcut.admin.css
@@ -1,4 +1,3 @@
-/* $Id: shortcut.admin.css,v 1.2 2010/02/25 15:58:54 dries Exp $ */
 
 .shortcut-slot-hidden {
   display: none;
diff --git a/modules/shortcut/shortcut.admin.inc b/modules/shortcut/shortcut.admin.inc
index 4c68a333cb75486bb3f3151c137105a8f6252043..9735d376079a7e760793e36872a00db114fc1b30 100644
--- a/modules/shortcut/shortcut.admin.inc
+++ b/modules/shortcut/shortcut.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: shortcut.admin.inc,v 1.16 2010/10/20 01:31:07 dries Exp $
 
 /**
  * @file
diff --git a/modules/shortcut/shortcut.admin.js b/modules/shortcut/shortcut.admin.js
index 3a384ad513a1d3c82742c82fb2e46d1b1124d70b..5e71e6fb654638fe0422483cf6fdc23f469ca24c 100644
--- a/modules/shortcut/shortcut.admin.js
+++ b/modules/shortcut/shortcut.admin.js
@@ -1,4 +1,3 @@
-// $Id: shortcut.admin.js,v 1.1 2009/10/17 00:51:52 dries Exp $
 (function ($) {
 
 /**
diff --git a/modules/shortcut/shortcut.api.php b/modules/shortcut/shortcut.api.php
index 792a10cfef467bb40b07c0991da982d715af3138..717a7c92b08c11af7546115b5c16f0f48ae25919 100644
--- a/modules/shortcut/shortcut.api.php
+++ b/modules/shortcut/shortcut.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: shortcut.api.php,v 1.1 2009/10/17 00:51:52 dries Exp $
 
 /**
  * @file
diff --git a/modules/shortcut/shortcut.css b/modules/shortcut/shortcut.css
index d844056ed13de697a59c1013e00f1ed9c55dd962..3afcb94332ae0459c6b6d5db1dead1f1ff057e8e 100644
--- a/modules/shortcut/shortcut.css
+++ b/modules/shortcut/shortcut.css
@@ -1,4 +1,3 @@
-/* $Id: shortcut.css,v 1.10 2011/01/03 07:04:48 webchick Exp $ */
 div#toolbar a#edit-shortcuts {
   float: right;
   padding: 5px 10px 5px 5px;
@@ -16,13 +15,13 @@ div#toolbar div.toolbar-shortcuts ul {
   padding: 5px 0 2px 0;
   height: 28px;
   line-height: 24px;
-  float: left;
-  margin-left:5px;
+  float: left; /* LTR */
+  margin-left:5px; /* LTR */
 }
 
 div#toolbar div.toolbar-shortcuts ul li a {
   padding: 0 5px 0 5px;
-  margin-right: 5px;
+  margin-right: 5px; /* LTR */
   -moz-border-radius: 5px;
   -webkit-border-radius: 5px;
   border-radius: 5px;
@@ -40,11 +39,11 @@ div#toolbar div.toolbar-shortcuts ul li a.active {
 }
 
 div#toolbar div.toolbar-shortcuts span.icon {
-  float: left;
+  float: left; /* LTR */
   background: #444;
   width: 30px;
   height: 30px;
-  margin-right: 5px;
+  margin-right: 5px; /* LTR */
   -moz-border-radius: 5px;
   -webkit-border-radius: 5px;
   border-radius: 5px;
@@ -88,14 +87,12 @@ div.add-or-remove-shortcuts a:hover span.text {
   color: #fff;
   background-color: #5f605b;
   display: block;
-  padding-right: 6px;
+  padding-right: 6px; /* LTR */
   cursor: pointer;
-  -moz-border-radius-bottomright: 5px;
-  -moz-border-radius-topright: 5px;
-  -webkit-border-bottom-right-radius: 5px;
-  -webkit-border-top-right-radius: 5px;
-  border-bottom-right-radius: 5px;
-  border-top-right-radius: 5px;
+  -moz-border-radius: 0 5px 5px 0; /* LTR */
+  -webkit-border-top-right-radius: 5px; /* LTR */
+  -webkit-border-bottom-right-radius: 5px; /* LTR */
+  border-radius: 0 5px 5px 0; /* LTR */
 }
 
 #shortcut-set-switch .form-type-radios {
@@ -105,5 +102,5 @@ div.add-or-remove-shortcuts a:hover span.text {
 
 #shortcut-set-switch .form-item-new {
   padding-top: 0;
-  padding-left: 17px;
+  padding-left: 17px; /* LTR */
 }
diff --git a/modules/shortcut/shortcut.info b/modules/shortcut/shortcut.info
index 095290da48f534213a198c38a2586223f3281aed..2748c62f02df7883d59cfbe9f5c1d5d7e2b49f4a 100644
--- a/modules/shortcut/shortcut.info
+++ b/modules/shortcut/shortcut.info
@@ -1,4 +1,3 @@
-; $Id: shortcut.info,v 1.5 2010/12/20 19:59:43 webchick Exp $
 name = Shortcut
 description = Allows users to manage customizable lists of shortcut links.
 package = Core
@@ -7,8 +6,8 @@ core = 7.x
 files[] = shortcut.test
 configure = admin/config/user-interface/shortcut
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/shortcut/shortcut.install b/modules/shortcut/shortcut.install
index 127500ce009dca61af40f3ef83f5ac5aa5fb5dc7..209a90754ea9f0ec2e81197f3e806b1b42cf2172 100644
--- a/modules/shortcut/shortcut.install
+++ b/modules/shortcut/shortcut.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: shortcut.install,v 1.6 2010/08/22 13:55:53 dries Exp $
 
 /**
  * @file
diff --git a/modules/shortcut/shortcut.module b/modules/shortcut/shortcut.module
index 8b35fb36bb869475bc8e5e7b1e99a7f13a471a29..d2ac72b32062f7de07c69ace037de1c744eebe56 100644
--- a/modules/shortcut/shortcut.module
+++ b/modules/shortcut/shortcut.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: shortcut.module,v 1.27 2010/09/24 00:37:44 dries Exp $
 
 /**
  * @file
diff --git a/modules/shortcut/shortcut.png b/modules/shortcut/shortcut.png
index 1d9567398e8a9825153bb464db6440b8a7bb1244..2924557bfaab7bee329231c8bd3d821a32b9e031 100644
Binary files a/modules/shortcut/shortcut.png and b/modules/shortcut/shortcut.png differ
diff --git a/modules/shortcut/shortcut.test b/modules/shortcut/shortcut.test
index 458dfd69cd50acb88332646b041d3c6d491b88d2..e37e1e5f8e673aef7912e9d236cdd25392ee3aa1 100644
--- a/modules/shortcut/shortcut.test
+++ b/modules/shortcut/shortcut.test
@@ -1,9 +1,8 @@
 <?php
-// $Id: shortcut.test,v 1.7 2010/11/27 20:25:44 dries Exp $
 
 /**
  * @file
- * Tests for the shortcut module.
+ * Tests for shortcut.module.
  */
 
 /**
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php
index c58aa34defaee164feb744f197c44a5fe09e73c9..b60c6829c1e58a315f2ff540baacf5b6fd0bdd81 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: drupal_web_test_case.php,v 1.257 2011/01/02 23:54:05 webchick Exp $
 
 /**
  * Global variable that holds information about the tests being run.
@@ -1152,7 +1151,7 @@ class DrupalWebTestCase extends DrupalTestCase {
    * If a user is already logged in, then the current user is logged out before
    * logging in the specified user.
    *
-   * Please note that neither the global $user nor the passed in user object is
+   * Please note that neither the global $user nor the passed-in user object is
    * populated with data of the logged in user. If you need full access to the
    * user object after logging in, it must be updated manually. If you also need
    * access to the plain-text password of the user (set by drupalCreateUser()),
@@ -1769,17 +1768,17 @@ class DrupalWebTestCase extends DrupalTestCase {
    *   button with the value t('Delete'), and execute different code depending
    *   on which one is clicked.
    *
-   *   This function can also be called to emulate an AJAX submission. In this
+   *   This function can also be called to emulate an Ajax submission. In this
    *   case, this value needs to be an array with the following keys:
-   *   - path: A path to submit the form values to for AJAX-specific processing,
+   *   - path: A path to submit the form values to for Ajax-specific processing,
    *     which is likely different than the $path parameter used for retrieving
    *     the initial form. Defaults to 'system/ajax'.
    *   - triggering_element: If the value for the 'path' key is 'system/ajax' or
-   *     another generic AJAX processing path, this needs to be set to the name
+   *     another generic Ajax processing path, this needs to be set to the name
    *     of the element. If the name doesn't identify the element uniquely, then
    *     this should instead be an array with a single key/value pair,
    *     corresponding to the element name and value. The callback for the
-   *     generic AJAX processing path uses this to find the #ajax information
+   *     generic Ajax processing path uses this to find the #ajax information
    *     for the element, including which specific callback to use for
    *     processing the request.
    *
@@ -1829,7 +1828,7 @@ class DrupalWebTestCase extends DrupalTestCase {
         $action = isset($form['action']) ? $this->getAbsoluteUrl((string) $form['action']) : $this->getUrl();
         if ($ajax) {
           $action = $this->getAbsoluteUrl(!empty($submit['path']) ? $submit['path'] : 'system/ajax');
-          // AJAX callbacks verify the triggering element if necessary, so while
+          // Ajax callbacks verify the triggering element if necessary, so while
           // we may eventually want extra code that verifies it in the
           // handleForm() function, it's not currently a requirement.
           $submit_matches = TRUE;
@@ -1886,12 +1885,45 @@ class DrupalWebTestCase extends DrupalTestCase {
   }
 
   /**
-   * Execute an AJAX submission.
+   * Execute an Ajax submission.
    *
    * This executes a POST as ajax.js does. It uses the returned JSON data, an
    * array of commands, to update $this->content using equivalent DOM
    * manipulation as is used by ajax.js. It also returns the array of commands.
    *
+   * @param $path
+   *   Location of the form containing the Ajax enabled element to test. Can be
+   *   either a Drupal path or an absolute path or NULL to use the current page.
+   * @param $edit
+   *   Field data in an associative array. Changes the current input fields
+   *   (where possible) to the values indicated.
+   * @param $triggering_element
+   *   The name of the form element that is responsible for triggering the Ajax
+   *   functionality to test. May be a string or, if the triggering element is
+   *   a button, an associative array where the key is the name of the button
+   *   and the value is the button label. i.e.) array('op' => t('Refresh')).
+   * @param $ajax_path
+   *   (optional) Override the path set by the Ajax settings of the triggering
+   *   element. In the absence of both the triggering element's Ajax path and
+   *   $ajax_path 'system/ajax' will be used.
+   * @param $options
+   *   (optional) Options to be forwarded to url().
+   * @param $headers
+   *   (optional) An array containing additional HTTP request headers, each
+   *   formatted as "name: value". Forwarded to drupalPost().
+   * @param $form_html_id
+   *   (optional) HTML ID of the form to be submitted, use when there is more
+   *   than one identical form on the same page and the value of the triggering
+   *   element is not enough to identify the form. Note this is not the Drupal
+   *   ID of the form but rather the HTML ID of the form.
+   * @param $ajax_settings
+   *   (optional) An array of Ajax settings which if specified will be used in
+   *   place of the Ajax settings of the triggering element.
+   *
+   * @return
+   *   An array of Ajax commands.
+   *
+   * @see drupalPost()
    * @see ajax.js
    */
   protected function drupalPostAJAX($path, $edit, $triggering_element, $ajax_path = NULL, array $options = array(), array $headers = array(), $form_html_id = NULL, $ajax_settings = NULL) {
@@ -1903,7 +1935,7 @@ class DrupalWebTestCase extends DrupalTestCase {
     $content = $this->content;
     $drupal_settings = $this->drupalSettings;
 
-    // Get the AJAX settings bound to the triggering element.
+    // Get the Ajax settings bound to the triggering element.
     if (!isset($ajax_settings)) {
       if (is_array($triggering_element)) {
         $xpath = '//*[@name="' . key($triggering_element) . '" and @value="' . current($triggering_element) . '"]';
@@ -1932,7 +1964,7 @@ class DrupalWebTestCase extends DrupalTestCase {
     }
 
     // Unless a particular path is specified, use the one specified by the
-    // AJAX settings, or else 'system/ajax'.
+    // Ajax settings, or else 'system/ajax'.
     if (!isset($ajax_path)) {
       $ajax_path = isset($ajax_settings['url']) ? $ajax_settings['url'] : 'system/ajax';
     }
diff --git a/modules/simpletest/files/README.txt b/modules/simpletest/files/README.txt
index ddfce559c22450221d6ee8f62a5a741e3507d5f3..c8f39ad3377fe1f49f3f061ec8672511b85a5298 100644
--- a/modules/simpletest/files/README.txt
+++ b/modules/simpletest/files/README.txt
@@ -1,4 +1,3 @@
-$Id: README.txt,v 1.2 2010/04/28 20:25:21 dries Exp $
 
 These files are use in some tests that upload files or other operations were
 a file is useful. These files are copied to the files directory as specified
diff --git a/modules/simpletest/files/css_test_files/css_input_without_import.css b/modules/simpletest/files/css_test_files/css_input_without_import.css
index 5d455d1c61eb28af6e3b9597273b42ae18297f4f..620360abc5d41cb5ba81cf02296c2d5212d62019 100644
--- a/modules/simpletest/files/css_test_files/css_input_without_import.css
+++ b/modules/simpletest/files/css_test_files/css_input_without_import.css
@@ -1,4 +1,3 @@
-/* $Id: css_input_without_import.css,v 1.3 2010/10/08 15:36:12 dries Exp $ */
 
 /**
  * @file Basic css that does not use import
diff --git a/modules/simpletest/files/css_test_files/css_input_without_import.css.unoptimized.css b/modules/simpletest/files/css_test_files/css_input_without_import.css.unoptimized.css
index 3366edd40797873fafd29c08db8a733894e2a824..620360abc5d41cb5ba81cf02296c2d5212d62019 100644
--- a/modules/simpletest/files/css_test_files/css_input_without_import.css.unoptimized.css
+++ b/modules/simpletest/files/css_test_files/css_input_without_import.css.unoptimized.css
@@ -1,4 +1,3 @@
-/* $Id: css_input_without_import.css.unoptimized.css,v 1.3 2010/10/08 15:36:12 dries Exp $ */
 
 /**
  * @file Basic css that does not use import
diff --git a/modules/simpletest/simpletest.api.php b/modules/simpletest/simpletest.api.php
index 70ee9469fafbac8a99dd2c7576d137c5aa9d4504..04c080bfd544ba107180042d4f88378579d153ae 100644
--- a/modules/simpletest/simpletest.api.php
+++ b/modules/simpletest/simpletest.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: simpletest.api.php,v 1.4 2009/12/20 21:12:54 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/simpletest.css b/modules/simpletest/simpletest.css
index 588fff6c6f4711580be661692874c521af790b25..0cf9aaa5edd07829490c487df9146f655779eeb8 100644
--- a/modules/simpletest/simpletest.css
+++ b/modules/simpletest/simpletest.css
@@ -1,4 +1,3 @@
-/* $Id: simpletest.css,v 1.10 2010/10/09 18:09:48 webchick Exp $ */
 
 /* Test Table */
 #simpletest-form-table th.select-all {
diff --git a/modules/simpletest/simpletest.info b/modules/simpletest/simpletest.info
index adc405c35ee430bd378dd9b8cdcb429c96d11d90..33088eaa2500eae887feed9d94fafea20868653c 100644
--- a/modules/simpletest/simpletest.info
+++ b/modules/simpletest/simpletest.info
@@ -1,4 +1,3 @@
-; $Id: simpletest.info,v 1.28 2010/12/20 19:59:43 webchick Exp $
 name = Testing
 description = Provides a framework for unit and functional testing.
 package = Core
@@ -33,6 +32,7 @@ files[] = tests/path.test
 files[] = tests/registry.test
 files[] = tests/schema.test
 files[] = tests/session.test
+files[] = tests/tablesort.test
 files[] = tests/theme.test
 files[] = tests/unicode.test
 files[] = tests/update.test
@@ -40,13 +40,14 @@ files[] = tests/xmlrpc.test
 files[] = tests/upgrade/upgrade.test
 files[] = tests/upgrade/upgrade.comment.test
 files[] = tests/upgrade/upgrade.filter.test
+files[] = tests/upgrade/upgrade.forum.test
 files[] = tests/upgrade/upgrade.node.test
 files[] = tests/upgrade/upgrade.taxonomy.test
 files[] = tests/upgrade/upgrade.upload.test
 files[] = tests/upgrade/upgrade.locale.test
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/simpletest.install b/modules/simpletest/simpletest.install
index e45ae9ca9fd80f29ae7e430d710504b5e3b7b337..0f017e75f0640f08fd216161502bbf6f9c45f1e6 100644
--- a/modules/simpletest/simpletest.install
+++ b/modules/simpletest/simpletest.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: simpletest.install,v 1.41 2011/01/03 06:40:49 webchick Exp $
 
 /**
  * @file
@@ -46,7 +45,7 @@ function simpletest_requirements($phase) {
   );
   if (!$has_domdocument) {
     $requirements['php_domdocument']['severity'] = REQUIREMENT_ERROR;
-    $requirements['php_domdocument']['description'] =t('The testing framework requires the DOMDocument class to be available. Check the configure command at the <a href="@link-phpinfo">PHP info page</a>.', array('@link-phpinfo' => url('admin/reports/status/php')));
+    $requirements['php_domdocument']['description'] = $t('The testing framework requires the DOMDocument class to be available. Check the configure command at the <a href="@link-phpinfo">PHP info page</a>.', array('@link-phpinfo' => url('admin/reports/status/php')));
   }
 
   // SimpleTest currently needs 2 cURL options which are incompatible with
@@ -58,7 +57,7 @@ function simpletest_requirements($phase) {
   );
   if ($open_basedir) {
     $requirements['php_open_basedir']['severity'] = REQUIREMENT_ERROR;
-    $requirements['php_open_basedir']['description'] = t('The testing framework requires the PHP <a href="@open_basedir-url">open_basedir</a> restriction to be disabled. Check your webserver configuration or contact your web host.', array('@open_basedir-url' => 'http://php.net/manual/en/ini.core.php#ini.open-basedir'));
+    $requirements['php_open_basedir']['description'] = $t('The testing framework requires the PHP <a href="@open_basedir-url">open_basedir</a> restriction to be disabled. Check your webserver configuration or contact your web host.', array('@open_basedir-url' => 'http://php.net/manual/en/ini.core.php#ini.open-basedir'));
   }
 
   // Check the current memory limit. If it is set too low, SimpleTest will fail
@@ -66,7 +65,7 @@ function simpletest_requirements($phase) {
   $memory_limit = ini_get('memory_limit');
   if ($memory_limit && $memory_limit != -1 && parse_size($memory_limit) < parse_size(SIMPLETEST_MINIMUM_PHP_MEMORY_LIMIT)) {
     $requirements['php_memory_limit']['severity'] = REQUIREMENT_ERROR;
-    $requirements['php_memory_limit']['description'] = t('The testing framework requires the PHP memory limit to be at least %memory_minimum_limit. The current value is %memory_limit. <a href="@url">Follow these steps to continue</a>.', array('%memory_limit' => $memory_limit, '%memory_minimum_limit' => SIMPLETEST_MINIMUM_PHP_MEMORY_LIMIT, '@url' => 'http://drupal.org/node/207036'));
+    $requirements['php_memory_limit']['description'] = $t('The testing framework requires the PHP memory limit to be at least %memory_minimum_limit. The current value is %memory_limit. <a href="@url">Follow these steps to continue</a>.', array('%memory_limit' => $memory_limit, '%memory_minimum_limit' => SIMPLETEST_MINIMUM_PHP_MEMORY_LIMIT, '@url' => 'http://drupal.org/node/207036'));
   }
 
   return $requirements;
diff --git a/modules/simpletest/simpletest.js b/modules/simpletest/simpletest.js
index f3bc109fed19ab58b2a908ec1008be47c3dae61e..c33ef982a8b20d0974e289f3830c550df56cfd3c 100644
--- a/modules/simpletest/simpletest.js
+++ b/modules/simpletest/simpletest.js
@@ -1,4 +1,3 @@
-// $Id: simpletest.js,v 1.11 2009/04/27 20:19:37 webchick Exp $
 (function ($) {
 
 /**
diff --git a/modules/simpletest/simpletest.module b/modules/simpletest/simpletest.module
index ea64aeb01d917be38fe8511269e673e58f9ae1ac..b992fd2a09a80f17a0c93dce57b8ac90cd63b2b5 100644
--- a/modules/simpletest/simpletest.module
+++ b/modules/simpletest/simpletest.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: simpletest.module,v 1.97 2010/11/12 03:06:52 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/simpletest.pages.inc b/modules/simpletest/simpletest.pages.inc
index 4f533511bbfa5defeae3d95b52474412dfd1d7e0..31d0b2ce773bedf90387fbf55ecd6d8cf36ea4a3 100644
--- a/modules/simpletest/simpletest.pages.inc
+++ b/modules/simpletest/simpletest.pages.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: simpletest.pages.inc,v 1.33 2010/10/20 01:31:07 dries Exp $
 
 /**
  * @file
@@ -83,8 +82,8 @@ function theme_simpletest_test_table($variables) {
   // Define the images used to expand/collapse the test groups.
   $js = array(
     'images' => array(
-      theme('image', array('path' => 'misc/menu-collapsed.png', 'alt' => t('Expand'), 'title' => t('Expand'))) . ' <a href="#" class="simpletest-collapse">(' . t('Expand') . ')</a>',
-      theme('image', array('path' => 'misc/menu-expanded.png', 'alt' => t('Collapse'), 'title' => t('Collapse'))) . ' <a href="#" class="simpletest-collapse">(' . t('Collapse') . ')</a>',
+      theme('image', array('path' => 'misc/menu-collapsed.png', 'width' => 7, 'height' => 7, 'alt' => t('Expand'), 'title' => t('Expand'))) . ' <a href="#" class="simpletest-collapse">(' . t('Expand') . ')</a>',
+      theme('image', array('path' => 'misc/menu-expanded.png', 'width' => 7, 'height' => 7, 'alt' => t('Collapse'), 'title' => t('Collapse'))) . ' <a href="#" class="simpletest-collapse">(' . t('Collapse') . ')</a>',
     ),
   );
 
@@ -427,10 +426,10 @@ function simpletest_result_status_image($status) {
 
   if (!isset($map)) {
     $map = array(
-      'pass' => theme('image', array('path' => 'misc/watchdog-ok.png', 'alt' => t('Pass'))),
-      'fail' => theme('image', array('path' => 'misc/watchdog-error.png', 'alt' => t('Fail'))),
-      'exception' => theme('image', array('path' => 'misc/watchdog-warning.png', 'alt' => t('Exception'))),
-      'debug' => theme('image', array('path' => 'misc/watchdog-warning.png', 'alt' => t('Debug'))),
+      'pass' => theme('image', array('path' => 'misc/watchdog-ok.png', 'width' => 18, 'height' => 18, 'alt' => t('Pass'))),
+      'fail' => theme('image', array('path' => 'misc/watchdog-error.png', 'width' => 18, 'height' => 18, 'alt' => t('Fail'))),
+      'exception' => theme('image', array('path' => 'misc/watchdog-warning.png', 'width' => 18, 'height' => 18, 'alt' => t('Exception'))),
+      'debug' => theme('image', array('path' => 'misc/watchdog-warning.png', 'width' => 18, 'height' => 18, 'alt' => t('Debug'))),
     );
   }
   if (isset($map[$status])) {
diff --git a/modules/simpletest/simpletest.test b/modules/simpletest/simpletest.test
index 228199a162976565d21ae7ddfa4a942d7dcedb5f..f51636423c5218f512ff7180379da3a28a770856 100644
--- a/modules/simpletest/simpletest.test
+++ b/modules/simpletest/simpletest.test
@@ -1,5 +1,9 @@
 <?php
-// $Id: simpletest.test,v 1.48 2010/11/12 03:06:52 dries Exp $
+
+/**
+ * @file
+ * Tests for simpletest.module.
+ */
 
 class SimpleTestFunctionalTest extends DrupalWebTestCase {
   /**
diff --git a/modules/simpletest/tests/actions.test b/modules/simpletest/tests/actions.test
index 940b994127afea76aa1f5a9d8a941d3db2e9bd73..23587f0c54ddb8f7c65a7878781f44ceed31e993 100644
--- a/modules/simpletest/tests/actions.test
+++ b/modules/simpletest/tests/actions.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: actions.test,v 1.18 2010/08/05 23:53:38 webchick Exp $
 
 class ActionsConfigurationTestCase extends DrupalWebTestCase {
   public static function getInfo() {
diff --git a/modules/simpletest/tests/actions_loop_test.info b/modules/simpletest/tests/actions_loop_test.info
index e5642821c28ecb2ab646a327394190ebf7a52762..3eccda369866bcf6a6786e5edec7292c97e308d0 100644
--- a/modules/simpletest/tests/actions_loop_test.info
+++ b/modules/simpletest/tests/actions_loop_test.info
@@ -1,4 +1,3 @@
-; $Id: actions_loop_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = Actions loop test
 description = Support module for action loop testing.
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/actions_loop_test.install b/modules/simpletest/tests/actions_loop_test.install
index c6776da0f0f5aa4e7e4f073e8104a42f92b62548..b22fd85ab9d627ccfddf99d5b0335dbb8b426dae 100644
--- a/modules/simpletest/tests/actions_loop_test.install
+++ b/modules/simpletest/tests/actions_loop_test.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: actions_loop_test.install,v 1.2 2009/12/04 16:49:47 dries Exp $
 
 /**
  * Implements hook_install().
diff --git a/modules/simpletest/tests/actions_loop_test.module b/modules/simpletest/tests/actions_loop_test.module
index 60497518ecacdec37ee60d3aeb1af54e0fed164e..77764907b9e6d6204c8c5221a4f5fd6f24dc8ee4 100644
--- a/modules/simpletest/tests/actions_loop_test.module
+++ b/modules/simpletest/tests/actions_loop_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: actions_loop_test.module,v 1.3 2009/12/04 16:49:47 dries Exp $
 
 /**
  * Implements hook_trigger_info().
diff --git a/modules/simpletest/tests/ajax.test b/modules/simpletest/tests/ajax.test
index b9fade22bd511614170576470fc6ace1077092cf..957979249ad677024c07601fb9890ae549847248 100644
--- a/modules/simpletest/tests/ajax.test
+++ b/modules/simpletest/tests/ajax.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: ajax.test,v 1.21 2010/11/29 03:00:50 webchick Exp $
 
 class AJAXTestCase extends DrupalWebTestCase {
   function setUp() {
@@ -11,9 +10,9 @@ class AJAXTestCase extends DrupalWebTestCase {
   }
 
   /**
-   * Assert that a command with the required properties exists within the array of AJAX commands returned by the server.
+   * Assert that a command with the required properties exists within the array of Ajax commands returned by the server.
    *
-   * The AJAX framework, via the ajax_deliver() and ajax_render() functions,
+   * The Ajax framework, via the ajax_deliver() and ajax_render() functions,
    * returns an array of commands. This array sometimes includes commands
    * automatically provided by the framework in addition to commands returned by
    * a particular page callback. During testing, we're usually interested that a
@@ -28,7 +27,7 @@ class AJAXTestCase extends DrupalWebTestCase {
    * additional settings that aren't part of $needle.
    *
    * @param $haystack
-   *   An array of AJAX commands returned by the server.
+   *   An array of Ajax commands returned by the server.
    * @param $needle
    *   Array of info we're expecting in one of those commands.
    * @param $message
@@ -56,7 +55,7 @@ class AJAXTestCase extends DrupalWebTestCase {
 }
 
 /**
- * Tests primary AJAX framework functions.
+ * Tests primary Ajax framework functions.
  */
 class AJAXFrameworkTestCase extends AJAXTestCase {
   protected $profile = 'testing';
@@ -87,7 +86,7 @@ class AJAXFrameworkTestCase extends AJAXTestCase {
     );
     $this->assertCommand($commands, $expected, t('ajax_render() loads settings added with drupal_add_js().'));
 
-    // Verify that AJAX settings are loaded for #type 'link'.
+    // Verify that Ajax settings are loaded for #type 'link'.
     $this->drupalGet('ajax-test/link');
     $settings = $this->drupalGetSettings();
     $this->assertEqual($settings['ajax']['ajax-link']['url'], url('filter/tips'));
@@ -120,7 +119,7 @@ class AJAXFrameworkTestCase extends AJAXTestCase {
 }
 
 /**
- * Tests AJAX framework commands.
+ * Tests Ajax framework commands.
  */
 class AJAXCommandsTestCase extends AJAXTestCase {
   public static function getInfo() {
@@ -132,7 +131,7 @@ class AJAXCommandsTestCase extends AJAXTestCase {
   }
 
   /**
-   * Test the various AJAX Commands.
+   * Test the various Ajax Commands.
    */
   function testAJAXCommands() {
     $form_path = 'ajax_forms_test_ajax_commands_form';
@@ -324,7 +323,7 @@ class AJAXFormValuesTestCase extends AJAXTestCase {
 }
 
 /**
- * Tests that AJAX-enabled forms work when multiple instances of the same form are on a page.
+ * Tests that Ajax-enabled forms work when multiple instances of the same form are on a page.
  */
 class AJAXMultiFormTestCase extends AJAXTestCase {
   public static function getInfo() {
@@ -338,7 +337,7 @@ class AJAXMultiFormTestCase extends AJAXTestCase {
   function setUp() {
     parent::setUp(array('form_test'));
 
-    // Create a multi-valued field for 'page' nodes to use for AJAX testing.
+    // Create a multi-valued field for 'page' nodes to use for Ajax testing.
     $field_name = 'field_ajax_test';
     $field = array(
       'field_name' => $field_name,
@@ -363,7 +362,7 @@ class AJAXMultiFormTestCase extends AJAXTestCase {
    */
   function testMultiForm() {
     // HTML IDs for elements within the field are potentially modified with
-    // each AJAX submission, but these variables are stable and help target the
+    // each Ajax submission, but these variables are stable and help target the
     // desired elements.
     $field_name = 'field_ajax_test';
     $field_xpaths = array(
@@ -399,7 +398,7 @@ class AJAXMultiFormTestCase extends AJAXTestCase {
 }
 
 /**
- * Miscellaneous AJAX tests using ajax_test module.
+ * Miscellaneous Ajax tests using ajax_test module.
  */
 class AJAXElementValidation extends AJAXTestCase {
   public static function getInfo() {
@@ -411,12 +410,12 @@ class AJAXElementValidation extends AJAXTestCase {
   }
 
   /**
-   * Try to post an AJAX change to a form that has a validated element.
+   * Try to post an Ajax change to a form that has a validated element.
    *
-   * The drivertext field is AJAX-enabled. An additional field is not, but
+   * The drivertext field is Ajax-enabled. An additional field is not, but
    * is set to be a required field. In this test the required field is not
    * filled in, and we want to see if the activation of the "drivertext"
-   * AJAX-enabled field fails due to the required field being empty.
+   * Ajax-enabled field fails due to the required field being empty.
    */
   function testAJAXElementValidation() {
     $web_user = $this->drupalCreateUser();
diff --git a/modules/simpletest/tests/ajax_forms_test.info b/modules/simpletest/tests/ajax_forms_test.info
index db131700f7d1fc66ae3d443fc0117b7cafdfc56e..580f2723da0b0501c901c11623fa604da277611b 100644
--- a/modules/simpletest/tests/ajax_forms_test.info
+++ b/modules/simpletest/tests/ajax_forms_test.info
@@ -1,4 +1,3 @@
-; $Id: ajax_forms_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = "AJAX form test mock module"
 description = "Test for AJAX form calls."
 core = 7.x
@@ -6,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/ajax_forms_test.module b/modules/simpletest/tests/ajax_forms_test.module
index 32146f93d45a6541368cf6963ddb8e428b4e0b65..d38cbbb9053dad44ae8cde9a197ef3dd6f5968a5 100644
--- a/modules/simpletest/tests/ajax_forms_test.module
+++ b/modules/simpletest/tests/ajax_forms_test.module
@@ -1,9 +1,8 @@
 <?php
-// $Id: ajax_forms_test.module,v 1.9 2010/11/29 03:00:50 webchick Exp $
 
 /**
  * @file
- * Simpletest mock module for AJAX forms testing.
+ * Simpletest mock module for Ajax forms testing.
  */
 
 /**
@@ -67,7 +66,7 @@ function ajax_forms_test_simple_form($form, &$form_state) {
 }
 
 /**
- * AJAX callback triggered by select.
+ * Ajax callback triggered by select.
  */
 function ajax_forms_test_simple_form_select_callback($form, $form_state) {
   $commands = array();
@@ -77,7 +76,7 @@ function ajax_forms_test_simple_form_select_callback($form, $form_state) {
 }
 
 /**
- * AJAX callback triggered by checkbox.
+ * Ajax callback triggered by checkbox.
  */
 function ajax_forms_test_simple_form_checkbox_callback($form, $form_state) {
   $commands = array();
@@ -88,7 +87,7 @@ function ajax_forms_test_simple_form_checkbox_callback($form, $form_state) {
 
 
 /**
- * Form to display the AJAX Commands.
+ * Form to display the Ajax Commands.
  * @param $form
  * @param $form_state
  * @return unknown_type
@@ -154,7 +153,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) {
     ),
   );
 
-  // Shows the AJAX 'css' command.
+  // Shows the Ajax 'css' command.
   $form['css_command_example'] = array(
     '#value' => t("Set the the '#box' div to be blue."),
     '#type' => 'submit',
@@ -165,7 +164,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) {
   );
 
 
-  // Shows the AJAX 'data' command. But there is no use of this information,
+  // Shows the Ajax 'data' command. But there is no use of this information,
   // as this would require a javascript client to use the data.
   $form['data_command_example'] = array(
     '#value' => t("AJAX data command: Issue command."),
@@ -176,7 +175,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) {
     '#suffix' => '<div id="data_div">Data attached to this div.</div>',
   );
 
-  // Shows the AJAX 'invoke' command.
+  // Shows the Ajax 'invoke' command.
   $form['invoke_command_example'] = array(
     '#value' => t("AJAX invoke command: Invoke addClass() method."),
     '#type' => 'submit',
@@ -186,7 +185,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) {
     '#suffix' => '<div id="invoke_div">Original contents</div>',
   );
 
-  // Shows the AJAX 'html' command.
+  // Shows the Ajax 'html' command.
   $form['html_command_example'] = array(
     '#value' => t("AJAX html: Replace the HTML in a selector."),
     '#type' => 'submit',
@@ -196,7 +195,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) {
     '#suffix' => '<div id="html_div">Original contents</div>',
   );
 
-  // Shows the AJAX 'insert' command.
+  // Shows the Ajax 'insert' command.
   $form['insert_command_example'] = array(
     '#value' => t("AJAX insert: Let client insert based on #ajax['method']."),
     '#type' => 'submit',
@@ -207,7 +206,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) {
     '#suffix' => '<div id="insert_div">Original contents</div>',
   );
 
-  // Shows the AJAX 'prepend' command.
+  // Shows the Ajax 'prepend' command.
   $form['prepend_command_example'] = array(
     '#value' => t("AJAX 'prepend': Click to prepend something"),
     '#type' => 'submit',
@@ -217,7 +216,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) {
     '#suffix' => '<div id="prepend_div">Something will be prepended to this div. </div>',
   );
 
-  // Shows the AJAX 'remove' command.
+  // Shows the Ajax 'remove' command.
   $form['remove_command_example'] = array(
     '#value' => t("AJAX 'remove': Click to remove text"),
     '#type' => 'submit',
@@ -227,7 +226,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) {
     '#suffix' => '<div id="remove_div"><div id="remove_text">text to be removed</div></div>',
   );
 
-  // Shows the AJAX 'restripe' command.
+  // Shows the Ajax 'restripe' command.
   $form['restripe_command_example'] = array(
     '#type' => 'submit',
     '#value' => t("AJAX 'restripe' command"),
@@ -242,7 +241,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) {
                   </div>',
   );
 
-  // Demonstrates the AJAX 'settings' command. The 'settings' command has
+  // Demonstrates the Ajax 'settings' command. The 'settings' command has
   // nothing visual to "show", but it can be tested via SimpleTest and via
   // Firebug.
   $form['settings_command_example'] = array(
@@ -262,7 +261,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) {
 }
 
 /**
- * AJAX callback for 'after'.
+ * Ajax callback for 'after'.
  */
 function ajax_forms_test_advanced_commands_after_callback($form, $form_state) {
   $selector = '#after_div';
@@ -273,7 +272,7 @@ function ajax_forms_test_advanced_commands_after_callback($form, $form_state) {
 }
 
 /**
- * AJAX callback for 'alert'.
+ * Ajax callback for 'alert'.
  */
 function ajax_forms_test_advanced_commands_alert_callback($form, $form_state) {
   $commands = array();
@@ -282,7 +281,7 @@ function ajax_forms_test_advanced_commands_alert_callback($form, $form_state) {
 }
 
 /**
- * AJAX callback for 'append'.
+ * Ajax callback for 'append'.
  */
 function ajax_forms_test_advanced_commands_append_callback($form, $form_state) {
   $selector = '#append_div';
@@ -292,7 +291,7 @@ function ajax_forms_test_advanced_commands_append_callback($form, $form_state) {
 }
 
 /**
- * AJAX callback for 'before'.
+ * Ajax callback for 'before'.
  */
 function ajax_forms_test_advanced_commands_before_callback($form, $form_state) {
   $selector = '#before_div';
@@ -303,14 +302,14 @@ function ajax_forms_test_advanced_commands_before_callback($form, $form_state) {
 }
 
 /**
- * AJAX callback for 'changed'.
+ * Ajax callback for 'changed'.
  */
 function ajax_forms_test_advanced_commands_changed_callback($form, $form_state) {
   $commands[] = ajax_command_changed('#changed_div');
   return array('#type' => 'ajax', '#commands' => $commands);
 }
 /**
- * AJAX callback for 'changed' with asterisk marking inner div.
+ * Ajax callback for 'changed' with asterisk marking inner div.
  */
 function ajax_forms_test_advanced_commands_changed_asterisk_callback($form, $form_state) {
   $commands = array();
@@ -319,7 +318,7 @@ function ajax_forms_test_advanced_commands_changed_asterisk_callback($form, $for
 }
 
 /**
- * AJAX callback for 'css'.
+ * Ajax callback for 'css'.
  */
 function ajax_forms_test_advanced_commands_css_callback($form, $form_state) {
   $selector = '#css_div';
@@ -331,7 +330,7 @@ function ajax_forms_test_advanced_commands_css_callback($form, $form_state) {
 }
 
 /**
- * AJAX callback for 'data'.
+ * Ajax callback for 'data'.
  */
 function ajax_forms_test_advanced_commands_data_callback($form, $form_state) {
   $selector = '#data_div';
@@ -342,7 +341,7 @@ function ajax_forms_test_advanced_commands_data_callback($form, $form_state) {
 }
 
 /**
- * AJAX callback for 'invoke'.
+ * Ajax callback for 'invoke'.
  */
 function ajax_forms_test_advanced_commands_invoke_callback($form, $form_state) {
   $commands = array();
@@ -351,7 +350,7 @@ function ajax_forms_test_advanced_commands_invoke_callback($form, $form_state) {
 }
 
 /**
- * AJAX callback for 'html'.
+ * Ajax callback for 'html'.
  */
 function ajax_forms_test_advanced_commands_html_callback($form, $form_state) {
   $commands = array();
@@ -360,7 +359,7 @@ function ajax_forms_test_advanced_commands_html_callback($form, $form_state) {
 }
 
 /**
- * AJAX callback for 'insert'.
+ * Ajax callback for 'insert'.
  */
 function ajax_forms_test_advanced_commands_insert_callback($form, $form_state) {
   $commands = array();
@@ -369,7 +368,7 @@ function ajax_forms_test_advanced_commands_insert_callback($form, $form_state) {
 }
 
 /**
- * AJAX callback for 'prepend'.
+ * Ajax callback for 'prepend'.
  */
 function ajax_forms_test_advanced_commands_prepend_callback($form, $form_state) {
   $commands = array();
@@ -378,7 +377,7 @@ function ajax_forms_test_advanced_commands_prepend_callback($form, $form_state)
 }
 
 /**
- * AJAX callback for 'remove'.
+ * Ajax callback for 'remove'.
  */
 function ajax_forms_test_advanced_commands_remove_callback($form, $form_state) {
   $commands = array();
@@ -387,7 +386,7 @@ function ajax_forms_test_advanced_commands_remove_callback($form, $form_state) {
 }
 
 /**
- * AJAX callback for 'restripe'.
+ * Ajax callback for 'restripe'.
  */
 function ajax_forms_test_advanced_commands_restripe_callback($form, $form_state) {
   $commands = array();
@@ -396,7 +395,7 @@ function ajax_forms_test_advanced_commands_restripe_callback($form, $form_state)
 }
 
 /**
- * AJAX callback for 'settings'.
+ * Ajax callback for 'settings'.
  */
 function ajax_forms_test_advanced_commands_settings_callback($form, $form_state) {
   $commands = array();
@@ -407,12 +406,12 @@ function ajax_forms_test_advanced_commands_settings_callback($form, $form_state)
 
 /**
  * This form and its related submit and callback functions demonstrate
- * not validating another form element when a single AJAX element is triggered.
+ * not validating another form element when a single Ajax element is triggered.
  *
- * The "drivertext" element is an AJAX-enabled textfield, free-form.
+ * The "drivertext" element is an Ajax-enabled textfield, free-form.
  * The "required_field" element is a textfield marked required.
  *
- * The correct behavior is that the AJAX-enabled drivertext element should
+ * The correct behavior is that the Ajax-enabled drivertext element should
  * be able to trigger without causing validation of the "required_field".
  */
 function ajax_forms_test_validation_form($form, &$form_state) {
@@ -451,7 +450,7 @@ function ajax_forms_test_validation_form_submit($form, $form_state) {
 }
 
 /**
- * AJAX callback for the 'drivertext' element of the validation form.
+ * Ajax callback for the 'drivertext' element of the validation form.
  */
 function ajax_forms_test_validation_form_callback($form, $form_state) {
   drupal_set_message("ajax_forms_test_validation_form_callback invoked");
diff --git a/modules/simpletest/tests/ajax_test.info b/modules/simpletest/tests/ajax_test.info
index 799c6d3722e265db70d5d3b7fb0d09eb43b28333..daa84cec5a0f4cbad3d281b2bf744a48a4235352 100644
--- a/modules/simpletest/tests/ajax_test.info
+++ b/modules/simpletest/tests/ajax_test.info
@@ -1,4 +1,3 @@
-; $Id: ajax_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = AJAX Test
 description = Support module for AJAX framework tests.
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/ajax_test.module b/modules/simpletest/tests/ajax_test.module
index 4b0e19e05e39673dc6c7f0860ef46d9a1c17bff1..4148a0839fb93dfcac3fe696a9d97dee826e38bf 100644
--- a/modules/simpletest/tests/ajax_test.module
+++ b/modules/simpletest/tests/ajax_test.module
@@ -1,9 +1,8 @@
 <?php
-// $Id: ajax_test.module,v 1.5 2010/10/21 19:31:39 dries Exp $
 
 /**
  * @file
- * Helper module for AJAX framework tests.
+ * Helper module for Ajax framework tests.
  */
 
 /**
@@ -45,7 +44,7 @@ function ajax_test_render() {
 }
 
 /**
- * Menu callback; Returns AJAX element with #error property set.
+ * Menu callback; Returns Ajax element with #error property set.
  */
 function ajax_test_error() {
   $message = '';
diff --git a/modules/simpletest/tests/batch.test b/modules/simpletest/tests/batch.test
index 48541426e4df0737eff4dec2e72894ffefd4aeb4..d1c0e0b2fe9aa982d67cad0c07cc573dcf200a6d 100644
--- a/modules/simpletest/tests/batch.test
+++ b/modules/simpletest/tests/batch.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: batch.test,v 1.16 2010/11/27 20:25:44 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/batch_test.callbacks.inc b/modules/simpletest/tests/batch_test.callbacks.inc
index 40308c73ae7e4acb5c46013ec347463d7f4351b5..75e665533e993a4d5a9e6ff5b1c2d36a2287865c 100644
--- a/modules/simpletest/tests/batch_test.callbacks.inc
+++ b/modules/simpletest/tests/batch_test.callbacks.inc
@@ -1,6 +1,5 @@
 <?php
 
-// $Id: batch_test.callbacks.inc,v 1.2 2010/10/03 02:42:25 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/batch_test.info b/modules/simpletest/tests/batch_test.info
index e33fb4c00f6617691702786c59770f9481fc1d4c..d8ec56d772da938890688bab4bfdb65825b898fa 100644
--- a/modules/simpletest/tests/batch_test.info
+++ b/modules/simpletest/tests/batch_test.info
@@ -1,4 +1,3 @@
-; $Id: batch_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = "Batch API test"
 description = "Support module for Batch API tests."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/batch_test.module b/modules/simpletest/tests/batch_test.module
index c8710df456ae19c6fbb00f3dc71eedbf66d7e5ab..1200e767dd7d38ae96520ed2ef391576a6263daa 100644
--- a/modules/simpletest/tests/batch_test.module
+++ b/modules/simpletest/tests/batch_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: batch_test.module,v 1.3 2010/10/03 02:42:25 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/bootstrap.test b/modules/simpletest/tests/bootstrap.test
index a6c0aeaecfbc1834701509b5ab66a15e4dd5c437..14c16a95b6d0c4e694ca01a53615fb472b58b1f7 100644
--- a/modules/simpletest/tests/bootstrap.test
+++ b/modules/simpletest/tests/bootstrap.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: bootstrap.test,v 1.35 2010/11/23 03:08:34 dries Exp $
 
 class BootstrapIPAddressTestCase extends DrupalWebTestCase {
 
diff --git a/modules/simpletest/tests/cache.test b/modules/simpletest/tests/cache.test
index c533722af97b3e5f87f289704f3d42c2f4dc255e..43d1fa122c7326c0c1b9bcca55eefa97986740ac 100644
--- a/modules/simpletest/tests/cache.test
+++ b/modules/simpletest/tests/cache.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: cache.test,v 1.12 2010/08/05 23:53:38 webchick Exp $
 
 class CacheTestCase extends DrupalWebTestCase {
   protected $default_bin = 'cache';
diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test
index 19dd70c26c902bce37ba57e2498662d3f94f7539..d618ddb00bb5a679a0cd2bff305609b0f3e806df 100644
--- a/modules/simpletest/tests/common.test
+++ b/modules/simpletest/tests/common.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: common.test,v 1.138 2010/12/15 04:21:39 webchick Exp $
 
 /**
  * @file
@@ -1171,6 +1170,8 @@ class JavaScriptTestCase extends DrupalWebTestCase {
     $this->assertTrue(array_key_exists('misc/drupal.js', $javascript), t('Drupal.js is added when file is added.'));
     $this->assertTrue(array_key_exists('misc/collapse.js', $javascript), t('JavaScript files are correctly added.'));
     $this->assertEqual(base_path(), $javascript['settings']['data'][0]['basePath'], t('Base path JavaScript setting is correctly set.'));
+    url('', array('prefix' => &$prefix));
+    $this->assertEqual(empty($prefix) ? '' : $prefix, $javascript['settings']['data'][1]['pathPrefix'], t('Path prefix JavaScript setting is correctly set.'));
   }
 
   /**
@@ -1178,8 +1179,8 @@ class JavaScriptTestCase extends DrupalWebTestCase {
    */
   function testAddSetting() {
     $javascript = drupal_add_js(array('drupal' => 'rocks', 'dries' => 280342800), 'setting');
-    $this->assertEqual(280342800, $javascript['settings']['data'][1]['dries'], t('JavaScript setting is set correctly.'));
-    $this->assertEqual('rocks', $javascript['settings']['data'][1]['drupal'], t('The other JavaScript setting is set correctly.'));
+    $this->assertEqual(280342800, $javascript['settings']['data'][2]['dries'], t('JavaScript setting is set correctly.'));
+    $this->assertEqual('rocks', $javascript['settings']['data'][2]['drupal'], t('The other JavaScript setting is set correctly.'));
   }
 
   /**
@@ -1209,6 +1210,7 @@ class JavaScriptTestCase extends DrupalWebTestCase {
     $javascript = drupal_get_js('header');
     $this->assertTrue(strpos($javascript, 'basePath') > 0, t('Rendered JavaScript header returns basePath setting.'));
     $this->assertTrue(strpos($javascript, 'misc/jquery.js') > 0, t('Rendered JavaScript header includes jQuery.'));
+    $this->assertTrue(strpos($javascript, 'pathPrefix') > 0, t('Rendered JavaScript header returns pathPrefix setting.'));
 
     // Test whether drupal_add_js can be used to override a previous setting.
     $this->assertTrue(strpos($javascript, 'commonTestShouldAppear') > 0, t('Rendered JavaScript header returns custom setting.'));
@@ -1521,6 +1523,56 @@ class DrupalRenderTestCase extends DrupalWebTestCase {
     $this->assertTrue(strpos($output, $second) < strpos($output, $first), t('Elements were not sorted.'));
   }
 
+  /**
+   * Test #attached functionality in children elements.
+   */
+  function testDrupalRenderChildrenAttached() {
+    // The cache system is turned off for POST requests.
+    $request_method = $_SERVER['REQUEST_METHOD'];
+    $_SERVER['REQUEST_METHOD'] = 'GET';
+
+    // Create an element with a child and subchild.  Each element loads a
+    // different JavaScript file using #attached.
+    $parent_js = drupal_get_path('module', 'user') . '/user.js';
+    $child_js = drupal_get_path('module', 'forum') . '/forum.js';
+    $subchild_js = drupal_get_path('module', 'book') . '/book.js';
+    $element = array(
+      '#type' => 'fieldset',
+      '#cache' => array(
+        'keys' => array('simpletest', 'drupal_render', 'children_attached'),
+      ),
+      '#attached' => array('js' => array($parent_js)),
+      '#title' => 'Parent',
+    );
+    $element['child'] = array(
+      '#type' => 'fieldset',
+      '#attached' => array('js' => array($child_js)),
+      '#title' => 'Child',
+    );
+    $element['child']['subchild'] = array(
+      '#attached' => array('js' => array($subchild_js)),
+      '#markup' => 'Subchild',
+    );
+
+    // Render the element and verify the presence of #attached JavaScript.
+    drupal_render($element);
+    $scripts = drupal_get_js();
+    $this->assertTrue(strpos($scripts, $parent_js), t('The element #attached JavaScript was included.'));
+    $this->assertTrue(strpos($scripts, $child_js), t('The child #attached JavaScript was included.'));
+    $this->assertTrue(strpos($scripts, $subchild_js), t('The subchild #attached JavaScript was included.'));
+
+    // Load the element from cache and verify the presence of the #attached
+    // JavaScript.
+    drupal_static_reset('drupal_add_js');
+    $this->assertTrue(drupal_render_cache_get($element), t('The element was retrieved from cache.'));
+    $scripts = drupal_get_js();
+    $this->assertTrue(strpos($scripts, $parent_js), t('The element #attached JavaScript was included when loading from cache.'));
+    $this->assertTrue(strpos($scripts, $child_js), t('The child #attached JavaScript was included when loading from cache.'));
+    $this->assertTrue(strpos($scripts, $subchild_js), t('The subchild #attached JavaScript was included when loading from cache.'));
+
+    $_SERVER['REQUEST_METHOD'] = $request_method;
+  }
+
   /**
    * Test passing arguments to the theme function.
    */
diff --git a/modules/simpletest/tests/common_test.css b/modules/simpletest/tests/common_test.css
index 0bbfdf24845049b289db5f91195d779e21dfb39e..b86ceadb7b902f35018ffe490097b4e60143dfa6 100644
--- a/modules/simpletest/tests/common_test.css
+++ b/modules/simpletest/tests/common_test.css
@@ -1,3 +1,2 @@
-/* $Id: common_test.css,v 1.1 2010/10/03 05:11:16 webchick Exp $ */
 
 /* This file is for testing CSS file inclusion, no contents are necessary. */
diff --git a/modules/simpletest/tests/common_test.info b/modules/simpletest/tests/common_test.info
index b08a08470eae64f32a94adaf89770a332afb1a3d..4e07d8202afcac284c80793c0b116be80cee821b 100644
--- a/modules/simpletest/tests/common_test.info
+++ b/modules/simpletest/tests/common_test.info
@@ -1,4 +1,3 @@
-; $Id: common_test.info,v 1.3 2010/12/20 19:59:43 webchick Exp $
 name = "Common Test"
 description = "Support module for Common tests."
 package = Testing
@@ -8,8 +7,8 @@ stylesheets[all][] = common_test.css
 stylesheets[print][] = common_test.print.css
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/common_test.module b/modules/simpletest/tests/common_test.module
index 1671f5e08138a78c9862f10e21f108e92a6f684e..9b6178804c9087b7d5144e45a23d6f7d48fc0d87 100644
--- a/modules/simpletest/tests/common_test.module
+++ b/modules/simpletest/tests/common_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: common_test.module,v 1.13 2010/08/17 21:31:13 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/common_test.print.css b/modules/simpletest/tests/common_test.print.css
index 2528fafaf0fefba848dac2930a6899b001037c46..b86ceadb7b902f35018ffe490097b4e60143dfa6 100644
--- a/modules/simpletest/tests/common_test.print.css
+++ b/modules/simpletest/tests/common_test.print.css
@@ -1,3 +1,2 @@
-/* $Id: common_test.print.css,v 1.1 2010/10/03 05:11:16 webchick Exp $ */
 
 /* This file is for testing CSS file inclusion, no contents are necessary. */
diff --git a/modules/simpletest/tests/common_test_info.txt b/modules/simpletest/tests/common_test_info.txt
index 95a8277f4f5ab94b98a959e684508b48d189b1d1..ae217b917036b93c0b0fc7e5727eed210294901f 100644
--- a/modules/simpletest/tests/common_test_info.txt
+++ b/modules/simpletest/tests/common_test_info.txt
@@ -1,4 +1,3 @@
-; $Id: common_test_info.txt,v 1.2 2010/01/30 07:59:25 dries Exp $
 ; Test parsing with a simple string.
 simple_string = A simple string
 
diff --git a/modules/simpletest/tests/database_test.info b/modules/simpletest/tests/database_test.info
index a315617f94be8acb9953675371489f91acb9658c..660f1a057a5fb747de7d7a04c325abaa807d3b36 100644
--- a/modules/simpletest/tests/database_test.info
+++ b/modules/simpletest/tests/database_test.info
@@ -1,4 +1,3 @@
-; $Id: database_test.info,v 1.3 2010/12/20 19:59:43 webchick Exp $
 name = "Database Test"
 description = "Support module for Database layer tests."
 core = 7.x
@@ -6,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/database_test.install b/modules/simpletest/tests/database_test.install
index 08db2e3c6c1ed72d293a206e6a6ece9f15f29bb9..4dce2b19af886d0489f9a7a1ae63605b419cf747 100644
--- a/modules/simpletest/tests/database_test.install
+++ b/modules/simpletest/tests/database_test.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: database_test.install,v 1.13 2010/07/28 10:52:12 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/database_test.module b/modules/simpletest/tests/database_test.module
index 0376930308788ce350a790b6b1a861327af75e94..6fac31919c7362d950415cb6f1ddefa6941c15fd 100644
--- a/modules/simpletest/tests/database_test.module
+++ b/modules/simpletest/tests/database_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: database_test.module,v 1.15 2010/10/15 04:34:15 webchick Exp $
 
 /**
  * Implements hook_query_alter().
diff --git a/modules/simpletest/tests/database_test.test b/modules/simpletest/tests/database_test.test
index 183e3b21c02470195c511052230c42f46e43d936..c22d1fc5d0b28600d1e5f044a87795c5e03b0758 100644
--- a/modules/simpletest/tests/database_test.test
+++ b/modules/simpletest/tests/database_test.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: database_test.test,v 1.110 2010/12/31 20:43:43 webchick Exp $
 
 /**
  * Dummy class for fetching into a class.
@@ -719,6 +718,21 @@ class DatabaseUpdateTestCase extends DatabaseTestCase {
     $this->assertIdentical($saved_name, 'Tiffany', t('Updated name successfully.'));
   }
 
+  /**
+   * Confirm updating to NULL.
+   */
+  function testSimpleNullUpdate() {
+    $this->ensureSampleDataNull();
+    $num_updated = db_update('test_null')
+      ->fields(array('age' => NULL))
+      ->condition('name', 'Kermit')
+      ->execute();
+    $this->assertIdentical($num_updated, 1, t('Updated 1 record.'));
+
+    $saved_age = db_query('SELECT age FROM {test_null} WHERE name = :name', array(':name' => 'Kermit'))->fetchField();
+    $this->assertNull($saved_age, t('Updated name successfully.'));
+  }
+
   /**
    * Confirm that we can update a multiple records successfully.
    */
@@ -1310,6 +1324,27 @@ class DatabaseSelectTestCase extends DatabaseTestCase {
     $this->assertEqual($query, $expected, t('The flattened query contains the comment string.'));
   }
 
+  /**
+   * Test query COMMENT system against vulnerabilities.
+   */
+  function testVulnerableComment() {
+    $query = db_select('test')->comment('Testing query comments */ SELECT nid FROM {node}; --');
+    $name_field = $query->addField('test', 'name');
+    $age_field = $query->addField('test', 'age', 'age');
+    $result = $query->execute();
+
+    $num_records = 0;
+    foreach ($result as $record) {
+      $num_records++;
+    }
+
+    $query = (string)$query;
+    $expected = "/* Testing query comments SELECT nid FROM {node}; -- */ SELECT test.name AS name, test.age AS age\nFROM \n{test} test";
+
+    $this->assertEqual($num_records, 4, t('Returned the correct number of rows.'));
+    $this->assertEqual($query, $expected, t('The flattened query contains the sanitised comment string.'));
+  }
+
   /**
    * Test basic conditionals on SELECT statements.
    */
@@ -1687,6 +1722,9 @@ class DatabaseSelectSubqueryTestCase extends DatabaseTestCase {
 
   /**
    * Test EXISTS subquery conditionals on SELECT statements.
+   *
+   * We essentially select all rows from the {test} table that have matching
+   * rows in the {test_people} table based on the shared name column.
    */
   function testExistsSubquerySelect() {
     // Put George into {test_people}.
@@ -1703,7 +1741,7 @@ class DatabaseSelectSubqueryTestCase extends DatabaseTestCase {
     // Subquery to {test_people}.
     $subquery = db_select('test_people', 'tp')
       ->fields('tp', array('name'))
-      ->condition('name', 'George');
+      ->where('tp.name = t.name');
     $query->exists($subquery);
     $result = $query->execute();
 
@@ -1714,6 +1752,9 @@ class DatabaseSelectSubqueryTestCase extends DatabaseTestCase {
 
   /**
    * Test NOT EXISTS subquery conditionals on SELECT statements.
+   *
+   * We essentially select all rows from the {test} table that don't have
+   * matching rows in the {test_people} table based on the shared name column.
    */
   function testNotExistsSubquerySelect() {
     // Put George into {test_people}.
@@ -1731,13 +1772,12 @@ class DatabaseSelectSubqueryTestCase extends DatabaseTestCase {
     // Subquery to {test_people}.
     $subquery = db_select('test_people', 'tp')
       ->fields('tp', array('name'))
-      ->condition('name', 'George');
+      ->where('tp.name = t.name');
     $query->notExists($subquery);
-    $result = $query->execute();
 
-    // Ensure that we got the right record.
-    $record = $result->fetch();
-    $this->assertFalse($record, t('NOT EXISTS query returned no results.'));
+    // Ensure that we got the right number of records.
+    $people = $query->execute()->fetchCol();
+    $this->assertEqual(count($people), 3, t('NOT EXISTS query returned the correct results.'));
   }
 }
 
diff --git a/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info b/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
index ef822558fe21d4e6f51f6b6a640f8766ee4c2e8c..030649d164c87a6eaca7809ae7e996712dcc0fd4 100644
--- a/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
+++ b/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
@@ -1,4 +1,3 @@
-; $Id: drupal_system_listing_compatible_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = "Drupal system listing compatible test"
 description = "Support module for testing the drupal_system_listing function."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module b/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module
index 4155b320357d25ee0d36ca6e9e1430d501ded96d..b3d9bbc7f3711e882119cd6b3af051245d859d04 100644
--- a/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module
+++ b/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module
@@ -1,2 +1 @@
 <?php
-// $Id: drupal_system_listing_compatible_test.module,v 1.1 2010/11/15 00:37:08 webchick Exp $
diff --git a/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info b/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
index 0a082b09ffcd969fa5e970b0eba2464b4f36f39f..1b97a000812704592718d220614b304230347181 100644
--- a/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
+++ b/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
@@ -1,4 +1,3 @@
-; $Id: drupal_system_listing_incompatible_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = "Drupal system listing incompatible test"
 description = "Support module for testing the drupal_system_listing function."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module b/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module
index d5db920e6f8d0bfae75423f536e559e97ff59ecc..b3d9bbc7f3711e882119cd6b3af051245d859d04 100644
--- a/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module
+++ b/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module
@@ -1,2 +1 @@
 <?php
-// $Id: drupal_system_listing_incompatible_test.module,v 1.1 2010/11/15 00:37:08 webchick Exp $
diff --git a/modules/simpletest/tests/entity_cache_test.info b/modules/simpletest/tests/entity_cache_test.info
index 17e15afd04fa3d21edc96dd704cd90fc5a3825b9..9926fa039a213ed0281a7f398d2def44cb644852 100644
--- a/modules/simpletest/tests/entity_cache_test.info
+++ b/modules/simpletest/tests/entity_cache_test.info
@@ -1,4 +1,3 @@
-; $Id: entity_cache_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = "Entity cache test"
 description = "Support module for testing entity cache."
 package = Testing
@@ -7,8 +6,8 @@ core = 7.x
 dependencies[] = entity_cache_test_dependency
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/entity_cache_test.module b/modules/simpletest/tests/entity_cache_test.module
index 244e2f8b74685ccae54b5d47678b39dc425d043d..5ae9eccb1e071a7d50ea2e34d39b8ef6e98ebbc7 100644
--- a/modules/simpletest/tests/entity_cache_test.module
+++ b/modules/simpletest/tests/entity_cache_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: entity_cache_test.module,v 1.2 2010/10/15 04:44:08 webchick Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/entity_cache_test_dependency.info b/modules/simpletest/tests/entity_cache_test_dependency.info
index f1217dfb8bc99f951140ed4864d9150db6564173..ec93b21eff1409c64cc38dd7ce63d15a063e54e9 100644
--- a/modules/simpletest/tests/entity_cache_test_dependency.info
+++ b/modules/simpletest/tests/entity_cache_test_dependency.info
@@ -1,4 +1,3 @@
-; $Id: entity_cache_test_dependency.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = "Entity cache test dependency"
 description = "Support dependency module for testing entity cache."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/entity_cache_test_dependency.module b/modules/simpletest/tests/entity_cache_test_dependency.module
index 31b7d384b41e7e53f518b4964ddb7d7fcc5e5fa4..73a11495f58f95d1248cbdad2f57661f03ee4055 100644
--- a/modules/simpletest/tests/entity_cache_test_dependency.module
+++ b/modules/simpletest/tests/entity_cache_test_dependency.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: entity_cache_test_dependency.module,v 1.2 2010/09/15 04:34:27 webchick Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/entity_crud_hook_test.info b/modules/simpletest/tests/entity_crud_hook_test.info
index 99bb8eb078e54703f3da2598af56f6875ebe6396..c9ea4e9b0fd7c114898a840ed39a89bb22cb6bbc 100644
--- a/modules/simpletest/tests/entity_crud_hook_test.info
+++ b/modules/simpletest/tests/entity_crud_hook_test.info
@@ -1,4 +1,3 @@
-; $Id: entity_crud_hook_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = "Entity CRUD Hooks Test"
 description = "Support module for CRUD hook tests."
 core = 7.x
@@ -6,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/entity_crud_hook_test.module b/modules/simpletest/tests/entity_crud_hook_test.module
index 3aa9caccdfe8de37854abbc1a3a284fcce11c251..873a162ced9c325f1cfc764e8dff187563586828 100644
--- a/modules/simpletest/tests/entity_crud_hook_test.module
+++ b/modules/simpletest/tests/entity_crud_hook_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: entity_crud_hook_test.module,v 1.2 2010/12/15 03:39:42 webchick Exp $
 
 //
 // Presave hooks
diff --git a/modules/simpletest/tests/entity_crud_hook_test.test b/modules/simpletest/tests/entity_crud_hook_test.test
index 50cf720347e033cfbbeaf74050b2047a3afae74c..3f18fc855546392dd27e800af960562a34ea5de6 100644
--- a/modules/simpletest/tests/entity_crud_hook_test.test
+++ b/modules/simpletest/tests/entity_crud_hook_test.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: entity_crud_hook_test.test,v 1.2 2010/12/15 03:39:42 webchick Exp $
 
 /**
  * Test invocation of hooks when inserting, loading, updating or deleting an
diff --git a/modules/simpletest/tests/entity_query.test b/modules/simpletest/tests/entity_query.test
index c1bc3dee51d0f98fa49e32ef845f15a34f8ac1f8..d28d5a35c9361fb88ddb92f88462ec90d064f026 100644
--- a/modules/simpletest/tests/entity_query.test
+++ b/modules/simpletest/tests/entity_query.test
@@ -1,6 +1,5 @@
 <?php
 
-// $Id: entity_query.test,v 1.15 2010/11/14 22:07:57 webchick Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/error.test b/modules/simpletest/tests/error.test
index d6a2fb7f911041dc44e727cda4df61009d3dd260..b1ec4b3f5ca64ab902cc6fe6c83efcc34a01befc 100644
--- a/modules/simpletest/tests/error.test
+++ b/modules/simpletest/tests/error.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: error.test,v 1.9 2010/10/16 00:00:16 webchick Exp $
 
 /**
  * Tests Drupal error and exception handlers.
@@ -25,21 +24,18 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase {
       '%type' => 'Notice',
       '!message' => 'Undefined variable: bananas',
       '%function' => 'error_test_generate_warnings()',
-      '%line' => 44,
       '%file' => drupal_realpath('modules/simpletest/tests/error_test.module'),
     );
     $error_warning = array(
       '%type' => 'Warning',
       '!message' => 'Division by zero',
       '%function' => 'error_test_generate_warnings()',
-      '%line' => 46,
       '%file' => drupal_realpath('modules/simpletest/tests/error_test.module'),
     );
     $error_user_notice = array(
       '%type' => 'User warning',
       '!message' => 'Drupal is awesome',
       '%function' => 'error_test_generate_warnings()',
-      '%line' => 48,
       '%file' => drupal_realpath('modules/simpletest/tests/error_test.module'),
     );
 
@@ -97,7 +93,7 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase {
     // varies from database to database. Check that the SQL string is displayed.
     $this->assertText($error_pdo_exception['%type'], t('Found %type in error page.', $error_pdo_exception));
     $this->assertText($error_pdo_exception['!message'], t('Found !message in error page.', $error_pdo_exception));
-    $error_details = t('in %function (line %line of %file)', $error_pdo_exception);
+    $error_details = t('in %function (line ', $error_pdo_exception);
     $this->assertRaw($error_details, t("Found '!message' in error page.", array('!message' => $error_details)));
   }
 
@@ -105,16 +101,16 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase {
    * Helper function: assert that the error message is found.
    */
   function assertErrorMessage(array $error) {
-    $message = t('%type: !message in %function (line %line of %file).', $error);
-    $this->assertRaw($message, t('Error !message found.', array('!message' => $message)));
+    $message = t('%type: !message in %function (line ', $error);
+    $this->assertRaw($message, t('Found error message: !message.', array('!message' => $message)));
   }
 
   /**
    * Helper function: assert that the error message is not found.
    */
   function assertNoErrorMessage(array $error) {
-    $message = t('%type: !message in %function (line %line of %file).', $error);
-    $this->assertNoRaw($message, t('Error !message not found.', array('!message' => $message)));
+    $message = t('%type: !message in %function (line ', $error);
+    $this->assertNoRaw($message, t('Did not find error message: !message.', array('!message' => $message)));
   }
 }
 
diff --git a/modules/simpletest/tests/error_test.info b/modules/simpletest/tests/error_test.info
index 1cb85e0221ea15277aa3b0a1276bdf18cc3498b1..f742d62d03cb78e17d687a94fdeee9afbc187a01 100644
--- a/modules/simpletest/tests/error_test.info
+++ b/modules/simpletest/tests/error_test.info
@@ -1,4 +1,3 @@
-; $Id: error_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = "Error test"
 description = "Support module for error and exception testing."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/error_test.module b/modules/simpletest/tests/error_test.module
index 6fe94ffa656fe93ccc3e5f01bd9d9ee1496cce79..d062cb067c47fd7f6d2af1c2ef36d384db0a4e1c 100644
--- a/modules/simpletest/tests/error_test.module
+++ b/modules/simpletest/tests/error_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: error_test.module,v 1.5 2009/12/04 16:49:47 dries Exp $
 
 /**
  * Implements hook_menu().
diff --git a/modules/simpletest/tests/file.test b/modules/simpletest/tests/file.test
index 467b599677507e22c2120d60b3e71d08440b0d7f..dc12b1b7395371b423abf9e74d1b3352f61100ad 100644
--- a/modules/simpletest/tests/file.test
+++ b/modules/simpletest/tests/file.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: file.test,v 1.72 2010/11/30 19:31:46 dries Exp $
 
 /**
  *  @file
diff --git a/modules/simpletest/tests/file_test.info b/modules/simpletest/tests/file_test.info
index 38ca4ec01a7cc0600ff53e7b6079b6163b66fdd2..24d05cf40667eaaf4f4f134203827772d1021f37 100644
--- a/modules/simpletest/tests/file_test.info
+++ b/modules/simpletest/tests/file_test.info
@@ -1,4 +1,3 @@
-; $Id: file_test.info,v 1.1 2008/09/20 07:35:53 webchick Exp $
 name = "File test"
 description = "Support module for file handling tests."
 package = Testing
@@ -7,8 +6,8 @@ core = 7.x
 files[] = file_test.module
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/file_test.module b/modules/simpletest/tests/file_test.module
index 3624ccec949dd192b92dbb4afe99a81497252565..2865a1fa3c143665ec99f8d6c89d742c0e91ae26 100644
--- a/modules/simpletest/tests/file_test.module
+++ b/modules/simpletest/tests/file_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: file_test.module,v 1.25 2010/08/22 13:52:58 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/filetransfer.test b/modules/simpletest/tests/filetransfer.test
index 0ddc436e3ef5f322475f8bd4ce118022a546100b..905d23cab7f3cf572293b6ef5ead31116d5887e6 100644
--- a/modules/simpletest/tests/filetransfer.test
+++ b/modules/simpletest/tests/filetransfer.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: filetransfer.test,v 1.9 2010/09/01 20:08:17 dries Exp $
 
 
 class FileTranferTest extends DrupalWebTestCase {
diff --git a/modules/simpletest/tests/filter_test.info b/modules/simpletest/tests/filter_test.info
index 880451301086f54876693b0610f95eef709fe3a2..4532e509fc30ece15caeee0128d7fcd68d1c0910 100644
--- a/modules/simpletest/tests/filter_test.info
+++ b/modules/simpletest/tests/filter_test.info
@@ -1,4 +1,3 @@
-; $Id: filter_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = Filter test module
 description = Tests filter hooks and functions.
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/filter_test.module b/modules/simpletest/tests/filter_test.module
index 9d896f3bc87528a0c2a3e2b186d4d62f07b542c8..2cebc7085d0e5233de62718d19464ab4a07142f7 100644
--- a/modules/simpletest/tests/filter_test.module
+++ b/modules/simpletest/tests/filter_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: filter_test.module,v 1.6 2010/09/18 02:18:35 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/form.test b/modules/simpletest/tests/form.test
index 79ec0983b09849b314f7aff3ada808853521750e..e7ae9de3f9e058065d3272a1ce9d4cb1335b1b70 100644
--- a/modules/simpletest/tests/form.test
+++ b/modules/simpletest/tests/form.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: form.test,v 1.79 2010/12/30 22:52:24 webchick Exp $
 
 /**
  * @file
@@ -1132,13 +1131,13 @@ class FormsRebuildTestCase extends DrupalWebTestCase {
   }
 
   /**
-   * Tests that a form's action is retained after an AJAX submission.
+   * Tests that a form's action is retained after an Ajax submission.
    *
-   * The 'action' attribute of a form should not change after an AJAX submission
-   * followed by a non-AJAX submission, which triggers a validation error.
+   * The 'action' attribute of a form should not change after an Ajax submission
+   * followed by a non-Ajax submission, which triggers a validation error.
    */
   function testPreserveFormActionAfterAJAX() {
-    // Create a multi-valued field for 'page' nodes to use for AJAX testing.
+    // Create a multi-valued field for 'page' nodes to use for Ajax testing.
     $field_name = 'field_ajax_test';
     $field = array(
       'field_name' => $field_name,
@@ -1157,14 +1156,14 @@ class FormsRebuildTestCase extends DrupalWebTestCase {
     $this->web_user = $this->drupalCreateUser(array('create page content'));
     $this->drupalLogin($this->web_user);
 
-    // Get the form for adding a 'page' node. Submit an "add another item" AJAX
+    // Get the form for adding a 'page' node. Submit an "add another item" Ajax
     // submission and verify it worked by ensuring the updated page has two text
     // field items in the field for which we just added an item.
     $this->drupalGet('node/add/page');
     $this->drupalPostAJAX(NULL, array(), array('field_ajax_test_add_more' => t('Add another item')), 'system/ajax', array(), array(), 'page-node-form');
     $this->assert(count($this->xpath('//div[contains(@class, "field-name-field-ajax-test")]//input[@type="text"]')) == 2, t('AJAX submission succeeded.'));
 
-    // Submit the form with the non-AJAX "Save" button, leaving the title field
+    // Submit the form with the non-Ajax "Save" button, leaving the title field
     // blank to trigger a validation error, and ensure that a validation error
     // occurred, because this test is for testing what happens when a form is
     // re-rendered without being re-built, which is what happens when there's
diff --git a/modules/simpletest/tests/form_test.file.inc b/modules/simpletest/tests/form_test.file.inc
index ea2dab2b247bef4629edf601ac0f4b8d29de489e..f9197ead2a5b1541e1b68748ee1a0deb6104d7ca 100644
--- a/modules/simpletest/tests/form_test.file.inc
+++ b/modules/simpletest/tests/form_test.file.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: form_test.file.inc,v 1.4 2010/09/19 18:39:18 dries Exp $
 
 /**
  * @file
@@ -11,7 +10,7 @@
  * hook_menu().
  */
 function form_test_load_include_menu($form, &$form_state) {
-  // Submit the form via AJAX. That way the FAPI has to care about including
+  // Submit the form via Ajax. That way the FAPI has to care about including
   // the file specified in hook_menu().
   $ajax_wrapper_id = drupal_html_id('form-test-load-include-menu-ajax-wrapper');
   $form['ajax_wrapper'] = array(
@@ -43,7 +42,7 @@ function form_test_load_include_submit($form, $form_state) {
 function form_test_load_include_menu_ajax($form) {
   // We don't need to return anything, since #ajax['method'] is 'append', which
   // does not remove the original #ajax['wrapper'] element, and status messages
-  // are automatically added by the AJAX framework as long as there's a wrapper
+  // are automatically added by the Ajax framework as long as there's a wrapper
   // element to add them to.
   return '';
 }
diff --git a/modules/simpletest/tests/form_test.info b/modules/simpletest/tests/form_test.info
index c839bcdac36621a0d98e9e5e6b2395ee27430556..430b0fe696d915a404a6c8bbccbdb522ef606ece 100644
--- a/modules/simpletest/tests/form_test.info
+++ b/modules/simpletest/tests/form_test.info
@@ -1,4 +1,3 @@
-; $Id: form_test.info,v 1.3 2010/12/20 19:59:43 webchick Exp $
 name = "FormAPI Test"
 description = "Support module for Form API tests."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/form_test.module b/modules/simpletest/tests/form_test.module
index c49b284668cb79c9635e8cdc46d2043cfde47349..00be7d2e68de9917e7b527364630c8942a630d02 100644
--- a/modules/simpletest/tests/form_test.module
+++ b/modules/simpletest/tests/form_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: form_test.module,v 1.59 2010/12/30 22:52:24 webchick Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/graph.test b/modules/simpletest/tests/graph.test
index 0c9014cdb0a97243fb1b52711fd63a83229a58f0..c190161b4fbcdfc07f2e189ede3a0d8b3ceb8aab 100644
--- a/modules/simpletest/tests/graph.test
+++ b/modules/simpletest/tests/graph.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: graph.test,v 1.10 2010/09/04 13:33:53 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/http.php b/modules/simpletest/tests/http.php
index 5400bb8f281063bd74de9bf1a1120e19c35dc31a..a22938d9beaa1d7703a9d182299c262e868ab6d3 100644
--- a/modules/simpletest/tests/http.php
+++ b/modules/simpletest/tests/http.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: http.php,v 1.1 2010/11/05 19:05:02 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/https.php b/modules/simpletest/tests/https.php
index bbbaca346b833d500a791f4d4744694df2dacfcc..b5ffab69345544cbdfeb326cc430005b7b5b08b3 100644
--- a/modules/simpletest/tests/https.php
+++ b/modules/simpletest/tests/https.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: https.php,v 1.3 2010/11/05 19:05:02 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/image.test b/modules/simpletest/tests/image.test
index 88ba242cee0fd1f39bb68a6465c668436320cc86..60599bee529a3f7c47595791bf12863397d02dde 100644
--- a/modules/simpletest/tests/image.test
+++ b/modules/simpletest/tests/image.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: image.test,v 1.16 2010/09/01 20:08:17 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/image_test.info b/modules/simpletest/tests/image_test.info
index 9f6d0f4934de3959783fec9b4862156253eed11d..eb280e5f50024059c67c89fe99d02258f79d61f1 100644
--- a/modules/simpletest/tests/image_test.info
+++ b/modules/simpletest/tests/image_test.info
@@ -1,4 +1,3 @@
-; $Id: image_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = "Image test"
 description = "Support module for image toolkit tests."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/image_test.module b/modules/simpletest/tests/image_test.module
index 6f88ef316fca9b2687dafba0dfd7693d23fdf73a..de640f0ba24cc33b067375edd1394c4fcc2d45b6 100644
--- a/modules/simpletest/tests/image_test.module
+++ b/modules/simpletest/tests/image_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: image_test.module,v 1.6 2010/03/26 17:14:45 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/lock.test b/modules/simpletest/tests/lock.test
index efa71646cdf60ac5e2e06ba474cd93b95694534a..0b423ffdd4d6ead2f82241367bc23217f7249013 100644
--- a/modules/simpletest/tests/lock.test
+++ b/modules/simpletest/tests/lock.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: lock.test,v 1.3 2010/08/05 23:53:38 webchick Exp $
 
 /**
  * Tests for the lock system.
diff --git a/modules/simpletest/tests/mail.test b/modules/simpletest/tests/mail.test
index 655ce98ba78af3169b89f60a5a72e4639806c8f4..8a7b152d9d32eee7ae47c9ef8b5fb9c77f4e0cf1 100644
--- a/modules/simpletest/tests/mail.test
+++ b/modules/simpletest/tests/mail.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: mail.test,v 1.5 2010/08/05 23:53:38 webchick Exp $
 
 /**
  * Test the Drupal mailing system.
diff --git a/modules/simpletest/tests/menu.test b/modules/simpletest/tests/menu.test
index ff7c7c4d7b60688a3dea96114f4e4117e3e953f4..5642fcee0e07edf0f24ddcde7d6c23589939b413 100644
--- a/modules/simpletest/tests/menu.test
+++ b/modules/simpletest/tests/menu.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: menu.test,v 1.42 2010/12/02 17:34:24 webchick Exp $
 
 /**
  * @file
@@ -34,6 +33,18 @@ class MenuRouterTestCase extends DrupalWebTestCase {
     $this->assertNoText(t('A title with @placeholder', array('@placeholder' => 'some other text')), t('Text with placeholder substitutions not found.'));
   }
 
+  /**
+   * Tests page title of MENU_CALLBACKs.
+   */
+  function testTitleMenuCallback() {
+    // Verify that the menu router item title is not visible.
+    $this->drupalGet('');
+    $this->assertNoText(t('Menu Callback Title'));
+    // Verify that the menu router item title is output as page title.
+    $this->drupalGet('menu_callback_title');
+    $this->assertText(t('Menu Callback Title'));
+  }
+
   /**
    * Test the theme callback when it is set to use an administrative theme.
    */
@@ -845,6 +856,64 @@ class MenuTreeDataTestCase extends DrupalUnitTestCase {
   }
 }
 
+/**
+ * Menu tree output related tests.
+ */
+class MenuTreeOutputTestCase extends DrupalWebTestCase {
+  /**
+   * Dummy link structure acceptable for menu_tree_output().
+   */
+  var $tree_data = array(
+    '1'=> array(
+      'link' => array( 'menu_name' => 'main-menu', 'mlid' => 1, 'hidden'=>0, 'has_children' => 1, 'title' => 'Item 1', 'in_active_trail' => 1, 'access'=>1, 'href' => 'a', 'localized_options' => array('attributes' => array('title' =>'')) ),
+      'below' => array(
+        '2' => array('link' => array( 'menu_name' => 'main-menu', 'mlid' => 2, 'hidden'=>0, 'has_children' => 1, 'title' => 'Item 2', 'in_active_trail' => 1, 'access'=>1, 'href' => 'a/b', 'localized_options' => array('attributes' => array('title' =>'')) ),
+          'below' => array(
+            '3' => array('link' => array( 'menu_name' => 'main-menu', 'mlid' => 3, 'hidden'=>0, 'has_children' => 0, 'title' => 'Item 3', 'in_active_trail' => 0, 'access'=>1, 'href' => 'a/b/c', 'localized_options' => array('attributes' => array('title' =>'')) ),
+              'below' => array() ),
+            '4' => array('link' => array( 'menu_name' => 'main-menu', 'mlid' => 4, 'hidden'=>0, 'has_children' => 0, 'title' => 'Item 4', 'in_active_trail' => 0, 'access'=>1, 'href' => 'a/b/d', 'localized_options' => array('attributes' => array('title' =>'')) ),
+              'below' => array() )
+            )
+          )
+        )
+      ),
+    '5' => array('link' => array( 'menu_name' => 'main-menu', 'mlid' => 5, 'hidden'=>1, 'has_children' => 0, 'title' => 'Item 5', 'in_active_trail' => 0, 'access'=>1, 'href' => 'e', 'localized_options' => array('attributes' => array('title' =>'')) ), 'below' => array( ) ),
+    '6' => array('link' => array( 'menu_name' => 'main-menu', 'mlid' => 6, 'hidden'=>0, 'has_children' => 0, 'title' => 'Item 6', 'in_active_trail' => 0, 'access'=>0, 'href' => 'f', 'localized_options' => array('attributes' => array('title' =>'')) ), 'below' => array( ) ),
+    '7' => array('link' => array( 'menu_name' => 'main-menu', 'mlid' => 7, 'hidden'=>0, 'has_children' => 0, 'title' => 'Item 7', 'in_active_trail' => 0, 'access'=>1, 'href' => 'g', 'localized_options' => array('attributes' => array('title' =>'')) ), 'below' => array( ) )
+  );
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Menu tree output',
+      'description' => 'Tests menu tree output functions.',
+      'group' => 'Menu',
+    );
+  }
+  
+  function setUp() {
+    parent::setUp();
+  }
+
+  /**
+   * Validate the generation of a proper menu tree output.
+   */
+  function testMenuTreeData() {
+    $output = menu_tree_output($this->tree_data);
+
+    // Validate that the - in main-menu is changed into an underscore
+    $this->assertEqual( $output['1']['#theme'], 'menu_link__main_menu', t('Hyphen is changed to a dash on menu_link'));
+    $this->assertEqual( $output['#theme_wrappers'][0], 'menu_tree__main_menu', t('Hyphen is changed to a dash on menu_tree wrapper'));
+    // Looking for child items in the data
+    $this->assertEqual( $output['1']['#below']['2']['#href'], 'a/b', t('Checking the href on a child item'));
+    $this->assertTrue( in_array('active-trail',$output['1']['#below']['2']['#attributes']['class']) , t('Checking the active trail class'));
+    // Validate that the hidden and no access items are missing
+    $this->assertFalse( isset($output['5']), t('Hidden item should be missing'));
+    $this->assertFalse( isset($output['6']), t('False access should be missing'));
+    // Item 7 is after a couple hidden items. Just to make sure that 5 and 6 are skipped and 7 still included
+    $this->assertTrue( isset($output['7']), t('Item after hidden items is present'));
+  }
+}
+
 /**
  * Menu breadcrumbs related tests.
  */
diff --git a/modules/simpletest/tests/menu_test.info b/modules/simpletest/tests/menu_test.info
index b41da9b479ee244d805f7b0830b63d6b03beac55..710e530bd9e00f034e12fa7bb376b976b5f9ef4a 100644
--- a/modules/simpletest/tests/menu_test.info
+++ b/modules/simpletest/tests/menu_test.info
@@ -1,4 +1,3 @@
-; $Id: menu_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = "Hook menu tests"
 description = "Support module for menu hook testing."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/menu_test.module b/modules/simpletest/tests/menu_test.module
index 2230756ac843a20c1c3a9e224dcd6056a00376ed..3046a0416d14b33f467167b8034cb0e5955eda4f 100644
--- a/modules/simpletest/tests/menu_test.module
+++ b/modules/simpletest/tests/menu_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: menu_test.module,v 1.21 2010/12/02 17:34:24 webchick Exp $
 
 /**
  * @file
@@ -16,6 +15,13 @@ function menu_test_menu() {
     'page callback' => 'node_save',
     'menu_name' => menu_test_menu_name(),
   );
+  // This item is of type MENU_CALLBACK with no parents to test title.
+  $items['menu_callback_title'] = array(
+    'title' => 'Menu Callback Title',
+    'page callback' => 'menu_test_callback',
+    'type' => MENU_CALLBACK,
+    'access arguments' => array('access content'),
+  );
   // Use FALSE as 'title callback' to bypass t().
   $items['menu_no_title_callback'] = array(
     'title' => 'A title with @placeholder',
diff --git a/modules/simpletest/tests/module.test b/modules/simpletest/tests/module.test
index 7461a406b834e6afee1108a79cd061401213b8b6..f55c08af4c973128a94acad3a05ea37e57649b62 100644
--- a/modules/simpletest/tests/module.test
+++ b/modules/simpletest/tests/module.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: module.test,v 1.26 2010/11/27 20:41:38 dries Exp $
 
 /**
  * @file
@@ -212,6 +211,27 @@ class ModuleUnitTest extends DrupalWebTestCase {
     $uninstalled_modules = variable_get('test_module_uninstall_order', array());
     $this->assertTrue(in_array('comment', $uninstalled_modules), t('Comment module is in the list of uninstalled modules.'));
     $this->assertFalse(in_array($profile, $uninstalled_modules), t('The installation profile is not in the list of uninstalled modules.'));
+
+    // Enable forum module again, which should enable both the poll module and
+    // php module. But, this time do it with poll module declaring a dependency
+    // on a specific version of php module in its info file. Make sure that
+    // module_enable() still works.
+    variable_set('dependency_test', 'version dependency');
+    drupal_static_reset('system_rebuild_module_data');
+    $result = module_enable(array('forum'));
+    $this->assertTrue($result, t('module_enable() returns the correct value.'));
+    // Verify that the fake dependency chain was installed.
+    $this->assertTrue(module_exists('poll') && module_exists('php'), t('Dependency chain was installed by module_enable().'));
+    // Verify that the original module was installed.
+    $this->assertTrue(module_exists('forum'), t('Module installation with version dependencies succeeded.'));
+    // Finally, verify that the modules were enabled in the correct order.
+    $enable_order = variable_get('test_module_enable_order', array());
+    $php_position = array_search('php', $enable_order);
+    $poll_position = array_search('poll', $enable_order);
+    $forum_position = array_search('forum', $enable_order);
+    $php_before_poll = $php_position !== FALSE && $poll_position !== FALSE && $php_position < $poll_position;
+    $poll_before_forum = $poll_position !== FALSE && $forum_position !== FALSE && $poll_position < $forum_position;
+    $this->assertTrue($php_before_poll && $poll_before_forum, t('Modules were enabled in the correct order by module_enable().'));
   }
 }
 
diff --git a/modules/simpletest/tests/module_test.file.inc b/modules/simpletest/tests/module_test.file.inc
index 323edc06b68fe396310ec909d87d5c0a6f06ffe9..c0d3ec41e68cca34f36b7d7605230ed3ab244388 100644
--- a/modules/simpletest/tests/module_test.file.inc
+++ b/modules/simpletest/tests/module_test.file.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: module_test.file.inc,v 1.3 2010/11/27 20:41:38 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/module_test.info b/modules/simpletest/tests/module_test.info
index e67742f4913812a434d699abcffd8b0ce60c50fc..2e8c9c8ad57caad6e40f2e4747d0345fea619b30 100644
--- a/modules/simpletest/tests/module_test.info
+++ b/modules/simpletest/tests/module_test.info
@@ -1,4 +1,3 @@
-; $Id: module_test.info,v 1.3 2010/12/20 19:59:43 webchick Exp $
 name = "Module test"
 description = "Support module for module system testing."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/module_test.install b/modules/simpletest/tests/module_test.install
index 3f00ee72b3b316b1e15eb272156f34d6cb1a2e98..4cc09df5a8d2b21479cca1484e3b52fc34d0bb31 100644
--- a/modules/simpletest/tests/module_test.install
+++ b/modules/simpletest/tests/module_test.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: module_test.install,v 1.1 2010/02/26 18:31:29 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/module_test.module b/modules/simpletest/tests/module_test.module
index e25a701a449bb5ff5322fc400a5594bc6b649ee9..d781350b360d24b7fe34f7d8d2a0249ded5b2e1b 100644
--- a/modules/simpletest/tests/module_test.module
+++ b/modules/simpletest/tests/module_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: module_test.module,v 1.10 2010/11/27 20:41:38 dries Exp $
 
 /**
  * Implements hook_permission().
@@ -36,6 +35,20 @@ function module_test_system_info_alter(&$info, $file, $type) {
       $info['dependencies'][] = 'php';
     }
   }
+  elseif (variable_get('dependency_test', FALSE) == 'version dependency') {
+    if ($file->name == 'forum') {
+      // Make the forum module depend on poll.
+      $info['dependencies'][] = 'poll';
+    }
+    elseif ($file->name == 'poll') {
+      // Make poll depend on a specific version of php module.
+      $info['dependencies'][] = 'php (1.x)';
+    }
+    elseif ($file->name == 'php') {
+      // Set php module to a version compatible with the above.
+      $info['version'] = '7.x-1.0';
+    }
+  }
   if ($file->name == 'seven' && $type == 'theme') {
     $info['regions']['test_region'] = t('Test region');
   }
diff --git a/modules/simpletest/tests/password.test b/modules/simpletest/tests/password.test
index 2250ac3da26726201a0517fd81d018ff9f2713a5..e100c2ef6306a33b2816b3e239f47ded149cfc22 100644
--- a/modules/simpletest/tests/password.test
+++ b/modules/simpletest/tests/password.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: password.test,v 1.1 2010/12/18 00:56:18 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/path.test b/modules/simpletest/tests/path.test
index efb96cc8623bad14cf5a2d10a734084741ce54d9..0c8ecdac46697c0ba3897be931e8d2ef72f1fe5c 100644
--- a/modules/simpletest/tests/path.test
+++ b/modules/simpletest/tests/path.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: path.test,v 1.8 2010/11/30 01:05:24 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/registry.test b/modules/simpletest/tests/registry.test
index 421678f781fa57723a62aaca124c92a879cf1710..bcd8d4e0dec5f1178e85447fb1b3c8d5fd085c22 100644
--- a/modules/simpletest/tests/registry.test
+++ b/modules/simpletest/tests/registry.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: registry.test,v 1.21 2010/09/01 20:08:17 dries Exp $
 
 class RegistryParseFileTestCase extends DrupalWebTestCase {
   public static function getInfo() {
diff --git a/modules/simpletest/tests/requirements1_test.info b/modules/simpletest/tests/requirements1_test.info
index e98368a557e6ec0dee16ef76ad69c8cd27266a5b..b227e41833517198c9d354c366ee57caf0c2710c 100644
--- a/modules/simpletest/tests/requirements1_test.info
+++ b/modules/simpletest/tests/requirements1_test.info
@@ -1,4 +1,3 @@
-; $Id: requirements1_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = Requirements 1 Test
 description = "Tests that a module is not installed when it fails hook_requirements('install')."
 package = Core
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/requirements1_test.install b/modules/simpletest/tests/requirements1_test.install
index c3748895f3318ef42b2c09c086b54cca55532b95..651d911abb88ea2fdc328fda58d0c988665ff1c8 100644
--- a/modules/simpletest/tests/requirements1_test.install
+++ b/modules/simpletest/tests/requirements1_test.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: requirements1_test.install,v 1.1 2010/05/26 07:31:46 dries Exp $
 
 /**
  * Implements hook_requirements().
diff --git a/modules/simpletest/tests/requirements1_test.module b/modules/simpletest/tests/requirements1_test.module
index 862c34b4a5fea63ce57b827b4cb29d09db5942de..e52266b2ec72e2ffe49014b251cce8cd38034b1f 100644
--- a/modules/simpletest/tests/requirements1_test.module
+++ b/modules/simpletest/tests/requirements1_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: requirements1_test.module,v 1.1 2010/05/26 07:31:46 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/requirements2_test.info b/modules/simpletest/tests/requirements2_test.info
index a058fd4a38d348116a618a682bd232a7a84865f7..b0bf1187b2e19ded1127481a4c8685eacb4572e5 100644
--- a/modules/simpletest/tests/requirements2_test.info
+++ b/modules/simpletest/tests/requirements2_test.info
@@ -1,4 +1,3 @@
-; $Id: requirements2_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = Requirements 2 Test
 description = "Tests that a module is not installed when the one it depends on fails hook_requirements('install)."
 dependencies[] = requirements1_test
@@ -8,8 +7,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/requirements2_test.module b/modules/simpletest/tests/requirements2_test.module
index d84c22aad54df6374ab066b76afd87b99e689cc5..a4f43051557fecd112b318980c43f6490ac6251c 100644
--- a/modules/simpletest/tests/requirements2_test.module
+++ b/modules/simpletest/tests/requirements2_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: requirements2_test.module,v 1.1 2010/05/26 07:31:47 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/schema.test b/modules/simpletest/tests/schema.test
index f9baaac7e4cde1b4bd038263bdab1a74493a56fe..8945117cbbdba4b13b70f9fd50ffbb4fce8a1460 100644
--- a/modules/simpletest/tests/schema.test
+++ b/modules/simpletest/tests/schema.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: schema.test,v 1.24 2010/12/08 06:38:59 webchick Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/session.test b/modules/simpletest/tests/session.test
index d947c51d9e1c593925eff776439c0a6528f5b781..bc72e5c5ee7f01cd5c473a5c67d6e3c89a99e868 100644
--- a/modules/simpletest/tests/session.test
+++ b/modules/simpletest/tests/session.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: session.test,v 1.35 2010/11/13 17:40:09 webchick Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/session_test.info b/modules/simpletest/tests/session_test.info
index 6f7c5305094f0bbfaa2cab5cbe9b9071ac50c5c3..c541d4379ee95f65e9d7d7d1db2f0ff3dd2eebfd 100644
--- a/modules/simpletest/tests/session_test.info
+++ b/modules/simpletest/tests/session_test.info
@@ -1,4 +1,3 @@
-; $Id: session_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = "Session test"
 description = "Support module for session data testing."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/session_test.module b/modules/simpletest/tests/session_test.module
index 62b3fbbe05ae741789a170d6a7da2c75c0824cd8..689ff099ae03dafac7fa0a9c8c66322a1fc98d63 100644
--- a/modules/simpletest/tests/session_test.module
+++ b/modules/simpletest/tests/session_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: session_test.module,v 1.16 2010/11/13 17:40:09 webchick Exp $
 
 /**
  * Implements hook_menu().
diff --git a/modules/simpletest/tests/system.base.css b/modules/simpletest/tests/system.base.css
index a1348a510e296c66f87935e1747f8a89d40a9c6a..c14ae9b27ba16164fdb3fa2f79f284cd3543c076 100644
--- a/modules/simpletest/tests/system.base.css
+++ b/modules/simpletest/tests/system.base.css
@@ -1,4 +1,3 @@
-/* $Id: system.base.css,v 1.1 2010/10/06 03:34:09 webchick Exp $ */
 
 /**
  * This file is for testing CSS file override in
diff --git a/modules/simpletest/tests/system_dependencies_test.info b/modules/simpletest/tests/system_dependencies_test.info
index 141ca63649058da9a2b16cfb8e3402d6943a4bf3..b371f635d4c89839cebd53cb32c3d146c5b18175 100644
--- a/modules/simpletest/tests/system_dependencies_test.info
+++ b/modules/simpletest/tests/system_dependencies_test.info
@@ -1,4 +1,3 @@
-; $Id: system_dependencies_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = "System dependency test"
 description = "Support module for testing system dependencies."
 package = Testing
@@ -7,8 +6,8 @@ core = 7.x
 hidden = TRUE
 dependencies[] = _missing_dependency
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/system_dependencies_test.module b/modules/simpletest/tests/system_dependencies_test.module
index 779209b46715721ad2966f6ea6cb0ee3314d6ecc..b3d9bbc7f3711e882119cd6b3af051245d859d04 100644
--- a/modules/simpletest/tests/system_dependencies_test.module
+++ b/modules/simpletest/tests/system_dependencies_test.module
@@ -1,2 +1 @@
 <?php
-// $Id: system_dependencies_test.module,v 1.1 2009/12/08 06:39:34 webchick Exp $
diff --git a/modules/simpletest/tests/system_test.info b/modules/simpletest/tests/system_test.info
index 02ce4a1163ed6f92edac73026f0590fd4cbd2c5b..1681ccb77f3ce63a0fc5feb8eb0acec9acf76a91 100644
--- a/modules/simpletest/tests/system_test.info
+++ b/modules/simpletest/tests/system_test.info
@@ -1,4 +1,3 @@
-; $Id: system_test.info,v 1.3 2008/10/24 23:32:44 webchick Exp $
 name = System test
 description = Support module for system testing.
 package = Testing
@@ -7,8 +6,8 @@ core = 7.x
 files[] = system_test.module
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/system_test.module b/modules/simpletest/tests/system_test.module
index 583a5b70bb4829b9a818a1b85954e428aa86c66e..76841fb6b3daf74e0fb96f9ec44d1ee8411406dd 100644
--- a/modules/simpletest/tests/system_test.module
+++ b/modules/simpletest/tests/system_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: system_test.module,v 1.33 2010/12/01 00:23:36 webchick Exp $
 
 /**
  * Implements hook_menu().
diff --git a/modules/simpletest/tests/tablesort.test b/modules/simpletest/tests/tablesort.test
new file mode 100644
index 0000000000000000000000000000000000000000..9c068f861459d981cde247f05db98eaf0d8c08ac
--- /dev/null
+++ b/modules/simpletest/tests/tablesort.test
@@ -0,0 +1,166 @@
+<?php
+
+/**
+ * @file
+ * Various tablesort tests.
+ */
+
+/**
+ * Test unicode handling features implemented in unicode.inc.
+ */
+class TableSortTest extends DrupalUnitTestCase {
+
+  /**
+   * Storage for initial value of $_GET.
+   *
+   * @var array
+   */
+  protected $GET = array();
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Tablesort',
+      'description' => 'Tests table sorting.',
+      'group' => 'System',
+    );
+  }
+
+  function setUp() {
+    // Save the original $_GET to be restored later.
+    $this->GET = $_GET;
+
+    parent::setUp();
+  }
+
+  function tearDown() {
+    // Revert $_GET.
+    $_GET = $this->GET;
+
+    parent::tearDown();
+  }
+
+  /**
+   * Test tablesort_init().
+   */
+  function testTableSortInit() {
+
+    // Test simple table headers.
+
+    $headers = array('foo', 'bar', 'baz');
+    // Reset $_GET to prevent parameters from Simpletest and Batch API ending
+    // up in $ts['query'].
+    $_GET = array('q' => 'jahwohl');
+    $expected_ts = array(
+      'name' => 'foo',
+      'sql' => '',
+      'sort' => 'asc',
+      'query' => array(),
+    );
+    $ts = tablesort_init($headers);
+    $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE)))));
+    $this->assertEqual($ts, $expected_ts, t('Simple table headers sorted correctly.'));
+
+    // Test with simple table headers plus $_GET parameters that should _not_
+    // override the default.
+
+    $_GET = array(
+      'q' => 'jahwohl',
+      // This should not override the table order because only complex
+      // headers are overridable.
+      'order' => 'bar',
+    );
+    $ts = tablesort_init($headers);
+    $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE)))));
+    $this->assertEqual($ts, $expected_ts, t('Simple table headers plus non-overriding $_GET parameters sorted correctly.'));
+
+    // Test with simple table headers plus $_GET parameters that _should_
+    // override the default.
+
+    $_GET = array(
+      'q' => 'jahwohl',
+      'sort' => 'DESC',
+      // Add an unrelated parameter to ensure that tablesort will include
+      // it in the links that it creates.
+      'alpha' => 'beta',
+    );
+    $expected_ts['sort'] = 'desc';
+    $expected_ts['query'] = array('alpha' => 'beta');
+    $ts = tablesort_init($headers);
+    $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE)))));
+    $this->assertEqual($ts, $expected_ts, t('Simple table headers plus $_GET parameters sorted correctly.'));
+
+    // Test complex table headers.
+
+    $headers = array(
+      'foo',
+      array(
+        'data' => '1',
+        'field' => 'one',
+        'sort' => 'asc',
+        'colspan' => 1,
+      ),
+      array(
+        'data' => '2',
+        'field' => 'two',
+        'sort' => 'desc',
+      ),
+    );
+    // Reset $_GET from previous assertion.
+    $_GET = array(
+      'q' => 'jahwohl',
+      'order' => '2',
+    );
+    $ts = tablesort_init($headers);
+    $expected_ts = array(
+      'name' => '2',
+      'sql' => 'two',
+      'sort' => 'desc',
+      'query' => array(),
+    );
+    $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE)))));
+    $this->assertEqual($ts, $expected_ts, t('Complex table headers sorted correctly.'));
+
+    // Test complex table headers plus $_GET parameters that should _not_
+    // override the default.
+
+    $_GET = array(
+      'q' => 'jahwohl',
+      // This should not override the table order because this header does not
+      // exist.
+      'order' => 'bar',
+    );
+    $ts = tablesort_init($headers);
+    $expected_ts = array(
+      'name' => '1',
+      'sql' => 'one',
+      'sort' => 'asc',
+      'query' => array(),
+    );
+    $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE)))));
+    $this->assertEqual($ts, $expected_ts, t('Complex table headers plus non-overriding $_GET parameters sorted correctly.'));
+    unset($_GET['sort'], $_GET['order'], $_GET['alpha']);
+
+    // Test complex table headers plus $_GET parameters that _should_
+    // override the default.
+
+    $_GET = array(
+      'q' => 'jahwohl',
+      'order' => '1',
+      'sort' => 'ASC',
+      // Add an unrelated parameter to ensure that tablesort will include
+      // it in the links that it creates.
+      'alpha' => 'beta',
+    );
+    $expected_ts = array(
+      'name' => '1',
+      'sql' => 'one',
+      'sort' => 'asc',
+      'query' => array('alpha' => 'beta'),
+    );
+    $ts = tablesort_init($headers);
+    $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE)))));
+    $this->assertEqual($ts, $expected_ts, t('Complex table headers plus $_GET parameters sorted correctly.'));
+    unset($_GET['sort'], $_GET['order'], $_GET['alpha']);
+
+  }
+}
diff --git a/modules/simpletest/tests/taxonomy_test.info b/modules/simpletest/tests/taxonomy_test.info
index e0b0fd8d4d65b30a77af597df6b1c3a2740569cb..8d3aa1efb43654b1d819ee794de0dfba1fd041f7 100644
--- a/modules/simpletest/tests/taxonomy_test.info
+++ b/modules/simpletest/tests/taxonomy_test.info
@@ -1,4 +1,3 @@
-; $Id: taxonomy_test.info,v 1.4 2010/12/20 19:59:43 webchick Exp $
 name = "Taxonomy test module"
 description = "Tests functions and hooks not used in core".
 package = Testing
@@ -7,8 +6,8 @@ core = 7.x
 hidden = TRUE
 dependencies[] = taxonomy
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/taxonomy_test.install b/modules/simpletest/tests/taxonomy_test.install
index b901e7abe8ac66cdf539f54febafea5000a1d072..d5c94da5f7b23ecf433f2851bba0f00919342b98 100644
--- a/modules/simpletest/tests/taxonomy_test.install
+++ b/modules/simpletest/tests/taxonomy_test.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: taxonomy_test.install,v 1.10 2009/12/04 16:49:47 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/taxonomy_test.module b/modules/simpletest/tests/taxonomy_test.module
index f25065c743d70bd55c3ad5a595b9fc3323fb3a8e..aae13a2d448bda09c183efce3051016a471b90d4 100644
--- a/modules/simpletest/tests/taxonomy_test.module
+++ b/modules/simpletest/tests/taxonomy_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: taxonomy_test.module,v 1.8 2009/12/04 16:49:47 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/theme.test b/modules/simpletest/tests/theme.test
index 9e2f38775265d41e8b62c7ef5cb86477d6efcc9d..d0ad77d78bb31f6232c66b8d1e2bb746cdff5fb1 100644
--- a/modules/simpletest/tests/theme.test
+++ b/modules/simpletest/tests/theme.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: theme.test,v 1.23 2010/11/14 21:04:45 webchick Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/theme_test.info b/modules/simpletest/tests/theme_test.info
index 0a790f2a3f43115db089640418b4fa2388be6e1f..7a9c2dbf3c48d472fb6530dbce73c9d4c91546a9 100644
--- a/modules/simpletest/tests/theme_test.info
+++ b/modules/simpletest/tests/theme_test.info
@@ -1,4 +1,3 @@
-; $Id: theme_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = "Theme test"
 description = "Support module for theme system testing."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/theme_test.module b/modules/simpletest/tests/theme_test.module
index 63539d655ce851cff58b745c14707c9c1b736e6e..160d192dd82a565858bdafc82dab953b2b952ef9 100644
--- a/modules/simpletest/tests/theme_test.module
+++ b/modules/simpletest/tests/theme_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: theme_test.module,v 1.4 2010/08/22 12:46:21 dries Exp $
 
 /**
  * Implements hook_menu().
diff --git a/modules/simpletest/tests/unicode.test b/modules/simpletest/tests/unicode.test
index 7e6f0348c676bf748b8f4fc5378c40c296d5110a..47a4938fe85698a78bc5fb2b66e97f17e1f2596e 100644
--- a/modules/simpletest/tests/unicode.test
+++ b/modules/simpletest/tests/unicode.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: unicode.test,v 1.9 2010/08/11 10:58:22 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/update.test b/modules/simpletest/tests/update.test
index a9b0e75e14b518f26e863966c17d684b9d7a3f58..966efff2214e4828e59ec08d4e5c845e90bed8e6 100644
--- a/modules/simpletest/tests/update.test
+++ b/modules/simpletest/tests/update.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: update.test,v 1.4 2010/08/05 23:53:38 webchick Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/update_test_1.info b/modules/simpletest/tests/update_test_1.info
index ab67ad647a51ef363bfaf6d2f6549d8860bba6b0..ae9a726ff0cd680a9c9510b532eea74d170926f0 100644
--- a/modules/simpletest/tests/update_test_1.info
+++ b/modules/simpletest/tests/update_test_1.info
@@ -1,4 +1,3 @@
-; $Id: update_test_1.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = "Update test"
 description = "Support module for update testing."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/update_test_1.install b/modules/simpletest/tests/update_test_1.install
index 814a74a8d2a39988c356be766ec08e343bda5da9..f4a86c7c421953b93454168be69d33477bdcdf7a 100644
--- a/modules/simpletest/tests/update_test_1.install
+++ b/modules/simpletest/tests/update_test_1.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: update_test_1.install,v 1.2 2010/04/28 05:28:22 webchick Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/update_test_1.module b/modules/simpletest/tests/update_test_1.module
index 99b6dcbdfb0e5b6e4b81cdc93473260cdbd41a4d..b3d9bbc7f3711e882119cd6b3af051245d859d04 100644
--- a/modules/simpletest/tests/update_test_1.module
+++ b/modules/simpletest/tests/update_test_1.module
@@ -1,2 +1 @@
 <?php
-// $Id: update_test_1.module,v 1.1 2010/02/03 18:16:23 webchick Exp $
diff --git a/modules/simpletest/tests/update_test_2.info b/modules/simpletest/tests/update_test_2.info
index 78ce4b6f8de9ff3116fbffcadbfd0472372f254c..ae9a726ff0cd680a9c9510b532eea74d170926f0 100644
--- a/modules/simpletest/tests/update_test_2.info
+++ b/modules/simpletest/tests/update_test_2.info
@@ -1,4 +1,3 @@
-; $Id: update_test_2.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = "Update test"
 description = "Support module for update testing."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/update_test_2.install b/modules/simpletest/tests/update_test_2.install
index 6e094ac48d3ec9ee17891829548aebe3d821bc49..9c076ff6c5d68b055717d8c0c7c034eae8f01d6e 100644
--- a/modules/simpletest/tests/update_test_2.install
+++ b/modules/simpletest/tests/update_test_2.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: update_test_2.install,v 1.2 2010/04/28 05:28:22 webchick Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/update_test_2.module b/modules/simpletest/tests/update_test_2.module
index 729e2eff1e5b463688a48902d926ac8963370256..b3d9bbc7f3711e882119cd6b3af051245d859d04 100644
--- a/modules/simpletest/tests/update_test_2.module
+++ b/modules/simpletest/tests/update_test_2.module
@@ -1,2 +1 @@
 <?php
-// $Id: update_test_2.module,v 1.1 2010/02/03 18:16:23 webchick Exp $
diff --git a/modules/simpletest/tests/update_test_3.info b/modules/simpletest/tests/update_test_3.info
index 23d71ba4edee784b179a00051eef4fd9d2aab6ff..ae9a726ff0cd680a9c9510b532eea74d170926f0 100644
--- a/modules/simpletest/tests/update_test_3.info
+++ b/modules/simpletest/tests/update_test_3.info
@@ -1,4 +1,3 @@
-; $Id: update_test_3.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = "Update test"
 description = "Support module for update testing."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/update_test_3.install b/modules/simpletest/tests/update_test_3.install
index 4a86e79b3e2170491453757f5c309cfb0acac2b0..c3f6b757ca63d4e5b97f8e860a41a1ca6fc21701 100644
--- a/modules/simpletest/tests/update_test_3.install
+++ b/modules/simpletest/tests/update_test_3.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: update_test_3.install,v 1.2 2010/04/28 05:28:22 webchick Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/update_test_3.module b/modules/simpletest/tests/update_test_3.module
index ea8efc9080578a731be3dfa0d4d3551e81aaf95e..b3d9bbc7f3711e882119cd6b3af051245d859d04 100644
--- a/modules/simpletest/tests/update_test_3.module
+++ b/modules/simpletest/tests/update_test_3.module
@@ -1,2 +1 @@
 <?php
-// $Id: update_test_3.module,v 1.1 2010/02/03 18:16:23 webchick Exp $
diff --git a/modules/simpletest/tests/upgrade/drupal-6.bare.database.php b/modules/simpletest/tests/upgrade/drupal-6.bare.database.php
index 65c9bc57f9dc3092e01c450da434054749514b46..40c75627a67bfcb76636f93c75d98fb867524512 100644
--- a/modules/simpletest/tests/upgrade/drupal-6.bare.database.php
+++ b/modules/simpletest/tests/upgrade/drupal-6.bare.database.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: drupal-6.bare.database.php,v 1.1 2010/06/28 02:05:47 webchick Exp $
 
 /**
  * @file
@@ -7902,7 +7901,7 @@ db_insert('users')->fields(array(
   'access' => '0',
   'login' => '0',
   'status' => '0',
-  'timezone' => NULL,
+  'timezone' => '-21600',
   'language' => '',
   'picture' => '',
   'init' => '',
@@ -7923,7 +7922,7 @@ db_insert('users')->fields(array(
   'access' => '1277671612',
   'login' => '1277671612',
   'status' => '1',
-  'timezone' => NULL,
+  'timezone' => '-21600',
   'language' => '',
   'picture' => '',
   'init' => 'admin@example.com',
diff --git a/modules/simpletest/tests/upgrade/drupal-6.filled.database.php b/modules/simpletest/tests/upgrade/drupal-6.filled.database.php
index 5fd96f1fde7e879055d105d1a9c4e31826de330c..a9162813678291b804a9b833efdbcaa7cb904b8d 100644
--- a/modules/simpletest/tests/upgrade/drupal-6.filled.database.php
+++ b/modules/simpletest/tests/upgrade/drupal-6.filled.database.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: drupal-6.filled.database.php,v 1.6 2010/12/30 03:44:39 webchick Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/upgrade/drupal-6.forum.database.php b/modules/simpletest/tests/upgrade/drupal-6.forum.database.php
new file mode 100644
index 0000000000000000000000000000000000000000..07dfcb34162bf187587ce131de7a3b1e47dc9b64
--- /dev/null
+++ b/modules/simpletest/tests/upgrade/drupal-6.forum.database.php
@@ -0,0 +1,261 @@
+<?php
+// $Id$
+
+/**
+ * Database additions for forum tests.
+ */
+
+db_create_table('forum', array(
+  'fields' => array(
+    'nid' => array(
+      'type' => 'int',
+      'unsigned' => TRUE,
+      'not null' => TRUE,
+      'default' => 0,
+    ),
+    'vid' => array(
+      'type' => 'int',
+      'unsigned' => TRUE,
+      'not null' => TRUE,
+      'default' => 0,
+    ),
+    'tid' => array(
+      'type' => 'int',
+      'unsigned' => TRUE,
+      'not null' => TRUE,
+      'default' => 0,
+    ),
+  ),
+  'indexes' => array(
+    'nid' => array(
+      'nid',
+    ),
+    'tid' => array(
+      'tid',
+    ),
+  ),
+  'primary key' => array(
+    'vid',
+  ),
+  'module' => 'forum',
+  'name' => 'forum',
+));
+db_insert('forum')->fields(array(
+  'nid',
+  'vid',
+  'tid',
+))
+->values(array(
+  'nid' => '51',
+  'vid' => '61',
+  'tid' => '81',
+))
+->execute();
+
+db_insert('node')->fields(array(
+  'nid',
+  'vid',
+  'type',
+  'language',
+  'title',
+  'uid',
+  'status',
+  'created',
+  'changed',
+  'comment',
+  'promote',
+  'moderate',
+  'sticky',
+  'tnid',
+  'translate',
+))
+->values(array(
+  'nid' => '51',
+  'vid' => '61',
+  'type' => 'forum',
+  'language' => '',
+  'title' => 'Apples',
+  'uid' => '1',
+  'status' => '1',
+  'created' => '1298363952',
+  'changed' => '1298363952',
+  'comment' => '2',
+  'promote' => '0',
+  'moderate' => '0',
+  'sticky' => '0',
+  'tnid' => '0',
+  'translate' => '0',
+))
+->execute();
+
+db_insert('node_revisions')->fields(array(
+  'nid',
+  'vid',
+  'uid',
+  'title',
+  'body',
+  'teaser',
+  'log',
+  'timestamp',
+  'format',
+))
+->values(array(
+  'nid' => '51',
+  'vid' => '61',
+  'uid' => '1',
+  'title' => 'Apples',
+  'body' => 'A fruit.',
+  'teaser' => 'A fruit.',
+  'log' => '',
+  'timestamp' => '1298363952',
+  'format' => '1',
+))
+->execute();
+
+db_insert('node_comment_statistics')->fields(array(
+  'nid',
+  'last_comment_timestamp',
+  'last_comment_name',
+  'last_comment_uid',
+  'comment_count',
+))
+->values(array(
+  'nid' => '51',
+  'last_comment_timestamp' => '1298363952',
+  'last_comment_name' => NULL,
+  'last_comment_uid' => '1',
+  'comment_count' => '0',
+))
+->execute();
+
+db_insert('node_type')->fields(array(
+  'type',
+  'name',
+  'module',
+  'description',
+  'help',
+  'has_title',
+  'title_label',
+  'has_body',
+  'body_label',
+  'min_word_count',
+  'custom',
+  'modified',
+  'locked',
+  'orig_type',
+))
+->values(array(
+  'type' => 'forum',
+  'name' => 'Forum topic',
+  'module' => 'forum',
+  'description' => 'A <em>forum topic</em> is the initial post to a new discussion thread within a forum.',
+  'help' => '',
+  'has_title' => '1',
+  'title_label' => 'Subject',
+  'has_body' => '1',
+  'body_label' => 'Body',
+  'min_word_count' => '0',
+  'custom' => '0',
+  'modified' => '0',
+  'locked' => '1',
+  'orig_type' => 'forum',
+))
+->execute();
+
+db_update('system')->fields(array(
+  'schema_version' => '6000',
+  'status' => '1',
+))
+->condition('filename', 'modules/forum/forum.module')
+->execute();
+
+db_insert('term_data')->fields(array(
+  'tid',
+  'vid',
+  'name',
+  'description',
+  'weight',
+))
+->values(array(
+  'tid' => '81',
+  'vid' => '101',
+  'name' => 'Fruits',
+  'description' => 'Fruits.',
+  'weight' => '0',
+))
+->execute();
+
+db_insert('term_hierarchy')->fields(array(
+  'tid',
+  'parent',
+))
+->values(array(
+  'tid' => '81',
+  'parent' => '0',
+))
+->execute();
+
+db_insert('term_node')->fields(array(
+  'nid',
+  'vid',
+  'tid',
+))
+->values(array(
+  'nid' => '51',
+  'vid' => '61',
+  'tid' => '81',
+))
+->execute();
+
+db_insert('variable')->fields(array(
+  'name',
+  'value',
+))
+->values(array(
+  'name' => 'forum_nav_vocabulary',
+  'value' => 's:3:"101";',
+))
+->values(array(
+  'name' => 'forum_containers',
+  'value' => 'a:1:{i:0;s:3:"101";}',
+))
+->execute();
+
+db_insert('vocabulary')->fields(array(
+  'vid',
+  'name',
+  'description',
+  'help',
+  'relations',
+  'hierarchy',
+  'multiple',
+  'required',
+  'tags',
+  'module',
+  'weight',
+))
+->values(array(
+  'vid' => '101',
+  'name' => 'Upgrade test for forums',
+  'description' => 'Vocabulary used for Forums. The name is changed from the default "Forums" so that the upgrade path may be tested.',
+  'help' => '',
+  'relations' => '1',
+  'hierarchy' => '1',
+  'multiple' => '0',
+  'required' => '0',
+  'tags' => '0',
+  'module' => 'forum',
+  'weight' => '-10',
+))
+->execute();
+
+db_insert('vocabulary_node_types')->fields(array(
+  'vid',
+  'type',
+))
+->values(array(
+  'vid' => '101',
+  'type' => 'forum',
+))
+->execute();
+
diff --git a/modules/simpletest/tests/upgrade/drupal-6.locale.database.php b/modules/simpletest/tests/upgrade/drupal-6.locale.database.php
index e96ca3ab5b17cc3b8528d9604385876ee87fe2ac..c8af67121a309e3d219a8b7cda62bbac4aaac54c 100644
--- a/modules/simpletest/tests/upgrade/drupal-6.locale.database.php
+++ b/modules/simpletest/tests/upgrade/drupal-6.locale.database.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: drupal-6.locale.database.php,v 1.1 2010/10/05 20:04:19 webchick Exp $
 
 /**
  * Database additions for locale tests.
diff --git a/modules/simpletest/tests/upgrade/drupal-6.upload.database.php b/modules/simpletest/tests/upgrade/drupal-6.upload.database.php
index ef72861cbd39b27873f37db0aa180b5f3b308262..493483f3d1e6eb5caeade2ad5b09aafe559249f0 100644
--- a/modules/simpletest/tests/upgrade/drupal-6.upload.database.php
+++ b/modules/simpletest/tests/upgrade/drupal-6.upload.database.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: drupal-6.upload.database.php,v 1.2 2010/11/13 01:48:14 dries Exp $
 
 db_insert('files')->fields(array(
   'fid',
diff --git a/modules/simpletest/tests/upgrade/upgrade.comment.test b/modules/simpletest/tests/upgrade/upgrade.comment.test
index ebf70304f8ea18661822f1a6ddf2d1ca966e1530..5fcf0b4b24278200534845139e4d79ed6a890c5c 100644
--- a/modules/simpletest/tests/upgrade/upgrade.comment.test
+++ b/modules/simpletest/tests/upgrade/upgrade.comment.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: upgrade.comment.test,v 1.1 2010/09/11 21:52:59 webchick Exp $
 
 /**
  * Upgrade test for comment.module.
diff --git a/modules/simpletest/tests/upgrade/upgrade.filter.test b/modules/simpletest/tests/upgrade/upgrade.filter.test
index e63fddb64ed02dcafc86dae18701c1952f765b16..86248b74cd5d745a72904e342b5173dd717d93e5 100644
--- a/modules/simpletest/tests/upgrade/upgrade.filter.test
+++ b/modules/simpletest/tests/upgrade/upgrade.filter.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: upgrade.filter.test,v 1.1 2010/11/09 17:43:10 webchick Exp $
 
 /**
  * Upgrade test for filter format identifiers.
diff --git a/modules/simpletest/tests/upgrade/upgrade.forum.test b/modules/simpletest/tests/upgrade/upgrade.forum.test
new file mode 100644
index 0000000000000000000000000000000000000000..827988dabdf081737757a71fbbec0200a5407009
--- /dev/null
+++ b/modules/simpletest/tests/upgrade/upgrade.forum.test
@@ -0,0 +1,61 @@
+<?php
+// $Id$
+
+/**
+ * Upgrade test for forum.module.
+ */
+class ForumUpgradePathTestCase extends UpgradePathTestCase {
+  public static function getInfo() {
+    return array(
+      'name'  => 'Forum upgrade path',
+      'description'  => 'Upgrade path tests for the Forum module.',
+      'group' => 'Upgrade path',
+    );
+  }
+
+  public function setUp() {
+    // Path to the database dump files.
+    $this->databaseDumpFiles = array(
+      drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.filled.database.php',
+      drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.forum.database.php',
+    );
+    parent::setUp();
+
+    $this->uninstallModulesExcept(array('comment', 'forum', 'taxonomy'));
+  }
+
+  /**
+   * Test a successful upgrade (no negotiation).
+   */
+  public function testForumUpgrade() {
+    $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
+
+    // Work around http://drupal.org/node/931512
+    $this->drupalPost('admin/structure/types/manage/forum/fields', array(), t('Save'));
+
+    // The D6 database forum vocabulary contains the term "Fruits" with id 81.
+    $tid = 81;
+    $this->drupalGet("forum/$tid");
+
+    // There is one forum topic in Fruits, with the title "Apples".
+    $this->clickLink('Apples');
+    $this->clickLink('Edit');
+
+    // Add a forum topic "Bananas" to the "Fruits" forum.
+    $edit = array(
+      'title' => $title = 'Bananas',
+      'body[' . LANGUAGE_NONE . '][0][value]' => $body = 'It is another fruit.',
+    );
+    $this->drupalPost("node/add/forum/$tid", $edit, t('Save'));
+    $type = t('Forum topic');
+    $this->assertRaw(t('@type %title has been created.', array('@type' => $type, '%title' => $title)), t('Forum topic was created'));
+
+    // Retrieve node object, ensure that the topic was created and in the proper forum.
+    $node = $this->drupalGetNodeByTitle($title);
+    $this->assertTrue($node != NULL, t('Node @title was loaded', array('@title' => $title)));
+    $this->assertEqual($node->taxonomy_forums[LANGUAGE_NONE][0]['tid'], $tid, 'Saved forum topic was in the expected forum');
+
+    $this->drupalGet("forum/$tid");
+    $this->assertText('Bananas');
+    }
+}
diff --git a/modules/simpletest/tests/upgrade/upgrade.locale.test b/modules/simpletest/tests/upgrade/upgrade.locale.test
index 2d83acdb47910c078e1137740d3a758914170f48..aec559de66f3003fcafb46d5fe2bff88074e7f61 100644
--- a/modules/simpletest/tests/upgrade/upgrade.locale.test
+++ b/modules/simpletest/tests/upgrade/upgrade.locale.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: upgrade.locale.test,v 1.1 2010/10/06 20:38:29 webchick Exp $
 
 /**
  * Upgrade test for locale.module.
diff --git a/modules/simpletest/tests/upgrade/upgrade.node.test b/modules/simpletest/tests/upgrade/upgrade.node.test
index 2b79579ddd6426fe13cbebfcf292ad06d363a8fb..163dbef5e9db58a71ae0c3aa057b29639ccffa7e 100644
--- a/modules/simpletest/tests/upgrade/upgrade.node.test
+++ b/modules/simpletest/tests/upgrade/upgrade.node.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: upgrade.node.test,v 1.4 2010/12/18 02:04:36 dries Exp $
 
 /**
  * Upgrade test for node bodies.
diff --git a/modules/simpletest/tests/upgrade/upgrade.poll.test b/modules/simpletest/tests/upgrade/upgrade.poll.test
index b1f41eb1c7488a99ce69d75d50d039a802c0c7d7..9bbbf90a4e8cad13f7d03106239ab63b42360ac5 100644
--- a/modules/simpletest/tests/upgrade/upgrade.poll.test
+++ b/modules/simpletest/tests/upgrade/upgrade.poll.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: upgrade.poll.test,v 1.4 2010/09/13 05:50:09 webchick Exp $
 
 /**
  * Upgrade test for poll.module.
diff --git a/modules/simpletest/tests/upgrade/upgrade.taxonomy.test b/modules/simpletest/tests/upgrade/upgrade.taxonomy.test
index b3f795ae0403d3974bce260e310ac0e63e5dfa68..dadb98e5acd994d2966cd59af6d06152ad905666 100644
--- a/modules/simpletest/tests/upgrade/upgrade.taxonomy.test
+++ b/modules/simpletest/tests/upgrade/upgrade.taxonomy.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: upgrade.taxonomy.test,v 1.6 2010/10/06 21:53:41 webchick Exp $
 
 /**
  * Test taxonomy upgrades.
diff --git a/modules/simpletest/tests/upgrade/upgrade.test b/modules/simpletest/tests/upgrade/upgrade.test
index 4738e5d3a6f2976d7186652e7598f96c0e525393..8a3da818857fcbfc9410c88ead525f3022b1410b 100644
--- a/modules/simpletest/tests/upgrade/upgrade.test
+++ b/modules/simpletest/tests/upgrade/upgrade.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: upgrade.test,v 1.12 2010/12/28 21:46:23 webchick Exp $
 
 /**
  * Perform end-to-end tests of the upgrade path.
diff --git a/modules/simpletest/tests/upgrade/upgrade.upload.test b/modules/simpletest/tests/upgrade/upgrade.upload.test
index dd02d3abbc14bd3e17180ef7edfca1ceb608c291..e3e1dc21ec74f5561b1289306d4267534d755dbd 100644
--- a/modules/simpletest/tests/upgrade/upgrade.upload.test
+++ b/modules/simpletest/tests/upgrade/upgrade.upload.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: upgrade.upload.test,v 1.3 2010/11/21 20:35:10 webchick Exp $
 
 /**
  * Upgrade test for comment.module.
diff --git a/modules/simpletest/tests/url_alter_test.info b/modules/simpletest/tests/url_alter_test.info
index 0455c0d50d9959a5ec8634820a519cdbd653b3fe..adea384c95dc77aa79756edec1eea5a09e8b4cda 100644
--- a/modules/simpletest/tests/url_alter_test.info
+++ b/modules/simpletest/tests/url_alter_test.info
@@ -1,4 +1,3 @@
-; $Id: url_alter_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = Url_alter tests
 description = A support modules for url_alter hook testing.
 core = 7.x
@@ -6,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/url_alter_test.install b/modules/simpletest/tests/url_alter_test.install
index 9ac09e071846a1218ea5bfc4c803e28de5e70705..6e09ab5838a71540ddd3911a4f9a0414ab91e14b 100644
--- a/modules/simpletest/tests/url_alter_test.install
+++ b/modules/simpletest/tests/url_alter_test.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: url_alter_test.install,v 1.1 2009/10/24 05:13:44 webchick Exp $
 
 /**
  * Impelement hook_install().
diff --git a/modules/simpletest/tests/url_alter_test.module b/modules/simpletest/tests/url_alter_test.module
index 4f21e44957ab55a5ed7ae2e7be68f0ceca090116..e229ab98652739d1f64a243f6056af76ccc5a926 100644
--- a/modules/simpletest/tests/url_alter_test.module
+++ b/modules/simpletest/tests/url_alter_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: url_alter_test.module,v 1.3 2010/01/29 22:40:41 dries Exp $
 
 /**
  * @file
diff --git a/modules/simpletest/tests/xmlrpc.test b/modules/simpletest/tests/xmlrpc.test
index 3a3fe3435d5ca61070e3a679ef8d3135cbe9f160..1b5bff3841cc14cb021580bdc9feb04289a32a24 100644
--- a/modules/simpletest/tests/xmlrpc.test
+++ b/modules/simpletest/tests/xmlrpc.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: xmlrpc.test,v 1.21 2010/10/02 01:22:41 dries Exp $
 
 /**
  * Perform basic XML-RPC tests that do not require addition callbacks.
@@ -42,6 +41,16 @@ class XMLRPCBasicTestCase extends DrupalWebTestCase {
     $this->assertEqual($count, count($minimum), 'system.listMethods returned at least the minimum listing');
   }
 
+  /**
+   * Ensure that system.methodSignature returns an array of signatures.
+   */
+  protected function testMethodSignature() {
+    $url = url(NULL, array('absolute' => TRUE)) . 'xmlrpc.php';
+    $signature = xmlrpc($url, array('system.methodSignature' => array('system.listMethods')));
+    $this->assert(is_array($signature) && !empty($signature) && is_array($signature[0]),
+      t('system.methodSignature returns an array of signature arrays.'));
+  }
+
   /**
    * Ensure that XML-RPC correctly handles invalid messages when parsing.
    */
diff --git a/modules/simpletest/tests/xmlrpc_test.info b/modules/simpletest/tests/xmlrpc_test.info
index 7c94c7971954b499766e4a4be76268b584cf2ac8..92a935783dacd54f47889d8eb80a519b0999f36e 100644
--- a/modules/simpletest/tests/xmlrpc_test.info
+++ b/modules/simpletest/tests/xmlrpc_test.info
@@ -1,4 +1,3 @@
-; $Id: xmlrpc_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = "XML-RPC Test"
 description = "Support module for XML-RPC tests according to the validator1 specification."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/simpletest/tests/xmlrpc_test.module b/modules/simpletest/tests/xmlrpc_test.module
index f226aff65d28dae8ebb992707870762311c07e43..db8f113b6b5ef779991eddb6adef6f88b7741880 100644
--- a/modules/simpletest/tests/xmlrpc_test.module
+++ b/modules/simpletest/tests/xmlrpc_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: xmlrpc_test.module,v 1.7 2010/10/02 01:22:41 dries Exp $
 
 function xmlrpc_test_arrayOfStructsTest($array) {
   $sum = 0;
diff --git a/modules/statistics/statistics.admin.inc b/modules/statistics/statistics.admin.inc
index 0885cde52996d746ef45657db8d7e42a3769ce34..6606b8b95616f6b50b7a53b8e8df49d6cc6b5fdc 100644
--- a/modules/statistics/statistics.admin.inc
+++ b/modules/statistics/statistics.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: statistics.admin.inc,v 1.40 2010/06/26 21:32:20 dries Exp $
 
 /**
  * @file
diff --git a/modules/statistics/statistics.info b/modules/statistics/statistics.info
index 1127b2fdaa0356bd9c893fc94c5b2f6f2d2fdbf0..a1339f24dddce870c466ad5e22e1ad99bf190ea2 100644
--- a/modules/statistics/statistics.info
+++ b/modules/statistics/statistics.info
@@ -1,4 +1,3 @@
-; $Id: statistics.info,v 1.12 2010/12/20 19:59:43 webchick Exp $
 name = Statistics
 description = Logs access statistics for your site.
 package = Core
@@ -7,8 +6,8 @@ core = 7.x
 files[] = statistics.test
 configure = admin/config/system/statistics
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/statistics/statistics.install b/modules/statistics/statistics.install
index 7654c2de45548f204779bf0332713b0d526c8dd1..d5855a77ff51cfe15e122ebd0723eb3815bfdd23 100644
--- a/modules/statistics/statistics.install
+++ b/modules/statistics/statistics.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: statistics.install,v 1.29 2011/01/02 17:26:39 webchick Exp $
 
 /**
  * @file
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module
index 3d0344ec21e8f628741e37ef5b3c130d6b2c69a4..6b7be8ac4b2cc5e5006a395d054020178041f7bc 100644
--- a/modules/statistics/statistics.module
+++ b/modules/statistics/statistics.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: statistics.module,v 1.340 2010/11/14 21:04:45 webchick Exp $
 
 /**
  * @file
diff --git a/modules/statistics/statistics.pages.inc b/modules/statistics/statistics.pages.inc
index b8b2cddba16cb97304008c83ed503779a75463d4..bb31f9838f3d4b8ed97d927fb47991aecf3e06ab 100644
--- a/modules/statistics/statistics.pages.inc
+++ b/modules/statistics/statistics.pages.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: statistics.pages.inc,v 1.23 2010/01/09 21:54:01 webchick Exp $
 
 /**
  * @file
diff --git a/modules/statistics/statistics.test b/modules/statistics/statistics.test
index d80e03b5795dea6c67057281d337247dfa216b39..126828f4a08c2b2895480ef00f4318a41b07530a 100644
--- a/modules/statistics/statistics.test
+++ b/modules/statistics/statistics.test
@@ -1,5 +1,9 @@
 <?php
-// $Id: statistics.test,v 1.24 2010/12/08 06:43:07 webchick Exp $
+
+/**
+ * @file
+ * Tests for statistics.module.
+ */
 
 /**
  * Sets up a base class for the Statistics module.
@@ -434,7 +438,7 @@ class StatisticsTokenReplaceTestCase extends StatisticsTestCase {
 
     foreach ($tests as $input => $expected) {
       $output = token_replace($input, array('node' => $node), array('language' => $language));
-      $this->assertFalse(strcmp($output, $expected), t('Statistics token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, t('Statistics token %token replaced.', array('%token' => $input)));
     }
   }
 }
diff --git a/modules/statistics/statistics.tokens.inc b/modules/statistics/statistics.tokens.inc
index 03d7ac8146a0ec5b4a9c8791fce3d43ed0c6b79b..c2c8fc3cbc506a778b07425b6f6b9d50ceb379d9 100644
--- a/modules/statistics/statistics.tokens.inc
+++ b/modules/statistics/statistics.tokens.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: statistics.tokens.inc,v 1.4 2010/04/20 09:48:06 webchick Exp $
 
 /**
  * @file
diff --git a/modules/syslog/syslog.info b/modules/syslog/syslog.info
index 72a6472ca690f6043b7f1ae36ca43d6e160d6aa0..a0467d49720660da3069e16e73c7f97d58284ff7 100644
--- a/modules/syslog/syslog.info
+++ b/modules/syslog/syslog.info
@@ -1,4 +1,3 @@
-; $Id: syslog.info,v 1.7 2010/12/20 19:59:43 webchick Exp $
 name = Syslog
 description = Logs and records system events to syslog.
 package = Core
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 files[] = syslog.test
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/syslog/syslog.install b/modules/syslog/syslog.install
index 969b1b64deec163c8542f918b4e08cf45f3bb4a4..12ff4fb2c7572b2c0d86b934ece2b6711ab7f159 100644
--- a/modules/syslog/syslog.install
+++ b/modules/syslog/syslog.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: syslog.install,v 1.1 2010/08/18 01:54:36 dries Exp $
 
 /**
  * @file
diff --git a/modules/syslog/syslog.module b/modules/syslog/syslog.module
index 83fc512a8ffc9af924230b9598fc005e42eb4467..c4ee382528892a67980e328b83aefa63596427d9 100644
--- a/modules/syslog/syslog.module
+++ b/modules/syslog/syslog.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: syslog.module,v 1.38 2010/09/26 23:31:36 dries Exp $
 
 /**
  * @file
diff --git a/modules/syslog/syslog.test b/modules/syslog/syslog.test
index ec79420723260b1492bcebdf51cbd8b15177c77d..691fb7deeb3858d0782987d6231b2fd4cf68ed6a 100644
--- a/modules/syslog/syslog.test
+++ b/modules/syslog/syslog.test
@@ -1,5 +1,9 @@
 <?php
-// $Id: syslog.test,v 1.14 2010/08/05 23:53:39 webchick Exp $
+
+/**
+ * @file
+ * Tests for syslog.module.
+ */
 
 class SyslogTestCase extends DrupalWebTestCase {
   public static function getInfo() {
diff --git a/modules/system/html.tpl.php b/modules/system/html.tpl.php
index 89435a7d11fa8fb9f2a5f161e91b9be974207e7f..0e012774dcef95dc5ed502bdea28e8a9f91a21b3 100644
--- a/modules/system/html.tpl.php
+++ b/modules/system/html.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: html.tpl.php,v 1.6 2010/11/24 03:30:59 webchick Exp $
 
 /**
  * @file
diff --git a/modules/system/image.gd.inc b/modules/system/image.gd.inc
index bd38c8cbeca9a1eb85c2b6fc50e6bcec726b840c..a3f76d4a629f385ecfd1592dcb702734033ed86c 100644
--- a/modules/system/image.gd.inc
+++ b/modules/system/image.gd.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: image.gd.inc,v 1.18 2010/10/28 02:27:09 dries Exp $
 
 /**
  * @file
diff --git a/modules/system/maintenance-page.tpl.php b/modules/system/maintenance-page.tpl.php
index ac34c52e1773884867e6d98861ba62c03a4e77bb..31de3bb2385826a31b04ab676970de37c5b32cc4 100644
--- a/modules/system/maintenance-page.tpl.php
+++ b/modules/system/maintenance-page.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: maintenance-page.tpl.php,v 1.10 2010/11/24 03:30:59 webchick Exp $
 
 /**
  * @file
diff --git a/modules/system/page.tpl.php b/modules/system/page.tpl.php
index 1092da04d5a97d89dddbf5bc9ebf4e435b64245f..8ffe82aa6298841b63b3f6e493d46bb012261325 100644
--- a/modules/system/page.tpl.php
+++ b/modules/system/page.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: page.tpl.php,v 1.47 2010/11/05 01:25:33 dries Exp $
 
 /**
  * @file
diff --git a/modules/system/region.tpl.php b/modules/system/region.tpl.php
index be8e25c6785efd130caa6346c38583f232d9691f..b29e24f0178f56318ed3415a6c06e40f42786618 100644
--- a/modules/system/region.tpl.php
+++ b/modules/system/region.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: region.tpl.php,v 1.3 2010/09/23 17:53:09 dries Exp $
 
 /**
  * @file
diff --git a/modules/system/system.admin-rtl.css b/modules/system/system.admin-rtl.css
index bcc98e1f0f368ad29b7912712e71d9c47504e66c..362a406c59c774639970b2fc642fb1442f326b83 100644
--- a/modules/system/system.admin-rtl.css
+++ b/modules/system/system.admin-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: system.admin-rtl.css,v 1.3 2010/10/09 05:18:53 webchick Exp $ */
 
 /**
  * @file
diff --git a/modules/system/system.admin.css b/modules/system/system.admin.css
index 80405cf22afd8411c5ccb84d3babba57f75ef5e9..43340b58d3fde533d07bafc312803a41b444e995 100644
--- a/modules/system/system.admin.css
+++ b/modules/system/system.admin.css
@@ -1,4 +1,3 @@
-/* $Id: system.admin.css,v 1.6 2010/10/15 04:40:41 webchick Exp $ */
 
 /**
  * @file
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index 1548977980f31f04878bcce9bdc78cc52a3195ee..9e7d69dd3aed5d6a6a6abecef02fa05c3b1157a2 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: system.admin.inc,v 1.327 2011/01/04 04:02:29 webchick Exp $
 
 /**
  * @file
@@ -55,6 +54,7 @@ function system_admin_config_page() {
 
 /**
  * Provide a single block from the administration menu as a page.
+ *
  * This function is often a destination for these blocks.
  * For example, 'admin/structure/types' needs to have a destination to be valid
  * in the Drupal menu system, but too much information there might be
@@ -158,7 +158,6 @@ function system_themes_page() {
           'alt' => t('Screenshot for !theme theme', array('!theme' => $theme->info['name'])),
           'title' => t('Screenshot for !theme theme', array('!theme' => $theme->info['name'])),
           'attributes' => array('class' => array('screenshot')),
-          'getsize' => FALSE,
         );
         break;
       }
@@ -350,6 +349,14 @@ function system_theme_default() {
       }
       // Set the default theme.
       variable_set('theme_default', $theme);
+
+      // Rebuild the menu. This duplicates the menu_rebuild() in theme_enable().
+      // However, modules must know the current default theme in order to use
+      // this information in hook_menu() or hook_menu_alter() implementations,
+      // and doing the variable_set() before the theme_enable() could result
+      // in a race condition where the theme is default but not enabled.
+      menu_rebuild();
+
       // The status message depends on whether an admin theme is currently in use:
       // a value of 0 means the admin theme is set to be the default theme.
       $admin_theme = variable_get('admin_theme', 0);
@@ -1030,7 +1037,7 @@ function system_modules_confirm_form($modules, $storage) {
       '@module' => $name,
       '@depends' => implode(', ', $info['depends']),
     );
-    $items[] = format_plural(count($info['depends']), 'The @module module is missing, so the following module will be disabled: @depends.', 'The @module module is missing, so the following module will be disabled: @depends.', $t_argument);
+    $items[] = format_plural(count($info['depends']), 'The @module module is missing, so the following module will be disabled: @depends.', 'The @module module is missing, so the following modules will be disabled: @depends.', $t_argument);
   }
 
   $form['text'] = array('#markup' => theme('item_list', array('items' => $items)));
@@ -1182,11 +1189,6 @@ function system_modules_submit($form, &$form_state) {
   }
 
   $form_state['redirect'] = 'admin/modules';
-
-  // Notify locale module about module changes, so translations can be
-  // imported. This might start a batch, and only return to the redirect
-  // path after that.
-  module_invoke('locale', 'system_update', $actions['install']);
 }
 
 /**
diff --git a/modules/system/system.api.php b/modules/system/system.api.php
index 141f6aa61bd88b396d6253e73ada304dfe84cba6..c7db6f1dda41d8657e1130828ea6397ecd9f9c63 100644
--- a/modules/system/system.api.php
+++ b/modules/system/system.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: system.api.php,v 1.225 2011/01/04 00:58:30 webchick Exp $
 
 /**
  * @file
@@ -76,6 +75,7 @@ function hook_hook_info_alter(&$hooks) {
  *     Leave blank to use the DrupalDefaultEntityController implementation.
  *   - base table: (used by DrupalDefaultEntityController) The name of the
  *     entity type's base table.
+ *   - revision table: The name of the entity type's revision table (if any).
  *   - static cache: (used by DrupalDefaultEntityController) FALSE to disable
  *     static caching of entities during a page request. Defaults to TRUE.
  *   - field cache: (used by Field API loading and saving of field data) FALSE
@@ -87,17 +87,18 @@ function hook_hook_info_alter(&$hooks) {
  *   - uri callback: A function taking an entity as argument and returning the
  *     uri elements of the entity, e.g. 'path' and 'options'. The actual entity
  *     uri can be constructed by passing these elements to url().
- *   - label callback: (optional) A function taking an entity as argument and
- *     returning the label of the entity. The entity label is the main string
- *     associated with an entity; for example, the title of a node or the
- *     subject of a comment. If there is an entity object property that defines
- *     the label, use the 'label' element of the 'entity keys' return
- *     value component to provide this information (see below). If more complex
- *     logic is needed to determine the label of an entity, you can instead
- *     specify a callback function here, which will be called to determine the
- *     entity label. See also the entity_label() function, which implements this
- *     logic.
- *   - fieldable: Set to TRUE if you want your entity type to be fieldable.
+ *   - label callback: (optional) A function taking an entity and an entity type
+ *     as arguments and returning the label of the entity. The entity label is
+ *     the main string associated with an entity; for example, the title of a
+ *     node or the subject of a comment. If there is an entity object property
+ *     that defines the label, use the 'label' element of the 'entity keys'
+ *     return value component to provide this information (see below). If more
+ *     complex logic is needed to determine the label of an entity, you can
+ *     instead specify a callback function here, which will be called to
+ *     determine the entity label. See also the entity_label() function, which
+ *     implements this logic.
+ *   - fieldable: Set to TRUE if you want your entity type to accept fields
+ *     being attached to it.
  *   - translation: An associative array of modules registered as field
  *     translation handlers. Array keys are the module names, array values
  *     can be any data structure the module uses to provide field translation.
@@ -123,12 +124,15 @@ function hook_hook_info_alter(&$hooks) {
  *       build the label, a 'label callback' should be defined instead (see
  *       the 'label callback' section above for details).
  *   - bundle keys: An array describing how the Field API can extract the
- *     information it needs from the bundle objects for this type (e.g
- *     $vocabulary objects for terms; not applicable for nodes). This entry can
- *     be omitted if this type's bundles do not exist as standalone objects.
- *     Elements:
- *     - bundle: The name of the property that contains the name of the bundle
- *       object.
+ *     information it needs from the bundle objects for this type. This entry
+ *     is required if the 'path' provided in the 'bundles'/'admin' section
+ *     identifies the bundle using a named menu placeholder whose loader
+ *     callback returns an object (e.g., $vocabulary for taxonomy terms, or
+ *     $node_type for nodes). If the path does not include the bundle, or the
+ *     bundle is just a string rather than an automatically loaded object, then
+ *     this can be omitted. Elements:
+ *     - bundle: The name of the property of the bundle object that contains
+ *       the name of the bundle object.
  *   - bundles: An array describing all bundles for this object type. Keys are
  *     bundles machine names, as found in the objects' 'bundle' property
  *     (defined in the 'entity keys' entry above). Elements:
@@ -142,9 +146,9 @@ function hook_hook_info_alter(&$hooks) {
  *       Elements:
  *       - path: the path of the bundle's main administration page, as defined
  *         in hook_menu(). If the path includes a placeholder for the bundle,
- *         the 'bundle argument', 'bundle helper' and 'real path' keys below
- *         are required.
- *       - bundle argument: The position of the placeholder in 'path', if any.
+ *         the 'bundle argument' and 'real path' keys below are required.
+ *       - bundle argument: The position of the bundle placeholder in 'path', if
+ *         any.
  *       - real path: The actual path (no placeholder) of the bundle's main
  *         administration page. This will be used to generate links.
  *       - access callback: As in hook_menu(). 'user_access' will be assumed if
@@ -498,8 +502,10 @@ function hook_admin_paths_alter(&$paths) {
  *   The entities keyed by entity ID.
  * @param $type
  *   The type of entities being loaded (i.e. node, user, comment).
+ * @param $langcode
+ *   The language to display the entity in.
  */
-function hook_entity_prepare_view($entities, $type) {
+function hook_entity_prepare_view($entities, $type, $langcode) {
   // Load a specific node into the user object for later theming.
   if ($type == 'user') {
     $nodes = mymodule_get_user_nodes(array_keys($entities));
@@ -512,8 +518,6 @@ function hook_entity_prepare_view($entities, $type) {
 /**
  * Perform periodic actions.
  *
- * This hook will only be called if cron.php is run (e.g. by crontab).
- *
  * Modules that require some commands to be executed periodically can
  * implement hook_cron(). The engine will then call the hook whenever a cron
  * run happens, as defined by the administrator. Typical tasks managed by
@@ -649,7 +653,7 @@ function hook_element_info() {
  * A module may implement this hook in order to alter the element type defaults
  * defined by a module.
  *
- * @param &$type
+ * @param $type
  *   All element type defaults as collected by hook_element_info().
  *
  * @see hook_element_info()
@@ -821,7 +825,7 @@ function hook_css_alter(&$css) {
 }
 
 /**
- * Alter the commands that are sent to the user through the AJAX framework.
+ * Alter the commands that are sent to the user through the Ajax framework.
  *
  * @param $commands
  *   An array of all commands that will be sent to the user.
@@ -871,7 +875,7 @@ function hook_page_build(&$page) {
  *
  * This hook is invoked by menu_get_item() and allows for run-time alteration of router
  * information (page_callback, title, and so on) before it is translated and checked for
- * access. The passed in $router_item is statically cached for the current request, so this
+ * access. The passed-in $router_item is statically cached for the current request, so this
  * hook is only invoked once for any router item that is retrieved via menu_get_item().
  *
  * Usually, modules will only want to inspect the router item and conditionally
@@ -922,6 +926,7 @@ function hook_menu_get_item_alter(&$router_item, $path, $original_map) {
  *     $items['abc/def'] = array(
  *       'page callback' => 'mymodule_abc_view',
  *     );
+ *     return $items;
  *   }
  *
  *   function mymodule_abc_view($ghi = 0, $jkl = '') {
@@ -950,6 +955,7 @@ function hook_menu_get_item_alter(&$router_item, $path, $original_map) {
  *       'page callback' => 'mymodule_abc_view',
  *       'page arguments' => array(1, 'foo'),
  *     );
+ *     return $items;
  *   }
  * @endcode
  * When path 'abc/def' is requested, the page callback function will get 'def'
@@ -1836,7 +1842,7 @@ function hook_mail_alter(&$message) {
  * hook in order to reorder the implementing modules, which are otherwise
  * ordered by the module's system weight.
  *
- * @param &$implementations
+ * @param $implementations
  *   An array keyed by the module's name. The value of each item corresponds
  *   to a $group, which is usually FALSE, unless the implementation is in a
  *   file named $module.$group.inc.
@@ -1863,7 +1869,7 @@ function hook_module_implements_alter(&$implementations, $hook) {
  * add to or alter the data generated by reading the .info file with
  * drupal_parse_info_file().
  *
- * @param &$info
+ * @param $info
  *   The .info file contents, passed by reference so that it can be altered.
  * @param $file
  *   Full information about the module or theme, including $file->name, and
@@ -1904,9 +1910,19 @@ function hook_system_info_alter(&$info, $file, $type) {
  *     have inherent security risks across a variety of potential use cases
  *     (for example, the "administer filters" and "bypass node access"
  *     permissions provided by Drupal core). When set to TRUE, a standard
- *     warning message defined in user_admin_permissions() will be associated
- *     with the permission and displayed with it on the permission
- *     administration page. Defaults to FALSE.
+ *     warning message defined in user_admin_permissions() and output via
+ *     theme_user_permission_description() will be associated with the
+ *     permission and displayed with it on the permission administration page.
+ *     Defaults to FALSE.
+ *   - warning: (optional) A translated warning message to display for this
+ *     permission on the permission administration page. This warning overrides
+ *     the automatic warning generated by 'restrict access' being set to TRUE.
+ *     This should rarely be used, since it is important for all permissions to
+ *     have a clear, consistent security warning that is the same across the
+ *     site. Use the 'description' key instead to provide any information that
+ *     is specific to the permission you are defining.
+ *
+ * @see theme_user_permission_description()
  */
 function hook_permission() {
   return array(
@@ -2353,7 +2369,7 @@ function hook_flush_caches() {
  * enable hooks are invoked.
  *
  * @param $modules
- *   An array of the installed modules.
+ *   An array of the modules that were installed.
  *
  * @see module_enable()
  * @see hook_modules_enabled()
@@ -2375,7 +2391,7 @@ function hook_modules_installed($modules) {
  * invoked.
  *
  * @param $modules
- *   An array of the enabled modules.
+ *   An array of the modules that were enabled.
  *
  * @see hook_enable()
  * @see hook_modules_installed()
@@ -2396,7 +2412,7 @@ function hook_modules_enabled($modules) {
  * is only called on the module actually being disabled.
  *
  * @param $modules
- *   An array of the disabled modules.
+ *   An array of the modules that were disabled.
  *
  * @see hook_disable()
  * @see hook_modules_uninstalled()
@@ -2414,11 +2430,11 @@ function hook_modules_disabled($modules) {
  * modules a chance to perform actions when a module is uninstalled, whereas
  * hook_uninstall() is only called on the module actually being uninstalled.
  *
- * It is recommended that you implement this module if your module
- * stores data that may have been set by other modules.
+ * It is recommended that you implement this hook if your module stores
+ * data that may have been set by other modules.
  *
  * @param $modules
- *   An array of the uninstalled modules.
+ *   An array of the modules that were uninstalled.
  *
  * @see hook_uninstall()
  * @see hook_modules_disabled()
@@ -2547,7 +2563,7 @@ function hook_file_load($files) {
  *
  * @see file_validate()
  */
-function hook_file_validate(&$file) {
+function hook_file_validate($file) {
   $errors = array();
 
   if (empty($file->filename)) {
@@ -2747,9 +2763,10 @@ function hook_file_url_alter(&$uri) {
 /**
  * Check installation requirements and do status reporting.
  *
- * This hook has two closely related uses, determined by the $phase argument:
- * checking installation requirements ($phase == 'install')
- * and status reporting ($phase == 'runtime').
+ * This hook has three closely related uses, determined by the $phase argument:
+ * - Checking installation requirements ($phase == 'install').
+ * - Checking update requirements ($phase == 'update').
+ * - Status reporting ($phase == 'runtime').
  *
  * Note that this hook, like all others dealing with installation and updates,
  * must reside in a module_name.install file, or it will not properly abort
@@ -3502,11 +3519,11 @@ function hook_install_tasks() {
 /**
  * Change the page the user is sent to by drupal_goto().
  *
- * @param &$path
+ * @param $path
  *   A Drupal path or a full URL.
- * @param &$options
+ * @param $options
  *   An associative array of additional URL options to pass to url().
- * @param &$http_response_code
+ * @param $http_response_code
  *   The HTTP status code to use for the redirection. See drupal_goto() for more
  *   information.
  */
@@ -3889,7 +3906,7 @@ function hook_date_formats_alter(&$formats) {
 function hook_page_delivery_callback_alter(&$callback) {
   // jQuery sets a HTTP_X_REQUESTED_WITH header of 'XMLHttpRequest'.
   // If a page would normally be delivered as an html page, and it is called
-  // from jQuery, deliver it instead as an AJAX response.
+  // from jQuery, deliver it instead as an Ajax response.
   if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' && $callback == 'drupal_deliver_html_page') {
     $callback = 'ajax_deliver';
   }
@@ -3975,7 +3992,7 @@ function hook_url_outbound_alter(&$path, &$options, $original_path) {
  * displayed. Can be used to ensure user privacy in situations where
  * $account->name is too revealing.
  *
- * @param &$name
+ * @param $name
  *   The string that format_username() will return.
  *
  * @param $account
diff --git a/modules/system/system.archiver.inc b/modules/system/system.archiver.inc
index 903e4688a98399c02ca65557d600b7d5421e4e8c..c37f07daa10413b0d9ff05c6fd59a36361641893 100644
--- a/modules/system/system.archiver.inc
+++ b/modules/system/system.archiver.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: system.archiver.inc,v 1.6 2010/12/30 22:33:04 webchick Exp $
 
 /**
  * @file
diff --git a/modules/system/system.base-rtl.css b/modules/system/system.base-rtl.css
index 79e13d970553a08a2c092f3bedc8c1d13b0b400f..9099c9d72b7f6b3fd2dd008d6cfded2551558cee 100644
--- a/modules/system/system.base-rtl.css
+++ b/modules/system/system.base-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: system.base-rtl.css,v 1.3 2010/09/27 03:56:14 webchick Exp $ */
 
 /**
  * @file
diff --git a/modules/system/system.base.css b/modules/system/system.base.css
index 3ed4e080f46ab2afa16e45d9258e9db058da9c2f..a6748de42ebd103d23b47fb1b42e2756da6fc705 100644
--- a/modules/system/system.base.css
+++ b/modules/system/system.base.css
@@ -1,4 +1,3 @@
-/* $Id: system.base.css,v 1.4 2011/01/03 07:04:48 webchick Exp $ */
 
 /**
  * @file
diff --git a/modules/system/system.cron.js b/modules/system/system.cron.js
index 869d806c7e5715d2170d551f6044bccf066971f2..af17dab52739cb3a9b21d8bd681a3f484fd0de4a 100644
--- a/modules/system/system.cron.js
+++ b/modules/system/system.cron.js
@@ -1,4 +1,3 @@
-// $Id: system.cron.js,v 1.1 2009/12/15 08:45:32 dries Exp $
 (function ($) {
 
 /**
diff --git a/modules/system/system.info b/modules/system/system.info
index cb84b7b29fe2a33d5e454472dd175d25068e7f9f..e54331f512526ca4e3b6608c1f328466d401cd96 100644
--- a/modules/system/system.info
+++ b/modules/system/system.info
@@ -1,4 +1,3 @@
-; $Id: system.info,v 1.21 2010/12/20 19:59:43 webchick Exp $
 name = System
 description = Handles general site configuration for administrators.
 package = Core
@@ -13,8 +12,8 @@ files[] = system.test
 required = TRUE
 configure = admin/config/system
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/system/system.install b/modules/system/system.install
index fa2c3fe92270be1f797dd28bd611b848f58d5fd0..e067444604dce39df4909e36e21847f6f758a748 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: system.install,v 1.532 2011/01/02 17:26:39 webchick Exp $
 
 /**
  * @file
@@ -33,7 +32,7 @@ function system_requirements($phase) {
     // is not running the default install profile.
     $profile = drupal_get_profile();
     if ($profile != 'standard') {
-      $info = install_profile_info($profile);
+      $info = system_get_info('module', $profile);
       $requirements['install_profile'] = array(
         'title' => $t('Install profile'),
         'value' => $t('%profile_name (%profile-%version)', array(
@@ -953,33 +952,6 @@ function system_schema() {
     ),
   );
 
-  $schema['history'] = array(
-    'description' => 'A record of which {users} have read which {node}s.',
-    'fields' => array(
-      'uid' => array(
-        'description' => 'The {users}.uid that read the {node} nid.',
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-      ),
-      'nid' => array(
-        'description' => 'The {node}.nid that was read.',
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-      ),
-      'timestamp' => array(
-        'description' => 'The Unix timestamp at which the read occurred.',
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-      ),
-    ),
-    'primary key' => array('uid', 'nid'),
-    'indexes' => array(
-      'nid' => array('nid'),
-    ),
-  );
   $schema['menu_router'] = array(
     'description' => 'Maps paths to various callbacks (access, page and title)',
     'fields' => array(
@@ -1555,7 +1527,7 @@ function system_schema() {
         'default' => '',
       ),
       'type' => array(
-        'description' => 'The type of the item, either module, theme, theme_engine, or profile.',
+        'description' => 'The type of the item, either module, theme, or theme_engine.',
         'type' => 'varchar',
         'length' => 12,
         'not null' => TRUE,
@@ -2972,6 +2944,27 @@ function system_update_7069() {
   variable_del('site_offline');
 }
 
+/**
+ * Remove the obsolete 'drupal_badge_color' and 'drupal_badge_size' variables.
+ */
+function system_update_7070() {
+  variable_del('drupal_badge_color');
+  variable_del('drupal_badge_size');
+}
+
+/**
+ * Add index missed during upgrade, and fix field default.
+ */
+function system_update_7071() {
+  db_drop_index('date_format_type', 'title');
+  db_add_index('date_format_type', 'title', array('title'));
+  db_change_field('registry', 'filename', 'filename', array(
+    'type' => 'varchar',
+    'length' => 255,
+    'not null' => TRUE,
+  ));
+}
+
 /**
  * @} End of "defgroup updates-6.x-to-7.x"
  * The next series of updates should start at 8000.
diff --git a/modules/system/system.js b/modules/system/system.js
index 09294932aab7004342a02c9ae740e41483467f8a..5446d28a370a17b585da117bd3ba873aab03ec1d 100644
--- a/modules/system/system.js
+++ b/modules/system/system.js
@@ -1,4 +1,3 @@
-// $Id: system.js,v 1.41 2010/10/13 13:43:21 dries Exp $
 (function ($) {
 
 /**
@@ -114,19 +113,6 @@ Drupal.behaviors.dateTime = {
   }
 };
 
-/**
- * Show the powered by Drupal image preview
- */
-Drupal.behaviors.poweredByPreview = {
-  attach: function (context, settings) {
-    $('#edit-color, #edit-size').change(function () {
-      var path = settings.basePath + 'misc/' + $('#edit-color').val() + '-' + $('#edit-size').val() + '.png';
-      $('img.powered-by-preview').attr('src', path);
-    });
-  }
-};
-
-
  /**
  * Show/hide settings for page caching depending on whether page caching is
  * enabled or not.
diff --git a/modules/system/system.mail.inc b/modules/system/system.mail.inc
index 14ba64f5105e5bd32bcd8f8df9bd92cc0530a8b2..ef50642c55a9db8c36ceb9a976f5f0d78096a3fc 100644
--- a/modules/system/system.mail.inc
+++ b/modules/system/system.mail.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: system.mail.inc,v 1.2 2010/03/06 12:36:40 dries Exp $
 
 /**
  * @file
diff --git a/modules/system/system.maintenance.css b/modules/system/system.maintenance.css
index 2bfbbb6bc97c46421c8b4001abfd76309f087b6b..5543c2db816e3b6a133f7db08d40c96de96ca7fc 100644
--- a/modules/system/system.maintenance.css
+++ b/modules/system/system.maintenance.css
@@ -1,4 +1,3 @@
-/* $Id: system.maintenance.css,v 1.1 2010/09/19 18:35:42 dries Exp $ */
 
 /**
  * Update styles
diff --git a/modules/system/system.menus-rtl.css b/modules/system/system.menus-rtl.css
index d3d3260e9165cd7c42fb92ec5b251cc2a606c5f2..be85245b2bf4dc2ad9f809fa7d147c5f0bcb5087 100644
--- a/modules/system/system.menus-rtl.css
+++ b/modules/system/system.menus-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: system.menus-rtl.css,v 1.2 2010/09/25 02:28:14 dries Exp $ */
 
 /**
  * @file
diff --git a/modules/system/system.menus.css b/modules/system/system.menus.css
index a2b81b94542971e12eec60a60307cfd92b74e69d..514b029527a7c6949b5775b81986270b899fe106 100644
--- a/modules/system/system.menus.css
+++ b/modules/system/system.menus.css
@@ -1,4 +1,3 @@
-/* $Id: system.menus.css,v 1.3 2010/11/05 01:25:33 dries Exp $ */
 
 /**
  * @file
diff --git a/modules/system/system.messages-rtl.css b/modules/system/system.messages-rtl.css
new file mode 100644
index 0000000000000000000000000000000000000000..445417b08c4644666aa687094d9a730e0fa5b5f2
--- /dev/null
+++ b/modules/system/system.messages-rtl.css
@@ -0,0 +1,13 @@
+
+/**
+ * @file
+ * RTL Styles for system messages.
+ */
+
+div.messages {
+  background-position: 99% 8px;
+  padding: 10px 50px 10px 10px;
+}
+div.messages ul {
+  margin: 0 1em 0 0;
+}
diff --git a/modules/system/system.messages.css b/modules/system/system.messages.css
index e14e3b23f12fe529181e74fd84f6d119ee510f77..ffd4e8efcaafc5f5ea07a7e1148a10b4e4698e47 100644
--- a/modules/system/system.messages.css
+++ b/modules/system/system.messages.css
@@ -1,4 +1,3 @@
-/* $Id: system.messages.css,v 1.1 2010/09/19 18:35:42 dries Exp $ */
 
 /**
  * @file
diff --git a/modules/system/system.module b/modules/system/system.module
index 383dc8a160550c441fa2effc0b2d06737f69c42d..5af9ad4ee1be655849211fe24dd29630942b089f 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: system.module,v 1.1003 2011/01/04 00:56:23 webchick Exp $
 
 /**
  * @file
@@ -295,10 +294,10 @@ function system_element_info() {
     '#theme' => 'page',
     '#theme_wrappers' => array('html'),
   );
-  // By default, we don't want AJAX commands being rendered in the context of an
+  // By default, we don't want Ajax commands being rendered in the context of an
   // HTML page, so we don't provide defaults for #theme or #theme_wrappers.
   // However, modules can set these properties (for example, to provide an HTML
-  // debugging page that displays rather than executes AJAX commands).
+  // debugging page that displays rather than executes Ajax commands).
   $types['ajax'] = array(
     '#header' => TRUE,
     '#commands' => array(),
@@ -1079,7 +1078,7 @@ function _system_batch_theme() {
  * Implements hook_library().
  */
 function system_library() {
-  // Drupal's AJAX framework.
+  // Drupal's Ajax framework.
   $libraries['drupal.ajax'] = array(
     'title' => 'Drupal AJAX',
     'website' => 'http://api.drupal.org/api/drupal/includes--ajax.inc/group/ajax/7',
@@ -2387,9 +2386,14 @@ function _system_rebuild_module_data() {
     drupal_alter('system_info', $modules[$key]->info, $modules[$key], $type);
   }
 
-  // The install profile is required, if it's a valid module.
   if (isset($modules[$profile])) {
+    // The install profile is required, if it's a valid module.
     $modules[$profile]->info['required'] = TRUE;
+    // Add a default distribution name if the profile did not provide one. This
+    // matches the default value used in install_profile_info().
+    if (!isset($modules[$profile]->info['distribution_name'])) {
+      $modules[$profile]->info['distribution_name'] = 'Drupal';
+    }
   }
 
   return $modules;
@@ -2677,7 +2681,7 @@ function system_region_list($theme_key, $show = REGIONS_ALL) {
   // If requested, suppress hidden regions. See block_admin_display_form().
   foreach ($info['regions'] as $name => $label) {
     if ($show == REGIONS_ALL || !isset($info['regions_hidden']) || !in_array($name, $info['regions_hidden'])) {
-      $list[$name] = $label;
+      $list[$name] = t($label);
     }
   }
 
@@ -3451,7 +3455,7 @@ function system_page_alter(&$page) {
  */
 function system_run_automated_cron() {
   // If the site is not fully installed, suppress the automated cron run.
-  // Otherwise it could be triggered prematurely by AJAX requests during
+  // Otherwise it could be triggered prematurely by Ajax requests during
   // installation.
   if (($threshold = variable_get('cron_safe_threshold', DRUPAL_CRON_DEFAULT_THRESHOLD)) > 0 && variable_get('install_task') == 'done') {
     $cron_last = variable_get('cron_last', NULL);
diff --git a/modules/system/system.queue.inc b/modules/system/system.queue.inc
index 3460241d513cf10d172046c241d14a5cd8dc5048..806015c242b6b7c11cd5bd776cd1912ecae11022 100644
--- a/modules/system/system.queue.inc
+++ b/modules/system/system.queue.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: system.queue.inc,v 1.14 2011/01/03 18:03:54 webchick Exp $
 
 /**
  * @file
diff --git a/modules/system/system.test b/modules/system/system.test
index 2043544dd060bbcdb3d67b3d7b75d98cca4a36f1..be4e36698d64c4b973df56ab4337f1517660c201 100644
--- a/modules/system/system.test
+++ b/modules/system/system.test
@@ -1,5 +1,9 @@
 <?php
-// $Id: system.test,v 1.153 2010/12/01 00:23:36 webchick Exp $
+
+/**
+ * @file
+ * Tests for system.module.
+ */
 
 /**
  * Helper class for module test cases.
@@ -1355,7 +1359,7 @@ class SystemThemeFunctionalTest extends DrupalWebTestCase {
   function setUp() {
     parent::setUp();
 
-    $this->admin_user = $this->drupalCreateUser(array('access administration pages', 'view the administration theme', 'administer themes', 'bypass node access'));
+    $this->admin_user = $this->drupalCreateUser(array('access administration pages', 'view the administration theme', 'administer themes', 'bypass node access', 'administer blocks'));
     $this->drupalLogin($this->admin_user);
     $this->node = $this->drupalCreateNode();
   }
@@ -1439,6 +1443,26 @@ class SystemThemeFunctionalTest extends DrupalWebTestCase {
     $this->drupalGet('node/add');
     $this->assertRaw('themes/bartik', t('Site default theme used on the add content page.'));
   }
+
+  /**
+   * Test switching the default theme.
+   */
+  function testSwitchDefaultTheme() {
+    // Enable "stark" and set it as the default theme.
+    theme_enable(array('stark'));
+    $this->drupalGet('admin/appearance');
+    $this->clickLink(t('Set default'), 1);
+    $this->assertTrue(variable_get('theme_default', '') == 'stark', t('Site default theme switched successfully.'));
+
+    // Test the default theme on the secondary links (blocks admin page).
+    $this->drupalGet('admin/structure/block');
+    $this->assertText('Stark(' . t('active tab') . ')', t('Default local task on blocks admin page is the default theme.'));
+    // Switch back to Bartik and test again to test that the menu cache is cleared.
+    $this->drupalGet('admin/appearance');
+    $this->clickLink(t('Set default'), 0);
+    $this->drupalGet('admin/structure/block');
+    $this->assertText('Bartik(' . t('active tab') . ')', t('Default local task on blocks admin page has changed.'));
+  }
 }
 
 
@@ -1571,13 +1595,13 @@ class TokenReplaceTestCase extends DrupalWebTestCase {
 
     // Test that the clear parameter cleans out non-existent tokens.
     $result = token_replace($source, array('node' => $node), array('language' => $language, 'clear' => TRUE));
-    $result = $this->assertFalse(strcmp($target, $result), 'Valid tokens replaced while invalid tokens cleared out.');
+    $result = $this->assertEqual($target, $result, 'Valid tokens replaced while invalid tokens cleared out.');
 
     // Test without using the clear parameter (non-existant token untouched).
     $target .= '[user:name]';
     $target .= '[bogus:token]';
     $result = token_replace($source, array('node' => $node), array('language' => $language));
-    $this->assertFalse(strcmp($target, $result), 'Valid tokens replaced while invalid tokens ignored.');
+    $this->assertEqual($target, $result, 'Valid tokens replaced while invalid tokens ignored.');
 
     // Check that the results of token_generate are sanitized properly. This does NOT
     // test the cleanliness of every token -- just that the $sanitize flag is being
@@ -1585,10 +1609,39 @@ class TokenReplaceTestCase extends DrupalWebTestCase {
     // token, [node:title].
     $raw_tokens = array('title' => '[node:title]');
     $generated = token_generate('node', $raw_tokens, array('node' => $node));
-    $this->assertFalse(strcmp($generated['[node:title]'], check_plain($node->title)), t('Token sanitized.'));
+    $this->assertEqual($generated['[node:title]'], check_plain($node->title), t('Token sanitized.'));
 
     $generated = token_generate('node', $raw_tokens, array('node' => $node), array('sanitize' => FALSE));
-    $this->assertFalse(strcmp($generated['[node:title]'], $node->title), t('Unsanitized token generated properly.'));
+    $this->assertEqual($generated['[node:title]'], $node->title, t('Unsanitized token generated properly.'));
+  }
+
+  /**
+   * Test whether token-replacement works in various contexts.
+   */
+  function testSystemTokenRecognition() {
+    global $language;
+
+    // Generate prefixes and suffixes for the token context.
+    $tests = array(
+      array('prefix' => 'this is the ', 'suffix' => ' site'),
+      array('prefix' => 'this is the', 'suffix' => 'site'),
+      array('prefix' => '[', 'suffix' => ']'),
+      array('prefix' => '', 'suffix' => ']]]'),
+      array('prefix' => '[[[', 'suffix' => ''),
+      array('prefix' => ':[:', 'suffix' => '--]'),
+      array('prefix' => '-[-', 'suffix' => ':]:'),
+      array('prefix' => '[:', 'suffix' => ']'),
+      array('prefix' => '[site:', 'suffix' => ':name]'),
+      array('prefix' => '[site:', 'suffix' => ']'),
+    );
+
+    // Check if the token is recognized in each of the contexts.
+    foreach ($tests as $test) {
+      $input = $test['prefix'] . '[site:name]' . $test['suffix'];
+      $expected = $test['prefix'] . 'Drupal' . $test['suffix'];
+      $output = token_replace($input, array(), array('language' => $language));
+      $this->assertTrue($output == $expected, t('Token recognized in string %string', array('%string' => $input)));
+    }
   }
 
   /**
@@ -1620,7 +1673,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase {
 
     foreach ($tests as $input => $expected) {
       $output = token_replace($input, array(), array('language' => $language));
-      $this->assertFalse(strcmp($output, $expected), t('Sanitized system site information token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, t('Sanitized system site information token %token replaced.', array('%token' => $input)));
     }
 
     // Generate and test unsanitized tokens.
@@ -1629,7 +1682,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase {
 
     foreach ($tests as $input => $expected) {
       $output = token_replace($input, array(), array('language' => $language, 'sanitize' => FALSE));
-      $this->assertFalse(strcmp($output, $expected), t('Unsanitized system site information token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, t('Unsanitized system site information token %token replaced.', array('%token' => $input)));
     }
   }
 
@@ -1656,7 +1709,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase {
 
     foreach ($tests as $input => $expected) {
       $output = token_replace($input, array('date' => $date), array('language' => $language));
-      $this->assertFalse(strcmp($output, $expected), t('Date token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, t('Date token %token replaced.', array('%token' => $input)));
     }
   }
 }
@@ -2145,3 +2198,37 @@ class SystemAuthorizeCase extends DrupalWebTestCase {
     $this->assertText('System Test Username');
   }
 }
+
+/**
+ * Test the handling of requests containing 'index.php'.
+ */
+class SystemIndexPhpTest extends DrupalWebTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Index.php handling',
+      'description' => "Test the handling of requests containing 'index.php'.",
+      'group' => 'System',
+    );
+  }
+
+  function setUp() {
+    parent::setUp();
+  }
+
+  /**
+   * Test index.php handling.
+   */
+  function testIndexPhpHandling() {
+    $index_php = $GLOBALS['base_url'] . '/index.php';
+
+    $this->drupalGet($index_php, array('external' => TRUE));
+    $this->assertResponse(200, t('Make sure index.php returns a valid page.'));
+
+    $this->drupalGet($index_php, array('external' => TRUE, 'query' => array('q' => 'user')));
+    $this->assertResponse(200, t('Make sure index.php?q=user returns a valid page.'));
+
+    $this->drupalGet($index_php .'/user', array('external' => TRUE));
+    $this->assertResponse(404, t("Make sure index.php/user returns a 'page not found'."));
+  }
+}
+
diff --git a/modules/system/system.theme-rtl.css b/modules/system/system.theme-rtl.css
index 3c2794f50337adde93362650f3d5e4eaecbe84da..0cd7fa6431f33c0bbefc258b8f87f9805579756f 100644
--- a/modules/system/system.theme-rtl.css
+++ b/modules/system/system.theme-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: system.theme-rtl.css,v 1.2 2010/09/25 02:28:14 dries Exp $ */
 
 /**
  * @file
diff --git a/modules/system/system.theme.css b/modules/system/system.theme.css
index 09f249c8fe6d5369c1ba3bfc91130d82a46b84fc..73cebee739f1c0e4f9391aa7a67187969009863a 100644
--- a/modules/system/system.theme.css
+++ b/modules/system/system.theme.css
@@ -1,4 +1,3 @@
-/* $Id: system.theme.css,v 1.3 2010/09/27 01:12:45 dries Exp $ */
 
 /**
  * @file
diff --git a/modules/system/system.tokens.inc b/modules/system/system.tokens.inc
index d07c4d521c6ec63010b191ec8be78ea8904de308..27d7dfdb0745023056f0060513376fd553d09d4f 100644
--- a/modules/system/system.tokens.inc
+++ b/modules/system/system.tokens.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: system.tokens.inc,v 1.13 2010/10/28 01:33:41 dries Exp $
 
 /**
  * @file
diff --git a/modules/system/system.updater.inc b/modules/system/system.updater.inc
index f3d6fb97734a6f175c8c35ff5e08ebf00bacc2ef..0df1ad955c8ed6b511f49480ba89be090d9ac629 100644
--- a/modules/system/system.updater.inc
+++ b/modules/system/system.updater.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: system.updater.inc,v 1.12 2011/01/04 03:06:24 webchick Exp $
 
 /**
  * @file
diff --git a/modules/system/theme.api.php b/modules/system/theme.api.php
index 0699f53a5f5af75772a08bdaac4d498475a79418..7fee81cb6708abca509c021430e1a136173bd5a3 100644
--- a/modules/system/theme.api.php
+++ b/modules/system/theme.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: theme.api.php,v 1.5 2011/01/03 18:03:54 webchick Exp $
 
 /**
  * @defgroup themeable Default theme implementations
@@ -100,6 +99,8 @@ function hook_form_system_theme_settings_alter(&$form, &$form_state) {
  * It is called for all invocations of theme(), to allow modules to add to
  * or override variables for all theme hooks.
  *
+ * For more detailed information, see theme().
+ *
  * @param $variables
  *   The variables array (modify in place).
  * @param $hook
@@ -146,6 +147,8 @@ function hook_preprocess(&$variables, $hook) {
  * hook. It should only be used if a module needs to override or add to the
  * theme preprocessing for a theme hook it didn't define.
  *
+ * For more detailed information, see theme().
+ *
  * @param $variables
  *   The variables array (modify in place).
  */
@@ -162,6 +165,8 @@ function hook_preprocess_HOOK(&$variables) {
  * It is called for all invocations of theme(), to allow modules to add to
  * or override variables for all theme hooks.
  *
+ * For more detailed information, see theme().
+ *
  * @param $variables
  *   The variables array (modify in place).
  * @param $hook
@@ -188,6 +193,8 @@ function hook_process(&$variables, $hook) {
  * hook. It should only be used if a module needs to override or add to the
  * theme processing for a theme hook it didn't define.
  *
+ * For more detailed information, see theme().
+ *
  * @param $variables
  *   The variables array (modify in place).
  */
diff --git a/modules/taxonomy/taxonomy-term.tpl.php b/modules/taxonomy/taxonomy-term.tpl.php
index ec19b36e64de36f7489f5d1d8b80b9551f50190e..b515a9be1b2278038cd55d67a8836d52fa6ea6da 100644
--- a/modules/taxonomy/taxonomy-term.tpl.php
+++ b/modules/taxonomy/taxonomy-term.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: taxonomy-term.tpl.php,v 1.1 2010/02/10 06:28:10 webchick Exp $
 
 /**
  * @file
diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc
index ae5e85e499eb0470bccca71cf62ffa113808cf6b..d83f5d367536532fd6e762ab5db1f6d10044c8e8 100644
--- a/modules/taxonomy/taxonomy.admin.inc
+++ b/modules/taxonomy/taxonomy.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: taxonomy.admin.inc,v 1.116 2010/11/20 06:49:47 webchick Exp $
 
 /**
  * @file
@@ -100,10 +99,11 @@ function theme_taxonomy_overview_vocabularies($variables) {
 }
 
 /**
- * Display form for adding and editing vocabularies.
+ * Form builder for the vocabulary editing form.
  *
  * @ingroup forms
  * @see taxonomy_form_vocabulary_submit()
+ * @see taxonomy_form_vocabulary_validate()
  */
 function taxonomy_form_vocabulary($form, &$form_state, $edit = array()) {
   // During initial form build, add the entity to the form state for use
@@ -147,7 +147,7 @@ function taxonomy_form_vocabulary($form, &$form_state, $edit = array()) {
   $form['machine_name'] = array(
     '#type' => 'machine_name',
     '#default_value' => $vocabulary->machine_name,
-    '#maxlength' => 21,
+    '#maxlength' => 255,
     '#machine_name' => array(
       'exists' => 'taxonomy_vocabulary_machine_name_load',
     ),
@@ -175,11 +175,38 @@ function taxonomy_form_vocabulary($form, &$form_state, $edit = array()) {
     $form['vid'] = array('#type' => 'value', '#value' => $vocabulary->vid);
     $form['module'] = array('#type' => 'value', '#value' => $vocabulary->module);
   }
+  $form['#validate'][] = 'taxonomy_form_vocabulary_validate';
+
   return $form;
 }
 
 /**
- * Accept the form submission for a vocabulary and save the results.
+ * Form validation handler for taxonomy_form_vocabulary().
+ *
+ * Makes sure that the machine name of the vocabulary is not in the
+ * disallowed list (names that conflict with menu items, such as 'list'
+ * and 'add').
+ *
+ * @see taxonomy_form_vocabulary()
+ * @see taxonomy_form_vocabulary_submit()
+ */
+function taxonomy_form_vocabulary_validate($form, &$form_state) {
+  // During the deletion there is no 'machine_name' key
+  if (isset($form_state['values']['machine_name'])) {
+    // Do not allow machine names to conflict with taxonomy path arguments.
+    $machine_name = $form_state['values']['machine_name'];
+    $disallowed = array('add', 'list');
+    if (in_array($machine_name, $disallowed)) {
+      form_set_error('machine_name', t('The machine-readable name cannot be "add" or "list".'));
+    }
+  }
+}
+
+/**
+ * Form submission handler for taxonomy_form_vocabulary().
+ *
+ * @see taxonomy_form_vocabulary()
+ * @see taxonomy_form_vocabulary_validate()
  */
 function taxonomy_form_vocabulary_submit($form, &$form_state) {
   if ($form_state['clicked_button']['#value'] == t('Delete')) {
diff --git a/modules/taxonomy/taxonomy.api.php b/modules/taxonomy/taxonomy.api.php
index f4d4a03491704fa757d6997ccfe0ab4bc09837c7..cb778c9a764f9ecd1b55b79e12013ee85c00ee28 100644
--- a/modules/taxonomy/taxonomy.api.php
+++ b/modules/taxonomy/taxonomy.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: taxonomy.api.php,v 1.11 2010/10/23 15:30:34 webchick Exp $
 
 /**
  * @file
diff --git a/modules/taxonomy/taxonomy.css b/modules/taxonomy/taxonomy.css
index 42408501ce422cfd6c6400026688ffaa5e54853a..36cd641bec2e46a36491b88467d3b43097374282 100644
--- a/modules/taxonomy/taxonomy.css
+++ b/modules/taxonomy/taxonomy.css
@@ -1,4 +1,3 @@
-/* $Id: taxonomy.css,v 1.5 2008/01/25 21:20:26 goba Exp $ */
 
 tr.taxonomy-term-preview {
   background-color: #EEE;
diff --git a/modules/taxonomy/taxonomy.info b/modules/taxonomy/taxonomy.info
index bdb558cbdda09c3ba15bb8d0b2f225498ac218d9..cf57006a6dc91c4758fb7bab117051ae73aab051 100644
--- a/modules/taxonomy/taxonomy.info
+++ b/modules/taxonomy/taxonomy.info
@@ -1,4 +1,3 @@
-; $Id: taxonomy.info,v 1.13 2010/12/20 19:59:43 webchick Exp $
 name = Taxonomy
 description = Enables the categorization of content.
 package = Core
@@ -9,8 +8,8 @@ files[] = taxonomy.module
 files[] = taxonomy.test
 configure = admin/structure/taxonomy
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/taxonomy/taxonomy.install b/modules/taxonomy/taxonomy.install
index d81d83709c48ca23469cb62f410b855e81aed27a..f28ffedf494c30c32b18ebd9b91fd4da22a07cda 100644
--- a/modules/taxonomy/taxonomy.install
+++ b/modules/taxonomy/taxonomy.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: taxonomy.install,v 1.56 2010/12/14 19:50:05 dries Exp $
 
 /**
  * @file
@@ -567,8 +566,12 @@ function taxonomy_update_7005(&$sandbox) {
   // of term references stored so far for the current revision, which
   // provides the delta value for each term reference data insert. The
   // deltas are reset for each new revision.
-
-  $field_info = _update_7000_field_read_fields();
+  
+  $conditions = array(
+    'type' => 'taxonomy_term_reference',
+    'deleted' => 0,
+  );
+  $field_info = _update_7000_field_read_fields($conditions, 'field_name');
 
   // This is a multi-pass update. On the first call we need to initialize some
   // variables.
diff --git a/modules/taxonomy/taxonomy.js b/modules/taxonomy/taxonomy.js
index 8f08b77e1fe8cf4eb26ba5ddaa06dfc086d803ae..cc9cdf7a61c8ef23bf785a4eedffd043be3ed22d 100644
--- a/modules/taxonomy/taxonomy.js
+++ b/modules/taxonomy/taxonomy.js
@@ -1,4 +1,3 @@
-// $Id: taxonomy.js,v 1.7 2010/01/04 12:04:07 dries Exp $
 (function ($) {
 
 /**
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index d3250c12e24d7fd9328190cf72ab7c49604a41dd..50d2fd6083407883c271f9567bb5b14a28b79c72 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: taxonomy.module,v 1.625 2011/01/03 18:03:54 webchick Exp $
 
 /**
  * @file
@@ -683,8 +682,8 @@ function taxonomy_term_view($term, $view_mode = 'full', $langcode = NULL) {
     $langcode = $GLOBALS['language_content']->language;
   }
 
-  field_attach_prepare_view('taxonomy_term', array($term->tid => $term), $view_mode);
-  entity_prepare_view('taxonomy_term', array($term->tid => $term));
+  field_attach_prepare_view('taxonomy_term', array($term->tid => $term), $view_mode, $langcode);
+  entity_prepare_view('taxonomy_term', array($term->tid => $term), $langcode);
 
   $build = array(
     '#theme' => 'taxonomy_term',
@@ -695,12 +694,15 @@ function taxonomy_term_view($term, $view_mode = 'full', $langcode = NULL) {
 
   $build += field_attach_view('taxonomy_term', $term, $view_mode, $langcode);
 
-  $build['description'] = array(
-    '#markup' => check_markup($term->description, $term->format, '', TRUE),
-    '#weight' => 0,
-    '#prefix' => '<div class="taxonomy-term-description">',
-    '#suffix' => '</div>',
-  );
+  // Add term description if the term has one.
+  if (!empty($term->description)) {
+    $build['description'] = array(
+      '#markup' => check_markup($term->description, $term->format, '', TRUE),
+      '#weight' => 0,
+      '#prefix' => '<div class="taxonomy-term-description">',
+      '#suffix' => '</div>',
+    );
+  }
 
   $build['#attached']['css'][] = drupal_get_path('module', 'taxonomy') . '/taxonomy.css';
 
@@ -728,6 +730,7 @@ function template_preprocess_taxonomy_term(&$variables) {
   $variables = array_merge((array) $term, $variables);
 
   // Helpful $content variable for templates.
+  $variables['content'] = array();
   foreach (element_children($variables['elements']) as $key) {
     $variables['content'][$key] = $variables['elements'][$key];
   }
@@ -747,7 +750,7 @@ function template_preprocess_taxonomy_term(&$variables) {
 }
 
 /**
- * Returns whether the current page is the page of the passed in term.
+ * Returns whether the current page is the page of the passed-in term.
  *
  * @param $term
  *   A term object.
@@ -1313,7 +1316,7 @@ function taxonomy_field_validate($entity_type, $entity, $field, $instance, $lang
       if (!$validate) {
         $errors[$field['field_name']][$langcode][$delta][] = array(
           'error' => 'taxonomy_term_reference_illegal_value',
-          'message' => t('%name: illegal value.', array('%name' => t($instance['label']))),
+          'message' => t('%name: illegal value.', array('%name' => $instance['label'])),
         );
       }
     }
@@ -1467,11 +1470,12 @@ function taxonomy_field_formatter_prepare_view($entity_type, $entities, $field,
  *
  * @param $term
  *   A term object.
+ *
  * @return
  *   The term name to be used as the page title.
  */
 function taxonomy_term_title($term) {
-  return check_plain($term->name);
+  return $term->name;
 }
 
 /**
diff --git a/modules/taxonomy/taxonomy.pages.inc b/modules/taxonomy/taxonomy.pages.inc
index 59dad6d606ddd4ec09288e4caaba13d183514e3a..3aed29011eabafe229809e4570a2cbd32722919c 100644
--- a/modules/taxonomy/taxonomy.pages.inc
+++ b/modules/taxonomy/taxonomy.pages.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: taxonomy.pages.inc,v 1.57 2010/11/23 02:56:10 dries Exp $
 
 /**
  * @file
@@ -32,14 +31,12 @@ function taxonomy_term_page($term) {
   drupal_add_feed('taxonomy/term/' . $term->tid . '/feed', 'RSS - ' . $term->name);
 
   $build = array();
-  // Add term heading if the term has a description
-  if (!empty($term->description)) {
-    $build['term_heading'] = array(
-      '#prefix' => '<div class="term-listing-heading">',
-      '#suffix' => '</div>',
-      'term' => taxonomy_term_view($term, 'full'),
-    );
-  }
+
+  $build['term_heading'] = array(
+    '#prefix' => '<div class="term-listing-heading">',
+    '#suffix' => '</div>',
+    'term' => taxonomy_term_view($term, 'full'),
+  );
 
   if ($nids = taxonomy_select_nodes($term->tid, TRUE, variable_get('default_nodes_main', 10))) {
     $nodes = node_load_multiple($nids);
diff --git a/modules/taxonomy/taxonomy.test b/modules/taxonomy/taxonomy.test
index a561a403b5dbb12a8fef82f0943f15bbc7533210..1fd47f5ea990ddd8811b8fca0c8053f8a72de04c 100644
--- a/modules/taxonomy/taxonomy.test
+++ b/modules/taxonomy/taxonomy.test
@@ -1,9 +1,8 @@
 <?php
-// $Id: taxonomy.test,v 1.99 2010/12/07 05:20:08 webchick Exp $
 
 /**
  * @file
- * Tests for Taxonomy module.
+ * Tests for taxonomy.module.
  */
 
 /**
@@ -649,12 +648,12 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase {
     $this->assertText($edit['description[value]'], t('The randomly generated term description is present.'));
 
     // Did this page request display a 'term-listing-heading'?
-    $this->assertPattern('|class="term-listing-heading"|', 'Term page displayed the term description element.');
+    $this->assertPattern('|class="taxonomy-term-description"|', 'Term page displayed the term description element.');
     // Check that it does NOT show a description when description is blank.
     $term->description = '';
     taxonomy_term_save($term);
     $this->drupalGet('taxonomy/term/' . $term->tid);
-    $this->assertNoPattern('|class="term-listing-heading"|', 'Term page did not display the term description when description was blank.');
+    $this->assertNoPattern('|class="taxonomy-term-description"|', 'Term page did not display the term description when description was blank.');
 
     // Check that the term feed page is working.
     $this->drupalGet('taxonomy/term/' . $term->tid . '/feed');
@@ -1108,7 +1107,7 @@ class TaxonomyTokenReplaceTestCase extends TaxonomyWebTestCase {
 
     foreach ($tests as $input => $expected) {
       $output = token_replace($input, array('term' => $term1), array('language' => $language));
-      $this->assertFalse(strcmp($output, $expected), t('Sanitized taxonomy term token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, t('Sanitized taxonomy term token %token replaced.', array('%token' => $input)));
     }
 
     // Generate and test sanitized tokens for term2.
@@ -1128,7 +1127,7 @@ class TaxonomyTokenReplaceTestCase extends TaxonomyWebTestCase {
 
     foreach ($tests as $input => $expected) {
       $output = token_replace($input, array('term' => $term2), array('language' => $language));
-      $this->assertFalse(strcmp($output, $expected), t('Sanitized taxonomy term token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, t('Sanitized taxonomy term token %token replaced.', array('%token' => $input)));
     }
 
     // Generate and test unsanitized tokens.
@@ -1139,7 +1138,7 @@ class TaxonomyTokenReplaceTestCase extends TaxonomyWebTestCase {
 
     foreach ($tests as $input => $expected) {
       $output = token_replace($input, array('term' => $term2), array('language' => $language, 'sanitize' => FALSE));
-      $this->assertFalse(strcmp($output, $expected), t('Unsanitized taxonomy term token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, t('Unsanitized taxonomy term token %token replaced.', array('%token' => $input)));
     }
 
     // Generate and test sanitized tokens.
@@ -1155,7 +1154,7 @@ class TaxonomyTokenReplaceTestCase extends TaxonomyWebTestCase {
 
     foreach ($tests as $input => $expected) {
       $output = token_replace($input, array('vocabulary' => $this->vocabulary), array('language' => $language));
-      $this->assertFalse(strcmp($output, $expected), t('Sanitized taxonomy vocabulary token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, t('Sanitized taxonomy vocabulary token %token replaced.', array('%token' => $input)));
     }
 
     // Generate and test unsanitized tokens.
@@ -1164,7 +1163,7 @@ class TaxonomyTokenReplaceTestCase extends TaxonomyWebTestCase {
 
     foreach ($tests as $input => $expected) {
       $output = token_replace($input, array('vocabulary' => $this->vocabulary), array('language' => $language, 'sanitize' => FALSE));
-      $this->assertFalse(strcmp($output, $expected), t('Unsanitized taxonomy vocabulary token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, t('Unsanitized taxonomy vocabulary token %token replaced.', array('%token' => $input)));
     }
   }
 }
diff --git a/modules/taxonomy/taxonomy.tokens.inc b/modules/taxonomy/taxonomy.tokens.inc
index 6f1be1171deda3e0f07c6760bf72a9add5f61f0e..f8ae4576d70e82f038eaf56d93f7e6e791c017a2 100644
--- a/modules/taxonomy/taxonomy.tokens.inc
+++ b/modules/taxonomy/taxonomy.tokens.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: taxonomy.tokens.inc,v 1.10 2010/11/14 00:25:44 dries Exp $
 
 /**
  * @file
diff --git a/modules/toolbar/toolbar-rtl.css b/modules/toolbar/toolbar-rtl.css
new file mode 100644
index 0000000000000000000000000000000000000000..acbc98f82873223375b755624f574b3ea3cbdd49
--- /dev/null
+++ b/modules/toolbar/toolbar-rtl.css
@@ -0,0 +1,41 @@
+
+#toolbar,
+#toolbar * {
+  text-align: right;
+}
+#toolbar ul li {
+  float: right;
+}
+#toolbar ul li a {
+  display: inline-block;
+  float: none;
+  zoom: 1;
+}
+#toolbar div.toolbar-menu {
+  padding: 5px 50px 5px 50px;
+}
+#toolbar-user {
+  float: left;
+}
+#toolbar ul#toolbar-user li {
+  float: none;
+  display: inline;
+}
+#toolbar-menu {
+  float: none;
+}
+#toolbar-home {
+  float: right;
+}
+#toolbar ul li.home a {
+  position: absolute;
+  right: 10px;
+}
+#toolbar div.toolbar-menu a.toggle {
+  left: 10px;
+  right: auto;
+}
+* html #toolbar {
+  left: 0;
+  padding-left: 0;
+}
diff --git a/modules/toolbar/toolbar.css b/modules/toolbar/toolbar.css
index b1ce4d8b2a04671addbf8f1aba9e8f7a3dfe017c..cbf3c14c8fe330ab42ee2ae5187f6d8e8f554f7d 100644
--- a/modules/toolbar/toolbar.css
+++ b/modules/toolbar/toolbar.css
@@ -1,9 +1,7 @@
-/* $Id: toolbar.css,v 1.27 2011/01/03 07:04:48 webchick Exp $ */
 
 body.toolbar {
   padding-top: 2.2em;
 }
-
 body.toolbar-drawer {
   padding-top: 5.3em;
 }
@@ -14,15 +12,15 @@ body.toolbar-drawer {
  */
 #toolbar,
 #toolbar * {
-  margin: 0;
-  padding: 0;
   border: 0;
-  outline: 0;
   font-size: 100%;
-  vertical-align: baseline;
   line-height: inherit;
-  text-align: left;
   list-style: none;
+  margin: 0;
+  outline: 0;
+  padding: 0;
+  text-align: left; /* LTR */
+  vertical-align: baseline;
 }
 
 /**
@@ -32,37 +30,34 @@ body.toolbar-drawer {
  * across different themes, while still allowing browsers to resize the text.
  */
 #toolbar {
-  font: normal small "Lucida Grande", Verdana, sans-serif;
   background: #666;
   color: #ccc;
-  position: fixed;
-  top: 0;
+  font: normal small "Lucida Grande", Verdana, sans-serif;
   left: 0;
-  right: 0;
   margin: 0 -20px;
   padding: 0 20px;
-  z-index: 600;
+  position: fixed;
+  right: 0;
+  top: 0;
   -moz-box-shadow: 0 3px 20px #000;
   -webkit-box-shadow: 0 3px 20px #000;
   box-shadow: 0 3px 20px #000;
   filter: progid:DXImageTransform.Microsoft.Shadow(color=#000000, direction='180', strength='10');
   -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(color=#000000, direction='180', strength='10')";
+  z-index: 600;
 }
-
 #toolbar div.collapsed {
   display: none;
   visibility: hidden;
 }
-
 #toolbar a {
   color: #fff;
   font-size: .846em;
   text-decoration: none;
 }
-
 #toolbar ul li,
 #toolbar ul li a {
-  float: left;
+  float: left; /* LTR */
 }
 
 /**
@@ -71,72 +66,64 @@ body.toolbar-drawer {
 #toolbar div.toolbar-menu {
   background: #000;
   line-height: 20px;
-  padding: 5px 50px 5px 10px;
+  padding: 5px 50px 5px 10px; /* LTR */
   position: relative;
 }
-
 #toolbar-home a span {
-  vertical-align: text-bottom;
-  width: 11px;
-  height: 14px;
-  display: block;
   background: url(toolbar.png) no-repeat 0 -45px;
-  text-indent: -9999px;
+  display: block;
+  height: 14px;
   margin: 3px 0px;
+  text-indent: -9999px;
+  vertical-align: text-bottom;
+  width: 11px;
 }
-
 #toolbar-user {
-  float: right;
+  float: right; /* LTR */
 }
-
 #toolbar-menu {
-  float: left;
+  float: left; /* LTR */
 }
-
 #toolbar div.toolbar-menu a.toggle {
-  position: absolute;
-  right: 10px;
+  background: url(toolbar.png) 0 -20px no-repeat;
   bottom: 0;
   cursor: pointer;
-  background: url(toolbar.png) 0 -20px no-repeat;
-  text-indent: -9999px;
+  height: 25px;
   overflow: hidden;
+  position: absolute;
+  right: 10px; /* LTR */
+  text-indent: -9999px;
   width: 25px;
-  height: 25px;
 }
 #toolbar div.toolbar-menu a.toggle:focus,
 #toolbar div.toolbar-menu a.toggle:hover {
-background-position:  -50px -20px;
+  background-position:  -50px -20px;
 }
-
 #toolbar div.toolbar-menu a.toggle-active {
   background-position:  -25px -20px;
 }
 #toolbar div.toolbar-menu a.toggle-active.toggle:focus,
 #toolbar div.toolbar-menu a.toggle-active.toggle:hover {
-background-position:  -75px -20px;
+  background-position:  -75px -20px;
 }
-
 #toolbar div.toolbar-menu ul li a {
+  padding: 0 10px;
   -moz-border-radius: 10px;
   -webkit-border-radius: 10px;
   border-radius: 10px;
-  padding: 0 10px;
 }
-
 #toolbar div.toolbar-menu ul li a:focus,
 #toolbar div.toolbar-menu ul li a:hover,
 #toolbar div.toolbar-menu ul li a:active,
 #toolbar div.toolbar-menu ul li a.active:focus {
   background: #444;
 }
-
 #toolbar div.toolbar-menu ul li a.active:hover,
 #toolbar div.toolbar-menu ul li a.active:active,
 #toolbar div.toolbar-menu ul li a.active,
 #toolbar div.toolbar-menu ul li.active-trail a {
-  text-shadow: #333 0 1px 0;
   background: url(toolbar.png) 0 0 repeat-x;
+  text-shadow: #333 0 1px 0;
 }
 
 /**
@@ -154,10 +141,10 @@ background-position:  -75px -20px;
  * it with position:absolute; toolbar needs its z-index to stay above overlay.
  */
 * html #toolbar {
-  position: absolute;
+  left: -20px;
   margin: 0;
   padding-right: 0;
-  left: -20px;
+  position: absolute;
   right: 0;
   width: 100%;
 }
diff --git a/modules/toolbar/toolbar.info b/modules/toolbar/toolbar.info
index 4149ad6d3b6b493c7a3fd859ce92f4a59e74bf54..e168fd72ffd8baa2e4b844baaf46680e175e2a68 100644
--- a/modules/toolbar/toolbar.info
+++ b/modules/toolbar/toolbar.info
@@ -1,12 +1,11 @@
-; $Id: toolbar.info,v 1.5 2010/12/20 19:59:43 webchick Exp $
 name = Toolbar
 description = Provides a toolbar that shows the top-level administration menu items and links from other modules.
 core = 7.x
 package = Core
 version = VERSION
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/toolbar/toolbar.js b/modules/toolbar/toolbar.js
index c2a9cafe51d8f565b0d7fb63c1faf91557975c3d..5b61634bbdee0511f684307710bf95c12d404c55 100644
--- a/modules/toolbar/toolbar.js
+++ b/modules/toolbar/toolbar.js
@@ -1,4 +1,3 @@
-// $Id: toolbar.js,v 1.20 2010/12/01 07:05:26 webchick Exp $
 (function ($) {
 
 Drupal.toolbar = Drupal.toolbar || {};
diff --git a/modules/toolbar/toolbar.module b/modules/toolbar/toolbar.module
index 3b86d61a5fb1d9f895d81ff806932c4ee468afd8..61ae648ad5f172d992c6c6edaedd1487138642e6 100644
--- a/modules/toolbar/toolbar.module
+++ b/modules/toolbar/toolbar.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: toolbar.module,v 1.49 2010/12/15 03:04:38 webchick Exp $
 
 /**
  * @file
@@ -96,7 +95,7 @@ function theme_toolbar_toggle($variables) {
     $toggle_text = t('Hide shortcuts');
     $variables['attributes']['class'][] = 'toggle-active';
   }
-  return '<a href="' . url('toolbar/toggle', array('query' => drupal_get_destination())) . '" title="' . $toggle_text . '"' .  drupal_attributes($variables['attributes']) . '>' . $toggle_text . '</a>';
+  return l($toggle_text, 'toolbar/toggle', array('query' => drupal_get_destination(), 'attributes' => array('title' => $toggle_text) + $variables['attributes']));
 }
 
 /**
diff --git a/modules/toolbar/toolbar.tpl.php b/modules/toolbar/toolbar.tpl.php
index d229426734d8ff8deb780f671e74e3065ae5be03..1df0cf03bf2306bcce7d1728b7aa1187d53b67bd 100644
--- a/modules/toolbar/toolbar.tpl.php
+++ b/modules/toolbar/toolbar.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: toolbar.tpl.php,v 1.11 2010/05/23 18:23:32 dries Exp $
 
 /**
  * @file
diff --git a/modules/tracker/tracker.css b/modules/tracker/tracker.css
index 0e91826f1feaa7de6e76930b2fe931f607da0a60..d3531c469ff420a52ec27c9a7ae4e9857adf29bf 100644
--- a/modules/tracker/tracker.css
+++ b/modules/tracker/tracker.css
@@ -1,4 +1,3 @@
-/* $Id: tracker.css,v 1.2 2009/07/02 04:27:23 webchick Exp $ */
 
 .page-tracker td.replies {
   text-align: center;
diff --git a/modules/tracker/tracker.info b/modules/tracker/tracker.info
index 9332162ab12d261c1e94853595d86a913df8067b..d640655b81f41d8fedff384e20cdc6ae3444d368 100644
--- a/modules/tracker/tracker.info
+++ b/modules/tracker/tracker.info
@@ -1,4 +1,3 @@
-; $Id: tracker.info,v 1.11 2010/12/20 19:59:43 webchick Exp $
 name = Tracker
 description = Enables tracking of recent content for users.
 dependencies[] = comment
@@ -7,8 +6,8 @@ version = VERSION
 core = 7.x
 files[] = tracker.test
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/tracker/tracker.install b/modules/tracker/tracker.install
index 3823542344b0024fbf45478ee460315542a7a720..244f53778b062e8d0a66074750e3e98a8df8a505 100644
--- a/modules/tracker/tracker.install
+++ b/modules/tracker/tracker.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: tracker.install,v 1.6 2011/01/02 17:26:39 webchick Exp $
 
 /**
  * Implements hook_uninstall().
diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module
index 5f410214601c368dee1335fd724019412af84540..227cf7209a36468ad6584a55021f4134b44cd68c 100644
--- a/modules/tracker/tracker.module
+++ b/modules/tracker/tracker.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: tracker.module,v 1.175 2010/12/28 18:39:23 webchick Exp $
 
 /**
  * @file
diff --git a/modules/tracker/tracker.pages.inc b/modules/tracker/tracker.pages.inc
index fab5c94784d659d9d9271bd040c2ad958ff1226c..7b1e946f31d9c0624f3181bda5cd7e57c6a8a281 100644
--- a/modules/tracker/tracker.pages.inc
+++ b/modules/tracker/tracker.pages.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: tracker.pages.inc,v 1.32 2010/07/30 02:47:28 dries Exp $
 
 /**
  * @file
diff --git a/modules/tracker/tracker.test b/modules/tracker/tracker.test
index 6ff3712c74f2ab2e004f00709c4231d74ddd0935..3cc227eae178dedba2d16e7f987e7d3121aa9ce5 100644
--- a/modules/tracker/tracker.test
+++ b/modules/tracker/tracker.test
@@ -1,5 +1,9 @@
 <?php
-// $Id: tracker.test,v 1.22 2010/12/28 18:39:23 webchick Exp $
+
+/**
+ * @file
+ * Tests for tracker.module.
+ */
 
 class TrackerTest extends DrupalWebTestCase {
   protected $user;
diff --git a/modules/translation/tests/translation_test.info b/modules/translation/tests/translation_test.info
index 646007e6a735370daed7d61b54cc83556f1f8c26..88021e6a5262f0bf9576956f07091a623599da17 100644
--- a/modules/translation/tests/translation_test.info
+++ b/modules/translation/tests/translation_test.info
@@ -1,4 +1,3 @@
-; $Id: translation_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = "Content Translation Test"
 description = "Support module for the content translation tests."
 core = 7.x
@@ -6,8 +5,8 @@ package = Testing
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/translation/tests/translation_test.module b/modules/translation/tests/translation_test.module
index ef02ee00220f6b28f9db1c8b30b534f787b84afc..e3bb4b5ff7d8eb5f9f3007066107e614fa425118 100644
--- a/modules/translation/tests/translation_test.module
+++ b/modules/translation/tests/translation_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: translation_test.module,v 1.1 2010/10/09 03:22:30 webchick Exp $
 
 /**
  * @file
diff --git a/modules/translation/translation.info b/modules/translation/translation.info
index 751305f5a065db1f35a52f42f95ea24a1a096bc3..e3e1e4aa742fb648befae7df6ca4a1b8a1dce874 100644
--- a/modules/translation/translation.info
+++ b/modules/translation/translation.info
@@ -1,4 +1,3 @@
-; $Id: translation.info,v 1.6 2010/12/20 19:59:43 webchick Exp $
 name = Content translation
 description = Allows content to be translated into different languages.
 dependencies[] = locale
@@ -7,8 +6,8 @@ version = VERSION
 core = 7.x
 files[] = translation.test
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/translation/translation.module b/modules/translation/translation.module
index 599ff1faaa70f96e5ae2f3cbcd8634f371fbba32..697929f6681467df7d21c3b060604461ca14e68e 100644
--- a/modules/translation/translation.module
+++ b/modules/translation/translation.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: translation.module,v 1.91 2010/11/27 20:25:44 dries Exp $
 
 /**
  * @file
@@ -114,15 +113,14 @@ function translation_form_node_type_form_alter(&$form, &$form_state) {
   // Add translation option to content type form.
   $form['workflow']['language_content_type']['#options'][TRANSLATION_ENABLED] = t('Enabled, with translation');
   // Description based on text from locale.module.
-  $form['workflow']['language_content_type']['#description'] = t('Enable multilingual support for this content type. If enabled, a language selection field will be added to the editing form, allowing you to select from one of the <a href="!languages">enabled languages</a>. You can also turn on translation for this content type, which lets you have content translated to any of the enabled languages. If disabled, new posts are saved with the default language. Existing content will not be affected by changing this option.', array('!languages' => url('admin/config/regional/language')));
+  $form['workflow']['language_content_type']['#description'] = t('Enable multilingual support for this content type. If enabled, a language selection field will be added to the editing form, allowing you to select from one of the <a href="!languages">enabled languages</a>. You can also turn on translation for this content type, which lets you have content translated to any of the installed languages. If disabled, new posts are saved with the default language. Existing content will not be affected by changing this option.', array('!languages' => url('admin/config/regional/language')));
 }
 
 /**
- * Implements hook_form_alter().
+ * Implements hook_form_BASE_FORM_ID_alter().
  *
- * - Add translation option to content type form.
- * - Alters language fields on node forms when a translation
- *   is about to be created.
+ * This function alters language fields on node edit forms when a translation is
+ * about to be created.
  */
 function translation_form_node_form_alter(&$form, &$form_state) {
   if (translation_supported_type($form['#node']->type)) {
@@ -135,7 +133,7 @@ function translation_form_node_form_alter(&$form, &$form_state) {
     // might need to distinguish between enabled and disabled languages, hence
     // we divide them in two option groups.
     if ($translator_widget) {
-      $options = array();
+      $options = array($groups[1] => array(LANGUAGE_NONE => t('Language neutral')));
       $language_list = locale_language_list('name', TRUE);
       foreach (array(1, 0) as $status) {
         $group = $groups[$status];
@@ -504,8 +502,23 @@ function translation_path_get_translations($path) {
  */
 function translation_language_switch_links_alter(array &$links, $type, $path) {
   $language_type = variable_get('translation_language_type', LANGUAGE_TYPE_INTERFACE);
-  if ($type == $language_type && preg_match("!^node/(\d+)(/.+|)!", $path, $matches) && ($node = node_load((int) $matches[1]))) {
-    $translations = $node->tnid ? translation_node_get_translations($node->tnid) : array($node->language => $node);
+
+  if ($type == $language_type && preg_match("!^node/(\d+)(/.+|)!", $path, $matches)) {
+    $node = node_load((int) $matches[1]);
+
+    if (empty($node->tnid)) {
+      // If the node cannot be found nothing needs to be done. If it does not
+      // have translations it might be a language neutral node, in which case we
+      // must leave the language switch links unaltered. This is true also for
+      // nodes not having translation support enabled.
+      if (empty($node) || $node->language == LANGUAGE_NONE || !translation_supported_type($node->type)) {
+        return;
+      }
+      $translations = array($node->language => $node);
+    }
+    else {
+      $translations = translation_node_get_translations($node->tnid);
+    }
 
     foreach ($links as $langcode => $link) {
       if (isset($translations[$langcode]) && $translations[$langcode]->status) {
diff --git a/modules/translation/translation.pages.inc b/modules/translation/translation.pages.inc
index 0da7666df07246f03b3a14488df772e28a3111fc..7e4f0af266aedc22713b4e47211e322fb5155814 100644
--- a/modules/translation/translation.pages.inc
+++ b/modules/translation/translation.pages.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: translation.pages.inc,v 1.18 2010/12/31 20:45:25 webchick Exp $
 
 /**
  * @file
@@ -38,12 +37,12 @@ function translation_node_overview($node) {
       $translation_node = node_load($translations[$langcode]->nid);
       $path = 'node/' . $translation_node->nid;
       $links = language_negotiation_get_switch_links($type, $path);
-      $title = empty($links->links[$langcode]) ? l($translation_node->title, $path) : l($translation_node->title, $links->links[$langcode]['href'], $links->links[$langcode]);
+      $title = empty($links->links[$langcode]['href']) ? l($translation_node->title, $path) : l($translation_node->title, $links->links[$langcode]['href'], $links->links[$langcode]);
       if (node_access('update', $translation_node)) {
         $text = t('edit');
         $path = 'node/' . $translation_node->nid . '/edit';
         $links = language_negotiation_get_switch_links($type, $path);
-        $options[] = empty($links->links[$langcode]) ? l($text, $path) : l($text, $links->links[$langcode]['href'], $links->links[$langcode]);
+        $options[] = empty($links->links[$langcode]['href']) ? l($text, $path) : l($text, $links->links[$langcode]['href'], $links->links[$langcode]);
       }
       $status = $translation_node->status ? t('Published') : t('Not published');
       $status .= $translation_node->translate ? ' - <span class="marker">' . t('outdated') . '</span>' : '';
@@ -59,7 +58,7 @@ function translation_node_overview($node) {
         $path = 'node/add/' . str_replace('_', '-', $node->type);
         $links = language_negotiation_get_switch_links($type, $path);
         $query = array('query' => array('translation' => $node->nid, 'target' => $langcode));
-        $options[] = empty($links->links[$langcode]) ? l($text, $path, $query) : l($text, $links->links[$langcode]['href'], array_merge_recursive($links->links[$langcode], $query));
+        $options[] = empty($links->links[$langcode]['href']) ? l($text, $path, $query) : l($text, $links->links[$langcode]['href'], array_merge_recursive($links->links[$langcode], $query));
       }
       $status = t('Not translated');
     }
diff --git a/modules/translation/translation.test b/modules/translation/translation.test
index d03acb500b6762cd2db988ffaa7c8821f3552d04..54b53d9fdc4e6856820a5333e94503b66a425093 100644
--- a/modules/translation/translation.test
+++ b/modules/translation/translation.test
@@ -1,5 +1,9 @@
 <?php
-// $Id: translation.test,v 1.35 2010/12/31 20:45:25 webchick Exp $
+
+/**
+ * @file
+ * Tests for translation.module
+ */
 
 class TranslationTestCase extends DrupalWebTestCase {
   protected $book;
@@ -16,7 +20,7 @@ class TranslationTestCase extends DrupalWebTestCase {
     parent::setUp('locale', 'translation', 'translation_test');
 
     // Setup users.
-    $this->admin_user = $this->drupalCreateUser(array('bypass node access', 'administer nodes', 'administer languages', 'administer content types', 'administer blocks', 'access administration pages'));
+    $this->admin_user = $this->drupalCreateUser(array('bypass node access', 'administer nodes', 'administer languages', 'administer content types', 'administer blocks', 'access administration pages', 'translate content'));
     $this->translator = $this->drupalCreateUser(array('create page content', 'edit own page content', 'translate content'));
 
     $this->drupalLogin($this->admin_user);
@@ -63,6 +67,14 @@ class TranslationTestCase extends DrupalWebTestCase {
     $node_body =  $this->randomName();
     $node = $this->createPage($node_title, $node_body, 'en');
 
+    // Unpublish the original node to check that this has no impact on the
+    // translation overview page, publish it again afterwards.
+    $this->drupalLogin($this->admin_user);
+    $this->drupalPost('node/' . $node->nid . '/edit', array('status' => FALSE), t('Save'));
+    $this->drupalGet('node/' . $node->nid . '/translate');
+    $this->drupalPost('node/' . $node->nid . '/edit', array('status' => NODE_PUBLISHED), t('Save'));
+    $this->drupalLogin($this->translator);
+
     // Check that the "add translation" link uses a localized path.
     $languages = language_list();
     $this->drupalGet('node/' . $node->nid . '/translate');
@@ -121,6 +133,13 @@ class TranslationTestCase extends DrupalWebTestCase {
     $translation_it = $this->createTranslation($node, $this->randomName(), $this->randomName(), 'it');
     $this->assertRaw($translation_it->body['it'][0]['value'], t('Content created in Italian (disabled).'));
 
+    // Confirm that language neutral is an option for translators when there are
+    // disabled languages.
+    $this->drupalGet('node/add/page');
+    $this->assertFieldByXPath('//select[@name="language"]//option', LANGUAGE_NONE, t('Language neutral is available in language selection with disabled languages.'));
+    $node2 = $this->createPage($this->randomName(), $this->randomName(), LANGUAGE_NONE);
+    $this->assertRaw($node2->body[LANGUAGE_NONE][0]['value'], t('Language neutral content created with disabled languages available.'));
+
     // Leave just one language enabled and check that the translation overview
     // page is still accessible.
     $this->drupalLogin($this->admin_user);
@@ -200,6 +219,38 @@ class TranslationTestCase extends DrupalWebTestCase {
     $this->assertLanguageSwitchLinks($node, $node, TRUE, $type);
     $this->assertLanguageSwitchLinks($node, $translation_es, TRUE, $type);
     $this->assertLanguageSwitchLinks($node, $translation_it, TRUE, $type);
+
+    // Create a language neutral node and check that the language switcher is
+    // left untouched.
+    $node2 = $this->createPage($this->randomName(), $this->randomName(), LANGUAGE_NONE);
+    $node2_en = (object) array('nid' => $node2->nid, 'language' => 'en');
+    $node2_es = (object) array('nid' => $node2->nid, 'language' => 'es');
+    $node2_it = (object) array('nid' => $node2->nid, 'language' => 'it');
+    $this->assertLanguageSwitchLinks($node2_en, $node2_en, TRUE, $type);
+    $this->assertLanguageSwitchLinks($node2_en, $node2_es, TRUE, $type);
+    $this->assertLanguageSwitchLinks($node2_en, $node2_it, TRUE, $type);
+
+    // Disable translation support to check that the language switcher is left
+    // untouched only for new nodes.
+    $this->drupalLogin($this->admin_user);
+    $edit = array('language_content_type' => 0);
+    $this->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type'));
+    $this->drupalLogin($this->translator);
+
+    // Existing translations trigger alterations even if translation support is
+    // disabled.
+    $this->assertLanguageSwitchLinks($node, $node, TRUE, $type);
+    $this->assertLanguageSwitchLinks($node, $translation_es, TRUE, $type);
+    $this->assertLanguageSwitchLinks($node, $translation_it, TRUE, $type);
+
+    // Check that new nodes with a language assigned do not trigger language
+    // switcher alterations when translation support is disabled.
+    $node = $this->createPage($this->randomName(), $this->randomName());
+    $node_es = (object) array('nid' => $node->nid, 'language' => 'es');
+    $node_it = (object) array('nid' => $node->nid, 'language' => 'it');
+    $this->assertLanguageSwitchLinks($node, $node, TRUE, $type);
+    $this->assertLanguageSwitchLinks($node, $node_es, TRUE, $type);
+    $this->assertLanguageSwitchLinks($node, $node_it, TRUE, $type);
   }
 
   /**
@@ -264,12 +315,14 @@ class TranslationTestCase extends DrupalWebTestCase {
    * @param
    *   $language Language code.
    */
-  function createPage($title, $body, $language) {
+  function createPage($title, $body, $language = NULL) {
     $edit = array();
     $langcode = LANGUAGE_NONE;
     $edit["title"] = $title;
     $edit["body[$langcode][0][value]"] = $body;
-    $edit['language'] = $language;
+    if (!empty($language)) {
+      $edit['language'] = $language;
+    }
     $this->drupalPost('node/add/page', $edit, t('Save'));
     $this->assertRaw(t('Basic page %title has been created.', array('%title' => $title)), t('Basic page created.'));
 
diff --git a/modules/trigger/tests/trigger_test.info b/modules/trigger/tests/trigger_test.info
index 81543d732f13ee7c2b04185530c2994638806a38..e5aa50df1c53e93b7afd7b04135852452586e6ef 100644
--- a/modules/trigger/tests/trigger_test.info
+++ b/modules/trigger/tests/trigger_test.info
@@ -1,12 +1,11 @@
-; $Id: trigger_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $
 name = "Trigger Test"
 description = "Support module for Trigger tests."
 package = Testing
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/trigger/tests/trigger_test.module b/modules/trigger/tests/trigger_test.module
index d19f8dc304465dab5e598160ff5cb3868c578ed2..0e3f3f877d2425df0498e9a5e68589bc2dbeb993 100644
--- a/modules/trigger/tests/trigger_test.module
+++ b/modules/trigger/tests/trigger_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: trigger_test.module,v 1.8 2010/06/29 18:24:10 dries Exp $
 
 /**
  * @file
diff --git a/modules/trigger/trigger.admin.inc b/modules/trigger/trigger.admin.inc
index 0bd205aa327f03c4609c33b493e34cae20515db6..7509eb35a60825139771bea308cb25095fcf3a4e 100644
--- a/modules/trigger/trigger.admin.inc
+++ b/modules/trigger/trigger.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: trigger.admin.inc,v 1.30 2010/10/20 16:19:24 webchick Exp $
 
 /**
  * @file
diff --git a/modules/trigger/trigger.api.php b/modules/trigger/trigger.api.php
index f2f4c6e753abac18f42d663c35d69603fed38e16..839c1d48d098f280e6469ccb907b88fcf1de3578 100644
--- a/modules/trigger/trigger.api.php
+++ b/modules/trigger/trigger.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: trigger.api.php,v 1.7 2010/04/22 06:33:06 webchick Exp $
 
 /**
  * @file
diff --git a/modules/trigger/trigger.info b/modules/trigger/trigger.info
index 1eb79f1d1b6d564bce840df63b8953b5242a5498..cb76d1ad4249320a4edec83e968870f20e37cd24 100644
--- a/modules/trigger/trigger.info
+++ b/modules/trigger/trigger.info
@@ -1,4 +1,3 @@
-; $Id: trigger.info,v 1.8 2010/12/20 19:59:43 webchick Exp $
 name = Trigger
 description = Enables actions to be fired on certain system events, such as when new content is created.
 package = Core
@@ -7,8 +6,8 @@ core = 7.x
 files[] = trigger.test
 configure = admin/structure/trigger
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/trigger/trigger.install b/modules/trigger/trigger.install
index 1f42515b2f0b121050a4a9edacd2b016e666cf84..9a172a2a0484be58d59e27b4e4bfcf4caa600c21 100644
--- a/modules/trigger/trigger.install
+++ b/modules/trigger/trigger.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: trigger.install,v 1.17 2010/08/22 13:55:53 dries Exp $
 
 /**
  * @file
diff --git a/modules/trigger/trigger.module b/modules/trigger/trigger.module
index 23a8b094775a84eca60baf727792ae975824c1a8..6c1f58ffa33e31d5ff8c3fb04cb9359935512d25 100644
--- a/modules/trigger/trigger.module
+++ b/modules/trigger/trigger.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: trigger.module,v 1.66 2010/12/01 07:41:03 webchick Exp $
 
 /**
  * @file
diff --git a/modules/trigger/trigger.test b/modules/trigger/trigger.test
index d3307d618f173b51eb5889b0c013a13f159eaaa7..9a9a4ba282406f7c81b6ceefc4ee1704c126686d 100644
--- a/modules/trigger/trigger.test
+++ b/modules/trigger/trigger.test
@@ -1,5 +1,9 @@
 <?php
-// $Id: trigger.test,v 1.37 2010/10/05 06:17:29 webchick Exp $
+
+/**
+ * @file
+ * Tests for trigger.module.
+ */
 
 /**
  * Provides common helper methods.
diff --git a/modules/update/tests/aaa_update_test.info b/modules/update/tests/aaa_update_test.info
index 617d79a84536a3823e694aa8cf5c55b01cfba4d6..17da66addd123a05a3abdb9e683bb1dfae0d718c 100644
--- a/modules/update/tests/aaa_update_test.info
+++ b/modules/update/tests/aaa_update_test.info
@@ -1,12 +1,11 @@
-; $Id: aaa_update_test.info,v 1.2 2010/12/20 19:59:44 webchick Exp $
 name = AAA Update test
 description = Support module for update module testing.
 package = Testing
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/update/tests/aaa_update_test.module b/modules/update/tests/aaa_update_test.module
index 777fe1b79c19710d706f7ef9c07bc22b78bf5314..4d67b8e40fcbe7e287f4289a43ceda4b44f3048d 100644
--- a/modules/update/tests/aaa_update_test.module
+++ b/modules/update/tests/aaa_update_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: aaa_update_test.module,v 1.1 2009/10/01 19:23:21 dries Exp $
 
 /**
  * @file
diff --git a/modules/update/tests/bbb_update_test.info b/modules/update/tests/bbb_update_test.info
index 805e56f3d95990591161a3fc526004e4485a14d8..016153efdd95c76ca36ed9873e4ac4479a2e513d 100644
--- a/modules/update/tests/bbb_update_test.info
+++ b/modules/update/tests/bbb_update_test.info
@@ -1,12 +1,11 @@
-; $Id: bbb_update_test.info,v 1.2 2010/12/20 19:59:44 webchick Exp $
 name = BBB Update test
 description = Support module for update module testing.
 package = Testing
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/update/tests/bbb_update_test.module b/modules/update/tests/bbb_update_test.module
index 8cb604178a51a02821e92708c18f5cc4366a85c2..4d67b8e40fcbe7e287f4289a43ceda4b44f3048d 100644
--- a/modules/update/tests/bbb_update_test.module
+++ b/modules/update/tests/bbb_update_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: bbb_update_test.module,v 1.1 2009/10/01 19:23:21 dries Exp $
 
 /**
  * @file
diff --git a/modules/update/tests/ccc_update_test.info b/modules/update/tests/ccc_update_test.info
index cbe120162a02bbc61a3b35e6386a4b4da4419cb9..a28552331c52e3898c1b0885a63f989436ad5be3 100644
--- a/modules/update/tests/ccc_update_test.info
+++ b/modules/update/tests/ccc_update_test.info
@@ -1,12 +1,11 @@
-; $Id: ccc_update_test.info,v 1.2 2010/12/20 19:59:44 webchick Exp $
 name = CCC Update test
 description = Support module for update module testing.
 package = Testing
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/update/tests/ccc_update_test.module b/modules/update/tests/ccc_update_test.module
index 70b90a0dfcfb58559082d278b586c2f64f48c2e0..4d67b8e40fcbe7e287f4289a43ceda4b44f3048d 100644
--- a/modules/update/tests/ccc_update_test.module
+++ b/modules/update/tests/ccc_update_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: ccc_update_test.module,v 1.1 2009/10/01 19:23:21 dries Exp $
 
 /**
  * @file
diff --git a/modules/update/tests/update_test.info b/modules/update/tests/update_test.info
index 4823b87b42c77b9b48cbd922d8760a99954d7ecc..94a2308a3779359de84de96107167cd4ecdac44b 100644
--- a/modules/update/tests/update_test.info
+++ b/modules/update/tests/update_test.info
@@ -1,4 +1,3 @@
-; $Id: update_test.info,v 1.2 2010/12/20 19:59:44 webchick Exp $
 name = Update test
 description = Support module for update module testing.
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/update/tests/update_test.module b/modules/update/tests/update_test.module
index 840133ab70bced0b57074399be00a3c81d5ab746..4e32d336afea644da469f2cdf5d91c3a280c4fee 100644
--- a/modules/update/tests/update_test.module
+++ b/modules/update/tests/update_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: update_test.module,v 1.7 2011/01/03 02:41:33 webchick Exp $
 
 /**
  * Implements hook_menu().
diff --git a/modules/update/update-rtl.css b/modules/update/update-rtl.css
index 623e76a2bf364b787e25a4bf82d7dd41c87117c8..5fc83d1a6239ce2e5466465e282d8da2fa96b73e 100644
--- a/modules/update/update-rtl.css
+++ b/modules/update/update-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: update-rtl.css,v 1.3 2007/11/27 16:22:22 goba Exp $ */
 
 .update .project {
   padding-right: .25em;
diff --git a/modules/update/update.api.php b/modules/update/update.api.php
index b7349a19c9e9826e8b4a8f91c039f09f2d2708cc..87f95cac5c2a239c83dd8c8b768ef37e6018d431 100644
--- a/modules/update/update.api.php
+++ b/modules/update/update.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: update.api.php,v 1.6 2010/12/06 06:50:08 webchick Exp $
 
 /**
  * @file
diff --git a/modules/update/update.authorize.inc b/modules/update/update.authorize.inc
index 7265681a00caf6e794d364c4662b1c40c600ca45..c9b76dd30f6200130579c75ee486ce3b2eaaea96 100644
--- a/modules/update/update.authorize.inc
+++ b/modules/update/update.authorize.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: update.authorize.inc,v 1.9 2011/01/03 02:53:07 webchick Exp $
 
 /**
  * @file
@@ -102,7 +101,7 @@ function update_authorize_run_install($filetransfer, $project, $updater_name, $l
  *   already been downloaded and extracted into.
  * @param FileTransfer $filetransfer
  *   The FileTransfer object to use for performing this operation.
- * @param array &$context
+ * @param array $context
  *   Reference to an array used for BatchAPI storage.
  */
 function update_authorize_batch_copy_project($project, $updater_name, $local_url, $filetransfer, &$context) {
diff --git a/modules/update/update.compare.inc b/modules/update/update.compare.inc
index 1efb6979c802e7da982942241ee92772d76c02da..2ccd97c0eb7bad1456d41318c1671d048b4202c5 100644
--- a/modules/update/update.compare.inc
+++ b/modules/update/update.compare.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: update.compare.inc,v 1.41 2010/10/04 07:26:25 webchick Exp $
 
 /**
  * @file
diff --git a/modules/update/update.css b/modules/update/update.css
index 832195e329f4b45300c70f96f057d0e7dbb2ad2a..d30dfb6e50b824acc6dca856fc8506922bb54380 100644
--- a/modules/update/update.css
+++ b/modules/update/update.css
@@ -1,4 +1,3 @@
-/* $Id: update.css,v 1.8 2010/10/08 00:24:09 dries Exp $ */
 
 .update .project {
   font-weight: bold;
diff --git a/modules/update/update.fetch.inc b/modules/update/update.fetch.inc
index 63847d26d83b1830fec0db20ce31b3324064ca84..ff69cbb114d66adf509c0c59a07c59458802465f 100644
--- a/modules/update/update.fetch.inc
+++ b/modules/update/update.fetch.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: update.fetch.inc,v 1.28 2010/05/06 05:59:31 webchick Exp $
 
 /**
  * @file
diff --git a/modules/update/update.info b/modules/update/update.info
index f3f2a4cb0bb1a18ffc800df8c0dbc7dd93a8153f..67c9565067ea9f7ec61f9e78a1fe45bb1ce09d6b 100644
--- a/modules/update/update.info
+++ b/modules/update/update.info
@@ -1,4 +1,3 @@
-; $Id: update.info,v 1.10 2010/12/20 19:59:43 webchick Exp $
 name = Update manager
 description = Checks for available updates, and can securely install or update modules and themes via a web interface.
 version = VERSION
@@ -7,8 +6,8 @@ core = 7.x
 files[] = update.test
 configure = admin/reports/updates/settings
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/update/update.install b/modules/update/update.install
index 69278bab072ade0c2131906a40a309ab3f338bcd..70fb6c3280a6180b6332c1bc6d05e57b8a650cbf 100644
--- a/modules/update/update.install
+++ b/modules/update/update.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: update.install,v 1.21 2011/01/02 17:26:39 webchick Exp $
 
 /**
  * @file
diff --git a/modules/update/update.manager.inc b/modules/update/update.manager.inc
index a6707bcc3bfe5ad223d5de04e5182c511514e88c..35b292905153f311aeb96008e229f88b2e092d84 100644
--- a/modules/update/update.manager.inc
+++ b/modules/update/update.manager.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: update.manager.inc,v 1.34 2011/01/03 02:53:07 webchick Exp $
 
 /**
  * @file
@@ -644,8 +643,11 @@ function update_manager_install_form_submit($form, &$form_state) {
     form_set_error($field, t('Provided archive contains no files.'));
     return;
   }
-  // Unfortunately, we can only use the directory name for this. :(
-  $project = drupal_substr($files[0], 0, -1);
+
+  // Unfortunately, we can only use the directory name to determine the project
+  // name. Some archivers list the first file as the directory (i.e., MODULE/)
+  // and others list an actual file (i.e., MODULE/README.TXT).
+  $project = strtok($files[0], '/\\');
 
   $archive_errors = update_manager_archive_verify($project, $local_cache, $directory);
   if (!empty($archive_errors)) {
@@ -728,26 +730,6 @@ function update_manager_install_form_submit($form, &$form_state) {
  * and verify archive files.
  */
 
-/**
- * Return the directory where update archive files should be extracted.
- *
- * If the directory does not already exist, attempt to create it.
- *
- * @return
- *   The full path to the temporary directory where update file archives
- *   should be extracted.
- */
-function _update_manager_extract_directory() {
-  $directory = &drupal_static(__FUNCTION__, '');
-  if (empty($directory)) {
-    $directory = 'temporary://update-extraction';
-    if (!file_exists($directory)) {
-      mkdir($directory);
-    }
-  }
-  return $directory;
-}
-
 /**
  * Unpack a downloaded archive file.
  *
@@ -771,8 +753,12 @@ function update_manager_archive_extract($file, $directory) {
   // old files mixed with the new files (e.g. in cases where files were removed
   // from a later release).
   $files = $archiver->listContents();
-  // Unfortunately, we can only use the directory name for this. :(
-  $project = drupal_substr($files[0], 0, -1);
+
+  // Unfortunately, we can only use the directory name to determine the project
+  // name. Some archivers list the first file as the directory (i.e., MODULE/)
+  // and others list an actual file (i.e., MODULE/README.TXT).
+  $project = strtok($files[0], '/\\');
+
   $extract_location = $directory . '/' . $project;
   if (file_exists($extract_location)) {
     file_unmanaged_delete_recursive($extract_location);
@@ -823,13 +809,9 @@ function update_manager_file_get($url) {
   }
 
   // Check the cache and download the file if needed.
-  $cache_directory = 'temporary://update-cache';
+  $cache_directory = _update_manager_cache_directory();
   $local = $cache_directory . '/' . basename($parsed_url['path']);
 
-  if (!file_exists($cache_directory)) {
-    mkdir($cache_directory);
-  }
-
   if (!file_exists($local) || update_delete_file_if_stale($local)) {
     return system_retrieve_file($url, $local, FALSE, FILE_EXISTS_REPLACE);
   }
@@ -849,7 +831,7 @@ function update_manager_file_get($url) {
  *   The short name of the project to download.
  * @param string $url
  *   The URL to download a specific project release archive file.
- * @param array &$context
+ * @param array $context
  *   Reference to an array used for BatchAPI storage.
  *
  * @see update_manager_download_page()
diff --git a/modules/update/update.module b/modules/update/update.module
index f7209c4c6dee04c74b4df0e25b4675f9bab6d891..a66cfa51247e379313abde33a12c2282bc1206e1 100644
--- a/modules/update/update.module
+++ b/modules/update/update.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: update.module,v 1.75 2011/01/03 02:17:34 webchick Exp $
 
 /**
  * @file
@@ -857,14 +856,71 @@ function update_flush_caches() {
  * @} End of "defgroup update_status_cache".
  */
 
+/**
+ * Return a short unique identifier for this Drupal installation.
+ *
+ * @return
+ *   An eight character string uniquely identifying this Drupal installation.
+ */
+function _update_manager_unique_identifier() {
+  $id = &drupal_static(__FUNCTION__, '');
+  if (empty($id)) {
+    $id = substr(hash('sha256', drupal_get_hash_salt()), 0, 8);
+  }
+  return $id;
+}
+
+/**
+ * Return the directory where update archive files should be extracted.
+ *
+ * @param $create
+ *   If TRUE, attempt to create the directory if it does not already exist.
+ *
+ * @return
+ *   The full path to the temporary directory where update file archives
+ *   should be extracted.
+ */
+function _update_manager_extract_directory($create = TRUE) {
+  $directory = &drupal_static(__FUNCTION__, '');
+  if (empty($directory)) {
+    $directory = 'temporary://update-extraction-' . _update_manager_unique_identifier();
+    if ($create && !file_exists($directory)) {
+      mkdir($directory);
+    }
+  }
+  return $directory;
+}
+
+/**
+ * Return the directory where update archive files should be cached.
+ *
+ * @param $create
+ *   If TRUE, attempt to create the directory if it does not already exist.
+ *
+ * @return
+ *   The full path to the temporary directory where update file archives
+ *   should be cached.
+ */
+function _update_manager_cache_directory($create = TRUE) {
+  $directory = &drupal_static(__FUNCTION__, '');
+  if (empty($directory)) {
+    $directory = 'temporary://update-cache-' . _update_manager_unique_identifier();
+    if ($create && !file_exists($directory)) {
+      mkdir($directory);
+    }
+  }
+  return $directory;
+}
+
 /**
  * Clear the temporary files and directories based on file age from disk.
  */
 function update_clear_update_disk_cache() {
-  // List of update module cache directories.
+  // List of update module cache directories. Do not create the directories if
+  // they do not exist.
   $directories = array(
-    'temporary://update-cache',
-    'temporary://update-extraction',
+    _update_manager_cache_directory(FALSE),
+    _update_manager_extract_directory(FALSE),
   );
 
   // Search for files and directories in base folder only without recursion.
diff --git a/modules/update/update.report.inc b/modules/update/update.report.inc
index 1208350379f19d8e3226304dc420b3fef7f50cf0..3f5933acb1feeb6caf0ed61d823aaf0269d7f852 100644
--- a/modules/update/update.report.inc
+++ b/modules/update/update.report.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: update.report.inc,v 1.33 2010/10/03 22:43:16 dries Exp $
 
 /**
  * @file
@@ -58,25 +57,25 @@ function theme_update_report($variables) {
     switch ($project['status']) {
       case UPDATE_CURRENT:
         $class = 'ok';
-        $icon = theme('image', array('path' => 'misc/watchdog-ok.png', 'alt' => t('ok'), 'title' => t('ok')));
+        $icon = theme('image', array('path' => 'misc/watchdog-ok.png', 'width' => 18, 'height' => 18, 'alt' => t('ok'), 'title' => t('ok')));
         break;
       case UPDATE_UNKNOWN:
       case UPDATE_FETCH_PENDING:
       case UPDATE_NOT_FETCHED:
         $class = 'unknown';
-        $icon = theme('image', array('path' => 'misc/watchdog-warning.png', 'alt' => t('warning'), 'title' => t('warning')));
+        $icon = theme('image', array('path' => 'misc/watchdog-warning.png', 'width' => 18, 'height' => 18, 'alt' => t('warning'), 'title' => t('warning')));
         break;
       case UPDATE_NOT_SECURE:
       case UPDATE_REVOKED:
       case UPDATE_NOT_SUPPORTED:
         $class = 'error';
-        $icon = theme('image', array('path' => 'misc/watchdog-error.png', 'alt' => t('error'), 'title' => t('error')));
+        $icon = theme('image', array('path' => 'misc/watchdog-error.png', 'width' => 18, 'height' => 18, 'alt' => t('error'), 'title' => t('error')));
         break;
       case UPDATE_NOT_CHECKED:
       case UPDATE_NOT_CURRENT:
       default:
         $class = 'warning';
-        $icon = theme('image', array('path' => 'misc/watchdog-warning.png', 'alt' => t('warning'), 'title' => t('warning')));
+        $icon = theme('image', array('path' => 'misc/watchdog-warning.png', 'width' => 18, 'height' => 18, 'alt' => t('warning'), 'title' => t('warning')));
         break;
     }
 
diff --git a/modules/update/update.settings.inc b/modules/update/update.settings.inc
index aa862a8361940163236858a4278626d4638b62ed..60ac3ca8e4e7b36709f2a27999c9cbef38aeafb1 100644
--- a/modules/update/update.settings.inc
+++ b/modules/update/update.settings.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: update.settings.inc,v 1.11 2010/06/26 21:32:20 dries Exp $
 
 /**
  * @file
diff --git a/modules/update/update.test b/modules/update/update.test
index 6cb44914acf6dada05359195b81c58c34284cbbd..6f9ef08edc1de9b480afe13d30dbb980217f92ec 100644
--- a/modules/update/update.test
+++ b/modules/update/update.test
@@ -1,8 +1,9 @@
 <?php
-// $Id: update.test,v 1.22 2011/01/03 02:41:33 webchick Exp $
 
 /**
  * @file
+ * Tests for update.module.
+ *
  * This file contains tests for the update module. The overarching methodology
  * of these tests is we need to compare a given state of installed modules and
  * themes (e.g. version, project grouping, timestamps, etc) vs. a current
diff --git a/modules/user/tests/user_form_test.info b/modules/user/tests/user_form_test.info
index 1fb6a9a1d602f95f3af92f5065880eb3a1342291..45d961c181f2596f75bd549fe885bb32832f60cf 100644
--- a/modules/user/tests/user_form_test.info
+++ b/modules/user/tests/user_form_test.info
@@ -1,4 +1,3 @@
-; $Id: user_form_test.info,v 1.2 2010/12/21 16:31:47 webchick Exp $
 name = "User module form tests"
 description = "Support module for user form testing."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/user/tests/user_form_test.module b/modules/user/tests/user_form_test.module
index ccb21f7f05a55966aa44f52698989727a16ef29d..4e907f361b3ceb9028ff625edbe8c1b2469ce99b 100644
--- a/modules/user/tests/user_form_test.module
+++ b/modules/user/tests/user_form_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: user_form_test.module,v 1.1 2010/12/11 06:22:33 webchick Exp $
 
 /**
  * @file
diff --git a/modules/user/user-picture.tpl.php b/modules/user/user-picture.tpl.php
index 9d62c134435b599bd0617f276bae5499523f9952..a33d2661d744606038af3db79e87ec96df310618 100644
--- a/modules/user/user-picture.tpl.php
+++ b/modules/user/user-picture.tpl.php
@@ -1,14 +1,13 @@
 <?php
-// $Id: user-picture.tpl.php,v 1.5 2009/08/06 05:05:59 webchick Exp $
 
 /**
  * @file
- * Default theme implementation to present an picture configured for the
+ * Default theme implementation to present a picture configured for the
  * user's account.
  *
  * Available variables:
  * - $user_picture: Image set by the user or the site's default. Will be linked
- *   depending on the viewer's permission to view the users profile page.
+ *   depending on the viewer's permission to view the user's profile page.
  * - $account: Array of account information. Potentially unsafe. Be sure to
  *   check_plain() before use.
  *
diff --git a/modules/user/user-profile-category.tpl.php b/modules/user/user-profile-category.tpl.php
index 69145fc9dccc4ee8635bf9550834407bea0d0415..0de7d5d0061ce14d20615b33b016285d4f6f48c3 100644
--- a/modules/user/user-profile-category.tpl.php
+++ b/modules/user/user-profile-category.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: user-profile-category.tpl.php,v 1.3 2008/10/13 12:31:43 dries Exp $
 
 /**
  * @file
diff --git a/modules/user/user-profile-item.tpl.php b/modules/user/user-profile-item.tpl.php
index 2275c12c62dbff31a70bc444d1fabc32a5151aed..042d43a879586afc236dd57d1874481903717cdd 100644
--- a/modules/user/user-profile-item.tpl.php
+++ b/modules/user/user-profile-item.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: user-profile-item.tpl.php,v 1.3 2008/10/13 12:31:43 dries Exp $
 
 /**
  * @file
diff --git a/modules/user/user-profile.tpl.php b/modules/user/user-profile.tpl.php
index f27aaf9e8934dc8dc030a92d7f01eb4e5cf709a1..50e6111173630d2b64a748ba3d18b6582991b157 100644
--- a/modules/user/user-profile.tpl.php
+++ b/modules/user/user-profile.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: user-profile.tpl.php,v 1.13 2010/01/08 07:04:09 webchick Exp $
 
 /**
  * @file
diff --git a/modules/user/user-rtl.css b/modules/user/user-rtl.css
index b589171b304d75eb9cabbcf6e17b816147deceb8..5a1442c1c5104f68da55bac4014ee126777c69c5 100644
--- a/modules/user/user-rtl.css
+++ b/modules/user/user-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: user-rtl.css,v 1.9 2010/09/19 18:10:42 dries Exp $ */
 
 #permissions td.permission {
   padding-left: 0;
@@ -8,19 +7,18 @@
 /**
  * Password strength indicator.
  */
-input.password-field {
-  margin-left: 10px;
-  margin-right: 0;
+.password-strength {
+  float: left;
 }
-input.password-confirm {
-  margin-left: 10px;
-  margin-right: 0;
+.password-strength-text {
+  float: left;
 }
-.password-strength-title {
-  float: right;
+div.password-confirm {
+  float: left;
 }
+.confirm-parent,
 .password-parent {
-  float: right;
+  clear: right;
 }
 
 /* Generated by user.module but used by profile.module: */
diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc
index 4bfb3c12b4564e7d7e63d8e99224064cfa1f45cb..0596bde4c1c387c8575a8810f6dd84a7778708ae 100644
--- a/modules/user/user.admin.inc
+++ b/modules/user/user.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: user.admin.inc,v 1.124 2010/12/15 02:59:01 webchick Exp $
 
 /**
  * @file
diff --git a/modules/user/user.api.php b/modules/user/user.api.php
index 437e01d6d3b4058c6f464299875ae6cefea41969..069a9f880be90c0b85cecc0b5ee37299d6e06480 100644
--- a/modules/user/user.api.php
+++ b/modules/user/user.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: user.api.php,v 1.27 2010/12/11 19:16:42 webchick Exp $
 
 /**
  * @file
@@ -25,18 +24,17 @@
  * @see profile_user_load()
  */
 function hook_user_load($users) {
-  $result = db_query('SELECT * FROM {my_table} WHERE uid IN (:uids)', array(':uids' => array_keys($users)));
+  $result = db_query('SELECT uid, foo FROM {my_table} WHERE uid IN (:uids)', array(':uids' => array_keys($users)));
   foreach ($result as $record) {
-    $users[$record->uid]->foo = $result->foo;
+    $users[$record->uid]->foo = $record->foo;
   }
 }
 
 /**
  * Respond to user deletion.
  *
- * This hook is invoked from user_delete_multiple() after the account has been
- * removed from the user tables in the database, and before
- * field_attach_delete() is called.
+ * This hook is invoked from user_delete_multiple() before field_attach_delete()
+ * is called and before users are actually removed from the database.
  *
  * Modules should additionally implement hook_user_cancel() to process stored
  * user data for other account cancellation methods.
@@ -128,7 +126,7 @@ function hook_user_cancel($edit, $account, $method) {
  *   a method. If #access is defined, the method cannot be configured as default
  *   method.
  *
- * @param &$methods
+ * @param $methods
  *   An array containing user account cancellation methods, keyed by method id.
  *
  * @see user_cancel_methods()
@@ -215,7 +213,7 @@ function hook_user_categories() {
  * user account object is loaded, modules may add to $edit['data'] in order
  * to have their data serialized on save.
  *
- * @param &$edit
+ * @param $edit
  *   The array of form values submitted by the user.
  * @param $account
  *   The user object on which the operation is performed.
@@ -238,7 +236,7 @@ function hook_user_presave(&$edit, $account, $category) {
  * The module should save its custom additions to the user object into the
  * database.
  *
- * @param &$edit
+ * @param $edit
  *   The array of form values submitted by the user.
  * @param $account
  *   The user object on which the operation is being performed.
@@ -263,7 +261,7 @@ function hook_user_insert(&$edit, $account, $category) {
  * Modules may use this hook to update their user data in a custom storage
  * after a user account has been updated.
  *
- * @param &$edit
+ * @param $edit
  *   The array of form values submitted by the user.
  * @param $account
  *   The user object on which the operation is performed.
@@ -285,7 +283,7 @@ function hook_user_update(&$edit, $account, $category) {
 /**
  * The user just logged in.
  *
- * @param &$edit
+ * @param $edit
  *   The array of form values submitted by the user.
  * @param $account
  *   The user object on which the operation was just performed.
@@ -368,6 +366,25 @@ function hook_user_view_alter(&$build) {
   $build['#post_render'][] = 'my_module_user_post_render';
 }
 
+/**
+ * Inform other modules that a user role is about to be saved.
+ *
+ * Modules implementing this hook can act on the user role object before
+ * it has been saved to the database.
+ *
+ * @param $role
+ *   A user role object.
+ *
+ * @see hook_user_role_insert()
+ * @see hook_user_role_update()
+ */
+function hook_user_role_presave($role) {
+  // Set a UUID for the user role if it doesn't already exist
+  if (empty($role->uuid)) {
+    $role->uuid = uuid_uuid();
+  }
+}
+
 /**
  * Inform other modules that a user role has been added.
  *
diff --git a/modules/user/user.css b/modules/user/user.css
index 85829f7e39153305df07858bccd4dacf8db8c386..d6ed7c366ba0f0796b0a2137c09e70baed3ca96d 100644
--- a/modules/user/user.css
+++ b/modules/user/user.css
@@ -1,4 +1,3 @@
-/* $Id: user.css,v 1.23 2010/09/19 18:10:42 dries Exp $ */
 
 #permissions td.module {
   font-weight: bold;
@@ -58,8 +57,10 @@ input.password-field {
   margin-bottom: 0.4em;
 }
 div.password-confirm {
-  display: inline;
-  padding-left: 1em;
+  float: right;  /* LTR */
+  margin-top: 1.5em;
+  visibility: hidden;
+  width: 17em;
 }
 div.form-item div.password-suggestions {
   padding: 0.2em 0.5em;
@@ -70,19 +71,11 @@ div.form-item div.password-suggestions {
 div.password-suggestions ul {
   margin-bottom: 0;
 }
+.confirm-parent,
 .password-parent {
+  clear: left; /* LTR */
   margin: 0;
-  width: 34.3em;
-}
-
-/**
- * Password confirmation checker.
- */
-.confirm-parent {
-  margin: 0;
-}
-div.password-confirm {
-  visibility: hidden;
+  width: 36.3em;
 }
 
 /* Generated by user.module but used by profile.module: */
diff --git a/modules/user/user.info b/modules/user/user.info
index 714d1fdfb415a2b9db51855151aebe625257a605..80f6962cf3e419684cfc69fd60f9cb0126827895 100644
--- a/modules/user/user.info
+++ b/modules/user/user.info
@@ -1,4 +1,3 @@
-; $Id: user.info,v 1.15 2010/12/20 19:59:44 webchick Exp $
 name = User
 description = Manages the user registration and login system.
 package = Core
@@ -10,8 +9,8 @@ required = TRUE
 configure = admin/config/people
 stylesheets[all][] = user.css
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/modules/user/user.install b/modules/user/user.install
index 6ee922649705975d734c9f87191da1a550299d74..df94ad5370024aa77ba4a07d8a705653a0a5d6a1 100644
--- a/modules/user/user.install
+++ b/modules/user/user.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: user.install,v 1.69 2011/01/02 17:26:40 webchick Exp $
 
 /**
  * @file
@@ -854,6 +853,19 @@ function user_update_7015() {
   ));
 }
 
+/**
+ * Update the database to match the schema.
+ */
+function user_update_7016() {
+  // Add field default.
+  db_change_field('users', 'uid', 'uid', array(
+    'type' => 'int',
+    'unsigned' => TRUE,
+    'not null' => TRUE,
+    'default' => 0,
+  ));
+}
+
 /**
  * @} End of "addtogroup updates-6.x-to-7.x"
  */
diff --git a/modules/user/user.js b/modules/user/user.js
index 7549a302250667039ec7fe06525fe1dcafd3e3e5..44c00f344a031f93ea77d29868a5aac60a941cfc 100644
--- a/modules/user/user.js
+++ b/modules/user/user.js
@@ -1,4 +1,3 @@
-// $Id: user.js,v 1.25 2010/11/30 23:55:11 webchick Exp $
 (function ($) {
 
 /**
@@ -17,7 +16,7 @@ Drupal.behaviors.password = {
       innerWrapper.addClass('password-parent');
 
       // Add the password confirmation layer.
-      $('input.password-confirm', outerWrapper).after('<div class="password-confirm">' + translate['confirmTitle'] + ' <span></span></div>').parent().addClass('confirm-parent');
+      $('input.password-confirm', outerWrapper).parent().prepend('<div class="password-confirm">' + translate['confirmTitle'] + ' <span></span></div>').addClass('confirm-parent');
       var confirmInput = $('input.password-confirm', outerWrapper);
       var confirmResult = $('div.password-confirm', outerWrapper);
       var confirmChild = $('span', confirmResult);
diff --git a/modules/user/user.module b/modules/user/user.module
index 934293562848f8e2ec05e193cd2aafa2d5c6c870..90d313b106d89cf19d87acf33c19418ea883427f 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: user.module,v 1.1229 2010/12/28 21:46:23 webchick Exp $
 
 /**
  * @file
@@ -326,9 +325,10 @@ class UserController extends DrupalDefaultEntityController {
  * user. So to avoid confusion and to avoid clobbering the global $user object,
  * it is a good idea to assign the result of this function to a different local
  * variable, generally $account. If you actually do want to act as the user you
- * are loading, it is essential to call @code session_save_session(FALSE);
- * @endcode first. See @link http://drupal.org/node/218104 Safely impersonating
- * another user @endlink for more information.
+ * are loading, it is essential to call drupal_save_session(FALSE); first.
+ * See
+ * @link http://drupal.org/node/218104 Safely impersonating another user @endlink
+ * for more information.
  *
  * @param $uid
  *   Integer specifying the user ID to load.
@@ -404,8 +404,6 @@ function user_load_by_name($name) {
 function user_save($account, $edit = array(), $category = 'account') {
   $transaction = db_transaction();
   try {
-    $table = drupal_get_schema('users');
-
     if (!empty($edit['pass'])) {
       // Allow alternate password hashing schemes.
       require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc');
@@ -419,6 +417,9 @@ function user_save($account, $edit = array(), $category = 'account') {
       // Avoid overwriting an existing password with a blank password.
       unset($edit['pass']);
     }
+    if (isset($edit['mail'])) {
+      $edit['mail'] = trim($edit['mail']);
+    }
 
     // Load the stored entity, if any.
     if (!empty($account->uid) && !isset($account->original)) {
@@ -441,27 +442,18 @@ function user_save($account, $edit = array(), $category = 'account') {
     user_module_invoke('presave', $edit, $account, $category);
 
     // Invoke presave operations of Field Attach API and Entity API. Those APIs
-    // require a fully-fledged (and updated) entity object, so $edit is not
-    // necessarily sufficient, as it technically contains submitted form values
-    // only. Therefore, we need to clone $account into a new object and copy any
-    // new property values of $edit into it.
-    $account_updated = clone $account;
+    // require a fully-fledged and updated entity object. Therefore, we need to
+    // copy any new property values of $edit into it.
     foreach ($edit as $key => $value) {
-      $account_updated->$key = $value;
-    }
-    field_attach_presave('user', $account_updated);
-    module_invoke_all('entity_presave', $account_updated, 'user');
-    // Update $edit with any changes modules might have applied to the account.
-    foreach ($account_updated as $key => $value) {
-      if (!property_exists($account, $key) || $value !== $account->$key) {
-        $edit[$key] = $value;
-      }
+      $account->$key = $value;
     }
+    field_attach_presave('user', $account);
+    module_invoke_all('entity_presave', $account, 'user');
 
     if (is_object($account) && !$account->is_new) {
       // Process picture uploads.
-      if (!$delete_previous_picture = empty($edit['picture']->fid)) {
-        $picture = $edit['picture'];
+      if (!empty($account->picture->fid) && (!isset($account->original->picture->fid) || $account->picture->fid != $account->original->picture->fid)) {
+        $picture = $account->picture;
         // If the picture is a temporary file move it to its final location and
         // make it permanent.
         if (!$picture->status) {
@@ -474,26 +466,23 @@ function user_save($account, $edit = array(), $category = 'account') {
 
           // Move the temporary file into the final location.
           if ($picture = file_move($picture, $destination, FILE_EXISTS_RENAME)) {
-            $delete_previous_picture = TRUE;
             $picture->status = FILE_STATUS_PERMANENT;
-            $edit['picture'] = file_save($picture);
+            $account->picture = file_save($picture);
             file_usage_add($picture, 'user', 'user', $account->uid);
           }
         }
+        // Delete the previous picture if it was deleted or replaced.
+        if (!empty($account->original->picture->fid)) {
+          file_usage_delete($account->original->picture, 'user', 'user', $account->uid);
+          file_delete($account->original->picture);
+        }
       }
-
-      // Delete the previous picture if it was deleted or replaced.
-      if ($delete_previous_picture && !empty($account->picture->fid)) {
-        file_usage_delete($account->picture, 'user', 'user', $account->uid);
-        file_delete($account->picture);
-      }
-
-      $edit['picture'] = empty($edit['picture']->fid) ? 0 : $edit['picture']->fid;
+      $account->picture = empty($account->picture->fid) ? 0 : $account->picture->fid;
 
       // Do not allow 'uid' to be changed.
-      $edit['uid'] = $account->uid;
+      $account->uid = $account->original->uid;
       // Save changes to the user table.
-      $success = drupal_write_record('users', $edit, 'uid');
+      $success = drupal_write_record('users', $account, 'uid');
       if ($success === FALSE) {
         // The query failed - better to abort the save than risk further
         // data loss.
@@ -501,13 +490,13 @@ function user_save($account, $edit = array(), $category = 'account') {
       }
 
       // Reload user roles if provided.
-      if (isset($edit['roles']) && is_array($edit['roles'])) {
+      if ($account->roles != $account->original->roles) {
         db_delete('users_roles')
           ->condition('uid', $account->uid)
           ->execute();
 
         $query = db_insert('users_roles')->fields(array('uid', 'rid'));
-        foreach (array_keys($edit['roles']) as $rid) {
+        foreach (array_keys($account->roles) as $rid) {
           if (!in_array($rid, array(DRUPAL_ANONYMOUS_RID, DRUPAL_AUTHENTICATED_RID))) {
             $query->values(array(
               'uid' => $account->uid,
@@ -519,13 +508,13 @@ function user_save($account, $edit = array(), $category = 'account') {
       }
 
       // Delete a blocked user's sessions to kick them if they are online.
-      if (isset($edit['status']) && $edit['status'] == 0) {
+      if ($account->original->status != $account->status && $account->status == 0) {
         drupal_session_destroy_uid($account->uid);
       }
 
       // If the password changed, delete all open sessions and recreate
       // the current one.
-      if (!empty($edit['pass'])) {
+      if ($account->pass != $account->original->pass) {
         drupal_session_destroy_uid($account->uid);
         if ($account->uid == $GLOBALS['user']->uid) {
           drupal_session_regenerate();
@@ -533,61 +522,56 @@ function user_save($account, $edit = array(), $category = 'account') {
       }
 
       // Save Field data.
-      $entity = (object) $edit;
-      field_attach_update('user', $entity);
-
-      // Refresh user object.
-      $user = user_load($account->uid, TRUE);
-      // Make the original, unchanged user account available to update hooks.
-      if (isset($account->original)) {
-        $user->original = $account->original;
-      }
+      field_attach_update('user', $account);
 
       // Send emails after we have the new user object.
-      if (isset($edit['status']) && $edit['status'] != $account->status) {
+      if ($account->status != $account->original->status) {
         // The user's status is changing; conditionally send notification email.
-        $op = $edit['status'] == 1 ? 'status_activated' : 'status_blocked';
-        _user_mail_notify($op, $user);
+        $op = $account->status == 1 ? 'status_activated' : 'status_blocked';
+        _user_mail_notify($op, $account);
       }
 
-      user_module_invoke('update', $edit, $user, $category);
-      module_invoke_all('entity_update', $user, 'user');
-      unset($user->original);
+      // Update $edit with any interim changes to $account.
+      foreach ($account as $key => $value) {
+        if (!property_exists($account->original, $key) || $value !== $account->original->$key) {
+          $edit[$key] = $value;
+        }
+      }
+      user_module_invoke('update', $edit, $account, $category);
+      module_invoke_all('entity_update', $account, 'user');
     }
     else {
       // Allow 'uid' to be set by the caller. There is no danger of writing an
       // existing user as drupal_write_record will do an INSERT.
-      if (empty($edit['uid'])) {
-        $edit['uid'] = db_next_id(db_query('SELECT MAX(uid) FROM {users}')->fetchField());
+      if (empty($account->uid)) {
+        $account->uid = db_next_id(db_query('SELECT MAX(uid) FROM {users}')->fetchField());
       }
       // Allow 'created' to be set by the caller.
-      if (!isset($edit['created'])) {
-        $edit['created'] = REQUEST_TIME;
+      if (!isset($account->created)) {
+        $account->created = REQUEST_TIME;
       }
-      $edit['mail'] = trim($edit['mail']);
-      $success = drupal_write_record('users', $edit);
+      $success = drupal_write_record('users', $account);
       if ($success === FALSE) {
         // On a failed INSERT some other existing user's uid may be returned.
         // We must abort to avoid overwriting their account.
         return FALSE;
       }
 
-      // Build a stub user object.
-      $user = (object) $edit;
-      $user->roles[DRUPAL_AUTHENTICATED_RID] = 'authenticated user';
+      // Make sure $account is properly initialized.
+      $account->roles[DRUPAL_AUTHENTICATED_RID] = 'authenticated user';
 
-      field_attach_insert('user', $user);
-
-      user_module_invoke('insert', $edit, $user, $category);
-      module_invoke_all('entity_insert', $user, 'user');
+      field_attach_insert('user', $account);
+      $edit = (array) $account;
+      user_module_invoke('insert', $edit, $account, $category);
+      module_invoke_all('entity_insert', $account, 'user');
 
       // Save user roles.
-      if (isset($edit['roles']) && is_array($edit['roles'])) {
+      if (count($account->roles) > 1) {
         $query = db_insert('users_roles')->fields(array('uid', 'rid'));
-        foreach (array_keys($edit['roles']) as $rid) {
+        foreach (array_keys($account->roles) as $rid) {
           if (!in_array($rid, array(DRUPAL_ANONYMOUS_RID, DRUPAL_AUTHENTICATED_RID))) {
             $query->values(array(
-              'uid' => $edit['uid'],
+              'uid' => $account->uid,
               'rid' => $rid,
             ));
           }
@@ -595,8 +579,13 @@ function user_save($account, $edit = array(), $category = 'account') {
         $query->execute();
       }
     }
+    // Clear internal properties.
+    unset($account->is_new);
+    unset($account->original);
+    // Clear the static loading cache.
+    entity_get_controller('user')->resetCache(array($account->uid));
 
-    return $user;
+    return $account;
   }
   catch (Exception $e) {
     $transaction->rollback();
@@ -655,7 +644,6 @@ function user_validate_name($name) {
  *   If the address is valid, nothing is returned.
  */
 function user_validate_mail($mail) {
-  $mail = trim($mail);
   if (!$mail) {
     return t('You must enter an e-mail address.');
   }
@@ -1203,6 +1191,11 @@ function user_account_form_validate($form, &$form_state) {
       }
     }
 
+    // Trim whitespace from mail, to prevent confusing 'e-mail not valid'
+    // warnings often caused by cutting and pasting.
+    $mail = trim($form_state['values']['mail']);
+    form_set_value($form['account']['mail'], $mail, $form_state);
+
     // Validate the e-mail address, and check if it is taken by an existing user.
     if ($error = user_validate_mail($form_state['values']['mail'])) {
       form_set_error('mail', $error);
@@ -1480,6 +1473,7 @@ function template_preprocess_user_picture(&$variables) {
 function theme_user_list($variables) {
   $users = $variables['users'];
   $title = $variables['title'];
+  $items = array();
 
   if (!empty($users)) {
     foreach ($users as $user) {
@@ -2518,8 +2512,8 @@ function user_build_content($account, $view_mode = 'full', $langcode = NULL) {
   $account->content = array();
 
   // Build fields content.
-  field_attach_prepare_view('user', array($account->uid => $account), $view_mode);
-  entity_prepare_view('user', array($account->uid => $account));
+  field_attach_prepare_view('user', array($account->uid => $account), $view_mode, $langcode);
+  entity_prepare_view('user', array($account->uid => $account), $langcode);
   $account->content += field_attach_view('user', $account, $view_mode, $langcode);
 
   // Populate $account->content with a render() array.
@@ -2823,6 +2817,10 @@ function user_role_save($role) {
     $query->addExpression('MAX(weight)');
     $role->weight = $query->execute()->fetchField() + 1;
   }
+
+  // Let modules modify the user role before it is saved to the database.
+  module_invoke_all('user_role_presave', $role);
+
   if (!empty($role->rid) && $role->name) {
     $status = drupal_write_record('role', $role, 'rid');
     module_invoke_all('user_role_update', $role);
diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc
index d9ad3bebce190c635757c52cd59520a67929b3c4..697a82d2c2c5cf132dcc6fa28d3ca11f8f1f9142 100644
--- a/modules/user/user.pages.inc
+++ b/modules/user/user.pages.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: user.pages.inc,v 1.78 2010/12/01 00:29:41 webchick Exp $
 
 /**
  * @file
diff --git a/modules/user/user.permissions.js b/modules/user/user.permissions.js
index ca4e5ff7724e3ed6017627add5d96930af9c3a6e..4ef576cd44a0bc51c07ba2342aeb1adb0b5b236d 100644
--- a/modules/user/user.permissions.js
+++ b/modules/user/user.permissions.js
@@ -1,4 +1,3 @@
-// $Id: user.permissions.js,v 1.2 2010/04/19 21:17:16 webchick Exp $
 (function ($) {
 
 /**
diff --git a/modules/user/user.test b/modules/user/user.test
index 064b37e0cd15ecef4bd53e68758719fb1724b11d..6ecbfac771c244edbe27ce72f4fca2b3a1e95e0a 100644
--- a/modules/user/user.test
+++ b/modules/user/user.test
@@ -1,5 +1,9 @@
 <?php
-// $Id: user.test,v 1.111 2010/12/18 00:56:18 dries Exp $
+
+/**
+ * @file
+ * Tests for user.module.
+ */
 
 class UserRegistrationTestCase extends DrupalWebTestCase {
   public static function getInfo() {
@@ -104,6 +108,31 @@ class UserRegistrationTestCase extends DrupalWebTestCase {
     $this->assertText(t('Member for'), t('User can log in after administrator approval.'));
   }
 
+  function testRegistrationEmailDuplicates() {
+    // Don't require e-mail verification.
+    variable_set('user_email_verification', FALSE);
+
+    // Allow registration by site visitors without administrator approval.
+    variable_set('user_register', USER_REGISTER_VISITORS);
+
+    // Set up a user to check for duplicates.
+    $duplicate_user = $this->drupalCreateUser();
+
+    $edit = array();
+    $edit['name'] = $this->randomName();
+    $edit['mail'] = $duplicate_user->mail;
+
+    // Attempt to create a new account using an existing e-mail address.
+    $this->drupalPost('user/register', $edit, t('Create new account'));
+    $this->assertText(t('The e-mail address @email is already registered.', array('@email' => $duplicate_user->mail)), t('Supplying an exact duplicate email address displays an error message'));
+
+    // Attempt to bypass duplicate email registration validation by adding spaces.
+    $edit['mail'] = '   ' . $duplicate_user->mail . '   ';
+
+    $this->drupalPost('user/register', $edit, t('Create new account'));
+    $this->assertText(t('The e-mail address @email is already registered.', array('@email' => $duplicate_user->mail)), t('Supplying a duplicate email address with added whitespace displays an error message'));
+  }
+
   function testRegistrationDefaultValues() {
     // Allow registration by site visitors without administrator approval.
     variable_set('user_register', USER_REGISTER_VISITORS);
@@ -406,6 +435,7 @@ class UserLoginTestCase extends DrupalWebTestCase {
       'pass' => $account->pass_raw,
     );
     $this->drupalPost('user', $edit, t('Log in'));
+    $this->assertNoFieldByXPath("//input[@name='pass' and @value!='']", NULL, t('Password value attribute is blank.'));
     if (isset($flood_trigger)) {
       if ($flood_trigger == 'user') {
         $this->assertRaw(format_plural(variable_get('user_failed_login_user_limit', 5), 'Sorry, there has been more than one failed login attempt for this account. It is temporarily blocked. Try again later or <a href="@url">request a new password</a>.', 'Sorry, there have been more than @count failed login attempts for this account. It is temporarily blocked. Try again later or <a href="@url">request a new password</a>.', array('@url' => url('user/password'))));
@@ -1899,7 +1929,7 @@ class UserTokenReplaceTestCase extends DrupalWebTestCase {
 
     foreach ($tests as $input => $expected) {
       $output = token_replace($input, array('user' => $account), array('language' => $language));
-      $this->assertFalse(strcmp($output, $expected), t('Sanitized user token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, t('Sanitized user token %token replaced.', array('%token' => $input)));
     }
 
     // Generate and test unsanitized tokens.
@@ -1909,7 +1939,7 @@ class UserTokenReplaceTestCase extends DrupalWebTestCase {
 
     foreach ($tests as $input => $expected) {
       $output = token_replace($input, array('user' => $account), array('language' => $language, 'sanitize' => FALSE));
-      $this->assertFalse(strcmp($output, $expected), t('Unsanitized user token %token replaced.', array('%token' => $input)));
+      $this->assertEqual($output, $expected, t('Unsanitized user token %token replaced.', array('%token' => $input)));
     }
   }
 }
diff --git a/modules/user/user.tokens.inc b/modules/user/user.tokens.inc
index e17eacf7660db7cd5cf13772ba8dac6c146526ea..8dcea4b597e0be894e254f0eba99094e960c9d97 100644
--- a/modules/user/user.tokens.inc
+++ b/modules/user/user.tokens.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: user.tokens.inc,v 1.9 2010/12/09 08:01:56 webchick Exp $
 
 /**
  * @file
diff --git a/profiles/minimal/minimal.info b/profiles/minimal/minimal.info
index 96404bc34a86b1e4c61ad69a345c661fd2238f2e..f7102f9573d9cb29000a67901c5d6aa9d2db50ec 100644
--- a/profiles/minimal/minimal.info
+++ b/profiles/minimal/minimal.info
@@ -1,4 +1,3 @@
-; $Id: minimal.info,v 1.1 2010/01/04 23:08:34 webchick Exp $
 name = Minimal
 description = Start with only a few modules enabled.
 version = VERSION
@@ -7,8 +6,8 @@ dependencies[] = block
 dependencies[] = dblog
 files[] = minimal.profile
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/profiles/minimal/minimal.install b/profiles/minimal/minimal.install
index ea3259980e5814e0d9520deab3db6ef75467ba17..059f038c2e7aa5755c85a968c96e8d0e8f50d1d3 100644
--- a/profiles/minimal/minimal.install
+++ b/profiles/minimal/minimal.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: minimal.install,v 1.6 2010/07/08 03:41:27 webchick Exp $
 
 /**
  * Implements hook_install().
diff --git a/profiles/minimal/minimal.profile b/profiles/minimal/minimal.profile
index 8fb1b82f6940f90cc51a58f9e326c73b6532acb8..ff8f28105ec1f661e7d248f1c36ad7357af25079 100644
--- a/profiles/minimal/minimal.profile
+++ b/profiles/minimal/minimal.profile
@@ -1,5 +1,4 @@
 <?php
-// $Id: minimal.profile,v 1.2 2010/07/22 16:16:42 dries Exp $
 
 /**
  * Implements hook_form_FORM_ID_alter().
diff --git a/profiles/minimal/translations/README.txt b/profiles/minimal/translations/README.txt
index d5cf750159a1695b718a58ef2e2b279a28bf6b61..a0afa5166a105993abae771a4cc1381ae77ed6b2 100644
--- a/profiles/minimal/translations/README.txt
+++ b/profiles/minimal/translations/README.txt
@@ -1,4 +1,3 @@
-// $Id: README.txt,v 1.1 2010/09/22 01:49:17 webchick Exp $
 
 This directory should be used to place downloaded translations
 for installing Drupal core.
diff --git a/profiles/standard/standard.info b/profiles/standard/standard.info
index 9abd5fa585f5ad56eac6f80e6cd1da2e044202c9..857f7062b14b7b4eba02f18fd1411d016b3a2447 100644
--- a/profiles/standard/standard.info
+++ b/profiles/standard/standard.info
@@ -1,4 +1,3 @@
-; $Id: standard.info,v 1.2 2010/10/25 15:48:41 webchick Exp $
 name = Standard
 description = Install with commonly used features pre-configured.
 version = VERSION
@@ -26,8 +25,8 @@ dependencies[] = file
 dependencies[] = rdf
 files[] = standard.profile
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/profiles/standard/standard.install b/profiles/standard/standard.install
index 8e0b47b1395edc68dd759d54c0bcd148e1beb37f..70829064d1bc3c929f20c3c112bbc0957e1e752d 100644
--- a/profiles/standard/standard.install
+++ b/profiles/standard/standard.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: standard.install,v 1.30 2011/01/04 18:24:24 webchick Exp $
 
 /**
  * Implements hook_install().
@@ -272,7 +271,7 @@ function standard_install() {
   $description = st('Use tags to group articles on similar topics into categories.');
   $help = st('Enter a comma-separated list of words to describe your content.');
   $vocabulary = (object) array(
-    'name' => 'Tags',
+    'name' => st('Tags'),
     'description' => $description,
     'machine_name' => 'tags',
     'help' => $help,
@@ -299,7 +298,7 @@ function standard_install() {
   $instance = array(
     'field_name' => 'field_' . $vocabulary->machine_name,
     'entity_type' => 'node',
-    'label' => $vocabulary->name,
+    'label' => 'Tags',
     'bundle' => 'article',
     'description' => $vocabulary->help,
     'widget' => array(
diff --git a/profiles/standard/standard.profile b/profiles/standard/standard.profile
index 97d5d8768a910288664c463baf10eaf6de0db4f9..7671c12a2d992cdd8753847214ededbeaaa4663d 100644
--- a/profiles/standard/standard.profile
+++ b/profiles/standard/standard.profile
@@ -1,5 +1,4 @@
 <?php
-// $Id: standard.profile,v 1.2 2010/07/22 16:16:42 dries Exp $
 
 /**
  * Implements hook_form_FORM_ID_alter().
diff --git a/profiles/standard/translations/README.txt b/profiles/standard/translations/README.txt
index d5cf750159a1695b718a58ef2e2b279a28bf6b61..a0afa5166a105993abae771a4cc1381ae77ed6b2 100644
--- a/profiles/standard/translations/README.txt
+++ b/profiles/standard/translations/README.txt
@@ -1,4 +1,3 @@
-// $Id: README.txt,v 1.1 2010/09/22 01:49:17 webchick Exp $
 
 This directory should be used to place downloaded translations
 for installing Drupal core.
diff --git a/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info b/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
index 8745a56da814bd0b5ee76c71e7266e382e692ee5..030649d164c87a6eaca7809ae7e996712dcc0fd4 100644
--- a/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
+++ b/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
@@ -1,4 +1,3 @@
-; $Id: drupal_system_listing_compatible_test.info,v 1.2 2010/12/21 16:31:47 webchick Exp $
 name = "Drupal system listing compatible test"
 description = "Support module for testing the drupal_system_listing function."
 package = Testing
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module b/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module
index 4155b320357d25ee0d36ca6e9e1430d501ded96d..b3d9bbc7f3711e882119cd6b3af051245d859d04 100644
--- a/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module
+++ b/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module
@@ -1,2 +1 @@
 <?php
-// $Id: drupal_system_listing_compatible_test.module,v 1.1 2010/11/15 00:37:08 webchick Exp $
diff --git a/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info b/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
index beba696fbf5ae0d54202173e5780a22993e4ddec..f61b87249e927b95a1dfa3d8b55189609f1a9788 100644
--- a/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
+++ b/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
@@ -1,4 +1,3 @@
-; $Id: drupal_system_listing_incompatible_test.info,v 1.2 2010/12/21 16:31:47 webchick Exp $
 name = "Drupal system listing incompatible test"
 description = "Support module for testing the drupal_system_listing function."
 package = Testing
@@ -9,8 +8,8 @@ version = VERSION
 core = 6.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module b/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module
index d5db920e6f8d0bfae75423f536e559e97ff59ecc..b3d9bbc7f3711e882119cd6b3af051245d859d04 100644
--- a/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module
+++ b/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module
@@ -1,2 +1 @@
 <?php
-// $Id: drupal_system_listing_incompatible_test.module,v 1.1 2010/11/15 00:37:08 webchick Exp $
diff --git a/profiles/testing/testing.info b/profiles/testing/testing.info
index 82fad90580fcde772484436f5d363af3db9b4e57..dc403e5fe76b747d33f3936bd7321685b92c655f 100644
--- a/profiles/testing/testing.info
+++ b/profiles/testing/testing.info
@@ -1,12 +1,11 @@
-; $Id: testing.info,v 1.2 2010/08/27 12:36:53 webchick Exp $
 name = Testing
 description = Minimal profile for running tests. Includes absolutely required modules only.
 version = VERSION
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/profiles/testing/testing.install b/profiles/testing/testing.install
index 6426140c858d8f1b52ac7f05451439d9d11a340a..192704d75191541436c4fde16a004a86de2460e2 100644
--- a/profiles/testing/testing.install
+++ b/profiles/testing/testing.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: testing.install,v 1.2 2010/08/27 12:36:53 webchick Exp $
 
 /**
  * Implements hook_install().
diff --git a/profiles/testing/testing.profile b/profiles/testing/testing.profile
index 5d804dec3dd93d83cd0b5aaada0ebbe6a5734c9d..a4abe2dafcb3fabac023b6d4630c24fed41379c0 100644
--- a/profiles/testing/testing.profile
+++ b/profiles/testing/testing.profile
@@ -1,3 +1,2 @@
 <?php
-// $Id: testing.profile,v 1.1 2010/08/22 15:31:18 dries Exp $
 
diff --git a/robots.txt b/robots.txt
index a5490c6ec28d620705eb6a5686d3713f5c9e9170..490fa59f87e6b1ab1c861f9c919c4e42d6b70926 100644
--- a/robots.txt
+++ b/robots.txt
@@ -1,4 +1,3 @@
-# $Id: robots.txt,v 1.15 2010/12/29 04:05:07 webchick Exp $
 #
 # robots.txt
 #
diff --git a/scripts/code-clean.sh b/scripts/code-clean.sh
index b5d69ec3f95057f14a651d4887ceb4f50f2bf2dd..3338b6ada9d13008780b41522b629e86b4e66620 100644
--- a/scripts/code-clean.sh
+++ b/scripts/code-clean.sh
@@ -1,5 +1,4 @@
 #!/bin/sh
-# $Id: code-clean.sh,v 1.10 2009/03/09 20:46:37 dries Exp $
 
 find . -name "*~" -type f | xargs rm -f
 find . -name ".#*" -type f | xargs rm -f
diff --git a/scripts/cron-curl.sh b/scripts/cron-curl.sh
index df4ed9986f9fff2a4936f9a5051592be19bf9f10..9b168ab364a5c6a29d881f9af41f2faf700889a7 100644
--- a/scripts/cron-curl.sh
+++ b/scripts/cron-curl.sh
@@ -1,4 +1,3 @@
 #!/bin/sh
-# $Id: cron-curl.sh,v 1.3 2006/08/22 07:38:24 dries Exp $
 
 curl --silent --compressed http://example.com/cron.php
diff --git a/scripts/cron-lynx.sh b/scripts/cron-lynx.sh
index 9ceb2dbd5d35a8d10044986ca81eb61dc2590c67..904667acb11f9047f9145dc97da3c363ae2ffd2c 100644
--- a/scripts/cron-lynx.sh
+++ b/scripts/cron-lynx.sh
@@ -1,4 +1,3 @@
 #!/bin/sh
-# $Id: cron-lynx.sh,v 1.3 2006/08/22 07:38:24 dries Exp $
 
 /usr/bin/lynx -source http://example.com/cron.php > /dev/null 2>&1
diff --git a/scripts/drupal.sh b/scripts/drupal.sh
index 435f6144f18bbf51d7734b5db27d078301bda614..5d064f5713a3c7bf7706b1de3a570b8621043cd0 100755
--- a/scripts/drupal.sh
+++ b/scripts/drupal.sh
@@ -1,6 +1,5 @@
 #!/usr/bin/env php
 <?php
-// $Id: drupal.sh,v 1.9 2009/09/19 10:38:47 dries Exp $
 
 /**
  * Drupal shell execution script
diff --git a/scripts/dump-database-d6.sh b/scripts/dump-database-d6.sh
index 0feb63471369f53ac1818620166fd152f3bee153..41146b075c21870b0b832f2f90fabdecb9091a32 100644
--- a/scripts/dump-database-d6.sh
+++ b/scripts/dump-database-d6.sh
@@ -1,6 +1,5 @@
 #!/usr/bin/env php
 <?php
-// $Id: dump-database-d6.sh,v 1.3 2010/07/30 01:28:00 dries Exp $
 
 /**
  * Dump a Drupal 6 database into a Drupal 7 PHP script to test the upgrade
@@ -34,7 +33,6 @@ include_once dirname(__FILE__) . '/../includes/utility.inc';
 // Output the PHP header.
 $output = <<<ENDOFHEADER
 <?php
-// \$Id\$
 
 /**
  * @file
diff --git a/scripts/generate-d6-content.sh b/scripts/generate-d6-content.sh
index b58197558b7b917aca036220dadeaddbda5a0540..bba61caee066d757611d6c2343c925a5ac1a8112 100644
--- a/scripts/generate-d6-content.sh
+++ b/scripts/generate-d6-content.sh
@@ -1,6 +1,5 @@
 #!/usr/bin/env php
 <?php
-// $Id: generate-d6-content.sh,v 1.3 2010/09/11 00:39:49 webchick Exp $
 
 /**
  * Generate content for a Drupal 6 database to test the upgrade process.
diff --git a/scripts/password-hash.sh b/scripts/password-hash.sh
index 3a7243e9b69519aac27c766e1f49ec869caf20d3..004421a896c1841f009d20fed8f872cc0eb18f72 100755
--- a/scripts/password-hash.sh
+++ b/scripts/password-hash.sh
@@ -1,6 +1,5 @@
 #!/usr/bin/php
 <?php
-// $Id: password-hash.sh,v 1.7 2010/05/01 08:12:23 dries Exp $
 
 /**
  * Drupal hash script - to generate a hash from a plaintext password
diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh
index 0c10d5dd390a53493de10645d7031228b7809a31..2cfbcac9fada4519aedcbd5196dbd71ef925cd9e 100755
--- a/scripts/run-tests.sh
+++ b/scripts/run-tests.sh
@@ -1,5 +1,4 @@
 <?php
-// $Id: run-tests.sh,v 1.43 2010/11/13 13:54:58 dries Exp $
 /**
  * @file
  * This script runs Drupal tests from command line.
diff --git a/sites/all/README.txt b/sites/all/README.txt
index 6fef9a4a1ffd8495283d3cee024289668221fc68..c8970883a7adc39b30d7d00c93713a7b19cd336e 100644
--- a/sites/all/README.txt
+++ b/sites/all/README.txt
@@ -1,4 +1,3 @@
-// $Id: README.txt,v 1.4 2009/03/18 09:53:04 dries Exp $
 
 This directory should be used to place downloaded and custom modules
 and themes which are common to all sites. Keeping contributed and
diff --git a/sites/all/modules/README.txt b/sites/all/modules/README.txt
index d18eb4ffd23ac2e69476c3e2c772406b9ce1be19..f4e35b558359cac87ace1a6e6db58384dcc928a5 100644
--- a/sites/all/modules/README.txt
+++ b/sites/all/modules/README.txt
@@ -1,4 +1,3 @@
-// $Id: README.txt,v 1.1 2009/01/22 04:33:38 webchick Exp $
 
 This directory should be used to place downloaded and custom modules
 which are common to all sites. This will allow you to more easily
diff --git a/sites/all/modules/ctools/API.txt b/sites/all/modules/ctools/API.txt
index 2187e8a56cbfbf55e72a311a2fba0ba5914bd5b2..29000a48b8aee0663c504a0512ee693a6fd9f03a 100644
--- a/sites/all/modules/ctools/API.txt
+++ b/sites/all/modules/ctools/API.txt
@@ -1,12 +1,25 @@
-API.txt: $Id: API.txt,v 1.16 2010/10/11 22:18:22 sdboyer Exp $
+Current API Version: 2.0.1
+
+Please note that the API version is an internal number and does not match release numbers. It is entirely possible that releases will not increase the API version number, and increasing this number too often would burden contrib module maintainers who need to keep up with API changes.
 
 This file contains a log of changes to the API.
-API Version 2.0
+
+API Version 2.0.1
+  Introduce ctools_export_crud_enable(), ctools_export_crud_disable() and
+    ctools_export_crud_set_status() and requisite changes.
+  Introduce 'object factory' to export schema, allowing modules to control
+    how the exportable objects are instantiated.
+  
+API Version 2.0 
   Remove the deprecated callback-based behavior of the 'defaults' property on
     plugin types; array addition is now the only option. If you need more
     complex logic, do it with the 'process' callback.
   Introduce a global plugin type registration hook and remove the per-plugin
     type magic callbacks.
+  Introduce $owner . '_' . $api . '_hook_name' allowing modules to use their own
+    API hook in place of 'hook_ctools_plugin_api'.
+  Introduce ctools_plugin_api_get_hook() to get the hook name above.
+  Introduce 'cache defaults' and 'default cache bin' keys to export.inc
 
 Versions prior to 2.0 have been removed from this document. See the D6 version
 for that information.
diff --git a/sites/all/modules/ctools/CHANGELOG.txt b/sites/all/modules/ctools/CHANGELOG.txt
index 28967f3e7a1a85623f4e543e3ab38f6f014e2ff6..c5bd5e6dc1ba959868e664b8cab49b3a4dd0e906 100644
--- a/sites/all/modules/ctools/CHANGELOG.txt
+++ b/sites/all/modules/ctools/CHANGELOG.txt
@@ -1,5 +1,12 @@
 Current API VERSION: 2.0. See API.txt for more information.
 
+ctools 7.x-1.x-dev
+==================
+#1008120: "New custom content" shows empty form if custom content panes module is not enabled.
+#999302 by troky: Fix jump menu. Apparently this wasn't actually committed the last time it was committed.
+#1065976 by tekante and David_Rothstein: Reset plugin static cache during module enable to prevent stale data from harming export ui.
+#1016510 by EclipseGC: Make the taxonomy system page functional.
+
 ctools 7.x-1.x-alpha2 (05-Jan-2011)
 ===================================
 
diff --git a/sites/all/modules/ctools/bulk_export/bulk_export.css b/sites/all/modules/ctools/bulk_export/bulk_export.css
index a7df2cf5c168adb301022b4bc104a6a3f045dc4f..14ac83b07710d66ce77fb49e27098f672f2f8ed8 100644
--- a/sites/all/modules/ctools/bulk_export/bulk_export.css
+++ b/sites/all/modules/ctools/bulk_export/bulk_export.css
@@ -1,4 +1,3 @@
-/* $Id: bulk_export.css,v 1.1 2009/07/12 11:32:30 sdboyer Exp $ */
 
 div.export-container {
   width: 48%;
@@ -13,6 +12,13 @@ div.export-container table {
 div.export-container table input,
 div.export-container table th,
 div.export-container table td {
-  padding: 0 0 0 .5em;
+  padding: 0 0 2px .5em;
   margin: 0;
-}
\ No newline at end of file
+  border-right: none;
+  border-left: none;
+  vertical-align: center;
+}
+
+div.export-container .select-all {
+  width: 1.5em;
+}
diff --git a/sites/all/modules/ctools/bulk_export/bulk_export.info b/sites/all/modules/ctools/bulk_export/bulk_export.info
index 12f230b25bca6c10e8311fe26a50b32233fc5c87..7e17fd735148f09ac1c1fa57de335d9ac21a0e1f 100644
--- a/sites/all/modules/ctools/bulk_export/bulk_export.info
+++ b/sites/all/modules/ctools/bulk_export/bulk_export.info
@@ -1,13 +1,12 @@
-; $Id: bulk_export.info,v 1.4 2011/01/01 00:01:46 merlinofchaos Exp $
 name = Bulk Export
 description = Performs bulk exporting of data objects known about by Chaos tools.
 core = 7.x
 dependencies[] = ctools
 package = Chaos tool suite
 
-; Information added by drupal.org packaging script on 2011-01-06
-version = "7.x-1.0-alpha2"
+; Information added by drupal.org packaging script on 2011-05-31
+version = "7.x-1.0-beta1"
 core = "7.x"
 project = "ctools"
-datestamp = "1294276864"
+datestamp = "1306885315"
 
diff --git a/sites/all/modules/ctools/bulk_export/bulk_export.module b/sites/all/modules/ctools/bulk_export/bulk_export.module
index 9ac962ce07294618045f357292c522bc7b7b8e37..f614f577cf1fc4daa147cfeba3d2f0562f23e57d 100644
--- a/sites/all/modules/ctools/bulk_export/bulk_export.module
+++ b/sites/all/modules/ctools/bulk_export/bulk_export.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: bulk_export.module,v 1.6 2010/10/11 22:18:24 sdboyer Exp $
 
 /**
  * @file
@@ -66,7 +65,7 @@ function bulk_export_export() {
       drupal_set_title(t('Bulk export results'));
       $output = '';
       $module_code = '';
-      $api_code = '';
+      $api_code = array();
       $dependencies = array();
       foreach ($form_state['code'] as $module => $api_info) {
         if ($module == 'general') {
@@ -74,56 +73,61 @@ function bulk_export_export() {
         }
         else {
           foreach ($api_info as $api => $info) {
-            $api_code .= "  if (\$module == '$module' && \$api == '$api') {\n";
-            $api_code .= "    return array('version' => $info[version]);\n";
-            $api_code .= "  }\n";
+            $api_hook = ctools_plugin_api_get_hook($module, $api);
+            if (empty($api_code[$api_hook])) {
+              $api_code[$api_hook] = '';
+            }
+            $api_code[$api_hook] .= "  if (\$module == '$module' && \$api == '$api') {\n";
+            $api_code[$api_hook] .= "    return array('version' => $info[version]);\n";
+            $api_code[$api_hook] .= "  }\n";
             $dependencies[$module] = TRUE;
 
             $file = $form_state['module'] . '.' . $api . '.inc';
-            $code = "<?php\n";
-            $code .= "// \$Id" . ": $\n\n";
+            $code = "<?php\n\n";
             $code .= "/**\n";
             $code .= " * @file\n";
             $code .= " * Bulk export of $api objects generated by Bulk export module.\n";
             $code .= " */\n\n";
             $code .= $info['code'];
-            $output .= drupal_render(drupal_get_form('ctools_export_form', $code, t('Place this in @file', array('@file' => $file))));
+            $export_form = drupal_get_form('ctools_export_form', $code, t('Place this in @file', array('@file' => $file)));
+            $output .= drupal_render($export_form);
           }
         }
       }
 
       // Add hook_ctools_plugin_api at the top of the module code, if there is any.
       if ($api_code) {
-        $api =  "/**\n";
-        $api .= " * Implements hook_ctools_plugin_api().\n";
-        $api .= " */\n";
-        $api .= "function $form_state[module]_ctools_plugin_api(\$module, \$api) {\n";
-        $api .= $api_code;
-        $api .= "}\n";
-        $module_code = $api . $module_code;
+        foreach ($api_code as $api_hook => $text) {
+          $api =  "\n/**\n";
+          $api .= " * Implement hook_$api_hook().\n";
+          $api .= " */\n";
+          $api .= "function $form_state[module]_$api_hook(\$module, \$api) {\n";
+          $api .= $text;
+          $api .= "}\n";
+          $module_code = $api . $module_code;
+        }
       }
 
       if ($module_code) {
-        $module =  "<?php\n";
-        $module .= "// \$Id" . ": $\n\n";
+        $module =  "<?php\n\n";
         $module .= "/**\n";
         $module .= " * @file\n";
         $module .= " * Bulk export of objects generated by Bulk export module.\n";
-        $module .= " */\n\n";
+        $module .= " */\n";
         $module .= $module_code;
-        $output = drupal_render(drupal_get_form('ctools_export_form', $module, t('Place this in @file', array('@file' => $form_state['module'] . '.module')))) . $output;
+        $export_form = drupal_get_form('ctools_export_form', $module, t('Place this in @file', array('@file' => $form_state['module'] . '.module')));
+        $output = drupal_render($export_form) . $output;
       }
 
-      $info  = "; \$Id" . ": $\n"; // The break in the string prevents CVS from subbing the ID.
-      $info .= strtr("name = @module export module\n", array('@module' => $form_state['module']));
+      $info = strtr("name = @module export module\n", array('@module' => $form_state['module']));
       $info .= strtr("description = Export objects from CTools\n", array('@module' => $form_state['values']['name']));
       foreach ($dependencies as $module => $junk) {
         $info .= "dependencies[] = $module\n";
       }
       $info .= "package = Chaos tool suite\n";
       $info .= "core = 7.x\n";
-      $info .= "files[] = " . check_plain($form_state['module'] . '.info') . "\n";
-      $output = drupal_render(drupal_get_form('ctools_export_form', $info, t('Place this in @file', array('@file' => $form_state['module'] . '.info')))) . $output;
+      $export_form = drupal_get_form('ctools_export_form', $info, t('Place this in @file', array('@file' => $form_state['module'] . '.info')));
+      $output = drupal_render($export_form) . $output;
 
     }
 
diff --git a/sites/all/modules/ctools/css/button.css b/sites/all/modules/ctools/css/button.css
new file mode 100644
index 0000000000000000000000000000000000000000..91a6044915e34d0b38d17d5c9e893cc0a667ec37
--- /dev/null
+++ b/sites/all/modules/ctools/css/button.css
@@ -0,0 +1,32 @@
+/* $Id$ */
+
+.ctools-button-processed {
+  border-style: solid;
+  border-width: 1px;
+  display: inline-block;
+  line-height: 1;
+}
+
+.ctools-button-processed:hover {
+  cursor: pointer;
+}
+
+.ctools-button-processed .ctools-content {
+  padding-bottom: 2px;
+  padding-top: 2px;
+}
+
+.ctools-no-js .ctools-content ul,
+.ctools-button-processed .ctools-content ul {
+  list-style-image: none;
+  list-style-type: none;
+}
+
+.ctools-button-processed li {
+  line-height: 1.3333;
+}
+
+.ctools-button li a {
+  padding-left: 12px;
+  padding-right: 12px;
+}
\ No newline at end of file
diff --git a/sites/all/modules/ctools/css/collapsible-div.css b/sites/all/modules/ctools/css/collapsible-div.css
index b1fc6e1a8947c5a218f3f5b18fb51028886e560f..91e787691e53495590569abe7f06744929232084 100644
--- a/sites/all/modules/ctools/css/collapsible-div.css
+++ b/sites/all/modules/ctools/css/collapsible-div.css
@@ -1,4 +1,3 @@
-/* $Id: collapsible-div.css,v 1.2 2008/11/27 17:29:34 merlinofchaos Exp $ */
 
 .ctools-collapsible-container .ctools-toggle {
   float: left;
diff --git a/sites/all/modules/ctools/css/context.css b/sites/all/modules/ctools/css/context.css
index 8522156bafa7c60564728d430af95b483a584bc7..5093104c83abc1670f2f1246adbaffe6047d5f21 100644
--- a/sites/all/modules/ctools/css/context.css
+++ b/sites/all/modules/ctools/css/context.css
@@ -1,4 +1,3 @@
-/* $Id: context.css,v 1.2 2008/12/05 00:15:36 merlinofchaos Exp $ */
 .ctools-context-holder .ctools-context-title {
   float: left;
   width: 49%;
diff --git a/sites/all/modules/ctools/css/ctools.css b/sites/all/modules/ctools/css/ctools.css
index 4dede743a68b3336d639a7955ae25e86784ba5ab..7372988df8a07c921a717b57c5e26bb27618f817 100644
--- a/sites/all/modules/ctools/css/ctools.css
+++ b/sites/all/modules/ctools/css/ctools.css
@@ -1,4 +1,3 @@
-/* $Id: ctools.css,v 1.5 2010/09/07 09:02:50 sdboyer Exp $ */
 .ctools-locked {
   color: red;
   border: 1px solid red;
diff --git a/sites/all/modules/ctools/css/dropbutton.css b/sites/all/modules/ctools/css/dropbutton.css
new file mode 100644
index 0000000000000000000000000000000000000000..7825111aec7fc72382a6379a8bdccedfaac06f48
--- /dev/null
+++ b/sites/all/modules/ctools/css/dropbutton.css
@@ -0,0 +1,67 @@
+/* $Id$ */
+
+.ctools-dropbutton-processed {
+  padding-right: 18px;
+  position: relative;
+  background-color: inherit;
+}
+
+.ctools-dropbutton-processed.open {
+  z-index: 200;
+}
+
+.ctools-dropbutton-processed .ctools-content li,
+.ctools-dropbutton-processed .ctools-content a {
+  display: block;
+}
+
+.ctools-dropbutton-processed .ctools-link {
+  bottom: 0;
+  display: block;
+  height: auto;
+  position: absolute;
+  right: 0;
+  text-indent: -9999px; /* LTR */
+  top: 0;
+  width: 17px;
+}
+
+.ctools-dropbutton-processed .ctools-link a {
+  overflow: hidden;
+}
+
+.ctools-dropbutton-processed .ctools-content ul {
+  margin: 0;
+  overflow: hidden;
+}
+
+.ctools-dropbutton-processed.open li + li {
+  padding-top: 4px;
+}
+
+/**
+ * This creates the dropbutton arrow and inherits the link color
+ */
+.ctools-twisty {
+  border-bottom-color: transparent;
+  border-left-color: transparent;
+  border-right-color: transparent;
+  border-style: solid;
+  border-width: 4px 4px 0;
+  line-height: 0;
+  right: 6px;
+  position: absolute;
+  top: 0.75em;
+}
+
+.ctools-dropbutton-processed.open .ctools-twisty {
+  border-bottom: 4px solid;
+  border-left-color: transparent;
+  border-right-color: transparent;
+  border-top-color: transparent;
+  top: 0.5em;
+}
+
+.ctools-no-js .ctools-twisty {
+  display: none;
+}
diff --git a/sites/all/modules/ctools/css/dropdown.css b/sites/all/modules/ctools/css/dropdown.css
index f1ad4792ea5b7689606cfb05f2ebf701b8193de3..bb50f3f44131bb5b7300209ee6f75a772a0f3324 100644
--- a/sites/all/modules/ctools/css/dropdown.css
+++ b/sites/all/modules/ctools/css/dropdown.css
@@ -1,4 +1,3 @@
-/* $Id: dropdown.css,v 1.6 2010/10/11 22:18:23 sdboyer Exp $ */
 html.js div.ctools-dropdown div.ctools-dropdown-container {
   z-index: 1001;
   display: none;
diff --git a/sites/all/modules/ctools/css/export-ui-list.css b/sites/all/modules/ctools/css/export-ui-list.css
index f53d886d1c097cea13001840c7d7c911952ce9f3..170d128ade6390c8fe01c9878513ed6d9401f315 100644
--- a/sites/all/modules/ctools/css/export-ui-list.css
+++ b/sites/all/modules/ctools/css/export-ui-list.css
@@ -1,4 +1,3 @@
-/* $Id: export-ui-list.css,v 1.3 2011/01/05 23:16:59 merlinofchaos Exp $ */
 body form#ctools-export-ui-list-form {
   margin: 0 0 20px 0;
 }
@@ -30,4 +29,17 @@ tr.ctools-export-ui-disabled td {
 th.ctools-export-ui-operations,
 td.ctools-export-ui-operations {
   text-align: right; /* LTR */
+  vertical-align: top;
+}
+
+/* Force the background color to inherit so that the dropbuttons do not need
+   a specific background color. */
+td.ctools-export-ui-operations {
+  background-color: inherit;
+}
+
+td.ctools-export-ui-operations .ctools-dropbutton {
+  text-align: left; /* LTR */
+  position: absolute;
+  right: 10px;
 }
diff --git a/sites/all/modules/ctools/css/modal.css b/sites/all/modules/ctools/css/modal.css
index c3faf2d7272a650b2a3acace607b7cc43ea2207d..66c4a1c3ba1f477323ef41a12385f32458c1d88a 100644
--- a/sites/all/modules/ctools/css/modal.css
+++ b/sites/all/modules/ctools/css/modal.css
@@ -1,4 +1,3 @@
-/* $Id: modal.css,v 1.9 2011/01/01 00:31:27 merlinofchaos Exp $ */
 div.ctools-modal-content {
   background: #fff;
   color: #000;
@@ -122,7 +121,6 @@ div.ctools-modal-content .option-text-aligner label.hidden-options {
   background: none;
 }
 
-
 div.ctools-modal-content .dependent-options {
   padding-left: 30px;
 }
diff --git a/sites/all/modules/ctools/css/stylizer.css b/sites/all/modules/ctools/css/stylizer.css
index 4a63f408700aba7b9efb407fe996ce52788fa1a6..a16ec789bfd960ab98508bb59cb6f62ac899fd1a 100644
--- a/sites/all/modules/ctools/css/stylizer.css
+++ b/sites/all/modules/ctools/css/stylizer.css
@@ -1,4 +1,3 @@
-/* $Id: stylizer.css,v 1.2 2010/10/11 22:18:23 sdboyer Exp $ */
 
 /* Farbtastic placement */
 .color-form {
diff --git a/sites/all/modules/ctools/css/wizard.css b/sites/all/modules/ctools/css/wizard.css
index ce305f8655b7c7f8611b3025066bafae25c54cde..d42a2db061239c11c160cb07196124c3065151d3 100644
--- a/sites/all/modules/ctools/css/wizard.css
+++ b/sites/all/modules/ctools/css/wizard.css
@@ -1,4 +1,3 @@
-/* $Id: wizard.css,v 1.1 2008/12/06 02:13:48 merlinofchaos Exp $ */
 
 .wizard-trail {
   font-size: 120%;
diff --git a/sites/all/modules/ctools/ctools.api.php b/sites/all/modules/ctools/ctools.api.php
index 78ae15c9b2030c6178bad628665268bf8d0b5258..8e74d06b010b56bcc74dcabd5b19e854b0e18b40 100644
--- a/sites/all/modules/ctools/ctools.api.php
+++ b/sites/all/modules/ctools/ctools.api.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctools.api.php,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
@@ -82,6 +81,42 @@ function hook_ctools_plugin_directory($owner, $plugin_type) {
   // Finally, if nothing matches, it's safe to return nothing at all (or NULL).
 }
 
+/**
+ * Alter a plugin before it has been processed.
+ *
+ * This hook is useful for altering flags or other information that will be
+ * used or possibly overriden by the process hook if defined.
+ *
+ * @param $plugin
+ *   An associative array defining a plugin.
+ * @param $info
+ *   An associative array of plugin type info.
+ */
+function hook_ctools_plugin_pre_alter(&$plugin, &$info) {
+  // Override a function defined by the plugin.
+  if ($info['type'] == 'my_type') {
+    $plugin['my_flag'] = 'new_value';
+  }
+}
+
+/**
+ * Alter a plugin after it has been processed.
+ *
+ * This hook is useful for overriding the final values for a plugin after it
+ * has been processed.
+ *
+ * @param $plugin
+ *   An associative array defining a plugin.
+ * @param $info
+ *   An associative array of plugin type info.
+ */
+function hook_ctools_plugin_post_alter(&$plugin, &$info) {
+  // Override a function defined by the plugin.
+  if ($info['type'] == 'my_type') {
+    $plugin['my_function'] = 'new_function';
+  }
+}
+
 /**
  * @} End of "addtogroup hooks".
- */
\ No newline at end of file
+ */
diff --git a/sites/all/modules/ctools/ctools.info b/sites/all/modules/ctools/ctools.info
index 81a66f2f34fd7e3eb1083edacf82c335cc166e0c..08b7887757d11b4be2fcfbb727f040a990471ee6 100644
--- a/sites/all/modules/ctools/ctools.info
+++ b/sites/all/modules/ctools/ctools.info
@@ -1,4 +1,3 @@
-; $Id: ctools.info,v 1.10 2011/01/01 00:01:46 merlinofchaos Exp $
 name = Chaos tools
 description = A library of helpful tools by Merlin of Chaos.
 core = 7.x
@@ -7,9 +6,9 @@ files[] = includes/context.inc
 files[] = includes/math-expr.inc
 files[] = includes/stylizer.inc
 
-; Information added by drupal.org packaging script on 2011-01-06
-version = "7.x-1.0-alpha2"
+; Information added by drupal.org packaging script on 2011-05-31
+version = "7.x-1.0-beta1"
 core = "7.x"
 project = "ctools"
-datestamp = "1294276864"
+datestamp = "1306885315"
 
diff --git a/sites/all/modules/ctools/ctools.install b/sites/all/modules/ctools/ctools.install
index c050f2283926957061899cb88bc02e53b64feb4c..e4447db0f79c1a5d91152b12ee4b76344701c559 100644
--- a/sites/all/modules/ctools/ctools.install
+++ b/sites/all/modules/ctools/ctools.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctools.install,v 1.15 2010/09/07 09:02:50 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/ctools.module b/sites/all/modules/ctools/ctools.module
index 3b90bb7393298e7914f864ff7b4e01147dfa9eaf..7b7499eecfb9087082d1641f7de432fe55ba2a5e 100644
--- a/sites/all/modules/ctools/ctools.module
+++ b/sites/all/modules/ctools/ctools.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctools.module,v 1.40 2011/01/05 20:06:57 merlinofchaos Exp $
 
 /**
  * @file
@@ -10,7 +9,7 @@
  * must be implemented in the module file.
  */
 
-define('CTOOLS_API_VERSION', '2.0-alpha1');
+define('CTOOLS_API_VERSION', '2.0.1');
 
 /**
  * Test the CTools API version.
@@ -112,10 +111,21 @@ function ctools_include($file, $module = 'ctools', $dir = 'includes') {
 
   if (!isset($used[$module][$dir][$file])) {
     require_once DRUPAL_ROOT . '/' . drupal_get_path('module', $module) . "$dir$file.inc";
-    $used[$module][$dir][$file] = true;
+    $used[$module][$dir][$file] = TRUE;
   }
 }
 
+/**
+ * Include .inc files in a form context.
+ *
+ * This is a variant of ctools_include that will save information in the
+ * the form_state so that cached forms will properly include things.
+ */
+function ctools_form_include(&$form_state, $file, $module = 'ctools', $dir = 'includes') {
+  $dir = '/' . ($dir ? $dir . '/' : '');
+  form_load_include($form_state, 'inc', $module, $dir . $file);
+}
+
 /**
  * Provide the proper path to an image as necessary.
  *
@@ -150,6 +160,28 @@ function ctools_add_css($file, $module = 'ctools', $dir = 'css') {
   drupal_add_css(drupal_get_path('module', $module) . "/$dir/$file.css");
 }
 
+/**
+ * Format a css file name for use with $form['#attached']['css'].
+ *
+ * This helper function is used by ctools but can also be used in other
+ * modules in the same way as explained in the comments of ctools_include.
+ *
+ * @code
+ *   $form['#attached']['css'] = array(ctools_attach_css('collapsible-div'));
+ *   $form['#attached']['css'][ctools_attach_css('collapsible-div')] = array('preprocess' => FALSE);
+ * @endcode
+ *
+ * @param $file
+ *   The base file name to be included.
+ * @param $module
+ *   Optional module containing the include.
+ * @param $dir
+ *   Optional subdirectory containing the include file.
+ */
+function ctools_attach_css($file, $module = 'ctools', $dir = 'css') {
+  return drupal_get_path('module', $module) . "/$dir/$file.css";
+}
+
 /**
  * Include js files as necessary.
  *
@@ -193,15 +225,12 @@ function ctools_attach_js($file, $module = 'ctools', $dir = 'js') {
  *
  * @return
  *   An array of role names keyed by role ID.
+ *
+ * @deprecated
+ *    user_roles() should be used instead.
  */
 function ctools_get_roles() {
-  static $roles = NULL;
-  if (!isset($roles)) {
-    $roles = user_roles(TRUE);
-    unset($roles[DRUPAL_AUTHENTICATED_RID]);
-  }
-
-  return $roles;
+  return user_roles();
 }
 
 /*
@@ -338,8 +367,8 @@ function ctools_init() {
  * Shutdown handler used during ajax operations to help catch fatal errors.
  */
 function ctools_shutdown_handler() {
-  if (function_exists('error_get_last') AND ($error = error_get_last())){
-    switch($error['type']){
+  if (function_exists('error_get_last') AND ($error = error_get_last())) {
+    switch ($error['type']) {
       case E_ERROR:
       case E_CORE_ERROR:
       case E_COMPILE_ERROR:
@@ -370,7 +399,7 @@ function ctools_shutdown_handler() {
 function ctools_theme() {
   ctools_include('utility');
   $items = array();
-  _ctools_passthrough($items, 'theme');
+  ctools_passthrough('ctools', 'theme', $items);
   return $items;
 }
 
@@ -380,7 +409,7 @@ function ctools_theme() {
 function ctools_menu() {
   ctools_include('utility');
   $items = array();
-  _ctools_passthrough($items, 'menu');
+  ctools_passthrough('ctools', 'menu', $items);
   return $items;
 }
 
@@ -389,7 +418,8 @@ function ctools_menu() {
  */
 function ctools_cron() {
   ctools_include('utility');
-  _ctools_passthrough($items, 'cron');
+  $items = array();
+  ctools_passthrough('ctools', 'cron', $items);
 }
 
 /**
@@ -400,7 +430,7 @@ function ctools_flush_caches() {
   // in an inconsistent fashion and it does not necessarily mean to *flush*
   // caches when running from cron. Instead it's just getting a list of cache
   // tables and may not do any flushing.
-  if (variable_get('cron_semaphore', FALSE)) {
+  if (!empty($GLOBALS['locks']['cron'])) {
     return;
   }
 
@@ -409,15 +439,12 @@ function ctools_flush_caches() {
 }
 
 /**
- * Provide a search form with a different id so that form_alters will miss it
- * and thus not get advanced search settings.
+ * Implements hook_element_info_alter().
+ *
  */
-function ctools_forms() {
-  $forms['ctools_search_form']= array(
-    'callback' => 'search_form',
-  );
-
-  return $forms;
+function ctools_element_info_alter(&$type) {
+  ctools_include('dependent');
+  ctools_dependent_element_info_alter($type);
 }
 
 /**
@@ -467,7 +494,7 @@ function ctools_ctools_plugin_type() {
   ctools_include('utility');
   $items = array();
   // Add all the plugins that have their own declaration space elsewhere.
-  _ctools_passthrough($items, 'plugin-type');
+  ctools_passthrough('ctools', 'plugin-type', $items);
 
   return $items;
 }
@@ -480,11 +507,11 @@ function ctools_ctools_plugin_type() {
  * templates based upon input when the panel was configured.
  */
 function ctools_preprocess_node(&$vars) {
-  // The 'panel_identifier' attribute of the node is added when the pane is
+  // The 'ctools_template_identifier' attribute of the node is added when the pane is
   // rendered.
-  if (!empty($vars['node']->panel_identifier)) {
-    $vars['panel_identifier'] = check_plain($vars['node']->panel_identifier);
-    $vars['template_files'][] = 'node-panel-' . check_plain($vars['node']->panel_identifier);
+  if (!empty($vars['node']->ctools_template_identifier)) {
+    $vars['ctools_template_identifier'] = check_plain($vars['node']->ctools_template_identifier);
+    $vars['theme_hook_suggestions'][] = 'node__panel__' . check_plain($vars['node']->ctools_template_identifier);
   }
 }
 
@@ -618,11 +645,10 @@ function ctools_export_ui_load($item_name, $plugin_name) {
   if (!$return) {
     ctools_include('export-ui');
     $plugin = ctools_get_export_ui($plugin_name);
+    $handler = ctools_export_ui_get_handler($plugin);
 
-    if ($plugin) {
-      // Get the load callback.
-      $item = ctools_export_crud_load($plugin['schema'], $item_name);
-      return empty($item) ? FALSE : $item;
+    if ($handler) {
+      return $handler->load_item($item_name);
     }
   }
 
@@ -734,10 +760,59 @@ function ctools_block_list_alter(&$blocks) {
     foreach ($blocks as $block_id => $block) {
       // @todo -- possibly we can set configuration for this so that users can
       // specify which blocks will not get rendered.
-      if (substr_compare($block->region, 'sidebar', 0)) {
+      if (substr_compare($block->region, 'sidebar', 0) >= 0) {
         unset($blocks[$block_id]);
       }
     }
   }
 }
 
+/**
+ * Implement hook_modules_enabled to clear static caches for detecting new plugins
+ */
+function ctools_modules_enabled($modules) {
+  ctools_include('plugins');
+  ctools_get_plugins_reset();
+}
+
+/**
+ * Menu theme callback.
+ *
+ * This simply ensures that Panels ajax calls are rendered in the same
+ * theme as the original page to prevent .css file confusion.
+ *
+ * To use this, set this as the theme callback on AJAX related menu
+ * items. Since the ajax page state won't be sent during ajax requests,
+ * it should be safe to use even if ajax isn't invoked.
+ */
+function ctools_ajax_theme_callback() {
+  if (!empty($_POST['ajax_page_state']['theme'])) {
+    return $_POST['ajax_page_state']['theme'];
+  }
+}
+
+function ctools_ctools_entity_context_alter(&$plugin, &$entity, $plugin_id) {
+  ctools_include('context');
+  switch ($plugin_id) {
+    case 'entity_id:taxonomy_term':
+      $plugin['no ui'] = TRUE;
+      break;
+    case 'entity:user':
+      $plugin = ctools_get_context('user');
+      unset($plugin['no ui']);
+      unset($plugin['no required context ui']);
+      break;
+  }
+
+  // Apply restrictions on taxonomy term reverse relationships whose
+  // restrictions are in the settings on the field.
+  if (!empty($plugin['parent']) &&
+      $plugin['parent'] == 'entity_from_field' &&
+      !empty($plugin['reverse']) &&
+      $plugin['to entity'] == 'taxonomy_term') {
+    $field = field_info_field($plugin['field name']);
+    if (isset($field['settings']['allowed_values'][0]['vocabulary'])) {
+      $plugin['required context']->restrictions = array('vocabulary' => array($field['settings']['allowed_values'][0]['vocabulary']));
+    }
+  }
+}
diff --git a/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info b/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info
index 34697927ca949dc1e84bbde684b99963962fb9c3..b1af3988b172eaace230f2e9a8a3543601a010dc 100644
--- a/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info
+++ b/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info
@@ -1,13 +1,12 @@
-; $Id: ctools_access_ruleset.info,v 1.3 2011/01/01 00:01:46 merlinofchaos Exp $
 name = Custom rulesets
 description = Create custom, exportable, reusable access rulesets for applications like Panels.
 core = 7.x
 package = Chaos tool suite
 dependencies[] = ctools
 
-; Information added by drupal.org packaging script on 2011-01-06
-version = "7.x-1.0-alpha2"
+; Information added by drupal.org packaging script on 2011-05-31
+version = "7.x-1.0-beta1"
 core = "7.x"
 project = "ctools"
-datestamp = "1294276864"
+datestamp = "1306885315"
 
diff --git a/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.install b/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.install
index b5278fa85022b8ae430f68eb24e0f3acdddfd488..b1613d8b51eb1b7bea23bc82c31a71ec867e4341 100644
--- a/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.install
+++ b/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctools_access_ruleset.install,v 1.2 2010/10/11 22:18:24 sdboyer Exp $
 
 /**
  * Schema for customizable access rulesets.
diff --git a/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.module b/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.module
index 6d320e277863f326105eafcf9c9daf552b60663d..fb39f37917574e57b41933d96b11327488e3d113 100644
--- a/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.module
+++ b/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctools_access_ruleset.module,v 1.3 2011/01/05 22:57:26 merlinofchaos Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/ctools_access_ruleset/plugins/access/ruleset.inc b/sites/all/modules/ctools/ctools_access_ruleset/plugins/access/ruleset.inc
index d8de9c212d34064318f8abab2e8941499742e42e..782c7cabf77ddae5f83e4f40dccc7386de407921 100644
--- a/sites/all/modules/ctools/ctools_access_ruleset/plugins/access/ruleset.inc
+++ b/sites/all/modules/ctools/ctools_access_ruleset/plugins/access/ruleset.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: ruleset.inc,v 1.2 2010/10/11 22:18:23 sdboyer Exp $
 
 /**
  * @file
@@ -76,9 +75,13 @@ function ctools_ruleset_ctools_access_get_children($plugin, $parent) {
  * Settings form for the 'by ruleset' access plugin
  */
 function ctools_ruleset_ctools_access_settings(&$form, &$form_state, $conf) {
-  $form['markup'] = array(
-    '#value' => '<div class="description">' . check_plain($form_state['plugin']['ruleset']->admin_description) . '</div>',
-  );
+  if (!empty($form_state['plugin']['ruleset']->admin_description)) {
+    $form['markup'] = array(
+      '#markup' => '<div class="description">' . check_plain($form_state['plugin']['ruleset']->admin_description) . '</div>',
+    );
+  }
+
+  return $form;
 }
 
 /**
@@ -96,6 +99,11 @@ function ctools_ruleset_ctools_access_check($conf, $context, $plugin) {
  * Provide a summary description based upon the checked roles.
  */
 function ctools_ruleset_ctools_access_summary($conf, $context, $plugin) {
-  return check_plain($plugin['ruleset']->admin_description);
+  if (!empty($form_state['plugin']['ruleset']->admin_description)) {
+    return check_plain($plugin['ruleset']->admin_description);
+  }
+  else {
+    return check_plain($plugin['ruleset']->admin_title);
+  }
 }
 
diff --git a/sites/all/modules/ctools/ctools_access_ruleset/plugins/export_ui/ctools_access_ruleset.inc b/sites/all/modules/ctools/ctools_access_ruleset/plugins/export_ui/ctools_access_ruleset.inc
index a1a2db47cd1f002cac81253684fcd3a89b851338..d2a1c605644bdf94421002248e03393438f75e7d 100644
--- a/sites/all/modules/ctools/ctools_access_ruleset/plugins/export_ui/ctools_access_ruleset.inc
+++ b/sites/all/modules/ctools/ctools_access_ruleset/plugins/export_ui/ctools_access_ruleset.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctools_access_ruleset.inc,v 1.2 2010/10/11 22:18:23 sdboyer Exp $
 
 $plugin = array(
   'schema' => 'ctools_access_ruleset',
diff --git a/sites/all/modules/ctools/ctools_access_ruleset/plugins/export_ui/ctools_access_ruleset_ui.class.php b/sites/all/modules/ctools/ctools_access_ruleset/plugins/export_ui/ctools_access_ruleset_ui.class.php
index 540e3d2a644f3c00d3d4554ac3948470e7ddc722..b18146455310a4b6123df8a859ad4a704358e2a2 100644
--- a/sites/all/modules/ctools/ctools_access_ruleset/plugins/export_ui/ctools_access_ruleset_ui.class.php
+++ b/sites/all/modules/ctools/ctools_access_ruleset/plugins/export_ui/ctools_access_ruleset_ui.class.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctools_access_ruleset_ui.class.php,v 1.2 2010/10/11 22:18:23 sdboyer Exp $
 
 class ctools_access_ruleset_ui extends ctools_export_ui {
 
diff --git a/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info b/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info
index 79e33ffe6038c5449a52074166ac66be67103437..1f1159be396969d9594e56cae59d056ec75ee8fe 100644
--- a/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info
+++ b/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info
@@ -1,13 +1,12 @@
-; $Id: ctools_ajax_sample.info,v 1.3 2011/01/01 00:01:46 merlinofchaos Exp $
 name = Chaos Tools (CTools) AJAX Example
 description = Shows how to use the power of Chaos AJAX.
 package = Chaos tool suite
 dependencies[] = ctools
 core = 7.x
 
-; Information added by drupal.org packaging script on 2011-01-06
-version = "7.x-1.0-alpha2"
+; Information added by drupal.org packaging script on 2011-05-31
+version = "7.x-1.0-beta1"
 core = "7.x"
 project = "ctools"
-datestamp = "1294276864"
+datestamp = "1306885315"
 
diff --git a/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.install b/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.install
index ee2b6d90aacf6206a69cbfd30734e38311b376a3..04325dbf418b23d2d5d2ead9498fea9763c853bf 100644
--- a/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.install
+++ b/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctools_ajax_sample.install,v 1.2 2010/10/11 22:18:23 sdboyer Exp $ 
 
 /**
  * @file 
diff --git a/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.module b/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.module
index c261d9c831fc3ec987dae5169942df9cad19cf6a..463e4a8060ba735c9625735a907f0e068a22cbe0 100644
--- a/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.module
+++ b/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctools_ajax_sample.module,v 1.5 2010/12/31 23:58:52 merlinofchaos Exp $
 
 /**
  * @file
@@ -26,6 +25,13 @@ function ctools_ajax_sample_menu() {
     'access callback' => TRUE,
     'type' => MENU_CALLBACK,
   );
+  $items['ctools_ajax_sample/%ctools_js/hello'] = array(
+      'title' => 'Hello World',
+      'page callback' => 'ctools_ajax_sample_hello',
+      'page arguments' => array(1),
+      'access callback' => TRUE,
+      'type' => MENU_CALLBACK,
+  );
   $items['ctools_ajax_sample/%ctools_js/tablenix/%'] = array(
       'title' => 'Hello World',
       'page callback' => 'ctools_ajax_sample_tablenix',
@@ -148,7 +154,8 @@ function ctools_ajax_sample_page() {
   if ($user->uid == 0) {
     $links[] = ctools_modal_text_button(t('Modal Login (default style)'), 'ctools_ajax_sample/nojs/login', t('Login via modal'));
 
-    // The extra class points to the info in ctools-sample-style which we added to the settings.
+    // The extra class points to the info in ctools-sample-style which we added
+    // to the settings, prefixed with 'ctools-modal'.
     $links[] = ctools_modal_text_button(t('Modal Login (custom style)'), 'ctools_ajax_sample/nojs/login', t('Login via modal'),  'ctools-modal-ctools-sample-style');
   }
 
@@ -260,9 +267,8 @@ function ctools_ajax_sample_login($js = NULL) {
     'ajax' => TRUE,
   );
   $output = ctools_modal_form_wrapper('user_login', $form_state);
-  if (empty($output)) {
-    // empty $output signifies success, so we'll use it as our $commands
-    // array.
+  if (!empty($form_state['executed'])) {
+    // We'll just overwrite the form output if it was successful.
     $output = array();
     $inplace = ctools_ajax_text_button(t('remain here'), 'ctools_ajax_sample/nojs/login/inplace', t('Go to your account'));
     $account = ctools_ajax_text_button(t('your account'), 'ctools_ajax_sample/nojs/login/user', t('Go to your account'));
@@ -282,6 +288,7 @@ function ctools_ajax_sample_login_success($js, $action) {
   }
 
   ctools_include('ajax');
+  ctools_add_js('ajax-responder');
   $commands = array();
   if ($action == 'inplace') {
     // stay here
@@ -709,7 +716,8 @@ function ctools_ajax_sample_show_raptor($object) {
  */
 function ctools_ajax_sample_jump_menu_form() {
   $url = url('ctools_ajax_sample/jumped');
-  $form = ctools_jump_menu(array(), array($url => t('Jump!')), array());
+  $form_state = array();
+  $form = ctools_jump_menu(array(), $form_state, array($url => t('Jump!')), array());
   return $form;
 }
 
diff --git a/sites/all/modules/ctools/ctools_ajax_sample/images/ajax-loader.gif b/sites/all/modules/ctools/ctools_ajax_sample/images/ajax-loader.gif
new file mode 100644
index 0000000000000000000000000000000000000000..d84f653789e5008da64ff04ee109471284a9e284
Binary files /dev/null and b/sites/all/modules/ctools/ctools_ajax_sample/images/ajax-loader.gif differ
diff --git a/sites/all/modules/ctools/ctools_ajax_sample/images/loading-large.gif b/sites/all/modules/ctools/ctools_ajax_sample/images/loading-large.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1c72ebb554be018511ae972c3f2361dff02dce02
Binary files /dev/null and b/sites/all/modules/ctools/ctools_ajax_sample/images/loading-large.gif differ
diff --git a/sites/all/modules/ctools/ctools_ajax_sample/images/loading.gif b/sites/all/modules/ctools/ctools_ajax_sample/images/loading.gif
new file mode 100644
index 0000000000000000000000000000000000000000..dc21df1837f54a65bbdf6a857f8358de880d63d9
Binary files /dev/null and b/sites/all/modules/ctools/ctools_ajax_sample/images/loading.gif differ
diff --git a/sites/all/modules/ctools/ctools_ajax_sample/images/popups-border.png b/sites/all/modules/ctools/ctools_ajax_sample/images/popups-border.png
new file mode 100644
index 0000000000000000000000000000000000000000..ba939f8994e793b3aa47757c6227c7762e1fdd9c
Binary files /dev/null and b/sites/all/modules/ctools/ctools_ajax_sample/images/popups-border.png differ
diff --git a/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info b/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info
index 320a6232229d2d835841f07737cd67b053638a11..09e989876387b0784ea31bb036f6244240db48f4 100644
--- a/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info
+++ b/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info
@@ -1,13 +1,12 @@
-; $Id: ctools_custom_content.info,v 1.3 2011/01/01 00:01:46 merlinofchaos Exp $
 name = Custom content panes
 description = Create custom, exportable, reusable content panes for applications like Panels.
 core = 7.x
 package = Chaos tool suite
 dependencies[] = ctools
 
-; Information added by drupal.org packaging script on 2011-01-06
-version = "7.x-1.0-alpha2"
+; Information added by drupal.org packaging script on 2011-05-31
+version = "7.x-1.0-beta1"
 core = "7.x"
 project = "ctools"
-datestamp = "1294276864"
+datestamp = "1306885315"
 
diff --git a/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.install b/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.install
index 4ff0f874bbcab25d1c3025046f0eefad287d2cb6..8348434b5f827f66067248db32eefb49ec441e5d 100644
--- a/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.install
+++ b/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctools_custom_content.install,v 1.2 2010/10/11 22:18:21 sdboyer Exp $
 
 /**
  * Schema for CTools custom content.
diff --git a/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.module b/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.module
index 9676540c045c42591c5b19435a8037031ad452ad..a2e8ee241b600411f14fe8b4cf60e8fe51be1a6a 100644
--- a/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.module
+++ b/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctools_custom_content.module,v 1.3 2011/01/05 22:57:26 merlinofchaos Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/ctools_custom_content/plugins/export_ui/ctools_custom_content.inc b/sites/all/modules/ctools/ctools_custom_content/plugins/export_ui/ctools_custom_content.inc
index fe634f4e6855b9fea5c2980b80ffb4ed0dea9032..467dc5804af5c81dd3bd1dc44401fd60e1d53bb3 100644
--- a/sites/all/modules/ctools/ctools_custom_content/plugins/export_ui/ctools_custom_content.inc
+++ b/sites/all/modules/ctools/ctools_custom_content/plugins/export_ui/ctools_custom_content.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctools_custom_content.inc,v 1.2 2010/10/11 22:18:23 sdboyer Exp $
 
 $plugin = array(
   'schema' => 'ctools_custom_content',
diff --git a/sites/all/modules/ctools/ctools_custom_content/plugins/export_ui/ctools_custom_content_ui.class.php b/sites/all/modules/ctools/ctools_custom_content/plugins/export_ui/ctools_custom_content_ui.class.php
index 9f8928271df43ff0dd997f062e90b8717da27b5f..e78c89f0d4a6b3d17cd4947f74e3f2c32b30668e 100644
--- a/sites/all/modules/ctools/ctools_custom_content/plugins/export_ui/ctools_custom_content_ui.class.php
+++ b/sites/all/modules/ctools/ctools_custom_content/plugins/export_ui/ctools_custom_content_ui.class.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctools_custom_content_ui.class.php,v 1.2 2010/10/11 22:18:23 sdboyer Exp $
 
 class ctools_custom_content_ui extends ctools_export_ui {
 
@@ -99,12 +98,14 @@ class ctools_custom_content_ui extends ctools_export_ui {
         break;
     }
 
+    $ops = theme('links__ctools_dropbutton', array('links' => $operations, 'attributes' => array('class' => array('links', 'inline'))));
+
     $this->rows[$item->name] = array(
       'data' => array(
         array('data' => check_plain($item->name), 'class' => array('ctools-export-ui-name')),
         array('data' => check_plain($item->admin_title), 'class' => array('ctools-export-ui-title')),
         array('data' => check_plain($item->category), 'class' => array('ctools-export-ui-category')),
-        array('data' => theme('links', array('links' => $operations)), 'class' => array('ctools-export-ui-operations')),
+        array('data' => $ops, 'class' => array('ctools-export-ui-operations')),
       ),
       'title' => check_plain($item->admin_description),
       'class' => array(!empty($item->disabled) ? 'ctools-export-ui-disabled' : 'ctools-export-ui-enabled'),
diff --git a/sites/all/modules/ctools/ctools_plugin_example/README.txt b/sites/all/modules/ctools/ctools_plugin_example/README.txt
index e13b9457351d93bccda02c234e7bce2d70c5dd6e..42edcdc9025c3c28d542fde5e07e4b77fdeee618 100644
--- a/sites/all/modules/ctools/ctools_plugin_example/README.txt
+++ b/sites/all/modules/ctools/ctools_plugin_example/README.txt
@@ -1,4 +1,3 @@
-// $Id: README.txt,v 1.2 2010/10/11 22:18:24 sdboyer Exp $
 
 The CTools Plugin Example is an example for developers of how to CTools
 access, argument, content type, context, and relationship plugins.
diff --git a/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info b/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info
index 7b43c9d3cdc2e8a2f34206dcbcf1408004647678..b6ba31ede434abe42cbc410560e68e1341e2f173 100644
--- a/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info
+++ b/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info
@@ -1,4 +1,3 @@
-; $Id: ctools_plugin_example.info,v 1.3 2011/01/01 00:01:46 merlinofchaos Exp $
 name = Chaos Tools (CTools) Plugin Example
 description = Shows how an external module can provide ctools plugins (for Panels, etc.).
 package = Chaos tool suite
@@ -8,9 +7,9 @@ dependencies[] = page_manager
 dependencies[] = advanced_help
 core = 7.x
 
-; Information added by drupal.org packaging script on 2011-01-06
-version = "7.x-1.0-alpha2"
+; Information added by drupal.org packaging script on 2011-05-31
+version = "7.x-1.0-beta1"
 core = "7.x"
 project = "ctools"
-datestamp = "1294276864"
+datestamp = "1306885315"
 
diff --git a/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.module b/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.module
index 8ac4d6aaf59931b7ea9605bff2d4aba3f4ee1fcc..442969d7b10ced9f91e9a1b05b733e1701a51b7f 100644
--- a/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.module
+++ b/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctools_plugin_example.module,v 1.2 2009/10/17 22:58:24 sdboyer Exp $
 
 /*
  * @file
diff --git a/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.pages_default.inc b/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.pages_default.inc
index 751a8ada9d31a79779a93ef2753295cfc2dec2cf..10a76193826443f20dce69dd6b5a0275033223cd 100644
--- a/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.pages_default.inc
+++ b/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.pages_default.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctools_plugin_example.pages_default.inc,v 1.2 2010/01/29 19:53:48 merlinofchaos Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/ctools_plugin_example/plugins/access/arg_length.inc b/sites/all/modules/ctools/ctools_plugin_example/plugins/access/arg_length.inc
index 11d065c681be693954354ebb5e3c6e1c4809bdd5..2a09eea127d6f75d8f9ef7bffcc96f95fbd49e16 100644
--- a/sites/all/modules/ctools/ctools_plugin_example/plugins/access/arg_length.inc
+++ b/sites/all/modules/ctools/ctools_plugin_example/plugins/access/arg_length.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: arg_length.inc,v 1.3 2010/09/07 09:02:50 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/ctools_plugin_example/plugins/access/example_role.inc b/sites/all/modules/ctools/ctools_plugin_example/plugins/access/example_role.inc
index 63f8dd98000f3764ee1bfec2e603b3e0d844650f..bbe364c153d8865e85378a391924b416be82b4b6 100644
--- a/sites/all/modules/ctools/ctools_plugin_example/plugins/access/example_role.inc
+++ b/sites/all/modules/ctools/ctools_plugin_example/plugins/access/example_role.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: example_role.inc,v 1.3 2010/09/07 09:02:50 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/ctools_plugin_example/plugins/arguments/simplecontext_arg.inc b/sites/all/modules/ctools/ctools_plugin_example/plugins/arguments/simplecontext_arg.inc
index fe245b6ac310d2e07d4fe0f18a8ffbae0d602c67..51c7c601c99984998f961cff50d6ba749a4beae7 100644
--- a/sites/all/modules/ctools/ctools_plugin_example/plugins/arguments/simplecontext_arg.inc
+++ b/sites/all/modules/ctools/ctools_plugin_example/plugins/arguments/simplecontext_arg.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: simplecontext_arg.inc,v 1.2 2010/01/29 19:53:48 merlinofchaos Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/no_context_content_type.inc b/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/no_context_content_type.inc
index ffe9438eb0531d8aa4d31c644acef7b3fc283689..2141c215f7b2ae558abf09f9e2bed284ec11fd0d 100644
--- a/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/no_context_content_type.inc
+++ b/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/no_context_content_type.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: no_context_content_type.inc,v 1.2 2010/01/29 19:53:48 merlinofchaos Exp $
 
 /**
  * @file
@@ -87,7 +86,7 @@ function no_context_content_type_render($subtype, $conf, $args, $context) {
  * ctools_plugin_example_no_context_content_type_edit_form.
  *
  */
-function no_context_content_type_edit_form(&$form, &$form_state) {
+function no_context_content_type_edit_form($form, &$form_state) {
   $conf = $form_state['conf'];
   $form['item1'] = array(
     '#type' => 'textfield',
@@ -114,4 +113,4 @@ function no_context_content_type_edit_form_submit(&$form, &$form_state) {
   foreach (array('item1', 'item2') as $key) {
     $form_state['conf'][$key] = $form_state['values'][$key];
   }
-}
\ No newline at end of file
+}
diff --git a/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/relcontext_content_type.inc b/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/relcontext_content_type.inc
index 60ef7bc49898b24b9e45f353c43e7d345e3bfa8f..b0742e0c3a565fbc8c50855c15855e8caf652279 100644
--- a/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/relcontext_content_type.inc
+++ b/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/relcontext_content_type.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: relcontext_content_type.inc,v 1.3 2010/01/29 19:53:48 merlinofchaos Exp $
 
 
 /**
diff --git a/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/simplecontext_content_type.inc b/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/simplecontext_content_type.inc
index 0759aecb44c8671f1c54f2e2948850acca860f8d..82291d063fdc287045c28be7faff49cc9879ca6b 100644
--- a/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/simplecontext_content_type.inc
+++ b/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/simplecontext_content_type.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: simplecontext_content_type.inc,v 1.3 2010/01/29 19:53:48 merlinofchaos Exp $
 
 
 /**
diff --git a/sites/all/modules/ctools/ctools_plugin_example/plugins/contexts/relcontext.inc b/sites/all/modules/ctools/ctools_plugin_example/plugins/contexts/relcontext.inc
index 313d6346b14543f377730deb7345a7fd48ecca33..0c7ef113556a150a45208c71a150b4df575ace64 100644
--- a/sites/all/modules/ctools/ctools_plugin_example/plugins/contexts/relcontext.inc
+++ b/sites/all/modules/ctools/ctools_plugin_example/plugins/contexts/relcontext.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: relcontext.inc,v 1.2 2010/01/29 19:53:48 merlinofchaos Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/ctools_plugin_example/plugins/contexts/simplecontext.inc b/sites/all/modules/ctools/ctools_plugin_example/plugins/contexts/simplecontext.inc
index 2ddf50c0837cb2d079983491895d18461b5c57f6..e19a84229617740ce8a4dd422aa4f0b4787799c8 100644
--- a/sites/all/modules/ctools/ctools_plugin_example/plugins/contexts/simplecontext.inc
+++ b/sites/all/modules/ctools/ctools_plugin_example/plugins/contexts/simplecontext.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: simplecontext.inc,v 1.2 2010/01/29 19:53:48 merlinofchaos Exp $
 
 
 /**
diff --git a/sites/all/modules/ctools/ctools_plugin_example/plugins/panels.pages.inc b/sites/all/modules/ctools/ctools_plugin_example/plugins/panels.pages.inc
index 8807f75396d3b1ce6f4b35e2874afe390fb22cd4..d3022af7fc194a91224bc7663d7d91e0530f62a7 100644
--- a/sites/all/modules/ctools/ctools_plugin_example/plugins/panels.pages.inc
+++ b/sites/all/modules/ctools/ctools_plugin_example/plugins/panels.pages.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: panels.pages.inc,v 1.3 2009/10/17 22:58:26 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/ctools_plugin_example/plugins/relationships/relcontext_from_simplecontext.inc b/sites/all/modules/ctools/ctools_plugin_example/plugins/relationships/relcontext_from_simplecontext.inc
index 6e24ed76d48987e239e9f807c3285d8570b307e6..6224621042338ee1c60bc760c4d4eaa4068c4a19 100644
--- a/sites/all/modules/ctools/ctools_plugin_example/plugins/relationships/relcontext_from_simplecontext.inc
+++ b/sites/all/modules/ctools/ctools_plugin_example/plugins/relationships/relcontext_from_simplecontext.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: relcontext_from_simplecontext.inc,v 1.2 2010/01/29 19:53:48 merlinofchaos Exp $
 
 
 /**
diff --git a/sites/all/modules/ctools/help/about.html b/sites/all/modules/ctools/help/about.html
index c5b8ec0ce476c2e8b8daf058b1e1fba6ce9b58c2..39493ffe7e8a9ecef50872bdfd3899201c28aa0b 100644
--- a/sites/all/modules/ctools/help/about.html
+++ b/sites/all/modules/ctools/help/about.html
@@ -1,4 +1,3 @@
-<!-- $Id: about.html,v 1.1 2009/01/22 01:57:18 merlinofchaos Exp $ -->
 The Chaos Tool Suite is a series of tools for developers to make code that I've found to be very useful to Views and Panels more readily available. Certain methods of doing things, particularly with AJAX, exportable objects, and a plugin system are proving to be ideas that are useful outside of just Views and Panels. This module does not offer much directly ot the end user, but instead creates a library for other modules to use. If you are an end user and some module asked you to install the CTools suite, then this is far as you really need to go. If you're a developer and are interested in these tools, read on!
 
 <h3>Tools provided by CTools</h3>
diff --git a/sites/all/modules/ctools/help/ajax.html b/sites/all/modules/ctools/help/ajax.html
index 8745e398f2f33136075c5a40abcc2e181cd5d4bf..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
--- a/sites/all/modules/ctools/help/ajax.html
+++ b/sites/all/modules/ctools/help/ajax.html
@@ -1 +0,0 @@
-<!-- $Id: ajax.html,v 1.1 2009/01/22 01:57:18 merlinofchaos Exp $ -->
diff --git a/sites/all/modules/ctools/help/context-access.html b/sites/all/modules/ctools/help/context-access.html
index 24a182bee11479244911931364f108a60d62823c..ef2ddbf849ee0a53c3b090d516a99404454a1ccf 100644
--- a/sites/all/modules/ctools/help/context-access.html
+++ b/sites/all/modules/ctools/help/context-access.html
@@ -1,4 +1,3 @@
-<!-- $Id: context-access.html,v 1.1 2008/12/17 08:29:20 merlinofchaos Exp $ -->
 
 access plugins allow context based access control to pages.    
 
diff --git a/sites/all/modules/ctools/help/context-arguments.html b/sites/all/modules/ctools/help/context-arguments.html
index d9910bb793499a0a66ecdf1190c9150477b14901..f19f597c5528933f802ddd658c7d45b7b928b22b 100644
--- a/sites/all/modules/ctools/help/context-arguments.html
+++ b/sites/all/modules/ctools/help/context-arguments.html
@@ -1,4 +1,3 @@
-<!-- $Id: context-arguments.html,v 1.3 2008/12/19 17:35:57 merlinofchaos Exp $ -->
 
 Arguments create a context from external input, which is assumed to be a
 string as though it came from a URL element.
diff --git a/sites/all/modules/ctools/help/context-content.html b/sites/all/modules/ctools/help/context-content.html
index b3becf12f7d813d10938b706bd512e3c6548fc85..7c18d519a09c64a644b3c080cd098d48799469ab 100644
--- a/sites/all/modules/ctools/help/context-content.html
+++ b/sites/all/modules/ctools/help/context-content.html
@@ -1,4 +1,3 @@
-<!-- $Id: context-content.html,v 1.3 2009/07/18 22:06:33 merlinofchaos Exp $ -->
 <p>The CTools pluggable content system provides various pieces of
 content as discrete bits of data that can be added to other
 applications, such as Panels or Dashboard via the UI. Whatever the
diff --git a/sites/all/modules/ctools/help/context-context.html b/sites/all/modules/ctools/help/context-context.html
index 9d8c1d8dcf1bea53b2ed901066a612a7aeae2189..23a9631540e7847ea7748df0f880b0b4eca6a403 100644
--- a/sites/all/modules/ctools/help/context-context.html
+++ b/sites/all/modules/ctools/help/context-context.html
@@ -1,4 +1,3 @@
-<!-- $Id: context-context.html,v 1.1 2008/12/04 22:22:40 merlinofchaos Exp $ -->
 
 Context plugin data:
 
diff --git a/sites/all/modules/ctools/help/context-relationships.html b/sites/all/modules/ctools/help/context-relationships.html
index 9fc8a9b59e86c8eb70e5c058895ff01ade7c6395..547f89129515e1a8c567c3605fc648a1d49974b4 100644
--- a/sites/all/modules/ctools/help/context-relationships.html
+++ b/sites/all/modules/ctools/help/context-relationships.html
@@ -1,4 +1,3 @@
-<!-- $Id: context-relationships.html,v 1.1 2008/12/04 22:22:40 merlinofchaos Exp $ -->
 
     'title' => The title to display.
     'description' => Description to display.
diff --git a/sites/all/modules/ctools/help/context.html b/sites/all/modules/ctools/help/context.html
index bf5ebeea09697b74bd6f73847bd1264438377cc4..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
--- a/sites/all/modules/ctools/help/context.html
+++ b/sites/all/modules/ctools/help/context.html
@@ -1 +0,0 @@
-<!-- $Id: context.html,v 1.1 2008/12/04 22:22:40 merlinofchaos Exp $ -->
diff --git a/sites/all/modules/ctools/help/ctools.help.ini b/sites/all/modules/ctools/help/ctools.help.ini
index 9de6e3b6a4facaf6d314d6df56eae1a36d6381b2..fcb121b8df086b3167fd2be7dd9a6cc9c378484c 100644
--- a/sites/all/modules/ctools/help/ctools.help.ini
+++ b/sites/all/modules/ctools/help/ctools.help.ini
@@ -1,4 +1,3 @@
-; $Id: ctools.help.ini,v 1.4 2010/09/07 09:02:50 sdboyer Exp $
 [advanced help settings]
 line break = TRUE
 
@@ -80,6 +79,10 @@ parent = ajax
 title = Javascript dropdown
 parent = ajax
 
+[dropbutton]
+title = Javascript dropbutton
+parent = ajax
+
 [dependent]
 title = Dependent checkboxes and radio buttons
 parent = ajax
diff --git a/sites/all/modules/ctools/help/export-ui.html b/sites/all/modules/ctools/help/export-ui.html
index 3ebeb647022503148d29686202f975d12ae6e941..d291ce4d91d65ff50c0475f68874f818a6d4faf5 100644
--- a/sites/all/modules/ctools/help/export-ui.html
+++ b/sites/all/modules/ctools/help/export-ui.html
@@ -1,4 +1,3 @@
-<!-- $Id: export-ui.html,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ -->
 Most user interfaces for exportables are very similar, so CTools includes a tool to provide the framework for the most common UI. This tool is a plugin of the 'export_ui' type. In order to create a UI for your exportable object with this tool, you first need to ensure that your module supports the plugin:
 
 <pre>
diff --git a/sites/all/modules/ctools/help/export.html b/sites/all/modules/ctools/help/export.html
index 0e6b4f8386b4ed29ab7262332f281385e75b82a2..350190296532de8a5c7475c5b33ceda0b3db48e2 100644
--- a/sites/all/modules/ctools/help/export.html
+++ b/sites/all/modules/ctools/help/export.html
@@ -1,4 +1,3 @@
-<!-- $Id: export.html,v 1.4 2010/10/11 22:18:22 sdboyer Exp $ -->
 Exportable objects are objects that can live either in the database or in code, or in both. If they live in both, then the object in code is considered to be "overridden", meaning that the version in code is ignored in favor of the version in the database.
 
 The main benefit to this is that you can move objects that are intended to be structure or feature-related into code, thus removing them entirely from the database. This is a very important part of the deployment path, since in an ideal world, the database is primarily user generated content, whereas site structure and site features should be in code. However, many many features in Drupal rely on objects being in the database and provide UIs to create them.
@@ -113,7 +112,10 @@ function mymodule_schema() {
 <dd>Objects should contain a primary key which is a database identifier primarily used to determine if an object has been written or not. This is required for the default CRUD save callback to work.</dd>
 
 <dt>object</dt>
-<dd>The class the object should be created as. Defaults as stdClass.</dd>
+<dd>The class the object should be created as, if 'object factory' is not set. If this is not set either, defaults as stdClass.</dd>
+
+<dt>object factory</dt>
+<dd>Function used to create the object. The function receives the schema and the loaded data as a parameters: your_factory_function($schema, $data). If this is set,  'object' has no effect since you can use your function to create whatever class you wish.</dd>
 
 <dt>can disable</dt>
 <dd>Control whether or not the exportable objects can be disabled. All this does is cause the 'disabled' field on the object to always be set appropriately, and a variable is kept to record the state. Changes made to this state must be handled by the owner of the object. Defaults to TRUE.</dd>
@@ -124,12 +126,21 @@ function mymodule_schema() {
 <dt>default hook</dt>
 <dd>What hook to invoke to find exportable objects that are currently defined. These will all be gathered into a giant array. Defaults to 'default_' . $table.</dd>
 
+<dt>cache defaults</dt>
+<dd>If true, default objects will be cached so that the processing of the hook does not need to be called often. Defaults to FALSE. Recommended if you will potentially have a lot of objects in code. Not recommended if code will be the exception.</dd>
+
+<dt>default cache bin</dt>
+<dd>If default object caching is enabled, what cache bin to use. This defaults to the basic "cache". It is highly recommended that you use a different cache bin if possible.</dd>
+
 <dt>identifier</dt>
 <dd>When exporting the object, the identifier is the variable that the exported object will be placed in. Defaults to $table.</dd>
 
 <dt>bulk export</dt>
 <dd>Declares whether or not the exportable will be available for bulk exporting.</dd>
 
+<dt>export type string</dt>
+<dd>The export type string (Local, Overridden, Database) is normally stored as $item-&gt;type. Since type is a very common keyword, it's possible to specify what key to actually use. </dd>
+
 <dt>list callback</dt>
 <dd>Bulk export callback to provide a list of exportable objects to be chosen for bulk exporting. Defaults to $module . '_' . $table . '_list' if the function exists. If it is not, a default listing function will be provided that will make a best effort to list the titles. See ctools_export_default_list().</dd>
 
@@ -158,6 +169,9 @@ function mymodule_schema() {
 <dt>import callback</dt>
 <dd>CRUD callback to use for importing. If not provided, the default export function will be used. This function will accept the code as a single argument and, if the code evaluates, return an object represented by that code. In the case of failure, this will return a string with human readable errors.</dd>
 
+<dt>status callback</dt>
+<dd>CRUD callback to use for updating the status of an object. If the status is TRUE the object will be disabled. If the status is FALSE the object will be enabled.</dd>
+
 In addition, each field can contain the following:
 <dl>
 <dt>no export</dt>
@@ -197,6 +211,7 @@ Exportable objects have several reserved keys that are used by the CTools export
 <li><em>Overridden</em> is an object that lives in the database and is overriding the exported configuration of a corresponding object in code.</li>
 <li><em>Default</em> is an object that lives only in code.</li>
 </ul>
+<i>Note: This key can be changed by setting 'export type string' to something else, to try and prevent "type" from conflicting.</i>
 </dd>
 </dl>
 
diff --git a/sites/all/modules/ctools/help/modal.html b/sites/all/modules/ctools/help/modal.html
index 60985929f85a5196ca2365a54d434f905b0ea55a..83c45adf79493244bc1c3787265d7433d43c09b1 100644
--- a/sites/all/modules/ctools/help/modal.html
+++ b/sites/all/modules/ctools/help/modal.html
@@ -1,4 +1,3 @@
-<!-- $Id: modal.html,v 1.4 2010/12/31 23:58:52 merlinofchaos Exp $ -->
 CTools provides a simple modal that can be used as a popup to place forms. It differs from the normal modal frameworks in that it does not do its work via an iframe. This is both an advantage and a disadvantage. The iframe simply renders normal pages in a sub-browser and they can do their thing. That makes it much easier to put arbitrary pages and forms in a modal. However, the iframe is not very good at actually communicating changes to the main page, so you cannot open the modal, have it do some work, and then modify the page. 
 
 <h3>Invoking the modal</h3>
@@ -198,15 +197,15 @@ If you are displaying a form -- and the vast majority of modals display forms --
   );
   $output = ctools_modal_form_wrapper('my_form', $form_state);
   // There are some possible states after calling the form wrapper:
-  // 1) We are not using $js and there is form output to be rendered.
+  // 1) We are not using $js and the form has been executed.
   // 2) We are using $js and the form was successfully submitted and
   //    we need to dismiss the modal.
   // Most other states are handled automatically unless you set flags in
   // $form_state to avoid handling them, so we only deal with those two
   // states.
-  if (empty($output) && $js) {
+  if ($form_state['executed'] && $js) {
     $commands = array();
-    $commands[] = ctools_modal_command_dismiss(t('Login Success');
+    $commands[] = ctools_modal_command_dismiss(t('Login Success'));
     // In typical usage you will do something else here, such as update a
     // div with HTML or redirect the page based upon the results of the modal
     // form.
diff --git a/sites/all/modules/ctools/help/object-cache.html b/sites/all/modules/ctools/help/object-cache.html
index e810b17d0a0cc393b5ec19e5dc573eddd7fc56f7..964817085534abfe5d1a700f9ef39324b7ab6cb3 100644
--- a/sites/all/modules/ctools/help/object-cache.html
+++ b/sites/all/modules/ctools/help/object-cache.html
@@ -1,4 +1,3 @@
-<!-- $Id: object-cache.html,v 1.1 2009/01/23 23:14:04 merlinofchaos Exp $ -->
 The CTools Object Cache is a specialized cache for storing data that is non-volatile. This differs from the standard Drupal cache mechanism, which is volatile, meaning that the data can be cleared at any time and it is expected that any cached data can easily be reconstructed. In contrast, data stored in this cache is not expected to be reconstructable. It is primarily used for storing user input which is retrieved in stages, allowing for more complex user interface interactions.
 
 The object cache consists of 3 normal functions for cache maintenance, and 2 additional functions to facilitate locking.
diff --git a/sites/all/modules/ctools/help/plugins-api.html b/sites/all/modules/ctools/help/plugins-api.html
index 4392cb4374baf5b7e7d3ee3d20db60d89367a907..47e5d6bad3bf9b4db1a37ace04ec0b86f7006368 100644
--- a/sites/all/modules/ctools/help/plugins-api.html
+++ b/sites/all/modules/ctools/help/plugins-api.html
@@ -1,4 +1,3 @@
-<!-- $Id: plugins-api.html,v 1.3 2009/04/17 19:16:21 merlinofchaos Exp $ -->
 APIs are a form of plugins that are tightly associated with a module. Instead of a module providing any number of plugins, each module provides only one file for an API and this file can contain hooks that the module should invoke.
 
 Modules support this API by implementing hook_ctools_plugin_api($module, $api). If they support the API, they return a packet of data:
diff --git a/sites/all/modules/ctools/help/plugins-creating.html b/sites/all/modules/ctools/help/plugins-creating.html
index b1242f291cd0b23e9a061f1d24e30583a6709b24..77f0315cdd607d7ec10ab468448994200c6a9d78 100644
--- a/sites/all/modules/ctools/help/plugins-creating.html
+++ b/sites/all/modules/ctools/help/plugins-creating.html
@@ -1,4 +1,3 @@
-<!-- $Id: plugins-creating.html,v 1.10 2010/09/07 09:02:50 sdboyer Exp $ -->
 There are two primary pieces to using plugins. The first is getting the data, and the second is using the data.
 
 <h3>Getting the data</h3>
diff --git a/sites/all/modules/ctools/help/plugins-implementing.html b/sites/all/modules/ctools/help/plugins-implementing.html
index 2ee4ce785625f7c34ab17e2a3bbe260868e9e4af..0ea1269ee38ce8b11aaf9353ae8f94b7eda8979b 100644
--- a/sites/all/modules/ctools/help/plugins-implementing.html
+++ b/sites/all/modules/ctools/help/plugins-implementing.html
@@ -1,4 +1,3 @@
-<!-- $Id: plugins-implementing.html,v 1.4 2009/11/13 00:49:28 merlinofchaos Exp $ -->
 To implement plugins, you need to implement a single hook in your module to tell the system where your plugins live, and then you need to implement one or more .inc files that contain the plugin data.
 
 <h3>Telling it where your plugins live</h3>
diff --git a/sites/all/modules/ctools/help/plugins.html b/sites/all/modules/ctools/help/plugins.html
index caf699a0f99e5aef6b1791c9784cdda2537236a3..906813ee88fc1bfe11811f7ab13935a03dc1fe82 100644
--- a/sites/all/modules/ctools/help/plugins.html
+++ b/sites/all/modules/ctools/help/plugins.html
@@ -1,4 +1,3 @@
-<!-- $Id: plugins.html,v 1.2 2010/09/07 09:02:50 sdboyer Exp $ -->
 The plugins tool allows a module to allow <b>other</b> modules (and themes!) to provide plugins which provide some kind of functionality or some kind of task. For example, in Panels there are several types of plugins: Content types (which are like blocks), layouts (which are page layouts) and styles (which can be used to style a panel). Each plugin is represented by a .inc file, and the functionality they offer can differ wildly.
 
 A module which uses plugins can implement a hook describing the plugin (which is not necessary, as defaults will be filled in) and then calls a ctools function which loads either all the known plugins (used for listing/choosing) or loads a specific plugin (used when its known which plugin is needed). From the perspective of the plugin system, a plugin is a packet of data, usually some printable info and a list of callbacks. It is up to the module implementing plugins to determine what that info means and what the callbacks do.
diff --git a/sites/all/modules/ctools/help/wizard.html b/sites/all/modules/ctools/help/wizard.html
index 5fbc55b6025006c4bad0010e59ed8f3edd62ff93..93775dbc8da5c8a1df553123d0f8158f443fe301 100644
--- a/sites/all/modules/ctools/help/wizard.html
+++ b/sites/all/modules/ctools/help/wizard.html
@@ -1,4 +1,3 @@
-<!-- $Id: wizard.html,v 1.8 2010/10/15 22:13:37 merlinofchaos Exp $ -->
 Form wizards, or multi-step forms, are a process by which the user goes through or can use an arbitrary number of different forms to create a single object or perform a single task. Traditionally the multi-step form is difficult in Drupal because there is no easy place to put data in between forms. No longer! The form wizard tool allows a single entry point to easily set up a wizard of multiple forms, provide callbacks  to handle data storage and updates between forms and when forms are completed. This tool pairs well with the <a href="&topic:ctools/object-cache&">object cache</a> tool for storage.
 
 <h3>The form info array</h3>
@@ -212,13 +211,15 @@ All that's needed to tie this together is to understand how the changes made it
 /**
  * Store the values from the basic settings form.
  */
-function delegator_page_form_basic_submit(&$form, &$form_state) {
+function delegator_page_form_basic_submit($form, &$form_state) {
   if (!isset($form_state['page']->pid) && empty($form_state['page']->import)) {
     $form_state['page']->name = $form_state['values']['name'];
   }
 
   $form_state['page']->admin_title = $form_state['values']['admin_title'];
   $form_state['page']->path = $form_state['values']['path'];
+
+  return $form;
 }
 </pre>
 
@@ -231,7 +232,7 @@ When using <strong>'show back' => TRUE</strong> the cached data should be assign
 /**
  * Form builder function for wizard.
  */
-function wizardid_step2_form(&$form, &$form_state) {
+function wizardid_step2_form($form, &$form_state) {
   $form_state['my data'] = my_module_get_cache($form_state['cache name']);
   $form['example'] = array(
     '#type' => 'radios',
@@ -242,6 +243,8 @@ function wizardid_step2_form(&$form, &$form_state) {
       'setting1' => t('Setting1'),
     ),
   );
+
+  return $form;
 }
 
 /**
diff --git a/sites/all/modules/ctools/includes/ajax.inc b/sites/all/modules/ctools/includes/ajax.inc
index 2f4637799f7d1e2dd2041305e6ea0d8f2c0171b0..981ee23798674cbdb8a2ef960090c8fb6b2f6460 100644
--- a/sites/all/modules/ctools/includes/ajax.inc
+++ b/sites/all/modules/ctools/includes/ajax.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: ajax.inc,v 1.22 2010/12/31 23:58:52 merlinofchaos Exp $
 
 // Set this so we can tell that the file has been included at some point.
 define('CTOOLS_AJAX_INCLUDED', 1);
diff --git a/sites/all/modules/ctools/includes/cache.inc b/sites/all/modules/ctools/includes/cache.inc
index 437acefc662536957d11fd90eb7c334bc9cfe050..ca6e6f34d50a7924bd67b137f6a5775e2cfd9414 100644
--- a/sites/all/modules/ctools/includes/cache.inc
+++ b/sites/all/modules/ctools/includes/cache.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: cache.inc,v 1.1 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/includes/cache.plugin-type.inc b/sites/all/modules/ctools/includes/cache.plugin-type.inc
index 0e8e8c815364bcc05a170d139c2be007d99eda8f..1ab4cdd138b34f2ea12c84eb1671f964e0d6d344 100644
--- a/sites/all/modules/ctools/includes/cache.plugin-type.inc
+++ b/sites/all/modules/ctools/includes/cache.plugin-type.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: cache.plugin-type.inc,v 1.1 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/includes/cleanstring.inc b/sites/all/modules/ctools/includes/cleanstring.inc
index baed9e3b0af46449e5ac6385763dda0f2109f684..e4943e430c57e256c3b93df670d58614b355c458 100644
--- a/sites/all/modules/ctools/includes/cleanstring.inc
+++ b/sites/all/modules/ctools/includes/cleanstring.inc
@@ -34,32 +34,32 @@
  * Copied from search.module's PREG_CLASS_SEARCH_EXCLUDE.
  */
 define('CTOOLS_PREG_CLASS_ALNUM',
-'\x{0}-\x{2f}\x{3a}-\x{40}\x{5b}-\x{60}\x{7b}-\x{bf}\x{d7}\x{f7}\x{2b0}-'.
-'\x{385}\x{387}\x{3f6}\x{482}-\x{489}\x{559}-\x{55f}\x{589}-\x{5c7}\x{5f3}-'.
-'\x{61f}\x{640}\x{64b}-\x{65e}\x{66a}-\x{66d}\x{670}\x{6d4}\x{6d6}-\x{6ed}'.
-'\x{6fd}\x{6fe}\x{700}-\x{70f}\x{711}\x{730}-\x{74a}\x{7a6}-\x{7b0}\x{901}-'.
-'\x{903}\x{93c}\x{93e}-\x{94d}\x{951}-\x{954}\x{962}-\x{965}\x{970}\x{981}-'.
-'\x{983}\x{9bc}\x{9be}-\x{9cd}\x{9d7}\x{9e2}\x{9e3}\x{9f2}-\x{a03}\x{a3c}-'.
-'\x{a4d}\x{a70}\x{a71}\x{a81}-\x{a83}\x{abc}\x{abe}-\x{acd}\x{ae2}\x{ae3}'.
-'\x{af1}-\x{b03}\x{b3c}\x{b3e}-\x{b57}\x{b70}\x{b82}\x{bbe}-\x{bd7}\x{bf0}-'.
-'\x{c03}\x{c3e}-\x{c56}\x{c82}\x{c83}\x{cbc}\x{cbe}-\x{cd6}\x{d02}\x{d03}'.
-'\x{d3e}-\x{d57}\x{d82}\x{d83}\x{dca}-\x{df4}\x{e31}\x{e34}-\x{e3f}\x{e46}-'.
-'\x{e4f}\x{e5a}\x{e5b}\x{eb1}\x{eb4}-\x{ebc}\x{ec6}-\x{ecd}\x{f01}-\x{f1f}'.
-'\x{f2a}-\x{f3f}\x{f71}-\x{f87}\x{f90}-\x{fd1}\x{102c}-\x{1039}\x{104a}-'.
-'\x{104f}\x{1056}-\x{1059}\x{10fb}\x{10fc}\x{135f}-\x{137c}\x{1390}-\x{1399}'.
-'\x{166d}\x{166e}\x{1680}\x{169b}\x{169c}\x{16eb}-\x{16f0}\x{1712}-\x{1714}'.
-'\x{1732}-\x{1736}\x{1752}\x{1753}\x{1772}\x{1773}\x{17b4}-\x{17db}\x{17dd}'.
-'\x{17f0}-\x{180e}\x{1843}\x{18a9}\x{1920}-\x{1945}\x{19b0}-\x{19c0}\x{19c8}'.
-'\x{19c9}\x{19de}-\x{19ff}\x{1a17}-\x{1a1f}\x{1d2c}-\x{1d61}\x{1d78}\x{1d9b}-'.
-'\x{1dc3}\x{1fbd}\x{1fbf}-\x{1fc1}\x{1fcd}-\x{1fcf}\x{1fdd}-\x{1fdf}\x{1fed}-'.
-'\x{1fef}\x{1ffd}-\x{2070}\x{2074}-\x{207e}\x{2080}-\x{2101}\x{2103}-\x{2106}'.
-'\x{2108}\x{2109}\x{2114}\x{2116}-\x{2118}\x{211e}-\x{2123}\x{2125}\x{2127}'.
-'\x{2129}\x{212e}\x{2132}\x{213a}\x{213b}\x{2140}-\x{2144}\x{214a}-\x{2b13}'.
-'\x{2ce5}-\x{2cff}\x{2d6f}\x{2e00}-\x{3005}\x{3007}-\x{303b}\x{303d}-\x{303f}'.
-'\x{3099}-\x{309e}\x{30a0}\x{30fb}-\x{30fe}\x{3190}-\x{319f}\x{31c0}-\x{31cf}'.
-'\x{3200}-\x{33ff}\x{4dc0}-\x{4dff}\x{a015}\x{a490}-\x{a716}\x{a802}\x{a806}'.
-'\x{a80b}\x{a823}-\x{a82b}\x{d800}-\x{f8ff}\x{fb1e}\x{fb29}\x{fd3e}\x{fd3f}'.
-'\x{fdfc}-\x{fe6b}\x{feff}-\x{ff0f}\x{ff1a}-\x{ff20}\x{ff3b}-\x{ff40}\x{ff5b}-'.
+'\x{0}-\x{2f}\x{3a}-\x{40}\x{5b}-\x{60}\x{7b}-\x{bf}\x{d7}\x{f7}\x{2b0}-' .
+'\x{385}\x{387}\x{3f6}\x{482}-\x{489}\x{559}-\x{55f}\x{589}-\x{5c7}\x{5f3}-' .
+'\x{61f}\x{640}\x{64b}-\x{65e}\x{66a}-\x{66d}\x{670}\x{6d4}\x{6d6}-\x{6ed}' .
+'\x{6fd}\x{6fe}\x{700}-\x{70f}\x{711}\x{730}-\x{74a}\x{7a6}-\x{7b0}\x{901}-' .
+'\x{903}\x{93c}\x{93e}-\x{94d}\x{951}-\x{954}\x{962}-\x{965}\x{970}\x{981}-' .
+'\x{983}\x{9bc}\x{9be}-\x{9cd}\x{9d7}\x{9e2}\x{9e3}\x{9f2}-\x{a03}\x{a3c}-' .
+'\x{a4d}\x{a70}\x{a71}\x{a81}-\x{a83}\x{abc}\x{abe}-\x{acd}\x{ae2}\x{ae3}' .
+'\x{af1}-\x{b03}\x{b3c}\x{b3e}-\x{b57}\x{b70}\x{b82}\x{bbe}-\x{bd7}\x{bf0}-' .
+'\x{c03}\x{c3e}-\x{c56}\x{c82}\x{c83}\x{cbc}\x{cbe}-\x{cd6}\x{d02}\x{d03}' .
+'\x{d3e}-\x{d57}\x{d82}\x{d83}\x{dca}-\x{df4}\x{e31}\x{e34}-\x{e3f}\x{e46}-' .
+'\x{e4f}\x{e5a}\x{e5b}\x{eb1}\x{eb4}-\x{ebc}\x{ec6}-\x{ecd}\x{f01}-\x{f1f}' .
+'\x{f2a}-\x{f3f}\x{f71}-\x{f87}\x{f90}-\x{fd1}\x{102c}-\x{1039}\x{104a}-' .
+'\x{104f}\x{1056}-\x{1059}\x{10fb}\x{10fc}\x{135f}-\x{137c}\x{1390}-\x{1399}' .
+'\x{166d}\x{166e}\x{1680}\x{169b}\x{169c}\x{16eb}-\x{16f0}\x{1712}-\x{1714}' .
+'\x{1732}-\x{1736}\x{1752}\x{1753}\x{1772}\x{1773}\x{17b4}-\x{17db}\x{17dd}' .
+'\x{17f0}-\x{180e}\x{1843}\x{18a9}\x{1920}-\x{1945}\x{19b0}-\x{19c0}\x{19c8}' .
+'\x{19c9}\x{19de}-\x{19ff}\x{1a17}-\x{1a1f}\x{1d2c}-\x{1d61}\x{1d78}\x{1d9b}-' .
+'\x{1dc3}\x{1fbd}\x{1fbf}-\x{1fc1}\x{1fcd}-\x{1fcf}\x{1fdd}-\x{1fdf}\x{1fed}-' .
+'\x{1fef}\x{1ffd}-\x{2070}\x{2074}-\x{207e}\x{2080}-\x{2101}\x{2103}-\x{2106}' .
+'\x{2108}\x{2109}\x{2114}\x{2116}-\x{2118}\x{211e}-\x{2123}\x{2125}\x{2127}' .
+'\x{2129}\x{212e}\x{2132}\x{213a}\x{213b}\x{2140}-\x{2144}\x{214a}-\x{2b13}' .
+'\x{2ce5}-\x{2cff}\x{2d6f}\x{2e00}-\x{3005}\x{3007}-\x{303b}\x{303d}-\x{303f}' .
+'\x{3099}-\x{309e}\x{30a0}\x{30fb}-\x{30fe}\x{3190}-\x{319f}\x{31c0}-\x{31cf}' .
+'\x{3200}-\x{33ff}\x{4dc0}-\x{4dff}\x{a015}\x{a490}-\x{a716}\x{a802}\x{a806}' .
+'\x{a80b}\x{a823}-\x{a82b}\x{d800}-\x{f8ff}\x{fb1e}\x{fb29}\x{fd3e}\x{fd3f}' .
+'\x{fdfc}-\x{fe6b}\x{feff}-\x{ff0f}\x{ff1a}-\x{ff20}\x{ff3b}-\x{ff40}\x{ff5b}-' .
 '\x{ff65}\x{ff70}\x{ff9e}\x{ff9f}\x{ffe0}-\x{fffd}');
 
 
@@ -78,7 +78,7 @@ define('CTOOLS_PREG_CLASS_ALNUM',
  *   - 'ignore words': Set to an array of words that will be removed
  *     rather than made safe. Defaults to an empty array.
  *   - 'separator': Change spaces and untranslatable characters to
- *     this character. Defaults to '-'.
+ *     this character. Defaults to '-' .
  *   - 'replacements': An array of direct replacements to be made that will
  *     be implemented via strtr(). Defaults to an empty array.
  *   - 'transliterate': If set, use the transliteration replacements. If set
@@ -138,7 +138,7 @@ function ctools_cleanstring($string, $settings = array()) {
 
   // Get rid of words that are on the ignore list
   if (!empty($settings['ignore words'])) {
-    $ignore_re = '\b'. preg_replace('/,/', '\b|\b', $settings['ignore words']) .'\b';
+    $ignore_re = '\b' . preg_replace('/,/', '\b|\b', $settings['ignore words']) . '\b';
 
     if (function_exists('mb_eregi_replace')) {
       $output = mb_eregi_replace($ignore_re, '', $output);
@@ -154,11 +154,11 @@ function ctools_cleanstring($string, $settings = array()) {
   // In preparation for pattern matching,
   // escape the separator if and only if it is not alphanumeric.
   if (isset($settings['separator'])) {
-    if (preg_match('/^[^'. CTOOLS_PREG_CLASS_ALNUM .']+$/uD', $settings['separator'])) {
+    if (preg_match('/^[^' . CTOOLS_PREG_CLASS_ALNUM . ']+$/uD', $settings['separator'])) {
       $seppattern = $settings['separator'];
     }
     else {
-      $seppattern = '\\'. $settings['separator'];
+      $seppattern = '\\' . $settings['separator'];
     }
     // Trim any leading or trailing separators (note the need to
     $output = preg_replace("/^$seppattern+|$seppattern+$/", '', $output);
diff --git a/sites/all/modules/ctools/includes/collapsible.theme.inc b/sites/all/modules/ctools/includes/collapsible.theme.inc
index c2a91762874ffb5fc6c92f4d49a741ba98aa18c3..f7bbbb376f59ffd2ded7e88f6ae1db4a1d9bb0fb 100644
--- a/sites/all/modules/ctools/includes/collapsible.theme.inc
+++ b/sites/all/modules/ctools/includes/collapsible.theme.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: collapsible.theme.inc,v 1.6 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/includes/content.inc b/sites/all/modules/ctools/includes/content.inc
index 39ec1abe52b27147e215f1b57a5a8c49cb361499..a55f7ec5e897b346f05a7a0d7041d3fc9485eda1 100644
--- a/sites/all/modules/ctools/includes/content.inc
+++ b/sites/all/modules/ctools/includes/content.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: content.inc,v 1.21 2010/12/31 23:53:34 merlinofchaos Exp $
 
 /**
  * @file
@@ -48,6 +47,14 @@ function ctools_content_process(&$plugin, $info) {
     $plugin['add form'] = $function_base . 'edit_form';
   }
 
+  if (!isset($plugin['description'])) {
+    $plugin['description'] = '';
+  }
+
+  if (!isset($plugin['icon'])) {
+    $plugin['icon'] = ctools_content_admin_icon($plugin);
+  }
+
   // Another ease of use check:
   if (!isset($plugin['content types'])) {
     // If a subtype plugin exists, try to use it. Otherwise assume single.
@@ -270,6 +277,10 @@ function ctools_content_render($type, $subtype, $conf, $keywords = array(), $arg
 
     $content = $function($subtype, $conf, $args, $pane_context, $incoming_content);
 
+    if (empty($content)) {
+      return;
+    }
+
     // Set up some defaults and other massaging on the content before we hand
     // it back to the caller.
     if (!isset($content->type)) {
@@ -487,7 +498,6 @@ function ctools_content_configure_form_defaults($form, &$form_state) {
       '#default_value' => isset($conf['override_title_text']) ? $conf['override_title_text'] : '',
       '#size' => 35,
       '#id' => 'override-title-textfield',
-      '#process' => array('ctools_dependent_process'),
       '#dependency' => array('override-title-checkbox' => array(1)),
       '#dependency_type' => 'disable',
     );
@@ -743,7 +753,7 @@ function ctools_content_select_context($plugin, $subtype, $conf, $contexts) {
   // than it's wrong.
   if (is_array($subtype_info['required context'])) {
     if (empty($conf['context']) || count($subtype_info['required context']) != count($conf['context'])) {
-      foreach($subtype_info['required context'] as $index => $required) {
+      foreach ($subtype_info['required context'] as $index => $required) {
         if (!isset($conf['context'][$index])) {
           $filtered = ctools_context_filter($contexts, $required);
           if ($filtered) {
diff --git a/sites/all/modules/ctools/includes/content.menu.inc b/sites/all/modules/ctools/includes/content.menu.inc
index 02169f2f5ddd16b4f6e544253ff11076bdbcaf41..11a686abffd06fa05b83abb50af98dde67976d71 100644
--- a/sites/all/modules/ctools/includes/content.menu.inc
+++ b/sites/all/modules/ctools/includes/content.menu.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: content.menu.inc,v 1.9 2011/01/05 20:34:46 merlinofchaos Exp $
 
 /**
  * @file
@@ -52,6 +51,9 @@ function ctools_content_autocomplete_entity($type, $string = '') {
     $matches = array();
     if ($type == 'node') {
       $query->addTag('node_access');
+      $query->join('users', 'u', 'b.uid = u.uid');
+      $query->addField('u', 'name', 'name');
+
       foreach ($query->execute() as $nodeish) {
         $name = empty($nodeish->name) ? variable_get('anonymous', t('Anonymous')) : check_plain($nodeish->name);
         $matches[$nodeish->title . " [id: $nodeish->nid]"] = '<span class="autocomplete_title">' . check_plain($nodeish->title) . '</span> <span class="autocomplete_user">(' . t('by @user', array('@user' => $name)) . ')</span>';
diff --git a/sites/all/modules/ctools/includes/content.plugin-type.inc b/sites/all/modules/ctools/includes/content.plugin-type.inc
index 66b330e4c063e9b8f449112b852f9f6a7cc9d50a..4c767ae80f776bb884292358700f69f1084cfb74 100644
--- a/sites/all/modules/ctools/includes/content.plugin-type.inc
+++ b/sites/all/modules/ctools/includes/content.plugin-type.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: content.plugin-type.inc,v 1.1 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/includes/content.theme.inc b/sites/all/modules/ctools/includes/content.theme.inc
index f3a34f60e251ecde6923bb6dfc4b5e0618dd6308..ae4456aa7ca1e979751314c985d8a3c49b6cc3e7 100644
--- a/sites/all/modules/ctools/includes/content.theme.inc
+++ b/sites/all/modules/ctools/includes/content.theme.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: content.theme.inc,v 1.4 2009/10/17 22:58:25 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/includes/context-access-admin.inc b/sites/all/modules/ctools/includes/context-access-admin.inc
index 7b458983333f0e7d4b62eaab9280b3cda223bdbd..b15580007854b0a43bcc6c90b90d3256ee08d7c4 100644
--- a/sites/all/modules/ctools/includes/context-access-admin.inc
+++ b/sites/all/modules/ctools/includes/context-access-admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: context-access-admin.inc,v 1.12 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/includes/context-admin.inc b/sites/all/modules/ctools/includes/context-admin.inc
index 1fba7bbe376caa3eeb9d79982551c1a52ee7a7b4..bda61e3ffc54c49114b0c98dab93447a0b5e1b90 100644
--- a/sites/all/modules/ctools/includes/context-admin.inc
+++ b/sites/all/modules/ctools/includes/context-admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: context-admin.inc,v 1.14 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file includes/common-context.inc
@@ -102,7 +101,9 @@ function ctools_context_add_argument_form($module, &$form, &$form_state, &$form_
   $args = ctools_get_arguments();
   $choices = array();
   foreach ($args as $name => $arg) {
-    $choices[$name] = $arg['title'];
+    if (empty($arg['no ui'])) {
+      $choices[$name] = $arg['title'];
+    }
   }
 
   asort($choices);
@@ -167,7 +168,9 @@ function ctools_context_add_required_context_form($module, &$form, &$form_state,
 
   $choices = array();
   foreach (ctools_get_contexts() as $name => $arg) {
-    $choices[$name] = $arg['title'];
+    if (empty($arg['no required context ui'])) {
+      $choices[$name] = $arg['title'];
+    }
   }
 
   asort($choices);
@@ -261,6 +264,7 @@ function ctools_context_add_item_table_buttons($type, $module, &$form, $availabl
       '#value' => url("ctools/context/ajax/add/$module/$type/$cache_key", array('absolute' => TRUE)),
     );
 
+    asort($available_contexts);
     // This also will be in the URL.
     $form['buttons'][$type]['item'] = array(
       '#attributes' => array('class' => array("ctools-$type-add-url")),
@@ -379,10 +383,19 @@ function ctools_context_ajax_item_add($mechanism = NULL, $type = NULL, $cache_ke
     'cache storage' => 'object',
   );
 
+  if ($type == 'requiredcontext') {
+    $form_info += array(
+      'add form name' => 'required context add form',
+      'edit form name' => 'required context edit form',
+    );
+  }
+
   $output = ctools_plugin_configure_form($form_info, $form_state);
 
-  // If $rc is FALSE, there was no actual form.
-  if ($output === FALSE || !empty($form_state['complete'])) {
+  if (!empty($form_state['cancel'])) {
+    $output = array(ctools_modal_command_dismiss());
+  }
+  else if (!empty($form_state['complete'])) {
     // Successful submit -- move temporary data to location.
 
     // Create a reference to the place our context lives. Since this is fairly
@@ -545,10 +558,19 @@ function ctools_context_ajax_item_edit($mechanism = NULL, $type = NULL, $cache_k
     'cache storage' => 'object',
   );
 
+  if ($type == 'requiredcontext') {
+    $form_info += array(
+      'add form name' => 'required context add form',
+      'edit form name' => 'required context edit form',
+    );
+  }
+
   $output = ctools_plugin_configure_form($form_info, $form_state);
 
-  // If $rc is FALSE, there was no actual form.
-  if ($output === FALSE || !empty($form_state['complete'])) {
+  if (!empty($form_state['cancel'])) {
+    $output = array(ctools_modal_command_dismiss());
+  }
+  else if (!empty($form_state['complete'])) {
     // successful submit
     $ref[$position] = $conf;
     if (isset($object->temporary)) {
diff --git a/sites/all/modules/ctools/includes/context-task-handler.inc b/sites/all/modules/ctools/includes/context-task-handler.inc
index cc51292145669b6ea596db7158c655eaae245076..e1f786172c5da5e89f53ebbfc7b908cf8bca39d7 100644
--- a/sites/all/modules/ctools/includes/context-task-handler.inc
+++ b/sites/all/modules/ctools/includes/context-task-handler.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: context-task-handler.inc,v 1.35 2011/01/05 20:06:57 merlinofchaos Exp $
 
 /**
  * @file
@@ -44,6 +43,8 @@ function ctools_context_handler_render($task, $subtask, $contexts, $args) {
   if ($id) {
     return ctools_context_handler_render_handler($task, $subtask, $handlers[$id], $contexts, $args);
   }
+
+  return FALSE;
 }
 
 /**
@@ -168,7 +169,7 @@ function ctools_context_handler_render_handler($task, $subtask, $handler, $conte
   }
 
   if (isset($info['title'])) {
-    drupal_set_title($info['title']);
+    drupal_set_title($info['title'], PASS_THROUGH);
   }
 
   // Only directly output if $page was set to true.
diff --git a/sites/all/modules/ctools/includes/context.inc b/sites/all/modules/ctools/includes/context.inc
index 97c3e1a38ee19ad6430b907d96a88a34abb44adf..23fac54c1354bca543bc6fde472fb52ffcfe55f6 100644
--- a/sites/all/modules/ctools/includes/context.inc
+++ b/sites/all/modules/ctools/includes/context.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: context.inc,v 1.44 2011/01/05 20:34:46 merlinofchaos Exp $
 
 /**
  * @file
@@ -162,11 +161,18 @@ class ctools_context_required {
       $contexts = array($contexts);
     }
 
-    // Due to a bug, some contexts got recorded with an id of 0. This will
-    // convert them to the correct ID allowing for some earlier panels
-    // to continue to work.
-    if (!empty($context) && $context[strlen($context) - 1] === '0') {
-      $context[strlen($context) - 1] = 1;
+    // If we had requested a $context but that $context doesn't exist
+    // in our context list, there is a good chance that what happened
+    // is our context IDs changed. See if there's another context
+    // that satisfies our requirements.
+    if (!empty($context) && !isset($contexts[$context])) {
+      $choices = $this->filter($contexts);
+
+      // If we got a hit, take the first one that matches.
+      if ($choices) {
+        $keys = array_keys($choices);
+        $context = reset($keys);
+      }
     }
 
     if (empty($context) || empty($contexts[$context])) {
@@ -478,9 +484,11 @@ function ctools_context_get_all_converters() {
   $contexts = ctools_get_contexts();
   $converters = array();
   foreach ($contexts as $name => $context) {
-    $context_converters = _ctools_context_get_converters($name . '.', $name);
-    if ($context_converters) {
-      $converters[$context['title']] = $context_converters;
+    if (empty($context['no required context ui'])) {
+      $context_converters = _ctools_context_get_converters($name . '.', $name);
+      if ($context_converters) {
+        $converters[$context['title']] = $context_converters;
+      }
     }
   }
 
@@ -524,6 +532,10 @@ function ctools_context_select($contexts, $required, $context) {
   if (is_array($required)) {
     $result = array();
     foreach ($required as $id => $r) {
+      if (empty($required[$id])) {
+        continue;
+      }
+
       if (($result[] = _ctools_context_select($contexts, $r, $context[$id])) === FALSE) {
         return FALSE;
       }
@@ -922,7 +934,7 @@ function ctools_context_get_relevant_relationships($contexts) {
   // Go through each relationship
   foreach ($relationships as $rid => $relationship) {
     // For each relationship, see if there is a context that satisfies it.
-    if (ctools_context_filter($contexts, $relationship['required context'])) {
+    if (empty($relationship['no ui']) && ctools_context_filter($contexts, $relationship['required context'])) {
       $relevant[$rid] = $relationship['title'];
     }
   }
@@ -1105,7 +1117,7 @@ function ctools_context_match_required_contexts($required, $contexts) {
   }
 
   foreach ($required as $r) {
-    $context = drupal_clone(array_shift($contexts));
+    $context = clone(array_shift($contexts));
     $context->identifier = $r['identifier'];
     $context->page_title = isset($r['title']) ? $r['title'] : '';
     $context->keyword    = $r['keyword'];
@@ -1251,7 +1263,7 @@ function ctools_context_replace_placeholders($contexts, $arguments) {
  * Provide a form array for getting data to replace placeholder contexts
  * with real data.
  */
-function ctools_context_replace_form($form, $contexts) {
+function ctools_context_replace_form(&$form, $contexts) {
   foreach ($contexts as $cid => $context) {
     if (empty($context->empty)) {
       continue;
@@ -1394,7 +1406,7 @@ function ctools_access_group_summary($access, $contexts) {
     $descriptions[] = ctools_access_summary($plugin, $contexts, $test);
   }
 
-  $separator = $access['logic'] == 'and' ? t(', and ') : t(', or ');
+  $separator = (isset($access['logic']) && $access['logic'] == 'and') ? t(', and ') : t(', or ');
   return implode($separator, $descriptions);
 }
 
diff --git a/sites/all/modules/ctools/includes/context.menu.inc b/sites/all/modules/ctools/includes/context.menu.inc
index 39bcd9b25daf218696075095e4a940718cfa1769..ee227cb74699e12434f2ab21a39b858e904eb3e0 100644
--- a/sites/all/modules/ctools/includes/context.menu.inc
+++ b/sites/all/modules/ctools/includes/context.menu.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: context.menu.inc,v 1.2 2008/12/30 18:21:34 merlinofchaos Exp $
 
 /**
  * @file
@@ -14,6 +13,7 @@ function ctools_context_menu(&$items) {
     'access arguments' => array('access content'),
     'type' => MENU_CALLBACK,
     'file' => 'includes/context-admin.inc',
+    'theme callback' => 'ajax_base_page_theme',
   );
   $items['ctools/context/ajax/add'] = array(
     'page callback' => 'ctools_context_ajax_item_add',
diff --git a/sites/all/modules/ctools/includes/context.plugin-type.inc b/sites/all/modules/ctools/includes/context.plugin-type.inc
index fd28c34e5e20c6b2bac103671ad0c022d87550c4..866def2e0c7d360831124f7845a7ba91ef5e1c53 100644
--- a/sites/all/modules/ctools/includes/context.plugin-type.inc
+++ b/sites/all/modules/ctools/includes/context.plugin-type.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: context.plugin-type.inc,v 1.2 2011/01/05 20:34:46 merlinofchaos Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/includes/context.theme.inc b/sites/all/modules/ctools/includes/context.theme.inc
index 1b437d8ed3b452e6645041885bbb771ea704025c..8f660b8c004afce38ea18ad8cc3f48cd7ec39d97 100644
--- a/sites/all/modules/ctools/includes/context.theme.inc
+++ b/sites/all/modules/ctools/includes/context.theme.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: context.theme.inc,v 1.15 2011/01/05 19:56:46 merlinofchaos Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/includes/css.inc b/sites/all/modules/ctools/includes/css.inc
index 47a17c2d81219301c77e4d06350b2bdb2eae5bfa..238a3bc9212ff7e5e3ab48b3237b51d245bd1637 100644
--- a/sites/all/modules/ctools/includes/css.inc
+++ b/sites/all/modules/ctools/includes/css.inc
@@ -1,5 +1,4 @@
 <?php
-/* $Id: css.inc,v 1.18 2010/10/15 20:54:24 merlinofchaos Exp $ */
 
 /*
  * @file
@@ -557,7 +556,13 @@ function ctools_css_flush_caches() {
   // @see http://drupal.org/node/573292
   // file_unmanaged_delete_recursive('public://render');
   $filedir = file_default_scheme() . '://ctools/css';
-  file_unmanaged_delete_recursive($filedir);
+  if (drupal_realpath($filedir)) {
+    // We use the @ because it's possible that files created by the webserver
+    // cannot be deleted while using drush to clear the cache. We don't really
+    // care that much about that, to be honest, so we use the @ to suppress
+    // the error message.
+    @file_unmanaged_delete_recursive($filedir);
+  }
 
   db_delete('ctools_css_cache')->execute();
 }
diff --git a/sites/all/modules/ctools/includes/dependent.inc b/sites/all/modules/ctools/includes/dependent.inc
index 2e866dceb2bcb74b2d25550b6f1ba32869d1bedc..e812cb977a607cab6fa9cd2b33e37972986f609f 100644
--- a/sites/all/modules/ctools/includes/dependent.inc
+++ b/sites/all/modules/ctools/includes/dependent.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: dependent.inc,v 1.9 2011/01/04 01:21:30 merlinofchaos Exp $
 
 /**
  * @file
@@ -21,8 +20,6 @@
  * When hiding checkboxes and radios you need to add their id in a div
  * manually via #prefix and #suffix since they don't have their own id. You
  * actually need to add TWO divs because it's the parent that gets hidden.
- * Also be sure to retain the 'expand_checkboxes' in the #process array,
- * because the views process will override it.
  *
  * Fieldsets can not be hidden by default. Adding '#input' => TRUE to the
  * fieldset works around that.
@@ -43,7 +40,6 @@
  * @code { ctools_include('dependent'); }
  *
  * On any form item, add
- * - @code '#process' => array('ctools_dependent_process'), @endcode
  * - @code '#dependency' => array('id-of-form-without-the-#' => array(list, of, values, that, make, this, gadget, visible)), @endcode
  *
  * A fuller example, that hides the menu title when no menu is selected:
@@ -72,7 +68,6 @@
  *    '#type' => 'textfield',
  *    '#default_value' => '',
  *    '#description' => t('If set to normal or tab, enter the text to use for the menu item.'),
- *    '#process' => array('ctools_dependent_process'),
  *    '#dependency' => array('radio:menu[type]' => array('normal', 'tab', 'default tab')),
  *   );
  *
@@ -106,7 +101,6 @@
  *    '#type' => 'checkboxes',
  *    '#prefix' => '<div id="edit-elements-wrapper"><div id="edit-elements">',
  *    '#suffix' => '</div></div>',
- *    '#process' => array('ctools_dependent_process', 'expand_checkboxes'),
  *    '#dependency' => array('radio:menu[type]' => array('node')),
  *    '#options' => array(
  *      'body' => t('Body'),
@@ -119,37 +113,69 @@
  *  return system_settings_form($form);
  *}
  * @endcode
+ *
+ * Deprecated:
+ *
+ * You no longer use ctools_dependent_process(), and it should be removed
+ * completely.
+ *
+ * If you have a form element which isn't listed in ctools_dependent_element_info_alter
+ * you have to add [#pre_render'][] => 'ctools_dependent_pre_render' to your form.
  */
 
 /**
  * Process callback to add dependency to form items.
+ *
  */
 function ctools_dependent_process($element, &$form_state, &$form) {
-  if (isset($element['#dependency'])) {
-    // Don't actually add any javascript until render time.
-    $element['#pre_render'][] = 'ctools_dependent_pre_render';
-  }
-
   return $element;
 }
 
 function ctools_dependent_pre_render($element) {
-  if (!isset($element['#dependency_count'])) {
-    $element['#dependency_count'] = 1;
-  }
-  if (!isset($element['#dependency_type'])) {
-    $element['#dependency_type'] = 'hide';
-  }
+  // Preprocess only items with #dependency set.
+  if (isset($element['#dependency'])) {
+    if (!isset($element['#dependency_count'])) {
+      $element['#dependency_count'] = 1;
+    }
+    if (!isset($element['#dependency_type'])) {
+      $element['#dependency_type'] = 'hide';
+    }
 
-  $js = array(
-    'values' => $element['#dependency'],
-    'num' => $element['#dependency_count'],
-    'type' => $element['#dependency_type'],
-  );
+    $js = array(
+      'values' => $element['#dependency'],
+      'num' => $element['#dependency_count'],
+      'type' => $element['#dependency_type'],
+    );
 
-  ctools_add_js('dependent');
-  $options['CTools']['dependent'][$element['#id']] = $js;
-  drupal_add_js($options, 'setting');
+    // Add a additional wrapper id around fieldsets, textareas to support depedency on it.
+    if (in_array($element['#type'], array('textarea', 'fieldset', 'text_format'))) {
+      $element['#theme_wrappers'][] = 'container';
+      $element['#attributes']['id'] = $element['#id'] . '-wrapper';
+    }
+
+    // Text formats need to unset the dependency on the textarea
+    // or it gets applied twice.
+    if ($element['#type'] == 'text_format') {
+      unset($element['value']['#dependency']);
+    }
+
+    $element['#attached']['js'][] = ctools_attach_js('dependent');
+    $options['CTools']['dependent'][$element['#id']] = $js;
+    $element['#attached']['js'][] = array('type' => 'setting', 'data' => $options);
+
+  }
 
   return $element;
 }
+
+/**
+ * CTools alters the element_info to be able to add #process functions to
+ * every major form element to make it much more handy to use #dependency,
+ * because you don't have to add #process.
+ */
+function ctools_dependent_element_info_alter(&$type) {
+  $form_elements = array('checkbox', 'checkboxes', 'fieldset', 'item', 'markup', 'radio', 'radios', 'select', 'textarea', 'textfield', 'text_format');
+  foreach ($form_elements as $element) {
+    $type[$element]['#pre_render'][] = 'ctools_dependent_pre_render';
+  }
+}
diff --git a/sites/all/modules/ctools/includes/dropbutton.theme.inc b/sites/all/modules/ctools/includes/dropbutton.theme.inc
new file mode 100644
index 0000000000000000000000000000000000000000..0848666e5d08a2e664924b701013aa7e5b4bb51b
--- /dev/null
+++ b/sites/all/modules/ctools/includes/dropbutton.theme.inc
@@ -0,0 +1,142 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Provide a javascript based dropbutton menu.
+ *
+ * The dropbutton menu will show up as a button with a clickable twisty pointer
+ * to the right. When clicked the button will expand, showing the list of links.
+ *
+ * The dropbutton will stay open until either the user has moved the mouse
+ * away from the box for > .5 seconds, or can be immediately closed by
+ * clicking the twisty again. The code is smart enough that if the mouse
+ * moves away and then back within the .5 second window, it will not
+ * re-close.
+ *
+ * Multiple dropbuttons can be placed per page.
+ *
+ * If only one link is passed to the theme function, the function will render
+ * a ctools-button with no twisty.  The twisty is only rendered when 2 or more
+ * links are provided. The wrapping element will be classed with both
+ * ctools-button and ctools-dropbutton when a dropbutton is rendered.
+ *
+ * If the user does not have javascript enabled, the link will not appear,
+ * and instead by default the list of links will appear as a normal inline
+ * list.
+ *
+ * The menu is minimally styled by default, and to make it look different
+ * will require your own CSS. You can apply your own class to the
+ * dropbutton to help style it.
+ *
+ * The twisty is rendered as a border on a widthless and heightless element.
+ * There is no image for the twisty.
+ * The color of the twisty is the color of the link by default. To adjust the
+ * size of the twisty, adjust the border widths on .ctools-twisty. The adjust
+ * the color of the twisty, assign a new color to the .ctools-button class or
+ * assign a color to .ctools-twisty. You shouldn't need to adjust border-color.
+ *
+ * Use the theme() function to render dropbutton e.g.
+ * theme('links__ctools_dropbutton', array()) where array contains a renderable
+ * array of links.
+ */
+
+/**
+ * Delegated implementation of hook_theme()
+ */
+function ctools_dropbutton_theme(&$items) {
+  $items['links__ctools_dropbutton'] = array(
+    'variables' => array('title' => NULL, 'links' => NULL, 'image' => FALSE, 'class' => NULL),
+    'file' => 'includes/dropbutton.theme.inc',
+  );
+}
+
+/**
+ * Create a dropbutton menu.
+ *
+ * @param $title
+ *   The text to place in the clickable area to activate the dropbutton. This
+ *   text is indented to -9999px by default.
+ * @param $links
+ *   A list of links to provide within the dropbutton, suitable for use
+ *   in via Drupal's theme('links').
+ * @param $image
+ *   If true, the dropbutton link is an image and will not get extra decorations
+ *   that a text dropbutton link will.
+ * @param $class
+ *   An optional class to add to the dropbutton's container div to allow you
+ *   to style a single dropbutton however you like without interfering with
+ *   other dropbuttons.
+ */
+function theme_links__ctools_dropbutton($vars) {
+  // Check to see if the number of links is greater than 1;
+  // otherwise just treat this like a button.
+  if (!empty($vars['links'])) {
+    $is_drop_button = (count($vars['links']) > 1);
+
+    // Add needed files
+    if ($is_drop_button) {
+      ctools_add_js('dropbutton');
+      ctools_add_css('dropbutton');
+    }
+    ctools_add_css('button');
+
+    // Provide a unique identifier for every button on the page.
+    static $id = 0;
+    $id++;
+
+    // Wrapping div
+    $class = 'ctools-no-js';
+    $class .= ($is_drop_button) ? ' ctools-dropbutton' : '';
+    $class .= ' ctools-button';
+    if (!empty($vars['class'])) {
+      $class .= ($vars['class']) ? (' ' . implode(' ', $vars['class'])) : '';
+    }
+
+    $output = '';
+
+    $output .= '<div class="' . $class . '" id="ctools-button-' . $id . '">';
+
+    // Add a twisty if this is a dropbutton
+    if ($is_drop_button) {
+      $vars['title'] = ($vars['title'] ? check_plain($vars['title']) : t('open'));
+
+      $output .= '<div class="ctools-link">';
+      if ($vars['image']) {
+        $output .= '<a href="#" class="ctools-twisty ctools-image">' . $vars['title'] . '</a>';
+      }
+      else {
+        $output .= '<a href="#" class="ctools-twisty ctools-text">' . $vars['title'] . '</a>';
+      }
+      $output .= '</div>'; // ctools-link
+    }
+
+    // The button content
+    $output .= '<div class="ctools-content">';
+
+    // Check for attributes. theme_links expects an array().
+    $vars['attributes'] = (!empty($vars['attributes'])) ? $vars['attributes'] : array();
+
+    // Remove the inline and links classes from links if they exist.
+    // These classes are added and styled by Drupal core and mess up the default
+    // styling of any link list.
+    if (!empty($vars['attributes']['class'])) {
+      $classes = $vars['attributes']['class'];
+      foreach ($classes as $key => $class) {
+        if ($class === 'inline' || $class === 'links') {
+          unset($vars['attributes']['class'][$key]);
+        }
+      }
+    }
+
+    // Call theme_links to render the list of links.
+    $output .= theme_links(array('links' => $vars['links'], 'attributes' => $vars['attributes'], 'heading' => ''));
+    $output .= '</div>'; // ctools-content
+    $output .= '</div>'; // ctools-dropbutton
+    return $output;
+  }
+  else {
+    return '';
+  }
+}
+
diff --git a/sites/all/modules/ctools/includes/dropdown.theme.inc b/sites/all/modules/ctools/includes/dropdown.theme.inc
index 3e030d3d42ce27599c6f6a1d19ce384d011b6fa7..2e21559d382573b23f102959e56bbbf3690fa8d9 100644
--- a/sites/all/modules/ctools/includes/dropdown.theme.inc
+++ b/sites/all/modules/ctools/includes/dropdown.theme.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: dropdown.theme.inc,v 1.7 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/includes/export-ui.inc b/sites/all/modules/ctools/includes/export-ui.inc
index 0a13ba56a85eb9a07e87d3725ecf78a7b2c0cd7a..2868ae8f5089393d213268869dc8f2aba529d3b4 100644
--- a/sites/all/modules/ctools/includes/export-ui.inc
+++ b/sites/all/modules/ctools/includes/export-ui.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: export-ui.inc,v 1.3 2010/12/31 23:50:25 merlinofchaos Exp $
 
 /**
  * @file
@@ -165,7 +164,7 @@ function ctools_export_ui_process(&$plugin, $info) {
       'load arguments' => array($plugin['name']),
       'access callback' => 'ctools_export_ui_task_access',
       'access arguments' => array($plugin['name'], 'edit', $prefix_count + 2),
-      'type' => MENU_DEFAULT_LOCAL_TASK,
+      'type' => MENU_CALLBACK,
     ),
   );
 
@@ -351,6 +350,7 @@ function ctools_export_ui_process(&$plugin, $info) {
   $plugin['strings']['message'] += array(
     'enable' => t('@plugin %title was enabled.', array('@plugin' => $plugin['title singular proper'])),
     'disable' => t('@plugin %title was disabled.', array('@plugin' => $plugin['title singular proper'])),
+    'no items' => t('There are no @titles to display.', array('@titles' => $plugin['title plural'])),
   );
 }
 
diff --git a/sites/all/modules/ctools/includes/export-ui.menu.inc b/sites/all/modules/ctools/includes/export-ui.menu.inc
index bc8130e2c38fa35311132976c81188560d78143c..d27bf157a1c4e0078e9e7053807bc4cd92fb5941 100644
--- a/sites/all/modules/ctools/includes/export-ui.menu.inc
+++ b/sites/all/modules/ctools/includes/export-ui.menu.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: export-ui.menu.inc,v 1.4 2011/01/01 01:14:24 merlinofchaos Exp $
 
 /**
  * Delegated implementation of hook_menu().
diff --git a/sites/all/modules/ctools/includes/export-ui.plugin-type.inc b/sites/all/modules/ctools/includes/export-ui.plugin-type.inc
index 06e84a6fc088e7596f428af0809ee12df8d08391..f1a7510955517c7cc0c66bfbb8d831d0918224a0 100644
--- a/sites/all/modules/ctools/includes/export-ui.plugin-type.inc
+++ b/sites/all/modules/ctools/includes/export-ui.plugin-type.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: export-ui.plugin-type.inc,v 1.1 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/includes/export.inc b/sites/all/modules/ctools/includes/export.inc
index 16bf635402f36f87b4a22ad068af027141d92fbb..eebf7f57625db103fd53a4a5006876eff02f5a9f 100644
--- a/sites/all/modules/ctools/includes/export.inc
+++ b/sites/all/modules/ctools/includes/export.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: export.inc,v 1.31 2010/12/31 23:50:25 merlinofchaos Exp $
 
 /**
  * @file
@@ -263,12 +262,71 @@ function ctools_export_crud_import($table, $code) {
     // Set these defaults just the same way that ctools_export_new_object sets
     // them.
     $item->export_type = NULL;
-    $item->type = t('Local');
+    $item->{$export['export type string']} = t('Local');
 
     return $item;
   }
 }
 
+/**
+ * Change the status of a certain object.
+ *
+ * @param $table
+ *   The name of the table to use to enable a certain object. This table
+ *   must have an 'export' section containing data or this function
+ *   will fail.
+ * @param $object
+ *   The fully populated object to enable, or the machine readable name.
+ * @param $status
+ *   The status, in this case, is whether or not it is 'disabled'.
+ */
+function ctools_export_crud_set_status($table, $object, $status) {
+  $schema = ctools_export_get_schema($table);
+  $export = $schema['export'];
+
+  if (!empty($export['status callback']) && function_exists($export['status callback'])) {
+    $export['status callback']($object, $status);
+  }
+  else {
+    if (is_object($object)) {
+      ctools_export_set_object_status($object, $status);
+    }
+    else {
+      ctools_export_set_status($table, $object, $status);
+    }
+  }
+
+}
+
+
+/**
+ * Enable a certain object.
+ *
+ * @param $table
+ *   The name of the table to use to enable a certain object. This table
+ *   must have an 'export' section containing data or this function
+ *   will fail.
+ * @param $object
+ *   The fully populated object to enable, or the machine readable name.
+ */
+function ctools_export_crud_enable($table, $object) {
+  return ctools_export_crud_set_status($table, $object, FALSE);
+}
+
+/**
+ * Disable a certain object.
+ *
+ * @param $table
+ *   The name of the table to use to disable a certain object. This table
+ *   must have an 'export' section containing data or this function
+ *   will fail.
+ * @param $object
+ *   The fully populated object to disable, or the machine readable name.
+ */
+function ctools_export_crud_disable($table, $object) {
+  return ctools_export_crud_set_status($table, $object, TRUE);
+}
+
 /**
  * @}
  */
@@ -339,7 +397,7 @@ function ctools_export_load_object($table, $type = 'all', $args = array()) {
   if (!empty($schema['join'])) {
     foreach ($schema['join'] as $join_key => $join) {
       if ($join_schema = drupal_get_schema($join['table'])) {
-        $query->join($join['table'], 't__' . $alias_count, 't__0' . $join['left_key'] . ' = ' . 't__' . $alias_count . '.' . $join['right_key']);
+        $query->join($join['table'], 't__' . $alias_count, 't__0.' . $join['left_key'] . ' = ' . 't__' . $alias_count . '.' . $join['right_key']);
         $query->fields('t__' . $alias_count);
         $alias_count++;
 
@@ -371,9 +429,14 @@ function ctools_export_load_object($table, $type = 'all', $args = array()) {
   $status = variable_get($export['status'], array());
   // Unpack the results of the query onto objects and cache them.
   foreach ($result as $data) {
-    $object = _ctools_export_unpack_object($schema, $data, $export['object']);
+    if (isset($schema['export']['object factory']) && function_exists($schema['export']['object factory'])) {
+      $object = $schema['export']['object factory']($schema, $data);
+    }
+    else {
+      $object = _ctools_export_unpack_object($schema, $data, $export['object']);
+    }
     $object->table = $table;
-    $object->type = t('Normal');
+    $object->{$export['export type string']} = t('Normal');
     $object->export_type = EXPORT_IN_DATABASE;
     // Determine if default object is enabled or disabled.
     if (isset($status[$object->{$export['key']}])) {
@@ -386,10 +449,19 @@ function ctools_export_load_object($table, $type = 'all', $args = array()) {
     }
   }
 
-  // @todo Load subrecords.
+  // Load subrecords.
+  if (isset($export['subrecords callback']) && function_exists($export['subrecords callback'])) {
+    $export['subrecords callback']($cache[$table]);
+  }
 
-  if ($defaults = _ctools_export_get_defaults($table, $export)) {
+  if ($type == 'names' && !empty($args) && !empty($export['cache defaults'])) {
+    $defaults = _ctools_export_get_some_defaults($table, $export, $args);
+  }
+  else {
+    $defaults = _ctools_export_get_defaults($table, $export);
+  }
 
+  if ($defaults) {
     foreach ($defaults as $object) {
       if ($type == 'conditions') {
         // if this does not match all of our conditions, skip it.
@@ -411,14 +483,14 @@ function ctools_export_load_object($table, $type = 'all', $args = array()) {
       }
 
       if (!empty($cache[$table][$object->{$export['key']}])) {
-        $cache[$table][$object->{$export['key']}]->type = t('Overridden');
+        $cache[$table][$object->{$export['key']}]->{$export['export type string']} = t('Overridden');
         $cache[$table][$object->{$export['key']}]->export_type |= EXPORT_IN_CODE;
         if ($type == 'conditions') {
           $return[$object->{$export['key']}] = $cache[$table][$object->{$export['key']}];
         }
       }
       else {
-        $object->type = t('Default');
+        $object->{$export['export type string']} = t('Default');
         $object->export_type = EXPORT_IN_CODE;
         $object->in_code_only = TRUE;
         $object->table = $table;
@@ -493,8 +565,14 @@ function ctools_get_default_object($table, $name) {
     return;
   }
 
-  // @todo add a method to load .inc files for this.
-  $defaults = _ctools_export_get_defaults($table, $export);
+  // Try to load individually from cache if this cache is enabled.
+  if (!empty($export['cache defaults'])) {
+    $defaults = _ctools_export_get_some_defaults($table, $export, array($name));
+  }
+  else {
+    $defaults = _ctools_export_get_defaults($table, $export);
+  }
+
   $status = variable_get($export['status'], array());
 
   if (!isset($defaults[$name])) {
@@ -508,7 +586,7 @@ function ctools_get_default_object($table, $name) {
     $object->disabled = $status[$object->{$export['key']}];
   }
 
-  $object->type = t('Default');
+  $object->{$export['export type string']} = t('Default');
   $object->export_type = EXPORT_IN_CODE;
   $object->in_code_only = TRUE;
 
@@ -523,7 +601,22 @@ function ctools_get_default_object($table, $name) {
 function _ctools_export_get_defaults($table, $export) {
   $cache = &drupal_static(__FUNCTION__, array());
 
+  // If defaults may be cached, first see if we can load from cache.
+  if (!isset($cache[$table]) && !empty($export['cache defaults'])) {
+    $cache[$table] = _ctools_export_get_defaults_from_cache($table, $export);
+  }
+
   if (!isset($cache[$table])) {
+    // If we're caching, attempt to get a lock. We will wait a short time
+    // on the lock, but not too long, because it's better to just rebuild
+    // and throw away results than wait too long on a lock.
+    if (!empty($export['cache defaults'])) {
+      for ($counter = 0; !($lock = lock_acquire('ctools_export:' . $table)) && $counter > 5; $counter++) {
+        lock_wait('ctools_export:' . $table, 1);
+        ++$counter;
+      }
+    }
+
     $cache[$table] = array();
 
     if ($export['default hook']) {
@@ -550,8 +643,8 @@ function _ctools_export_get_defaults($table, $export) {
             else {
               // If version checking is enabled, ensure that the object can be used.
               if (isset($object->api_version) &&
-                $object->api_version >= $export['api']['minimum_version'] &&
-                $object->api_version <= $export['api']['current_version']) {
+                version_compare($object->api_version, $export['api']['minimum_version']) >= 0 &&
+                version_compare($object->api_version, $export['api']['current_version']) <= 0) {
                 $cache[$table][$name] = $object;
               }
             }
@@ -560,12 +653,102 @@ function _ctools_export_get_defaults($table, $export) {
       }
 
       drupal_alter($export['default hook'], $cache[$table]);
+
+      // If we acquired a lock earlier, cache the results and release the
+      // lock.
+      if (!empty($lock)) {
+        // Cache the index.
+        $index = array_keys($cache[$table]);
+        cache_set('ctools_export_index:' . $table, $index, $export['default cache bin']);
+
+        // Cache each object.
+        foreach ($cache[$table] as $name => $object) {
+          cache_set('ctools_export:' . $table . ':' . $name, $object, $export['default cache bin']);
+        }
+        lock_release('ctools_export:' . $table);
+      }
     }
   }
 
   return $cache[$table];
 }
 
+/**
+ * Attempt to load default objects from cache.
+ *
+ * We can be instructed to cache default objects by the schema. If so
+ * we cache them as an index which is a list of all default objects, and
+ * then each default object is cached individually.
+ *
+ * @return Either an array of cached objects, or NULL indicating a cache
+ *   rebuild is necessary.
+ */
+function _ctools_export_get_defaults_from_cache($table, $export) {
+  $data = cache_get('ctools_export_index:' . $table, $export['default cache bin']);
+  if (!$data || !is_array($data->data)) {
+    return;
+  }
+
+  // This is the perfectly valid case where there are no default objects,
+  // and we have cached this state.
+  if (empty($data->data)) {
+    return array();
+  }
+
+  $keys = array();
+  foreach ($data->data as $name) {
+    $keys[] = 'ctools_export:' . $table . ':' . $name;
+  }
+
+  $data = cache_get_multiple($keys, $export['default cache bin']);
+
+  // If any of our indexed keys missed, then we have a fail and we need to
+  // rebuild.
+  if (!empty($keys)) {
+    return;
+  }
+
+  // Now, translate the returned cache objects to actual objects.
+  $cache = array();
+  foreach ($data as $cached_object) {
+    $cache[$cached_object->data->{$export['key']}] = $cached_object->data;
+  }
+
+  return $cache;
+}
+
+/**
+ * Get a limited number of default objects.
+ *
+ * This attempts to load the objects directly from cache. If it cannot,
+ * the cache is rebuilt. This does not disturb the general get defaults
+ * from cache object.
+ *
+ * This function should ONLY be called if default caching is enabled.
+ * It does not check, it is assumed the caller has already done so.
+ */
+function _ctools_export_get_some_defaults($table, $export, $names) {
+  foreach ($names as $name) {
+    $keys[] = 'ctools_export:' . $table . ':' . $name;
+  }
+
+  $data = cache_get_multiple($keys, $export['default cache bin']);
+
+  // Cache hits remove the $key from $keys by reference. Cache
+  // misses do not. A cache miss indicates we may have to rebuild.
+  if (!empty($keys)) {
+    return _ctools_export_get_defaults($table, $export);
+  }
+
+  // Now, translate the returned cache objects to actual objects.
+  $cache = array();
+  foreach ($data as $cached_object) {
+    $cache[$cached_object->data->{$export['key']}] = $cached_object->data;
+  }
+
+  return $cache;
+}
+
 /**
  * Unpack data loaded from the database onto an object.
  *
@@ -646,7 +829,7 @@ function ctools_var_export($var, $prefix = '') {
     // magic method __set_state() leaving the export broken. This
     // workaround avoids this by casting the object as an array for
     // export and casting it back to an object when evaluated.
-    $output .= '(object) ' . ctools_var_export((array) $var);
+    $output .= '(object) ' . ctools_var_export((array) $var, $prefix);
   }
   else if (is_bool($var)) {
     $output = $var ? 'TRUE' : 'FALSE';
@@ -708,7 +891,7 @@ function ctools_export_object($table, $object, $indent = '', $identifier = NULL,
 
     // Note: This is the *field* export callback, not the table one!
     if (!empty($info['export callback']) && function_exists($info['export callback'])) {
-      $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . $info['export callback']($object, $field, $value, $indent) . ";\n";
+      $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . $info['export callback']($object, $field, $object->$field, $indent) . ";\n";
     }
     else {
       $value = $object->$field;
@@ -742,7 +925,7 @@ function ctools_export_get_schema($table) {
     // If our schema isn't loaded, it's possible we're in a state where it
     // simply hasn't been cached. If we've been asked, let's force the
     // issue.
-    if (!$schema) {
+    if (!$schema || empty($schema['export'])) {
       // force a schema reset:
       $schema = drupal_get_schema($table, TRUE);
     }
@@ -768,6 +951,9 @@ function ctools_export_get_schema($table) {
       'bulk export' => TRUE,
       'list callback' => "$schema[module]_{$table}_list",
       'to hook code callback' => "$schema[module]_{$table}_to_hook_code",
+      'cache defaults' => FALSE,
+      'default cache bin' => 'cache',
+      'export type string' => 'type',
     );
 
     // If the export definition doesn't have the "primary key" then the CRUD
@@ -856,7 +1042,7 @@ function ctools_export_set_object_status($object, $new_status = TRUE) {
   $table = $object->table;
   $schema = ctools_export_get_schema($table);
   $export = $schema['export'];
-  $status = variable_get($schema['export']['status'], array());
+  $status = variable_get($export['status'], array());
 
   // Compare
   if (!$new_status && $object->export_type & EXPORT_IN_DATABASE) {
@@ -866,7 +1052,7 @@ function ctools_export_set_object_status($object, $new_status = TRUE) {
     $status[$object->{$export['key']}] = $new_status;
   }
 
-  variable_set($schema['export']['status'], $status);
+  variable_set($export['status'], $status);
 }
 
 /**
@@ -919,7 +1105,7 @@ function ctools_export_new_object($table, $set_defaults = TRUE) {
     // We don't set the export_type property here, as this object is not saved
     // yet. We do give it NULL so we don't generate notices trying to read it.
     $object->export_type = NULL;
-    $object->type = t('Local');
+    $object->{$export['export type string']} = t('Local');
   }
   return $object;
 }
@@ -995,16 +1181,22 @@ function ctools_export_default_list($table, $schema) {
 
   $items = ctools_export_crud_load_all($table);
   $export_key = $schema['export']['key'];
-
   foreach ($items as $item) {
     // Try a couple of possible obvious title keys:
-    if (!empty($item->admin_title)) {
-      $string = "$item->admin_title (" . $item->$export_key . ")";
+    $keys = array('admin_title', 'title');
+    if (isset($schema['export']['admin_title'])) {
+      array_unshift($keys, $schema['export']['admin_title']);
     }
-    elseif (!empty($item->title)) {
-      $string = "$item->title (" . $item->$export_key . ")";
+
+    $string = '';
+    foreach ($keys as $key) {
+      if (!empty($item->$key)) {
+        $string = $item->$key . " (" . $item->$export_key . ")";
+        break;
+      }
     }
-    else {
+
+    if (empty($string)) {
       $string = $item->$export_key;
     }
     $list[$item->$export_key] = check_plain($string);
diff --git a/sites/all/modules/ctools/includes/fields.inc b/sites/all/modules/ctools/includes/fields.inc
index 6a9e632d08f05bfbf1ae7d3b411f90ff1e66f645..1617d3acbcd1f927b6a3dcdcff685c4084b6b6f3 100644
--- a/sites/all/modules/ctools/includes/fields.inc
+++ b/sites/all/modules/ctools/includes/fields.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: fields.inc,v 1.1 2010/11/01 19:07:10 merlinofchaos Exp $
 
 /**
  * @file
@@ -84,20 +83,49 @@ function ctools_fields_get_field_formatter_settings_form($field, $formatter_type
 }
 
 /**
- * Helper function for generating all the formatter information associated with any fields.  Especially useful for determining the fields that will be added to form that executes hook_ield_formatter_settings_form().
+ * Helper function for generating all the formatter information associated with
+ * any fields.
+ * Especially useful for determining the fields that will be added to form that
+ * executes hook_field_formatter_settings_form().
  *
  * @param $fields
  *   An array of fully loaded fields.
  */
-
 function ctools_fields_get_field_formatter_info($fields) {
   $info = array();
+  $field_info = module_invoke_all('field_formatter_info');
   foreach ($fields as $field) {
-    $field_info = module_invoke($field['module'], 'field_formatter_info');
-    if ($field_info) {
-      $info += $field_info;
+    foreach ($field_info as $format_name => $formatter_info) {
+      if (in_array($field['type'], $formatter_info['field types'])) {
+        $info += array($format_name => $formatter_info);
+      }
     }
   }
   drupal_alter('field_formatter_info', $info);
   return $info;
 }
+
+/**
+ * Returns the label of a certain field.
+ *
+ * Cribbed from Views.
+ */
+function ctools_field_label($field_name) {
+  $label_counter = array();
+  // Count the amount of instances per label per field.
+  $instances = field_info_instances();
+  foreach ($instances as $entity_type) {
+    foreach ($entity_type as $bundle) {
+      if (isset($bundle[$field_name])) {
+        $label_counter[$bundle[$field_name]['label']] = isset($label_counter[$bundle[$field_name]['label']]) ? ++$label_counter[$bundle[$field_name]['label']] : 1;
+      }
+    }
+  }
+  if (empty($label_counter)) {
+    return $field_name;
+  }
+  // Sort the field lables by it most used label and return the most used one.
+  arsort($label_counter);
+  $label_counter = array_keys($label_counter);
+  return $label_counter[0];
+}
diff --git a/sites/all/modules/ctools/includes/jump-menu.inc b/sites/all/modules/ctools/includes/jump-menu.inc
index 9acd8b7157b6471fecc9d0b14ab90714fa1e543a..f58672766438726d1edb9b86d394ff5770b0a41b 100644
--- a/sites/all/modules/ctools/includes/jump-menu.inc
+++ b/sites/all/modules/ctools/includes/jump-menu.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: jump-menu.inc,v 1.3 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
@@ -44,7 +43,7 @@
  *     set to this.
  *   - 'inline': If set to TRUE (default) the display will be forced inline.
  */
-function ctools_jump_menu($form_state, $select, $options = array()) {
+function ctools_jump_menu($form, &$form_state, $select, $options = array()) {
   $options += array(
     'button' => t('Go'),
     'choose' => t('- Choose -'),
@@ -117,5 +116,18 @@ function ctools_jump_menu($form_state, $select, $options = array()) {
  * This is normally only invoked upon submit without javascript enabled.
  */
 function ctools_jump_menu_submit($form, &$form_state) {
-  $form_state['redirect'] = $form_state['values']['jump'];
+  $redirect = $form_state['values']['jump'];
+
+  // If the path we are redirecting to starts with the base path (for example,
+  // "/somepath/node/1"), we need to strip the base path off before passing it
+  // to $form_state['redirect'].
+  $base_path = base_path();
+  if (strpos($redirect, $base_path) === 0) {
+    $redirect = substr($redirect, strlen($base_path));
+  }
+
+  // Parse the URL so that query strings and fragments are preserved in the
+  // redirect.
+  $redirect = drupal_parse_url($redirect);
+  $form_state['redirect'] = array($redirect['path'], $redirect);
 }
diff --git a/sites/all/modules/ctools/includes/menu.inc b/sites/all/modules/ctools/includes/menu.inc
index 8a81a5191c1e0f8e3dcfc103a5ffff5e2ee0bfdf..e725ea407e28c50889d629c74c6d625f553420d9 100644
--- a/sites/all/modules/ctools/includes/menu.inc
+++ b/sites/all/modules/ctools/includes/menu.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: menu.inc,v 1.7 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
@@ -28,7 +27,7 @@
  *   - 'weight': The weight to use in ordering the tabs.
  *   - 'type': Optional. If set to MENU_DEFAULT_LOCAL_TASK this can be used to
  *     add a fake 'default' local task, which is useful if you have to add
- *     tabs to a page that has noen.
+ *     tabs to a page that has none.
  */
 function ctools_menu_add_tab($link = NULL) {
   $links = &drupal_static(__FUNCTION__, array());
diff --git a/sites/all/modules/ctools/includes/modal.inc b/sites/all/modules/ctools/includes/modal.inc
index a680f15ebc7a9aae23d357b486f0189e216d5d4c..759391eea4cb0b7da851fa6e545c3e1d7ff7e329 100644
--- a/sites/all/modules/ctools/includes/modal.inc
+++ b/sites/all/modules/ctools/includes/modal.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: modal.inc,v 1.13 2010/12/31 23:58:52 merlinofchaos Exp $
 
 /**
  * @file
@@ -246,5 +245,5 @@ function ctools_modal_form_render($form_state, $output) {
 function ctools_modal_render($title, $output) {
   $commands = array();
   $commands[] = ctools_modal_command_display($title, $output);
-  ajax_render($commands);
+  print ajax_render($commands);
 }
diff --git a/sites/all/modules/ctools/includes/object-cache.cron.inc b/sites/all/modules/ctools/includes/object-cache.cron.inc
index d306b60d31e1af446bffad83265928e001545b38..99f2276ca708222a23d490747746d020a26fd98c 100644
--- a/sites/all/modules/ctools/includes/object-cache.cron.inc
+++ b/sites/all/modules/ctools/includes/object-cache.cron.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: object-cache.cron.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/includes/object-cache.inc b/sites/all/modules/ctools/includes/object-cache.inc
index baefd943690cc6995b818e2dcfc9213205afd37a..5de4df71c6c306e3a2cc809cce1e6f8730576044 100644
--- a/sites/all/modules/ctools/includes/object-cache.inc
+++ b/sites/all/modules/ctools/includes/object-cache.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: object-cache.inc,v 1.15 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/includes/page-wizard.inc b/sites/all/modules/ctools/includes/page-wizard.inc
index ec5a87b8c0ca031628469dfc3e3fef77dcc60fff..a211361b214938c3e2d84e3b5f72f05f1242fe59 100644
--- a/sites/all/modules/ctools/includes/page-wizard.inc
+++ b/sites/all/modules/ctools/includes/page-wizard.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: page-wizard.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * Fetch metadata on a specific page_wizard plugin.
diff --git a/sites/all/modules/ctools/includes/page-wizard.menu.inc b/sites/all/modules/ctools/includes/page-wizard.menu.inc
index 0b8b2f63d1f8033c8b3d8f7bcfed39d4adbf0273..7ed932ed19ee8b0cc385f795f57c3b6788c30999 100644
--- a/sites/all/modules/ctools/includes/page-wizard.menu.inc
+++ b/sites/all/modules/ctools/includes/page-wizard.menu.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: page-wizard.menu.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/includes/plugins-admin.inc b/sites/all/modules/ctools/includes/plugins-admin.inc
index 7b2c69c9abb58fc08cf23bfd017aca019f3b2668..d4ead0a4801e82efefd0388441bd1971ee7d9c20 100644
--- a/sites/all/modules/ctools/includes/plugins-admin.inc
+++ b/sites/all/modules/ctools/includes/plugins-admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: plugins-admin.inc,v 1.3 2011/01/05 22:57:26 merlinofchaos Exp $
 
 /**
  * @file
@@ -72,18 +71,21 @@ function _ctools_plugin_configure_create_form_info(&$form_info, $plugin_definiti
     'show back' => TRUE,
   );
 
+  $add_form = isset($form_info['add form name']) ? $form_info['add form name'] : 'add form';
+  $edit_form = isset($form_info['edit form name']) ? $form_info['edit form name'] : 'edit form';
+
   // Figure out what the forms should actually be. Since they can be specified
   // in a couple of different ways (in order to support simple declarations for
   // the minimal forms but more complex declarations for powerful wizards).
   if ($op == 'add') {
-    if (!empty($plugin_definition['add form'])) {
-      $info = $plugin_definition['add form'];
+    if (!empty($plugin_definition[$add_form])) {
+      $info = $plugin_definition[$add_form];
     }
   }
   if (!isset($info) || $op == 'edit') {
     // Use the edit form for the add form if add form was completely left off.
-    if (!empty($plugin_definition['edit form'])) {
-      $info = $plugin_definition['edit form'];
+    if (!empty($plugin_definition[$edit_form])) {
+      $info = $plugin_definition[$edit_form];
     }
   }
 
@@ -104,12 +106,17 @@ function _ctools_plugin_configure_create_form_info(&$form_info, $plugin_definiti
     else {
       $title = t('Configure !plugin_title', array('!plugin_title' => $plugin_definition['title']));
     }
-    $form_info['order'] = array('form' => $title);
-    $form_info['forms'] = array(
-      'form' => array(
-        'title' => $title,
-        'form id' => $info,
-      ),
+    if (empty($form_info['order'])) {
+      $form_info['order'] = array();
+    }
+    $form_info['order']['form'] = $title;
+
+    if (empty($form_info['forms'])) {
+      $form_info['forms'] = array();
+    }
+    $form_info['forms']['form'] = array(
+      'title' => $title,
+      'form id' => $info,
     );
 
     // Add the default form if one is specified.
@@ -128,8 +135,12 @@ function _ctools_plugin_configure_create_form_info(&$form_info, $plugin_definiti
     }
   }
   else if (is_array($info)) {
-    $form_info['order'] = array();
-    $form_info['forms'] = array();
+      if (empty($form_info['order'])) {
+        $form_info['order'] = array();
+      }
+    if (empty($form_info['forms'])) {
+      $form_info['forms'] = array();
+    }
     $count = 0;
     $base = 'step';
     $wrapper = NULL;
diff --git a/sites/all/modules/ctools/includes/plugins.inc b/sites/all/modules/ctools/includes/plugins.inc
index 5f6364abb9b1fd66cef43e5408c9038a1489a663..f395dbc18ced7a10a54e6213f051abaf14303074 100644
--- a/sites/all/modules/ctools/includes/plugins.inc
+++ b/sites/all/modules/ctools/includes/plugins.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: plugins.inc,v 1.33 2011/01/05 19:58:21 merlinofchaos Exp $
 
 /**
  * @file
@@ -59,15 +58,27 @@ function ctools_plugin_api_info($owner, $api, $minimum_version, $current_version
   $cache = &drupal_static(__FUNCTION__, array());
   if (!isset($cache[$owner][$api])) {
     $cache[$owner][$api] = array();
-    foreach (module_implements('ctools_plugin_api') as $module) {
-      $function = $module . '_ctools_plugin_api';
+
+    $hook = ctools_plugin_api_get_hook($owner, $api);
+
+    foreach (module_implements($hook) as $module) {
+      $function = $module . '_' . $hook;
       $info = $function($owner, $api);
-      if (!isset($info['version'])) {
+      // This is added to make hook_views_api() compatible with this, since
+      // views used a different version key.
+      if (isset($info['version'])) {
+        $version = $info['version'];
+      }
+      else if (isset($info['api'])) {
+        $version = $info['api'];
+      }
+
+      if (!isset($version)) {
         continue;
       }
 
       // Only process if version is between minimum and current, inclusive.
-      if ($info['version'] >= $minimum_version && $info['version'] <= $current_version) {
+      if (version_compare($version, $minimum_version, '>=') && version_compare($version, $current_version, '<=')) {
         if (!isset($info['path'])) {
           $info['path'] = drupal_get_path('module', $module);
         }
@@ -85,7 +96,7 @@ function ctools_plugin_api_info($owner, $api, $minimum_version, $current_version
         }
 
         // Only process if version is between minimum and current, inclusive.
-        if ($info['version'] >= $minimum_version && $info['version'] <= $current_version) {
+      if (version_compare($info['version'], $minimum_version, '>=') && version_compare($info['version'], $current_version, '<=')) {
           if (!isset($info['path'])) {
             $info['path'] = '';
           }
@@ -131,9 +142,21 @@ function ctools_plugin_api_include($owner, $api, $minimum_version, $current_vers
   $info = ctools_plugin_api_info($owner, $api, $minimum_version, $current_version);
   foreach ($info as $module => $plugin_info) {
     if (!isset($already_done[$owner][$api][$module])) {
-      $file = isset($plugin_info['file']) ? $plugin_info['file'] : "$module.$api.inc";
-      if (file_exists("./$plugin_info[path]/$file")) {
-        require_once "./$plugin_info[path]/$file";
+      if (isset($plugin_info["$api file"])) {
+        $file = isset($plugin_info["$api file"]);
+      }
+      else if (isset($plugin_info['file'])) {
+        $file = isset($plugin_info['file']);
+      }
+      else {
+        $file = "$module.$api.inc";
+      }
+
+      if (file_exists(DRUPAL_ROOT . "/$plugin_info[path]/$file")) {
+        require_once DRUPAL_ROOT . "/$plugin_info[path]/$file";
+      }
+      else if (file_exists(DRUPAL_ROOT . "/$file")) {
+        require_once DRUPAL_ROOT . "/$plugin_info[path]/$file";
       }
       $already_done[$owner][$api][$module] = TRUE;
     }
@@ -142,6 +165,32 @@ function ctools_plugin_api_include($owner, $api, $minimum_version, $current_vers
   return $info;
 }
 
+/**
+ * Find out what hook to use to determine if modules support an API.
+ *
+ * By default, most APIs will use hook_ctools_plugin_api, but some modules
+ * want sole ownership. This technique lets modules define what hook
+ * to use.
+ */
+function ctools_plugin_api_get_hook($owner, $api) {
+  // Allow modules to use their own hook for this. The only easy way to do
+  // this right now is with a magically named function.
+  if (function_exists($function = $owner . '_' . $api . '_hook_name')) {
+    $hook = $function();
+  }
+  else if (function_exists($function = $owner . '_ctools_plugin_api_hook_name')) {
+    $hook = $function();
+  }
+
+  // Do this last so that if the $function above failed to return, we have a
+  // sane default.
+  if (empty($hook)) {
+    $hook = 'ctools_plugin_api';
+  }
+
+  return $hook;
+}
+
 /**
  * Fetch a group of plugins by name.
  *
@@ -320,6 +369,7 @@ function ctools_plugin_get_plugin_type_info($flush = FALSE) {
           'use hooks' => FALSE,
           'defaults' => array(),
           'process' => '',
+          'alterable' => TRUE,
           'extension' => 'inc',
           'info file' => FALSE,
           'hook' => $module . '_' . $plugin_type_name,
@@ -338,6 +388,7 @@ function ctools_plugin_get_plugin_type_info($flush = FALSE) {
  * Reset all static caches that affect the result of ctools_get_plugins().
  */
 function ctools_get_plugins_reset() {
+  drupal_static_reset('ctools_plugin_setup');
   drupal_static_reset('ctools_plugin_load_includes');
   drupal_static_reset('ctools_plugin_api_info');
 }
@@ -354,7 +405,7 @@ function ctools_get_plugins_reset() {
  *   An array of information created for this plugin.
  */
 function ctools_plugin_load_includes($info, $filename = NULL) {
-  // Keep a static array so we don't hit drupal_system_listing more than necessary.
+  // Keep a static array so we don't hit file_scan_directory more than necessary.
   $all_files = &drupal_static(__FUNCTION__, array());
 
   // store static of plugin arrays for reference because they can't be reincluded.
@@ -385,7 +436,7 @@ function ctools_plugin_load_includes($info, $filename = NULL) {
       $extension = empty($info['info file']) ? $info['extension'] : 'info';
 
       foreach ($directories as $module => $path) {
-        $all_files[$info['module']][$info['type']][$module] = drupal_system_listing('/\.' . $extension . '$/', $path, 'name', 0);
+        $all_files[$info['module']][$info['type']][$module] = file_scan_directory($path, '/\.' . $extension . '$/', array('key' => 'name'));
       }
 
       cache_set("ctools_plugin_files:$info[module]:$info[type]", $all_files[$info['module']][$info['type']]);
@@ -510,7 +561,9 @@ function _ctools_list_themes() {
     }
     // Put the actual theme info objects into the array
     foreach (array_keys($themes) as $name) {
-      $themes[$name] = $all_themes[$name];
+      if (isset($all_themes[$name])) {
+        $themes[$name] = $all_themes[$name];
+      }
     }
 
     // Make sure the current default theme always gets the last word
@@ -657,10 +710,20 @@ function _ctools_process_data($result, $plugin_type_info, $module, $path, $file)
       }
     }
 
+    // Allow the plugin to be altered before processing.
+    if (!empty($plugin_type_info['alterable']) && $plugin_type_info['alterable']) {
+      drupal_alter('ctools_plugin_pre', $result[$name], $plugin_type_info);
+    }
+
     // Allow the plugin owner to do additional processing.
     if (!empty($plugin_type_info['process']) && $function = ctools_plugin_get_function($plugin_type_info, 'process')) {
       $function($result[$name], $plugin_type_info);
     }
+
+    // Allow the plugin to be altered after processing.
+    if (!empty($plugin_type_info['alterable']) && $plugin_type_info['alterable']) {
+      drupal_alter('ctools_plugin_post', $result[$name], $plugin_type_info);
+    }
   }
   return $result;
 }
diff --git a/sites/all/modules/ctools/includes/stylizer.inc b/sites/all/modules/ctools/includes/stylizer.inc
index 5325eaab1915b0e69b6bcf270d9e38c15e5b0fa8..85e99c0b620d7cb97e88310ba8a381beae6e9a53 100644
--- a/sites/all/modules/ctools/includes/stylizer.inc
+++ b/sites/all/modules/ctools/includes/stylizer.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: stylizer.inc,v 1.3 2011/01/05 22:35:46 merlinofchaos Exp $
 /**
  * @file
  * Create customized CSS and images from palettes created by user input.
@@ -533,7 +532,7 @@ class ctools_stylizer_image_processor {
     }
 
     // The step size for each component
-    for($i = ($luminosity_input + 1); $i <= 255; $i++) {
+    for ($i = ($luminosity_input + 1); $i <= 255; $i++) {
       $palette[$i]['red'] = $red + round($step_size_red * ($i - $luminosity_input));
       $palette[$i]['green'] = $green + round($step_size_green * ($i - $luminosity_input));
       $palette[$i]['blue']= $blue + round($step_size_blue * ($i - $luminosity_input));
@@ -995,7 +994,7 @@ function ctools_stylizer_edit_style_form_default($form, &$form_state) {
       '#theme' => 'ctools_stylizer_color_scheme_form',
     );
 
-    $form['top box']['color']['palette']['#tree'] = true;
+    $form['top box']['color']['palette']['#tree'] = TRUE;
 
     foreach ($plugin['palette'] as $key => $color) {
       if (empty($settings['palette'][$key])) {
diff --git a/sites/all/modules/ctools/includes/stylizer.theme.inc b/sites/all/modules/ctools/includes/stylizer.theme.inc
index 8e320106a7c751a8de123aabc2abc01a70fc79df..85346c155c62e5ac9a5f911dff182f833c953d0a 100644
--- a/sites/all/modules/ctools/includes/stylizer.theme.inc
+++ b/sites/all/modules/ctools/includes/stylizer.theme.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: stylizer.theme.inc,v 1.3 2011/01/05 19:41:11 merlinofchaos Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/includes/utility.inc b/sites/all/modules/ctools/includes/utility.inc
index 6e4f46c8129e8ac2fd50d188e5f6f4a8d6db2ce8..9795dd865d0dc83a2480218a467c50edaa677e89 100644
--- a/sites/all/modules/ctools/includes/utility.inc
+++ b/sites/all/modules/ctools/includes/utility.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: utility.inc,v 1.3 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
@@ -18,13 +17,13 @@
  * To save time we pass the $items array in so we don't need to do array
  * addition. It modifies the array by reference and doesn't need to return it.
  */
-function _ctools_passthrough(&$items, $type = 'theme') {
-  $files = drupal_system_listing('/\.' . $type . '\.inc$/', drupal_get_path('module', 'ctools') . '/includes', 'name', 0);
+function ctools_passthrough($module, $type, &$items) {
+  $files = file_scan_directory(drupal_get_path('module', $module) . '/includes', '/\.' . $type . '\.inc$/', array('key' => 'name'));
   foreach ($files as $file) {
     require_once DRUPAL_ROOT . '/' . $file->uri;
     list($tool) = explode('.', $file->name, 2);
 
-    $function = 'ctools_' . str_replace ('-', '_', $tool) . '_' . str_replace('-', '_', $type);
+    $function = $module . '_' . str_replace ('-', '_', $tool) . '_' . str_replace('-', '_', $type);
     if (function_exists($function)) {
       $function($items);
     }
diff --git a/sites/all/modules/ctools/includes/views.inc b/sites/all/modules/ctools/includes/views.inc
new file mode 100644
index 0000000000000000000000000000000000000000..4ef6439e727444369645dcd3c2042ab238ea15e3
--- /dev/null
+++ b/sites/all/modules/ctools/includes/views.inc
@@ -0,0 +1,26 @@
+<?php
+
+/**
+ * Generate new context classes by argument settings on the view.
+ */
+function ctools_views_get_argument_context($argument) {
+  if ($argument['type'] == 'context') {
+    if (strpos($argument['context'], '.')) {
+      list($context, $converter) = explode('.', $argument['context'], 2);
+    }
+    else {
+      // Backwards-compat for before we had a system for delimiting the data
+      // we retrieve out of context objects.
+      $context = $argument['context'];
+    }
+    if ($context == 'term' || $context == 'vocabulary') {
+      $context = 'entity:taxonomy_' . $context;
+    }
+    elseif ($entity = entity_get_info($context)) {
+      $context = 'entity:' . $context;
+    }
+    $class = 'ctools_context_' . (empty($argument['context_optional']) ? 'required' : 'optional');
+    $new_context = new $class($argument['label'], $context);
+    return $new_context;
+  }
+}
diff --git a/sites/all/modules/ctools/includes/wizard.inc b/sites/all/modules/ctools/includes/wizard.inc
index d8b604d9209021ee5713f60fe73f49710bf294a6..50cd79cfb974bd7e73f293a05b7428779d28afd1 100644
--- a/sites/all/modules/ctools/includes/wizard.inc
+++ b/sites/all/modules/ctools/includes/wizard.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: wizard.inc,v 1.20 2010/10/27 20:07:10 merlinofchaos Exp $
 
 /**
  * @file
@@ -49,7 +48,7 @@
 function ctools_wizard_multistep_form($form_info, $step, &$form_state) {
   // allow order array to be optional
   if (empty($form_info['order'])) {
-    foreach($form_info['forms'] as $step_id => $params) {
+    foreach ($form_info['forms'] as $step_id => $params) {
       $form_info['order'][$step_id] = $params['title'];
     }
   }
@@ -488,7 +487,7 @@ function ctools_wizard_defaults(&$form_info) {
 
   $form_info = $form_info + $defaults;
   // set form callbacks if they aren't defined
-  foreach($form_info['forms'] as $step => $params) {
+  foreach ($form_info['forms'] as $step => $params) {
     if (!$params['form id']) {
        $form_callback = $hook . '_' . $step . '_form';
        $form_info['forms'][$step]['form id'] = $form_callback;
@@ -504,7 +503,7 @@ function ctools_wizard_defaults(&$form_info) {
     'finish callback' => '_finish',
   );
 
-  foreach($callbacks as $key => $callback) {
+  foreach ($callbacks as $key => $callback) {
     // never overwrite if explicity defined
     if (empty($form_info[$key])) {
       $wizard_callback = $hook . $callback;
diff --git a/sites/all/modules/ctools/includes/wizard.theme.inc b/sites/all/modules/ctools/includes/wizard.theme.inc
index ab85e1e560fffb25397f258eaf690f07e5d21544..304906c02ee7a8feff46d47e998f9e3247aa94f3 100644
--- a/sites/all/modules/ctools/includes/wizard.theme.inc
+++ b/sites/all/modules/ctools/includes/wizard.theme.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: wizard.theme.inc,v 1.3 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/js/ajax-responder.js b/sites/all/modules/ctools/js/ajax-responder.js
index ce400220dcdf999e5026ad977b1a679cff6ae741..61ddcf690d78dd044ed12a7a60c920d7a34faebc 100644
--- a/sites/all/modules/ctools/js/ajax-responder.js
+++ b/sites/all/modules/ctools/js/ajax-responder.js
@@ -1,4 +1,3 @@
-// $Id: ajax-responder.js,v 1.25 2010/10/11 22:18:22 sdboyer Exp $
 /**
  * @file
  *
@@ -6,6 +5,8 @@
  */
 
 (function ($) {
+  Drupal.CTools = Drupal.CTools || {};
+  Drupal.CTools.AJAX = Drupal.CTools.AJAX || {};
   /**
    * Grab the response from the server and store it.
    *
@@ -95,29 +96,30 @@
     return url;
   };
 
-
-  Drupal.CTools.AJAX.commands.attr = function(data) {
-    $(data.selector).attr(data.name, data.value);
-  };
+  // Hide these in a ready to ensure that Drupal.ajax is set up first.
+  $(function() {
+    Drupal.ajax.prototype.commands.attr = function(ajax, data, status) {
+      $(data.selector).attr(data.name, data.value);
+    };
 
 
-  Drupal.CTools.AJAX.commands.redirect = function(data) {
-    if (data.delay > 0) {
-      setTimeout(function () {
+    Drupal.ajax.prototype.commands.redirect = function(ajax, data, status) {
+      if (data.delay > 0) {
+        setTimeout(function () {
+          location.href = data.url;
+        }, data.delay);
+      }
+      else {
         location.href = data.url;
-      }, data.delay);
-    }
-    else {
-      location.href = data.url;
-    }
-  };
-
-  Drupal.CTools.AJAX.commands.reload = function(data) {
-    location.reload();
-  };
+      }
+    };
 
-  Drupal.CTools.AJAX.commands.submit = function(data) {
-    $(data.selector).submit();
-  }
+    Drupal.ajax.prototype.commands.reload = function(ajax, data, status) {
+      location.reload();
+    };
 
+    Drupal.ajax.prototype.commands.submit = function(ajax, data, status) {
+      $(data.selector).submit();
+    }
+  });
 })(jQuery);
diff --git a/sites/all/modules/ctools/js/auto-submit.js b/sites/all/modules/ctools/js/auto-submit.js
index 202b534155b59045fceee85b52e14eadc00b4887..4a80f79ee1910115aa25386bf483a7d5af9337cd 100644
--- a/sites/all/modules/ctools/js/auto-submit.js
+++ b/sites/all/modules/ctools/js/auto-submit.js
@@ -1,4 +1,3 @@
-// $Id: auto-submit.js,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 (function($){
 /**
  * To make a form auto submit, all you have to do is 3 things:
@@ -8,19 +7,19 @@
  * On gadgets you want to auto-submit when changed, add the ctools-auto-submit
  * class. With FAPI, add:
  * @code
- *  '#attributes' => array('class' => 'ctools-auto-submit'),
+ *  '#attributes' => array('class' => array('ctools-auto-submit')),
  * @endcode
  *
  * If you want to have auto-submit for every form element,
  * add the ctools-auto-submit-full-form to the form. With FAPI, add:
  * @code
- *   '#attributes' => array('class' => 'ctools-auto-submit-full-form'),
+ *   '#attributes' => array('class' => array('ctools-auto-submit-full-form')),
  * @endcode
  *
  * Finally, you have to identify which button you want clicked for autosubmit.
  * The behavior of this button will be honored if it's ajaxy or not:
  * @code
- *  '#attributes' => array('class' => 'ctools-use-ajax ctools-auto-submit-click'),
+ *  '#attributes' => array('class' => array('ctools-use-ajax', 'ctools-auto-submit-click')),
  * @endcode
  *
  * Currently only 'select' and 'textfield' types are supported. We probably
diff --git a/sites/all/modules/ctools/js/collapsible-div.js b/sites/all/modules/ctools/js/collapsible-div.js
index 4b177bf24160c7f366ebdf650c3c41a76db57df7..2a240ae816b0d885236aee466228df784b150717 100644
--- a/sites/all/modules/ctools/js/collapsible-div.js
+++ b/sites/all/modules/ctools/js/collapsible-div.js
@@ -1,4 +1,3 @@
-// $Id: collapsible-div.js,v 1.11 2010/10/11 22:18:22 sdboyer Exp $
 /**
  * @file
  * Javascript required for a simple collapsible div.
diff --git a/sites/all/modules/ctools/js/dependent.js b/sites/all/modules/ctools/js/dependent.js
index 264f714ecc3ce60df3bdf4bdbceb9f12c2776a0e..9ed0a3215522204ef8c75fe333339465424ba3a7 100644
--- a/sites/all/modules/ctools/js/dependent.js
+++ b/sites/all/modules/ctools/js/dependent.js
@@ -1,4 +1,3 @@
-// $Id: dependent.js,v 1.9 2011/01/01 00:19:17 merlinofchaos Exp $
 /**
  * @file
  *
@@ -31,12 +30,10 @@
 
   Drupal.CTools.dependent.inArray = function(array, search_term) {
     var i = array.length;
-    if (i > 0) {
-     do {
+    while (i--) {
       if (array[i] == search_term) {
          return true;
       }
-     } while (i--);
     }
     return false;
   }
@@ -168,6 +165,7 @@
                 if (Drupal.settings.CTools.dependent[id].num <= len) {
                   // Show if the element if criteria is matched
                   object.show(0);
+                  object.addClass('dependent-options');
                 }
                 else {
                   // Otherwise hide. Use css rather than hide() because hide()
diff --git a/sites/all/modules/ctools/js/dropbutton.js b/sites/all/modules/ctools/js/dropbutton.js
new file mode 100644
index 0000000000000000000000000000000000000000..4dd20b0b8020ac9b5bacf1125059591cb14f0e87
--- /dev/null
+++ b/sites/all/modules/ctools/js/dropbutton.js
@@ -0,0 +1,96 @@
+// $Id$
+/**
+ * @file
+ * Implement a simple, clickable dropbutton menu.
+ *
+ * See dropbutton.theme.inc for primary documentation.
+ *
+ * The javascript relies on four classes:
+ * - The dropbutton must be fully contained in a div with the class
+ *   ctools-dropbutton. It must also contain the class ctools-no-js
+ *   which will be immediately removed by the javascript; this allows for
+ *   graceful degradation.
+ * - The trigger that opens the dropbutton must be an a tag wit hthe class
+ *   ctools-dropbutton-link. The href should just be '#' as this will never
+ *   be allowed to complete.
+ * - The part of the dropbutton that will appear when the link is clicked must
+ *   be a div with class ctools-dropbutton-container.
+ * - Finally, ctools-dropbutton-hover will be placed on any link that is being
+ *   hovered over, so that the browser can restyle the links.
+ *
+ * This tool isn't meant to replace click-tips or anything, it is specifically
+ * meant to work well presenting menus.
+ */
+
+(function ($) {
+  Drupal.behaviors.CToolsDropbutton = {
+    attach: function() {
+      // Process buttons. All dropbuttons are buttons.
+      $('.ctools-button:not(.ctools-button-processed)')
+      .removeClass('ctools-no-js')
+      .addClass('ctools-button-processed');
+      // Process dropbuttons. Not all buttons are dropbuttons.
+      $('.ctools-dropbutton:not(.ctools-dropbutton-processed)')
+      .addClass('ctools-dropbutton-processed')
+      .each(function() {
+        var $dropbutton = $(this);
+        var $button = $('.ctools-content', $dropbutton);
+        var $secondaryActions = $('li', $button).not(':first');
+        var $twisty = $(".ctools-link", $dropbutton);
+        var open = false;
+        var hovering = false;
+        var timerID = 0;
+
+        var toggle = function(close) {
+          // if it's open or we're told to close it, close it.
+          if (open || close) {
+            // If we're just toggling it, close it immediately.
+            if (!close) {
+              open = false;
+              $secondaryActions.slideUp(100);
+              $dropbutton.removeClass('open');
+            }
+            else {
+              // If we were told to close it, wait half a second to make
+              // sure that's what the user wanted.
+              // Clear any previous timer we were using.
+              if (timerID) {
+                clearTimeout(timerID);
+              }
+              timerID = setTimeout(function() {
+                if (!hovering) {
+                  open = false;
+                  $secondaryActions.slideUp(100);
+                  $dropbutton.removeClass('open');
+                }}, 500);
+            }
+          }
+          else {
+            // open it.
+            open = true;
+            $secondaryActions.animate({height: "show", opacity: "show"}, 100);
+            $dropbutton.addClass('open');
+          }
+        }
+        // Hide the secondary actions initially.
+        $secondaryActions.hide();
+
+        $twisty.click(function() {
+            toggle();
+            return false;
+          });
+
+        $dropbutton.hover(
+          function() {
+            hovering = true;
+          }, // hover in
+          function() { // hover out
+            hovering = false;
+            toggle(true);
+            return false;
+          }
+        );
+      });
+    }
+  }
+})(jQuery);
diff --git a/sites/all/modules/ctools/js/dropdown.js b/sites/all/modules/ctools/js/dropdown.js
index 5feea2d3fa5aeb3045b2a202246f9ea7755c6a94..522f4d5d7643789d2903f25d486caff796f4d5c3 100644
--- a/sites/all/modules/ctools/js/dropdown.js
+++ b/sites/all/modules/ctools/js/dropdown.js
@@ -1,4 +1,3 @@
-// $Id: dropdown.js,v 1.6 2010/10/11 22:18:22 sdboyer Exp $
 /**
  * @file
  * Implement a simple, clickable dropdown menu.
diff --git a/sites/all/modules/ctools/js/jump-menu.js b/sites/all/modules/ctools/js/jump-menu.js
index 3310022b59addaf4e206dc40884c49fc1079d8c2..f515c8c5d433858c1d92f2bf73e36d3dd80159d0 100644
--- a/sites/all/modules/ctools/js/jump-menu.js
+++ b/sites/all/modules/ctools/js/jump-menu.js
@@ -1,4 +1,3 @@
-// $Id: jump-menu.js,v 1.3 2010/10/11 22:18:22 sdboyer Exp $
 
 (function($) {
   Drupal.behaviors.CToolsJumpMenu = { 
diff --git a/sites/all/modules/ctools/js/modal.js b/sites/all/modules/ctools/js/modal.js
index 7ad5524b3718a5a6ab627f3e7de4f6b66135ffe8..4d6c6f81e118b6d683676152492d61bde238351b 100644
--- a/sites/all/modules/ctools/js/modal.js
+++ b/sites/all/modules/ctools/js/modal.js
@@ -1,4 +1,3 @@
-// $Id: modal.js,v 1.27 2010/12/31 22:27:02 merlinofchaos Exp $
 /**
  * @file
  *
@@ -245,10 +244,6 @@
       $('#modal-content form:not(.ctools-use-modal-processed)', context)
         .addClass('ctools-use-modal-processed')
         .each(function() {
-          $('input[type=submit], button', this).click(function() {
-            this.form.clk = this;
-          });
-
           var element_settings = {};
 
           element_settings.url = $(this).attr('action');
@@ -258,6 +253,12 @@
 
           Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings);
           Drupal.ajax[base].form = $(this);
+
+          $('input[type=submit], button', this).click(function() {
+            Drupal.ajax[base].element = this;
+            this.form.clk = this;
+          });
+
         });
     }
   };
@@ -384,6 +385,14 @@
         event = window.event;
         target = event.srcElement;
       }
+
+      var parents = $(target).parents().get();
+      for (var i in $(target).parents().get()) {
+        var position = $(parents[i]).css('position');
+        if (position == 'absolute' || position == 'fixed') {
+          return true;
+        }
+      }
       if( $(target).filter('*:visible').parents('#modalContent').size()) {
         // allow the event only if target is a visible child node of #modalContent
         return true;
diff --git a/sites/all/modules/ctools/js/stylizer.js b/sites/all/modules/ctools/js/stylizer.js
index 38727cff6900d80899d29382313606da9eacc1bd..dc1caaa5bf0616433746ed75af525779c4c23c86 100644
--- a/sites/all/modules/ctools/js/stylizer.js
+++ b/sites/all/modules/ctools/js/stylizer.js
@@ -1,4 +1,3 @@
-// $Id: stylizer.js,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 (function ($) {
   Drupal.CTools = Drupal.CTools || {};
diff --git a/sites/all/modules/ctools/page_manager/css/page-manager.css b/sites/all/modules/ctools/page_manager/css/page-manager.css
index 2ba23b9ffbf8280bb63927be6dea27b23bffe873..40b2e5e314d5243330619b58fc8ecc2c72fd2579 100644
--- a/sites/all/modules/ctools/page_manager/css/page-manager.css
+++ b/sites/all/modules/ctools/page_manager/css/page-manager.css
@@ -1,4 +1,3 @@
-/* $Id: page-manager.css,v 1.13 2011/01/05 23:16:59 merlinofchaos Exp $ */
 body form#page-manager-list-pages-form {
   margin: 0 0 20px 0;
 }
@@ -54,6 +53,21 @@ body form#page-manager-list-pages-form {
   background: url(../images/locked-other.png) no-repeat scroll left center; /* LTR */
 }
 
+/* Force the background color to inherit so that the dropbuttons do not need
+   a specific background color. */
+#page-manager-list-pages td.page-manager-page-operations {
+  vertical-align: top;
+  background-color: inherit;
+}
+
+#page-manager-list-pages td.page-manager-page-operations .ctools-dropbutton {
+  text-align: left; /* LTR */
+  position: absolute;
+  right: 10px;
+}
+
+
+
 #page-manager-edit .page-manager-wrapper {
   margin: 0;
   padding: 0 0 0 149px;
@@ -340,3 +354,20 @@ body form#page-manager-list-pages-form {
   line-height: 1.75em;
 }
 
+
+/** Override that obnoxious float on throbber. **/
+#page-manager-edit .progress-disabled {
+  float: none;
+}
+
+#page-manager-edit .progress-disabled + .ajax-progress {
+  float: right;
+  position: relative;
+  top: -2em;
+}
+
+#page-manager-list-pages-form .progress-disabled + .ajax-progress {
+  position: relative;
+  top: 2em;
+  left: -.5em;
+}
diff --git a/sites/all/modules/ctools/page_manager/help/about.html b/sites/all/modules/ctools/page_manager/help/about.html
index 5e6729c5b4b48013974b598097674050ec81b0e1..fa58acafbb1c3fd767706439cb597edc6a4b8153 100644
--- a/sites/all/modules/ctools/page_manager/help/about.html
+++ b/sites/all/modules/ctools/page_manager/help/about.html
@@ -1,4 +1,3 @@
-<!-- $Id: about.html,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ -->
 The Page Manager module creates and manages pages in your Drupal site. Pages are defined as items that have a path and provide output to the user. It is a complete round trip from getting user input to providing user output.
 
 There are two types of pages that the Page Manager currently supports:
diff --git a/sites/all/modules/ctools/page_manager/help/api-task-handler.html b/sites/all/modules/ctools/page_manager/help/api-task-handler.html
index 64f594547b5959cf9573910a18ee9e54a091eb88..4544a2a864a759446765b8990628437d5f91e4fb 100644
--- a/sites/all/modules/ctools/page_manager/help/api-task-handler.html
+++ b/sites/all/modules/ctools/page_manager/help/api-task-handler.html
@@ -1,4 +1,3 @@
-<!-- $Id: api-task-handler.html,v 1.1 2009/07/09 00:07:04 merlinofchaos Exp $ -->
 task handler definition:
   title -- visible title of the task handler.
   description -- description of the task handler.
diff --git a/sites/all/modules/ctools/page_manager/help/api-task-type.html b/sites/all/modules/ctools/page_manager/help/api-task-type.html
index f39ac11ddaa3dd0dafd124702e5fd57ec93d7fef..eb87265f6264505e8e91a1cb5b37dca6a50a705a 100644
--- a/sites/all/modules/ctools/page_manager/help/api-task-type.html
+++ b/sites/all/modules/ctools/page_manager/help/api-task-type.html
@@ -1,3 +1,2 @@
-<!-- $Id: api-task-type.html,v 1.1 2009/07/09 00:07:04 merlinofchaos Exp $ -->
 
 defines a task type, grouping tasks together and providing a common UI for them.
\ No newline at end of file
diff --git a/sites/all/modules/ctools/page_manager/help/api-task.html b/sites/all/modules/ctools/page_manager/help/api-task.html
index 4eced0e2a44cbfb7e80e25d5e9cc1cfc232f8a73..cd6e3d0cbc495c4fdf0c0e5ea84224023ea54485 100644
--- a/sites/all/modules/ctools/page_manager/help/api-task.html
+++ b/sites/all/modules/ctools/page_manager/help/api-task.html
@@ -1,4 +1,3 @@
-<!-- $Id: api-task.html,v 1.1 2009/07/09 00:07:04 merlinofchaos Exp $ -->
 task definition:
   title -- visible title of the task.
   description -- description of the task.
diff --git a/sites/all/modules/ctools/page_manager/help/custom-pages-access.html b/sites/all/modules/ctools/page_manager/help/custom-pages-access.html
index 25ba63a268ef6c597ad43aef6b395913f703bf27..a2643c28c44e50046cd53476b79eb00ef0306f16 100644
--- a/sites/all/modules/ctools/page_manager/help/custom-pages-access.html
+++ b/sites/all/modules/ctools/page_manager/help/custom-pages-access.html
@@ -1,3 +1,2 @@
-<!-- $Id: custom-pages-access.html,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ -->
 
 Please visit <a href="http://drupal.org/node/528072">http://drupal.org/node/528072</a> to help provide this documentation page.
\ No newline at end of file
diff --git a/sites/all/modules/ctools/page_manager/help/custom-pages-arguments.html b/sites/all/modules/ctools/page_manager/help/custom-pages-arguments.html
index b0bdff51f89b1c626ac93f8da7c789ca7e5531cd..516a4292b95039e976c02ba8f145804e1beb30ce 100644
--- a/sites/all/modules/ctools/page_manager/help/custom-pages-arguments.html
+++ b/sites/all/modules/ctools/page_manager/help/custom-pages-arguments.html
@@ -1,3 +1,2 @@
-<!-- $Id: custom-pages-arguments.html,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ -->
 
 Please visit <a href="http://drupal.org/node/528058">http://drupal.org/node/528058</a> to help provide this documentation page.
\ No newline at end of file
diff --git a/sites/all/modules/ctools/page_manager/help/custom-pages-menu.html b/sites/all/modules/ctools/page_manager/help/custom-pages-menu.html
index d3388bca1ea1578159e826e603b14ece47831c43..48cf9c3976d892215d0ae73055314634799a4282 100644
--- a/sites/all/modules/ctools/page_manager/help/custom-pages-menu.html
+++ b/sites/all/modules/ctools/page_manager/help/custom-pages-menu.html
@@ -1,3 +1,2 @@
-<!-- $Id: custom-pages-menu.html,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ -->
 
 Please visit <a href="http://drupal.org/node/528078">http://drupal.org/node/528078</a> to help provide this documentation page.
\ No newline at end of file
diff --git a/sites/all/modules/ctools/page_manager/help/custom-pages.html b/sites/all/modules/ctools/page_manager/help/custom-pages.html
index 22ea381ea07cf6e8754cfae6560a8999d29c20df..18e66d4bef925c51a07e7673e79cf74df883d2ab 100644
--- a/sites/all/modules/ctools/page_manager/help/custom-pages.html
+++ b/sites/all/modules/ctools/page_manager/help/custom-pages.html
@@ -1,3 +1,2 @@
-<!-- $Id: custom-pages.html,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ -->
 
 Please visit <a href="http://drupal.org/node/528050">http://drupal.org/node/528050</a> to help provide this documentation page.
\ No newline at end of file
diff --git a/sites/all/modules/ctools/page_manager/help/getting-started-create.html b/sites/all/modules/ctools/page_manager/help/getting-started-create.html
index 3ba5ebc297c02d71116cf7a82059c897f9cad28a..a3d295e388f121663fc6ca48976abec1ef15d6ee 100644
--- a/sites/all/modules/ctools/page_manager/help/getting-started-create.html
+++ b/sites/all/modules/ctools/page_manager/help/getting-started-create.html
@@ -1,3 +1,2 @@
-<!-- $Id: getting-started-create.html,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ -->
 
 Please visit <a href="http://drupal.org/node/528038">http://drupal.org/node/528038</a> to help provide this documentation page.
\ No newline at end of file
diff --git a/sites/all/modules/ctools/page_manager/help/getting-started-custom-nodes.html b/sites/all/modules/ctools/page_manager/help/getting-started-custom-nodes.html
index a5d403b0eced5f62c8e16c6f8bb68b333fa60769..d62eb0f32a2ca2a5dc5b4c4956c5f2c24bfca4e0 100644
--- a/sites/all/modules/ctools/page_manager/help/getting-started-custom-nodes.html
+++ b/sites/all/modules/ctools/page_manager/help/getting-started-custom-nodes.html
@@ -1,3 +1,2 @@
-<!-- $Id: getting-started-custom-nodes.html,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ -->
 
 Please visit <a href="http://drupal.org/node/528044">http://drupal.org/node/528044</a> to help provide this documentation page.
\ No newline at end of file
diff --git a/sites/all/modules/ctools/page_manager/help/getting-started-custom-vocabulary.html b/sites/all/modules/ctools/page_manager/help/getting-started-custom-vocabulary.html
index a14c0ea68b8ef358cc5b152422e73c6572ec99ea..7148cd96a3c43bb613edb778f5f0030cda53dc08 100644
--- a/sites/all/modules/ctools/page_manager/help/getting-started-custom-vocabulary.html
+++ b/sites/all/modules/ctools/page_manager/help/getting-started-custom-vocabulary.html
@@ -1,3 +1,2 @@
-<!-- $Id: getting-started-custom-vocabulary.html,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ -->
 
 Please visit <a href="http://drupal.org/node/528046">http://drupal.org/node/528046</a> to help provide this documentation page.
\ No newline at end of file
diff --git a/sites/all/modules/ctools/page_manager/help/getting-started-members.html b/sites/all/modules/ctools/page_manager/help/getting-started-members.html
index 73a4405ffe8cf1392e4eeecc3ff043f5c51110f9..87b21227ca1bf718c9807056b4fa87208c3d9aad 100644
--- a/sites/all/modules/ctools/page_manager/help/getting-started-members.html
+++ b/sites/all/modules/ctools/page_manager/help/getting-started-members.html
@@ -1,3 +1,2 @@
-<!-- $Id: getting-started-members.html,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ -->
 
 Please visit <a href="http://drupal.org/node/528040">http://drupal.org/node/528040</a> to help provide this documentation page.
\ No newline at end of file
diff --git a/sites/all/modules/ctools/page_manager/help/getting-started-page-list.html b/sites/all/modules/ctools/page_manager/help/getting-started-page-list.html
index ad330a7f529e66c9444e0ac99f7bd8f6dbeb80d6..d60bea4ad0bc9cc0f2d86d5f6426be6ba2f05d0d 100644
--- a/sites/all/modules/ctools/page_manager/help/getting-started-page-list.html
+++ b/sites/all/modules/ctools/page_manager/help/getting-started-page-list.html
@@ -1,3 +1,2 @@
-<!-- $Id: getting-started-page-list.html,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ -->
 
 Please visit <a href="http://drupal.org/node/528036">http://drupal.org/node/528036</a> to help provide this documentation page.
\ No newline at end of file
diff --git a/sites/all/modules/ctools/page_manager/help/getting-started.html b/sites/all/modules/ctools/page_manager/help/getting-started.html
index d342751dfd1d14ea41be606f125c45940d68f506..4e4f24ae8f3ec30c0ed038f1f3419b36b0371f8d 100644
--- a/sites/all/modules/ctools/page_manager/help/getting-started.html
+++ b/sites/all/modules/ctools/page_manager/help/getting-started.html
@@ -1,4 +1,3 @@
-<!-- $Id: getting-started.html,v 1.2 2009/08/19 22:24:07 merlinofchaos Exp $ -->
 
 Note: this page is currently very preliminary. Please visit <a href="http://drupal.org/node/528034">http://drupal.org/node/528034</a> to help provide this documentation page!
 
diff --git a/sites/all/modules/ctools/page_manager/help/page_manager.help.ini b/sites/all/modules/ctools/page_manager/help/page_manager.help.ini
index cd94653270d5171af16fa06fcefedbe5f96a6782..05cadb482e3bcaa323bb8de6e74371174a21bf50 100644
--- a/sites/all/modules/ctools/page_manager/help/page_manager.help.ini
+++ b/sites/all/modules/ctools/page_manager/help/page_manager.help.ini
@@ -1,4 +1,3 @@
-; $Id: page_manager.help.ini,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $
 [advanced help settings]
 line break = TRUE
 
diff --git a/sites/all/modules/ctools/page_manager/help/variants.html b/sites/all/modules/ctools/page_manager/help/variants.html
index 389af3304b95b34612b19188e5a46c25e9cbbcee..48cf9c3976d892215d0ae73055314634799a4282 100644
--- a/sites/all/modules/ctools/page_manager/help/variants.html
+++ b/sites/all/modules/ctools/page_manager/help/variants.html
@@ -1,3 +1,2 @@
-<!-- $Id: variants.html,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ -->
 
 Please visit <a href="http://drupal.org/node/528078">http://drupal.org/node/528078</a> to help provide this documentation page.
\ No newline at end of file
diff --git a/sites/all/modules/ctools/page_manager/js/page-list.js b/sites/all/modules/ctools/page_manager/js/page-list.js
index 796862565834ac777b97553d440573d10432d31b..16b52911dca41f4c763849b1bec92f4dd956b81d 100644
--- a/sites/all/modules/ctools/page_manager/js/page-list.js
+++ b/sites/all/modules/ctools/page_manager/js/page-list.js
@@ -1,4 +1,3 @@
-// $Id: page-list.js,v 1.3 2009/07/12 18:32:04 merlinofchaos Exp $
 
 /**
  * Provide some extra responses for the page list so we can have automatic
diff --git a/sites/all/modules/ctools/page_manager/page_manager.admin.inc b/sites/all/modules/ctools/page_manager/page_manager.admin.inc
index 4540cb51c2612a0e19384f17bb52fdbfcbfb97ad..7b9056b7521d0d526ace7093336b6bc985cf8a61 100644
--- a/sites/all/modules/ctools/page_manager/page_manager.admin.inc
+++ b/sites/all/modules/ctools/page_manager/page_manager.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: page_manager.admin.inc,v 1.45 2010/11/03 00:01:14 merlinofchaos Exp $
 
 /**
  * @file
@@ -21,6 +20,12 @@ function page_manager_list_page($js = NULL) {
   // TRUE if 'ajax', FALSE if otherwise.
   $js = $js == 'ajax';
 
+  // If we do any form rendering, it's to completely replace a form on the
+  // page, so don't let it force our ids to change.
+  if ($js && isset($_POST['ajax_html_ids'])) {
+    unset($_POST['ajax_html_ids']);
+  }
+
   if (module_exists('advanced_help') && !$js) {
     drupal_set_message(theme('advanced_help_topic', 'page_manager', 'getting-started', t('See the getting started guide for more information.')));
   }
@@ -108,7 +113,7 @@ function page_manager_list_page($js = NULL) {
   $commands = array();
   $commands[] = ajax_command_replace('#page-manager-list-pages', $table);
   if (!empty($replace_form)) {
-    $commands[] = ajax_command_replace('#page-manager-list-pages-form', $form);
+    $commands[] = ajax_command_replace('#page-manager-list-pages-form', drupal_render($form));
   }
   print ajax_render($commands);
   ajax_footer();
@@ -198,11 +203,11 @@ function page_manager_get_pages($tasks, &$pages, $task_id = NULL) {
 
     if (!empty($task['enable callback'])) {
       if (!empty($task['disabled'])) {
-        $operations[] = array(
+        array_unshift($operations, array(
           'title' => t('Enable'),
           'href' => 'admin/structure/pages/nojs/enable/' . $task_name,
           'query' => array('token' => drupal_get_token($task_name)),
-        );
+        ));
       }
       else {
         $operations[] = array(
@@ -213,7 +218,9 @@ function page_manager_get_pages($tasks, &$pages, $task_id = NULL) {
       }
     }
 
-    $row['data']['operations'] = array('data' => theme('links', array('links' => $operations)), 'class' => array('page-manager-page-operations'));
+    $ops = theme('links__ctools_dropbutton', array('links' => $operations, 'attributes' => array('class' => array('links', 'inline'))));
+
+    $row['data']['operations'] = array('data' => $ops, 'class' => array('page-manager-page-operations'));
 
     $pages['disabled'][$task_name] = !empty($task['disabled']);
     $pages['tasks'][] = $task_name;
@@ -391,7 +398,8 @@ function page_manager_edit_page($page) {
   drupal_set_title($page->subtask['admin title']);
   // Provide and process the save page form before anything else.
   $form_state = array('page' => &$page);
-  $form = drupal_render(drupal_build_form('page_manager_save_page_form', $form_state));
+  $built_form = drupal_build_form('page_manager_save_page_form', $form_state);
+  $form = drupal_render($built_form);
 
   $operations = page_manager_get_operations($page);
   $args = array('summary');
@@ -436,7 +444,8 @@ function page_manager_edit_page_operation() {
   // Since this form should never be submitted to this page, process it late so
   // that we can be sure it notices changes.
   $form_state = array('page' => &$page);
-  $form = drupal_render(drupal_build_form('page_manager_save_page_form', $form_state));
+  $built_form = drupal_build_form('page_manager_save_page_form', $form_state);
+  $form = drupal_render($built_form);
 
   $output = theme('page_manager_edit_page', array('page' => $page, 'save' => $form, 'operations' => $rendered_operations, 'content' => $content));
 
@@ -911,7 +920,8 @@ function _page_manager_get_operation_content($js, &$page, $active, $operation, $
       $form_state['handler'] = &$form_state['page']->new_handler;
     }
 
-    $output = drupal_render(ctools_wizard_multistep_form($form_info, $step, $form_state));
+    $built_form = ctools_wizard_multistep_form($form_info, $step, $form_state);
+    $output = drupal_render($built_form);
     $title = empty($form_state['title']) ? $operation['title'] : $form_state['title'];
     $titles[] = $title;
     $title = implode(' &raquo ', array_filter($titles));
@@ -1387,10 +1397,8 @@ function page_manager_handler_add_form($form, $form_state, $features = array())
 
   // This set of checkboxes is not dangerous at all.
   $form['features'] = array(
-    '#type' => 'checkboxes',
-    '#validated' => TRUE,
+    '#type' => 'item',
     '#title' => t('Optional features'),
-    '#options' => array(),
     '#description' => t('Check any optional features you need to be presented with forms for configuring them. If you do not check them here you will still be able to utilize these features once the new page is created. If you are not sure, leave these unchecked.'),
     '#tree' => TRUE,
   );
@@ -1408,7 +1416,6 @@ function page_manager_handler_add_form($form, $form_state, $features = array())
 
       if ($plugin != 'default') {
         $form['features'][$plugin][$feature_id] += array(
-          '#process' => array('ctools_dependent_process'),
           '#dependency' => array('edit-handler' => array($plugin)),
         );
       }
diff --git a/sites/all/modules/ctools/page_manager/page_manager.info b/sites/all/modules/ctools/page_manager/page_manager.info
index 16e36dfdd91e2d57d4e22c7eb834c6c405c984df..4791bc318786d021052ca9de2dc0161864e2b8aa 100644
--- a/sites/all/modules/ctools/page_manager/page_manager.info
+++ b/sites/all/modules/ctools/page_manager/page_manager.info
@@ -1,13 +1,12 @@
-; $Id: page_manager.info,v 1.5 2011/01/01 00:01:46 merlinofchaos Exp $
 name = Page manager
 description = Provides a UI and API to manage pages within the site.
 core = 7.x
 dependencies[] = ctools
 package = Chaos tool suite
 
-; Information added by drupal.org packaging script on 2011-01-06
-version = "7.x-1.0-alpha2"
+; Information added by drupal.org packaging script on 2011-05-31
+version = "7.x-1.0-beta1"
 core = "7.x"
 project = "ctools"
-datestamp = "1294276864"
+datestamp = "1306885315"
 
diff --git a/sites/all/modules/ctools/page_manager/page_manager.install b/sites/all/modules/ctools/page_manager/page_manager.install
index 1771e48e995d064754897d7d520d1a2b62d7ee1b..ad2781c8c7ef603e0db001946aa7c3b84b678ba2 100644
--- a/sites/all/modules/ctools/page_manager/page_manager.install
+++ b/sites/all/modules/ctools/page_manager/page_manager.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: page_manager.install,v 1.10 2010/09/07 09:02:50 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/page_manager/page_manager.module b/sites/all/modules/ctools/page_manager/page_manager.module
index e7ba2dabffe62fce13b6b5c39c25301443bb7c03..7b606af51c7fa210ecb70f236cc8681b3c375e02 100644
--- a/sites/all/modules/ctools/page_manager/page_manager.module
+++ b/sites/all/modules/ctools/page_manager/page_manager.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: page_manager.module,v 1.26 2010/11/03 00:08:04 merlinofchaos Exp $
 
 /**
  * @file
@@ -96,6 +95,7 @@ function page_manager_menu() {
   $base = array(
     'access arguments' => array('use page manager'),
     'file' => 'page_manager.admin.inc',
+    'theme callback' => 'ajax_base_page_theme',
   );
 
   $items['admin/structure/pages'] = array(
@@ -115,13 +115,13 @@ function page_manager_menu() {
     'title' => 'Edit',
     'page callback' => 'page_manager_edit_page',
     'page arguments' => array(4),
-    'type' => MENU_CALLBACK,
+    'type' => MENU_NORMAL_ITEM,
   ) + $base;
 
   $items['admin/structure/pages/%ctools_js/operation/%page_manager_cache'] = array(
     'page callback' => 'page_manager_edit_page_operation',
     'page arguments' => array(3, 5),
-    'type' => MENU_CALLBACK,
+    'type' => MENU_NORMAL_ITEM,
   ) + $base;
 
   $items['admin/structure/pages/%ctools_js/enable/%page_manager_cache'] = array(
@@ -158,6 +158,35 @@ function page_manager_menu() {
   return $items;
 }
 
+function page_manager_admin_paths() {
+  /* @todo FIX ME this is a major resource suck. */
+  return;
+
+  $items = array();
+  ctools_include('page', 'page_manager', 'plugins/tasks');
+  $pages = page_manager_page_load_all();
+  foreach ($pages as $page) {
+    // Make sure the page we're on is set to be an administrative path and that
+    // it is not set to be a frontpage path.
+    if ((isset($page->conf['admin_paths']) && $page->conf['admin_paths']) && (!isset($page->make_frontpage) || !$page->make_frontpage)) {
+      $path_parts = explode('/', $page->path);
+      foreach ($path_parts as $key => $part) {
+        if (strpos($part, '%') !== FALSE || strpos($part, '!') !== FALSE) {
+          $path_parts[$key] = '*';
+        }
+      }
+      $path = implode('/', $path_parts);
+      if ($page->menu['type'] == 'default tab') {
+        array_pop($path_parts);
+        $parent_path = implode('/', $path_parts);
+        $items[$parent_path] = TRUE;
+      }
+      $items[$path] = TRUE;
+    }
+  }
+  return $items;
+}
+
 /**
  * Implements hook_menu_alter.
  *
diff --git a/sites/all/modules/ctools/page_manager/plugins/cache/page_manager_context.inc b/sites/all/modules/ctools/page_manager/plugins/cache/page_manager_context.inc
index f56f81c6a48912924ca98ff4c67803b24b5a05ac..2f01b56033c12e257f0571a8dc3b4a7c7230631d 100644
--- a/sites/all/modules/ctools/page_manager/plugins/cache/page_manager_context.inc
+++ b/sites/all/modules/ctools/page_manager/plugins/cache/page_manager_context.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: page_manager_context.inc,v 1.1 2010/10/11 22:18:24 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/page_manager/plugins/task_handlers/http_response.inc b/sites/all/modules/ctools/page_manager/plugins/task_handlers/http_response.inc
index bf3da17e94bdb4d2d0564e1539ec4cfe49c6e519..ba549b49d0db5d0b1c305ba6be5c9405f63f2739 100644
--- a/sites/all/modules/ctools/page_manager/plugins/task_handlers/http_response.inc
+++ b/sites/all/modules/ctools/page_manager/plugins/task_handlers/http_response.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: http_response.inc,v 1.2 2010/10/11 22:18:24 sdboyer Exp $
 
 /**
  * @file
@@ -16,7 +15,7 @@ $plugin = array(
 
   // Administrative fields.
   'title' => t('HTTP response code'),
-  'admin summary' =>'page_manager_http_response_admin_summary',
+  'admin summary' => 'page_manager_http_response_admin_summary',
   'admin title' => 'page_manager_http_response_title',
   'operations' => array(
     'settings' => array(
@@ -215,7 +214,7 @@ function page_manager_http_response_title($handler, $task, $subtask) {
 /**
  * General settings for the panel
  */
-function page_manager_http_response_edit_settings(&$form, &$form_state) {
+function page_manager_http_response_edit_settings($form, &$form_state) {
   $conf = $form_state['handler']->conf;
   $form['title'] = array(
     '#type' => 'textfield',
@@ -236,7 +235,6 @@ function page_manager_http_response_edit_settings(&$form, &$form_state) {
     '#type' => 'textfield',
     '#title' => t('Redirect destination'),
     '#default_value' => $conf['destination'],
-    '#process' => array('ctools_dependent_process'),
     '#dependency' => array('edit-code' => array(301)),
     '#description' => t('Enter the path to redirect to. You may use keyword substitutions from contexts. You can use external urls (http://www.example.com/foo) or internal urls (node/1).'),
   );
@@ -244,7 +242,7 @@ function page_manager_http_response_edit_settings(&$form, &$form_state) {
   return $form;
 }
 
-function page_manager_http_response_edit_settings_submit(&$form, &$form_state) {
+function page_manager_http_response_edit_settings_submit($form, &$form_state) {
   $form_state['handler']->conf['title'] = $form_state['values']['title'];
   $form_state['handler']->conf['code'] = $form_state['values']['code'];
   $form_state['handler']->conf['destination'] = $form_state['values']['destination'];
diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/blog.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/blog.inc
index 94d76feb39638d3d43c9817a003c564f1746940b..8d62e98ddd1b2a7cb91dca96218fdb6529d32ae7 100644
--- a/sites/all/modules/ctools/page_manager/plugins/tasks/blog.inc
+++ b/sites/all/modules/ctools/page_manager/plugins/tasks/blog.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: blog.inc,v 1.3 2010/01/29 21:21:20 merlinofchaos Exp $
 
 /**
  * Specialized implementation of hook_page_manager_task_tasks(). See api-task.html for
diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/blog_user.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/blog_user.inc
index 9332441b912765c62f0c4725044409ef040974a7..8ad43d01c810b01a2cbb19478cf54a39aaa99e73 100644
--- a/sites/all/modules/ctools/page_manager/plugins/tasks/blog_user.inc
+++ b/sites/all/modules/ctools/page_manager/plugins/tasks/blog_user.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: blog_user.inc,v 1.3 2009/10/13 18:12:09 merlinofchaos Exp $
 
 /**
  * Specialized implementation of hook_page_manager_task_tasks(). See api-task.html for
diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/contact_site.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/contact_site.inc
index 26fc8122ec4627dcfe68f66767a15e3fcd51dfd3..532e2ef1bcada6d7ad698f3b0ca1c19751ac6f83 100644
--- a/sites/all/modules/ctools/page_manager/plugins/tasks/contact_site.inc
+++ b/sites/all/modules/ctools/page_manager/plugins/tasks/contact_site.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: contact_site.inc,v 1.3 2010/01/29 21:21:20 merlinofchaos Exp $
 
 /**
  * Specialized implementation of hook_page_manager_task_tasks(). See api-task.html for
@@ -44,8 +43,12 @@ function page_manager_contact_site_menu_alter(&$items, $task) {
   }
 
   $callback = $items['contact']['page callback'];
+  if ($callback == 'drupal_get_form') {
+    $callback = $items['contact']['page arguments'][0];
+  }
+
   // Override the node edit handler for our purpose.
-  if ($callback == 'contact_site_page' || variable_get('page_manager_override_anyway', FALSE)) {
+  if ($callback == 'contact_site_form' || variable_get('page_manager_override_anyway', FALSE)) {
     $items['contact']['page callback'] = 'page_manager_contact_site';
     $items['contact']['file path'] = $task['path'];
     $items['contact']['file'] = $task['file'];
@@ -61,7 +64,7 @@ function page_manager_contact_site_menu_alter(&$items, $task) {
 }
 
 /**
- * Entry point for our overridden node edit.
+ * Entry point for our overridden site contact.
  *
  * This function asks its assigned handlers who, if anyone, would like
  * to run with it. If no one does, it passes through to Drupal core's
@@ -79,7 +82,7 @@ function page_manager_contact_site() {
   }
 
   module_load_include('inc', 'contact', 'contact.pages');
-  $function = 'contact_site_page';
+  $function = 'contact_site_form';
   foreach (module_implements('page_manager_override') as $module) {
     $call = $module . '_page_manager_override';
     if (($rc = $call('contact_site')) && function_exists($rc)) {
@@ -89,6 +92,10 @@ function page_manager_contact_site() {
   }
 
   // Otherwise, fall back.
+  if ($function == 'contact_site_form') {
+    return drupal_get_form($function);
+  }
+
   return $function();
 }
 
diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/contact_user.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/contact_user.inc
index 88e00ca9aaca2e243aafe10a7fc5483ab342f37e..85305352ab82f85a60bf995204e706181f36d8c4 100644
--- a/sites/all/modules/ctools/page_manager/plugins/tasks/contact_user.inc
+++ b/sites/all/modules/ctools/page_manager/plugins/tasks/contact_user.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: contact_user.inc,v 1.4 2010/01/21 05:59:29 sdboyer Exp $
 
 /**
  * Specialized implementation of hook_page_manager_task_tasks(). See api-task.html for
@@ -44,9 +43,13 @@ function page_manager_contact_user_menu_alter(&$items, $task) {
   if (variable_get('page_manager_contact_user_disabled', TRUE)) {
     return;
   }
+  $callback = $items['user/%user/contact']['page callback'];
+  if ($callback == 'drupal_get_form') {
+    $callback = $items['user/%user/contact']['page arguments'][0];
+  }
 
   // Override the user view handler for our purpose.
-  if ($items['user/%user/contact']['page callback'] == 'contact_user_page' || variable_get('page_manager_override_anyway', FALSE)) {
+  if ($callback == 'contact_personal_form' || variable_get('page_manager_override_anyway', FALSE)) {
     $items['user/%user/contact']['page callback'] = 'page_manager_contact_user';
     $items['user/%user/contact']['file path'] = $task['path'];
     $items['user/%user/contact']['file'] = $task['file'];
@@ -55,7 +58,7 @@ function page_manager_contact_user_menu_alter(&$items, $task) {
     // automatically disable this task if it cannot be enabled.
     variable_set('page_manager_contact_user_disabled', TRUE);
     if (!empty($GLOBALS['page_manager_enabling_contact_user'])) {
-      drupal_set_message(t('Page manager module is unable to enable user/%user/contact because some other module already has overridden with %callback.', array('%callback' => $items['user/%user/contact']['page callback'])), 'error');
+      drupal_set_message(t('Page manager module is unable to enable user/%user/contact because some other module already has overridden with %callback.', array('%callback' => $callback)), 'error');
     }
   }
 }
@@ -67,7 +70,7 @@ function page_manager_contact_user_menu_alter(&$items, $task) {
  * to run with it. If no one does, it passes through to Drupal core's
  * user view, which is user_page_view().
  */
-function page_manager_contact_user($account) {
+function page_manager_contact_user($form_id, $account) {
   // Load my task plugin:
   $task = page_manager_get_task('contact_user');
 
@@ -82,7 +85,7 @@ function page_manager_contact_user($account) {
   }
 
   module_load_include('inc', 'contact', 'contact.pages');
-  $function = 'contact_user_page';
+  $function = 'contact_personal_form';
   foreach (module_implements('page_manager_override') as $module) {
     $call = $module . '_page_manager_override';
     if (($rc = $call('contact_user')) && function_exists($rc)) {
@@ -92,7 +95,7 @@ function page_manager_contact_user($account) {
   }
 
   // Otherwise, fall back.
-  return $function($account);
+  return drupal_get_form($function, $account);
 }
 
 /**
diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/node_edit.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/node_edit.inc
index 43c70a6e0a4c5fd5f18c918487d2691ce3953c24..0125c6f1e104a70eebe10eaabc0a134ac4b614c5 100644
--- a/sites/all/modules/ctools/page_manager/plugins/tasks/node_edit.inc
+++ b/sites/all/modules/ctools/page_manager/plugins/tasks/node_edit.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_edit.inc,v 1.4 2009/09/27 03:41:02 merlinofchaos Exp $
 
 /**
  * Specialized implementation of hook_page_manager_task_tasks(). See api-task.html for
@@ -97,8 +96,8 @@ function page_manager_node_edit($node) {
     // Fall back!
     // We've already built the form with the context, so we can't build it again, or
     // form_clean_id will mess up our ids. But we don't really need to, either:
-    $context = current($contexts);
-    $output = drupal_render_form($context->form_id, $context->form);
+    $context = reset($contexts);
+    $output = $context->form;
   }
 
   return $output;
@@ -123,7 +122,7 @@ function page_manager_node_add($type) {
     'uid' => $user->uid,
     'name' => (isset($user->name) ? $user->name : ''),
     'type' => $type,
-    'language' => '',
+    'language' => LANGUAGE_NONE,
   );
 
   drupal_set_title(t('Create @name', array('@name' => $types[$type]->name)));
diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/node_view.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/node_view.inc
index d5f4abdf9364dab29053e7bd06abaf8c07c3c2ff..340dc42f9b9f184cfbb935d08a30825f01e88f41 100644
--- a/sites/all/modules/ctools/page_manager/plugins/tasks/node_view.inc
+++ b/sites/all/modules/ctools/page_manager/plugins/tasks/node_view.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_view.inc,v 1.7 2010/12/31 23:56:41 merlinofchaos Exp $
 
 /**
  * @file
@@ -117,7 +116,7 @@ function page_manager_node_view_get_arguments($task, $subtask_id) {
       'keyword' => 'node',
       'identifier' => t('Node being viewed'),
       'id' => 1,
-      'name' => 'nid',
+      'name' => 'entity_id:node',
       'settings' => array(),
     ),
   );
diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/page.admin.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/page.admin.inc
index f23db8cefa660bafb30cb08115d93d91e240280c..4e6e749431b3f3d744cb193a3b1f4279d8a550eb 100644
--- a/sites/all/modules/ctools/page_manager/plugins/tasks/page.admin.inc
+++ b/sites/all/modules/ctools/page_manager/plugins/tasks/page.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: page.admin.inc,v 1.30 2011/01/05 22:35:46 merlinofchaos Exp $
 
 /**
  * @file
@@ -117,7 +116,7 @@ function page_manager_page_menu(&$items, $task) {
     $items[$menu_path] = page_manager_page_menu_item($task, $subtask->menu, $access_arguments, $page_arguments, $load_arguments);
 
     // Add a parent menu item if one is configured.
-    if (isset($subtask->menu['type']) && $subtask->menu['type'] == 'default tab' && $subtask->menu['parent']['type'] != 'none') {
+    if (isset($subtask->menu['type']) && $subtask->menu['type'] == 'default tab') {
       array_pop($path);
       $parent_path = implode('/', $path);
       $items[$parent_path] = page_manager_page_menu_item($task, $subtask->menu['parent'], $access_arguments, $page_arguments, $load_arguments);
@@ -444,12 +443,18 @@ function page_manager_page_form_basic($form, &$form_state) {
       '#type' => 'checkbox',
       '#default_value' => !empty($page->make_frontpage),
       '#title' => t('Make this your site home page.'),
-      '#description' => t('To set this panel as your home page you must create a unique path name with no % placeholders in the path. The site home page is currently set to %homepage on the !siteinfo configuration form.', array('!siteinfo' => l('Site Information', 'admin/settings/site-information'), '%homepage' => '/' . $frontpage)),
+      '#description' => t('To set this panel as your home page you must create a unique path name with no % placeholders in the path. The site home page is currently set to %homepage on the !siteinfo configuration form.', array('!siteinfo' => l(t('Site Information'), 'admin/settings/site-information'), '%homepage' => '/' . $frontpage)),
+    );
+    $form['admin_paths'] = array(
+      '#type' => 'checkbox',
+      '#default_value' => !empty($page->conf['admin_paths']),
+      '#title' => t('Use this page in an admin overlay.'),
+      '#description' => t('Admin overlays are used in many places in Drupal 7 and administrative custom pages should probably utilize this feature.'),
     );
   }
   else if ($path == $frontpage) {
     $form['frontpage_markup'] = array(
-      '#value' => '<b>' . t('This page is currently set to be your site home page. This can be modified on the !siteinfo configuration form.', array('!siteinfo' => l('Site Information', 'admin/settings/site-information'))) . '</b>',
+      '#value' => '<b>' . t('This page is currently set to be your site home page. This can be modified on the !siteinfo configuration form.', array('!siteinfo' => l(t('Site Information'), 'admin/settings/site-information'))) . '</b>',
     );
 
     $form['frontpage'] = array(
@@ -646,6 +651,7 @@ function page_manager_page_form_basic_submit(&$form, &$form_state) {
   }
 
   $page->make_frontpage = !empty($form_state['values']['frontpage']);
+  $page->conf['admin_paths'] = !empty($form_state['values']['admin_paths']);
 }
 
 /**
@@ -693,7 +699,6 @@ function page_manager_page_form_menu($form, &$form_state) {
     '#type' => 'textfield',
     '#default_value' => $menu['title'],
     '#description' => t('If set to normal or tab, enter the text to use for the menu item.'),
-    '#process' => array('ctools_dependent_process'),
     '#dependency' => array('radio:menu[type]' => array('normal', 'tab', 'default tab', 'action')),
   );
 
@@ -707,7 +712,6 @@ function page_manager_page_form_menu($form, &$form_state) {
       '#options' => menu_get_menus(),
       '#default_value' => $menu['name'],
       '#description' => t('Insert item into an available menu.'),
-      '#process' => array('ctools_dependent_process'),
       '#dependency' => array('radio:menu[type]' => array('normal')),
     );
   }
@@ -725,7 +729,6 @@ function page_manager_page_form_menu($form, &$form_state) {
     '#type' => 'textfield',
     '#default_value' => isset($menu['weight']) ? $menu['weight'] : 0,
     '#description' => t('The lower the weight the higher/further left it will appear.'),
-    '#process' => array('ctools_dependent_process'),
     '#dependency' => array('radio:menu[type]' => array('normal', 'tab', 'default tab', 'action')),
   );
 
@@ -734,10 +737,9 @@ function page_manager_page_form_menu($form, &$form_state) {
     '#suffix' => '</div>',
     '#title' => t('Parent menu item'),
     '#type' => 'radios',
-    '#options' => array('none' => t('Already exists'), 'normal' => t('Normal menu item'), 'tab' => t('Menu tab')),
+    '#options' => array('none' => t('No menu entry'), 'normal' => t('Normal menu item'), 'tab' => t('Menu tab')),
     '#default_value' => $menu['parent']['type'],
     '#description' => t('When providing a menu item as a default tab, Drupal needs to know what the parent menu item of that tab will be. Sometimes the parent will already exist, but other times you will need to have one created. The path of a parent item will always be the same path with the last part left off. i.e, if the path to this view is <em>foo/bar/baz</em>, the parent path would be <em>foo/bar</em>.'),
-    '#process' => array('form_process_radios', 'ctools_dependent_process'),
     '#dependency' => array('radio:menu[type]' => array('default tab')),
   );
   $form['menu']['parent']['title'] = array(
@@ -745,7 +747,6 @@ function page_manager_page_form_menu($form, &$form_state) {
     '#type' => 'textfield',
     '#default_value' => $menu['parent']['title'],
     '#description' => t('If creating a parent menu item, enter the title of the item.'),
-    '#process' => array('ctools_dependent_process'),
     '#dependency' => array('radio:menu[type]' => array('default tab'), 'radio:menu[parent][type]' => array('normal', 'tab')),
     '#dependency_count' => 2,
   );
@@ -757,7 +758,6 @@ function page_manager_page_form_menu($form, &$form_state) {
       '#options' => menu_get_menus(),
       '#default_value' => $menu['parent']['name'],
       '#description' => t('Insert item into an available menu.'),
-      '#process' => array('ctools_dependent_process'),
       '#dependency' => array('radio:menu[type]' => array('default tab'), 'radio:menu[parent][type]' => array('normal')),
       '#dependency_count' => 2,
     );
@@ -774,7 +774,6 @@ function page_manager_page_form_menu($form, &$form_state) {
     '#default_value' => $menu['parent']['weight'],
     '#size' => 5,
     '#description' => t('If the parent menu item is a tab, enter the weight of the tab. The lower the number, the more to the left it will be.'),
-    '#process' => array('ctools_dependent_process'),
     '#dependency' => array('radio:menu[type]' => array('default tab'), 'radio:menu[parent][type]' => array('tab')),
     '#dependency_count' => 2,
   );
@@ -1030,7 +1029,10 @@ function page_manager_page_subtask_argument_ajax($step = NULL, $task_name = NULL
   );
 
   $output = ctools_wizard_multistep_form($form_info, $step, $form_state);
-  if (!empty($form_state['complete'])) {
+  if (!empty($form_state['cancel'])) {
+    $commands = array(ctools_modal_command_dismiss());
+  }
+  else if (!empty($form_state['complete'])) {
     if (isset($page->temporary_arguments[$keyword])) {
       $page->arguments[$keyword] = $page->temporary_arguments[$keyword];
     }
@@ -1114,7 +1116,9 @@ function page_manager_page_argument_form_change($form, &$form_state) {
 
   $options = array();
   foreach ($plugins as $id => $plugin) {
-    $options[$id] = $plugin['title'];
+    if (empty($plugin['no ui'])) {
+      $options[$id] = $plugin['title'];
+    }
   }
 
   asort($options);
@@ -1400,7 +1404,7 @@ function page_manager_page_form_clone($form, &$form_state) {
     '#description' => t('The name of this page. This will appear in the administrative interface to easily identify it.'),
     '#default_value' => $page->admin_title,
   );
-  
+
   $form['name'] = array(
     '#type' => 'machine_name',
     '#title' => t('Page name'),
diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/page.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/page.inc
index 79c03c8cb9b20e1834b2952cc037ed1f6e29b402..aba99c7d9eb4526df168d18285b0e225dcaaba39 100644
--- a/sites/all/modules/ctools/page_manager/plugins/tasks/page.inc
+++ b/sites/all/modules/ctools/page_manager/plugins/tasks/page.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: page.inc,v 1.24 2010/10/11 22:18:23 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/poll.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/poll.inc
index e811e2996af3c59c10105ba04015ee614cf1033c..1dcb419079525b4c496d61326cc3a208b5a31009 100644
--- a/sites/all/modules/ctools/page_manager/plugins/tasks/poll.inc
+++ b/sites/all/modules/ctools/page_manager/plugins/tasks/poll.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: poll.inc,v 1.2 2010/01/29 21:21:21 merlinofchaos Exp $
 
 /**
  * Specialized implementation of hook_page_manager_task_tasks(). See api-task.html for
diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/search.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/search.inc
index cc997c27db3fa9ea84acdb5781e318b168a7e71a..b18ab94cb8c4e636aafa117cc9954dfa1c5b50d1 100644
--- a/sites/all/modules/ctools/page_manager/plugins/tasks/search.inc
+++ b/sites/all/modules/ctools/page_manager/plugins/tasks/search.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: search.inc,v 1.4 2010/10/11 22:18:23 sdboyer Exp $
 
 /**
  * @file
@@ -60,115 +59,47 @@ function page_manager_search_menu_alter(&$items, $task) {
   // is necessary because search/node/% and search/node need to be
   // different due to the way the search menu items function.
 
+  $default_info = search_get_default_module_info();
+  if (empty($default_info)) {
+    // Nothing to do.
+    return;
+  }
+
   // Go through each search module item.
-  foreach (module_implements('search') as $name) {
-    // Do not bother with search menu items that should not have search tabs.
-    if (!module_invoke($name, 'search', 'name')) {
+  foreach (search_get_info() as $module => $info) {
+    if (variable_get('page_manager_search_disabled_' . $module, TRUE)) {
       continue;
     }
 
-    // Put these items under the default search tab which is node.
-    $items["search/$name/%menu_tail"]['tab_parent'] = "search/node/%menu_tail";
-    $items["search/$name/%menu_tail"]['tab_root'] = "search/node/%menu_tail";
-
-    $callback = $items["search/$name/%menu_tail"]['page callback'];
-
-    // Even if a search page is not implemented, we need to add an extra
-    // entry anyway, for two reasons.
-    //
-    // 1) The 'search' menu entry actually handles all entries by default
-    // and that is going to be bad if the node search is overridden and
-    // 2) We need to have dual entries to make sure that the tabs are right.
-    if (variable_get('page_manager_search_disabled_' . $name, TRUE) || ($callback != 'search_view' && !variable_get('page_manager_override_anyway', FALSE))) {
-      $items["search/$name"] = $items["search/$name/%menu_tail"];
-
-      // Put these items under the real search tab.
-      $items["search/$name"]['tab_parent'] = 'search';
-      $items["search/$name"]['tab_root'] = 'search';
-
-      if ($name == 'node') {
-        $items["search/$name"]['type'] = MENU_DEFAULT_LOCAL_TASK;
-        // The default tab should always be left weighted. Because of the way
-        // menu sorts, this item tends to float around if not weighted.
-        $items["search/$name"]['weight'] = -10;
-        $items["search/$name/%menu_tail"]['weight'] = -10;
-      }
-
-      if ($callback == 'search_view' || variable_get('page_manager_override_anyway', FALSE)) {
-        $items["search/$name/%menu_tail"]['page callback'] = 'page_manager_search_view';
-        $items["search/$name/%menu_tail"]['file path'] = $task['path'];
-        $items["search/$name/%menu_tail"]['file'] = $task['file'];
-      }
-
-      continue;
-    }
+    $path = 'search/' . $info['path'];
+    $callback = $items["$path/%menu_tail"]['page callback'];
 
     if ($callback == 'search_view' || variable_get('page_manager_override_anyway', FALSE)) {
-      $items["search/$name/%menu_tail"]['page callback'] = 'page_manager_search_page';
-      $items["search/$name/%menu_tail"]['file path'] = $task['path'];
-      $items["search/$name/%menu_tail"]['file'] = $task['file'];
-
-      // Add a version that doesn't contain the menu tail for the no keywords
-      // version. Ordinarily this works because the top level 'search' just
-      // passes through.
-      $items["search/$name"] = $items["search/$name/%menu_tail"];
-      $items["search/$name/%menu_tail"]['page arguments'] = array(1, 2);
-
-      // Put these items under the real search tab.
-      $items["search/$name"]['tab_parent'] = 'search';
-      $items["search/$name"]['tab_root'] = 'search';
-
-      // Content search is the default search link, so we have to override
-      // the default task as well.
-      if ($name == 'node') {
-        $items["search/$name"]['type'] = MENU_DEFAULT_LOCAL_TASK;
-        // The default tab should always be left weighted. Because of the way
-        // menu sorts, this item tends to float around if not weighted.
-        $items["search/$name"]['weight'] = -10;
-        $items["search/$name/%menu_tail"]['weight'] = -10;
-
-        $items["search"]['page callback'] = 'page_manager_search_page';
-        $items["search"]['page arguments'] = array('node');
-        $items["search"]['file path'] = $task['path'];
-        $items["search"]['file'] = $task['file'];
-      }
+      $items["$path"]['page callback'] = 'page_manager_search_page';
+      $items["$path"]['file path'] = $task['path'];
+      $items["$path"]['file'] = $task['file'];
+
+      $items["$path/%menu_tail"]['page callback'] = 'page_manager_search_page';
+      $items["$path/%menu_tail"]['file path'] = $task['path'];
+      $items["$path/%menu_tail"]['file'] = $task['file'];
     }
     else {
       // automatically disable this task if it cannot be enabled.
-      variable_set('page_manager_search_disabled_' . $name, TRUE);
+      variable_set('page_manager_search_disabled_' . $module, TRUE);
       if (!empty($GLOBALS['page_manager_enabling_search'])) {
-        drupal_set_message(t('Page manager module is unable to enable search/@name/%menu_tail because some other module already has overridden with %callback.', array('%callback' => $callback, '@name' => $name)), 'error');
+        drupal_set_message(t('Page manager module is unable to enable @path because some other module already has overridden with %callback.', array('%callback' => $callback, '@path' => $path)), 'error');
       }
     }
   }
 }
 
 /**
- * Replacement function for normal search view.
- *
- * This function resets the active trail because menu system loses track
- * of it due to the special way we're handling search items.
- */
-function page_manager_search_view($type = 'node') {
-  // @TODO: test that this actually works once page_manager is upgraded.
-  drupal_static_reset('menu_set_active_trail');
-  drupal_static_reset('menu_tree_page_data');
-  menu_set_active_trail();
-
-  module_load_include('inc', 'search', 'search.pages');
-  return search_view($type);
-}
-
-/**
- * Entry point for our overridden node view.
+ * Entry point for our overridden search page.
  *
- * This function asks its assigned handlers who, if anyone, would like
- * to run with it. If no one does, it passes through to Drupal core's
- * node view, which is node_page_view().
  */
 function page_manager_search_page($type) {
   ctools_include('menu');
-  menu_set_active_trail(ctools_get_menu_trail('search/' . $type));
+//  menu_set_active_trail(ctools_get_menu_trail('search/' . $type));
 
   // Get the arguments and construct a keys string out of them.
   $args = func_get_args();
@@ -255,9 +186,11 @@ function page_manager_search_enable($cache, $status) {
  */
 function page_manager_search_subtasks($task) {
   $return = array();
-  foreach (module_implements('search') as $name) {
-    if(module_invoke($name, 'search', 'name')) {
-      $return[$name] = page_manager_search_build_subtask($task, $name);
+  foreach (search_get_info() as $module => $info) {
+    if ($info['path']) {
+      // We don't pass the $info because the subtask build could be called
+      // singly without the $info when just the subtask needs to be built.
+      $return[$module] = page_manager_search_build_subtask($task, $module);
     }
   }
 
@@ -274,17 +207,19 @@ function page_manager_search_subtask($task, $subtask_id) {
 /**
  * Build a subtask array for a given page.
  */
-function page_manager_search_build_subtask($task, $name) {
-  $type = module_invoke($name, 'search', 'name', TRUE);
+function page_manager_search_build_subtask($task, $module) {
+  $search_info = search_get_info();
+  $info = $search_info[$module];
+  $path = 'search/' . $info['path'];
   $subtask = array(
-    'name' => $name,
-    'admin title' => $type,
-    'admin path' => "search/$name/!keywords",
-    'admin description' => t('Search @type', array('@type' => $type)),
+    'name' => $module,
+    'admin title' => $info['title'],
+    'admin path' => "$path/!keywords",
+    'admin description' => t('Search @type', array('@type' => $info['title'])),
     'admin type' => t('System'),
     'row class' => empty($page->disabled) ? 'page-manager-enabled' : 'page-manager-disabled',
     'storage' => t('In code'),
-    'disabled' => variable_get('page_manager_search_disabled_' . $name, TRUE),
+    'disabled' => variable_get('page_manager_search_disabled_' . $module, TRUE),
     // This works for both enable AND disable
     'enable callback' => 'page_manager_search_enable',
   );
diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/term_view.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/term_view.inc
index fabf6da1da70e771c170fe420ec1e3357bea07ac..97dda0cce24f4c9954079f8ad9fc8631167c28d8 100644
--- a/sites/all/modules/ctools/page_manager/plugins/tasks/term_view.inc
+++ b/sites/all/modules/ctools/page_manager/plugins/tasks/term_view.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: term_view.inc,v 1.10 2011/01/06 00:16:28 merlinofchaos Exp $
 
 /**
  * @file
@@ -23,7 +22,7 @@ function page_manager_term_view_page_manager_tasks() {
       'title' => t('Taxonomy term template'),
       'admin title' => t('Taxonomy term template'),
       'admin description' => t('When enabled, this overrides the default Drupal behavior for displaying taxonomy terms at <em>taxonomy/term/%term</em>. If you add variants, you may use selection criteria such as vocabulary or user access to provide different displays of the taxonomy term and associated nodes. If no variant is selected, the default Drupal taxonomy term display will be used. This page only affects items actually displayed ad taxonomy/term/%term. Some taxonomy terms, such as forums, have their displays moved elsewhere. Also please note that if you are using pathauto, aliases may make a taxonomy terms appear somewhere else, but as far as Drupal is concerned, they are still at taxonomy/term/%term.'),
-      'admin path' => 'taxonomy/term/%term',
+      'admin path' => 'taxonomy/term/%taxonomy_term',
       'admin summary' => 'page_manager_term_view_admin_summary',
 
       // Menu hooks so that we can alter the term/%term menu entry to point to us.
@@ -71,11 +70,6 @@ function page_manager_term_view_menu_alter(&$items, $task) {
     return;
   }
 
-  // @todo --fix.
-  variable_set('page_manager_term_view_disabled', TRUE);
-  drupal_set_message(t('Due to changes in taxonomy, the taxonomy integration with Page Manager is currently not implemented. See <a href="http://drupal.org/node/1016510">.'), 'error');
-  return;
-
   // Override the term view handler for our purpose, but only if someone else
   // has not already done so.
   if (isset($items['taxonomy/term/%taxonomy_term']) && $items['taxonomy/term/%taxonomy_term']['page callback'] == 'taxonomy_term_page' || variable_get('page_manager_override_anyway', FALSE)) {
@@ -86,8 +80,20 @@ function page_manager_term_view_menu_alter(&$items, $task) {
   else {
     // automatically disable this task if it cannot be enabled.
     variable_set('page_manager_term_view_disabled', TRUE);
+
+    if (isset($items['taxonomy/term/%taxonomy_term']['page callback'])) {
+      $callback = $items['taxonomy/term/%taxonomy_term']['page callback'];
+    }
+    // Because Views changes %taxonomy_term to %views_arg, check to see if that
+    // is why we can't enable:
+    else if (isset($items['taxonomy/term/%views_arg']['page callback'])) {
+      $callback = $items['taxonomy/term/%views_arg']['page callback'];
+    }
+    else {
+      $callback = t('an unknown callback');
+    }
     if (!empty($GLOBALS['page_manager_enabling_term_view'])) {
-      drupal_set_message(t('Page manager module is unable to enable taxonomy/term/%term because some other module already has overridden with %callback.', array('%callback' => $items['taxonomy/term/%taxonomy_term']['page callback'])), 'error');
+      drupal_set_message(t('Page manager module is unable to enable taxonomy/term/%taxonomy_term because some other module already has overridden with %callback.', array('%callback' => $callback)), 'error');
     }
   }
 }
@@ -102,39 +108,37 @@ function page_manager_term_view_menu_alter(&$items, $task) {
 function page_manager_term_view_page($term) {
   // While we ordinarily should never actually get feeds through here,
   // just in case
-  if ($op != 'feed') {
-    // Load my task plugin
-    $task = page_manager_get_task('term_view');
+  // Load my task plugin
+  $task = page_manager_get_task('term_view');
 
-    // Load the term into a context.
-    ctools_include('context');
-    ctools_include('context-task-handler');
-    $contexts = ctools_context_handler_get_task_contexts($task, '', array($terms, $depth));
+  // Load the term into a context.
+  ctools_include('context');
+  ctools_include('context-task-handler');
+  $contexts = ctools_context_handler_get_task_contexts($task, '', array($term));
 
-    if (empty($contexts)) {
-      return drupal_not_found();
-    }
+  if (empty($contexts)) {
+    return drupal_not_found();
+  }
 
-    // Add a fake tab for 'View' so that edit tabs can be added.
-    if (user_access('administer page manager')) {
-      ctools_include('menu');
-      ctools_menu_add_tab(array(
-        'title' => t('View'),
-        'href' => $_GET['q'],
-        'type' => MENU_DEFAULT_LOCAL_TASK,
-        'weight' => -10,
-      ));
-    }
+  $output = ctools_context_handler_render($task, '', $contexts, array($term->tid));
+  if ($output !== FALSE) {
+    return $output;
+  }
 
-    $output = ctools_context_handler_render($task, '', $contexts, array($terms, $depth, $op));
-    if ($output !== FALSE) {
-      return $output;
+  $function = 'taxonomy_term_page';
+  foreach (module_implements('page_manager_override') as $module) {
+    $call = $module . '_page_manager_override';
+    if (($rc = $call('term_view')) && function_exists($rc)) {
+      $function = $rc;
+      break;
     }
   }
 
   // Otherwise, fall back.
-  module_load_include('inc', 'taxonomy', 'taxonomy.pages');
-  return taxonomy_term_page($terms, $depth, $op);
+  if ($function == 'taxonomy_term_page') {
+    module_load_include('inc', 'taxonomy', 'taxonomy.pages');
+  }
+  return $function($term);
 }
 
 /**
@@ -147,9 +151,9 @@ function page_manager_term_view_get_arguments($task, $subtask_id) {
   return array(
     array(
       'keyword' => 'term',
-      'identifier' => variable_get('page_manager_term_view_type', 'multiple') == 'multiple' ? t('Term(s) being viewed') : t('Term being viewed'),
+      'identifier' => page_manager_term_view_get_type() == 'multiple' ? t('Term(s) being viewed') : t('Term being viewed'),
       'id' => 1,
-      'name' => variable_get('page_manager_term_view_type', 'multiple') == 'multiple' ? 'terms' : 'term',
+      'name' => page_manager_term_view_get_type() == 'multiple' ? 'terms' : 'term',
       'settings' => array('input_form' => 'tid', 'breadcrumb' => variable_get('page_manager_taxonomy_breadcrumb', TRUE)),
       'default' => '404',
     ),
@@ -173,11 +177,11 @@ function page_manager_term_view_get_contexts($task, $subtask_id) {
 /**
  * Settings page for this item.
  */
-function page_manager_term_view_settings(&$form, &$form_state) {
+function page_manager_term_view_settings($form, &$form_state) {
   // This passes thru because the setting can also appear on the main Panels
   // settings form. If $settings is an array it will just pick up the default.
   $settings = isset($form_state->update_values) ? $form_state->update_values : array();
-  page_manager_term_view_admin_settings($form, $settings);
+  return page_manager_term_view_admin_settings($form, $settings);
 }
 
 /**
@@ -200,10 +204,10 @@ function page_manager_term_view_save($subtask, $cache) {
 /**
  * Provide a setting to the Panels administrative form.
  */
-function page_manager_term_view_admin_settings(&$form, $settings = array()) {
+function page_manager_term_view_admin_settings($form, $settings = array()) {
   if (empty($settings)) {
     $settings = array(
-      'page_manager_term_view_type' => variable_get('page_manager_term_view_type', 'multiple'),
+      'page_manager_term_view_type' => page_manager_term_view_get_type(),
       'page_manager_taxonomy_breadcrumb' => variable_get('page_manager_taxonomy_breadcrumb', TRUE),
     );
   }
@@ -212,8 +216,10 @@ function page_manager_term_view_admin_settings(&$form, $settings = array()) {
     '#type' => 'radios',
     '#title' => t('Allow multiple terms on taxonomy/term/%term'),
     '#options' => array('single' => t('Single term'), 'multiple' => t('Multiple terms')),
-    '#description' => t('By default, Drupal allows multiple terms as an argument by separating them with commas or plus signs. If you set this to single, that feature will be disabled.'),
+    '#description' => t('By default, Drupal allows multiple terms as an argument by separating them with commas or plus signs. If you set this to single, that feature will be disabled.') . ' ' . t('This feature does not currently work and is disabled.'),
     '#default_value' => $settings['page_manager_term_view_type'],
+    // @todo -- fix this
+    '#disabled' => TRUE,
   );
   $form['page_manager_taxonomy_breadcrumb'] = array(
     '#title' => t('Inject hierarchy of first term into breadcrumb trail'),
@@ -221,6 +227,8 @@ function page_manager_term_view_admin_settings(&$form, $settings = array()) {
     '#default_value' => $settings['page_manager_taxonomy_breadcrumb'],
     '#description' => t('If checked, taxonomy term parents will appear in the breadcrumb trail.'),
   );
+
+  return $form;
 }
 
 /**
@@ -236,6 +244,14 @@ function page_manager_term_view_enable($cache, $status) {
   }
 }
 
+function page_manager_term_view_get_type() {
+//  $view_type = variable_get('page_manager_term_view_type', 'multiple');
+  // Revert to just allowing single.
+  $view_type = 'single';
+
+  return $view_type;
+}
+
 /**
  * Provide a nice administrative summary of the page so an admin can see at a
  * glance what this page does and how it is configured.
@@ -263,7 +279,7 @@ function page_manager_term_view_admin_summary($task, $subtask) {
     array('class' => array('page-summary-operation'), 'data' => ''),
   );
 
-  if (variable_get('page_manager_term_view_type', 'multiple') == 'multiple') {
+  if (page_manager_term_view_get_type() == 'multiple') {
     $message = t('Multiple terms may be used, separated by , or +.');
   }
   else {
@@ -291,4 +307,5 @@ function page_manager_term_view_admin_summary($task, $subtask) {
 
   $output = theme('table', array(), $rows, array('id' => 'page-manager-page-summary'));
   return $output;
-}
\ No newline at end of file
+}
+
diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/user_view.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/user_view.inc
index fcac5219f474b343eaf48ec77f5fe1277c54349a..246d5915670b5dad9bb3a7d39df28e1363002bdd 100644
--- a/sites/all/modules/ctools/page_manager/plugins/tasks/user_view.inc
+++ b/sites/all/modules/ctools/page_manager/plugins/tasks/user_view.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: user_view.inc,v 1.7 2011/01/06 00:06:18 merlinofchaos Exp $
 
 /**
  * @file
@@ -81,16 +80,28 @@ function page_manager_user_view_page($account) {
   user_build_content($account);
 
   $output = ctools_context_handler_render($task, '', $contexts, array($account->uid));
-  if ($output === FALSE) {
-    // Fall back!
-    module_load_include('inc', 'user', 'user.pages');
-    $output = user_view($account);
+  if ($output != FALSE) {
+    return $output;
   }
-  else {
-    //fire off "view" op so that triggers still work
-//    user_module_invoke('view', $array = array(), $account);
+
+  $function = 'user_view';
+  foreach (module_implements('page_manager_override') as $module) {
+    $call = $module . '_page_manager_override';
+    if (($rc = $call('user_view')) && function_exists($rc)) {
+      $function = $rc;
+      break;
+    }
+  }
+
+  // Otherwise, fall back.
+  if ($function == 'user_view') {
+    module_load_include('inc', 'user', 'user.pages');
   }
-  return $output;
+  //fire off "view" op so that triggers still work
+  // @todo -- this doesn't work anymore, and the alternatives seem bad.
+  // will have to figure out how to fix this.
+//  user_module_invoke('view', $array = array(), $account);
+  return $function($account);
 }
 
 /**
@@ -105,7 +116,7 @@ function page_manager_user_view_get_arguments($task, $subtask_id) {
       'keyword' => 'user',
       'identifier' => t('User being viewed'),
       'id' => 1,
-      'name' => 'uid',
+      'name' => 'entity_id:user',
       'settings' => array(),
     ),
   );
diff --git a/sites/all/modules/ctools/page_manager/theme/page-manager-edit-page.tpl.php b/sites/all/modules/ctools/page_manager/theme/page-manager-edit-page.tpl.php
index 90ed201d97d04a0f5f16e41631a3b6c43afaaa19..85510cd93f9e9b53003546cfbe4534804b76c127 100644
--- a/sites/all/modules/ctools/page_manager/theme/page-manager-edit-page.tpl.php
+++ b/sites/all/modules/ctools/page_manager/theme/page-manager-edit-page.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: page-manager-edit-page.tpl.php,v 1.4 2010/10/11 22:18:23 sdboyer Exp $
 /**
  * @file
  * Template for the page manager page editor.
diff --git a/sites/all/modules/ctools/page_manager/theme/page_manager.theme.inc b/sites/all/modules/ctools/page_manager/theme/page_manager.theme.inc
index c12dcebdc4a95badc028fb13cc539c109372aab7..6435d1ce5984d64f4a97a81c815ddbd2e826852a 100644
--- a/sites/all/modules/ctools/page_manager/theme/page_manager.theme.inc
+++ b/sites/all/modules/ctools/page_manager/theme/page_manager.theme.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: page_manager.theme.inc,v 1.9 2010/11/03 00:01:14 merlinofchaos Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/access/compare_users.inc b/sites/all/modules/ctools/plugins/access/compare_users.inc
index 59e794e97f3b11d7fc214c5743579cb4a0696959..c271ff4e3cdafcd528455e623e75c820deab43d5 100644
--- a/sites/all/modules/ctools/plugins/access/compare_users.inc
+++ b/sites/all/modules/ctools/plugins/access/compare_users.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: compare_users.inc,v 1.6 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
@@ -32,7 +31,7 @@ function ctools_compare_users_settings($form, &$form_state, $conf) {
 
   $form['settings']['helptext'] = array(
     '#type' => 'markup',
-    '#value' => '<div>'. t('Grant access based on comparison of the two user contexts. For example, to grant access to a user to view their own profile, choose "logged in user" and "user being viewed" and say "grant access if equal". When they\'re the same, access will be granted.') . '</div>',
+    '#value' => '<div>' . t('Grant access based on comparison of the two user contexts. For example, to grant access to a user to view their own profile, choose "logged in user" and "user being viewed" and say "grant access if equal". When they\'re the same, access will be granted.') . '</div>',
   );
 
   $form['settings']['equality'] = array(
diff --git a/sites/all/modules/ctools/plugins/access/context_exists.inc b/sites/all/modules/ctools/plugins/access/context_exists.inc
index bdf593c106f03acb7856d3ed49b6d1ba5fd0f329..f60eb1932afd6f2865506d91d4eae2f51b50da52 100644
--- a/sites/all/modules/ctools/plugins/access/context_exists.inc
+++ b/sites/all/modules/ctools/plugins/access/context_exists.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: context_exists.inc,v 1.4 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/access/entity_bundle.inc b/sites/all/modules/ctools/plugins/access/entity_bundle.inc
new file mode 100644
index 0000000000000000000000000000000000000000..ffb83f572c1b3f3161babe576f39dccd3b8abcee
--- /dev/null
+++ b/sites/all/modules/ctools/plugins/access/entity_bundle.inc
@@ -0,0 +1,126 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Plugin to provide access control based upon entity bundle.
+ */
+
+/**
+ * Plugins are described by creating a $plugin array which will be used
+ * by the system that includes this file.
+ */
+$plugin = array(
+  'title' => t("Entity: bundle"),
+  'description' => t('Control access by entity bundle.'),
+  'callback' => 'ctools_entity_bundle_ctools_access_check',
+  'default' => array('type' => array()),
+  'settings form' => 'ctools_entity_bundle_ctools_access_settings',
+  'settings form submit' => 'ctools_entity_bundle_ctools_access_settings_submit',
+  'summary' => 'ctools_entity_bundle_ctools_access_summary',
+  'restrictions' => 'ctools_entity_bundle_ctools_access_restrictions',
+  'get child' => 'ctools_entity_bundle_ctools_access_get_child',
+  'get children' => 'ctools_entity_bundle_ctools_access_get_children',
+);
+
+function ctools_entity_bundle_ctools_access_get_child($plugin, $parent, $child) {
+  $plugins = ctools_entity_bundle_ctools_access_get_children($plugin, $parent);
+  return $plugins[$parent . ':' . $child];
+}
+
+function ctools_entity_bundle_ctools_access_get_children($plugin, $parent) {
+  $entities = entity_get_info();
+  $plugins = array();
+  foreach ($entities as $entity_type => $entity) {
+    $plugin['title'] = t('@entity: Bundle', array('@entity' => $entity['label']));
+    $plugin['keyword'] = $entity_type;
+    $plugin['description'] = t('Control access by @entity entity bundle.', array('@entity' => $entity_type));
+    $plugin['name'] = $parent . ':' . $entity_type;
+    $plugin['required context'] = new ctools_context_required(t(ucfirst($entity_type)), $entity_type);
+    $plugins[$parent . ':' . $entity_type] = $plugin;
+  }
+
+  return $plugins;
+}
+
+/**
+ * Settings form for the 'by entity_bundle' access plugin
+ */
+function ctools_entity_bundle_ctools_access_settings($form, &$form_state, $conf) {
+  $plugin = $form_state['plugin'];
+  $entity_type = explode(':', $plugin['name']);
+  $entity_type = $entity_type[1];
+  $entity = entity_get_info($entity_type);
+  foreach ($entity['bundles'] as $type => $info) {
+    $options[$type] = check_plain($info['label']);
+  }
+
+  $form['settings']['type'] = array(
+    '#title' => t('Entity Bundle'),
+    '#type' => 'checkboxes',
+    '#options' => $options,
+    '#description' => t('Only the checked entity bundles will be valid.'),
+    '#default_value' => $conf['type'],
+  );
+  return $form;
+}
+
+/**
+ * Compress the entity bundles allowed to the minimum.
+ */
+function ctools_entity_bundle_ctools_access_settings_submit($form, &$form_state) {
+  $form_state['values']['settings']['type'] = array_filter($form_state['values']['settings']['type']);
+}
+
+/**
+ * Check for access.
+ */
+function ctools_entity_bundle_ctools_access_check($conf, $context) {
+  $entity = entity_get_info($context->type[2]);
+  // As far as I know there should always be a context at this point, but this
+  // is safe.
+  if (empty($context) || empty($context->data) || empty($context->data->{$entity['entity keys']['bundle']})) {
+    return FALSE;
+  }
+
+  if (array_filter($conf['type']) && empty($conf['type'][$context->data->{$entity['entity keys']['bundle']}])) {
+    return FALSE;
+  }
+
+  return TRUE;
+}
+
+/**
+ * Inform the UI that we've eliminated a bunch of possibilities for this
+ * context.
+ */
+function ctools_entity_bundle_ctools_access_restrictions($conf, &$context) {
+  if (isset($context->restrictions['type'])) {
+    $context->restrictions['type'] = array_unique(array_merge($context->restrictions['type'], array_keys(array_filter($conf['type']))));
+  }
+  else {
+    $context->restrictions['type'] = array_keys(array_filter($conf['type']));
+  }
+}
+
+/**
+ * Provide a summary description based upon the checked entity_bundle.
+ */
+function ctools_entity_bundle_ctools_access_summary($conf, $context) {
+  if (!isset($conf['type'])) {
+    $conf['type'] = array();
+  }
+  $entity = entity_get_info($context->type[2]);
+
+  $names = array();
+  foreach (array_filter($conf['type']) as $type) {
+    $names[] = check_plain($entity['bundles'][$type]['label']);
+  }
+
+  if (empty($names)) {
+    return t('@identifier is any bundle', array('@identifier' => $context->identifier));
+  }
+
+  return format_plural(count($names), '@identifier is type "@types"', '@identifier type is one of "@types"', array('@types' => implode(', ', $names), '@identifier' => $context->identifier));
+}
+
diff --git a/sites/all/modules/ctools/plugins/access/node_access.inc b/sites/all/modules/ctools/plugins/access/node_access.inc
index 3e6320ee601d0b0a86976e9a6bb61a92cce6852c..fcd275d94c11265df1ebe05d7469bcfd7f4f3d5c 100644
--- a/sites/all/modules/ctools/plugins/access/node_access.inc
+++ b/sites/all/modules/ctools/plugins/access/node_access.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_access.inc,v 1.10 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/access/node_language.inc b/sites/all/modules/ctools/plugins/access/node_language.inc
index 662203b84787c0a3be9703a634617086d9a2f696..0fdcfc66a533ef9d2318e01b6e5b6b507f60f1e2 100644
--- a/sites/all/modules/ctools/plugins/access/node_language.inc
+++ b/sites/all/modules/ctools/plugins/access/node_language.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_language.inc,v 1.11 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/access/node_type.inc b/sites/all/modules/ctools/plugins/access/node_type.inc
index 5646626d89271ba740f769117c2a5027a14f5bfd..23a38453a7ffa9f4c1c6c5943095dd3abb58d048 100644
--- a/sites/all/modules/ctools/plugins/access/node_type.inc
+++ b/sites/all/modules/ctools/plugins/access/node_type.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_type.inc,v 1.12 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
@@ -88,14 +87,31 @@ function ctools_node_type_ctools_access_summary($conf, $context) {
   $types = node_type_get_types();
 
   $names = array();
+  // If a node type doesn't exist, let the user know, but prevent a notice.
+  $missing_types = array();
+
   foreach (array_filter($conf['type']) as $type) {
-    $names[] = check_plain($types[$type]->name);
+    if (!empty($types[$type])) {
+      $names[] = check_plain($types[$type]->name);
+    }
+    else {
+      $missing_types[] = check_plain($type);
+    }
   }
 
-  if (empty($names)) {
+  if (empty($names) && empty($missing_types)) {
     return t('@identifier is any node type', array('@identifier' => $context->identifier));
   }
 
+  if (!empty($missing_types)) {
+    $output = array();
+    if (!empty($names)) {
+      $output[] = format_plural(count($names), '@identifier is type "@types"', '@identifier type is one of "@types"', array('@types' => implode(', ', $names), '@identifier' => $context->identifier));
+    }
+    $output[] = format_plural(count($missing_types), 'Missing/ deleted type "@types"', 'Missing/ deleted type is one of "@types"', array('@types' => implode(', ', $missing_types)));
+    return implode(' | ', $output);
+  }
+
   return format_plural(count($names), '@identifier is type "@types"', '@identifier type is one of "@types"', array('@types' => implode(', ', $names), '@identifier' => $context->identifier));
 }
 
diff --git a/sites/all/modules/ctools/plugins/access/path_visibility.inc b/sites/all/modules/ctools/plugins/access/path_visibility.inc
index 160f8bfbf06bdc56579b47b6ccca6fe0eb03d43e..60b86124e49eedcfd98699f59f8a78098450fc87 100644
--- a/sites/all/modules/ctools/plugins/access/path_visibility.inc
+++ b/sites/all/modules/ctools/plugins/access/path_visibility.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: path_visibility.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/access/perm.inc b/sites/all/modules/ctools/plugins/access/perm.inc
index eca4ac7ccd4229f4927fb852bcbf8b94a0baa39e..67516faf6f34233fea6dafc94690df9d746558d6 100644
--- a/sites/all/modules/ctools/plugins/access/perm.inc
+++ b/sites/all/modules/ctools/plugins/access/perm.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: perm.inc,v 1.10 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/access/php.inc b/sites/all/modules/ctools/plugins/access/php.inc
index 71d9f91ac38dfd413f0af71f9a50364fdda84eeb..35da86d9a593b1446f1ca22b30cb0815d158ef3a 100644
--- a/sites/all/modules/ctools/plugins/access/php.inc
+++ b/sites/all/modules/ctools/plugins/access/php.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: php.inc,v 1.7 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/access/role.inc b/sites/all/modules/ctools/plugins/access/role.inc
index 2e5875e00e69a614f8ae719dae6c5db19fbe99f7..b6332544fee5d8b33fa582cfe093ba6306b26e9c 100644
--- a/sites/all/modules/ctools/plugins/access/role.inc
+++ b/sites/all/modules/ctools/plugins/access/role.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: role.inc,v 1.11 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/access/site_language.inc b/sites/all/modules/ctools/plugins/access/site_language.inc
index 1c4357476de7c9b296e7cf8f89ecab1008236cd0..9ff2f70c8f144a57c5a0e33bc6651021878bfdbf 100644
--- a/sites/all/modules/ctools/plugins/access/site_language.inc
+++ b/sites/all/modules/ctools/plugins/access/site_language.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: site_language.inc,v 1.10 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/access/string_equal.inc b/sites/all/modules/ctools/plugins/access/string_equal.inc
index 4a9ff45ace2136f0c7814f273a99c213c7ddc62a..ad1c88d82f3251f7f451f8c3b5d325a5f39da345 100644
--- a/sites/all/modules/ctools/plugins/access/string_equal.inc
+++ b/sites/all/modules/ctools/plugins/access/string_equal.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: string_equal.inc,v 1.3 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/access/string_length.inc b/sites/all/modules/ctools/plugins/access/string_length.inc
index 56e8c9d252626d6b0b9071babe6fbf280550f3d5..2bad6afb17a9e5f84764188cc9321c67d1657b66 100644
--- a/sites/all/modules/ctools/plugins/access/string_length.inc
+++ b/sites/all/modules/ctools/plugins/access/string_length.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: string_length.inc,v 1.3 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
@@ -55,7 +54,7 @@ function ctools_string_length_ctools_access_check($conf, $context) {
     $length = drupal_strlen($context->data);
   }
 
-  switch($conf['operator']) {
+  switch ($conf['operator']) {
     case '<':
       return $length < $conf['length'];
     case '<=':
diff --git a/sites/all/modules/ctools/plugins/access/term.inc b/sites/all/modules/ctools/plugins/access/term.inc
index c49dc927532e2c90405599a0a2c85b5f172960c9..36e70de47662c9e891656fb97d2ec8c2045da68d 100644
--- a/sites/all/modules/ctools/plugins/access/term.inc
+++ b/sites/all/modules/ctools/plugins/access/term.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: term.inc,v 1.8 2011/01/05 20:34:46 merlinofchaos Exp $
 
 /**
  * @file
@@ -61,28 +60,18 @@ function ctools_term_ctools_access_settings($form, &$form_state, $conf) {
     $form['settings'][$vocabulary->vid] = array(
       '#title' => t('Terms'),
       '#description' => t('Select a term or terms from @vocabulary.', array('@vocabulary' => $vocabulary->name)), //. $description,
-      '#process' => array('ctools_dependent_process'),
       '#dependency' => array('ctools-select-vid' => array($vocabulary->vid)),
       '#default_value' => !empty($conf[$vid]) ? $conf[$vid] : '',
       '#multiple' => TRUE,
     );
 
-    // If it's a tag, use an autocomplete.
-    if ($vocabulary->tags) {
-      $form['settings'][$vocabulary->vid]['#type'] = 'textfield';
-      $form['settings'][$vocabulary->vid]['#autocomplete_path'] = 'taxonomy/autocomplete/' . $vocabulary->vid;
-    }
-
-    // Other vocabs just show a list.
-    else {
-      $terms = array();
-      foreach (taxonomy_get_tree($vid) as $x => $term) {
-        $terms[$term->tid] = str_repeat('-', $term->depth) . ($term->depth ? ' ' : '') . $term->name;
-      }
-      $form['settings'][$vocabulary->vid]['#type'] = 'select';
-      $form['settings'][$vocabulary->vid]['#options'] = $terms;
-      unset($terms);
+    $terms = array();
+    foreach (taxonomy_get_tree($vocabulary->vid) as $tid => $term) {
+      $terms[$term->tid] = str_repeat('-', $term->depth) . ($term->depth ? ' ' : '') . $term->name;
     }
+    $form['settings'][$vocabulary->vid]['#type'] = 'select';
+    $form['settings'][$vocabulary->vid]['#options'] = $terms;
+    unset($terms);
   }
   $form['settings']['vid']['#options'] = $options;
   return $form;
@@ -110,22 +99,14 @@ function ctools_term_ctools_access_check($conf, $context) {
   }
 
   $return = FALSE;
-  // Tags get saved as an imploded array of strings.
-  if (!is_array($conf[$vid])) {
-    $terms = explode(', ', $conf[$vid]);
-    // For multi-term with names, we'll only accept the first term because
-    // that is the name we have.
-    return in_array($context->data->name, $terms);
+
+  $terms = array_filter($conf[$vid]);
+  // For multi-term if any terms coincide, let's call that good enough:
+  if (isset($context->tids)) {
+    return (bool) array_intersect($terms, $context->tids);
   }
   else {
-    $terms = array_filter($conf[$vid]);
-    // For multi-term if any terms coincide, let's call that good enough:
-    if (isset($context->tids)) {
-      return (bool) array_intersect($terms, $context->tids);
-    }
-    else {
-      return in_array($context->data->tid, $terms);
-    }
+    return in_array($context->data->tid, $terms);
   }
 }
 
@@ -133,16 +114,11 @@ function ctools_term_ctools_access_check($conf, $context) {
  * Provide a summary description based upon the checked terms.
  */
 function ctools_term_ctools_access_summary($conf, $context) {
-  $vocab = taxonomy_vocabulary_load($conf['vid']);
-  if ($vocab->tags) {
-    $terms = explode(', ', $conf[$vocab->vid]);
-  }
-  else {
-    $terms = array();
-    foreach ($conf[$vocab->vid] as $tid) {
-      $term = taxonomy_term_load($tid);
-      $terms[] = $term->name;
-    }
+  $vid = $conf['vid'];
+  $terms = array();
+  foreach ($conf[$vid] as $tid) {
+    $term = taxonomy_term_load($tid);
+    $terms[] = $term->name;
   }
 
   return format_plural(count($terms),
diff --git a/sites/all/modules/ctools/plugins/access/term_has_parent.inc b/sites/all/modules/ctools/plugins/access/term_has_parent.inc
new file mode 100644
index 0000000000000000000000000000000000000000..2c86d1cf12335ceb75dfa9efd65d8ea62628e2df
--- /dev/null
+++ b/sites/all/modules/ctools/plugins/access/term_has_parent.inc
@@ -0,0 +1,161 @@
+<?php
+/**
+ * @file
+ * Plugin to provide access control based upon a parent term.
+ */
+
+/**
+ * Plugins are described by creating a $plugin array which will be used
+ * by the system that includes this file.
+ */
+$plugin = array(
+  'title' => t("Taxonomy: term has parent(s)"),
+  'description' => t('Control access if a term belongs to a specific parent term.'),
+  'callback' => 'ctools_term_has_parent_ctools_access_check',
+  'default' => array('vid' => array(), 'negate' => 0),
+  'settings form' => 'ctools_term_has_parent_ctools_access_settings',
+  'settings form validation' => 'ctools_term_has_parent_ctools_access_settings_validate',
+  'settings form submit' => 'ctools_term_has_parent_ctools_access_settings_submit',
+  'summary' => 'ctools_term_has_parent_ctools_access_summary',
+  'required context' => new ctools_context_required(t('Term'), array('taxonomy_term', 'terms')),
+);
+
+/**
+ * Settings form for the 'by parent term' access plugin
+ */
+function ctools_term_has_parent_ctools_access_settings($form, &$form_state, $conf) {
+  // If no configuration was saved before, set some defaults.
+  if (empty($conf)) {
+    $conf = array(
+      'vid' => 0,
+    );
+  }
+  if (!isset($conf['vid'])) {
+    $conf['vid'] = 0;
+  }
+
+  $form['settings']['vid'] = array(
+    '#title' => t('Vocabulary'),
+    '#type' => 'select',
+    '#options' => array(),
+    '#description' => t('Select the vocabulary for this form.'),
+    '#id' => 'ctools-select-vid',
+    '#default_value' => $conf['vid'],
+    '#required' => TRUE,
+  );
+
+  ctools_include('dependent');
+  $options = array();
+
+  // A note: Dependency works strangely on these forms as they have never been
+  // updated to a more modern system so they are not individual forms of their
+  // own like the content types.
+
+  $form['settings']['#tree'] = TRUE;
+
+  // Loop over each of the configured vocabularies.
+  foreach (taxonomy_get_vocabularies() as $vid => $vocabulary) {
+    $options[$vid] = $vocabulary->name;
+    $form['settings'][$vid] = array(
+      '#title' => t('Terms'),
+      '#description' => t('Select a term or terms from @vocabulary.', array('@vocabulary' => $vocabulary->name)),
+      '#dependency' => array('ctools-select-vid' => array($vocabulary->vid)),
+      '#default_value' => !empty($conf[$vid]) ? $conf[$vid] : '',
+      '#size' => 10,
+      '#multiple' => TRUE,
+      //@todo: Remove the following workaround when the following patch is in core. {@see:http://drupal.org/node/1117526}
+      '#name' => sprintf("settings[%u][]", $vid),
+      '#attributes' => array('multiple' => 'multiple'),
+    );
+
+    $terms = array();
+    foreach (taxonomy_get_tree($vocabulary->vid) as $term) {
+      $terms[$term->tid] = str_repeat('-', $term->depth) . ($term->depth ? ' ' : '') . $term->name;
+    }
+    $form['settings'][$vid]['#type'] = 'select';
+    $form['settings'][$vid]['#options'] = $terms;
+    unset($terms);
+  }
+  $form['settings']['vid']['#options'] = $options;
+  $form['settings']['include_self'] = array(
+    '#title' => t('Include these term(s) as candidates?'),
+    '#description' => t('When this rule is evaluated, should the term(s) you select be included as candidates for access?'),
+    '#default_value' => $conf['include_self'],
+    '#type' => 'checkbox',
+  );
+  return $form;
+}
+
+/**
+ * Check for access.
+ */
+function ctools_term_has_parent_ctools_access_check($conf, $context) {
+  // As far as I know there should always be a context at this point, but this
+  // is safe.
+  if (empty($context) || empty($context->data) || empty($context->data->vid) || empty($context->data->tid)) {
+    return FALSE;
+  }
+
+  // Get the $vid.
+  if (!isset($conf['vid'])) {
+    return FALSE;
+  }
+  $vid = $conf['vid'];
+
+  // we'll start looking up the hierarchy from our context term id.
+  $current_term = $context->data->tid;
+
+  $term='';
+
+  // scan up the tree.
+  while (true) {
+    // select parent as term_parent to avoid PHP5 complications with the parent keyword
+    //@todo: Find a way to reduce the number of queries required for really deep hierarchies.
+    $term = db_query("SELECT parent AS term_parent, tid AS tid FROM {taxonomy_term_hierarchy} th WHERE th.tid = :tid", array(':tid'=>$current_term))->fetchObject();
+
+    // if no term is found, get out of the loop
+    if (!$term || empty($term->tid)) {
+      break;
+    }
+
+    // check the term selected, if the user asked it to.
+    if (!empty($conf['include_self']) && in_array($term->tid, $conf[$vid])) {
+      return TRUE;
+    }
+
+    // did we find the parent TID we were looking for?
+    if (in_array($term->term_parent, $conf[$vid])) {
+      // YES, we're done!
+      return TRUE;
+    }
+    // Nope, we didn't find it.
+
+    // If this is the top of the hierarchy, stop scanning.
+    if ($term->term_parent==0) {
+      break;
+    }
+
+    // update the parent, and keep scanning.
+    $current_term = $term->term_parent;
+  }
+
+  return FALSE;
+}
+
+/**
+ * Provide a summary description based upon the checked terms.
+ */
+function ctools_term_has_parent_ctools_access_summary($conf, $context) {
+  $vid = (int)$conf['vid'];
+  $terms = array();
+  foreach ($conf[$vid] as $tid) {
+    $term = taxonomy_term_load($tid);
+    $terms[] = $term->name;
+  }
+
+  return format_plural(count($terms),
+    '@term can have the parent "@terms"',
+    '@term can have one of these parents: @terms',
+    array('@terms' => implode(', ', $terms),
+      '@term' => $context->identifier));
+}
diff --git a/sites/all/modules/ctools/plugins/access/term_parent.inc b/sites/all/modules/ctools/plugins/access/term_parent.inc
index 15a71a85986974225b9cd46f47a19904cf4f465c..acbaf8720e1de6d45c900ca4f50476ae4bfbabb9 100644
--- a/sites/all/modules/ctools/plugins/access/term_parent.inc
+++ b/sites/all/modules/ctools/plugins/access/term_parent.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: term_parent.inc,v 1.3 2011/01/05 20:34:46 merlinofchaos Exp $
 
 /**
  * @file
@@ -72,7 +71,7 @@ function ctools_term_parent_ctools_access_check($conf, $context) {
   }
   $vid = $conf['vid'];
 
-  $count = db_result(db_query('SELECT COUNT(*) FROM {term_hierarchy} th INNER JOIN {term_data} td ON th.parent = td.tid WHERE th.tid = %d AND td.vid = %d',  $context->data->tid, $vid));
+  $count = db_query('SELECT COUNT(*) FROM {taxonomy_term_hierarchy} th INNER JOIN {taxonomy_term_data} td ON th.parent = td.tid WHERE th.tid = :tid AND td.vid = :vid', array(':tid' => $context->data->tid, ':vid' => $vid))->fetchField();
 
   return $count ? TRUE : FALSE;
 }
diff --git a/sites/all/modules/ctools/plugins/access/term_vocabulary.inc b/sites/all/modules/ctools/plugins/access/term_vocabulary.inc
index 8bb7e2a36e98652adc2affd21841329acd65b14c..644600fcf8d8a0d439e074c62752402f0c200dc0 100644
--- a/sites/all/modules/ctools/plugins/access/term_vocabulary.inc
+++ b/sites/all/modules/ctools/plugins/access/term_vocabulary.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: term_vocabulary.inc,v 1.9 2011/01/05 20:34:46 merlinofchaos Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/access/theme.inc b/sites/all/modules/ctools/plugins/access/theme.inc
index eaff131df3e3df3a8c4bb471fdac07dd939eaeb8..4f4be6ded916560a7da8873db4d1237aa4cc580d 100644
--- a/sites/all/modules/ctools/plugins/access/theme.inc
+++ b/sites/all/modules/ctools/plugins/access/theme.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: theme.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/arguments/entity_id.inc b/sites/all/modules/ctools/plugins/arguments/entity_id.inc
index 63cf4c683fcb487d942b2e6be1199a20b798e00e..451d444cbe9fd9564727d552425e8bc1a29b2b2c 100644
--- a/sites/all/modules/ctools/plugins/arguments/entity_id.inc
+++ b/sites/all/modules/ctools/plugins/arguments/entity_id.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: entity_id.inc,v 1.1 2011/01/05 20:34:46 merlinofchaos Exp $
 
 /**
  * @file
@@ -24,17 +23,20 @@ function ctools_argument_entity_id_get_child($plugin, $parent, $child) {
   return $plugins[$parent . ':' . $child];
 }
 
-function ctools_argument_entity_id_get_children($plugin, $parent) {
+function ctools_argument_entity_id_get_children($original_plugin, $parent) {
   $entities = entity_get_info();
   $plugins = array();
   foreach ($entities as $entity_type => $entity) {
+    $plugin = $original_plugin;
     $plugin['title'] = t('@entity: ID', array('@entity' => $entity['label']));
     $plugin['keyword'] = $entity_type;
     $plugin['description'] = t('Creates @entity context from an ID argument.', array('@entity' => $entity_type));
     $plugin['name'] = $parent . ':' . $entity_type;
-    $plugins[$parent . ':' . $entity_type] = $plugin;
+    $plugin_id = $parent . ':' . $entity_type;
+    drupal_alter('ctools_entity_context', $plugin, $entity, $plugin_id);
+    $plugins[$plugin_id] = $plugin;
   }
-
+  drupal_alter('ctools_entity_contexts', $plugins);
   return $plugins;
 }
 
@@ -42,7 +44,8 @@ function ctools_argument_entity_id_get_children($plugin, $parent) {
  * Discover if this argument gives us the entity we crave.
  */
 function ctools_argument_entity_id_context($arg = NULL, $conf = NULL, $empty = FALSE) {
-  $entity_type = $conf['keyword'];
+  $entity_type = explode(':', $conf['name']);
+  $entity_type = $entity_type[1];
   // If unset it wants a generic, unfilled context.
   if ($empty) {
     return ctools_context_create_empty('entity:' . $entity_type);
diff --git a/sites/all/modules/ctools/plugins/arguments/nid.inc b/sites/all/modules/ctools/plugins/arguments/nid.inc
index e0caf8829d121c25a041729f39687e9ec8c6b847..9aaec0e1fa056babfb459ef53360791d74cc4f12 100644
--- a/sites/all/modules/ctools/plugins/arguments/nid.inc
+++ b/sites/all/modules/ctools/plugins/arguments/nid.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: nid.inc,v 1.10 2010/01/29 20:18:01 merlinofchaos Exp $
 
 /**
  * @file
@@ -20,6 +19,7 @@ $plugin = array(
     '#type' => 'textfield',
     '#description' => t('Enter the node ID of a node for this argument'),
   ),
+  'no ui' => TRUE,
 );
 
 /**
diff --git a/sites/all/modules/ctools/plugins/arguments/node_add.inc b/sites/all/modules/ctools/plugins/arguments/node_add.inc
index 3282b82d7314f529bcfad61c9b72926eefc0a173..c811311b0207a76887dc319f4571e7b0edb41c70 100644
--- a/sites/all/modules/ctools/plugins/arguments/node_add.inc
+++ b/sites/all/modules/ctools/plugins/arguments/node_add.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_add.inc,v 1.6 2010/10/15 22:56:51 merlinofchaos Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/arguments/node_edit.inc b/sites/all/modules/ctools/plugins/arguments/node_edit.inc
index 422b6ffc79d346289b84c7ba0b1e8515b3e12728..c7cdf29e83e8ff1fc3b289ee3331292dae32b2a7 100644
--- a/sites/all/modules/ctools/plugins/arguments/node_edit.inc
+++ b/sites/all/modules/ctools/plugins/arguments/node_edit.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_edit.inc,v 1.7 2010/01/29 20:18:01 merlinofchaos Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/arguments/rid.inc b/sites/all/modules/ctools/plugins/arguments/rid.inc
index fbad0553fb11c41b18c7f4d459e4a3f4fd9fcbeb..dd30848e12e91923619e701db38c99b14c083c7c 100644
--- a/sites/all/modules/ctools/plugins/arguments/rid.inc
+++ b/sites/all/modules/ctools/plugins/arguments/rid.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: rid.inc,v 1.2 2010/10/15 21:13:04 merlinofchaos Exp $
 
 /**
  * @file
@@ -40,7 +39,7 @@ function ctools_argument_rid_context($arg = NULL, $conf = NULL, $empty = FALSE)
     return FALSE;
   }
 
-  $nid = db_result(db_query("SELECT nid FROM {node_revisions} WHERE vid = %d", $arg));
+  $nid = db_query('SELECT nid FROM {node_revisions} WHERE vid = :vid', array(':vid' => $arg))->fetchField();
   $node = node_load($nid, $arg);
   if (!$node) {
     return FALSE;
diff --git a/sites/all/modules/ctools/plugins/arguments/string.inc b/sites/all/modules/ctools/plugins/arguments/string.inc
index 09048aa34adefcb86a4b27e5bee7318145067a5f..ed4ffbb63a47cfe290667dd67aeaf6d9ad8a2ad3 100644
--- a/sites/all/modules/ctools/plugins/arguments/string.inc
+++ b/sites/all/modules/ctools/plugins/arguments/string.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: string.inc,v 1.7 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
@@ -42,14 +41,14 @@ function ctools_string_context($arg = NULL, $conf = NULL, $empty = FALSE) {
 /**
  * Settings form for the argument
  */
-function ctools_string_settings_form($form, &$form_state, $conf) {
+function ctools_string_settings_form(&$form, &$form_state, $conf) {
   $form['settings']['use_tail'] = array(
     '#title' => t('Get all arguments after this one'),
     '#type' => 'checkbox',
     '#default_value' => !empty($conf['use_tail']),
     '#description' => t('If checked, this string will include all arguments. For example, if the path is "path/%" and the user visits "path/foo/bar", if this is not checked the string will be "foo". If it is checked the string will be "foo/bar".'),
   );
-  return $form;
+//  return $form;
 }
 
 /**
diff --git a/sites/all/modules/ctools/plugins/arguments/term.inc b/sites/all/modules/ctools/plugins/arguments/term.inc
index f3efd4677e093a773fad407285360f21c504d697..652c5c16c303f05dda1693d96bd58b9b31e59dc4 100644
--- a/sites/all/modules/ctools/plugins/arguments/term.inc
+++ b/sites/all/modules/ctools/plugins/arguments/term.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: term.inc,v 1.12 2010/12/31 21:31:50 merlinofchaos Exp $
 
 /**
  * @file
@@ -29,46 +28,51 @@ $plugin = array(
 function ctools_term_context($arg = NULL, $conf = NULL, $empty = FALSE) {
   // If unset it wants a generic, unfilled context.
   if ($empty) {
-    return ctools_context_create_empty('term');
+    return ctools_context_create_empty('entity:taxonomy_term');
   }
 
-  switch ($conf['input_form']) {
-    case 'tid':
-    default:
-      if (!is_numeric($arg)) {
-        return FALSE;
-      }
-      $term = taxonomy_term_load($arg);
-      break;
-
-    case 'term':
-      $terms = taxonomy_get_term_by_name($arg);
-
-      $conf['vids'] = is_array($conf['vids']) ? array_filter($conf['vids']) : NULL;
-      if ((count($terms) > 1) && isset($conf['vids'])) {
-        foreach ($terms as $potential) {
-          foreach ($conf['vids'] as $vid => $active) {
-            if ($active && $potential->vid == $vid) {
-              $term = $potential;
-              // break out of the foreaches AND the case
-              break 3;
+  if (is_object($arg)) {
+    $term = $arg;
+  }
+  else {
+    switch ($conf['input_form']) {
+      case 'tid':
+      default:
+        if (!is_numeric($arg)) {
+          return FALSE;
+        }
+        $term = taxonomy_term_load($arg);
+        break;
+
+      case 'term':
+        $terms = taxonomy_get_term_by_name($arg);
+
+        $conf['vids'] = is_array($conf['vids']) ? array_filter($conf['vids']) : NULL;
+        if ((count($terms) > 1) && isset($conf['vids'])) {
+          foreach ($terms as $potential) {
+            foreach ($conf['vids'] as $vid => $active) {
+              if ($active && $potential->vid == $vid) {
+                $term = $potential;
+                // break out of the foreaches AND the case
+                break 3;
+              }
             }
           }
         }
-      }
-      $term = array_shift($terms);
-      break;
-  }
+        $term = array_shift($terms);
+        break;
+    }
 
-  if (empty($term)) {
-    return NULL;
+    if (empty($term)) {
+      return NULL;
+    }
   }
 
   if (!empty($conf['vids']) && array_filter($conf['vids']) && empty($conf['vids'][$term->vid])) {
     return NULL;
   }
 
-  $context = ctools_context_create('term', $term);
+  $context = ctools_context_create('entity:taxonomy_term', $term);
   $context->original_argument = $arg;
   return $context;
 }
@@ -76,7 +80,7 @@ function ctools_term_context($arg = NULL, $conf = NULL, $empty = FALSE) {
 /**
  * Settings form for the argument
  */
-function ctools_term_settings_form($form, &$form_state, $conf) {
+function ctools_term_settings_form(&$form, &$form_state, $conf) {
   // @todo allow synonym use like Views does.
   $form['settings']['input_form'] = array(
     '#title' => t('Argument type'),
@@ -106,7 +110,7 @@ function ctools_term_settings_form($form, &$form_state, $conf) {
     '#default_value' => !empty($conf['breadcrumb']),
     '#description' => t('If checked, taxonomy term parents will appear in the breadcrumb trail.'),
   );
-  return $form;
+//  return $form;
 }
 
 /**
diff --git a/sites/all/modules/ctools/plugins/arguments/terms.inc b/sites/all/modules/ctools/plugins/arguments/terms.inc
index 126504ee1604a02e9797f7c1eb26727d3fbfdbf7..4298ea91dd388a7e6c5f7e75d9a830400484513a 100644
--- a/sites/all/modules/ctools/plugins/arguments/terms.inc
+++ b/sites/all/modules/ctools/plugins/arguments/terms.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: terms.inc,v 1.6 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
@@ -48,14 +47,14 @@ function ctools_terms_context($arg = NULL, $conf = NULL, $empty = FALSE) {
 /**
  * Settings form for the argument
  */
-function ctools_terms_settings_form($form, &$form_state, $conf) {
+function ctools_terms_settings_form(&$form, &$form_state, $conf) {
   $form['settings']['breadcrumb'] = array(
     '#title' => t('Inject hierarchy of first term into breadcrumb trail'),
     '#type' => 'checkbox',
     '#default_value' => !empty($conf['breadcrumb']),
     '#description' => t('If checked, taxonomy term parents will appear in the breadcrumb trail.'),
   );
-  return $form;
+//  return $form;
 }
 
 /**
diff --git a/sites/all/modules/ctools/plugins/arguments/uid.inc b/sites/all/modules/ctools/plugins/arguments/uid.inc
index 69be25b04ddab33a4320f738a7d463c9954a8839..a730b2164e514b7400142f3d01bab864eb29c8f3 100644
--- a/sites/all/modules/ctools/plugins/arguments/uid.inc
+++ b/sites/all/modules/ctools/plugins/arguments/uid.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: uid.inc,v 1.12 2010/01/29 20:18:01 merlinofchaos Exp $
 
 /**
  * @file
@@ -24,6 +23,7 @@ $plugin = array(
   'default' => array('to_arg' => TRUE),
   'path placeholder' => '%pm_uid_arg', // This is in pagemanager.
   'path placeholder to_arg' => TRUE,
+  'no ui' => TRUE,
 );
 
 /**
diff --git a/sites/all/modules/ctools/plugins/arguments/user_name.inc b/sites/all/modules/ctools/plugins/arguments/user_name.inc
index 87fccf9b44d5d00795c53f5a63f36df9eaa7ebee..f6f3b4635c5015903f6ab2510e66c8a88ba76208 100644
--- a/sites/all/modules/ctools/plugins/arguments/user_name.inc
+++ b/sites/all/modules/ctools/plugins/arguments/user_name.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: user_name.inc,v 1.3 2010/01/29 20:18:01 merlinofchaos Exp $
 
 /**
  * @file
@@ -37,7 +36,7 @@ function ctools_argument_user_name_context($arg = NULL, $conf = NULL, $empty = F
     return ctools_context_create('user', $arg);
   }
 
-  $account = user_load(array('name' => $arg));
+  $account = user_load_by_name($arg);
   if (!$account) {
     return NULL;
   }
diff --git a/sites/all/modules/ctools/plugins/arguments/vid.inc b/sites/all/modules/ctools/plugins/arguments/vid.inc
index 1dd4088d0170444ec992ec64cf6de43460e6e3a7..bc5c7b85059d7d0f1078bec937945606055fbfbe 100644
--- a/sites/all/modules/ctools/plugins/arguments/vid.inc
+++ b/sites/all/modules/ctools/plugins/arguments/vid.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: vid.inc,v 1.6 2010/01/29 20:18:01 merlinofchaos Exp $
 
 /**
  * @file
@@ -21,6 +20,7 @@ $plugin = array(
     '#type' => 'textfield',
     '#description' => t('Enter the vocabulary ID for this argument'),
   ),
+  'no ui' => TRUE,
 );
 
 /**
diff --git a/sites/all/modules/ctools/plugins/cache/export_ui.inc b/sites/all/modules/ctools/plugins/cache/export_ui.inc
index 4f9d0828c257ad38ce89f61818770c3892d41206..53483a53535de1bd617c08e576ae639c998ed8b2 100644
--- a/sites/all/modules/ctools/plugins/cache/export_ui.inc
+++ b/sites/all/modules/ctools/plugins/cache/export_ui.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: export_ui.inc,v 1.1 2010/10/11 22:18:24 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/cache/simple.inc b/sites/all/modules/ctools/plugins/cache/simple.inc
index 69c98abecb33d986a4a0ea009fc56342be7e72df..215dc1a66bdd385a59df6b92cc9c02b7ec701265 100644
--- a/sites/all/modules/ctools/plugins/cache/simple.inc
+++ b/sites/all/modules/ctools/plugins/cache/simple.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: simple.inc,v 1.1 2010/10/11 22:18:24 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/content_types/block/block.inc b/sites/all/modules/ctools/plugins/content_types/block/block.inc
index 2e4569fe35f3c62c17a995a6da47d9a5c236b98a..c8e70f2f0b9ece086c18e6b93f307bdc85bc2223 100644
--- a/sites/all/modules/ctools/plugins/content_types/block/block.inc
+++ b/sites/all/modules/ctools/plugins/content_types/block/block.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: block.inc,v 1.17 2011/01/06 00:42:03 merlinofchaos Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/content_types/contact/contact.inc b/sites/all/modules/ctools/plugins/content_types/contact/contact.inc
index 10c81e93ff012137c3a2db7c4b0ba5b918bede2a..63283f598d46d1b9f90b16461e0763f93c6347c0 100644
--- a/sites/all/modules/ctools/plugins/content_types/contact/contact.inc
+++ b/sites/all/modules/ctools/plugins/content_types/contact/contact.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: contact.inc,v 1.4 2010/10/11 22:18:24 sdboyer Exp $
 
 if (module_exists('contact')) {
   /**
@@ -29,7 +28,7 @@ function ctools_contact_content_type_render($subtype, $conf, $panel_args, $conte
   $block->title   = t('Contact');
 
   module_load_include('inc', 'contact', 'contact.pages');
-  $block->content = contact_site_page();
+  $block->content = drupal_get_form('contact_site_form');
   return $block;
 }
 
diff --git a/sites/all/modules/ctools/plugins/content_types/contact/user_contact.inc b/sites/all/modules/ctools/plugins/content_types/contact/user_contact.inc
index a558981645467acaa82f8fbfa53bf24df6d11654..cb643bfdcf1767300b47817e62625d8cbfb2f098 100644
--- a/sites/all/modules/ctools/plugins/content_types/contact/user_contact.inc
+++ b/sites/all/modules/ctools/plugins/content_types/contact/user_contact.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: user_contact.inc,v 1.3 2010/01/29 20:18:01 merlinofchaos Exp $
 
 if (module_exists('contact')) {
   /**
@@ -24,7 +23,7 @@ function ctools_user_contact_content_type_render($subtype, $conf, $panel_args, $
     return;
   }
 
-  if (!_contact_user_tab_access($context->data)) {
+  if (!_contact_personal_tab_access($context->data)) {
     return;
   }
 
@@ -35,7 +34,7 @@ function ctools_user_contact_content_type_render($subtype, $conf, $panel_args, $
   $block->title   = t('Contact @name', array('@name' => $context->data->name));
 
   module_load_include('inc', 'contact', 'contact.pages');
-  $block->content = contact_user_page($context->data);
+  $block->content = drupal_get_form('contact_personal_form', $context->data);
   return $block;
 }
 
@@ -44,6 +43,7 @@ function ctools_user_contact_content_type_render($subtype, $conf, $panel_args, $
  */
 function ctools_user_contact_content_type_edit_form(&$form, &$form_state) {
   // Empty so that we can have title override.
+  return $form;
 }
 
 /**
diff --git a/sites/all/modules/ctools/plugins/content_types/custom/custom.inc b/sites/all/modules/ctools/plugins/content_types/custom/custom.inc
index 54460d05ba4e433c94287baa0ae294bcd9fd0c52..f60497a60ee4cb3ea50417c339adf573c7db5771 100644
--- a/sites/all/modules/ctools/plugins/content_types/custom/custom.inc
+++ b/sites/all/modules/ctools/plugins/content_types/custom/custom.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: custom.inc,v 1.17 2011/01/05 22:57:26 merlinofchaos Exp $
 
 /**
  * @file
@@ -225,7 +224,7 @@ function ctools_custom_content_type_admin_info($subtype, $conf) {
     if (!filter_access($filter)) {
       return NULL;
     }
-    $block->content = '<pre>'. check_plain($settings['body']) .'</pre>';
+    $block->content = '<pre>' . check_plain($settings['body']) . '</pre>';
   }
   else {
     // We also need to filter through XSS admin because <script> tags can
@@ -243,7 +242,7 @@ function ctools_custom_content_type_edit_form($form, &$form_state) {
   $form_state['settings'] = $settings;
 
   if ($settings['custom_type'] == 'fixed') {
-    return; // no form for this case.
+    return $form; // no form for this case.
   }
 
   $form['admin_title'] = array(
@@ -259,7 +258,7 @@ function ctools_custom_content_type_edit_form($form, &$form_state) {
     '#title' => t('Title'),
   );
 
-    $form['body'] = array(
+  $form['body'] = array(
     '#type' => 'text_format',
     '#title' => t('Body'),
     '#default_value' => $settings['body'],
@@ -270,9 +269,11 @@ function ctools_custom_content_type_edit_form($form, &$form_state) {
     // Set extended description if both CCK and Token modules are enabled, notifying of unlisted keywords
     if (module_exists('content') && module_exists('token')) {
       $description = t('If checked, context keywords will be substituted in this content. Note that CCK fields may be used as keywords using patterns like <em>%node:field_name-formatted</em>.');
-    } elseif (!module_exists('token')) {
+    }
+    elseif (!module_exists('token')) {
       $description = t('If checked, context keywords will be substituted in this content. More keywords will be available if you install the Token module, see http://drupal.org/project/token.');
-    } else {
+    }
+    else {
       $description = t('If checked, context keywords will be substituted in this content.');
     }
 
@@ -303,7 +304,7 @@ function ctools_custom_content_type_edit_form($form, &$form_state) {
   }
 
   if (!user_access('administer custom content') || !module_exists('ctools_custom_content')) {
-    return;
+    return $form;
   }
 
   // Make the other form items dependent upon it.
@@ -320,7 +321,6 @@ function ctools_custom_content_type_edit_form($form, &$form_state) {
     '#type' => 'textfield',
     '#title' => t('Machine name'),
     '#description' => t('The machine readable name of this content. It must be unique, and it must contain only alphanumeric characters and underscores. Once created, you will not be able to change this value!'),
-    '#process' => array('ctools_dependent_process'),
     '#dependency' => array('edit-reusable' => array(1)),
   );
 
@@ -328,7 +328,6 @@ function ctools_custom_content_type_edit_form($form, &$form_state) {
     '#type' => 'textfield',
     '#title' => t('Category'),
     '#description' => t('What category this content should appear in. If left blank the category will be "Miscellaneous".'),
-    '#process' => array('ctools_dependent_process'),
     '#dependency' => array('edit-reusable' => array(1)),
   );
 
@@ -336,7 +335,6 @@ function ctools_custom_content_type_edit_form($form, &$form_state) {
     '#type' => 'textarea',
     '#title' => t('Administrative description'),
     '#description' => t('A description of what this content is, does or is for, for administrative use.'),
-    '#process' => array('ctools_dependent_process'),
     '#dependency' => array('edit-reusable' => array(1)),
   );
   return $form;
diff --git a/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc b/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc
index 1b967fd52a53679a045d7b5865da0161bd7c146c..e252064a6df193e44a27684eb62ad4550867dd84 100644
--- a/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc
+++ b/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc
@@ -1,9 +1,13 @@
 <?php
-// $Id: entity_field.inc,v 1.3 2011/01/05 22:57:26 merlinofchaos Exp $
+
+/**
+ * @file
+ * Handle rendering entity fields as panes.
+ */
 
 $plugin = array(
   'title' => t('Entity field'),
-  'defaults' => array('label' => '', 'formatter' => ''),
+  'defaults' => array('label' => 'title', 'formatter' => ''),
   'content type' => 'ctools_entity_field_content_type_content_type',
 );
 
@@ -33,26 +37,28 @@ function ctools_entity_field_content_type_content_types() {
   foreach ($entities as $entity_type => $entity) {
     foreach ($entity['bundles'] as $type => $bundle) {
       foreach (field_info_instances($entity_type, $type) as $field_name => $field) {
-        if (!isset($types[$entity_type .':'. $field_name])) {
-          $types[$entity_type .':'. $field_name] = array(
+        if (!isset($types[$entity_type . ':' . $field_name])) {
+          $types[$entity_type . ':' . $field_name] = array(
             'category' => t(ucfirst($entity_type)),
             'icon' => 'icon_field.png',
-            'title' => t('Field: @widget_label (@field_name) - @field_type', array(
+            'title' => t('Field: @widget_label (@field_name)', array(
               '@widget_label' => t($field['label']),
               '@field_name' => $field_name,
-              '@field_type' => t($field['widget']['type']),
             )),
             'description' => t('Field on the referenced entity.'),
             'edit form' => array(
               'ctools_entity_field_content_type_formatter_options' => array(
                 'default' => TRUE,
-                'title' => t('Formatter Options'),
+                'title' => t('Formatter options for: @widget_label (@field_name)', array(
+                  '@widget_label' => t($field['label']),
+                  '@field_name' => $field_name,
+                )),
               ),
               'ctools_entity_field_content_type_formatter_styles' => t('Formatter Styles'),
             ),
           );
         }
-        $context_types[$entity_type .':'. $field_name]['types'][$type] = $bundle['label'];
+        $context_types[$entity_type . ':' . $field_name]['types'][$type] = $bundle['label'];
       }
     }
   }
@@ -65,6 +71,7 @@ function ctools_entity_field_content_type_content_types() {
     ));
     unset($context_types[$key]['types']);
   }
+
   return $types;
 }
 
@@ -90,11 +97,34 @@ function ctools_entity_field_content_type_render($subtype, $conf, $panel_args, $
   }
   $language = field_language($entity_type, $entity, $field_name);
 
+  if (empty($conf['label']) || $conf['label'] == 'title') {
+    $label = 'hidden';
+    $conf['label'] = 'title';
+  }
+  else {
+    $label = $conf['label'];
+  }
+
+  $field_settings = array(
+    'label' => $label,
+    'type' => $conf['formatter'],
+  );
+
+  // Get the field output, and the title.\
+  if (!empty($conf['formatter_settings'])) {
+    $field_settings['settings'] = $conf['formatter_settings'];
+  }
+
+  $field_output = field_view_field($entity_type, $entity, $field_name, $field_settings, $language);
+
   // Build the content type block.
   $block = new stdClass();
   $block->module  = 'entity_field';
-  $block->title   = $field['label'];
-  $block->content = field_view_field($entity_type, $entity, $field_name, ($conf['formatter_settings'] ? array('label' => 'hidden', 'type' => $conf['formatter'], 'settings' => $conf['formatter_settings']) : array('label' => 'hidden', 'type' => $conf['formatter'])), $language);
+  if ($conf['label'] == 'title' && isset($field_output['#title'])) {
+    $block->title = $field_output['#title'];
+  }
+
+  $block->content = $field_output;
   $block->delta   = $ids[0];
 
   return $block;
@@ -115,6 +145,20 @@ function ctools_entity_field_content_type_formatter_options($form, &$form_state)
   module_load_include('inc', 'field_ui', 'field_ui.admin');
   $formatter_options = field_ui_formatter_options($field['type']);
 
+  $field_label_options = array(
+    'title' => t('Pane title'),
+    'above' => t('Above'),
+    'inline' => t('Inline'),
+    'hidden' => t('Hidden'),
+  );
+
+  $form['label'] = array(
+    '#type' => 'select',
+    '#title' => t('Label'),
+    '#options' => $field_label_options,
+    '#default_value' => $conf['label'],
+  );
+
   $form['formatter'] = array(
     '#type' => 'select',
     '#title' => t('Select a formatter'),
@@ -127,6 +171,7 @@ function ctools_entity_field_content_type_formatter_options($form, &$form_state)
 
 function ctools_entity_field_content_type_formatter_options_submit($form, &$form_state) {
   $form_state['conf']['formatter'] = $form_state['values']['formatter'];
+  $form_state['conf']['label'] = $form_state['values']['label'];
 }
 
 function ctools_entity_field_content_type_formatter_styles($form, &$form_state) {
@@ -155,7 +200,7 @@ function ctools_entity_field_content_type_formatter_styles_submit($form, &$form_
   foreach ($formatter_info as $info) {
     if (!empty($info['settings'])) {
       foreach ($info['settings'] as $field_name => $value) {
-        if (!empty($form_state['values'][$field_name])) {
+        if (isset($form_state['values'][$field_name])) {
           $form_state['conf']['formatter_settings'][$field_name] = $form_state['values'][$field_name];
         }
       }
@@ -167,5 +212,7 @@ function ctools_entity_field_content_type_formatter_styles_submit($form, &$form_
 * Returns the administrative title for a type.
 */
 function ctools_entity_field_content_type_admin_title($subtype, $conf, $context) {
-  return t('"@s" @field', array('@s' => $context->identifier, '@field' => $subtype));
+  list($bundle, $field_name) = explode(':', $subtype);
+  ctools_include('fields');
+  return t('"@s" @field', array('@s' => $context->identifier, '@field' => ctools_field_label($field_name)));
 }
diff --git a/sites/all/modules/ctools/plugins/content_types/form/entity_form_field.inc b/sites/all/modules/ctools/plugins/content_types/form/entity_form_field.inc
new file mode 100644
index 0000000000000000000000000000000000000000..3905a31043a33c0f73d9c0970bfa48dd50ca49f8
--- /dev/null
+++ b/sites/all/modules/ctools/plugins/content_types/form/entity_form_field.inc
@@ -0,0 +1,114 @@
+<?php
+
+/**
+ * @file
+ * Handle rendering entity fields as panes.
+ */
+
+$plugin = array(
+  'title' => t('Entity field'),
+  'defaults' => array('label' => '', 'formatter' => ''),
+  'content type' => 'ctools_entity_form_field_content_type_content_type',
+);
+
+/**
+ * Just one subtype.
+ *
+ * Ordinarily this function is meant to get just one subtype. However, we are
+ * using it to deal with the fact that we have changed the subtype names. This
+ * lets us translate the name properly.
+ */
+function ctools_entity_form_field_content_type_content_type($subtype) {
+  $types = ctools_entity_form_field_content_type_content_types();
+  if (isset($types[$subtype])) {
+    return $types[$subtype];
+  }
+}
+
+/**
+ * Return all field content types available.
+ */
+function ctools_entity_form_field_content_type_content_types() {
+  // This will hold all the individual field content types.
+  $types = array();
+  $content_types = array();
+  $entities = entity_get_info();
+
+  foreach ($entities as $entity_type => $entity) {
+    foreach ($entity['bundles'] as $type => $bundle) {
+      foreach (field_info_instances($entity_type, $type) as $field_name => $field) {
+        if (!isset($types[$entity_type . ':' . $field_name])) {
+          $types[$entity_type . ':' . $field_name] = array(
+            'category' => t('Form'),
+            'icon' => 'icon_field.png',
+            'title' => t('Field form: @widget_label', array(
+              '@widget_label' => t($field['label']),
+            )),
+            'description' => t('Field on the referenced entity.'),
+          );
+        }
+        $content_types[$entity_type . ':' . $field_name]['types'][$type] = $bundle['label'];
+      }
+    }
+  }
+
+  // Create the required context for each field related to the bundle types.
+  foreach ($types as $key => $field_content_type) {
+    list($entity_type, $field_name) = explode(':', $key, 2);
+    $types[$key]['required context'] = new ctools_context_required(t(ucfirst($entity_type)), $entity_type, array(
+      'form' => array('form'),
+      'type' => array_keys($content_types[$key]['types']),
+    ));
+    unset($content_types[$key]['types']);
+  }
+  return $types;
+}
+
+/**
+* Render the custom content type.
+*/
+function ctools_entity_form_field_content_type_render($subtype, $conf, $panel_args, $context) {
+  if (empty($context) || empty($context->data)) {
+    return;
+  }
+
+  // Get a shortcut to the entity.
+  $entity = $context->data;
+  list($entity_type, $field_name) = explode(':', $subtype, 2);
+
+  // Load the entity type's information for this field.
+  $ids = entity_extract_ids($entity_type, $entity);
+  $field = field_info_instance($entity_type, $field_name, $ids[2]);
+
+  // Do not render if the entity type does not have this field.
+  if (empty($field)) {
+    return;
+  }
+
+  if (isset($context->form)) {
+    $block->content[$field_name] = $context->form[$field_name];
+    unset($context->form[$field_name]);
+  }
+  else {
+    $block->content = t('Entity info.');
+  }
+  return $block;
+
+  return $block;
+}
+
+/**
+* Returns the administrative title for a type.
+*/
+function ctools_entity_form_field_content_type_admin_title($subtype, $conf, $context) {
+  list($entity_type, $field_name) = explode(':', $subtype, 2);
+
+  $field = field_info_instance($entity_type, $field_name, $context->restrictions['type'][0]);
+
+  return t('"@s" @field form', array('@s' => $context->identifier, '@field' => $field['label']));
+}
+
+function ctools_entity_form_field_content_type_edit_form($form, &$form_state) {
+  // provide a blank form so we have a place to have context setting.
+  return $form;
+}
diff --git a/sites/all/modules/ctools/plugins/content_types/form/form.inc b/sites/all/modules/ctools/plugins/content_types/form/form.inc
index 4fb0380c6395d7f6d5b2893d238c3492fa9fbee9..c6cd6840090b9d54b89b0ae3192413bab748aa64 100644
--- a/sites/all/modules/ctools/plugins/content_types/form/form.inc
+++ b/sites/all/modules/ctools/plugins/content_types/form/form.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: form.inc,v 1.3 2010/10/11 22:18:24 sdboyer Exp $
 
 /**
  * Plugins are described by creating a $plugin array which will be used
@@ -26,15 +25,12 @@ function ctools_form_content_type_render($subtype, $conf, $panel_args, &$context
 
   if (isset($context->form)) {
     $block->title = $context->form_title;
-    if (!empty($context->form_id)) {
-      // If this is a form, drupal_render it.
-      $block->content = drupal_render($context->form);
-    }
-    else {
-      // Otherwise just spit back what we were given. This is probably an
-      // error message or something.
-      $block->content = $context->form;
+    $block->content = array();
+    foreach (element_children($context->form) as $element) {
+      $block->content[$element] = $context->form[$element];
+      unset($context->form[$element]);
     }
+
     $block->delta = $context->form_id;
   }
   else {
diff --git a/sites/all/modules/ctools/plugins/content_types/node/node.inc b/sites/all/modules/ctools/plugins/content_types/node/node.inc
index 33a24ae3b3b834f6d270d7fbd02f5ff89c85d215..2722a195b148f6153fe4e55b8013a2e63046cede 100644
--- a/sites/all/modules/ctools/plugins/content_types/node/node.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node/node.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node.inc,v 1.11 2010/12/31 21:09:56 merlinofchaos Exp $
 
 /**
  * @file
@@ -51,7 +50,7 @@ function ctools_node_content_type_render($subtype, $conf, $panel_args) {
   // Support node translation
   if (module_exists('translation')) {
     if ($translations = module_invoke('translation', 'node_get_translations', $nid)) {
-  	  if ($translations[$GLOBALS['language']->language])  {
+      if (isset($translations[$GLOBALS['language']->language]))  {
         $nid = $translations[$GLOBALS['language']->language]->nid;
       }
     }
@@ -66,6 +65,10 @@ function ctools_node_content_type_render($subtype, $conf, $panel_args) {
     return;
   }
 
+  // Don't store viewed node data on the node, this can mess up other
+  // views of the node.
+  $node = clone($node);
+
   $block->module = 'node';
   $block->delta = $node->nid;
 
@@ -81,7 +84,7 @@ function ctools_node_content_type_render($subtype, $conf, $panel_args) {
   }
 
   if (!empty($conf['identifier'])) {
-    $node->panel_identifier = $conf['identifier'];
+    $node->ctools_template_identifier = $conf['identifier'];
   }
 
   // Handle existing configurations with the deprecated 'teaser' option.
@@ -90,6 +93,12 @@ function ctools_node_content_type_render($subtype, $conf, $panel_args) {
   }
 
   $block->content = node_view($node, $conf['build_mode']);
+
+  // Hide links if they've been suppressed.
+  if (empty($conf['links'])) {
+    $block->content['links']['#access'] = FALSE;
+  }
+
   return $block;
 }
 
@@ -143,7 +152,7 @@ function ctools_node_content_type_edit_form($form, &$form_state) {
     '#type' => 'textfield',
     '#default_value' => !empty($conf['identifier']) ? $conf['identifier'] : '',
     '#title' => t('Template identifier'),
-    '#description' => t('This identifier will be added as a template suggestion to display this node: node-panel-IDENTIFIER.tpl.php. Please see the Drupal theming guide for information about template suggestions.'),
+    '#description' => t('This identifier will be added as a template suggestion to display this node: node--panel--IDENTIFIER.tpl.php. Please see the Drupal theming guide for information about template suggestions.'),
   );
 
   $entity = entity_get_info('node');
@@ -178,19 +187,19 @@ function  ctools_node_content_type_edit_form_validate(&$form, &$form_state) {
 
   $nid = $form_state['values']['nid'];
   $preg_matches = array();
-  $match = preg_match('/\[nid: (\d+)\]/', $nid, $preg_matches);
+  $match = preg_match('/\[id: (\d+)\]/', $nid, $preg_matches);
   if (!$match) {
-    $match = preg_match('/^nid: (\d+)/', $nid, $preg_matches);
+    $match = preg_match('/^id: (\d+)/', $nid, $preg_matches);
   }
 
   if ($match) {
     $nid = $preg_matches[1];
   }
   if (is_numeric($nid)) {
-    $node = db_query('SELECT nid FROM {node} WHERE nid = :nid', array(':nid' => $nid))->fetchObject();
+    $node = db_query('SELECT nid, status FROM {node} WHERE nid = :nid', array(':nid' => $nid))->fetchObject();
   }
   else {
-    $node = db_query('SELECT nid FROM {node} WHERE LOWER(title) = LOWER(:title)', array(':title' => $nid))->fetchObject();
+    $node = db_query('SELECT nid, status FROM {node} WHERE LOWER(title) = LOWER(:title)', array(':title' => $nid))->fetchObject();
   }
   if ($node) {
     $form_state['values']['nid'] = $node->nid;
@@ -222,7 +231,7 @@ function ctools_node_content_type_admin_title($subtype, $conf) {
 
   $node = node_load($conf['nid']);
   if ($node) {
-    if (!empty($data->status) || user_access('administer nodes')) {
+    if (!empty($node->status) || user_access('administer nodes')) {
       return check_plain($node->title);
     }
     else {
diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_attachments.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_attachments.inc
index 97eb6aa0df84f5a81385dc13b1dafa01291b1c93..380e26043db489712bc6f2d2d403ee763497f800 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_context/node_attachments.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_attachments.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_attachments.inc,v 1.4 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * Plugins are described by creating a $plugin array which will be used
diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_author.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_author.inc
index 75f5376ccaaccaeefd84824e0998dcf3399f3c63..e98ce5acc90263df28f694487dd3d881c23e9cde 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_context/node_author.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_author.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_author.inc,v 1.6 2011/01/02 16:44:11 merlinofchaos Exp $
 
 /**
  * Plugins are described by creating a $plugin array which will be used
@@ -33,7 +32,7 @@ function ctools_node_author_content_type_render($subtype, $conf, $panel_args, $c
   $block = new stdClass();
   $block->module  = 'node_author';
   $block->title   = t('Author');
-  $block->content = !empty($conf['link']) ? theme('username', array('account' => $user, 'link_path' => 'user/'. $node->uid)) : check_plain(format_username($node));
+  $block->content = !empty($conf['link']) ? theme('username', array('account' => $user, 'link_path' => 'user/' . $node->uid)) : check_plain(format_username($node));
   $block->delta   = $node->nid;
 
   return $block;
diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_body.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_body.inc
index 0923c988e2467c171a0ab0cacfa540566bda2c80..3e69560a28a75f6f3ffb4cd58e7054a915a5793f 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_context/node_body.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_body.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_body.inc,v 1.6 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * Plugins are described by creating a $plugin array which will be used
@@ -12,37 +11,17 @@ $plugin = array(
   'description' => t('The body of the referenced node.'),
   'required context' => new ctools_context_required(t('Node'), 'node'),
   'category' => t('Node'),
+  'no ui' => TRUE,
 );
 
 /**
  * Render the custom content type.
  */
 function ctools_node_body_content_type_render($subtype, $conf, $panel_args, $context) {
-  if (empty($context) || empty($context->data)) {
-    return;
-  }
-
-  // Get a shortcut to the node.
-  $node = $context->data;
-
-  // Load information about the node type.
-  $type = node_type_get_type($node);
-
-  // Do not render if the body is disabled for this node type.
-  if (!$type->has_body) {
-    return;
-  }
-
-  $body = str_replace('<!--break-->', '', $node->body);
-
-  // Build the content type block.
-  $block = new stdClass();
-  $block->module  = 'node_body';
-  $block->title   = $type->body_label;
-  $block->content = check_markup($body, $node->format, FALSE);
-  $block->delta   = $node->nid;
-
-  return $block;
+  $plugin = ctools_get_content_type('entity_field');
+  $conf['formatter'] = 'text_default';
+  $conf['formatter_settings'] = array();
+  return $plugin['render callback']('node:body', $conf, $panel_args, $context);
 }
 
 /**
diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_book_children.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_book_children.inc
index 3336719241bbc17b5f9302b6a01fbb48f9b601a8..5d017c5cde4b60ad5a0d780dd67794c44e753206 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_context/node_book_children.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_book_children.inc
@@ -16,7 +16,7 @@ if (module_exists('book')) {
 }
 
 function ctools_node_book_children_content_type_render($subtype, $conf, $panel_args, $context) {
-  $node = isset($context->data) ? drupal_clone($context->data) : NULL;
+  $node = isset($context->data) ? clone($context->data) : NULL;
   $block = new stdClass();
   $block->module = 'book_children';
 
diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_book_nav.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_book_nav.inc
index 9b93a6bf2d8664e8eb4e846dbc647bd6b867699e..6c0d50df7e329b2eb59fb7bd7677882f3a053fdb 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_context/node_book_nav.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_book_nav.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_book_nav.inc,v 1.4 2010/10/11 22:18:22 sdboyer Exp $
 
 if (module_exists('book')) {
   /**
@@ -23,7 +22,7 @@ function ctools_node_book_nav_content_type_render($subtype, $conf, $panel_args,
 
   $block->title = t('Book navigation');
   if ($node) {
-    $block->content = isset($node->book) ? theme('book_navigation', $node->book) : '';
+    $block->content = isset($node->book) ? theme('book_navigation', array('book_link' => $node->book)) : '';
     $block->delta = $node->nid;
   }
   else {
diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_comment_form.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_comment_form.inc
index 6706e450a087fe6b513cc1f269adbd12855c6b5e..b1aa2fb43ce727a7cfb7a499ae57a3e4d0f48ab7 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_context/node_comment_form.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_comment_form.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_comment_form.inc,v 1.6 2010/12/31 21:16:51 merlinofchaos Exp $
 
 if (module_exists('comment')) {
   /**
@@ -13,7 +12,7 @@ if (module_exists('comment')) {
     'description' => t('A form to add a new comment.'),
     'required context' => new ctools_context_required(t('Node'), 'node'),
     'category' => t('Node'),
-    'defaults' => array('anon_links' => false),
+    'defaults' => array('anon_links' => FALSE),
   );
 }
 
@@ -42,7 +41,7 @@ function ctools_node_comment_form_content_type_render($subtype, $conf, $panel_ar
           ),
         ),
       );
-      $block->content = drupal_build_form('comment_node_'. $node->type .'_form', $form_state);
+      $block->content = drupal_build_form('comment_node_' . $node->type . '_form', $form_state);
     }
     else if (!empty($conf['anon_links'])) {
       $block->content = theme('comment_post_forbidden', array('node' => $node));
diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_comments.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_comments.inc
index 5aa9770597cbb524838a540ea95c589fc73370fc..47176ea07ae2385615755a8ce1fec32f8588c67d 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_context/node_comments.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_comments.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_comments.inc,v 1.9 2010/12/31 21:04:28 merlinofchaos Exp $
 
 if (module_exists('comment')) {
   /**
@@ -119,7 +118,7 @@ function ctools_comment_render($node, $conf) {
   $comments = comment_load_multiple($cids);
 
   if ($comments) {
-    drupal_add_css(drupal_get_path('module', 'comment') .'/comment.css');
+    drupal_add_css(drupal_get_path('module', 'comment') . '/comment.css');
     comment_prepare_thread($comments);
     $build = comment_view_multiple($comments, $node);
     $build['pager']['#theme'] = 'pager';
diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_content.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_content.inc
index a4a49f33219f4545976995682ee3151bdd91f920..38c5b574423c8fdbc7f764840180827f1fda1d94 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_context/node_content.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_content.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_content.inc,v 1.9 2010/12/31 21:05:24 merlinofchaos Exp $
 
 /**
  * Plugins are described by creating a $plugin array which will be used
@@ -44,7 +43,7 @@ function ctools_node_content_content_type_render($subtype, $conf, $panel_args, $
   }
   else {
     if (!empty($conf['identifier'])) {
-      $node->panel_identifier = $conf['identifier'];
+      $node->ctools_template_identifier = $conf['identifier'];
     }
 
     $block->title = $node->title;
@@ -99,8 +98,9 @@ function ctools_node_content_render_node($node, $conf) {
 
     if (empty($conf['no_extras'])) {
       // Allow modules to make their own additions to the node.
-      module_invoke_all('node_view', $node, $conf['build_mode']);
-      module_invoke_all('entity_view', $node, 'node', $conf['build_mode']);
+      $langcode = $GLOBALS['language_content']->language;
+      module_invoke_all('node_view', $node, $conf['build_mode'], $langcode);
+      module_invoke_all('entity_view', $node, 'node', $conf['build_mode'], $langcode);
     }
   }
 
@@ -171,7 +171,7 @@ function ctools_node_content_content_type_edit_form($form, &$form_state) {
     '#type' => 'textfield',
     '#default_value' => $conf['identifier'],
     '#title' => t('Template identifier'),
-    '#description' => t('This identifier will be added as a template suggestion to display this node: node-panel-IDENTIFIER.tpl.php. Please see the Drupal theming guide for information about template suggestions.'),
+    '#description' => t('This identifier will be added as a template suggestion to display this node: node--panel--IDENTIFIER.tpl.php. Please see the Drupal theming guide for information about template suggestions.'),
   );
 
   $entity = entity_get_info('node');
diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_created.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_created.inc
index 789d6c86f9450dfed683ae552fea6f0f809326aa..41c8b83d40e29bf1486d171ef24d86beff1d0bb4 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_context/node_created.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_created.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_created.inc,v 1.4 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * Plugins are described by creating a $plugin array which will be used
diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_links.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_links.inc
index a2da7b22871d7995b1606baf54ca118d95322a7c..6096a44fb673daf02293f75ed2e621b7ea19114b 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_context/node_links.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_links.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_links.inc,v 1.6 2010/12/31 21:06:18 merlinofchaos Exp $
 
 /**
  * Plugins are described by creating a $plugin array which will be used
@@ -87,7 +86,7 @@ function ctools_node_links_content_type_edit_form($form, &$form_state) {
     '#type' => 'textfield',
     '#default_value' => $conf['identifier'],
     '#title' => t('Identifier'),
-    '#description' => t('Whatever is placed here will appear in $node->panel_identifier to help theme node links displayed on the panel'),
+    '#description' => t('Whatever is placed here will appear in @identifier, to help theme node links displayed on the panel', array('@identifier' => $node->panel_identifier)),
   );
 
   return $form;
diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_terms.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_terms.inc
index 55620065fff91cab93cab5f6681ef0f8b8341750..6cb5e7ce912bb303dbb1aaaaf43b9e595cca80dd 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_context/node_terms.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_terms.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_terms.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * Plugins are described by creating a $plugin array which will be used
@@ -31,29 +30,41 @@ function ctools_node_terms_content_type_render($subtype, $conf, $panel_args, $co
   // Get a shortcut to the node.
   $node = $context->data;
 
-  if (empty($node->taxonomy)) {
-    return;
+  // Load all terms for this node from all vocabularies
+  $query = db_select('taxonomy_index', 't');
+  $result = $query
+    ->fields('t')
+    ->condition('t.nid', $node->nid)
+    ->execute();
+
+  $tids = array();
+  foreach ($result AS $term) {
+    $tids[] = $term->tid;
   }
 
-  $formatted_terms = '';
-  if (empty($conf['vid']) && $conf['term_format'] == 'term-links') {
-    // They want all terms, formatted as term links, so we can just use
-    // taxonomy_link() directly.
-    $terms = taxonomy_link('taxonomy terms', $node);
-    $formatted_terms = theme('links', $terms);
+  // Get the real term objects
+  $term_objects = taxonomy_term_load_multiple($tids);
+
+  $terms = array();
+
+  if (empty($conf['vid'])) {
+    // All terms.
+    foreach ($term_objects AS $term) {
+      $terms['taxonomy_term_' . $term->tid] = array(
+        'title' => check_plain($term->name),
+        'href' => 'taxonomy/term/' . $term->tid,
+        'attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description))
+      );
+    }
   }
   else {
     // They want something special and custom, we'll have to do this ourselves.
-    $terms = array();
-    foreach ($context->data->taxonomy as $term) {
-      if (empty($conf['vid']) || $term->vid == $conf['vid']) {
+    foreach ($term_objects as $term) {
+      if ($term->vid == $conf['vid']) {
         if ($conf['term_format'] == 'term-links') {
-          // We have to do this manually since taxonomy_link() doesn't let you
-          // filter by vocabulary, so we just replicate it for the subset of
-          // terms matching the requested vid.
           $terms['taxonomy_term_' . $term->tid] = array(
             'title' => $term->name,
-            'href' => taxonomy_term_path($term),
+            'href' => 'taxonomy/term/' . $term->tid,
             'attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description)),
           );
         }
@@ -61,29 +72,31 @@ function ctools_node_terms_content_type_render($subtype, $conf, $panel_args, $co
           $terms[] = check_plain($term->name);
         }
         else {
-          $terms[] = l($term->name, taxonomy_term_path($term), array('attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description))));
+          $terms[] = l($term->name, 'taxonomy/term/' . $term->tid, array('attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description))));
         }
       }
     }
+  }
 
-    switch ($conf['term_format']) {
-      case 'term-links':
-        // Since we didn't use taxonomy_link() directly, we need to invoke
-        // hook_link_alter() for this to work as sites will expect.
-        drupal_alter('link', $terms, $node);
-        $formatted_terms = theme('links', $terms);
-        break;
-
-      case 'ul':
-        $formatted_terms = theme('item_list', $terms);
-        break;
-
-      case 'inline-delimited':
-        $delimiter = isset($conf['term_delimiter']) ? $conf['term_delimiter'] : ', ';
-        $formatted_terms = implode($delimiter, $terms);
-        break;
-
-    }
+  $formatted_terms = '';
+  switch ($conf['term_format']) {
+    case 'term-links':
+      drupal_alter('link', $terms, $node);
+      $formatted_terms = theme('links', $terms);
+      break;
+
+    case 'ul':
+      $formatted_terms = theme('item_list', $terms);
+      break;
+
+    case 'inline-delimited':
+      $term_names = array();
+      foreach ($terms AS $term) {
+        $term_names[] = $term['title'];
+      }
+      $delimiter = isset($conf['term_delimiter']) ? $conf['term_delimiter'] : ', ';
+      $formatted_terms = implode($delimiter, $term_names);
+      break;
   }
 
   // Build the content type block.
@@ -147,7 +160,6 @@ function ctools_node_terms_content_type_edit_form($form, &$form_state) {
     '#type' => 'checkbox',
     '#default_value' => $conf['link'],
     '#description' => t('Check here to make the terms link to the term paths.'),
-    '#process' => array('ctools_dependent_process'),
     '#dependency' => array('radio:term_format' => array('inline-delimited', 'ul')),
     '#prefix' => '<div class="clearfix">',
     '#suffix' => '</div>',
@@ -158,7 +170,6 @@ function ctools_node_terms_content_type_edit_form($form, &$form_state) {
     '#title' => t('Term delimiter'),
     '#default_value' => $conf['term_delimiter'],
     '#size' => 10,
-    '#process' => array('ctools_dependent_process'),
     '#dependency' => array('radio:term_format' => array('inline-delimited')),
   );
   return $form;
diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_title.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_title.inc
index ef31a5374712d70539c854a87146bc6b772ec663..6a52306ba7392de8a77bf29bf20f5aff24ff3b29 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_context/node_title.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_title.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_title.inc,v 1.5 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * Plugins are described by creating a $plugin array which will be used
@@ -35,7 +34,7 @@ function ctools_node_title_content_type_render($subtype, $conf, $panel_args, $co
   $block = new stdClass();
   $block->module  = 'node_title';
   $block->title   = $type->title_label;
-  $block->content = !empty($conf['link']) ? l($node->title, 'node/'. $node->nid) : check_plain($node->title);
+  $block->content = !empty($conf['link']) ? l($node->title, 'node/' . $node->nid) : check_plain($node->title);
   $block->delta   = $node->nid;
 
   return $block;
diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_type_desc.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_type_desc.inc
index f1aff821d3fa99ae959dbc9322ae1d98caf34c88..f2005d08b538cb94b1f006ebbb9a7948515b2bea 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_context/node_type_desc.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_type_desc.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_type_desc.inc,v 1.4 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * Plugins are described by creating a $plugin array which will be used
diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_updated.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_updated.inc
index a38a208977f296df4f124ddb8f561045989efe7e..076eb06edc9270c098b0d3ed8dbc6879fefb1363 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_context/node_updated.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_updated.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_updated.inc,v 1.5 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * Plugins are described by creating a $plugin array which will be used
diff --git a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_attachments.inc b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_attachments.inc
index 01d3f6344cc97b12fa02062498c1d9bb2c501f80..1e248f5005c73e93cf87cdc0c13f2e6ed2bdd66a 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_attachments.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_attachments.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_form_attachments.inc,v 1.4 2010/10/11 22:18:23 sdboyer Exp $
 
 if (module_exists('upload')) {
   /**
@@ -24,10 +23,16 @@ function ctools_node_form_attachments_content_type_render($subtype, $conf, $pane
   $block->delta = 'url-path-options';
 
   if (isset($context->form)) {
-    if (!empty($context->form['form_id']) && !empty($context->form['attachments']['#access'])) {
-      // remove the fieldset
-      unset($context->form['attachments']['#type']);
-      $block->content = drupal_render($context->form['attachments']);
+    if (isset($context->form['attachments'])) {
+      $block->content = $context->form['attachments'];
+      if (isset($block->content['attachments']['#group'])) {
+        unset($block->content['attachments']['#pre_render']);
+        unset($block->content['attachments']['#theme_wrappers']);
+        $block->content['attachments']['#type'] = '';
+      }
+      // Set access to false on the original rather than removing so that
+      // vertical tabs doesn't clone it. I think this is due to references.
+      $context->form['attachments']['#access'] = FALSE;
     }
   }
   else {
diff --git a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_author.inc b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_author.inc
index 507acd8719364f623db4d1752a2e228cd40b2a92..5cb6a344daeb44db50b2a21e0045f91ab39f8cdb 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_author.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_author.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_form_author.inc,v 1.4 2010/10/11 22:18:23 sdboyer Exp $
 
 /**
  * Plugins are described by creating a $plugin array which will be used
@@ -22,12 +21,19 @@ function ctools_node_form_author_content_type_render($subtype, $conf, $panel_arg
   $block->delta = 'author-options';
 
   if (isset($context->form)) {
-    if (!empty($context->form['form_id']) && !empty($context->form['author']['#access'])) {
-      // remove the fieldset
-      unset($context->form['author']['#type']);
-      $context->form['author']['name']['#size'] /= 2;
-      $context->form['author']['date']['#size'] /= 2;
-      $block->content = drupal_render($context->form['author']);
+    if (!empty($context->form['author'])) {
+      $block->content['author'] = $context->form['author'];
+      if (isset($block->content['author']['#group'])) {
+        unset($block->content['author']['#pre_render']);
+        unset($block->content['author']['#theme_wrappers']);
+        $block->content['author']['#type'] = '';
+        $block->content['author']['name']['#size'] /= 2;
+        $block->content['author']['date']['#size'] /= 2;
+      }
+
+      // Set access to false on the original rather than removing so that
+      // vertical tabs doesn't clone it. I think this is due to references.
+      $context->form['author']['#access'] = FALSE;
     }
   }
   else {
diff --git a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_book.inc b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_book.inc
index f6c24cbbce2e330ee999ae0756fe7fecebb5dc93..ad19590f1701e254e41e53fb29babeffe5898250 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_book.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_book.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_form_book.inc,v 1.4 2010/10/11 22:18:23 sdboyer Exp $
 
 if (module_exists('book')) {
   /**
@@ -20,18 +19,19 @@ function ctools_node_form_book_content_type_render($subtype, $conf, $panel_args,
   $block = new stdClass();
   $block->module = t('node_form');
 
-  $block->title = t('Book options');
-  $block->delta = 'book-options';
+  $block->title = t('Book outline');
+  $block->delta = 'book-outline';
 
   if (isset($context->form)) {
-    if (!empty($context->form['form_id'])) {
-      $block->content = '';
-      if ($context->form['parent']['#type'] != 'value') {
-        $block->content .= drupal_render($context->form['parent']);
-      }
-      if ($context->form['weight']['#type'] != 'value') {
-        $block->content .= drupal_render($context->form['weight']);
-      }
+    if (isset($context->form['book'])) {
+      $block->content['book'] = $context->form['book'];
+      unset($block->content['book']['#pre_render']);
+      unset($block->content['book']['#theme_wrappers']);
+      $block->content['book']['#type'] = '';
+
+      // Set access to false on the original rather than removing so that
+      // vertical tabs doesn't clone it. I think this is due to references.
+      $context->form['book']['#access'] = FALSE;
     }
   }
   else {
diff --git a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_buttons.inc b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_buttons.inc
index 78bb9965ff823507c4939b76956b1c91bbb6b5af..a7817a074be0705014791b2337b4f71ddb865a7c 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_buttons.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_buttons.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_form_buttons.inc,v 1.4 2010/10/11 22:18:23 sdboyer Exp $
 
 /**
  * Plugins are described by creating a $plugin array which will be used
@@ -22,10 +21,11 @@ function ctools_node_form_buttons_content_type_render($subtype, $conf, $panel_ar
   $block->delta = 'buttons';
 
   if (isset($context->form)) {
-    $block->content = drupal_render($context->form['buttons']);
-    $block->content .= drupal_render($context->form['form_token']);
-    $block->content .= drupal_render($context->form['form_build_id']);
-    $block->content .= drupal_render($context->form['form_id']);
+    $block->content = array();
+    foreach (array('actions', 'form_token', 'form_build_id', 'form_id') as $element) {
+      $block->content[$element] = $context->form[$element];
+      unset($context->form[$element]);
+    }
   }
   else {
     $block->content = t('Node form buttons.');
diff --git a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_comment.inc b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_comment.inc
index 0b3e1cbadc4fbf57455840f98c7fdf8b6abe0ce2..d0f137ae7a08fa45a792ae2227b78a3afd68d6cb 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_comment.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_comment.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_form_comment.inc,v 1.4 2010/10/11 22:18:23 sdboyer Exp $
 
 if (module_exists('comment')) {
   /**
@@ -24,10 +23,15 @@ function ctools_node_form_comment_content_type_render($subtype, $conf, $panel_ar
   $block->delta = 'comment-options';
 
   if (isset($context->form)) {
-    if (!empty($context->form['form_id']) && !empty($context->form['comment_settings']['#access'])) {
-      // remove the fieldset
-      unset($context->form['comment_settings']['#type']);
-      $block->content = drupal_render($context->form['comment_settings']);
+    if (isset($context->form['comment_settings'])) {
+      $block->content['comment_settings'] = $context->form['comment_settings'];
+      unset($block->content['comment_settings']['#pre_render']);
+      unset($block->content['comment_settings']['#theme_wrappers']);
+      $block->content['comment_settings']['#type'] = '';
+
+      // Set access to false on the original rather than removing so that
+      // vertical tabs doesn't clone it. I think this is due to references.
+      $context->form['comment_settings']['#access'] = FALSE;
     }
   }
   else {
diff --git a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_log.inc b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_log.inc
index 0dfe7402dd256f67265b725f730cf989d10176c0..334ff54004fbc73a6afe888ab5911aad20bcd65b 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_log.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_log.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_form_log.inc,v 1.3 2010/10/11 22:18:23 sdboyer Exp $
 
 /**
  * Plugins are described by creating a $plugin array which will be used
@@ -17,8 +16,23 @@ $plugin = array(
 function ctools_node_form_log_content_type_render($subtype, $conf, $panel_args, &$context) {
   $block = new stdClass();
   $block->module = t('node_form');
+  $block->title = t('Revision information');
 
-  // @todo -- this was never implemented!?
+  if (isset($context->form)) {
+    if (isset($context->form['revision_information'])) {
+      $block->content['revision_information'] = $context->form['revision_information'];
+      unset($block->content['revision_information']['#pre_render']);
+      unset($block->content['revision_information']['#theme_wrappers']);
+      $block->content['revision_information']['#type'] = '';
+
+      // Set access to false on the original rather than removing so that
+      // vertical tabs doesn't clone it. I think this is due to references.
+      $context->form['revision_information']['#access'] = FALSE;
+    }
+  }
+  else {
+    $block->content = t('Revision information.');
+  }
 
   return $block;
 }
diff --git a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_menu.inc b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_menu.inc
index d5ef59d58b44a4015fe678f39818b9558f7c8ae9..906ade4d7d475896643ee607156bbe8fa9777ec2 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_menu.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_menu.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_form_menu.inc,v 1.4 2010/10/11 22:18:23 sdboyer Exp $
 
 if (module_exists('menu')) {
   /**
@@ -24,11 +23,15 @@ function ctools_node_form_menu_content_type_render($subtype, $conf, $panel_args,
   $block->delta = 'menu-options';
 
   if (isset($context->form)) {
-    if (!empty($context->form['form_id']) && !empty($context->form['menu']['#access'])) {
-      // remove the fieldset
-      unset($context->form['menu']['#type']);
-      $context->form['menu']['link_title']['#size'] /= 2;
-      $block->content = drupal_render($context->form['menu']);
+    if (isset($context->form['menu'])) {
+      $block->content['menu'] = $context->form['menu'];
+      unset($block->content['menu']['#pre_render']);
+      unset($block->content['menu']['#theme_wrappers']);
+      $block->content['menu']['#type'] = '';
+
+      // Set access to false on the original rather than removing so that
+      // vertical tabs doesn't clone it. I think this is due to references.
+      $context->form['menu']['#access'] = FALSE;
     }
   }
   else {
diff --git a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_path.inc b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_path.inc
index f47e997348fb1022e0cd9b48638e6070d08b2fbe..00759007ed8d737f85d5bf301dea89742909e7a7 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_path.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_path.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_form_path.inc,v 1.4 2010/10/11 22:18:23 sdboyer Exp $
 
 if (module_exists('path')) {
   /**
@@ -24,11 +23,16 @@ function ctools_node_form_path_content_type_render($subtype, $conf, $panel_args,
   $block->delta = 'url-path-options';
 
   if (isset($context->form)) {
-    if (!empty($context->form['form_id']) && !empty($context->form['path']['#access'])) {
-      // remove the fieldset
-      unset($context->form['path']['#type']);
-      $context->form['path']['path']['#size'] /= 2;
-      $block->content = drupal_render($context->form['path']);
+    if (isset($context->form['path'])) {
+      $block->content['path'] = $context->form['path'];
+      unset($block->content['path']['#pre_render']);
+      unset($block->content['path']['#theme_wrappers']);
+      $block->content['path']['#type'] = '';
+      $block->content['path']['path']['#size'] /= 2;
+
+      // Set access to false on the original rather than removing so that
+      // vertical tabs doesn't clone it. I think this is due to references.
+      $context->form['path']['#access'] = FALSE;
     }
   }
   else {
diff --git a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_publishing.inc b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_publishing.inc
index a45160f2959fef186684e16c132f80bb24144ce8..3f3cf25d3ca9c5a89944b300ee062e42d9310467 100644
--- a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_publishing.inc
+++ b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_publishing.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_form_publishing.inc,v 1.4 2010/10/11 22:18:23 sdboyer Exp $
 
 /**
  * @file
@@ -28,10 +27,15 @@ function ctools_node_form_publishing_content_type_render($subtype, $conf, $panel
   $block->delta = 'publishing-options';
 
   if (isset($context->form)) {
-    if (!empty($context->form['form_id']) && $context->form['options']['#type'] == 'fieldset') {
-      // remove the fieldset
-      unset($context->form['options']['#type']);
-      $block->content = drupal_render($context->form['options']);
+    if (isset($context->form['options'])) {
+      $block->content['options'] = $context->form['options'];
+      unset($block->content['options']['#pre_render']);
+      unset($block->content['options']['#theme_wrappers']);
+      $block->content['options']['#type'] = '';
+
+      // Set access to false on the original rather than removing so that
+      // vertical tabs doesn't clone it. I think this is due to references.
+      $context->form['options']['#access'] = FALSE;
     }
   }
   else {
diff --git a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_title.inc b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_title.inc
new file mode 100644
index 0000000000000000000000000000000000000000..f40d274dec52ec83fac948a27e0585f68676e83a
--- /dev/null
+++ b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_title.inc
@@ -0,0 +1,41 @@
+<?php
+
+/**
+ * Plugins are described by creating a $plugin array which will be used
+ * by the system that includes this file.
+ */
+$plugin = array(
+  'single' => TRUE,
+  'icon' => 'icon_node_form.png',
+  'title' => t('Node form title field'),
+  'description' => t('The node title form.'),
+  'required context' => new ctools_context_required(t('Form'), 'node_form'),
+  'category' => t('Form'),
+);
+
+function ctools_node_form_title_content_type_render($subtype, $conf, $panel_args, &$context) {
+  $block = new stdClass();
+  $block->module = t('node_form');
+
+  $block->delta = 'title-options';
+
+  if (isset($context->form)) {
+    if (!empty($context->form['title'])) {
+      $block->content['title'] = $context->form['title'];
+      unset($context->form['title']);
+    }
+  }
+  else {
+    $block->content = t('Node title form.');
+  }
+  return $block;
+}
+
+function ctools_node_form_title_content_type_admin_title($subtype, $conf, $context) {
+  return t('"@s" node form title field', array('@s' => $context->identifier));
+}
+
+function ctools_node_form_title_content_type_edit_form($form, &$form_state) {
+  // provide a blank form so we have a place to have context setting.
+  return $form;
+}
diff --git a/sites/all/modules/ctools/plugins/content_types/page/page_breadcrumb.inc b/sites/all/modules/ctools/plugins/content_types/page/page_breadcrumb.inc
index 56dabd052baa1a7cb3edadd23c998ab7921ca2aa..f5a060eff38e5cfb5b8c9acce23b0c6278dc9c28 100644
--- a/sites/all/modules/ctools/plugins/content_types/page/page_breadcrumb.inc
+++ b/sites/all/modules/ctools/plugins/content_types/page/page_breadcrumb.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: page_breadcrumb.inc,v 1.4 2010/12/31 21:20:57 merlinofchaos Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/content_types/page/page_feed_icons.inc b/sites/all/modules/ctools/plugins/content_types/page/page_feed_icons.inc
index e7a38018e59b82638563998c71b41fdde9261bf7..0dba317d856c87e7df299679df8e7decfd47aac4 100644
--- a/sites/all/modules/ctools/plugins/content_types/page/page_feed_icons.inc
+++ b/sites/all/modules/ctools/plugins/content_types/page/page_feed_icons.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: page_feed_icons.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/content_types/page/page_help.inc b/sites/all/modules/ctools/plugins/content_types/page/page_help.inc
index a813301f7ecdac73b7b86c1d6e34c2d03ee968c0..da1abe69f5fb5e8967cf49123f2c9067311b1252 100644
--- a/sites/all/modules/ctools/plugins/content_types/page/page_help.inc
+++ b/sites/all/modules/ctools/plugins/content_types/page/page_help.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: page_help.inc,v 1.3 2010/09/07 09:02:51 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/content_types/page/page_logo.inc b/sites/all/modules/ctools/plugins/content_types/page/page_logo.inc
index 589c989e153890982bfa7992443808bb94d56127..c00ca5e888ba6869d8e17c6620a53a41ed820270 100644
--- a/sites/all/modules/ctools/plugins/content_types/page/page_logo.inc
+++ b/sites/all/modules/ctools/plugins/content_types/page/page_logo.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: page_logo.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
@@ -27,8 +26,9 @@ $plugin = array(
  */
 function ctools_page_logo_content_type_render($subtype, $conf, $panel_args) {
   $logo = theme_get_setting('logo');
+  $block = new stdClass();
+
   if (!empty($logo)) {
-    $block = new stdClass();
     $image = '<img src="' . $logo . '" alt="' . t('Home') . '" />';
     $block->content = l($image, '', array('html' => TRUE, 'attributes' => array('rel' => 'home', 'id' => 'logo', 'title' => t('Home'))));
   }
diff --git a/sites/all/modules/ctools/plugins/content_types/page/page_messages.inc b/sites/all/modules/ctools/plugins/content_types/page/page_messages.inc
index e9bbfee2d31215281e79a06a5e6899bb6b7958c0..e2fe37b3574d67dc0e9d6adfe9d238ae5b0357a6 100644
--- a/sites/all/modules/ctools/plugins/content_types/page/page_messages.inc
+++ b/sites/all/modules/ctools/plugins/content_types/page/page_messages.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: page_messages.inc,v 1.3 2010/09/07 09:02:51 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/content_types/page/page_primary_links.inc b/sites/all/modules/ctools/plugins/content_types/page/page_primary_links.inc
index 6b0bc9d15cda7d21562db192e517212a9be87f26..54fb97c94b13d3fb6bfe204da4d79f2f119d5538 100644
--- a/sites/all/modules/ctools/plugins/content_types/page/page_primary_links.inc
+++ b/sites/all/modules/ctools/plugins/content_types/page/page_primary_links.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: page_primary_links.inc,v 1.3 2010/12/31 21:21:39 merlinofchaos Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/content_types/page/page_secondary_links.inc b/sites/all/modules/ctools/plugins/content_types/page/page_secondary_links.inc
index 548c82d540cc7307acd7534c27e97f50f32baf7d..3d13b1e3be566955ceb5cf117d1814354104aa64 100644
--- a/sites/all/modules/ctools/plugins/content_types/page/page_secondary_links.inc
+++ b/sites/all/modules/ctools/plugins/content_types/page/page_secondary_links.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: page_secondary_links.inc,v 1.3 2010/12/31 21:22:26 merlinofchaos Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/content_types/page/page_site_name.inc b/sites/all/modules/ctools/plugins/content_types/page/page_site_name.inc
index 306b0f6f2dd8b860d02c737eb4c592bf2e92fc9b..99501f2c1f9ef46799a55870cc7aca756d41aec3 100644
--- a/sites/all/modules/ctools/plugins/content_types/page/page_site_name.inc
+++ b/sites/all/modules/ctools/plugins/content_types/page/page_site_name.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: page_site_name.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/content_types/page/page_slogan.inc b/sites/all/modules/ctools/plugins/content_types/page/page_slogan.inc
index e46a99037cc132548c422a8b3c0b86f6119794f2..58f913f6017ac8d52b5c191b75af77a748b24f6f 100644
--- a/sites/all/modules/ctools/plugins/content_types/page/page_slogan.inc
+++ b/sites/all/modules/ctools/plugins/content_types/page/page_slogan.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: page_slogan.inc,v 1.3 2010/09/07 09:02:51 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/content_types/page/page_tabs.inc b/sites/all/modules/ctools/plugins/content_types/page/page_tabs.inc
index 042520fb4282e965ec38fb9e3e0659863114d812..62a264374182e41a347f295629e3c9a2f332f9aa 100644
--- a/sites/all/modules/ctools/plugins/content_types/page/page_tabs.inc
+++ b/sites/all/modules/ctools/plugins/content_types/page/page_tabs.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: page_tabs.inc,v 1.4 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
@@ -31,7 +30,21 @@ $plugin = array(
  */
 function ctools_page_tabs_content_type_render($subtype, $conf, $panel_args) {
   $block = new stdClass();
-  $block->content = theme('menu_local_tasks');
+  $menus = menu_local_tabs();
+  switch ($conf['type']) {
+    case 'primary':
+      unset($menus['#secondary']);
+      break;
+    case 'secondary':
+      unset($menus['#primary']);
+      break;
+  }
+  if ($conf['id']) {
+    $menus['#theme_wrappers'][] = 'container';
+    $menus['#attributes']['id'] = $conf['id'];
+  }
+
+  $block->content = $menus;
 
   return $block;
 }
diff --git a/sites/all/modules/ctools/plugins/content_types/page/page_title.inc b/sites/all/modules/ctools/plugins/content_types/page/page_title.inc
index 4fa21009ca62b5909b70ad7e1ad7177360b05740..e3032dfbee69e0c9adbbe9785999be7cf5ef7e2c 100644
--- a/sites/all/modules/ctools/plugins/content_types/page/page_title.inc
+++ b/sites/all/modules/ctools/plugins/content_types/page/page_title.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: page_title.inc,v 1.4 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/content_types/search/search_form.inc b/sites/all/modules/ctools/plugins/content_types/search/search_form.inc
index 4e1364656f4e27fde5dcbe6dfb6fe0efff21e55f..2b6a322b1e647ef179ff1eea50a2cd2f095f6268 100644
--- a/sites/all/modules/ctools/plugins/content_types/search/search_form.inc
+++ b/sites/all/modules/ctools/plugins/content_types/search/search_form.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: search_form.inc,v 1.5 2010/12/31 21:24:40 merlinofchaos Exp $
 
 if (module_exists('search')) {
   /**
@@ -58,7 +57,6 @@ function ctools_search_form_content_type_render($subtype, $conf, $panel_args, $c
   $prompt = $conf['override_prompt'] ? $conf['prompt'] : NULL;
 
   $form_state = array(
-    'no_redirect' => TRUE,
     'build_info' => array(
       'args' => array($path, $keys, $conf['type'], $prompt),
     ),
@@ -66,13 +64,9 @@ function ctools_search_form_content_type_render($subtype, $conf, $panel_args, $c
 
   module_load_include('inc', 'search', 'search.pages');
 
-  $form_id = $conf['form'] == 'simple' ? 'ctools_search_form' : 'search_form';
-  $block->content = drupal_build_form($form_id, $form_state);
-
-  // We do the redirect manually because the built in search form is stupid
-  // and won't redirect even though action is a valid argument for it.
-  if (empty($block->content)) {
-    drupal_goto($path . '/' . $form_state['values']['processed_keys']);
+  $block->content = drupal_build_form('search_form', $form_state);
+  if ($conf['form'] == 'simple' && isset($block->content['advanced'])) {
+    $block->content['advanced']['#access'] = FALSE;
   }
 
   return $block;
@@ -85,8 +79,8 @@ function ctools_search_form_content_type_edit_form($form, &$form_state) {
   $conf = $form_state['conf'];
 
   $types = array();
-  foreach (module_implements('search') as $name) {
-    $types[$name] = module_invoke($name, 'search', 'name', TRUE);
+  foreach (search_get_info() as $module => $info) {
+    $types[$module] = $info['title'];
   }
 
   $form['type'] = array(
@@ -122,7 +116,6 @@ function ctools_search_form_content_type_edit_form($form, &$form_state) {
   $form['path'] = array(
     '#type' => 'textfield',
     '#default_value' => $conf['path'],
-    '#process' => array('ctools_dependent_process'),
     '#dependency' => array('edit-path-type' => array('custom')),
     '#suffix' => '</div>',
   );
@@ -137,7 +130,6 @@ function ctools_search_form_content_type_edit_form($form, &$form_state) {
   $form['prompt'] = array(
     '#type' => 'textfield',
     '#default_value' => $conf['prompt'],
-    '#process' => array('ctools_dependent_process'),
     '#dependency' => array('edit-override-prompt' => array(1)),
     '#suffix' => '</div>',
   );
@@ -158,14 +150,7 @@ function ctools_search_form_content_type_edit_form_submit($form, &$form_state) {
  * Returns the administrative title for a type.
  */
 function ctools_search_form_content_type_admin_title($subtype, $conf, $context) {
-  $type = module_invoke($conf['type'], 'search', 'name', TRUE);
+  $info = search_get_info();
+  $type = isset($info[$conf['type']]['title']) ? $info[$conf['type']]['title'] : t('Missing/broken type');
   return t('@type search form', array('@type' => $type));
 }
-
-/**
- * Form alter the submit/validate onto our customized search form.
- */
-function ctools_form_ctools_search_form_alter(&$form, &$form_state) {
-  $form['#validate'] = array('search_form_validate');
-  $form['#submit'] = array('search_form_submit');
-}
diff --git a/sites/all/modules/ctools/plugins/content_types/search/search_result.inc b/sites/all/modules/ctools/plugins/content_types/search/search_result.inc
index 02684ea9c50f6802488a3cf5e046dfbd8760dcb3..44cfbac5e73c75c5f939413daf143912a7903b79 100644
--- a/sites/all/modules/ctools/plugins/content_types/search/search_result.inc
+++ b/sites/all/modules/ctools/plugins/content_types/search/search_result.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: search_result.inc,v 1.7 2010/10/11 22:18:24 sdboyer Exp $
 
 if (module_exists('search')) {
   /**
@@ -32,8 +31,25 @@ if (module_exists('search')) {
  * Render the custom content type.
  */
 function ctools_search_result_content_type_render($subtype, $conf, $panel_args, $context) {
+  $search_info = search_get_info();
+  if (empty($search_info[$conf['type']])) {
+    return;
+  }
+  $info = $search_info[$conf['type']];
+
+  $keys = NULL;
+  if (!empty($context) && isset($context->data)) {
+    $keys = $context->data;
+  }
+
+  $conditions =  NULL;
+  if (isset($info['conditions_callback']) && function_exists($info['conditions_callback'])) {
+    // Build an optional array of more search conditions.
+    $conditions = $info['conditions_callback']($keys);
+  }
+
   // Display nothing at all if no keywords were entered.
-  if (empty($context) || empty($context->data)) {
+  if (empty($keys) && empty($conditions)) {
     if (!empty($conf['override_no_key'])) {
       $block->title = $conf['no_key_title'];
       $block->content = check_markup($conf['no_key'], $conf['no_key_format'], FALSE);
@@ -42,8 +58,6 @@ function ctools_search_result_content_type_render($subtype, $conf, $panel_args,
     return;
   }
 
-  $keys = $context->data;
-
   // Build the content type block.
   $block = new stdClass();
   $block->module  = 'search';
@@ -51,20 +65,31 @@ function ctools_search_result_content_type_render($subtype, $conf, $panel_args,
 
   $results = '';
 
-  // Need settings for:
-  // $no result override
+    // Only search if there are keywords or non-empty conditions.
+    if ($keys || !empty($conditions)) {
+
+      // Collect the search results.
+      $results = search_data($keys, $info['module'], $conditions);
+    }
 
   if (!empty($conf['log'])) {
     // Log the search keys:
-    watchdog('search', '%keys (@type).', array('%keys' => $keys, '@type' => module_invoke($conf['type'], 'search', 'name')), WATCHDOG_NOTICE, l(t('results'), $_GET['q']));
+    watchdog('search', 'Searched %type for %keys.', array('%keys' => $keys, '%type' => $info['title']), WATCHDOG_NOTICE, l(t('results'), $_GET['q']));
   }
 
   // Collect the search results:
-  $results = search_data($keys, $conf['type']);
+  $results = search_data($keys, $conf['type'], $conditions);
+
+  if (!empty($results['#results'])) {
+    $output = "<ol class=\"search-results $conf[type]-results\">\n";
+    foreach ($results['#results'] as $result) {
+      $output .= theme('search_result', array('result' => $result, 'module' => $conf['type']));
+    }
+    $output .= "</ol>\n";
+    $output .= theme('pager', array('tags' => NULL));
 
-  if ($results) {
     $block->title = t('Search results');
-    $block->content = $results;
+    $block->content = $output;
   }
   else {
     if (empty($conf['override_empty'])) {
@@ -86,12 +111,9 @@ function ctools_search_result_content_type_render($subtype, $conf, $panel_args,
 function ctools_search_result_content_type_edit_form($form, &$form_state) {
   $conf = $form_state['conf'];
 
-  // Add js for collapsible fieldsets manually
-  drupal_add_js('misc/collapse.js');
-
   $types = array();
-  foreach (module_implements('search') as $name) {
-    $types[$name] = module_invoke($name, 'search', 'name', TRUE);
+  foreach (search_get_info() as $module => $info) {
+    $types[$module] = $info['title'];
   }
 
   $form['type'] = array(
@@ -113,74 +135,43 @@ function ctools_search_result_content_type_edit_form($form, &$form_state) {
     '#title' => t('Override "no result" text'),
   );
 
-  $form['empty_field']['empty_title'] = array(
+  $form['empty_title'] = array(
     '#title' => t('Title'),
     '#type' => 'textfield',
     '#default_value' => $conf['empty_title'],
-    '#process' => array('ctools_dependent_process'),
     '#dependency' => array('edit-override-empty' => array(1)),
   );
 
-  $form['empty_field']['empty'] = array(
+  $form['empty_field'] = array(
+    '#type' => 'text_format',
     '#title' => t('No result text'),
-    '#type' => 'textarea',
     '#default_value' => $conf['empty'],
-    '#process' => array('ctools_dependent_process'),
+    '#format' => $conf['empty_format'],
     '#dependency' => array('edit-override-empty' => array(1)),
   );
 
-  $form['empty_field']['format_prefix'] = array(
-    '#type' => 'hidden',
-    '#id' => 'edit-empty-format',
-    '#prefix' => '<div><fieldset id="edit-empty-format" class="collapsed collapsible"><legend>' . t('Input format') . '</legend>',
-    '#process' => array('ctools_dependent_process'),
-    '#dependency' => array('edit-override-empty' => array(1)),
-  );
-  // Yes, lots of gymnastics to make this fieldset work with dependencies.
-  $form['empty_field']['empty_format'] = filter_form($conf['empty_format'], NULL, array('empty_format'));
-  unset($form['empty_field']['empty_format']['#type']);
-
-  $form['empty_field']['format_suffix'] = array(
-    '#value' => '</fieldset></div>',
-  );
-
-
   $form['override_no_key'] = array(
     '#type' => 'checkbox',
     '#default_value' => $conf['override_no_key'],
     '#title' => t('Display text if no search keywords were submitted'),
   );
 
-  $form['no_key_field']['no_key_title'] = array(
+
+  $form['no_key_title'] = array(
     '#title' => t('Title'),
     '#type' => 'textfield',
     '#default_value' => $conf['no_key_title'],
-    '#process' => array('ctools_dependent_process'),
     '#dependency' => array('edit-override-no-key' => array(1)),
   );
 
-  $form['no_key_field']['no_key'] = array(
-    '#title' => t('No keywords text'),
-    '#type' => 'textarea',
+  $form['no_key_field'] = array(
+    '#type' => 'text_format',
+    '#title' => t('No result text'),
     '#default_value' => $conf['no_key'],
-    '#process' => array('ctools_dependent_process'),
-    '#dependency' => array('edit-override-no-key' => array(1)),
-  );
-
-  $form['no_key_field']['format_prefix'] = array(
-    '#type' => 'hidden',
-    '#id' => 'edit-no-key-format',
-    '#prefix' => '<div><fieldset id="edit-no-key-format" class="collapsed collapsible"><legend>' . t('Input format') . '</legend>',
-    '#process' => array('ctools_dependent_process'),
+    '#format' => $conf['no_key_format'],
     '#dependency' => array('edit-override-no-key' => array(1)),
   );
-  // Yes, lots of gymnastics to make this fieldset work with dependencies.
-  $form['no_key_field']['no_key_format'] = filter_form($conf['no_key_format'], NULL, array('no_key_format'));
-  unset($form['no_key_field']['no_key_format']['#type']);
 
-  $form['no_key_field']['format_suffix'] = array(
-    '#value' => '</fieldset></div>',
-  );
   return $form;
 }
 
@@ -188,6 +179,11 @@ function ctools_search_result_content_type_edit_form($form, &$form_state) {
  * Submit handler for search form.
  */
 function ctools_search_result_content_type_edit_form_submit($form, &$form_state) {
+  // Copy the text_format values over to where we normally store them.
+  $form_state['values']['empty'] = $form_state['values']['empty_field']['value'];
+  $form_state['values']['empty_format'] = $form_state['values']['empty_field']['format'];
+  $form_state['values']['no_key'] = $form_state['values']['no_key_field']['value'];
+  $form_state['values']['no_key_format'] = $form_state['values']['no_key_field']['format'];
   // Copy everything from our defaults.
   foreach (array_keys($form_state['plugin']['defaults']) as $key) {
     $form_state['conf'][$key] = $form_state['values'][$key];
@@ -198,6 +194,7 @@ function ctools_search_result_content_type_edit_form_submit($form, &$form_state)
  * Returns the administrative title for a type.
  */
 function ctools_search_result_content_type_admin_title($subtype, $conf, $context) {
-  $type = module_invoke($conf['type'], 'search', 'name', TRUE);
+  $info = search_get_info();
+  $type = isset($info[$conf['type']]['title']) ? $info[$conf['type']]['title'] : t('Missing/broken type');
   return t('@type search result', array('@type' => $type));
 }
diff --git a/sites/all/modules/ctools/plugins/content_types/term_context/term_description.inc b/sites/all/modules/ctools/plugins/content_types/term_context/term_description.inc
index d939c922a35df0c0c05ed03ab278baf42179e8c8..dc1d26f07d2f0e91e1dd9d7bd65f8095ecae0f28 100644
--- a/sites/all/modules/ctools/plugins/content_types/term_context/term_description.inc
+++ b/sites/all/modules/ctools/plugins/content_types/term_context/term_description.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: term_description.inc,v 1.4 2010/10/11 22:18:23 sdboyer Exp $
 
 /**
  * Plugins are described by creating a $plugin array which will be used
@@ -10,7 +9,7 @@ $plugin = array(
   'title' => t('Term description'),
   'icon' => 'icon_term.png',
   'description' => t('Term description.'),
-  'required context' => new ctools_context_required(t('Term'), 'term'),
+  'required context' => new ctools_context_required(t('Term'), array('term', 'taxonomy_term')),
   'category' => t('Taxonomy term'),
 );
 
diff --git a/sites/all/modules/ctools/plugins/content_types/term_context/term_list.inc b/sites/all/modules/ctools/plugins/content_types/term_context/term_list.inc
index 9fd2865b6e19e6c92396b6b54b7e32ef2cb19cdf..c5ea4a6bfa961a52c16f54d3188b60a4e6914c00 100644
--- a/sites/all/modules/ctools/plugins/content_types/term_context/term_list.inc
+++ b/sites/all/modules/ctools/plugins/content_types/term_context/term_list.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: term_list.inc,v 1.8 2010/10/11 22:18:23 sdboyer Exp $
 
 /**
  * Plugins are described by creating a $plugin array which will be used
@@ -10,19 +9,28 @@ $plugin = array(
   'title' => t('List of related terms'),
   'icon' => 'icon_term.png',
   'description' => t('Terms related to an existing term; may be child, siblings or top level.'),
-  'required context' => new ctools_context_required(t('Term'), 'term'),
+  'required context' => new ctools_context_required(t('Term'), array('term', 'taxonomy_term')),
   'category' => t('Taxonomy term'),
-  'defaults' => array('title' => '', 'type' => 'child', 'list_type' => 'ul'),
+  'defaults' => array('title' => '', 'type' => 'child', 'list_type' => 'ul', 'path' => 'taxonomy/term'),
 );
 
 function ctools_term_list_content_type_render($subtype, $conf, $panel_args, $context) {
   $term = isset($context->data) ? clone($context->data) : NULL;
   $block = new stdClass();
   $block->module = 'term-list';
+  $path = empty($conf['path']) ? 'taxonomy/term/%tid' : $conf['path'];
+  if (strpos($path, '%tid') === FALSE) {
+    if (substr($path, -1) != '/') {
+      $path .= '/';
+    }
+    $path .= '%tid';
+  }
 
   $options = ctools_admin_term_list_options();
+  $skip = array();
+
   if ($term) {
-    $block->subject = $options[$conf['type']];
+    $block->title = $options[$conf['type']];
     $block->delta = $conf['type'];
     switch ($conf['type']) {
       case 'related':
@@ -36,31 +44,40 @@ function ctools_term_list_content_type_render($subtype, $conf, $panel_args, $con
         break;
 
       case 'top':
-        $terms = taxonomy_get_children(0, $term->vid);
+        $terms = taxonomy_get_tree($term->vid, 0, 1);
+        break;
+
+      case 'parent':
+        $terms = taxonomy_get_parents($term->tid);
+        $block->title = format_plural(count($terms), 'Parent term', 'Parent terms');
         break;
 
       case 'sibling':
-        $parent = db_query('SELECT parent FROM {term_hierarchy} WHERE tid = :tid', array(':tid' => $term->tid))->fetchField();
-        $terms = taxonomy_get_children($parent, $term->vid);
-        // Remove the term that started this.
-        unset($terms[$term->tid]);
+        $parent = db_query('SELECT parent FROM {taxonomy_term_hierarchy} WHERE tid = :tid', array(':tid' => $term->tid))->fetchField();
+        if ($parent) {
+          $terms = taxonomy_get_children($parent, $term->vid);
+        }
+        else {
+          $terms = taxonomy_get_tree($term->vid, 0, 1);
+        }
+
+        $skip[$term->tid] = $term->tid;
         break;
 
       case 'synonyms':
-        $terms = taxonomy_get_synonyms($term->tid);
+        // FIXME this no longer exists, must be done with Field API
+//        $terms = taxonomy_get_synonyms($term->tid);
         break;
     }
-    if ($terms) {
+
+    if (!empty($terms)) {
       foreach ($terms as $related) {
-        if (is_object($related)) {
-          $items[] = l($related->name, taxonomy_term_path($related), array('rel' => 'tag', 'title' => strip_tags($related->description)));
-        }
-        else {
-          $items[] = check_plain($related);
+        if (empty($skip[$related->tid])) {
+          $items[] = l($related->name, str_replace('%tid', $related->tid, $path), array('rel' => 'tag', 'title' => strip_tags($related->description)));
         }
       }
 
-      $block->content = theme('item_list', $items, NULL, $conf['list_type']);
+      $block->content = theme('item_list', array('items' => $items, 'type' => $conf['list_type']));
     }
   }
   else {
@@ -74,10 +91,11 @@ function ctools_term_list_content_type_render($subtype, $conf, $panel_args, $con
 function ctools_admin_term_list_options() {
   return array(
     'child' => t('Child terms'),
-    'related' => t('Related terms'),
+    'related' => t('Related terms (does not work in D7)'),
     'sibling' => t('Sibling terms'),
     'top' => t('Top level terms'),
-    'synonyms' => t('Term synonyms'),
+    'synonyms' => t('Term synonyms (does not work in D7)'),
+    'parent' => t('Parent term(s)'),
   );
 }
 
@@ -102,6 +120,13 @@ function ctools_term_list_content_type_edit_form($form, &$form_state) {
     '#options' => array('ul' => t('Unordered'), 'ol' => t('Ordered')),
     '#default_value' => $conf['list_type'],
   );
+
+  $form['path'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Path'),
+    '#default_value' => empty($conf['path']) ? 'taxonomy/term/%tid' : $conf['path'],
+    '#description' => t('The path to use for the terms. You may use %tid to place the term id as part of the path; if let off, it will be appended to the end.'),
+  );
   return $form;
 }
 
diff --git a/sites/all/modules/ctools/plugins/content_types/token/icon_token.png b/sites/all/modules/ctools/plugins/content_types/token/icon_token.png
new file mode 100644
index 0000000000000000000000000000000000000000..f0417cb6515aa7fb2856c90722b386ed99bfc501
Binary files /dev/null and b/sites/all/modules/ctools/plugins/content_types/token/icon_token.png differ
diff --git a/sites/all/modules/ctools/plugins/content_types/token/token.inc b/sites/all/modules/ctools/plugins/content_types/token/token.inc
new file mode 100644
index 0000000000000000000000000000000000000000..c43abd29c424a97151a2100f9b7116c5ef13f41a
--- /dev/null
+++ b/sites/all/modules/ctools/plugins/content_types/token/token.inc
@@ -0,0 +1,115 @@
+<?php
+
+/**
+ * @file
+ * Plugin automatically declare 'tokens' as plugins.
+ */
+
+/**
+ * Plugin decleration.
+ */
+$plugin = array(
+  'title' => t('Tokens'),
+  'content type' => 'ctools_token_content_type_content_type',
+  'defaults' => array('sanitize' => TRUE),
+);
+
+/**
+ * Just one subtype.
+ *
+ * Ordinarily this function is meant to get just one subtype. However, we are
+ * using it to deal with the fact that we have changed the subtype names. This
+ * lets us translate the name properly.
+ */
+function ctools_token_content_type_content_type($subtype) {
+  $types = ctools_token_content_type_content_types();
+  if (isset($types[$subtype])) {
+    return $types[$subtype];
+  }
+}
+
+/**
+ * Return all field content types available.
+ */
+function ctools_token_content_type_content_types() {
+  // This will hold all the properties.
+  $types = array();
+  $info = token_info();
+
+  foreach ($info['tokens'] as $entity_type => $tokens) {
+    foreach ($tokens as $name => $token) {
+      if (!empty($token['name'])) {
+        $token += array('description' => '');
+        $types[$entity_type . ':' . $name] = array(
+          'category' => t('@entity (tokens)', array('@entity' => ucfirst($entity_type))),
+          'icon' => 'icon_token.png',
+          'title' => $token['name'],
+          'description' => $token['description'],
+          'required context' => new ctools_context_required(t(ucfirst($entity_type)), $entity_type),
+        );
+      }
+    }
+  }
+
+  return $types;
+}
+
+/**
+* Render the custom content type.
+*/
+function ctools_token_content_type_render($subtype, $conf, $panel_args, $context) {
+  if (empty($context) || empty($context->data)) {
+    return FALSE;
+  }
+
+  $sanitize = $conf['sanitize'];
+
+  $entity = $context->data;
+  list($entity_type, $name) = explode(':', $subtype, 2);
+
+  $info = token_info();
+  $values = token_generate($entity_type, array($name => $name), array($entity_type => $entity), array('sanitize' => $sanitize));
+  if (!isset($values[$name])) {
+    return;
+  }
+
+  // Build the content type block.
+  $block = new stdClass();
+  $block->module  = 'ctools';
+  $block->title   = $info['tokens'][$entity_type][$name]['name'];
+  $block->content = $values[$name];
+  $block->delta   = str_replace('_', '-', $entity_type . '-' . $name);
+
+  return $block;
+}
+
+/**
+* Returns an edit form for custom type settings.
+*/
+function ctools_token_content_type_edit_form($form, &$form_state) {
+  $conf = $form_state['conf'];
+
+  $form['sanitize'] = array(
+    '#type' => 'checkbox',
+    '#default_value' => !empty($conf['sanitize']),
+    '#title' => t('Sanitize'),
+    '#description' => t('When enabled that output of the token will be stripped from dangerous HTML.'),
+  );
+
+  return $form;
+}
+
+/**
+ * Validate the node selection.
+ */
+function ctools_token_content_type_edit_form_submit($form, &$form_state) {
+  $form_state['conf']['sanitize'] = $form_state['values']['sanitize'];
+}
+
+
+/**
+* Returns the administrative title for a type.
+*/
+function ctools_token_content_type_admin_title($subtype, $conf, $context) {
+  return t('"@s" @name', array('@s' => $context->identifier, '@name' => $subtype));
+}
diff --git a/sites/all/modules/ctools/plugins/content_types/user_context/profile_fields.inc b/sites/all/modules/ctools/plugins/content_types/user_context/profile_fields.inc
index f820c329a1340e583754ad76e55fb75be4b5cc5e..2633fd3ed721a577065105cddb5597218afeeaa4 100644
--- a/sites/all/modules/ctools/plugins/content_types/user_context/profile_fields.inc
+++ b/sites/all/modules/ctools/plugins/content_types/user_context/profile_fields.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: profile_fields.inc,v 1.9 2010/10/18 18:00:48 merlinofchaos Exp $
 
 if (module_exists('profile') && !is_null(profile_user_categories())) {
   /**
diff --git a/sites/all/modules/ctools/plugins/content_types/user_context/profile_fields_pane.tpl.php b/sites/all/modules/ctools/plugins/content_types/user_context/profile_fields_pane.tpl.php
index 375fbe0dc463dddfd92360abb340767f3f14cfca..373681213aacea3506e5ca2ab2ebdf767d1e6b54 100644
--- a/sites/all/modules/ctools/plugins/content_types/user_context/profile_fields_pane.tpl.php
+++ b/sites/all/modules/ctools/plugins/content_types/user_context/profile_fields_pane.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: profile_fields_pane.tpl.php,v 1.1 2009/04/18 02:00:35 merlinofchaos Exp $
 /**
  * @file
  * Display profile fields.
diff --git a/sites/all/modules/ctools/plugins/content_types/user_context/user_picture.inc b/sites/all/modules/ctools/plugins/content_types/user_context/user_picture.inc
index 3115bbc5ad937b79cac57029f43cd28f1dbe076d..dbe42428e58c70064f995b217b1ad591ec91dca4 100644
--- a/sites/all/modules/ctools/plugins/content_types/user_context/user_picture.inc
+++ b/sites/all/modules/ctools/plugins/content_types/user_context/user_picture.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: user_picture.inc,v 1.6 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * Plugins are described by creating a $plugin array which will be used
@@ -15,7 +14,7 @@ $plugin = array(
 );
 
 function ctools_user_picture_content_type_render($subtype, $conf, $panel_args, $context) {
-  $account = isset($context->data) ? clone($context->data) : NULL;
+  $account = isset($context->data) ? clone($context->data) : FALSE;
   $block = new stdClass();
   $block->module = 'term-list';
 
@@ -24,7 +23,7 @@ function ctools_user_picture_content_type_render($subtype, $conf, $panel_args, $
   }
 
   $block->title = check_plain($account->name);
-  $block->content = theme('user_picture', $account);
+  $block->content = theme('user_picture', array('account' => $account));
 
   return $block;
 }
diff --git a/sites/all/modules/ctools/plugins/content_types/user_context/user_profile.inc b/sites/all/modules/ctools/plugins/content_types/user_context/user_profile.inc
index 33a6427ce4775e07b7c429cf24b02a78f8f1704d..e05c1c764722c89f8a147fc530d95d530f9e25fc 100644
--- a/sites/all/modules/ctools/plugins/content_types/user_context/user_profile.inc
+++ b/sites/all/modules/ctools/plugins/content_types/user_context/user_profile.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: user_profile.inc,v 1.11 2011/01/06 00:06:18 merlinofchaos Exp $
 
 /**
  * Plugins are described by creating a $plugin array which will be used
diff --git a/sites/all/modules/ctools/plugins/content_types/user_context/user_signature.inc b/sites/all/modules/ctools/plugins/content_types/user_context/user_signature.inc
index 840210171348c5c8a1f10b74f5d8e0355e84a20e..529b65587ca28cfac443c1912f62c67636f8f3fa 100644
--- a/sites/all/modules/ctools/plugins/content_types/user_context/user_signature.inc
+++ b/sites/all/modules/ctools/plugins/content_types/user_context/user_signature.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: user_signature.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * Plugins are described by creating a $plugin array which will be used
@@ -14,7 +13,7 @@ $plugin = array(
 );
 
 function ctools_user_signature_content_type_render($subtype, $conf, $panel_args, $context) {
-  $account = isset($context->data) ? drupal_clone($context->data) : NULL;
+  $account = isset($context->data) ? clone($context->data) : NULL;
   $block = new stdClass();
   $block->module = 'term-list';
 
diff --git a/sites/all/modules/ctools/plugins/content_types/vocabulary_context/vocabulary_terms.inc b/sites/all/modules/ctools/plugins/content_types/vocabulary_context/vocabulary_terms.inc
index 5e7f5485036664fdaf447e90d4c7fd84820faf88..6127ac1a8a58258d1dc430ed64b2308d7ae10377 100644
--- a/sites/all/modules/ctools/plugins/content_types/vocabulary_context/vocabulary_terms.inc
+++ b/sites/all/modules/ctools/plugins/content_types/vocabulary_context/vocabulary_terms.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: vocabulary_terms.inc,v 1.7 2010/10/11 22:18:23 sdboyer Exp $
 
 if (module_exists('taxonomy')) {
   /**
@@ -54,7 +53,7 @@ function _ctools_content_vocabulary_terms($vid, $max_depth, $depth = -1, $tid =
   $result = db_query('SELECT t.name, t.tid FROM {taxonomy_term_data} t INNER JOIN {taxonomy_term_hierarchy} h ON t.tid = h.tid WHERE t.vid = :vid AND h.parent = :parent ORDER BY t.weight ASC, t.name ASC', array(':vid' => $vid, ':parent' => $tid));
   foreach ($result as $term) {
     $return[] = array(
-      'data' => l($term->name, 'taxonomy/term/'. $term->tid),
+      'data' => l($term->name, 'taxonomy/term/' . $term->tid),
       'children' => _ctools_content_vocabulary_terms($vid, $max_depth, $depth, $term->tid),
     );
   }
diff --git a/sites/all/modules/ctools/plugins/contexts/entity.inc b/sites/all/modules/ctools/plugins/contexts/entity.inc
index 08a50f144f52a9d59d515d9ca238b48f0b518896..99bfb293aa983718fcbbda5134b10e00394d4d1d 100644
--- a/sites/all/modules/ctools/plugins/contexts/entity.inc
+++ b/sites/all/modules/ctools/plugins/contexts/entity.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: entity.inc,v 1.1 2011/01/05 20:34:46 merlinofchaos Exp $
 
 /**
  * @file
@@ -42,9 +41,11 @@ function ctools_context_entity_get_children($plugin, $parent) {
     $plugin['context name'] = $entity_type;
     $plugin['name'] = $parent . ':' . $entity_type;
     $plugin['description'] = t('Creates @entity context from an entity ID.', array('@entity' => $entity_type));
-    $plugins[$parent . ':' . $entity_type] = $plugin;
+    $plugin_id = $parent . ':' . $entity_type;
+    drupal_alter('ctools_entity_context', $plugin, $entity, $plugin_id);
+    $plugins[$plugin_id] = $plugin;
   }
-
+  drupal_alter('ctools_entity_contexts', $plugins);
   return $plugins;
 }
 
@@ -73,7 +74,7 @@ function ctools_context_create_entity($empty, $data = NULL, $conf = FALSE, $plug
   elseif (is_numeric($data)) {
     $id = $data;
     $data = entity_load($entity_type, array($id));
-    $data = $data[$id];
+    $data = !empty($data[$id]) ? $data[$id] : FALSE;
   }
 
   if (is_array($data)) {
@@ -98,32 +99,33 @@ function ctools_context_create_entity($empty, $data = NULL, $conf = FALSE, $plug
 
 function ctools_context_entity_settings_form($form, &$form_state) {
   $conf = &$form_state['conf'];
+  $plugin = &$form_state['plugin'];
 
   $form['entity'] = array(
-    '#title' => t('Enter the title or ID of a @entity entity', array('@entity' => $conf['keyword'])),
+    '#title' => t('Enter the title or ID of a @entity entity', array('@entity' => $plugin['keyword'])),
     '#type' => 'textfield',
     '#maxlength' => 512,
-    '#autocomplete_path' => 'ctools/autocomplete/' . $conf['keyword'],
+    '#autocomplete_path' => 'ctools/autocomplete/' . $plugin['keyword'],
     '#weight' => -10,
   );
 
   if (!empty($conf['id'])) {
-    $info = entity_load($conf['keyword'], array($conf['id']));
+    $info = entity_load($plugin['keyword'], array($conf['id']));
     $info = $info[$conf['id']];
     if ($info) {
-      $entity = entity_get_info($conf['keyword']);
-      $uri = entity_uri($conf['keyword'], $info);
+      $entity = entity_get_info($plugin['keyword']);
+      $uri = entity_uri($plugin['keyword'], $info);
       if (is_array($uri) && $entity['entity keys']['label']) {
-        $link = l(t("'%title' [%type id %id]", array('%title' => $info->{$entity['entity keys']['label']}, '%type' => $conf['keyword'], '%id' => $conf['id'])), $uri['path'], array('attributes' => array('target' => '_blank', 'title' => t('Open in new window')), 'html' => TRUE));
+        $link = l(t("'%title' [%type id %id]", array('%title' => $info->{$entity['entity keys']['label']}, '%type' => $plugin['keyword'], '%id' => $conf['id'])), $uri['path'], array('attributes' => array('target' => '_blank', 'title' => t('Open in new window')), 'html' => TRUE));
       }
       elseif (is_array($uri)) {
-        $link = l(t("[%type id %id]", array('%type' => $conf['keyword'], '%id' => $conf['id'])), $uri['path'], array('attributes' => array('target' => '_blank', 'title' => t('Open in new window')), 'html' => TRUE));
+        $link = l(t("[%type id %id]", array('%type' => $plugin['keyword'], '%id' => $conf['id'])), $uri['path'], array('attributes' => array('target' => '_blank', 'title' => t('Open in new window')), 'html' => TRUE));
       }
       elseif ($entity['entity keys']['label']) {
-        $link = l(t("'%title' [%type id %id]", array('%title' => $info->{$entity['entity keys']['label']}, '%type' => $conf['keyword'], '%id' => $conf['id'])), file_create_url($uri), array('attributes' => array('target' => '_blank', 'title' => t('Open in new window')), 'html' => TRUE));
+        $link = l(t("'%title' [%type id %id]", array('%title' => $info->{$entity['entity keys']['label']}, '%type' => $plugin['keyword'], '%id' => $conf['id'])), file_create_url($uri), array('attributes' => array('target' => '_blank', 'title' => t('Open in new window')), 'html' => TRUE));
       }
       else {
-        $link = t("[%type id %id]", array('%type' => $conf['keyword'], '%id' => $conf['id']));
+        $link = t("[%type id %id]", array('%type' => $plugin['keyword'], '%id' => $conf['id']));
       }
       $form['entity']['#description'] = t('Currently set to !link', array('!link' => $link));
     }
@@ -136,7 +138,7 @@ function ctools_context_entity_settings_form($form, &$form_state) {
 
   $form['entity_type'] = array(
     '#type' => 'value',
-    '#value' => $conf['keyword'],
+    '#value' => $plugin['keyword'],
   );
 
   $form['set_identifier'] = array(
@@ -220,6 +222,13 @@ function ctools_context_entity_convert_list($plugin) {
   else {
     $token = $plugin['context name'];
   }
+
+  // Hack: we need either token.module or a core fix for this to work right,
+  // until then, we just muscle it.
+  if ($token == 'taxonomy_term') {
+    $token = 'term';
+  }
+
   $tokens = token_info();
   if (isset($tokens['tokens'][$token])) {
     foreach ($tokens['tokens'][$token] as $id => $info) {
@@ -237,13 +246,22 @@ function ctools_context_entity_convert_list($plugin) {
 function ctools_context_entity_convert($context, $type) {
   $entity_type = $context->type[2];
   $entity = entity_get_info($entity_type);
+
   if (isset($entity['token type'])) {
     $token = $entity['token type'];
   }
   else {
     $token = $entity_type;
   }
+
+  // Hack: we need either token.module or a core fix for this to work right,
+  // until then, we just muscle it.
+  if ($token == 'taxonomy_term') {
+    $token = 'term';
+  }
+
   $tokens = token_info();
+
   if (isset($tokens['tokens'][$token][$type])) {
     $values = token_generate($token, array($type => $type), array($token => $context->data));
     if (isset($values[$type])) {
diff --git a/sites/all/modules/ctools/plugins/contexts/node.inc b/sites/all/modules/ctools/plugins/contexts/node.inc
index 28389cd397a899acf11b1ae05cf2782debf86325..cd6d8c65e74464f46b094f8c8fead654f6977f3e 100644
--- a/sites/all/modules/ctools/plugins/contexts/node.inc
+++ b/sites/all/modules/ctools/plugins/contexts/node.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node.inc,v 1.19 2010/10/26 23:40:43 merlinofchaos Exp $
 
 /**
  * @file
@@ -26,6 +25,9 @@ $plugin = array(
     '#type' => 'textfield',
     '#description' => t('Enter the node ID of a node for this context.'),
   ),
+  // This context is deprecated and should not be usable in the UI.
+  'no ui' => TRUE,
+  'no required context ui' => TRUE,
 );
 
 /**
@@ -115,19 +117,19 @@ function ctools_context_node_settings_form_validate($form, &$form_state) {
 
   $nid          = $form_state['values']['node'];
   $preg_matches = array();
-  $match        = preg_match('/\[nid: (\d+)\]/', $nid, $preg_matches);
+  $match        = preg_match('/\[id: (\d+)\]/', $nid, $preg_matches);
   if (!$match) {
-    $match = preg_match('/^nid: (\d+)/', $nid, $preg_matches);
+    $match = preg_match('/^id: (\d+)/', $nid, $preg_matches);
   }
 
   if ($match) {
     $nid = $preg_matches[1];
   }
   if (is_numeric($nid)) {
-    $node = db_query('SELECT nid FROM {node} WHERE nid = :nid', array(':nid' => $nid))->fetchObject();
+    $node = db_query('SELECT nid, status FROM {node} WHERE nid = :nid', array(':nid' => $nid))->fetchObject();
   }
   else {
-    $node = db_query('SELECT nid FROM {node} WHERE LOWER(title) = LOWER(:title)', array(':title' => $nid))->fetchObject();
+    $node = db_query('SELECT nid, status FROM {node} WHERE LOWER(title) = LOWER(:title)', array(':title' => $nid))->fetchObject();
   }
 
   // Do not allow unpublished nodes to be selected by unprivileged users
@@ -136,7 +138,6 @@ function ctools_context_node_settings_form_validate($form, &$form_state) {
   }
   else {
     form_set_value($form['nid'], $node->nid, $form_state);
-    // $form_state['values']['nid'] = $node->nid;
   }
 }
 
diff --git a/sites/all/modules/ctools/plugins/contexts/node_add_form.inc b/sites/all/modules/ctools/plugins/contexts/node_add_form.inc
index 139f57456d1bdeae36da5a62078a0dbadefb9fd4..55219330a9699e7e86c390db7275792c3c5b3938 100644
--- a/sites/all/modules/ctools/plugins/contexts/node_add_form.inc
+++ b/sites/all/modules/ctools/plugins/contexts/node_add_form.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_add_form.inc,v 1.14 2010/10/11 22:18:23 sdboyer Exp $
 
 /**
  * @file
@@ -47,7 +46,7 @@ function ctools_context_create_node_add_form($empty, $data = NULL, $conf = FALSE
   }
 
   if (!empty($data)) {
-    $types = node_get_types();
+    $types = node_type_get_types();
     $type = str_replace('-', '_', $data);
 
     // Validate the node type exists.
@@ -64,7 +63,7 @@ function ctools_context_create_node_add_form($empty, $data = NULL, $conf = FALSE
       include_once './' . $file;
       // This piece of information can let other modules know that more files
       // need to be included if this form is loaded from cache:
-      $form_state['form_load_files'] = array($file);
+      $form_state['build_info']['files'] = array($file);
 
       $form = drupal_build_form($form_id, $form_state);
       // In a form, $data is the object being edited.
@@ -79,6 +78,7 @@ function ctools_context_create_node_add_form($empty, $data = NULL, $conf = FALSE
       $context->form_title = t('Submit @name', array('@name' => $types[$type]->name));
       $context->node_type  = $type;
       $context->restrictions['type'] = array($type);
+      $context->restrictions['form'] = array('form');
       return $context;
     }
   }
@@ -87,15 +87,10 @@ function ctools_context_create_node_add_form($empty, $data = NULL, $conf = FALSE
 function ctools_context_node_add_form_settings_form($form, &$form_state) {
   $conf = $form_state['conf'];
 
-  foreach (node_get_types() as $type => $info) {
-    $options[$type] = $info->name;
-  }
-  asort($options);
-
   $form['type'] = array(
     '#title' => t('Node type'),
     '#type' => 'select',
-    '#options' => $options,
+    '#options' => node_type_get_names(),
     '#default_value' => $conf['type'],
     '#description' => t('Select the node type for this form.'),
   );
diff --git a/sites/all/modules/ctools/plugins/contexts/node_edit_form.inc b/sites/all/modules/ctools/plugins/contexts/node_edit_form.inc
index b613dac70f19dbc51b33c5aa66cfe2ff6b2d8ac2..a7b04523a37ae1fdbc1191d324181242ebdbab8a 100644
--- a/sites/all/modules/ctools/plugins/contexts/node_edit_form.inc
+++ b/sites/all/modules/ctools/plugins/contexts/node_edit_form.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_edit_form.inc,v 1.18 2010/10/11 22:18:23 sdboyer Exp $
 
 /**
  * @file
@@ -66,27 +65,28 @@ function ctools_context_create_node_edit_form($empty, $node = NULL, $conf = FALS
     require_once DRUPAL_ROOT . '/' . $file;
     // This piece of information can let other modules know that more files
     // need to be included if this form is loaded from cache:
-    $form_state['form_load_files'] = array($file);
+    $form_state['build_info']['files'] = array($file);
 
     $form = drupal_build_form($form_id, $form_state);
 
     // Fill in the 'node' portion of the context
     $context->data     = $node;
-    $context->title    = $node->title;
+    $context->title    = isset($node->title) ? $node->title : '';
     $context->argument = isset($node->nid) ? $node->nid : $node->type;
 
     $context->form       = $form;
     $context->form_state = &$form_state;
     $context->form_id    = $form_id;
-    $context->form_title = $node->title;
+    $context->form_title = isset($node->title) ? $node->title : '';
     $context->node_type  = $node->type;
     $context->restrictions['type'] = array($node->type);
+    $context->restrictions['form'] = array('form');
     return $context;
   }
 }
 
 function ctools_context_node_edit_form_settings_form($form, &$form_state) {
-  $conf = $form_state['conf'];
+  $conf = &$form_state['conf'];
 
   $form['node'] = array(
     '#title' => t('Enter the title or NID of a node'),
@@ -104,6 +104,11 @@ function ctools_context_node_edit_form_settings_form($form, &$form_state) {
     }
   }
 
+  $form['nid'] = array(
+    '#type' => 'value',
+    '#value' => $conf['nid'],
+  );
+
   $form['set_identifier'] = array(
     '#type' => 'checkbox',
     '#default_value' => FALSE,
@@ -130,27 +135,27 @@ function ctools_context_node_edit_form_settings_form_validate($form, &$form_stat
 
   $nid          = $form_state['values']['node'];
   $preg_matches = array();
-  $match        = preg_match('/\[nid: (\d+)\]/', $nid, $preg_matches);
+  $match        = preg_match('/\[id: (\d+)\]/', $nid, $preg_matches);
   if (!$match) {
-    $match = preg_match('/^nid: (\d+)/', $nid, $preg_matches);
+    $match = preg_match('/^id: (\d+)/', $nid, $preg_matches);
   }
 
   if ($match) {
     $nid = $preg_matches[1];
   }
   if (is_numeric($nid)) {
-    $node = db_query('SELECT nid FROM {node} WHERE nid = :nid', array(':nid' => $nid))->fetchObject();
+    $node = db_query('SELECT nid, status FROM {node} WHERE nid = :nid', array(':nid' => $nid))->fetchObject();
   }
   else {
-    $node = db_query('SELECT nid FROM {node} WHERE LOWER(title) = LOWER(:title)', array(':title' => $nid))->fetchObject();
+    $node = db_query('SELECT nid, status FROM {node} WHERE LOWER(title) = LOWER(:title)', array(':title' => $nid))->fetchObject();
   }
 
-  if (!$node) {
+  // Do not allow unpublished nodes to be selected by unprivileged users
+  if (!$node || (empty($node->status) && !(user_access('administer nodes')))) {
     form_error($form['node'], t('Invalid node selected.'));
   }
   else {
     form_set_value($form['nid'], $node->nid, $form_state);
-    // $form_state['values']['nid'] = $node->nid;
   }
 }
 
diff --git a/sites/all/modules/ctools/plugins/contexts/string.inc b/sites/all/modules/ctools/plugins/contexts/string.inc
index 1c78fab3489faf5767e60077b2ddaf8212588ab1..c53acaeacffe22f6c07c131ce4e425553d6ad07f 100644
--- a/sites/all/modules/ctools/plugins/contexts/string.inc
+++ b/sites/all/modules/ctools/plugins/contexts/string.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: string.inc,v 1.8 2010/01/29 20:18:02 merlinofchaos Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/contexts/term.inc b/sites/all/modules/ctools/plugins/contexts/term.inc
index 6a3524aa0f8a81d2e25e1de210971e6ac5dccd8e..1d6d48e6fa5cb9330e4d93aaec22f7aa2d513048 100644
--- a/sites/all/modules/ctools/plugins/contexts/term.inc
+++ b/sites/all/modules/ctools/plugins/contexts/term.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: term.inc,v 1.13 2011/01/01 01:14:24 merlinofchaos Exp $
 
 /**
  * @file
@@ -30,6 +29,9 @@ $plugin = array(
     'vid' => t('Vocabulary ID'),
   ),
   'convert' => 'ctools_context_term_convert',
+  // This context is deprecated and should not be usable in the UI.
+  'no ui' => TRUE,
+  'no required context ui' => TRUE,
 );
 
 /**
@@ -88,7 +90,6 @@ function ctools_context_term_settings_form($form, &$form_state) {
       '#type' => 'textfield',
       '#description' => t('Select a term from @vocabulary.', array('@vocabulary' => $vocabulary->name)) . $description,
       '#autocomplete_path' => 'taxonomy/autocomplete/' . $vocabulary->vid,
-      '#process' => array('ctools_dependent_process'),
       '#dependency' => array('ctools-select-vid' => array($vocabulary->vid)),
     );
 
diff --git a/sites/all/modules/ctools/plugins/contexts/terms.inc b/sites/all/modules/ctools/plugins/contexts/terms.inc
index 6218d8017394894d48d4005c4e2094cd63e942c8..b076a61991c6e7c8d631821405197ada06759f1c 100644
--- a/sites/all/modules/ctools/plugins/contexts/terms.inc
+++ b/sites/all/modules/ctools/plugins/contexts/terms.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: terms.inc,v 1.10 2010/10/15 21:06:58 merlinofchaos Exp $
 
 /**
  * @file
@@ -16,7 +15,9 @@ $plugin = array(
   'description' => t('Multiple taxonomy terms, as a group.'),
   'context' => 'ctools_context_create_terms',
   'keyword' => 'terms',
+  // This context is deprecated and should not be usable in the UI.
   'no ui' => TRUE,
+  'no required context ui' => TRUE,
   'context name' => 'terms',
   'convert list' => array(
     'tid' => t('Term ID of first term'),
diff --git a/sites/all/modules/ctools/plugins/contexts/token.inc b/sites/all/modules/ctools/plugins/contexts/token.inc
index 150dc10db0af75cb6c6dba6f3f8873ef1757bf2f..5138b1cdec0c5486d6b9abaffffcf1f0de837736 100644
--- a/sites/all/modules/ctools/plugins/contexts/token.inc
+++ b/sites/all/modules/ctools/plugins/contexts/token.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: token.inc,v 1.4 2010/12/31 22:46:50 merlinofchaos Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/contexts/user.inc b/sites/all/modules/ctools/plugins/contexts/user.inc
index a12aa828afca1aadaa8b39652f93bd6d17b8382c..638d146fba7a25dcb465b369697169c1e1df3128 100644
--- a/sites/all/modules/ctools/plugins/contexts/user.inc
+++ b/sites/all/modules/ctools/plugins/contexts/user.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: user.inc,v 1.12 2011/01/05 19:42:37 merlinofchaos Exp $
 
 /**
  * @file
@@ -22,7 +21,10 @@ $plugin = array(
   'convert list' => 'ctools_context_user_convert_list',
   'convert' => 'ctools_context_user_convert',
   'convert default' => 'name',
-  'js' => array('misc/autocomplete.js'),
+
+  // This context is deprecated and should not be usable in the UI.
+  'no ui' => TRUE,
+  'no required context ui' => TRUE,
 );
 
 /**
@@ -30,7 +32,7 @@ $plugin = array(
  * are not always created from the UI.
  */
 function ctools_context_create_user($empty, $data = NULL, $conf = FALSE) {
-  $context = new ctools_context('user');
+  $context = new ctools_context(array('entity:user', 'entity', 'user'));
   $context->plugin = 'user';
 
   if ($empty) {
@@ -47,6 +49,11 @@ function ctools_context_create_user($empty, $data = NULL, $conf = FALSE) {
       $data = user_load($data['uid']);
     }
   }
+  // Load entity if the data provided is a numeric value. This kind of data is
+  // passed by some relationships.
+  if (is_numeric($data)) {
+    $data = user_load($data);
+  }
 
   if (!empty($data)) {
     $context->data     = $data;
@@ -75,7 +82,6 @@ function ctools_context_user_settings_form($form, &$form_state) {
     '#type' => 'textfield',
     '#maxlength' => 512,
     '#autocomplete_path' => 'user/autocomplete',
-    '#process' => array('ctools_dependent_process'),
     '#dependency' => array('radio:type' => array('select')),
   );
 
@@ -96,7 +102,6 @@ function ctools_context_user_settings_form($form, &$form_state) {
     '#default_value' => FALSE,
     '#title' => t('Reset identifier to username'),
     '#description' => t('If checked, the identifier will be reset to the user name of the selected user.'),
-    '#process' => array('ctools_dependent_process'),
     '#dependency' => array('radio:context[context_settings][type]' => array('select')),
   );
 
diff --git a/sites/all/modules/ctools/plugins/contexts/vocabulary.inc b/sites/all/modules/ctools/plugins/contexts/vocabulary.inc
index 38d00fde714d6a31a9ea465ad639458d083b7722..4930c24948ca1d9b420360a2445b883e92be62e3 100644
--- a/sites/all/modules/ctools/plugins/contexts/vocabulary.inc
+++ b/sites/all/modules/ctools/plugins/contexts/vocabulary.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: vocabulary.inc,v 1.7 2010/10/11 22:18:23 sdboyer Exp $
 
 /**
  * @file
@@ -19,6 +18,9 @@ $plugin = array(
   'defaults' => array('vid' => ''),
   'keyword' => 'vocabulary',
   'context name' => 'vocabulary',
+  // This context is deprecated and should not be usable in the UI.
+  'no ui' => TRUE,
+  'no required context ui' => TRUE,
 );
 
 /**
diff --git a/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.class.php b/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.class.php
index 10fc50d8bc0e4c70d124797a8d203a6574ffbea4..4a919eacff1c30221a5a5904f5249a1149f000e3 100644
--- a/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.class.php
+++ b/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.class.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctools_export_ui.class.php,v 1.5 2011/01/05 22:35:46 merlinofchaos Exp $
 
 /**
  * Base class for export UI.
@@ -38,6 +37,17 @@ class ctools_export_ui {
     return $title;
   }
 
+  /**
+   * Called by ctools_export_ui_load to load the item.
+   *
+   * This can be overridden for modules that want to be able to export
+   * items currently being edited, for example.
+   */
+  function load_item($item_name) {
+    $item = ctools_export_crud_load($this->plugin['schema'], $item_name);
+    return empty($item) ? FALSE : $item;
+  }
+
   // ------------------------------------------------------------------------
   // Menu item manipulation
 
@@ -181,7 +191,14 @@ class ctools_export_ui {
       $form_state['input']['form_id'] = 'ctools_export_ui_list_form';
     }
 
-    $form = drupal_render(drupal_build_form('ctools_export_ui_list_form', $form_state));
+    // If we do any form rendering, it's to completely replace a form on the
+    // page, so don't let it force our ids to change.
+    if ($js && isset($_POST['ajax_html_ids'])) {
+      unset($_POST['ajax_html_ids']);
+    }
+
+    $form = drupal_build_form('ctools_export_ui_list_form', $form_state);
+    $form = drupal_render($form);
 
     $output = $this->list_header($form_state) . $this->list_render($form_state) . $this->list_footer($form_state);
 
@@ -320,6 +337,7 @@ class ctools_export_ui {
   function list_form_submit(&$form, &$form_state) {
     // Filter and re-sort the pages.
     $plugin = $this->plugin;
+    $schema = ctools_export_get_schema($this->plugin['schema']);
 
     $prefix = ctools_export_ui_plugin_base_path($plugin);
 
@@ -335,10 +353,10 @@ class ctools_export_ui {
       $allowed_operations = drupal_map_assoc(array_keys($plugin['allowed operations']));
       $not_allowed_operations = array('import');
 
-      if ($item->type == t('Normal')) {
+      if ($item->{$schema['export']['export type string']} == t('Normal')) {
         $not_allowed_operations[] = 'revert';
       }
-      elseif ($item->type == t('Overridden')) {
+      elseif ($item->{$schema['export']['export type string']} == t('Overridden')) {
         $not_allowed_operations[] = 'delete';
       }
       else {
@@ -400,7 +418,8 @@ class ctools_export_ui {
    *   TRUE if the item should be excluded.
    */
   function list_filter($form_state, $item) {
-    if ($form_state['values']['storage'] != 'all' && $form_state['values']['storage'] != $item->type) {
+    $schema = ctools_export_get_schema($this->plugin['schema']);
+    if ($form_state['values']['storage'] != 'all' && $form_state['values']['storage'] != $item->{$schema['export']['export type string']}) {
       return TRUE;
     }
 
@@ -489,8 +508,9 @@ class ctools_export_ui {
   function list_build_row($item, &$form_state, $operations) {
     // Set up sorting
     $name = $item->{$this->plugin['export']['key']};
+    $schema = ctools_export_get_schema($this->plugin['schema']);
 
-    // Note: $item->type should have already been set up by export.inc so
+    // Note: $item->{$schema['export']['export type string']} should have already been set up by export.inc so
     // we can use it safely.
     switch ($form_state['values']['order']) {
       case 'disabled':
@@ -503,7 +523,7 @@ class ctools_export_ui {
         $this->sorts[$name] = $name;
         break;
       case 'storage':
-        $this->sorts[$name] = $item->type . $name;
+        $this->sorts[$name] = $item->{$schema['export']['export type string']} . $name;
         break;
     }
 
@@ -515,8 +535,11 @@ class ctools_export_ui {
       $this->rows[$name]['data'][] = array('data' => check_plain($item->{$this->plugin['export']['admin_title']}), 'class' => array('ctools-export-ui-title'));
     }
     $this->rows[$name]['data'][] = array('data' => check_plain($name), 'class' => array('ctools-export-ui-name'));
-    $this->rows[$name]['data'][] = array('data' => check_plain($item->type), 'class' => array('ctools-export-ui-storage'));
-    $this->rows[$name]['data'][] = array('data' => theme('links', array('links' => $operations)), 'class' => array('ctools-export-ui-operations'));
+    $this->rows[$name]['data'][] = array('data' => check_plain($item->{$schema['export']['export type string']}), 'class' => array('ctools-export-ui-storage'));
+
+    $ops = theme('links__ctools_dropbutton', array('links' => $operations, 'attributes' => array('class' => array('links', 'inline'))));
+
+    $this->rows[$name]['data'][] = array('data' => $ops, 'class' => array('ctools-export-ui-operations'));
 
     // Add an automatic mouseover of the description if one exists.
     if (!empty($this->plugin['export']['admin_description'])) {
@@ -557,6 +580,7 @@ class ctools_export_ui {
       'header' => $this->list_table_header(),
       'rows' => $this->rows,
       'attributes' => array('id' => 'ctools-export-ui-list-items'),
+      'empty' => $this->plugin['strings']['message']['no items'],
     );
     return theme('table', $table);
   }
@@ -825,7 +849,8 @@ class ctools_export_ui {
 
     // Figure out if this is a new instance of the wizard
     if (empty($form_state['step'])) {
-      $form_state['step'] = reset(array_keys($form_info['order']));
+      $order = array_keys($form_info['order']);
+      $form_state['step'] = reset($order);
     }
 
     if (empty($form_info['order'][$form_state['step']]) && empty($form_info['forms'][$form_state['step']])) {
@@ -970,10 +995,6 @@ class ctools_export_ui {
     $item = $form_state['item'];
     $schema = ctools_export_get_schema($this->plugin['schema']);
 
-    // TODO: Drupal 7 has a nifty method of auto guessing names from
-    // titles that is standard. We should integrate that here as a
-    // nice standard.
-    // Guess at a couple of our standard fields.
     if (!empty($this->plugin['export']['admin_title'])) {
       $form['info'][$this->plugin['export']['admin_title']] = array(
         '#type' => 'textfield',
@@ -1115,7 +1136,7 @@ class ctools_export_ui {
    * as though the filter form had been executed.
    */
   function set_item_state($state, $js, $input, $item) {
-    ctools_export_set_object_status($item, $state);
+    ctools_export_crud_set_status($this->plugin['schema'], $item, $state);
 
     if (!$js) {
       drupal_goto(ctools_export_ui_plugin_base_path($this->plugin));
diff --git a/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.inc b/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.inc
index fb204c3acbe676b0e228b012851f9f84e53a3aff..4e0a84978ee1b219c8f5fbf7edfed3666f0269fd 100644
--- a/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.inc
+++ b/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctools_export_ui.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * The default plugin exists only to provide the base class. Other plugins
diff --git a/sites/all/modules/ctools/plugins/relationships/book_parent.inc b/sites/all/modules/ctools/plugins/relationships/book_parent.inc
index adc66edec2ea59a1004a3e393b66c8d3a6846206..c49db76ef04a3c61fbab900123f24c5fbda6fdcd 100644
--- a/sites/all/modules/ctools/plugins/relationships/book_parent.inc
+++ b/sites/all/modules/ctools/plugins/relationships/book_parent.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: book_parent.inc,v 1.7 2010/10/11 22:18:23 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/relationships/entity_from_field.inc b/sites/all/modules/ctools/plugins/relationships/entity_from_field.inc
index 7e6ebcabf2cb3b4f124a8a2491e5fb6632f0cb5b..99d6f2d6db4cf548d356982825c6f192779017e4 100644
--- a/sites/all/modules/ctools/plugins/relationships/entity_from_field.inc
+++ b/sites/all/modules/ctools/plugins/relationships/entity_from_field.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: entity_from_field.inc,v 1.1 2011/01/05 20:34:46 merlinofchaos Exp $
 
 /**
  * @file
@@ -23,32 +22,104 @@ function ctools_entity_from_field_get_child($plugin, $parent, $child) {
   return $plugins[$parent . ':' . $child];
 }
 
-function ctools_entity_from_field_get_children($plugin, $parent) {
+function ctools_entity_from_field_get_children($parent_plugin, $parent) {
+  ctools_include('fields');
   $entities = entity_get_info();
   $plugins = array();
   $context_types = array();
 
   // Get the schema information for every field.
   $fields_info = field_info_instances();
-  foreach ($fields_info as $entity_type => $entity_info) {
+  foreach ($fields_info as $from_entity => $entity_info) {
     foreach ($entity_info as $bundle => $fields) {
-      foreach ($fields as $field_name => $field) {
-        $field = field_info_field($field_name);
-        $module = $field['module'];
-        module_load_install($module);
-        $schema = module_invoke($module, 'field_schema', $field);
-        if (isset($schema['foreign keys'])) {
-          foreach ($schema['foreign keys'] as $key => $info) {
-            if (isset($info['table'])) {
-              foreach ($entities as $entity => $einfo) {
-                if ($einfo['base table'] == $info['table'] && isset($info['columns'][$einfo['entity keys']['id']])) {
-                  $plugin['title'] = t('@field_entity from @entity on @field_name field', array('@field_entity' => $einfo['label'], '@entity' => $entities[$entity_type]['label'], '@field_name' => $field_name));
-                  $plugin['keyword'] = $entity;
-                  $plugin['context name'] = $field_name . '-' . $entity_type . '-' . $entity;
-                  $plugin['name'] = $parent . ':' . $field_name . '-' . $entity_type . '-' . $entity;
-                  $plugin['description'] = t('Creates a @entity context from @base_entity field relationship on the @base_table table.', array('@entity' => $entity, '@base_entity' => $entity_type, '@base_table' => $einfo['base table']));
-                  $context_types[$parent . ':' . $field_name . '-' . $entity_type . '-' . $entity]['types'][$bundle] = $entities[$entity_type]['bundles'][$bundle]['label'];
-                  $plugins[$parent . ':' . $field_name . '-' . $entity_type . '-' . $entity] = $plugin;
+      // There might be fields attached to bundles that are disabled (e.g. a
+      // module that declared a node's content type, is now disabled), but the
+      // field instance is still shown.
+      if (!empty($entities[$from_entity]['bundles'][$bundle])) {
+        foreach ($fields as $field_name => $field) {
+          $field = field_info_field($field_name);
+          $foreign_keys = NULL;
+
+          if (!empty($field['foreign keys'])) {
+            $foreign_keys = $field['foreign keys'];
+          }
+          else {
+            // try to fetch foreign keys from schema, as not everything
+            // stores foreign keys properly in the field info.
+            $module = $field['module'];
+            module_load_install($module);
+            $schema = module_invoke($module, 'field_schema', $field);
+            if (!empty($schema['foreign keys'])) {
+              $foreign_keys = $schema['foreign keys'];
+            }
+          }
+
+          if (is_array($foreign_keys)) {
+            foreach ($foreign_keys as $key => $info) {
+              if (isset($info['table'])) {
+                foreach ($entities as $to_entity => $to_entity_info) {
+                  $from_entity_info = $entities[$from_entity];
+                  if (isset($to_entity_info['base table']) && $to_entity_info['base table'] == $info['table'] && isset($info['columns'][$to_entity_info['entity keys']['id']])) {
+                    $name = $field_name . '-' . $from_entity . '-' . $to_entity;
+                    $plugin_id = $parent . ':' . $name;
+
+                    // Record the bundle for later.
+                    $context_types[$plugin_id]['types'][$bundle] = $from_entity_info['bundles'][$bundle]['label'];
+
+                    // We check for every bundle; this plugin may already have
+                    // been created, so don't recreate it.
+                    if (!isset($plugins[$plugin_id])) {
+                      $plugin = $parent_plugin;
+                      $replacements = array(
+                        '@to_entity' => $to_entity_info['label'],
+                        '@from_entity' => $from_entity_info['label'],
+                        '@field_name' => ctools_field_label($field_name),
+                      );
+                      $plugin['title'] = t('@to_entity from @from_entity (on @from_entity: @field_name)', $replacements);
+                      $plugin['keyword'] = $to_entity;
+                      $plugin['context name'] = $name;
+                      $plugin['name'] = $plugin_id;
+                      $plugin['description'] = t('Creates a @to_entity context from @from_entity using the @field_name field on @from_entity.', $replacements);
+                      $plugin['from entity'] = $from_entity;
+                      $plugin['to entity'] = $to_entity;
+                      $plugin['field name'] = $field_name;
+                      $plugin['parent'] = $parent;
+
+                      $plugins[$plugin_id] = $plugin;
+
+/*
+ -- commented out until I figure out how to actually load the reverse properly.
+                      // Build the reverse
+                      $plugin = $parent_plugin;
+                      $name = $field_name . '-' . $from_entity . '-' . $to_entity . '-reverse';
+                      $plugin_id = $parent . ':' . $name;
+
+                      $plugin['title'] = t('@from_entity from @to_entity (on @from_entity: @field_name)', $replacements);
+                      $plugin['keyword'] = $to_entity;
+                      $plugin['context name'] = $name;
+                      $plugin['name'] = $plugin_id;
+                      $plugin['description'] = t('Creates a @from_entity context from @to_entity using the @field_name field on @from_entity.', $replacements);
+
+                      $plugin['from entity'] = $from_entity;
+                      $plugin['to entity'] = $to_entity;
+                      $plugin['field name'] = $field_name;
+                      $plugin['reverse'] = TRUE;
+                      $plugin['parent'] = $parent;
+
+                      // Since we can't apply restrictions on the reverse relationship
+                      // we just add the required context here.
+                      $plugin['required context'] = new ctools_context_required($to_entity_info['label'], $to_entity);
+
+                      $plugin_entities = array(
+                        'to' => array($from_entity => $from_entity_info),
+                        'from' => array($to_entity => $to_entity_info)
+                      );
+                      drupal_alter('ctools_entity_context', $plugin, $plugin_entities, $plugin_id);
+
+                      $plugins[$plugin_id] = $plugin;
+*/
+                    }
+                  }
                 }
               }
             }
@@ -57,11 +128,24 @@ function ctools_entity_from_field_get_children($plugin, $parent) {
       }
     }
   }
+
   foreach ($context_types as $key => $context) {
     list($parent, $plugin_name) = explode(':', $key);
-    list($field_name, $from_entity) = explode('-', $plugin_name);
-    $plugins[$key]['required context'] = new ctools_context_required(t(ucfirst($from_entity)), $from_entity, array('type' => array_keys($context['types'])));
+    list($field_name, $from_entity, $to_entity) = explode('-', $plugin_name);
+
+    $from_entity_info = $entities[$from_entity];
+    $to_entity_info = $entities[$to_entity];
+
+    $plugins[$key]['required context'] = new ctools_context_required($from_entity_info['label'], $from_entity, array('type' => array_keys($context['types'])));
+
+    $plugin_entities = array(
+      'to' => array($to_entity => $to_entity_info),
+      'from' => array($from_entity => $from_entity_info)
+    );
+    drupal_alter('ctools_entity_context', $plugins[$key], $plugin_entities, $key);
   }
+  drupal_alter('ctools_entity_contexts', $plugins);
+
   return $plugins;
 }
 
@@ -71,11 +155,11 @@ function ctools_entity_from_field_get_children($plugin, $parent) {
 function ctools_entity_from_field_context($context, $conf) {
   $plugin = $conf['name'];
   list($plugin, $plugin_name) = explode(':', $plugin);
-  list($field_name, $from_entity, $to_entity) = explode('-', $plugin_name);
+  list($field_name, $from_entity, $to_entity_info) = explode('-', $plugin_name);
   // If unset it wants a generic, unfilled context, which is just NULL.
   $entity_info = entity_get_info($from_entity);
   if (empty($context->data) || !isset($context->data->{$entity_info['entity keys']['id']})) {
-    return ctools_context_create_empty('entity:' . $to_entity, NULL);
+    return ctools_context_create_empty('entity:' . $to_entity_info, NULL);
   }
 
   if (isset($context->data->{$entity_info['entity keys']['id']})) {
@@ -85,11 +169,11 @@ function ctools_entity_from_field_context($context, $conf) {
     $entity = $entity[$id];
     if (isset($entity->$field_name)) {
       $language = field_language($from_entity, $entity, $field_name);
-      $to_entity_info = entity_get_info($to_entity);
-      $to_entity_id = $entity->{$field_name}[$language][0][$to_entity_info['entity keys']['id']];
+      $to_entity_info_info = entity_get_info($to_entity_info);
+      $to_entity_info_id = $entity->{$field_name}[$language][0][$to_entity_info_info['entity keys']['id']];
 
       // Send it to ctools.
-      return ctools_context_create('entity:' . $to_entity, $to_entity_id);
+      return ctools_context_create('entity:' . $to_entity_info, $to_entity_info_id);
     }
   }
 }
diff --git a/sites/all/modules/ctools/plugins/relationships/entity_from_schema.inc b/sites/all/modules/ctools/plugins/relationships/entity_from_schema.inc
index a5bfa506f6e8f34fbf3ecff84ad9c8aa47fbe6ed..809473eb65b93436cc79a9764ab41c06e8c496eb 100644
--- a/sites/all/modules/ctools/plugins/relationships/entity_from_schema.inc
+++ b/sites/all/modules/ctools/plugins/relationships/entity_from_schema.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: entity_from_schema.inc,v 1.1 2011/01/05 20:34:46 merlinofchaos Exp $
 
 /**
  * @file
@@ -23,34 +22,81 @@ function ctools_entity_from_schema_get_child($plugin, $parent, $child) {
   return $plugins[$parent . ':' . $child];
 }
 
-function ctools_entity_from_schema_get_children($plugin, $parent) {
+function ctools_entity_from_schema_get_children($parent_plugin, $parent) {
   $entities = entity_get_info();
   $plugins = array();
 
   foreach (module_implements('entity_info') as $module) {
     module_load_install($module);
-    $schemas = module_invoke($module, 'schema');
-    foreach ($schemas as $table => $schema) {
-      foreach ($entities as $from_entity => $from_entity_info) {
-        if ($table == $from_entity_info['base table'] && isset($schema['foreign keys'])) {
-          foreach ($schema['foreign keys'] as $relationship => $info) {
-            foreach ($entities as $to_entity => $to_entity_info) {
-              if ($info['table'] == $to_entity_info['base table'] && in_array($to_entity_info['entity keys']['id'], $info['columns'])) {
-                $this_col = ctools_entity_from_schema_columns_filter($info['columns'], $to_entity_info['entity keys']['id']);
-                $plugin['title'] = t('@to_entity @relationship relationship', array('@relationship' => $relationship, '@to_entity' => $to_entity));
-                $plugin['keyword'] = $to_entity;
-                $plugin['context name'] = $this_col . '-' . $from_entity . '-' . $to_entity;
-                $plugin['name'] = $parent . ':' . $this_col . '-' . $from_entity . '-' . $to_entity;
-                $plugin['description'] = t('Builds a @relationship relationship from a @from_entity to a @to_entity', array('@relationship' => $relationship, '@from_entity' => $from_entity, '@to_entity' => $to_entity));
-                $plugin['required context'] = new ctools_context_required(t(ucfirst($from_entity_info['label'])), $from_entity);
-                $plugins[$parent . ':' . $this_col . '-' . $from_entity . '-' . $to_entity] = $plugin;
-              }
+    $schemas = drupal_get_schema();
+
+    foreach ($entities as $from_entity => $from_entity_info) {
+      if (empty($from_entity_info['base table'])) {
+        continue;
+      }
+
+      $table = $from_entity_info['base table'];
+      if (isset($schemas[$table]['foreign keys'])) {
+        foreach ($schemas[$table]['foreign keys'] as $relationship => $info) {
+          foreach ($entities as $to_entity => $to_entity_info) {
+            if (empty($info['table'])) {
+              continue;
+            }
+
+            if (isset($to_entity_info['base table']) && $info['table'] == $to_entity_info['base table'] && in_array($to_entity_info['entity keys']['id'], $info['columns'])) {
+              $this_col = ctools_entity_from_schema_columns_filter($info['columns'], $to_entity_info['entity keys']['id']);
+
+              // Set up our t() replacements as we reuse these.
+              $replacements = array(
+                '@relationship' => $relationship,
+                '@base_table' => $table,
+                '@to_entity' => $to_entity_info['label'],
+                '@from_entity' => $from_entity_info['label'],
+              );
+
+              $name = $this_col . '-' . $from_entity . '-' . $to_entity;
+              $plugin_id = $parent . ':' . $name;
+              $plugin = $parent_plugin;
+
+              $plugin['title'] = t('@to_entity from @from_entity (on @base_table.@relationship)', $replacements);
+              $plugin['keyword'] = $to_entity;
+              $plugin['context name'] = $name;
+              $plugin['name'] = $plugin_id;
+              $plugin['description'] = t('Builds a relationship from a @from_entity to a @to_entity using the @base_table.@relationship field.', $replacements);
+
+              $plugin['required context'] = new ctools_context_required($from_entity_info['label'], $from_entity);
+
+              $plugin_entities = array('to' => $to_entity_info, 'from' => $from_entity_info);
+              $plugin_entities = array('to' => array($to_entity => $to_entity_info), 'from' => array($from_entity => $from_entity_info));
+
+              drupal_alter('ctools_entity_context', $plugin, $plugin_entities, $plugin_id);
+              $plugins[$plugin_id] = $plugin;
+
+              // Add the relation in the reverse direction.
+              $name = $this_col . '-' . $to_entity . '-' . $from_entity;
+              $plugin_id = $parent . ':' . $name;
+              $plugin = $parent_plugin;
+
+              $plugin['title'] = t('@from_entity from @to_entity (on @base_table.@relationship)', $replacements);
+              $plugin['keyword'] = $to_entity;
+              $plugin['context name'] = $name;
+              $plugin['name'] = $plugin_id;
+              $plugin['description'] = t('Builds a relationship from a @to_entity to a @from_entity using the @base_table.@relationship field.', $replacements);
+
+              $plugin['required context'] = new ctools_context_required($to_entity_info['label'], $to_entity);
+
+              $plugin_entities = array('to' => $from_entity_info, 'from' => $to_entity_info);
+              $plugin_entities = array('to' => array($from_entity => $from_entity_info), 'from' => array($to_entity => $to_entity_info));
+              drupal_alter('ctools_entity_context', $plugin, $plugin_entities, $plugin_id);
+               $plugins[$plugin_id] = $plugin;
+
             }
           }
         }
       }
     }
   }
+  drupal_alter('ctools_entity_contexts', $plugins);
   return $plugins;
 }
 
diff --git a/sites/all/modules/ctools/plugins/relationships/node_edit_form_from_node.inc b/sites/all/modules/ctools/plugins/relationships/node_edit_form_from_node.inc
index 013d28b000cb976e9e08465ca1995b8fcfa38383..15c758a227f1fb81beb937158447d7f3d66b72c5 100644
--- a/sites/all/modules/ctools/plugins/relationships/node_edit_form_from_node.inc
+++ b/sites/all/modules/ctools/plugins/relationships/node_edit_form_from_node.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_edit_form_from_node.inc,v 1.2 2010/10/11 22:18:23 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/relationships/term_from_node.inc b/sites/all/modules/ctools/plugins/relationships/term_from_node.inc
index 2eac8ffb723e1281eb0ab3320da7e954a1402a8b..2304367820f85ed6deb51cca6918edff0255cdf7 100644
--- a/sites/all/modules/ctools/plugins/relationships/term_from_node.inc
+++ b/sites/all/modules/ctools/plugins/relationships/term_from_node.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: term_from_node.inc,v 1.6 2010/10/11 22:18:23 sdboyer Exp $
 
 /**
  * @file
@@ -26,13 +25,13 @@ $plugin = array(
 function ctools_term_from_node_context($context, $conf) {
   // If unset it wants a generic, unfilled context, which is just NULL.
   if (empty($context->data)) {
-    return ctools_context_create_empty('term', NULL);
+    return ctools_context_create_empty('entity_taxonomy:term', NULL);
   }
 
   if (isset($context->data->taxonomy)) {
     foreach ($context->data->taxonomy as $term) {
       if ($term->vid == $conf['vid']) {
-        return ctools_context_create('term', $term);
+        return ctools_context_create('entity:taxonomy_term', $term);
       }
     }
   }
diff --git a/sites/all/modules/ctools/plugins/relationships/term_parent.inc b/sites/all/modules/ctools/plugins/relationships/term_parent.inc
index e1a73c09fac4d202cc0002249e4116c67215be55..0ee9ebf0ff6b507a4b47a22111f94f6ab9ff1c87 100644
--- a/sites/all/modules/ctools/plugins/relationships/term_parent.inc
+++ b/sites/all/modules/ctools/plugins/relationships/term_parent.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: term_parent.inc,v 1.7 2010/10/11 22:18:23 sdboyer Exp $
 
 /**
  * @file relationships/term_parent.inc
@@ -14,7 +13,7 @@ $plugin = array(
   'title' => t('Term parent'),
   'keyword' => 'parent_term',
   'description' => t('Adds a taxonomy term parent from a term context.'),
-  'required context' => new ctools_context_required(t('Term'), 'term'),
+  'required context' => new ctools_context_required(t('Term'), 'entity_taxonomy_term'),
   'context' => 'ctools_term_parent_context',
   'edit form' => 'ctools_term_parent_settings_form',
   'defaults' => array('type' => 'top'),
@@ -26,7 +25,7 @@ $plugin = array(
 function ctools_term_parent_context($context, $conf) {
   // If unset it wants a generic, unfilled context, which is just NULL.
   if (empty($context->data)) {
-    return ctools_context_create_empty('term');
+    return ctools_context_create_empty('entity:taxonomy_term');
   }
 
   if (isset($context->data)) {
@@ -47,7 +46,7 @@ function ctools_term_parent_context($context, $conf) {
     // Load the term.
     if ($result) {
       $term = taxonomy_term_load($result['tid']);
-      return ctools_context_create('term', $term);
+      return ctools_context_create('entity:taxonomy_term', $term);
     }
   }
 }
diff --git a/sites/all/modules/ctools/plugins/relationships/terms_from_node.inc b/sites/all/modules/ctools/plugins/relationships/terms_from_node.inc
index 9d472380b29bfb655c4b444d6782833dbc918353..e8eaa545c085bd150f1ea08a3eb55197c999f8de 100644
--- a/sites/all/modules/ctools/plugins/relationships/terms_from_node.inc
+++ b/sites/all/modules/ctools/plugins/relationships/terms_from_node.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: terms_from_node.inc,v 1.2 2010/10/11 22:18:23 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/plugins/relationships/user_from_node.inc b/sites/all/modules/ctools/plugins/relationships/user_from_node.inc
index dd79c95613b7b9b94b327f8733f4aff910ed3763..388b1cec19a574823e5f5b25fcb1865f9a3032e3 100644
--- a/sites/all/modules/ctools/plugins/relationships/user_from_node.inc
+++ b/sites/all/modules/ctools/plugins/relationships/user_from_node.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: user_from_node.inc,v 1.7 2010/01/29 20:18:02 merlinofchaos Exp $
 
 /**
  * @file
@@ -16,6 +15,7 @@ $plugin = array(
   'description' => t('Creates the author of a node as a user context.'),
   'required context' => new ctools_context_required(t('Node'), 'node'),
   'context' => 'ctools_user_from_node_context',
+  'no ui' => TRUE,
 );
 
 /**
diff --git a/sites/all/modules/ctools/stylizer/plugins/export_ui/stylizer.inc b/sites/all/modules/ctools/stylizer/plugins/export_ui/stylizer.inc
index 7ddc492375c0dd3f908bde84b79ae1b2fce6e700..a1fc1d8cab813903913b628eed37c27768a9bad6 100644
--- a/sites/all/modules/ctools/stylizer/plugins/export_ui/stylizer.inc
+++ b/sites/all/modules/ctools/stylizer/plugins/export_ui/stylizer.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: stylizer.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 $plugin = array(
   'schema' => 'stylizer',
diff --git a/sites/all/modules/ctools/stylizer/plugins/export_ui/stylizer_ui.class.php b/sites/all/modules/ctools/stylizer/plugins/export_ui/stylizer_ui.class.php
index 0e2b60cd2cc118b6eb04b2f1d307dfdacd33eec7..14d6293960219308b3e11369b4f097dea9f8bbe8 100644
--- a/sites/all/modules/ctools/stylizer/plugins/export_ui/stylizer_ui.class.php
+++ b/sites/all/modules/ctools/stylizer/plugins/export_ui/stylizer_ui.class.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: stylizer_ui.class.php,v 1.3 2011/01/05 22:35:46 merlinofchaos Exp $
 
 /**
  * UI class for Stylizer.
@@ -139,6 +138,8 @@ class stylizer_ui extends ctools_export_ui {
       $type = t('Unknown');
     }
 
+    $ops = theme('links__ctools_dropbutton', array('links' => $operations, 'attributes' => array('class' => array('links', 'inline'))));
+
     $this->rows[$item->name] = array(
       'data' => array(
         array('data' => $type, 'class' => array('ctools-export-ui-type')),
@@ -146,7 +147,7 @@ class stylizer_ui extends ctools_export_ui {
         array('data' => check_plain($item->admin_title), 'class' => array('ctools-export-ui-title')),
         array('data' => check_plain($this->style_plugin['title']), 'class' => array('ctools-export-ui-base')),
         array('data' => check_plain($item->type), 'class' => array('ctools-export-ui-storage')),
-        array('data' => theme('links', array('links' => $operations)), 'class' => array('ctools-export-ui-operations')),
+        array('data' => $ops, 'class' => array('ctools-export-ui-operations')),
       ),
       'title' => check_plain($item->admin_description),
       'class' => array(!empty($item->disabled) ? 'ctools-export-ui-disabled' : 'ctools-export-ui-enabled'),
diff --git a/sites/all/modules/ctools/stylizer/stylizer.info b/sites/all/modules/ctools/stylizer/stylizer.info
index 72332ae0f3f192de38a783a9473dd8b55550a4ee..96b7db6f311a7d41cb7e59b978a9c00e4b1836ce 100644
--- a/sites/all/modules/ctools/stylizer/stylizer.info
+++ b/sites/all/modules/ctools/stylizer/stylizer.info
@@ -1,4 +1,3 @@
-; $Id: stylizer.info,v 1.3 2011/01/01 00:01:46 merlinofchaos Exp $
 name = Stylizer
 description = Create custom styles for applications such as Panels.
 core = 7.x
@@ -6,9 +5,9 @@ package = Chaos tool suite
 dependencies[] = ctools
 dependencies[] = color
 
-; Information added by drupal.org packaging script on 2011-01-06
-version = "7.x-1.0-alpha2"
+; Information added by drupal.org packaging script on 2011-05-31
+version = "7.x-1.0-beta1"
 core = "7.x"
 project = "ctools"
-datestamp = "1294276864"
+datestamp = "1306885315"
 
diff --git a/sites/all/modules/ctools/stylizer/stylizer.install b/sites/all/modules/ctools/stylizer/stylizer.install
index 1f28515003216c77e51361e5a340c499f621a5e6..cee8b74815b9511c99274b28803e896190017577 100644
--- a/sites/all/modules/ctools/stylizer/stylizer.install
+++ b/sites/all/modules/ctools/stylizer/stylizer.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: stylizer.install,v 1.2 2010/10/11 22:18:23 sdboyer Exp $
 
 /**
  * Schema for stylizer.
diff --git a/sites/all/modules/ctools/stylizer/stylizer.module b/sites/all/modules/ctools/stylizer/stylizer.module
index c68f77a498d08262d337c756332175194f9969bc..e7278975ddeea42760af54fab3607cf8258eceab 100644
--- a/sites/all/modules/ctools/stylizer/stylizer.module
+++ b/sites/all/modules/ctools/stylizer/stylizer.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: stylizer.module,v 1.4 2011/01/05 22:53:04 merlinofchaos Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/tests/css.test b/sites/all/modules/ctools/tests/css.test
index 48a99d113ef13e36a70a063621a44848febf6fc3..039e9757b6099d2851b2bdeecfc397b8f4fe96a1 100644
--- a/sites/all/modules/ctools/tests/css.test
+++ b/sites/all/modules/ctools/tests/css.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: css.test,v 1.1 2010/10/11 22:18:22 sdboyer Exp $
 /**
  * @file
  * Tests for different parts of the ctools plugin system.
diff --git a/sites/all/modules/ctools/tests/ctools.plugins.test b/sites/all/modules/ctools/tests/ctools.plugins.test
index a752e15d636ec03e6d831e7b425330311d130ed9..fe1829cfbc04998f857e9100c20b395850dfa340 100644
--- a/sites/all/modules/ctools/tests/ctools.plugins.test
+++ b/sites/all/modules/ctools/tests/ctools.plugins.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctools.plugins.test,v 1.3 2010/10/11 22:18:22 sdboyer Exp $
 /**
  * @file
  * Tests for different parts of the ctools plugin system.
diff --git a/sites/all/modules/ctools/tests/ctools_plugin_test.info b/sites/all/modules/ctools/tests/ctools_plugin_test.info
index 3bc97fc0f04d30ca16ad058ed2d80448096c0399..83ec9dc0b18a1a8ccbadb2a5acb060432d185084 100644
--- a/sites/all/modules/ctools/tests/ctools_plugin_test.info
+++ b/sites/all/modules/ctools/tests/ctools_plugin_test.info
@@ -1,4 +1,3 @@
-; $Id: ctools_plugin_test.info,v 1.2 2011/01/01 00:01:46 merlinofchaos Exp $
 name = Chaos tools plugins test
 description = Provides hooks for testing ctools plugins.
 package = Chaos tool suite
@@ -8,9 +7,9 @@ files[] = ctools.plugins.test
 files[] = object_cache.test
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-06
-version = "7.x-1.0-alpha2"
+; Information added by drupal.org packaging script on 2011-05-31
+version = "7.x-1.0-beta1"
 core = "7.x"
 project = "ctools"
-datestamp = "1294276864"
+datestamp = "1306885315"
 
diff --git a/sites/all/modules/ctools/tests/ctools_plugin_test.module b/sites/all/modules/ctools/tests/ctools_plugin_test.module
index f978dd48c20ae8adb8d64f6d634d8a9e6c0b6bf9..567f6e73d39d3bd7a8e33c44cd2e48e6dd2deaaf 100644
--- a/sites/all/modules/ctools/tests/ctools_plugin_test.module
+++ b/sites/all/modules/ctools/tests/ctools_plugin_test.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctools_plugin_test.module,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 /**
  * Define some plugin systems to test ctools plugin includes.
  */
diff --git a/sites/all/modules/ctools/tests/object_cache.test b/sites/all/modules/ctools/tests/object_cache.test
index d46c7d20226c2ea1bfc5503ec7ad174db8dd94ec..8791d7e706fe276a95e46dd0f302b9342e5e4783 100644
--- a/sites/all/modules/ctools/tests/object_cache.test
+++ b/sites/all/modules/ctools/tests/object_cache.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: object_cache.test,v 1.1 2010/10/11 22:18:22 sdboyer Exp $
 /**
  * @file
  * Tests for different parts of the ctools object caching system.
diff --git a/sites/all/modules/ctools/tests/plugins/cached/ctoolsCachedPluginArray.class.php b/sites/all/modules/ctools/tests/plugins/cached/ctoolsCachedPluginArray.class.php
index 853582a4e9dac9c10bf52cb3fa51678fe85c538b..3037daa50cf19122fbe7e011160fc13cbef28cd7 100644
--- a/sites/all/modules/ctools/tests/plugins/cached/ctoolsCachedPluginArray.class.php
+++ b/sites/all/modules/ctools/tests/plugins/cached/ctoolsCachedPluginArray.class.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctoolsCachedPluginArray.class.php,v 1.2 2010/10/11 22:18:23 sdboyer Exp $
 /**
  * @file
  * A cached plugin object that tests inheritence including.
diff --git a/sites/all/modules/ctools/tests/plugins/cached/ctoolsCachedPluginArray2.class.php b/sites/all/modules/ctools/tests/plugins/cached/ctoolsCachedPluginArray2.class.php
index 4be0f4a1b1328c76f6faf11419a9d94b27d5052c..0f7d858405970c4374590cecadcaec9123a36bcb 100644
--- a/sites/all/modules/ctools/tests/plugins/cached/ctoolsCachedPluginArray2.class.php
+++ b/sites/all/modules/ctools/tests/plugins/cached/ctoolsCachedPluginArray2.class.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctoolsCachedPluginArray2.class.php,v 1.1 2010/10/11 22:18:23 sdboyer Exp $
 /**
  * @file
  * A cached plugin object that tests inheritence including.
diff --git a/sites/all/modules/ctools/tests/plugins/cached/plugin_array.inc b/sites/all/modules/ctools/tests/plugins/cached/plugin_array.inc
index 609c7c0ed24454bdf304a06cc98c69d7e058b613..40a4bf7360662a9d8fbfbfabfad67f692c48a567 100644
--- a/sites/all/modules/ctools/tests/plugins/cached/plugin_array.inc
+++ b/sites/all/modules/ctools/tests/plugins/cached/plugin_array.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: plugin_array.inc,v 1.2 2010/10/11 22:18:23 sdboyer Exp $
 /**
  * @file
  * Chaos Tools plugin include using a plugin array to declare a plugin.
diff --git a/sites/all/modules/ctools/tests/plugins/cached/plugin_array2.inc b/sites/all/modules/ctools/tests/plugins/cached/plugin_array2.inc
index 5c1d2ce8979259fd07dfae4369f1c81bd4396fa4..e6676154d6cd14d2d48228df453eff7959513983 100644
--- a/sites/all/modules/ctools/tests/plugins/cached/plugin_array2.inc
+++ b/sites/all/modules/ctools/tests/plugins/cached/plugin_array2.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: plugin_array2.inc,v 1.1 2010/10/11 22:18:23 sdboyer Exp $
 /**
  * @file
  * Chaos Tools plugin include using a plugin array to declare a plugin.
diff --git a/sites/all/modules/ctools/tests/plugins/cached/plugin_array_dne.inc b/sites/all/modules/ctools/tests/plugins/cached/plugin_array_dne.inc
index 4f39ff04d0a9524ae25ab3d94c24e26c460da399..e3d3bfb90de04be18812639b1884a0fd381661a5 100644
--- a/sites/all/modules/ctools/tests/plugins/cached/plugin_array_dne.inc
+++ b/sites/all/modules/ctools/tests/plugins/cached/plugin_array_dne.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: plugin_array_dne.inc,v 1.1 2010/10/11 22:18:23 sdboyer Exp $
 /**
  * @file
  * Chaos Tools plugin include using a plugin array to declare a plugin.
diff --git a/sites/all/modules/ctools/tests/plugins/not_cached/ctoolsNotCachedPluginArray.class.php b/sites/all/modules/ctools/tests/plugins/not_cached/ctoolsNotCachedPluginArray.class.php
index 38666ce4a5a89a69ce88115d273b9c9bf5caf1e4..a3043bc6bbb288c99a4607b78324d98c5eebeb1a 100644
--- a/sites/all/modules/ctools/tests/plugins/not_cached/ctoolsNotCachedPluginArray.class.php
+++ b/sites/all/modules/ctools/tests/plugins/not_cached/ctoolsNotCachedPluginArray.class.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctoolsNotCachedPluginArray.class.php,v 1.2 2010/10/11 22:18:23 sdboyer Exp $
 /**
  * @file
  * A cached plugin object that tests inheritence including.
diff --git a/sites/all/modules/ctools/tests/plugins/not_cached/ctoolsNotCachedPluginArray2.class.php b/sites/all/modules/ctools/tests/plugins/not_cached/ctoolsNotCachedPluginArray2.class.php
index 5aa6db12629972c0005c5ce2ece1917e48b596e1..d7687dd02e5a13ab29caabbbedac3fec3202e80d 100644
--- a/sites/all/modules/ctools/tests/plugins/not_cached/ctoolsNotCachedPluginArray2.class.php
+++ b/sites/all/modules/ctools/tests/plugins/not_cached/ctoolsNotCachedPluginArray2.class.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: ctoolsNotCachedPluginArray2.class.php,v 1.1 2010/10/11 22:18:23 sdboyer Exp $
 /**
  * @file
  * A cached plugin object that tests including.
diff --git a/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array.inc b/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array.inc
index a3c640e0badc86ee163e0a420ddb17f0d95c8bea..3f4539359622ba8754cadb8a0b23819c50f2f597 100644
--- a/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array.inc
+++ b/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: plugin_array.inc,v 1.2 2010/10/11 22:18:23 sdboyer Exp $
 /**
  * @file
  * Chaos Tools plugin include using a plugin array to declare a plugin.
diff --git a/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array2.inc b/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array2.inc
index e909cdcdcbf6fbb81367045e3ae061bc83f51220..06b8175710206af88f0173dec96c1358f7bdf823 100644
--- a/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array2.inc
+++ b/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array2.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: plugin_array2.inc,v 1.1 2010/10/11 22:18:23 sdboyer Exp $
 /**
  * @file
  * Chaos Tools plugin include using a plugin array to declare a plugin.
diff --git a/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array_dne.inc b/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array_dne.inc
index c13245375f04b4c9f441d5b5261d1b73ed86092f..1f19d2a44592a7fa631840aebd36f3d42c396c21 100644
--- a/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array_dne.inc
+++ b/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array_dne.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: plugin_array_dne.inc,v 1.1 2010/10/11 22:18:23 sdboyer Exp $
 /**
  * @file
  * Chaos Tools plugin include using a plugin array to declare a plugin.
diff --git a/sites/all/modules/ctools/views_content/plugins/content_types/views.inc b/sites/all/modules/ctools/views_content/plugins/content_types/views.inc
index f825c809c497a74175555054d28ef5fb36e65c84..1a7be12d7cb57a7e68bece6d096e8f8aa9eee847 100644
--- a/sites/all/modules/ctools/views_content/plugins/content_types/views.inc
+++ b/sites/all/modules/ctools/views_content/plugins/content_types/views.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: views.inc,v 1.17 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
@@ -80,7 +79,7 @@ function views_content_views_content_type_content_type($subtype, $plugin) {
  * Create the content type info array to give back to ctools for a given display.
  */
 function _views_content_views_content_type($view) {
-  $title = $view->name;
+  $title = $view->get_human_name();
 
   $icon = 'icon_views_page_legacy.png';
 
@@ -159,7 +158,7 @@ function views_content_views_content_type_render($subtype, $conf, $panel_args, $
 
   $block = new stdClass();
   $block->module = 'views';
-  $block->delta  = $view->name .'-'.  $view->current_display;
+  $block->delta  = $view->name . '-' . $view->current_display;
 
   if (!empty($conf['link_to_view'])) {
     $block->title_link = $view->get_url();
@@ -238,7 +237,7 @@ function views_content_views_select_display($form, &$form_state) {
   foreach ($view->display as $id => $display) {
     // Content pane views should never be used this way.
     if ($display->display_plugin != 'panel_pane') {
-      $displays[$id] = $display->display_title;
+      $displays[$id] = views_content_get_display_label($view, $id);
     }
   }
 
@@ -273,7 +272,7 @@ function views_content_views_content_type_edit_form($form, &$form_state) {
     return;
   }
 
-  $form_state['title'] = t('Configure view @view (@display)', array('@view' => $view->name, '@display' => $view->display[$conf['display']]->display_title));
+  $form_state['title'] = t('Configure view @view (@display)', array('@view' => $view->get_human_name(), '@display' => views_content_get_display_label($view, $view->current_display)));
 
   // @todo
   // If using the older format, just a context is listed. We should go through
@@ -336,7 +335,6 @@ function views_content_views_content_type_edit_form($form, &$form_state) {
     '#title' => t('Use pager'),
     '#default_value' => $conf['use_pager'],
     '#id' => 'use-pager-checkbox',
-    '#process' => array('ctools_dependent_process'),
     '#dependency' => array('override-pager-checkbox' => array(1)),
   );
   $form['pager_settings']['pager_id'] = array(
@@ -345,7 +343,6 @@ function views_content_views_content_type_edit_form($form, &$form_state) {
     '#title' => t('Pager ID'),
     '#size' => 4,
     '#id' => 'use-pager-textfield',
-    '#process' => array('ctools_dependent_process'),
     '#dependency' => array('override-pager-checkbox' => array(1), 'use-pager-checkbox' => array(1)),
     '#dependency_count' => 2,
     '#suffix' => '</div>',
@@ -356,7 +353,6 @@ function views_content_views_content_type_edit_form($form, &$form_state) {
     '#default_value' => $conf['nodes_per_page'],
     '#size' => 4,
     '#title' => t('Num posts'),
-    '#process' => array('ctools_dependent_process'),
     '#dependency' => array('override-pager-checkbox' => array(1)),
   );
 
@@ -366,7 +362,6 @@ function views_content_views_content_type_edit_form($form, &$form_state) {
     '#title' => t('Offset'),
     '#size' => 4,
     '#description' => t('The number of items to skip and not display.'),
-    '#process' => array('ctools_dependent_process'),
     '#dependency' => array('override-pager-checkbox' => array(1)),
   );
 
@@ -417,8 +412,8 @@ function views_content_views_content_type_admin_title($subtype, $conf) {
     return t('Deleted/missing view @view', array('@view' => $view));
   }
 
-  $title = $view->display[$view->current_display]->display_title;
-  return t('View: @name', array('@name' => $view->name . '-' . $title));
+  $title = views_content_get_display_label($view, $view->current_display);
+  return t('View: @name', array('@name' => $view->get_human_name() . ': ' . $title));
 }
 
 /**
@@ -435,7 +430,7 @@ function views_content_views_content_type_admin_info($subtype, $conf, $contexts)
   $block->title = t('View information');
 
   $block->content = '<ul>';
-  $block->content .= '<li>' . t('Using display @display.', array('@display' => $view->display[$display]->display_title)) . '</li>';
+  $block->content .= '<li>' . t('Using display @display.', array('@display' => views_content_get_display_label($view, $display))) . '</li>';
 
   if (!empty($conf['context']) && $arguments = $view->display_handler->get_handlers('argument')) {
     $argument = reset($arguments);
diff --git a/sites/all/modules/ctools/views_content/plugins/content_types/views_attachments.inc b/sites/all/modules/ctools/views_content/plugins/content_types/views_attachments.inc
index b5aa4222caa555e8e9bcd07394fd0796ecfdbba5..e938f539fdadf2524a2a5e6541e71bcedfe575ef 100644
--- a/sites/all/modules/ctools/views_content/plugins/content_types/views_attachments.inc
+++ b/sites/all/modules/ctools/views_content/plugins/content_types/views_attachments.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: views_attachments.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/views_content/plugins/content_types/views_empty.inc b/sites/all/modules/ctools/views_content/plugins/content_types/views_empty.inc
index 7bcc86c92813399d8500d17861e5fcd006a3e23a..4664d65d350f733636c34f4fc66d7b3d09a57a1d 100644
--- a/sites/all/modules/ctools/views_content/plugins/content_types/views_empty.inc
+++ b/sites/all/modules/ctools/views_content/plugins/content_types/views_empty.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: views_empty.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
@@ -12,9 +11,6 @@ $plugin = array(
   'icon' => 'icon_views_page.png',
   'description' => t('Display the view empty text if there are no results.'),
   'required context' => new ctools_context_required(t('View'), 'view'),
-  'defaults' => array(
-    'which' => array(),
-  ),
 );
 
 /**
@@ -33,12 +29,16 @@ function views_content_views_empty_content_type_render($subtype, $conf, $panel_a
   $block->content = '';
 
   $output = views_content_context_get_output($context);
-  $block->content = $output['empty'];
+  if (isset($output['empty'])) {
+    $block->content = $output['empty'];
+  }
 
   return $block;
 }
 
 function views_content_views_empty_content_type_edit_form($form, &$form_state) {
+  // This form does nothing; it exists to let the main form select the view context.
+  return $form;
 }
 
 function views_content_views_empty_content_type_edit_form_submit(&$form, &$form_state) {
diff --git a/sites/all/modules/ctools/views_content/plugins/content_types/views_exposed.inc b/sites/all/modules/ctools/views_content/plugins/content_types/views_exposed.inc
index 8dd90f08010f9533e5016dd6e2c28eda779c73fd..93371e21f7cbc01e68d034f375a490e43e83eff0 100644
--- a/sites/all/modules/ctools/views_content/plugins/content_types/views_exposed.inc
+++ b/sites/all/modules/ctools/views_content/plugins/content_types/views_exposed.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: views_exposed.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
@@ -12,9 +11,6 @@ $plugin = array(
   'icon' => 'icon_views_page.png',
   'description' => t('Display the view exposed widgets if there are no results.'),
   'required context' => new ctools_context_required(t('View'), 'view'),
-  'defaults' => array(
-    'which' => array(),
-  ),
 );
 
 /**
@@ -39,6 +35,8 @@ function views_content_views_exposed_content_type_render($subtype, $conf, $panel
 }
 
 function views_content_views_exposed_content_type_edit_form($form, &$form_state) {
+  // This form does nothing; it exists to let the main form select the view context.
+  return $form;
 }
 
 function views_content_views_exposed_content_type_edit_form_submit(&$form, &$form_state) {
diff --git a/sites/all/modules/ctools/views_content/plugins/content_types/views_feed.inc b/sites/all/modules/ctools/views_content/plugins/content_types/views_feed.inc
index 53b325927b7fb3dceef1fa908d36d630ae7730c2..f2fdb8af502a276f8ccd30a18b5e3391174f6644 100644
--- a/sites/all/modules/ctools/views_content/plugins/content_types/views_feed.inc
+++ b/sites/all/modules/ctools/views_content/plugins/content_types/views_feed.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: views_feed.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
@@ -12,13 +11,10 @@ $plugin = array(
   'icon' => 'icon_views_page.png',
   'description' => t('Display the view feed icon if there are no results.'),
   'required context' => new ctools_context_required(t('View'), 'view'),
-  'defaults' => array(
-    'which' => array(),
-  ),
 );
 
 /**
- * Render the node_terms content type.
+ * Render the views feed content type.
  */
 function views_content_views_feed_content_type_render($subtype, $conf, $panel_args, $context) {
   if (empty($context) || empty($context->data)) {
@@ -39,6 +35,8 @@ function views_content_views_feed_content_type_render($subtype, $conf, $panel_ar
 }
 
 function views_content_views_feed_content_type_edit_form($form, &$form_state) {
+  // This form does nothing; it exists to let the main form select the view context.
+  return $form;
 }
 
 function views_content_views_feed_content_type_edit_form_submit(&$form, &$form_state) {
diff --git a/sites/all/modules/ctools/views_content/plugins/content_types/views_footer.inc b/sites/all/modules/ctools/views_content/plugins/content_types/views_footer.inc
index 595c164f8175d44dcc7754d9671b11702206c42a..81c87a3abbb0d956967f5fb2c9447feced028759 100644
--- a/sites/all/modules/ctools/views_content/plugins/content_types/views_footer.inc
+++ b/sites/all/modules/ctools/views_content/plugins/content_types/views_footer.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: views_footer.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
@@ -12,9 +11,6 @@ $plugin = array(
   'icon' => 'icon_views_page.png',
   'description' => t('Display the view footer if there are no results.'),
   'required context' => new ctools_context_required(t('View'), 'view'),
-  'defaults' => array(
-    'which' => array(),
-  ),
 );
 
 /**
@@ -39,6 +35,8 @@ function views_content_views_footer_content_type_render($subtype, $conf, $panel_
 }
 
 function views_content_views_footer_content_type_edit_form($form, &$form_state) {
+  // This form does nothing; it exists to let the main form select the view context.
+  return $form;
 }
 
 function views_content_views_footer_content_type_edit_form_submit(&$form, &$form_state) {
diff --git a/sites/all/modules/ctools/views_content/plugins/content_types/views_header.inc b/sites/all/modules/ctools/views_content/plugins/content_types/views_header.inc
index 3a446556ee3d5ab2eafda911d2ff94ecc7f6a665..f144d29fa34616f6e734e20444ba39864d715508 100644
--- a/sites/all/modules/ctools/views_content/plugins/content_types/views_header.inc
+++ b/sites/all/modules/ctools/views_content/plugins/content_types/views_header.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: views_header.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
@@ -12,9 +11,6 @@ $plugin = array(
   'icon' => 'icon_views_page.png',
   'description' => t('Display the view header if there are no results.'),
   'required context' => new ctools_context_required(t('View'), 'view'),
-  'defaults' => array(
-    'which' => array(),
-  ),
 );
 
 /**
@@ -39,6 +35,8 @@ function views_content_views_header_content_type_render($subtype, $conf, $panel_
 }
 
 function views_content_views_header_content_type_edit_form($form, &$form_state) {
+  // This form does nothing; it exists to let the main form select the view context.
+  return $form;
 }
 
 function views_content_views_header_content_type_edit_form_submit(&$form, &$form_state) {
diff --git a/sites/all/modules/ctools/views_content/plugins/content_types/views_pager.inc b/sites/all/modules/ctools/views_content/plugins/content_types/views_pager.inc
index 24ae47b223dde32ec73b10f7577a9c0df3f09069..faa65692b7543e120b4f1802f739922d20c4e9cb 100644
--- a/sites/all/modules/ctools/views_content/plugins/content_types/views_pager.inc
+++ b/sites/all/modules/ctools/views_content/plugins/content_types/views_pager.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: views_pager.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
@@ -12,9 +11,6 @@ $plugin = array(
   'icon' => 'icon_views_page.png',
   'description' => t('Display the view pager if there are no results.'),
   'required context' => new ctools_context_required(t('View'), 'view'),
-  'defaults' => array(
-    'which' => array(),
-  ),
 );
 
 /**
@@ -39,6 +35,9 @@ function views_content_views_pager_content_type_render($subtype, $conf, $panel_a
 }
 
 function views_content_views_pager_content_type_edit_form($form, &$form_state) {
+  // This form does nothing; it exists to let the main form select the view context.
+  return $form;
+
 }
 
 function views_content_views_pager_content_type_edit_form_submit(&$form, &$form_state) {
diff --git a/sites/all/modules/ctools/views_content/plugins/content_types/views_panes.inc b/sites/all/modules/ctools/views_content/plugins/content_types/views_panes.inc
index 630e12a5925777dc88c596700bc65b712e8c7be5..f1ccd1a70094ce9b3a2e2d1acc826d18ae01ffcd 100644
--- a/sites/all/modules/ctools/views_content/plugins/content_types/views_panes.inc
+++ b/sites/all/modules/ctools/views_content/plugins/content_types/views_panes.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: views_panes.inc,v 1.24 2011/01/05 19:53:36 merlinofchaos Exp $
 
 /**
  * @file
@@ -14,7 +13,6 @@ function views_content_views_panes_ctools_content_types() {
   return array(
     'title' => t('View panes'),
     'admin settings' => 'views_content_admin_form',
-    'js' => array(drupal_get_path('module', 'ctools') . '/js/dependent.js'),
   );
 }
 
@@ -88,10 +86,7 @@ function _views_content_panes_content_type($view, $display) {
     return;
   }
 
-  $title = $display->handler->get_option('pane_title');
-  if (!$title) {
-    $title = t('@view: @display', array('@view' => $view->name, '@display' => $display->display_title));
-  }
+  $title = views_content_get_display_title($view, $display->id);
 
   $description = $display->handler->get_option('pane_description');
   if (!$description) {
@@ -108,19 +103,9 @@ function _views_content_panes_content_type($view, $display) {
   $contexts = array();
 
   $arguments = $display->handler->get_argument_input();
+  ctools_include('views');
   foreach ($arguments as $argument) {
-    if ($argument['type'] == 'context') {
-      if (strpos($argument['context'], '.')) {
-        list($context, $converter) = explode('.', $argument['context'], 2);
-      }
-      else {
-        // Backwards-compat for before we had a system for delimiting the data
-        // we retrieve out of context objects.
-        $context = $argument['context'];
-      }
-      $class = 'ctools_context_' . (empty($argument['context_optional']) ? 'required' : 'optional');
-      $contexts[] = new $class($argument['label'], $context);
-    }
+    $contexts[] = ctools_views_get_argument_context($argument);
   }
 
   $allow = $display->handler->get_option('allow');
@@ -151,6 +136,8 @@ function views_content_views_panes_content_type_render($subtype, $conf, $panel_a
   }
 
   $view->set_display($display);
+  views_content_views_panes_add_defaults($conf, $view);
+
   if (!$view->display_handler->access($GLOBALS['user']) || !$view->display_handler->panel_pane_display) {
     return;
   }
@@ -160,13 +147,12 @@ function views_content_views_panes_content_type_render($subtype, $conf, $panel_a
   $args = array();
   $arguments = $view->display_handler->get_option('arguments');
 
-
   $context_keys = array_keys($contexts);
   foreach ($view->display_handler->get_argument_input() as $id => $argument) {
     switch ($argument['type']) {
       case 'context':
         $key = array_shift($context_keys);
-        if (isset($contexts [$key])) {
+        if (isset($contexts[$key])) {
           if (strpos($argument['context'], '.')) {
             list($context, $converter) = explode('.', $argument['context'], 2);
             $args[] = ctools_context_convert_context($contexts[$key], $converter);
@@ -182,11 +168,11 @@ function views_content_views_panes_content_type_render($subtype, $conf, $panel_a
         break;
 
       case 'panel':
-        $args[] = $panel_args[$argument['panel']];
+        $args[] = isset($panel_args[$argument['panel']]) ? $panel_args[$argument['panel']] : NULL;
         break;
 
       case 'user':
-        $args[] = (isset($conf['arguments'][$id])  && $conf['arguments'][$id] !== '') ? $conf['arguments'][$id] : NULL;
+        $args[] = (isset($conf['arguments'][$id])  && $conf['arguments'][$id] !== '') ? ctools_context_keyword_substitute($conf['arguments'][$id], array(), $contexts) : NULL;
         break;
 
      case 'wildcard':
@@ -207,6 +193,7 @@ function views_content_views_panes_content_type_render($subtype, $conf, $panel_a
   while (count($args) && end($args) === NULL) {
     array_pop($args);
   }
+
   $view->set_arguments($args);
 
   $allow = $view->display_handler->get_option('allow');
@@ -223,7 +210,7 @@ function views_content_views_panes_content_type_render($subtype, $conf, $panel_a
 
   $block = new stdClass();
   $block->module = 'views';
-  $block->delta  = $view->name . $display;
+  $block->delta  = $view->name . '-' . $display;
 
   if (($allow['link_to_view'] && !empty($conf['link_to_view'])) ||
       (!$allow['link_to_view'] && $view->display_handler->get_option('link_to_view'))) {
@@ -325,6 +312,26 @@ function views_content_views_panes_content_type_render($subtype, $conf, $panel_a
   return $block;
 }
 
+/**
+ * Add defaults to view pane settings.
+ * This helps cover us if $allow settings changed and there are no actual
+ * settings for a particular item.
+ */
+function views_content_views_panes_add_defaults(&$conf, $view) {
+  $conf += array(
+    'link_to_view' => $view->display_handler->get_option('link_to_view'),
+    'more_link' => $view->display_handler->get_option('more_link'),
+    'feed_icons' => FALSE,
+    'use_pager' => $view->display_handler->get_option('use_pager'),
+    'pager_id' => $view->display_handler->get_option('element_id'),
+    'items_per_page' => $view->display_handler->get_option('items_per_page'),
+    'offset' => $view->display_handler->get_option('offset'),
+    'path_override' => FALSE,
+    'path' => $view->get_path(),
+    'fields_override' => $view->display_handler->get_option('fields_override'),
+  );
+}
+
 /**
  * Returns an edit form for a block.
  */
@@ -337,27 +344,23 @@ function views_content_views_panes_content_type_edit_form($form, &$form_state) {
   $view = views_get_view($name);
 
   if (empty($view)) {
-    $form['markup'] = array('#value' => t('Broken/missing/deleted view.'));
-    return;
+    $form['markup'] = array('#markup' => t('Broken/missing/deleted view.'));
+    return $form;
   }
 
   $view->set_display($display_id);
 
+  // If it couldn't set the display and we got the default display instead,
+  // fail.
+  if ($view->current_display == 'default') {
+    $form['markup'] = array('#markup' => t('Broken/missing/deleted view display.'));
+    return $form;
+  }
+
   $allow = $view->display_handler->get_option('allow');
 
   // Provide defaults for everything in order to prevent warnings.
-  if (empty($conf)) {
-    $conf['link_to_view'] = $view->display_handler->get_option('link_to_view');
-    $conf['more_link'] = $view->display_handler->get_option('more_link');
-    $conf['feed_icons'] = FALSE;
-    $conf['use_pager'] = $view->display_handler->get_option('use_pager');
-    $conf['pager_id'] = $view->display_handler->get_option('element_id');
-    $conf['items_per_page'] = $view->display_handler->get_option('items_per_page');
-    $conf['offset'] = $view->display_handler->get_option('offset');
-    $conf['path_override'] = FALSE;
-    $conf['path'] = $view->get_path();
-    $conf['fields_override'] = $view->display_handler->get_option('fields_override');
-  }
+  views_content_views_panes_add_defaults($conf, $view);
 
   $form['arguments']['#tree'] = TRUE;
 
@@ -366,7 +369,8 @@ function views_content_views_panes_content_type_edit_form($form, &$form_state) {
       $form['arguments'][$id] = array(
         '#type' => 'textfield',
         '#default_value' => isset($conf['arguments'][$id]) ? $conf['arguments'][$id] : '',
-        '#title' => $argument['label'],
+        '#description' => t('You may use keywords for substitutions.'),
+        '#title' => check_plain($argument['label']),
       );
     }
   }
@@ -405,7 +409,7 @@ function views_content_views_panes_content_type_edit_form($form, &$form_state) {
     foreach ($view->display_handler->get_handlers('field') as $field => $handler) {
       $title = $handler->ui_name();
       if ($handler->options['label']) {
-        $title .= ' ('. $handler->options['label'] .')';
+        $title .= ' (' . check_plain($handler->options['label']) . ')';
       }
 
       $form['fields_override'][$field] = array(
@@ -431,7 +435,6 @@ function views_content_views_panes_content_type_edit_form($form, &$form_state) {
       '#title' => t('Pager ID'),
       '#size' => 4,
       '#id' => 'use-pager-textfield',
-      '#process' => array('ctools_dependent_process'),
       '#dependency' => array('use-pager-checkbox' => array(1)),
       '#suffix' => '</div>',
     );
@@ -465,15 +468,11 @@ function views_content_views_panes_content_type_edit_form($form, &$form_state) {
     if (!empty($contexts)) {
       $form['path']['#description'] .= ' ' . t('You may use substitutions in this path.');
 
-      // Add js for collapsible fieldsets manually
-      drupal_add_js('misc/collapse.js');
-
-      // We have to create a manual fieldset because fieldsets do not support IDs.
-      // Use 'hidden' instead of 'markup' so that the process will run.
-      $form['contexts_prefix'] = array(
-        '#type' => 'hidden',
-        '#id' => 'edit-path-substitutions',
-        '#prefix' => '<div><fieldset id="edit-path-substitutions" class="collapsed collapsible"><legend>' . t('Substitutions') . '</legend>',
+      $form['contexts'] = array(
+        '#type' => 'fieldset',
+        '#title' => t('Substitutions'),
+        '#collapsible' => TRUE,
+        '#collapsed' => TRUE,
       );
 
       $rows = array();
@@ -487,10 +486,7 @@ function views_content_views_panes_content_type_edit_form($form, &$form_state) {
       }
 
       $header = array(t('Keyword'), t('Value'));
-      $form['contexts']['context'] = array('#value' => theme('table', $header, $rows));
-      $form['contexts_suffix'] = array(
-        '#value' => '</fieldset></div>',
-      );
+      $form['contexts']['context'] = array('#markup' => theme('table', array('header' => $header, 'rows' => $rows)));
     }
   }
 
@@ -512,7 +508,8 @@ function views_content_views_panes_content_type_edit_form($form, &$form_state) {
       $exposed_form_state['exposed_form_plugin'] = $view->display_handler->get_plugin('exposed_form');
     }
     $view->init_handlers();
-    $exposed_form = views_exposed_form($exposed_form_state);
+    $exposed_form = array();
+    $exposed_form = views_exposed_form($exposed_form, $exposed_form_state);
 
     $form['exposed'] = array(
       '#tree' => TRUE,
@@ -569,8 +566,11 @@ function views_content_views_panes_content_type_admin_title($subtype, $conf, $co
   }
 
   $view->set_display($display);
-  $title = $view->display_handler->get_option('pane_title');
-  return check_plain($title ? $title : $view->name);
+  views_content_views_panes_add_defaults($conf, $view);
+
+  $title = views_content_get_display_title($view, $display);
+
+  return check_plain($title);
 }
 
 /**
@@ -587,6 +587,7 @@ function views_content_views_panes_content_type_admin_info($subtype, $conf, $con
   }
 
   $view->set_display($display_name);
+  views_content_views_panes_add_defaults($conf, $view);
 
   // Add arguments first
   if (!empty($conf['arguments'])) {
@@ -596,7 +597,7 @@ function views_content_views_panes_content_type_admin_info($subtype, $conf, $con
 
     foreach ($conf['arguments'] as $key => $value) {
       $label = $argument_input[$key]['label'];
-      $info[] = $label .': '. $value;
+      $info[] = $label . ': ' . $value;
     }
   }
 
diff --git a/sites/all/modules/ctools/views_content/plugins/content_types/views_row.inc b/sites/all/modules/ctools/views_content/plugins/content_types/views_row.inc
index 8233480188d62bc1536156ed1b2ced7dfbb3597f..827d36035ad3658f1d14da897b2d99ba166a305f 100644
--- a/sites/all/modules/ctools/views_content/plugins/content_types/views_row.inc
+++ b/sites/all/modules/ctools/views_content/plugins/content_types/views_row.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: views_row.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
@@ -45,10 +44,14 @@ function views_content_views_row_content_type_render($subtype, $conf, $panel_arg
   // This guarantees the view is rendered normally which must happen.
   $view = views_content_context_get_view($context);
   $output = views_content_context_get_output($context);
+  // Rows are keyed by result id value and need to be reset.
+  $output['rows'] = array_values($output['rows']);
   if (empty($conf['use_fields']) || empty($view->style_plugin->row_plugin)) {
     foreach ($conf['rows'] as $row) {
       // We store the row number 1-indexed but they are 0-indexed internally.
-      $block->content .= $output['rows'][$row - 1];
+      if (isset($output['rows'][$row - 1])) {
+        $block->content .= $output['rows'][$row - 1];
+      }
     }
   }
   else {
@@ -71,24 +74,36 @@ function views_content_views_row_content_type_render($subtype, $conf, $panel_arg
 
 function views_content_views_row_content_type_edit_form($form, &$form_state) {
   // This form does nothing; it exists to let the main form select the view context.
+  return $form;
 }
 
-function views_content_views_row_content_type_edit_form_submit(&$form, &$form_state) {
-
+function views_content_views_row_content_type_edit_form_submit($form, &$form_state) {
 }
 
-function views_content_views_row_edit(&$form, &$form_state) {
+function views_content_views_row_edit($form, &$form_state) {
   $conf = $form_state['conf'];
+  $contexts = $form_state['contexts'];
 
-  if (empty($form_state['contexts'][$conf['context']])) {
-    $form['markup'] = array('#value' => '<p>' . t('Invalid context selected.') . '</p>');
-    return;
+  if (empty($contexts[$conf['context']])) {
+    $form['markup'] = array('#markup' => '<p>' . t('Invalid context selected.') . '</p>');
+    return $form;
   }
 
-  $view = views_content_context_get_view($form_state['contexts'][$conf['context']]);
+  if (!isset($contexts[$conf['context']]->argument)) {
+    $name = $contexts[$conf['context']]->placeholder['conf']['name'];
+    list($plugin, $view_data) = explode(':', $name);
+    list($view_name, $display_id) = explode('-', $view_data);
+  }
+  else {
+    $view_data = $contexts[$conf['context']]->argument;
+    list($view_name, $display_id) = explode(':', $view_data);
+  }
+  $contexts[$conf['context']]->data['name'] = $view_name;
+  $contexts[$conf['context']]->data['display'] = $display_id;
+  $view = views_content_context_get_view($contexts[$conf['context']]);
   if (empty($view)) {
-    $form['markup'] = array('#value' => '<p>' . t('Context contains an invalid view.') . '</p>');
-    return;
+    $form['markup'] = array('#markup' => '<p>' . t('Context contains an invalid view.') . '</p>');
+    return $form;
   }
 
   // Support Views 2 and Views 3.
@@ -100,8 +115,8 @@ function views_content_views_row_edit(&$form, &$form_state) {
     $rows = $view->display_handler->get_option('items_per_page');
   }
   if (empty($rows)) {
-    $form['markup'] = array('#value' => '<p>' . t('The view must have a maximum number of items set to use this content type.') . '</p>');
-    return;
+    $form['markup'] = array('#markup' => '<p>' . t('The view must have a maximum number of items set to use this content type.') . '</p>');
+    return $form;
   }
 
   foreach (range(1, $rows) as $row) {
@@ -129,10 +144,10 @@ function views_content_views_row_edit(&$form, &$form_state) {
       '#default_value' => $conf['fields'],
       '#prefix' => '<div id="edit-fields-wrapper"><div id="edit-fields">',
       '#suffix' => '</div></div>',
-      '#process' => array('ctools_dependent_process', 'expand_checkboxes'),
       '#dependency' => array('edit-use-fields' => array(TRUE)),
     );
   }
+  return $form;
 }
 
 function views_content_views_row_edit_validate(&$form, &$form_state) {
diff --git a/sites/all/modules/ctools/views_content/plugins/content_types/views_view.inc b/sites/all/modules/ctools/views_content/plugins/content_types/views_view.inc
new file mode 100644
index 0000000000000000000000000000000000000000..dfb1175c3bf6ffef0dac91952b610e5ceeef9d50
--- /dev/null
+++ b/sites/all/modules/ctools/views_content/plugins/content_types/views_view.inc
@@ -0,0 +1,52 @@
+<?php
+
+/**
+ * @file
+ * Allow a view context to be displayed as whole.
+ */
+
+$plugin = array(
+  'title' => t('Entire view'),
+  'category' => t('View context'),
+  'icon' => 'icon_views_page.png',
+  'description' => t('Display the entire view.'),
+  'required context' => new ctools_context_required(t('View'), 'view'),
+);
+
+/**
+ * Render the views view content type.
+ */
+function views_content_views_view_content_type_render($subtype, $conf, $panel_args, $context) {
+  if (empty($context) || empty($context->data)) {
+    return;
+  }
+
+  // Build the content type block.
+  $block = new stdClass();
+  $block->module  = 'views_view';
+  $block->delta   = $context->argument;
+  $block->title   = '';
+  $block->content = '';
+
+  $output = views_content_context_get_output($context);
+  $output = $output['view']->preview();
+  $block->content = $output;
+
+  return $block;
+}
+
+function views_content_views_view_content_type_edit_form($form, &$form_state) {
+  // This form does nothing; it exists to let the main form select the view context.
+  return $form;
+}
+
+function views_content_views_view_content_type_edit_form_submit(&$form, &$form_state) {
+  // Kept so we guarantee we have a submit handler.
+}
+
+/**
+ * Returns the administrative title for a type.
+ */
+function views_content_views_view_content_type_admin_title($subtype, $conf, $context) {
+  return t('"@context" entire view', array('@context' => $context->identifier));
+}
diff --git a/sites/all/modules/ctools/views_content/plugins/contexts/view.inc b/sites/all/modules/ctools/views_content/plugins/contexts/view.inc
index fed1f8f9f92d456818099e1f8be459f27647fda8..1e926e457d3b10121ee9c03dca18a0261868957a 100644
--- a/sites/all/modules/ctools/views_content/plugins/contexts/view.inc
+++ b/sites/all/modules/ctools/views_content/plugins/contexts/view.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: view.inc,v 1.2 2010/10/11 22:18:24 sdboyer Exp $
 
 /**
  * @file
@@ -17,29 +16,61 @@ $plugin = array(
   'description' => t('Loads a view result into a context that can then be displayed across a panel or turned into other contexts.'),
   'context' => 'views_content_context_view_create',
 
-  'settings form' => 'views_content_context_view_settings_form',
-  'settings form validate' => 'views_content_context_view_settings_form_validate',
-  'settings form submit' => 'views_content_context_view_settings_form_submit',
+  'edit form' => 'views_content_context_view_settings_form',
+  'edit form validate' => 'views_content_context_view_settings_form_validate',
+  'edit form submit' => 'views_content_context_view_settings_form_submit',
 
   'defaults' => array('view' => ''),
 
   'keyword' => 'view',
   'context name' => 'view',
 
-  /*
-  'convert list' => 'views_content_context_view_convert_list',
-  'convert' => 'views_content_context_view_convert',
-  */
-
-  /*
-  'placeholder form' => array(
-    '#type' => 'textfield',
-    '#description' => t('Enter the node ID of a node for this context.'),
-  ),
-  */
+  'get child' => 'views_content_context_view_get_child',
+  'get children' => 'views_content_context_view_get_children',
 );
 
-function views_content_context_view_create($empty, $data = NULL, $conf = FALSE) {
+function views_content_context_view_get_child($plugin, $parent, $child) {
+  list($name, $id) = explode('-', $child, 2);
+  $view = views_get_view($name);
+  if (!$view) {
+    return;
+  }
+
+  $view->set_display($id);
+  if ($view->current_display != $id) {
+    return;
+  }
+
+  $info = _views_content_get_context_from_display($view, $id, $parent, FALSE);
+  if ($info) {
+    return $info;
+  }
+  return;
+}
+
+function views_content_context_view_get_children($plugin, $parent) {
+  $types = array(
+    'view' => $plugin,
+  );
+
+  // We're keeping the 'view' context around for legacy reasons but
+  // we want to disable the UI so you can't add it that way anymore.
+  $types['view']['no ui'] = TRUE;
+
+  $views = views_get_applicable_views('returns context');
+  foreach ($views as $data) {
+    list($view, $id) = $data;
+    $info = _views_content_get_context_from_display($view, $id, $parent, FALSE);
+    if ($info) {
+      $info['no required context ui'] = TRUE;
+      $types[$info['name']] = $info;
+    }
+  }
+
+  return $types;
+}
+
+function views_content_context_view_create($empty, $data = NULL, $conf = FALSE, $plugin = array()) {
   $context = new ctools_context('view');
   $context->plugin = 'view';
 
@@ -49,20 +80,31 @@ function views_content_context_view_create($empty, $data = NULL, $conf = FALSE)
 
   if ($conf) {
     if (is_array($data) && !empty($data['view'])) {
+      // This code is left in for backward compatibility. Will not be used
+      // with child plugins.
       list($name, $display_id) = explode(':', $data['view'], 2);
       $data = views_get_view($name);
       if ($data) {
         $data->set_display($display_id);
       }
     }
+    else if (!empty($plugin['view name'])) {
+      $data = views_get_view($plugin['view name']);
+      $data->set_display($plugin['view display id']);
+    }
   }
 
-  if (is_object($data)) {
+  if (is_object($data) && $data->current_display != 'default') {
     // We don't store the loaded view as we don't want the view object
-    // cached.
+    // cached. However, in order to extract it you can use:
+    // @code
+    // $output = views_content_context_get_output($context);
+    // $view = $output['view'];
+    // @endcode
     $context->data     = array(
       'name' => $data->name,
       'display' => $data->current_display,
+      'args' => $data->args,
     );
 
     // At runtime, this can get populated. Once it is populated this
@@ -82,10 +124,7 @@ function views_content_context_view_settings_form($form, &$form_state) {
   $views = views_get_applicable_views('returns context');
   foreach ($views as $data) {
     list($view, $id) = $data;
-    $title = $view->display_handler->get_option('admin_title');
-    if (!$title) {
-      $title = $view->name;
-    }
+    $title = views_content_get_display_title($view, $id, 'admin_title');
     $options[$view->name . ':' . $id] = $title;
   }
 
diff --git a/sites/all/modules/ctools/views_content/plugins/relationships/node_from_view.inc b/sites/all/modules/ctools/views_content/plugins/relationships/node_from_view.inc
index de8f3e9c4d5789c455ee5bd75995e1e8f6a814c2..55ed945763ba7fb55cb43851740d6a6c7bcc7908 100644
--- a/sites/all/modules/ctools/views_content/plugins/relationships/node_from_view.inc
+++ b/sites/all/modules/ctools/views_content/plugins/relationships/node_from_view.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: node_from_view.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/views_content/plugins/relationships/term_from_view.inc b/sites/all/modules/ctools/views_content/plugins/relationships/term_from_view.inc
index e99dcf8f755251c42da1bd80f0cb26ee0512ab10..bc75062a5c31d4b2086ea5bc9de707b26d1b5094 100644
--- a/sites/all/modules/ctools/views_content/plugins/relationships/term_from_view.inc
+++ b/sites/all/modules/ctools/views_content/plugins/relationships/term_from_view.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: term_from_view.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/views_content/plugins/relationships/user_from_view.inc b/sites/all/modules/ctools/views_content/plugins/relationships/user_from_view.inc
index 62e907ffcc8d5a45fc3420a8c9ecb013355cfe8d..eb594859371fa6d8754c3d781da5512ba864e640 100644
--- a/sites/all/modules/ctools/views_content/plugins/relationships/user_from_view.inc
+++ b/sites/all/modules/ctools/views_content/plugins/relationships/user_from_view.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: user_from_view.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/ctools/views_content/plugins/relationships/view_from_argument.inc b/sites/all/modules/ctools/views_content/plugins/relationships/view_from_argument.inc
new file mode 100644
index 0000000000000000000000000000000000000000..4da5fe558bc62f7a0816bccb331a005a9598bf60
--- /dev/null
+++ b/sites/all/modules/ctools/views_content/plugins/relationships/view_from_argument.inc
@@ -0,0 +1,101 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Plugin to provide an relationship handler for a view by argument input settings.
+ */
+
+/**
+ * Plugins are described by creating a $plugin array which will be used
+ * by the system that includes this file.
+ */
+$plugin = array(
+  'title' => t('View From Argument'),
+  'description' => t('Creates a view context from argument input settings.'),
+  'context' => 'views_content_view_from_argument_context',
+  'get child' => 'views_content_view_from_argument_get_child',
+  'get children' => 'views_content_view_from_argument_get_children',
+);
+
+function views_content_view_from_argument_get_child($plugin, $parent, $child) {
+  list($name, $id) = explode('-', $child, 2);
+  $view = views_get_view($name);
+  if (!$view) {
+    return;
+  }
+
+  $view->set_display($id);
+  if ($view->current_display != $id) {
+    return;
+  }
+
+  $info = _views_content_get_context_from_display($view, $id, $parent, TRUE);
+  if ($info) {
+    return $info;
+  }
+  return;
+}
+
+function views_content_view_from_argument_get_children($plugin, $parent) {
+  $types = array();
+
+  $views = views_get_applicable_views('returns context');
+  foreach ($views as $data) {
+    list($view, $id) = $data;
+    $info = _views_content_get_context_from_display($view, $id, $parent, TRUE);
+    if ($info) {
+      $types[$info['name']] = $info;
+    }
+  }
+
+  return $types;
+}
+
+/**
+ * Return a new context based on an existing context.
+ */
+function views_content_view_from_argument_context($contexts, $conf) {
+  $name = $conf['name'];
+  list($plugin, $view_data) = explode(':', $name);
+  list($view_name, $display_id) = explode('-', $view_data);
+  $keys = array_keys($conf['context']);
+
+  if (empty($contexts[$keys[0]]->data)) {
+    return ctools_context_create_empty('view', NULL);
+  }
+
+  // Load our view up.
+  $data = views_get_view($view_name);
+  if ($data) {
+    // Set the display.
+    $data->set_display($display_id);
+    $context_keys = array_keys($contexts);
+    foreach ($data->display_handler->get_argument_input() as $id => $argument) {
+      if ($argument['type'] == 'context') {
+        $key = array_shift($context_keys);
+        if (isset($contexts [$key])) {
+          if (strpos($argument['context'], '.')) {
+            list($context, $converter) = explode('.', $argument['context'], 2);
+            $args[] = ctools_context_convert_context($contexts[$key], $converter);
+          }
+          else {
+            $args[] = $contexts[$key]->argument;
+          }
+        }
+      }
+    }
+    // remove any trailing NULL arguments as these are non-args:
+    while (count($args) && end($args) === NULL) {
+      array_pop($args);
+    }
+    $data->set_arguments($args);
+    if ($path = $data->display_handler->get_option('inherit_panels_path')) {
+      $data->override_path = $_GET['q'];
+    }
+  }
+
+  if (isset($contexts[$keys[0]]->data)) {
+    return ctools_context_create('view', $data);
+  }
+}
diff --git a/sites/all/modules/ctools/views_content/plugins/views/views_content.views.inc b/sites/all/modules/ctools/views_content/plugins/views/views_content.views.inc
index 6e35bce27b169c469f8620dfa811b63786bbec1d..db564c7f4ec64a141f1f50a58b08c04594fbbec7 100644
--- a/sites/all/modules/ctools/views_content/plugins/views/views_content.views.inc
+++ b/sites/all/modules/ctools/views_content/plugins/views/views_content.views.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: views_content.views.inc,v 1.4 2010/09/07 09:02:51 sdboyer Exp $
 
 /**
  * @file
@@ -14,6 +13,7 @@ function views_content_views_plugins() {
     'display' => array(
       'panel_pane' => array(
         'title' => t('Content pane'),
+        'admin' => t('Content pane'),
         'help' => t('Is available as content for a panel or dashboard display.'),
         'handler' => 'views_content_plugin_display_panel_pane',
         'path' => drupal_get_path('module', 'views_content') . '/plugins/views',
@@ -27,6 +27,7 @@ function views_content_views_plugins() {
       ),
       'ctools_context' => array(
         'title' => t('Context'),
+        'admin' => t('Context'),
         'help' => t('Makes the view results available as a context for use in Panels and other applications.'),
         'handler' => 'views_content_plugin_display_ctools_context',
         'path' => drupal_get_path('module', 'views_content') . '/plugins/views',
diff --git a/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_display_ctools_context.inc b/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_display_ctools_context.inc
index 6a5759fd4e01471ccc96b6d2fb85752b39b0cdf3..55febe17b843a40c9b6ac094d4007ff19ec8e852 100644
--- a/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_display_ctools_context.inc
+++ b/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_display_ctools_context.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: views_content_plugin_display_ctools_context.inc,v 1.2 2010/10/11 22:18:23 sdboyer Exp $
 /**
  * @file
  * Contains the block display plugin.
@@ -11,6 +10,12 @@
  * @ingroup views_display_plugins
  */
 class views_content_plugin_display_ctools_context extends views_plugin_display {
+  /**
+   * If this variable is true, this display counts as a context. We use this
+   * variable so that we can easily build plugins against this display type.
+   */
+  var $context_display = TRUE;
+
   function get_style_type() { return 'context'; }
 
   function defaultable_sections($section = NULL) {
@@ -33,6 +38,8 @@ class views_content_plugin_display_ctools_context extends views_plugin_display {
     $options['defaults']['default']['style_options'] = FALSE;
     $options['defaults']['default']['row_plugin'] = FALSE;
     $options['defaults']['default']['row_options'] = FALSE;
+    $options['inherit_panels_path'] = array('default' => 0);
+    $options['argument_input'] = array('default' => array());
 
     return $options;
   }
@@ -55,7 +62,7 @@ class views_content_plugin_display_ctools_context extends views_plugin_display {
    */
   function render() {
     if (!empty($this->previewing)) {
-      return theme($this->theme_functions(), $this->view);
+      return theme($this->theme_functions(), array('view' => $this->view));
     }
     else {
       // We want to process the view like we're theming it, but not actually
@@ -91,6 +98,10 @@ class views_content_plugin_display_ctools_context extends views_plugin_display {
 
     $categories['context'] = array(
       'title' => t('Context settings'),
+      'column' => 'second',
+      'build' => array(
+        '#weight' => -10,
+      ),
     );
 
     $admin_title = $this->get_option('admin_title');
@@ -108,6 +119,17 @@ class views_content_plugin_display_ctools_context extends views_plugin_display {
       'value' => $admin_title,
     );
 
+    $options['inherit_panels_path'] = array(
+      'category' => 'context',
+      'title' => t('Use Panel path'),
+      'value' => $this->get_option('inherit_panels_path') ? t('Yes') : t('No'),
+    );
+
+    $options['argument_input'] = array(
+      'category' => 'context',
+      'title' => t('Argument input'),
+      'value' => t('Edit'),
+    );
   }
 
   /**
@@ -130,6 +152,63 @@ class views_content_plugin_display_ctools_context extends views_plugin_display {
           '#description' => t('This is the title that will appear for this view context in the configure context dialog. If left blank, the view name will be used.'),
         );
         break;
+      case 'inherit_panels_path':
+        $form['#title'] .= t('Inherit path from panel display');
+
+        $form['inherit_panels_path'] = array(
+          '#type' => 'select',
+          '#options' => array(1 => t('Yes'), 0 => t('No')),
+          '#default_value' => $this->get_option('inherit_panels_path'),
+          '#description' => t('If yes, all links generated by Views, such as more links, summary links, and exposed input links will go to the panels display path, not the view, if the display has a path.'),
+        );
+        break;
+      case 'argument_input':
+        $form['#title'] .= t('Choose the data source for view arguments');
+        $argument_input = $this->get_argument_input();
+        ctools_include('context');
+        ctools_include('dependent');
+        $form['argument_input']['#tree'] = TRUE;
+
+        $converters = ctools_context_get_all_converters();
+        ksort($converters);
+
+        foreach ($argument_input as $id => $argument) {
+          $form['argument_input'][$id] = array(
+            '#tree' => TRUE,
+          );
+
+          $safe = str_replace(array('][', '_', ' ', ':'), '-', $id);
+          $type_id = 'edit-argument-input-' . $safe;
+
+          $form['argument_input'][$id]['type'] = array(
+            '#type' => 'select',
+            '#options' => array(
+              'none' => t('No argument'),
+              'context' => t('From context'),
+            ),
+            '#id' => $type_id,
+            '#title' => t('@arg source', array('@arg' => $argument['name'])),
+            '#default_value' => $argument['type'],
+          );
+
+          $form['argument_input'][$id]['context'] = array(
+            '#type' => 'select',
+            '#title' => t('Required context'),
+            '#description' => t('If "From context" is selected, which type of context to use.'),
+            '#default_value' => $argument['context'],
+            '#options' => $converters,
+            '#dependency' => array($type_id => array('context')),
+          );
+
+          $form['argument_input'][$id]['context_optional'] = array(
+            '#type' => 'checkbox',
+            '#title' => t('Context is optional'),
+            '#description' => t('This context need not be present for the pane to function. If you plan to use this, ensure that the argument handler can handle empty values gracefully.'),
+            '#default_value' => $argument['context_optional'],
+            '#dependency' => array($type_id => array('context')),
+          );
+        }
+        break;
     }
   }
 
@@ -142,15 +221,49 @@ class views_content_plugin_display_ctools_context extends views_plugin_display {
     parent::options_submit($form, $form_state);
     switch ($form_state['section']) {
       case 'admin_title':
+      case 'argument_input':
+      case 'inherit_panels_path':
         $this->set_option($form_state['section'], $form_state['values'][$form_state['section']]);
         break;
     }
   }
 
   /**
-   * Block views use exposed widgets only if AJAX is set.
+   * Adjust the array of argument input to match the current list of
+   * arguments available for this display. This ensures that changing
+   * the arguments doesn't cause the argument input field to just
+   * break.
    */
-  function uses_exposed() {
-    return FALSE;
+  function get_argument_input() {
+    $arguments = $this->get_option('argument_input');
+    $handlers = $this->get_handlers('argument');
+
+    // We use a separate output so as to seamlessly discard info for
+    // arguments that no longer exist.
+    $output = array();
+
+    foreach ($handlers as $id => $handler) {
+      if (empty($arguments[$id])) {
+        $output[$id] = array(
+          'type' => 'none',
+          'context' => 'any',
+          'context_optional' => FALSE,
+          'name' => $handler->ui_name(),
+        );
+      }
+      else {
+        $output[$id] = $arguments[$id];
+        $output[$id]['name'] = $handler->ui_name();
+      }
+    }
+
+    return $output;
+  }
+
+  function get_path() {
+    if ($this->get_option('inherit_panels_path')) {
+      return $_GET['q'];
+    }
+    return parent::get_path();
   }
 }
diff --git a/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_display_panel_pane.inc b/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_display_panel_pane.inc
index f8108a9bec2af81fa383009ecc2766d12081ae76..06225afbb9aaa5d09eb9614db55f52f9fb0bbf35 100644
--- a/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_display_panel_pane.inc
+++ b/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_display_panel_pane.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: views_content_plugin_display_panel_pane.inc,v 1.7 2011/01/01 01:27:38 merlinofchaos Exp $
 
 /**
  * The plugin that handles a panel_pane.
@@ -65,6 +64,10 @@ class views_content_plugin_display_panel_pane extends views_plugin_display {
 
     $categories['panel_pane'] = array(
       'title' => t('Pane settings'),
+      'column' => 'second',
+      'build' => array(
+        '#weight' => -10,
+      ),
     );
 
     $pane_title = $this->get_option('pane_title');
@@ -240,6 +243,9 @@ class views_content_plugin_display_panel_pane extends views_plugin_display {
         ctools_include('dependent');
         $form['argument_input']['#tree'] = TRUE;
 
+        $converters = ctools_context_get_all_converters();
+        ksort($converters);
+
         foreach ($argument_input as $id => $argument) {
           $form['argument_input'][$id] = array(
             '#tree' => TRUE,
@@ -262,14 +268,12 @@ class views_content_plugin_display_panel_pane extends views_plugin_display {
             '#title' => t('@arg source', array('@arg' => $argument['name'])),
             '#default_value' => $argument['type'],
           );
-
           $form['argument_input'][$id]['context'] = array(
             '#type' => 'select',
             '#title' => t('Required context'),
             '#description' => t('If "From context" is selected, which type of context to use.'),
             '#default_value' => $argument['context'],
-            '#options' => ctools_context_get_all_converters(),
-            '#process' => array('form_process_select', 'ctools_dependent_process'),
+            '#options' => $converters,
             '#dependency' => array($type_id => array('context')),
           );
 
@@ -278,7 +282,6 @@ class views_content_plugin_display_panel_pane extends views_plugin_display {
             '#title' => t('Context is optional'),
             '#description' => t('This context need not be present for the pane to function. If you plan to use this, ensure that the argument handler can handle empty values gracefully.'),
             '#default_value' => $argument['context_optional'],
-            '#process' => array('form_process_checkbox', 'ctools_dependent_process'),
             '#dependency' => array($type_id => array('context')),
           );
 
@@ -288,7 +291,6 @@ class views_content_plugin_display_panel_pane extends views_plugin_display {
             '#description' => t('If "From panel argument" is selected, which panel argument to use.'),
             '#default_value' => $argument['panel'],
             '#options' => array(0 => t('First'), 1 => t('Second'), 2 => t('Third'), 3 => t('Fourth'), 4 => t('Fifth'), 5 => t('Sixth')),
-            '#process' => array('form_process_select', 'ctools_dependent_process'),
             '#dependency' => array($type_id => array('panel')),
           );
 
@@ -297,7 +299,6 @@ class views_content_plugin_display_panel_pane extends views_plugin_display {
             '#title' => t('Fixed argument'),
             '#description' => t('If "Fixed" is selected, what to use as an argument.'),
             '#default_value' => $argument['fixed'],
-            '#process' => array('ctools_dependent_process'),
             '#dependency' => array($type_id => array('fixed')),
           );
 
@@ -306,7 +307,6 @@ class views_content_plugin_display_panel_pane extends views_plugin_display {
             '#title' => t('Label'),
             '#description' => t('If this argument is presented to the panels user, what label to apply to it.'),
             '#default_value' => empty($argument['label']) ? $argument['name'] : $argument['label'],
-            '#process' => array('ctools_dependent_process'),
             '#dependency' => array($type_id => array('user')),
           );
         }
diff --git a/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_style_ctools_context.inc b/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_style_ctools_context.inc
index ce79b583105632937400386e2949d833cbc65a2c..837f2e1775e07fe22aacedf425c9d8377179087d 100644
--- a/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_style_ctools_context.inc
+++ b/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_style_ctools_context.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: views_content_plugin_style_ctools_context.inc,v 1.2 2010/10/11 22:18:23 sdboyer Exp $
 /**
  * @file
  * Contains the default style plugin.
diff --git a/sites/all/modules/ctools/views_content/views_content.info b/sites/all/modules/ctools/views_content/views_content.info
index f7132f3c4aee6cf577e30709c06111722e5e4c0a..1da408bf2ced83ae735dacf05ca9784d161c90d7 100644
--- a/sites/all/modules/ctools/views_content/views_content.info
+++ b/sites/all/modules/ctools/views_content/views_content.info
@@ -1,4 +1,3 @@
-; $Id: views_content.info,v 1.6 2011/01/01 00:01:46 merlinofchaos Exp $
 name = Views content panes
 description = Allows Views content to be used in Panels, Dashboard and other modules which use the CTools Content API.
 package = Views
@@ -10,9 +9,9 @@ files[] = plugins/views/views_content_plugin_display_ctools_context.inc
 files[] = plugins/views/views_content_plugin_display_panel_pane.inc
 files[] = plugins/views/views_content_plugin_style_ctools_context.inc
 
-; Information added by drupal.org packaging script on 2011-01-06
-version = "7.x-1.0-alpha2"
+; Information added by drupal.org packaging script on 2011-05-31
+version = "7.x-1.0-beta1"
 core = "7.x"
 project = "ctools"
-datestamp = "1294276864"
+datestamp = "1306885315"
 
diff --git a/sites/all/modules/ctools/views_content/views_content.module b/sites/all/modules/ctools/views_content/views_content.module
index aee8ad1d3f8d7b5c7938026b3be4b97976a24131..e5074f5ff912bf9cd6ba83ee2803a9115554cac5 100644
--- a/sites/all/modules/ctools/views_content/views_content.module
+++ b/sites/all/modules/ctools/views_content/views_content.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: views_content.module,v 1.8 2010/11/01 18:51:22 merlinofchaos Exp $
 
 /**
  * @file views_content.module
@@ -166,6 +165,7 @@ function views_content_context_get_view(&$context) {
     $context->view = views_get_view($context->data['name']);
     if ($context->view) {
       $context->view->set_display($context->data['display']);
+      $context->view->set_arguments($context->data['args']);
     }
   }
 
@@ -183,3 +183,101 @@ function views_content_context_get_output(&$context) {
 
   return $context->output;
 }
+
+/**
+ * Get the title to display for a views content display for pane or context.
+ */
+function views_content_get_display_title($view, $display_id, $option = 'pane_title') {
+  $handler = $view->display[$display_id]->handler;
+  $title = $handler->get_option($option);
+  if (!$title) {
+    if ($handler->display->display_title == $handler->definition['title']) {
+      $title = t('View: @view', array('@view' => $view->get_human_name()));
+    }
+    else {
+      $title = t('View: @view: @display', array('@view' => $view->get_human_name(), '@display' => $handler->display->display_title));
+    }
+  }
+
+  return $title;
+}
+
+/**
+ * Get the proper label for a display.
+ *
+ * Views renamed the default to Master, but it can still have a conflicting
+ * display title. Fix that.
+ */
+function views_content_get_display_label($view, $display_id) {
+  $title = $display_id == 'default' ? t('Master') : $view->display[$display_id]->display_title;
+  return $title;
+}
+
+/**
+ * Get the child plugin for a view context display.
+ *
+ * This can return both the context and relationship style. The
+ * $required parameter is used to distinguish if context is required
+ * or not, so we know whether we need it suitable as a pure context
+ * (i.e, no context required) or a relationship (i.e, context required).
+ */
+function _views_content_get_context_from_display($view, $id, $parent, $required = TRUE) {
+  $title = views_content_get_display_title($view, $id, 'admin_title');
+
+  $description = $view->description;
+  $contexts = array();
+
+  $arguments = $view->display_handler->get_argument_input();
+  ctools_include('views');
+  foreach ($arguments as $argument) {
+    $argument['label'] = $argument['name'] ? $argument['name'] : '';
+    $contexts[] = ctools_views_get_argument_context($argument);
+  }
+
+  $pass = FALSE;
+  if ($required) {
+    // If context is required, make sure we have at least one optional
+    // or required context.
+    foreach ($contexts as $context) {
+      if (is_object($context)) {
+        $pass = TRUE;
+        break;
+      }
+    }
+
+    if (!$pass) {
+      return;
+    }
+  }
+  else {
+    // If context is not required, then having any required context
+    // causes a fail.
+    foreach ($contexts as $context) {
+      if (is_object($context) && get_class($context) == 'ctools_context_required') {
+        return;
+      }
+    }
+
+    // Since we know we don't want contexts, we an unset this now.
+    $contexts = array();
+  }
+
+  if ($required) {
+    $function = 'views_content_view_from_argument_context';
+  }
+  else {
+    $function = 'views_content_context_view_create';
+  }
+
+  return array(
+    'title' => $title,
+    'description' => filter_xss_admin($description),
+    'required context' => $contexts,
+    'keyword' => 'view',
+    'context' => $function,
+    'context name' => $view->name,
+    'name' => $parent . ':' . $view->name . '-' . $id,
+    'view name' => $view->name,
+    'view display id' => $id,
+  );
+}
diff --git a/sites/all/modules/google_analytics/README.txt b/sites/all/modules/google_analytics/README.txt
index a17a80eb262f1514c8d4b004844f20f6a0a3b6a2..1628cf780578b4c8ef87a0c6ca107b591086d043 100644
--- a/sites/all/modules/google_analytics/README.txt
+++ b/sites/all/modules/google_analytics/README.txt
@@ -1,4 +1,3 @@
-// $Id: README.txt,v 1.10.2.4 2011/02/07 16:56:27 hass Exp $
 
 Module: Google Analytics
 Author: Alexander Hass <http://drupal.org/user/85918>
@@ -39,9 +38,10 @@ default the following pages are listed for exclusion:
 
 admin
 admin/*
-user/*/*
+batch
 node/add*
 node/*/*
+user/*/*
 
 These defaults are changeable by the website administrator or any other
 user with 'administer google analytics' permission.
diff --git a/sites/all/modules/google_analytics/googleanalytics.admin.inc b/sites/all/modules/google_analytics/googleanalytics.admin.inc
index 4102eec83966f6a118a256f755f6e2b0ca6bd4e3..f690bcc4847fa20b171853854c959d3363b2e447 100644
--- a/sites/all/modules/google_analytics/googleanalytics.admin.inc
+++ b/sites/all/modules/google_analytics/googleanalytics.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: googleanalytics.admin.inc,v 1.24.2.28 2011/02/07 14:41:11 hass Exp $
 
 /**
  * @file
@@ -87,7 +86,7 @@ function googleanalytics_admin_settings_form($form_state) {
   // Page specific visibility configurations.
   $php_access = user_access('use PHP for tracking visibility');
   $visibility = variable_get('googleanalytics_visibility_pages', 0);
-  $pages = variable_get('googleanalytics_pages', '');
+  $pages = variable_get('googleanalytics_pages', GOOGLEANALYTICS_PAGES);
 
   $form['tracking']['page_vis_settings'] = array(
     '#type' => 'fieldset',
@@ -198,8 +197,8 @@ function googleanalytics_admin_settings_form($form_state) {
     '#title' => t('List of download file extensions'),
     '#title_display' => 'invisible',
     '#type' => 'textfield',
-    '#default_value' => variable_get('googleanalytics_trackfiles_extensions', GA_TRACKFILES_EXTENSIONS),
-    '#description' => t('A file extension list separated by the | character that will be tracked as download when clicked. Regular expressions are supported. For example: !extensions', array('!extensions' => GA_TRACKFILES_EXTENSIONS)),
+    '#default_value' => variable_get('googleanalytics_trackfiles_extensions', GOOGLEANALYTICS_TRACKFILES_EXTENSIONS),
+    '#description' => t('A file extension list separated by the | character that will be tracked as download when clicked. Regular expressions are supported. For example: !extensions', array('!extensions' => GOOGLEANALYTICS_TRACKFILES_EXTENSIONS)),
     '#maxlength' => 255,
   );
   $form['tracking']['linktracking']['googleanalytics_trackoutboundaspageview'] = array(
@@ -235,6 +234,24 @@ function googleanalytics_admin_settings_form($form_state) {
     '#default_value' => variable_get('googleanalytics_trackadsense', FALSE),
   );
 
+  // Privacy specific configurations.
+  $form['tracking']['privacy'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Privacy'),
+  );
+  $form['tracking']['privacy']['googleanalytics_tracker_anonymizeip'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Anonymize visitors IP address'),
+    '#description' => t('Tell Google Analytics to anonymize the information sent by the tracker objects by removing the last octet of the IP address prior to its storage. Note that this will slightly reduce the accuracy of geographic reporting. In some countries it is not allowed to collect personally identifying information for privacy reasons and this setting may help you to comply with the local laws.'),
+    '#default_value' => variable_get('googleanalytics_tracker_anonymizeip', 0),
+  );
+  $form['tracking']['privacy']['googleanalytics_privacy_donottrack'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Universal web tracking opt-out'),
+    '#description' => t('If enabled and your server receives the <a href="http://donottrack.us/">Do-Not-Track</a> header from the client browser, the Google Analytics module will not embed any tracking code into your site. Compliance with Do Not Track could be purely voluntary, enforced by industry self-regulation, or mandated by state or federal law. Please accept your visitors privacy. If they have opt-out from tracking and advertising, you should accept their personal decision. This feature is currently limited to logged in users and disabled page caching.'),
+    '#default_value' => variable_get('googleanalytics_privacy_donottrack', 1),
+  );
+
   // Backward compatibility only.
   // TODO: If currently not in use, hide the UI and later remove the code.
   $segmentation = variable_get('googleanalytics_segmentation', array());
@@ -268,6 +285,7 @@ function googleanalytics_admin_settings_form($form_state) {
   }
 
   $form['googleanalytics_custom_var'] = array(
+  	'#collapsed' => TRUE,
     '#collapsible' => TRUE,
     '#description' => t('You can add Google Analytics <a href="!custom_var_documentation">Custom Variables</a> here. These will be added to every page that Google Analytics tracking code appears on. Google Analytics will only accept custom variables if the <em>name</em> and <em>value</em> combined are less than 64 bytes after URL encoding. Keep the names as short as possible and expect long values to get trimmed. You may use tokens in custom variable values. Global and user tokens are always available; on node pages, node tokens are also available.', array('!custom_var_documentation' => 'http://code.google.com/intl/en/apis/analytics/docs/tracking/gaTrackingCustomVariables.html')),
     '#theme' => 'googleanalytics_admin_custom_var_table',
@@ -341,13 +359,6 @@ function googleanalytics_admin_settings_form($form_state) {
     '#collapsed' => TRUE,
   );
 
-  $form['advanced']['googleanalytics_tracker_anonymizeip'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Anonymize visitors IP address'),
-    '#description' => t('Tell Google Analytics to anonymize the information sent by the tracker objects by removing the last octet of the IP address prior to its storage. Note that this will slightly reduce the accuracy of geographic reporting. In some countries it is not allowed to collect personally identifying information for privacy reasons and this setting may help you to comply with the local laws.'),
-    '#default_value' => variable_get('googleanalytics_tracker_anonymizeip', 0),
-  );
-
   $form['advanced']['googleanalytics_cache'] = array(
     '#type' => 'checkbox',
     '#title' => t('Locally cache tracking code file'),
diff --git a/sites/all/modules/google_analytics/googleanalytics.admin.js b/sites/all/modules/google_analytics/googleanalytics.admin.js
index 3571c8c9294c71ac92565ad2627d1fefaaeb95ff..796eee6ac94a273bb22157709dcfea7a9b7f7df7 100644
--- a/sites/all/modules/google_analytics/googleanalytics.admin.js
+++ b/sites/all/modules/google_analytics/googleanalytics.admin.js
@@ -1,4 +1,3 @@
-// $Id: googleanalytics.admin.js,v 1.1.2.7 2011/02/07 15:20:57 hass Exp $
 (function ($) {
 
 /**
@@ -98,6 +97,20 @@ Drupal.behaviors.trackingSettingsSummary = {
         return Drupal.t('Multiple top-level domains');
       }
     });
+
+    $('fieldset#edit-privacy', context).drupalSetSummary(function (context) {
+      var vals = [];
+      if ($('input#edit-googleanalytics-tracker-anonymizeip', context).is(':checked')) {
+        vals.push('Anonymize IP');
+      }
+      if ($('input#edit-googleanalytics-privacy-donottrack', context).is(':checked')) {
+        vals.push('Universal web tracking opt-out');
+      }
+      if (!vals.length) {
+        return Drupal.t('No privacy');
+      }
+      return Drupal.t('@items enabled', {'@items' : vals.join(', ')});
+    });
   }
 };
 
diff --git a/sites/all/modules/google_analytics/googleanalytics.info b/sites/all/modules/google_analytics/googleanalytics.info
index b0bd35f37915bcbe2978553481e634b615cbe831..0888a39ed41978efe7544aff724e12b007829349 100644
--- a/sites/all/modules/google_analytics/googleanalytics.info
+++ b/sites/all/modules/google_analytics/googleanalytics.info
@@ -1,4 +1,3 @@
-; $Id: googleanalytics.info,v 1.12.2.3 2011/01/02 22:01:30 hass Exp $
 name = "Google Analytics"
 description = Allows your site to be tracked by Google Analytics by adding a Javascript tracking code to every page.
 core = 7.x
@@ -6,9 +5,9 @@ package = Statistics
 configure = admin/config/system/googleanalytics
 files[] = googleanalytics.test
 
-; Information added by drupal.org packaging script on January 1, 1970 - 00:00
-version = "7.x-1.1"
+; Information added by drupal.org packaging script on 2011-03-28
+version = "7.x-1.2"
 core = "7.x"
 project = "google_analytics"
-datestamp = "1297103606"
+datestamp = "1301340367"
 
diff --git a/sites/all/modules/google_analytics/googleanalytics.install b/sites/all/modules/google_analytics/googleanalytics.install
index fafba6f0ca3702af1112181773377fb1809092e6..ebb900649151679fec47c1856353012ca91a1977 100644
--- a/sites/all/modules/google_analytics/googleanalytics.install
+++ b/sites/all/modules/google_analytics/googleanalytics.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: googleanalytics.install,v 1.22.2.16 2011/02/07 14:29:06 hass Exp $
 
 /**
  * @file
@@ -10,19 +9,6 @@
  * Implements hook_install().
  */
 function googleanalytics_install() {
-  variable_set('googleanalytics_visibility_roles', 0);
-  variable_set('googleanalytics_visibility_pages', 0);
-
-  // Remove tracking from all administrative pages, see http://drupal.org/node/34970.
-  $pages = array(
-    'admin',
-    'admin/*',
-    'user/*/*',
-    'node/add*',
-    'node/*/*',
-  );
-  variable_set('googleanalytics_pages', implode("\n", $pages));
-
   // By German laws it's always best to enable the anonymizing of IP addresses.
   // NOTE: If this is also an important default setting in other countries, please let us know!
   $countries = array(
@@ -43,7 +29,7 @@ function googleanalytics_uninstall() {
   variable_del('googleanalytics_codesnippet_after');
   variable_del('googleanalytics_cross_domains');
   variable_del('googleanalytics_custom');
-  variable_del('googleanalytics_custom_vars');
+  variable_del('googleanalytics_custom_var');
   variable_del('googleanalytics_domain_mode');
   variable_del('googleanalytics_js_scope');
   variable_del('googleanalytics_last_cache');
@@ -396,3 +382,35 @@ function googleanalytics_update_7004() {
 
   return t('Renamed "googleanalytics_visibility" settings variable to googleanalytics_visibility_pages.');
 }
+
+/**
+ * Path visibility filter setting should hide "batch" path.
+ */
+function googleanalytics_update_7005() {
+  // Current pages setting.
+  $pages = array(
+    'admin',
+    'admin/*',
+    'user/*/*',
+    'node/add*',
+    'node/*/*',
+  );
+
+  $diff = array_diff($pages, preg_split('/(\r\n?|\n)/', variable_get('googleanalytics_pages', implode("\n", $pages))));
+  if (empty($diff)) {
+    // No diff to previous settings found. Update with new settings.
+    $pages = array(
+      'admin',
+      'admin/*',
+      'batch',
+      'node/add*',
+      'node/*/*',
+      'user/*/*',
+    );
+    variable_set('googleanalytics_pages', implode("\n", $pages));
+    return t('Added "batch" to path visibility filter setting.');
+  }
+  else {
+    return t('Custom path visibility filter setting found. Update skipped!');
+  }
+}
diff --git a/sites/all/modules/google_analytics/googleanalytics.js b/sites/all/modules/google_analytics/googleanalytics.js
index 3e8ca35a0f004e8025fdeca8ac13a01c3d20d3b0..ba4e88caa182afeaee46943b835d7b207d988992 100644
--- a/sites/all/modules/google_analytics/googleanalytics.js
+++ b/sites/all/modules/google_analytics/googleanalytics.js
@@ -1,4 +1,3 @@
-// $Id: googleanalytics.js,v 1.11.2.8 2011/02/06 19:22:05 hass Exp $
 (function ($) {
 
 $(document).ready(function() {
@@ -8,13 +7,13 @@ $(document).ready(function() {
   // characters are [ ] { } ( ) * + ? - . , \ ^ $ # and whitespace. The character | is excluded
   // in this function as it's used to separate the domains names.
   RegExp.escapeDomains = function(text) {
-    return text.replace(/[-[\]{}()*+?.,\\^$#\s]/g, "\\$&");
+    return (text) ? text.replace(/[-[\]{}()*+?.,\\^$#\s]/g, "\\$&") : '';
   }
 
   // Attach onclick event to document only and catch clicks on all elements.
   $(document.body).click(function(event) {
-    // Catch only the first parent link of a clicked element.
-    $(event.target).parents("a:first,area:first").andSelf().filter("a,area").each(function() {
+    // Catch the closest surrounding link of a clicked element.
+    $(event.target).closest("a,area").each(function() {
 
       var ga = Drupal.settings.googleanalytics;
       // Expression to check for absolute internal links.
@@ -37,7 +36,6 @@ $(document).ready(function() {
         else if (isInternalSpecial.test(this.href)) {
           // Keep the internal URL for Google Analytics website overlay intact.
           _gaq.push(["_trackPageview", this.href.replace(isInternal, '')]);
-          setTimeout('document.location = "' + this.href + '"', 100);
         }
       }
       else {
@@ -47,26 +45,17 @@ $(document).ready(function() {
         }
         else if (ga.trackOutbound && this.href) {
           if (ga.trackDomainMode == 2 && isCrossDomain.test(this.href)) {
-            // Top-level cross domain clicked.
+            // Top-level cross domain clicked. document.location is handled by _link internally.
             _gaq.push(["_link", this.href]);
           }
           else if (ga.trackOutboundAsPageview) {
             // Track all external links as page views after URL cleanup.
             // Currently required, if click should be tracked as goal.
             _gaq.push(["_trackPageview", '/outbound/' + this.href.replace(/^(https?|ftp|news|nntp|telnet|irc|ssh|sftp|webcal):\/\//i, '').split('/').join('--')]);
-            setTimeout('document.location = "' + this.href + '"', 100);
           }
           else {
             // External link clicked.
             _gaq.push(["_trackEvent", "Outbound links", "Click", this.href]);
-
-            // First, delay the outbound click by a fraction of a second.
-            // This delay will hardly be noticeable by the user, but it will provide the
-            // browser more time load the tracking code. Without this method, it's possible
-            // that a user can click on the outbound link before the tracking code loads,
-            // in which case the event will not be recorded.
-            // See http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55527
-            setTimeout('document.location = "' + this.href + '"', 100);
           }
         }
       }
diff --git a/sites/all/modules/google_analytics/googleanalytics.module b/sites/all/modules/google_analytics/googleanalytics.module
index a00c2ff49738c6ad9c41e908931691b0e758f51c..918135f26e81e9c30a92c9f2e247aa5df639de85 100644
--- a/sites/all/modules/google_analytics/googleanalytics.module
+++ b/sites/all/modules/google_analytics/googleanalytics.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: googleanalytics.module,v 1.70.2.13 2011/02/07 17:30:49 hass Exp $
 
 /*
  * @file
@@ -10,7 +9,10 @@
  * @author: Alexander Hass <http://drupal.org/user/85918>
  */
 
-define('GA_TRACKFILES_EXTENSIONS', '7z|aac|arc|arj|asf|asx|avi|bin|csv|doc|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|msi|msp|pdf|phps|png|ppt|qtm?|ra(m|r)?|sea|sit|tar|tgz|torrent|txt|wav|wma|wmv|wpd|xls|xml|z|zip');
+define('GOOGLEANALYTICS_TRACKFILES_EXTENSIONS', '7z|aac|arc|arj|asf|asx|avi|bin|csv|doc|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|msi|msp|pdf|phps|png|ppt|qtm?|ra(m|r)?|sea|sit|tar|tgz|torrent|txt|wav|wma|wmv|wpd|xls|xml|z|zip');
+
+// Remove tracking from all administrative pages, see http://drupal.org/node/34970.
+define('GOOGLEANALYTICS_PAGES', "admin\nadmin/*\nbatch\nnode/add*\nnode/*/*\nuser/*/*");
 
 /**
  * Implements hook_help().
@@ -107,7 +109,7 @@ function googleanalytics_page_alter(&$page) {
     if ($track_mailto = variable_get('googleanalytics_trackmailto', 1)) {
       $link_settings['trackMailto'] = $track_mailto;
     }
-    if (($track_download = variable_get('googleanalytics_trackfiles', 1)) && ($trackfiles_extensions = variable_get('googleanalytics_trackfiles_extensions', GA_TRACKFILES_EXTENSIONS))) {
+    if (($track_download = variable_get('googleanalytics_trackfiles', 1)) && ($trackfiles_extensions = variable_get('googleanalytics_trackfiles_extensions', GOOGLEANALYTICS_TRACKFILES_EXTENSIONS))) {
       $link_settings['trackDownload'] = $track_download;
       $link_settings['trackDownloadExtensions'] = $trackfiles_extensions;
     }
@@ -150,7 +152,7 @@ function googleanalytics_page_alter(&$page) {
     // Site search tracking support.
     $url_custom = '';
     if (module_exists('search') && variable_get('googleanalytics_site_search', FALSE) && arg(0) == 'search' && $keys = googleanalytics_search_get_keys()) {
-      $url_custom = drupal_json_encode(rawurldecode(url('search/' . arg(1), array('query' => array('search' => $keys)))));
+      $url_custom = '(window.googleanalytics_search_results) ? ' . drupal_json_encode(url('search/' . arg(1), array('query' => array('search' => $keys)))) . ' : ' . drupal_json_encode(url('search/' . arg(1), array('query' => array('search' => 'no-results:' . $keys, 'cat' => 'no-results'))));
     }
 
     // If this node is a translation of another node, pass the original
@@ -239,12 +241,12 @@ function googleanalytics_page_alter(&$page) {
     if (!empty($segmentation)) {
       $script .= $segmentation;
     }
-    if (!empty($codesnippet_before)) {
-      $script .= $codesnippet_before;
-    }
     if (!empty($custom_var)) {
       $script .= $custom_var;
     }
+    if (!empty($codesnippet_before)) {
+      $script .= $codesnippet_before;
+    }
     if (empty($url_custom)) {
       $script .= '_gaq.push(["_trackPageview"]);';
     }
@@ -309,11 +311,25 @@ function googleanalytics_form_user_profile_form_alter(&$form, &$form_state) {
         break;
     }
 
+    // Disable tracking for visitors who have opted out from tracking via DNT (Do-Not-Track) header.
+    $disabled = FALSE;
+    if (variable_get('googleanalytics_privacy_donottrack', 1) && !empty($_SERVER['HTTP_DNT'])) {
+      $disabled = TRUE;
+
+      // Override settings value.
+      $account->data['googleanalytics']['custom'] = FALSE;
+
+      $description .= '<span class="admin-disabled">';
+      $description .= ' ' . t('You have opted out from tracking via browser privacy settings.');
+      $description .= '</span>';
+    }
+
     $form['googleanalytics']['custom'] = array(
       '#type' => 'checkbox',
       '#title' => t('Enable user tracking'),
       '#description' => $description,
-      '#default_value' => isset($account->data['googleanalytics']['custom']) ? $account->data['googleanalytics']['custom'] : ($custom == 1)
+      '#default_value' => isset($account->data['googleanalytics']['custom']) ? $account->data['googleanalytics']['custom'] : ($custom == 1),
+      '#disabled' => $disabled,
     );
 
     return $form;
@@ -340,6 +356,36 @@ function googleanalytics_cron() {
   }
 }
 
+/**
+ * Implements hook_preprocess_search_results().
+ *
+ * Collects and adds the number of search results to the head.
+ */
+function googleanalytics_preprocess_search_results(&$variables) {
+  // There is no search result $variable available that hold the number of items
+  // found. But the pager item mumber can tell the number of search results.
+  global $pager_total_items;
+
+  drupal_add_js('window.googleanalytics_search_results = ' . intval($pager_total_items[0]) . ';', array('type' => 'inline', 'group' => JS_LIBRARY-1));
+}
+
+/**
+ * Helper function for grabbing search keys. Function is missing in D7.
+ *
+ * http://api.drupal.org/api/function/search_get_keys/6
+ */
+function googleanalytics_search_get_keys() {
+  static $return;
+  if (!isset($return)) {
+    // Extract keys as remainder of path
+    // Note: support old GET format of searches for existing links.
+    $path = explode('/', $_GET['q'], 3);
+    $keys = empty($_REQUEST['keys']) ? '' : $_REQUEST['keys'];
+    $return = count($path) == 3 ? $path[2] : $keys;
+  }
+  return $return;
+}
+
 /**
  * Download/Synchronize/Cache tracking code file locally.
  *
@@ -409,23 +455,6 @@ function googleanalytics_clear_js_cache() {
   }
 }
 
-/**
- * Helper function for grabbing search keys. Function is missing in D7.
- *
- * http://api.drupal.org/api/function/search_get_keys/6
- */
-function googleanalytics_search_get_keys() {
-  static $return;
-  if (!isset($return)) {
-    // Extract keys as remainder of path
-    // Note: support old GET format of searches for existing links.
-    $path = explode('/', $_GET['q'], 3);
-    $keys = empty($_REQUEST['keys']) ? '' : $_REQUEST['keys'];
-    $return = count($path) == 3 ? $path[2] : $keys;
-  }
-  return $return;
-}
-
 /**
  * Tracking visibility check for an user object.
  *
@@ -439,7 +468,7 @@ function _googleanalytics_visibility_user($account) {
   $enabled = FALSE;
 
   // Is current user a member of a role that should be tracked?
-  if (_googleanalytics_visibility_roles($account)) {
+  if (_googleanalytics_visibility_header($account) && _googleanalytics_visibility_roles($account)) {
 
     // Use the user's block visibility setting, if necessary.
     if (($custom = variable_get('googleanalytics_custom', 0)) != 0) {
@@ -499,7 +528,7 @@ function _googleanalytics_visibility_pages() {
   if (!isset($page_match)) {
 
     $visibility = variable_get('googleanalytics_visibility_pages', 0);
-    $setting_pages = variable_get('googleanalytics_pages', '');
+    $setting_pages = variable_get('googleanalytics_pages', GOOGLEANALYTICS_PAGES);
 
     // Match path if necessary.
     if (!empty($setting_pages)) {
@@ -533,3 +562,18 @@ function _googleanalytics_visibility_pages() {
   }
   return $page_match;
 }
+
+/**
+ * Based on headers send by clients this function returns TRUE if GA code should
+ * be added to the current page and otherwise FALSE.
+ */
+function _googleanalytics_visibility_header($account) {
+
+  if (($account->uid || variable_get('cache', 0) == 0) && variable_get('googleanalytics_privacy_donottrack', 1) && !empty($_SERVER['HTTP_DNT'])) {
+    // Disable tracking if caching is disabled or a visitors is logged in and
+    // have opted out from tracking via DNT (Do-Not-Track) header.
+    return FALSE;
+  }
+
+  return TRUE;
+}
diff --git a/sites/all/modules/google_analytics/googleanalytics.test b/sites/all/modules/google_analytics/googleanalytics.test
index 22d3f3b59320a3255586936c8bc34a181c753baa..9015f4dfa77203f8c349b482d7afa4c31d84d29e 100644
--- a/sites/all/modules/google_analytics/googleanalytics.test
+++ b/sites/all/modules/google_analytics/googleanalytics.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: googleanalytics.test,v 1.2.2.8 2011/02/07 14:11:43 hass Exp $
 
 /**
  * @file
@@ -44,7 +43,7 @@ class GoogleAnalyticsBasicTest extends DrupalWebTestCase {
     variable_set('googleanalytics_account', $ua_code);
 
     // Show tracking on "every page except the listed pages".
-    variable_set('googleanalytics_visibility', 0);
+    variable_set('googleanalytics_visibility_pages', 0);
     // Disable tracking one "admin*" pages only.
     variable_set('googleanalytics_pages', "admin\nadmin/*");
     // Enable tracking only for authenticated users only.
@@ -62,7 +61,7 @@ class GoogleAnalyticsBasicTest extends DrupalWebTestCase {
     $this->assertNoRaw('google-analytics.com/ga.js', '[testGoogleAnalyticsPageVisibility]: Tracking code is not displayed on admin subpage.');
 
     // Test whether tracking code display is properly flipped.
-    variable_set('googleanalytics_visibility', 1);
+    variable_set('googleanalytics_visibility_pages', 1);
     $this->drupalGet('admin');
     $this->assertRaw($ua_code, '[testGoogleAnalyticsPageVisibility]: Tracking code is displayed on admin page.');
     $this->drupalGet('admin/config/system/googleanalytics');
@@ -77,7 +76,7 @@ class GoogleAnalyticsBasicTest extends DrupalWebTestCase {
     $this->assertNoRaw($ua_code, '[testGoogleAnalyticsPageVisibility]: Tracking code is NOT displayed for anonymous.');
 
     // Switch back to every page except the listed pages.
-    variable_set('googleanalytics_visibility', 0);
+    variable_set('googleanalytics_visibility_pages', 0);
     // Enable tracking code for all user roles.
     variable_set('googleanalytics_roles', array());
 
@@ -95,7 +94,7 @@ class GoogleAnalyticsBasicTest extends DrupalWebTestCase {
     variable_set('googleanalytics_account', $ua_code);
 
     // Show tracking code on every page except the listed pages.
-    variable_set('googleanalytics_visibility', 0);
+    variable_set('googleanalytics_visibility_pages', 0);
     // Enable tracking code for all user roles.
     variable_set('googleanalytics_roles', array());
 
diff --git a/sites/all/modules/google_analytics/googleanalytics.tokens.inc b/sites/all/modules/google_analytics/googleanalytics.tokens.inc
index 2af09110d82683a8b33847e7cd3aef44bf6aadd7..0ab195cb4d95805c5d3ca1d3fdd338bccdff4231 100644
--- a/sites/all/modules/google_analytics/googleanalytics.tokens.inc
+++ b/sites/all/modules/google_analytics/googleanalytics.tokens.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: googleanalytics.tokens.inc,v 1.1.2.4 2011/02/07 15:33:38 hass Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/imce/README.txt b/sites/all/modules/imce/README.txt
index 1c7f1c0c85c12e4cbe325837c6db9dc5901b246c..ac82c125f192409eb9593475ac3edfaff3b207ad 100644
--- a/sites/all/modules/imce/README.txt
+++ b/sites/all/modules/imce/README.txt
@@ -1,4 +1,3 @@
-// $Id: README.txt,v 1.18.2.1 2010/11/08 04:37:21 ufku Exp $
 
 IMCE
 http://drupal.org/project/imce
diff --git a/sites/all/modules/imce/css/imce-content.css b/sites/all/modules/imce/css/imce-content.css
index 6aae3e5b02ddeac829c716f84dfba305cd9b8505..f746e0de381b6398535f5f3d61a43481deddc284 100644
--- a/sites/all/modules/imce/css/imce-content.css
+++ b/sites/all/modules/imce/css/imce-content.css
@@ -1,10 +1,10 @@
-/* $Id: imce-content.css,v 1.9 2010/10/09 05:47:47 ufku Exp $ */
 
 /*Body*/
 body.imce {
   padding: 2px;
   background: none;
   text-align: left;
+  height: auto;
 }
 
 /*Main container*/
@@ -253,6 +253,9 @@ body.imce {
   background-color: #07f;
   color: #fff;
 }
+#file-list tr.selected span {
+  color: #fff;
+}
 #file-list td.name img {
   vertical-align: middle;
   margin-right: 3px;
@@ -305,6 +308,7 @@ body.imce {
 #ops-list a span {
   display: inline-block;
   color: #0e1f43;
+  padding-left: 1px;
 }
 #ops-list li.loading a {
   background-image: url(loading.gif);
diff --git a/sites/all/modules/imce/imce.info b/sites/all/modules/imce/imce.info
index 56461245d39541223ea62f6fe66d40deb3a0c826..30a923f690260c39f99c3e66e00c1bf667606266 100644
--- a/sites/all/modules/imce/imce.info
+++ b/sites/all/modules/imce/imce.info
@@ -1,13 +1,12 @@
-; $Id: imce.info,v 1.7.2.2 2011/01/13 09:09:40 ufku Exp $
 name = "IMCE"
 description = "An image/file uploader and browser supporting personal directories and user quota."
 core = "7.x"
 package = "Media"
 configure = "admin/config/media/imce"
 
-; Information added by drupal.org packaging script on January 1, 1970 - 00:00
-version = "7.x-1.2"
+; Information added by drupal.org packaging script on 2011-06-06
+version = "7.x-1.4"
 core = "7.x"
 project = "imce"
-datestamp = "1296601518"
+datestamp = "1307386616"
 
diff --git a/sites/all/modules/imce/imce.install b/sites/all/modules/imce/imce.install
index 458119f9a32cd9de913b35de5cc180be79eeff8f..865236bb6381541721dfa2e1bcbae735c7865611 100644
--- a/sites/all/modules/imce/imce.install
+++ b/sites/all/modules/imce/imce.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: imce.install,v 1.8.2.1 2011/01/18 08:56:19 ufku Exp $
 
 /**
  * @file
@@ -82,7 +81,13 @@ function imce_update_7001(&$sandbox) {
     $file->uri = file_stream_wrapper_uri_normalize($scheme . $relpath);
     unset($file->filepath);
     if (!db_query("SELECT 1 FROM {file_managed} WHERE fid = :fid", array(':fid' => $file->fid))->fetchField()) {
-      drupal_write_record('file_managed', $file);
+      // Check duplicate uri
+      if ($fid = db_query("SELECT fid FROM {file_managed} WHERE uri = :uri", array(':uri' => $file->uri))->fetchField()) {
+        $file->fid = $fid;
+      }
+      else {
+        drupal_write_record('file_managed', $file);
+      }
     }
     file_usage_add($file, 'imce', 'file', $file->fid);
     $sandbox['progress']++;
diff --git a/sites/all/modules/imce/imce.module b/sites/all/modules/imce/imce.module
index 1632e94d1c4f8dbdc49bd1a04bc8a184c7467b27..fe93a1204a4b0cef71cd755bec7ee1489705f870 100644
--- a/sites/all/modules/imce/imce.module
+++ b/sites/all/modules/imce/imce.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: imce.module,v 1.36 2010/10/09 05:48:35 ufku Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/imce/inc/imce.admin.inc b/sites/all/modules/imce/inc/imce.admin.inc
index 3dd437823b573d625afa8012d706a66d4c0df41c..4ff3077bb9c9ebe1ac21cab47327877f6a00f9a9 100644
--- a/sites/all/modules/imce/inc/imce.admin.inc
+++ b/sites/all/modules/imce/inc/imce.admin.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: imce.admin.inc,v 1.7.2.1 2010/12/12 07:14:44 ufku Exp $
 
 /**
  * @file
@@ -283,10 +282,30 @@ function imce_profile_form($form, &$form_state, $pid = 0) {
   $form = array('profile' => $form);
   $form['pid'] = array('#type' => 'hidden', '#value' => $pid);
   $form['submit'] = array('#type' => 'submit', '#value' => t('Save configuration'));
+  $form['#validate'][] = 'imce_profile_validate';
   $form['#submit'][] = 'imce_profile_submit';
   return $form;
 }
 
+/**
+ * Profile form validate.
+ */
+function imce_profile_validate($form, &$form_state) {
+  $profile = &$form_state['values']['profile'];
+  $dim_re = '/^\d+x\d+$/';
+  $dim_error = t('Dimensions must be specified in <kbd>WIDTHxHEIGHT</kbd> format.');
+  // Check max image dimensions
+  if ($profile['dimensions'] && !preg_match($dim_re, $profile['dimensions'])) {
+    return form_set_error('profile][dimensions', $dim_error);
+  }
+  // Check thumbnails dimensions
+  foreach ($profile['thumbnails'] as $i => $thumb) {
+    if (trim($thumb['name']) != '' && !preg_match($dim_re, $thumb['dimensions'])) {
+      return form_set_error("profile][thumbnails][$i][dimensions", $dim_error);
+    }
+  }
+}
+
 /**
  * Profile form submit.
  */
@@ -598,7 +617,7 @@ function imce_update_profiles($pid, $profile = NULL) {
 function imce_clean_profile_fields(&$profile) {
   $clean = array();
   foreach ($profile['thumbnails'] as $thumb) {
-    if (trim($thumb['name']) != '' && preg_match('/^\d+x\d+$/', $thumb['dimensions'])) {
+    if (trim($thumb['name']) != '') {
       $clean[] = $thumb;
     }
   }
diff --git a/sites/all/modules/imce/inc/imce.core.profiles.inc b/sites/all/modules/imce/inc/imce.core.profiles.inc
index 39247a3165f0795b0fcb4d53a422521c2816792a..7495773397a839a6c34b9f381c65f33baf0302eb 100644
--- a/sites/all/modules/imce/inc/imce.core.profiles.inc
+++ b/sites/all/modules/imce/inc/imce.core.profiles.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: imce.core.profiles.inc,v 1.3 2010/05/14 19:57:24 ufku Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/imce/inc/imce.js.inc b/sites/all/modules/imce/inc/imce.js.inc
index 08b5e70eda0a93c03dffbc2e058c75427145df5b..fce9d7292044dd201e58c4ddfc9226e85f6a8fc7 100644
--- a/sites/all/modules/imce/inc/imce.js.inc
+++ b/sites/all/modules/imce/inc/imce.js.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: imce.js.inc,v 1.2 2010/03/17 21:36:38 ufku Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/imce/inc/imce.page.inc b/sites/all/modules/imce/inc/imce.page.inc
index b4dc6d044ed5425423f5c7f1cde69f9cffd1f1b3..c5b6907c68dc9c4068d63d2bd899c9c9892d168b 100644
--- a/sites/all/modules/imce/inc/imce.page.inc
+++ b/sites/all/modules/imce/inc/imce.page.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: imce.page.inc,v 1.10.2.4 2011/01/10 13:03:02 ufku Exp $
 
 /**
  * @file
@@ -876,11 +875,14 @@ function imce_directory_info($dirname, $imce) {
   }
 
   $info = FALSE;
-  if (imce_reg_dir($dirname) && file_prepare_directory(imce_dir_uri($imce, $dirname))) {
-    foreach ($imce['directories'] as $name => $prop) {
-      if ($prop['subnav'] && ($name == '.' || strpos($dirname . '/', $name . '/') === 0)) {
-        $info = $prop;
-        $info['name'] = $dirname;
+  if (imce_reg_dir($dirname)) {
+    $diruri = imce_dir_uri($imce, $dirname);
+    if (file_prepare_directory($diruri)) {
+      foreach ($imce['directories'] as $name => $prop) {
+        if ($prop['subnav'] && ($name == '.' || strpos($dirname . '/', $name . '/') === 0)) {
+          $info = $prop;
+          $info['name'] = $dirname;
+        }
       }
     }
   }
diff --git a/sites/all/modules/imce/js/imce.js b/sites/all/modules/imce/js/imce.js
index 91552233a159b5e75b0c334b0eb535962e674412..2a2f9b4011c74df0eddae5583effeaf7e5d3993e 100644
--- a/sites/all/modules/imce/js/imce.js
+++ b/sites/all/modules/imce/js/imce.js
@@ -1,4 +1,3 @@
-// $Id: imce.js,v 1.26.2.2 2010/12/12 07:15:56 ufku Exp $
 
 (function($) {
 //Global container.
@@ -329,7 +328,7 @@ opClick: function(name) {
       });
     });
     var diff = left + $opcon.width() - $('#imce-content').width();
-    $opcon.css({left: diff > 0 ? left - diff : left});
+    $opcon.css({left: diff > 0 ? left - diff - 1 : left});
     $(Op.li).addClass('active');
     $(imce.opCloseLink).fadeIn(300);
     imce.vars.op = name;
@@ -554,9 +553,9 @@ setMessage: function (msg, type) {
     $box.css({opacity: 0, display: 'block'}).html(msg);
     $box.dequeue();
   });
-  var q = $box.queue().length;
+  var q = $box.queue().length, t = imce.vars.msgT || 1000;
   q = q < 2 ? 1 : q < 3 ? 0.8 : q < 4 ? 0.7 : 0.4;//adjust speed with respect to queue length
-  $box.fadeTo(600 * q, 1).fadeTo(1000 * q, 1).fadeOut(400 * q);
+  $box.fadeTo(600 * q, 1).fadeTo(t * q, 1).fadeOut(400 * q);
   $(logs).append(msg);
   return false;
 },
diff --git a/sites/all/modules/imce/js/imce_extras.js b/sites/all/modules/imce/js/imce_extras.js
index 4f736e5f7f2d4da0a050610374ba1f5e4374811d..349de2d1edc48d94be6d3204246c907aec100ef5 100644
--- a/sites/all/modules/imce/js/imce_extras.js
+++ b/sites/all/modules/imce/js/imce_extras.js
@@ -1,4 +1,3 @@
-// $Id: imce_extras.js,v 1.9 2010/10/06 04:42:57 ufku Exp $
 //This pack implemets: keyboard shortcuts, file sorting, resize bars, and inline thumbnail preview.
 
 (function($) {
diff --git a/sites/all/modules/imce/js/imce_set_app.js b/sites/all/modules/imce/js/imce_set_app.js
index 667294c1f48738e8cdb57566c3595a5b93c395f1..239086881d8a9a4914e27e795cea8bf9102e6a0a 100644
--- a/sites/all/modules/imce/js/imce_set_app.js
+++ b/sites/all/modules/imce/js/imce_set_app.js
@@ -1,4 +1,3 @@
-// $Id: imce_set_app.js,v 1.8.2.1 2010/12/12 07:14:44 ufku Exp $
 /*
  * IMCE Integration by URL
  * Ex-1: http://example.com/imce?app=XEditor|url@urlFieldId|width@widthFieldId|height@heightFieldId
diff --git a/sites/all/modules/imce/js/imce_set_inline.js b/sites/all/modules/imce/js/imce_set_inline.js
index 462efef1307dfd03fff4572420b17fe1dbfcdf7d..82706b74ccfbc519d4ecb41344e7f6718d4d4de8 100644
--- a/sites/all/modules/imce/js/imce_set_inline.js
+++ b/sites/all/modules/imce/js/imce_set_inline.js
@@ -1,11 +1,10 @@
-// $Id: imce_set_inline.js,v 1.5 2010/06/02 08:29:40 ufku Exp $
-
 (function($) {
 
 var ii = window.imceInline = {};
 
-ii.initiate = function() {
-  $('div.imce-inline-wrapper').show().find('a').click(function() {
+// Drupal behavior
+Drupal.behaviors.imceInline = {attach: function(context, settings) {
+  $('div.imce-inline-wrapper', context).not('.processed').addClass('processed').show().find('a').click(function() {
     var i = this.name.indexOf('-IMCE-');
     ii.activeTextarea = $('#'+ this.name.substr(0, i)).get(0);
     ii.activeType = this.name.substr(i+6);
@@ -17,7 +16,7 @@ ii.initiate = function() {
     ii.pop.focus();
     return false;
   });
-};
+}};
 
 //function to be executed when imce loads.
 ii.load = function(win) {
@@ -56,6 +55,4 @@ ii.insert = function (file, win) {
   ii.insertAtCursor(ii.activeTextarea, html, type);
 };
 
-$(document).ready(ii.initiate);
-
 })(jQuery);
\ No newline at end of file
diff --git a/sites/all/modules/imce/js/jquery.form.js b/sites/all/modules/imce/js/jquery.form.js
index 17597c8b7be8ca727c217090d328c87cf4ce25b4..69bf8997c048e2d37be515b626e833041d082ff0 100644
--- a/sites/all/modules/imce/js/jquery.form.js
+++ b/sites/all/modules/imce/js/jquery.form.js
@@ -1,7 +1,6 @@
-//$Id: jquery.form.js,v 1.2 2010/03/17 21:36:38 ufku Exp $
 /*
  * jQuery Form Plugin
- * version: 2.43 (12-MAR-2010)
+ * version: 2.67 (12-MAR-2011)
  * @requires jQuery v1.3.2 or later
  */
-(function(b){b.fn.ajaxSubmit=function(s){if(!this.length){a("ajaxSubmit: skipping submit process - no element selected");return this}if(typeof s=="function"){s={success:s}}var e=b.trim(this.attr("action"));if(e){e=(e.match(/^([^#]+)/)||[])[1]}e=e||window.location.href||"";s=b.extend({url:e,type:this.attr("method")||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},s||{});var u={};this.trigger("form-pre-serialize",[this,s,u]);if(u.veto){a("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(s.beforeSerialize&&s.beforeSerialize(this,s)===false){a("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var m=this.formToArray(s.semantic);if(s.data){s.extraData=s.data;for(var f in s.data){if(s.data[f] instanceof Array){for(var g in s.data[f]){m.push({name:f,value:s.data[f][g]})}}else{m.push({name:f,value:s.data[f]})}}}if(s.beforeSubmit&&s.beforeSubmit(m,this,s)===false){a("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[m,this,s,u]);if(u.veto){a("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var d=b.param(m);if(s.type.toUpperCase()=="GET"){s.url+=(s.url.indexOf("?")>=0?"&":"?")+d;s.data=null}else{s.data=d}var t=this,l=[];if(s.resetForm){l.push(function(){t.resetForm()})}if(s.clearForm){l.push(function(){t.clearForm()})}if(!s.dataType&&s.target){var p=s.success||function(){};l.push(function(k){var j=s.replaceTarget?"replaceWith":"html";b(s.target)[j](k).each(p,arguments)})}else{if(s.success){l.push(s.success)}}s.success=function(q,k,v){for(var n=0,j=l.length;n<j;n++){l[n].apply(s,[q,k,v||t,t])}};var c=b("input:file",this).fieldValue();var r=false;for(var i=0;i<c.length;i++){if(c[i]){r=true}}var h=false;if((c.length&&s.iframe!==false)||s.iframe||r||h){if(s.closeKeepAlive){b.get(s.closeKeepAlive,o)}else{o()}}else{b.ajax(s)}this.trigger("form-submit-notify",[this,s]);return this;function o(){var w=t[0];if(b(":input[name=submit]",w).length){alert('Error: Form elements must not be named "submit".');return}var q=b.extend({},b.ajaxSettings,s);var H=b.extend(true,{},b.extend(true,{},b.ajaxSettings),q);var v="jqFormIO"+(new Date().getTime());var D=b('<iframe id="'+v+'" name="'+v+'" src="'+q.iframeSrc+'" onload="(jQuery(this).data(\'form-plugin-onload\'))()" />');var F=D[0];D.css({position:"absolute",top:"-1000px",left:"-1000px"});var G={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;D.attr("src",q.iframeSrc)}};var E=q.global;if(E&&!b.active++){b.event.trigger("ajaxStart")}if(E){b.event.trigger("ajaxSend",[G,q])}if(H.beforeSend&&H.beforeSend(G,H)===false){H.global&&b.active--;return}if(G.aborted){return}var k=false;var A=0;var j=w.clk;if(j){var y=j.name;if(y&&!j.disabled){q.extraData=q.extraData||{};q.extraData[y]=j.value;if(j.type=="image"){q.extraData[y+".x"]=w.clk_x;q.extraData[y+".y"]=w.clk_y}}}function x(){var K=t.attr("target"),I=t.attr("action");w.setAttribute("target",v);if(w.getAttribute("method")!="POST"){w.setAttribute("method","POST")}if(w.getAttribute("action")!=q.url){w.setAttribute("action",q.url)}if(!q.skipEncodingOverride){t.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(q.timeout){setTimeout(function(){A=true;B()},q.timeout)}var J=[];try{if(q.extraData){for(var L in q.extraData){J.push(b('<input type="hidden" name="'+L+'" value="'+q.extraData[L]+'" />').appendTo(w)[0])}}D.appendTo("body");D.data("form-plugin-onload",B);w.submit()}finally{w.setAttribute("action",I);K?w.setAttribute("target",K):t.removeAttr("target");b(J).remove()}}if(q.forceSync){x()}else{setTimeout(x,10)}var z=100;function B(){if(k){return}var I=true;try{if(A){throw"timeout"}var J,M;M=F.contentWindow?F.contentWindow.document:F.contentDocument?F.contentDocument:F.document;var N=q.dataType=="xml"||M.XMLDocument||b.isXMLDoc(M);a("isXml="+N);if(!N&&(M.body==null||M.body.innerHTML=="")){if(--z){a("requeing onLoad callback, DOM not available");setTimeout(B,250);return}a("Could not access iframe DOM after 100 tries.");return}a("response detected");k=true;G.responseText=M.body?M.body.innerHTML:null;G.responseXML=M.XMLDocument?M.XMLDocument:M;G.getResponseHeader=function(P){var O={"content-type":q.dataType};return O[P]};if(q.dataType=="json"||q.dataType=="script"){var n=M.getElementsByTagName("textarea")[0];if(n){G.responseText=n.value}else{var L=M.getElementsByTagName("pre")[0];if(L){G.responseText=L.innerHTML}}}else{if(q.dataType=="xml"&&!G.responseXML&&G.responseText!=null){G.responseXML=C(G.responseText)}}J=b.httpData(G,q.dataType)}catch(K){a("error caught:",K);I=false;G.error=K;b.handleError(q,G,"error",K)}if(I){q.success(J,"success");if(E){b.event.trigger("ajaxSuccess",[G,q])}}if(E){b.event.trigger("ajaxComplete",[G,q])}if(E&&!--b.active){b.event.trigger("ajaxStop")}if(q.complete){q.complete(G,I?"success":"error")}setTimeout(function(){D.removeData("form-plugin-onload");D.remove();G.responseXML=null},100)}function C(n,I){if(window.ActiveXObject){I=new ActiveXObject("Microsoft.XMLDOM");I.async="false";I.loadXML(n)}else{I=(new DOMParser()).parseFromString(n,"text/xml")}return(I&&I.documentElement&&I.documentElement.tagName!="parsererror")?I:null}}};b.fn.ajaxForm=function(c){return this.ajaxFormUnbind().bind("submit.form-plugin",function(d){d.preventDefault();b(this).ajaxSubmit(c)}).bind("click.form-plugin",function(i){var h=i.target;var f=b(h);if(!(f.is(":submit,input:image"))){var d=f.closest(":submit");if(d.length==0){return}h=d[0]}var g=this;g.clk=h;if(h.type=="image"){if(i.offsetX!=undefined){g.clk_x=i.offsetX;g.clk_y=i.offsetY}else{if(typeof b.fn.offset=="function"){var j=f.offset();g.clk_x=i.pageX-j.left;g.clk_y=i.pageY-j.top}else{g.clk_x=i.pageX-h.offsetLeft;g.clk_y=i.pageY-h.offsetTop}}}setTimeout(function(){g.clk=g.clk_x=g.clk_y=null},100)})};b.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};b.fn.formToArray=function(q){var p=[];if(this.length==0){return p}var d=this[0];var h=q?d.getElementsByTagName("*"):d.elements;if(!h){return p}for(var k=0,m=h.length;k<m;k++){var e=h[k];var f=e.name;if(!f){continue}if(q&&d.clk&&e.type=="image"){if(!e.disabled&&d.clk==e){p.push({name:f,value:b(e).val()});p.push({name:f+".x",value:d.clk_x},{name:f+".y",value:d.clk_y})}continue}var r=b.fieldValue(e,true);if(r&&r.constructor==Array){for(var g=0,c=r.length;g<c;g++){p.push({name:f,value:r[g]})}}else{if(r!==null&&typeof r!="undefined"){p.push({name:f,value:r})}}}if(!q&&d.clk){var l=b(d.clk),o=l[0],f=o.name;if(f&&!o.disabled&&o.type=="image"){p.push({name:f,value:l.val()});p.push({name:f+".x",value:d.clk_x},{name:f+".y",value:d.clk_y})}}return p};b.fn.formSerialize=function(c){return b.param(this.formToArray(c))};b.fn.fieldSerialize=function(d){var c=[];this.each(function(){var h=this.name;if(!h){return}var f=b.fieldValue(this,d);if(f&&f.constructor==Array){for(var g=0,e=f.length;g<e;g++){c.push({name:h,value:f[g]})}}else{if(f!==null&&typeof f!="undefined"){c.push({name:this.name,value:f})}}});return b.param(c)};b.fn.fieldValue=function(h){for(var g=[],e=0,c=this.length;e<c;e++){var f=this[e];var d=b.fieldValue(f,h);if(d===null||typeof d=="undefined"||(d.constructor==Array&&!d.length)){continue}d.constructor==Array?b.merge(g,d):g.push(d)}return g};b.fieldValue=function(c,j){var e=c.name,p=c.type,q=c.tagName.toLowerCase();if(typeof j=="undefined"){j=true}if(j&&(!e||c.disabled||p=="reset"||p=="button"||(p=="checkbox"||p=="radio")&&!c.checked||(p=="submit"||p=="image")&&c.form&&c.form.clk!=c||q=="select"&&c.selectedIndex==-1)){return null}if(q=="select"){var k=c.selectedIndex;if(k<0){return null}var m=[],d=c.options;var g=(p=="select-one");var l=(g?k+1:d.length);for(var f=(g?k:0);f<l;f++){var h=d[f];if(h.selected){var o=h.value;if(!o){o=(h.attributes&&h.attributes.value&&!(h.attributes.value.specified))?h.text:h.value}if(g){return o}m.push(o)}}return m}return c.value};b.fn.clearForm=function(){return this.each(function(){b("input,select,textarea",this).clearFields()})};b.fn.clearFields=b.fn.clearInputs=function(){return this.each(function(){var d=this.type,c=this.tagName.toLowerCase();if(d=="text"||d=="password"||c=="textarea"){this.value=""}else{if(d=="checkbox"||d=="radio"){this.checked=false}else{if(c=="select"){this.selectedIndex=-1}}}})};b.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};b.fn.enable=function(c){if(c==undefined){c=true}return this.each(function(){this.disabled=!c})};b.fn.selected=function(c){if(c==undefined){c=true}return this.each(function(){var d=this.type;if(d=="checkbox"||d=="radio"){this.checked=c}else{if(this.tagName.toLowerCase()=="option"){var e=b(this).parent("select");if(c&&e[0]&&e[0].type=="select-one"){e.find("option").selected(false)}this.selected=c}}})};function a(){if(b.fn.ajaxSubmit.debug){var c="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(c)}else{if(window.opera&&window.opera.postError){window.opera.postError(c)}}}}})(jQuery);
+(function(b){b.fn.ajaxSubmit=function(t){if(!this.length){a("ajaxSubmit: skipping submit process - no element selected");return this}if(typeof t=="function"){t={success:t}}var h=this.attr("action");var d=(typeof h==="string")?b.trim(h):"";if(d){d=(d.match(/^([^#]+)/)||[])[1]}d=d||window.location.href||"";t=b.extend(true,{url:d,type:this[0].getAttribute("method")||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},t);var u={};this.trigger("form-pre-serialize",[this,t,u]);if(u.veto){a("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(t.beforeSerialize&&t.beforeSerialize(this,t)===false){a("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var f,p,m=this.formToArray(t.semantic);if(t.data){t.extraData=t.data;for(f in t.data){if(t.data[f] instanceof Array){for(var i in t.data[f]){m.push({name:f,value:t.data[f][i]})}}else{p=t.data[f];p=b.isFunction(p)?p():p;m.push({name:f,value:p})}}}if(t.beforeSubmit&&t.beforeSubmit(m,this,t)===false){a("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[m,this,t,u]);if(u.veto){a("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var c=b.param(m);if(t.type.toUpperCase()=="GET"){t.url+=(t.url.indexOf("?")>=0?"&":"?")+c;t.data=null}else{t.data=c}var s=this,l=[];if(t.resetForm){l.push(function(){s.resetForm()})}if(t.clearForm){l.push(function(){s.clearForm()})}if(!t.dataType&&t.target){var r=t.success||function(){};l.push(function(n){var k=t.replaceTarget?"replaceWith":"html";b(t.target)[k](n).each(r,arguments)})}else{if(t.success){l.push(t.success)}}t.success=function(w,n,x){var v=t.context||t;for(var q=0,k=l.length;q<k;q++){l[q].apply(v,[w,n,x||s,s])}};var g=b("input:file",this).length>0;var e="multipart/form-data";var j=(s.attr("enctype")==e||s.attr("encoding")==e);if(t.iframe!==false&&(g||t.iframe||j)){if(t.closeKeepAlive){b.get(t.closeKeepAlive,o)}else{o()}}else{b.ajax(t)}this.trigger("form-submit-notify",[this,t]);return this;function o(){var v=s[0];if(b(":input[name=submit],:input[id=submit]",v).length){alert('Error: Form elements must not have name or id of "submit".');return}var B=b.extend(true,{},b.ajaxSettings,t);B.context=B.context||B;var E="jqFormIO"+(new Date().getTime()),z="_"+E;var w=b('<iframe id="'+E+'" name="'+E+'" src="'+B.iframeSrc+'" />');var A=w[0];w.css({position:"absolute",top:"-1000px",left:"-1000px"});var x={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){a("aborting upload...");var n="aborted";this.aborted=1;w.attr("src",B.iframeSrc);x.error=n;B.error&&B.error.call(B.context,x,"error",n);I&&b.event.trigger("ajaxError",[x,B,n]);B.complete&&B.complete.call(B.context,x,"error")}};var I=B.global;if(I&&!b.active++){b.event.trigger("ajaxStart")}if(I){b.event.trigger("ajaxSend",[x,B])}if(B.beforeSend&&B.beforeSend.call(B.context,x,B)===false){if(B.global){b.active--}return}if(x.aborted){return}var H=0;var y=v.clk;if(y){var F=y.name;if(F&&!y.disabled){B.extraData=B.extraData||{};B.extraData[F]=y.value;if(y.type=="image"){B.extraData[F+".x"]=v.clk_x;B.extraData[F+".y"]=v.clk_y}}}function G(){var O=s.attr("target"),M=s.attr("action");v.setAttribute("target",E);if(v.getAttribute("method")!="POST"){v.setAttribute("method","POST")}if(v.getAttribute("action")!=B.url){v.setAttribute("action",B.url)}if(!B.skipEncodingOverride){s.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(B.timeout){setTimeout(function(){H=true;D()},B.timeout)}var N=[];try{if(B.extraData){for(var P in B.extraData){N.push(b('<input type="hidden" name="'+P+'" value="'+B.extraData[P]+'" />').appendTo(v)[0])}}w.appendTo("body");A.attachEvent?A.attachEvent("onload",D):A.addEventListener("load",D,false);v.submit()}finally{v.setAttribute("action",M);if(O){v.setAttribute("target",O)}else{s.removeAttr("target")}b(N).remove()}}if(B.forceSync){G()}else{setTimeout(G,10)}var K,L,J=50;function D(){if(x.aborted){return}var R=A.contentWindow?A.contentWindow.document:A.contentDocument?A.contentDocument:A.document;if(!R||R.location.href==B.iframeSrc){return}A.detachEvent?A.detachEvent("onload",D):A.removeEventListener("load",D,false);var N=true;try{if(H){throw"timeout"}var S=B.dataType=="xml"||R.XMLDocument||b.isXMLDoc(R);a("isXml="+S);if(!S&&window.opera&&(R.body==null||R.body.innerHTML=="")){if(--J){a("requeing onLoad callback, DOM not available");setTimeout(D,250);return}}x.responseText=R.body?R.body.innerHTML:R.documentElement?R.documentElement.innerHTML:null;x.responseXML=R.XMLDocument?R.XMLDocument:R;x.getResponseHeader=function(U){var T={"content-type":B.dataType};return T[U]};var Q=/(json|script)/.test(B.dataType);if(Q||B.textarea){var M=R.getElementsByTagName("textarea")[0];if(M){x.responseText=M.value}else{if(Q){var P=R.getElementsByTagName("pre")[0];var n=R.getElementsByTagName("body")[0];if(P){x.responseText=P.textContent}else{if(n){x.responseText=n.innerHTML}}}}}else{if(B.dataType=="xml"&&!x.responseXML&&x.responseText!=null){x.responseXML=C(x.responseText)}}K=k(x,B.dataType,B)}catch(O){a("error caught:",O);N=false;x.error=O;B.error&&B.error.call(B.context,x,"error",O);I&&b.event.trigger("ajaxError",[x,B,O])}if(x.aborted){a("upload aborted");N=false}if(N){B.success&&B.success.call(B.context,K,"success",x);I&&b.event.trigger("ajaxSuccess",[x,B])}I&&b.event.trigger("ajaxComplete",[x,B]);if(I&&!--b.active){b.event.trigger("ajaxStop")}B.complete&&B.complete.call(B.context,x,N?"success":"error");setTimeout(function(){w.removeData("form-plugin-onload");w.remove();x.responseXML=null},100)}var C=b.parseXML||function(n,M){if(window.ActiveXObject){M=new ActiveXObject("Microsoft.XMLDOM");M.async="false";M.loadXML(n)}else{M=(new DOMParser()).parseFromString(n,"text/xml")}return(M&&M.documentElement&&M.documentElement.nodeName!="parsererror")?M:null};var q=b.parseJSON||function(n){return window["eval"]("("+n+")")};var k=function(Q,O,N){var M=Q.getResponseHeader("content-type")||"",n=O==="xml"||!O&&M.indexOf("xml")>=0,P=n?Q.responseXML:Q.responseText;if(n&&P.documentElement.nodeName==="parsererror"){b.error&&b.error("parsererror")}if(N&&N.dataFilter){P=N.dataFilter(P,O)}if(typeof P==="string"){if(O==="json"||!O&&M.indexOf("json")>=0){P=q(P)}else{if(O==="script"||!O&&M.indexOf("javascript")>=0){b.globalEval(P)}}}return P}}};b.fn.ajaxForm=function(c){if(this.length===0){var d={s:this.selector,c:this.context};if(!b.isReady&&d.s){a("DOM not ready, queuing ajaxForm");b(function(){b(d.s,d.c).ajaxForm(c)});return this}a("terminating; zero elements found by selector"+(b.isReady?"":" (DOM not ready)"));return this}return this.ajaxFormUnbind().bind("submit.form-plugin",function(f){if(!f.isDefaultPrevented()){f.preventDefault();b(this).ajaxSubmit(c)}}).bind("click.form-plugin",function(j){var i=j.target;var g=b(i);if(!(g.is(":submit,input:image"))){var f=g.closest(":submit");if(f.length==0){return}i=f[0]}var h=this;h.clk=i;if(i.type=="image"){if(j.offsetX!=undefined){h.clk_x=j.offsetX;h.clk_y=j.offsetY}else{if(typeof b.fn.offset=="function"){var k=g.offset();h.clk_x=j.pageX-k.left;h.clk_y=j.pageY-k.top}else{h.clk_x=j.pageX-i.offsetLeft;h.clk_y=j.pageY-i.offsetTop}}}setTimeout(function(){h.clk=h.clk_x=h.clk_y=null},100)})};b.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};b.fn.formToArray=function(q){var p=[];if(this.length===0){return p}var d=this[0];var g=q?d.getElementsByTagName("*"):d.elements;if(!g){return p}var k,h,f,r,e,m,c;for(k=0,m=g.length;k<m;k++){e=g[k];f=e.name;if(!f){continue}if(q&&d.clk&&e.type=="image"){if(!e.disabled&&d.clk==e){p.push({name:f,value:b(e).val()});p.push({name:f+".x",value:d.clk_x},{name:f+".y",value:d.clk_y})}continue}r=b.fieldValue(e,true);if(r&&r.constructor==Array){for(h=0,c=r.length;h<c;h++){p.push({name:f,value:r[h]})}}else{if(r!==null&&typeof r!="undefined"){p.push({name:f,value:r})}}}if(!q&&d.clk){var l=b(d.clk),o=l[0];f=o.name;if(f&&!o.disabled&&o.type=="image"){p.push({name:f,value:l.val()});p.push({name:f+".x",value:d.clk_x},{name:f+".y",value:d.clk_y})}}return p};b.fn.formSerialize=function(c){return b.param(this.formToArray(c))};b.fn.fieldSerialize=function(d){var c=[];this.each(function(){var h=this.name;if(!h){return}var f=b.fieldValue(this,d);if(f&&f.constructor==Array){for(var g=0,e=f.length;g<e;g++){c.push({name:h,value:f[g]})}}else{if(f!==null&&typeof f!="undefined"){c.push({name:this.name,value:f})}}});return b.param(c)};b.fn.fieldValue=function(h){for(var g=[],e=0,c=this.length;e<c;e++){var f=this[e];var d=b.fieldValue(f,h);if(d===null||typeof d=="undefined"||(d.constructor==Array&&!d.length)){continue}d.constructor==Array?b.merge(g,d):g.push(d)}return g};b.fieldValue=function(c,j){var e=c.name,p=c.type,q=c.tagName.toLowerCase();if(j===undefined){j=true}if(j&&(!e||c.disabled||p=="reset"||p=="button"||(p=="checkbox"||p=="radio")&&!c.checked||(p=="submit"||p=="image")&&c.form&&c.form.clk!=c||q=="select"&&c.selectedIndex==-1)){return null}if(q=="select"){var k=c.selectedIndex;if(k<0){return null}var m=[],d=c.options;var g=(p=="select-one");var l=(g?k+1:d.length);for(var f=(g?k:0);f<l;f++){var h=d[f];if(h.selected){var o=h.value;if(!o){o=(h.attributes&&h.attributes.value&&!(h.attributes.value.specified))?h.text:h.value}if(g){return o}m.push(o)}}return m}return b(c).val()};b.fn.clearForm=function(){return this.each(function(){b("input,select,textarea",this).clearFields()})};b.fn.clearFields=b.fn.clearInputs=function(){return this.each(function(){var d=this.type,c=this.tagName.toLowerCase();if(d=="text"||d=="password"||c=="textarea"){this.value=""}else{if(d=="checkbox"||d=="radio"){this.checked=false}else{if(c=="select"){this.selectedIndex=-1}}}})};b.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};b.fn.enable=function(c){if(c===undefined){c=true}return this.each(function(){this.disabled=!c})};b.fn.selected=function(c){if(c===undefined){c=true}return this.each(function(){var d=this.type;if(d=="checkbox"||d=="radio"){this.checked=c}else{if(this.tagName.toLowerCase()=="option"){var e=b(this).parent("select");if(c&&e[0]&&e[0].type=="select-one"){e.find("option").selected(false)}this.selected=c}}})};function a(){if(b.fn.ajaxSubmit.debug){var c="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(c)}else{if(window.opera&&window.opera.postError){window.opera.postError(c)}}}}})(jQuery);
diff --git a/sites/all/modules/imce/tpl/imce-content.tpl.php b/sites/all/modules/imce/tpl/imce-content.tpl.php
index 8b3bece7b354e422ea59174ab8717be9727f322c..53a397c908beff32f6fa0ae560e6258c73aa2782 100644
--- a/sites/all/modules/imce/tpl/imce-content.tpl.php
+++ b/sites/all/modules/imce/tpl/imce-content.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: imce-content.tpl.php,v 1.12 2010/10/06 04:42:57 ufku Exp $
 $imce =& $imce_ref['imce'];//keep this line.
 ?>
 
diff --git a/sites/all/modules/imce/tpl/imce-file-list.tpl.php b/sites/all/modules/imce/tpl/imce-file-list.tpl.php
index 0a666ae3c28f98c0c75f915d81a08acad1bd3609..9447fa08961c6cb33b3bc88b4d6cc76a85e050f4 100644
--- a/sites/all/modules/imce/tpl/imce-file-list.tpl.php
+++ b/sites/all/modules/imce/tpl/imce-file-list.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: imce-file-list.tpl.php,v 1.9 2010/03/17 21:36:39 ufku Exp $
 $imce =& $imce_ref['imce'];//keep this line.
 
 /*
diff --git a/sites/all/modules/imce/tpl/imce-page.tpl.php b/sites/all/modules/imce/tpl/imce-page.tpl.php
index 0a8710d30ec6a813d192db9c7856a294d13680dc..197858a9e99c6b9e3f79e1f74ef8e6fa5e74f36a 100644
--- a/sites/all/modules/imce/tpl/imce-page.tpl.php
+++ b/sites/all/modules/imce/tpl/imce-page.tpl.php
@@ -1,6 +1,4 @@
-<?php
-// $Id: imce-page.tpl.php,v 1.10 2010/03/17 23:19:55 ufku Exp $
-?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $GLOBALS['language']->language; ?>" xml:lang="<?php print $GLOBALS['language']->language; ?>" class="imce">
 
diff --git a/sites/all/modules/imce_wysiwyg/CHANGELOG.txt b/sites/all/modules/imce_wysiwyg/CHANGELOG.txt
index d3ac5683671eb83f5f89ab4706912720d3112239..7e7f9a81c25ac8b1925b81f2e06917b8eac3cb97 100644
--- a/sites/all/modules/imce_wysiwyg/CHANGELOG.txt
+++ b/sites/all/modules/imce_wysiwyg/CHANGELOG.txt
@@ -1,4 +1,3 @@
-// $Id: CHANGELOG.txt,v 1.7 2010/04/18 17:37:09 sun Exp $
 
 IMCE Wysiwyg x.x-x.x, xxxx-xx-xx
 --------------------------------
diff --git a/sites/all/modules/imce_wysiwyg/README.txt b/sites/all/modules/imce_wysiwyg/README.txt
index fdf63bfae8d80db903c052d8a3fc6695257bab51..be288e152acad801266bb5257728dc462ca007f2 100644
--- a/sites/all/modules/imce_wysiwyg/README.txt
+++ b/sites/all/modules/imce_wysiwyg/README.txt
@@ -1,4 +1,3 @@
-/* $Id: README.txt,v 1.3 2009/07/06 22:27:13 sun Exp $ */
 
 -- SUMMARY --
 
diff --git a/sites/all/modules/imce_wysiwyg/imce_wysiwyg.info b/sites/all/modules/imce_wysiwyg/imce_wysiwyg.info
index a5f327e6b12e0f40d85db055d9561b6f58fb262f..83a6755899b9c2b40adbdbe641b60dfb70dd357f 100644
--- a/sites/all/modules/imce_wysiwyg/imce_wysiwyg.info
+++ b/sites/all/modules/imce_wysiwyg/imce_wysiwyg.info
@@ -1,4 +1,3 @@
-; $Id: imce_wysiwyg.info,v 1.4 2010/04/18 17:37:09 sun Exp $
 name = IMCE Wysiwyg API bridge
 description = Makes IMCE available as plugin for client-side editors integrated via Wysiwyg API.
 package = User interface
@@ -7,9 +6,9 @@ dependencies[] = imce
 dependencies[] = wysiwyg
 files[] = imce_wysiwyg.module
 
-; Information added by drupal.org packaging script on 2010-07-11
+; Information added by drupal.org packaging script on 2011-02-25
 version = "7.x-1.x-dev"
 core = "7.x"
 project = "imce_wysiwyg"
-datestamp = "1278834568"
+datestamp = "1298619435"
 
diff --git a/sites/all/modules/imce_wysiwyg/imce_wysiwyg.module b/sites/all/modules/imce_wysiwyg/imce_wysiwyg.module
index 95d533917c0e6c1f5c59fd86f089efbb9eadf144..c1b819a26f33d9c8aedefb5ff3fec699cfb1bb0d 100644
--- a/sites/all/modules/imce_wysiwyg/imce_wysiwyg.module
+++ b/sites/all/modules/imce_wysiwyg/imce_wysiwyg.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: imce_wysiwyg.module,v 1.5 2010/02/21 00:07:00 sun Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/imce_wysiwyg/js/imce_wysiwyg.js b/sites/all/modules/imce_wysiwyg/js/imce_wysiwyg.js
index c5b7d3972235be955fc41cbf85c00a5e19bba6f7..81d60e697a269decef4287f963f4659a1f89f4ce 100644
--- a/sites/all/modules/imce_wysiwyg/js/imce_wysiwyg.js
+++ b/sites/all/modules/imce_wysiwyg/js/imce_wysiwyg.js
@@ -1,4 +1,3 @@
-// $Id: imce_wysiwyg.js,v 1.4 2010/02/21 00:07:00 sun Exp $
 
 /**
  * Wysiwyg API integration helper function.
diff --git a/sites/all/modules/imce_wysiwyg/translations/de.po b/sites/all/modules/imce_wysiwyg/translations/de.po
deleted file mode 100644
index e380c21d2a10268e4a31c2a757ffd2565c94faaa..0000000000000000000000000000000000000000
--- a/sites/all/modules/imce_wysiwyg/translations/de.po
+++ /dev/null
@@ -1,39 +0,0 @@
-# $Id$
-#
-# LANGUAGE translation of Drupal (general)
-# Copyright 2009 NAME <EMAIL@ADDRESS>
-# Generated from files:
-#  imce_wysiwyg.module,v 1.4 2009/03/04 15:52:16 sun
-#  imce_wysiwyg.info,v 1.2 2009/02/23 12:49:16 sun
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"POT-Creation-Date: 2009-10-30 13:31+0100\n"
-"PO-Revision-Date: 2009-10-30 15:12+0100\n"
-"Last-Translator: Thomas Zahreddin <thomas@voicehero.net>\n"
-"Language-Team: German <tz@it-arts.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Poedit-Language: German\n"
-"X-Poedit-Country: Germany\n"
-"X-Poedit-SourceCharset: utf-8\n"
-
-#: imce_wysiwyg.module:41;55
-msgid "IMCE"
-msgstr "IMCE"
-
-#: imce_wysiwyg.info:0
-msgid "IMCE Wysiwyg API bridge"
-msgstr "IMCE Wysiwyg API bridge"
-
-#: imce_wysiwyg.info:0
-msgid "Makes IMCE available as plugin for client-side editors integrated via Wysiwyg API."
-msgstr "Integriert IMCE als Plugin in  Wysiwyg - Editoren (via API)."
-
-#: imce_wysiwyg.info:0
-msgid "User interface"
-msgstr "Benutzeroberfläche"
-
diff --git a/sites/all/modules/imce_wysiwyg/translations/imce_wysiwyg.pot b/sites/all/modules/imce_wysiwyg/translations/imce_wysiwyg.pot
deleted file mode 100644
index 382d8822b49612c8cb4d51c0f07a302450e07b42..0000000000000000000000000000000000000000
--- a/sites/all/modules/imce_wysiwyg/translations/imce_wysiwyg.pot
+++ /dev/null
@@ -1,37 +0,0 @@
-# $Id$
-#
-# LANGUAGE translation of Drupal (general)
-# Copyright YEAR NAME <EMAIL@ADDRESS>
-# Generated from files:
-#  imce_wysiwyg.module,v 1.4 2009/03/04 15:52:16 sun
-#  imce_wysiwyg.info,v 1.2 2009/02/23 12:49:16 sun
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"POT-Creation-Date: 2009-10-30 13:31+0100\n"
-"PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n"
-"Last-Translator: NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
-
-#: imce_wysiwyg.module:41;55
-msgid "IMCE"
-msgstr ""
-
-#: imce_wysiwyg.info:0
-msgid "IMCE Wysiwyg API bridge"
-msgstr ""
-
-#: imce_wysiwyg.info:0
-msgid "Makes IMCE available as plugin for client-side editors integrated via Wysiwyg API."
-msgstr ""
-
-#: imce_wysiwyg.info:0
-msgid "User interface"
-msgstr ""
-
diff --git a/sites/all/modules/token/README.txt b/sites/all/modules/token/README.txt
index eeacce976f1ac869fa10a371e900b79c06b4c45b..230774e98d6eecd05526e39f5603a59f8b8bc6f9 100644
--- a/sites/all/modules/token/README.txt
+++ b/sites/all/modules/token/README.txt
@@ -1,3 +1,2 @@
-$Id: README.txt,v 1.2 2010/03/06 22:12:11 davereid Exp $
 
 Provides common and resuable token UI elements and missing core tokens.
diff --git a/sites/all/modules/token/jquery.treeTable.css b/sites/all/modules/token/jquery.treeTable.css
index 017a5ddefadc0257c60c11bbb63d1a1503001094..bec225ae869c0bbabf1699a306965beb2e9fc944 100644
--- a/sites/all/modules/token/jquery.treeTable.css
+++ b/sites/all/modules/token/jquery.treeTable.css
@@ -1,4 +1,3 @@
-/* $Id: jquery.treeTable.css,v 1.2 2010/07/10 13:57:47 davereid Exp $ */
 
 /* jQuery TreeTable Core 2.0 stylesheet
  *
diff --git a/sites/all/modules/token/jquery.treeTable.js b/sites/all/modules/token/jquery.treeTable.js
index 00fb8107a445c751e835ca8c472f73f6d9911813..fd8d0c2db13d3e83fcda2f9a05af8c6fcdac626e 100644
--- a/sites/all/modules/token/jquery.treeTable.js
+++ b/sites/all/modules/token/jquery.treeTable.js
@@ -1,4 +1,3 @@
-// $Id: jquery.treeTable.js,v 1.1 2010/03/16 23:48:58 davereid Exp $
 
 /*
  * jQuery treeTable Plugin 2.3.0
diff --git a/sites/all/modules/token/tests/token_test.info b/sites/all/modules/token/tests/token_test.info
index f0324c240e9675f2853118948aa5ab60cd4a6d69..859fcccf035be3084136b2553ab848df366054b2 100644
--- a/sites/all/modules/token/tests/token_test.info
+++ b/sites/all/modules/token/tests/token_test.info
@@ -5,9 +5,9 @@ core = 7.x
 files[] = token_test.module
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-12
-version = "7.x-1.0-beta1"
+; Information added by drupal.org packaging script on 2011-05-19
+version = "7.x-1.0-beta2"
 core = "7.x"
 project = "token"
-datestamp = "1294805790"
+datestamp = "1305833216"
 
diff --git a/sites/all/modules/token/token.css b/sites/all/modules/token/token.css
index 351bb7c5027811494df9219b9f37caacc3a4a1a4..c8500c51f4102779e7052b791b99087ffcd38080 100644
--- a/sites/all/modules/token/token.css
+++ b/sites/all/modules/token/token.css
@@ -1,4 +1,3 @@
-/* $Id: token.css,v 1.3 2010/09/06 14:55:41 davereid Exp $ */
 
 .token-tree {
   font-size: 0.85em;
@@ -9,3 +8,11 @@
   padding-top: 0;
   padding-bottom: 0;
 }
+
+.token-group {
+  font-weight: bold;
+}
+
+.js .token-group {
+  font-weight: normal;
+}
diff --git a/sites/all/modules/token/token.info b/sites/all/modules/token/token.info
index 1bcb425ad9d538d4fa703f240f068d34fd274bb0..d7be5709e53385b660f4581ba4913efd65ade76a 100644
--- a/sites/all/modules/token/token.info
+++ b/sites/all/modules/token/token.info
@@ -1,4 +1,3 @@
-; $Id: token.info,v 1.12 2010/11/18 00:20:33 davereid Exp $
 name = Token
 description = Provides a user interface for the Token API and some missing core tokens.
 core = 7.x
@@ -8,9 +7,9 @@ files[] = token.tokens.inc
 files[] = token.pages.inc
 files[] = token.test
 
-; Information added by drupal.org packaging script on 2011-01-12
-version = "7.x-1.0-beta1"
+; Information added by drupal.org packaging script on 2011-05-19
+version = "7.x-1.0-beta2"
 core = "7.x"
 project = "token"
-datestamp = "1294805790"
+datestamp = "1305833216"
 
diff --git a/sites/all/modules/token/token.install b/sites/all/modules/token/token.install
index b4466bc98322aa74935894e5b21223eb8327d27f..ded68e9fe2342d596cf4f23b6e903d37dd5be374 100644
--- a/sites/all/modules/token/token.install
+++ b/sites/all/modules/token/token.install
@@ -1,5 +1,4 @@
 <?php
-// $Id: token.install,v 1.15 2010/12/08 16:25:09 davereid Exp $
 
 /**
  * Implements hook_requirements().
diff --git a/sites/all/modules/token/token.js b/sites/all/modules/token/token.js
index 304063227bff253e252c73625192a47df4c3260a..59715f473cb152c28836ad9ad5534e8753cb95e0 100644
--- a/sites/all/modules/token/token.js
+++ b/sites/all/modules/token/token.js
@@ -1,4 +1,3 @@
-// $Id: token.js,v 1.3 2010/03/20 19:48:25 davereid Exp $
 
 (function ($) {
 
diff --git a/sites/all/modules/token/token.module b/sites/all/modules/token/token.module
index f0e8692e5d7b3f405b717483bcffcc198346986e..ad4107ba5cc8dcf35c515984298b496a9b47e5f0 100644
--- a/sites/all/modules/token/token.module
+++ b/sites/all/modules/token/token.module
@@ -1,5 +1,4 @@
 <?php
-// $Id: token.module,v 1.61 2011/01/12 03:26:59 davereid Exp $
 
 /**
  * The maximum depth for token tree recursion.
@@ -11,6 +10,12 @@ define('TOKEN_MAX_DEPTH', 9);
  */
 function token_help($path, $arg) {
   if ($path == 'admin/help#token') {
+    if (current_path() != 'admin/help/token') {
+      // Because system_modules() executes hook_help() for each module to 'test'
+      // if they will return anything, but not actually display it, we want to
+      // return a TRUE value if this is not actually the help page.
+      return TRUE;
+    }
     $output = '<dl>';
     $output .= '<dt>' . t('List of the currently available tokens on this site') . '</dt>';
     $output .= '<dd>' . theme('token_tree', array('token_types' => 'all', 'click_insert' => FALSE, 'show_restricted' => TRUE)) . '</dd>';
@@ -170,7 +175,7 @@ function token_form_alter(&$form, $form_state, $form_id) {
  * Clear token caches and static variables.
  */
 function token_clear_cache() {
-  cache_clear_all(NULL, 'cache_token');
+  cache_clear_all('*', 'cache_token', TRUE);
   drupal_static_reset('token_get_info');
   drupal_static_reset('token_get_global_token_types');
   drupal_static_reset('token_build_tree');
@@ -302,10 +307,13 @@ function token_get_info($token_type = NULL, $token = NULL) {
 
       foreach (array_keys($token_info['types']) as $type_key) {
         if (isset($token_info['types'][$type_key]['type'])) {
+          $base_type = $token_info['types'][$type_key]['type'];
           // If this token type extends another token type, then merge in
           // the base token type's tokens.
-          $token_info['tokens'] += array($type_key => array());
-          $token_info['tokens'][$type_key] += $token_info['tokens'][$token_info['types'][$type_key]['type']];
+          if (isset($token_info['tokens'][$base_type])) {
+            $token_info['tokens'] += array($type_key => array());
+            $token_info['tokens'][$type_key] += $token_info['tokens'][$base_type];
+          }
         }
         else {
           // Add a 'type' value to each token type so we can properly use
@@ -729,7 +737,7 @@ function _token_build_tree($token_type, array $options) {
   );
 
   $info = token_get_info();
-  if ($options['depth'] <= 0 || !isset($info['types'][$token_type])) {
+  if ($options['depth'] <= 0 || !isset($info['types'][$token_type]) || !isset($info['tokens'][$token_type])) {
     return array();
   }
 
@@ -916,3 +924,47 @@ function _token_menu_link_translate(&$item) {
 
   return $map;
 }
+
+/**
+ * Prepare a string for use as a valid token name.
+ *
+ * @param $name
+ *   The token name to clean.
+ * @return
+ *   The cleaned token name.
+ */
+function token_clean_token_name($name) {
+  static $names = array();
+
+  if (!isset($names[$name])) {
+    $cleaned_name = strtr($name, array(' ' => '-', '_' => '-', '/' => '-', '[' => '-', ']' => ''));
+    $cleaned_name = preg_replace('/[^\w\-]/i', '', $cleaned_name);
+    $cleaned_name = trim($cleaned_name, '-');
+    $names[$name] = $cleaned_name;
+  }
+
+  return $names[$name];
+}
+
+/**
+ * Do not use this function yet. Its API has not been finalized.
+ */
+function token_render_array(array $array, array $options = array()) {
+  $rendered = array_map('render', $array);
+  if (!empty($options['sanitize'])) {
+    $rendered = array_map('check_plain', $rendered);
+  }
+  $join = isset($options['join']) ? $options['join'] : ', ';
+  return implode($join, $rendered);
+}
+
+/**
+ * Do not use this function yet. Its API has not been finalized.
+ */
+function token_render_array_value($value, array $options = array()) {
+  $rendered = render($value);
+  if (!empty($options['sanitize'])) {
+    $rendered = check_plain($rendered);
+  }
+  return $rendered;
+}
diff --git a/sites/all/modules/token/token.pages.inc b/sites/all/modules/token/token.pages.inc
index 8d2935ab964553fabed33d0ed30bbc5c86473cf6..ee98b9267612814ddd3c0cf25849ec197c5aaeea 100644
--- a/sites/all/modules/token/token.pages.inc
+++ b/sites/all/modules/token/token.pages.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: token.pages.inc,v 1.13 2010/12/18 01:53:33 davereid Exp $
 
 /**
  * @file
diff --git a/sites/all/modules/token/token.test b/sites/all/modules/token/token.test
index ef1c817ec6a00ca54168c0fb41773b9254992dbf..87ffeed6017274878ce314c2a8bd04ecdc3d198c 100644
--- a/sites/all/modules/token/token.test
+++ b/sites/all/modules/token/token.test
@@ -1,5 +1,4 @@
 <?php
-// $Id: token.test,v 1.32 2011/01/12 03:26:59 davereid Exp $
 
 /**
  * Helper test class with some added functions for testing.
@@ -12,13 +11,16 @@ class TokenTestHelper extends DrupalWebTestCase {
     parent::setUp($modules);
   }
 
-  function assertToken($type, $object, $token, $expected, array $options = array()) {
-    $this->assertTokens($type, $object, array($token => $expected), $options);
+  function assertToken($type, $data, $token, $expected, array $options = array()) {
+    $this->assertTokens($type, $data, array($token => $expected), $options);
   }
 
-  function assertTokens($type, $object, array $tokens, array $options = array()) {
+  function assertTokens($type, $data, array $tokens, array $options = array()) {
     $token_input = drupal_map_assoc(array_keys($tokens));
-    $values = token_generate($type, $token_input, array($type => $object), $options);
+    if (!is_array($data)) {
+      $data = array($type => $data);
+    }
+    $values = token_generate($type, $token_input, $data, $options);
     foreach ($tokens as $token => $expected) {
       if (!isset($expected)) {
         $this->assertTrue(!isset($values[$token]), t("Token value for [@type:@token] was not generated.", array('@type' => $type, '@token' => $token)));
@@ -32,9 +34,12 @@ class TokenTestHelper extends DrupalWebTestCase {
     }
   }
 
-  function assertNoTokens($type, $object, array $tokens, array $options = array()) {
+  function assertNoTokens($type, $data, array $tokens, array $options = array()) {
     $token_input = drupal_map_assoc($tokens);
-    $values = token_generate($type, $token_input, array($type => $object), $options);
+    if (!is_array($data)) {
+      $data = array($type => $data);
+    }
+    $values = token_generate($type, $token_input, $data, $options);
     foreach ($tokens as $token) {
       $this->assertTrue(!isset($values[$token]), t("Token value for [@type:@token] was not generated.", array('@type' => $type, '@token' => $token)));
     }
@@ -177,6 +182,33 @@ class TokenUnitTestCase extends TokenTestHelper {
   }
 }
 
+class TokenURLTestCase extends TokenTestHelper {
+  public static function getInfo() {
+    return array(
+      'name' => 'URL token tests',
+      'description' => 'Test the URL tokens.',
+      'group' => 'Token',
+    );
+  }
+
+  function setUp($modules = array()) {
+    parent::setUp($modules);
+    $this->saveAlias('node/1', 'first-node');
+    variable_set('clean_url', 1);
+  }
+
+  function testURLTokens() {
+    $tokens = array(
+      'absolute' => 'http://example.com/first-node',
+      'relative' => base_path() . 'first-node',
+      'path' => 'node/1',
+      'alias' => 'first-node',
+      'brief' => 'example.com/first-node',
+    );
+    $this->assertTokens('url', array('path' => 'node/1', 'options' => array('base_url' => 'http://example.com')), $tokens);
+  }
+}
+
 class TokenCommentTestCase extends TokenTestHelper {
   public static function getInfo() {
     return array(
@@ -349,7 +381,7 @@ class TokenMenuTestCase extends TokenTestHelper {
       'root:parent' => NULL,
       'root:root' => NULL,
     );
-    $this->assertTokens('menu-link', $parent_link, $tokens);
+    $this->assertTokens('menu-link', array('menu-link' => $parent_link), $tokens);
 
     // Add a node menu link
     $node_link = array(
@@ -739,3 +771,36 @@ class TokenCurrentPageTestCase extends TokenTestHelper {
     $this->assertPageTokens("node/{$node->nid}", $tokens);
   }
 }
+
+class TokenArrayTestCase extends TokenTestHelper {
+  public static function getInfo() {
+    return array(
+      'name' => 'Array token tests',
+      'description' => 'Test the array tokens.',
+      'group' => 'Token',
+    );
+  }
+
+  function testArrayTokens() {
+    $array = array(0 => 'a', 1 => 'b', 2 => 'c', 4 => 'd');
+
+    // Test the profile token values.
+    $tokens = array(
+      'first' => 'a',
+      'last' => 'd',
+      'value:0' => 'a',
+      'value:2' => 'c',
+      'count' => 4,
+      'keys' => '0, 1, 2, 4',
+      'keys:value:3' => '4',
+      'keys:join' => '0124',
+      'reversed' => 'd, c, b, a',
+      'reversed:keys' => '4, 2, 1, 0',
+      'join:/' => 'a/b/c/d',
+      'join' => 'abcd',
+      'join:, ' => 'a, b, c, d',
+      'join: ' => 'a b c d',
+    );
+    $this->assertTokens('array', $array, $tokens);
+  }
+}
diff --git a/sites/all/modules/token/token.tokens.inc b/sites/all/modules/token/token.tokens.inc
index e85ab6792eef658899621e4d8ed1129181c16d42..29ac76f8793c638887819b1ce271f94e4f837370 100644
--- a/sites/all/modules/token/token.tokens.inc
+++ b/sites/all/modules/token/token.tokens.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: token.tokens.inc,v 1.37 2011/01/09 20:49:07 davereid Exp $
 
 /**
  * @file
@@ -149,6 +148,11 @@ function token_token_info() {
       'type' => 'file',
     );
   }
+  $info['tokens']['user']['roles'] = array(
+    'name' => t('Roles'),
+    'description' => t('The user roles associated with the user account.'),
+    'type' => 'array',
+  );
 
   // Current user tokens.
   $info['tokens']['current-user']['ip-address'] = array(
@@ -210,6 +214,7 @@ function token_token_info() {
     'dynamic' => TRUE,
   );
 
+  // URL tokens.
   $info['types']['url'] = array(
     'name' => t('URL'),
     'description' => t('Tokens related to URLs.'),
@@ -231,6 +236,44 @@ function token_token_info() {
     'name' => t('Absolute URL'),
     'description' => t('The absolute URL.'),
   );
+  $info['tokens']['url']['brief'] = array(
+    'name' => t('Brief URL'),
+    'description' => t('The URL without the protocol and trailing backslash.'),
+  );
+
+  // Array tokens.
+  $info['types']['array'] = array(
+    'name' => t('Array'),
+    'description' => t('Tokens related to arrays of strings.'),
+    'needs-data' => 'array',
+  );
+  $info['tokens']['array']['first'] = array(
+    'name' => t('First'),
+    'description' => t('The first element of the array.'),
+  );
+  $info['tokens']['array']['last'] = array(
+    'name' => t('Last'),
+    'description' => t('The last element of the array.'),
+  );
+  $info['tokens']['array']['count'] = array(
+    'name' => t('Count'),
+    'description' => t('The number of elements in the array.'),
+  );
+  $info['tokens']['array']['reversed'] = array(
+    'name' => t('Reversed'),
+    'description' => t('The array reversed.'),
+    'type' => 'array',
+  );
+  $info['tokens']['array']['keys'] = array(
+    'name' => t('Keys'),
+    'description' => t('The array of keys of the array.'),
+    'type' => 'array',
+  );
+  $info['tokens']['array']['join'] = array(
+    'name' => t('Imploded'),
+    'description' => t('The values of the array joined together with a custom string in-between each value.'),
+    'dynamic' => TRUE,
+  );
 
   return $info;
 }
@@ -392,6 +435,9 @@ function token_tokens($type, $tokens, array $data = array(), array $options = ar
             $replacements[$original] = theme('user_picture', array('account' => $account));
           }
           break;
+        case 'roles':
+          $replacements[$original] = token_render_array($account->roles, $options);
+          break;
       }
     }
 
@@ -401,9 +447,12 @@ function token_tokens($type, $tokens, array $data = array(), array $options = ar
       $account->picture->description = '';
       $replacements += token_generate('file', $picture_tokens, array('file' => $account->picture), $options);
     }
-    if (($url_tokens = token_find_with_prefix($tokens, 'url'))) {
+    if ($url_tokens = token_find_with_prefix($tokens, 'url')) {
       $replacements += token_generate('url', $url_tokens, entity_uri('user', $account), $options);
     }
+    if ($role_tokens = token_find_with_prefix($tokens, 'roles')) {
+      $replacements += token_generate('array', $role_tokens, array('array' => $account->roles), $options);
+    }
   }
 
   // Current user tokens.
@@ -525,6 +574,9 @@ function token_tokens($type, $tokens, array $data = array(), array $options = ar
         case 'relative':
           $replacements[$original] = url($path, array('absolute' => FALSE) + $url_options);
           break;
+        case 'brief':
+          $replacements[$original] = preg_replace(array('!^https?://!', '!/$!'), '', url($path, $url_options));
+          break;
       }
     }
   }
@@ -555,6 +607,64 @@ function token_tokens($type, $tokens, array $data = array(), array $options = ar
     }
   }
 
+  // Array tokens.
+  if ($type == 'array' && !empty($data['array']) && is_array($data['array'])) {
+    $array = $data['array'];
+
+    foreach ($tokens as $name => $original) {
+      switch ($name) {
+        case 'first':
+          $first = reset($array);
+          $replacements[$original] = token_render_array_value($first, $options);
+          reset($array);
+          break;
+        case 'last':
+          $last = end($array);
+          $replacements[$original] = token_render_array_value($last, $options);
+          reset($array);
+          break;
+        case 'count':
+          $replacements[$original] = count($array);
+          break;
+        case 'keys':
+          $keys = array_keys($array);
+          $replacements[$original] = token_render_array($keys, $options);
+          break;
+        case 'reversed':
+          $reversed = array_reverse($array, TRUE);
+          $replacements[$original] = token_render_array($reversed, $options);
+          break;
+        case 'join':
+          $replacements[$original] = token_render_array($array, array('join' => '') + $options);
+          break;
+      }
+    }
+
+    // Dynamic tokens.
+    if ($value_tokens = token_find_with_prefix($tokens, 'value')) {
+      foreach ($value_tokens as $key => $original) {
+        if (isset($array[$key])) {
+          $replacements[$original] = token_render_array_value($array[$key], $options);
+        }
+      }
+    }
+    if ($join_tokens = token_find_with_prefix($tokens, 'join')) {
+      foreach ($join_tokens as $join => $original) {
+        $replacements[$original] = token_render_array($array, array('join' => $join) + $options);
+      }
+    }
+
+    // Chained token relationships.
+    if ($key_tokens = token_find_with_prefix($tokens, 'keys')) {
+      $replacements += token_generate('array', $key_tokens, array('array' => array_keys($array)), $options);
+    }
+    if ($reversed_tokens = token_find_with_prefix($tokens, 'reversed')) {
+      $replacements += token_generate('array', $reversed_tokens, array('array' => array_reverse($array, TRUE)), $options);
+    }
+
+    // @todo Handle if the array values are not strings and could be chained.
+  }
+
   // If $type is a token type, $data[$type] is empty but $data[$entity_type] is
   // not, re-run token replacements.
   if (empty($data[$type]) && ($entity_type = token_get_entity_mapping('token', $type)) && $entity_type != $type && !empty($data[$entity_type]) && empty($options['recursive'])) {
@@ -851,9 +961,10 @@ function _token_profile_fields() {
   $fields = &drupal_static(__FUNCTION__);
 
   if (!isset($fields)) {
+    $fields = array();
     $results = db_query("SELECT name, title, category, type FROM {profile_field}");
     foreach ($results as $field) {
-      $field->token_name = strtr($field->name, '_', '-');
+      $field->token_name = token_clean_token_name($field->name);
       $fields[$field->token_name] = $field;
     }
   }
diff --git a/sites/all/themes/README.txt b/sites/all/themes/README.txt
index 507485f8623a9ea6f51ccb9231148dc9682aea80..e9425214b2f9a103c136356e25e9323cd55162d9 100644
--- a/sites/all/themes/README.txt
+++ b/sites/all/themes/README.txt
@@ -1,4 +1,3 @@
-// $Id: README.txt,v 1.1 2009/01/22 04:33:38 webchick Exp $
 
 This directory should be used to place downloaded and custom themes
 which are common to all sites. This will allow you to more easily
diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php
index 6ebacffec1b74e00a3264daed77c9ac5a84b6305..0472f02b1c3bdf1344cf9ddad90e302d799083c4 100644
--- a/sites/default/default.settings.php
+++ b/sites/default/default.settings.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: default.settings.php,v 1.51 2010/10/11 23:49:48 dries Exp $
 
 /**
  * @file
@@ -282,11 +281,11 @@ ini_set('session.cookie_lifetime', 2000000);
 
 /**
  * Drupal automatically generates a unique session cookie name for each site
- * based on on its full domain name. If you have multiple domains pointing at
- * the same Drupal site, you can either redirect them all to a single domain
- * (see comment in .htaccess), or uncomment the line below and specify their
- * shared base domain. Doing so assures that users remain logged in as they
- * cross between your various domains.
+ * based on its full domain name. If you have multiple domains pointing at the
+ * same Drupal site, you can either redirect them all to a single domain (see
+ * comment in .htaccess), or uncomment the line below and specify their shared
+ * base domain. Doing so assures that users remain logged in as they cross
+ * between your various domains.
  */
 # $cookie_domain = 'example.com';
 
@@ -369,8 +368,7 @@ ini_set('session.cookie_lifetime', 2000000);
  * the cache. If the site has mostly anonymous users except a few known
  * editors/administrators, the Vary header can be omitted. This allows for
  * better caching in HTTP proxies (including reverse proxies), i.e. even if
- * clients send different cookies, they still get content served from the cache
- * if aggressive caching is enabled and the minimum cache time is non-zero.
+ * clients send different cookies, they still get content served from the cache.
  * However, authenticated users should access the site directly (i.e. not use an
  * HTTP proxy, and bypass the reverse proxy if one is used) in order to avoid
  * getting cached pages from the proxy.
diff --git a/sites/example.sites.php b/sites/example.sites.php
index 1775824006e45e196c334f2f0e0951109fdea0b7..08c1020ff4398b19279672e90301ee2bf1aa2129 100644
--- a/sites/example.sites.php
+++ b/sites/example.sites.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: example.sites.php,v 1.3 2010/04/15 12:01:28 dries Exp $
 
 /**
  * @file
diff --git a/themes/README.txt b/themes/README.txt
index 686fe3447a76f4230a986dae7ce8dc56dbf3dd7f..3fb27ed10d64ee1e78c6935750f66c46820c3891 100644
--- a/themes/README.txt
+++ b/themes/README.txt
@@ -1,4 +1,3 @@
-// $Id: README.txt,v 1.3 2009/10/08 01:44:22 dries Exp $
 
 This directory is reserved for core theme files. Custom or contributed themes
 should be placed in their own subdirectory of the sites/all/themes directory.
diff --git a/themes/bartik/bartik.info b/themes/bartik/bartik.info
index 6f3521ccf7e15eb53763e77dde5e09b25fc3df7f..efdb8846cfb5c56278aec65307ddd6da6211d6a1 100644
--- a/themes/bartik/bartik.info
+++ b/themes/bartik/bartik.info
@@ -1,4 +1,3 @@
-; $Id: bartik.info,v 1.5 2010/11/07 00:27:20 dries Exp $
 
 name = Bartik
 description = A flexible, recolorable theme with many regions.
@@ -35,8 +34,8 @@ regions[footer] = Footer
 settings[shortcut_module_link] = 0
 
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/themes/bartik/color/color.inc b/themes/bartik/color/color.inc
index b66e560499d4ae66e794cf220ffd8373b9cf1a7b..fa323edad584ed663f986514af3995264dc17d34 100644
--- a/themes/bartik/color/color.inc
+++ b/themes/bartik/color/color.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: color.inc,v 1.7 2010/12/14 19:53:14 dries Exp $
 
 // Put the logo path into JavaScript for the live preview.
 drupal_add_js(array('color' => array('logo' => theme_get_setting('logo', 'bartik'))), 'setting');
diff --git a/themes/bartik/color/preview.css b/themes/bartik/color/preview.css
index 61f2035b494da826c155eb1f597f9b1731b1f659..48a4a83346bec7c92623cb1b27bdec283418a228 100644
--- a/themes/bartik/color/preview.css
+++ b/themes/bartik/color/preview.css
@@ -1,4 +1,3 @@
-/* $Id: preview.css,v 1.5 2010/12/14 02:50:24 dries Exp $ */
 
 /* ---------- Color form ----------- */
 #color_scheme_form #palette .form-item {
diff --git a/themes/bartik/color/preview.js b/themes/bartik/color/preview.js
index bf60cb3a5564282f2c7c2aa910d281c4132614af..b40bcf7dcae1af32a3030664132863e6331c6414 100644
--- a/themes/bartik/color/preview.js
+++ b/themes/bartik/color/preview.js
@@ -1,4 +1,3 @@
-// $Id: preview.js,v 1.5 2010/12/11 21:37:41 webchick Exp $
 
 (function ($) {
   Drupal.color = {
diff --git a/themes/bartik/css/colors.css b/themes/bartik/css/colors.css
index b937362c9a93670243b27271557f4ae99c8959d0..fd83374a54b67df5cf7dcafd94610d51916d2a5c 100644
--- a/themes/bartik/css/colors.css
+++ b/themes/bartik/css/colors.css
@@ -1,4 +1,3 @@
-/* $Id: colors.css,v 1.10 2011/01/04 05:24:13 webchick Exp $ */
 
 /* ---------- Color Module Styles ----------- */
 
@@ -24,8 +23,12 @@ body.overlay {
 }
 #header {
   background-color: #48a9e4;
-  background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#0779bf), to(#48a9e4));
-  background-image: -moz-linear-gradient(-90deg, #0779bf, #48a9e4);
+  background-image: -moz-linear-gradient(top, #0779bf 0%, #48a9e4 100%);
+  background-image: -ms-linear-gradient(top, #0779bf 0%, #48a9e4 100%);
+  background-image: -o-linear-gradient(top, #0779bf 0%, #48a9e4 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #0779bf), color-stop(1, #48a9e4));
+  background-image: -webkit-linear-gradient(top, #0779bf 0%, #48a9e4 100%);
+  background-image: linear-gradient(top, #0779bf 0%, #48a9e4 100%);
 }
 a {
   color: #0071B3;
diff --git a/themes/bartik/css/ie-rtl.css b/themes/bartik/css/ie-rtl.css
index b07c3fde8b3bb5d398b5b18faf4080d27f88a2e7..6358bf376a7e805b883e2edd27cf513a8487ce45 100644
--- a/themes/bartik/css/ie-rtl.css
+++ b/themes/bartik/css/ie-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: ie-rtl.css,v 1.7 2011/01/04 02:59:37 webchick Exp $ */
 
 fieldset legend {
   left: 6px;
diff --git a/themes/bartik/css/ie.css b/themes/bartik/css/ie.css
index aafaf19b279e504b276e7a364482f022abb81e1b..7a658336c9ca4f794f0ab079efca19c230616e43 100644
--- a/themes/bartik/css/ie.css
+++ b/themes/bartik/css/ie.css
@@ -1,4 +1,3 @@
-/* $Id: ie.css,v 1.12 2011/01/04 02:59:37 webchick Exp $ */
 
 .block {
   zoom: 1;
diff --git a/themes/bartik/css/ie6.css b/themes/bartik/css/ie6.css
index cb233a5170fcd130a0e953110791af74e2ec9a62..435fab02bd8d76bd365bae70ac9f2317cbdee59b 100644
--- a/themes/bartik/css/ie6.css
+++ b/themes/bartik/css/ie6.css
@@ -1,4 +1,3 @@
-/* $Id: ie6.css,v 1.5 2010/12/02 23:54:56 dries Exp $ */
 
 #content {
   overflow: hidden;
diff --git a/themes/bartik/css/layout-rtl.css b/themes/bartik/css/layout-rtl.css
index b1cb06bd88b5014ce1e076323f31eb74916a15a8..fa81e4f862e85600ea7798f967f67f589cada1f2 100644
--- a/themes/bartik/css/layout-rtl.css
+++ b/themes/bartik/css/layout-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: layout-rtl.css,v 1.5 2010/11/30 17:43:52 dries Exp $ */
 
 /* ---------- Basic Layout RTL Styles ----------- */
 
diff --git a/themes/bartik/css/layout.css b/themes/bartik/css/layout.css
index 9f8227c92033d9412b6efbf19d660a0affaafbee..b561f4c021cd83766e290e923a3a87046e80d482 100644
--- a/themes/bartik/css/layout.css
+++ b/themes/bartik/css/layout.css
@@ -1,4 +1,3 @@
-/* $Id: layout.css,v 1.8 2011/01/04 05:24:13 webchick Exp $ */
 
 /* ---------- Basic Layout Styles ----------- */
 
diff --git a/themes/bartik/css/maintenance-page.css b/themes/bartik/css/maintenance-page.css
index fb21ae4be3a830bfbafddb851bcc14cf40b5e5c6..c13c77b9a179bde5d86260811d58cc6955a58b38 100644
--- a/themes/bartik/css/maintenance-page.css
+++ b/themes/bartik/css/maintenance-page.css
@@ -1,13 +1,14 @@
-/* $Id: maintenance-page.css,v 1.6 2010/11/26 11:00:37 webchick Exp $ */
 
 body.maintenance-page {
   background-color: #fff;
   color: #000;
 }
 .maintenance-page #page-wrapper {
+  background: #fff;
   margin-left: auto;
   margin-right: auto;
   min-width: 0;
+  min-height: 0;
   width: 800px;
   border: 1px solid #ddd;
   margin-top: 40px;
@@ -24,7 +25,6 @@ body.maintenance-page {
   width: auto;
 }
 .maintenance-page #header div.section,
-.maintenance-page #messages,
 .maintenance-page #main {
   width: 700px;
 }
@@ -58,6 +58,10 @@ body.maintenance-page {
   padding: 0;
   margin-top: 30px;
 }
+.maintenance-page #messages div.messages {
+  margin: 0;
+}
 .maintenance-page #messages div.section {
   padding: 0;
+  width: auto;
 }
diff --git a/themes/bartik/css/print.css b/themes/bartik/css/print.css
index d6f3131ba8e83c831f4fdb5dcde5ef094240ada5..61ca3fa7d33318587920e217f22c7fc07c9ee459 100644
--- a/themes/bartik/css/print.css
+++ b/themes/bartik/css/print.css
@@ -1,4 +1,3 @@
-/* $Id: print.css,v 1.2 2010/09/09 15:27:08 webchick Exp $ */
 
 /* ---------- General Layout ---------- */
 
diff --git a/themes/bartik/css/style-rtl.css b/themes/bartik/css/style-rtl.css
index 5220c67f030ecd79f822391bef3b5fd251686dc0..d25006faaac45380dc6609b483d7abfc27b43999 100644
--- a/themes/bartik/css/style-rtl.css
+++ b/themes/bartik/css/style-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: style-rtl.css,v 1.19 2011/01/04 06:23:29 dries Exp $ */
 
 /* ------------------ Reset Styles ------------------ */
 
diff --git a/themes/bartik/css/style.css b/themes/bartik/css/style.css
index d37754cabe127e4cf47efc2586921c7074002b3c..7c14277840bedbd5ddd049d586bd2c5782f5528b 100644
--- a/themes/bartik/css/style.css
+++ b/themes/bartik/css/style.css
@@ -1,4 +1,3 @@
-/* $Id: style.css,v 1.53 2011/01/04 06:23:29 dries Exp $ */
 
 /* ---------- Overall Specifications ---------- */
 
@@ -159,7 +158,7 @@ blockquote:after {
   line-height: 0.1em;
   vertical-align: -.45em;
 }
-blockquote :first-child {
+blockquote > p:first-child {
   display: inline;
 }
 a.feed-icon {
@@ -1067,25 +1066,26 @@ div.messages {
 
 /* -------------- Password Meter  ------------- */
 
+.confirm-parent,
+.password-parent {
+  width: 34em;
+}
 .password-parent,
 div.form-item div.password-suggestions {
   position: relative;
-  width: auto;
-}
-#password-strength {
-  float: none;
-  left: 16em;
-  position: absolute;
-  width: 11.5em;
 }
-#password-strength-text,
+.password-strength-text,
 .password-strength-title,
 div.password-confirm {
   font-size: 0.82em;
 }
-#password-strength-text {
+.password-strength-text {
   margin-top: 0.2em;
 }
+div.password-confirm {
+  margin-top: 2.2em;
+  width: 20.73em;
+}
 
 /* ---------------- Buttons    ---------------- */
 
@@ -1136,7 +1136,7 @@ fieldset {
 .fieldset-wrapper {
   margin-top: 25px;
 }
-.node-form .fieldset-wrapper {
+.node-form .vertical-tabs .fieldset-wrapper {
   margin-top: 0;
 }
 .filter-wrapper {
@@ -1213,6 +1213,13 @@ fieldset legend a:active {
 fieldset .fieldset-wrapper {
   padding: 0 10px;
 }
+fieldset .fieldset-description {
+  margin-top: 5px;
+  margin-bottom: 1em;
+  line-height: 1.4;
+  color: #3c3c3c;
+  font-style: italic;
+}
 input {
   margin: 2px 0;
   padding: 4px;
@@ -1247,12 +1254,6 @@ input.form-submit:focus {
 .form-item label {
   font-size: 0.929em;
 }
-fieldset .description {
-  margin-top: 5px;
-  line-height: 1.4;
-  color: #3c3c3c;
-  font-style: italic;
-}
 .form-type-radio label,
 .form-type-checkbox label {
   margin-left: 4px;
diff --git a/themes/bartik/template.php b/themes/bartik/template.php
index 685331a7804b19a6ea396513c076297c4621046c..d523a0abab57259b3775d5e661a388e6875ca673 100644
--- a/themes/bartik/template.php
+++ b/themes/bartik/template.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: template.php,v 1.13 2010/12/14 01:04:27 dries Exp $
 
 /**
  * Add body classes if certain regions have content.
@@ -106,7 +105,6 @@ function bartik_process_maintenance_page(&$variables) {
  * Override or insert variables into the node template.
  */
 function bartik_preprocess_node(&$variables) {
-  $variables['submitted'] = t('published by !username on !datetime', array('!username' => $variables['name'], '!datetime' => $variables['date']));
   if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) {
     $variables['classes_array'][] = 'node-full';
   }
diff --git a/themes/bartik/templates/comment-wrapper.tpl.php b/themes/bartik/templates/comment-wrapper.tpl.php
index 09b8e1c17282834064cc297730f54eeb77bf5b31..864dc41c4086de489187617561428a6d1fcd24db 100644
--- a/themes/bartik/templates/comment-wrapper.tpl.php
+++ b/themes/bartik/templates/comment-wrapper.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: comment-wrapper.tpl.php,v 1.2 2010/09/25 02:05:51 dries Exp $
 
 /**
  * @file
diff --git a/themes/bartik/templates/comment.tpl.php b/themes/bartik/templates/comment.tpl.php
index 3135c65d15e18361082d9b9b45c97b7fcbedd504..d64487d0ea845c14713ef1916087cfb433d04e60 100644
--- a/themes/bartik/templates/comment.tpl.php
+++ b/themes/bartik/templates/comment.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: comment.tpl.php,v 1.4 2010/12/01 00:18:15 webchick Exp $
 
 /**
  * @file
diff --git a/themes/bartik/templates/maintenance-page.tpl.php b/themes/bartik/templates/maintenance-page.tpl.php
index 9c35121a1bc309017b1ec3f2b10919d0ce63bb30..6deef1e3f2ae5671327567a9c9a517b9fde6f86a 100644
--- a/themes/bartik/templates/maintenance-page.tpl.php
+++ b/themes/bartik/templates/maintenance-page.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: maintenance-page.tpl.php,v 1.4 2010/11/30 17:55:13 dries Exp $
 
 /**
  * @file
diff --git a/themes/bartik/templates/node.tpl.php b/themes/bartik/templates/node.tpl.php
index f5907d9b45ef169201d2367bc584791a08929346..f215b477bb3200ea9bdb0f989e110110d58a4bdf 100644
--- a/themes/bartik/templates/node.tpl.php
+++ b/themes/bartik/templates/node.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: node.tpl.php,v 1.2 2010/12/01 00:18:15 webchick Exp $
 
 /**
  * @file
diff --git a/themes/bartik/templates/page.tpl.php b/themes/bartik/templates/page.tpl.php
index ed18127effae27edf2004ebd3acce9ccadfa2f71..7b0f99097a0e40b2f6944b61584951430b8a94fe 100644
--- a/themes/bartik/templates/page.tpl.php
+++ b/themes/bartik/templates/page.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: page.tpl.php,v 1.9 2010/11/07 21:48:56 dries Exp $
 
 /**
  * @file
diff --git a/themes/engines/phptemplate/phptemplate.engine b/themes/engines/phptemplate/phptemplate.engine
index 6b935026ab198f77f764bc38e51018a8856c83a8..d293b85c7e7134e5deeea976d5bdd3256ebe6ec5 100644
--- a/themes/engines/phptemplate/phptemplate.engine
+++ b/themes/engines/phptemplate/phptemplate.engine
@@ -1,5 +1,4 @@
 <?php
-// $Id: phptemplate.engine,v 1.75 2010/02/23 19:03:37 webchick Exp $
 
 /**
  * @file
diff --git a/themes/garland/color/color.inc b/themes/garland/color/color.inc
index 416983b7bc2113c4bdf3530c12de42076a21f47e..163369294044cc3b32409564aa89d73e5f935e41 100644
--- a/themes/garland/color/color.inc
+++ b/themes/garland/color/color.inc
@@ -1,5 +1,4 @@
 <?php
-// $Id: color.inc,v 1.5 2010/04/03 08:05:08 webchick Exp $
 
 $info = array(
 
diff --git a/themes/garland/color/preview.css b/themes/garland/color/preview.css
index b63c078c23388319e2925e82df897c1ceb508472..cf324380463b7545e26a38a1a65e1004126ff965 100644
--- a/themes/garland/color/preview.css
+++ b/themes/garland/color/preview.css
@@ -1,4 +1,3 @@
-/* $Id: preview.css,v 1.5 2010/04/28 20:08:39 dries Exp $ */
 
 /* Positioning */
 #preview {
diff --git a/themes/garland/comment.tpl.php b/themes/garland/comment.tpl.php
index d083ea9af2235bc62d1110e5f61b0167dbba7673..900afc1065352f51fb6e2d71c622aa430d25cea7 100644
--- a/themes/garland/comment.tpl.php
+++ b/themes/garland/comment.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: comment.tpl.php,v 1.21 2010/12/01 00:18:15 webchick Exp $
 ?>
 <div class="<?php print $classes . ' ' . $zebra; ?>"<?php print $attributes; ?>>
 
diff --git a/themes/garland/fix-ie-rtl.css b/themes/garland/fix-ie-rtl.css
index 4816254831fc46529d6b74b72d3cefefb1a01189..fb1901b37ebaac62ca38ef53962a60c391ca019d 100644
--- a/themes/garland/fix-ie-rtl.css
+++ b/themes/garland/fix-ie-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: fix-ie-rtl.css,v 1.6 2010/04/28 20:08:39 dries Exp $ */
 
 body {
   /* Center layout */
diff --git a/themes/garland/fix-ie.css b/themes/garland/fix-ie.css
index 8753da1defed85f376582d04808783675be35b66..1a1c131bc21fe2d4fc19c512a6aa407d3c0e66ca 100644
--- a/themes/garland/fix-ie.css
+++ b/themes/garland/fix-ie.css
@@ -1,4 +1,3 @@
-/* $Id: fix-ie.css,v 1.13 2010/04/28 20:08:39 dries Exp $ */
 
 body {
   /* Center layout */
diff --git a/themes/garland/garland.info b/themes/garland/garland.info
index 31925c1ba21a6449c8da4b442940c12b26a65ea3..adc37e387515f9fd0694a9a8bbc6dbfdb90096c7 100644
--- a/themes/garland/garland.info
+++ b/themes/garland/garland.info
@@ -1,4 +1,3 @@
-; $Id: garland.info,v 1.10 2010/11/07 00:27:20 dries Exp $
 name = Garland
 description = A multi-column theme which can be configured to modify colors and switch between fixed and fluid width layouts.
 package = Core
@@ -8,8 +7,8 @@ stylesheets[all][] = style.css
 stylesheets[print][] = print.css
 settings[garland_width] = fluid
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/themes/garland/maintenance-page.tpl.php b/themes/garland/maintenance-page.tpl.php
index 1c22bc8184585279ad649ebbb1349923411bbdaa..75fb1471db9205bb092bb31e0695d97d650b8214 100644
--- a/themes/garland/maintenance-page.tpl.php
+++ b/themes/garland/maintenance-page.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: maintenance-page.tpl.php,v 1.16 2010/03/04 09:03:08 dries Exp $
 
 /**
  * @file
diff --git a/themes/garland/node.tpl.php b/themes/garland/node.tpl.php
index 50fb3c71dedfc765ea43ff5fc9accde8d28b2dff..27808f4f5641baf2cb2892231e8d098ebc4708f7 100644
--- a/themes/garland/node.tpl.php
+++ b/themes/garland/node.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: node.tpl.php,v 1.24 2010/12/01 00:18:15 webchick Exp $
 ?>
 <div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?>"<?php print $attributes; ?>>
 
diff --git a/themes/garland/page.tpl.php b/themes/garland/page.tpl.php
index 4857a67faca0d95f25279b7e49fe0789d7898390..326255cd4ef894a9dcbf6ecf23cae5d76143e51a 100644
--- a/themes/garland/page.tpl.php
+++ b/themes/garland/page.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: page.tpl.php,v 1.48 2010/11/20 04:03:51 webchick Exp $
 ?>
   <?php print render($page['header']); ?>
 
diff --git a/themes/garland/print.css b/themes/garland/print.css
index 2b74d16773c7bc6f03a11d419e57a7e72e718c94..df4f0ae2ec829138774a27a7d33b1372af9bf217 100644
--- a/themes/garland/print.css
+++ b/themes/garland/print.css
@@ -1,4 +1,3 @@
-/* $Id: print.css,v 1.9 2010/04/28 20:08:39 dries Exp $ */
 
 body,
 input,
diff --git a/themes/garland/style-rtl.css b/themes/garland/style-rtl.css
index 67d9030362b02921e321865ed1e4e852bc04a571..58aed578bee5dafee4b41739438db3be7cc0cdbf 100644
--- a/themes/garland/style-rtl.css
+++ b/themes/garland/style-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: style-rtl.css,v 1.23 2010/09/27 01:12:45 dries Exp $ */
 
 html {
   direction: rtl;
diff --git a/themes/garland/style.css b/themes/garland/style.css
index dc8fd8dfa4d7a5813608b1ad2a8b65935ba44f5d..f36fa96549fe5c581b03feaaf8ccda9908a97534 100644
--- a/themes/garland/style.css
+++ b/themes/garland/style.css
@@ -1,4 +1,3 @@
-/* $Id: style.css,v 1.88 2011/01/03 07:04:48 webchick Exp $ */
 
 /**
  * Generic elements
diff --git a/themes/garland/template.php b/themes/garland/template.php
index 45818aaaadc654553b0c4a63a81c21fc2f4c5968..1b144f1210b998a4b50d34fe199e3f8d566dfaca 100644
--- a/themes/garland/template.php
+++ b/themes/garland/template.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: template.php,v 1.45 2010/12/01 00:18:15 webchick Exp $
 
 /**
  * Return a themed breadcrumb trail.
diff --git a/themes/garland/theme-settings.php b/themes/garland/theme-settings.php
index dc2ea33609b59b09b52e5f20f3a902c3fdb8d2ec..24543416f489804b5140063d41b24e43f0effd49 100644
--- a/themes/garland/theme-settings.php
+++ b/themes/garland/theme-settings.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: theme-settings.php,v 1.3 2010/09/04 15:21:09 dries Exp $
 
 /**
  * @file
diff --git a/themes/seven/ie.css b/themes/seven/ie.css
index 74e56fa47962ed0ec3bfdd6119b548a43811b823..4b2569502f0c352195dabfe062cb875a351c8063 100644
--- a/themes/seven/ie.css
+++ b/themes/seven/ie.css
@@ -1,4 +1,3 @@
-/* $Id: ie.css,v 1.4 2010/09/23 17:54:20 dries Exp $ */
 
 /* IE7 renders legends in nested fieldsets without a width. */
 fieldset legend {
diff --git a/themes/seven/ie6.css b/themes/seven/ie6.css
index c3735ba5c9f09a7c4c9db87ecc9005836c33d631..7d1c320b84bc7447c73c458ccf991a90481c745c 100644
--- a/themes/seven/ie6.css
+++ b/themes/seven/ie6.css
@@ -1,4 +1,3 @@
-/* $Id: ie6.css,v 1.7 2010/10/03 02:46:12 dries Exp $ */
 
 ul.menu li,
 ul.menu li a,
diff --git a/themes/seven/images/fc-rtl.png b/themes/seven/images/fc-rtl.png
new file mode 100644
index 0000000000000000000000000000000000000000..e02cf9cd9e45465cd89d047353b5796bafaf4a9f
Binary files /dev/null and b/themes/seven/images/fc-rtl.png differ
diff --git a/themes/seven/maintenance-page.tpl.php b/themes/seven/maintenance-page.tpl.php
index 6cd43c40847149cc0e07baff27e78399aac2c3d1..aeef310df82b1f4a753dfee536320bd07b515f8c 100644
--- a/themes/seven/maintenance-page.tpl.php
+++ b/themes/seven/maintenance-page.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: maintenance-page.tpl.php,v 1.2 2009/11/22 23:44:09 webchick Exp $
 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
diff --git a/themes/seven/page.tpl.php b/themes/seven/page.tpl.php
index 6327c0928cd65434418132165e29b2580e8a2909..85353a7b04c905107da0ef5407d2bde68720ef51 100644
--- a/themes/seven/page.tpl.php
+++ b/themes/seven/page.tpl.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: page.tpl.php,v 1.15 2010/11/20 04:03:51 webchick Exp $
 ?>
   <div id="branding" class="clearfix">
     <?php print $breadcrumb; ?>
diff --git a/themes/seven/reset.css b/themes/seven/reset.css
index 90ab4705aa9bd25750babea54021d4456cf1cf45..0bdc29aef80d2e7be84ed2b75d93b8895abbcc66 100644
--- a/themes/seven/reset.css
+++ b/themes/seven/reset.css
@@ -1,4 +1,3 @@
-/* $Id: reset.css,v 1.13 2010/12/19 04:58:13 webchick Exp $ */
 
 /**
  * Reset CSS styles.
diff --git a/themes/seven/seven.info b/themes/seven/seven.info
index 10d306c1fb21c84857edd0385f2693c1f0a870bf..599879f737c409a3b0f2a82406fcec0c387507f8 100644
--- a/themes/seven/seven.info
+++ b/themes/seven/seven.info
@@ -1,4 +1,3 @@
-; $Id: seven.info,v 1.6 2010/11/07 00:27:20 dries Exp $
 name = Seven
 description = A simple one-column, tableless, fluid width administration theme.
 package = Core
@@ -14,8 +13,8 @@ regions[page_bottom] = Page bottom
 regions[sidebar_first] = First sidebar
 regions_hidden[] = sidebar_first
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/themes/seven/style-rtl.css b/themes/seven/style-rtl.css
index 755ad2fb6b05c43ae7635134ff53319ef269d615..6328193c17769a3e13bba85eb06f33f097570942 100644
--- a/themes/seven/style-rtl.css
+++ b/themes/seven/style-rtl.css
@@ -1,4 +1,3 @@
-/* $Id: style-rtl.css,v 1.2 2010/10/15 04:37:15 webchick Exp $ */
 
 /**
  * Generic elements.
diff --git a/themes/seven/style.css b/themes/seven/style.css
index 851d2d816af5bc416169b75c23bb5199930b53a6..66303c5019cff6eb6c8f46a7665afd8d05a4bbaf 100644
--- a/themes/seven/style.css
+++ b/themes/seven/style.css
@@ -1,4 +1,3 @@
-/* $Id: style.css,v 1.86 2011/01/03 07:04:48 webchick Exp $ */
 
 /**
  * Generic elements.
@@ -918,7 +917,7 @@ div.add-or-remove-shortcuts {
 #dashboard div.block h2 {
   margin: 0;
   font-size: 1em;
-  padding: 3px 9px 3px 19px;
+  padding: 3px 10px;
 }
 #dashboard div.block div.content {
   padding: 10px 5px 5px 5px;
diff --git a/themes/seven/template.php b/themes/seven/template.php
index b01d8b91de5bd7fc114d3cfb787b8fa08647a58a..4582749b1d0a29dd98db48f0a8625b965a1036a1 100644
--- a/themes/seven/template.php
+++ b/themes/seven/template.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: template.php,v 1.25 2010/11/20 04:03:51 webchick Exp $
 
 /**
  * Override or insert variables into the maintenance page template.
@@ -89,10 +88,10 @@ function seven_tablesort_indicator($variables) {
   $style = $variables['style'];
   $theme_path = drupal_get_path('theme', 'seven');
   if ($style == 'asc') {
-    return theme('image', array('path' => $theme_path . '/images/arrow-asc.png', 'alt' => t('sort ascending'), 'title' => t('sort ascending')));
+    return theme('image', array('path' => $theme_path . '/images/arrow-asc.png', 'alt' => t('sort ascending'), 'width' => 13, 'height' => 13, 'title' => t('sort ascending')));
   }
   else {
-    return theme('image', array('path' => $theme_path . '/images/arrow-desc.png', 'alt' => t('sort descending'), 'title' => t('sort descending')));
+    return theme('image', array('path' => $theme_path . '/images/arrow-desc.png', 'alt' => t('sort descending'), 'width' => 13, 'height' => 13, 'title' => t('sort descending')));
   }
 }
 
@@ -104,6 +103,9 @@ function seven_css_alter(&$css) {
   if (isset($css['misc/vertical-tabs.css'])) {
     $css['misc/vertical-tabs.css']['data'] = drupal_get_path('theme', 'seven') . '/vertical-tabs.css';
   }
+  if (isset($css['misc/vertical-tabs-rtl.css'])) {
+    $css['misc/vertical-tabs-rtl.css']['data'] = drupal_get_path('theme', 'seven') . '/vertical-tabs-rtl.css';
+  }
   // Use Seven's jQuery UI theme style instead of the default one.
   if (isset($css['misc/ui/jquery.ui.theme.css'])) {
     $css['misc/ui/jquery.ui.theme.css']['data'] = drupal_get_path('theme', 'seven') . '/jquery.ui.theme.css';
diff --git a/themes/seven/vertical-tabs-rtl.css b/themes/seven/vertical-tabs-rtl.css
new file mode 100644
index 0000000000000000000000000000000000000000..a9598c36a05a2b355a2abc1c2f02556f3a57212c
--- /dev/null
+++ b/themes/seven/vertical-tabs-rtl.css
@@ -0,0 +1,21 @@
+
+/**
+ * Override of misc/vertical-tabs-rtl.css.
+ */
+div.vertical-tabs {
+  background: #fff url(images/fc-rtl.png) repeat-y right 0;
+}
+div.vertical-tabs .vertical-tabs-list {
+  float: right;
+  margin: 0 0 -1px -100%;
+}
+div.vertical-tabs ul li.selected a,
+div.vertical-tabs ul li.selected a:hover,
+div.vertical-tabs ul li.selected a:focus,
+div.vertical-tabs ul li.selected a:active {
+  border-left-color: #fff;
+}
+div.vertical-tabs .vertical-tabs-panes {
+  margin: 0 265px 0 0;
+  padding: 10px 0 10px 15px;
+}
diff --git a/themes/seven/vertical-tabs.css b/themes/seven/vertical-tabs.css
index 0de228b8eba8aea77b29c6f62ae2c522f0ff53ec..4f6622251c7307444a06ee19cebc822a69982b4d 100644
--- a/themes/seven/vertical-tabs.css
+++ b/themes/seven/vertical-tabs.css
@@ -1,10 +1,9 @@
-/* $Id: vertical-tabs.css,v 1.10 2010/11/19 20:45:04 dries Exp $ */
 
 /**
  * Override of misc/vertical-tabs.css.
  */
 div.vertical-tabs {
-  background: #fff url(images/fc.png) repeat-y 0 0;
+  background: #fff url(images/fc.png) repeat-y 0 0; /* LTR */
   border: 1px solid #ccc;
   margin: 10px 0;
   position: relative;
@@ -16,10 +15,10 @@ div.vertical-tabs fieldset {
 }
 div.vertical-tabs .vertical-tabs-list {
   border-bottom: 1px solid #ccc;
-  float: left;
+  float: left; /* LTR */
   font-size: 1em;
   line-height: 1;
-  margin: 0 -100% -1px 0;
+  margin: 0 -100% -1px 0; /* LTR */
   padding: 0;
   width: 240px;
 }
@@ -56,7 +55,7 @@ div.vertical-tabs ul li.selected a:hover,
 div.vertical-tabs ul li.selected a:focus,
 div.vertical-tabs ul li.selected a:active {
   background: #fff;
-  border-right-color: #fff;
+  border-right-color: #fff; /* LTR */
   border-top: 1px solid #ccc;
 }
 div.vertical-tabs ul li.first.selected a,
@@ -67,8 +66,8 @@ div.vertical-tabs ul li.selected a:focus strong {
   text-decoration: underline;
 }
 div.vertical-tabs .vertical-tabs-panes {
-  margin: 0 0 0 265px;
-  padding: 10px 15px 10px 0;
+  margin: 0 0 0 265px; /* LTR */
+  padding: 10px 15px 10px 0; /* LTR */
 }
 div.vertical-tabs .vertical-tabs-panes legend {
   display: none;
@@ -76,3 +75,19 @@ div.vertical-tabs .vertical-tabs-panes legend {
 .vertical-tabs-pane .fieldset-wrapper > div:first-child {
   padding-top: 5px;
 }
+
+/**
+ * Prevent text inputs from overflowing when container is too narrow. "width" is
+ * applied to override hardcoded cols or size attributes and used in conjunction
+ * with "box-sizing" to prevent box model issues from occurring in most browsers.
+*/
+.vertical-tabs .form-type-textfield input {
+  width: 100%;
+  -moz-box-sizing: border-box;
+  -webkit-box-sizing: border-box;
+  box-sizing: border-box;
+}
+* html .vertical-tabs .form-type-textfield,
+* html .vertical-tabs .form-textarea-wrapper {
+  width: 95%; /* IE6 */
+}
diff --git a/themes/stark/README.txt b/themes/stark/README.txt
index ffe0eb0764de2e94c0929b156f764cf3a6a368fb..e7af281ee31a7f64a798c4ea26ddab60a3535fcf 100644
--- a/themes/stark/README.txt
+++ b/themes/stark/README.txt
@@ -1,4 +1,3 @@
-// $Id: README.txt,v 1.2 2009/12/20 19:43:10 dries Exp $
 
 ABOUT STARK
 -----------
diff --git a/themes/stark/layout.css b/themes/stark/layout.css
index c622ff8cb808e8bdcfdf3bd37397c44a316f9ea3..43bb93f888569937823822b19e453ba2ea51d9d5 100644
--- a/themes/stark/layout.css
+++ b/themes/stark/layout.css
@@ -1,4 +1,3 @@
-/* $Id: layout.css,v 1.3 2009/08/03 03:04:34 webchick Exp $ */
 
 /**
  * @file
diff --git a/themes/stark/stark.info b/themes/stark/stark.info
index 62251ade18668dc0c7bb28c0077027a9e1e03d63..d860b8d8a0fa8a2d49926fcfeefc3610cbd4d50c 100644
--- a/themes/stark/stark.info
+++ b/themes/stark/stark.info
@@ -1,4 +1,3 @@
-; $Id: stark.info,v 1.4 2010/11/07 00:27:20 dries Exp $
 name = Stark
 description = This theme demonstrates Drupal's default HTML markup and CSS styles. To learn how to build your own theme and override Drupal's default code, see the <a href="http://drupal.org/theme-guide">Theming Guide</a>.
 package = Core
@@ -6,8 +5,8 @@ version = VERSION
 core = 7.x
 stylesheets[all][] = layout.css
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/themes/tests/README.txt b/themes/tests/README.txt
index 6cdb1dc92ac17bc627af6c5620da3d78a0e4aec8..5ddaa8caf22eedc2dc5e854f695b4a89614710ad 100644
--- a/themes/tests/README.txt
+++ b/themes/tests/README.txt
@@ -1,4 +1,3 @@
-// $Id: README.txt,v 1.1 2009/10/06 01:38:55 webchick Exp $
 
 The themes in this subdirectory are all used by the Drupal core testing
 framework. They are not functioning themes that could be used on a real site
diff --git a/themes/tests/test_theme/template.php b/themes/tests/test_theme/template.php
index 5681d5be79f364840484a56c540a084ceb415e39..ef8118a6da947674484fef05351ce9dd3cf03769 100644
--- a/themes/tests/test_theme/template.php
+++ b/themes/tests/test_theme/template.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: template.php,v 1.2 2010/08/22 12:46:21 dries Exp $
 
 /**
  * Tests a theme overriding a suggestion of a base theme hook.
diff --git a/themes/tests/test_theme/test_theme.info b/themes/tests/test_theme/test_theme.info
index 16938a7670af244e1675a23c41ffdc0bdb3d3cb7..2dfc17d9121af2fa57757e04709b82cb4a36a1db 100644
--- a/themes/tests/test_theme/test_theme.info
+++ b/themes/tests/test_theme/test_theme.info
@@ -1,4 +1,3 @@
-; $Id: test_theme.info,v 1.3 2010/11/07 00:27:20 dries Exp $
 name = Test theme
 description = Theme for testing the theme system
 core = 7.x
@@ -16,8 +15,8 @@ hidden = TRUE
 ; file within the theme folder.
 stylesheets[all][] = system.base.css
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/themes/tests/update_test_basetheme/update_test_basetheme.info b/themes/tests/update_test_basetheme/update_test_basetheme.info
index 27e6fb3f149a9d986a3cd12b0305a90934a5c7f8..f45f7e077423ceb0c6f1e11dc0f332643506509e 100644
--- a/themes/tests/update_test_basetheme/update_test_basetheme.info
+++ b/themes/tests/update_test_basetheme/update_test_basetheme.info
@@ -1,11 +1,10 @@
-; $Id: update_test_basetheme.info,v 1.2 2010/11/07 00:27:20 dries Exp $
 name = Update test base theme
 description = Test theme which acts as a base theme for other test subthemes.
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/themes/tests/update_test_subtheme/update_test_subtheme.info b/themes/tests/update_test_subtheme/update_test_subtheme.info
index 2b21a98e8c8fb141c5a5184f117321255b03e2f6..d4719a494b2a2689f59434d4220cbb3447997f4f 100644
--- a/themes/tests/update_test_subtheme/update_test_subtheme.info
+++ b/themes/tests/update_test_subtheme/update_test_subtheme.info
@@ -1,12 +1,11 @@
-; $Id: update_test_subtheme.info,v 1.2 2010/11/07 00:27:20 dries Exp $
 name = Update test subtheme
 description = Test theme which uses update_test_basetheme as the base theme.
 core = 7.x
 base theme = update_test_basetheme
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2011-01-05
-version = "7.0"
+; Information added by drupal.org packaging script on 2011-05-25
+version = "7.2"
 project = "drupal"
-datestamp = "1294208756"
+datestamp = "1306357016"
 
diff --git a/update.php b/update.php
index b860b9645e873c85c91e6c4435198a62b385e483..e238f9d3ff0a859ab868bba946ff60b834d2c18a 100644
--- a/update.php
+++ b/update.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: update.php,v 1.328 2011/01/04 05:57:26 webchick Exp $
 
 /**
  * Root directory of Drupal installation.
@@ -57,9 +56,10 @@ function update_script_selection_form($form, &$form_state) {
   foreach ($updates as $module => $update) {
     if (!isset($update['start'])) {
       $form['start'][$module] = array(
-        '#title' => $module,
-        '#item'  => $update['warning'],
-        '#prefix' => '<div class="warning">',
+        '#type' => 'item',
+        '#title' => $module . ' module',
+        '#markup'  => $update['warning'],
+        '#prefix' => '<div class="messages warning">',
         '#suffix' => '</div>',
       );
       $incompatible_updates_exist = TRUE;
@@ -351,9 +351,18 @@ require_once DRUPAL_ROOT . '/includes/unicode.inc';
 unl_bootstrap();
 update_prepare_d7_bootstrap();
 
+// Temporarily disable configurable timezones so the upgrade process uses the
+// site-wide timezone. This prevents a PHP notice during session initlization
+// and before offsets have been converted in user_update_7002().
+$configurable_timezones = variable_get('configurable_timezones', 1);
+$conf['configurable_timezones'] = 0;
+
 // Determine if the current user has access to run update.php.
 drupal_bootstrap(DRUPAL_BOOTSTRAP_SESSION);
 
+// Reset configurable timezones.
+$conf['configurable_timezones'] = $configurable_timezones;
+
 // Only allow the requirements check to proceed if the current user has access
 // to run updates (since it may expose sensitive information about the site's
 // configuration).
@@ -378,6 +387,10 @@ if (empty($op) && update_access_allowed()) {
   // Set up theme system for the maintenance page.
   drupal_maintenance_theme();
 
+  // Rebuild the registry to ensure that removed hooks in modules do not result
+  // in undefined function errors and that newly defined hooks are called.
+  registry_rebuild();
+
   // Check the update requirements for Drupal.
   update_check_requirements();
 
diff --git a/xmlrpc.php b/xmlrpc.php
index 32fe7ef188708fbbf2a3426b8f2503d537f71aa6..b202dc29385bf8d9e7c5fd7c2bac34cb720f968f 100644
--- a/xmlrpc.php
+++ b/xmlrpc.php
@@ -1,5 +1,4 @@
 <?php
-// $Id: xmlrpc.php,v 1.20 2010/10/02 01:22:41 dries Exp $
 
 /**
  * @file