S2OJ/web/app/views/blog-editor.php

46 lines
1.8 KiB
PHP
Raw Normal View History

2016-07-18 16:39:37 +00:00
<form method="post" class="form-horizontal" id="form-<?= $editor->name ?>" enctype="multipart/form-data">
<?= HTML::hiddenToken() ?>
<div class="row">
<div class="col-sm-6">
<?= HTML::div_vinput("{$editor->name}_title", 'text', $editor->label_text['title'], html_entity_decode($editor->cur_data['title'])) ?>
</div>
2022-03-20 00:07:46 +00:00
<?php if ($editor->show_tags): ?>
2016-07-18 16:39:37 +00:00
<div class="col-sm-6">
<?= HTML::div_vinput("{$editor->name}_tags", 'text', $editor->label_text['tags'], join(', ', $editor->cur_data['tags'])) ?>
</div>
2022-03-20 00:07:46 +00:00
<?php endif ?>
2016-07-18 16:39:37 +00:00
</div>
2022-03-20 00:07:46 +00:00
<?php if ($editor->show_editor): ?>
2016-07-18 16:39:37 +00:00
<?= HTML::div_vtextarea("{$editor->name}_content_md", $editor->label_text['content'], $editor->cur_data['content_md']) ?>
2022-03-20 00:07:46 +00:00
<?php endif ?>
<div class="row mt-2">
2016-07-18 16:39:37 +00:00
<div class="col-sm-6">
<?php if ($editor->blog_url): ?>
<a id="a-<?= $editor->name ?>_view_blog" class="btn btn-info" href="<?= HTML::escape($editor->blog_url) ?>"><?= $editor->label_text['view blog'] ?></a>
<?php else: ?>
<a id="a-<?= $editor->name ?>_view_blog" class="btn btn-info" style="display: none;"><?= $editor->label_text['view blog'] ?></a>
<?php endif ?>
</div>
<div class="col-sm-6
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
text-end
<?php else: ?>
text-right
<?php endif ?>
">
2016-07-18 16:39:37 +00:00
<?= HTML::checkbox("{$editor->name}_is_hidden", $editor->cur_data['is_hidden']) ?>
</div>
</div>
</form>
<script type="text/javascript">
$('#<?= "input-{$editor->name}_is_hidden" ?>').bootstrapSwitch({
onText: <?= json_encode($editor->label_text['private']) ?>,
onColor: 'danger',
offText: <?= json_encode($editor->label_text['public']) ?>,
offColor: 'primary',
labelText: <?= json_encode($editor->label_text['blog visibility']) ?>,
handleWidth: 100
});
blog_editor_init("<?= $editor->name ?>", <?= json_encode(array('type' => $editor->type)) ?>);
</script>