Skip to content

Commit

Permalink
Merge branch 'foldArticles' into dev
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
cobalt74 committed Mar 9, 2014
2 parents ba2df53 + b5f263d commit cd6cc05
Show file tree
Hide file tree
Showing 13 changed files with 212 additions and 89 deletions.
28 changes: 23 additions & 5 deletions action.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,18 +173,14 @@

//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']);
Expand Down Expand Up @@ -593,6 +589,28 @@

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));
Expand Down
14 changes: 6 additions & 8 deletions article.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,19 @@
$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'];
Expand All @@ -39,8 +37,8 @@
$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,';
Expand Down
30 changes: 14 additions & 16 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,31 @@
$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,';
Expand Down
3 changes: 1 addition & 2 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,12 @@ class_exists('Update') or require_once('Update.class.php');
$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');
Expand Down
10 changes: 7 additions & 3 deletions locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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.",
Expand All @@ -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",
Expand Down
10 changes: 7 additions & 3 deletions locale/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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.",
Expand All @@ -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",
Expand Down
10 changes: 7 additions & 3 deletions locale/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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.",
Expand All @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
$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
Expand Down
Loading

0 comments on commit cd6cc05

Please sign in to comment.