summaryrefslogtreecommitdiff
path: root/modules/field/modules/text/text.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-10-09 01:00:08 +0000
committerDries Buytaert <dries@buytaert.net>2009-10-09 01:00:08 +0000
commitc05f2181dc8556cb6700e8c6bb6e6ded43273192 (patch)
tree5446facb7f5f18dfaac48aade56c0d86f1477fff /modules/field/modules/text/text.module
parent48dd14a898420ae98984c951f59e8d299080bee8 (diff)
downloadbrdo-c05f2181dc8556cb6700e8c6bb6e6ded43273192.tar.gz
brdo-c05f2181dc8556cb6700e8c6bb6e6ded43273192.tar.bz2
- Patch #572618 by effulgentsia, pwolanin, sun: all theme functions should take a single argument. Code clean-up and performance improvement. Woot.
Diffstat (limited to 'modules/field/modules/text/text.module')
-rw-r--r--modules/field/modules/text/text.module24
1 files changed, 15 insertions, 9 deletions
diff --git a/modules/field/modules/text/text.module b/modules/field/modules/text/text.module
index cc0245dee..4a88b1e3a 100644
--- a/modules/field/modules/text/text.module
+++ b/modules/field/modules/text/text.module
@@ -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_trimmed($element) {
* 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']);
@@ -774,16 +778,18 @@ function text_field_widget_formatted_text_value($form, $edit = FALSE) {
*
* The textfield or textarea is already rendered by the
* textfield or textarea themes and the html output
- * lives in $element['#children']. Override this theme to
+ * lives in $variables['element']['#children']. Override this theme to
* make custom changes to the output.
*
- * $element['#field_name'] contains the field name
- * $element['#delta] is the position of this element in the group
+ * $variables['element']['#field_name'] contains the field name
+ * $variables['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'];
}