? .buildpath ? .project ? .settings ? sites/default/files ? sites/default/settings.php Index: install.php =================================================================== RCS file: /cvs/drupal/drupal/install.php,v retrieving revision 1.160 diff -u -p -r1.160 install.php --- install.php 17 Mar 2009 15:26:29 -0000 1.160 +++ install.php 22 Mar 2009 14:03:59 -0000 @@ -1019,7 +1019,13 @@ function install_configure_form(&$form_s ); $countries = country_get_list(); - $countries = array_merge(array('' => st('No default country')), $countries); + $countries = array_merge( + array(array( + '#return_value' => '', + '#value' => st('No default country'), + '#attributes' => array(), + )), + $countries); $form['server_settings']['site_default_country'] = array( '#type' => 'select', '#title' => t('Default country'), Index: includes/form.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/form.inc,v retrieving revision 1.324 diff -u -p -r1.324 form.inc --- includes/form.inc 14 Mar 2009 20:13:26 -0000 1.324 +++ includes/form.inc 22 Mar 2009 14:04:06 -0000 @@ -1455,7 +1455,12 @@ function form_options_flatten($array, $r form_options_flatten($value->option, FALSE); } elseif (is_array($value)) { - form_options_flatten($value, FALSE); + if (isset($value['#value']) && isset($value['#return_value'])) { + $return[$value['#return_value']] = 1; + } + else { + form_options_flatten($value, FALSE); + } } else { $return[$key] = 1; @@ -1498,23 +1503,43 @@ function form_select_options($element, $ $value_is_array = is_array($element['#value']); $options = ''; foreach ($choices as $key => $choice) { - if (is_array($choice)) { - $options .= ''; - $options .= form_select_options($element, $choice); - $options .= ''; + if (is_object($choice)) { + $optioncontent = each($choice->option); + $choice = array( + '#value' => $optioncontent['value'], + '#return_value' => $optioncontent['key'], + ); } - elseif (is_object($choice)) { - $options .= form_select_options($element, $choice->option); + if (!is_array($choice)) { + $choice = array('#value' => $choice); + } + elseif (!isset($choice['#value']) && !isset($choice['#options'])) { + $choice = array('#value' => array_shift($choice)); + } + elseif (!isset($choice['#value']) && isset($choice['#options'])) { + $choice['#value'] = (string)$key; + } + if (!isset($choice['#return_value'])) { + $choice['#return_value'] = (string)$key; + } + + if (isset($choice['#options']) && is_array($choice['#options'])) { + $options .= ''; + $options .= form_select_options($element, $choice['#options']); + $options .= ''; } else { - $key = (string)$key; - if ($value_valid && (!$value_is_array && (string)$element['#value'] === $key || ($value_is_array && in_array($key, $element['#value'])))) { + if ($value_valid && (!$value_is_array && (string)$element['#value'] === $choice['#return_value'] + || ($value_is_array && in_array($choice['#return_value'], $element['#value'])))) { $selected = ' selected="selected"'; } else { $selected = ''; } - $options .= ''; + if (!isset($choice['#attributes'])) { + $choice['#attributes'] = array(); + } + $options .= ''; } } return $options; Index: includes/locale.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/locale.inc,v retrieving revision 1.207 diff -u -p -r1.207 locale.inc --- includes/locale.inc 19 Mar 2009 10:48:51 -0000 1.207 +++ includes/locale.inc 22 Mar 2009 14:04:10 -0000 @@ -708,8 +708,14 @@ function locale_translate_import_form() } else { $languages = array( - t('Already added languages') => $names, - t('Languages not yet added') => _locale_prepare_predefined_list() + array( + '#value' => t('Already added languages'), + '#options' => $names, + ), + array( + '#value' => t('Languages not yet added'), + '#options' => _locale_prepare_predefined_list(), + ), ); $default = key($names); } Index: modules/trigger/trigger.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/trigger/trigger.admin.inc,v retrieving revision 1.9 diff -u -p -r1.9 trigger.admin.inc --- modules/trigger/trigger.admin.inc 8 Mar 2009 04:25:07 -0000 1.9 +++ modules/trigger/trigger.admin.inc 22 Mar 2009 14:04:13 -0000 @@ -132,7 +132,10 @@ function trigger_assign_form($form_state } foreach (actions_actions_map(actions_get_all_actions()) as $aid => $action) { if (in_array($action['callback'], $functions)) { - $options[$action['type']][$aid] = $action['description']; + $options[$action['type']]['#options'][] = array( + '#value' => $action['description'], + '#return_value' => $aid, + ); } } Index: modules/user/user.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.admin.inc,v retrieving revision 1.40 diff -u -p -r1.40 user.admin.inc --- modules/user/user.admin.inc 26 Feb 2009 07:30:28 -0000 1.40 +++ modules/user/user.admin.inc 22 Mar 2009 14:04:15 -0000 @@ -48,7 +48,13 @@ function user_filter_form() { foreach ($session as $filter) { list($type, $value) = $filter; // Merge an array of arrays into one if necessary. - $options = $type == 'permission' ? call_user_func_array('array_merge', $filters[$type]['options']) : $filters[$type]['options']; + $options = $filters[$type]['options']; + if ($type == 'permission') { + $options = array(); + foreach ($filters[$type]['options'] as $filtermodule) { + $options += $filtermodule['#options']; + } + } $params = array('%property' => $filters[$type]['title'] , '%value' => $options[$value]); if ($i++ > 0) { $form['filters']['current'][] = array('#markup' => t('and where %property is %value', $params)); @@ -101,7 +107,13 @@ function user_filter_form_submit($form, if (isset($form_state['values']['filter'])) { $filter = $form_state['values']['filter']; // Merge an array of arrays into one if necessary. - $options = $filter == 'permission' ? call_user_func_array('array_merge', $filters[$filter]['options']) : $filters[$filter]['options']; + $options = $filters[$filter]['options']; + if ($filter == 'permission') { + $options = array(); + foreach ($filters[$filter]['options'] as $filtermodule) { + $options += $filtermodule['#options']; + } + } if (isset($options[$form_state['values'][$filter]])) { if (!isset($_SESSION['user_overview_filter'])) { drupal_set_session('user_overview_filter', array()); Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.971 diff -u -p -r1.971 user.module --- modules/user/user.module 20 Mar 2009 19:18:10 -0000 1.971 +++ modules/user/user.module 22 Mar 2009 14:04:19 -0000 @@ -2415,8 +2415,9 @@ function user_filters() { $function = $module . '_perm'; if ($permissions = $function('perm')) { asort($permissions); + $options[t('@module module', array('@module' => $module))] = array('#options' => array()); foreach ($permissions as $permission => $description) { - $options[t('@module module', array('@module' => $module))][$permission] = t($permission); + $options[t('@module module', array('@module' => $module))]['#options'][$permission] = t($permission); } } }