Deltacms/core/module/page/view/edit/edit.php

414 lines
16 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] = 'Aide';
$text[2] = 'Dupliquer';
$text[3] = 'Supprimer';
$text[4] = 'Enregistrer';
$text[5] = 'Informations générales';
$text[6] = 'Titre';
$text[7] = 'Titre court';
$text[8] = 'Le titre court est affiché dans les menus. Il peut être identique au titre de la page.';
$text[9] = 'En cas de changement de module, les données du module précédent seront supprimées.';
$text[10] = 'Module';
$text[11] = 'Aspect du lien';
$text[12] = 'Sélectionnez une image ou une icône de petite dimension';
$text[13] = 'Icône';
$text[14] = 'En position libre ajoutez le module en plaçant [MODULE] à l\'endroit voulu dans votre page.';
$text[15] = 'Position du module';
$text[16] = 'Mise en page';
$text[17] = 'Gabarits de page / Barre latérale';
$text[18] = 'Pour définir la page comme barre latérale, choisissez l\'option dans la liste.';
$text[19] = 'Barre latérale gauche :';
$text[20] = 'Barre latérale droite :';
$text[21] = 'Contenu du menu vertical';
$text[22] = 'Par défaut le menu est affiché APRES le contenu de la page. Pour le positionner à un emplacement précis, insérez [MENU] dans le contenu de la page.';
$text[23] = 'Emplacement dans le menu';
$text[24] = 'Position';
$text[25] = '\'Ne pas afficher\' crée une page orpheline non accessible par le biais des menus.';
$text[26] = 'Page parent';
$text[27] = 'Une page désactivée n\'est pas cliquable en mode déconnecté, les pages enfants sont visibles et accessibles. La page d\'accueil n\'est pas désactivable.';
$text[28] = 'Affiche le nom de la page parente suivi du nom de la page, le titre ne doit pas être masqué.';
$text[29] = 'Options d\'emplacement avancées';
$text[30] = 'Masquer les pages enfants dans le menu horizontal';
$text[31] = 'Masquer la page et les pages enfants dans le menu d\'une barre latérale';
$text[32] = 'La page est affichée dans un menu horizontal mais pas dans le menu vertical d\'une barre latérale.';
$text[33] = 'Permission et référencement';
$text[34] = 'Groupe requis pour accéder à la page :';
$text[35] = 'Méta-titre';
$text[36] = 'Méta-description';
$text[37] = 'Désactivée';
$text[38] = 'Nouvel onglet';
$text[39] = 'Titre masqué';
$text[40] = 'Fil d\'Ariane';
$typeMenu = $module::$typeMenu;
$modulePosition = $module::$modulePosition;
$pageBlocks = $module::$pageBlocks;
$displayMenu = $module::$displayMenu;
$groupPublics = self::$groupPublics;
$pagesBarId = $module::$pagesBarId;
$pagesNoParentId = $module::$pagesNoParentId;
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[2] = 'Duplicate';
$text[3] = 'Delete';
$text[4] = 'OK';
$text[5] = 'General information';
$text[6] = 'Title';
$text[7] = 'Short title';
$text[8] = 'The short title is displayed in the menus. It can be identical to the page title.';
$text[9] = 'If the module is changed, the data of the previous module will be deleted.';
$text[10] = 'Module';
$text[11] = 'Aspect of the link';
$text[12] = 'Select a small image or icon';
$text[13] = 'Icon';
$text[14] = 'In free position add the module by placing [MODULE] at the desired location on your page.';
$text[15] = 'Module position';
$text[16] = 'Layout';
$text[17] = 'Page templates / Sidebar';
$text[18] = 'To set the page as a sidebar, choose the option from the list.';
$text[19] = 'Left sidebar :';
$text[20] = 'Right sidebar :';
$text[21] = 'Content of the vertical menu';
$text[22] = 'By default the menu is displayed AFTER the page content. To position it at a specific location, insert [MENU] into the page content.';
$text[23] = 'Location in the menu';
$text[24] = 'Position';
$text[25] = 'Do not display creates an orphan page that cannot be accessed via the menus.';
$text[26] = 'Parent page';
$text[27] = 'A deactivated page is not clickable in disconnected mode, the child pages are visible and accessible. The home page cannot be disabled.';
$text[28] = 'Displays the parent page name followed by the page name, the title should not be hidden.';
$text[29] = 'Advanced location options';
$text[30] = 'Hide child pages in the horizontal menu';
$text[31] = 'Hide the page and child pages in the sidebar menu';
$text[32] = 'The page is displayed in a horizontal menu but not in the vertical menu of a sidebar.';
$text[33] = 'Permission and referencing';
$text[34] = 'Group required to access the page:';
$text[35] = 'Meta title';
$text[36] = 'Meta description';
$text[37] = 'Disabled';
$text[38] = 'New tab';
$text[39] = 'Title hidden';
$text[40] = 'Breadcrumb';
$typeMenu = $module::$typeMenu_en;
$modulePosition = $module::$modulePosition_en;
$pageBlocks = $module::$pageBlocks_en;
$displayMenu = $module::$displayMenu_en;
$groupPublics = self::$groupPublics_en;
$pagesBarId = $module::$pagesBarId_en;
$pagesNoParentId = $module::$pagesNoParentId_en;
break;
}
?>
2022-01-31 09:10:49 +01:00
<?php echo template::formOpen('pageEditForm'); ?>
<div class="row">
<div class="col2">
<?php $href = helper::baseUrl() . $this->getUrl(2); ?>
<?php if ($this->getData(['page', $this->getUrl(2), 'moduleId']) === 'redirection' || 'code')$href = helper::baseUrl(); ?>
<?php echo template::button('pageEditBack', [
'class' => 'buttonGrey',
'href' => $href,
'ico' => 'left',
2022-03-06 13:35:21 +01:00
'value' => $text[0]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
<div class="col2">
<?php echo template::button('pageEditHelp', [
'href' => 'https://doc.deltacms.fr/edition',
'target' => '_blank',
'ico' => 'help',
2022-03-06 13:35:21 +01:00
'value' => $text[1],
2022-01-31 09:10:49 +01:00
'class' => 'buttonHelp'
]); ?>
</div>
<div class="col2 offset2">
<?php echo template::button('pageEditDuplicate', [
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(2) . '&csrf=' . $_SESSION['csrf'],
2022-03-06 13:35:21 +01:00
'value' => $text[2],
2022-01-31 09:10:49 +01:00
'ico' => 'clone'
]); ?>
</div>
<div class="col2">
<?php echo template::button('pageEditDelete', [
'class' => 'buttonRed',
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(2) . '&csrf=' . $_SESSION['csrf'],
2022-03-06 13:35:21 +01:00
'value' => $text[3],
2022-01-31 09:10:49 +01:00
'ico' => 'cancel'
]); ?>
</div>
<div class="col2">
<?php echo template::submit('pageEditSubmit', [
2022-03-06 13:35:21 +01:00
'uniqueSubmission' => true,
'value' => $text[4]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block" id="info">
2022-03-06 13:35:21 +01:00
<h4><?php echo $text[5]; ?>
2022-01-31 09:10:49 +01:00
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/informations-generales" target="_blank">
<?php echo template::ico('help', 'left');?>
</a>
</span>
</h4>
<div class="row">
<div class="col6">
<?php echo template::text('pageEditTitle', [
2022-03-06 13:35:21 +01:00
'label' => $text[6],
2022-01-31 09:10:49 +01:00
'value' => $this->getData(['page', $this->getUrl(2), 'title'])
]); ?>
</div>
<div class="col2">
<?php echo template::text('pageEditShortTitle', [
2022-03-06 13:35:21 +01:00
'label' => $text[7],
2022-01-31 09:10:49 +01:00
'value' => $this->getData(['page', $this->getUrl(2), 'shortTitle']),
2022-03-06 13:35:21 +01:00
'help' => $text[8]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
<div class="col4">
<div class="row">
<div class="col9">
<?php echo template::hidden('pageEditModuleRedirect'); ?>
<?php echo template::select('pageEditModuleId', $module::$moduleIds, [
2022-03-06 13:35:21 +01:00
'help' => $text[9],
'label' => $text[10],
2022-01-31 09:10:49 +01:00
'selected' => $this->getData(['page', $this->getUrl(2), 'moduleId'])
]); ?>
<?php echo template::hidden('pageEditModuleIdOld',['value' => $this->getData(['page', $this->getUrl(2), 'moduleId'])]); ?>
<?php echo template::hidden('pageEditModuleIdOldText',[
'value' => array_key_exists($this->getData(['page', $this->getUrl(2), 'moduleId']),$module::$moduleIds)? $module::$moduleIds[$this->getData(['page', $this->getUrl(2), 'moduleId'])] : ucfirst($this->getData(['page', $this->getUrl(2), 'moduleId']))
]); ?>
</div>
<div class="col3 verticalAlignBottom">
<?php echo template::button('pageEditModuleConfig', [
'disabled' => (bool) $this->getData(['page', $this->getUrl(2), 'moduleId']) === false,
'uniqueSubmission' => true,
'value' => template::ico('gear')
]); ?>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col4">
2022-03-06 13:35:21 +01:00
<?php echo template::select('pageTypeMenu', $typeMenu,[
'label' => $text[11],
2022-01-31 09:10:49 +01:00
'selected' => $this->getData(['page', $this->getUrl(2), 'typeMenu'])
]); ?>
</div>
<div class="col4">
<?php echo template::file('pageIconUrl', [
2022-03-06 13:35:21 +01:00
'help' => $text[12],
'label' => $text[13],
2022-01-31 09:10:49 +01:00
'value' => $this->getData(['page', $this->getUrl(2), 'iconUrl'])
]); ?>
</div>
<div class="col4">
2022-03-06 13:35:21 +01:00
<?php echo template::select('configModulePosition', $modulePosition,[
'help' => $text[14],
'label' => $text[15],
2022-01-31 09:10:49 +01:00
'selected' => $this->getData(['page', $this->getUrl(2), 'modulePosition'])
]); ?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<?php echo template::textarea('pageEditContent', [
'class' => 'editorWysiwyg',
//'value' => file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getUrl(2), 'content']))
'value' => $this->getPage($this->getUrl(2), self::$i18n)
]); ?>
</div>
</div>
<div class="row">
<div class="col12" id="pageEditBlockLayout">
<div class="block">
2022-03-06 13:35:21 +01:00
<h4><?php echo $text[16]; ?>
2022-01-31 09:10:49 +01:00
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/mise-en-page" target="_blank">
<?php echo template::ico('help', 'left');?>
</a>
</span>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col6">
<div class="row">
<div class="col12">
2022-03-06 13:35:21 +01:00
<?php echo template::select('pageEditBlock', $pageBlocks, [
'label' => $text[17],
'help' => $text[18],
2022-01-31 09:10:49 +01:00
'selected' => $this->getData(['page', $this->getUrl(2) , 'block'])
]); ?>
</div>
</div>
</div>
<div class="col6">
<!-- Sélection des barres latérales -->
<?php if($this->getHierarchy($this->getUrl(2),false,true)): ?>
<?php echo template::hidden('pageEditBarLeft', [
'value' => $this->getData(['page', $this->getUrl(2), 'barLeft'])
]); ?>
<?php else: ?>
2022-03-06 13:35:21 +01:00
<?php echo template::select('pageEditBarLeft', $pagesBarId, [
'label' => $text[19],
2022-01-31 09:10:49 +01:00
'selected' => $this->getData(['page', $this->getUrl(2), 'barLeft'])
]); ?>
<?php endif; ?>
<?php if($this->getHierarchy($this->getUrl(2),false,true)): ?>
<?php echo template::hidden('pageEditBarRight', [
'value' => $this->getData(['page', $this->getUrl(2), 'barRight'])
]); ?>
<?php else: ?>
2022-03-06 13:35:21 +01:00
<?php echo template::select('pageEditBarRight', $pagesBarId, [
'label' => $text[20],
2022-01-31 09:10:49 +01:00
'selected' => $this->getData(['page', $this->getUrl(2), 'barRight'])
]); ?>
<?php endif; ?>
2022-03-06 13:35:21 +01:00
<?php echo template::select('pageEditDisplayMenu', $displayMenu, [
'label' => $text[21],
2022-01-31 09:10:49 +01:00
'selected' => $this->getData(['page', $this->getUrl(2), 'displayMenu']),
2022-03-06 13:35:21 +01:00
'help' => $text[22]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12" id="pageEditMenu">
<div class="block">
2022-03-06 13:35:21 +01:00
<h4><?php echo $text[23]; ?>
2022-01-31 09:10:49 +01:00
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/emplacement-dans-le-menu" target="_blank">
<?php echo template::ico('help', 'left');?>
</a>
</span>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col6">
<?php echo template::select('pageEditPosition', [], [
2022-03-06 13:35:21 +01:00
'label' => $text[24],
'help' => $text[25]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
<div class="col6">
<?php if($this->getHierarchy($this->getUrl(2), false)): ?>
<?php echo template::hidden('pageEditParentPageId', [
'value' => $this->getData(['page', $this->getUrl(2), 'parentPageId'])
]); ?>
<?php else: ?>
2022-03-06 13:35:21 +01:00
<?php echo template::select('pageEditParentPageId', $pagesNoParentId, [
'label' => $text[26],
2022-01-31 09:10:49 +01:00
'selected' => $this->getData(['page', $this->getUrl(2), 'parentPageId'])
]); ?>
<?php endif; ?>
</div>
</div>
<div class="row">
<div class="col6">
2022-03-06 13:35:21 +01:00
<?php echo template::checkbox('pageEditDisable', true, $text[37], [
2022-01-31 09:10:49 +01:00
'checked' => $this->getData(['page', $this->getUrl(2), 'disable']),
2022-03-06 13:35:21 +01:00
'help' => $text[27]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
<div class="col6">
2022-03-06 13:35:21 +01:00
<?php echo template::checkbox('pageEditTargetBlank', true, $text[38], [
2022-01-31 09:10:49 +01:00
'checked' => $this->getData(['page', $this->getUrl(2), 'targetBlank'])
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
2022-03-06 13:35:21 +01:00
<?php echo template::checkbox('pageEditHideTitle', true, $text[39], [
2022-01-31 09:10:49 +01:00
'checked' => $this->getData(['page', $this->getUrl(2), 'hideTitle'])
]); ?>
</div>
<div class="col6">
2022-03-06 13:35:21 +01:00
<?php echo template::checkbox('pageEditbreadCrumb', true, $text[40], [
2022-01-31 09:10:49 +01:00
'checked' => $this->getData(['page', $this->getUrl(2), 'breadCrumb']),
2022-03-06 13:35:21 +01:00
'help' => $text[28]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class='row' id="pageEditAdvancedWrapper">
<div class="col12">
<div class="block">
2022-03-06 13:35:21 +01:00
<h4><?php echo $text[29]; ?>
2022-01-31 09:10:49 +01:00
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/options-d-emplacement-avancees" target="_blank">
<?php echo template::ico('help', 'left');?>
</a>
</span>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col6">
2022-03-06 13:35:21 +01:00
<?php echo template::checkbox('pageEditHideMenuChildren', true, $text[30], [
2022-01-31 09:10:49 +01:00
'checked' => $this->getData(['page', $this->getUrl(2), 'hideMenuChildren'])
]); ?>
</div>
<div class="col6">
2022-03-06 13:35:21 +01:00
<?php echo template::checkbox('pageEditHideMenuSide', true, $text[31] , [
2022-01-31 09:10:49 +01:00
'checked' => $this->getData(['page', $this->getUrl(2), 'hideMenuSide']),
2022-03-06 13:35:21 +01:00
'help' => $text[32]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class='row' id="pageEditSeoWrapper">
<div class="col12">
<div class="block">
2022-03-06 13:35:21 +01:00
<h4><?php echo $text[33]; ?>
2022-01-31 09:10:49 +01:00
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/permission-et-referencement" target="_blank">
<?php echo template::ico('help', 'left');?>
</a>
</span>
</h4>
<div class="blockContainer">
<div class="row">
<div class='col6'>
2022-03-06 13:35:21 +01:00
<?php echo template::select('pageEditGroup', $groupPublics, [
'label' => $text[34],
2022-01-31 09:10:49 +01:00
'selected' => $this->getData(['page', $this->getUrl(2), 'group'])
]); ?>
</div>
<div class='col12'>
<?php echo template::text('pageEditMetaTitle', [
2022-03-06 13:35:21 +01:00
'label' => $text[35],
2022-01-31 09:10:49 +01:00
'value' => $this->getData(['page', $this->getUrl(2), 'metaTitle'])
]); ?>
<?php echo template::textarea('pageEditMetaDescription', [
2022-03-06 13:35:21 +01:00
'label' => $text[36],
2022-01-31 09:10:49 +01:00
//'maxlength' => '500',
'value' => $this->getData(['page', $this->getUrl(2), 'metaDescription'])
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php echo template::formClose(); ?>