Deltacms/module/news/view/add/add.php

102 lines
2.9 KiB
PHP
Raw Normal View History

2022-03-06 13:35:21 +01:00
<?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] = 'Titre';
$text[4] = 'Auteur';
$text[5] = 'Informations générales';
$text[6] = 'Options de publication';
$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] = 'Title';
$text[4] = 'Author';
$text[5] = 'General information';
$text[6] = 'Publication options';
$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;
}
?>
2022-01-31 09:10:49 +01:00
<?php echo template::formOpen('newsAddForm'); ?>
<div class="row">
<div class="col2">
<?php echo template::button('newsAddBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'ico' => 'left',
2022-03-06 13:35:21 +01:00
'value' => $text[0]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
<div class="col3 offset5">
<?php echo template::button('newsAddDraft', [
'uniqueSubmission' => true,
2022-03-06 13:35:21 +01:00
'value' => $text[1]
2022-01-31 09:10:49 +01:00
]); ?>
<?php echo template::hidden('newsAddState', [
'value' => true
]); ?>
</div>
<div class="col2">
<?php echo template::submit('newsAddPublish', [
2022-03-06 13:35:21 +01:00
'value' => $text[2],
2022-01-31 09:10:49 +01:00
'uniqueSubmission' => true
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
2022-03-06 13:35:21 +01:00
<h4><?php echo $text[5]; ?></h4>
2022-01-31 09:10:49 +01:00
<?php echo template::text('newsAddTitle', [
2022-03-06 13:35:21 +01:00
'label' => $text[3]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
</div>
</div>
<?php echo template::textarea('newsAddContent', [
'class' => 'editorWysiwyg'
]); ?>
<div class="row">
<div class="col12">
<div class="block">
2022-03-06 13:35:21 +01:00
<h4><?php echo $text[6]; ?></h4>
2022-01-31 09:10:49 +01:00
<div class="row">
<div class="col4">
<?php echo template::select('newsAddUserId', $module::$users, [
2022-03-06 13:35:21 +01:00
'label' => $text[4],
2022-01-31 09:10:49 +01:00
'selected' => $this->getUser('id')
]); ?>
</div>
<div class="col4">
<?php echo template::date('newsAddPublishedOn', [
2022-03-06 13:35:21 +01:00
'help' => $text[7],
'label' => $text[8],
2022-01-31 09:10:49 +01:00
'value' => time()
]); ?>
</div>
<div class="col4">
<?php echo template::date('newsAddPublishedOff', [
2022-03-06 13:35:21 +01:00
'help' => $text[9],
'label' => $text[10],
2022-01-31 09:10:49 +01:00
'value' => $this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(2), 'publishedOff'])
]); ?>
</div>
</div>
</div>
</div>
</div>
<?php echo template::formClose(); ?>