Mercurial > hg > isophonics-drupal-site
view core/profiles/standard/standard.install @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | af1871eacc83 |
children |
line wrap: on
line source
<?php /** * @file * Install, update and uninstall functions for the standard installation profile. */ use Drupal\user\Entity\User; use Drupal\shortcut\Entity\Shortcut; /** * Implements hook_install(). * * Perform actions to set up the site for this profile. * * @see system_install() */ function standard_install() { // Assign user 1 the "administrator" role. $user = User::load(1); $user->roles[] = 'administrator'; $user->save(); // We install some menu links, so we have to rebuild the router, to ensure the // menu links are valid. \Drupal::service('router.builder')->rebuildIfNeeded(); // Populate the default shortcut set. $shortcut = Shortcut::create([ 'shortcut_set' => 'default', 'title' => t('Add content'), 'weight' => -20, 'link' => ['uri' => 'internal:/node/add'], ]); $shortcut->save(); $shortcut = Shortcut::create([ 'shortcut_set' => 'default', 'title' => t('All content'), 'weight' => -19, 'link' => ['uri' => 'internal:/admin/content'], ]); $shortcut->save(); }