action.module

This is the Actions module for executing stored actions.

File

drupal/core/modules/action/action.module
View source
<?php

/**
 * @file
 * This is the Actions module for executing stored actions.
 */

/**
 * Implements hook_help().
 */
function action_help($path, $arg) {
  switch ($path) {
    case 'admin/help#action':
      $output = '<p>' . t('Actions are individual tasks that the system can do, such as unpublishing a piece of content or banning a user. Other modules can fire these actions when certain system events happen; for example, when a new post is added or when a user logs in. Modules may also provide additional actions. Visit the <a href="@actions">Actions page</a> to configure actions.', array(
        '@actions' => url('admin/config/system/actions'),
      )) . '</p>';
      return $output;
    case 'admin/config/system/actions':
    case 'admin/config/system/actions/manage':
      $output = '<p>' . t('There are two types of actions: simple and advanced. Simple actions do not require any additional configuration and are listed here automatically. Advanced actions need to be created and configured before they can be used because they have options that need to be specified; for example, sending an e-mail to a specified address or unpublishing content containing certain words. To create an advanced action, select the action from the drop-down list in the advanced action section below and click the <em>Create</em> button.') . '</p>';
      return $output;
    case 'admin/config/system/actions/configure':
      return t('An advanced action offers additional configuration options which may be filled out below. Changing the <em>Description</em> field is recommended in order to better identify the precise action taking place.');
  }
}

/**
 * Implements hook_permission().
 */
function action_permission() {
  return array(
    'administer actions' => array(
      'title' => t('Administer actions'),
    ),
  );
}

/**
 * Implements hook_menu().
 */
function action_menu() {
  $items['admin/config/system/actions'] = array(
    'title' => 'Actions',
    'description' => 'Manage the actions defined for your site.',
    'route_name' => 'action_admin',
  );
  $items['admin/config/system/actions/manage'] = array(
    'title' => 'Manage actions',
    'description' => 'Manage the actions defined for your site.',
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['admin/config/system/actions/add'] = array(
    'title' => 'Create an advanced action',
    'type' => MENU_VISIBLE_IN_BREADCRUMB,
    'route_name' => 'action_admin_add',
  );
  $items['admin/config/system/actions/configure'] = array(
    'title' => 'Configure an advanced action',
    'type' => MENU_VISIBLE_IN_BREADCRUMB,
    'route_name' => 'action_admin_configure',
  );
  $items['admin/config/system/actions/configure/%/delete'] = array(
    'title' => 'Delete action',
    'description' => 'Delete an action.',
    'route_name' => 'action_delete',
  );
  return $items;
}

/**
 * Implements hook_entity_info().
 */
function action_entity_info(&$entity_info) {
  $entity_info['action']['controllers']['form']['add'] = 'Drupal\\action\\ActionAddFormController';
  $entity_info['action']['controllers']['form']['edit'] = 'Drupal\\action\\ActionEditFormController';
  $entity_info['action']['controllers']['list'] = 'Drupal\\action\\ActionListController';
}

Functions

Namesort descending Description
action_entity_info Implements hook_entity_info().
action_help Implements hook_help().
action_menu Implements hook_menu().
action_permission Implements hook_permission().