You are here

function patterns_execute_action in Patterns 5

Same name and namespace in other branches
  1. 6.2 patterns.module \patterns_execute_action()
  2. 6 patterns.module \patterns_execute_action()
  3. 7.2 includes/core/common.inc \patterns_execute_action()
  4. 7 includes/core/common.inc \patterns_execute_action()

Execute an action

1 call to patterns_execute_action()
patterns_execute_pattern in ./patterns.module

File

./patterns.module, line 1064
Enables extremely simple adding/removing features to your site with minimal to no configuration

Code

function patterns_execute_action($form_id, $values, $params) {

  // Make sure we always have a clear cache for everything
  $result = db_query('SHOW TABLES LIKE "cache_%"');
  while ($table = db_fetch_array($result)) {
    $table = current($table);
    cache_clear_all(null, $table);
  }
  $args = array(
    $form_id,
    $values,
  );
  if (is_array($params)) {
    $args = array_merge($args, $params);
  }
  patterns_executing(true);

  //$form = call_user_func_array('drupal_retrieve_form', $args);

  //$form['#post'] = $values;

  //$return = drupal_process_form($form_id, $form);
  $return = call_user_func_array('drupal_execute', $args);
  patterns_executing(false);
  return $return;
}