diff --git a/core/includes/form.inc b/core/includes/form.inc index b3dbb70..1df56b7 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -1593,11 +1593,12 @@ function form_process_container($element, &$form_state) { } /** - * Returns HTML for a table with radio buttons or checkboxes. + * Prepares a 'tableselect' #type element for rendering. * - * @param $variables - * An associative array containing: - * - element: An associative array containing the properties and children of + * Adds a column of radio buttons or checkboxes for each row of a table. + * + * @param $element + * An associative array containing the properties and children of * the tableselect element. Properties used: #header, #options, #empty, * and #js_select. The #options property is an array of selection options; * each array element of #options is an array of properties. These @@ -1631,14 +1632,8 @@ function form_process_container($element, &$form_state) { * '#empty' => t('No content available.'), * ); * @endcode - * - * @ingroup themeable */ -function theme_tableselect($variables) { - $element = $variables['element']; - $table = array( - '#type' => 'table', - ); +function form_pre_render_tableselect($element) { $rows = array(); $header = $element['#header']; if (!empty($element['#options'])) { @@ -1678,7 +1673,7 @@ function theme_tableselect($variables) { // checkboxes/radios in the first table column. if ($element['#js_select']) { // Add a "Select all" checkbox. - $table['#attached']['library'][] = 'core/drupal.tableselect'; + $element['#attached']['library'][] = 'core/drupal.tableselect'; array_unshift($header, array('class' => array('select-all'))); } else { @@ -1687,14 +1682,11 @@ function theme_tableselect($variables) { array_unshift($header, ''); } } - $table += array( - '#header' => $header, - '#rows' => $rows, - '#empty' => $element['#empty'], - '#attributes' => $element['#attributes'], - ); - return drupal_render($table); + $element['#header'] = $header; + $element['#rows'] = $rows; + + return $element; } /** @@ -1786,7 +1778,6 @@ function form_process_tableselect($element) { * The processed element. * * @see form_process_tableselect() - * @see theme_tableselect() */ function form_process_table($element, &$form_state) { if ($element['#tableselect']) { diff --git a/core/includes/theme.inc b/core/includes/theme.inc index d38eaec..eff5d49 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2661,9 +2661,6 @@ function drupal_common_theme() { 'render element' => 'element', 'template' => 'textarea', ), - 'tableselect' => array( - 'render element' => 'element', - ), 'form_element' => array( 'render element' => 'element', 'template' => 'form-element', diff --git a/core/modules/comment/src/Form/CommentAdminOverview.php b/core/modules/comment/src/Form/CommentAdminOverview.php index efcd19e..ab6ab97 100644 --- a/core/modules/comment/src/Form/CommentAdminOverview.php +++ b/core/modules/comment/src/Form/CommentAdminOverview.php @@ -202,15 +202,22 @@ public function buildForm(array $form, array &$form_state, $type = 'new') { '#title' => $comment->getSubject(), ) + $comment_permalink->toRenderArray(), ), - 'author' => drupal_render($username), + 'author' => array( + 'data' => $username, + 'class' => array(RESPONSIVE_PRIORITY_MEDIUM), + ), 'posted_in' => array( 'data' => array( '#type' => 'link', '#title' => $commented_entity->label(), '#access' => $commented_entity->access('view'), ) + $commented_entity->urlInfo()->toRenderArray(), + 'class' => array(RESPONSIVE_PRIORITY_LOW), + ), + 'changed' => array( + 'data' => $this->date->format($comment->getChangedTime(), 'short'), + 'class' => array(RESPONSIVE_PRIORITY_LOW), ), - 'changed' => $this->date->format($comment->getChangedTime(), 'short'), ); $comment_uri_options = $comment->urlInfo()->getOptions(); $links = array(); diff --git a/core/modules/system/system.module b/core/modules/system/system.module index ba965a2..cb473b8 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -540,10 +540,13 @@ function system_element_info() { '#input' => TRUE, '#js_select' => TRUE, '#multiple' => TRUE, + '#responsive' => TRUE, + '#sticky' => FALSE, + '#pre_render' => array('drupal_pre_render_table','form_pre_render_tableselect'), '#process' => array('form_process_tableselect'), '#options' => array(), '#empty' => '', - '#theme' => 'tableselect', + '#theme' => 'table__tableselect', ); // Form structure.