You are here

function _mailhandler_build_options in Mailhandler 6.2

Same name and namespace in other branches
  1. 7.2 mailhandler.module \_mailhandler_build_options()

Builds an options array for a select field from a source array.

4 calls to _mailhandler_build_options()
MailhandlerFetcher::configForm in plugins/feeds/plugins/MailhandlerFetcher.class.php
Config form.
MailhandlerFetcher::sourceForm in plugins/feeds/plugins/MailhandlerFetcher.class.php
Source form.
MailhandlerParser::configForm in plugins/feeds/plugins/MailhandlerParser.class.php
Build configuration form.
mailhandler_mailbox_ui::edit_form in plugins/ctools/export_ui/mailhandler_mailbox_ui.class.php
Implementation of ctools_export_ui::edit_form().

File

./mailhandler.module, line 296
Retrieves email for posting as nodes and comments.

Code

function _mailhandler_build_options($source, $key_name = 'name') {
  $options = array();
  foreach ($source as $key => $value) {
    $options[$key] = is_object($value) ? $value->{$key_name} : $value[$key_name];
  }
  return $options;
}