theme_select

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

includes/form.inc, строка 1405

Версии
5 – 6
theme_select($element)

Format a dropdown menu or scrolling selection box.

It is possible to group options together; to do this, change the format of $options to an associative array in which the keys are group labels, and the values are associative arrays in the normal $options format.

Параметры

$element An associative array containing the properties of the element. Properties used: title, value, options, description, extra, multiple, required

Возвращаемое значение

A themed HTML string representing the form element.

Связанные темы

▾ 1 функция вызывает theme_select()

theme_taxonomy_term_select in modules/taxonomy/taxonomy.module
Format the selection field for choosing terms (by deafult the default selection field is used).

Код

<?php
function theme_select($element) {
  $select = '';
  $size = $element['#size'] ? ' size="'. $element['#size'] .'"' : '';
  _form_set_class($element, array('form-select'));
  $multiple = $element['#multiple'];
  return theme('form_element', $element, '<select name="'. $element['#name'] .''. ($multiple ? '[]' : '') .'"'. ($multiple ? ' multiple="multiple" ' : '') . drupal_attributes($element['#attributes']) .' id="'. $element['#id'] .'" '. $size .'>'. form_select_options($element) .'</select>');
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему