29 нояб. 2011 г.

drupal 7 создание массива options функцией drupal_map_assoc

 $form['nice_menus_type_' . $delta] = array(
    '#type' => 'select',
    '#title' => t('Menu Style'),
    '#description' => t('right: menu items are listed on top of each other and expand to the right') . '<br />' . t('left: menu items are listed on top of each other and expand to the left') . '<br />' . t('down: menu items are listed side by side and expand down'),
    '#default_value' => variable_get('nice_menus_type_' . $delta, 'right'),
    '#options' => drupal_map_assoc(array('right', 'left', 'down')),
  );