You are here

function patterns_get_include_mode in Patterns 7

Same name and namespace in other branches
  1. 7.2 patterns.module \patterns_get_include_mode()

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.

3 calls to patterns_get_include_mode()
patterns_config_settings in includes/config.inc
Display the pattern settings form. @TODO proper doc.
patterns_forms_get_execution_options in includes/forms/forms.inc
Builds up a fieldset containing the options for executing a pattern.
patterns_parser_build_include_options in includes/parser/parser.inc

File

./patterns.module, line 880

Code

function patterns_get_include_mode($mode = NULL) {
  if (!is_null($mode)) {
    if (patterns_parser_is_valid_include_mode($mode)) {
      return $mode;
    }
  }
  $mode = variable_get('patterns_default_include_mode', PATTERNS_INCLUDE_NEVER);
  if (!patterns_parser_is_valid_include_mode($mode)) {
    $mode = PATTERNS_INCLUDE_NEVER;
  }
  return $mode;
}