diff --git a/core/modules/system/css/system.admin.css b/core/modules/system/css/system.admin.css index c600539..17ec12f 100644 --- a/core/modules/system/css/system.admin.css +++ b/core/modules/system/css/system.admin.css @@ -59,7 +59,7 @@ div.admin .expert-link { } /** - * Markup generated by theme_system_compact_link(). + * System compact link: to toggle the display of description text. */ .compact-link { margin: 0 0 0.5em 0; diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index 957db86..d2e2c6f 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -995,15 +995,37 @@ function theme_admin_page($variables) { } } - $output = '
'; - $output .= theme('system_compact_link'); + $system_compact_link = array( + '#type' => 'link', + '#href' => 'admin/compact/off', + '#title' => t('Show descriptions'), + '#attributes' => array( + 'title' => t('Expand layout to include descriptions.'), + ), + '#options' => array('query' => drupal_get_destination()), + ); + if (!system_admin_compact_mode()) { + $system_compact_link['#href'] = 'admin/compact/on'; + $system_compact_link['#title'] = t('Hide descriptions'); + $system_compact_link['#attributes']['title'] = t('Compress layout by hiding descriptions.'); + } + $system_compact = array( + '#theme' => 'container', + '#children' => drupal_render($system_compact_link), + '#attributes' => array( + 'class' => array('compact-link'), + ), + ); + $output = '
'; + $output .= drupal_render($system_compact); foreach ($container as $id => $data) { $output .= '
'; $output .= $data; $output .= '
'; } $output .= '
'; + return $output; } @@ -1047,8 +1069,30 @@ function theme_system_admin_index($variables) { } } + $system_compact_link = array( + '#type' => 'link', + '#href' => 'admin/compact/off', + '#title' => t('Show descriptions'), + '#attributes' => array( + 'title' => t('Expand layout to include descriptions.'), + ), + '#options' => array('query' => drupal_get_destination()), + ); + if (!system_admin_compact_mode()) { + $system_compact_link['#href'] = 'admin/compact/on'; + $system_compact_link['#title'] = t('Hide descriptions'); + $system_compact_link['#attributes']['title'] = t('Compress layout by hiding descriptions.'); + } + $system_compact = array( + '#theme' => 'container', + '#children' => drupal_render($system_compact_link), + '#attributes' => array( + 'class' => array('compact-link'), + ), + ); + $output = '
'; - $output .= theme('system_compact_link'); + $output .= drupal_render($system_compact); foreach ($container as $id => $data) { $output .= '
'; $output .= $data; diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 87fe50d..c5e5155 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -184,9 +184,6 @@ function system_theme() { 'system_powered_by' => array( 'variables' => array(), ), - 'system_compact_link' => array( - 'variables' => array(), - ), 'system_date_format_localize_form' => array( 'render element' => 'form', ), @@ -3320,24 +3317,6 @@ function theme_system_powered_by() { } /** - * Returns HTML for a link to show or hide inline help descriptions. - * - * @ingroup themeable - */ -function theme_system_compact_link() { - $output = ''; - - return $output; -} - -/** * Attempts to get a file using Guzzle HTTP client and to store it locally. * * @param $url diff --git a/core/modules/user/user.admin.inc b/core/modules/user/user.admin.inc index 9361864..1488718 100644 --- a/core/modules/user/user.admin.inc +++ b/core/modules/user/user.admin.inc @@ -236,9 +236,29 @@ function theme_user_admin_permissions($variables) { foreach (element_children($form['role_names']) as $rid) { $header[] = array('data' => drupal_render($form['role_names'][$rid]), 'class' => array('checkbox')); } + $system_compact_link = array( - '#theme' => 'system_compact_link', + '#type' => 'link', + '#href' => 'admin/compact/off', + '#title' => t('Show descriptions'), + '#attributes' => array( + 'title' => t('Expand layout to include descriptions.'), + ), + '#options' => array('query' => drupal_get_destination()), + ); + if (!system_admin_compact_mode()) { + $system_compact_link['#href'] = 'admin/compact/on'; + $system_compact_link['#title'] = t('Hide descriptions'); + $system_compact_link['#attributes']['title'] = t('Compress layout by hiding descriptions.'); + } + $system_compact = array( + '#theme' => 'container', + '#children' => drupal_render($system_compact_link), + '#attributes' => array( + 'class' => array('compact-link'), + ), ); + $table = array( '#theme' => 'table', '#header' => $header, @@ -247,7 +267,7 @@ function theme_user_admin_permissions($variables) { 'id' => 'permissions', ), ); - $output = drupal_render($system_compact_link); + $output = drupal_render($system_compact); $output .= drupal_render($table); $output .= drupal_render_children($form); return $output;