Get List of GalleryItem/GalleryDataItem Types? for extending CustomFields Module

draco2002

Joined: 2003-04-28
Posts: 70
Posted: Sat, 2006-04-01 21:38

I'm in the middle of creating two modules which extend the GalleryItem/GalleryDataItem classes. For the most part using the api and available functions they fit in nicely with the current frame work. The problem is that i would like to have Custom Fields specific to the different types.
Looking in the CustomFields Code it is pulling back a hardcoded set array. With some tweaking of that file along with the .tpl i am able to have it show/allow/maintain custom fields for the new GalleryItems. however this probably isn't the best long term soltuion. If there was a more dynamic way to populate the set array with all avaible item types (animation/movie/etc) then if we add any new item types they will automagically showup.

I'm going to be looking into this, but would like to know if there is an easy/best way to get a list of available item types?

a quick fix type solutions would be Select unique from g2_Entity/g2_EntityType where rigth 4 are item, but this would only pull back the types that you are currently using not all that are installed/available.

Thanks in advance,

-Dan
||Custom Theming | Donate to Gallery ||

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2006-04-01 23:35

you can do GalleryCoreApi::getAllFactoryImplementationIds('GalleryItem')

 
draco2002

Joined: 2003-04-28
Posts: 70
Posted: Sun, 2006-04-02 01:11

Haven't tried it yet, but sounds perfect. I'll post the changes to the customfields module as soon i'm done with it.

Thanks for your help again.

-Draco

||Custom Theming | Donate to Gallery ||