function _image_gallery_get_vid in Image 5
Same name and namespace in other branches
- 5.2 contrib/image_gallery/image_gallery.module \_image_gallery_get_vid()
- 6 contrib/image_gallery/image_gallery.module \_image_gallery_get_vid()
- 7 contrib/image_gallery/image_gallery.module \_image_gallery_get_vid()
Returns (and possibly creates) a new vocabulary for Image galleries.
5 calls to _image_gallery_get_vid()
- image_gallery_admin in contrib/
image_gallery/ image_gallery.module - image_gallery_admin_form in contrib/
image_gallery/ image_gallery.module - image_gallery_nodeapi in contrib/
image_gallery/ image_gallery.module - image_gallery_page in contrib/
image_gallery/ image_gallery.module - Image gallery callback, displays an image gallery
- _image_gallery_parent_select in contrib/
image_gallery/ image_gallery.module
File
- contrib/
image_gallery/ image_gallery.module, line 399
Code
function _image_gallery_get_vid() {
$vid = variable_get('image_gallery_nav_vocabulary', '');
if (empty($vid) || !taxonomy_get_vocabulary($vid)) {
// Check to see if an image gallery vocabulary exists
$vid = db_result(db_query("SELECT vid FROM {vocabulary} WHERE module='image_gallery'"));
if (!$vid) {
$vocabulary = array(
'name' => t('Image Galleries'),
'multiple' => '0',
'required' => '0',
'hierarchy' => '1',
'relations' => '0',
'module' => 'image_gallery',
'nodes' => array(
'image' => 1,
),
);
taxonomy_save_vocabulary($vocabulary);
$vid = $vocabulary['vid'];
}
variable_set('image_gallery_nav_vocabulary', $vid);
}
return $vid;
}