You are here

function patterns_parser_retrieve_actions_from_section in Patterns 7.2

Same name and namespace in other branches
  1. 7 includes/parser/ \patterns_parser_retrieve_actions_from_section()

Returns all the actions from a a given section


array $section:

array $pattern the pattern to scan:

3 calls to patterns_parser_retrieve_actions_from_section()
patterns_execute_pattern_batch in includes/core/
Starts preliminary operations for pattern execution.
patterns_execute_pattern_php in includes/core/
Execute a Pattern. Actions will be called sequentially.
patterns_parser_extract_all_actions in includes/parser/
Extract all the actions from a pattern and returns them as an array.


includes/parser/, line 415


function patterns_parser_retrieve_actions_from_section($section, $options = array()) {
  if (empty($section)) {
    return FALSE;
  $actions = array();
  foreach ($section as $key => $value) {
    $action = key($value);
    if (in_array($action, patterns_actions())) {
      if ($action !== PATTERNS_INCLUDE) {
        $actions[] = $section[$key];
      else {
        $include = $value[PATTERNS_INCLUDE];
        if (patterns_parser_should_include_local($include, $options)) {

          // $actions is passed as reference
          patterns_parser_include_pattern($actions, $include['pattern'], $options);

          //            $new_actions =  _patterns_parser_retrieve_actions_from_include($include, $options);
          //            $actions = array_merge($actions, $new_actions);
  return $actions;