[geeklog-devel] On to the next release
Joe Mucchiello
joe at ThrowingDice.com
Sun Sep 2 15:55:19 EDT 2007
Yes, it's a great example, but in practice, not everything sets such
a variable. The first thing I had to do to make it worth while to
hook event displays was add
$cal_templates->set_var('eid', $eid);
before the call to PLG_templateSetVars.
Doesn't solve the lack of a PLG_itemDeleted. I was thinking rather
than having a bunch of PLG_itemActions functions, it would be good to
change PLG_itemSaved to PLG_itemChanged and have it mirror the
PLG_groupChanged API:
function PLG_itemChanged($obj_id, $obj_type, $action)
Internally, when $action is 'save' it would first attempt to call
plugin_itemsaved_$plugin and if that didn't exist, it would try
plugin_itemchanged_$plugin to maintain backward compatibility with
anything using the PLG_itemSaved call.
At 12:02 PM 9/2/2007, Blaine Lang wrote:
>Joe Mucchiello wrote:
> > There should be a call to $template->set_vars('unique_id', $id)
> so that inside plugin_templatesetvars_$plugin, you can find the id
> of the item being displayed.
>
>I like that idea of using the template class to set a unique id
>variable which could then be used by plugins PLG_templateSetVars
>without needing to extend the API function. The API already passes
>the template and 'template_name' which developers can use
>$template->get_var('unique_id') if it needs the story SID.
>
>In the case of rendering a story, this is already done and this
>example for lib-custom on a fresh GL install works
>function CUSTOM_templateSetVars ($templatename, &$template) {
> if ($templatename == 'featuredstorytext' or $templatename ==
> 'storytext') {
> $sid = $template->get_var('story_id');
> // Do what we need with $sid and set our custom template vars
> }
>}
>
>Blaine
>>One more feature request. How about we settle the
>>PLG_templateSetVars/PLG_itemSaved issue from January? Either change
>>the API as I described or at least add the calls to these existing
>>functions where they should be.
>>
>>For example only stories supports calls to PLG_templateSetVars and
>>PLG_itemSaved. Of course, missing is PLG_itemDeleted but that could
>>be covered by a 3rd parameter to PLG_itemSaved. Users, groups and
>>comments have custom functions that do the same thing (mostly).
>>I've added calls to setvars and itemsaved to calendar (and I've got
>>a file of altered functions that i'm using to bridge between 1.4.1
>>and the 1.5 changes to stuff like ADMIN_list.) How hard would it be
>>to do the same thing in polls and links and whereever else they
>>should be? Calls to PLG_templateSetVars should be just about
>>everywhere there's a major call to parse.
>>
>>One more thing. There should be a call to
>>Template->set_vars('unique_id', $id) so that inside
>>plugin_templatesetvars_$plugin, you can find the id of the item
>>being displayed. Doing so probably also helps with theming.
>>
>>----
>>Joe Mucchiello
>>Throwing Dice Games
>>http://www.throwingdice.com
>>_______________________________________________
>>geeklog-devel mailing list
>>geeklog-devel at lists.geeklog.net
>>http://eight.pairlist.net/mailman/listinfo/geeklog-devel
>>
>_______________________________________________
>geeklog-devel mailing list
>geeklog-devel at lists.geeklog.net
>http://eight.pairlist.net/mailman/listinfo/geeklog-devel
----
Joe Mucchiello
Throwing Dice Games
http://www.throwingdice.com
More information about the geeklog-devel
mailing list