diff --git a/core/modules/field/field.form.inc b/core/modules/field/field.form.inc index 461e20dd413..ac0cb701d2a 100644 --- a/core/modules/field/field.form.inc +++ b/core/modules/field/field.form.inc @@ -25,9 +25,10 @@ function theme_field_multiple_value_form($variables) { $output = ''; if ($element['#cardinality'] > 1 || $element['#cardinality'] == FIELD_CARDINALITY_UNLIMITED) { + $form_required_marker = array('#theme' => 'form_required_marker'); + $required = !empty($element['#required']) ? drupal_render($form_required_marker) : ''; $table_id = drupal_html_id($element['#field_name'] . '_values'); $order_class = $element['#field_name'] . '-delta-order'; - $required = !empty($element['#required']) ? theme('form_required_marker', $variables) : ''; $header = array( array( @@ -67,8 +68,17 @@ function theme_field_multiple_value_form($variables) { ); } + $table = array( + '#theme' => 'table', + '#header' => $header, + '#rows' => $rows, + '#attributes' => array( + 'id' => $table_id, + 'class' => array('field-multiple-table'), + ), + ); $output = '
'; - $output .= theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => $table_id, 'class' => array('field-multiple-table')))); + $output .= drupal_render($table); $output .= $element['#description'] ? '
' . $element['#description'] . '
' : ''; $output .= '
' . drupal_render($add_more_button) . '
'; $output .= '
'; diff --git a/core/modules/field/field.module b/core/modules/field/field.module index 92a2c4533bc..5ea0c0cf395 100644 --- a/core/modules/field/field.module +++ b/core/modules/field/field.module @@ -157,7 +157,11 @@ function field_help($path, $arg) { $items['items'][] = $display; } } - $output .= theme('item_list', $items) . ''; + $item_list = array( + '#theme' => 'item_list', + '#items' => $items['items'], + ); + $output .= drupal_render($item_list) . ''; $output .= '
' . t('Managing field data storage') . '
'; $output .= '
' . t('Developers of field modules can either use the default Field SQL Storage module to store data for their fields, or a contributed or custom module developed using the field storage API.', array('@storage-api' => 'http://api.drupal.org/api/group/field_storage/8', '@sql-store' => url('admin/help/field_sql_storage'))) . '
'; $output .= ''; diff --git a/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php index 2346271568a..7ce432ba3f3 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php +++ b/core/modules/field/lib/Drupal/field/Plugin/views/field/Field.php @@ -624,12 +624,13 @@ class Field extends FieldPluginBase { return implode(filter_xss_admin($this->options['separator']), $items); } else { - return theme('item_list', - array( - 'items' => $items, - 'title' => NULL, - 'list_type' => $this->options['multi_type'], - )); + $item_list = array( + '#theme' => 'item_list', + '#items' => $items, + '#title' => NULL, + '#list_type' => $this->options['multi_type'], + ); + return drupal_render($item_list); } } } diff --git a/core/modules/field_ui/field_ui.module b/core/modules/field_ui/field_ui.module index 2040df277c9..8a8674c0a9a 100644 --- a/core/modules/field_ui/field_ui.module +++ b/core/modules/field_ui/field_ui.module @@ -355,19 +355,19 @@ function field_ui_view_mode_delete(EntityViewModeInterface $view_mode) { */ function theme_field_ui_table($variables) { $elements = $variables['elements']; - $table = array(); + $table = array('#theme' => 'table'); // Add table headers and attributes. - foreach (array('header', 'attributes') as $key) { - if (isset($elements["#$key"])) { - $table[$key] = $elements["#$key"]; + foreach (array('#header', '#attributes') as $key) { + if (isset($elements[$key])) { + $table[$key] = $elements[$key]; } } // Determine the colspan to use for region rows, by checking the number of // columns in the headers. $columns_count = 0; - foreach ($table['header'] as $header) { + foreach ($table['#header'] as $header) { $columns_count += (is_array($header) && isset($header['colspan']) ? $header['colspan'] : 1); } @@ -377,7 +377,7 @@ function theme_field_ui_table($variables) { // Add region rows. if (isset($region['title']) && empty($region['invisible'])) { - $table['rows'][] = array( + $table['#rows'][] = array( 'class' => array('region-title', 'region-' . $region_name_class . '-title'), 'no_striping' => TRUE, 'data' => array( @@ -387,7 +387,7 @@ function theme_field_ui_table($variables) { } if (isset($region['message'])) { $class = (empty($region['rows_order']) ? 'region-empty' : 'region-populated'); - $table['rows'][] = array( + $table['#rows'][] = array( 'class' => array('region-message', 'region-' . $region_name_class . '-message', $class), 'no_striping' => TRUE, 'data' => array( @@ -417,10 +417,10 @@ function theme_field_ui_table($variables) { $row['data'][] = $cell; } } - $table['rows'][] = $row; + $table['#rows'][] = $row; } } - return theme('table', $table); + return drupal_render($table); } diff --git a/core/modules/field_ui/lib/Drupal/field_ui/OverviewBase.php b/core/modules/field_ui/lib/Drupal/field_ui/OverviewBase.php index 67b742b7989..39ffb8df974 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/OverviewBase.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/OverviewBase.php @@ -180,7 +180,11 @@ abstract class OverviewBase implements FormInterface, ControllerInterface { if ($depth = count($parents[$name])) { $children = element_children($row); $cell = current($children); - $row[$cell]['#prefix'] = theme('indentation', array('size' => $depth)) . (isset($row[$cell]['#prefix']) ? $row[$cell]['#prefix'] : ''); + $indentation = array( + '#theme' => 'indentation', + '#size' => $depth, + ); + $row[$cell]['#prefix'] = drupal_render($indentation) . (isset($row[$cell]['#prefix']) ? $row[$cell]['#prefix'] : ''); } // Add row id and associate JS settings.