You are here

function _potx_element_has_schema in Translation template extractor 6.3

Same name and namespace in other branches
  1. 8 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:

Return value

boolean

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 configuration with the processed schema.

File

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

Code

function _potx_element_has_schema($type) {
  global $_potx_processed_schema;

  // 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]);
}