You are here

function mlidselector_field_widget_settings_form in Views Menu Support 7

Same name and namespace in other branches
  1. 8 mlidselector.module \mlidselector_field_widget_settings_form()

Implements hook_field_widget_settings_form().

File

./mlidselector.module, line 97
Functions to provide a menu item reference widget for integer fields.

Code

function mlidselector_field_widget_settings_form($field, $instance) {
  $form = array();

  // Create these variables by reference. No need to increase memory usage just
  // because we want to write variables in a readable way.
  $widget =& $instance['widget'];
  $settings =& $widget['settings'];
  if ($widget['type'] == 'field_mlid_reference') {
    $form['menus'] = array(
      '#type' => 'checkboxes',
      '#title' => t('Selectable menus'),
      '#default_value' => $settings['menus'],
      '#options' => menu_get_menus(),
      '#description' => t('Select which menus should be possible to refer to.'),
      '#weight' => -1,
      '#required' => TRUE,
    );
    $form['show_front'] = array(
      '#type' => 'checkbox',
      '#title' => t('Enable front page menu items'),
      '#description' => t('Check this box to enable all menu items linking to the front page.'),
      '#default_value' => $settings['show_front'],
      '#weight' => -1,
    );
  }
  return $form;
}