openlucius-2.0.0-alpha3/openlucius.install

openlucius.install
<?php

/**
 * @file
 * Install and uninstall functions for the OpenLucius installation profile.
 */

/**
 * Implements hook_install_tasks().
 */
function openlucius_install_tasks() {
  $tasks = [];

  $tasks['openlucius_set_front_page'] = [];
  $tasks['openlucius_add_first_group'] = [];
  $tasks['openlucius_set_default_theme'] = [];

  return $tasks;
}
/**
 * Sets the front page path to /ol_home (a redirect to first group).
 */
function openlucius_set_front_page() {
  Drupal::configFactory()
    ->getEditable('system.site')
    ->set('page.front', '/ol_home')
    ->save(TRUE);
}

/**
 * Adds first group.
 */
function openlucius_add_first_group() {
  $group = \Drupal::service('olmain.groups');
  $group->addGroup('General', 'company', 1, false);
}

/**
 * Sets the default and administration themes.
 */
function openlucius_set_default_theme() {
  Drupal::configFactory()
    ->getEditable('system.theme')
    ->set('default', 'ol_base')
    ->set('admin', 'seven')
    ->save(TRUE);
}

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

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