You are here

function _patterns_has_uninterpretable_attributes in Patterns 7.2

Auxiliar function that can be used by the components to check if the action has any attributes that will not be interpretable.

@TO-DO: Find a cleaner way to input the <br>

Parameters

array $attributes List of attributes in the current action:

array $interpretable_attributes List attributes interpretable for the component for this case:

string $msg Message that will be promted to the user:

Return value

boolean Returns TRUE if any uninterpreatable attributes is found, FALSE otherwise

7 calls to _patterns_has_uninterpretable_attributes()
block_patterns_validate in patterns_components/components/block.inc
color_patterns_validate in patterns_components/components/color.inc
field_patterns_validate in patterns_components/components/field.inc
menu_patterns_validate in patterns_components/components/menu.inc
pathauto_patterns_validate in patterns_components/components/pathauto.inc

... See full list

File

patterns_components/patterns_components.module, line 48

Code

function _patterns_has_uninterpretable_attributes($attributes, $interpretable_attributes, &$msg) {
  $result = FALSE;
  foreach ($attributes as $att => $value) {
    if (!in_array($att, $interpretable_attributes)) {
      $msg .= t('Attribute %att cannot be interpreted by the component.<br>', array(
        '%att' => $att,
      ));
      $result = TRUE;
    }
  }
  return $result;
}