Add a button to slots

4 views
Skip to first unread message

Charles

unread,
Aug 3, 2010, 6:00:43 AM8/3/10
to apostr...@googlegroups.com
Hello,
Our client ask us to show some slots to identifed groups of users. So we need to add a button "groups" to some slots : http://img230.imageshack.us/i/screenshot007cq.jpg/. In our database we need to link a group a to slot.
It works in Ajax when we edit an existing slot (because we know at this moment the slot id).
But the problem is that when we create a new slot we don't know the id it will have when the slot will be saved in the DB.
So we need the override public function executeEdit(sfRequest $request) in BaseaSlotActions.class.php to take in account our new parameter (group). But, of course, we don't want to edit this class that is part of Aposrtophe plugin.
Perhaps BaseaSlotActions.class.php should be an empty class that we could override ?
 
Any help would be most welcome !

Tom Boutell

unread,
Aug 3, 2010, 8:13:33 AM8/3/10
to apostr...@googlegroups.com
Override aSlotActions. That extends BaseaSlotActions and adds nothing,
so you can override it and call parent:: versions before/after doing
whatever it is you want to do in addition. This is standard for
Symfony modules in plugins.

--
Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com

Tom Boutell

unread,
Aug 3, 2010, 8:15:42 AM8/3/10
to apostr...@googlegroups.com
Pardon, you're right, BaseaSlotActions is the parent of the various
Base classes for individual slot types. So you would need to do the
override for individual slot types, which is a bit awkward I'll admit.

We should make BaseaSlotActions an override of PluginASlotActions
which should be the real container of our code so that you can easily
override for all slots without copying. Would you mind opening a
ticket about this in trac.apostrophenow.org?

On Tue, Aug 3, 2010 at 6:00 AM, Charles <jc.d...@gmail.com> wrote:

--

Reply all
Reply to author
Forward
0 new messages