You are here

rules_conditional.module in Conditional Rules 8

Same filename and directory in other branches
  1. 7 rules_conditional.module

Main module file.

File

rules_conditional.module
View source
<?php

/**
 * @file
 * Main module file.
 */

/**
 * Maximum number of loop iterations (effectively infinite).
 */
define('RULES_CONDITIONAL_MAX_ITERATIONS', 65535);

/**
 * Implements hook_rules_ui_menu_alter().
 */
function rules_conditional_rules_ui_menu_alter(&$items, $base_path, $base_count) {
  module_load_include('inc', 'rules_conditional', 'includes/rules_conditional.rules_admin');
  _rules_conditional_rules_ui_menu_alter($items, $base_path, $base_count);
}

/**
 * Creates a conditional.
 */
function rules_conditional() {
  return new RulesConditional();
}

/**
 * Creates an "if".
 */
function rules_conditional_if($predicate, array $settings = array()) {
  return new RulesConditionalIf($predicate, $settings);
}

/**
 * Creates an "else".
 */
function rules_conditional_else() {
  return new RulesConditionalElse();
}

/**
 * Creates a "switch".
 */
function rules_conditional_switch($data_selector) {
  return new RulesConditionalSwitch($data_selector);
}

/**
 * Creates a "case".
 */
function rules_conditional_case(array $settings = array(), $fall_through = FALSE) {
  return new RulesConditionalCase($settings, $fall_through);
}

/**
 * Creates a "default case".
 */
function rules_conditional_default_case() {
  return new RulesConditionalDefaultCase();
}

/**
 * Creates a "while".
 */
function rules_conditional_while($predicate, array $settings = array()) {
  return new RulesConditionalWhile($predicate, $settings);
}

/**
 * Creates a rule condition set.
 */
function rule_condition_set(array $variables = array()) {
  return new RuleConditionSet($variables);
}

/**
 * Implements hook_module_implements_alter().
 */
function rules_conditional_module_implements_alter(&$implementations, $hook) {
  if ($hook == 'rules_plugin_info') {
    $group = $implementations['rules_conditional'];
    unset($implementations['rules_conditional']);
    $implementations['rules_conditional'] = $group;
  }
}

Functions

Namesort descending Description
rules_conditional Creates a conditional.
rules_conditional_case Creates a "case".
rules_conditional_default_case Creates a "default case".
rules_conditional_else Creates an "else".
rules_conditional_if Creates an "if".
rules_conditional_module_implements_alter Implements hook_module_implements_alter().
rules_conditional_rules_ui_menu_alter Implements hook_rules_ui_menu_alter().
rules_conditional_switch Creates a "switch".
rules_conditional_while Creates a "while".
rule_condition_set Creates a rule condition set.

Constants

Namesort descending Description
RULES_CONDITIONAL_MAX_ITERATIONS Maximum number of loop iterations (effectively infinite).