| Wednesday 07 December 2005 12:27:30 am 
                                                                 It is possible to create custom actions in Exponential. By default it comes with several like, creating new content, editing, collecting information and more.  You can place new actions in extension/mynewextension/actions/content_actionhandler.php 
You will have to override content.ini in your extension and addextension/mynewextension/settings/content.ini.append.php
 
[ActionSettings]ExtensionDirectories[]=mynewextension
 extension/mynewextension/actions/content_actionhandler.php function name have to start with extension name, other ways it will not work 
function mynewextension_ContentActionHandler( &$module, &$http, &$objectID )
{
    if( $http->hasPostVariable("CustomAction") )
    {
        //your custom action goes here
    }
}
In tpl you will need define form: 
<form method="post" action="content/action">
    <input type="submit" name="CustomAction" value="Custom action" />
    <input name="ContentObjectID" type="hidden" value="102" />
</form>
ContentObjectID have to be included in POST. For more examples look in to /kernel/content/action.php. I think you can re-use some code. Hope it will help you. Personal website -> http://serwatka.netBlog (about eZ Publish) -> http://serwatka.net/blog
 |