You are here

function patterns_parser_is_valid_include_mode in Patterns 7

Same name and namespace in other branches
  1. 7.2 includes/parser/parser.inc \patterns_parser_is_valid_include_mode()

Returns TRUE if the passed parameter is a valid flag to configure Patterns behaviors with the 'include' tag.

3 calls to patterns_parser_is_valid_include_mode()
patterns_get_include_mode in ./patterns.module
Returns the current option for included patterns, as it is in the database. If the option stored in the database is not valid, by default patterns' inclusion is disabled.
patterns_parser_should_include in includes/parser/parser.inc
Determines if a pattern should be included or not. The following conditions are checked in order:
patterns_parser_should_include_local in includes/parser/parser.inc
Determines whether an pattern should be included based on the local configuration (the pattern code itself).

File

includes/parser/parser.inc, line 725

Code

function patterns_parser_is_valid_include_mode($mode = NULL) {
  if (is_null($mode)) {
    return FALSE;
  }
  $modes = array(
    PATTERNS_INCLUDE_NEVER,
    PATTERNS_INCLUDE_FIRSTRUN,
    PATTERNS_INCLUDE_UPDATE,
    PATTERNS_INCLUDE_FIRSTRUN_OR_UPDATE,
    PATTERNS_INCLUDE_ATTACHED,
    PATTERNS_INCLUDE_ALWAYS,
  );
  return in_array($mode, $modes) ? TRUE : FALSE;
}