Skip to content

Commit

Permalink
Facto actions toujours effectuées avec $isAlwaysDisplayed
Browse files Browse the repository at this point in the history
  • Loading branch information
Simounet committed Sep 28, 2017
1 parent 6747a94 commit 040828b
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 18 deletions.
6 changes: 6 additions & 0 deletions common.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ class_exists('Logger') or require_once('Logger.class.php');
$tpl->assign('configurationManager',$configurationManager);
$tpl->assign('synchronisationCode',$configurationManager->get('synchronisationCode'));

$articleDisplayAnonymous = $configurationManager->get('articleDisplayAnonymous');
$tpl->assign('articleDisplayAnonymous',$articleDisplayAnonymous);

$isAlwaysDisplayed = ($articleDisplayAnonymous=='1') || ($myUser!=false);
$tpl->assign('isAlwaysDisplayed',$isAlwaysDisplayed);

//Récuperation et sécurisation de toutes les variables POST et GET
$_ = array();
foreach($_POST as $key=>$val){
Expand Down
38 changes: 23 additions & 15 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,22 @@
//Récuperation de l'action (affichage) demandée
$action = (isset($_['action'])?$_['action']:'');
$tpl->assign('action',$action);
//Récuperation des dossiers de flux par ordre de nom
$tpl->assign('folders',$folderManager->populate('name'));
//Recuperation de tous les non Lu
$tpl->assign('unread',$feedManager->countUnreadEvents());
//recuperation de tous les flux
$allFeeds = $feedManager->getFeedsPerFolder();
$tpl->assign('allFeeds',$allFeeds);
//recuperation de tous les flux par dossier
$tpl->assign('allFeedsPerFolder',$allFeeds['folderMap']);
//recuperation de tous les event nons lu par dossiers
$tpl->assign('allEvents',$eventManager->getEventCountPerFolder());
//utilisé pour récupérer le statut d'un feed dans le template (en erreur ou ok)
$feedState = new Feed();
$tpl->assign('feedState',$feedState);
if($isAlwaysDisplayed) {
//Récuperation des dossiers de flux par ordre de nom
$tpl->assign('folders',$folderManager->populate('name'));
//Recuperation de tous les non Lu
$tpl->assign('unread',$feedManager->countUnreadEvents());
//recuperation de tous les flux
$allFeeds = $feedManager->getFeedsPerFolder();
$tpl->assign('allFeeds',$allFeeds);
//recuperation de tous les flux par dossier
$tpl->assign('allFeedsPerFolder',$allFeeds['folderMap']);
//recuperation de tous les event nons lu par dossiers
$tpl->assign('allEvents',$eventManager->getEventCountPerFolder());
//utilisé pour récupérer le statut d'un feed dans le template (en erreur ou ok)
$feedState = new Feed();
$tpl->assign('feedState',$feedState);
}
//afficher ou non le champ OTP
$tpl->assign('otpEnabled', $configurationManager->get('otpEnabled'));

Expand All @@ -43,6 +45,9 @@
($displayOnlyUnreadFeedFolder=='true')?$displayOnlyUnreadFeedFolder_reverse='false':$displayOnlyUnreadFeedFolder_reverse='true';
$optionFeedIsVerbose = $configurationManager->get('optionFeedIsVerbose');

$page = 0;
$pages = 0;

$tpl->assign('articleDisplayAuthor',$articleDisplayAuthor);
$tpl->assign('articleDisplayDate',$articleDisplayDate);
$tpl->assign('articleDisplayFolderSort',$articleDisplayFolderSort);
Expand Down Expand Up @@ -112,6 +117,10 @@
$wrongLogin = true;
default:
$wrongLogin = !empty($wrongLogin);
$tpl->assign('wrongLogin',$wrongLogin);
if(!$isAlwaysDisplayed) {
break;
}
$filter = array('unread'=>1);
if($optionFeedIsVerbose) {
$numberOfItem = $eventManager->rowCount($filter);
Expand All @@ -128,7 +137,6 @@
$events = $eventManager->getEventsNotVerboseFeed($startArticle,$articlePerPages,$order,$target);
}
$tpl->assign('numberOfItem',$numberOfItem);
$tpl->assign('wrongLogin',$wrongLogin);

break;
}
Expand Down
1 change: 0 additions & 1 deletion settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
$tpl->assign('synchronisationType',$configurationManager->get('synchronisationType'));
$tpl->assign('synchronisationEnableCache',$configurationManager->get('synchronisationEnableCache'));
$tpl->assign('synchronisationForceFeed',$configurationManager->get('synchronisationForceFeed'));
$tpl->assign('articleDisplayAnonymous', $configurationManager->get('articleDisplayAnonymous'));
$tpl->assign('articleDisplayLink', $configurationManager->get('articleDisplayLink'));
$tpl->assign('articleDisplayDate', $configurationManager->get('articleDisplayDate'));
$tpl->assign('articleDisplayAuthor', $configurationManager->get('articleDisplayAuthor'));
Expand Down
2 changes: 1 addition & 1 deletion templates/marigolds/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->


{if="($configurationManager->get('articleDisplayAnonymous')=='1') || ($myUser!=false)"}
{if="$isAlwaysDisplayed"}


<div id="helpPanel" onclick="$(this).fadeOut(200);">
Expand Down
2 changes: 1 addition & 1 deletion templates/marigolds/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@description: Page de gestion de toutes les préférences/configurations administrateur
-->

{if="($configurationManager->get('articleDisplayAnonymous')=='1') || ($myUser!=false)"}
{if="$isAlwaysDisplayed"}


<div id="main" class="wrapper clearfix settings">
Expand Down

0 comments on commit 040828b

Please sign in to comment.