You are here

function _syntaxhighlighter_get_enabled_language_brushes in Syntax Highlighter 8

Same name and namespace in other branches
  1. 6.2 syntaxhighlighter.module \_syntaxhighlighter_get_enabled_language_brushes()
  2. 7.2 syntaxhighlighter.module \_syntaxhighlighter_get_enabled_language_brushes()

Get the enabled programming languages from brushes names.

Return value

array An array of all enabled languages.

1 call to _syntaxhighlighter_get_enabled_language_brushes()
_syntaxhighlighter_filter_tips in ./syntaxhighlighter.module
Show usage tips for the syntaxhighlighter filter.

File

./syntaxhighlighter.module, line 249
Syntax highlight code using the SyntaxHighlighter Javascript library.

Code

function _syntaxhighlighter_get_enabled_language_brushes() {
  $config = \Drupal::config('syntaxhighlighter.settings');
  $brushes =& drupal_static(__FUNCTION__);
  if (!isset($brushes)) {
    $brushes = [];
    foreach ($config
      ->get('enabled_languages') as $val) {
      if ($val) {
        $brushes[] = strtolower(substr(substr($val, 7), 0, -3));
      }
    }
  }
  return $brushes;
}