You are here

workbench.install in Workbench 8

Uninstall config.

File

workbench.install
View source
<?php

/**
 * @file
 * Uninstall config.
 */

/**
 * Implements hook_uninstall().
 */
function workbench_uninstall() {
  \Drupal::configFactory()
    ->getEditable('system.menu.workbench')
    ->delete();
}

/**
 * Add a menu for Workbench.
 */
function workbench_update_8001(&$sandbox) {
  $config_factory = \Drupal::configFactory();
  $config = $config_factory
    ->getEditable('system.menu.workbench');
  $config
    ->set('id', 'workbench');
  $config
    ->set('label', 'Workbench');
  $config
    ->set('description', 'The editorial workbench.');
  $config
    ->set('langcode', 'en');
  $config
    ->set('locked', TRUE);
  $config
    ->save(TRUE);
}

/**
 * Add the new settings for Workbench.
 */
function workbench_update_8002(&$sandbox) {
  $config_factory = \Drupal::configFactory();
  $config = $config_factory
    ->getEditable('workbench.settings');
  $config
    ->set('overview_left', 'workbench_current_user:block_1');
  $config
    ->set('overview_right', 'workbench_edited:block_1');
  $config
    ->set('overview_main', 'workbench_recent_content:block_1');
  $config
    ->set('edits_main', 'workbench_edited:embed_1');
  $config
    ->set('all_main', 'workbench_recent_content:embed_1');
  $config
    ->save(TRUE);
}

Functions

Namesort descending Description
workbench_uninstall Implements hook_uninstall().
workbench_update_8001 Add a menu for Workbench.
workbench_update_8002 Add the new settings for Workbench.