You are here

function _potx_element_has_schema in Translation template extractor 8

Same name and namespace in other branches
  1. 6.3 potx.inc \_potx_element_has_schema()
  2. 7.3 potx.inc \_potx_element_has_schema()
  3. 7.2 potx.inc \_potx_element_has_schema()

Checks whether an element exists in the processed schema.

Parameters

string $type: The element type.

Return value

bool Where the element exists in the processed schema.

2 calls to _potx_element_has_schema()
_potx_find_matching_schema in ./potx.inc
Find the schema element matching with a specific type.
_potx_find_shipped_config_translatables in ./potx.inc
Recursively check elements in shipped config with the processed schema.

File

./potx.inc, line 2594
Extraction API used by the web and command line interface.

Code

function _potx_element_has_schema($type) {
  global $_potx_processed_schema;
  if (empty($_potx_processed_schema)) {
    return FALSE;
  }

  // If an element doesn't exist in any of the extracted lists, it hasn't been
  // defined in schema. This is checked during processing shipped config.
  return in_array($type, $_potx_processed_schema['translatables']) || in_array($type, $_potx_processed_schema['mappings']) || isset($_potx_processed_schema['types'][$type]);
}