Drupal 8.0.0 beta 12. More info: https://www.drupal.org/node/2514176
This commit is contained in:
commit
9921556621
13277 changed files with 1459781 additions and 0 deletions
69
core/modules/shortcut/shortcut.install
Normal file
69
core/modules/shortcut/shortcut.install
Normal file
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Install, update and uninstall functions for the shortcut module.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements hook_schema().
|
||||
*/
|
||||
function shortcut_schema() {
|
||||
$schema['shortcut_set_users'] = array(
|
||||
'description' => 'Maps users to shortcut sets.',
|
||||
'fields' => array(
|
||||
'uid' => array(
|
||||
'type' => 'int',
|
||||
'unsigned' => TRUE,
|
||||
'not null' => TRUE,
|
||||
'default' => 0,
|
||||
'description' => 'The {users}.uid for this set.',
|
||||
),
|
||||
'set_name' => array(
|
||||
'type' => 'varchar_ascii',
|
||||
'length' => 32,
|
||||
'not null' => TRUE,
|
||||
'default' => '',
|
||||
'description' => "The {shortcut_set}.set_name that will be displayed for this user.",
|
||||
),
|
||||
),
|
||||
'primary key' => array('uid'),
|
||||
'indexes' => array(
|
||||
'set_name' => array('set_name'),
|
||||
),
|
||||
'foreign keys' => array(
|
||||
'set_user' => array(
|
||||
'table' => 'users',
|
||||
'columns' => array('uid' => 'uid'),
|
||||
),
|
||||
'set_name' => array(
|
||||
'table' => 'shortcut_set',
|
||||
'columns' => array('set_name' => 'set_name'),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
return $schema;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_install().
|
||||
*/
|
||||
function shortcut_install() {
|
||||
// Theme settings are not configuration entities and cannot depend on modules
|
||||
// so to set a module-specific setting, we need to set it with logic.
|
||||
if (\Drupal::service('theme_handler')->themeExists('seven')) {
|
||||
\Drupal::configFactory()->getEditable('seven.settings')->set('third_party_settings.shortcut.module_link', TRUE)->save(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_uninstall().
|
||||
*/
|
||||
function shortcut_uninstall() {
|
||||
// Theme settings are not configuration entities and cannot depend on modules
|
||||
// so to unset a module-specific setting, we need to unset it with logic.
|
||||
if (\Drupal::service('theme_handler')->themeExists('seven')) {
|
||||
\Drupal::configFactory()->getEditable('seven.settings')->clear('third_party_settings.shortcut.module_link')->save(TRUE);
|
||||
}
|
||||
}
|
Reference in a new issue