DsRegionBlock.php in Display Suite 8.2
File
modules/ds_extras/src/Plugin/Derivative/DsRegionBlock.php
View source
<?php
namespace Drupal\ds_extras\Plugin\Derivative;
use Drupal\Component\Plugin\Derivative\DeriverBase;
class DsRegionBlock extends DeriverBase {
public function getDerivativeDefinitions($base_plugin_definition) {
$region_blocks = \Drupal::config('ds_extras.settings')
->get('region_blocks');
if (empty($region_blocks)) {
return $this->derivatives;
}
foreach ($region_blocks as $key => $block) {
$this->derivatives[$key] = $base_plugin_definition;
$this->derivatives[$key]['delta'] = $key;
$this->derivatives[$key]['admin_label'] = $block['title'];
}
return $this->derivatives;
}
}