<?php
/* Smarty version 3.1.29, created on 2016-12-22 12:33:43
  from "/home/enousk5/public_html/questforbelief.com/docf/ow_plugins/forum/views/controllers/edit_topic_index.html" */

if ($_smarty_tpl->smarty->ext->_validateCompiled->decodeProperties($_smarty_tpl, array (
  'has_nocache_code' => false,
  'version' => '3.1.29',
  'unifunc' => 'content_585b57a77585e8_47551760',
  'file_dependency' => 
  array (
    'dca1a0e91b70e5cb1ba4a2e6441b43d58356b685' => 
    array (
      0 => '/home/enousk5/public_html/questforbelief.com/docf/ow_plugins/forum/views/controllers/edit_topic_index.html',
      1 => 1469549704,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_585b57a77585e8_47551760 ($_smarty_tpl) {
if (!is_callable('smarty_block_script')) require_once '/home/enousk5/public_html/questforbelief.com/docf/ow_smarty/plugin/block.script.php';
if (!is_callable('smarty_function_url_for_route')) require_once '/home/enousk5/public_html/questforbelief.com/docf/ow_smarty/plugin/function.url_for_route.php';
if (!is_callable('smarty_block_form')) require_once '/home/enousk5/public_html/questforbelief.com/docf/ow_smarty/plugin/block.form.php';
if (!is_callable('smarty_function_cycle')) require_once '/home/enousk5/public_html/questforbelief.com/docf/ow_libraries/vendor/smarty/smarty/libs/plugins/function.cycle.php';
if (!is_callable('smarty_function_text')) require_once '/home/enousk5/public_html/questforbelief.com/docf/ow_smarty/plugin/function.text.php';
if (!is_callable('smarty_function_input')) require_once '/home/enousk5/public_html/questforbelief.com/docf/ow_smarty/plugin/function.input.php';
if (!is_callable('smarty_function_error')) require_once '/home/enousk5/public_html/questforbelief.com/docf/ow_smarty/plugin/function.error.php';
if (!is_callable('smarty_function_submit')) require_once '/home/enousk5/public_html/questforbelief.com/docf/ow_smarty/plugin/function.submit.php';
?>


<?php $_smarty_tpl->smarty->_cache['tag_stack'][] = array('script', array()); $_block_repeat=true; echo smarty_block_script(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>


    $("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 = '<?php echo smarty_function_url_for_route(array('for'=>'forum_delete_attachment'),$_smarty_tpl);?>
';
               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;
            }
        });
    });

<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_script(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_cache['tag_stack']);?>


<?php if ($_smarty_tpl->tpl_vars['isHidden']->value) {?>
    <div class="ow_stdmargin">
        <?php echo $_smarty_tpl->tpl_vars['componentForumCaption']->value;?>

    </div>
<?php }
echo $_smarty_tpl->tpl_vars['breadcrumb']->value;?>



<?php $_smarty_tpl->smarty->_cache['tag_stack'][] = array('form', array('name'=>'edit-topic-form')); $_block_repeat=true; echo smarty_block_form(array('name'=>'edit-topic-form'), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>

    <table class="ow_table_1 ow_form" width="100%">
    <tbody>
        <tr class="ow_alt<?php echo smarty_function_cycle(array('values'=>'2,1'),$_smarty_tpl);?>
ow_tr_first <?php if (!$_smarty_tpl->tpl_vars['enableAttachments']->value) {?>ow_tr_last<?php }?>">
            <td class="ow_label"><?php echo smarty_function_text(array('key'=>'forum+new_topic_subject'),$_smarty_tpl);?>
</td>
            <td class="ow_value">
                <?php echo smarty_function_input(array('name'=>'title'),$_smarty_tpl);?>

                <?php echo smarty_function_error(array('name'=>'title'),$_smarty_tpl);?>

            </td>
        </tr>
        <tr class="ow_alt<?php echo smarty_function_cycle(array('values'=>'2,1'),$_smarty_tpl);?>
">
            <td class="ow_label"><?php echo smarty_function_text(array('key'=>'forum+new_topic_body'),$_smarty_tpl);?>
</td>
            <td class="ow_value">
                <div class="ow_smallmargin">
                <?php echo smarty_function_input(array('name'=>'text','id'=>'post_body'),$_smarty_tpl);?>

                <?php echo smarty_function_error(array('name'=>'text'),$_smarty_tpl);?>

                </div>
                <?php if ($_smarty_tpl->tpl_vars['enableAttachments']->value) {?>
                    <?php $_smarty_tpl->_cache['capture_stack'][] = array('default', 'postId', null); ob_start();
echo $_smarty_tpl->tpl_vars['post']->value->id;
list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_cache['capture_stack']);
if (!empty($_capture_buffer)) {
 if (isset($_capture_assign)) $_smarty_tpl->assign($_capture_assign, ob_get_contents());
 if (isset( $_capture_append)) $_smarty_tpl->append( $_capture_append, ob_get_contents());
$_smarty_tpl->_cache['__smarty_capture'][$_capture_buffer]=ob_get_clean();
} else $_smarty_tpl->capture_error();?>
                    <?php if (isset($_smarty_tpl->tpl_vars['attachments']->value[$_smarty_tpl->tpl_vars['postId']->value])) {?>
                    <div class="ow_file_attachment_preview clearfix">
                        <?php
$_from = $_smarty_tpl->tpl_vars['attachments']->value[$_smarty_tpl->tpl_vars['postId']->value];
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$__foreach_attm_0_saved_item = isset($_smarty_tpl->tpl_vars['attm']) ? $_smarty_tpl->tpl_vars['attm'] : false;
$_smarty_tpl->tpl_vars['attm'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['attm']->_loop = false;
foreach ($_from as $_smarty_tpl->tpl_vars['attm']->value) {
$_smarty_tpl->tpl_vars['attm']->_loop = true;
$__foreach_attm_0_saved_local_item = $_smarty_tpl->tpl_vars['attm'];
?>
                        <div class="attachment_container ow_file_attachment_block<?php echo smarty_function_cycle(array('values'=>'1,2'),$_smarty_tpl);?>
">
                            <div class="ow_file_attachment_info">
                                <div class="ow_file_attachment_name">
                                    <?php if ($_smarty_tpl->tpl_vars['attm']->value['downloadUrl'] != '') {?><a href="<?php echo $_smarty_tpl->tpl_vars['attm']->value['downloadUrl'];?>
"><?php echo $_smarty_tpl->tpl_vars['attm']->value['fileName'];?>
</a><?php } else {
echo $_smarty_tpl->tpl_vars['attm']->value['fileName'];
}?>
                                    <span class="ow_file_attachment_size" style="display: inline-block;">(<?php echo $_smarty_tpl->tpl_vars['attm']->value['fileSize'];?>
Kb)</span>
                                </div>
                                <a href="javascript://" class="ow_file_attachment_close forum_delete_attachment" data-aid="<?php echo $_smarty_tpl->tpl_vars['attm']->value['id'];?>
"></a>
                            </div>
                        </div>
                        <?php
$_smarty_tpl->tpl_vars['attm'] = $__foreach_attm_0_saved_local_item;
}
if ($__foreach_attm_0_saved_item) {
$_smarty_tpl->tpl_vars['attm'] = $__foreach_attm_0_saved_item;
}
?>
                    </div>
                    <?php }?>
                    <div class="ow_smallmargin">
                        <?php echo $_smarty_tpl->tpl_vars['attachmentsCmp']->value;?>

                    </div>
                <?php }?>
            </td>
        </tr>
    </tbody>
    </table>
    <div class="clearfix ow_stdmargin">
    <div class="ow_right">
		<?php echo smarty_function_submit(array('name'=>'save','class'=>"ow_ic_save ow_positive"),$_smarty_tpl);?>
 
	</div>
	</div>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_form(array('name'=>'edit-topic-form'), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_cache['tag_stack']);?>

<?php }
}
