layout_builder_kit-8.x-1.x-dev/layout_builder_kit.install

layout_builder_kit.install
<?php

/**
 * @file
 * Contains layout_builder_kit.install.
 */

use Drupal\Core\Url;

/**
 * Implements hook_requirements().
 *
 * For the Status Report, return information about CK statuses.
 *
 * @param $phase
 *
 * @return array
 * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
 * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
 */
function layout_builder_kit_requirements($phase) {
  $requirements = [];
  if ($phase == 'runtime') {
    // Check if Book component is enabled for Layout Builder Kit module, specially for Book Navigation Component.
    if (!Drupal::moduleHandler()->moduleExists('book')) {
      $requirements['book'] = [
        'title' => t('Layout Builder Kit'),
        'description' => t('Book Navigation component requires Book module to be enabled. Enable it <a href="/admin/modules">here</a>.'),
        'severity' => REQUIREMENT_INFO,
        'weight' => 1,
      ];
    }

    // Check if Render component is enabled for Layout Builder Kit module, specially for Render Component.
    if (!Drupal::moduleHandler()->moduleExists('media')) {
      $requirements['render'] = [
        'title' => t('Layout Builder Kit'),
        'description' => t('Render component requires Media module to be enabled. Enable it <a href="/admin/modules">here</a>.'),
        'severity' => REQUIREMENT_INFO,
        'weight' => 1,
      ];
    }

  }
  return $requirements;
}

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

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