news perso css et balise sémantique article

This commit is contained in:
fredtempez 2022-03-17 12:55:04 +01:00
parent 2ef99978c4
commit d24acb3bc2
2 changed files with 39 additions and 40 deletions

View File

@ -80,11 +80,7 @@ class news extends common {
public static $borderStyle =[ public static $borderStyle =[
'none' => 'Aucune', 'none' => 'Aucune',
'solid' => 'Tiret', 'solid' => 'Tiret'
'inset' => '3D enfoncé',
'outset'=> '3D surélevé',
'ridge' => 'Relief 1',
'groove'=> 'Relief 2'
]; ];
// Signature de l'article // Signature de l'article
@ -252,7 +248,8 @@ class news extends common {
// Générer la feuille de CSS // Générer la feuille de CSS
$style = '.newsFrame {'; $style = '.newsFrame {';
$style .= 'border:' . $this->getInput('newsThemeBorderStyle',helper::FILTER_STRING_SHORT) . ' ' . $this->getInput('newsThemeBorderColor') . ' ' . $this->getInput('newsThemeBorderWidth',helper::FILTER_STRING_SHORT) . ';'; $style .= 'border-right:' . $this->getInput('newsThemeBorderStyle',helper::FILTER_STRING_SHORT) . ' ' . $this->getInput('newsThemeBorderColor') . ' ' . $this->getInput('newsThemeBorderWidth',helper::FILTER_STRING_SHORT) . ';';
$style .= 'border-left:' . $this->getInput('newsThemeBorderStyle',helper::FILTER_STRING_SHORT) . ' ' . $this->getInput('newsThemeBorderColor') . ' ' . $this->getInput('newsThemeBorderWidth',helper::FILTER_STRING_SHORT) . ';';
$style .= 'background-color:' . $this->getInput('newsThemeBackgroundColor') . ';'; $style .= 'background-color:' . $this->getInput('newsThemeBackgroundColor') . ';';
$style .= '}'; $style .= '}';

View File

@ -1,40 +1,42 @@
<?php if($module::$news): ?> <?php if($module::$news): ?>
<div class="row"> <article>
<?php foreach($module::$news as $newsId => $news): ?> <div class="row">
<div class="newsFrame col<?php echo $module::$nbrCol ;?>" > <?php foreach($module::$news as $newsId => $news): ?>
<h2 class="newsTitle" id="<?php echo $newsId;?>"> <div class="newsFrame col<?php echo $module::$nbrCol ;?>" >
<?php echo '<a href="'. helper::baseUrl(true) . $this->getUrl(0) . '/' . $newsId . '">' . $news['title'] . '</a>'; ?> <h2 class="newsTitle" id="<?php echo $newsId;?>">
</h2> <?php echo '<a href="'. helper::baseUrl(true) . $this->getUrl(0) . '/' . $newsId . '">' . $news['title'] . '</a>'; ?>
<div class="newsContent"> </h2>
<?php echo $news['content']; ?> <div class="newsContent">
<?php if ( $this->getData(['module', $this->getUrl(0), 'config', 'height']) !== -1 <?php echo $news['content']; ?>
&& strlen($this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'content'])) >= $this->getData(['module', $this->getUrl(0), 'config', 'height'])):?> <?php if ( $this->getData(['module', $this->getUrl(0), 'config', 'height']) !== -1
<?php echo ' ... <a href="'. helper::baseUrl(true) . $this->getUrl(0) . '/' . $newsId . '"><span class="newsSuite">lire la suite</span></a>'; ?> && strlen($this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'content'])) >= $this->getData(['module', $this->getUrl(0), 'config', 'height'])):?>
<?php endif; ?> <?php echo ' ... <a href="'. helper::baseUrl(true) . $this->getUrl(0) . '/' . $newsId . '"><span class="newsSuite">lire la suite</span></a>'; ?>
</div> <?php endif; ?>
<div class="newsSignature"> </div>
<?php echo template::ico('calendar-empty'); ?> <div class="newsSignature">
<?php echo mb_detect_encoding(strftime('%d %B %Y', $news['publishedOn']), 'UTF-8', true) <?php echo template::ico('calendar-empty'); ?>
? strftime('%d %B %Y', $news['publishedOn']) <?php echo mb_detect_encoding(strftime('%d %B %Y', $news['publishedOn']), 'UTF-8', true)
: utf8_encode(strftime('%d %B %Y', $news['publishedOn'])); ?> ? strftime('%d %B %Y', $news['publishedOn'])
- <?php echo $news['userId']; ?> : utf8_encode(strftime('%d %B %Y', $news['publishedOn'])); ?>
<!-- Bloc edition --> - <?php echo $news['userId']; ?>
<?php if ( <!-- Bloc edition -->
<?php if (
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
AND AND
( // Propriétaire ( // Propriétaire
( $this->getUser('group') === self::GROUP_ADMIN ) ( $this->getUser('group') === self::GROUP_ADMIN )
) )
): ?> ): ?>
<a href ="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $newsId . '/' . $_SESSION['csrf'];?>"> <a href ="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $newsId . '/' . $_SESSION['csrf'];?>">
<?php echo template::ico('pencil');?> Editer <?php echo template::ico('pencil');?> Editer
</a> </a>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div>
<?php endforeach; ?>
</div> </div>
<?php endforeach; ?> </article>
</div>
<?php echo $module::$pages; ?> <?php echo $module::$pages; ?>
<?php if ($this->getData(['module',$this->getUrl(0), 'config', 'feeds'])): ?> <?php if ($this->getData(['module',$this->getUrl(0), 'config', 'feeds'])): ?>
<div id="rssFeed"> <div id="rssFeed">