You are here

protected function ResponsiveShareButtonsBlock::getActiveNetworks in Responsive Share Buttons 8

Get active social networks.

1 call to ResponsiveShareButtonsBlock::getActiveNetworks()
ResponsiveShareButtonsBlock::build in src/Plugin/Block/ResponsiveShareButtonsBlock.php
Builds and returns the renderable array for this block plugin.

File

src/Plugin/Block/ResponsiveShareButtonsBlock.php, line 62

Class

ResponsiveShareButtonsBlock
Provides a 'Responsive Share buttons' block.

Namespace

Drupal\responsive_share_buttons\Plugin\Block

Code

protected function getActiveNetworks() {
  $config = \Drupal::config('responsive_share_buttons.settings');
  $networks = $config
    ->get('networks');
  $network_list = [];
  foreach ($networks as $name => $network) {
    if (!empty($network['active'])) {
      $network_list[] = $name;
    }
  }
  return $network_list;
}