You are here

function media_gallery_get_default_gallery_collection in Media Gallery 7.2

Same name and namespace in other branches
  1. 7 media_gallery.module \media_gallery_get_default_gallery_collection()

Gets the first term in the media_gallery_collection vocabulary

1 call to media_gallery_get_default_gallery_collection()
media_gallery_admin_settings in ./media_gallery.admin.inc
The Galleries settings page will just return the term edit form for the "all galleries" tid.

File

./media_gallery.module, line 1470

Code

function media_gallery_get_default_gallery_collection() {
  $gallery_collection_vid = variable_get('media_gallery_collection_vid');
  $tid = db_select('taxonomy_term_data', 'ttd')
    ->fields('ttd', array(
    'tid',
  ))
    ->condition('vid', $gallery_collection_vid)
    ->range(0, 1)
    ->execute()
    ->fetchField();
  return taxonomy_term_load($tid);
}