Browse Source

#87 - Nettoyage des anciennes variables + mise en route de la fonctionnalité.
Affichage des articles en fonction du paramétrage dans settings.
RAF : bouton pour switcher entre les états d'affichage + appel ajax

cobalt74 5 years ago
parent
commit
464f5b6905

+ 0 - 5
action.php

@@ -173,12 +173,7 @@ switch ($action){
 
             //Ajout des préférences et réglages
             $configurationManager->put('root',(substr($_['root'], strlen($_['root'])-1)=='/'?$_['root']:$_['root'].'/'));
-            //$configurationManager->put('view',$_['view']);
-            if(isset($_['articleView']))
-                $configurationManager->put('articleView',$_['articleView']);
-            $configurationManager->put('articleDisplayContent',$_['articleDisplayContent']);
             $configurationManager->put('articleDisplayAnonymous',$_['articleDisplayAnonymous']);
-
             $configurationManager->put('articlePerPages',$_['articlePerPages']);
             $configurationManager->put('articleDisplayLink',$_['articleDisplayLink']);
             $configurationManager->put('articleDisplayDate',$_['articleDisplayDate']);

+ 6 - 8
article.php

@@ -16,21 +16,19 @@ $allFeeds = $feedManager->getFeedsPerFolder();
 $tpl->assign('allFeeds',$allFeeds);
 $tpl->assign('scrollpage',$_['scroll']);
 // récupération des variables pour l'affichage
-$articleDisplayContent = $configurationManager->get('articleDisplayContent');
-$articleView = $configurationManager->get('articleView');
 $articlePerPages = $configurationManager->get('articlePerPages');
 $articleDisplayLink = $configurationManager->get('articleDisplayLink');
 $articleDisplayDate = $configurationManager->get('articleDisplayDate');
 $articleDisplayAuthor = $configurationManager->get('articleDisplayAuthor');
 $articleDisplayHomeSort = $configurationManager->get('articleDisplayHomeSort');
 $articleDisplayFolderSort = $configurationManager->get('articleDisplayFolderSort');
+$articleDisplayMode = $configurationManager->get('articleDisplayMode');
 $optionFeedIsVerbose = $configurationManager->get('optionFeedIsVerbose');
 
-$tpl->assign('articleView',$articleView);
-$tpl->assign('articleDisplayLink',$articleDisplayLink);
-$tpl->assign('articleDisplayDate',$articleDisplayDate);
 $tpl->assign('articleDisplayAuthor',$articleDisplayAuthor);
-$tpl->assign('articleDisplayContent',$articleDisplayContent);
+$tpl->assign('articleDisplayDate',$articleDisplayDate);
+$tpl->assign('articleDisplayLink',$articleDisplayLink);
+$tpl->assign('articleDisplayMode',$articleDisplayMode);
 
 
 $hightlighted = $_['hightlighted'];
@@ -39,8 +37,8 @@ $tpl->assign('hightlighted',$hightlighted);
 $tpl->assign('time',$_SERVER['REQUEST_TIME']);
 
 $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,';
-if($articleDisplayContent && $articleView!='partial') $target .= MYSQL_PREFIX.'event.content,';
+if($articleDisplayMode=='summary') $target .= MYSQL_PREFIX.'event.description,';
+if($articleDisplayMode=='content') $target .= MYSQL_PREFIX.'event.content,';
 if($articleDisplayLink) $target .= MYSQL_PREFIX.'event.link,';
 if($articleDisplayDate) $target .= MYSQL_PREFIX.'event.pubdate,';
 if($articleDisplayAuthor) $target .= MYSQL_PREFIX.'event.creator,';

+ 14 - 16
index.php

@@ -29,33 +29,31 @@ $tpl->assign('allEvents',$eventManager->getEventCountPerFolder());
 $feedState = new Feed();
 $tpl->assign('feedState',$feedState);
 
-$articleDisplayContent = $configurationManager->get('articleDisplayContent');
-$articleView = $configurationManager->get('articleView');
-$articlePerPages = $configurationManager->get('articlePerPages');
-$articleDisplayLink = $configurationManager->get('articleDisplayLink');
-$articleDisplayDate = $configurationManager->get('articleDisplayDate');
 $articleDisplayAuthor = $configurationManager->get('articleDisplayAuthor');
-$articleDisplayHomeSort = $configurationManager->get('articleDisplayHomeSort');
+$articleDisplayDate = $configurationManager->get('articleDisplayDate');
 $articleDisplayFolderSort = $configurationManager->get('articleDisplayFolderSort');
+$articleDisplayHomeSort = $configurationManager->get('articleDisplayHomeSort');
+$articleDisplayLink = $configurationManager->get('articleDisplayLink');
+$articleDisplayMode = $configurationManager->get('articleDisplayMode');
+$articlePerPages = $configurationManager->get('articlePerPages');
 $displayOnlyUnreadFeedFolder = $configurationManager->get('displayOnlyUnreadFeedFolder');
 if (!isset($displayOnlyUnreadFeedFolder)) $displayOnlyUnreadFeedFolder=false;
 ($displayOnlyUnreadFeedFolder=='true')?$displayOnlyUnreadFeedFolder_reverse='false':$displayOnlyUnreadFeedFolder_reverse='true';
 $optionFeedIsVerbose = $configurationManager->get('optionFeedIsVerbose');
 
-$tpl->assign('articleDisplayContent',$configurationManager->get('articleDisplayContent'));
-$tpl->assign('articleView',$configurationManager->get('articleView'));
-$tpl->assign('articlePerPages',$configurationManager->get('articlePerPages'));
-$tpl->assign('articleDisplayLink',$configurationManager->get('articleDisplayLink'));
-$tpl->assign('articleDisplayDate',$configurationManager->get('articleDisplayDate'));
-$tpl->assign('articleDisplayAuthor',$configurationManager->get('articleDisplayAuthor'));
-$tpl->assign('articleDisplayHomeSort',$configurationManager->get('articleDisplayHomeSort'));
-$tpl->assign('articleDisplayFolderSort',$configurationManager->get('articleDisplayFolderSort'));
+$tpl->assign('articleDisplayAuthor',$articleDisplayAuthor);
+$tpl->assign('articleDisplayDate',$articleDisplayDate);
+$tpl->assign('articleDisplayFolderSort',$articleDisplayFolderSort);
+$tpl->assign('articleDisplayHomeSort',$articleDisplayHomeSort);
+$tpl->assign('articleDisplayLink',$articleDisplayLink);
+$tpl->assign('articleDisplayMode',$articleDisplayMode);
+$tpl->assign('articlePerPages',$articlePerPages);
 $tpl->assign('displayOnlyUnreadFeedFolder',$displayOnlyUnreadFeedFolder);
 $tpl->assign('displayOnlyUnreadFeedFolder_reverse',$displayOnlyUnreadFeedFolder_reverse);
 
 $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,';
-if($articleDisplayContent && $articleView!='partial') $target .= MYSQL_PREFIX.'event.content,';
+if($articleDisplayMode=='summary') $target .= MYSQL_PREFIX.'event.description,';
+if($articleDisplayMode=='content') $target .= MYSQL_PREFIX.'event.content,';
 if($articleDisplayLink) $target .= MYSQL_PREFIX.'event.link,';
 if($articleDisplayDate) $target .= MYSQL_PREFIX.'event.pubdate,';
 if($articleDisplayAuthor) $target .= MYSQL_PREFIX.'event.creator,';

+ 0 - 2
install.php

@@ -189,8 +189,6 @@ if (isset($_['installButton']) && empty($test[$lib_errors])) { // Pas d'erreur,
     }
     $configurationManager->create();
     $configurationManager->add('root',$root);
-    $configurationManager->add('articleView','partial');
-    $configurationManager->add('articleDisplayContent','1');
     $configurationManager->add('articleDisplayAnonymous','0');
     $configurationManager->add('articlePerPages','5');
     $configurationManager->add('articleDisplayLink','1');

+ 0 - 2
settings.php

@@ -21,8 +21,6 @@ $tpl->assign('articleDisplayDate', $configurationManager->get('articleDisplayDat
 $tpl->assign('articleDisplayAuthor', $configurationManager->get('articleDisplayAuthor'));
 $tpl->assign('articleDisplayHomeSort', $configurationManager->get('articleDisplayHomeSort'));
 $tpl->assign('articleDisplayFolderSort', $configurationManager->get('articleDisplayFolderSort'));
-$tpl->assign('articleDisplayContent', $configurationManager->get('articleDisplayContent'));
-$tpl->assign('articleView', $configurationManager->get('articleView'));
 $tpl->assign('articleDisplayMode', $configurationManager->get('articleDisplayMode'));
 $tpl->assign('optionFeedIsVerbose', $configurationManager->get('optionFeedIsVerbose'));
 

+ 3 - 3
templates/marigolds/article.html

@@ -37,9 +37,9 @@
         </h3>
 
         <!-- CONTENU/DESCRIPTION -->
-        {if="$articleDisplayContent"}
+        {if="$articleDisplayMode!='title'"}
             <div class="articleContent">
-                {if="$articleView=='partial'"}
+                {if="$articleDisplayMode=='summary'"}
                     {function="Plugin::callHook("event_pre_description", array(&$value))"}
                     {$value->getDescription()}
                     {function="Plugin::callHook("event_post_description", array(&$value))"}
@@ -50,7 +50,7 @@
                 {/if}
             </div>
 
-            {if="$articleView!='partial'"}
+            {if="$articleDisplayMode=='content'"}
             <!-- RAPPEL DETAILS + OPTIONS POUR LES ARTICLES AFFICHES EN ENTIER -->
             <h3 class="articleDetails">
                 {function="Plugin::callHook("event_pre_bottom_options", array(&$value))"}

+ 0 - 13
templates/marigolds/js/script.js

@@ -19,13 +19,6 @@ $(document).ready(function(){
     // Page settings
     if($('.settings').length){
 
-        // Gestion affichage partiel ou complet en fonction de affichage du contenu
-        if($("input[name='articleDisplayContent']").length){
-            $("input[name='articleDisplayContent']").click(function(){
-                toggleArticleView();
-            });
-        }
-
         // Si nom du bloc en hash dans url
         var hash=window.location.hash;
         if(hash.length){
@@ -540,12 +533,6 @@ function synchronize(code){
     }
 }
 
-// Active ou desactive inputs type affichage des events
-function toggleArticleView(){
-    var element = $("input[name=articleView]");
-    element.prop("disabled",!element.prop("disabled"));
-}
-
 // Disparition block et affichage block clique
 function toggleBlocks(target){
     target=target.substring(1);

+ 18 - 0
updates/00004-articleDisplayMode-20140306.sql

@@ -0,0 +1,18 @@
+--######################################################################################################
+--#####
+--#####     MISE À JOUR Base de données de Leed
+--#####			Date : 06/03/2014
+--#####			Version Leed : v1.7
+--#####
+--#####				Préfixe des tables : ##MYSQL_PREFIX## est remplacé automatiquement
+--#####
+--##### 			Feature(s) :
+--#####				- Pliage des articles - issues : #87
+--#####
+--######################################################################################################
+
+-- insertion du paramétrage par défaut
+INSERT INTO `##MYSQL_PREFIX##configuration` (`key`, `value`) VALUES ('articleDisplayMode','summary');
+-- suppression des anciennes variables
+DELETE FROM `##MYSQL_PREFIX##configuration` WHERE (`key` = 'articleDisplayContent');
+DELETE FROM `##MYSQL_PREFIX##configuration` WHERE (`key` = 'articleView');