Browse Source

Une option similaire mais pour l'affichage des dossiers.
+ correction typo.

cobalt74 6 years ago
parent
commit
eeaba6e529
5 changed files with 20 additions and 8 deletions
  1. 1 0
      action.php
  2. 5 2
      index.php
  3. 3 1
      install.php
  4. 1 0
      settings.php
  5. 10 5
      templates/marigolds/settings.html

+ 1 - 0
action.php

@@ -199,6 +199,7 @@ switch ($action){
 			$configurationManager->put('articleDisplayDate',$_['articleDisplayDate']);
 			$configurationManager->put('articleDisplayAuthor',$_['articleDisplayAuthor']);			
 			$configurationManager->put('articleDisplaySort',$_['articleDisplaySort']);
+			$configurationManager->put('articleDisplayFolderSort',$_['articleDisplayFolderSort']);
 			$configurationManager->put('synchronisationType',$_['synchronisationType']);
 			$configurationManager->put('feedMaxEvents',$_['feedMaxEvents']);
 

+ 5 - 2
index.php

@@ -34,7 +34,8 @@ $articleDisplayLink = $configurationManager->get('articleDisplayLink');
 $articleDisplayDate = $configurationManager->get('articleDisplayDate');
 $articleDisplayAuthor = $configurationManager->get('articleDisplayAuthor');
 $articleDisplaySort = $configurationManager->get('articleDisplaySort');
- 
+$articleDisplayFolderSort = $configurationManager->get('articleDisplayFolderSort');
+
 $tpl->assign('articleDisplayContent',$configurationManager->get('articleDisplayContent'));
 $tpl->assign('articleView',$configurationManager->get('articleView'));
 $tpl->assign('articlePerPages',$configurationManager->get('articlePerPages'));
@@ -42,6 +43,7 @@ $tpl->assign('articleDisplayLink',$configurationManager->get('articleDisplayLink
 $tpl->assign('articleDisplayDate',$configurationManager->get('articleDisplayDate'));
 $tpl->assign('articleDisplayAuthor',$configurationManager->get('articleDisplayAuthor'));
 $tpl->assign('articleDisplaySort',$configurationManager->get('articleDisplaySort'));
+$tpl->assign('articleDisplayFolderSort',$configurationManager->get('articleDisplayFolderSort'));
 
 $target = MYSQL_PREFIX.'event.title,'.MYSQL_PREFIX.'event.unread,'.MYSQL_PREFIX.'event.favorite,'.MYSQL_PREFIX.'event.feed,';
 if($articleDisplayContent && $articleView=='partial') $target .= MYSQL_PREFIX.'event.description,';
@@ -81,7 +83,8 @@ $pagesArray = array();
 						$page = (isset($_['page'])?$_['page']:1);
 						$pages = ceil($numberOfItem/$articlePerPages); 
 						$startArticle = ($page-1)*$articlePerPages;
-						$events = $currentFolder->getEvents($startArticle,$articlePerPages,MYSQL_PREFIX.'event.pubdate DESC',$target);
+						if($articleDisplayFolderSort) {$order = MYSQL_PREFIX.'event.pubdate desc';} else {$order = MYSQL_PREFIX.'event.pubdate asc';}
+						$events = $currentFolder->getEvents($startArticle,$articlePerPages,$order,$target);
 
 
 					break;

+ 3 - 1
install.php

@@ -151,6 +151,7 @@ if(isset($_['installButton'])){
 	$configurationManager->add('articleDisplayDate',$_['articleDisplayDate']);
 	$configurationManager->add('articleDisplayAuthor',$_['articleDisplayAuthor']);
 	$configurationManager->add('articleDisplaySort',$_['articleDisplaySort']);
+	$configurationManager->add('articleDisplayFolderSort',$_['articleDisplayFolderSort']);
 	$configurationManager->add('synchronisationType',$_['synchronisationType']);
 	$configurationManager->add('feedMaxEvents',$_['feedMaxEvents']);
 	
@@ -292,7 +293,8 @@ if(isset($_['installButton'])){
 					<p>Autoriser la lecture anonyme: <input type="radio" checked="checked" value="1" name="articleDisplayAnonymous">Oui <input type="radio" value="0" name="articleDisplayAnonymous">Non</p>
 					<h3 class="articleDetails">Nb: si vous choisissez cette option, les utilisateurs non authentifiés pourront consulter vos flux (sans pouvoir les marquer comme lu/non lu).</h3>
 					<p>Nombre d'articles par pages: <input type="text" value="5" name="articlePerPages"></p>
-					<p>Affichage des articles les plus récents en premier : <input type="radio" checked="checked" value="1" name="articleDisplaySort">Oui <input type="radio" value="0" name="articleDisplaySort">Non</p>
+					<p>Articles les plus récents en premier (sur page d'accueil) : <input type="radio" checked="checked" value="1" name="articleDisplaySort">Oui <input type="radio" value="0" name="articleDisplaySort">Non</p>
+					<p>Articles les plus récents en premier (sur les dossiers) : <input type="radio" checked="checked" value="1" name="articleDisplayFolderSort">Oui <input type="radio" value="0" name="articleDisplayFolderSort">Non</p>
 					<p>Affichage du lien direct de l'article: <input type="radio" checked="checked" value="1" name="articleDisplayLink">Oui <input type="radio" value="0" name="articleDisplayLink">Non</p>
 					<p>Affichage de la date de l'article: <input type="radio" checked="checked" value="1" name="articleDisplayDate">Oui <input type="radio" value="0" name="articleDisplayDate">Non</p>
 					<p>Affichage de l'auteur de l'article: <input type="radio" checked="checked" value="1" name="articleDisplayAuthor">Oui <input type="radio" value="0" name="articleDisplayAuthor">Non</p>

+ 1 - 0
settings.php

@@ -18,6 +18,7 @@ $tpl->assign('articleDisplayLink', $configurationManager->get('articleDisplayLin
 $tpl->assign('articleDisplayDate', $configurationManager->get('articleDisplayDate')); 
 $tpl->assign('articleDisplayAuthor', $configurationManager->get('articleDisplayAuthor'));
 $tpl->assign('articleDisplaySort', $configurationManager->get('articleDisplaySort'));
+$tpl->assign('articleDisplayFolderSort', $configurationManager->get('articleDisplayFolderSort'));
 $tpl->assign('articleDisplayContent', $configurationManager->get('articleDisplayContent')); 
 $tpl->assign('articleView', $configurationManager->get('articleView'));
 //Récuperation des plugins  

+ 10 - 5
templates/marigolds/settings.html

@@ -143,6 +143,16 @@
 							<input type="text" value="{$configurationManager->get('articlePerPages')}" id="articlePerPages" name="articlePerPages" size="4" />
 						</fieldset>
 						<fieldset>
+							<legend>Articles les plus récents en premier (sur page d'accueil)</legend>
+							<input type="radio" {if="$articleDisplaySort"} checked="checked" {/if} value="1" id="articleDisplaySortYes" name="articleDisplaySort" /><label for="articleDisplaySortYes">Oui</label>
+							<input type="radio" {if="!$articleDisplaySort"} checked="checked" {/if} value="0" id="articleDisplaySortNo" name="articleDisplaySort" /><label for="articleDisplaySortNo">Non</label>
+						</fieldset>
+						<fieldset>
+							<legend>Articles les plus récents en premier (sur les dossiers)</legend>
+							<input type="radio" {if="$articleDisplayFolderSort"} checked="checked" {/if} value="1" id="articleDisplayFolderSortYes" name="articleDisplayFolderSort" /><label for="articleDisplayFolderSortYes">Oui</label>
+							<input type="radio" {if="!$articleDisplayFolderSort"} checked="checked" {/if} value="0" id="articleDisplayFolderSorttNo" name="articleDisplayFolderSort" /><label for="articleDisplayFolderSortNo">Non</label>
+						</fieldset>
+						<fieldset>
 							<legend>Affichage du lien direct de l'article</legend>
 							<input type="radio"  {if="$articleDisplayLink=='1'"} checked="checked" {/if}value="1" id="articleDisplayLinkYes" name="articleDisplayLink" /><label for="articleDisplayLinkYes">Oui</label>
 							<input type="radio" {if="$articleDisplayLink=='0'"} checked="checked" {/if} value="0" id="articleDisplayLinkNo" name="articleDisplayLink" /><label for="articleDisplayLinkNo">Non</label>
@@ -158,11 +168,6 @@
 							<input type="radio" {if="$articleDisplayAuthor=='0'"} checked="checked" {/if} value="0" id="articleDisplayAuthorNo" name="articleDisplayAuthor" /><label for="articleDisplayAuthorNo">Non</label>
 						</fieldset>
 						<fieldset>
-							<legend>Afficher les articles les plus récent en premier</legend>
-							<input type="radio" {if="$articleDisplaySort"} checked="checked" {/if} value="1" id="articleDisplaySortYes" name="articleDisplaySort" /><label for="articleDisplaySortYes">Oui</label>
-							<input type="radio" {if="!$articleDisplaySort"} checked="checked" {/if} value="0" id="articleDisplaySortNo" name="articleDisplaySort" /><label for="articleDisplaySortNo">Non</label>
-						</fieldset>
-						<fieldset>
 							<legend>Affichage du contenu de l'article</legend>
 							<input type="radio" onchange="$('.articleView').slideToggle(200);" {if="$articleDisplayContent=='1'"} checked="checked" {/if} value="1" id="articleDisplayContentYes" name="articleDisplayContent" /><label for="articleDisplayContentYes">Oui</label>
 							<input type="radio" onchange="$('.articleView').slideToggle(200);" {if="$articleDisplayContent=='0'"} checked="checked" {/if} value="0" id="articleDisplayContentNo" name="articleDisplayContent" /><label for="articleDisplayContentNo">Non</label>