-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpanelizer_variants.install
84 lines (79 loc) · 2.04 KB
/
panelizer_variants.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/**
* @file
* Panelizer Variant Install.
*/
/**
* Implements hook_schema().
*/
function panelizer_variants_schema() {
$schema['panelizer_variants'] = array(
'description' => 'Panelizer Variants Settings to Use.',
'fields' => array(
'pnid' => array(
'type' => 'int',
'not null' => TRUE,
'description' => 'The Panel ID',
'no export' => TRUE,
),
'name' => array(
'description' => 'Panelizer Name from panelizer_default table.',
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'default' => NULL,
),
'context' => array(
'description' => 'Context Info.',
'type' => 'text',
'size' => 'big',
'serialize' => TRUE,
'object default' => array(),
),
'did' => array(
'type' => 'int',
'not null' => TRUE,
'description' => 'The display ID of the panel.',
'no export' => TRUE,
),
'pipeline' => array(
'description' => 'Panelizer Name from panelizer_default table.',
'type' => 'varchar',
'length' => 255,
'default' => 'standard',
),
'view_mode' => array(
'description' => 'view_mode from panelizer_default table.',
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'default' => NULL,
),
),
'primary key' => array('pnid'),
);
return $schema;
}
/**
* Implements hook_install().
*/
function panelizer_variants_install() {
// Make this the same weight as panelizer.
db_update('system')
->fields(array('weight' => 21))
->condition('name', 'panelizer_variants', '=')
->execute();
}
/**
* Unstable1 to alpha1 upgrade check.
*/
function panelizer_variants_update_7001() {
if (!db_field_exists('panelizer_variants', 'pipeline')) {
db_add_field('panelizer_variants', 'pipeline', array(
'description' => 'Panelizer Name from panelizer_default table.',
'type' => 'varchar',
'length' => 255,
'default' => 'standard',
));
}
}