getBodyAttributes(); $classes = $attributes['class']; // Add information about the number of sidebars. if (!empty($variables['page']['sidebar_first'])) { $classes[] = 'one-sidebar'; $classes[] = 'sidebar-first'; } else { $classes[] = 'no-sidebars'; } $attributes['class'] = $classes; $variables['primary_local_tasks'] = $variables['tabs']; unset($variables['primary_local_tasks']['#secondary']); $variables['secondary_local_tasks'] = array( '#theme' => 'menu_local_tasks', '#secondary' => isset($variables['tabs']['#secondary']) ? $variables['tabs']['#secondary'] : '', ); } /** * Overrides theme_menu_local_tasks(). * * Returns HTML for primary and secondary local tasks. * **/ function seven_menu_local_tasks(&$variables) { $output = ''; if (!empty($variables['primary'])) { $variables['primary']['#attached'] = array( 'library' => array( array('seven', 'drupal.nav-tabs'), ), ); $variables['primary']['#prefix'] = '

' . t('Primary tabs') . '

'; $variables['primary']['#prefix'] .= ''; $output .= drupal_render($variables['primary']); } if (!empty($variables['secondary'])) { $variables['secondary']['#attached'] = array( 'library' => array( array('seven', 'drupal.nav-tabs'), ), ); $variables['secondary']['#prefix'] = '

' . t('Secondary tabs') . '

'; $variables['secondary']['#prefix'] .= ''; $output .= drupal_render($variables['secondary']); } return $output; } /** * Overrides theme_menu_local_task(). * * Returns HTML for a local task. * **/ function seven_menu_local_task($variables) { $link = $variables['element']['#link']; $link += array( 'localized_options' => array(), ); $link_text = $link['title']; if (!empty($variables['element']['#active'])) { // Add text to indicate active tab for non-visual users. $active = '' . t('(active tab)') . ''; // If the link does not contain HTML already, String::checkPlain() it now. // After we set 'html'=TRUE the link will not be sanitized by l(). if (empty($link['localized_options']['html'])) { $link['title'] = String::checkPlain($link['title']); } $link['localized_options']['html'] = TRUE; $link_text = t('!local-task-title!active', array('!local-task-title' => $link['title'], '!active' => $active)); } if (!empty($link['href'])) { // @todo - remove this once all pages are converted to routes. $a_tag = l($link_text, $link['href'], $link['localized_options']); } else { $a_tag = \Drupal::l($link_text, $link['route_name'], $link['route_parameters'], $link['localized_options']); } return '' . $a_tag . ''; } /** * Displays the list of available node types for node creation. */ function seven_node_add_list($variables) { $content = $variables['content']; if ($content) { $output = ''; } else { $output = '

' . t('You have not created any content types yet. Go to the content type creation page to add a new content type.', array('@create-content' => url('admin/structure/types/add'))) . '

'; } return $output; } /** * Overrides theme_custom_block_add_list(). * * Displays the list of available custom block types for creation. */ function seven_custom_block_add_list($variables) { $output = ''; if (!empty($variables['types'])) { $output = ''; } return $output; } /** * Overrides theme_admin_block_content(). * * Uses an unordered list markup in both compact and extended mode. */ function seven_admin_block_content($variables) { $content = $variables['content']; $output = ''; if (!empty($content)) { $output = system_admin_compact_mode() ? '