rocketship_core-8.x-2.0-alpha11/modules/rocketship_page/rocketship_page.module
modules/rocketship_page/rocketship_page.module
<?php
/**
* @file
* Main module file.
*/
/**
* Implements hook_themes_installed().
*
* Disable some blocks when one of our themes gets installed and this module
* is already active at the time.
*/
function rocketship_page_themes_installed($theme_list) {
foreach ($theme_list as $theme) {
if (in_array($theme, ['dropsolid_starter', 'dropsolid_flex'])) {
try {
\Rocketship::hideBreadcrumbAndTitleBlockOnContentType($theme, 'page');
}
catch (\Exception $e) {
\Drupal::messenger()
->addError(t('Failed hiding the breadcrumb and/or title block for the page content type. Please do so manually.'));
}
}
}
}
/**
* Implements hook_module_implements_alter().
*
* Make sure we go after block_themes_installed.
*/
function rocketship_page_module_implements_alter(&$implementations, $hook) {
if ($hook == 'themes_installed') {
$group = $implementations['rocketship_page'];
unset($implementations['rocketship_page']);
$implementations['rocketship_page'] = $group;
}
}