function node_gallery_get_types in Node Gallery 6.3
Same name and namespace in other branches
- 6.2 node_gallery.inc \node_gallery_get_types()
Returns a list of all possible content types of galleries, images, or both.
Parameters
$type: (optional) 'gallery', 'image' or 'all'.
Return value
An array containing the list of content types.
18 calls to node_gallery_get_types()
- node_gallery_apply_cck_settings_to_image_types in ./
node_gallery.inc - Given a settings associative array uses content_crud to apply settings to the widget for all image types
- node_gallery_change_gallery_action in ./
node_gallery.actions.inc - Changes the gallery of an image node.
- node_gallery_change_gallery_action_form in ./
node_gallery.actions.inc - Builds the form to allow a user to change the gallery of an image.
- node_gallery_change_image_weight_action in ./
node_gallery.actions.inc - Sets an image's weight.
- node_gallery_content_extra_fields in ./
node_gallery.module - Implementation of cck's hook_content_extra_fields()
File
- ./
node_gallery.inc, line 190 - Shared functions for node_gallery
Code
function node_gallery_get_types($type = 'gallery', $reset = FALSE) {
static $ng_types = array();
if (empty($ng_types) || $reset) {
$ng_types['gallery'] = array();
$ng_types['image'] = array();
$ng_rels = node_gallery_get_all_relationships($reset);
foreach ($ng_rels as $gallery_type => $value) {
$ng_types['gallery'][] = $gallery_type;
$ng_types['image'][] = $value['image_type'];
}
}
if ($type == 'all') {
return array_merge($ng_types['gallery'], $ng_types['image']);
}
else {
return $ng_types[$type];
}
}