Forums / Developer / Content Action

Content Action

Author Message

Stefano Vaghi

Thursday 29 May 2008 6:43:17 am

Hi,

I am creating an interface to edit a particular content class. I don't undestand how the "button mechanism" works.

For example, for my class I want to have standard action mechanism (edit, delete...), and other custom actions.
I see that all admin buttons call the view "action" of module "content", with a particular name (for example "EditButton").
I see that for custom buttons, I have to use the name "NewButton".

But, where do I set what will be the action produced (what's going to happen if I push that button)?

Thanks

Kristof Coomans

Friday 30 May 2008 1:17:14 am

Hi Stefano

The view "action" of the module "content" uses the script action.php. You can find this out by inspecting the $ViewList variable in kernel/content/module.php. In the same array, there are mappings from POST variables to actions. In the view script (in this case action.php) the current action can be fetched by using $Module->currentAction() or there is checked if the current action is 'whatever' with $Module->isCurrentAction( 'whatever' ).

You can find some more information about this on http://ezpedia.org/wiki/en/ez/module

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Stefano Vaghi

Monday 02 June 2008 3:37:56 am

thanks for your answer... :)