$form['blocks']['image']['gallery_link'] = array(
'#type' => 'textfield',
- '#title' => t('Link'),
+ '#title' => t('Image Link'),
'#default_value' => variable_get('gallery_link', ''),
'#size' => 20,
'#maxlength' => 20,
$form['blocks']['grid']['gallery_grid_link'] = array(
'#type' => 'textfield',
- '#title' => t('Link'),
+ '#title' => t('Image Link'),
'#default_value' => variable_get('gallery_grid_link', ''),
'#size' => 20,
'#maxlength' => 20,
function _gallery_settings_filter() {
$plugin_status = gallery_plugin_status(array('imageblock', 'imageframe'));
-
- $desc = t('The Gallery Filter requires the Gallery2 Image Block plugin (!imageblock_status) and
+
+ $desc = t('Note that changing the defaults here will change the all the gallery filter images
+ on the site, not just new images. ');
+ $desc .= t('The Gallery Filter requires the Gallery2 Image Block plugin (!imageblock_status) and
optionally the Gallery2 Image Frame plugin (!imageframe_status).', array(
'!imageblock_status' => theme('gallery_plugin_status_message', $plugin_status['imageblock']),
'!imageframe_status' => theme('gallery_plugin_status_message', $plugin_status['imageframe']),
'#default_value' => variable_get('gallery_filter_prefix', 'G2'),
'#size' => 10,
'#maxlength' => 10,
- '#description' => t('Prefix to use with filter. Example: \'G2\' means you use [G2: 999].'),
+ '#description' => t('Prefix to use with filter. Example: \'G2\' means you use [G2: 999].
+ Be careful when changing this as any pages using the previous prefix will not be changed
+ and so will not be filtered correctly.'),
);
$form['filter']['gallery_filter_default_block_type'] = array(
'#maxlength' => 20,
'#description' => t('Enter a link target (e.g. "_blank", "_new").'),
);
+
+ $form['filter']['gallery_filter_default_link'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Default Image Link'),
+ '#default_value' => variable_get('gallery_filter_default_link', ''),
+ '#size' => 20,
+ '#maxlength' => 20,
+ '#description' => t('By default the image has a link to the item in the Gallery. This
+ can be overridden here (or leave empty for the default). Use \'none\' for no link, or a URL
+ to link somewhere else instead.'),
+ );
}
+ // Include both #submit handlers so that the default system submit
+ // is also called to save all the variables.
+ $form['#submit']['_gallery_settings_filter_submit'] = array();
+ $form['#submit']['system_settings_form_submit'] = array();
return system_settings_form($form);
}
}
}
+function _gallery_settings_filter_submit($form_id, $form_values) {
+// The default values have changed, so the pages containing the gallery filter need
+// to be updated (or else it would only occur on an edit), so empty the filter cache.
+
+// Find out which formats are using the gallery filter
+ $result = db_query("SELECT format FROM {filters} WHERE module = 'gallery'");
+ while ($format = db_fetch_object($result)) {
+ cache_clear_all($format->format .':', 'cache_filter', TRUE);
+ }
+ drupal_set_message('The gallery filter cache has been cleared so that the new defaults apply.');
+}
+
function _gallery_settings_g2image() {
$plugin_status = gallery_plugin_status(array('imageblock'));
'#maxlength' => 20,
'#description' => t('Enter a link target (e.g. "_blank", "_new").'),
);
+
+ $form['search']['thumbs']['gallery_search_default_link'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Image Link'),
+ '#default_value' => variable_get('gallery_search_default_link', ''),
+ '#size' => 20,
+ '#maxlength' => 20,
+ '#description' => t('By default the image has a link to the item in the Gallery. This
+ can be overridden here (or leave empty for the default). Use \'none\' for no link, or a
+ URL to link somewhere else instead.'),
+ );
}
}