You are here

public function MenuBeanType::form in Menu Bean 7

The Plugin Form

The Bean object will be either loaded from the database or filled with the defaults.

_state

Parameters

$bean:

$form:

Return value

array form array

Overrides BeanPlugin::form

File

plugins/MenuBeanType.class.php, line 17

Class

MenuBeanType

Code

public function form($bean, $form, &$form_state) {
  $menus = menu_get_menus();
  $form['menu_name'] = array(
    '#type' => 'select',
    '#title' => t('Menu'),
    '#default_value' => $bean->menu_name,
    '#options' => $menus,
  );
  $settings = menu_bean_get_settings();
  foreach ($settings as $key => $class) {
    menu_bean_load_setting_class($key)
      ->form($bean, $form, $form_state);
  }
  return $form;
}