[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/rules/rules_test/ -> rules_test.rules.inc (source)

   1  <?php
   2  // $Id: rules_test.rules.inc,v 1.1.2.6 2009/04/19 15:03:43 fago Exp $
   3  
   4  
   5  /**
   6   * @file Define some conditions and actions, used by the tests
   7   */
   8  
   9  /**
  10   * Implementation of hook_rules_condition_info
  11   */
  12  function rules_test_rules_condition_info() {
  13    return array(
  14      'rules_test_condition_alter_arg' => array(
  15        'label' => 'Alter data',
  16        'arguments' => array('rules_test' => array('type' => 'rules_test', 'label' => 'test')),
  17        'hidden' => TRUE,
  18      ),
  19      'rules_test_condition_check_for_altered_arg' => array(
  20        'label' => 'Check for altered data',
  21        'arguments' => array('rules_test' => array('type' => 'rules_test', 'label' => 'test')),
  22        'hidden' => TRUE,
  23      ),
  24    );
  25  }
  26  
  27  /**
  28   * Implementation of hook_rules_action_info
  29   */
  30  function rules_test_rules_action_info() {
  31    return array(
  32      'rules_test_action_log_msg' => array(
  33        'label' => 'Logs a message to the rules log',
  34        'arguments' => array(),
  35        'hidden' => TRUE,
  36      ),
  37      'rules_test_change_arg' => array(
  38        'label' => 'Changes the argument',
  39        'arguments' => array('rules_test' => array('type' => 'rules_test', 'label' => 'test')),
  40        'hidden' => TRUE,
  41      ),
  42      'rules_test_add_var' => array(
  43        'label' => 'Adds a new variable',
  44        'new variables' => array('rules_test' => array('type' => 'rules_test', 'label' => 'test')),
  45        'hidden' => TRUE,
  46      ),
  47    );
  48  }
  49  
  50  function rules_test_condition_alter_arg(&$array) {
  51    $array['altered'] = TRUE;
  52    return TRUE;
  53  }
  54  
  55  function rules_test_condition_check_for_altered_arg($array) {
  56    return isset($array['altered']) && $array['altered'];
  57  }
  58  
  59  function rules_test_action_log_msg($settings) {
  60    rules_log($settings['msg']);
  61  }
  62  
  63  function rules_test_change_arg($array) {
  64    $array['altered'] = TRUE;
  65    return array('rules_test' => $array);
  66  }
  67  
  68  function rules_test_add_var() {
  69    $array['altered'] = FALSE;
  70    return array('rules_test' => $array);
  71  }
  72  


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7