Hi,

I tried overriding this function:

function theme_imagefield_gallery_lightbox2_css_render($type)

with my own function:

function phptemplate_imagefield_gallery_lightbox2_css_render($type)

but the override did not work.
After scratching my head, I noticed that problem is in the calling function:

function theme_imagefield_gallery_css_render()

The theme function is getting called called directly:

theme_imagefield_gallery_lightbox2_css_render($type)

rather than indirectly:

theme(imagefield_gallery_lightbox2_css_render$type)

I changed the calling function as follows and the override is now working:

function phptemplate_imagefield_gallery_css_render() {
  $output = "
/* This CSS File is automatically generated by the imagefield_gallery.module, any 
edits made to this file will be overwritten the next time any configuration changes 
are made via the admin.  If you'd like to alter the contents of this file, check 
theme_imagefield_gallery_css_render() in the imagefield_gallery.module file. */
";
  $types = imagefield_gallery_nodetypes();
  foreach ($types as $type) {
  	$s = 'imagefield_gallery_'. imagefield_gallery_gallery_type($type['type']) .'_css_render';
	
	$theme_func = 'theme_' . $s; 
	if (function_exists($theme_func)) {
	  $output .= theme($s, $type['type']); 
    }
	/* original version:
    $theme_func = 'theme_imagefield_gallery_'. imagefield_gallery_gallery_type($type['type']) .'_css_render';
    if (function_exists($theme_func)) {
      $output .= $theme_func($type['type']);
    }
	*/
  }
  return $output;
}

Anyway, thought I would let you know in case you wanted to add this fix to the source code.

- Mindy

Comments

eclipsegc’s picture

Assigned: Unassigned » eclipsegc

Mindy,

Nice catch, I'll add this to the list for the next version.

eclipsegc’s picture

Status: Active » Fixed

This is fixed as of version 1.4

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.