dcco-8.x-3.x-dev/dcco.install

dcco.install
<?php

/**
 * @file
 * Install and update hooks for the DrupalCamp Colorado distro.
 */

use Drupal\user\Entity\User;

/**
 * Implements hook_install().
 */
function dcco_install() {
  // Set node edit pages to use admin theme.
  \Drupal::configFactory()
    ->getEditable('node.settings')
    ->set('use_admin_theme', TRUE)
    ->save(TRUE);

  // Assign user 1 the "administrator" role.
  $user = User::load(1);
  $user->roles[] = 'administrator';
  $user->save();

  // Enable the admin theme.
  \Drupal::configFactory()
    ->getEditable('node.settings')
    ->set('use_admin_theme', TRUE)
    ->save(TRUE);

  // Enable and set Adminimal as the admin theme. This has to be done here as
  // the theme needs some core elements installed prior to it's installation.
  if (\Drupal::service('theme_installer')->install(['adminimal_theme'])) {
    \Drupal::configFactory()
      ->getEditable('system.theme')
      ->set('admin', 'adminimal_theme')
      ->save(TRUE);
  }
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc