-
Notifications
You must be signed in to change notification settings - Fork 2
/
protected_pages.install
54 lines (49 loc) · 1.23 KB
/
protected_pages.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* @file
* Protected Pages install file.
*/
use Drupal\Core\Url;
/**
* Implements hook_schema().
*/
function protected_pages_schema() {
$schema['protected_pages'] = [
'fields' => [
'pid' => [
'description' => 'The primary key always unique.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
],
'password' => [
'type' => 'varchar',
'description' => 'The password of the protected page.',
'length' => '128',
'not null' => TRUE,
],
'path' => [
'type' => 'varchar',
'description' => 'The path of the protected page.',
'length' => '255',
'not null' => TRUE,
],
],
'indexes' => [
'path' => ['path'],
],
'primary key' => ['pid'],
];
return $schema;
}
/**
* Implements hook_enable().
*/
function protected_pages_install() {
drupal_set_message(\Drupal::translation()->translate('The Protected Pages module has been successfully enabled.
Visit the <a href="@permissions">permissions</a> for your site.',
[
'@permissions' => Url::fromUri('internal:/admin/people/permissions', ['fragment' => 'module-protected_pages'])
->toString(),
]), 'status');
}