Browse Source

Merge branch 'foldArticles' into dev

* foldArticles:
  #87 - Correction d'affichage
  #87 - Chargement en ajax du content / traduction / raccoucis "j" / maj panneau d'aide
  #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
  'eventDisplayMode' --> 'articleDisplayMode'
  Change les modes d'affichage des événements

Conflicts:
	install.php
cobalt74 7 years ago
parent
commit
cd6cc05d07

+ 23 - 5
action.php

@@ -173,18 +173,14 @@ 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']);
             $configurationManager->put('articleDisplayAuthor',$_['articleDisplayAuthor']);
             $configurationManager->put('articleDisplayHomeSort',$_['articleDisplayHomeSort']);
             $configurationManager->put('articleDisplayFolderSort',$_['articleDisplayFolderSort']);
+            $configurationManager->put('articleDisplayMode',$_['articleDisplayMode']);
             $configurationManager->put('synchronisationType',$_['synchronisationType']);
             $configurationManager->put('synchronisationEnableCache',$_['synchronisationEnableCache']);
             $configurationManager->put('synchronisationForceFeed',$_['synchronisationForceFeed']);
@@ -593,6 +589,28 @@ switch ($action){
 
         break;
 
+    case 'articleDisplayMode':
+        if($myUser==false) {
+            $response_array['status'] = 'noconnect';
+            $response_array['texte'] = _t('YOU_MUST_BE_CONNECTED_ACTION');
+            header('Content-type: application/json');
+            echo json_encode($response_array);
+            exit();
+        }
+        // chargement du content de l'article souhaité
+        $newEvent = new Event();
+        $event = $newEvent->getById($_['event_id']);
+
+        if ($_['articleDisplayMode']=='content'){
+            //error_log(print_r($_SESSION['events'],true));
+            $content = $event->getContent();
+        } else {
+            $content = $event->getDescription();
+        }
+        echo $content;
+
+        break;
+
     default:
         require_once("SimplePie.class.php");
         Plugin::callHook("action_post_case", array(&$_,$myUser));

+ 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,';

+ 1 - 2
install.php

@@ -190,13 +190,12 @@ if (isset($_['installButton']) && empty($test[$lib_errors])) { // Pas d'erreur,
     $configurationManager->create();
     $configurationManager->add('articleDisplayAnonymous','0');
     $configurationManager->add('articleDisplayAuthor','1');
-    $configurationManager->add('articleDisplayContent','1');
     $configurationManager->add('articleDisplayDate','1');
     $configurationManager->add('articleDisplayFolderSort','1');
     $configurationManager->add('articleDisplayHomeSort','1');
     $configurationManager->add('articleDisplayLink','1');
+    $configurationManager->add('articleDisplayMode','summary');
     $configurationManager->add('articlePerPages','5');
-    $configurationManager->add('articleView','partial');
     $configurationManager->add('cryptographicSalt', $cryptographicSalt);
     $configurationManager->add('displayOnlyUnreadFeedFolder','false');
     $configurationManager->add('feedMaxEvents','50');

+ 7 - 3
locale/en.json

@@ -27,6 +27,7 @@
  "CONFIRM_MARK_ALL_AS_READ":"Mark all as read for all the feeds?",
  "CONFIRM_MARK_FEED_AS_READ":"Do you really want to mark all the news as read for this feed?",
  "CONFIRM_TRASH_EVENTS":"Do you really want to empty the events?",
+ "CONTENT":"Full content",
  "CONTRIBUTORS":"Contributors",
  "DELETE":"Delete",
  "DISABLE":"Disable",
@@ -37,6 +38,9 @@
  "ENABLE_CACHE_DESC":"This option allows you to disable caching. However, disabling caching may cause longer loading time.",
  "ERROR":"Errors",
  "ERRORS":"error(s)",
+ "EVENT_DISPLAY_CONTENT":"Display full content",
+ "EVENT_DISPLAY_SUMMARY":"Display summary",
+ "EVENT_DISPLAY_TITLE":"Display title",
  "EVENT_NUMBER_PER_PAGES":"Number of articles per page",
  "EXPORT":"Export",
  "EXPORT_FEED_OPML_FORMAT":"Export feeds as opml format",
@@ -55,7 +59,6 @@
  "FOLD_UNFOLD_FOLDER":"Fold/Unfold folder",
  "FORCE_INTEGRATION":"Force integration",
  "FORCE_INTEGRATION_DESC":"RSS and Atom feeds are supposed to have specific MIME ypes to allow the softwares to identify them. Some feeds don't follow the rules (for example text/plain). By default SimplePie follows the best pratices, but you can still force the integration with this option. ",
- "FULL":"Complete",
  "FULL_SYNCHRONISATION":"Complete synchronization…",
  "GENERALITY":"Generality",
  "GENERAL_FOLDER":"General",
@@ -64,6 +67,7 @@
  "GRADUATE_SYNCHRONISATION":"Graduated synchronization",
  "HELP_H":"<strong>h</strong> show/hide the help panel",
  "HELP_H_?":"Key h show/hide the help panel",
+ "HELP_J":"<strong>j</ strong> change the display mode of the article (title, summary, complete)",
  "HELP_K":"<strong>k</strong> previous element (opening it)",
  "HELP_L":"<strong>l</strong> mark the previous element as unread",
  "HELP_M":"<strong>m</strong> mark the selected element as read / unread",
@@ -141,7 +145,6 @@
  "NO_INSTALLED_PLUGINS":"There is no installed plugin yet.",
  "OLDER":"oldest",
  "OPML_FILE":"OPML File",
- "PARTIAL":"Partial",
  "PASSWORD":"Password",
  "PENDING":"In progress...",
  "PLUGINS":"Plugins",
@@ -167,11 +170,11 @@
  "SHOW_EVENT_CONTENT":"Show the content of the article",
  "SHOW_EVENT_DATE":"Show the date of the article",
  "SHOW_EVENT_LINK":"Show direct link to the article",
- "SHOW_PARTIAL_CONTENT_DESC":"NB : if you choose partial, a click on the article will redirect to the authors' blog.",
  "SITE":"Website",
  "SORT_BY_RECENT_EVENT_FOLDER":"Most recent articles first (in folders)",
  "SORT_BY_RECENT_EVENT_HOME":"Most recent articles first (on the home page)",
  "SUCCESS":"Success",
+ "SUMMARY":"Summary",
  "SYNCHRONISATION":"Synchronization",
  "SYNCHRONISATION_CODE":"Synchronization code",
  "SYNCHRONISATION_COMPLETE":"Synchronization finished.",
@@ -180,6 +183,7 @@
  "SYNCHRONISATION_TYPE":"Synchronization type",
  "SYNCHRONIZE_COFFEE_TIME":"NB : The synchronization can take time, leave your browser do the job and go grab a coffee :).",
  "SYNCHRONIZE_NOW":"Synchronize now",
+ "TITLE":"Title",
  "TRASH_EVENTS":"Empty events",
  "UNFAVORIZE":"Unfavorize",
  "UNFOLD":"Unfold",

+ 7 - 3
locale/es.json

@@ -27,6 +27,7 @@
  "CONFIRM_MARK_ALL_AS_READ":"¿ Marcar como leído todos los RSS ?",
  "CONFIRM_MARK_FEED_AS_READ":"¿ Está seguro que desea marcar todos los eventos como leidos para este RSS ?",
  "CONFIRM_TRASH_EVENTS":"¿ Está seguro que desea suprimir todos los eventos ?",
+ "CONTENT":"Contenido completo",
  "CONTRIBUTORS":"Contribuidor",
  "DELETE":"Suprimir",
  "DISABLE":"Desactivar",
@@ -37,6 +38,9 @@
  "ENABLE_CACHE_DESC":"Esta opción permite desactivar el caché. Sin embargo, la desactivación del caché puede llevar tiempos de cargamiento más largos.",
  "ERROR":"Errores",
  "ERRORS":"error(es)",
+ "EVENT_DISPLAY_CONTENT":"Visualizar contenido completo",
+ "EVENT_DISPLAY_SUMMARY":"Visualizar resumen",
+ "EVENT_DISPLAY_TITLE":"Visualizar título",
  "EVENT_NUMBER_PER_PAGES":"Número de articulos por página",
  "EXPORT":"Exportación ",
  "EXPORT_FEED_OPML_FORMAT":"Exportar los RSS con el formato OPML",
@@ -55,7 +59,6 @@
  "FOLD_UNFOLD_FOLDER":"Plegar/Desplegar el directorio",
  "FORCE_INTEGRATION":"Forzar la integración",
  "FORCE_INTEGRATION_DESC":"Los RSS y Atom deben tener tipos MIME asociados especificados para que el script sepa de que tipo de datos se trata. Algunos RSS no siguen estas reglas (por ejemplo text/plain). SimplePie sigue las mejoras practicas por defecto, pero se puede forzar la integración con este parámetro.",
- "FULL":"Completo",
  "FULL_SYNCHRONISATION":"Syncronización completa…",
  "GENERALITY":"Generalidades",
  "GENERAL_FOLDER":"General",
@@ -64,6 +67,7 @@
  "GRADUATE_SYNCHRONISATION":"Syncronización gradual",
  "HELP_H":"<strong>h</strong> Mostrar/disfrazar el panel de ayuda",
  "HELP_H_?":"tecla h para mostrar/disfrazar el panel de ayuda",
+ "HELP_J":"<strong>j</ strong> cambiar el modo de visualización del artículo (título, reducida, completo)",
  "HELP_K":"<strong>k</strong> elémento precedente (sin abrirlo)",
  "HELP_L":"<strong>l</strong> marcar el elemento precedente como no leído",
  "HELP_M":"<strong>m</strong> marcar el elemento seleccionado como leído / no leído",
@@ -141,7 +145,6 @@
  "NO_INSTALLED_PLUGINS":"No se ha instalado ningún complemento ya.",
  "OLDER":"Más antiguo",
  "OPML_FILE":"Archivo OPML",
- "PARTIAL":"Parcial",
  "PASSWORD":"Contraseña",
  "PENDING":"En curso…",
  "PLUGINS":"Complementos",
@@ -167,11 +170,11 @@
  "SHOW_EVENT_CONTENT":"Mostrar el contenido del artículo",
  "SHOW_EVENT_DATE":"Mostrar la fecha del artículo",
  "SHOW_EVENT_LINK":"Mostrar el vínculo directo del artículo",
- "SHOW_PARTIAL_CONTENT_DESC":"NB : si usted elige una visualización parcial de los articulos, un clic sobre ellos permitirá ir sobre el blog del autor.",
  "SITE":"Sitio web",
  "SORT_BY_RECENT_EVENT_FOLDER":"Articulos los más recientes en primero (en los directorios)",
  "SORT_BY_RECENT_EVENT_HOME":"Articles los más recientes en primero (en la portada)",
  "SUCCESS":"Éxito",
+ "SUMMARY":"Resumen",
  "SYNCHRONISATION":"Syncronisación",
  "SYNCHRONISATION_CODE":"Código de syncronisación",
  "SYNCHRONISATION_COMPLETE":"Syncronisación terminada.",
@@ -180,6 +183,7 @@
  "SYNCHRONISATION_TYPE":"Tipo de syncronisación",
  "SYNCHRONIZE_COFFEE_TIME":"NB : La syncronisación puede tomar cierto tiempo, deje su navegador y vaya tomarse un cafe.&nbsp;:)",
  "SYNCHRONIZE_NOW":"Syncronisar ahora",
+ "TITLE":"Título",
  "TRASH_EVENTS":"Vaciar los eventos",
  "UNFAVORIZE":"Marcar no favorito",
  "UNFOLD":"Desplegar",

+ 7 - 3
locale/fr.json

@@ -27,6 +27,7 @@
  "CONFIRM_MARK_ALL_AS_READ":"Tout marquer comme lu pour tous les flux ?",
  "CONFIRM_MARK_FEED_AS_READ":"Êtes vous sûr de vouloir marquer tous les événements comme lus pour ce flux ?",
  "CONFIRM_TRASH_EVENTS":"Êtes vous sûr de vouloir vider tous les événements ?",
+ "CONTENT":"Complet",
  "CONTRIBUTORS":"Contributeurs",
  "DELETE":"Supprimer",
  "DISABLE":"Désactiver",
@@ -37,6 +38,9 @@
  "ENABLE_CACHE_DESC":"Cette option vous permet de désactiver la mise en cache. Cependant, la désactivation du cache peut entraîner des temps de chargement plus longs.",
  "ERROR":"Erreurs",
  "ERRORS":"erreur(s)",
+ "EVENT_DISPLAY_CONTENT":"Affichage mode complet",
+ "EVENT_DISPLAY_SUMMARY":"Affichage mode réduit",
+ "EVENT_DISPLAY_TITLE":"Affichage mode titre",
  "EVENT_NUMBER_PER_PAGES":"Nombre d’articles par page",
  "EXPORT":"Export",
  "EXPORT_FEED_OPML_FORMAT":"Exporter les flux au format OPML",
@@ -55,7 +59,6 @@
  "FOLD_UNFOLD_FOLDER":"Plier/Déplier le dossier",
  "FORCE_INTEGRATION":"Forcer l’intégration",
  "FORCE_INTEGRATION_DESC":"Les flux RSS et Atom sont censés avoir des types MIME associés spécifiques afin que le logiciel sache quel type de données il s’agit. Certains flux ne suivent pas ces règles (par exemple text/plain). SimplePie suit les meilleures pratiques par défaut, mais vous pouvez forcer l’intégration avec ce paramètre.",
- "FULL":"Complet",
  "FULL_SYNCHRONISATION":"Synchronisation complète…",
  "GENERALITY":"Généralités",
  "GENERAL_FOLDER":"Générale",
@@ -64,6 +67,7 @@
  "GRADUATE_SYNCHRONISATION":"Synchronisation graduée",
  "HELP_H":"<strong>h</strong> afficher/masquer le panneau d’aide",
  "HELP_H_?":"touche h pour afficher/masquer le panneau d’aide",
+ "HELP_J":"<strong>j</strong> change le mode d'affichage de l'article (titre, réduit, complet)",
  "HELP_K":"<strong>k</strong> élément précédent (et l’ouvrir)",
  "HELP_L":"<strong>l</strong> marque l’élément précédent comme non lu",
  "HELP_M":"<strong>m</strong> marque l’élément sélectionné comme lu / non lu",
@@ -141,7 +145,6 @@
  "NO_INSTALLED_PLUGINS":"Aucun plugin n’est installé pour le moment.",
  "OLDER":"Plus vieux",
  "OPML_FILE":"Fichier OPML",
- "PARTIAL":"Partiel",
  "PASSWORD":"Mot de passe",
  "PENDING":"En cours…",
  "PLUGINS":"Plugins",
@@ -167,11 +170,11 @@
  "SHOW_EVENT_CONTENT":"Affichage du contenu de l’article",
  "SHOW_EVENT_DATE":"Affichage de la date de l’article",
  "SHOW_EVENT_LINK":"Affichage du lien direct de l’article",
- "SHOW_PARTIAL_CONTENT_DESC":"NB : si vous choissisez un affichage partiel des articles, un clic sur ces derniers mènera à l’article sur le blog de l’auteur.",
  "SITE":"Site web",
  "SORT_BY_RECENT_EVENT_FOLDER":"Articles les plus récents en premier (sur les dossiers)",
  "SORT_BY_RECENT_EVENT_HOME":"Articles les plus récents en premier (sur la page d’accueil)",
  "SUCCESS":"Succès",
+ "SUMMARY":"Résumé",
  "SYNCHRONISATION":"Synchronisation",
  "SYNCHRONISATION_CODE":"Code de synchronisation",
  "SYNCHRONISATION_COMPLETE":"Synchronisation terminée.",
@@ -180,6 +183,7 @@
  "SYNCHRONISATION_TYPE":"Type de synchronisation",
  "SYNCHRONIZE_COFFEE_TIME":"NB : La synchronisation peut prendre un certain temps, laissez votre navigateur tourner et allez vous prendre un café.&nbsp;:)",
  "SYNCHRONIZE_NOW":"Synchroniser maintenant",
+ "TITLE":"Titre",
  "TRASH_EVENTS":"Vider les événements",
  "UNFAVORIZE":"Défavoriser",
  "UNFOLD":"Déplier",

+ 1 - 2
settings.php

@@ -21,8 +21,7 @@ $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'));
 
 //Suppression de l'état des plugins inexistants

+ 45 - 29
templates/marigolds/article.html

@@ -29,42 +29,58 @@
             {/if}
             {if="$value->getFavorite()!=1"} -  <a class="pointer favorite" onclick="addFavorite(this,{$value->getId()});" >{function="_t('FAVORIZE')"}</a>
             {else}
-             <a class="pointer favorite" onclick="removeFavorite(this,{$value->getId()});" >{function="_t('UNFAVORIZE')"}</a>
-             {/if}
-
-             <a class="pointer right readUnreadButton">({function="_t('READ')"}/{function="_t('UNREAD')"})</a>
-             {function="Plugin::callHook("event_post_top_options", array(&$value))"}
+            <a class="pointer favorite" onclick="removeFavorite(this,{$value->getId()});" >{function="_t('UNFAVORIZE')"}</a>
+            {/if}
+            {if="$articleDisplayMode=='title'"}
+            <a class="pointer" id="btnDisplayMode_{$value->getId()}" onclick="toggleArticleDisplayMode(this,{$value->getId()})" title="{function="_t('EVENT_DISPLAY_TITLE')"}">|&nbsp;&nbsp;</a>
+            {/if}
+            {if="$articleDisplayMode=='summary'"}
+            <a class="pointer" id="btnDisplayMode_{$value->getId()}" onclick="toggleArticleDisplayMode(this,{$value->getId()})" title="{function="_t('EVENT_DISPLAY_SUMMARY')"}">||&nbsp;</a>
+            {/if}
+            {if="$articleDisplayMode=='content'"}
+            <a class="pointer" id="btnDisplayMode_{$value->getId()}" onclick="toggleArticleDisplayMode(this,{$value->getId()})" title="{function="_t('EVENT_DISPLAY_CONTENT')"}">|||</a>
+            {/if}
+            <a class="pointer right readUnreadButton">({function="_t('READ')"}/{function="_t('UNREAD')"})</a>
+            {function="Plugin::callHook("event_post_top_options", array(&$value))"}
         </h3>
 
         <!-- CONTENU/DESCRIPTION -->
-        {if="$articleDisplayContent"}
-            <div class="articleContent">
-                {if="$articleView=='partial'"}
-                    {function="Plugin::callHook("event_pre_description", array(&$value))"}
-                    {$value->getDescription()}
-                    {function="Plugin::callHook("event_post_description", array(&$value))"}
-                {else}
-                    {function="Plugin::callHook("event_pre_content", array(&$value))"}
-                    {$value->getContent()}
-                    {function="Plugin::callHook("event_post_content", array(&$value))"}
-                {/if}
+        {if="$articleDisplayMode=='summary'"}
+            <div class="articleContent summary">
+            {function="Plugin::callHook("event_pre_description", array(&$value))"}
+            {$value->getDescription()}
+            {function="Plugin::callHook("event_post_description", array(&$value))"}
+            </div>
+        {else}
+            <div class="articleContent summary" style="display: none;"></div>
+        {/if}
+
+        {if="$articleDisplayMode=='content'"}
+            <div class="articleContent content">
+            {function="Plugin::callHook("event_pre_content", array(&$value))"}
+            {$value->getContent()}
+            {function="Plugin::callHook("event_post_content", array(&$value))"}
             </div>
+        {else}
+            <div class="articleContent content" style="display: none;"></div>
+        {/if}
 
-            {if="$articleView!='partial'"}
-            <!-- RAPPEL DETAILS + OPTIONS POUR LES ARTICLES AFFICHES EN ENTIER -->
-            <h3 class="articleDetails">
-                {function="Plugin::callHook("event_pre_bottom_options", array(&$value))"}
+        {if="$articleDisplayMode=='content'"}
+        <!-- RAPPEL DETAILS + OPTIONS POUR LES ARTICLES AFFICHES EN ENTIER -->
+        <h3 class="articleDetails">
+        {else}
+        <h3 class="articleDetails" style="display: none;">
+        {/if}
+            {function="Plugin::callHook("event_pre_bottom_options", array(&$value))"}
 
-                <a class="pointer right readUnreadButton">(lu/non lu)</a>
-                {if="$value->getFavorite()!=1"}<a class="right pointer favorite"  onclick="addFavorite(this,{$value->getId()});">{function="_t('FAVORIZE')"}</a>
-                {else}
-                <a class="right pointer favorite" onclick="removeFavorite(this,{$value->getId()});">{function="_t('UNFAVORIZE')"}</a>
-                {/if}
-                <div class="clear"></div>
-                {function="Plugin::callHook("event_post_bottom_options", array(&$value))"}
-            </h3>
+            <a class="pointer right readUnreadButton">(lu/non lu)</a>
+            {if="$value->getFavorite()!=1"}<a class="right pointer favorite"  onclick="addFavorite(this,{$value->getId()});">{function="_t('FAVORIZE')"}</a>
+            {else}
+            <a class="right pointer favorite" onclick="removeFavorite(this,{$value->getId()});">{function="_t('UNFAVORIZE')"}</a>
             {/if}
-        {/if}
+            <div class="clear"></div>
+            {function="Plugin::callHook("event_post_bottom_options", array(&$value))"}
+        </h3>
     </section>
     {function="Plugin::callHook("event_post_section", array(&$value))"}
     {$hightlighted=$hightlighted+1}

+ 1 - 0
templates/marigolds/index.html

@@ -22,6 +22,7 @@
                 <li>{function="_t('HELP_SPC')"}</li>
                 <li>{function="_t('HELP_K')"}</li>
                 <li>{function="_t('HELP_O_ENTER')"}</li>
+                <li>{function="_t('HELP_J')"}</li>
                 <li>{function="_t('HELP_H')"}</li>
             </ul>
         </div>

+ 79 - 11
templates/marigolds/js/script.js

@@ -12,6 +12,7 @@ keyCode['p'] = 80;
 keyCode['k'] = 75;
 keyCode['o'] = 79;
 keyCode['h'] = 72;
+keyCode['j'] = 74;
 keyCode['space'] = 32;
 
 $(document).ready(function(){
@@ -19,13 +20,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){
@@ -131,6 +125,11 @@ $(document).keydown(function (e) {
             document.getElementById( 'helpPanel' ).style.display == 'block' ? document.getElementById( 'helpPanel' ).style.display = 'none' : document.getElementById( 'helpPanel' ).style.display = 'block';
             return false;
         break;
+        case keyCode['j']:
+            // Affiche / cache les blocs résumé / content
+            toggleArticleDisplayMode(document.getElementById('btnDisplayMode_'+$('.eventSelected').attr('id')),$('.eventSelected').attr('id'));
+            return false;
+        break;
     }
 });
 
@@ -540,10 +539,79 @@ function synchronize(code){
     }
 }
 
-// Active ou desactive inputs type affichage des events
-function toggleArticleView(){
-    var element = $("input[name=articleView]");
-    element.prop("disabled",!element.prop("disabled"));
+// Affiche / cache les blocs résumé / content
+function toggleArticleDisplayMode(button, target){
+    if ($('#'+target+' > .summary').length>0 && $('#'+target+' > .summary').attr('style')!='display: none;'){
+
+        // je suis en mode affichage réduit et je passe en affichage mode complet
+        action = 'content';
+        $('#'+target+' > .summary').hide();
+        // chargement de l'article complet (content)
+        if ($.trim($('#'+target+' > .content').text()).length==0){
+            $.ajax({
+                url: "./action.php?action=articleDisplayMode&articleDisplayMode="+action+'&event_id='+target,
+                success:function(msg){
+                    if(msg.status == 'noconnect') {
+                        alert(msg.texte)
+                    } else {
+                        if( console && console.log && msg!="" ) console.log(msg);
+                        $('#'+target+' > .content').html(msg);
+                        $('#'+target+' > .content').show()
+                        // btn pour passer en mode title
+                        button.innerHTML = '|||';
+                        button.title = _t('EVENT_DISPLAY_CONTENT');
+                        $('#'+target+' > .articleDetails').last().show();
+                    }
+                }
+            });
+        } else {
+            $('#'+target+' > .content').show()
+            // btn pour passer en mode title
+            button.innerHTML = '|||';
+            button.title = _t('EVENT_DISPLAY_CONTENT');
+            $('#'+target+' > .articleDetails').last().show();
+        }
+
+    }else{
+        if ($('#'+target+' > .content').length>0 && $('#'+target+' > .content').attr('style')!='display: none;'){
+            // je suis en mode affichage complet et je passe en affichage mode title
+            $('#'+target+' > .content').hide();
+            // btn pour passer en mode reduit
+            button.innerHTML = '|&nbsp;&nbsp;';
+            button.title = _t('EVENT_DISPLAY_TITLE');
+            if ($('#'+target+' > .articleDetails').length > 1) {
+                $('#'+target+' > .articleDetails').last().hide();
+            }
+
+        }  else {
+
+            // je suis en mode affichage titre et je passe en affichage mode réduit
+            action = 'summary';
+            // chargement de l'article réduit (description)
+            if ($.trim($('#'+target+' > .summary').text()).length==0){
+                $.ajax({
+                    url: "./action.php?action=articleDisplayMode&articleDisplayMode="+action+'&event_id='+target,
+                    success:function(msg){
+                        if(msg.status == 'noconnect') {
+                            alert(msg.texte)
+                        } else {
+                            if( console && console.log && msg!="" ) console.log(msg);
+                            $('#'+target+' > .summary').html(msg);
+                            $('#'+target+' > .summary').show();
+                            // btn pour passer en mode complet
+                            button.innerHTML = '||&nbsp;';
+                            button.title = _t('EVENT_DISPLAY_SUMMARY');
+                        }
+                    }
+                });
+            } else {
+                $('#'+target+' > .summary').show();
+                // btn pour passer en mode complet
+                button.innerHTML = '||&nbsp;';
+                button.title = _t('EVENT_DISPLAY_SUMMARY');
+            }
+        }
+    }
 }
 
 // Disparition block et affichage block clique

+ 3 - 7
templates/marigolds/settings.html

@@ -221,13 +221,9 @@
                         </fieldset>
                         <fieldset>
                             <legend>{function="_t('SHOW_EVENT_CONTENT')"}</legend>
-                            <input type="radio" onchange="$('.articleView').slideToggle(200);" {if="$articleDisplayContent=='1'"} checked="checked" {/if} value="1" id="articleDisplayContentYes" name="articleDisplayContent" /><label for="articleDisplayContentYes">{function="_t('YES')"}</label>
-                            <input type="radio" onchange="$('.articleView').slideToggle(200);" {if="$articleDisplayContent=='0'"} checked="checked" {/if} value="0" id="articleDisplayContentNo" name="articleDisplayContent" /><label for="articleDisplayContentNo">{function="_t('NO')"}</label>
-                            <div class="articleView"{$articleDisplayContent==0 ? 'style="display: none;"':''}>
-                                <input type="radio" {if="$articleView=='partial'"} checked="checked" {/if} value="partial" id="articleViewPartial" name="articleView"{if="$articleDisplayContent=='0'"} disabled="disabled"{/if} /><label for="articleViewPartial">{function="_t('PARTIAL')"}</label>
-                                <input type="radio" {if="$articleView=='complete'"} checked="checked" {/if} value="complete" id="articleViewComplete" name="articleView"{if="$articleDisplayContent=='0'"} disabled="disabled"{/if} /><label for="articleViewComplete">{function="_t('FULL')"}</label>
-                            </div>
-                            <h4>{function="_t('SHOW_PARTIAL_CONTENT_DESC')"}</h4>
+                            <input type="radio" {if="$articleDisplayMode=='title'"} checked="checked" {/if} value="title" id="articleDisplayModeTitle" name="articleDisplayMode" /><label for="articleDisplayModeTitle">{function="_t('TITLE')"}</label>
+                            <input type="radio" {if="$articleDisplayMode=='summary'"} checked="checked" {/if} value="summary" id="articleDisplayModeSummary" name="articleDisplayMode" /><label for="articleDisplayModeSummary">{function="_t('SUMMARY')"}</label>
+                            <input type="radio" {if="$articleDisplayMode=='content'"} checked="checked" {/if} value="content" id="articleDisplayModeContent" name="articleDisplayMode" /><label for="articleDisplayModeContent">{function="_t('CONTENT')"}</label>
                         </fieldset>
                         <fieldset>
                             <legend>{function="_t('KEEP_LAST_X_EVENTS_FEED',array('<input type="text" value="'.$configurationManager->get('feedMaxEvents').'" name="feedMaxEvents" size="4" />'))"}</legend>

+ 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');