the first try:

$imagefield_type = variable_get('jcarousel_block_imagefield_type', 'imceimage');
module_load_include('inc', 'jcarousel_block', $imagefield_type);

imceimage.inc
imagefield.inc
directoryimage.inc

and all should have an equally named jcarousel_block_preprocess_image(&$variables) function, and any other function necessary.
this way it would be possible to add new types without altering the main module files..

---
it would be even better if custom modules can define their image system in their own space like views uses the module_name.views.inc files..

Comments

pasqualle’s picture

Status: Needs review » Active
StatusFileSize
new2.34 KB
new8.4 KB
new1.99 KB
new951 bytes
new11.69 KB

The basic plugin system.
The admin settings are not included, they are left in the module, as it is not possible to include files with the same function names. It would require additional include files per image type (like imceimage.settings.inc)

directory structure should be:
jcarousel_block.module
includes/imceimage.inc
includes/imagefield.inc
includes/directoryimage.inc

attached the patch for the module, but also attached the final (patched) module file, if there would be a problem applying the patch..

pasqualle’s picture

Status: Active » Needs review
pasqualle’s picture

Status: Active » Needs review
StatusFileSize
new1.91 KB

improved directoryimage plugin

yang_yi_cn’s picture

Thanks for that. I'm currently busy and don't have too much time to make a new release for that. However, when I do have time, I'm thinking about integrate some video module as well, maybe embedded meta field module. So the next release will not be there very soon.

yang_yi_cn’s picture

Status: Needs review » Fixed

commited

pasqualle’s picture

I wanted to suggest to name the functions differently by image plugin type, but you fixed that already. Nice one.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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