{*Edit topic form*} {style} {literal} .ow_forum_attachment_icon { display: inline-block; background-repeat: no-repeat; cursor: pointer; width: 14px; height: 17px; } .forum_attachments_label { margin: 15px 0 5px; padding-left: 5px; font-weight: bold; } {/literal} {/style} {script} {literal} $('#toggle_attach_link').click(function(){ $('#attach_file_inputs').toggle(); }); $('#toggle_attach_edit_link').click(function(){ $('#attach_edit_file_inputs').toggle(); }); $(".ow_forum_attachment").hover( function(){ $(this).find("a.forum_delete_attachment").show(); }, function(){ $(this).find("a.forum_delete_attachment").hide(); } ); $("a.forum_delete_attachment").each(function(){ var container_handler = $(this).parent(); $(this).click(function(){ if ( confirm(OW.getLanguageText('forum', 'confirm_delete_attachment')) ) { var attachment_id = $(this).attr("rel"); 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-topic-form'} {if $enableAttachments} {/if}
{text key='forum+new_topic_subject'} {input name='title'} {error name='title'}
{text key='forum+new_topic_body'} {input name='text' id='post_body'} {error name='text'}
{text key='forum+attachments'} {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) {text key='base+delete'}
{/foreach} {/if}   {text key='forum+attach_files'}

{input name='attachments'}
{submit name='save' class="ow_ic_save"}
{/form}