You are here

function patterns_reformat_actions in Patterns 7.2

Same name and namespace in other branches
  1. 7 includes/core/ \patterns_reformat_actions()

Group the action and the data fields.


array $actions The array of actions.:

2 calls to patterns_reformat_actions()
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.


includes/core/, line 360
The common functions used by the Batch and PHP running modes.


function patterns_reformat_actions(&$actions) {
  $valid_actions = patterns_actions();
  $newactions = array();
  foreach ($actions as $key => $value) {

    //$found = FALSE;
    foreach ($value as $akey => $avalue) {
      if (!array_key_exists($akey, $valid_actions)) {

        // Should not happen.
        drupal_set_message(t("Invalid action: %action.", $akey), 'error');
      else {
        $newactions[] = array(
          'action' => $akey,
          'data' => $avalue,
  $actions = $newactions;