create a simple plugin functionality to easily swap the image system
Pasqualle - September 26, 2008 - 13:11
| Project: | jcarousel block |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
the first try:
<?php
$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..

#1
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..
#2
#3
improved directoryimage plugin
#4
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.
#5
commited
#6
I wanted to suggest to name the functions differently by image plugin type, but you fixed that already. Nice one.
#7
Automatically closed -- issue fixed for two weeks with no activity.