12345678910111213141516171819202122232425262728293031323334 |
- <?php
- /**
- * Implements hook_modules_installed().
- * @param $modules
- */
- function toolbar_themes_modules_installed($modules) {
- // Force a cache flush.
- if (in_array('toolbar_themes', $modules)) {
- drupal_flush_all_caches();
- }
- }
- /**
- * Implements hook_install().
- */
- function toolbar_themes_install() {
- if ($roles = user_roles(FALSE, 'access toolbar')) {
- foreach ($roles as $rid => $role) {
- user_role_grant_permissions($rid, ['configure toolbar_themes']);
- }
- }
- }
- /**
- * Assign "Configure administration toolbar themes" permission to all roles.
- */
- function toolbar_themes_update_8001() {
- if ($roles = user_roles(FALSE, 'access toolbar')) {
- foreach ($roles as $rid => $role) {
- user_role_grant_permissions($rid, ['configure toolbar_themes']);
- }
- }
- }
|