You are here

function _views_row_insert_get_blocks_definitions in Views Row Insert 8

Provides list of available system blocks definitions.

Return value

array Returns array.

2 calls to _views_row_insert_get_blocks_definitions()
template_preprocess_views_row_insert in ./views_row_insert.theme.inc
Implements template_preprocess_hook().
_views_row_insert_get_blocks in ./views_row_insert.module
Provides list of available system blocks for the form options.

File

./views_row_insert.module, line 72
Contains views_row_insert.module.

Code

function _views_row_insert_get_blocks_definitions() {
  $blockManager = \Drupal::service('plugin.manager.block');
  $contextRepository = \Drupal::service('context.repository');
  $definitions = $blockManager
    ->getDefinitionsForContexts($contextRepository
    ->getAvailableContexts());
  return $blockManager
    ->getSortedDefinitions($definitions);
}