diff --git a/core/modules/system/css/system.admin.css b/core/modules/system/css/system.admin.css index 203f7d2..f45921d 100644 --- a/core/modules/system/css/system.admin.css +++ b/core/modules/system/css/system.admin.css @@ -48,7 +48,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 3af30c8..a660465 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -389,16 +389,34 @@ function theme_admin_page($variables) { } } - $system_compact_link = array('#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()), + '#theme_wrappers' => array('container'), + '#wrapper_container_attributes' => array( + 'class' => array('compact-link'), + ), + ); + 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.'); + } + $output = '
'; $output .= drupal_render($system_compact_link); - foreach ($container as $id => $data) { $output .= '
'; $output .= $data; $output .= '
'; } $output .= '
'; + return $output; } @@ -449,7 +467,25 @@ function theme_system_admin_index($variables) { } } - $system_compact_link = array('#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()), + '#theme_wrappers' => array('container'), + '#wrapper_container_attributes' => array( + 'class' => array('compact-link'), + ), + ); + 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.'); + } + $output = '
'; $output .= drupal_render($system_compact_link); foreach ($container as $id => $data) { diff --git a/core/modules/system/system.module b/core/modules/system/system.module index f4bf194..e03e468 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -182,9 +182,6 @@ function system_theme() { 'variables' => array('menu_items' => NULL), 'file' => 'system.admin.inc', ), - 'system_compact_link' => array( - 'variables' => array(), - ), )); } @@ -2702,24 +2699,6 @@ function system_time_zones($blank = NULL) { } /** - * 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/lib/Drupal/user/Form/UserPermissionsForm.php b/core/modules/user/lib/Drupal/user/Form/UserPermissionsForm.php index a0b29ee..ce05f27 100644 --- a/core/modules/user/lib/Drupal/user/Form/UserPermissionsForm.php +++ b/core/modules/user/lib/Drupal/user/Form/UserPermissionsForm.php @@ -104,8 +104,27 @@ public function buildForm(array $form, array &$form_state) { } asort($modules); + $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()), + '#theme_wrappers' => array('container'), + '#wrapper_container_attributes' => array( + 'class' => array('compact-link'), + ), + ); + 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.'); + } + $form['system_compact_link'] = array( - '#theme' => 'system_compact_link', + '#markup' => drupal_render($system_compact_link), ); $form['permissions'] = array(