From f272258697f4858d2e44ace7f664cba619c28ee4 Mon Sep 17 00:00:00 2001 From: Benjamin Doherty Date: Mon, 26 Oct 2009 21:58:10 -0500 Subject: [PATCH] update to latest HEAD. --- CHANGELOG.txt | 18 +- CVS/Entries | 8 +- includes/CVS/Entries | 14 +- includes/bootstrap.inc | 26 +-- includes/common.inc | 164 +++++++++--------- includes/database/CVS/Entries | 2 +- includes/database/query.inc | 20 ++- includes/file.inc | 4 +- includes/filetransfer/CVS/Entries | 6 +- includes/filetransfer/filetransfer.inc | 30 +++- includes/filetransfer/ftp.inc | 94 +++++----- includes/filetransfer/ssh.inc | 4 +- includes/language.inc | 43 +---- includes/path.inc | 27 +-- includes/theme.inc | 58 ++++--- includes/update.inc | 160 ++++++++++++++++- index.php | 25 +-- install.php | 30 +--- modules/aggregator/CVS/Entries | 2 +- modules/aggregator/aggregator.module | 20 +-- modules/block/CVS/Entries | 2 +- modules/block/block.module | 6 +- modules/book/CVS/Entries | 2 +- modules/book/book.module | 14 +- modules/color/CVS/Entries | 2 +- modules/color/color.module | 4 +- modules/comment/CVS/Entries | 2 +- modules/comment/comment.module | 12 +- modules/dashboard/CVS/Entries | 2 +- modules/dashboard/dashboard.module | 12 +- modules/dblog/CVS/Entries | 2 +- modules/dblog/dblog.module | 4 +- modules/field/CVS/Entries | 6 +- modules/field/field.api.php | 4 +- modules/field/field.info.inc | 10 +- modules/field/field.module | 10 +- modules/field/modules/number/CVS/Entries | 2 +- modules/field/modules/number/number.module | 4 +- modules/field/modules/options/CVS/Entries | 2 +- modules/field/modules/options/options.module | 10 +- modules/field/modules/text/CVS/Entries | 2 +- modules/field/modules/text/text.module | 6 +- modules/field_ui/CVS/Entries | 6 +- .../field_ui-field-overview-form.tpl.php | 10 +- modules/field_ui/field_ui.admin.inc | 14 +- modules/field_ui/field_ui.module | 12 +- modules/file/CVS/Entries | 2 +- modules/file/file.module | 14 +- modules/filter/CVS/Entries | 2 +- modules/filter/filter.module | 28 +-- modules/forum/CVS/Entries | 4 +- modules/forum/forum.module | 33 ++-- modules/forum/forum.test | 4 +- modules/image/CVS/Entries | 2 +- modules/image/image.module | 28 +-- modules/locale/CVS/Entries | 2 +- modules/locale/locale.module | 48 ++++- modules/menu/CVS/Entries | 2 +- modules/menu/menu.module | 6 +- modules/node/CVS/Entries | 8 +- modules/node/node.admin.inc | 7 +- modules/node/node.api.php | 62 ++++--- modules/node/node.module | 22 +-- modules/node/node.test | 8 +- modules/path/CVS/Entries | 2 +- modules/path/path.admin.inc | 7 +- modules/poll/CVS/Entries | 2 +- modules/poll/poll.module | 10 +- modules/profile/CVS/Entries | 2 +- modules/profile/profile.module | 10 +- modules/rdf/CVS/Entries | 2 +- modules/rdf/rdf.module | 6 +- modules/search/CVS/Entries | 2 +- modules/search/search.module | 10 +- modules/shortcut/CVS/Entries | 2 +- modules/shortcut/shortcut.module | 6 +- modules/simpletest/CVS/Entries | 4 +- modules/simpletest/drupal_web_test_case.php | 3 +- modules/simpletest/simpletest.module | 16 +- modules/simpletest/tests/CVS/Entries | 13 +- modules/simpletest/tests/common_test.module | 4 +- modules/simpletest/tests/database_test.test | 6 +- modules/simpletest/tests/field_test.module | 23 +-- modules/simpletest/tests/file.test | 30 +++- modules/simpletest/tests/path.test | 111 +++++++++++- modules/simpletest/tests/url_alter_test.info | 9 + .../simpletest/tests/url_alter_test.install | 13 ++ .../simpletest/tests/url_alter_test.module | 43 +++++ modules/statistics/CVS/Entries | 2 +- modules/statistics/statistics.module | 4 +- modules/syslog/CVS/Entries | 2 +- modules/syslog/syslog.module | 4 +- modules/system/CVS/Entries | 8 +- modules/system/system.api.php | 153 ++++++++-------- modules/system/system.install | 135 ++------------ modules/system/system.module | 122 +++++-------- modules/system/system.test | 6 +- modules/taxonomy/CVS/Entries | 10 +- modules/taxonomy/taxonomy.admin.inc | 4 +- modules/taxonomy/taxonomy.module | 27 +-- modules/taxonomy/taxonomy.pages.inc | 4 +- modules/taxonomy/taxonomy.test | 65 ++++++- modules/taxonomy/taxonomy.tokens.inc | 4 +- modules/toolbar/CVS/Entries | 2 +- modules/toolbar/toolbar.module | 45 +++-- modules/trigger/CVS/Entries | 2 +- modules/trigger/trigger.module | 4 +- modules/update/CVS/Entries | 6 +- modules/update/update.manager.inc | 115 ++++++------ modules/update/update.module | 33 ++-- modules/update/update.report.inc | 4 +- modules/upload/CVS/Entries | 2 +- modules/upload/upload.module | 8 +- modules/user/CVS/Entries | 2 +- modules/user/user.module | 22 +-- profiles/default/CVS/Entries | 4 +- profiles/default/default.info | 4 +- profiles/default/default.install | 34 ++-- sites/default/CVS/Entries | 2 +- sites/default/default.settings.php | 18 +- themes/garland/CVS/Entries | 8 +- themes/garland/block.tpl.php | 8 +- themes/garland/comment.tpl.php | 8 +- themes/garland/node.tpl.php | 8 +- themes/garland/style.css | 17 +- themes/seven/CVS/Entries | 6 +- themes/seven/page.tpl.php | 3 +- themes/seven/reset.css | 3 +- themes/seven/style.css | 19 +- update.php | 15 +- 130 files changed, 1431 insertions(+), 1056 deletions(-) create mode 100644 modules/simpletest/tests/url_alter_test.info create mode 100644 modules/simpletest/tests/url_alter_test.install create mode 100644 modules/simpletest/tests/url_alter_test.module diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 1614baa..612f095 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,4 +1,4 @@ -// $Id: CHANGELOG.txt,v 1.345 2009/10/12 05:22:56 webchick Exp $ +// $Id: CHANGELOG.txt,v 1.348 2009/10/21 19:34:53 dries Exp $ Drupal 7.0, xxxx-xx-xx (development version) ---------------------- @@ -18,7 +18,12 @@ Drupal 7.0, xxxx-xx-xx (development version) * Rate limited login attempts to prevent brute-force password guessing, and improved the flood control API to allow variable time windows and identifiers for limiting user access to resources. + * Transformed the "Update status" module into the "Update manager" which + can securely install or update modules and themes via a web interface. - Usability: + * Added contextual links (a.k.a. local tasks) to page elements, such as + blocks, nodes, or comments, which allows to perform the most common tasks + with a single click only. * Improved installer requirements check. * Improved support for integration of WYSIWYG editors. * Implemented drag-and-drop positioning for input format listings. @@ -36,8 +41,8 @@ Drupal 7.0, xxxx-xx-xx (development version) visitors. * Added an administrator role which is assigned all permisions for installed modules automatically. - * Image toolkits are now provided by modules (rather than requiring a manual - file copy to the includes directory). + * Image toolkits are now provided by modules (rather than requiring a + manual file copy to the includes directory). * Added an edit tab to taxonomy term pages. * Redesigned password strength validator. * Redesigned the add content type screen. @@ -45,8 +50,8 @@ Drupal 7.0, xxxx-xx-xx (development version) * Renamed "input formats" to "text formats". * Moved text format permissions to the main permissions page. * Added configurable ability for users to cancel their own accounts. - * Added "vertical tabs", a reusable interface component that features automatic - summaries and increases usability. + * Added "vertical tabs", a reusable interface component that features + automatic summaries and increases usability. * Replaced fieldsets on node edit and add pages with vertical tabs. - Performance: * Improved performance on uncached page views by loading multiple core @@ -141,6 +146,9 @@ Drupal 7.0, xxxx-xx-xx (development version) - Added RDF support: * Modules can declare RDF namespaces which are serialized in the tag for RDFa support. + * Modules can specify how their data structure maps to RDF. + * Added support for RDFa export of nodes, comments, terms, users, etc. and + their fields. - Field API: * Custom data fields may be attached to nodes, users, comments and taxonomy terms. diff --git a/CVS/Entries b/CVS/Entries index d42a7ed..d8f72e7 100644 --- a/CVS/Entries +++ b/CVS/Entries @@ -12,12 +12,12 @@ D/themes//// /INSTALL.sqlite.txt/1.1/Thu Aug 27 22:12:13 2009// /LICENSE.txt/1.7/Thu Aug 27 22:12:13 2009// /cron.php/1.42/Thu Aug 27 22:12:13 2009// -/index.php/1.98/Thu Aug 27 22:12:14 2009// /xmlrpc.php/1.17/Thu Aug 27 22:12:25 2009// /INSTALL.txt/1.76/Fri Oct 2 19:50:11 2009// /robots.txt/1.14/Fri Oct 2 19:50:12 2009// -/CHANGELOG.txt/1.345/Mon Oct 12 23:25:04 2009// /MAINTAINERS.txt/1.35/Mon Oct 12 23:25:04 2009// /UPGRADE.txt/1.17/Mon Oct 12 23:25:04 2009// -/update.php/1.307/Mon Oct 12 23:25:04 2009// -/install.php/1.217/Tue Oct 13 15:14:16 2009// +/CHANGELOG.txt/1.348/Tue Oct 27 02:57:00 2009// +/index.php/1.99/Tue Oct 27 02:57:00 2009// +/install.php/1.219/Tue Oct 27 02:57:00 2009// +/update.php/1.309/Tue Oct 27 02:57:00 2009// diff --git a/includes/CVS/Entries b/includes/CVS/Entries index 37a5e7e..54cd6a5 100644 --- a/includes/CVS/Entries +++ b/includes/CVS/Entries @@ -5,21 +5,17 @@ D/filetransfer//// /archiver.inc/1.2/Fri Oct 16 13:18:30 2009// /authorize.inc/1.2/Thu Oct 22 00:52:03 2009// /batch.inc/1.42/Thu Oct 22 14:25:06 2009// -/bootstrap.inc/1.313/Thu Oct 22 14:25:06 2009// /browser.inc/1.3/Thu Oct 22 14:22:19 2009// /cache-install.inc/1.5/Thu Oct 22 14:22:19 2009// /cache.inc/1.40/Thu Oct 22 14:22:19 2009// -/common.inc/1.1027/Thu Oct 22 14:25:06 2009// /date.inc/1.1/Thu Oct 22 14:22:19 2009// /entity.inc/1.2/Thu Oct 22 14:25:06 2009// -/file.inc/1.197/Thu Oct 22 14:25:06 2009// /file.mimetypes.inc/1.4/Thu Oct 22 14:22:19 2009// /form.inc/1.386/Thu Oct 22 14:25:07 2009// /graph.inc/1.3/Thu Oct 22 14:22:19 2009// /image.inc/1.38/Thu Oct 22 14:22:19 2009// /install.inc/1.115/Thu Oct 22 14:22:19 2009// /iso.inc/1.6/Thu Oct 22 14:22:19 2009// -/language.inc/1.22/Thu Oct 22 14:25:07 2009// /locale.inc/1.233/Thu Oct 22 14:25:07 2009// /lock.inc/1.1/Thu Oct 22 14:22:19 2009// /mail.inc/1.26/Thu Oct 22 14:25:07 2009// @@ -27,17 +23,21 @@ D/filetransfer//// /module.inc/1.161/Thu Oct 22 14:25:07 2009// /pager.inc/1.74/Thu Oct 22 14:22:19 2009// /password.inc/1.6/Thu Oct 22 14:22:19 2009// -/path.inc/1.46/Thu Oct 22 14:25:07 2009// /registry.inc/1.25/Thu Oct 22 14:22:19 2009// /session.inc/1.72/Thu Oct 22 14:22:19 2009// /stream_wrappers.inc/1.6/Thu Oct 22 14:22:19 2009// /tablesort.inc/1.56/Thu Oct 22 14:22:19 2009// -/theme.inc/1.541/Thu Oct 22 14:25:07 2009// /theme.maintenance.inc/1.43/Thu Oct 22 14:25:07 2009// /token.inc/1.6/Thu Oct 22 14:25:07 2009// /unicode.entities.inc/1.2/Thu Oct 22 14:22:19 2009// /unicode.inc/1.40/Thu Oct 22 14:22:19 2009// -/update.inc/1.13/Thu Oct 22 14:22:19 2009// /updater.inc/1.1/Thu Oct 15 21:19:31 2009// /xmlrpc.inc/1.61/Thu Oct 22 14:22:19 2009// /xmlrpcs.inc/1.33/Thu Oct 22 14:22:19 2009// +/bootstrap.inc/1.315/Tue Oct 27 02:57:00 2009// +/common.inc/1.1030/Tue Oct 27 02:57:01 2009// +/file.inc/1.198/Tue Oct 27 02:57:01 2009// +/language.inc/1.23/Tue Oct 27 02:57:01 2009// +/path.inc/1.47/Tue Oct 27 02:57:01 2009// +/theme.inc/1.542/Tue Oct 27 02:57:01 2009// +/update.inc/1.18/Tue Oct 27 02:57:01 2009// diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index cf3095a..b0d79a9 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -1,5 +1,5 @@ FALSE, 'prefix' => '' ); + if (!isset($options['external'])) { // Return an external link if $path contains an allowed absolute URL. // Only call the slow filter_xss_bad_protocol if $path contains a ':' before @@ -2387,10 +2388,12 @@ function url($path = NULL, array $options = array()) { $options['external'] = ($colonpos !== FALSE && !preg_match('![/?#]!', substr($path, 0, $colonpos)) && filter_xss_bad_protocol($path, FALSE) == check_plain($path)); } - // May need language dependent rewriting if language.inc is present. - if (function_exists('language_url_rewrite')) { - language_url_rewrite($path, $options); - } + // Preserve the original path before altering or aliasing. + $original_path = $path; + + // Allow other modules to alter the outbound URL and options. + drupal_alter('url_outbound', $path, $options, $original_path); + if ($options['fragment']) { $options['fragment'] = '#' . $options['fragment']; } @@ -2439,21 +2442,16 @@ function url($path = NULL, array $options = array()) { } } - // Preserve the original path before aliasing. - $original_path = $path; - // The special path '' links to the default front page. if ($path == '') { $path = ''; } elseif (!empty($path) && !$options['alias']) { $language = isset($options['language']) && isset($options['language']->language) ? $options['language']->language : ''; - $path = drupal_get_path_alias($path, $language); - } - - if (function_exists('custom_url_rewrite_outbound')) { - // Modules may alter outbound links by reference. - custom_url_rewrite_outbound($path, $options, $original_path); + $alias = drupal_get_path_alias($original_path, $language); + if ($alias != $original_path) { + $path = $alias; + } } $base = $options['absolute'] ? $options['base_url'] . '/' : base_path(); @@ -4223,6 +4221,7 @@ function _drupal_bootstrap_full() { return; } $called = 1; + require_once DRUPAL_ROOT . '/includes/path.inc'; require_once DRUPAL_ROOT . '/includes/theme.inc'; require_once DRUPAL_ROOT . '/includes/pager.inc'; require_once DRUPAL_ROOT . '/includes/menu.inc'; @@ -4256,6 +4255,8 @@ function _drupal_bootstrap_full() { ini_set('log_errors', 1); ini_set('error_log', file_directory_path() . '/error.log'); } + // Initialize $_GET['q'] prior to invoking hook_init(). + drupal_path_initialize(); // Set a custom theme for the current page, if there is one. We need to run // this before invoking hook_init(), since any modules which initialize the // theme system will prevent a custom theme from being correctly set later. @@ -5071,196 +5072,196 @@ function drupal_common_theme() { return array( // theme.inc 'placeholder' => array( - 'arguments' => array('text' => NULL) + 'variables' => array('text' => NULL) ), 'html' => array( - 'arguments' => array('page' => NULL), + 'render element' => 'page', 'template' => 'html', ), 'page' => array( - 'arguments' => array('page' => NULL), + 'render element' => 'page', 'template' => 'page', ), 'region' => array( - 'arguments' => array('elements' => NULL), + 'render element' => 'elements', 'template' => 'region', ), 'status_messages' => array( - 'arguments' => array('display' => NULL), + 'variables' => array('display' => NULL), ), 'links' => array( - 'arguments' => array('links' => NULL, 'attributes' => array('class' => array('links')), 'heading' => array()), + 'variables' => array('links' => NULL, 'attributes' => array('class' => array('links')), 'heading' => array()), ), 'image' => array( - 'arguments' => array('path' => NULL, 'alt' => '', 'title' => '', 'attributes' => array(), 'getsize' => TRUE), + 'variables' => array('path' => NULL, 'alt' => '', 'title' => '', 'attributes' => array(), 'getsize' => TRUE), ), 'breadcrumb' => array( - 'arguments' => array('breadcrumb' => NULL), + 'variables' => array('breadcrumb' => NULL), ), 'help' => array( - 'arguments' => array(), + 'variables' => array(), ), 'submenu' => array( - 'arguments' => array('links' => NULL), + 'variables' => array('links' => NULL), ), 'table' => array( - 'arguments' => array('header' => NULL, 'rows' => NULL, 'attributes' => array(), 'caption' => NULL, 'colgroups' => array(), 'sticky' => TRUE), + 'variables' => array('header' => NULL, 'rows' => NULL, 'attributes' => array(), 'caption' => NULL, 'colgroups' => array(), 'sticky' => TRUE), ), 'table_select_header_cell' => array( - 'arguments' => array(), + 'variables' => array(), ), 'tablesort_indicator' => array( - 'arguments' => array('style' => NULL), + 'variables' => array('style' => NULL), ), 'mark' => array( - 'arguments' => array('type' => MARK_NEW), + 'variables' => array('type' => MARK_NEW), ), 'item_list' => array( - 'arguments' => array('items' => array(), 'title' => NULL, 'type' => 'ul', 'attributes' => array()), + 'variables' => array('items' => array(), 'title' => NULL, 'type' => 'ul', 'attributes' => array()), ), 'more_help_link' => array( - 'arguments' => array('url' => NULL), + 'variables' => array('url' => NULL), ), 'feed_icon' => array( - 'arguments' => array('url' => NULL, 'title' => NULL), + 'variables' => array('url' => NULL, 'title' => NULL), ), 'more_link' => array( - 'arguments' => array('url' => NULL, 'title' => NULL) + 'variables' => array('url' => NULL, 'title' => NULL) ), 'blocks' => array( - 'arguments' => array('region' => NULL), + 'variables' => array('region' => NULL), ), 'username' => array( - 'arguments' => array('account' => NULL), + 'variables' => array('account' => NULL), ), 'progress_bar' => array( - 'arguments' => array('percent' => NULL, 'message' => NULL), + 'variables' => array('percent' => NULL, 'message' => NULL), ), 'indentation' => array( - 'arguments' => array('size' => 1), + 'variables' => array('size' => 1), ), // from theme.maintenance.inc 'maintenance_page' => array( - 'arguments' => array('content' => NULL, 'show_messages' => TRUE), + 'variables' => array('content' => NULL, 'show_messages' => TRUE), 'template' => 'maintenance-page', ), 'update_page' => array( - 'arguments' => array('content' => NULL, 'show_messages' => TRUE), + 'variables' => array('content' => NULL, 'show_messages' => TRUE), ), 'install_page' => array( - 'arguments' => array('content' => NULL), + 'variables' => array('content' => NULL), ), 'task_list' => array( - 'arguments' => array('items' => NULL, 'active' => NULL), + 'variables' => array('items' => NULL, 'active' => NULL), ), 'authorize_message' => array( - 'arguments' => array('message' => NULL, 'success' => TRUE), + 'variables' => array('message' => NULL, 'success' => TRUE), ), 'authorize_report' => array( - 'arguments' => array('messages' => array()), + 'variables' => array('messages' => array()), ), // from pager.inc 'pager' => array( - 'arguments' => array('tags' => array(), 'element' => 0, 'parameters' => array(), 'quantity' => 9), + 'variables' => array('tags' => array(), 'element' => 0, 'parameters' => array(), 'quantity' => 9), ), 'pager_first' => array( - 'arguments' => array('text' => NULL, 'element' => 0, 'parameters' => array()), + 'variables' => array('text' => NULL, 'element' => 0, 'parameters' => array()), ), 'pager_previous' => array( - 'arguments' => array('text' => NULL, 'element' => 0, 'interval' => 1, 'parameters' => array()), + 'variables' => array('text' => NULL, 'element' => 0, 'interval' => 1, 'parameters' => array()), ), 'pager_next' => array( - 'arguments' => array('text' => NULL, 'element' => 0, 'interval' => 1, 'parameters' => array()), + 'variables' => array('text' => NULL, 'element' => 0, 'interval' => 1, 'parameters' => array()), ), 'pager_last' => array( - 'arguments' => array('text' => NULL, 'element' => 0, 'parameters' => array()), + 'variables' => array('text' => NULL, 'element' => 0, 'parameters' => array()), ), 'pager_link' => array( - 'arguments' => array('text' => NULL, 'page_new' => NULL, 'element' => NULL, 'parameters' => array(), 'attributes' => array()), + 'variables' => array('text' => NULL, 'page_new' => NULL, 'element' => NULL, 'parameters' => array(), 'attributes' => array()), ), // from locale.inc 'locale_admin_manage_screen' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), // from menu.inc 'menu_link' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'menu_tree' => array( - 'arguments' => array('tree' => NULL), + 'render element' => 'tree', ), 'menu_local_task' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'menu_local_action' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'menu_local_tasks' => array( - 'arguments' => array(), + 'variables' => array(), ), // from form.inc 'select' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'fieldset' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'radio' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'radios' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'date' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'checkbox' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'checkboxes' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'button' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'image_button' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'hidden' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'textfield' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'form' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'textarea' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'markup' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'password' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'file' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'tableselect' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'form_element' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'text_format_wrapper' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'vertical_tabs' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'container' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), ); } @@ -6065,12 +6066,18 @@ function archiver_get_info() { * * @param $file * The full path of the archive file. Note that stream wrapper - * paths are supported. + * paths are supported, but not remote ones. * @return * A newly created instance of the archiver class appropriate * for the specified file, already bound to that file. + * If no appropriate archiver class was found, will return FALSE. */ function archiver_get_archiver($file) { + // Archivers can only work on local paths + $filepath = drupal_realpath($file); + if (!is_file($filepath)) { + throw new Exception(t('Archivers can only operate on local files: %file not supported', array('%file' => $file))); + } $archiver_info = archiver_get_info(); foreach ($archiver_info as $implementation) { @@ -6080,8 +6087,8 @@ function archiver_get_archiver($file) { // This method isn't quite as clean but gets the job done. // Also note that the file may not yet exist, so we cannot rely // on fileinfo() or other disk-level utilities. - if (strrpos($file, '.' . $extension) === strlen($file) - strlen('.' . $extension)) { - return new $implementation['class']($file); + if (strrpos($filepath, '.' . $extension) === strlen($filepath) - strlen('.' . $extension)) { + return new $implementation['class']($filepath); } } } @@ -6109,4 +6116,3 @@ function drupal_get_updaters() { } return $updaters; } - diff --git a/includes/database/CVS/Entries b/includes/database/CVS/Entries index 961be44..2ec0ede 100644 --- a/includes/database/CVS/Entries +++ b/includes/database/CVS/Entries @@ -4,6 +4,6 @@ D/sqlite//// /log.inc/1.6/Thu Aug 27 22:12:13 2009// /prefetch.inc/1.6/Thu Aug 27 22:12:14 2009// /schema.inc/1.22/Thu Oct 8 03:28:40 2009// -/query.inc/1.32/Mon Oct 12 23:25:04 2009// /database.inc/1.81/Thu Oct 22 14:25:07 2009// /select.inc/1.26/Thu Oct 22 14:25:07 2009// +/query.inc/1.33/Tue Oct 27 02:57:01 2009// diff --git a/includes/database/query.inc b/includes/database/query.inc index c64c7a7..7c65c6f 100644 --- a/includes/database/query.inc +++ b/includes/database/query.inc @@ -1,5 +1,5 @@ array('delimiter' => ' AND '), 'IN' => array('delimiter' => ', ', 'prefix' => ' (', 'postfix' => ')'), 'NOT IN' => array('delimiter' => ', ', 'prefix' => ' (', 'postfix' => ')'), - 'LIKE' => array('operator' => 'LIKE'), 'IS NULL' => array('use_value' => FALSE), 'IS NOT NULL' => array('use_value' => FALSE), + // These ones are here for performance reasons. + '=' => array(), + '<' => array(), + '>' => array(), + '>=' => array(), + '<=' => array(), + 'LIKE' => array(), ); + if (isset($specials[$operator])) { + $return = $specials[$operator]; + } + else { + // We need to upper case because PHP index matches are case sensitive but + // do not need the more expensive drupal_strtoupper because SQL statements are ASCII. + $operator = strtoupper($operator); + $return = isset($specials[$operator]) ? $specials[$operator] : array(); + } - $return = isset($specials[$operator]) ? $specials[$operator] : array(); $return += array('operator' => $operator); return $return; diff --git a/includes/file.inc b/includes/file.inc index 67b6106..a8d5c30 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -1,5 +1,5 @@ sanitizePath($path); $path = $this->fixRemotePath($path); $this->checkPath($path); $this->chmodJailed($path, $mode, $recursive); } - - protected abstract function chmodJailed($path, $mode, $recursive); - + /** * Creates a directory. * @@ -314,4 +315,23 @@ class FileTransferException extends Exception { parent::__construct($message, $code); $this->arguments = $arguments; } -} \ No newline at end of file +} + + +/** + * A FileTransfer Class implementing this interface can be used to chmod files. + */ +interface FileTransferChmodInterface { + + /** + * Changes the permissions of the file / directory specified in $path + * + * @param string $path + * Path to change permissions of. + * @param long $mode + * @see http://php.net/chmod + * @param boolean $recursive + * Pass TRUE to recursively chmod the entire directory specified in $path. + */ + function chmodJailed($path, $mode, $recursive); +} diff --git a/includes/filetransfer/ftp.inc b/includes/filetransfer/ftp.inc index d5c6f1b..1c2f5c7 100644 --- a/includes/filetransfer/ftp.inc +++ b/includes/filetransfer/ftp.inc @@ -1,11 +1,11 @@ username = $username; $this->password = $password; @@ -13,6 +13,39 @@ class FileTransferFTPWrapper extends FileTransfer { $this->port = $port; parent::__construct($jail); } + + /** + * Return an object which can implement the FTP protocol. + * + * @param string $jail + * @param array $settings + * @return + * The appropriate FileTransferFTP subclass based on the available + * options. If the FTP PHP extension is available, use it. Otherwise, we + * try to use the FTP file stream support. + */ + static function factory($jail, $settings) { + $settings['hostname'] = empty($settings['hostname']) ? 'localhost' : $settings['hostname']; + $settings['port'] = empty($settings['port']) ? 21 : $settings['port']; + + if (function_exists('ftp_connect')) { + $class = 'FileTransferFTPExtension'; + } + elseif (ini_get('allow_url_fopen')) { + $class = 'FileTransferFTPWrapper'; + } + else { + throw new FileTransferException('No FTP backend available.'); + } + + return new $class($jail, $settings['username'], $settings['password'], $settings['hostname'], $settings['port']); + } +} + +/** + * Connection class using the FTP URL wrapper. + */ +class FileTransferFTPWrapper extends FileTransferFTP { function connect() { $this->connection = 'ftp://' . urlencode($this->username) . ':' . urlencode($this->password) . '@' . $this->hostname . ':' . $this->port . '/'; @@ -20,12 +53,6 @@ class FileTransferFTPWrapper extends FileTransfer { throw new FileTransferException('FTP Connection failed.'); } } - - static function factory($jail, $settings) { - $settings['hostname'] = empty($settings['hostname']) ? 'localhost' : $settings['hostname']; - $settings['port'] = empty($settings['port']) ? 21 : $settings['port']; - return new FileTransferFTPWrapper($jail, $settings['username'], $settings['password'], $settings['hostname'], $settings['port']); - } function createDirectoryJailed($directory) { if (!@drupal_mkdir($this->connection . $directory)) { @@ -77,39 +104,9 @@ class FileTransferFTPWrapper extends FileTransfer { // This is stupid, but is_file and file_exists don't work! always return true. return @fopen($this->connection . '/' . $path,'r'); } - - /** - * This is impossible with the stream wrapper, so an exception is thrown. - * - * If the ftp extenstion is available, we will cheat and use that instead. - * - * @param string $path - * @param long $mode - * @param bool $recursive - */ - function chmodJailed($path, $mode, $recursive) { - if (!function_exists('ftp_connect')) { - throw new FileTransferException('Unable to set permissions on @path. Change umask settings on server to be world executable.', array('@path' => $path)); - } - static $ftp_ext_file_transfer; - - if (!$ftp_ext_file_transfer) { - $ftp_ext_file_transfer = new FileTransferFTPExtension($this->jail, $this->username, $this->password, $this->hostname, $this->port); - } - $ftp_ext_file_transfer->chmodJailed($path, $mode, $recursive); - } - } -class FileTransferFTPExtension extends FileTransfer { - - public function __construct($jail, $username, $password, $hostname, $port) { - $this->username = $username; - $this->password = $password; - $this->hostname = $hostname; - $this->port = $port; - parent::__construct($jail); - } +class FileTransferFTPExtension extends FileTransferFTP implements FileTransferChmodInterface { public function connect() { $this->connection = ftp_connect($this->hostname, $this->port); @@ -122,19 +119,6 @@ class FileTransferFTPExtension extends FileTransfer { } } - /** - * Returns a copy of itself using common defaults. - * - * @param string $jail - * @param array $settings - * @return FileTransferFTPExtension - */ - static function factory($jail, $settings) { - $settings['hostname'] = empty($settings['hostname']) ? 'localhost' : $settings['hostname']; - $settings['port'] = empty($settings['port']) ? 21 : $settings['port']; - return new FileTransferFTPExtension($jail, $settings['username'], $settings['password'], $settings['hostname'], $settings['port']); - } - protected function copyFileJailed($source, $destination) { if (!@ftp_put($this->connection, $destination, $source, FTP_BINARY)) { throw new FileTransferException("Cannot move @source to @destination", NULL, array("@source" => $source, "@destination" => $destination)); @@ -215,4 +199,4 @@ if (!function_exists('ftp_chmod')) { function ftp_chmod($ftp_stream, $mode, $filename) { return ftp_site($ftp_stream, sprintf('CHMOD %o %s', $mode, $filename)); } -} \ No newline at end of file +} diff --git a/includes/filetransfer/ssh.inc b/includes/filetransfer/ssh.inc index c7c28cc..2cee170 100644 --- a/includes/filetransfer/ssh.inc +++ b/includes/filetransfer/ssh.inc @@ -1,10 +1,10 @@ username = $username; diff --git a/includes/language.inc b/includes/language.inc index 3f3c31f..5f3400f 100644 --- a/includes/language.inc +++ b/includes/language.inc @@ -1,5 +1,5 @@ language; } -/** - * Rewrite URLs allowing modules to hook in. - * - * @param $path - * The path to rewrite. - * @param $options - * An associative array of additional options as in url(). - */ -function language_url_rewrite(&$path, &$options) { - // Only modify relative (insite) URLs. - if (!$options['external']) { - static $callbacks; - - if (!isset($callbacks)) { - $callbacks = array(); - - foreach (language_types_configurable() as $type) { - // Get url rewriter callbacks only from enabled language providers. - $negotiation = variable_get("language_negotiation_$type", array()); - - foreach ($negotiation as $id => $provider) { - if (isset($provider['file'])) { - require_once DRUPAL_ROOT . '/' . $provider['file']; - } - - // Avoid duplicate callback entries. - if (isset($provider['callbacks']['url_rewrite'])) { - $callbacks[$provider['callbacks']['url_rewrite']] = NULL; - } - } - } - - $callbacks = array_keys($callbacks); - } - - foreach ($callbacks as $callback) { - $callback($path, $options); - } - } -} - /** * Split the given path into prefix and actual path. * diff --git a/includes/path.inc b/includes/path.inc index 0b24b77..90dc3c3 100644 --- a/includes/path.inc +++ b/includes/path.inc @@ -1,13 +1,13 @@ 1) { - foreach ($info['arguments'] as $name => $default) { + if (isset($info['variables'])) { + foreach (array_keys($info['variables']) as $name) { if (isset($element["#$name"])) { $variables[$name] = $element["#$name"]; } } } + else { + $variables[$info['render element']] = $element; + } } // Merge in argument defaults. - if (!empty($info['arguments'])) { - $variables += $info['arguments']; + if (!empty($info['variables'])) { + $variables += $info['variables']; + } + elseif (!empty($info['render element'])) { + $variables += array($info['render element'] => array()); } // Invoke the variable processors, if any. The processors may specify @@ -968,8 +974,7 @@ function path_to_theme() { } /** - * Find overridden theme functions. Called by themes and/or theme engines to - * easily discover theme functions. + * Allow themes and/or theme engines to easily discover overridden theme functions. * * @param $cache * The existing cache of theme hooks to test against. @@ -990,9 +995,10 @@ function drupal_find_theme_functions($cache, $prefixes) { if ($matches) { foreach ($matches as $match) { $new_hook = str_replace($prefix . '_', '', $match); + $arg_name = isset($info['variables']) ? 'variables' : 'render element'; $templates[$new_hook] = array( 'function' => $match, - 'arguments' => $info['arguments'], + $arg_name => $info[$arg_name], ); } } @@ -1015,8 +1021,7 @@ function drupal_find_theme_functions($cache, $prefixes) { } /** - * Find overridden theme templates. Called by themes and/or theme engines to - * easily discover templates. + * Allow themes and/or theme engines to easily discover overridden templates. * * @param $cache * The existing cache of theme hooks to test against. @@ -1093,10 +1098,11 @@ function drupal_find_theme_templates($cache, $extension, $path) { foreach ($matches as $match) { $file = substr($match, 0, strpos($match, '.')); // Put the underscores back in for the hook name and register this pattern. + $arg_name = isset($info['variables']) ? 'variables' : 'render element'; $templates[strtr($file, '-', '_')] = array( 'template' => $file, 'path' => dirname($files[$match]->uri), - 'arguments' => $info['arguments'], + $arg_name => $info[$arg_name], ); } } diff --git a/includes/update.inc b/includes/update.inc index 84078c8..be951cc 100644 --- a/includes/update.inc +++ b/includes/update.inc @@ -1,5 +1,5 @@ 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')); + db_add_field('url_alias', 'alias', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')); + + // Add new columns to {menu_router}. + db_add_field('menu_router', 'delivery_callback', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')); + db_add_field('menu_router', 'context', array( + 'description' => 'Only for local tasks (tabs) - the context of a local task to control its placement.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + )); + db_add_field('menu_router', 'theme_callback', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')); + db_add_field('menu_router', 'theme_arguments', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')); + + // Add the role_permisson table. + $schema['role_permission'] = array( + 'fields' => array( + 'rid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + 'permission' => array( + 'type' => 'varchar', + 'length' => 64, + 'not null' => TRUE, + 'default' => '', + ), + ), + 'primary key' => array('rid', 'permission'), + 'indexes' => array( + 'permission' => array('permission'), + ), + ); + db_create_table('role_permission', $schema['role_permission']); + + // Add the {semaphore} table in case menu_rebuild() gets called during + // an update. + $schema['semaphore'] = array( + 'description' => 'Table for holding semaphores, locks, flags, etc. that cannot be stored as Drupal variables since they must not be cached.', + 'fields' => array( + 'name' => array( + 'description' => 'Primary Key: Unique name.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '' + ), + 'value' => array( + 'description' => 'A value for the semaphore.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '' + ), + 'expire' => array( + 'description' => 'A Unix timestamp with microseconds indicating when the semaphore should expire.', + 'type' => 'float', + 'size' => 'big', + 'not null' => TRUE + ), + ), + 'indexes' => array('value' => array('value')), + 'primary key' => array('name'), + ); + db_create_table('semaphore', $schema['semaphore']); + + $schema['date_format_type'] = array( + 'description' => 'Stores configured date format types.', + 'fields' => array( + 'type' => array( + 'description' => 'The date format type, e.g. medium.', + 'type' => 'varchar', + 'length' => 64, + 'not null' => TRUE, + ), + 'title' => array( + 'description' => 'The human readable name of the format type.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + ), + 'locked' => array( + 'description' => 'Whether or not this is a system provided format.', + 'type' => 'int', + 'size' => 'tiny', + 'default' => 0, + 'not null' => TRUE, + ), + ), + 'primary key' => array('type'), + ); + + $schema['date_formats'] = array( + 'description' => 'Stores configured date formats.', + 'fields' => array( + 'dfid' => array( + 'description' => 'The date format identifier.', + 'type' => 'serial', + 'not null' => TRUE, + 'unsigned' => TRUE, + ), + 'format' => array( + 'description' => 'The date format string.', + 'type' => 'varchar', + 'length' => 100, + 'not null' => TRUE, + ), + 'type' => array( + 'description' => 'The date format type, e.g. medium.', + 'type' => 'varchar', + 'length' => 64, + 'not null' => TRUE, + ), + 'locked' => array( + 'description' => 'Whether or not this format can be modified.', + 'type' => 'int', + 'size' => 'tiny', + 'default' => 0, + 'not null' => TRUE, + ), + ), + 'primary key' => array('dfid'), + 'unique keys' => array('formats' => array('format', 'type')), + ); + + $schema['date_format_locale'] = array( + 'description' => 'Stores configured date formats for each locale.', + 'fields' => array( + 'format' => array( + 'description' => 'The date format string.', + 'type' => 'varchar', + 'length' => 100, + 'not null' => TRUE, + ), + 'type' => array( + 'description' => 'The date format type, e.g. medium.', + 'type' => 'varchar', + 'length' => 64, + 'not null' => TRUE, + ), + 'language' => array( + 'description' => 'A {languages}.language for this format to be used with.', + 'type' => 'varchar', + 'length' => 12, + 'not null' => TRUE, + ), + ), + 'primary key' => array('type', 'language'), + ); + + db_create_table('date_format_type', $schema['date_format_type']); + db_create_table('date_formats', $schema['date_formats']); + db_create_table('date_format_locale', $schema['date_format_locale']); // Add column for locale context. if (db_table_exists('locales_source')) { diff --git a/index.php b/index.php index 0caeaec..c7d323b 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,5 @@ array( - 'arguments' => array('content' => NULL), + 'variables' => array('content' => NULL), 'file' => 'aggregator.pages.inc', 'template' => 'aggregator-wrapper', ), 'aggregator_categorize_items' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'aggregator.pages.inc', ), 'aggregator_feed_source' => array( - 'arguments' => array('feed' => NULL), + 'variables' => array('feed' => NULL), 'file' => 'aggregator.pages.inc', 'template' => 'aggregator-feed-source', ), 'aggregator_block_item' => array( - 'arguments' => array('item' => NULL, 'feed' => 0), + 'variables' => array('item' => NULL, 'feed' => 0), ), 'aggregator_summary_items' => array( - 'arguments' => array('summary_items' => NULL, 'source' => NULL), + 'variables' => array('summary_items' => NULL, 'source' => NULL), 'file' => 'aggregator.pages.inc', 'template' => 'aggregator-summary-items', ), 'aggregator_summary_item' => array( - 'arguments' => array('item' => NULL), + 'variables' => array('item' => NULL), 'file' => 'aggregator.pages.inc', 'template' => 'aggregator-summary-item', ), 'aggregator_item' => array( - 'arguments' => array('item' => NULL), + 'variables' => array('item' => NULL), 'file' => 'aggregator.pages.inc', 'template' => 'aggregator-item', ), 'aggregator_page_opml' => array( - 'arguments' => array('feeds' => NULL), + 'variables' => array('feeds' => NULL), 'file' => 'aggregator.pages.inc', ), 'aggregator_page_rss' => array( - 'arguments' => array('feeds' => NULL, 'category' => NULL), + 'variables' => array('feeds' => NULL, 'category' => NULL), 'file' => 'aggregator.pages.inc', ), ); diff --git a/modules/block/CVS/Entries b/modules/block/CVS/Entries index 3595dfa..860ae19 100644 --- a/modules/block/CVS/Entries +++ b/modules/block/CVS/Entries @@ -5,7 +5,7 @@ /block.info/1.14/Thu Oct 22 14:22:21 2009// /block.install/1.34/Thu Oct 22 14:25:07 2009// /block.js/1.11/Thu Oct 22 14:22:21 2009// -/block.module/1.393/Thu Oct 22 14:25:07 2009// /block.test/1.30/Thu Oct 22 14:25:07 2009// /block.tpl.php/1.6/Thu Oct 22 14:25:07 2009// +/block.module/1.394/Tue Oct 27 02:57:01 2009// D diff --git a/modules/block/block.module b/modules/block/block.module index 2de6062..ed43fab 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -1,5 +1,5 @@ array( - 'arguments' => array('elements' => NULL), + 'render element' => 'elements', 'template' => 'block', ), 'block_admin_display_form' => array( 'template' => 'block-admin-display-form', 'file' => 'block.admin.inc', - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), ); } diff --git a/modules/book/CVS/Entries b/modules/book/CVS/Entries index be8a446..9e8f2c2 100644 --- a/modules/book/CVS/Entries +++ b/modules/book/CVS/Entries @@ -8,7 +8,7 @@ /book.info/1.12/Thu Oct 22 14:22:21 2009// /book.install/1.33/Thu Oct 22 14:22:21 2009// /book.js/1.6/Thu Oct 22 14:22:21 2009// -/book.module/1.519/Thu Oct 22 14:25:07 2009// /book.pages.inc/1.19/Thu Oct 22 14:25:07 2009// /book.test/1.18/Thu Oct 22 14:25:07 2009// +/book.module/1.520/Tue Oct 27 02:57:01 2009// D diff --git a/modules/book/book.module b/modules/book/book.module index 7834743..b4ad252 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -1,5 +1,5 @@ array( - 'arguments' => array('book_link' => NULL), + 'variables' => array('book_link' => NULL), 'template' => 'book-navigation', ), 'book_export_html' => array( - 'arguments' => array('title' => NULL, 'contents' => NULL, 'depth' => NULL), + 'variables' => array('title' => NULL, 'contents' => NULL, 'depth' => NULL), 'template' => 'book-export-html', ), 'book_admin_table' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), 'book_title_link' => array( - 'arguments' => array('link' => NULL), + 'variables' => array('link' => NULL), ), 'book_all_books_block' => array( - 'arguments' => array('book_menus' => array()), + 'render element' => 'book_menus', 'template' => 'book-all-books-block', ), 'book_node_export_html' => array( - 'arguments' => array('node' => NULL, 'children' => NULL), + 'variables' => array('node' => NULL, 'children' => NULL), 'template' => 'book-node-export-html', ), ); diff --git a/modules/color/CVS/Entries b/modules/color/CVS/Entries index 871b35b..51381f8 100644 --- a/modules/color/CVS/Entries +++ b/modules/color/CVS/Entries @@ -4,5 +4,5 @@ D/images//// /color.info/1.10/Thu Oct 22 14:22:21 2009// /color.install/1.5/Thu Oct 22 14:22:21 2009// /color.js/1.15/Thu Oct 22 14:22:21 2009// -/color.module/1.73/Thu Oct 22 14:22:21 2009// /color.test/1.1/Thu Oct 22 14:22:21 2009// +/color.module/1.74/Tue Oct 27 02:57:01 2009// diff --git a/modules/color/color.module b/modules/color/color.module index 5876880..d403e43 100644 --- a/modules/color/color.module +++ b/modules/color/color.module @@ -1,5 +1,5 @@ array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), ); } diff --git a/modules/comment/CVS/Entries b/modules/comment/CVS/Entries index 3f4e449..129c8cd 100644 --- a/modules/comment/CVS/Entries +++ b/modules/comment/CVS/Entries @@ -6,9 +6,9 @@ /comment.css/1.5/Thu Oct 22 14:22:21 2009// /comment.info/1.11/Thu Oct 22 14:22:21 2009// /comment.install/1.51/Thu Oct 22 14:25:07 2009// -/comment.module/1.795/Thu Oct 22 14:25:07 2009// /comment.pages.inc/1.27/Thu Oct 22 14:25:07 2009// /comment.test/1.52/Thu Oct 22 14:25:07 2009// /comment.tokens.inc/1.6/Thu Oct 22 14:25:07 2009// /comment.tpl.php/1.16/Thu Oct 22 14:25:07 2009// +/comment.module/1.796/Tue Oct 27 02:57:01 2009// D diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 5f62879..a3357a5 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1,5 +1,5 @@ array( - 'arguments' => array(), + 'variables' => array(), ), 'comment_preview' => array( - 'arguments' => array('comment' => NULL), + 'variables' => array('comment' => NULL), ), 'comment' => array( 'template' => 'comment', - 'arguments' => array('elements' => NULL), + 'render element' => 'elements', ), 'comment_post_forbidden' => array( - 'arguments' => array('node' => NULL), + 'variables' => array('node' => NULL), ), 'comment_wrapper' => array( 'template' => 'comment-wrapper', - 'arguments' => array('content' => NULL), + 'render element' => 'content', ), ); } diff --git a/modules/dashboard/CVS/Entries b/modules/dashboard/CVS/Entries index 2ca347c..a2d7725 100644 --- a/modules/dashboard/CVS/Entries +++ b/modules/dashboard/CVS/Entries @@ -2,5 +2,5 @@ /dashboard.css/1.2/Thu Oct 22 14:25:07 2009// /dashboard.info/1.1/Thu Oct 22 14:22:21 2009// /dashboard.js/1.2/Thu Oct 22 14:25:07 2009// -/dashboard.module/1.3/Thu Oct 22 14:25:07 2009// +/dashboard.module/1.4/Tue Oct 27 02:57:01 2009// D diff --git a/modules/dashboard/dashboard.module b/modules/dashboard/dashboard.module index 8277edb..fef79e0 100644 --- a/modules/dashboard/dashboard.module +++ b/modules/dashboard/dashboard.module @@ -1,5 +1,5 @@ array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'dashboard_admin' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'dashboard_region' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'dashboard_disabled_blocks' => array( - 'arguments' => array('blocks' => NULL), + 'variables' => array('blocks' => NULL), ), 'dashboard_disabled_block' => array( - 'arguments' => array('block' => NULL), + 'variables' => array('block' => NULL), ), ); } diff --git a/modules/dblog/CVS/Entries b/modules/dblog/CVS/Entries index eb1805c..f1d8dcd 100644 --- a/modules/dblog/CVS/Entries +++ b/modules/dblog/CVS/Entries @@ -3,6 +3,6 @@ /dblog.css/1.7/Thu Oct 22 14:22:21 2009// /dblog.info/1.7/Thu Oct 22 14:22:21 2009// /dblog.install/1.19/Thu Oct 22 14:25:07 2009// -/dblog.module/1.43/Thu Oct 22 14:22:21 2009// /dblog.test/1.29/Thu Oct 22 14:22:21 2009// +/dblog.module/1.44/Tue Oct 27 02:57:01 2009// D diff --git a/modules/dblog/dblog.module b/modules/dblog/dblog.module index c4d08e4..2f8f30c 100644 --- a/modules/dblog/dblog.module +++ b/modules/dblog/dblog.module @@ -1,5 +1,5 @@ array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), ); } diff --git a/modules/field/CVS/Entries b/modules/field/CVS/Entries index 031eb6b..1f348b6 100644 --- a/modules/field/CVS/Entries +++ b/modules/field/CVS/Entries @@ -1,13 +1,13 @@ D/modules//// D/theme//// -/field.api.php/1.45/Thu Oct 22 14:25:07 2009// /field.attach.inc/1.55/Thu Oct 22 14:25:07 2009// /field.crud.inc/1.40/Thu Oct 22 14:25:07 2009// /field.default.inc/1.21/Thu Oct 22 14:25:07 2009// /field.form.inc/1.29/Thu Oct 22 14:25:07 2009// /field.info/1.5/Thu Oct 22 14:22:21 2009// -/field.info.inc/1.24/Thu Oct 22 14:25:07 2009// /field.install/1.16/Thu Oct 22 14:25:07 2009// -/field.module/1.43/Thu Oct 22 14:25:07 2009// /field.multilingual.inc/1.3/Thu Oct 22 14:25:07 2009// /field.test/1.64/Thu Oct 22 14:25:07 2009// +/field.api.php/1.46/Tue Oct 27 02:57:01 2009// +/field.info.inc/1.25/Tue Oct 27 02:57:01 2009// +/field.module/1.45/Tue Oct 27 02:57:01 2009// diff --git a/modules/field/field.api.php b/modules/field/field.api.php index bc108b8..d519c4c 100644 --- a/modules/field/field.api.php +++ b/modules/field/field.api.php @@ -1,5 +1,5 @@ array( - * 'arguments' => array('element' => NULL), + * 'render_element' => 'element', * ) * @code * diff --git a/modules/field/field.info.inc b/modules/field/field.info.inc index 0b37ea1..272979f 100644 --- a/modules/field/field.info.inc +++ b/modules/field/field.info.inc @@ -1,5 +1,5 @@ $bundle_info) { - $info['instances'][$bundle] = array(); + foreach (field_info_bundles() as $obj_type => $bundles) { + foreach ($bundles as $bundle => $bundle_info) { + $info['instances'][$obj_type][$bundle] = array(); + } } foreach ($definitions['instances'] as $instance) { $field = $info['fields'][$instance['field_name']]; diff --git a/modules/field/field.module b/modules/field/field.module index cf3227d..105e475 100644 --- a/modules/field/field.module +++ b/modules/field/field.module @@ -1,5 +1,5 @@ array( 'template' => 'field', - 'arguments' => array('element' => NULL), + 'render element' => 'element', 'path' => $path, ), 'field_multiple_value_form' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), ); $field_formatters = field_info_formatter_types(NULL); foreach ($field_formatters as $key => $field_formatter) { $items['field_formatter_' . $key] = array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ); if (isset($field_formatter['theme'])) { $items['field_formatter_' . $key] += $field_formatter['theme']; @@ -478,7 +478,7 @@ function _field_filter_xss_display_allowed_tags() { * * Used to display a field's values outside the context of the $node, as * when fields are displayed in Views, or to display a field in a template - * using a different formatter than the one set up on the Display Fields tab + * using a different formatter than the one set up on the 'Manage display' tab * for the node's context. * * @param $field diff --git a/modules/field/modules/number/CVS/Entries b/modules/field/modules/number/CVS/Entries index 42d46fc..c34fbb7 100644 --- a/modules/field/modules/number/CVS/Entries +++ b/modules/field/modules/number/CVS/Entries @@ -1,3 +1,3 @@ /number.info/1.4/Thu Oct 22 14:22:21 2009// -/number.module/1.22/Thu Oct 22 14:25:07 2009// +/number.module/1.23/Tue Oct 27 02:57:01 2009// D diff --git a/modules/field/modules/number/number.module b/modules/field/modules/number/number.module index 1dba84e..964e7a7 100644 --- a/modules/field/modules/number/number.module +++ b/modules/field/modules/number/number.module @@ -1,5 +1,5 @@ array('arguments' => array('element' => NULL)), + 'number' => array('render element' => 'element'), ); } diff --git a/modules/field/modules/options/CVS/Entries b/modules/field/modules/options/CVS/Entries index 2bbe97c..d51b9d3 100644 --- a/modules/field/modules/options/CVS/Entries +++ b/modules/field/modules/options/CVS/Entries @@ -1,4 +1,4 @@ /options.info/1.4/Thu Oct 22 14:25:07 2009// -/options.module/1.13/Thu Oct 22 14:25:07 2009// /options.test/1.1/Sat Oct 17 01:20:01 2009// +/options.module/1.14/Tue Oct 27 02:57:01 2009// D diff --git a/modules/field/modules/options/options.module b/modules/field/modules/options/options.module index 9c51498..51991f8 100644 --- a/modules/field/modules/options/options.module +++ b/modules/field/modules/options/options.module @@ -1,5 +1,5 @@ array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'options_buttons' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'options_onoff' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'options_none' => array( - 'arguments' => array('instance' => NULL), + 'variables' => array('instance' => NULL), ), ); } diff --git a/modules/field/modules/text/CVS/Entries b/modules/field/modules/text/CVS/Entries index 5b0b04e..be4fc92 100644 --- a/modules/field/modules/text/CVS/Entries +++ b/modules/field/modules/text/CVS/Entries @@ -1,5 +1,5 @@ /text.info/1.5/Thu Oct 22 14:22:21 2009// /text.js/1.1/Thu Oct 22 14:22:21 2009// -/text.module/1.33/Thu Oct 22 14:25:07 2009// /text.test/1.14/Thu Oct 22 14:25:07 2009// +/text.module/1.34/Tue Oct 27 02:57:01 2009// D diff --git a/modules/field/modules/text/text.module b/modules/field/modules/text/text.module index 8013a71..40d0f11 100644 --- a/modules/field/modules/text/text.module +++ b/modules/field/modules/text/text.module @@ -1,5 +1,5 @@ array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'text_textfield' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), ); } diff --git a/modules/field_ui/CVS/Entries b/modules/field_ui/CVS/Entries index 4f1292f..cc59feb 100644 --- a/modules/field_ui/CVS/Entries +++ b/modules/field_ui/CVS/Entries @@ -1,10 +1,10 @@ /field_ui-display-overview-form.tpl.php/1.1/Thu Oct 22 14:22:22 2009// -/field_ui-field-overview-form.tpl.php/1.1/Thu Oct 22 14:22:22 2009// /field_ui-rtl.css/1.1/Thu Oct 22 14:22:22 2009// -/field_ui.admin.inc/1.23/Thu Oct 22 14:25:07 2009// /field_ui.api.php/1.3/Thu Oct 22 14:22:22 2009// /field_ui.css/1.1/Thu Oct 22 14:22:22 2009// /field_ui.info/1.1/Thu Oct 22 14:22:22 2009// /field_ui.js/1.1/Thu Oct 22 14:22:22 2009// -/field_ui.module/1.10/Thu Oct 22 14:25:07 2009// +/field_ui-field-overview-form.tpl.php/1.2/Tue Oct 27 02:57:01 2009// +/field_ui.admin.inc/1.24/Tue Oct 27 02:57:01 2009// +/field_ui.module/1.12/Tue Oct 27 02:57:01 2009// D diff --git a/modules/field_ui/field_ui-field-overview-form.tpl.php b/modules/field_ui/field_ui-field-overview-form.tpl.php index ec76199..d710731 100644 --- a/modules/field_ui/field_ui-field-overview-form.tpl.php +++ b/modules/field_ui/field_ui-field-overview-form.tpl.php @@ -1,5 +1,5 @@
 
weight . $row->hidden_name; ?> -
 
field_name; ?> +
 
field_name; ?>
 
type; ?> -
 
widget_type; ?> +
 
widget_type; ?> @@ -81,8 +81,8 @@
 
weight . $row->hidden_name; ?> -
 
field_name; ?> -
 
widget_type; ?> +
 
field_name; ?> +
 
widget_type; ?> diff --git a/modules/field_ui/field_ui.admin.inc b/modules/field_ui/field_ui.admin.inc index dac8822..6464f1d 100644 --- a/modules/field_ui/field_ui.admin.inc +++ b/modules/field_ui/field_ui.admin.inc @@ -1,5 +1,5 @@ $bundles) { - foreach ($bundles as $bundle => $info) { - foreach ($info as $field_name => $instance) { + foreach ($instances as $obj_type => $type_bundles) { + foreach ($type_bundles as $bundle => $bundle_instances) { + foreach ($bundle_instances as $field_name => $instance) { $field = field_info_field($field_name); $admin_path = _field_ui_bundle_admin_path($obj_type, $bundle); $rows[$field_name]['data'][0] = $field['locked'] ? t('@field_name (Locked)', array('@field_name' => $field_name)) : $field_name; $rows[$field_name]['data'][1] = t($field_types[$field['type']]['label']); - $rows[$field_name]['data'][2][] = l($bundles[$bundle]['label'], $admin_path . '/fields'); + $rows[$field_name]['data'][2][] = l($bundles[$obj_type][$bundle]['label'], $admin_path . '/fields'); $rows[$field_name]['class'] = $field['locked'] ? array('menu-disabled') : array(''); } } @@ -837,7 +837,7 @@ function field_ui_field_settings_form($form, &$form_state, $obj_type, $bundle, $ '#options' => array(TRUE => t('Translatable field'), FALSE => t('Language neutral field')), '#default_value' => $field['translatable'], '#description' => t("Translatable fields can have a different value for each available language. An example of a translatable field is an article's body. Language neutral fields will retain the same value across all translations. An example of a language neutral field is a user profile's first name."), - ); + ); // Add settings provided by the field module. The field module is // responsible for not returning settings that cannot be changed if @@ -898,7 +898,7 @@ function field_ui_widget_type_form($form, &$form_state, $obj_type, $bundle, $ins $field_type = field_info_field_types($field['type']); $widget_type = field_info_widget_types($instance['widget']['type']); $bundles = field_info_bundles(); - $bundle_label = $bundles[$bundle]['label']; + $bundle_label = $bundles[$obj_type][$bundle]['label']; $form['basic'] = array( '#type' => 'fieldset', diff --git a/modules/field_ui/field_ui.module b/modules/field_ui/field_ui.module index e87fda2..b2182d9 100644 --- a/modules/field_ui/field_ui.module +++ b/modules/field_ui/field_ui.module @@ -1,5 +1,5 @@ 'field_ui.admin.inc', ) + $access; - // 'Display fields' tab and context secondary tabs. + // 'Manage display' tab and context secondary tabs. $items["$path/display"] = array( - 'title' => 'Display fields', + 'title' => 'Manage display', 'page callback' => 'drupal_get_form', 'page arguments' => array('field_ui_display_overview_form', $obj_type, $bundle_arg), 'type' => MENU_LOCAL_TASK, @@ -154,12 +154,12 @@ function field_ui_menu_label($instance) { function field_ui_theme() { return array( 'field_ui_field_overview_form' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'field_ui.admin.inc', 'template' => 'field_ui-field-overview-form', ), 'field_ui_display_overview_form' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'field_ui.admin.inc', 'template' => 'field_ui-display-overview-form', ), @@ -167,7 +167,7 @@ function field_ui_theme() { } /** - * Group available build modes on tabs on the 'Display fields' page. + * Group available build modes on tabs on the 'Manage display' page. * * @todo Remove this completely and use vertical tabs? */ diff --git a/modules/file/CVS/Entries b/modules/file/CVS/Entries index 0e5aed2..eb7ddc4 100644 --- a/modules/file/CVS/Entries +++ b/modules/file/CVS/Entries @@ -5,4 +5,4 @@ D/icons//// /file.info/1.1/Thu Oct 22 14:22:22 2009// /file.install/1.1/Thu Oct 22 14:22:22 2009// /file.js/1.1/Thu Oct 22 14:22:22 2009// -/file.module/1.9/Thu Oct 22 14:25:07 2009// +/file.module/1.10/Tue Oct 27 02:57:01 2009// diff --git a/modules/file/file.module b/modules/file/file.module index 67cd6e4..15692ce 100644 --- a/modules/file/file.module +++ b/modules/file/file.module @@ -1,5 +1,5 @@ array( - 'arguments' => array('file' => NULL), + 'variables' => array('file' => NULL), ), 'file_icon' => array( - 'arguments' => array('file' => NULL), + 'variables' => array('file' => NULL), ), 'file_managed_file' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), // file.field.inc. 'file_widget' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'file_widget_multiple' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'file_upload_help' => array( - 'arguments' => array('description' => NULL, 'upload_validators' => NULL), + 'variables' => array('description' => NULL, 'upload_validators' => NULL), ), ); } diff --git a/modules/filter/CVS/Entries b/modules/filter/CVS/Entries index fcbb58b..b5caf7b 100644 --- a/modules/filter/CVS/Entries +++ b/modules/filter/CVS/Entries @@ -3,7 +3,7 @@ /filter.css/1.1/Thu Oct 22 14:22:22 2009// /filter.info/1.12/Thu Oct 22 14:22:22 2009// /filter.install/1.23/Thu Oct 22 14:25:07 2009// -/filter.module/1.298/Thu Oct 22 14:25:07 2009// /filter.pages.inc/1.9/Thu Oct 22 14:22:22 2009// /filter.test/1.46/Thu Oct 22 14:22:22 2009// +/filter.module/1.300/Tue Oct 27 02:57:01 2009// D diff --git a/modules/filter/filter.module b/modules/filter/filter.module index dd103ae..8cfd9ac 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -1,5 +1,5 @@ array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'filter.admin.inc', ), 'filter_admin_order' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'filter.admin.inc', ), 'filter_tips' => array( - 'arguments' => array('tips' => NULL, 'long' => FALSE), + 'variables' => array('tips' => NULL, 'long' => FALSE), 'file' => 'filter.pages.inc', ), 'filter_tips_more_info' => array( - 'arguments' => array(), + 'variables' => array(), ), 'filter_guidelines' => array( - 'arguments' => array('format' => NULL), + 'variables' => array('format' => NULL), ), ); } @@ -615,17 +615,21 @@ function check_markup($text, $format_id = NULL, $langcode = '', $cache = FALSE) } /** - * Generate a selector for choosing a format in a form. + * Generates a selector for choosing a format in a form. * - * @ingroup forms * @param $selected_format - * The ID of the format that is currently selected. + * The ID of the format that is currently selected; uses the default format + * for the current user if not provided. * @param $weight - * The weight of the text format. + * The weight of the form element within the form. * @param $parents - * Required when defining multiple text formats on a single node or having a different parent than 'format'. + * The parents array of the element. Required when defining multiple text + * formats on a single form or having a different parent than 'format'. + * * @return - * HTML for the form element. + * Form API array for the form element. + * + * @ingroup forms */ function filter_form($selected_format = NULL, $weight = NULL, $parents = array('format')) { global $user; diff --git a/modules/forum/CVS/Entries b/modules/forum/CVS/Entries index 4c5de05..d3df58f 100644 --- a/modules/forum/CVS/Entries +++ b/modules/forum/CVS/Entries @@ -7,8 +7,8 @@ /forum.css/1.7/Thu Oct 22 14:22:22 2009// /forum.info/1.12/Thu Oct 22 14:22:22 2009// /forum.install/1.38/Thu Oct 22 14:25:07 2009// -/forum.module/1.526/Thu Oct 22 14:25:07 2009// /forum.pages.inc/1.3/Thu Oct 22 14:22:23 2009// -/forum.test/1.35/Thu Oct 22 14:25:07 2009// /forums.tpl.php/1.6/Thu Oct 22 14:22:23 2009// +/forum.module/1.528/Tue Oct 27 02:57:01 2009// +/forum.test/1.36/Tue Oct 27 02:57:01 2009// D diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 50a724c..b72e94e 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -1,5 +1,5 @@ array( 'template' => 'forums', - 'arguments' => array('forums' => NULL, 'topics' => NULL, 'parents' => NULL, 'tid' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), + 'variables' => array('forums' => NULL, 'topics' => NULL, 'parents' => NULL, 'tid' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), ), 'forum_list' => array( 'template' => 'forum-list', - 'arguments' => array('forums' => NULL, 'parents' => NULL, 'tid' => NULL), + 'variables' => array('forums' => NULL, 'parents' => NULL, 'tid' => NULL), ), 'forum_topic_list' => array( 'template' => 'forum-topic-list', - 'arguments' => array('tid' => NULL, 'topics' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), + 'variables' => array('tid' => NULL, 'topics' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), ), 'forum_icon' => array( 'template' => 'forum-icon', - 'arguments' => array('new_posts' => NULL, 'num_posts' => 0, 'comment_mode' => 0, 'sticky' => 0), + 'variables' => array('new_posts' => NULL, 'num_posts' => 0, 'comment_mode' => 0, 'sticky' => 0), ), 'forum_submitted' => array( 'template' => 'forum-submitted', - 'arguments' => array('topic' => NULL), + 'variables' => array('topic' => NULL), ), 'forum_form' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'forum.admin.inc', ), ); @@ -115,12 +115,6 @@ function forum_menu() { 'parent' => 'admin/structure/forum', 'file' => 'forum.admin.inc', ); - $items['admin/structure/forum/edit/%taxonomy_term'] = array( - 'page callback' => 'forum_form_main', - 'access arguments' => array('administer forums'), - 'type' => MENU_CALLBACK, - 'file' => 'forum.admin.inc', - ); $items['admin/structure/forum/edit/container/%taxonomy_term'] = array( 'title' => 'Edit container', 'page callback' => 'forum_form_main', @@ -610,7 +604,7 @@ function forum_block_view_pre_render($elements) { */ function forum_form($node, $form_state) { $type = node_type_get_type($node); - + if (!empty($node->nid)) { $forum_terms = $node->taxonomy_forums; // If editing, give option to leave shadows @@ -626,10 +620,15 @@ function forum_form($node, $form_state) { } /** - * Implement hook_term_path(). + * Implement hook_url_outbound_alter(). */ -function forum_term_path($term) { - return 'forum/' . $term->tid; +function forum_url_outbound_alter(&$path, &$options, $original_path) { + if (preg_match('!^taxonomy/term/(\d+)!', $path, $matches)) { + $term = taxonomy_term_load($matches[1]); + if ($term && $term->vocabulary_machine_name == 'forums') { + $path = 'forum/' . $matches[1]; + } + } } /** diff --git a/modules/forum/forum.test b/modules/forum/forum.test index dee26df..007b63a 100644 --- a/modules/forum/forum.test +++ b/modules/forum/forum.test @@ -1,5 +1,5 @@ drupalPost('admin/structure/forum/edit/forum/' . $tid, array(), t('Delete')); - $this->drupalPost(NULL, NULL, t('Delete')); + $this->drupalPost(NULL, array(), t('Delete')); // Assert that the forum no longer exists. $this->drupalGet('forum/' . $tid); diff --git a/modules/image/CVS/Entries b/modules/image/CVS/Entries index edcfa78..847f5ba 100644 --- a/modules/image/CVS/Entries +++ b/modules/image/CVS/Entries @@ -7,7 +7,7 @@ /image.field.inc/1.2/Thu Oct 22 14:25:08 2009// /image.info/1.3/Thu Oct 22 14:22:23 2009// /image.install/1.3/Thu Oct 22 14:22:23 2009// -/image.module/1.23/Thu Oct 22 14:25:08 2009// /image.test/1.11/Thu Oct 22 14:25:08 2009// /sample.png/1.1/Thu Oct 22 14:22:23 2009/-kb/ +/image.module/1.24/Tue Oct 27 02:57:01 2009// D diff --git a/modules/image/image.module b/modules/image/image.module index ac0974b..7e27926 100644 --- a/modules/image/image.module +++ b/modules/image/image.module @@ -1,5 +1,5 @@ array( - 'arguments' => array( + 'variables' => array( 'style_name' => NULL, 'path' => NULL, 'alt' => '', @@ -182,42 +182,42 @@ function image_theme() { // Theme functions in image.admin.inc. 'image_style_list' => array( - 'arguments' => array('styles' => NULL), + 'variables' => array('styles' => NULL), ), 'image_style_effects' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), 'image_style_preview' => array( - 'arguments' => array('style' => NULL), + 'variables' => array('style' => NULL), ), 'image_anchor' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'image_resize_summary' => array( - 'arguments' => array('data' => NULL), + 'variables' => array('data' => NULL), ), 'image_scale_summary' => array( - 'arguments' => array('data' => NULL), + 'variables' => array('data' => NULL), ), 'image_crop_summary' => array( - 'arguments' => array('data' => NULL), + 'variables' => array('data' => NULL), ), 'image_rotate_summary' => array( - 'arguments' => array('data' => NULL), + 'variables' => array('data' => NULL), ), // Theme functions in image.field.inc. 'image_widget' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'field_formatter_image' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'field_formatter_image_link_content' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'field_formatter_image_link_file' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), ); } diff --git a/modules/locale/CVS/Entries b/modules/locale/CVS/Entries index 2450bde..990400d 100644 --- a/modules/locale/CVS/Entries +++ b/modules/locale/CVS/Entries @@ -4,5 +4,5 @@ D/tests//// /locale.field.inc/1.1/Fri Oct 16 02:04:42 2009// /locale.info/1.12/Thu Oct 22 14:25:08 2009// /locale.install/1.52/Thu Oct 22 14:25:08 2009// -/locale.module/1.265/Thu Oct 22 14:25:08 2009// /locale.test/1.48/Thu Oct 22 14:25:08 2009// +/locale.module/1.267/Tue Oct 27 02:57:01 2009// diff --git a/modules/locale/locale.module b/modules/locale/locale.module index e61e937..bd3cd06 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -1,5 +1,5 @@ array( - 'arguments' => array('form' => array()), + 'render element' => 'form', ), 'locale_languages_configure_form' => array( - 'arguments' => array('form' => array()), + 'render element' => 'form', ), 'locale_translation_filters' => array( - 'arguments' => array('form' => array()), + 'render element' => 'form', ), 'locale_date_format_form' => array( - 'arguments' => array('form' => array()), + 'render element' => 'form', ), ); } @@ -1067,3 +1067,41 @@ function locale_date_format_reset_form_submit($form, &$form_state) { $form_state['redirect'] = 'admin/config/regional/date-time/locale'; } +/** + * Implement hook_url_outbound_alter(). + * + * Rewrite outbound URLs with language based prefixes. + */ +function locale_url_outbound_alter(&$path, &$options, $original_path) { + // Only modify internal URLs. + if (!$options['external']) { + static $callbacks; + + if (!isset($callbacks)) { + $callbacks = array(); + include_once DRUPAL_ROOT . '/includes/language.inc'; + + foreach (language_types_configurable() as $type) { + // Get url rewriter callbacks only from enabled language providers. + $negotiation = variable_get("language_negotiation_$type", array()); + + foreach ($negotiation as $id => $provider) { + if (isset($provider['file'])) { + require_once DRUPAL_ROOT . '/' . $provider['file']; + } + + // Avoid duplicate callback entries. + if (isset($provider['callbacks']['url_rewrite'])) { + $callbacks[$provider['callbacks']['url_rewrite']] = NULL; + } + } + } + + $callbacks = array_keys($callbacks); + } + + foreach ($callbacks as $callback) { + $callback($path, $options); + } + } +} diff --git a/modules/menu/CVS/Entries b/modules/menu/CVS/Entries index 0bd9008..b8b44ec 100644 --- a/modules/menu/CVS/Entries +++ b/modules/menu/CVS/Entries @@ -5,6 +5,6 @@ /menu.info/1.9/Thu Oct 22 14:22:23 2009// /menu.install/1.23/Thu Oct 22 14:25:08 2009// /menu.js/1.3/Thu Oct 22 14:22:23 2009// -/menu.module/1.212/Thu Oct 22 14:25:08 2009// /menu.test/1.24/Thu Oct 22 14:22:23 2009// +/menu.module/1.213/Tue Oct 27 02:57:01 2009// D diff --git a/modules/menu/menu.module b/modules/menu/menu.module index c639e09..d834449 100644 --- a/modules/menu/menu.module +++ b/modules/menu/menu.module @@ -1,5 +1,5 @@ array( 'file' => 'menu.admin.inc', - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), 'menu_admin_overview' => array( 'file' => 'menu.admin.inc', - 'arguments' => array('title' => NULL, 'name' => NULL, 'description' => NULL), + 'variables' => array('title' => NULL, 'name' => NULL, 'description' => NULL), ), ); } diff --git a/modules/node/CVS/Entries b/modules/node/CVS/Entries index e2b5af9..cfa1ea1 100644 --- a/modules/node/CVS/Entries +++ b/modules/node/CVS/Entries @@ -2,14 +2,14 @@ D/tests//// /content_types.inc/1.98/Thu Oct 22 14:25:08 2009// /content_types.js/1.7/Thu Oct 22 14:22:23 2009// /node-rtl.css/1.3/Thu Oct 22 14:22:23 2009// -/node.admin.inc/1.72/Thu Oct 22 14:25:08 2009// -/node.api.php/1.40/Thu Oct 22 14:25:08 2009// /node.css/1.8/Thu Oct 22 14:22:23 2009// /node.info/1.12/Thu Oct 22 14:22:23 2009// /node.install/1.34/Thu Oct 22 14:25:08 2009// /node.js/1.4/Thu Oct 22 14:22:23 2009// -/node.module/1.1153/Thu Oct 22 14:25:08 2009// /node.pages.inc/1.93/Thu Oct 22 14:25:08 2009// -/node.test/1.49/Thu Oct 22 14:25:08 2009// /node.tokens.inc/1.5/Thu Oct 22 14:25:08 2009// /node.tpl.php/1.28/Thu Oct 22 14:25:08 2009// +/node.admin.inc/1.73/Tue Oct 27 02:57:01 2009// +/node.api.php/1.41/Tue Oct 27 02:57:01 2009// +/node.module/1.1154/Tue Oct 27 02:57:01 2009// +/node.test/1.50/Tue Oct 27 02:57:01 2009// diff --git a/modules/node/node.admin.inc b/modules/node/node.admin.inc index 6beeb35..8d9053d 100644 --- a/modules/node/node.admin.inc +++ b/modules/node/node.admin.inc @@ -1,5 +1,5 @@ 'submit', '#value' => t('Update'), '#submit' => array('node_admin_nodes_submit'), + '#validate' => array('node_admin_nodes_validate'), ); $languages = language_list(); @@ -475,8 +476,8 @@ function node_admin_nodes() { * 'Update option' on. */ function node_admin_nodes_validate($form, &$form_state) { - $nodes = array_filter($form_state['values']['nodes']); - if (count($nodes) == 0) { + // Error if there are no items to select. + if (!is_array($form_state['values']['nodes']) || !count(array_filter($form_state['values']['nodes']))) { form_set_error('', t('No items selected.')); } } diff --git a/modules/node/node.api.php b/modules/node/node.api.php index c27c3b7..630092f 100644 --- a/modules/node/node.api.php +++ b/modules/node/node.api.php @@ -1,5 +1,5 @@ array( - 'arguments' => array('elements' => NULL), + 'render element' => 'elements', 'template' => 'node', ), 'node_list' => array( - 'arguments' => array('items' => NULL, 'title' => NULL), + 'variables' => array('items' => NULL, 'title' => NULL), ), 'node_search_admin' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), 'node_filter_form' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'node.admin.inc', ), 'node_filters' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'node.admin.inc', ), 'node_add_list' => array( - 'arguments' => array('content' => NULL), + 'variables' => array('content' => NULL), 'file' => 'node.pages.inc', ), 'node_form' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'node.pages.inc', ), 'node_preview' => array( - 'arguments' => array('node' => NULL), + 'variables' => array('node' => NULL), 'file' => 'node.pages.inc', ), 'node_log_message' => array( - 'arguments' => array('log' => NULL), + 'variables' => array('log' => NULL), ), 'node_admin_overview' => array( - 'arguments' => array('name' => NULL, 'type' => NULL), + 'variables' => array('name' => NULL, 'type' => NULL), ), ); } diff --git a/modules/node/node.test b/modules/node/node.test index 7b2c29c..0f67f6c 100644 --- a/modules/node/node.test +++ b/modules/node/node.test @@ -1,5 +1,5 @@ drupalPost('admin/content', array(), t('Update')); + $this->assertText(t('No items selected.'), t('Clicking update with no nodes displays error message on the node administration listing.')); + $node1 = $this->drupalCreateNode(array('type' => 'article', 'status' => 1)); $node2 = $this->drupalCreateNode(array('type' => 'article', 'status' => 0)); $node3 = $this->drupalCreateNode(array('type' => 'page')); @@ -974,6 +977,9 @@ class NodeAdminTestCase extends DrupalWebTestCase { $this->drupalGet('admin/content'); $this->assertText($node1->title[FIELD_LANGUAGE_NONE][0]['value'], t('Node appears on the node administration listing.')); + $this->drupalPost('admin/content', array(), t('Update')); + $this->assertText(t('No items selected.'), t('Clicking update with no selected nodes displays error message on the node administration listing.')); + // Filter the node listing by status. $edit = array( 'filter' => 'status', diff --git a/modules/path/CVS/Entries b/modules/path/CVS/Entries index d48b2c2..6a0750c 100644 --- a/modules/path/CVS/Entries +++ b/modules/path/CVS/Entries @@ -1,7 +1,7 @@ -/path.admin.inc/1.35/Thu Oct 22 14:25:08 2009// /path.api.php/1.1/Sat Oct 17 00:52:36 2009// /path.info/1.8/Thu Oct 22 14:22:24 2009// /path.js/1.3/Thu Oct 22 14:25:08 2009// /path.module/1.173/Thu Oct 22 14:25:08 2009// /path.test/1.25/Thu Oct 22 14:25:08 2009// +/path.admin.inc/1.36/Tue Oct 27 02:57:01 2009// D diff --git a/modules/path/path.admin.inc b/modules/path/path.admin.inc index 134b6f1..e627436 100644 --- a/modules/path/path.admin.inc +++ b/modules/path/path.admin.inc @@ -1,5 +1,5 @@ '', 'ali '#default_value' => $path['source'], '#maxlength' => 255, '#size' => 45, - '#description' => t('Specify the existing path you wish to alias. For example: node/28, forum/1, taxonomy/term/1+2.'), + '#description' => t('Specify the existing path you wish to alias. For example: node/28, forum/1, taxonomy/term/1.'), '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q='), '#required' => TRUE, ); @@ -150,7 +150,8 @@ function path_admin_form($form, &$form_state, $path = array('source' => '', 'ali * Verify that a URL alias is valid */ function path_admin_form_validate($form, &$form_state) { - $source = $form_state['values']['source']; + $source = &$form_state['values']['source']; + $source = drupal_get_normal_path($source); $alias = $form_state['values']['alias']; $pid = isset($form_state['values']['pid']) ? $form_state['values']['pid'] : 0; // Language is only set if locale module is enabled, otherwise save for all languages. diff --git a/modules/poll/CVS/Entries b/modules/poll/CVS/Entries index 472b23e..e18b5bc 100644 --- a/modules/poll/CVS/Entries +++ b/modules/poll/CVS/Entries @@ -7,8 +7,8 @@ /poll.css/1.7/Thu Oct 22 14:22:24 2009// /poll.info/1.10/Thu Oct 22 14:22:24 2009// /poll.install/1.27/Thu Oct 22 14:25:08 2009// -/poll.module/1.320/Thu Oct 22 14:25:08 2009// /poll.pages.inc/1.23/Thu Oct 22 14:25:08 2009// /poll.test/1.25/Thu Oct 22 14:25:08 2009// /poll.tokens.inc/1.2/Thu Oct 22 14:25:08 2009// +/poll.module/1.321/Tue Oct 27 02:57:01 2009// D diff --git a/modules/poll/poll.module b/modules/poll/poll.module index 7f6cfd6..df5756c 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -1,5 +1,5 @@ array( 'template' => 'poll-vote', - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), 'poll_choices' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), 'poll_results' => array( 'template' => 'poll-results', - 'arguments' => array('raw_title' => NULL, 'results' => NULL, 'votes' => NULL, 'raw_links' => NULL, 'block' => NULL, 'nid' => NULL, 'vote' => NULL), + 'variables' => array('raw_title' => NULL, 'results' => NULL, 'votes' => NULL, 'raw_links' => NULL, 'block' => NULL, 'nid' => NULL, 'vote' => NULL), ), 'poll_bar' => array( 'template' => 'poll-bar', - 'arguments' => array('title' => NULL, 'votes' => NULL, 'total_votes' => NULL, 'vote' => NULL, 'block' => NULL), + 'variables' => array('title' => NULL, 'votes' => NULL, 'total_votes' => NULL, 'vote' => NULL, 'block' => NULL), ), ); } diff --git a/modules/profile/CVS/Entries b/modules/profile/CVS/Entries index 73d56ff..4133b74 100644 --- a/modules/profile/CVS/Entries +++ b/modules/profile/CVS/Entries @@ -6,7 +6,7 @@ /profile.info/1.9/Thu Oct 22 14:22:24 2009// /profile.install/1.22/Thu Oct 22 14:22:24 2009// /profile.js/1.7/Thu Oct 22 14:22:24 2009// -/profile.module/1.279/Thu Oct 22 14:22:24 2009// /profile.pages.inc/1.21/Thu Oct 22 14:22:24 2009// /profile.test/1.22/Thu Oct 22 14:25:08 2009// +/profile.module/1.280/Tue Oct 27 02:57:01 2009// D diff --git a/modules/profile/profile.module b/modules/profile/profile.module index 6cadb50..3efa41e 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -1,5 +1,5 @@ array( - 'arguments' => array('account' => NULL, 'fields' => array()), + 'variables' => array('account' => NULL, 'fields' => array()), 'template' => 'profile-block', ), 'profile_listing' => array( - 'arguments' => array('account' => NULL, 'fields' => array()), + 'variables' => array('account' => NULL, 'fields' => array()), 'template' => 'profile-listing', ), 'profile_wrapper' => array( - 'arguments' => array('content' => NULL), + 'variables' => array('content' => NULL), 'template' => 'profile-wrapper', ), 'profile_admin_overview' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'profile.admin.inc', ) ); diff --git a/modules/rdf/CVS/Entries b/modules/rdf/CVS/Entries index 406a07f..fbc0e35 100644 --- a/modules/rdf/CVS/Entries +++ b/modules/rdf/CVS/Entries @@ -1,6 +1,6 @@ /rdf.api.php/1.2/Tue Oct 20 17:33:43 2009// /rdf.info/1.1/Mon Oct 19 18:28:15 2009// /rdf.install/1.2/Tue Oct 20 17:33:43 2009// -/rdf.module/1.4/Tue Oct 20 19:54:15 2009// /rdf.test/1.3/Tue Oct 20 19:54:15 2009// D/tests//// +/rdf.module/1.5/Tue Oct 27 02:57:01 2009// diff --git a/modules/rdf/rdf.module b/modules/rdf/rdf.module index 10a584a..30b731c 100644 --- a/modules/rdf/rdf.module +++ b/modules/rdf/rdf.module @@ -1,5 +1,5 @@ array( - 'arguments' => array('content' => NULL, 'attributes' => array(), 'context' => array(), 'inline' => TRUE), + 'variables' => array('content' => NULL, 'attributes' => array(), 'context' => array(), 'inline' => TRUE), ), 'rdf_metadata' => array( - 'arguments' => array('metadata' => array()), + 'variables' => array('metadata' => array()), ), ); } diff --git a/modules/search/CVS/Entries b/modules/search/CVS/Entries index efc325e..466d2e9 100644 --- a/modules/search/CVS/Entries +++ b/modules/search/CVS/Entries @@ -8,7 +8,7 @@ /search.extender.inc/1.1/Thu Oct 22 14:22:24 2009// /search.info/1.10/Thu Oct 22 14:22:24 2009// /search.install/1.26/Thu Oct 22 14:22:24 2009// -/search.module/1.320/Thu Oct 22 14:25:08 2009// /search.pages.inc/1.12/Thu Oct 22 14:22:24 2009// /search.test/1.42/Thu Oct 22 14:25:08 2009// +/search.module/1.321/Tue Oct 27 02:57:01 2009// D diff --git a/modules/search/search.module b/modules/search/search.module index 6a04c26..8bac580 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -1,5 +1,5 @@ array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'template' => 'search-block-form', ), 'search_result' => array( - 'arguments' => array('result' => NULL, 'type' => NULL), + 'variables' => array('result' => NULL, 'type' => NULL), 'file' => 'search.pages.inc', 'template' => 'search-result', ), 'search_results' => array( - 'arguments' => array('results' => NULL, 'type' => NULL), + 'variables' => array('results' => NULL, 'type' => NULL), 'file' => 'search.pages.inc', 'template' => 'search-results', ), 'search_results_listing' => array( - 'arguments' => array('title' => NULL, 'content' => NULL), + 'variables' => array('title' => NULL, 'content' => NULL), ), ); } diff --git a/modules/shortcut/CVS/Entries b/modules/shortcut/CVS/Entries index 47fa720..5939a24 100644 --- a/modules/shortcut/CVS/Entries +++ b/modules/shortcut/CVS/Entries @@ -5,5 +5,5 @@ /shortcut.css/1.1/Sat Oct 17 00:51:52 2009// /shortcut.info/1.1/Sat Oct 17 00:51:52 2009// /shortcut.install/1.1/Sat Oct 17 00:51:52 2009// -/shortcut.module/1.1/Sat Oct 17 00:51:52 2009// +/shortcut.module/1.2/Tue Oct 27 02:57:01 2009// D diff --git a/modules/shortcut/shortcut.module b/modules/shortcut/shortcut.module index 6abd7b3..0449708 100644 --- a/modules/shortcut/shortcut.module +++ b/modules/shortcut/shortcut.module @@ -1,5 +1,5 @@ array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'shortcut.admin.inc', ), 'shortcut_set_customize' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'shortcut.admin.inc', ), ); diff --git a/modules/simpletest/CVS/Entries b/modules/simpletest/CVS/Entries index ab103e9..d8b071a 100644 --- a/modules/simpletest/CVS/Entries +++ b/modules/simpletest/CVS/Entries @@ -1,11 +1,11 @@ D/files//// D/tests//// -/drupal_web_test_case.php/1.165/Thu Oct 22 14:25:08 2009// /simpletest.api.php/1.3/Thu Oct 22 14:22:25 2009// /simpletest.css/1.6/Thu Oct 22 14:22:25 2009// /simpletest.info/1.13/Thu Oct 22 14:25:08 2009// /simpletest.install/1.27/Thu Oct 22 14:22:25 2009// /simpletest.js/1.11/Thu Oct 22 14:22:25 2009// -/simpletest.module/1.77/Thu Oct 22 14:22:25 2009// /simpletest.pages.inc/1.19/Thu Oct 22 14:25:08 2009// /simpletest.test/1.36/Thu Oct 22 14:25:08 2009// +/drupal_web_test_case.php/1.166/Tue Oct 27 02:57:01 2009// +/simpletest.module/1.80/Tue Oct 27 02:57:01 2009// diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index 28f697d..3c4e4ba 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -1,5 +1,5 @@ array( - 'arguments' => array('table' => NULL), + 'render element' => 'table', 'file' => 'simpletest.pages.inc', ), 'simpletest_result_summary' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'simpletest.pages.inc', ), ); @@ -406,6 +406,10 @@ function simpletest_clean_environment() { else { drupal_set_message(t('Clear results is disabled and the test results table will not be cleared.'), 'warning'); } + + // Detect test classes that have been added, renamed or deleted. + registry_rebuild(); + cache_clear_all('simpletest', 'cache'); } /** @@ -414,16 +418,18 @@ function simpletest_clean_environment() { function simpletest_clean_database() { $tables = db_find_tables(Database::getConnection()->prefixTables('{simpletest}') . '%'); $schema = drupal_get_schema_unprocessed('simpletest'); + $count = 0; foreach (array_diff_key($tables, $schema) as $table) { // Strip the prefix and skip tables without digits following "simpletest", // e.g. {simpletest_test_id}. if (preg_match('/simpletest\d+.*/', $table, $matches)) { db_drop_table($matches[0]); + $count++; } } - if (count($ret) > 0) { - drupal_set_message(format_plural(count($ret), 'Removed 1 leftover table.', 'Removed @count leftover tables.')); + if ($count > 0) { + drupal_set_message(format_plural($count, 'Removed 1 leftover table.', 'Removed @count leftover tables.')); } else { drupal_set_message(t('No leftover tables to remove.')); diff --git a/modules/simpletest/tests/CVS/Entries b/modules/simpletest/tests/CVS/Entries index fd0856d..0d6098d 100644 --- a/modules/simpletest/tests/CVS/Entries +++ b/modules/simpletest/tests/CVS/Entries @@ -13,18 +13,14 @@ /cache.test/1.10/Thu Oct 22 14:22:25 2009// /common.test/1.84/Thu Oct 22 14:22:25 2009// /common_test.info/1.1/Thu Oct 22 14:22:25 2009// -/common_test.module/1.6/Thu Oct 22 14:25:08 2009// /database_test.info/1.2/Thu Oct 22 14:22:25 2009// /database_test.install/1.9/Thu Oct 22 14:22:25 2009// /database_test.module/1.10/Thu Oct 22 14:22:25 2009// -/database_test.test/1.71/Thu Oct 22 14:25:08 2009// /error.test/1.6/Thu Oct 22 14:22:25 2009// /error_test.info/1.1/Thu Oct 22 14:22:25 2009// /error_test.module/1.4/Thu Oct 22 14:22:25 2009// /field_test.info/1.2/Thu Oct 22 14:22:25 2009// /field_test.install/1.6/Thu Oct 22 14:25:08 2009// -/field_test.module/1.33/Thu Oct 22 14:25:08 2009// -/file.test/1.44/Thu Oct 22 14:22:25 2009// /file_test.info/1.1/Thu Oct 22 14:22:25 2009// /file_test.module/1.18/Thu Oct 22 14:25:08 2009// /filetransfer.test/1.5/Thu Oct 22 14:22:25 2009// @@ -46,7 +42,6 @@ /module.test/1.14/Thu Oct 22 14:22:25 2009// /module_test.info/1.1/Thu Oct 22 14:22:25 2009// /module_test.module/1.2/Thu Oct 22 14:22:25 2009// -/path.test/1.1/Thu Oct 22 14:22:25 2009// /registry.test/1.16/Thu Oct 22 14:22:25 2009// /schema.test/1.9/Thu Oct 22 14:22:25 2009// /session.test/1.18/Thu Oct 22 14:22:26 2009// @@ -62,4 +57,12 @@ /xmlrpc.test/1.14/Thu Oct 22 14:22:26 2009// /xmlrpc_test.info/1.1/Thu Oct 22 14:22:26 2009// /xmlrpc_test.module/1.4/Thu Oct 22 14:22:26 2009// +/common_test.module/1.7/Tue Oct 27 02:57:01 2009// +/database_test.test/1.72/Tue Oct 27 02:57:01 2009// +/field_test.module/1.35/Tue Oct 27 02:57:01 2009// +/file.test/1.45/Tue Oct 27 02:57:01 2009// +/path.test/1.2/Tue Oct 27 02:57:01 2009// +/url_alter_test.info/1.1/Sat Oct 24 05:13:44 2009// +/url_alter_test.install/1.1/Sat Oct 24 05:13:44 2009// +/url_alter_test.module/1.1/Sat Oct 24 05:13:44 2009// D diff --git a/modules/simpletest/tests/common_test.module b/modules/simpletest/tests/common_test.module index 5528813..f7e06f4 100644 --- a/modules/simpletest/tests/common_test.module +++ b/modules/simpletest/tests/common_test.module @@ -1,5 +1,5 @@ array( - 'arguments' => array('foo' => 'foo', 'bar' => 'bar'), + 'variables' => array('foo' => 'foo', 'bar' => 'bar'), ), ); } diff --git a/modules/simpletest/tests/database_test.test b/modules/simpletest/tests/database_test.test index fa888d4..97e0f77 100644 --- a/modules/simpletest/tests/database_test.test +++ b/modules/simpletest/tests/database_test.test @@ -1,5 +1,5 @@ fields(array('job' => 'Musician')) - ->condition('name', array('John', 'Paul', 'George'), 'NOT IN') + ->condition('name', array('John', 'Paul', 'George'), 'NoT IN') ->execute(); $this->assertIdentical($num_updated, 1, t('Updated 1 record.')); diff --git a/modules/simpletest/tests/field_test.module b/modules/simpletest/tests/field_test.module index 1f81805..6e0a953 100644 --- a/modules/simpletest/tests/field_test.module +++ b/modules/simpletest/tests/field_test.module @@ -1,5 +1,5 @@ array( - 'arguments' => array('element' => NULL), - ), - 'field_formatter_field_test_multiple' => array( - 'arguments' => array('element' => NULL), - ), - 'field_formatter_field_test_needs_additional_data' => array( - 'arguments' => array('element' => NULL), - ), - ); -} - /** * Implement hook_field_formatter_prepare_view(). */ @@ -1069,7 +1050,7 @@ function field_test_field_storage_create_field($field) { if ($field['storage']['type'] == 'field_test_storage_failure') { throw new Exception('field_test_storage_failure engine always fails to create fields'); } - + $data = _field_test_storage_data(); $data[$field['id']] = array( diff --git a/modules/simpletest/tests/file.test b/modules/simpletest/tests/file.test index 70c227e..dd24d4d 100644 --- a/modules/simpletest/tests/file.test +++ b/modules/simpletest/tests/file.test @@ -1,5 +1,5 @@ 'Stream Wrapper Registry', - 'description' => 'Tests stream wrapper registry.', + 'name' => 'Stream wrappers', + 'description' => 'Tests stream wrapper functions.', 'group' => 'File API', ); } @@ -2167,21 +2167,33 @@ class StreamWrapperRegistryTest extends DrupalWebTestCase { /** * Test the URI and target functions. */ - function testGetInstanceByUri() { + function testUriFunctions() { $instance = file_stream_wrapper_get_instance_by_uri($this->scheme . '://foo'); $this->assertEqual($this->classname, get_class($instance), t('Got correct class type for dummy URI.')); $instance = file_stream_wrapper_get_instance_by_uri('public://foo'); $this->assertEqual('DrupalPublicStreamWrapper', get_class($instance), t('Got correct class type for public URI.')); - // Test file_stream_wrapper_uri_normalize. + // Test file_stream_wrapper_uri_normalize(). $uri = 'public:///' . file_directory_path() . '/foo/bar/'; $uri = file_stream_wrapper_uri_normalize($uri); $this->assertEqual('public://foo/bar', $uri, t('Got a properly normalized URI @uri', array('@uri' => $uri))); - // Test file_uri_taget(). - $this->assertEqual('foo/bar.txt', file_uri_target('public://foo/bar.txt'), t('Got a valid stream target from public://foo/bar.txt')); + // Test file_uri_target(). + $this->assertEqual(file_uri_target('public://foo/bar.txt'), 'foo/bar.txt', t('Got a valid stream target from public://foo/bar.txt.')); $this->assertFalse(file_uri_target('foo/bar.txt'), t('foo/bar.txt is not a valid stream.')); + + // Test file_build_uri() and file_directory_path(). + $this->assertEqual(file_build_uri('foo/bar.txt'), 'public://foo/bar.txt', t('Expected scheme was added.')); + $this->assertEqual(file_directory_path(), variable_get('file_public_path'), t('Expected default directory path was returned.')); + $this->assertEqual(file_directory_path('public'), variable_get('file_public_path'), t('Expected public directory path was returned.')); + $this->assertEqual(file_directory_path('temporary'), conf_path() . '/private/temp', t('Expected temporary directory path was returned.')); + $this->assertEqual(file_directory_path($this->scheme), variable_get('stream_public_path', 'sites/default/files'), t('Expected dummy directory path was returned.')); + $this->assertFalse(file_directory_path('non-existent'), t('No directory path returned for invalid scheme.')); + variable_set('file_default_scheme', 'private'); + $this->assertEqual(file_build_uri('foo/bar.txt'), 'private://foo/bar.txt', t('Got a valid URI from foo/bar.txt.')); + $this->assertEqual(file_directory_path(), variable_get('file_private_path'), t('Expected default directory path was returned.')); + $this->assertEqual(file_directory_path('private'), variable_get('file_private_path'), t('Expected private directory path was returned.')); } /** diff --git a/modules/simpletest/tests/path.test b/modules/simpletest/tests/path.test index 3943ad6..af79800 100644 --- a/modules/simpletest/tests/path.test +++ b/modules/simpletest/tests/path.test @@ -1,5 +1,5 @@ t('URL altering'), + 'description' => t('Tests hook_url_inbound_alter() and hook_url_outbound_alter().'), + 'group' => t('Path API'), + ); + } + + function setUp() { + parent::setUp('path', 'forum', 'url_alter_test'); + } + + /** + * Test that URL altering works and that it occurs in the correct order. + */ + function testUrlAlter() { + $account = $this->drupalCreateUser(array('administer url aliases')); + $this->drupalLogin($account); + + $uid = $account->uid; + $name = $account->name; + + // Test a single altered path. + $this->assertUrlInboundAlter("user/$name", "user/$uid"); + $this->assertUrlOutboundAlter("user/$uid", "user/$name"); + + // Test that a path always uses its alias. + $path = array('source' => "user/$uid/test1", 'alias' => 'alias/test1'); + path_save($path); + $this->assertUrlInboundAlter('alias/test1', "user/$uid/test1"); + $this->assertUrlOutboundAlter("user/$uid/test1", 'alias/test1'); + + // Test that alias source paths are normalized in the interface. + $edit = array('source' => "user/$name/edit", 'alias' => 'alias/test2'); + $this->drupalPost('admin/config/search/path/add', $edit, t('Create new alias')); + $this->assertText(t('The alias has been saved.')); + + // Test that a path always uses its alias. + $this->assertUrlInboundAlter('alias/test2', "user/$uid/edit"); + $this->assertUrlOutboundAlter("user/$uid/edit", 'alias/test2'); + + // Test a non-existant user is not altered. + $uid++; + $this->assertUrlInboundAlter("user/$uid", "user/$uid"); + $this->assertUrlOutboundAlter("user/$uid", "user/$uid"); + + // Test that 'forum' is altered to 'community' correctly. + $this->assertUrlInboundAlter('community', 'forum'); + $this->assertUrlOutboundAlter('forum', 'community'); + + // Add a forum to test url altering. + $forum_vid = db_query("SELECT vid FROM {taxonomy_vocabulary} WHERE module = 'forum'")->fetchField(); + $tid = db_insert('taxonomy_term_data') + ->fields(array( + 'name' => $this->randomName(), + 'vid' => $forum_vid, + )) + ->execute(); + + // Test that a existing forum URL is altered. + $this->assertUrlInboundAlter("community/$tid", "forum/$tid"); + $this->assertUrlOutboundAlter("taxonomy/term/$tid", "community/$tid"); + + // Test that a non-existant forum URL is not altered. + $tid++; + $this->assertUrlInboundAlter("taxonomy/term/$tid", "taxonomy/term/$tid"); + $this->assertUrlOutboundAlter("taxonomy/term/$tid", "taxonomy/term/$tid"); + } + + /** + * Assert that an outbound path is altered to an expected value. + * + * @param $original + * A string with the original path that is run through url(). + * @param $final + * A string with the expected result after url(). + * @return + * TRUE if $original was correctly altered to $final, FALSE otherwise. + */ + protected function assertUrlOutboundAlter($original, $final) { + // Test outbound altering. + $result = url($original); + $base_path = base_path() . (variable_get('clean_url', '0') ? '' : '?q='); + $result = substr($result, strlen($base_path)); + $this->assertIdentical($result, $final, t('Altered outbound URL %original, expected %final, and got %result.', array('%original' => $original, '%final' => $final, '%result' => $result))); + } + + /** + * Assert that a inbound path is altered to an expected value. + * + * @param $original + * A string with the aliased or un-normal path that is run through + * drupal_get_normal_path(). + * @param $final + * A string with the expected result after url(). + * @return + * TRUE if $original was correctly altered to $final, FALSE otherwise. + */ + protected function assertUrlInboundAlter($original, $final) { + // Test inbound altering. + $result = drupal_get_normal_path($original); + $this->assertIdentical($result, $final, t('Altered inbound URL %original, expected %final, and got %result.', array('%original' => $original, '%final' => $final, '%result' => $result))); + } +} diff --git a/modules/simpletest/tests/url_alter_test.info b/modules/simpletest/tests/url_alter_test.info new file mode 100644 index 0000000..892ebe9 --- /dev/null +++ b/modules/simpletest/tests/url_alter_test.info @@ -0,0 +1,9 @@ +; $Id: url_alter_test.info,v 1.1 2009/10/24 05:13:44 webchick Exp $ +name = Url_alter tests +description = A support modules for url_alter hook testing. +core = 7.x +package = Testing +version = VERSION +files[] = url_alter_test.module +files[] = url_alter_test.install +hidden = TRUE diff --git a/modules/simpletest/tests/url_alter_test.install b/modules/simpletest/tests/url_alter_test.install new file mode 100644 index 0000000..9ac09e0 --- /dev/null +++ b/modules/simpletest/tests/url_alter_test.install @@ -0,0 +1,13 @@ +fields(array('weight' => 2)) + ->condition('name', 'url_alter_test') + ->execute(); +} diff --git a/modules/simpletest/tests/url_alter_test.module b/modules/simpletest/tests/url_alter_test.module new file mode 100644 index 0000000..ca94e95 --- /dev/null +++ b/modules/simpletest/tests/url_alter_test.module @@ -0,0 +1,43 @@ + ''); + $path = 'user/' . $account->uid . $matches[2]; + } + } + + // Rewrite community/ to forum/. + if ($path == 'community' || strpos($path, 'community/') === 0) { + $path = 'forum' . substr($path, 9); + } +} + +/** + * Implement hook_url_outbound_alter(). + */ +function url_alter_test_url_outbound_alter(&$path, &$options, $original_path) { + // Rewrite user/uid to user/username. + if (preg_match('!^user/([0-9]+)(/.*)?!', $path, $matches)) { + if ($account = user_load($matches[1])) { + $matches += array(2 => ''); + $path = 'user/' . $account->name . $matches[2]; + } + } + + // Rewrite forum/ to community/. + if ($path == 'forum' || strpos($path, 'forum/') === 0) { + $path = 'community' . substr($path, 5); + } +} diff --git a/modules/statistics/CVS/Entries b/modules/statistics/CVS/Entries index 0a502e6..320dd56 100644 --- a/modules/statistics/CVS/Entries +++ b/modules/statistics/CVS/Entries @@ -1,8 +1,8 @@ /statistics.admin.inc/1.34/Thu Oct 22 14:22:26 2009// /statistics.info/1.10/Thu Oct 22 14:22:26 2009// /statistics.install/1.24/Thu Oct 22 14:25:08 2009// -/statistics.module/1.320/Thu Oct 22 14:22:26 2009// /statistics.pages.inc/1.18/Thu Oct 22 14:22:26 2009// /statistics.test/1.12/Thu Oct 22 14:22:26 2009// /statistics.tokens.inc/1.2/Thu Oct 22 14:25:08 2009// +/statistics.module/1.321/Tue Oct 27 02:57:01 2009// D diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index 33babfc..7ac5058 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -1,5 +1,5 @@ array( - 'arguments' => array('entry' => NULL), + 'variables' => array('entry' => NULL), ), ); } diff --git a/modules/system/CVS/Entries b/modules/system/CVS/Entries index 9627723..1f00aab 100644 --- a/modules/system/CVS/Entries +++ b/modules/system/CVS/Entries @@ -13,16 +13,16 @@ /system-menus.css/1.1/Thu Oct 22 14:22:26 2009// /system-rtl.css/1.17/Thu Oct 22 14:22:26 2009// /system.admin.inc/1.216/Thu Oct 22 14:25:08 2009// -/system.api.php/1.94/Thu Oct 22 14:25:08 2009// /system.archiver.inc/1.2/Fri Oct 16 13:18:32 2009// /system.css/1.63/Thu Oct 22 14:22:26 2009// /system.info/1.18/Thu Oct 22 14:25:08 2009// -/system.install/1.410/Thu Oct 22 14:25:08 2009// /system.js/1.37/Thu Oct 22 14:25:08 2009// -/system.module/1.822/Thu Oct 22 14:25:08 2009// /system.queue.inc/1.6/Thu Oct 22 14:22:26 2009// /system.tar.inc/1.2/Thu Oct 22 14:22:26 2009// -/system.test/1.89/Thu Oct 22 14:25:08 2009// /system.tokens.inc/1.4/Thu Oct 22 14:22:26 2009// /system.updater.inc/1.1/Thu Oct 15 21:19:31 2009// +/system.api.php/1.97/Tue Oct 27 02:57:01 2009// +/system.install/1.415/Tue Oct 27 02:57:01 2009// +/system.module/1.826/Tue Oct 27 02:57:01 2009// +/system.test/1.90/Tue Oct 27 02:57:01 2009// D diff --git a/modules/system/system.api.php b/modules/system/system.api.php index 760a41c..770146b 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -1,5 +1,5 @@ array( - 'arguments' => array('forums' => NULL, 'topics' => NULL, 'parents' => NULL, 'tid' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), + 'variables' => array('forums' => NULL, 'topics' => NULL, 'parents' => NULL, 'tid' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), ), 'forum_list' => array( - 'arguments' => array('forums' => NULL, 'parents' => NULL, 'tid' => NULL), + 'variables' => array('forums' => NULL, 'parents' => NULL, 'tid' => NULL), ), 'forum_topic_list' => array( - 'arguments' => array('tid' => NULL, 'topics' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), + 'variables' => array('tid' => NULL, 'topics' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), ), 'forum_icon' => array( - 'arguments' => array('new_posts' => NULL, 'num_posts' => 0, 'comment_mode' => 0, 'sticky' => 0), + 'variables' => array('new_posts' => NULL, 'num_posts' => 0, 'comment_mode' => 0, 'sticky' => 0), + ), + 'status_report' => array( + 'render element' => 'requirements', + 'file' => 'system.admin.inc', + ), + 'system_date_time_settings' => array( + 'render element' => 'form', + 'file' => 'system.admin.inc', ), ); } @@ -960,7 +975,7 @@ function hook_theme($existing, $type, $theme, $path) { * For example: * @code * $theme_registry['user_profile'] = array( - * 'arguments' => array( + * 'variables' => array( * 'account' => NULL, * ), * 'template' => 'modules/user/user-profile', @@ -1282,64 +1297,6 @@ function hook_modules_uninstalled($modules) { mymodule_cache_rebuild(); } -/** - * custom_url_rewrite_outbound is not a hook, it's a function you can add to - * settings.php to alter all links generated by Drupal. This function is called from url(). - * This function is called very frequently (100+ times per page) so performance is - * critical. - * - * This function should change the value of $path and $options by reference. - * - * @param $path - * The alias of the $original_path as defined in the database. - * If there is no match in the database it'll be the same as $original_path - * @param $options - * An array of link attributes such as querystring and fragment. See url(). - * @param $original_path - * The unaliased Drupal path that is being linked to. - */ -function custom_url_rewrite_outbound(&$path, &$options, $original_path) { - global $user; - - // Change all 'node' to 'article'. - if (preg_match('|^node(/.*)|', $path, $matches)) { - $path = 'article' . $matches[1]; - } - // Create a path called 'e' which lands the user on her profile edit page. - if ($path == 'user/' . $user->uid . '/edit') { - $path = 'e'; - } - -} - -/** - * custom_url_rewrite_inbound is not a hook, it's a function you can add to - * settings.php to alter incoming requests so they map to a Drupal path. - * This function is called before modules are loaded and - * the menu system is initialized and it changes $_GET['q']. - * - * This function should change the value of $result by reference. - * - * @param $result - * The Drupal path based on the database. If there is no match in the database it'll be the same as $path. - * @param $path - * The path to be rewritten. - * @param $path_language - * An optional language code to rewrite the path into. - */ -function custom_url_rewrite_inbound(&$result, $path, $path_language) { - global $user; - - // Change all article/x requests to node/x - if (preg_match('|^article(/.*)|', $path, $matches)) { - $result = 'node' . $matches[1]; - } - // Redirect a path called 'e' to the user's profile edit page. - if ($path == 'e') { - $result = 'user/' . $user->uid . '/edit'; - } -} - /** * Registers PHP stream wrapper implementations associated with a module. * @@ -2651,6 +2608,62 @@ function hook_page_delivery_callback_alter(&$callback) { } } +/** + * Alters inbound URL requests. + * + * @param $path + * The path being constructed, which, if a path alias, has been resolved to a + * Drupal path by the database, and which also may have been altered by other + * modules before this one. + * @param $original_path + * The original path, before being checked for path aliases or altered by any + * modules. + * @param $path_language + * The language of the path. + * + * @see drupal_get_normal_path() + */ +function hook_url_inbound_alter(&$path, $original_path, $path_language) { + // Create the path user/me/edit, which allows a user to edit their account. + if (preg_match('|^user/me/edit(/.*)?|', $path, $matches)) { + global $user; + $path = 'user/' . $user->uid . '/edit' . $matches[1]; + } +} + +/** + * Alters outbound URLs. + * + * @param $path + * The outbound path to alter, not adjusted for path aliases yet. It won't be + * adjusted for path aliases until all modules are finished altering it, thus + * being consistent with hook_url_alter_inbound(), which adjusts for all path + * aliases before allowing modules to alter it. This may have been altered by + * other modules before this one. + * @param $options + * A set of URL options for the URL so elements such as a fragment or a query + * string can be added to the URL. + * @param $original_path + * The original path, before being altered by any modules. + * + * @see url() + */ +function hook_url_outbound_alter(&$path, &$options, $original_path) { + // Use an external RSS feed rather than the Drupal one. + if ($path == 'rss.xml') { + $path = 'http://example.com/rss.xml'; + $options['external'] = TRUE; + } + + // Instead of pointing to user/[uid]/edit, point to user/me/edit. + if (preg_match('|^user/([0-9]*)/edit(/.*)?|', $path, $matches)) { + global $user; + if ($user->uid == $matches[1]) { + $path = 'user/me/edit' . $matches[2]; + } + } +} + /** * @} End of "addtogroup hooks". */ diff --git a/modules/system/system.install b/modules/system/system.install index 04f1aee..a164123 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -1,5 +1,5 @@ array( - 'rid' => array( - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - ), - 'permission' => array( - 'type' => 'varchar', - 'length' => 64, - 'not null' => TRUE, - 'default' => '', - ), - ), - 'primary key' => array('rid', 'permission'), - 'indexes' => array( - 'permission' => array('permission'), - ), - ); - - db_create_table('role_permission', $schema['role_permission']); - // Copy the permissions from the old {permission} table to the new {role_permission} table. $messages = array(); $result = db_query("SELECT rid, perm FROM {permission} ORDER BY rid ASC"); @@ -2723,101 +2701,14 @@ function system_update_7038() { * page. */ function system_update_7039() { - db_add_field('menu_router', 'theme_callback', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')); - db_add_field('menu_router', 'theme_arguments', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')); + // Moved to update_fix_d7_requirements(). } /** * Create new date format tables. */ function system_update_7040() { - $schema['date_format_type'] = array( - 'description' => 'Stores configured date format types.', - 'fields' => array( - 'type' => array( - 'description' => 'The date format type, e.g. medium.', - 'type' => 'varchar', - 'length' => 64, - 'not null' => TRUE, - ), - 'title' => array( - 'description' => 'The human readable name of the format type.', - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - ), - 'locked' => array( - 'description' => 'Whether or not this is a system provided format.', - 'type' => 'int', - 'size' => 'tiny', - 'default' => 0, - 'not null' => TRUE, - ), - ), - 'primary key' => array('type'), - ); - - $schema['date_formats'] = array( - 'description' => 'Stores configured date formats.', - 'fields' => array( - 'dfid' => array( - 'description' => 'The date format identifier.', - 'type' => 'serial', - 'not null' => TRUE, - 'unsigned' => TRUE, - ), - 'format' => array( - 'description' => 'The date format string.', - 'type' => 'varchar', - 'length' => 100, - 'not null' => TRUE, - ), - 'type' => array( - 'description' => 'The date format type, e.g. medium.', - 'type' => 'varchar', - 'length' => 64, - 'not null' => TRUE, - ), - 'locked' => array( - 'description' => 'Whether or not this format can be modified.', - 'type' => 'int', - 'size' => 'tiny', - 'default' => 0, - 'not null' => TRUE, - ), - ), - 'primary key' => array('dfid'), - 'unique keys' => array('formats' => array('format', 'type')), - ); - - $schema['date_format_locale'] = array( - 'description' => 'Stores configured date formats for each locale.', - 'fields' => array( - 'format' => array( - 'description' => 'The date format string.', - 'type' => 'varchar', - 'length' => 100, - 'not null' => TRUE, - ), - 'type' => array( - 'description' => 'The date format type, e.g. medium.', - 'type' => 'varchar', - 'length' => 64, - 'not null' => TRUE, - ), - 'language' => array( - 'description' => 'A {languages}.language for this format to be used with.', - 'type' => 'varchar', - 'length' => 12, - 'not null' => TRUE, - ), - ), - 'primary key' => array('type', 'language'), - ); - - db_create_table('date_format_type', $schema['date_format_type']); - db_create_table('date_formats', $schema['date_formats']); - db_create_table('date_format_locale', $schema['date_format_locale']); + // Moved to update_fix_d7_requirements(). } /** @@ -2825,13 +2716,23 @@ function system_update_7040() { * function to be used for final page rendering and sending to browser. */ function system_update_7041() { - db_add_field('menu_router', 'delivery_callback', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')); + // Moved to update_fix_d7_requirements(). } /** * Rename dst and src to source and alias. */ function system_update_7042() { + // update_fix_d7_requirements() adds 'fake' source and alias columns to + // allow bootstrap to run without fatal errors. Remove those columns now + // so that we can rename properly. + db_drop_field('url_alias', 'source'); + db_drop_field('url_alias', 'alias'); + + // Add the cache_path table. + $schema['cache_path'] = drupal_get_schema_unprocessed('system', 'cache'); + $schema['cache_path']['description'] = 'Cache table used for path alias lookups.'; + db_create_table('cache_path', $schema['cache_path']); // Drop indexes. db_drop_index('url_alias', 'src_language_pid'); db_drop_unique_key('url_alias', 'dst_language_pid'); @@ -2841,18 +2742,14 @@ function system_update_7042() { // Add indexes back. db_add_index('url_alias', 'source_language_pid', array('source', 'language', 'pid')); db_add_unique_key('url_alias', 'alias_language_pid', array('alias', 'language', 'pid')); + } /** * Add a 'context' field to {menu_router} to control contextual placement of local tasks. */ function system_update_7043() { - db_add_field('menu_router', 'context', array( - 'description' => 'Only for local tasks (tabs) - the context of a local task to control its placement.', - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - )); + // Moved to update_fix_d7_requirements(). } /** diff --git a/modules/system/system.module b/modules/system/system.module index 7331513..28fd9a4 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -1,5 +1,5 @@ ' . t('Modules are plugins that extend Drupal\'s core functionality. To further extend your site\'s functionality, a number of contributed modules are available for download.', array('@permissions' => url('admin/config/people/permissions'), '@modules' => 'http://drupal.org/project/modules')) . '

'; $output .= '

' . t('Module-related tasks can be located on the administration by module page. New module-related permissions may also become available as new modules are enabled.', array('@by-module' => url('admin/by-module'), '@permissions' => url('admin/config/people/permissions'))) . '

'; - $output .= '

' . t('Each time a module is updated, it is important that update.php is run. To help manage the update process, the Update status module, if enabled, provides information on new versions of modules (and themes) as they are released. Regular review of the available updates page is essential to maintaining a secure and current site.', array('@update-php' => $base_url . '/update.php', '@updates' => url('admin/reports/updates'))) . '

'; + if (module_exists('update')) { + if (update_manager_access()) { + $output .= '

' . t('Each time a module is updated, it is important that update.php is run. To help manage the update process, the Update manager module provides information on new versions of modules (and themes) as they are released, and allows you to upgrade any missing updates or install new modules and themes. Regular review of the available updates page is essential to maintaining a secure and current site.', array('@update-php' => $base_url . '/update.php', '@updates' => url('admin/reports/updates'), '@update-manager-update' => url('admin/config/modules/update'), '@update-manager-install' => url('admin/config/modules/install'))) . '

'; + } + else { + $output .= '

' . t('Each time a module is updated, it is important that update.php is run. To help manage the update process, the Update manager module provides information on new versions of modules (and themes) as they are released. Regular review of the available updates page is essential to maintaining a secure and current site.', array('@update-php' => $base_url . '/update.php', '@updates' => url('admin/reports/updates'))) . '

'; + } + } + else { + $output .= '

' . t('Each time a module is updated, it is important that update.php is run. If you enable the Update manager module, it will provide a report about new versions of modules (and themes) as they are released, can notify you via e-mail if your site is out of date, and let you install missing updates. Regular review of available updates is essential to maintaining a secure and current site.', array('@update-php' => $base_url . '/update.php')) . '

'; + } return $output; case 'admin/config/modules/uninstall': return '

' . t('The uninstall process removes all data related to a module. To uninstall a module, you must first disable it on the main modules page. Not all modules support this feature.', array('@modules' => url('admin/config/modules'))) . '

'; @@ -156,63 +166,65 @@ function system_help($path, $arg) { function system_theme() { return array_merge(drupal_common_theme(), array( 'system_themes_form' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'system.admin.inc', ), 'system_settings_form' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'system.admin.inc', ), 'confirm_form' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), 'system_modules_fieldset' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'system.admin.inc', ), 'system_modules_incompatible' => array( - 'arguments' => array('message' => NULL), + 'variables' => array('message' => NULL), 'file' => 'system.admin.inc', ), 'system_modules_uninstall' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'system.admin.inc', ), 'status_report' => array( - 'arguments' => array('requirements' => NULL), + 'render element' => 'requirements', 'file' => 'system.admin.inc', ), 'admin_page' => array( - 'arguments' => array('blocks' => NULL), + 'variables' => array('blocks' => NULL), 'file' => 'system.admin.inc', ), 'admin_block' => array( - 'arguments' => array('block' => NULL), + 'variables' => array('block' => NULL), 'file' => 'system.admin.inc', ), 'admin_block_content' => array( - 'arguments' => array('content' => NULL), + 'variables' => array('content' => NULL), 'file' => 'system.admin.inc', ), 'system_admin_by_module' => array( - 'arguments' => array('menu_items' => NULL), + 'variables' => array('menu_items' => NULL), 'file' => 'system.admin.inc', ), 'system_powered_by' => array( - 'arguments' => array('image_path' => NULL), + 'variables' => array(), ), 'meta_generator_html' => array( - 'arguments' => array('version' => NULL), + 'variables' => array('version' => NULL), ), 'meta_generator_header' => array( - 'arguments' => array('version' => NULL), + 'variables' => array('version' => NULL), + ), + 'system_compact_link' => array( + 'variables' => array(), ), - 'system_compact_link' => array(), 'system_run_cron_image' => array( - 'arguments' => array('image_path' => NULL), + 'variables' => array('image_path' => NULL), ), 'system_date_time_settings' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'system.admin.inc', ), )); @@ -1507,25 +1519,16 @@ function system_updater_info() { function system_filetransfer_backends() { $backends = array(); - //This is the default, will be available on most systems - if (function_exists('ftp_connect')) { - $backends['ftp_extension'] = array( + // This is the default, will be available on most systems. + if (function_exists('ftp_connect') || ini_get('allow_url_fopen')) { + $backends['ftp'] = array( 'title' => t('FTP'), - 'class' => 'FileTransferFTPExtension', + 'class' => 'FileTransferFTP', 'settings_form' => 'system_filetransfer_backend_form_ftp', 'weight' => 0, ); } - if (ini_get('allow_url_fopen')) { - $backends['ftp_wrapper'] = array( - 'title' => t('FTP using file streams'), - 'class' => 'FileTransferFTPWrapper', - 'settings_form' => 'system_filetransfer_backend_form_ftp', - 'weight' => 10, - ); - } - // SSH2 lib connection is only available if the proper PHP extension is // installed. if (function_exists('ssh2_connect')) { @@ -1752,46 +1755,6 @@ function system_block_info() { return $blocks; } -/** - * Implement hook_block_configure(). - */ -function system_block_configure($delta = '') { - if ($delta == 'powered-by') { - $image_path = 'misc/' . variable_get('drupal_badge_color', 'powered-blue') . '-' . variable_get('drupal_badge_size', '80x15') . '.png'; - drupal_add_js(drupal_get_path('module', 'system') . '/system.js'); - // Compile a list of fields to show - $form['wrapper']['color'] = array( - '#type' => 'select', - '#title' => t('Badge color'), - '#default_value' => variable_get('drupal_badge_color', 'powered-blue'), - '#options' => array('powered-black' => t('Black'), 'powered-blue' => t('Blue'), 'powered-gray' => t('Gray')), - ); - $form['wrapper']['size'] = array( - '#type' => 'select', - '#title' => t('Badge size'), - '#default_value' => variable_get('drupal_badge_size', '80x15'), - '#options' => array('80x15' => t('Small'), '88x31' => t('Medium'), '135x42' => t('Large')), - ); - $form['wrapper']['preview'] = array( - '#type' => 'item', - '#title' => 'Preview', - '#markup' => theme('image', array('path' => $image_path, 'alt' => t('Powered by Drupal, an open source content management system'), 'title' => t('Powered by Drupal, an open source content management system'), 'attributes' => array('class' => array('powered-by-preview')), 'getsize' => FALSE)), - ); - return $form; - } -} - -/** - * Implement hook_block_save(). - */ -function system_block_save($delta = '', $edit = NULL) { - if ($delta == 'powered-by') { - $image_path = 'misc/' . variable_get('drupal_badge_color', 'powered-blue') . '-' . variable_get('drupal_badge_size', '80x15') . '.png'; - variable_set('drupal_badge_color', $edit['color']); - variable_set('drupal_badge_size', $edit['size']); - } -} - /** * Implement hook_block_view(). * @@ -1806,9 +1769,8 @@ function system_block_view($delta = '') { $block['content'] = drupal_set_page_content(); return $block; case 'powered-by': - $image_path = 'misc/' . variable_get('drupal_badge_color', 'powered-blue') . '-' . variable_get('drupal_badge_size', '80x15') . '.png'; $block['subject'] = NULL; - $block['content'] = theme('system_powered_by', array('image_path' => $image_path)); + $block['content'] = theme('system_powered_by'); return $block; case 'help': $block['subject'] = NULL; @@ -2910,8 +2872,7 @@ function system_timezone($abbreviation = '', $offset = -1, $is_daylight_saving_t * @ingroup themeable */ function theme_system_powered_by($variables) { - $image = theme('image', array('path' => $variables['image_path'], 'alt' => t('Powered by Drupal, an open source content management system'), 'title' => t('Powered by Drupal, an open source content management system'))); - return l($image, 'http://drupal.org', array('html' => TRUE, 'absolute' => TRUE, 'external' => TRUE)); + return '' . t('Powered by Drupal', array('@poweredby' => 'http://drupal.org')) . ''; } /** @@ -3506,8 +3467,13 @@ function system_preprocess(&$variables, $hook) { $variables['contextual_links'] = array(); // Determine the primary theme function argument. - $keys = array_keys($hooks[$hook]['arguments']); - $key = $keys[0]; + if (isset($hooks[$hook]['variables'])) { + $keys = array_keys($hooks[$hook]['variables']); + $key = $keys[0]; + } + else { + $key = $hooks[$hook]['render element']; + } if (isset($variables[$key])) { $element = $variables[$key]; } diff --git a/modules/system/system.test b/modules/system/system.test index 9f03e6e..f779127 100644 --- a/modules/system/system.test +++ b/modules/system/system.test @@ -1,5 +1,5 @@ drupalPost('admin/structure/block/manage/system/powered-by/configure', array('title' => $this->randomName(8), 'color' => 'powered-black', 'size' => '135x42'), t('Save block')); + $this->drupalPost('admin/structure/block/manage/system/powered-by/configure', array('title' => $this->randomName(8)), t('Save block')); $this->assertText(t('The block configuration has been saved.'), t('Block configuration set.')); // Set the powered-by block to the footer region. @@ -997,7 +997,7 @@ class SystemBlockTestCase extends DrupalWebTestCase { $edit = array(); $edit['system_powered-by[region]'] = 'footer'; $this->drupalPost('admin/structure/block', $edit, t('Save blocks')); - $this->drupalPost('admin/structure/block/manage/system/powered-by/configure', array('title' => '', 'color' => 'powered-blue', 'size' => '80x15'), t('Save block')); + $this->drupalPost('admin/structure/block/manage/system/powered-by/configure', array('title' => ''), t('Save block')); } } diff --git a/modules/taxonomy/CVS/Entries b/modules/taxonomy/CVS/Entries index 8360731..7086659 100644 --- a/modules/taxonomy/CVS/Entries +++ b/modules/taxonomy/CVS/Entries @@ -1,11 +1,11 @@ -/taxonomy.admin.inc/1.78/Thu Oct 22 14:25:08 2009// /taxonomy.api.php/1.7/Thu Oct 22 14:22:26 2009// /taxonomy.css/1.5/Thu Oct 22 14:22:26 2009// /taxonomy.info/1.10/Thu Oct 22 14:22:26 2009// /taxonomy.install/1.27/Thu Oct 22 14:25:08 2009// /taxonomy.js/1.6/Thu Oct 22 14:22:26 2009// -/taxonomy.module/1.528/Thu Oct 22 14:25:08 2009// -/taxonomy.pages.inc/1.42/Thu Oct 22 14:25:08 2009// -/taxonomy.test/1.55/Thu Oct 22 14:25:08 2009// -/taxonomy.tokens.inc/1.2/Thu Oct 22 14:22:26 2009// +/taxonomy.admin.inc/1.79/Tue Oct 27 02:57:01 2009// +/taxonomy.module/1.530/Tue Oct 27 02:57:01 2009// +/taxonomy.pages.inc/1.43/Tue Oct 27 02:57:01 2009// +/taxonomy.test/1.56/Tue Oct 27 02:57:02 2009// +/taxonomy.tokens.inc/1.3/Tue Oct 27 02:57:02 2009// D diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc index 4999c14..abe164a 100644 --- a/modules/taxonomy/taxonomy.admin.inc +++ b/modules/taxonomy/taxonomy.admin.inc @@ -1,5 +1,5 @@ vid); + return taxonomy_vocabulary_confirm_reset_alphabetical($form, $form_state, $vocabulary->vid); } $form['#vocabulary'] = $vocabulary; diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 5c8d23a..485b702 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -1,5 +1,5 @@ array( - 'arguments' => array('form' => array()), + 'render element' => 'form', ), 'taxonomy_overview_terms' => array( - 'arguments' => array('form' => array()), + 'render element' => 'form', ), 'taxonomy_autocomplete' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), ); } -/** - * For vocabularies not maintained by taxonomy.module, give the maintaining - * module a chance to provide a path for terms in that vocabulary. - * - * @param $term - * A term object. - * @return - * An internal Drupal path. - */ -function taxonomy_term_path($term) { - $vocabulary = taxonomy_vocabulary_load($term->vid); - if ($vocabulary->module != 'taxonomy' && $path = module_invoke($vocabulary->module, 'term_path', $term)) { - return $path; - } - return 'taxonomy/term/' . $term->tid; -} - /** * Implement hook_menu(). */ @@ -1103,7 +1086,7 @@ function taxonomy_field_formatter_info() { function theme_field_formatter_taxonomy_term_link($variables) { $term = $variables['element']['#item']['taxonomy_term']; $attributes = empty($variables['link_options']) ? array() : $variables['link_options']; - return l($term->name, taxonomy_term_path($term), $attributes); + return l($term->name, 'taxonomy/term/' . $term->tid, $attributes); } /** diff --git a/modules/taxonomy/taxonomy.pages.inc b/modules/taxonomy/taxonomy.pages.inc index 47e1f84..7c4a66d 100644 --- a/modules/taxonomy/taxonomy.pages.inc +++ b/modules/taxonomy/taxonomy.pages.inc @@ -1,5 +1,5 @@ tid)) { $current = array_shift($parents); - $breadcrumb[] = l($current->name, taxonomy_term_path($current)); + $breadcrumb[] = l($current->name, 'taxonomy/term/' . $current->tid); } $breadcrumb[] = l(t('Home'), NULL); $breadcrumb = array_reverse($breadcrumb); diff --git a/modules/taxonomy/taxonomy.test b/modules/taxonomy/taxonomy.test index 00f7386..cb1e8f9 100644 --- a/modules/taxonomy/taxonomy.test +++ b/modules/taxonomy/taxonomy.test @@ -1,5 +1,5 @@ assertResponse(404, t('The taxonomy term page was not found')); } + /** + * Save, edit and delete a term using the user interface. + */ + function testTermReorder() { + $this->createTerm($this->vocabulary); + $this->createTerm($this->vocabulary); + $this->createTerm($this->vocabulary); + + // Fetch the created terms in the default alphabetical order, i.e. term1 + // precedes term2 alphabetically, and term2 precedes term3. + drupal_static_reset('taxonomy_get_tree'); + drupal_static_reset('taxonomy_get_treeparent'); + drupal_static_reset('taxonomy_get_treeterms'); + list($term1, $term2, $term3) = taxonomy_get_tree($this->vocabulary->vid); + + // Change the order to term2, term3, term1. Emulate the reordering done by + // tabledrag.js by changing the page HTML source. Each term has three hidden + // fields, "tid:1:0[tid]", "tid:1:0[parent]", and "tid:1:0[depth]". The + // order of the input fields in the page is used when the form is processed. + $this->drupalGet('admin/structure/taxonomy/' . $this->vocabulary->vid . '/list'); + $reorder = array( + 'tid:' . $term1->tid . ':0' => 'tid:' . $term2->tid . ':0', + 'tid:' . $term2->tid . ':0' => 'tid:' . $term3->tid . ':0', + 'tid:' . $term3->tid . ':0' => 'tid:' . $term1->tid . ':0', + ); + $this->drupalSetContent(strtr($this->drupalGetContent(), $reorder)); + + // Make term3 a child of term2, and update all hidden fields. + $edit = array( + 'tid:' . $term2->tid . ':0[tid]' => $term2->tid, + 'tid:' . $term2->tid . ':0[parent]' => 0, + 'tid:' . $term2->tid . ':0[depth]' => 0, + 'tid:' . $term3->tid . ':0[tid]' => $term3->tid, + 'tid:' . $term3->tid . ':0[parent]' => $term2->tid, + 'tid:' . $term3->tid . ':0[depth]' => 1, + 'tid:' . $term1->tid . ':0[tid]' => $term1->tid, + 'tid:' . $term1->tid . ':0[parent]' => 0, + 'tid:' . $term1->tid . ':0[depth]' => 0, + ); + $this->drupalPost(NULL, $edit, t('Save')); + + drupal_static_reset('taxonomy_get_tree'); + drupal_static_reset('taxonomy_get_treeparent'); + drupal_static_reset('taxonomy_get_treeterms'); + $terms = taxonomy_get_tree($this->vocabulary->vid); + $this->assertEqual($terms[0]->tid, $term2->tid, t('Term 2 was moved above term 1.')); + $this->assertEqual($terms[1]->parents, array($term2->tid), t('Term 3 was made a child of term 2.')); + $this->assertEqual($terms[2]->tid, $term1->tid, t('Term 1 was moved below term 2.')); + + $this->drupalPost('admin/structure/taxonomy/' . $this->vocabulary->vid . '/list', array(), t('Reset to alphabetical')); + // Submit confirmation form. + $this->drupalPost(NULL, array(), t('Reset to alphabetical')); + + drupal_static_reset('taxonomy_get_tree'); + drupal_static_reset('taxonomy_get_treeparent'); + drupal_static_reset('taxonomy_get_treeterms'); + $terms = taxonomy_get_tree($this->vocabulary->vid); + $this->assertEqual($terms[0]->tid, $term1->tid, t('Term 1 was moved to back above term 2.')); + $this->assertEqual($terms[1]->tid, $term2->tid, t('Term 2 was moved to back below term 1.')); + $this->assertEqual($terms[2]->tid, $term3->tid, t('Term 3 is still below term 2.')); + $this->assertEqual($terms[2]->parents, array($term2->tid), t('Term 3 is still a child of term 2.').var_export($terms[1]->tid,1)); + } + /** * Test taxonomy_get_term_by_name(). */ diff --git a/modules/taxonomy/taxonomy.tokens.inc b/modules/taxonomy/taxonomy.tokens.inc index a532c38..202791d 100644 --- a/modules/taxonomy/taxonomy.tokens.inc +++ b/modules/taxonomy/taxonomy.tokens.inc @@ -1,5 +1,5 @@ TRUE)); + $replacements[$original] = url('taxonomy/term/' . $term, array('absolute' => TRUE)); break; case 'node-count': diff --git a/modules/toolbar/CVS/Entries b/modules/toolbar/CVS/Entries index 99aed2a..e21458b 100644 --- a/modules/toolbar/CVS/Entries +++ b/modules/toolbar/CVS/Entries @@ -2,7 +2,7 @@ /toolbar.info/1.3/Thu Oct 22 14:25:08 2009// /toolbar.install/1.6/Thu Oct 22 14:22:26 2009// /toolbar.js/1.7/Thu Oct 22 14:25:08 2009// -/toolbar.module/1.14/Thu Oct 22 14:25:08 2009// /toolbar.png/1.4/Thu Oct 22 14:25:08 2009/-kb/ /toolbar.tpl.php/1.5/Thu Oct 22 14:25:08 2009// +/toolbar.module/1.16/Tue Oct 27 02:57:02 2009// D diff --git a/modules/toolbar/toolbar.module b/modules/toolbar/toolbar.module index aacb97d..1c49656 100644 --- a/modules/toolbar/toolbar.module +++ b/modules/toolbar/toolbar.module @@ -1,5 +1,5 @@ array('toolbar' => array()), + 'render element' => 'toolbar', 'template' => 'toolbar', 'path' => drupal_get_path('module', 'toolbar'), ); @@ -36,10 +36,22 @@ function toolbar_theme($existing, $type, $theme, $path) { * Add admin toolbar to the page_top region automatically. */ function toolbar_page_build(&$page) { - if (user_access('access toolbar')) { - $page['page_top']['toolbar'] = toolbar_build(); - $page['page_top']['toolbar']['toolbar_drawer'] = isset($page['toolbar_drawer']) ? $page['toolbar_drawer'] : array(); - } + $page['page_top']['toolbar'] = array( + '#pre_render' => array('toolbar_pre_render'), + '#access' => user_access('access toolbar'), + 'toolbar_drawer' => isset($page['toolbar_drawer']) ? $page['toolbar_drawer'] : array(), + ); +} + +/** + * Prerender function for the toolbar. + * + * Since building the toolbar takes some time, it is done just prior to + * rendering to ensure that it is built only if it will be displayed. + */ +function toolbar_pre_render($toolbar) { + $toolbar = array_merge($toolbar, toolbar_build()); + return $toolbar; } /** @@ -85,10 +97,9 @@ function toolbar_build() { '#attributes' => array('id' => 'toolbar-menu'), ); - // Add logout & user account links - $build['toolbar_user'] = array( - '#theme' => 'links', - '#links' => array( + // Add logout & user account links or login link + if ($user->uid) { + $links = array( 'account' => array( 'title' => t('Hello @username', array('@username' => $user->name)), 'href' => 'user', @@ -98,7 +109,19 @@ function toolbar_build() { 'title' => t('Log out'), 'href' => 'user/logout', ), - ), + ); + } + else { + $links = array( + 'login' => array( + 'title' => t('Log in'), + 'href' => 'user', + ), + ); + } + $build['toolbar_user'] = array( + '#theme' => 'links', + '#links' => $links, '#attributes' => array('id' => 'toolbar-user'), ); return $build; diff --git a/modules/trigger/CVS/Entries b/modules/trigger/CVS/Entries index 4a06f19..18adeff 100644 --- a/modules/trigger/CVS/Entries +++ b/modules/trigger/CVS/Entries @@ -3,5 +3,5 @@ D/tests//// /trigger.api.php/1.5/Thu Oct 22 14:22:26 2009// /trigger.info/1.6/Thu Oct 22 14:22:26 2009// /trigger.install/1.14/Thu Oct 22 14:22:26 2009// -/trigger.module/1.50/Thu Oct 22 14:22:26 2009// /trigger.test/1.21/Thu Oct 22 14:25:08 2009// +/trigger.module/1.51/Tue Oct 27 02:57:02 2009// diff --git a/modules/trigger/trigger.module b/modules/trigger/trigger.module index d3d3eef..305cfc5 100644 --- a/modules/trigger/trigger.module +++ b/modules/trigger/trigger.module @@ -1,5 +1,5 @@ array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', 'file' => 'trigger.admin.inc', ), ); diff --git a/modules/update/CVS/Entries b/modules/update/CVS/Entries index 42d26c5..666d5cf 100644 --- a/modules/update/CVS/Entries +++ b/modules/update/CVS/Entries @@ -7,8 +7,8 @@ D/tests//// /update.fetch.inc/1.25/Thu Oct 22 14:22:27 2009// /update.info/1.8/Thu Oct 22 14:25:08 2009// /update.install/1.11/Thu Oct 22 14:22:27 2009// -/update.manager.inc/1.2/Thu Oct 22 00:52:03 2009// -/update.module/1.50/Thu Oct 22 14:25:08 2009// -/update.report.inc/1.26/Thu Oct 22 14:25:08 2009// /update.settings.inc/1.9/Thu Oct 22 14:22:27 2009// /update.test/1.10/Thu Oct 22 14:25:08 2009// +/update.manager.inc/1.5/Tue Oct 27 02:57:02 2009// +/update.module/1.53/Tue Oct 27 02:57:02 2009// +/update.report.inc/1.27/Tue Oct 27 02:57:02 2009// diff --git a/modules/update/update.manager.inc b/modules/update/update.manager.inc index 0f96dbc..613ba2e 100644 --- a/modules/update/update.manager.inc +++ b/modules/update/update.manager.inc @@ -1,5 +1,5 @@ array('update-' . $type)); - // Drupal core and projects which are dev versions with no stable release - // need to be upgraded manually. - $needs_manual = $project['project_type'] == 'core' || ($project['install_type'] == 'dev' && $recommended_release['version_extra'] == 'dev'); + // Drupal core needs to be upgraded manually. + $needs_manual = $project['project_type'] == 'core'; if ($needs_manual) { // Since it won't be tableselect, #weight will add an extra column to the @@ -180,28 +177,18 @@ function update_manager_update_form($form, $form_state = array(), $context) { // appropriate subarray. switch ($project['project_type']) { case 'core': - // Core is always enabled, but need manual updates at this time. - $projects['manual-enabled'][$name] = $entry; + // Core needs manual updates at this time. + $projects['manual'][$name] = $entry; break; case 'module': case 'theme': - if ($needs_manual) { - $projects['manual-enabled'][$name] = $entry; - } - else { - $projects['enabled'][$name] = $entry; - } + $projects['enabled'][$name] = $entry; break; case 'module-disabled': case 'theme-disabled': - if ($needs_manual) { - $projects['manual-disabled'][$name] = $entry; - } - else { - $projects['disabled'][$name] = $entry; - } + $projects['disabled'][$name] = $entry; break; } } @@ -256,28 +243,17 @@ function update_manager_update_form($form, $form_state = array(), $context) { $form['#validate'][] = 'update_manager_update_form_validate'; } - if (!empty($projects['manual-enabled'])) { - $prefix = '

' . t('Add-ons requiring manual updates') . '

'; - $prefix .= '

' . t('Updates of Drupal core or development releases are not supported at this time.') . '

'; + if (!empty($projects['manual'])) { + $prefix = '

' . t('Manual updates required') . '

'; + $prefix .= '

' . t('Updates of Drupal core are not supported at this time.') . '

'; $form['manual_updates'] = array( '#type' => 'markup', - '#markup' => theme('table', array('header' => $headers, 'rows' => $projects['manual-enabled'])), + '#markup' => theme('table', array('header' => $headers, 'rows' => $projects['manual'])), '#prefix' => $prefix, '#weight' => 20, ); } - if (!empty($projects['manual-disabled'])) { - $prefix = '

' . t('Disabled add-ons requiring manual updates') . '

'; - $prefix .= '

' . t('Updates of Drupal core or development releases are not supported at this time.') . '

'; - $form['manual_disabled'] = array( - '#type' => 'markup', - '#markup' => theme('table', array('header' => $headers, 'rows' => $projects['manual-disabled'])), - '#prefix' => $prefix, - '#weight' => 25, - ); - } - return $form; } @@ -462,13 +438,41 @@ function update_manager_confirm_update_form_submit($form, &$form_state) { * @{ */ -function update_manager_install_form(&$form_state) { +/** + * Build the form for the update manager page to install new projects. + * + * This presents a place to enter a URL or upload an archive file to use to + * install a new module or theme. + * + * @param $form + * @param $form_state + * @param $context + * String representing the context from which we're trying to install, can + * be: 'module', 'theme' or 'report'. + * @return + * The form array for selecting which project to install. + */ +function update_manager_install_form($form, &$form_state, $context) { $form = array(); + // Collect all the supported archive file extensions for the UI text. + $extensions = array(); + $archiver_info = archiver_get_info(); + foreach ($archiver_info as $info) { + if (!empty($info['extensions'])) { + $extensions += $info['extensions']; + } + } + $form['help_text'] = array( + '#prefix' => '

', + '#markup' => t('To install a new module or theme, either paste the URL of an archive file you wish to install, or upload the archive file that you have downloaded. You can find modules and themes at http://drupal.org. The following archive extensions are supported: %extensions', array('@module_url' => 'http://drupal.org/project/modules', '@theme_url' => 'http://drupal.org/project/themes', '@drupal_org_url' => 'http://drupal.org', '%extensions' => implode(', ', $extensions))), + '#suffix' => '

', + ); + $form['project_url'] = array( '#type' => 'textfield', '#title' => t('URL'), - '#description' => t('Paste the URL to a Drupal module or theme archive (.tar.gz) to install it. (e.g http://ftp.drupal.org/files/projects/projectname.tar.gz)'), + '#description' => t('Paste the URL to a Drupal module or theme archive to install it (e.g http://ftp.drupal.org/files/projects/projectname.tar.gz).'), ); $form['information'] = array( @@ -480,7 +484,7 @@ function update_manager_install_form(&$form_state) { $form['project_upload'] = array( '#type' => 'file', '#title' => t('Upload a module or theme'), - '#description' => t('Upload a Drupal module or theme (in .tar.gz format) to install it.'), + '#description' => t('Upload a Drupal module or theme archive to install it.'), ); $form['submit'] = array( @@ -498,6 +502,12 @@ function update_manager_install_form_validate($form, &$form_state) { if (!($form_state['values']['project_url'] XOR !empty($_FILES['files']['name']['project_upload']))) { form_set_error('project_url', t('You must either provide a URL or upload an archive file to install.')); } + + if ($form_state['values']['project_url']) { + if (!valid_url($form_state['values']['project_url'], TRUE)) { + form_set_error('project_url', t('The provided URL is invalid.')); + } + } } /** @@ -537,7 +547,7 @@ function update_manager_install_form_submit($form, &$form_state) { return; } - $files = $archive->listContent(); + $files = $archive->listContents(); if (!$files) { form_set_error($field, t('Provided archive contains no files.')); return; @@ -615,21 +625,18 @@ function _update_manager_extract_directory() { * @param string $file * The filename of the archive you wish to extract. * @param string $directory - * The directory you wish to extract the archive info. - * - * @return - * The Archive_Tar class used to extract the archive. + * The directory you wish to extract the archive into. + * @return Archiver + * The Archiver object used to extract the archive. * @throws Exception on failure. - * - * @todo Currently, this is hard-coded to only support .tar.gz. This is an API - * bug, and should be fixed. See http://drupal.org/node/604618. */ function update_manager_archive_extract($file, $directory) { - $archive_tar = new Archive_Tar(drupal_realpath($file)); - if (!$archive_tar->extract($directory)) { - throw new Exception(t('Unable to extract %file', array('%file' => $file))); + $archiver = archiver_get_archiver($file); + if (!$archiver) { + throw new Exception(t('Cannot extract %file, not a valid archive.', array ('%file' => $file))); } - return $archive_tar; + $archiver->extract($directory); + return $archiver; } /** diff --git a/modules/update/update.module b/modules/update/update.module index 56132c9..6297609 100644 --- a/modules/update/update.module +++ b/modules/update/update.module @@ -1,5 +1,5 @@ ' . t('Here you can find information about available updates for your installed modules and themes. Note that each module or theme is part of a "project", which may or may not have the same name, and might include multiple modules or themes within it.') . '

'; - case 'admin/appearance/install': - case 'admin/config/modules/install': - case 'admin/reports/updates/install': - return '

' . t('To install a new module or theme, either upload the .tar.gz file that you have downloaded, or paste the URL of a .tar.gz you wish to install. You can find modules and themes at http://drupal.org.', array('@module_url' => 'http://drupal.org/project/modules', '@theme_url' => 'http://drupal.org/project/themes', '@drupal_org_url' => 'http://drupal.org')) . '

'; - case 'admin/appearance': case 'admin/config/modules': include_once DRUPAL_ROOT . '/includes/install.inc'; @@ -101,8 +96,11 @@ function update_help($path, $arg) { } case 'admin/appearance/update': + case 'admin/appearance/install': case 'admin/config/modules/update': + case 'admin/config/modules/install': case 'admin/reports/updates/update': + case 'admin/reports/updates/install': case 'admin/reports/updates/settings': case 'admin/reports/status': case 'admin/update/confirm': @@ -245,20 +243,20 @@ function update_manager_access() { function update_theme() { return array( 'update_manager_update_form' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'update.manager.inc', ), 'update_last_check' => array( - 'arguments' => array('last' => NULL), + 'variables' => array('last' => NULL), ), 'update_report' => array( - 'arguments' => array('data' => NULL), + 'variables' => array('data' => NULL), ), 'update_version' => array( - 'arguments' => array('version' => NULL, 'tag' => NULL, 'class' => array()), + 'variables' => array('version' => NULL, 'tag' => NULL, 'class' => array()), ), 'update_status_label' => array( - 'arguments' => array('status' => NULL), + 'variables' => array('status' => NULL), ), ); } @@ -373,7 +371,7 @@ function _update_requirement_check($project, $type) { if ($status != UPDATE_CURRENT && $type == 'core' && isset($project['recommended'])) { $requirement_label .= ' ' . t('(version @version available)', array('@version' => $project['recommended'])); } - $requirement['value'] = l($requirement_label, 'admin/reports/updates'); + $requirement['value'] = l($requirement_label, update_manager_access() ? 'admin/reports/updates/update' : 'admin/reports/updates'); return $requirement; } @@ -588,7 +586,9 @@ function update_mail($key, &$message, $params) { $message['body'][] = _update_message_text($msg_type, $msg_reason, FALSE, $language); } $message['body'][] = t('See the available updates page for more information:', array(), array('langcode' => $langcode)) . "\n" . url('admin/reports/updates', array('absolute' => TRUE, 'language' => $language)); - + if (update_manager_access()) { + $message['body'][] = t('You can automatically install your missing updates using the Update manager:', array(), array('langcode' => $langcode)) . "\n" . url('admin/reports/updates/update', array('absolute' => TRUE, 'language' => $language)); + } $settings_url = url('admin/reports/updates/settings', array('absolute' => TRUE)); if (variable_get('update_notification_threshold', 'all') == 'all') { $message['body'][] = t('Your site is currently configured to send these emails when any updates are available. To get notified only for security updates, please visit !url.', array('!url' => $settings_url)); @@ -672,7 +672,12 @@ function _update_message_text($msg_type, $msg_reason, $report_link = FALSE, $lan } if ($report_link) { - $text .= ' ' . t('See the available updates page for more information.', array('@available_updates' => url('admin/reports/updates', array('language' => $language))), array('langcode' => $langcode)); + if (update_manager_access()) { + $text .= ' ' . t('See the available updates page for more information and to install your missing updates.', array('@available_updates' => url('admin/reports/updates/update', array('language' => $language))), array('langcode' => $langcode)); + } + else { + $text .= ' ' . t('See the available updates page for more information.', array('@available_updates' => url('admin/reports/updates', array('language' => $language))), array('langcode' => $langcode)); + } } return $text; diff --git a/modules/update/update.report.inc b/modules/update/update.report.inc index 05ce9c2..be14d93 100644 --- a/modules/update/update.report.inc +++ b/modules/update/update.report.inc @@ -1,5 +1,5 @@ $base_theme)); } } $row .= t('Depends on: !basethemes', array('!basethemes' => implode(', ', $base_themes))); diff --git a/modules/upload/CVS/Entries b/modules/upload/CVS/Entries index d27932b..ef44b3a 100644 --- a/modules/upload/CVS/Entries +++ b/modules/upload/CVS/Entries @@ -3,7 +3,7 @@ /upload.info/1.10/Thu Oct 22 14:22:27 2009// /upload.install/1.16/Thu Oct 22 14:25:09 2009// /upload.js/1.3/Thu Oct 22 14:22:27 2009// -/upload.module/1.265/Thu Oct 22 14:25:09 2009// /upload.test/1.27/Thu Oct 22 14:22:27 2009// /upload.tokens.inc/1.1/Thu Oct 22 14:22:27 2009// +/upload.module/1.266/Tue Oct 27 02:57:02 2009// D diff --git a/modules/upload/upload.module b/modules/upload/upload.module index 1513a7f..892f613 100644 --- a/modules/upload/upload.module +++ b/modules/upload/upload.module @@ -1,5 +1,5 @@ array( - 'arguments' => array('elements' => NULL), + 'render element' => 'elements', ), 'upload_form_current' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), 'upload_form_new' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), ); } diff --git a/modules/user/CVS/Entries b/modules/user/CVS/Entries index 47edbe2..3c8a12a 100644 --- a/modules/user/CVS/Entries +++ b/modules/user/CVS/Entries @@ -9,9 +9,9 @@ /user.info/1.12/Thu Oct 22 14:22:27 2009// /user.install/1.31/Thu Oct 22 14:25:09 2009// /user.js/1.19/Thu Oct 22 14:25:09 2009// -/user.module/1.1072/Thu Oct 22 14:25:09 2009// /user.pages.inc/1.61/Thu Oct 22 14:25:09 2009// /user.permissions.js/1.1/Thu Oct 22 14:22:27 2009// /user.test/1.65/Thu Oct 22 14:25:09 2009// /user.tokens.inc/1.2/Thu Oct 22 14:22:27 2009// +/user.module/1.1073/Tue Oct 27 02:57:02 2009// D diff --git a/modules/user/user.module b/modules/user/user.module index 5e076fa..be43b4c 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -1,5 +1,5 @@ array( - 'arguments' => array('account' => NULL), + 'variables' => array('account' => NULL), 'template' => 'user-picture', ), 'user_profile' => array( - 'arguments' => array('elements' => NULL), + 'render element' => 'elements', 'template' => 'user-profile', 'file' => 'user.pages.inc', ), 'user_profile_category' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', 'template' => 'user-profile-category', 'file' => 'user.pages.inc', ), 'user_profile_item' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', 'template' => 'user-profile-item', 'file' => 'user.pages.inc', ), 'user_list' => array( - 'arguments' => array('users' => NULL, 'title' => NULL), + 'variables' => array('users' => NULL, 'title' => NULL), ), 'user_admin_permissions' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'user.admin.inc', ), 'user_admin_new_role' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'user.admin.inc', ), 'user_filter_form' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'user.admin.inc', ), 'user_filters' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'user.admin.inc', ), 'user_signature' => array( - 'arguments' => array('signature' => NULL), + 'variables' => array('signature' => NULL), ), ); } diff --git a/profiles/default/CVS/Entries b/profiles/default/CVS/Entries index 4032638..1d83439 100644 --- a/profiles/default/CVS/Entries +++ b/profiles/default/CVS/Entries @@ -1,4 +1,4 @@ /default.profile/1.63/Thu Sep 3 08:50:38 2009// -/default.info/1.5/Tue Oct 13 15:14:16 2009// -/default.install/1.11/Wed Oct 14 23:34:21 2009// +/default.info/1.7/Tue Oct 27 02:57:02 2009// +/default.install/1.16/Tue Oct 27 02:57:02 2009// D diff --git a/profiles/default/default.info b/profiles/default/default.info index c5ddd17..cf29d15 100644 --- a/profiles/default/default.info +++ b/profiles/default/default.info @@ -1,4 +1,4 @@ -; $Id: default.info,v 1.5 2009/10/13 13:54:55 dries Exp $ +; $Id: default.info,v 1.7 2009/10/19 18:28:16 dries Exp $ name = Drupal description = Create a Drupal site with the most commonly used features pre-installed. version = VERSION @@ -14,7 +14,9 @@ dependencies[] = path dependencies[] = taxonomy dependencies[] = dblog dependencies[] = search +dependencies[] = shortcut dependencies[] = toolbar dependencies[] = field_ui dependencies[] = file +dependencies[] = rdf files[] = default.profile diff --git a/profiles/default/default.install b/profiles/default/default.install index 0c9c43b..d8265fe 100644 --- a/profiles/default/default.install +++ b/profiles/default/default.install @@ -1,5 +1,5 @@ 'node', + 'bundle' => 'page', + 'mapping' => array( + 'rdftype' => array('foaf:Document'), + ), + ), + array( + 'type' => 'node', + 'bundle' => 'article', + 'mapping' => array( + 'rdftype' => array('sioc:Item', 'foaf:Document'), + ), + ), + ); + foreach ($rdf_mappings as $rdf_mapping) { + rdf_mapping_save($rdf_mapping); + } + // Default page to not be promoted and have comments disabled. variable_set('node_options_page', array('status')); variable_set('comment_page', COMMENT_NODE_HIDDEN); @@ -173,16 +194,6 @@ function default_install() { // Don't display date and author information for page nodes by default. variable_set('node_submitted_page', FALSE); - // Create an image style. - $style = array('name' => 'thumbnail'); - $style = image_style_save($style); - $effect = array( - 'isid' => $style['isid'], - 'name' => 'image_scale_and_crop', - 'data' => array('width' => '85', 'height' => '85'), - ); - image_effect_save($effect); - // Enable user picture support and set the default to a square thumbnail option. variable_set('user_pictures', '1'); variable_set('user_picture_dimensions', '1024x1024'); @@ -202,6 +213,7 @@ function default_install() { taxonomy_vocabulary_save($vocabulary); $instance = array( 'field_name' => 'taxonomy_' . $vocabulary->machine_name, + 'object_type' => 'node', 'label' => $vocabulary->name, 'bundle' => 'article', 'description' => $vocabulary->help, diff --git a/sites/default/CVS/Entries b/sites/default/CVS/Entries index 39a763f..c8aa359 100644 --- a/sites/default/CVS/Entries +++ b/sites/default/CVS/Entries @@ -1,2 +1,2 @@ -/default.settings.php/1.32/Mon Oct 12 23:25:06 2009// +/default.settings.php/1.33/Tue Oct 27 02:57:02 2009// D diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php index 6040a87..005abb5 100644 --- a/sites/default/default.settings.php +++ b/sites/default/default.settings.php @@ -1,5 +1,5 @@
> + + + + subject)): ?>

>subject ?>

-
+
>
diff --git a/themes/garland/comment.tpl.php b/themes/garland/comment.tpl.php index 45955df..95a7298 100644 --- a/themes/garland/comment.tpl.php +++ b/themes/garland/comment.tpl.php @@ -1,10 +1,14 @@
>
+ + + + @@ -15,7 +19,7 @@ > -
+
>
diff --git a/themes/garland/node.tpl.php b/themes/garland/node.tpl.php index e4fdd86..1e0fa6f 100644 --- a/themes/garland/node.tpl.php +++ b/themes/garland/node.tpl.php @@ -1,8 +1,12 @@
> + + + + @@ -13,7 +17,7 @@ -
+
>

+
diff --git a/themes/seven/reset.css b/themes/seven/reset.css index 4298375..741b79c 100644 --- a/themes/seven/reset.css +++ b/themes/seven/reset.css @@ -1,4 +1,4 @@ -/* $Id: reset.css,v 1.1 2009/07/31 19:35:57 dries Exp $ */ +/* $Id: reset.css,v 1.2 2009/10/15 20:33:46 dries Exp $ */ /** * Reset CSS styles. @@ -150,7 +150,6 @@ ul.secondary a.active, vertical-align: baseline; background: transparent; line-height: inherit; - text-align: left; } diff --git a/themes/seven/style.css b/themes/seven/style.css index 9899f4b..a3953a9 100644 --- a/themes/seven/style.css +++ b/themes/seven/style.css @@ -1,4 +1,4 @@ -/* $Id: style.css,v 1.18 2009/09/11 13:48:44 dries Exp $ */ +/* $Id: style.css,v 1.20 2009/10/18 04:35:30 webchick Exp $ */ /** * Generic elements @@ -111,9 +111,9 @@ legend { } /** - * Console. + * Messages. */ -#console div.messages { +div.messages { padding: 9px; margin: 1em 0; color: #036; @@ -121,19 +121,19 @@ legend { border: 1px solid #ace; } -#console div.warning { +div.warning { color: #840; background: #fe6; border-color: #ed5; } -#console div.error { +div.error { color: #fff; background: #e63; border-color: #d52; } -#console div.status { +div.status { color: #360; background: #cf8; border-color: #be7; @@ -735,3 +735,10 @@ body.overlay #page { body.overlay #block-system-main { padding: 20px; } + +/* Shortcut theming */ +div.add-to-shortcuts { + float: left; + margin-left: 6px; + margin-top: 6px; +} diff --git a/update.php b/update.php index 68b1105..4a1275c 100644 --- a/update.php +++ b/update.php @@ -1,5 +1,5 @@ $output, 'show_messages' => !$progress_page));