You are here

function og_subgroups_context_condition_has_siblings::condition_form in Subgroups for Organic groups 6

Condition form

File

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

Class

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

Code

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