You are here

function patterns_api_add_action in Patterns 7.2

Same name and namespace in other branches
  1. 7 includes/api/api.inc \patterns_api_add_action()

Adds an action to a section

Checks that the action has the 'tag' key

Parameters

mixed $action: A valid Patterns action, e.g. PATTERNS_CREATE, PATTERNS_MODIFY, etc.

Array $data: The tag of the action and the additional properties

Array $section Optional: The containing section

File

includes/api/api.inc, line 153
API for writing pattern files.

Code

function patterns_api_add_action($action = PATTERNS_CREATE, $data = array(), &$section = array()) {
  if (!isset($data['tag'])) {
    return FALSE;
  }
  $section[] = array(
    $action => $data,
  );
  return TRUE;
}