This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function layout_page_pre_render($page) { | |
global $theme; | |
// @todo Don't hard-code the bartik__bartik layout; let that be administrator | |
// configurable. | |
if ($theme == 'bartik') { | |
$layout_manager = drupal_container()->get('plugin.manager.layout'); | |
$conf = array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function layout_get_layout(Request $request) { | |
global $theme; | |
if ($theme == 'bartik' && arg(0) != 'user') { | |
$conf = array( | |
'regions' => array( | |
'content' => array( | |
'plugin.core.block.bartik.main_content' => array(), | |
), | |
'help' => array( | |
'plugin.core.block.bartik.help_text' => array(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function _block_get_renderable_block($element) { | |
$block = $element['#block']; | |
// Don't bother to build blocks that aren't accessible. | |
if ($element['#access'] = $block->access()) { | |
$build = $block->build(); | |
if ($build) { | |
if (isset($build['#title'])) { | |
$element['#title'] = $build['#title']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\layout\Plugin\block\block; | |
use Drupal\block\BlockBase; | |
use Drupal\Core\Annotation\Plugin; | |
use Drupal\Core\Annotation\Translation; | |
/** | |
* @Plugin( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\layout\Plugin\block\block; | |
use Drupal\block\BlockBase; | |
use Drupal\Core\Annotation\Plugin; | |
use Drupal\Core\Annotation\Translation; | |
/** | |
* @Plugin( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\bartik\blocks; | |
use Drupal\layout\Plugin\block\block\PagePrimaryLinks; | |
class PrimaryLinks extends PagePrimaryLinks { | |
/** | |
* Implements BlockInterface::build(). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\layout\Plugin\block\block; | |
use Drupal\block\BlockBase; | |
use Drupal\Core\Annotation\Plugin; | |
use Drupal\Core\Annotation\Translation; | |
/** | |
* @Plugin( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 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'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\bartik\blocks; | |
use Drupal\layout\Plugin\block\block\PagePrimaryLinks; | |
class PrimaryLinks extends PagePrimaryLinks { | |
/** | |
* Implements BlockInterface::build(). |