You are here

public static function GeshiFilter::getEnabledLanguages in GeSHi Filter for syntax highlighting 8.2

Same name and namespace in other branches
  1. 8 src/GeshiFilter.php \Drupal\geshifilter\GeshiFilter::getEnabledLanguages()

List of enabled languages(with caching).

Return value

array Array with enabled languages mapping language code to full name.

10 calls to GeshiFilter::getEnabledLanguages()
CodeSnippetGeshiCKEditorButton::getConfig in codesnippetgeshi/src/Plugin/CKEditorPlugin/CodeSnippetGeshiCKEditorButton.php
Returns the additions to CKEDITOR.config for a specific CKEditor instance.
GeshiFieldDefaultWidget::formElement in geshifield/src/Plugin/Field/FieldWidget/GeshiFieldDefaultWidget.php
Returns the form for a single field widget.
GeshiFilterCss::generateLanguagesCssFile in src/GeshiFilterCss.php
Function for generating the external stylesheet.
GeshiFilterCss::generateLanguagesCssRules in src/GeshiFilterCss.php
Helper function for generating the CSS rules.
GeshiFilterFilter::getTags in src/Plugin/Filter/GeshiFilterFilter.php
Helper function for gettings the tags.

... See full list

File

src/GeshiFilter.php, line 202

Class

GeshiFilter
Contains constants and some helper functions.

Namespace

Drupal\geshifilter

Code

public static function getEnabledLanguages() {
  $config = \Drupal::config('geshifilter.settings');
  static $enabled_languages = NULL;
  if ($enabled_languages === NULL) {
    $enabled_languages = [];
    $languages = self::getAvailableLanguages();
    foreach ($languages as $language => $language_data) {
      if ($config
        ->get('language.' . $language . ".enabled")) {
        $enabled_languages[$language] = $language_data['fullname'];
      }
    }
  }
  return $enabled_languages;
}