You are here

function opigno_module_update_8029 in Opigno module 8

Add learning path progress block to top region

File

./opigno_module.install, line 1445
Opigno module app install/update functionality.

Code

function opigno_module_update_8029() {
  if (\Drupal::entityTypeManager()
    ->getStorage('block')
    ->load('learningpathprogress')) {
    return;
  }
  $values = array(
    'id' => 'learningpathprogress',
    'plugin' => 'opigno_module_learning_path_progress_block',
    'region' => 'top',
    'settings' => array(
      'id' => 'opigno_module_learning_path_progress_block',
      'provider' => 'opigno_module',
      'label' => 'Learning path progress',
      'label_display' => '0',
    ),
    'theme' => 'platon',
    'visibility' => array(),
    'weight' => 0,
  );
  $block = \Drupal\block\Entity\Block::create($values);
  $block
    ->save();
}