Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Uploadify (how to implement a custom action)


Reply


2 Posts   848 Views

Avatar
nicolant

Community Member, 6 Posts

9 September 2011 at 3:49am

Anyone, please point me in a right direction.

I want to add a new tab to ImageUploadField, and to place there a field to enter a timecode, and button to get preview from FLV attached via FileUploadField above, as shown in the image:

I've extended ImageUploadField and set a new template for it, with code for butrton as:

<button type="submit" class="{'url' : '$Link(extract)'}">Extract from video</button>

But where (in which class) to place a "function extract(...)" and why Firebug console shows corresponding request as
http://localhost/zavod/admin/EditForm/field/Media/item/3/DetailForm?SecurityID=...
i.e. without /extract chunk after "DetailForm"?

Thank you in advance, and sorry for not so good English...

Avatar
UncleCheese

Forum Moderator, 4096 Posts

10 September 2011 at 1:37am

I assume you have created a subclass of ImageUploadField? The function can go in there. Form fields are actually controllers. Just don't forget to add the "extract" action to your allowed_actions, too.

--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com