getName()])) { return TRUE; } // Recursively traverse required modules, looking for incompatible modules. foreach ($file->requires as $requires) { if (isset($files[$requires]) && _system_is_incompatible($incompatible, $files, $files[$requires])) { $incompatible[$file->getName()] = TRUE; return TRUE; } } } /** * Prepares variables for administrative content block templates. * * Default template: admin-block-content.html.twig. * * @param $variables * An associative array containing: * - 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', 'link_path', and 'localized_options', which are * passed to l(). A 'description' key may also be provided. */ function template_preprocess_admin_block_content(&$variables) { if (!empty($variables['content'])) { $compact = system_admin_compact_mode(); $variables['attributes'] = array('class' => array('admin-list')); if ($compact) { $variables['attributes']['class'][] = 'compact'; } foreach ($variables['content'] as $key => $item) { $variables['content'][$key]['link'] = l($item['title'], $item['link_path'], $item['localized_options']); if (!$compact && isset($item['description'])) { $variables['content'][$key]['description'] = Xss::filterAdmin($item['description']); } else { $variables['content'][$key]['description'] = FALSE; } } } } /** * Prepares variables for administrative index page templates. * * Default template: admin-page.html.twig. * * @param $variables * An associative array containing: * - blocks: An array of blocks to display. Each array should include a * 'title', a 'description', a formatted 'content' and a 'position' which * will control which container it will be in. This is usually 'left' or * 'right'. */ function template_preprocess_admin_page(&$variables) { $variables['system_compact_link'] = array( '#theme' => 'system_compact_link', ); $variables['containers'] = array(); $stripe = 0; foreach ($variables['blocks'] as $block) { if (!empty($block['content']['#content'])) { if (empty($block['position'])) { // Perform automatic striping. $block['position'] = ++$stripe % 2 ? 'left' : 'right'; } $variables['containers'][$block['position']]['blocks'][] = array( '#theme' => 'admin_block', '#block' => $block, ); } } } /** * Prepares variables for admin index templates. * * Default template: system-admin-index.html.twig. * * @param $variables * An associative array containing: * - menu_items: An array of modules to be displayed. */ function template_preprocess_system_admin_index(&$variables) { $variables['system_compact_link'] = array( '#theme' => 'system_compact_link', ); $variables['containers'] = array(); $stripe = 0; // Iterate over all modules. foreach ($variables['menu_items'] as $module => $block) { list($description, $items) = $block; $position = ++$stripe % 2 ? 'left' : 'right'; // Output links. if (count($items)) { $variables['containers'][$position][] = array( '#theme' => 'admin_block', '#block' => array( 'position' => $position, 'title' => $module, 'content' => array( '#theme' => 'admin_block_content', '#content' => $items, ), 'description' => t($description), ), ); } } } /** * Prepares variables for status report template. * * Default template: status-report.html.twig. * * This theme function is dependent on install.inc being loaded, because * that's where the constants are defined. * * @param $variables * An associative array containing: * - requirements: An array of requirements/status items. Each requirement * is an associative array containing the following elements: * - title: The name of the requirement. * - value: (optional) The current value (version, time, level, etc). * - description: (optional) The description of the requirement. * - severity: (optional) The requirement's result/severity level, one of: * - REQUIREMENT_INFO: Status information. * - REQUIREMENT_OK: The requirement is satisfied. * - REQUIREMENT_WARNING: The requirement failed with a warning. * - REQUIREMENT_ERROR: The requirement failed with an error. */ function template_preprocess_status_report(&$variables) { $severities = array( REQUIREMENT_INFO => array( 'title' => t('Info'), 'class' => 'info', ), REQUIREMENT_OK => array( 'title' => t('OK'), 'class' => 'ok', ), REQUIREMENT_WARNING => array( 'title' => t('Warning'), 'class' => 'warning', ), REQUIREMENT_ERROR => array( 'title' => t('Error'), 'class' => 'error', ), ); foreach ($variables['requirements'] as $i => $requirement) { // Always use the explicit requirement severity, if defined. Otherwise, // default to REQUIREMENT_OK in the installer to visually confirm that // installation requirements are met. And default to REQUIREMENT_INFO to // denote neutral information without special visualization. if (isset($requirement['severity'])) { $severity = $severities[(int) $requirement['severity']]; } elseif (defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'install') { $severity = $severities[REQUIREMENT_OK]; } else { $severity = $severities[REQUIREMENT_INFO]; } $variables['requirements'][$i]['severity_class'] = $severity['class']; $variables['requirements'][$i]['severity_title'] = $severity['title']; } } /** * Returns HTML for the modules form. * * @param $variables * An associative array containing: * - form: A render element representing the form. * * @ingroup themeable */ function theme_system_modules_details($variables) { $form = $variables['form']; // Individual table headers. $rows = array(); // Iterate through all the modules, which are children of this element. foreach (Element::children($form) as $key) { // Stick the key into $module for easier access. $module = $form[$key]; // Create the row for the table. $row = array(); // Add the checkbox into the first cell. unset($module['enable']['#title']); $module['#requires'] = array_filter($module['#requires']); $module['#required_by'] = array_filter($module['#required_by']); $requires = !empty($module['#requires']); $required_by = !empty($module['#required_by']); $version = !empty($module['version']['#markup']); $row[] = array('class' => array('checkbox'), 'data' => drupal_render($module['enable'])); // Add the module label and expand/collapse functionalty. $col2 = ''; $row[] = array('class' => array('module'), 'data' => $col2); // Add the description, along with any modules it requires. $description = ''; if ($version || $requires || $required_by) { $description .= '