From f272258697f4858d2e44ace7f664cba619c28ee4 Mon Sep 17 00:00:00 2001
From: Benjamin Doherty
-
+
-
+
@@ -81,8 +81,8 @@
-
-
+
+
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')) . '
' . 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('Updates of Drupal core or development releases are not supported at this time.') . '
'; + if (!empty($projects['manual'])) { + $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('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 @@