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_layout_instance($request) { | |
$page_node = array( | |
'weight' => -10, | |
'layout' => 'default_layout:layout__twocol', | |
'regions' => array( | |
'left' => array( | |
'plugin.core.block.bartik.user_online' => array(), | |
), | |
'right' => array( | |
'plugin.core.block.bartik.page_messages' => 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 block_user_role_delete($role) { | |
$block_configs = config_get_storage_names_with_prefix('plugin.core.block'); | |
foreach ($block_configs as $config_id) { | |
$config = config($config_id); | |
$roles = $config->get('visibility.role.roles'); | |
if (isset($roles[$role->rid])) { | |
unset($roles[$role->rid]); | |
$config->set('visibility.role.roles', $roles); | |
$config->save(); | |
} |
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_menu_delete(). | |
*/ | |
function block_menu_delete($menu) { | |
$block_configs = config_get_storage_names_with_prefix('plugin.core.block'); | |
foreach ($block_configs as $config_id) { | |
$config = config($config_id); | |
if ($config->get('id') == 'menu_menu_block:' . $menu['menu_name']) { | |
$config->delete(); | |
} |
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_language_delete(). | |
* | |
* Delete the potential block visibility settings of the deleted language. | |
*/ | |
function block_language_delete($language) { | |
// Remove the block visibility settings for the deleted language. | |
$block_configs = config_get_storage_names_with_prefix('plugin.core.block'); | |
foreach ($block_configs as $config_id) { | |
$config = config($config_id); |
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 my_module_ctools_render_alter(&$info, &$page, &$context) { | |
if (!empty($context['subtask']) && !empty($context['subtask']['name']) && !empty($context['handler']) && $context['subtask']['name'] == 'my_page' && $context['handler']->name == 'page_my_page_panel_context') { | |
ctools_include('ajax'); | |
ctools_include('modal'); | |
ctools_modal_add_js(); | |
} | |
} |
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 _block_rehash($theme = NULL) { | |
$blocks = array(); | |
$instances = array(); | |
$theme = $theme ? $theme : variable_get('theme_default', 'stark'); | |
$block_configs = config_get_storage_names_with_prefix('plugin.core.block.' . $theme); | |
foreach ($block_configs as $config) { | |
$blocks[$config] = block_load($config); | |
} | |
return $blocks; | |
} |
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_user_role_delete(). | |
* | |
* Removes deleted role from blocks that use it. | |
*/ | |
function block_user_role_delete($role) { | |
$block_configs = config_get_storage_names_with_prefix('plugin.core.block'); | |
foreach ($block_configs as $config_id) { | |
$config = config($config_id); | |
$roles = $config->get('visibility.role.roles'); |
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 statistics_block_alter(&$definitions) { | |
$statistics_count_content_views = config('statistics.settings')->get('count_content_views'); | |
if (empty($statistics_count_content_views)) { | |
unset($definitions['statistics_popular_block']); | |
} | |
} |
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
/** | |
* Override or insert variables into the node template. | |
*/ | |
function commerce_kickstart_product_ui_preprocess_node(&$vars) { | |
$product_display_types = commerce_product_reference_node_types(); | |
if (isset($vars['type']) && isset($product_display_types[$vars['node']->type])) { | |
$vars['theme_hook_suggestions'][] = 'node__product__type'; | |
$vars['classes_array'][] = 'node-product-type'; | |
if ($vars['view_mode'] == 'product_list') { | |
$vars['theme_hook_suggestions'][] = 'node__product__type__product__list'; |