Deltacms/module/news/view/edit/edit.php

104 lines
3.2 KiB
PHP

<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Enregistrer en brouillon';
$text[2] = 'Publier';
$text[3] = 'Informations générales';
$text[4] = 'Titre';
$text[5] = 'Options de publication';
$text[6] = 'Auteur';
$text[7] = 'La news est consultable à partir du moment ou la date de publication est passée.';
$text[8] = 'Date de publication';
$text[9] = 'La news est consultable Jusqu\'à cette date si elle est spécifiée. Pour annuler la date de dépublication, sélectionnez une date antérieure à la publication.';
$text[10] = 'Date de dépublication';
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Save as draft';
$text[2] = 'Publish';
$text[3] = 'General information';
$text[4] = 'Title';
$text[5] = 'Publication options';
$text[6] = 'Author';
$text[7] = 'The news can be consulted as soon as the publication date has passed';
$text[8] = 'Publication date';
$text[9] = 'The news is viewable until this date if specified. To cancel the unpublishing date, select a date before publication';
$text[10] = 'Unpublish date';
break;
}
?>
<?php echo template::formOpen('newsEditForm'); ?>
<div class="row">
<div class="col2">
<?php echo template::button('newsEditBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'ico' => 'left',
'value' => $text[0]
]); ?>
</div>
<div class="col3 offset5">
<?php echo template::button('newsEditDraft', [
'uniqueSubmission' => true,
'value' => $text[1]
]); ?>
<?php echo template::hidden('newsEditState', [
'value' => true
]); ?>
</div>
<div class="col2">
<?php echo template::submit('newsEditSubmit', [
'value' => $text[2],
'uniqueSubmission' => true
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4><?php echo $text[3]; ?></h4>
<?php echo template::text('newsEditTitle', [
'label' => $text[4],
'value' => $this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(2), 'title'])
]); ?>
</div>
</div>
</div>
<?php echo template::textarea('newsEditContent', [
'class' => 'editorWysiwyg',
'value' => $this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(2), 'content'])
]); ?>
<div class="row">
<div class="col12">
<div class="block">
<h4><?php echo $text[5]; ?></h4>
<div class="row">
<div class="col4">
<?php echo template::select('newsEditUserId', $module::$users, [
'label' => $text[6],
'selected' => $this->getUser('id')
]); ?>
</div>
<div class="col4">
<?php echo template::date('newsEditPublishedOn', [
'help' => $text[7],
'label' => $text[8],
'value' => $this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(2), 'publishedOn'])
]); ?>
</div>
<div class="col4">
<?php echo template::date('newsEditPublishedOff', [
'help' => $text[9],
'label' => $text[10],
'value' => $this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(2), 'publishedOff'])
]); ?>
</div>
</div>
</div>
</div>
</div>
<?php echo template::formClose(); ?>