Deltacms/module/blog/view/edit/edit.php

160 lines
6.3 KiB
PHP
Raw Normal View History

2022-03-18 07:50:13 +01:00
<?php
// Lexique
2022-09-02 08:44:18 +02:00
$param = 'blog_view';
include('./module/blog/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_blog.php');
2022-11-05 09:31:32 +01:00
// Passage de la langue d'administration à Tinymce et flatpickr
2022-12-04 08:19:08 +01:00
$lang_admin = $text['blog_view']['edit'][24];
2022-11-05 09:31:32 +01:00
$lang_flatpickr = $text['blog_view']['edit'][25];
?>
<script> var lang_admin = "<?php echo $lang_admin; ?>"; var lang_flatpickr = "<?php echo $lang_flatpickr; ?>";</script>
2022-11-05 09:31:32 +01:00
<?php echo template::formOpen('blogEditForm'); ?>
2022-01-31 09:10:49 +01:00
<div class="row">
<div class="col2">
<?php echo template::button('blogEditBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'ico' => 'left',
2022-09-02 08:44:18 +02:00
'value' => $text['blog_view']['edit'][0]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
<div class="col3 offset5">
<?php echo template::button('blogEditDraft', [
'uniqueSubmission' => true,
2022-09-02 08:44:18 +02:00
'value' => $text['blog_view']['edit'][1]
2022-01-31 09:10:49 +01:00
]); ?>
<?php echo template::hidden('blogEditState', [
'value' => true
]); ?>
</div>
<div class="col2">
<?php echo template::submit('blogEditSubmit', [
2022-09-02 08:44:18 +02:00
'value' => $text['blog_view']['edit'][2],
2022-01-31 09:10:49 +01:00
'uniqueSubmission' => true,
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
2022-12-04 08:19:08 +01:00
<div class="blockTitle"><?php echo $text['blog_view']['edit'][3]; ?></div>
2022-01-31 09:10:49 +01:00
<div class="row">
<div class="col12">
<?php echo template::text('blogEditTitle', [
2022-09-02 08:44:18 +02:00
'label' => $text['blog_view']['edit'][4],
2022-01-31 09:10:49 +01:00
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'title'])
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
2022-09-02 08:44:18 +02:00
<?php $help = $text['blog_view']['add'][23];
2022-12-04 08:19:08 +01:00
if( $this->getData(['theme', 'site', 'width']) !== '100%' ) $help = $text['blog_view']['edit'][5] . ((int) substr($this->getData(['theme', 'site', 'width']), 0, -2) - (20 * 2)) . ' x 350 pixels.';
2022-03-18 07:50:13 +01:00
echo template::file('blogEditPicture', [
'help' => $help,
2022-09-02 08:44:18 +02:00
'label' => $text['blog_view']['edit'][6],
2022-01-31 09:10:49 +01:00
'type' => 1,
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'picture'])
]); ?>
</div>
<div class="col3">
2022-03-18 07:50:13 +01:00
<?php echo template::select('blogEditPictureSize', $pictureSizes, [
2022-09-02 08:44:18 +02:00
'label' => $text['blog_view']['edit'][7],
2022-01-31 09:10:49 +01:00
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'pictureSize'])
]); ?>
</div>
<div class="col3">
2022-03-18 07:50:13 +01:00
<?php echo template::select('blogEditPicturePosition', $picturePositions, [
2022-09-02 08:44:18 +02:00
'label' => $text['blog_view']['edit'][8],
2022-01-31 09:10:49 +01:00
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'picturePosition']),
2022-09-02 08:44:18 +02:00
'help' => $text['blog_view']['edit'][9]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
2022-09-02 08:44:18 +02:00
<?php echo template::checkbox('blogEditHidePicture', true, $text['blog_view']['edit'][10], [
2022-01-31 09:10:49 +01:00
'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'hidePicture'])
]); ?>
</div>
</div>
</div>
</div>
</div>
<?php echo template::textarea('blogEditContent', [
'class' => 'editorWysiwyg',
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'content'])
]); ?>
<div class="row">
<div class="col12">
<div class="block">
2022-12-04 08:19:08 +01:00
<div class="blockTitle"><?php echo $text['blog_view']['edit'][11]; ?></div>
2022-01-31 09:10:49 +01:00
<div class="row">
2022-11-10 09:00:05 +01:00
<div class="col4 <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo 'displayNone'; ?> ">
2022-01-31 09:10:49 +01:00
<?php echo template::select('blogEditUserId', $module::$users, [
2022-09-02 08:44:18 +02:00
'label' => $text['blog_view']['edit'][12],
2022-11-10 09:00:05 +01:00
'selected' => $this->getUser('id')
2022-01-31 09:10:49 +01:00
]); ?>
</div>
<div class="col4">
<?php echo template::date('blogEditPublishedOn', [
2022-09-02 08:44:18 +02:00
'help' => $text['blog_view']['edit'][13],
'label' => $text['blog_view']['edit'][14],
2022-01-31 09:10:49 +01:00
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'publishedOn'])
]); ?>
</div>
2022-11-10 09:00:05 +01:00
<div class="col4 <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo 'displayNone'; ?> ">
2022-03-18 07:50:13 +01:00
<?php echo template::select('blogEditConsent', $articleConsent , [
2022-09-02 08:44:18 +02:00
'label' => $text['blog_view']['edit'][15],
2022-01-31 09:10:49 +01:00
'selected' => is_numeric($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent'])) ? $module::EDIT_GROUP : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent']),
2022-11-10 09:00:05 +01:00
'help' => $text['blog_view']['edit'][16]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
2022-12-04 08:19:08 +01:00
<div class="blockTitle"><?php echo$text['blog_view']['edit'][17]; ?></div>
2022-01-31 09:10:49 +01:00
<div class="row">
<div class="col4 ">
2022-09-02 08:44:18 +02:00
<?php echo template::checkbox('blogEditCommentClose', true, $text['blog_view']['edit'][18], [
2022-01-31 09:10:49 +01:00
'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentClose'])
]); ?>
</div>
<div class="col4 commentOptionsWrapper ">
2022-09-02 08:44:18 +02:00
<?php echo template::checkbox('blogEditCommentApproved', true, $text['blog_view']['edit'][19], [
2022-01-31 09:10:49 +01:00
'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentApproved']),
''
]); ?>
</div>
<div class="col4 commentOptionsWrapper">
2022-09-02 08:44:18 +02:00
<?php echo template::select('blogEditCommentMaxlength', $commentLength,[
'help' => $text['blog_view']['edit'][20],
'label' => $text['blog_view']['edit'][21],
2022-01-31 09:10:49 +01:00
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentMaxlength'])
]); ?>
</div>
</div>
<div class="row">
<div class="col3 commentOptionsWrapper offset2">
2022-09-02 08:44:18 +02:00
<?php echo template::checkbox('blogEditCommentNotification', true, $text['blog_view']['edit'][22], [
2022-01-31 09:10:49 +01:00
'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentNotification']),
]); ?>
</div>
<div class="col4 commentOptionsWrapper">
2022-09-02 08:44:18 +02:00
<?php echo template::select('blogEditCommentGroupNotification', $groupNews, [
2022-01-31 09:10:49 +01:00
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentGroupNotification']),
2022-09-02 08:44:18 +02:00
'help' => $text['blog_view']['edit'][23]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
</div>
</div>
</div>
</div>
<?php echo template::formClose(); ?>