function language_types_get_configurable

Returns only the configurable language types.

A language type maybe configurable or fixed. A fixed language type is a type whose language negotiation methods 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 reaction 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

8 calls to language_types_get_configurable()
BlockFormController::form in drupal/core/modules/block/lib/Drupal/block/BlockFormController.php
Overrides \Drupal\Core\Entity\EntityFormController::form().
drupal_render_cid_parts in drupal/core/includes/common.inc
Returns cache ID parts for building a cache ID.
LanguageBlock::getDerivativeDefinitions in drupal/core/modules/language/lib/Drupal/language/Plugin/Derivative/LanguageBlock.php
Implements \Drupal\Component\Plugin\Derivative\DerivativeInterface::getDerivativeDefinitions().
LanguageNegotiationInfoTest::testInfoAlterations in drupal/core/modules/language/lib/Drupal/language/Tests/LanguageNegotiationInfoTest.php
Tests alterations to language types/negotiation info.
language_install in drupal/core/modules/language/language.install
Implements hook_install().

... See full list

1 string reference to 'language_types_get_configurable'
language_types_set in drupal/core/includes/language.inc
Updates the language type configuration.

File

drupal/core/includes/language.inc, line 180
Language Negotiation API.

Code

function language_types_get_configurable($stored = TRUE) {
  $configurable =& drupal_static(__FUNCTION__);
  if ($stored && !isset($configurable)) {
    $types = variable_get('language_types', language_types_get_default());
    $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;
}