2009-10-17 00:51:53 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* Install, update and uninstall functions for the shortcut module.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2009-12-04 16:49:48 +00:00
|
|
|
* Implements hook_schema().
|
2009-10-17 00:51:53 +00:00
|
|
|
*/
|
|
|
|
function shortcut_schema() {
|
2017-03-04 01:20:24 +00:00
|
|
|
$schema['shortcut_set_users'] = [
|
2009-10-17 00:51:53 +00:00
|
|
|
'description' => 'Maps users to shortcut sets.',
|
2017-03-04 01:20:24 +00:00
|
|
|
'fields' => [
|
|
|
|
'uid' => [
|
2009-10-17 00:51:53 +00:00
|
|
|
'type' => 'int',
|
|
|
|
'unsigned' => TRUE,
|
|
|
|
'not null' => TRUE,
|
|
|
|
'default' => 0,
|
|
|
|
'description' => 'The {users}.uid for this set.',
|
2017-03-04 01:20:24 +00:00
|
|
|
],
|
|
|
|
'set_name' => [
|
2015-05-05 16:42:09 +00:00
|
|
|
'type' => 'varchar_ascii',
|
2009-10-17 00:51:53 +00:00
|
|
|
'length' => 32,
|
|
|
|
'not null' => TRUE,
|
|
|
|
'default' => '',
|
|
|
|
'description' => "The {shortcut_set}.set_name that will be displayed for this user.",
|
2017-03-04 01:20:24 +00:00
|
|
|
],
|
|
|
|
],
|
|
|
|
'primary key' => ['uid'],
|
|
|
|
'indexes' => [
|
|
|
|
'set_name' => ['set_name'],
|
|
|
|
],
|
|
|
|
'foreign keys' => [
|
|
|
|
'set_user' => [
|
2010-08-22 13:55:53 +00:00
|
|
|
'table' => 'users',
|
2017-03-04 01:20:24 +00:00
|
|
|
'columns' => ['uid' => 'uid'],
|
|
|
|
],
|
|
|
|
'set_name' => [
|
2010-08-22 13:55:53 +00:00
|
|
|
'table' => 'shortcut_set',
|
2017-03-04 01:20:24 +00:00
|
|
|
'columns' => ['set_name' => 'set_name'],
|
|
|
|
],
|
|
|
|
],
|
|
|
|
];
|
2009-10-17 00:51:53 +00:00
|
|
|
|
|
|
|
return $schema;
|
|
|
|
}
|
2014-12-10 20:08:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
Issue #3079738 by lauriii, saschaeggi, webchick, xjm, andrewmacpherson, shimpy, effulgentsia, Wim Leers, DyanneNova, svettes, rainbreaw, fhaeberle, ckrina, AaronMcHale, justafish, catch, charlieweb82, AntoineH, lot007, pzajacz, kostyashupenko, jasonbarrie, antonellasevero, finnsky, worldlinemine, bnjmnm, RobLoach, Dennis Cohn, huzooka, Archita Arora, joachim, jrockowitz, benjifisher, shaal, Gábor Hojtsy, quiron, L2G2, ccasals, hampercm, if-jds, abhisekmazumdar, Kami Amiga, pivica, zrpnr, BrightBold, imalabya, jhedstrom, Neslee Canil Pinto, maliknaik, junaidmasoodi, Maithri Shetty, pranav73, mandclu, modulist, nod_, philosurfer, phenaproxima, mherchel, mlncn, rafuel92, leymannx, kiboman, Swapnil_Kotwal, anevins, evankay, rfmarcelino, thamas, brianperry, idebr, joelpittet, boulaffasae, alexpott, volkerk, DuneBL, Eli-T, Mahenkvyas22: Add Claro administration theme to core
2019-10-13 20:42:58 +00:00
|
|
|
foreach (['seven', 'claro'] as $theme) {
|
|
|
|
if (\Drupal::service('theme_handler')->themeExists($theme)) {
|
|
|
|
\Drupal::configFactory()
|
|
|
|
->getEditable("$theme.settings")
|
|
|
|
->set('third_party_settings.shortcut.module_link', TRUE)
|
|
|
|
->save(TRUE);
|
|
|
|
}
|
2014-12-10 20:08:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
Issue #3079738 by lauriii, saschaeggi, webchick, xjm, andrewmacpherson, shimpy, effulgentsia, Wim Leers, DyanneNova, svettes, rainbreaw, fhaeberle, ckrina, AaronMcHale, justafish, catch, charlieweb82, AntoineH, lot007, pzajacz, kostyashupenko, jasonbarrie, antonellasevero, finnsky, worldlinemine, bnjmnm, RobLoach, Dennis Cohn, huzooka, Archita Arora, joachim, jrockowitz, benjifisher, shaal, Gábor Hojtsy, quiron, L2G2, ccasals, hampercm, if-jds, abhisekmazumdar, Kami Amiga, pivica, zrpnr, BrightBold, imalabya, jhedstrom, Neslee Canil Pinto, maliknaik, junaidmasoodi, Maithri Shetty, pranav73, mandclu, modulist, nod_, philosurfer, phenaproxima, mherchel, mlncn, rafuel92, leymannx, kiboman, Swapnil_Kotwal, anevins, evankay, rfmarcelino, thamas, brianperry, idebr, joelpittet, boulaffasae, alexpott, volkerk, DuneBL, Eli-T, Mahenkvyas22: Add Claro administration theme to core
2019-10-13 20:42:58 +00:00
|
|
|
foreach (['seven', 'claro'] as $theme) {
|
|
|
|
if (\Drupal::service('theme_handler')->themeExists($theme)) {
|
|
|
|
\Drupal::configFactory()
|
|
|
|
->getEditable("$theme.settings")
|
|
|
|
->clear('third_party_settings.shortcut')
|
|
|
|
->save(TRUE);
|
|
|
|
}
|
2014-12-10 20:08:40 +00:00
|
|
|
}
|
|
|
|
}
|