You are here

function og_menu_config_form in Organic Groups Menu (OG Menu) 7.2

Same name and namespace in other branches
  1. 7.3 og_menu.admin.inc \og_menu_config_form()

Form callback for OG Menu configuration.

1 string reference to 'og_menu_config_form'
og_menu_menu in ./og_menu.module
Implementation of hook_menu().

File

./og_menu.pages.inc, line 202
Contains page callbacks for og_menu

Code

function og_menu_config_form($form, &$form_state) {
  $form['og_menu_block_links'] = array(
    '#type' => 'checkbox',
    '#title' => t('Convert OG Menu block titles into links'),
    '#default_value' => variable_get('og_menu_block_links', FALSE),
    '#description' => t('If enabled, OG Menu block titles will link to the group node.'),
  );
  $form['og_menu_max_menus_per_group'] = array(
    '#type' => 'textfield',
    '#title' => t('Maximum number of menus per group'),
    '#default_value' => variable_get('og_menu_max_menus_per_group', 1),
    '#size' => 20,
    '#maxlength' => 5,
    '#required' => TRUE,
    '#description' => t('Enter 0 for no limit. Users with the \'administer menu\' permission will be able to bypass this.'),
  );
  $form['og_menu_assignment'] = array(
    '#type' => 'radios',
    '#options' => array(
      'select' => t('Select list'),
      'autocomplete' => t('Textbox with autocomplete'),
    ),
    '#title' => t('Use autocomplete field on menu admin page'),
    '#default_value' => variable_get('og_menu_assignment', 'autocomplete'),
    '#required' => 'TRUE',
    '#description' => t('Autocomplete is recommended when you have a lot of organic groups.'),
  );
  $form['og_menu_visibility'] = array(
    '#type' => 'fieldset',
    '#title' => t('Admin page visibility'),
    '#description' => t("On sites with multiple OG Menu's it might be prefereable to hide them in places where you don't need them."),
  );
  $form['og_menu_visibility']['og_menu_show_blocks'] = array(
    '#type' => 'checkbox',
    '#title' => t("Show blocks for individual OG Menu's"),
    '#default_value' => variable_get('og_menu_show_blocks', FALSE),
    '#description' => t("If disabled, blocks for OG Menu's will be hidden from the block administration page."),
  );
  $form['og_menu_visibility']['og_menu_show_nodetype'] = array(
    '#type' => 'checkbox',
    '#title' => t("Include OG Menu's in node type menu settings"),
    '#default_value' => variable_get('og_menu_show_nodetype', FALSE),
    '#description' => t("If disabled, OG Menu's will be hidden from the node type config page."),
  );
  if (module_exists('menu_position')) {
    $form['og_menu_visibility']['og_menu_show_menuposition'] = array(
      '#type' => 'checkbox',
      '#title' => t("Show as available parent in menu position rules."),
      '#default_value' => variable_get('og_menu_show_menuposition', FALSE),
      '#description' => t("If disabled, OG Menu's will be hidden from the menu position parent selection dropdown."),
    );
  }
  if (module_exists('homebox')) {
    $form['og_menu_visibility']['og_menu_show_homebox'] = array(
      '#type' => 'checkbox',
      '#title' => t("Show blocks in Homebox admin page"),
      '#default_value' => variable_get('og_menu_show_homebox', FALSE),
      '#description' => t("If disabled, blocks for OG Menu's will be hidden from the homebox administration page."),
    );
  }
  return system_settings_form($form);
}