Customization of flashvideo_objects.inc
| Project: | FlashVideo |
| Version: | 5.x-2.8-rc3 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Jump to:
Hi!
Foro our project, I needed to customize the output generation in flashvideo_objects.inc. To make this survive eventual updates, I have put those changes in a file named flashvideo_objects_custom.inc and enhanced flashvideo.module to include the custom file instead of the standard if it exists. Now it would be nice if this or an equivalent mechanism could be included in the next version. if I have missed some already available way to achieve this customization I would be glad if someone would point it out to me. Thanks
diff --git a/sites/all/modules/flashvideo/flashvideo.module b/sites/all/modules/flashvideo/flashvideo.module
index 78df2d7..9fe4419 100644
--- a/sites/all/modules/flashvideo/flashvideo.module
+++ b/sites/all/modules/flashvideo/flashvideo.module
@@ -6,7 +6,15 @@
* Enables the ability to attach a Flash video to a node.
*/
-require_once(drupal_get_path('module', 'flashvideo') . '/flashvideo_objects.inc');
+$flashvideo_inc_path = drupal_get_path('module', 'flashvideo') . '/';
+$standard_objects_inc = $flashvideo_inc_path . 'flashvideo_objects.inc';
+$custom_objects_inc = $flashvideo_inc_path . 'flashvideo_objects_custom.inc';
+
+if (file_exists($custom_objects_inc)) {
+ require_once($custom_objects_inc);
+} else {
+ require_once($standard_objects_inc);
+}
/**
* The Status defines for a FlashVideo video.
| Attachment | Size |
|---|---|
| flashvideo_objects_custom_inc.diff | 827 bytes |

#1