You are here

function ca_ca_condition in Ubercart 6.2

Implements hook_ca_condition().

File

ca/ca.ca.inc, line 44
This file includes some generic conditions and actions.

Code

function ca_ca_condition() {
  $conditions = array();
  $conditions['ca_condition_date'] = array(
    '#title' => t('Check the current date'),
    '#description' => t('Used to determine if the action should be performed on the current date.'),
    '#category' => t('Drupal'),
    '#callback' => 'ca_condition_date',
    '#arguments' => array(),
  );
  $conditions['node_field_comparison'] = array(
    '#title' => t('Compare a node field value'),
    '#description' => t('Returns TRUE if the node field selected below compares to the value entered as specified by the operator.'),
    '#category' => t('Node'),
    '#callback' => 'ca_condition_node_field_comparison',
    '#arguments' => array(
      'node' => array(
        '#entity' => 'node',
      ),
    ),
  );
  $conditions['ca_condition_custom_php'] = array(
    '#title' => t('Execute custom PHP code'),
    '#description' => t('Returns whatever your custom PHP code returns.'),
    '#category' => t('System'),
    '#callback' => 'ca_condition_custom_php',
    '#arguments' => array(
      'arguments' => array(
        '#entity' => 'arguments',
        '#title' => t('Arguments'),
      ),
    ),
  );
  $conditions['ca_condition_user_roles'] = array(
    '#title' => t("Check the user's roles"),
    '#category' => t('User'),
    '#description' => t('Returns TRUE if the user roles match your settings.'),
    '#callback' => 'ca_condition_user_roles',
    '#arguments' => array(
      'account' => array(
        '#entity' => 'user',
        '#title' => t('User'),
      ),
    ),
  );
  return $conditions;
}