Skip to content

Instantly share code, notes, and snippets.

@catrielmuller
Created July 6, 2015 19:27
Show Gist options
  • Save catrielmuller/bfd0edc29b6b1b1f64bb to your computer and use it in GitHub Desktop.
Save catrielmuller/bfd0edc29b6b1b1f64bb to your computer and use it in GitHub Desktop.
hook_webform_select_options_info
/**
* Private implementation of hook_webform_select_options_info().
*
* @see webform_webform_select_options_info()
*/
function general_webform_select_options_info()
{
$items = array();
$items['people'] = array(
'title' => t('People'),
'options callback' => 'general_people_options'
);
return $items;
}
/**
* Option list containing the site users
*/
function general_people_options()
{
$q = db_query("SELECT `name`
FROM {users}
WHERE 1
ORDER BY `name` ASC
");
$options = array();
while ($r = db_fetch_object($q))
{
$options[$r -> name] = $r -> name;
}// WHILE
return $options;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment