diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index fde1bcc..06c0fbd 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -7,10 +7,11 @@ use Drupal\Core\Ajax\AjaxResponse; use Drupal\Core\Ajax\ReplaceCommand; +use Drupal\Core\Datetime\DrupalDateTime; +use Drupal\Core\Template\Attribute; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; -use Drupal\Core\Datetime\DrupalDateTime; /** * Menu callback; Provide the administration overview page. @@ -44,10 +45,11 @@ function system_admin_config_page() { unset($item['localized_options']['attributes']['title']); } $block = $item; - $block['content'] = ''; - $block['content'] .= theme('admin_block_content', array('content' => system_admin_menu_block($item))); - if (!empty($block['content'])) { - $block['show'] = TRUE; + if ($content = system_admin_menu_block($item)) { + $block['content'] = array( + '#theme' => 'admin_block_content', + '#content' => $content + ); } // Prepare for sorting as in function _menu_tree_check_access(). @@ -58,7 +60,10 @@ function system_admin_config_page() { } if ($blocks) { ksort($blocks); - return theme('admin_page', array('blocks' => $blocks)); + return array( + '#theme' => 'admin_page', + '#blocks' => $blocks + ); } else { return t('You do not have any administrative items.'); @@ -79,12 +84,17 @@ function system_admin_config_page() { function system_admin_menu_block_page() { $item = menu_get_item(); if ($content = system_admin_menu_block($item)) { - $output = theme('admin_block_content', array('content' => $content)); + $build = array( + '#theme' => 'admin_block_content', + '#content' => $content + ); } else { - $output = t('You do not have any administrative items.'); + $build = array( + '#markup' => t('You do not have any administrative items.'), + ); } - return $output; + return $build; } /** @@ -115,7 +125,10 @@ function system_admin_index() { $menu_items[$info->info['name']] = array($info->info['description'], $admin_tasks); } } - return theme('system_admin_index', array('menu_items' => $menu_items)); + return array( + '#theme' => 'system_admin_index', + '#menu_items' => $menu_items + ); } /** @@ -244,8 +257,12 @@ function system_themes_page() { uasort($theme_groups['enabled'], 'system_sort_themes'); drupal_alter('system_themes_page', $theme_groups); - $admin_form = drupal_get_form('system_themes_admin_form', $admin_theme_options); - return theme('system_themes_page', array('theme_groups' => $theme_groups, 'theme_group_titles' => $theme_group_titles)) . drupal_render($admin_form); + return array( + '#theme' => 'system_themes_page', + '#theme_groups' => $theme_groups, + '#theme_group_titles' => $theme_group_titles, + '#admin_theme_options' => $admin_theme_options, + ); } /** @@ -1059,9 +1076,12 @@ function _system_modules_build_row($info, $extra) { } else { $form['enable'] = array( - '#markup' => theme('image', array('uri' => 'core/misc/watchdog-error.png', 'alt' => $status_short, 'title' => $status_short)), + '#theme' => 'image', + '#uri' => 'core/misc/watchdog-error.png', + '#alt' => $status_short, + '#title' => $status_short ); - $form['description']['#markup'] .= theme('system_modules_incompatible', array('message' => $status_long)); + $form['description']['#markup'] .= '
' . $status_long . '
'; } // Build operation links. @@ -1105,7 +1125,10 @@ function system_modules_confirm_form($modules, $storage) { $items[] = format_plural(count($info['depends']), 'The @module module is missing, so the following module will be disabled: @depends.', 'The @module module is missing, so the following modules will be disabled: @depends.', $t_argument); } - $form['text'] = array('#markup' => theme('item_list', array('items' => $items))); + $form['text'] = array( + '#theme' => 'item_list', + '#items' => $items, + ); // Set some default form values $form = confirm_form( @@ -1357,7 +1380,13 @@ function system_modules_uninstall_confirm_form($storage) { if (isset($uninstall)) { $form['#confirmed'] = TRUE; $form['uninstall']['#tree'] = TRUE; - $form['modules'] = array('#markup' => '

' . t('The following modules will be completely uninstalled from your site, and all data from these modules will be lost!') . '

' . theme('item_list', array('items' => $uninstall))); + $form['modules'] = array( + '#markup' => '

' . t('The following modules will be completely uninstalled from your site, and all data from these modules will be lost!') . '

', + ); + $form['modules_list'] = array( + '#theme' => 'item_list', + '#items' => $uninstall, + ); $form = confirm_form( $form, t('Confirm uninstall'), @@ -2112,7 +2141,11 @@ function system_status($check = FALSE) { ->condition('pass', '') ->condition('status', 0) ->execute(); - return theme('status_report', array('requirements' => $requirements)); + + return array( + '#theme' => 'status_report', + '#requirements' => $requirements + ); } /** @@ -2162,7 +2195,12 @@ function system_batch_page() { } /** - * Returns HTML for an administrative block for display. + * Prepares variables for administrative block template. + * + * Default template: admin-block.html.twig. + * + * This doesn't do anything extra to prepare the template, but is given simply + * for example purposes. * * @param $variables * An associative array containing: @@ -2175,32 +2213,13 @@ function system_batch_page() { * * @ingroup themeable */ -function theme_admin_block($variables) { - $block = $variables['block']; - $output = ''; - - // Don't display the block if it has no content to display. - if (empty($block['show'])) { - return $output; - } - - $output .= '
'; - if (!empty($block['title'])) { - $output .= '

' . $block['title'] . '

'; - } - if (!empty($block['content'])) { - $output .= '
' . $block['content'] . '
'; - } - else { - $output .= '
' . $block['description'] . '
'; - } - $output .= '
'; - - return $output; +function template_preprocess_admin_block(&$variables) { } /** - * Returns HTML for the content of an administrative block. + * Prepares variables for administrative content block template. + * + * Default template: admin-block-content.html.twig. * * @param $variables * An associative array containing: @@ -2211,29 +2230,29 @@ function theme_admin_block($variables) { * * @ingroup themeable */ -function theme_admin_block_content($variables) { - $content = $variables['content']; - $output = ''; - - if (!empty($content)) { - $class = 'admin-list'; - if ($compact = system_admin_compact_mode()) { - $class .= ' compact'; +function template_preprocess_admin_block_content(&$variables) { + if (!empty($variables['content'])) { + $compact = system_admin_compact_mode(); + $variables['attributes'] = new Attribute(array('class' => array('admin-list'))); + if ($compact) { + $variables['attributes']['class'][] = 'compact'; } - $output .= '
'; - foreach ($content as $item) { - $output .= '
' . l($item['title'], $item['href'], $item['localized_options']) . '
'; + foreach ($variables['content'] as $key => $item) { + $variables['content'][$key]['link'] = l($item['title'], $item['href'], $item['localized_options']); if (!$compact && isset($item['description'])) { - $output .= '
' . filter_xss_admin($item['description']) . '
'; + $variables['content'][$key]['description'] = filter_xss_admin($item['description']); + } + else { + $variables['content'][$key]['description'] = FALSE; } } - $output .= '
'; } - return $output; } /** - * Returns HTML for an administrative page. + * Prepares variables for administrative index page templates. + * + * Default template: admin-page.html.twig. * * @param $variables * An associative array containing: @@ -2244,100 +2263,86 @@ function theme_admin_block_content($variables) { * * @ingroup themeable */ -function theme_admin_page($variables) { - $blocks = $variables['blocks']; - +function template_preprocess_admin_page(&$variables) { + $variables['system_compact_link'] = array( + '#theme' => 'system_compact_link', + ); + $variables['containers'] = array(); $stripe = 0; - $container = array(); - - foreach ($blocks as $block) { - if ($block_output = theme('admin_block', array('block' => $block))) { + foreach ($variables['blocks'] as $Block) { + $block = (array) $Block; + if ($block['show'] = !empty($block['content'])) { if (empty($block['position'])) { // perform automatic striping. $block['position'] = ++$stripe % 2 ? 'left' : 'right'; } - if (!isset($container[$block['position']])) { - $container[$block['position']] = ''; + if (!isset($variables['containers'][$block['position']])) { + $variables['containers'][$block['position']] = array('blocks' => array()); } - $container[$block['position']] .= $block_output; + $variables['containers'][$block['position']]['blocks'][] = array( + '#theme' => 'admin_block', + '#block' => $block, + ); } } - - $output = '
'; - $output .= theme('system_compact_link'); - - foreach ($container as $id => $data) { - $output .= '
'; - $output .= $data; - $output .= '
'; - } - $output .= '
'; - return $output; } /** - * Returns HTML for the output of the admin index page. + * Prepares variables for admin index template. + * + * Default template: system-admin-index.html.twig. * * @param $variables * An associative array containing: * - menu_items: An array of modules to be displayed. * + * @todo Remove this once http://drupal.org/node/1842232 is resolved. + * * @ingroup themeable */ -function theme_system_admin_index($variables) { - $menu_items = $variables['menu_items']; - +function template_preprocess_system_admin_index(&$variables) { + $variables['system_compact_link'] = array( + '#theme' => 'system_compact_link' + ); + $variables['containers'] = array(); $stripe = 0; - $container = array('left' => '', 'right' => ''); - $flip = array('left' => 'right', 'right' => 'left'); - $position = 'left'; - // Iterate over all modules. - foreach ($menu_items as $module => $block) { + foreach ($variables['menu_items'] as $module => $block) { list($description, $items) = $block; - + $position = ++$stripe % 2 ? 'left' : 'right'; // Output links. if (count($items)) { - $block = array(); - $block['title'] = $module; - $block['content'] = theme('admin_block_content', array('content' => $items)); - $block['description'] = t($description); - $block['show'] = TRUE; - - if ($block_output = theme('admin_block', array('block' => $block))) { - if (!isset($block['position'])) { - // Perform automatic striping. - $block['position'] = $position; - $position = $flip[$position]; - } - $container[$block['position']] .= $block_output; - } + $variables['containers'][$position]['blocks'][] = array( + '#theme' => 'admin_block', + '#block' => array( + 'position' => $position, + 'title' => $module, + 'show' => TRUE, + 'content' => array( + '#theme' => 'admin_block_content', + '#content' => $items, + ), + 'description' => t($description), + ), + ); } } - - $output = '
'; - $output .= theme('system_compact_link'); - foreach ($container as $id => $data) { - $output .= '
'; - $output .= $data; - $output .= '
'; - } - $output .= '
'; - - return $output; } /** - * Returns HTML for the status report. + * Prepares variables for status report template. + * + * Default template: status-report.html.twig. * * @param $variables * An associative array containing: * - requirements: An array of requirements. + * Properties used: severity.title, severity.class, + * requirement.title, requirement.value, requirement.description * * @ingroup themeable */ -function theme_status_report($variables) { - $requirements = $variables['requirements']; +function template_preprocess_status_report(&$variables) { $severities = array( REQUIREMENT_INFO => array( 'title' => t('Info'), @@ -2356,11 +2361,8 @@ function theme_status_report($variables) { 'class' => 'error', ), ); - $output = ''; - $output .= ''; - $output .= ''; - foreach ($requirements as $requirement) { + foreach ($variables['requirements'] as $i => $requirement) { if (empty($requirement['#type'])) { // Always use the explicit requirement severity, if defined. Otherwise, // default to REQUIREMENT_OK in the installer to visually confirm that @@ -2376,26 +2378,16 @@ function theme_status_report($variables) { $severity = $severities[REQUIREMENT_INFO]; } - $severity['icon'] = '
' . $severity['title'] . '
'; - - // Output table rows. - $output .= ''; - $output .= ''; - $output .= ''; - $output .= ''; + $variables['requirements'][$i]['severity_class'] = $severity['class']; + $variables['requirements'][$i]['severity_title'] = $severity['title']; } } - - $output .= '
' . t('Status') . '' . t('Component') . '' . t('Details') . '
' . $severity['icon'] . '' . $requirement['title'] . '' . $requirement['value']; - if (!empty($requirement['description'])) { - $output .= '
' . $requirement['description'] . '
'; - } - $output .= '
'; - return $output; } /** - * Returns HTML for the modules form. + * Prepares variables for the modules form. + * + * Default template: system-modules-details.html.twig. * * @param $variables * An associative array containing: @@ -2403,7 +2395,7 @@ function theme_status_report($variables) { * * @ingroup themeable */ -function theme_system_modules_details($variables) { +function template_preprocess_system_modules_details(&$variables) { $form = $variables['form']; // Individual table headers. @@ -2459,20 +2451,11 @@ function theme_system_modules_details($variables) { $rows[] = $row; } - return theme('table', array('header' => $form['#header'], 'rows' => $rows)); -} - -/** - * Returns HTML for a message about incompatible modules. - * - * @param $variables - * An associative array containing: - * - message: The form array representing the currently disabled modules. - * - * @ingroup themeable - */ -function theme_system_modules_incompatible($variables) { - return '
' . $variables['message'] . '
'; + $variables['content'] = array( + '#theme' => 'table', + '#header' => $form['#header'], + '#rows' => $rows + ); } /** @@ -2525,7 +2508,9 @@ function theme_system_modules_uninstall($variables) { } /** - * Returns HTML for the Appearance page. + * Prepares variables for the appearance page template. + * + * Default template: system-themes-page.html.twig. * * @param $variables * An associative array containing: @@ -2533,10 +2518,16 @@ function theme_system_modules_uninstall($variables) { * * @ingroup themeable */ -function theme_system_themes_page($variables) { +function template_preprocess_system_themes_page(&$variables) { + $groups = array(); $theme_groups = $variables['theme_groups']; - $output = '
'; + // Top level attributes. + $variables['attributes'] = !empty($variables['attributes']) ? new Attribute($variables['attributes']) : new Attribute(); + // We have a default class variable that we don't want here. + // @see http://drupal.org/node/1938430 + unset($variables['attributes']['class']); + $variables['attributes']['id'] = 'system-themes-page'; foreach ($variables['theme_group_titles'] as $state => $title) { if (!count($theme_groups[$state])) { @@ -2544,48 +2535,67 @@ function theme_system_themes_page($variables) { continue; } // Start new theme group. - $output .= '

'. $title .'

'; + $theme_group = array(); + $theme_group['state'] = $state; + $theme_group['title'] = $title; + $theme_group['themes'] = array(); + $theme_group['attributes'] = new Attribute(array('class' => array('system-themes-list', 'system-themes-list-' . $state, 'clearfix'))); foreach ($theme_groups[$state] as $theme) { - - // Theme the screenshot. - $screenshot = $theme->screenshot ? theme('image', $theme->screenshot) : '
' . t('no screenshot') . '
'; + $current_theme = array(); + + // Screenshot depicting the theme. + if ($theme->screenshot) { + $current_theme['screenshot'] = array( + '#theme' => 'image', + '#uri' => $theme->screenshot['uri'], + '#alt' => $theme->screenshot['alt'], + '#title' => $theme->screenshot['title'], + '#attributes' => $theme->screenshot['attributes'], + ); + } // Localize the theme description. - $description = t($theme->info['description']); + $current_theme['description'] = t($theme->info['description']); // Style theme info - $notes = count($theme->notes) ? ' (' . join(', ', $theme->notes) . ')' : ''; $theme->classes[] = 'theme-selector'; $theme->classes[] = 'clearfix'; - $output .= '
' . $screenshot . '

' . $theme->info['name'] . ' ' . (isset($theme->info['version']) ? $theme->info['version'] : '') . $notes . '

' . $description . '
'; + $current_theme['attributes'] = new Attribute(array('class' => $theme->classes)); + $current_theme['name'] = $theme->info['name']; + $current_theme['version'] = isset($theme->info['version']) ? $theme->info['version'] : ''; + $current_theme['notes'] = count($theme->notes) ? '(' . join(', ', $theme->notes) . ')' : ''; // Make sure to provide feedback on compatibility. if (!empty($theme->incompatible_core)) { - $output .= '
' . t('This version is not compatible with Drupal !core_version and should be replaced.', array('!core_version' => DRUPAL_CORE_COMPATIBILITY)) . '
'; + $current_theme['compatibility'] = t('This version is not compatible with Drupal !core_version and should be replaced.', array('!core_version' => DRUPAL_CORE_COMPATIBILITY)); } elseif (!empty($theme->incompatible_php)) { if (substr_count($theme->info['php'], '.') < 2) { $theme->info['php'] .= '.*'; } - $output .= '
' . t('This theme requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $theme->info['php'], '!php_version' => phpversion())) . '
'; + $current_theme['compatibility'] = t('This theme requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $theme->info['php'], '!php_version' => phpversion())); } elseif (!empty($theme->incompatible_base)) { - $output .= '
' . t('This theme requires the base theme @base_theme to operate correctly.', array('@base_theme' => $theme->info['base theme'])) . '
'; + $current_theme['compatibility'] = t('This theme requires the base theme @base_theme to operate correctly.', array('@base_theme' => $theme->info['base theme'])); } elseif (!empty($theme->incompatible_engine)) { - $output .= '
' . t('This theme requires the theme engine @theme_engine to operate correctly.', array('@theme_engine' => $theme->info['engine'])) . '
'; + $current_theme['compatibility'] = t('This theme requires the theme engine @theme_engine to operate correctly.', array('@theme_engine' => $theme->info['engine'])); } else { - $output .= theme('links', array('links' => $theme->operations, 'attributes' => array('class' => array('operations', 'clearfix')))); + $current_theme['compatibility'] = array( + '#theme' => 'links', + '#links' => $theme->operations, + '#attributes' => new Attribute(array('class' => array('operations', 'clearfix'))), + ); } - $output .= '
'; + $theme_group['themes'][] = $current_theme; } - $output .= '
'; + $groups[] = $theme_group; } - $output .= '
'; + $variables['theme_groups'] = $groups; + $variables['admin_form'] = drupal_get_form('system_themes_admin_form', $variables['admin_theme_options']); - return $output; } /** @@ -2841,7 +2851,11 @@ function system_date_format_language_overview_page() { $rows[] = $row; } - return theme('table', array('header' => $header, 'rows' => $rows)); + return array( + '#theme' => 'table', + '#header' => $header, + '#rows' => $rows + ); } /** diff --git a/core/modules/system/system.module b/core/modules/system/system.module index b3f9bc1..29365fb 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -8,8 +8,8 @@ use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Cache\Cache; use Drupal\Core\Database\Database; -use Drupal\Core\Utility\ModuleInfo; use Drupal\Core\TypedData\Primitive; +use Drupal\Core\Utility\ModuleInfo; use Drupal\system\Plugin\block\block\SystemMenuBlock; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; @@ -139,59 +139,70 @@ function system_help($path, $arg) { function system_theme() { return array_merge(drupal_common_theme(), array( 'system_themes_page' => array( - 'variables' => array('theme_groups' => NULL), + 'variables' => array( + 'theme_groups' => array(), + 'theme_group_titles' => array(), + 'admin_theme_options' => array(), + ), 'file' => 'system.admin.inc', + 'template' => 'system-themes-page', ), 'system_settings_form' => array( 'render element' => 'form', + 'template' => 'system-settings-form', ), 'confirm_form' => array( 'render element' => 'form', + 'template' => 'confirm-form', ), 'system_modules_details' => array( 'render element' => 'form', 'file' => 'system.admin.inc', - ), - 'system_modules_incompatible' => array( - 'variables' => array('message' => NULL), - 'file' => 'system.admin.inc', + 'template' => 'system-modules-details', ), 'system_modules_uninstall' => array( 'render element' => 'form', 'file' => 'system.admin.inc', ), 'status_report' => array( - 'render element' => 'requirements', + 'variables' => array('requirements' => array()), 'file' => 'system.admin.inc', + 'template' => 'status-report' ), 'admin_page' => array( - 'variables' => array('blocks' => NULL), + 'variables' => array('blocks' => array()), 'file' => 'system.admin.inc', + 'template' => 'admin-page', ), 'admin_block' => array( - 'variables' => array('block' => NULL), + 'variables' => array('block' => array()), 'file' => 'system.admin.inc', + 'template' => 'admin-block', ), 'admin_block_content' => array( - 'variables' => array('content' => NULL), + 'variables' => array('content' => array()), 'file' => 'system.admin.inc', + 'template' => 'admin-block-content', ), 'system_admin_index' => array( - 'variables' => array('menu_items' => NULL), + 'variables' => array('menu_items' => array()), 'file' => 'system.admin.inc', + 'template' => 'system-admin-index', ), 'system_powered_by' => array( 'variables' => array(), + 'template' => 'system-powered-by', ), 'system_compact_link' => array( 'variables' => array(), + 'template' => 'system-compact-link', ), 'system_date_format_localize_form' => array( 'render element' => 'form', ), 'system_plugin_ui_form' => array( - 'template' => 'system-plugin-ui-form', 'render element' => 'form', + 'template' => 'system-plugin-ui-form', ), )); } @@ -2671,7 +2682,7 @@ function system_user_timezone(&$form, &$form_state) { } /** - * Implements hook_preprocess_HOOK() for block.tpl.php. + * Preprares variables for block templates. */ function system_preprocess_block(&$variables) { switch ($variables['block']->id) { @@ -2692,10 +2703,17 @@ function system_preprocess_block(&$variables) { } /** - * Implements hook_preprocess_HOOK() for system-plugin-ui-form.tpl.php. + * Prepares variables for the plugin ui form template. + * + * Default template: system-plugin-ui-form.html.twig. * * The $variables array contains the following arguments: * - $form + * + * @todo Fix drupal_render() and drupal_render_children() calls. See + * http://drupal.org/node/1920886 for more information. + * + * @ingroup themeable */ function template_preprocess_system_plugin_ui_form(&$variables) { drupal_add_css(drupal_get_path('module', 'system') . '/system.plugin.ui.css'); @@ -3634,30 +3652,38 @@ function system_timezone($abbreviation = '', $offset = -1, $is_daylight_saving_t } /** - * Returns HTML for the Powered by Drupal text. + * Prepares variables for the Powered by Drupal template. + * + * Default template: system-powered-by.html.twig. + * + * This doesn't do anything extra to prepare the template, but is given simply + * for example purposes. * * @ingroup themeable */ -function theme_system_powered_by() { - return '' . t('Powered by Drupal', array('@poweredby' => 'http://drupal.org')) . ''; +function template_preprocess_system_powered_by(&$variables) { } /** - * Returns HTML for a link to show or hide inline help descriptions. + * Prepare variables for system compact link templates. + * + * Default template: system-compact-link.html.twig. * * @ingroup themeable */ -function theme_system_compact_link() { - $output = ''; - - return $output; } /** @@ -3907,10 +3933,12 @@ function system_archiver_info() { } /** - * Returns HTML for a confirmation form. + * Prepares variables for a confirmation form template. * - * By default this does not alter the appearance of a form at all, - * but is provided as a convenience for themers. + * Default template: confirm-form.html.twig. + * + * This doesn't do anything extra to prepare the template, but is given simply + * for example purposes. * * @param $variables * An associative array containing: @@ -3918,15 +3946,18 @@ function system_archiver_info() { * * @ingroup themeable */ -function theme_confirm_form($variables) { - return drupal_render_children($variables['form']); +function template_preprocess_confirm_form(&$variables) { + // @todo Resolve this http://drupal.org/node/1920886 + $variables['form'] = drupal_render_children($variables['form']); } /** - * Returns HTML for a system settings form. + * Prepares variables for system settings form template. + * + * Default template: system-settings-form.html.twig. * - * By default this does not alter the appearance of a form at all, - * but is provided as a convenience for themers. + * This doesn't do anything extra to prepare the template, but is given simply + * for example purposes. * * @param $variables * An associative array containing: @@ -3934,8 +3965,9 @@ function theme_confirm_form($variables) { * * @ingroup themeable */ -function theme_system_settings_form($variables) { - return drupal_render_children($variables['form']); +function template_preprocess_system_settings_form(&$variables) { + // @todo Resolve this http://drupal.org/node/1920886 + $variables['form'] = drupal_render_children($variables['form']); } /** @@ -3949,6 +3981,7 @@ function theme_system_settings_form($variables) { * A string containing an HTML-formatted form. * * @ingroup themeable + * @todo Move this out of system.module and back into theme.inc. */ function theme_exposed_filters($variables) { $form = $variables['form']; diff --git a/core/modules/system/templates/admin-block-content.html.twig b/core/modules/system/templates/admin-block-content.html.twig new file mode 100644 index 0000000..80c0526 --- /dev/null +++ b/core/modules/system/templates/admin-block-content.html.twig @@ -0,0 +1,29 @@ +{# +/** + * @file + * Default theme implementation for the content of an administrative block. + * + * Available variables: + * - content: An array containing information about the block. Each element + * of the array represents an administrative menu item, and must at least + * contain the keys 'title', 'href', and 'localized_options', which are + * passed to l(). A 'description' key may also be provided. + * - attributes: Remaining HTML attributes to be aded to the element. + * - is_compact_mode: It defines if compact mode is used. + * + * @see template_preprocess() + * @see template_preprocess_admin_block_content() + * + * @ingroup themeable + */ +#} +{% if content %} + + {% for item in content %} +
{{ item.link }}
+ {% if item.description %} +
{{ item.description }}
+ {% endif %} + {% endfor %} + +{% endif %} diff --git a/core/modules/system/templates/admin-block.html.twig b/core/modules/system/templates/admin-block.html.twig new file mode 100644 index 0000000..986b959 --- /dev/null +++ b/core/modules/system/templates/admin-block.html.twig @@ -0,0 +1,26 @@ +{# +/** + * @file + * Default theme implementation for an administrative block. + * + * Available variables: + * - block: An array of information about the block, including: + * - show: A boolean flag indicating if the block should be displayed. + * - title: The block title. + * - content: (optional) The content of the block. + * - description: (optional) A description of the block. + * (description should only be output if content is not available). + * + * @see template_preprocess() + * @see template_preprocess_admin_block() + * + * @ingroup themeable + */ +#} +{% if block.show %} +
+ {% if block.title %}

{{ block.title }}

{% endif %} + {% if block.content %}
{{ block.content }}
+ {% elseif block.description %}
{{ block.description }}
{% endif %} +
+{% endif %} diff --git a/core/modules/system/templates/admin-page.html.twig b/core/modules/system/templates/admin-page.html.twig new file mode 100644 index 0000000..ab16d6e --- /dev/null +++ b/core/modules/system/templates/admin-page.html.twig @@ -0,0 +1,25 @@ +{# +/** + * @file + * Default theme implementation for an administrative page. + * + * Available variables: + * - system_compact_link: Themed link to toggle compact view. + * - containers: An array of administrative blocks keyed by position: left or right. + * + * @see template_preprocess() + * @see template_preprocess_admin_page() + * + * @ingroup themeable + */ +#} +
+ {{ system_compact_link }} + {% for position, container in containers %} +
+ {% for i in container.blocks|keys %} + {{ container.blocks[i] }} + {% endfor %} +
+ {% endfor %} +
diff --git a/core/modules/system/templates/confirm-form.html.twig b/core/modules/system/templates/confirm-form.html.twig new file mode 100644 index 0000000..ba541de --- /dev/null +++ b/core/modules/system/templates/confirm-form.html.twig @@ -0,0 +1,18 @@ +{# +/** + * @file + * Default theme implementation for a confirmation form. + * + * By default this does not alter the appearance of a form at all, + * but is provided as a convenience for themers. + * + * Available variables: + * - form: A render element representing the form. + * + * @see template_preprocess() + * @see template_preprocess_confirm_form() + * + * @ingroup themeable + */ +#} +{{ form }} diff --git a/core/modules/system/templates/status-report.html.twig b/core/modules/system/templates/status-report.html.twig new file mode 100644 index 0000000..f8b74d6 --- /dev/null +++ b/core/modules/system/templates/status-report.html.twig @@ -0,0 +1,40 @@ +{# +/** + * Default theme implementation for the status report. + * + * Available variables: + * - requirements: contains multiple requirement instances. Each requirement + * has .title, .value and .description. + * - severity: The severity of error. Contains .title and .class. + * + * @see template_preprocess() + * @see template_preprocess_status_report() + * + * @ingroup themeable + */ +#} + + + + + + + + {% for i in requirements|keys %} + + + + + + {% endfor %} + +
{{ 'Status'|t }}{{ 'Component'|t }}{{ 'Details'|t }}
+
+ {{ requirements[i].severity_title }} +
+
{{ requirements[i].title }} + {{ requirements[i].value }} + {% if requirements[i].description %} +
{{ requirements[i].description }}
+ {% endif %} +
diff --git a/core/modules/system/templates/system-admin-index.html.twig b/core/modules/system/templates/system-admin-index.html.twig new file mode 100644 index 0000000..54cf0e2 --- /dev/null +++ b/core/modules/system/templates/system-admin-index.html.twig @@ -0,0 +1,26 @@ +{# +/** + * @file + * Default theme implementation for the admin index page. + * + * Available variables: + * - system_compact_link: Themed link to toggle compact view. + * - container: Container for admin blocks. + * + * @see template_preprocess() + * @see template_preprocess_system_admin_index() + * + * @ingroup themeable + */ + @todo: remove this file once http://drupal.org/node/1842232 is resolved. +#} +
+ {{ system_compact_link }} + {% for position, container in containers %} +
+ {% for i in container.blocks|keys %} + {{ container.blocks[i] }} + {% endfor %} +
+ {% endfor %} +
diff --git a/core/modules/system/templates/system-compact-link.html.twig b/core/modules/system/templates/system-compact-link.html.twig new file mode 100644 index 0000000..a18efda --- /dev/null +++ b/core/modules/system/templates/system-compact-link.html.twig @@ -0,0 +1,13 @@ +{# +/** + * @file + * Default theme implementation for a link to show or hide inline help + * descriptions. + * + * @see template_preprocess() + * @see template_preprocess_system_compact_link() + * + * @ingroup themeable + */ +#} + diff --git a/core/modules/system/templates/system-modules-details.html.twig b/core/modules/system/templates/system-modules-details.html.twig new file mode 100644 index 0000000..6321b28 --- /dev/null +++ b/core/modules/system/templates/system-modules-details.html.twig @@ -0,0 +1,15 @@ +{# +/** + * @file + * Default theme implementation to display the modules form. + * + * Available variables: + * - content: file form element html. + * + * @see template_preprocess() + * @see template_preprocess_system_modules_details() + * + * @ingroup themeable + */ +#} +{{ content }} diff --git a/core/modules/system/templates/system-plugin-ui-form.html.twig b/core/modules/system/templates/system-plugin-ui-form.html.twig new file mode 100644 index 0000000..5019164 --- /dev/null +++ b/core/modules/system/templates/system-plugin-ui-form.html.twig @@ -0,0 +1,31 @@ +{# +/** + * @file + * Default theme implementation to configure blocks. + * + * Available variables: + * - $left: Any form array elements that should appear in the left hand column. + * - $right: Any form array elements that should appear in the right hand column. + * - $form_submit: Form submit button. + * + * @see template_preprocess_block_library_form() + * @see theme_block_library_form() + * + * @ingroup themeable + */ +#} +
+
+
+ {{ left }} +
+
+
+
+ {{ right }} +
+
+ {% if form_submit %} +
{{ form_submit }}
+ {% endif %} +
diff --git a/core/modules/system/templates/system-plugin-ui-form.tpl.php b/core/modules/system/templates/system-plugin-ui-form.tpl.php deleted file mode 100644 index 8179076..0000000 --- a/core/modules/system/templates/system-plugin-ui-form.tpl.php +++ /dev/null @@ -1,32 +0,0 @@ - -
-
-
- -
-
-
-
- -
-
- -
- -
diff --git a/core/modules/system/templates/system-powered-by.html.twig b/core/modules/system/templates/system-powered-by.html.twig new file mode 100644 index 0000000..fa7dd32 --- /dev/null +++ b/core/modules/system/templates/system-powered-by.html.twig @@ -0,0 +1,12 @@ +{# +/** + * @file + * Default theme implementation for the Powered by Drupal text. + * + * @see template_preprocess() + * @see template_preprocess_system_powered_by() + * + * @ingroup themeable + */ +#} +{{ 'Powered by Drupal'|t }} diff --git a/core/modules/system/templates/system-settings-form.html.twig b/core/modules/system/templates/system-settings-form.html.twig new file mode 100644 index 0000000..9be86af --- /dev/null +++ b/core/modules/system/templates/system-settings-form.html.twig @@ -0,0 +1,18 @@ +{# +/** + * @file + * Default theme implementation for a system settings form. + * + * By default this does not alter the appearance of a form at all, but is + * provided as a convenience for themers. + * + * Available variables: + * - form: A render element representing the form. + * + * @see template_preprocess() + * @see template_preprocess_system_settings_form() + * + * @ingroup themeable + */ +#} +{{ form }} diff --git a/core/modules/system/templates/system-themes-page.html.twig b/core/modules/system/templates/system-themes-page.html.twig new file mode 100644 index 0000000..c20544a --- /dev/null +++ b/core/modules/system/templates/system-themes-page.html.twig @@ -0,0 +1,58 @@ +{# +/** + * @file + * Default theme implementation for the Appearance page. + * + * Available variables: + * - attributes: HTML element attributes. + * - theme_groups: An array of theme groups. + * + * Each theme_groups[group] contains an array of theme groups. + * + * Each group in theme_groups[group] contains: + * - group.attributes: Element attributes specific to this group. + * - group.title: Title for the theme group. + * - group.state: State of the theme group. + * - group.themes: An array of themes within that group. + * + * Each group.themes[theme] contains an array of themes. + * + * Each theme in group.themes[theme] contains: + * - theme.attributes: Element attributes specific to this theme. + * - theme.screenshot: Render of theme screenshot. + * - theme.description: Description of the theme. + * - theme.name: Name of theme. + * - theme.version: Verions number of theme. + * - theme.notes: Identifies what context this theme is being used. + * eg. (default theme, admin theme) + * - theme.compatibility: Description of any incompatibility issues, + * if the theme is compatible, provides a list of links. + * + * @see template_preprocess() + * @see template_preprocess_system_themes_page() + * + * @ingroup themeable + */ +#} + + {% for group_key in theme_groups|keys %} +
+

{{ theme_groups[group_key].title }}

+ {% for theme_key in theme_groups[group_key].themes|keys %} +
+ {% if theme_groups[group_key].themes[theme_key].screenshot %} + {{ theme_groups[group_key].themes[theme_key].screenshot }} + {% else %} +
{{ "no screenshot"|t }}
+ {% endif %} +
+

{{ theme_groups[group_key].themes[theme_key].name }} {{ theme_groups[group_key].themes[theme_key].version }} {{ theme_groups[group_key].themes[theme_key].notes }}

+
{{ theme_groups[group_key].themes[theme_key].description }}
+ {{ theme_groups[group_key].themes[theme_key].compatibility }} +
+
+ {% endfor %} +
+ {% endfor %} + +{{ admin_form }}