Index: gallery.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/gallery/gallery.module,v retrieving revision 1.11 diff -u -F^f -r1.11 gallery.module --- gallery.module 29 Sep 2005 14:04:51 -0000 1.11 +++ gallery.module 19 Nov 2005 01:26:03 -0000 @@ -137,18 +137,18 @@ function gallery_user($op, &$edit, &$use * - gallery imageblock (random, most viewed, etc) */ function gallery_block($op = 'list', $delta = 0, $edit = array()) { - $typeMap = array('randomImage' => t('Random image'), - 'recentImage' => t('Recent image'), - 'viewedImage' => t('Viewed image'), - 'randomAlbum' => t('Random album'), - 'recentAlbum' => t('Recent album'), - 'viewedAlbum' => t('Viewed album'), - 'dailyImage' => t('Daily image'), - 'weeklyImage' => t('Weekly image'), - 'monthlyImage' => t('Monthly image'), - 'dailyAlbum' => t('Daily album'), - 'weeklyAlbum' => t('Weekly album'), - 'monthlyAlbum' => t('Monthly album')); + $typeMap = array('randomImage' => t('Random Image'), + 'recentImage' => t('Newest Image'), + 'viewedImage' => t('Most Viewed Image'), + 'randomAlbum' => t('Random Album'), + 'recentAlbum' => t('Newest Album'), + 'viewedAlbum' => t('Most Viewed Album'), + 'dailyImage' => t('Picture of the Day'), + 'weeklyImage' => t('Picture of the Week'), + 'monthlyImage' => t('Picture of the Month'), + 'dailyAlbum' => t('Album of the Day'), + 'weeklyAlbum' => t('Album of the Week'), + 'monthlyAlbum' => t('Album of the Month')); switch ($op) { case 'list': @@ -156,7 +156,7 @@ function gallery_block($op = 'list', $de return $blocks; case 'configure': - $output = form_select(t('Image type'), + $output = form_checkboxes(t('Image type'), 'gallery_block_block_' . $delta, variable_get('gallery_block_block_' . $delta, 'randomImage'), $typeMap, @@ -175,7 +175,12 @@ function gallery_block($op = 'list', $de return $output; case 'save': - variable_set('gallery_block_block_' . $delta, $edit['gallery_block_block_' . $delta]); + // if no image types selected, assume randomImage + if (count($edit['gallery_block_block_' . $delta])) { + variable_set('gallery_block_block_' . $delta, $edit['gallery_block_block_' . $delta]); + } else { + variable_set('gallery_block_block_' . $delta, array('randomImage')); + } variable_set('gallery_block_show_' . $delta, $edit['gallery_block_show_' . $delta]); break; @@ -186,7 +191,7 @@ function gallery_block($op = 'list', $de return; } - $params['block'] = variable_get('gallery_block_block_' . $delta, 'randomImage'); + $params['blocks'] = implode('|', variable_get('gallery_block_block_' . $delta, array('0'=>'randomImage'))); $params['show'] = implode('|', variable_get('gallery_block_show_' . $delta, array())); // TODO: parameterize this @@ -199,7 +204,11 @@ function gallery_block($op = 'list', $de return; } else { if ($content) { - $block['subject'] = $typeMap[$params['block']]; + if (count(variable_get('gallery_block_block_' . $delta, 'randomImage')) > 1) { + $block['subject'] = t('Gallery'); + } else { + $block['subject'] = $typeMap[$params['blocks']]; + } $block['content'] = '