{*Edit post form*} {script} {literal} $("a.forum_delete_attachment").each(function(){ var container_handler = $(this).closest(".attachment_container"); $(this).click(function(){ if ( confirm(OW.getLanguageText('forum', 'confirm_delete_attachment')) ) { var attachment_id = $(this).data("aid"); var params = {}; var url = '{/literal}{url_for_route for='forum_delete_attachment'}{literal}'; params['attachmentId'] = attachment_id; $.ajaxSetup({dataType: 'json'}); $.post(url, params, function(data){ if ( data.result == true ) { OW.info(data.msg); container_handler.remove(); } else if (data.error != undefined) { OW.warning(data.error); } }); } else { return false; } }); }); {/literal} {/script} {if $isHidden}
{$componentForumCaption}
{/if} {$breadcrumb} {form name='edit-post-form'}
{text key='forum+new_topic_body'}
{input name='text' class="ow_smallmargin" id='post_body'}
{error name='text'}
{if $enableAttachments} {*capture assign='postId'}{$post->id}{/capture*} {if isset($attachments[$postId])}
{foreach from=$attachments[$postId] item='attm'}
{if $attm.downloadUrl != ''}{$attm.fileName}{else}{$attm.fileName}{/if} ({$attm.fileSize}Kb)
{/foreach}
{/if}
{$attachmentsCmp}
{/if}
{submit name='save' class='ow_ic_save ow_positive'}
{/form}