diff -ur /tmp/imagefield_gallery/imagefield_gallery.info imagefield_gallery/imagefield_gallery.info --- /tmp/imagefield_gallery/imagefield_gallery.info 2008-09-17 18:35:32.000000000 +0200 +++ imagefield_gallery/imagefield_gallery.info 2009-06-11 16:08:51.000000000 +0200 @@ -1,11 +1,13 @@ ; $Id: imagefield_gallery.info,v 1.4 2008/02/04 23:27:14 eclipsegc Exp $ name = ImageField Gallery -description = Creates a Gallery out of an Imagefield. +description = Creates a Gallery out of an Imagefield. package = ImageField Gallery -dependencies = imagefield imagecache +dependencies[] = imagefield +dependencies[] = imagecache +core = 6.x -; Information added by drupal.org packaging script on 2008-09-17 -version = "5.x-2.0-alpha4" +; Information added by drupal.org packaging script on 2008-09-17 +version = "6.x-2.0-alpha4" project = "imagefield_gallery" datestamp = "1221669332" diff -ur /tmp/imagefield_gallery/imagefield_gallery.module imagefield_gallery/imagefield_gallery.module --- /tmp/imagefield_gallery/imagefield_gallery.module 2008-09-17 18:10:30.000000000 +0200 +++ imagefield_gallery/imagefield_gallery.module 2009-06-11 15:47:53.000000000 +0200 @@ -6,8 +6,8 @@ * implementation of hook_help() */ -function imagefield_gallery_help($section) { - switch ($section) { +function imagefield_gallery_help($path, $arg) { + switch ($path) { case 'admin/help#imagefield_gallery': $output = '

'. t('Imagefield Gallery is specifically designed to make theming and displaying imagefield images easy. The following administrative links will help you manage your imagefield galleries.') .'

'; $output .= '

'. t('Imagefield Gallery is currently made up of two separate modules. The first is the imagefield_gallery module which does nothing on its own. The second is the imagefield_gallery_lightbox2 module. This module allows you to create galleries of images on a node that has an imagefield on it. Imagefield_gallery is designed to work with nodes that have only one imagefield, it does not currently work with nodes that have more than one imagefield. Results cannot be garunteed in these situations. For best results set your imagefield to be a multi-value imagefield and then use the links below to administrate the look of your gallery. Imagefield_gallery works on a node by node basis, so you can set completely different css settings on nodes, even if they share the same gallery type, and same imagefield!') .'

'; @@ -28,57 +28,49 @@ * implementation of hook_menu() */ -function imagefield_gallery_menu($may_cache) { +function imagefield_gallery_menu() { $items = array(); - if ($may_cache) { - $items[] = array( - 'path' => 'admin/settings/imagefield_gallery_types', - 'title' => t('Imagefield Gallery Administration'), - 'description' => t('Configure the types of content on which you would like an Imagefield Gallery to appear, and modify the css settings for those galleries.'), - 'callback' => 'imagefield_gallery_content_types', - 'access' => user_access('administer imagefield gallery'), - 'type' => MENU_NORMAL_ITEM, - ); - } - else { - $type = arg(3); - $field = arg(4); - $items[] = array( - 'path' => 'admin/settings/imagefield_gallery_types_edit/'. $type .'/'. $field, - 'title' => $type .' '. t('Imagefield Gallery Settings'), - 'callback' => 'drupal_get_form', - 'callback arguments' => array('imagefield_gallery_content_types_edit', $type, $field), - 'access' => user_access('administer imagefield gallery'), - 'type' => MENU_CALLBACK, - ); - $items[] = array( - 'path' => 'admin/settings/imagefield_gallery_types_reset/'. $type .'/'. $field, - 'callback' => 'imagefield_gallery_content_types_reset', - 'callback arguments' => array($type, $field), - 'access' => user_access('administer imagefield gallery'), - 'type' => MENU_CALLBACK, - ); - $items[] = array( - 'path' => 'admin/settings/imagefield_gallery_style_edit/'. $type .'/'. $field, - 'title' => $type .' '. t('Style Settings'), - 'callback' => 'drupal_get_form', - 'callback arguments' => array('imagefield_gallery_style_edit', $type, $field), - 'access' => user_access('administer imagefield gallery'), - 'type' => MENU_CALLBACK, - ); - $items[] = array( - 'path' => 'admin/settings/imagefield_gallery_style_reset/'. $type .'/'. $field, - 'callback' => 'imagefield_gallery_style_reset', - 'callback arguments' => array($type, $field), - 'access' => user_access('administer imagefield gallery'), - 'type' => MENU_CALLBACK, - ); - } + $items['admin/settings/imagefield_gallery_types'] = array( + 'title' => 'Imagefield Gallery Administration', + 'description' => 'Configure the types of content on which you would like an Imagefield Gallery to appear, and modify the css settings for those galleries.', + 'page callback' => 'imagefield_gallery_content_types', + 'access arguments' => array('administer imagefield gallery'), + 'type' => MENU_NORMAL_ITEM, + ); + $type = arg(3); + $field = arg(4); + $items['admin/settings/imagefield_gallery_types_edit/%/%'] = array( + 'title' => $type .' '.'Imagefield Gallery Settings', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('imagefield_gallery_content_types_edit', 3, 4), + 'access arguments' => array('administer imagefield gallery'), + 'type' => MENU_CALLBACK, + ); + $items['admin/settings/imagefield_gallery_types_reset/%/%'] = array( + 'page callback' => 'imagefield_gallery_content_types_reset', + 'page arguments' => array(3, 4), + 'access arguments' => array('administer imagefield gallery'), + 'type' => MENU_CALLBACK, + ); + $items['admin/settings/imagefield_gallery_style_edit/%/%'] = array( + 'title' => 3 .' '.'Style Settings', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('imagefield_gallery_style_edit', 3, 4), + 'access arguments' => array('administer imagefield gallery'), + 'type' => MENU_CALLBACK, + ); + $items['admin/settings/imagefield_gallery_style_reset/%/%'] = array( + 'callback' => 'imagefield_gallery_style_reset', + 'callback arguments' => array(3, 4), + 'access arguments' => array('administer imagefield gallery'), + 'type' => MENU_CALLBACK, + ); + return $items; } -function imagefield_gallery_style_reset($type, $field){ +function imagefield_gallery_style_reset($type, $field) { $gallery_type = imagefield_gallery_gallery_type($type, $field); $var_name = $gallery_type .'_imagefield_gallery_css'; $var = variable_get($var_name, array()); @@ -89,7 +81,7 @@ drupal_goto('admin/settings/imagefield_gallery_types'); } -function imagefield_gallery_style_edit($type, $field){ +function imagefield_gallery_style_edit($form_state, $type, $field) { $cache = imagefield_gallery_get_imagecache_presets(); $var = variable_get('imagefield_gallery', array()); $form_func = $var[$type][$field]['gallery'] .'_imagefield_gallery_admin'; @@ -106,17 +98,15 @@ return system_settings_form($form); } -function imagefield_gallery_style_edit_validate($form_id, $form_values) { //!! this is probalby going to break, I forget what's in $form_values['variable'] but I think it makes this check - $validate_func = $form_values['variable'] .'_imagefield_gallery_admin_validate'; +function imagefield_gallery_style_edit_validate($form, &$form_state) { //!! this is probalby going to break, I forget what's in $form_values['variable'] but I think it makes this check + $validate_func = $form_state['values']['variable'] .'_imagefield_gallery_admin_validate'; if (function_exists($validate_func)) { - $validate_func($form_id, $form_values); + $validate_func($form, $form_state); } -} -function imagefield_gallery_style_edit_submit($form_id, $form_values) { //!! this is probalby going to break, I forget what's in $form_values['variable'] but I think it makes this check - $submit_func = $form_values['variable'] .'_imagefield_gallery_admin_submit'; + $submit_func = $form_state['values']['variable'] .'_imagefield_gallery_admin_submit'; if (function_exists($submit_func)) { - $submit_func($form_id, $form_values); + $submit_func($form, $form_state); imagefield_gallery_build_css(); } else { @@ -164,8 +154,8 @@ } } # end new stuff - - $current_theme = variable_get('theme_default','none'); + + $current_theme = variable_get('theme_default', 'none'); /*if (function_exists('garland_lightbox2_story_field_lead_image_imagefield_gallery')) { $gallery_func = 'garland_lightbox2_story_field_lead_image_imagefield_gallery'; }*/ @@ -181,7 +171,7 @@ else { $gallery_func = imagefield_gallery_gallery_type($type['type'], $type['name']) .'_imagefield_gallery'; } - + $node->content[$type['name']]['#value'] = theme($gallery_func, $images, $node, $type['name']); //$node->content[$type['name']]['#value'] = imagefield_gallery_gallery_type($type['type'], $type['name']) .'_'. $type['type'] .'_'. $type['name']; } @@ -222,10 +212,15 @@ $nt[$i]['type'] = $type['type']; $nt[$i]['name'] = $field['field_name']; } + if (($field['type'] == 'filefield') && ($field['widget']['type'] == 'imagefield_widget')) { + $nt[$i]['type'] = $type['type']; + $nt[$i]['name'] = $field['field_name']; + } + # new stuff if ($field['type'] == 'nodereference') { foreach ($field['referenceable_types'] as $name => $active) { - if($active && $types[$active]['fields']){ + if ($active && $types[$active]['fields']) { // check active content types for an imagefield. If one doesn't exist, this node reference is ineligible for an imagefield gallery foreach ($types[$active]['fields'] as $name2 => $field2) { if ($field2['type'] == 'image') { @@ -315,11 +310,12 @@ foreach ($types as $type) { $rows = array(); +// drupal_set_message('type: '.$type['type'].' name: '.$type['name']); if (empty($var[$type['type']][$type['name']]['gallery']) || !isset($var[$type['type']][$type['name']]['gallery'])) { - $gallery = 'none'; + $gallery = 'none'; } else { - $gallery = $var[$type['type']][$type['name']]['gallery']; + $gallery = $var[$type['type']][$type['name']]['gallery']; } $rows[] = array(''. $type['type'] .'', $type['name'], $gallery, l(t('edit'), 'admin/settings/imagefield_gallery_types_edit/'. $type['type'] .'/'. $type['name']), l(t('reset'), 'admin/settings/imagefield_gallery_types_reset/'. $type['type'] .'/'. $type['name'])); $output .= '