You are here

function _datex_language_calendar_name in Datex 8

Same name and namespace in other branches
  1. 7.3 datex.module \_datex_language_calendar_name()

Get calendar for a/current language in a mode (if given) from schema.

Parameters

string $for_schema:

null $for_lang:

Return value

null

File

./datex.inc.php, line 53

Code

function _datex_language_calendar_name($for_schema = 'default', $for_lang = NULL) {
  if (!$for_lang) {
    $for_lang = \Drupal::languageManager()
      ->getCurrentLanguage()
      ->getId();
  }
  if (!$for_schema) {
    $for_schema = 'default';
  }
  $cfg = \Drupal::config('datex.schemas')
    ->get($for_schema);
  return is_array($cfg) && isset($cfg[$for_lang]) ? $cfg[$for_lang] : NULL;
}