News 5.3 voir CMS

This commit is contained in:
Fred Tempez 2023-12-19 19:10:49 +01:00
parent d64ffa02c7
commit caf00c0d41
11 changed files with 54 additions and 33 deletions

View File

@ -1,3 +1,5 @@
# Version 5.3
- Option d'un lien de retour dans la signature
# Version 5.2
- Termes des commandes de profils
# Version 5.1
@ -23,6 +25,4 @@
- Config : le nombre d'objet est fixe, constante dans news.php
- Ecran layout réservé à la configuration et au thème
- Bug avec l'initialisation, fichier css déclaré mais absent
- Appel de la feuille style si présente
A faire partie CSS à amléiorer au niveau des options
- Appel de la feuille style si présente

View File

@ -16,7 +16,7 @@
class news extends common
{
const VERSION = '5.2';
const VERSION = '5.3';
const REALNAME = 'News';
const DATADIRECTORY = self::DATA_DIR . 'news/';
@ -308,7 +308,8 @@ class news extends common
'height' => $this->getInput('newsOptionHeight', helper::FILTER_INT, true),
'dateFormat' => $this->getInput('newsOptionDateFormat'),
'timeFormat' => $this->getInput('newsOptionTimeFormat'),
'versionData' => $this->getData(['module', $this->getUrl(0), 'config', 'versionData'])
'buttonBack' => $this->getInput('newsOptionButtonBack'),
'versionData' => $this->getData(['module', $this->getUrl(0), 'config', 'versionData']),
]
]);
@ -593,13 +594,19 @@ class news extends common
// Mettre à jour la version
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', '3.4']);
}
// Mise à jour 3.4
// Mise à jour 4.4
if (version_compare($versionData, '4.4', '<')) {
$this->setData(['module', $this->getUrl(0), 'config', 'dateFormat', '%d %B %Y']);
$this->setData(['module', $this->getUrl(0), 'config', 'timeFormat', '%H:%M']);
// Mettre à jour la version
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', '4.4']);
}
// Mise à jour 5.3
if (version_compare($versionData, '5.3', '<')) {
$this->setData(['module', $this->getUrl(0), 'config', 'buttonBack', true]);
// Mettre à jour la version
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', '5.3']);
}
}

View File

@ -1,14 +1,15 @@
<?php
class init extends news {
public static $defaultData = [
'feeds' => false,
'feedsLabel' => '',
'feeds' => true,
'feedsLabel' => 'RSS',
'itemsperPage' => 8,
'itemsperCol' => 12,
'height' => -1,
'versionData' => '3.5',
'versionData' => '5.3',
'dateFormat' => '%d %B %Y',
'timeFormat' =>'%H:%M',
'buttonBack' => true
];
public static $defaultTheme = [
@ -16,7 +17,8 @@ class init extends news {
'borderStyle' => 'none',
'borderColor' => 'rgba(33, 34, 35, 1)',
'backgroundColor' => 'rgba(255, 255, 255, 1)',
'borderWidth' => '0'
'borderWidth' => '0',
'itemsBlur' => '0%'
];
}

0
module/news/ressource/feed-icon-16.gif Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 652 B

After

Width:  |  Height:  |  Size: 652 B

0
module/news/vendor/FeedWriter/README.md vendored Normal file → Executable file
View File

0
module/news/view/add/add.css Normal file → Executable file
View File

View File

@ -1,34 +1,42 @@
<div class="row">
<div class="col12">
<?php echo $this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(1), 'content']); ?>
</div>
<div class="col12">
<?php echo $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'content']); ?>
</div>
</div>
<div class="row verticalAlignMiddle">
<div class="col12 newsDate">
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'buttonBack'])): ?>
<div class="col6 textAlignLeft">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0); ?>">
<?php echo template::ico('left') . helper::translate('Retour'); ?>
</a>
</div>
<?php endif; ?>
<div class="col6 newsDate textAlignRight">
<!-- bloc signature et date -->
<?php echo template::ico('user'); ?>
<?php echo $module::$articleSignature . ' - ';?>
<?php echo $module::$articleSignature . ' - '; ?>
<?php echo template::ico('calendar-empty'); ?>
<?php echo helper::dateUTF8('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$siteContent) . ' - ' . helper::dateUTF8('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$siteContent); ?>
<!-- Bloc edition -->
<?php if (
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
AND
( // Propriétaire
( $this->getUser('group') === self::GROUP_ADMIN )
)
): ?>
<a href ="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $this->getUrl(1);?>">
<?php echo template::ico('pencil');?> Éditer
</a>
<?php endif; ?>
<?php if (
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
and
( // Propriétaire
($this->getUser('group') === self::GROUP_ADMIN)
)
): ?>
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $this->getUrl(1); ?>">
<?php echo template::ico('pencil'); ?> Éditer
</a>
<?php endif; ?>
<!-- Bloc RSS-->
<?php if ($this->getData(['module',$this->getUrl(0), 'config', 'feeds'])): ?>
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'feeds'])): ?>
<div id="rssFeed">
<a type="application/rss+xml" href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/rss'; ?>" target="_blank">
<img src='module/news/ressource/feed-icon-16.gif' />
<?php
echo '<p>' . $this->getData(['module',$this->getUrl(0), 'config', 'feedsLabel']) . '</p>' ;
<a type="application/rss+xml" href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/rss'; ?>"
target="_blank">
<img src='module/news/ressource/feed-icon-16.gif' />
<?php
echo '<p>' . $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel']) . '</p>';
?>
</a>
</div>

0
module/news/view/config/config.css Normal file → Executable file
View File

0
module/news/view/index/index.css Normal file → Executable file
View File

View File

@ -46,7 +46,6 @@
&& strlen($this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'content'])) >= $this->getData(['module', $this->getUrl(0), 'config', 'height'])
): ?>
<?php echo ' ... <a href="' . helper::baseUrl(true) . $this->getUrl(0) . '/' . $newsId . '"><span class="newsSuite">lire la suite</span></a>'; ?>
<?php endif; ?>
</div>
</div>

View File

@ -48,12 +48,17 @@
</div>
</div>
<div class="row">
<div class="col6">
<div class="col3">
<?php echo template::checkbox('newsOptionShowFeeds', true, 'Lien du flux RSS', [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'feeds']),
'help' => 'Flux limité aux articles de la première page.'
]); ?>
</div>
<div class="col3">
<?php echo template::checkbox('newsOptionButtonBack', true, 'Bouton de retour', [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'buttonBack'])
]); ?>
</div>
<div class="col6">
<?php echo template::text('newsOptionFeedslabel', [
'label' => 'Etiquette RSS',