Closed (fixed)
Project:
Embed widgets
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
5 Jun 2008 at 18:45 UTC
Updated:
24 Dec 2008 at 05:51 UTC
Jump to comment: Most recent file
What should and shouldn't go into the API? (embed_widgets.module)
Currently, the API consists of:
Other things that will likely go into the API:
What else makes a good API? I've been told, when in doubt, leave it out.
Perhaps a useful function would be one that returns a list of what types of additional widgets/widget modules are enabled. i.e. IFrame, Google Gadgets, JavaScript, etc.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | embed_widgets_API.patch | 4.95 KB | jtsnow |
Comments
Comment #1
nedjoGood questions. Yes, the sorts of utility functions you're suggesting are indeed good candidates.
We could consider introducing a hook or set of hooks. E.g.,
hook_embed_widgets()could allow modules to register the sorts of embed widgets they implement. This could allow us to reduce the code in each embed widget type module. Here are some rough ideas:Comment #2
jtsnow commentedI like the idea of having modules registering widget types. Here is a patch implementing that. It also moves the
$items['embed-widgets/%embed_widgets/code/' . $type]menu items into the API module and out of the IFrame module as you suggested. This can also be done with other functions, so I will improve upon this patch.Comment #3
alex ua commentedThis is what I was suggesting (poorly) when I mentioned that you should separate the embed source (i.e. page, view, block, etc) from the embed output (i.e. iframe, javascript, etc). This is already going in that direction, but I also think it might be worth creating more hooks within the different output modules you create.
Comment #4
aaron commentedNoticed that this patch has already been committed (and expanded). The API ideas look great. In implementation, I would recommend also caching some of this, for instance embed_widgets_get_types. No need to rebuild that every time we want to build or display an image. We would just rebuild it at /admin/build/modules (and possibly other places).
Of course, you may already be planning this, and just waiting until further in development. Just putting it out there.
Great work!
Aaron
Comment #5
jtsnow commented