You are here

public function SocialMediaLinksIconsetManager::getStyles in Social Media Links Block and Field 8.2

Return a array with the available styles for each (available) iconset.

Return value

array The array with the styles.

File

src/SocialMediaLinksIconsetManager.php, line 62

Class

SocialMediaLinksIconsetManager
Manager class for the iconset plugins.

Namespace

Drupal\social_media_links

Code

public function getStyles() {
  $options = [];
  foreach ($this
    ->getIconsets() as $iconset_id => $iconset) {

    // Only display options for iconsets that are installed and available.
    if ($iconset['instance']
      ->getPath()) {
      $styles = $iconset['instance']
        ->getStyle();
      foreach ($styles as $key => $style) {
        $options[$iconset_id][$iconset_id . ':' . $key] = $style;
      }
    }
    else {
      $options[$iconset_id] = [];
    }
  }
  return $options;
}