function userpoints_get_categories in User Points 6
Same name and namespace in other branches
- 5.3 userpoints.module \userpoints_get_categories()
- 7.2 userpoints.module \userpoints_get_categories()
- 7 userpoints.module \userpoints_get_categories()
12 calls to userpoints_get_categories()
- theme_userpoints_list_users in ./
userpoints.module - UserpointsTestCase::testGetCategories in tests/
userpoints_api.test - userpoints_admin_manage in ./
userpoints.module - userpoints_admin_points in ./
userpoints.module - userpoints_admin_settings in ./
userpoints.module - menu callback for settings form.
File
- ./
userpoints.module, line 1838
Code
function userpoints_get_categories() {
//Create the "Uncategorized" category
$options = array();
$options[0] = t('!Uncategorized', userpoints_translation());
if (module_exists('taxonomy')) {
$vid = userpoints_get_vid();
if ($vid) {
$tree = taxonomy_get_tree($vid, 0, -1, 1);
foreach ($tree as $term) {
$options[$term->tid] = $term->name;
}
}
}
return $options;
}