You are here

function og_subgroups_context_condition_has_parent::condition_form in Subgroups for Organic groups 6

Condition form

File

modules/og_subgroups_context/plugins/og_subgroups_context_condition_has_parent.inc, line 15

Class

og_subgroups_context_condition_has_parent
Enable OG Subgroups to trigger a condition based on whether or not the current group has a parent

Code

function condition_form($context) {
  $default = $this
    ->fetch_from_context($context, 'values');
  if ($default) {
    $default = array_shift($default);
  }
  return array(
    'og_subgroups_context_has_parent' => array(
      '#title' => $this->title,
      '#type' => 'radios',
      '#options' => array(
        OG_SUBGROUPS_CONTEXT_NO_PARENT => t('Does not have a parent'),
        OG_SUBGROUPS_CONTEXT_HAS_PARENT => t('Has a parent'),
      ),
      '#description' => $this->description,
      '#default_value' => $default ? $default : OG_SUBGROUPS_CONTEXT_NO_PARENT,
    ),
  );
}