cforge-2.0.x-dev/modules/cforge_gallery/cforge_gallery.install

modules/cforge_gallery/cforge_gallery.install
<?php

/**
 * @file
 * Installation hooks for cforge_gallery.
 */

use Drupal\user\Entity\Role;
use Drupal\taxonomy\Entity\Term;

/**
 * Implements hook_install().
 */
function cforge_gallery_install() {
  $properties = [
    'name' => t('The usual suspects'),
    'vid' => 'galleries',
    'format' => 'plain_text',
    'description' => t("Rogues's gallery"),
  ];

  Term::create($properties)->save();

  Role::load('committee')
    ->grantPermission('create image content')
    ->grantPermission('delete any image content')
    ->grantPermission('edit any image content')
    ->grantPermission('edit terms in galleries')
    ->save();
}

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

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