You are here

function sharerich_install in Sharerich 8

Same name and namespace in other branches
  1. 7.3 sharerich.install \sharerich_install()
  2. 7 sharerich.install \sharerich_install()
  3. 7.2 sharerich.install \sharerich_install()

Implements hook_install().

File

./sharerich.install, line 13
Install, update, and uninstall functions for the sharerich module.

Code

function sharerich_install() {
  $default_theme = \Drupal::config('system.theme')
    ->get('default');

  // Create default block.
  Block::create(array(
    'id' => 'sharerich_block',
    'label' => t('Share this'),
    'type' => 'sharerich',
    'theme' => $default_theme,
    'region' => 'content',
    'weight' => -10,
    'provider' => NULL,
    'plugin' => 'sharerich',
    'settings' => array(
      'id' => 'sharerich_block',
      'label' => t('Share this'),
      'provider' => 'sharerich',
      'label_display' => 'visible',
      'sharerich_set' => 'default',
      'orientation' => 'vertical',
      'sticky' => TRUE,
    ),
  ))
    ->save();
}