actions_save

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 actions_save($function, $type, $params, $desc, $aid = NULL)

Save an action and its associated user-supplied parameter values to the database.

Übergabeparameter

$function The name of the function to be called when this action is performed.

$params An associative array with parameter names as keys and parameter values as values.

$desc A user-supplied description of this particular action, e.g., 'Send e-mail to Jim'.

$aid The ID of this action. If omitted, a new action is created.

Rückgabewert

The ID of the action.

Code

includes/actions.inc, line 320

<?php
function actions_save($function, $type, $params, $desc, $aid = NULL) {
  // aid is the callback for singleton actions so we need to keep a separate
  // table for numeric aids.
  if (!$aid) {
    $aid = db_insert('actions_aid')->useDefaults(array('aid'))->execute();
  }

  db_merge('actions')
    ->key(array('aid' => $aid))
    ->fields(array(
      'callback' => $function,
      'type' => $type,
      'parameters' => serialize($params),
      'description' => $desc,
    ))
    ->execute();

  watchdog('actions', 'Action %action saved.', array('%action' => $desc));
  return $aid;
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen