Index: image.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/image/image.module,v retrieving revision 1.277 diff -u -r1.277 image.module --- image.module 2 Sep 2008 16:41:56 -0000 1.277 +++ image.module 25 Nov 2008 19:07:07 -0000 @@ -38,10 +38,10 @@ 'arguments' => array('form' => NULL), ), 'image_teaser' => array( - 'arguments' => array('node' => NULL, 'size' => IMAGE_THUMBNAIL), + 'arguments' => array('node' => NULL, 'size' => variable_get('image_size_teaser_image', IMAGE_THUMBNAIL)), ), 'image_body' => array( - 'arguments' => array('node' => NULL, 'size' => IMAGE_PREVIEW), + 'arguments' => array('node' => NULL, 'size' => variable_get('image_size_body_image', IMAGE_PREVIEW)), ), 'image_block_random' => array( 'arguments' => array('images' => NULL, 'size' => IMAGE_THUMBNAIL), @@ -422,7 +422,7 @@ */ function image_view($node, $teaser = 0, $page = 0) { $sizes = image_get_sizes(); - $size = IMAGE_PREVIEW; + $size = variable_get('image_size_body_image', IMAGE_PREVIEW); if (isset($_GET['size'])) { // Invalid size specified. if (!isset($sizes[$_GET['size']])) { @@ -655,7 +655,7 @@ * Theme a teaser */ function theme_image_teaser($node, $size) { - return l(image_display($node, IMAGE_THUMBNAIL), 'node/'. $node->nid, array('html' => TRUE)); + return l(image_display($node, $size), 'node/'. $node->nid, array('html' => TRUE)); } /** @@ -1033,3 +1033,37 @@ return $node; } +/** + * implementation of hook_form_alter() + */ +function image_form_alter(&$form, $form_state, $form_id) { + // Content type settings form. + if ($form_id == 'node_type_form' && $form['#node_type']->type == 'image') { + _image_check_settings(); + + foreach (image_get_sizes() as $key => $size) { + $image_sizes[$key] = $size['label']; + } + + $form['image_size'] = array( + '#type' => 'fieldset', + '#title' => t('Image size settings'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + $form['image_size']['image_size_teaser'] = array( + '#type' => 'select', + '#title' => t('Teaser image size'), + '#default_value' => variable_get('image_size_teaser_image', IMAGE_THUMBNAIL), + '#options' => $image_sizes, + '#description' => t("This determines the size of the image that appears when the node is displayed as a teaser.") + ); + $form['image_size']['image_size_body'] = array( + '#type' => 'select', + '#title' => t('Full node image size'), + '#default_value' => variable_get('image_size_body_image', IMAGE_PREVIEW), + '#options' => $image_sizes, + '#description' => t("This determines the size of the image that appears when the full node is displayed.") + ); + } +} \ No newline at end of file