function imagepicker_get_enabled_group in Image Picker 7
Same name and namespace in other branches
- 5.2 imagepicker.module \imagepicker_get_enabled_group()
- 5 imagepicker.module \imagepicker_get_enabled_group()
- 6.2 imagepicker.functions.inc \imagepicker_get_enabled_group()
2 calls to imagepicker_get_enabled_group()
File
- ./
imagepicker.functions.inc, line 1537 - @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL
Code
function imagepicker_get_enabled_group($account = FALSE) {
if (!imagepicker_variable_get('imagepicker_groups_enabled', 0)) {
return FALSE;
}
if ($account) {
$user = $account;
}
else {
global $user;
}
$query = db_select('imagepicker_user_groups', 'g');
$query
->fields('g', array(
'gid',
'group_name',
));
$query
->distinct();
$query
->join('imagepicker_group_images', 'i', 'g.gid = i.gid');
$query
->condition('g.uid', $user->uid);
$query
->condition('g.state', 1);
$rows = $query
->execute();
$ct = 0;
foreach ($rows as $row) {
$data[] = $row->gid;
$ct++;
}
if ($ct) {
return $data;
}
return FALSE;
}