5 * Install, update and uninstall functions for the shortcut module.
9 * Implements hook_schema().
11 function shortcut_schema() {
12 $schema['shortcut_set_users'] = [
13 'description' => 'Maps users to shortcut sets.',
20 'description' => 'The {users}.uid for this set.',
23 'type' => 'varchar_ascii',
27 'description' => "The {shortcut_set}.set_name that will be displayed for this user.",
30 'primary key' => ['uid'],
32 'set_name' => ['set_name'],
37 'columns' => ['uid' => 'uid'],
40 'table' => 'shortcut_set',
41 'columns' => ['set_name' => 'set_name'],
50 * Implements hook_install().
52 function shortcut_install() {
53 // Theme settings are not configuration entities and cannot depend on modules
54 // so to set a module-specific setting, we need to set it with logic.
55 if (\Drupal::service('theme_handler')->themeExists('seven')) {
56 \Drupal::configFactory()->getEditable('seven.settings')->set('third_party_settings.shortcut.module_link', TRUE)->save(TRUE);
61 * Implements hook_uninstall().
63 function shortcut_uninstall() {
64 // Theme settings are not configuration entities and cannot depend on modules
65 // so to unset a module-specific setting, we need to unset it with logic.
66 if (\Drupal::service('theme_handler')->themeExists('seven')) {
67 \Drupal::configFactory()->getEditable('seven.settings')->clear('third_party_settings.shortcut')->save(TRUE);