Index: img_assist.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/img_assist/img_assist.module,v
retrieving revision 1.62
diff -u -r1.62 img_assist.module
--- img_assist.module 12 May 2006 09:56:38 -0000 1.62
+++ img_assist.module 20 May 2006 23:11:21 -0000
@@ -300,6 +300,20 @@
'#options' => array('filtertag' => t('Filter Tag'), 'html' => t('HTML Code')),
'#description' => t('The link behavior can be overriden when inserting images by users with the proper permissions, but these defaults will still be used for everyone else.'),
);
+ $form['properties']['img_assist_load_title'] = array(
+ '#type' => 'radios',
+ '#title' => t('Preload image title'),
+ '#default_value' => variable_get('img_assist_load_title', 1),
+ '#options' => array(t('Disabled'), t('Enabled')),
+ '#description' => t('If enabled, the title from the image will be loaded as the bolded caption by default.'),
+ );
+ $form['properties']['img_assist_load_description'] = array(
+ '#type' => 'radios',
+ '#title' => t('Preload image description'),
+ '#default_value' => variable_get('img_assist_load_description', 1),
+ '#options' => array(t('Disabled'), t('Enabled')),
+ '#description' => t('If enabled, the body text from the image will be loaded as the caption by default.'),
+ );
// Image Settings
$form['display'] = array(
@@ -804,7 +818,7 @@
$form['title'] = array(
'#type' => 'textfield',
'#title' => t('Title (optional)'),
- '#default_value' => $node->title,
+ '#default_value' => variable_get('img_assist_load_title', 1)?$node->title:'',
'#size' => 50,
'#maxlength' => 255,
'#description' => NULL,
@@ -813,7 +827,7 @@
$form['desc'] = array(
'#type' => 'textfield',
'#title' => t('Description (optional)'),
- '#default_value' => $node->body,
+ '#default_value' => variable_get('img_assist_load_description', 1)?$node->body:'',
'#size' => 50,
'#maxlength' => 255,
'#description' => NULL,
@@ -1258,6 +1272,8 @@
$caption = '' . $attributes['title'] . ': ' . $attributes['desc'];
} elseif ($attributes['title']) {
$caption = '' . $attributes['title'] . '';
+ } elseif ($attributes['desc']) {
+ $caption = $attributes['desc'];
}
$node->title = strip_tags($caption); // change the node title because img_assist_display() uses the node title for alt and title
$img_tag = img_assist_display($node, $size);