123 lines
4.3 KiB
PHP
Executable File
123 lines
4.3 KiB
PHP
Executable File
<?php
|
|
/* Smarty version 5.3.1, created on 2025-02-02 20:24:13
|
|
from 'file:admin/announcement/edit.tpl' */
|
|
|
|
/* @var \Smarty\Template $_smarty_tpl */
|
|
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
|
|
'version' => '5.3.1',
|
|
'unifunc' => 'content_679f63ed59a180_96629682',
|
|
'has_nocache_code' => false,
|
|
'file_dependency' =>
|
|
array (
|
|
'2c8abbf99da7fb97cb375bf7b5ae4c9272a5143d' =>
|
|
array (
|
|
0 => 'admin/announcement/edit.tpl',
|
|
1 => 1712762115,
|
|
2 => 'file',
|
|
),
|
|
),
|
|
'includes' =>
|
|
array (
|
|
'file:admin/header.tpl' => 1,
|
|
'file:admin/footer.tpl' => 1,
|
|
),
|
|
))) {
|
|
function content_679f63ed59a180_96629682 (\Smarty\Template $_smarty_tpl) {
|
|
$_smarty_current_dir = '/www/wwwroot/fuuu.cloud/resources/views/tabler/admin/announcement';
|
|
$_smarty_tpl->renderSubTemplate('file:admin/header.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir);
|
|
?>
|
|
|
|
<?php echo '<script'; ?>
|
|
src="//cdnjs.cloudflare.com/ajax/libs/tinymce/7.0.0/tinymce.min.js"><?php echo '</script'; ?>
|
|
>
|
|
|
|
<div class="page-wrapper">
|
|
<div class="container-xl">
|
|
<div class="page-header d-print-none text-white">
|
|
<div class="row align-items-center">
|
|
<div class="col">
|
|
<h2 class="page-title">
|
|
<span class="home-title">编辑公告 #<?php echo $_smarty_tpl->getValue('ann')->id;?>
|
|
</span>
|
|
</h2>
|
|
<div class="page-pretitle my-3">
|
|
<span class="home-subtitle">编辑站点公告</span>
|
|
</div>
|
|
</div>
|
|
<div class="col-auto ms-auto d-print-none">
|
|
<div class="btn-list">
|
|
<button id="save-ann" href="#" class="btn btn-primary">
|
|
<i class="icon ti ti-device-floppy"></i>
|
|
保存
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="page-body">
|
|
<div class="container-xl">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div class="mb-3">
|
|
<form method="post">
|
|
<textarea id="tinymce"><?php echo $_smarty_tpl->getValue('ann')->content;?>
|
|
</textarea>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<?php echo '<script'; ?>
|
|
>
|
|
document.addEventListener("DOMContentLoaded", function () {
|
|
let options = {
|
|
selector: '#tinymce',
|
|
menubar: false,
|
|
statusbar: false,
|
|
plugins:
|
|
'advlist autolink lists link image charmap preview anchor searchreplace visualblocks ' +
|
|
'code insertdatetime media table',
|
|
toolbar: 'undo redo | bold italic backcolor link | styles | fontsize | lineheight | alignleft aligncenter ' +
|
|
'alignright alignjustify | bullist numlist outdent indent | removeformat',
|
|
content_style: 'body { font-size: 14px; }',
|
|
<?php if ($_smarty_tpl->getValue('user')->is_dark_mode) {?>
|
|
skin: 'oxide-dark',
|
|
content_css: 'dark',
|
|
<?php }?>
|
|
}
|
|
tinyMCE.init(options);
|
|
})
|
|
|
|
$("#save-ann").click(function () {
|
|
$.ajax({
|
|
url: '/admin/announcement/' + <?php echo $_smarty_tpl->getValue('ann')->id;?>
|
|
,
|
|
type: 'PUT',
|
|
dataType: "json",
|
|
data: {
|
|
content: tinyMCE.activeEditor.getContent(),
|
|
},
|
|
success: function (data) {
|
|
if (data.ret === 1) {
|
|
$('#success-message').text(data.msg);
|
|
$('#success-dialog').modal('show');
|
|
window.setTimeout("location.href=top.document.referrer", <?php echo $_smarty_tpl->getValue('config')['jump_delay'];?>
|
|
);
|
|
} else {
|
|
$('#fail-message').text(data.msg);
|
|
$('#fail-dialog').modal('show');
|
|
}
|
|
}
|
|
})
|
|
});
|
|
<?php echo '</script'; ?>
|
|
>
|
|
|
|
<?php $_smarty_tpl->renderSubTemplate('file:admin/footer.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), (int) 0, $_smarty_current_dir);
|
|
}
|
|
}
|