function language_types_configurable

language_types_configurable($stored = TRUE)

Returns only the configurable language types.

A language type maybe configurable or fixed. A fixed language type is a type whose language negotiation providers are module-defined and not altered through the user interface.

Parameters

$stored: Optional. By default retrieves values from the 'language_types' variable to avoid unnecessary hook invocations. If set to FALSE retrieves values from the actual language type definitions. This allows to react to alterations performed on the definitions by modules installed after the 'language_types' variable is set.

Return value

An array of language type names.

Related topics

File

includes/language.inc, line 139
Language Negotiation API.

Code

function language_types_configurable($stored = TRUE) {
  $configurable = &drupal_static(__FUNCTION__);

  if ($stored && !isset($configurable)) {
    $types = variable_get('language_types', drupal_language_types());
    $configurable = array_keys(array_filter($types));
  }

  if (!$stored) {
    $result = array();
    foreach (language_types_info() as $type => $info) {
      if (!isset($info['fixed'])) {
        $result[] = $type;
      }
    }
    return $result;
  }

  return $configurable;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!language.inc/function/language_types_configurable/7.x