home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (rules_admin.module)

This example Drupal source code file (rules_admin.module) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

access, arguments, array, callback, component_path, directory, file, form, items, page, reaction_path, rules, title, type

The rules_admin.module Drupal example source code

<?php
// $Id: rules_admin.module,v 1.1.4.8 2011/02/09 13:16:55 fago Exp $

/**
 * @file Rules Admin UI
 */

/**
 * Implements hook_menu().
 */
function rules_admin_menu() {
  // Reaction rules UI menu entries.
  $reaction_path = 'admin/config/workflow/rules/reaction';
  $items = rules_ui()->config_menu($reaction_path);

  $items[$reaction_path] = array(
    'title' => 'Rules',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -1,
  );
  $items[$reaction_path . '/add'] = array(
    'title' => 'Add new rule',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('rules_admin_add_reaction_rule', $reaction_path),
    'access arguments' => array('administer rules'),
    'type' => MENU_LOCAL_ACTION,
    'file' => 'rules_admin.inc',
    'weight' => 0,
  );
  $items[$reaction_path . '/import'] = array(
    'title' => 'Import rule',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('rules_ui_import_form', $reaction_path),
    'access arguments' => array('administer rules'),
    'file' => 'ui/ui.forms.inc',
    'file path' => drupal_get_path('module', 'rules'),
    'type' => MENU_LOCAL_ACTION,
  );

  // Components UI menu entries.
  $component_path = 'admin/config/workflow/rules/components';
  $items += rules_ui()->config_menu($component_path);
  $items[$component_path] = array(
    'title' => 'Components',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('rules_admin_components_overview', $component_path),
    'access arguments' => array('administer rules'),
    'type' => MENU_LOCAL_TASK,
    'file' => 'rules_admin.inc',
    'weight' => 0,
  );
  $items[$component_path . '/add'] = array(
    'title' => 'Add new component',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('rules_admin_add_component', $component_path),
    'access arguments' => array('administer rules'),
    'type' => MENU_LOCAL_ACTION,
    'file' => 'rules_admin.inc',
    'weight' => 0,
  );
  $items[$component_path . '/import'] = array(
    'title' => 'Import component',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('rules_ui_import_form', $component_path),
    'access arguments' => array('administer rules'),
    'file' => 'ui/ui.forms.inc',
    'file path' => drupal_get_path('module', 'rules'),
    'type' => MENU_LOCAL_ACTION,
  );

  // Some general rules admin menu items.
  $items['admin/config/workflow/rules'] = array(
    'title' => 'Rules',
    'position' => 'right',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('rules_admin_reaction_overview', $reaction_path),
    'description' => 'Manage reaction rules and rule components.',
    'access arguments' => array('administer rules'),
    'file' => 'rules_admin.inc',
  );
  $items['admin/config/workflow/rules/settings'] = array(
    'title' => 'Settings',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('rules_admin_settings'),
    'access arguments' => array('administer rules'),
    'type' => MENU_LOCAL_TASK,
    'file' => 'rules_admin.inc',
    'weight' => 1,
  );
  return $items;
}

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal rules_admin.module source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.