You are here

function sms_og_admin_form in SMS Framework 5

Menu callback.

1 string reference to 'sms_og_admin_form'
sms_og_menu in modules/sms_og/sms_og.module
Implements hook_menu()

File

modules/sms_og/sms_og.module, line 21

Code

function sms_og_admin_form() {
  $types = node_get_types();
  $group_types = array();
  foreach ($types as $type => $key) {
    if (variable_get('og_content_type_usage_' . $type, '') == 'group') {
      $group_types[$type] = $type;
    }
  }
  if (count($group_types) > 1) {
    $form['sms_og_type'] = array(
      '#type' => 'select',
      '#title' => t('Choose the group type'),
      '#default_value' => variable_get('sms_og_type', ''),
      '#options' => $group_types,
    );
  }
  else {
    variable_set('sms_og_type', key($group_types));
  }
  if (variable_get('sms_og_type', '') != '') {
    $form['sms_og_field'] = array(
      '#type' => 'select',
      '#title' => t("Choose which %type field should be used for routing", array(
        '%type' => variable_get('sms_og_type', ''),
      )),
      '#default_value' => variable_get('sms_og_field', ''),
      '#options' => sms_receive_type_fields(variable_get('sms_og_type', '')),
    );
  }
  if (count($group_types) == 0) {
    $form['og_no_group'] = array(
      '#value' => t('Please create a group content type'),
    );
  }
  else {
    $form['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Submit'),
    );
  }
  return $form;
}