You are here

function ctools_context_language_conf_defaults in Chaos Tool Suite (ctools) 7

Ensures a full populated settings array with sane defaults.

Parameters

mixed $conf: Array with the user defined settings, or a string identifying a language.

Return value

array Array with all available settings.

2 calls to ctools_context_language_conf_defaults()
ctools_context_language_create in plugins/contexts/language.inc
Create a context, either from manual configuration or the current language.
ctools_context_language_settings_form in plugins/contexts/language.inc
Settings form.

File

plugins/contexts/language.inc, line 44
Ctools context type plugin to hold the current language context.

Code

function ctools_context_language_conf_defaults($conf = array()) {
  if (!is_array($conf)) {
    $conf = array(
      'preset_langcode' => (string) $conf,
    );
  }
  return $conf + array(
    'enable_cache_argument' => TRUE,
    'language_type' => 'language',
    'preset_langcode' => $GLOBALS['language']->language,
  );
}