lightbox2_lite_general_handler();
lightbox2_lite_auto_handler();
image_node_handler();
+ image_group_handler();
$("input[@name=lightbox2_lite]").bind("click", lightbox2_lite_general_handler);
$("input[@name=lightbox2_use_alt_layout]").bind("click", alt_layout_handler);
$("input[@name=lightbox2_image_node]").bind("click", image_node_handler);
$("input[@name=lightbox2_image_assist_custom]").bind("click", image_node_handler);
$("input[@name=lightbox2_inline]").bind("click", image_node_handler);
$("textarea[@name=lightbox2_custom_trigger_classes]").bind("change", image_node_handler);
+ $("input[@name=lightbox2_image_group]").bind("click", image_group_handler);
});
}
$("input[@name=lightbox2_node_link_text]").attr("disabled", "disabled");
$("input[@name=lightbox2_node_link_target]").attr("disabled", "disabled");
$("input[@name=lightbox2_image_group]").attr("disabled", "disabled");
+ $("input[@name=lightbox2_imagefield_group_node_id]").attr("disabled", "disabled");
$("select[@name=lightbox2_display_image_size]").attr("disabled", "disabled");
$("select[@name='lightbox2_trigger_image_size[]']").attr("disabled", "disabled");
$("input[@name=lightbox2_flickr]").attr("disabled", "disabled");
$("input[@name=lightbox2_node_link_text]").removeAttr("disabled");
$("input[@name=lightbox2_node_link_target]").removeAttr("disabled");
$("input[@name=lightbox2_image_group]").removeAttr("disabled");
+ $("input[@name=lightbox2_imagefield_group_node_id]").removeAttr("disabled");
$("select[@name=lightbox2_display_image_size]").removeAttr("disabled");
$("select[@name='lightbox2_trigger_image_size[]']").removeAttr("disabled");
$("input[@name=lightbox2_disable_nested_galleries]").removeAttr("disabled");
$("input[@name=lightbox2_node_link_text]").removeAttr("disabled");
$("input[@name=lightbox2_node_link_target]").removeAttr("disabled");
$("input[@name=lightbox2_image_group]").removeAttr("disabled");
+ $("input[@name=lightbox2_imagefield_group_node_id]").removeAttr("disabled");
}
else {
$("input[@name=lightbox2_node_link_text]").attr("disabled", "disabled");
$("input[@name=lightbox2_node_link_target]").attr("disabled", "disabled");
$("input[@name=lightbox2_image_group]").attr("disabled", "disabled");
+ $("input[@name=lightbox2_imagefield_group_node_id]").attr("disabled", "disabled");
}
// Image node only stuff.
$("select[@name='lightbox2_trigger_image_size[]']").attr("disabled", "disabled");
}
}
+
+ image_group_handler();
+}
+
+function image_group_handler(event) {
+ // Image grouping stuff.
+ if ($("input[@name=lightbox2_lite]").val() != 1) {
+ if ($("input[@name=lightbox2_image_group]:checked").val() == 1) {
+ $("input[@name=lightbox2_imagefield_group_node_id]").removeAttr("disabled");
+ }
+ else {
+ $("input[@name=lightbox2_imagefield_group_node_id]").attr("disabled", "disabled");
+ }
+ }
}
$form['lightbox2_node_link_text'] = array(
'#type' => 'textfield',
'#title' => t('Text for Node Link'),
- '#description' => t('This is the text that will appear as the link to the node underneath the image in the lightbox'),
+ '#description' => t('This is the text that will appear as the link to the node underneath the image in the lightbox.'),
'#default_value' => variable_get('lightbox2_node_link_text', 'View Image Details'),
);
);
}
+ // Define Imagefield settings fieldset.
+ /* ---------------------------------- */
+ if (module_exists('imagefield') && module_exists('imagecache')) {
+ $form['lightbox2_imagefield_options'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Imagefield settings'),
+ '#collapsible' => TRUE,
+ '#collapsed' => TRUE,
+ );
+
+ // Add checkbox for imagefield grouping.
+ $form['lightbox2_imagefield_options']['lightbox2_imagefield_group_node_id'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Group Imagefields by Node Id'),
+ '#description' => t('By default, imagefields in views are grouped by the field name they appear in the view in. Enabling this option allows them to be grouped by field name and node id (where available).'),
+ '#default_value' => variable_get('lightbox2_imagefield_group_node_id', FALSE),
+ );
+ }
+
return system_settings_form($form);
}
$rel = 'lightbox';
if (variable_get('lightbox2_image_group', TRUE)) {
$rel = 'lightbox['. $field['field_name'] .']';
+ if (variable_get('lightbox2_imagefield_group_node_id', FALSE) && !empty($item['nid'])) {
+ $rel = 'lightbox['. $field['field_name'] . $item['nid'] .']';
+ }
}
$node_link = '';