You are here

function blocktheme_set in Block Theme 8

Same name and namespace in other branches
  1. 5 blocktheme.module \blocktheme_set()
  2. 6 blocktheme.module \blocktheme_set()
  3. 7 blocktheme.module \blocktheme_set()

Set Block Theme custom block settings.

2 calls to blocktheme_set()
blocktheme_save in ./blocktheme.module
Save a new block a after the block form has been submitted.
blocktheme_update in ./blocktheme.module
Update an existing block after the block form has been submitted.

File

./blocktheme.module, line 167
Provides a configuration option to select custom themes for blocks

Code

function blocktheme_set($blocktheme, $blocktheme_vars = NULL) {
  $config = \Drupal::configFactory()
    ->getEditable('blocktheme.settings');
  $config
    ->set('blocktheme', $blocktheme)
    ->save();
  if ($blocktheme_vars !== NULL) {
    $config
      ->set('blocktheme_vars', $blocktheme_vars)
      ->save();
  }
}