You are here

function crm_core_contact_context_condition_contact_type::options_form in CRM Core 7

Same name and namespace in other branches
  1. 8 modules/crm_core_contact/legacy/context/crm_core_contact_context_condition_contact_type.inc \crm_core_contact_context_condition_contact_type::options_form()
  2. 8.2 modules/crm_core_contact/legacy/context/crm_core_contact_context_condition_contact_type.inc \crm_core_contact_context_condition_contact_type::options_form()

Options form. Provide additional options for your condition.

Overrides context_condition::options_form

File

modules/crm_core_contact/includes/context/crm_core_contact_context_condition_contact_type.inc, line 36
Class for determining if the user is in the right contact context.

Class

crm_core_contact_context_condition_contact_type
Expose node views/node forms of specific node types as a context condition.

Code

function options_form($context) {
  $defaults = $this
    ->fetch_from_context($context, 'options');
  return array(
    'contact_form' => array(
      '#title' => t('Set on contact form'),
      '#type' => 'select',
      '#options' => array(
        CONTEXT_CRM_CONTACT_VIEW => t('No'),
        CONTEXT_CRM_CONTACT_NODE_FORM => t('Yes'),
        CONTEXT_CRM_CONTACT_NODE_FORM_ONLY => t('Only on contact form'),
      ),
      '#description' => t('Set this context on contact forms'),
      '#default_value' => isset($defaults['contact_form']) ? $defaults['contact_form'] : TRUE,
    ),
  );
}