IF you call the Gallery_CP class you should be able to do something like this:
$GALL->gallery_id = '#';
$GALL->assign_gallery_preferences();
Then you would have the prefs you needed available from:
$GALL->prefs;
I’m just shooting from the hip here. I have a meeting to run off to in a few minutes. But something like the above should work. I’m assuming you called the class as: $GALL = new Gallery_CP; of course.
Jamie
Without knowing what you’re doing, I’d say in this case it’s not worth it to dogmatically stick to a practice of never duplicating code (believe me, I hate duplicated code too). Reason being, that method was never intended to be used outside of the Gallery module, and including that entire file and instantiated a class object for just that one tiny method may be better for you from a code perspective, it is worse for the user and server, occupying more resources, not to mention running a bunch of things in the class constructor method that you do not need.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.