diff -upr upload_image.orig2/upload_image.css upload_image/upload_image.css --- upload_image.orig2/upload_image.css 2009-06-21 07:21:58.000000000 -0700 +++ upload_image/upload_image.css 2009-06-23 23:09:39.000000000 -0700 @@ -21,3 +21,11 @@ padding: 0; margin: 0; } + +.upload-image-caption, +.upload-image-wrapper { + text-align: center; +} +.upload-image-caption { + margin: 0 0.5em; +} diff -upr upload_image.orig2/upload_image.install upload_image/upload_image.install --- upload_image.orig2/upload_image.install 2007-08-28 19:48:16.000000000 -0700 +++ upload_image/upload_image.install 2009-06-23 23:17:50.000000000 -0700 @@ -34,6 +34,12 @@ function upload_image_update_1() { * Implementation of hook_uninstall(). */ function upload_image_uninstall() { + variable_del('upload_image_show_caption'); +// variable_del('upload_image_create_*'); // FIXME: do for all $node->type +// variable_del('upload_image_delete_*'); // FIXME: do for all $node->type + variable_del('upload_image_title_template'); + variable_del('upload_image_derivative'); + db_query('DROP TABLE {upload_images}'); global $conf; diff -upr upload_image.orig2/upload_image.module upload_image/upload_image.module --- upload_image.orig2/upload_image.module 2009-06-23 21:46:41.000000000 -0700 +++ upload_image/upload_image.module 2009-06-23 23:06:22.000000000 -0700 @@ -88,6 +88,13 @@ function upload_image_form_alter(&$form, '#options' => $options, '#description' => t('Select which image size should be used to display uploaded images.'), ); + $form['upload_image']['upload_image_show_caption'] = array( + '#type' => 'checkbox', + '#title' => t('Show caption'), + '#default_value' => variable_get('upload_image_show_caption', 0), + '#return_value' => 1, + '#description' => t('Select whether to show image caption above thumbnails (description or filename).'), + ); } // node deletion, alert people about attachments being deleted. elseif ('node_delete_confirm' == $form_id) { @@ -148,12 +155,18 @@ function upload_image_nodeapi(&$node, $o unset($node->files[$fid]); // unset, so image won't appear as attachment $image = new stdClass(); $image->nid = $images[$fid]->nid; - $image->title = $node->title; // this is not the correct +// $image->title = $node->title; // this is not the correct // title, but we rather // not look it up. + $image->title = $file->description ? $file->description : $file->filename; image_load($image); $thumb = module_invoke('image', 'display', $image, $derivative); + if (variable_get('upload_image_show_caption', 0)) { + $thumb = '