drupal_map_assoc

Versions
mediamosa-21
drupal_map_assoc($array, $function = NULL)

Form an associative array from a linear array.

This function walks through the provided array and constructs an associative array out of it. The keys of the resulting array will be the values of the input array. The values will be the same as the keys unless a function is specified, in which case the output of the function is used for the values instead.

@result An associative array.

Parameters

$array A linear array.

$function A name of a function to apply to all values before output.

▾ 33 functions call drupal_map_assoc()

aggregator_block_configure in modules/aggregator/aggregator.module
Implements hook_block_configure().
aggregator_form_aggregator_admin_form_alter in modules/aggregator/aggregator.processor.inc
Implements hook_form_aggregator_admin_form_alter().
aggregator_form_feed in modules/aggregator/aggregator.admin.inc
Form builder; Generate a form to add/edit feed sources.
aggregator_form_opml in modules/aggregator/aggregator.admin.inc
Form builder; Generate a form to import feeds from OPML.
blog_block_configure in modules/blog/blog.module
Implements hook_block_configure().
comment_block_configure in modules/comment/comment.module
Implements hook_block_configure().
dblog_form_system_logging_settings_alter in modules/dblog/dblog.module
Implements hook_form_FORM_ID_alter().
devel_admin_settings in sites/all/modules/devel/devel.module
devel_reinstall in sites/all/modules/devel/devel.module
Display a dropdown of installed modules with the option to reinstall them.
field_ui_field_edit_form in modules/field_ui/field_ui.admin.inc
Menu callback; presents the field instance edit page.
field_ui_menu in modules/field_ui/field_ui.module
Implements hook_menu().
form_process_date in includes/form.inc
Roll out a single date element.
form_type_select_value in includes/form.inc
Helper function to determine the value for a select form element.
forum_admin_settings in modules/forum/forum.admin.inc
Form builder for the forum settings page.
forum_block_configure in modules/forum/forum.module
Implements hook_block_configure().
hook_search_admin in modules/search/search.api.php
Add elements to the search settings form.
image_style_options in modules/image/image.module
Get an array of image styles suitable for using as select list options.
node_block_configure in modules/node/node.module
Implements hook_block_configure().
node_search_admin in modules/node/node.module
Implements hook_search_admin().
node_type_form in modules/node/content_types.inc
Generates the node type editing form.
number_field_settings_form in modules/field/modules/number/number.module
Implements hook_field_settings_form().
poll_form in modules/poll/poll.module
Implements hook_form().
search_admin_settings in modules/search/search.admin.inc
Menu callback; displays the search module settings page.
statistics_block_configure in modules/statistics/statistics.module
Implements hook_block_configure().
statistics_settings_form in modules/statistics/statistics.admin.inc
Form builder; Configure access logging.
system_performance_settings in modules/system/system.admin.inc
Form builder; Configure site performance settings.
system_rss_feeds_settings in modules/system/system.admin.inc
Form builder; Configure how the site handles RSS feeds.
system_site_information_settings in modules/system/system.admin.inc
Form builder; The general site information form.
update_filter_project_info in modules/update/update.compare.inc
Filter the project .info data to only save attributes we need.
update_get_update_list in includes/update.inc
Return a list of all the pending database updates.
user_block_configure in modules/user/user.module
Implements hook_block_configure().
_coder_review_default_reviews in sites/all/modules/coder/coder_review/coder_review.module
Helper functions for settings form.
_comment_per_page in modules/comment/comment.module
Return an array of "comments per page" settings from which the user can choose.

Code

includes/common.inc, line 2479

<?php
function drupal_map_assoc($array, $function = NULL) {
  $array = array_combine($array, $array);
  if (is_callable($function)) {
    $array = array_map($function, $array);
  }
  return $array;
}
?>