Created
July 6, 2015 19:27
-
-
Save catrielmuller/bfd0edc29b6b1b1f64bb to your computer and use it in GitHub Desktop.
hook_webform_select_options_info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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