';
}
/**
* Preprocess variables for theme_username().
*
- * Modules that make any changes to the $variables['object'] properties like
- * 'name' or 'extra' must insure that the final string is safe to include
- * directly in the ouput by using check_plain() or filter_xss().
+ * Modules that make any changes to variables like 'name' or 'extra' must insure
+ * that the final string is safe to include directly in the ouput by using
+ * check_plain() or filter_xss().
*
* @see theme_username().
*/
function template_preprocess_username(&$variables) {
- $account = $variables['object'];
- // Create a new empty object to populate with standardized data.
- $variables['object'] = new stdClass;
- // Keep a reference to the original data.
- $variables['object']->account = $account;
- $variables['object']->extra = '';
+ $account = $variables['account'];
+
+ $variables['extra'] = '';
if (empty($account->uid)) {
- $variables['object']->uid = 0;
- if (theme_get_setting('toggle_comment_user_verification')) {
- $variables['object']->extra = ' (' . t('not verified') . ')';
- }
+ $variables['uid'] = 0;
+ if (theme_get_setting('toggle_comment_user_verification')) {
+ $variables['extra'] = ' (' . t('not verified') . ')';
+ }
}
else {
- $variables['object']->uid = (int)$account->uid;
+ $variables['uid'] = (int)$account->uid;
}
if (empty($account->name)) {
- $variables['object']->name = variable_get('anonymous', t('Anonymous'));
+ $variables['name'] = variable_get('anonymous', t('Anonymous'));
}
else {
- $variables['object']->name = $account->name;
+ $variables['name'] = $account->name;
}
- $variables['object']->profile_access = user_access('access user profiles');
- $variables['object']->link_attributes = array();
+ $variables['profile_access'] = user_access('access user profiles');
+ $variables['link_attributes'] = array();
// Populate link path and attributes if appropriate.
- if ($variables['object']->uid && $variables['object']->profile_access) {
+ if ($variables['uid'] && $variables['profile_access']) {
// We are linking to a local user.
- $variables['object']->link_attributes = array('title' => t('View user profile.'));
- $variables['object']->link_path = 'user/' . $variables['object']->uid;
+ $variables['link_attributes'] = array('title' => t('View user profile.'));
+ $variables['link_path'] = 'user/' . $variables['uid'];
}
elseif (!empty($account->homepage)) {
- $variables['object']->link_attributes = array('rel' => 'nofollow');
- $variables['object']->link_path = $account->homepage;
- $variables['object']->homepage = $account->homepage;
+ $variables['link_attributes'] = array('rel' => 'nofollow');
+ $variables['link_path'] = $account->homepage;
+ $variables['homepage'] = $account->homepage;
}
// We do not want the l() function to check_plain() a second time.
- $variables['object']->link_options['html'] = TRUE;
+ $variables['link_options']['html'] = TRUE;
// Set a default class.
- $variables['object']->attributes = array('class' => array('username'));
+ $variables['attributes_array'] = array('class' => array('username'));
// Shorten the name when it is too long or it will break many tables.
- if (drupal_strlen($variables['object']->name) > 20) {
- $variables['object']->name = drupal_substr($variables['object']->name, 0, 15) . '...';
+ if (drupal_strlen($variables['name']) > 20) {
+ $variables['name'] = drupal_substr($variables['name'], 0, 15) . '...';
}
// Make sure name is safe for use in the theme function.
- $variables['object']->name = check_plain($variables['object']->name);
+ $variables['name'] = check_plain($variables['name']);
}
/**
@@ -1926,8 +1908,8 @@ function template_process_username(&$var
// Finalize the link_options array for passing to the l() function.
// This is done in the process phase so that attributes may be added by
// modules or the theme during the preprocess phase.
- if (isset($variables['object']->link_path)) {
- $variables['object']->link_options['attributes'] = $variables['object']->link_attributes + $variables['object']->attributes;
+ if (isset($variables['link_path'])) {
+ $variables['link_options']['attributes'] = $variables['link_attributes'] + $variables['attributes_array'];
}
}
@@ -1946,18 +1928,18 @@ function template_process_username(&$var
* @see template_preprocess_username()
* @see template_process_username()
*/
-function theme_username($object) {
- if (isset($object->link_path)) {
+function theme_username($variables) {
+ if (isset($variables['link_path'])) {
// We have a link path, so we should generate a link using l().
// Additional classes may be added as array elements like
- // $object->link_options['attributes']['class'][] = 'myclass';
- $output = l($object->name . $object->extra, $object->link_path, $object->link_options);
+ // $variables['link_options']['attributes']['class'][] = 'myclass';
+ $output = l($variables['name'] . $variables['extra'], $variables['link_path'], $variables['link_options']);
}
else {
// Modules may have added important attributes so they must be included
// in the output. Additional classes may be added as array elements like
- // $object->attributes['class'][] = 'myclass';
- $output = 'attributes) . '>' . $object->name . $object->extra . '';
+ // $variables['attributes_array']['class'][] = 'myclass';
+ $output = '' . $variables['name'] . $variables['extra'] . '';
}
return $output;
}
@@ -1972,11 +1954,11 @@ function theme_username($object) {
* @return
* A themed HTML string representing the progress bar.
*/
-function theme_progress_bar($percent, $message) {
+function theme_progress_bar($variables) {
$output = '
';
$output .= '';
@@ -118,11 +119,9 @@ function theme_task_list($items, $active
* @param $content
* The page content to show.
*/
-function theme_install_page($content) {
+function theme_install_page($variables) {
drupal_set_header('Content-Type', 'text/html; charset=utf-8');
- // Assign content.
- $variables['content'] = $content;
// Delay setting the message variable so it can be processed below.
$variables['show_messages'] = FALSE;
// Variable processors invoked manually since this function and theme_update_page()
@@ -136,7 +135,7 @@ function theme_install_page($content) {
if (isset($messages['error'])) {
$title = count($messages['error']) > 1 ? st('The following errors must be resolved before you can continue the installation process') : st('The following error must be resolved before you can continue the installation process');
$variables['messages'] .= '
' . st('Please check the error messages and try again.', array('!url' => request_uri())) . '
';
}
@@ -144,14 +143,14 @@ function theme_install_page($content) {
if (isset($messages['warning'])) {
$title = count($messages['warning']) > 1 ? st('The following installation warnings should be carefully reviewed') : st('The following installation warning should be carefully reviewed');
$variables['messages'] .= '
' . $title . ':
';
- $variables['messages'] .= theme('status_messages', 'warning');
+ $variables['messages'] .= theme('status_messages', array('display' => 'warning'));
}
// Special handling of status messages
if (isset($messages['status'])) {
$title = count($messages['status']) > 1 ? st('The following installation warnings should be carefully reviewed, but in most cases may be safely ignored') : st('The following installation warning should be carefully reviewed, but in most cases may be safely ignored');
$variables['messages'] .= '
' . $title . ':
';
- $variables['messages'] .= theme('status_messages', 'status');
+ $variables['messages'] .= theme('status_messages', array('display' => 'status'));
}
// This was called as a theme hook (not template), so we need to
@@ -174,13 +173,10 @@ function theme_install_page($content) {
* Whether to output status and error messages.
* FALSE can be useful to postpone the messages to a subsequent page.
*/
-function theme_update_page($content, $show_messages = TRUE) {
+function theme_update_page($variables) {
// Set required headers.
drupal_set_header('Content-Type', 'text/html; charset=utf-8');
- // Assign content and show message flag.
- $variables['content'] = $content;
- $variables['show_messages'] = $show_messages;
// Variable processors invoked manually since this function and theme_install_page()
// are exceptions in how it works within the theme system.
template_preprocess($variables, 'update_page');
@@ -192,7 +188,7 @@ function theme_update_page($content, $sh
if (isset($messages['warning'])) {
$title = count($messages['warning']) > 1 ? 'The following update warnings should be carefully reviewed before continuing' : 'The following update warning should be carefully reviewed before continuing';
$variables['messages'] .= '
';
Index: modules/field/modules/list/list.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/modules/list/list.module,v
retrieving revision 1.15
diff -u -p -r1.15 list.module
--- modules/field/modules/list/list.module 26 Sep 2009 15:57:38 -0000 1.15
+++ modules/field/modules/list/list.module 28 Sep 2009 22:42:42 -0000
@@ -263,7 +263,8 @@ function list_field_formatter_info() {
/**
* Theme function for 'default' list field formatter.
*/
-function theme_field_formatter_list_default($element) {
+function theme_field_formatter_list_default($variables) {
+ $element = $variables['element'];
$field = field_info_field($element['#field_name']);
if (($allowed_values = list_allowed_values($field)) && isset($allowed_values[$element['#item']['value']])) {
return $allowed_values[$element['#item']['value']];
@@ -275,6 +276,7 @@ function theme_field_formatter_list_defa
/**
* Theme function for 'key' list field formatter.
*/
-function theme_field_formatter_list_key($element) {
+function theme_field_formatter_list_key($variables) {
+ $element = $variables['element'];
return $element['#item']['safe'];
}
Index: modules/field/modules/number/number.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/modules/number/number.module,v
retrieving revision 1.20
diff -u -p -r1.20 number.module
--- modules/field/modules/number/number.module 27 Sep 2009 11:12:15 -0000 1.20
+++ modules/field/modules/number/number.module 28 Sep 2009 22:42:42 -0000
@@ -242,14 +242,16 @@ function number_field_formatter_info() {
/**
* Theme function for 'unformatted' number field formatter.
*/
-function theme_field_formatter_number_unformatted($element) {
+function theme_field_formatter_number_unformatted($variables) {
+ $element = $variables['element'];
return $element['#item']['value'];
}
/**
* Proxy theme function for number field formatters.
*/
-function theme_field_formatter_number($element) {
+function theme_field_formatter_number($variables) {
+ $element = $variables['element'];
$field = field_info_field($element['#field_name']);
$instance = field_info_instance($element['#field_name'], $element['#bundle']);
$value = $element['#item']['value'];
@@ -499,6 +501,7 @@ function number_decimal_validate($elemen
* $element['#field_name'] contains the field name
* $element['#delta] is the position of this element in the group
*/
-function theme_number($element) {
+function theme_number($variables) {
+ $element = $variables['element'];
return $element['#children'];
}
Index: modules/field/modules/options/options.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/modules/options/options.module,v
retrieving revision 1.10
diff -u -p -r1.10 options.module
--- modules/field/modules/options/options.module 10 Sep 2009 06:31:38 -0000 1.10
+++ modules/field/modules/options/options.module 28 Sep 2009 22:42:42 -0000
@@ -21,7 +21,7 @@ function options_theme() {
'arguments' => array('element' => NULL),
),
'options_none' => array(
- 'arguments' => array('widget_type' => NULL, 'field_name' => NULL, 'node_type' => NULL),
+ 'arguments' => array('instance' => NULL),
),
);
}
@@ -375,7 +375,7 @@ function options_options($field, $instan
if (!$instance['required']) {
if ((in_array($instance['widget']['type'], array('options_buttons', 'node_reference_buttons', 'user_reference_buttons')) && !$field['cardinality'])
|| (in_array($instance['widget']['type'], array('options_select', 'node_reference_select', 'user_reference_select')))) {
- $options = array('' => theme('options_none', $instance)) + $options;
+ $options = array('' => theme('options_none', array('instance' => $instance))) + $options;
}
}
return $options;
@@ -385,7 +385,8 @@ function options_options($field, $instan
* Theme the label for the empty value for options that are not required.
* The default theme will display N/A for a radio list and blank for a select.
*/
-function theme_options_none($instance) {
+function theme_options_none($variables) {
+ $instance = $variables['instance'];
switch ($instance['widget']['type']) {
case 'options_buttons':
case 'node_reference_buttons':
@@ -411,14 +412,17 @@ function theme_options_none($instance) {
* $element['#field_name'] contains the field name
* $element['#delta] is the position of this element in the group
*/
-function theme_options_select($element) {
+function theme_options_select($variables) {
+ $element = $variables['element'];
return $element['#children'];
}
-function theme_options_onoff($element) {
+function theme_options_onoff($variables) {
+ $element = $variables['element'];
return $element['#children'];
}
-function theme_options_buttons($element) {
+function theme_options_buttons($variables) {
+ $element = $variables['element'];
return $element['#children'];
}
\ No newline at end of file
Index: modules/field/modules/text/text.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/modules/text/text.module,v
retrieving revision 1.30
diff -u -p -r1.30 text.module
--- modules/field/modules/text/text.module 26 Sep 2009 15:57:38 -0000 1.30
+++ modules/field/modules/text/text.module 28 Sep 2009 22:42:42 -0000
@@ -299,21 +299,24 @@ function text_field_formatter_info() {
/**
* Theme function for 'default' text field formatter.
*/
-function theme_field_formatter_text_default($element) {
+function theme_field_formatter_text_default($variables) {
+ $element = $variables['element'];
return $element['#item']['safe'];
}
/**
* Theme function for 'plain' text field formatter.
*/
-function theme_field_formatter_text_plain($element) {
+function theme_field_formatter_text_plain($variables) {
+ $element = $variables['element'];
return strip_tags($element['#item']['safe']);
}
/**
* Theme function for 'trimmed' text field formatter.
*/
-function theme_field_formatter_text_trimmed($element) {
+function theme_field_formatter_text_trimmed($variables) {
+ $element = $variables['element'];
$field = field_info_field($element['#field_name']);
$instance = field_info_instance($element['#field_name'], $element['#bundle']);
return text_summary($element['#item']['safe'], $instance['settings']['text_processing'] ? $element['#item']['format'] : NULL);
@@ -325,7 +328,8 @@ function theme_field_formatter_text_trim
* element of the field or, if the summary is empty, the trimmed
* version of the full element of the field.
*/
-function theme_field_formatter_text_summary_or_trimmed($element) {
+function theme_field_formatter_text_summary_or_trimmed($variables) {
+ $element = $variables['element'];
$field = field_info_field($element['#field_name']);
$instance = field_info_instance($element['#field_name'], $element['#bundle']);
@@ -780,10 +784,12 @@ function text_field_widget_formatted_tex
* $element['#field_name'] contains the field name
* $element['#delta] is the position of this element in the group
*/
-function theme_text_textfield($element) {
+function theme_text_textfield($variables) {
+ $element = $variables['element'];
return $element['#children'];
}
-function theme_text_textarea($element) {
+function theme_text_textarea($variables) {
+ $element = $variables['element'];
return $element['#children'];
}
Index: modules/field_ui/field_ui.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/field_ui/field_ui.admin.inc,v
retrieving revision 1.17
diff -u -p -r1.17 field_ui.admin.inc
--- modules/field_ui/field_ui.admin.inc 26 Sep 2009 15:57:38 -0000 1.17
+++ modules/field_ui/field_ui.admin.inc 28 Sep 2009 22:42:42 -0000
@@ -34,7 +34,7 @@ function field_ui_fields_list() {
else {
// Sort rows by field name.
ksort($rows);
- $output = theme('table', $header, $rows);
+ $output = theme('table', array('header' => $header, 'rows' => $rows));
}
return $output;
}
@@ -56,7 +56,7 @@ function field_ui_inactive_message($bund
'%widget_module' => $instance['widget']['module'],
));
}
- drupal_set_message(t('Inactive fields are not shown unless their providing modules are enabled. The following fields are not enabled: !list', array('!list' => theme('item_list', $list))), 'error');
+ drupal_set_message(t('Inactive fields are not shown unless their providing modules are enabled. The following fields are not enabled: !list', array('!list' => theme('item_list', array('items' => $list)))), 'error');
}
}
@@ -831,7 +831,7 @@ function field_ui_field_settings_form($f
'#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
Index: modules/file/file.field.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/file/file.field.inc,v
retrieving revision 1.4
diff -u -p -r1.4 file.field.inc
--- modules/file/file.field.inc 26 Sep 2009 15:57:38 -0000 1.4
+++ modules/file/file.field.inc 28 Sep 2009 22:42:42 -0000
@@ -523,7 +523,7 @@ function file_field_widget(&$form, &$for
// If there's only one field, return it as delta 0.
$element['#title'] = $instance['label'];
if (empty($element['#default_value']['fid'])) {
- $element['#description'] = theme('file_upload_help', $instance['description'], $element['#upload_validators']);
+ $element['#description'] = theme('file_upload_help', array('description' => $instance['description'], 'upload_validators' => $element['#upload_validators']));
}
$elements = array($element);
}
@@ -557,7 +557,7 @@ function file_field_widget(&$form, &$for
// field. These are added here so that they may be referenced easily through
// a hook_form_alter().
$elements['#file_upload_title'] = t('Add a new file');
- $elements['#file_upload_description'] = theme('file_upload_help', '', $elements[0]['#upload_validators']);
+ $elements['#file_upload_description'] = theme('file_upload_help', array('description' => '', 'upload_validators' => $elements[0]['#upload_validators']));
}
return $elements;
@@ -746,7 +746,10 @@ function file_field_widget_process_multi
/**
* Theme an individual file upload widget.
*/
-function theme_file_widget($element) {
+function theme_file_widget($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
$output = '';
// The "form-managed-file" class is required for proper AJAX functionality.
$output .= '
';
@@ -763,7 +766,10 @@ function theme_file_widget($element) {
/**
* Theme a group of file upload widgets.
*/
-function theme_file_widget_multiple($element) {
+function theme_file_widget_multiple($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
$field = field_info_field($element['#field_name']);
// Get our list of widgets in order.
@@ -840,7 +846,7 @@ function theme_file_widget_multiple($ele
drupal_add_tabledrag($table_id, 'order', 'sibling', $weight_class);
$output = '';
- $output = empty($rows) ? '' : theme('table', $headers, $rows, array('id' => $table_id));
+ $output = empty($rows) ? '' : theme('table', array('header' => $headers, 'rows' => $rows, 'attributes' => array('id' => $table_id)));
$output .= drupal_render_children($element);
return $output;
}
@@ -855,7 +861,10 @@ function theme_file_widget_multiple($ele
* @return
* A string suitable for a file field description.
*/
-function theme_file_upload_help($description, $upload_validators) {
+function theme_file_upload_help($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
$descriptions = array();
if (strlen($description)) {
@@ -890,29 +899,38 @@ function theme_file_upload_help($descrip
/**
* Theme function for 'default' file field formatter.
*/
-function theme_field_formatter_file_default($element) {
- return theme('file_link', (object) $element['#item']);
+function theme_field_formatter_file_default($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
+ return theme('file_link', array('file' => (object) $element['#item']));
}
/**
* Theme function for 'url_plain' file field formatter.
*/
-function theme_field_formatter_file_url_plain($element) {
+function theme_field_formatter_file_url_plain($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
return empty($element['#item']['uri']) ? '' : file_create_url($element['#item']['uri']);
}
/**
* Theme function for the 'table' formatter.
*/
-function theme_field_formatter_file_table($element) {
+function theme_field_formatter_file_table($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
$header = array(t('Attachment'), t('Size'));
$rows = array();
foreach (element_children($element) as $key) {
$rows[] = array(
- theme('file_link', (object) $element[$key]['#item']),
+ theme('file_link', array('file' => (object) $element[$key]['#item'])),
format_size($element[$key]['#item']['filesize']),
);
}
- return empty($rows) ? '' : theme('table', $header, $rows);
+ return empty($rows) ? '' : theme('table', array('header' => $header, 'rows' => $rows));
}
Index: modules/file/file.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/file/file.module,v
retrieving revision 1.4
diff -u -p -r1.4 file.module
--- modules/file/file.module 10 Sep 2009 06:31:39 -0000 1.4
+++ modules/file/file.module 28 Sep 2009 22:42:42 -0000
@@ -80,7 +80,7 @@ function file_theme() {
'arguments' => array('element' => NULL),
),
'file_upload_help' => array(
- 'arguments' => array('upload_validators' => NULL),
+ 'arguments' => array('description' => NULL, 'upload_validators' => NULL),
),
);
}
@@ -413,7 +413,7 @@ function file_managed_file_process($elem
if ($fid && $element['#file']) {
$element['filename'] = array(
'#type' => 'markup',
- '#markup' => theme('file_link', $element['#file']) . ' ',
+ '#markup' => theme('file_link', array('file' => $element['#file'])) . ' ',
'#weight' => -10,
);
}
@@ -577,7 +577,10 @@ function file_managed_file_save_upload($
/**
* Theme a managed file element.
*/
-function theme_file_managed_file($element) {
+function theme_file_managed_file($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
// This wrapper is required to apply JS behaviors and CSS styling.
$output = '';
$output .= '
';
@@ -592,9 +595,12 @@ function theme_file_managed_file($elemen
* @param $file
* A file object to which the link will be created.
*/
-function theme_file_link($file) {
+function theme_file_link($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
$url = file_create_url($file->uri);
- $icon = theme('file_icon', $file);
+ $icon = theme('file_icon', array('file' => $file));
// Set options as per anchor format described at
// http://microformats.org/wiki/file-format-examples
@@ -622,7 +628,10 @@ function theme_file_link($file) {
* @param $file
* A file object for which to make an icon.
*/
-function theme_file_icon($file) {
+function theme_file_icon($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
$mime = check_plain($file->filemime);
$icon_url = file_icon_url($file);
return '';
Index: modules/file/tests/file.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/file/tests/file.test,v
retrieving revision 1.2
diff -u -p -r1.2 file.test
--- modules/file/tests/file.test 20 Sep 2009 17:40:41 -0000 1.2
+++ modules/file/tests/file.test 28 Sep 2009 22:42:42 -0000
@@ -304,7 +304,7 @@ class FileFieldDisplayTestCase extends F
// Check that the default formatter is displaying with the file name.
$node = node_load($nid, NULL, TRUE);
$node_file = (object) $node->{$field_name}[FIELD_LANGUAGE_NONE][0];
- $default_output = theme('file_link', $node_file);
+ $default_output = theme('file_link', array('file' => $node_file));
$this->assertRaw($default_output, t('Default formatter displaying correctly on full node view.'));
// Turn the "display" option off and check that the file is no longer displayed.
@@ -531,7 +531,7 @@ class FileFieldPathTestCase extends File
/**
* A loose assertion to check that a file is uploaded to the right location.
- *
+ *
* @param $expected_path
* The location where the file is expected to be uploaded. Duplicate file
* names to not need to be taken into account.
Index: modules/filter/filter.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.admin.inc,v
retrieving revision 1.47
diff -u -p -r1.47 filter.admin.inc
--- modules/filter/filter.admin.inc 25 Sep 2009 14:06:09 -0000 1.47
+++ modules/filter/filter.admin.inc 28 Sep 2009 22:42:42 -0000
@@ -23,8 +23,8 @@ function filter_admin_overview($form) {
// to all roles and cannot be deleted via the admin interface.
$form['formats'][$id]['#is_fallback'] = ($id == $fallback_format);
if ($form['formats'][$id]['#is_fallback']) {
- $form['formats'][$id]['name'] = array('#markup' => theme('placeholder', $format->name));
- $roles_markup = theme('placeholder', t('All roles may use this format'));
+ $form['formats'][$id]['name'] = array('#markup' => theme('placeholder', array('text' => $format->name)));
+ $roles_markup = theme('placeholder', array('text' => t('All roles may use this format')));
}
else {
$form['formats'][$id]['name'] = array('#markup' => check_plain($format->name));
@@ -59,7 +59,10 @@ function filter_admin_overview_submit($f
*
* @ingroup themeable
*/
-function theme_filter_admin_overview($form) {
+function theme_filter_admin_overview($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
$rows = array();
foreach (element_children($form['formats']) as $id) {
$form['formats'][$id]['weight']['#attributes']['class'] = array('text-format-order-weight');
@@ -75,7 +78,7 @@ function theme_filter_admin_overview($fo
);
}
$header = array(t('Name'), t('Roles'), t('Weight'), array('data' => t('Operations'), 'colspan' => 2));
- $output = theme('table', $header, $rows, array('id' => 'text-format-order'));
+ $output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'text-format-order')));
$output .= drupal_render_children($form);
drupal_add_tabledrag('text-format-order', 'order', 'sibling', 'text-format-order-weight');
@@ -153,7 +156,7 @@ function filter_admin_format_form($form,
// Composition tips (guidelines)
$tips = _filter_tips($format->format, FALSE);
- $tiplist = theme('filter_tips', $tips, FALSE);
+ $tiplist = theme('filter_tips', array('tips' => $tips, 'long' => FALSE));
if (!$tiplist) {
$tiplist = '
' . t('No guidelines available.') . '
';
}
@@ -342,7 +345,10 @@ function filter_admin_order($form, &$for
*
* @ingroup themeable
*/
-function theme_filter_admin_order($form) {
+function theme_filter_admin_order($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
$header = array(t('Name'), t('Weight'));
$rows = array();
foreach (element_children($form['names']) as $id) {
@@ -356,7 +362,7 @@ function theme_filter_admin_order($form)
}
}
- $output = theme('table', $header, $rows, array('id' => 'filter-order'));
+ $output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'filter-order')));
$output .= drupal_render_children($form);
drupal_add_tabledrag('filter-order', 'order', 'sibling', 'filter-order-weight', NULL, NULL, FALSE);
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.291
diff -u -p -r1.291 filter.module
--- modules/filter/filter.module 20 Sep 2009 07:32:18 -0000 1.291
+++ modules/filter/filter.module 28 Sep 2009 22:42:42 -0000
@@ -265,7 +265,7 @@ function filter_permission() {
if (!empty($permission)) {
// Only link to the text format configuration page if the user who is
// viewing this will have access to that page.
- $format_name_replacement = user_access('administer filters') ? l($format->name, 'admin/config/content/formats/' . $format->format) : theme('placeholder', $format->name);
+ $format_name_replacement = user_access('administer filters') ? l($format->name, 'admin/config/content/formats/' . $format->format) : theme('placeholder', array('text' => $format->name));
$perms[$permission] = array(
'title' => t("Use the %text_format text format", array('%text_format' => $format->name)),
'description' => t('Use !text_format in forms when entering or editing content. %warning', array('!text_format' => $format_name_replacement, '%warning' => t('Warning: This permission may have security implications depending on how the text format is configured.'))),
@@ -371,7 +371,7 @@ function _filter_html_tips($filter, $for
);
}
}
- $output .= theme('table', $header, $rows);
+ $output .= theme('table', array('header' => $header, 'rows' => $rows));
$output .= '
' . t('Most unusual characters can be directly entered without any problems.') . '
';
$output .= '
' . t('If you do encounter problems, try using HTML character entities. A common example looks like & for an ampersand & character. For a full list of entities see HTML\'s entities page. Some of the available characters include:', array('@html-entities' => 'http://www.w3.org/TR/html4/sgml/entities.html')) . '
'; // End preview-image.
@@ -718,7 +727,10 @@ function theme_image_style_preview($styl
* A Form API element containing radio buttons.
* @ingroup themeable
*/
-function theme_image_anchor($element) {
+function theme_image_anchor($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
$rows = array();
$row = array();
foreach (element_children($element) as $n => $key) {
@@ -731,7 +743,7 @@ function theme_image_anchor($element) {
}
}
- return theme('table', array(), $rows, array('class' => array('image-anchor')));
+ return theme('table', array('header' => array(), 'rows' => $rows, 'attributes' => array('class' => array('image-anchor'))));
}
/**
@@ -741,7 +753,10 @@ function theme_image_anchor($element) {
* The current configuration for this resize effect.
* @ingroup themeable
*/
-function theme_image_resize_summary($data) {
+function theme_image_resize_summary($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
if ($data['width'] && $data['height']) {
return check_plain($data['width']) . 'x' . check_plain($data['height']);
}
@@ -757,8 +772,11 @@ function theme_image_resize_summary($dat
* The current configuration for this scale effect.
* @ingroup themeable
*/
-function theme_image_scale_summary($data) {
- return theme('image_resize_summary', $data) . ' ' . ($data['upscale'] ? '(' . t('upscaling allowed') . ')' : '');
+function theme_image_scale_summary($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
+ return theme('image_resize_summary', array('data' => $data)) . ' ' . ($data['upscale'] ? '(' . t('upscaling allowed') . ')' : '');
}
/**
@@ -768,8 +786,8 @@ function theme_image_scale_summary($data
* The current configuration for this crop effect.
* @ingroup themeable
*/
-function theme_image_crop_summary($data) {
- return theme('image_resize_summary', $data);
+function theme_image_crop_summary($variables) {
+ return theme('image_resize_summary', $variables);
}
/**
@@ -779,6 +797,9 @@ function theme_image_crop_summary($data)
* The current configuration for this rotate effect.
* @ingroup themeable
*/
-function theme_image_rotate_summary($data) {
+function theme_image_rotate_summary($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
return ($data['random']) ? t('random between -@degrees° and @degrees°', array('@degrees' => str_replace('-', '', $data['degrees']))) : t('@degrees°', array('@degrees' => $data['degrees']));
}
Index: modules/image/image.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/image/image.module,v
retrieving revision 1.16
diff -u -p -r1.16 image.module
--- modules/image/image.module 26 Aug 2009 03:20:39 -0000 1.16
+++ modules/image/image.module 28 Sep 2009 22:42:43 -0000
@@ -20,7 +20,7 @@ function image_help($path, $arg) {
$output .= '
' . t('Image styles') . '
';
$output .= '
' . t('Image styles allow your site to output an image in several different ways without affecting the original image. Any created images will automatically be refreshed if any changes are made to the image style.') .'
';
$output .= '
' . t('Every image style must have a name, which will be used in the URL of generated images. There are two common approaches to naming image styles:') . '