diff --git a/core/modules/layout/lib/Drupal/layout/Plugin/block/block/PagePrimaryLinks.php b/core/modules/layout/lib/Drupal/layout/Plugin/block/block/PagePrimaryLinks.php new file mode 100644 index 0000000..58f352d --- /dev/null +++ b/core/modules/layout/lib/Drupal/layout/Plugin/block/block/PagePrimaryLinks.php @@ -0,0 +1,30 @@ + theme('links', array('links' => menu_main_menu(), 'attributes' => array('class' => 'links primary-links'))), + ); + } +} diff --git a/core/modules/layout/lib/Drupal/layout/Plugin/block/block/PageSecondaryLinks.php b/core/modules/layout/lib/Drupal/layout/Plugin/block/block/PageSecondaryLinks.php new file mode 100644 index 0000000..ab56df7 --- /dev/null +++ b/core/modules/layout/lib/Drupal/layout/Plugin/block/block/PageSecondaryLinks.php @@ -0,0 +1,30 @@ + theme('links', array('links' => menu_secondary_menu(), 'attributes' => array('class' => 'links secondary-links'))), + ); + } +} diff --git a/core/themes/bartik/lib/Drupal/bartik/blocks/PrimaryLinks.php b/core/themes/bartik/lib/Drupal/bartik/blocks/PrimaryLinks.php new file mode 100644 index 0000000..05f97a7 --- /dev/null +++ b/core/themes/bartik/lib/Drupal/bartik/blocks/PrimaryLinks.php @@ -0,0 +1,30 @@ + '', + '#children' => theme('links__system_main_menu', array( + 'links' => menu_main_menu(), + 'attributes' => array( + 'id' => 'main-menu-links', + 'class' => array('links', 'clearfix'), + ), + 'heading' => array( + 'text' => t('Main menu'), + 'level' => 'h2', + 'class' => array('element-invisible'), + ), + )), + ); + } +} diff --git a/core/themes/bartik/lib/Drupal/bartik/blocks/SecondaryLinks.php b/core/themes/bartik/lib/Drupal/bartik/blocks/SecondaryLinks.php new file mode 100644 index 0000000..1ada2f1 --- /dev/null +++ b/core/themes/bartik/lib/Drupal/bartik/blocks/SecondaryLinks.php @@ -0,0 +1,30 @@ + '', + '#children' => theme('links__system_secondary_menu', array( + 'links' => menu_secondary_menu(), + 'attributes' => array( + 'id' => 'secondary-menu-links', + 'class' => array('links', 'inline', 'clearfix'), + ), + 'heading' => array( + 'text' => t('Secondary menu'), + 'level' => 'h2', + 'class' => array('element-invisible'), + ), + )), + ); + } +} diff --git a/core/themes/bartik/template.php b/core/themes/bartik/template.php index 5373c92..d4facdc 100644 --- a/core/themes/bartik/template.php +++ b/core/themes/bartik/template.php @@ -151,3 +151,12 @@ function bartik_field__taxonomy_term_reference($variables) { return $output; } + +/** + * Implements hook_block_alter(). + */ +function bartik_block_alter(&$definitions) { + $definitions['page_primary_links']['class'] = 'Drupal\\bartik\\blocks\\PrimaryLinks'; + $definitions['page_secondary_links']['class'] = 'Drupal\\bartik\\blocks\\SecondaryLinks'; +} +