X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fshortcut%2Fshortcut.install;fp=web%2Fcore%2Fmodules%2Fshortcut%2Fshortcut.install;h=21ebf51942245a952cb43bf2cb83006f3b2fad64;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/core/modules/shortcut/shortcut.install b/web/core/modules/shortcut/shortcut.install new file mode 100644 index 000000000..21ebf5194 --- /dev/null +++ b/web/core/modules/shortcut/shortcut.install @@ -0,0 +1,69 @@ + 'Maps users to shortcut sets.', + 'fields' => [ + 'uid' => [ + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'description' => 'The {users}.uid for this set.', + ], + 'set_name' => [ + 'type' => 'varchar_ascii', + 'length' => 32, + 'not null' => TRUE, + 'default' => '', + 'description' => "The {shortcut_set}.set_name that will be displayed for this user.", + ], + ], + 'primary key' => ['uid'], + 'indexes' => [ + 'set_name' => ['set_name'], + ], + 'foreign keys' => [ + 'set_user' => [ + 'table' => 'users', + 'columns' => ['uid' => 'uid'], + ], + 'set_name' => [ + 'table' => 'shortcut_set', + 'columns' => ['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')->save(TRUE); + } +}