monster_menus-9.0.x-dev/modules/mm_webform/mm_webform.install

modules/mm_webform/mm_webform.install
<?php

/**
 * @file
 *   mm_webform module install/schema hooks.
 */

/**
 * Implements hook_requirements().
 */
function mm_webform_requirements($phase) {
  $requirements = [];

  if ($phase == 'runtime') {
    if (!\Drupal::moduleHandler()->moduleExists('webform_node')) {
      $requirements['mm_webform_webform_node'] = [
        'title' => t('MM Webform'),
        'value' => t('Webform Node not enabled'),
        'description' => t('In order to be able to view Webform submissions as part of the normal Webform edit page the <strong>Webform Node</strong> module must be enabled.'),
        'severity' => REQUIREMENT_WARNING,
      ];
    }
  }

  return $requirements;
}

/**
 * Implements hook_schema().
 */
function mm_webform_schema() {
  $schema = [];
  $schema['webform_submitted_readers'] = [
    'description' => 'Which MM groups are allowed to read a webform\'s submissions.',
    'fields' => [
      'id' => [
        'description' => 'Unique ID of this row',
        'type' => 'serial',
        'size' => 'big',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ],
      'nid' => [
        'description' => 'The node identifier of a webform',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ],
      'gid' => [
        'description' => 'The MM group identifier',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ],
    ],
    'indexes' => [
      'nid' => ['nid'],
    ],
    'primary key' => ['id'],
  ];

  return $schema;
}

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

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