actions_list

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 actions_list($reset = FALSE)

Discover all action functions by invoking hook_action_info().

<?php

mymodule_action_info() {
  return array(
    'mymodule_functiondescription_action' => array(
      'type' => 'node',
      'description' => t('Save node'),
      'configurable' => FALSE,
      'hooks' => array(
        'nodeapi' => array('delete', 'insert', 'update', 'view'),
        'comment' => array('delete', 'insert', 'update', 'view'),
      )
    )
  );
}

?>

The description is used in presenting possible actions to the user for configuration. The type is used to present these actions in a logical grouping and to denote context. Some types are 'node', 'user', 'comment', and 'system'. If an action is configurable it will provide form, validation and submission functions. The hooks the action supports are declared in the 'hooks' array.

Übergabeparameter

$reset Reset the action info static cache.

Rückgabewert

An associative array keyed on function name. The value of each key is an array containing information about the action, such as type of action and description of the action, e.g.,

<?php

  $actions['node_publish_action'] = array(
    'type' => 'node',
    'description' => t('Publish post'),
    'configurable' => FALSE,
    'hooks' => array(
      'nodeapi' => array('presave', 'insert', 'update', 'view'),
      'comment' => array('delete', 'insert', 'update', 'view'),
    ),
  );
  
?>

▾ 9 functions call actions_list()

actions_do in includes/actions.inc
Perform a given list of actions by executing their callback functions.
actions_function_lookup in includes/actions.inc
Given an md5 hash of a function name, return the function name.
actions_synchronize in includes/actions.inc
Synchronize actions that are provided by modules.
system_actions_configure in modules/system/system.module
Menu callback. Create the form for configuration of a single action.
system_actions_manage in modules/system/system.module
Menu callback. Display an overview of available and configured actions.
system_actions_remove_orphans in modules/system/system.module
Remove actions that are in the database but not supported by any enabled module.
trigger_assign_form in modules/trigger/trigger.admin.inc
Create the form definition for assigning an action to a hook-op combination.
trigger_assign_form_submit in modules/trigger/trigger.admin.inc
Submit function for trigger_assign_form().
trigger_install in modules/trigger/trigger.install
Implementation of hook_install().

Code

includes/actions.inc, line 206

<?php
function actions_list($reset = FALSE) {
  static $actions;
  if (!isset($actions) || $reset) {
    $actions = module_invoke_all('action_info');
    drupal_alter('action_info', $actions);
  }

  // See module_implements for explanations of this cast.
  return (array) $actions;
}
?>

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