A free, self-hostable news aggregator…
Split reading configuration page
Alexis Degrugillierb55571de8f19
diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.phpindex b4de19e11..df5212041 100755--- a/app/Controllers/configureController.php+++ b/app/Controllers/configureController.php@@ -140,21 +140,6 @@ class FreshRSS_configure_Controller extends Minz_ActionController {public function displayAction () {if (Minz_Request::isPost()) {$this->view->conf->_language(Minz_Request::param('language', 'en'));- $this->view->conf->_posts_per_page(Minz_Request::param('posts_per_page', 10));- $this->view->conf->_view_mode(Minz_Request::param('view_mode', 'normal'));- $this->view->conf->_default_view (Minz_Request::param('default_view', 'a'));- $this->view->conf->_auto_load_more(Minz_Request::param('auto_load_more', false));- $this->view->conf->_display_posts(Minz_Request::param('display_posts', false));- $this->view->conf->_onread_jump_next(Minz_Request::param('onread_jump_next', false));- $this->view->conf->_lazyload (Minz_Request::param('lazyload', false));- $this->view->conf->_sticky_post (Minz_Request::param('sticky_post', false));- $this->view->conf->_sort_order(Minz_Request::param('sort_order', 'DESC'));- $this->view->conf->_mark_when (array(- 'article' => Minz_Request::param('mark_open_article', false),- 'site' => Minz_Request::param('mark_open_site', false),- 'scroll' => Minz_Request::param('mark_scroll', false),- 'reception' => Minz_Request::param('mark_upon_reception', false),- ));$themeId = Minz_Request::param('theme', '');if ($themeId == '') {$themeId = FreshRSS_Themes::defaultTheme;@@ -187,6 +172,41 @@ class FreshRSS_configure_Controller extends Minz_ActionController {$this->view->themes = FreshRSS_Themes::get();+ Minz_View::prependTitle (Minz_Translate::t ('display_configuration') . ' · ');+ }++ public function readingAction () {+ if (Minz_Request::isPost()) {+ $this->view->conf->_posts_per_page(Minz_Request::param('posts_per_page', 10));+ $this->view->conf->_view_mode(Minz_Request::param('view_mode', 'normal'));+ $this->view->conf->_default_view (Minz_Request::param('default_view', 'a'));+ $this->view->conf->_auto_load_more(Minz_Request::param('auto_load_more', false));+ $this->view->conf->_display_posts(Minz_Request::param('display_posts', false));+ $this->view->conf->_onread_jump_next(Minz_Request::param('onread_jump_next', false));+ $this->view->conf->_lazyload (Minz_Request::param('lazyload', false));+ $this->view->conf->_sticky_post (Minz_Request::param('sticky_post', false));+ $this->view->conf->_sort_order(Minz_Request::param('sort_order', 'DESC'));+ $this->view->conf->_mark_when (array(+ 'article' => Minz_Request::param('mark_open_article', false),+ 'site' => Minz_Request::param('mark_open_site', false),+ 'scroll' => Minz_Request::param('mark_scroll', false),+ 'reception' => Minz_Request::param('mark_upon_reception', false),+ ));+ $this->view->conf->save();++ Minz_Session::_param ('language', $this->view->conf->language);+ Minz_Translate::reset ();+ invalidateHttpCache();++ $notif = array (+ 'type' => 'good',+ 'content' => Minz_Translate::t ('configuration_updated')+ );+ Minz_Session::_param ('notification', $notif);++ Minz_Request::forward (array ('c' => 'configure', 'a' => 'reading'), true);+ }+Minz_View::prependTitle (Minz_Translate::t ('reading_configuration') . ' · ');}diff --git a/app/i18n/en.php b/app/i18n/en.phpindex 91bb9adce..d6096bbe8 100644--- a/app/i18n/en.php+++ b/app/i18n/en.php@@ -79,7 +79,6 @@ return array ('sharing_management' => 'Sharing options management','bad_opml_file' => 'Your OPML file is invalid','shortcuts_updated' => 'Shortcuts have been updated',- 'shortcuts_management' => 'Shortcuts management','shortcuts_navigation' => 'Navigation','shortcuts_navigation_help' => 'With the "Shift" modifier, navigation shortcuts apply on feeds.<br/>With the "Alt" modifier, navigation shortcuts apply on categories.','shortcuts_article_action' => 'Article actions',@@ -212,6 +211,7 @@ return array ('purge_completed' => 'Purge completed (%d articles deleted)','archiving_configuration_help' => 'More options are available in the individual stream settings','reading_configuration' => 'Reading',+ 'display_configuration' => 'Display','articles_per_page' => 'Number of articles per page','default_view' => 'Default view','sort_order' => 'Sort order',@@ -219,7 +219,7 @@ return array ('display_articles_unfolded' => 'Show articles unfolded by default','after_onread' => 'After “mark all as read”,','jump_next' => 'jump to next unread sibling (feed or category)',- 'reading_icons' => 'Reading icons',+ 'article_icons' => 'Article icons','top_line' => 'Top line','bottom_line' => 'Bottom line','img_with_lazyload' => 'Use "lazy load" mode to load pictures',diff --git a/app/i18n/fr.php b/app/i18n/fr.phpindex 0897db93d..d89cbb098 100644--- a/app/i18n/fr.php+++ b/app/i18n/fr.php@@ -79,7 +79,6 @@ return array ('sharing_management' => 'Gestion des options de partage','bad_opml_file' => 'Votre fichier OPML n’est pas valide','shortcuts_updated' => 'Les raccourcis ont été mis à jour',- 'shortcuts_management' => 'Gestion des raccourcis','shortcuts_navigation' => 'Navigation','shortcuts_navigation_help' => 'Avec le modificateur "Shift", les raccourcis de navigation s’appliquent aux flux.<br/>Avec le modificateur "Alt", les raccourcis de navigation s’appliquent aux catégories.','shortcuts_article_action' => 'Actions associées à l’article courant',@@ -212,6 +211,7 @@ return array ('purge_completed' => 'Purge effectuée (%d articles supprimés)','archiving_configuration_help' => 'D’autres options sont disponibles dans la configuration individuelle des flux','reading_configuration' => 'Lecture',+ 'display_configuration' => 'Affichage','articles_per_page' => 'Nombre d’articles par page','default_view' => 'Vue par défaut','sort_order' => 'Ordre de tri',@@ -219,7 +219,7 @@ return array ('display_articles_unfolded' => 'Afficher les articles dépliés par défaut','after_onread' => 'Après “marquer tout comme lu”,','jump_next' => 'sauter au prochain voisin non lu (flux ou catégorie)',- 'reading_icons' => 'Icônes de lecture',+ 'article_icons' => 'Icônes d’article','top_line' => 'Ligne du haut','bottom_line' => 'Ligne du bas','img_with_lazyload' => 'Utiliser le mode “chargement différé” pour les images',diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtmlindex 27f11ab6d..43adeb3c6 100644--- a/app/layout/aside_configure.phtml+++ b/app/layout/aside_configure.phtml@@ -1,7 +1,10 @@<ul class="nav nav-list aside"><li class="nav-header"><?php echo Minz_Translate::t ('configuration'); ?></li><li class="item<?php echo Minz_Request::actionName () == 'display' ? ' active' : ''; ?>">- <a href="<?php echo _url ('configure', 'display'); ?>"><?php echo Minz_Translate::t ('reading_configuration'); ?></a>+ <a href="<?php echo _url ('configure', 'display'); ?>"><?php echo Minz_Translate::t ('display_configuration'); ?></a>+ </li>+ <li class="item<?php echo Minz_Request::actionName () == 'reading' ? ' active' : ''; ?>">+ <a href="<?php echo _url ('configure', 'reading'); ?>"><?php echo Minz_Translate::t ('reading_configuration'); ?></a></li><li class="item<?php echo Minz_Request::actionName () == 'archiving' ? ' active' : ''; ?>"><a href="<?php echo _url ('configure', 'archiving'); ?>"><?php echo Minz_Translate::t ('archiving_configuration'); ?></a>diff --git a/app/layout/header.phtml b/app/layout/header.phtmlindex d20f7487f..08aa7715d 100644--- a/app/layout/header.phtml+++ b/app/layout/header.phtml@@ -67,7 +67,8 @@ if (Minz_Configuration::canLogIn()) {<ul class="dropdown-menu"><li class="dropdown-close"><a href="#close">❌</a></li><li class="dropdown-header"><?php echo Minz_Translate::t ('configuration'); ?></li>- <li class="item"><a href="<?php echo _url ('configure', 'display'); ?>"><?php echo Minz_Translate::t ('reading_configuration'); ?></a></li>+ <li class="item"><a href="<?php echo _url ('configure', 'display'); ?>"><?php echo Minz_Translate::t ('display_configuration'); ?></a></li>+ <li class="item"><a href="<?php echo _url ('configure', 'reading'); ?>"><?php echo Minz_Translate::t ('reading_configuration'); ?></a></li><li class="item"><a href="<?php echo _url ('configure', 'archiving'); ?>"><?php echo Minz_Translate::t ('archiving_configuration'); ?></a></li><li class="item"><a href="<?php echo _url ('configure', 'sharing'); ?>"><?php echo Minz_Translate::t ('sharing'); ?></a></li><li class="item"><a href="<?php echo _url ('configure', 'shortcut'); ?>"><?php echo Minz_Translate::t ('shortcuts'); ?></a></li>diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtmlindex 846db4b4c..5a94376ad 100644--- a/app/views/configure/display.phtml+++ b/app/views/configure/display.phtml@@ -4,7 +4,7 @@<a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a><form method="post" action="<?php echo _url ('configure', 'display'); ?>">- <legend><?php echo Minz_Translate::t ('theme'); ?></legend>+ <legend><?php echo Minz_Translate::t ('display_configuration'); ?></legend><div class="form-group"><label class="group-name" for="language"><?php echo Minz_Translate::t ('language'); ?></label>@@ -35,132 +35,8 @@</div></div>- <div class="form-group form-actions">- <div class="group-controls">- <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>- <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button>- </div>- </div>-- <legend><?php echo Minz_Translate::t ('reading_configuration'); ?></legend>-- <div class="form-group">- <label class="group-name" for="posts_per_page"><?php echo Minz_Translate::t ('articles_per_page'); ?></label>- <div class="group-controls">- <input type="number" id="posts_per_page" name="posts_per_page" value="<?php echo $this->conf->posts_per_page; ?>" />- </div>- </div>-- <div class="form-group">- <label class="group-name" for="sort_order"><?php echo Minz_Translate::t ('sort_order'); ?></label>- <div class="group-controls">- <select name="sort_order" id="sort_order">- <option value="DESC"<?php echo $this->conf->sort_order === 'DESC' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('newer_first'); ?></option>- <option value="ASC"<?php echo $this->conf->sort_order === 'ASC' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('older_first'); ?></option>- </select>- </div>- </div>-- <div class="form-group">- <label class="group-name" for="view_mode"><?php echo Minz_Translate::t ('default_view'); ?></label>- <div class="group-controls">- <select name="view_mode" id="view_mode">- <option value="normal"<?php echo $this->conf->view_mode === 'normal' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('normal_view'); ?></option>- <option value="reader"<?php echo $this->conf->view_mode === 'reader' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('reader_view'); ?></option>- <option value="global"<?php echo $this->conf->view_mode === 'global' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('global_view'); ?></option>- </select>- <label class="radio" for="radio_all">- <input type="radio" name="default_view" id="radio_all" value="all"<?php echo $this->conf->default_view === 'all' ? ' checked="checked"' : ''; ?> />- <?php echo Minz_Translate::t ('show_all_articles'); ?>- </label>- <label class="radio" for="radio_not_read">- <input type="radio" name="default_view" id="radio_not_read" value="not_read"<?php echo $this->conf->default_view === 'not_read' ? ' checked="checked"' : ''; ?> />- <?php echo Minz_Translate::t ('show_not_reads'); ?>- </label>- </div>- </div>-- <div class="form-group">- <div class="group-controls">- <label class="checkbox" for="auto_load_more">- <input type="checkbox" name="auto_load_more" id="auto_load_more" value="1"<?php echo $this->conf->auto_load_more ? ' checked="checked"' : ''; ?> />- <?php echo Minz_Translate::t ('auto_load_more'); ?>- <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript>- </label>- </div>- </div>-- <div class="form-group">- <div class="group-controls">- <label class="checkbox" for="display_posts">- <input type="checkbox" name="display_posts" id="display_posts" value="1"<?php echo $this->conf->display_posts ? ' checked="checked"' : ''; ?> />- <?php echo Minz_Translate::t ('display_articles_unfolded'); ?>- <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript>- </label>- </div>- </div>-- <div class="form-group">- <div class="group-controls">- <label class="checkbox" for="lazyload">- <input type="checkbox" name="lazyload" id="lazyload" value="1"<?php echo $this->conf->lazyload ? ' checked="checked"' : ''; ?> />- <?php echo Minz_Translate::t ('img_with_lazyload'); ?>- <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript>- </label>- </div>- </div>-- <div class="form-group">- <div class="group-controls">- <label class="checkbox" for="sticky_post">- <input type="checkbox" name="sticky_post" id="sticky_post" value="1"<?php echo $this->conf->sticky_post ? ' checked="checked"' : ''; ?> />- <?php echo Minz_Translate::t ('sticky_post'); ?>- <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript>- </label>- </div>- </div>-- <div class="form-group">- <label class="group-name"><?php echo Minz_Translate::t ('auto_read_when'); ?></label>- <div class="group-controls">- <label class="checkbox" for="check_open_article">- <input type="checkbox" name="mark_open_article" id="check_open_article" value="1"<?php echo $this->conf->mark_when['article'] ? ' checked="checked"' : ''; ?> />- <?php echo Minz_Translate::t ('article_selected'); ?>- </label>- <label class="checkbox" for="check_open_site">- <input type="checkbox" name="mark_open_site" id="check_open_site" value="1"<?php echo $this->conf->mark_when['site'] ? ' checked="checked"' : ''; ?> />- <?php echo Minz_Translate::t ('article_open_on_website'); ?>- </label>- <label class="checkbox" for="check_scroll">- <input type="checkbox" name="mark_scroll" id="check_scroll" value="1"<?php echo $this->conf->mark_when['scroll'] ? ' checked="checked"' : ''; ?> />- <?php echo Minz_Translate::t ('scroll'); ?>- </label>- <label class="checkbox" for="check_reception">- <input type="checkbox" name="mark_upon_reception" id="check_reception" value="1"<?php echo $this->conf->mark_when['reception'] ? ' checked="checked"' : ''; ?> />- <?php echo Minz_Translate::t ('upon_reception'); ?>- </label>- </div>- </div>-- <div class="form-group">- <label class="group-name"><?php echo Minz_Translate::t ('after_onread'); ?></label>- <div class="group-controls">- <label class="checkbox" for="onread_jump_next">- <input type="checkbox" name="onread_jump_next" id="onread_jump_next" value="1"<?php echo $this->conf->onread_jump_next ? ' checked="checked"' : ''; ?> />- <?php echo Minz_Translate::t ('jump_next'); ?>- </label>- </div>- </div>-- <div class="form-group form-actions">- <div class="group-controls">- <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>- <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button>- </div>- </div>-- <legend><?php echo Minz_Translate::t ('reading_icons'); ?></legend><div class="form-group">+ <label class="group-name" for="theme"><?php echo Minz_Translate::t ('article_icons'); ?></label><table><thead><tr>diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtmlnew file mode 100644index 000000000..c32c59305--- /dev/null+++ b/app/views/configure/reading.phtml@@ -0,0 +1,125 @@+<?php $this->partial ('aside_configure'); ?>++<div class="post">+ <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a>++ <form method="post" action="<?php echo _url ('configure', 'reading'); ?>">+ <legend><?php echo Minz_Translate::t ('reading_configuration'); ?></legend>++ <div class="form-group">+ <label class="group-name" for="posts_per_page"><?php echo Minz_Translate::t ('articles_per_page'); ?></label>+ <div class="group-controls">+ <input type="number" id="posts_per_page" name="posts_per_page" value="<?php echo $this->conf->posts_per_page; ?>" />+ </div>+ </div>++ <div class="form-group">+ <label class="group-name" for="sort_order"><?php echo Minz_Translate::t ('sort_order'); ?></label>+ <div class="group-controls">+ <select name="sort_order" id="sort_order">+ <option value="DESC"<?php echo $this->conf->sort_order === 'DESC' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('newer_first'); ?></option>+ <option value="ASC"<?php echo $this->conf->sort_order === 'ASC' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('older_first'); ?></option>+ </select>+ </div>+ </div>++ <div class="form-group">+ <label class="group-name" for="view_mode"><?php echo Minz_Translate::t ('default_view'); ?></label>+ <div class="group-controls">+ <select name="view_mode" id="view_mode">+ <option value="normal"<?php echo $this->conf->view_mode === 'normal' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('normal_view'); ?></option>+ <option value="reader"<?php echo $this->conf->view_mode === 'reader' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('reader_view'); ?></option>+ <option value="global"<?php echo $this->conf->view_mode === 'global' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('global_view'); ?></option>+ </select>+ <label class="radio" for="radio_all">+ <input type="radio" name="default_view" id="radio_all" value="all"<?php echo $this->conf->default_view === 'all' ? ' checked="checked"' : ''; ?> />+ <?php echo Minz_Translate::t ('show_all_articles'); ?>+ </label>+ <label class="radio" for="radio_not_read">+ <input type="radio" name="default_view" id="radio_not_read" value="not_read"<?php echo $this->conf->default_view === 'not_read' ? ' checked="checked"' : ''; ?> />+ <?php echo Minz_Translate::t ('show_not_reads'); ?>+ </label>+ </div>+ </div>++ <div class="form-group">+ <div class="group-controls">+ <label class="checkbox" for="auto_load_more">+ <input type="checkbox" name="auto_load_more" id="auto_load_more" value="1"<?php echo $this->conf->auto_load_more ? ' checked="checked"' : ''; ?> />+ <?php echo Minz_Translate::t ('auto_load_more'); ?>+ <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript>+ </label>+ </div>+ </div>++ <div class="form-group">+ <div class="group-controls">+ <label class="checkbox" for="display_posts">+ <input type="checkbox" name="display_posts" id="display_posts" value="1"<?php echo $this->conf->display_posts ? ' checked="checked"' : ''; ?> />+ <?php echo Minz_Translate::t ('display_articles_unfolded'); ?>+ <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript>+ </label>+ </div>+ </div>++ <div class="form-group">+ <div class="group-controls">+ <label class="checkbox" for="lazyload">+ <input type="checkbox" name="lazyload" id="lazyload" value="1"<?php echo $this->conf->lazyload ? ' checked="checked"' : ''; ?> />+ <?php echo Minz_Translate::t ('img_with_lazyload'); ?>+ <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript>+ </label>+ </div>+ </div>++ <div class="form-group">+ <div class="group-controls">+ <label class="checkbox" for="sticky_post">+ <input type="checkbox" name="sticky_post" id="sticky_post" value="1"<?php echo $this->conf->sticky_post ? ' checked="checked"' : ''; ?> />+ <?php echo Minz_Translate::t ('sticky_post'); ?>+ <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript>+ </label>+ </div>+ </div>++ <div class="form-group">+ <label class="group-name"><?php echo Minz_Translate::t ('auto_read_when'); ?></label>+ <div class="group-controls">+ <label class="checkbox" for="check_open_article">+ <input type="checkbox" name="mark_open_article" id="check_open_article" value="1"<?php echo $this->conf->mark_when['article'] ? ' checked="checked"' : ''; ?> />+ <?php echo Minz_Translate::t ('article_selected'); ?>+ </label>+ <label class="checkbox" for="check_open_site">+ <input type="checkbox" name="mark_open_site" id="check_open_site" value="1"<?php echo $this->conf->mark_when['site'] ? ' checked="checked"' : ''; ?> />+ <?php echo Minz_Translate::t ('article_open_on_website'); ?>+ </label>+ <label class="checkbox" for="check_scroll">+ <input type="checkbox" name="mark_scroll" id="check_scroll" value="1"<?php echo $this->conf->mark_when['scroll'] ? ' checked="checked"' : ''; ?> />+ <?php echo Minz_Translate::t ('scroll'); ?>+ </label>+ <label class="checkbox" for="check_reception">+ <input type="checkbox" name="mark_upon_reception" id="check_reception" value="1"<?php echo $this->conf->mark_when['reception'] ? ' checked="checked"' : ''; ?> />+ <?php echo Minz_Translate::t ('upon_reception'); ?>+ </label>+ </div>+ </div>++ <div class="form-group">+ <label class="group-name"><?php echo Minz_Translate::t ('after_onread'); ?></label>+ <div class="group-controls">+ <label class="checkbox" for="onread_jump_next">+ <input type="checkbox" name="onread_jump_next" id="onread_jump_next" value="1"<?php echo $this->conf->onread_jump_next ? ' checked="checked"' : ''; ?> />+ <?php echo Minz_Translate::t ('jump_next'); ?>+ </label>+ </div>+ </div>++ <div class="form-group form-actions">+ <div class="group-controls">+ <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>+ <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button>+ </div>+ </div>++ </form>+</div>diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtmlindex 748a65d17..7ba14c1d8 100644--- a/app/views/configure/shortcut.phtml+++ b/app/views/configure/shortcut.phtml@@ -12,7 +12,7 @@<?php $s = $this->conf->shortcuts; ?><form method="post" action="<?php echo _url ('configure', 'shortcut'); ?>">- <legend><?php echo Minz_Translate::t ('shortcuts_management'); ?></legend>+ <legend><?php echo Minz_Translate::t ('shortcuts'); ?></legend><noscript><p class="alert alert-error"><?php echo Minz_Translate::t ('javascript_for_shortcuts'); ?></p></noscript>