From 00776f454773d83b9c1db590f01122b24c06edbd Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Tue, 19 Dec 2017 09:35:37 +0100 Subject: PHP 7.2: Fix a warning when retrieving the list of entries (#1739) When retrieving the list of entries when the context was 'all' or 'starred', there was the following warning: > Warning: count(): Parameter must be an array or an object that implements Countable in /home/alexis/FreshRSS/app/Controllers/indexController.php on line 206 I fixed that by changing how the array is tested. --- app/Controllers/indexController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/Controllers') diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php index e8dde36fa..e3dbd4664 100755 --- a/app/Controllers/indexController.php +++ b/app/Controllers/indexController.php @@ -203,7 +203,7 @@ class FreshRSS_index_Controller extends Minz_ActionController { $entryDAO = FreshRSS_Factory::createEntryDao(); $get = FreshRSS_Context::currentGet(true); - if (count($get) > 1) { + if (is_array($get)) { $type = $get[0]; $id = $get[1]; } else { -- cgit v1.2.3 From e73fae159168b1ed9c0469e1d5bce55a3ef1f911 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Mon, 1 Jan 2018 18:53:53 +0100 Subject: Add shortcuts to switch views (#1755) --- app/Controllers/configureController.php | 2 +- app/i18n/cz/conf.php | 5 +++++ app/i18n/de/conf.php | 5 +++++ app/i18n/en/conf.php | 5 +++++ app/i18n/es/conf.php | 5 +++++ app/i18n/fr/conf.php | 5 +++++ app/i18n/he/conf.php | 5 +++++ app/i18n/it/conf.php | 5 +++++ app/i18n/kr/conf.php | 5 +++++ app/i18n/nl/conf.php | 5 +++++ app/i18n/pt-br/conf.php | 5 +++++ app/i18n/ru/conf.php | 5 +++++ app/i18n/tr/conf.php | 5 +++++ app/i18n/zh-cn/conf.php | 5 +++++ app/views/configure/shortcut.phtml | 30 ++++++++++++++++++++++++++++++ app/views/helpers/javascript_vars.phtml | 4 ++++ config-user.default.php | 4 ++++ p/scripts/main.js | 23 +++++++++++++++++++++++ 18 files changed, 127 insertions(+), 1 deletion(-) (limited to 'app/Controllers') diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 9d2ee450c..de70e475b 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -170,7 +170,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { 'm', 'n', 'o', 'p', 'page_down', 'page_up', 'q', 'r', 'return', 'right', 's', 'space', 't', 'tab', 'u', 'up', 'v', 'w', 'x', 'y', 'z', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', - 'f10', 'f11', 'f12'); + 'f10', 'f11', 'f12', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'); $this->view->list_keys = $list_keys; if (Minz_Request::isPost()) { diff --git a/app/i18n/cz/conf.php b/app/i18n/cz/conf.php index 9a4410679..8193b9575 100644 --- a/app/i18n/cz/conf.php +++ b/app/i18n/cz/conf.php @@ -148,6 +148,7 @@ return array( 'collapse_article' => 'Srolovat', 'first_article' => 'Skočit na první článek', 'focus_search' => 'Hledání', + 'global_view' => 'Switch to global view', // TODO 'help' => 'Zobrazit documentaci', 'javascript' => 'Pro použití zkratek musí být povolen JavaScript', 'last_article' => 'Skočit na poslední článek', @@ -157,13 +158,17 @@ return array( 'navigation' => 'Navigace', 'navigation_help' => 'Pomocí přepínače "Shift" fungují navigační zkratky v rámci kanálů.
Pomocí přepínače "Alt" fungují v rámci kategorií.', 'next_article' => 'Skočit na další článek', + 'normal_view' => 'Switch to normal view', // TODO 'other_action' => 'Ostatní akce', 'previous_article' => 'Skočit na předchozí článek', + 'reading_view' => 'Switch to reading view', // TODO + 'rss_view' => 'Open RSS view in a new tab', // TODO 'see_on_website' => 'Navštívit původní webovou stránku', 'shift_for_all_read' => '+ shift označí vše jako přečtené', 'title' => 'Zkratky', 'user_filter' => 'Aplikovat uživatelské filtry', 'user_filter_help' => 'Je-li nastaven pouze jeden filtr, bude použit. Další filtry jsou dostupné pomocí jejich čísla.', + 'views' => 'Views', // TODO ), 'user' => array( 'articles_and_size' => '%s článků (%s)', diff --git a/app/i18n/de/conf.php b/app/i18n/de/conf.php index ac7c08e98..86c738dd1 100644 --- a/app/i18n/de/conf.php +++ b/app/i18n/de/conf.php @@ -148,6 +148,7 @@ return array( 'collapse_article' => 'Einklappen', 'first_article' => 'Zum ersten Artikel springen', 'focus_search' => 'Auf das Suchfeld zugreifen', + 'global_view' => 'Switch to global view', // TODO 'help' => 'Dokumentation anzeigen', 'javascript' => 'JavaScript muss aktiviert sein, um Tastaturkürzel benutzen zu können', 'last_article' => 'Zum letzten Artikel springen', @@ -157,13 +158,17 @@ return array( 'navigation' => 'Navigation', 'navigation_help' => 'Mit der "Umschalttaste" finden die Tastenkombination auf Feeds Anwendung.
Mit der "Alt-Taste" finden die Tastenkombination auf Kategorien Anwendung.', 'next_article' => 'Zum nächsten Artikel springen', + 'normal_view' => 'Switch to normal view', // TODO 'other_action' => 'Andere Aktionen', 'previous_article' => 'Zum vorherigen Artikel springen', + 'reading_view' => 'Switch to reading view', // TODO + 'rss_view' => 'Open RSS view in a new tab', // TODO 'see_on_website' => 'Auf der Original-Webseite ansehen', 'shift_for_all_read' => '+ Umschalttaste, um alle Artikel als gelesen zu markieren.', 'title' => 'Tastenkombination', 'user_filter' => 'Auf Benutzerfilter zugreifen', 'user_filter_help' => 'Wenn es nur einen Benutzerfilter gibt, wird dieser verwendet. Ansonsten sind die Filter über ihre Nummer erreichbar.', + 'views' => 'Views', // TODO ), 'user' => array( 'articles_and_size' => '%s Artikel (%s)', diff --git a/app/i18n/en/conf.php b/app/i18n/en/conf.php index e4eeb74b7..5e3b723fe 100644 --- a/app/i18n/en/conf.php +++ b/app/i18n/en/conf.php @@ -148,6 +148,7 @@ return array( 'collapse_article' => 'Collapse', 'first_article' => 'Skip to the first article', 'focus_search' => 'Access search box', + 'global_view' => 'Switch to global view', 'help' => 'Display documentation', 'javascript' => 'JavaScript must be enabled in order to use shortcuts', 'last_article' => 'Skip to the last article', @@ -157,13 +158,17 @@ return array( 'navigation' => 'Navigation', 'navigation_help' => 'With the "Shift" modifier, navigation shortcuts apply on feeds.
With the "Alt" modifier, navigation shortcuts apply on categories.', 'next_article' => 'Skip to the next article', + 'normal_view' => 'Switch to normal view', 'other_action' => 'Other actions', 'previous_article' => 'Skip to the previous article', + 'reading_view' => 'Switch to reading view', + 'rss_view' => 'Open RSS view in a new tab', 'see_on_website' => 'See on original website', 'shift_for_all_read' => '+ shift to mark all articles as read', 'title' => 'Shortcuts', 'user_filter' => 'Access user filters', 'user_filter_help' => 'If there is only one user filter, it is used. Otherwise, filters are accessible by their number.', + 'views' => 'Views', ), 'user' => array( 'articles_and_size' => '%s articles (%s)', diff --git a/app/i18n/es/conf.php b/app/i18n/es/conf.php index aad5cc66d..2d9a476cb 100755 --- a/app/i18n/es/conf.php +++ b/app/i18n/es/conf.php @@ -148,6 +148,7 @@ return array( 'collapse_article' => 'Contraer', 'first_article' => 'Saltar al primer artículo', 'focus_search' => 'Acceso a la casilla de búsqueda', + 'global_view' => 'Switch to global view', // TODO 'help' => 'Mostrar documentación', 'javascript' => 'JavaScript debe estar activado para poder usar atajos de teclado', 'last_article' => 'Saltar al último artículo', @@ -157,13 +158,17 @@ return array( 'navigation' => 'Navegación', 'navigation_help' => 'Con el modificador "Mayúsculas" es posible usar los atajos de teclado en las fuentes.
Con el modificador "Alt" es posible aplicar los atajos de teclado en las categorías.', 'next_article' => 'Saltar al siguiente artículo', + 'normal_view' => 'Switch to normal view', // TODO 'other_action' => 'Otras acciones', 'previous_article' => 'Saltar al artículo anterior', + 'reading_view' => 'Switch to reading view', // TODO + 'rss_view' => 'Open RSS view in a new tab', // TODO 'see_on_website' => 'Ver en la web original', 'shift_for_all_read' => '+ mayúsculas para marcar todos los artículos como leídos', 'title' => 'Atajos de teclado', 'user_filter' => 'Acceso a filtros de usuario', 'user_filter_help' => 'Si solo hay un filtro de usuario, ese será el que se use. En caso contrario, los filtros están accesibles por su númeración.', + 'views' => 'Views', // TODO ), 'user' => array( 'articles_and_size' => '%s artículos (%s)', diff --git a/app/i18n/fr/conf.php b/app/i18n/fr/conf.php index 0c8188623..b126a77c9 100644 --- a/app/i18n/fr/conf.php +++ b/app/i18n/fr/conf.php @@ -148,6 +148,7 @@ return array( 'collapse_article' => 'Refermer', 'first_article' => 'Passer au premier article', 'focus_search' => 'Accéder à la recherche', + 'global_view' => 'Basculer vers la vue globale', 'help' => 'Afficher la documentation', 'javascript' => 'Le JavaScript doit être activé pour pouvoir profiter des raccourcis.', 'last_article' => 'Passer au dernier article', @@ -157,13 +158,17 @@ return array( 'navigation' => 'Navigation', 'navigation_help' => 'Avec le modificateur "Shift", les raccourcis de navigation s’appliquent aux flux.
Avec le modificateur "Alt", les raccourcis de navigation s’appliquent aux catégories.', 'next_article' => 'Passer à l’article suivant', + 'normal_view' => 'Basculer vers la vue normale', 'other_action' => 'Autres actions', 'previous_article' => 'Passer à l’article précédent', + 'reading_view' => 'Basculer vers la vue lecture', + 'rss_view' => 'Ouvrir le flux RSS dans un nouvel onglet', 'see_on_website' => 'Voir sur le site d’origine', 'shift_for_all_read' => '+ shift pour marquer tous les articles comme lus', 'title' => 'Raccourcis', 'user_filter' => 'Accéder aux filtres utilisateur', 'user_filter_help' => 'S’il n’y a qu’un filtre utilisateur, celui-ci est utilisé automatiquement. Sinon ils sont accessibles par leur numéro.', + 'views' => 'Vues', ), 'user' => array( 'articles_and_size' => '%s articles (%s)', diff --git a/app/i18n/he/conf.php b/app/i18n/he/conf.php index ba9985d45..0dd277d78 100644 --- a/app/i18n/he/conf.php +++ b/app/i18n/he/conf.php @@ -145,6 +145,7 @@ return array( 'collapse_article' => 'כיווץ', 'first_article' => 'דילוג למאמר הראשון', 'focus_search' => 'גישה לתיבת החיפוש', + 'global_view' => 'Switch to global view', // TODO 'help' => 'הצגת התיעוד', 'javascript' => 'חובה להפעיל JavaScript על מנת לעשות שימוש בקיצורי דרך', 'last_article' => 'דילוג למאמר האחרון', @@ -154,13 +155,17 @@ return array( 'navigation' => 'ניווט', 'navigation_help' => 'בעזרת מקש השיפט קיצורי דרך חלים על הזנות .
עם מקש האלט הם חלים על קטגוריות.', 'next_article' => 'דילוג למאמר הבא', + 'normal_view' => 'Switch to normal view', // TODO 'other_action' => 'פעולות אחרות', 'previous_article' => 'דילוג למאמר הקודם', + 'reading_view' => 'Switch to reading view', // TODO + 'rss_view' => 'Open RSS view in a new tab', // TODO 'see_on_website' => 'ראו את המקור באתר', 'shift_for_all_read' => '+ shift על מנת לסמן את כל המאמרים כנקראו', 'title' => 'קיצורי דרך', 'user_filter' => 'גישה למססנים', 'user_filter_help' => 'אם יש רק מזנן אחד הוא יהיה בשימוש. אחרת המסננים ישמשו על בסיס המספר שלהם.', + 'views' => 'Views', // TODO ), 'user' => array( 'articles_and_size' => '%s articles (%s)', // @todo diff --git a/app/i18n/it/conf.php b/app/i18n/it/conf.php index 15837ae8a..25cfbb7bf 100644 --- a/app/i18n/it/conf.php +++ b/app/i18n/it/conf.php @@ -148,6 +148,7 @@ return array( 'collapse_article' => 'Collassa articoli', 'first_article' => 'Salta al primo articolo', 'focus_search' => 'Modulo di ricerca', + 'global_view' => 'Switch to global view', // TODO 'help' => 'Mostra documentazione', 'javascript' => 'JavaScript deve essere abilitato per poter usare i comandi da tastiera', 'last_article' => 'Salta all ultimo articolo', @@ -157,13 +158,17 @@ return array( 'navigation' => 'Navigazione', 'navigation_help' => 'Con il tasto "Shift" i comandi di navigazione verranno applicati ai feeds.
Con il tasto "Alt" i comandi di navigazione verranno applicati alle categorie.', 'next_article' => 'Salta al contenuto successivo', + 'normal_view' => 'Switch to normal view', // TODO 'other_action' => 'Altre azioni', 'previous_article' => 'Salta al contenuto precedente', + 'reading_view' => 'Switch to reading view', // TODO + 'rss_view' => 'Open RSS view in a new tab', // TODO 'see_on_website' => 'Vai al sito fonte', 'shift_for_all_read' => '+ shift per segnare tutti gli articoli come letti', 'title' => 'Comandi da tastiera', 'user_filter' => 'Accedi alle ricerche personali', 'user_filter_help' => 'Se è presente una sola ricerca personale verrà usata quella, altrimenti usare anche il numero associato.', + 'views' => 'Views', // TODO ), 'user' => array( 'articles_and_size' => '%s articoli (%s)', diff --git a/app/i18n/kr/conf.php b/app/i18n/kr/conf.php index 35d412078..e36079a87 100644 --- a/app/i18n/kr/conf.php +++ b/app/i18n/kr/conf.php @@ -148,6 +148,7 @@ return array( 'collapse_article' => '접기', 'first_article' => '첫 글 보기', 'focus_search' => '검색창 사용하기', + 'global_view' => 'Switch to global view', // TODO 'help' => '도움말 보기', 'javascript' => '단축키를 사용하기 위해선 자바스크립트를 사용하도록 설정하여야 합니다', 'last_article' => '마지막 글 보기', @@ -157,13 +158,17 @@ return array( 'navigation' => '탐색', 'navigation_help' => '"Shift" 키를 누른 상태에선 탐색 단축키가 피드에 적용됩니다.
"Alt" 키를 누른 상태에선 탐색 단축키가 카테고리에 적용됩니다.', 'next_article' => '다음 글 보기', + 'normal_view' => 'Switch to normal view', // TODO 'other_action' => '다른 동작', 'previous_article' => '이전 글 보기', + 'reading_view' => 'Switch to reading view', // TODO + 'rss_view' => 'Open RSS view in a new tab', // TODO 'see_on_website' => '글이 게재된 웹사이트에서 보기', 'shift_for_all_read' => '+ shift를 누른 상태에선 모두 읽음으로 표시', 'title' => '단축키', 'user_filter' => '사용자 필터 사용하기', 'user_filter_help' => '사용자 필터가 하나만 설정되어 있다면 해당 필터를 사용하고, 그렇지 않다면 필터를 번호로 선택할 수 있습니다.', + 'views' => 'Views', // TODO ), 'user' => array( 'articles_and_size' => '%s 개의 글 (%s)', diff --git a/app/i18n/nl/conf.php b/app/i18n/nl/conf.php index e4db5ec3d..0d1d9b70d 100644 --- a/app/i18n/nl/conf.php +++ b/app/i18n/nl/conf.php @@ -148,6 +148,7 @@ return array( 'collapse_article' => 'Inklappen', 'first_article' => 'Spring naar eerste artikel', 'focus_search' => 'Toegang zoek venster', + 'global_view' => 'Switch to global view', // TODO 'help' => 'Toon documentatie', 'javascript' => 'JavaScript moet geactiveerd zijn om verwijzingen te gebruiken', 'last_article' => 'Spring naar laatste artikel', @@ -157,13 +158,17 @@ return array( 'navigation' => 'Navigatie', 'navigation_help' => 'Met de "Shift" toets, kunt u navigatie verwijzingen voor feeds gebruiken.
Met de "Alt" toets, kunt u navigatie verwijzingen voor categoriën gebruiken.', 'next_article' => 'Spring naar volgende artikel', + 'normal_view' => 'Switch to normal view', // TODO 'other_action' => 'Andere acties', 'previous_article' => 'Spring naar vorige artikel', + 'reading_view' => 'Switch to reading view', // TODO + 'rss_view' => 'Open RSS view in a new tab', // TODO 'see_on_website' => 'Bekijk op originale website', 'shift_for_all_read' => '+ shift om alle artikelen als gelezen te markeren', 'title' => 'Verwijzingen', 'user_filter' => 'Toegang gebruikers filters', 'user_filter_help' => 'Als er slechts één gebruikers filter s, dan wordt deze gebruikt. Anders zijn ze toegankelijk met hun nummer.', + 'views' => 'Views', // TODO ), 'user' => array( 'articles_and_size' => '%s artikelen (%s)', diff --git a/app/i18n/pt-br/conf.php b/app/i18n/pt-br/conf.php index 4eaf599db..a5a0a9197 100644 --- a/app/i18n/pt-br/conf.php +++ b/app/i18n/pt-br/conf.php @@ -148,6 +148,7 @@ return array( 'collapse_article' => 'Fechar', 'first_article' => 'Ir para o primeiro artigo', 'focus_search' => 'Acessar a caixa de busca', + 'global_view' => 'Switch to global view', // TODO 'help' => 'Mostrar documentação', 'javascript' => 'JavaScript deve ser habilitado para utilizar atalhos', 'last_article' => 'Ir para o último artigo', @@ -157,13 +158,17 @@ return array( 'navigation' => 'Navegação', 'navigation_help' => 'Com o modificador "Shift", atalhos de navegação aplicam aos feeds.
Com o "Alt" modificador, atalhos de navegação aplicam as categorias.', 'next_article' => 'Pule para o próximo artigo', + 'normal_view' => 'Switch to normal view', // TODO 'other_action' => 'Outras ações', 'previous_article' => 'Pule para o artigo anterior', + 'reading_view' => 'Switch to reading view', // TODO + 'rss_view' => 'Open RSS view in a new tab', // TODO 'see_on_website' => 'Visualize o site original', 'shift_for_all_read' => '+ shift para marcar todos os artigos como lido', 'title' => 'Atalhos', 'user_filter' => 'Acesse filtros de usuário', 'user_filter_help' => 'Se há apenas um filtro, ele é utilizado. Caso contrário, os filtros serão acessíveis pelos seus números.', + 'views' => 'Views', // TODO ), 'user' => array( 'articles_and_size' => '%s artigos (%s)', diff --git a/app/i18n/ru/conf.php b/app/i18n/ru/conf.php index 9c61754ae..0265ede9c 100644 --- a/app/i18n/ru/conf.php +++ b/app/i18n/ru/conf.php @@ -148,6 +148,7 @@ return array( 'collapse_article' => 'Collapse', 'first_article' => 'Skip to the first article', 'focus_search' => 'Access search box', + 'global_view' => 'Switch to global view', // TODO 'help' => 'Display documentation', 'javascript' => 'JavaScript must be enabled in order to use shortcuts', 'last_article' => 'Skip to the last article', @@ -157,13 +158,17 @@ return array( 'navigation' => 'Navigation', 'navigation_help' => 'With the "Shift" modifier, navigation shortcuts apply on feeds.
With the "Alt" modifier, navigation shortcuts apply on categories.', 'next_article' => 'Skip to the next article', + 'normal_view' => 'Switch to normal view', // TODO 'other_action' => 'Other actions', 'previous_article' => 'Skip to the previous article', + 'reading_view' => 'Switch to reading view', // TODO + 'rss_view' => 'Open RSS view in a new tab', // TODO 'see_on_website' => 'See on original website', 'shift_for_all_read' => '+ shift to mark all articles as read', 'title' => 'Shortcuts', 'user_filter' => 'Access user filters', 'user_filter_help' => 'If there is only one user filter, it is used. Else filters are accessible by their number.', + 'views' => 'Views', // TODO ), 'user' => array( 'articles_and_size' => '%s articles (%s)', diff --git a/app/i18n/tr/conf.php b/app/i18n/tr/conf.php index e4c094be2..424c030c5 100644 --- a/app/i18n/tr/conf.php +++ b/app/i18n/tr/conf.php @@ -148,6 +148,7 @@ return array( 'collapse_article' => 'Kapat', 'first_article' => 'İlk makaleyi atla', 'focus_search' => 'Arama kutusuna eriş', + 'global_view' => 'Switch to global view', // TODO 'help' => 'Dokümantasyonu göster', 'javascript' => 'Kısayolları kullanabilmek için JavaScript aktif olmalıdır', 'last_article' => 'Son makaleyi atla', @@ -157,13 +158,17 @@ return array( 'navigation' => 'Genel eylemler', 'navigation_help' => '"Shift" tuşu ile kısayollar akışlar için geçerli olur.
"Alt" tuşu ile kısayollar kategoriler için geçerli olur.', 'next_article' => 'Sonraki makaleye geç', + 'normal_view' => 'Switch to normal view', // TODO 'other_action' => 'Diğer eylemler', 'previous_article' => 'Önceki makaleye geç', + 'reading_view' => 'Switch to reading view', // TODO + 'rss_view' => 'Open RSS view in a new tab', // TODO 'see_on_website' => 'Orijinal sitede göster', 'shift_for_all_read' => '+ shift tuşu ile tüm makaleler okundu olarak işaretlenir', 'title' => 'Kısayollar', 'user_filter' => 'Kullanıcı filtrelerine eriş', 'user_filter_help' => 'Eğer tek filtre varsa o kullanılır. Yoksa filtrelerin kendi numaralarıyla kullanılır.', + 'views' => 'Views', // TODO ), 'user' => array( 'articles_and_size' => '%s makale (%s)', diff --git a/app/i18n/zh-cn/conf.php b/app/i18n/zh-cn/conf.php index 1b52ac38f..d63ff7d92 100644 --- a/app/i18n/zh-cn/conf.php +++ b/app/i18n/zh-cn/conf.php @@ -148,6 +148,7 @@ return array( 'collapse_article' => '收起文章', 'first_article' => '跳转到第一篇文章', 'focus_search' => '聚焦到搜索框', + 'global_view' => 'Switch to global view', // TODO 'help' => '显示帮助文档', 'javascript' => '若要使用快捷键,必须启用 JavaScript', 'last_article' => '跳转到最后一篇文章', @@ -157,13 +158,17 @@ return array( 'navigation' => '浏览', 'navigation_help' => '搭配 "Shift" 键,浏览快捷键将生效于 RSS 源。
搭配 "Alt" 键,浏览快捷键将生效于分类。', 'next_article' => '跳转到下一篇文章', + 'normal_view' => 'Switch to normal view', // TODO 'other_action' => '其他操作', 'previous_article' => '跳转到上一篇文章', + 'reading_view' => 'Switch to reading view', // TODO + 'rss_view' => 'Open RSS view in a new tab', // TODO 'see_on_website' => '在原网站上查看', 'shift_for_all_read' => '+ shift 可以将全部文章设为已读', 'title' => '快捷键', 'user_filter' => '显示自定义查询', 'user_filter_help' => '如果有多个自定义过滤器,则会按照它们的编号依次访问。', + 'views' => 'Views', // TODO ), 'user' => array( 'articles_and_size' => '%s 篇文章 (%s)', diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtml index dceeb17de..66db6a5d4 100644 --- a/app/views/configure/shortcut.phtml +++ b/app/views/configure/shortcut.phtml @@ -17,6 +17,36 @@ + + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+

diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 2da53b679..1b9b614d2 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -35,6 +35,10 @@ echo htmlspecialchars(json_encode(array( 'user_filter' => @$s['user_filter'], 'help' => @$s['help'], 'close_dropdown' => @$s['close_dropdown'], + 'normal_view' => @$s['normal_view'], + 'global_view' => @$s['global_view'], + 'reading_view' => @$s['reading_view'], + 'rss_view' => @$s['rss_view'], ), 'url' => array( 'index' => _url('index', 'index'), diff --git a/config-user.default.php b/config-user.default.php index 40ab49570..2e4a96239 100644 --- a/config-user.default.php +++ b/config-user.default.php @@ -56,6 +56,10 @@ return array ( 'user_filter' => 'u', 'help' => 'f1', 'close_dropdown' => 'escape', + 'normal_view' => '1', + 'global_view' => '2', + 'reading_view' => '3', + 'rss_view' => '4', ), 'topline_read' => true, 'topline_favorite' => true, diff --git a/p/scripts/main.js b/p/scripts/main.js index ce8070008..26b542179 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -704,6 +704,29 @@ function init_shortcuts() { 'disable_in_input': true }); + shortcut.add(shortcuts.normal_view, function () { + $('#nav_menu_views .view_normal').get(0).click(); + }, { + 'disable_in_input': true + }); + + shortcut.add(shortcuts.global_view, function () { + $('#nav_menu_views .view_global').get(0).click(); + }, { + 'disable_in_input': true + }); + + shortcut.add(shortcuts.reading_view, function () { + $('#nav_menu_views .view_reader').get(0).click(); + }, { + 'disable_in_input': true + }); + + shortcut.add(shortcuts.rss_view, function () { + $('#nav_menu_views .view_rss').get(0).click(); + }, { + 'disable_in_input': true + }); } function init_stream(divStream) { -- cgit v1.2.3 From 8c2113f9e6eb86b630a4e861513229d7abf219b8 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Mon, 1 Jan 2018 20:34:06 +0100 Subject: Add mute strategy configuration (#1750) --- app/Controllers/configureController.php | 7 ++---- app/Controllers/feedController.php | 15 +++++++++-- app/Controllers/subscriptionController.php | 14 ++++++++--- app/Models/CategoryDAO.php | 5 ++-- app/Models/EntryDAO.php | 40 +++++++++++++++++++++--------- app/Models/Feed.php | 23 +++++++++++------ app/Models/FeedDAO.php | 33 ++++++++++++++++-------- app/SQL/install.sql.mysql.php | 2 +- app/SQL/install.sql.pgsql.php | 2 +- app/SQL/install.sql.sqlite.php | 2 +- app/i18n/cz/sub.php | 8 +++++- app/i18n/de/sub.php | 8 +++++- app/i18n/en/sub.php | 8 +++++- app/i18n/es/sub.php | 8 +++++- app/i18n/fr/sub.php | 8 +++++- app/i18n/he/sub.php | 8 +++++- app/i18n/it/sub.php | 8 +++++- app/i18n/kr/sub.php | 8 +++++- app/i18n/nl/sub.php | 8 +++++- app/i18n/pt-br/sub.php | 8 +++++- app/i18n/ru/sub.php | 8 +++++- app/i18n/tr/sub.php | 8 +++++- app/i18n/zh-cn/sub.php | 8 +++++- app/layout/aside_feed.phtml | 2 +- app/views/helpers/feed/update.phtml | 19 ++++++++------ app/views/index/global.phtml | 2 +- app/views/subscription/index.phtml | 2 +- p/api/greader.php | 4 +-- p/themes/base-theme/template.css | 3 +++ 29 files changed, 210 insertions(+), 69 deletions(-) (limited to 'app/Controllers') diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index de70e475b..2c7739c55 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -204,16 +204,13 @@ class FreshRSS_configure_Controller extends Minz_ActionController { * The options available on that page are: * - duration to retain old article (default: 3) * - number of article to retain per feed (default: 0) - * - refresh frequency (default: -2) - * - * @todo explain why the default value is -2 but this value does not - * exist in the drop-down list + * - refresh frequency (default: 0) */ public function archivingAction() { if (Minz_Request::isPost()) { FreshRSS_Context::$user_conf->old_entries = Minz_Request::param('old_entries', 3); FreshRSS_Context::$user_conf->keep_history_default = Minz_Request::param('keep_history_default', 0); - FreshRSS_Context::$user_conf->ttl_default = Minz_Request::param('ttl_default', -2); + FreshRSS_Context::$user_conf->ttl_default = Minz_Request::param('ttl_default', FreshRSS_Feed::TTL_DEFAULT); FreshRSS_Context::$user_conf->save(); invalidateHttpCache(); diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index fff20f798..2793577d5 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -24,6 +24,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { Minz_Error::error(403); } } + $this->updateTTL(); } /** @@ -282,11 +283,11 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $mtime = 0; $ttl = $feed->ttl(); - if ($ttl == -1) { + if ($ttl < FreshRSS_Feed::TTL_DEFAULT) { continue; //Feed refresh is disabled } if ((!$simplePiePush) && (!$feed_id) && - ($feed->lastUpdate() + 10 >= time() - ($ttl == -2 ? FreshRSS_Context::$user_conf->ttl_default : $ttl))) { + ($feed->lastUpdate() + 10 >= time() - ($ttl == FreshRSS_Feed::TTL_DEFAULT ? FreshRSS_Context::$user_conf->ttl_default : $ttl))) { //Too early to refresh from source, but check whether the feed was updated by another user $mtime = $feed->cacheModifiedTime(); if ($feed->lastUpdate() + 10 >= $mtime) { @@ -639,4 +640,14 @@ class FreshRSS_feed_Controller extends Minz_ActionController { Minz_Request::bad(_t('feedback.sub.feed.error'), $redirect_url); } } + + /** + * This method update TTL values for feeds if needed. + * It changes the old default value (-2) to the new default value (0). + * It changes the old disabled value (-1) to the default disabled value. + */ + private function updateTTL() { + $feedDAO = FreshRSS_Factory::createFeedDao(); + $feedDAO->updateTTL(); + } } diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php index 6af048b84..b3f3df46e 100644 --- a/app/Controllers/subscriptionController.php +++ b/app/Controllers/subscriptionController.php @@ -15,8 +15,10 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { } $catDAO = new FreshRSS_CategoryDAO(); + $feedDAO = new FreshRSS_FeedDAO(); $catDAO->checkDefault(); + $feedDAO->updateTTL(); $this->view->categories = $catDAO->listCategories(false); $this->view->default_category = $catDAO->getDefault(); } @@ -55,7 +57,7 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { * - display in main stream (default: 0) * - HTTP authentication * - number of article to retain (default: -2) - * - refresh frequency (default: -2) + * - refresh frequency (default: 0) * Default values are empty strings unless specified. */ public function feedAction() { @@ -87,6 +89,12 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { $cat = intval(Minz_Request::param('category', 0)); + $mute = Minz_Request::param('mute', false); + $ttl = intval(Minz_Request::param('ttl', FreshRSS_Feed::TTL_DEFAULT)); + if ($mute && FreshRSS_Feed::TTL_DEFAULT === $ttl) { + $ttl = FreshRSS_Context::$user_conf->ttl_default; + } + $values = array( 'name' => Minz_Request::param('name', ''), 'description' => sanitizeHTML(Minz_Request::param('description', '', true)), @@ -94,10 +102,10 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { 'url' => checkUrl(Minz_Request::param('url', '')), 'category' => $cat, 'pathEntries' => Minz_Request::param('path_entries', ''), - 'priority' => intval(Minz_Request::param('priority', 0)), + 'priority' => intval(Minz_Request::param('priority', FreshRSS_Feed::PRIORITY_MAIN_STREAM)), 'httpAuth' => $httpAuth, 'keep_history' => intval(Minz_Request::param('keep_history', -2)), - 'ttl' => intval(Minz_Request::param('ttl', -2)), + 'ttl' => $ttl * ($mute ? -1 : 1), ); invalidateHttpCache(); diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php index f219c275f..68db17db3 100644 --- a/app/Models/CategoryDAO.php +++ b/app/Models/CategoryDAO.php @@ -106,13 +106,14 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo implements FreshRSS_Searchable public function listCategories($prePopulateFeeds = true, $details = false) { if ($prePopulateFeeds) { $sql = 'SELECT c.id AS c_id, c.name AS c_name, ' - . ($details ? 'f.* ' : 'f.id, f.name, f.url, f.website, f.priority, f.error, f.`cache_nbEntries`, f.`cache_nbUnreads` ') + . ($details ? 'f.* ' : 'f.id, f.name, f.url, f.website, f.priority, f.error, f.`cache_nbEntries`, f.`cache_nbUnreads`, f.ttl ') . 'FROM `' . $this->prefix . 'category` c ' . 'LEFT OUTER JOIN `' . $this->prefix . 'feed` f ON f.category=c.id ' + . 'WHERE f.priority >= :priority_normal ' . 'GROUP BY f.id, c_id ' . 'ORDER BY c.name, f.name'; $stm = $this->bd->prepare($sql); - $stm->execute(); + $stm->execute(array(':priority_normal' => FreshRSS_Feed::PRIORITY_NORMAL)); return self::daoToCategoryPrepopulated($stm->fetchAll(PDO::FETCH_ASSOC)); } else { $sql = 'SELECT * FROM `' . $this->prefix . 'category` ORDER BY name'; diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index e8b6dcdae..9e291f4ed 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -726,23 +726,23 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo implements FreshRSS_Searchable { $values = array(); switch ($type) { case 'a': - $where .= 'f.priority > 0 '; - $joinFeed = true; + $where .= 'f.priority > ' . FreshRSS_Feed::PRIORITY_NORMAL . ' '; break; case 's': //Deprecated: use $state instead - $where .= 'e.is_favorite=1 '; + $where .= 'f.priority >= ' . FreshRSS_Feed::PRIORITY_NORMAL . ' '; + $where .= 'AND e.is_favorite=1 '; break; case 'c': - $where .= 'f.category=? '; + $where .= 'f.priority >= ' . FreshRSS_Feed::PRIORITY_NORMAL . ' '; + $where .= 'AND f.category=? '; $values[] = intval($id); - $joinFeed = true; break; case 'f': $where .= 'e.id_feed=? '; $values[] = intval($id); break; case 'A': - $where .= '1=1 '; + $where .= 'f.priority >= ' . FreshRSS_Feed::PRIORITY_NORMAL . ' '; break; default: throw new FreshRSS_EntriesGetter_Exception('Bad type in Entry->listByType: [' . $type . ']!'); @@ -752,7 +752,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo implements FreshRSS_Searchable { return array(array_merge($values, $searchValues), 'SELECT e.id FROM `' . $this->prefix . 'entry` e ' - . ($joinFeed ? 'INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id ' : '') + . 'INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id ' . 'WHERE ' . $where . $search . 'ORDER BY e.id ' . $order @@ -873,12 +873,28 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo implements FreshRSS_Searchable { } public function countUnreadReadFavorites() { - $sql = 'SELECT c FROM (' - . 'SELECT COUNT(id) AS c, 1 as o FROM `' . $this->prefix . 'entry` WHERE is_favorite=1 ' - . 'UNION SELECT COUNT(id) AS c, 2 AS o FROM `' . $this->prefix . 'entry` WHERE is_favorite=1 AND is_read=0' - . ') u ORDER BY o'; + $sql = <<prefix}entry` AS e1 + JOIN `{$this->prefix}feed` AS f1 ON e1.id_feed = f1.id + WHERE e1.is_favorite = 1 + AND f1.priority >= :priority_normal + UNION + SELECT COUNT(e2.id) AS c + , 2 AS o + FROM `{$this->prefix}entry` AS e2 + JOIN `{$this->prefix}feed` AS f2 ON e2.id_feed = f2.id + WHERE e2.is_favorite = 1 + AND e2.is_read = 0 + AND f2.priority >= :priority_normal + ) u +ORDER BY o +SQL; $stm = $this->bd->prepare($sql); - $stm->execute(); + $stm->execute(array(':priority_normal' => FreshRSS_Feed::PRIORITY_NORMAL)); $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); $all = empty($res[0]) ? 0 : $res[0]; $unread = empty($res[1]) ? 0 : $res[1]; diff --git a/app/Models/Feed.php b/app/Models/Feed.php index 560f7415d..216a26d44 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -1,6 +1,12 @@ ttl; } + public function mute() { + return $this->mute; + } // public function ttlExpire() { // $ttl = $this->ttl; - // if ($ttl == -2) { //Default + // if ($ttl == self::TTL_DEFAULT) { //Default // $ttl = FreshRSS_Context::$user_conf->ttl_default; // } // if ($ttl == -1) { //Never @@ -198,8 +208,7 @@ class FreshRSS_Feed extends Minz_Model { $this->lastUpdate = $value; } public function _priority($value) { - $value = intval($value); - $this->priority = $value >= 0 ? $value : 10; + $this->priority = intval($value); } public function _pathEntries($value) { $this->pathEntries = $value; @@ -219,8 +228,8 @@ class FreshRSS_Feed extends Minz_Model { public function _ttl($value) { $value = intval($value); $value = min($value, 100000000); - $value = max($value, -2); - $this->ttl = $value; + $this->ttl = abs($value); + $this->mute = $value < self::TTL_DEFAULT; } public function _nbNotRead($value) { $this->nbNotRead = intval($value); diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php index 0de6d98be..deda02c63 100644 --- a/app/Models/FeedDAO.php +++ b/app/Models/FeedDAO.php @@ -18,7 +18,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo implements FreshRSS_Searchable { ttl ) VALUES - (?, ?, ?, ?, ?, ?, 10, ?, 0, -2, -2)'; + (?, ?, ?, ?, ?, ?, 10, ?, 0, -2, ?)'; $stm = $this->bd->prepare($sql); $valuesTmp['url'] = safe_ascii($valuesTmp['url']); @@ -32,6 +32,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo implements FreshRSS_Searchable { substr($valuesTmp['description'], 0, 1023), $valuesTmp['lastUpdate'], base64_encode($valuesTmp['httpAuth']), + FreshRSS_Feed::TTL_DEFAULT, ); if ($stm && $stm->execute($values)) { @@ -249,18 +250,14 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo implements FreshRSS_Searchable { * Use $defaultCacheDuration == -1 to return all feeds, without filtering them by TTL. */ public function listFeedsOrderUpdate($defaultCacheDuration = 3600) { + $this->updateTTL(); $sql = 'SELECT id, url, name, website, `lastUpdate`, `pathEntries`, `httpAuth`, keep_history, ttl ' . 'FROM `' . $this->prefix . 'feed` ' - . ($defaultCacheDuration < 0 ? '' : 'WHERE ttl <> -1 AND `lastUpdate` < (' . (time() + 60) . '-(CASE WHEN ttl=-2 THEN ' . intval($defaultCacheDuration) . ' ELSE ttl END)) ') + . ($defaultCacheDuration < 0 ? '' : 'WHERE ttl >= ' . FreshRSS_Feed::TTL_DEFAULT + . ' AND `lastUpdate` < (' . (time() + 60) . '-(CASE WHEN ttl=' . FreshRSS_Feed::TTL_DEFAULT . ' THEN ' . intval($defaultCacheDuration) . ' ELSE ttl END)) ') . 'ORDER BY `lastUpdate`'; $stm = $this->bd->prepare($sql); - if (!($stm && $stm->execute())) { - $sql2 = 'ALTER TABLE `' . $this->prefix . 'feed` ADD COLUMN ttl INT NOT NULL DEFAULT -2'; //v0.7.3 - $stm = $this->bd->prepare($sql2); - $stm->execute(); - $stm = $this->bd->prepare($sql); - $stm->execute(); - } + $stm->execute(); return self::daoToFeed($stm->fetchAll(PDO::FETCH_ASSOC)); } @@ -410,7 +407,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo implements FreshRSS_Searchable { $myFeed->_httpAuth(isset($dao['httpAuth']) ? base64_decode($dao['httpAuth']) : ''); $myFeed->_error(isset($dao['error']) ? $dao['error'] : 0); $myFeed->_keepHistory(isset($dao['keep_history']) ? $dao['keep_history'] : -2); - $myFeed->_ttl(isset($dao['ttl']) ? $dao['ttl'] : -2); + $myFeed->_ttl(isset($dao['ttl']) ? $dao['ttl'] : FreshRSS_Feed::TTL_DEFAULT); $myFeed->_nbNotRead(isset($dao['cache_nbUnreads']) ? $dao['cache_nbUnreads'] : 0); $myFeed->_nbEntries(isset($dao['cache_nbEntries']) ? $dao['cache_nbEntries'] : 0); if (isset($dao['id'])) { @@ -421,4 +418,20 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo implements FreshRSS_Searchable { return $list; } + + public function updateTTL() { + $sql = <<prefix}feed` + SET ttl = :new_value + WHERE ttl = :old_value +SQL; + $stm = $this->bd->prepare($sql); + if (!($stm && $stm->execute(array(':new_value' => FreshRSS_Feed::TTL_DEFAULT, ':old_value' => -2)))) { + $sql2 = 'ALTER TABLE `' . $this->prefix . 'feed` ADD COLUMN ttl INT NOT NULL DEFAULT ' . FreshRSS_Feed::TTL_DEFAULT; //v0.7.3 + $stm = $this->bd->prepare($sql2); + $stm->execute(); + } else { + $stm->execute(array(':new_value' => -3600, ':old_value' => -1)); + } + } } diff --git a/app/SQL/install.sql.mysql.php b/app/SQL/install.sql.mysql.php index 09defd452..b94a24298 100644 --- a/app/SQL/install.sql.mysql.php +++ b/app/SQL/install.sql.mysql.php @@ -23,7 +23,7 @@ CREATE TABLE IF NOT EXISTS `%1$sfeed` ( `httpAuth` varchar(511) DEFAULT NULL, `error` boolean DEFAULT 0, `keep_history` MEDIUMINT NOT NULL DEFAULT -2, -- v0.7 - `ttl` INT NOT NULL DEFAULT -2, -- v0.7.3 + `ttl` INT NOT NULL DEFAULT 0, -- v0.7.3 `cache_nbEntries` int DEFAULT 0, -- v0.7 `cache_nbUnreads` int DEFAULT 0, -- v0.7 PRIMARY KEY (`id`), diff --git a/app/SQL/install.sql.pgsql.php b/app/SQL/install.sql.pgsql.php index 4cfeb2517..23afdb783 100644 --- a/app/SQL/install.sql.pgsql.php +++ b/app/SQL/install.sql.pgsql.php @@ -21,7 +21,7 @@ $SQL_CREATE_TABLES = array( "httpAuth" VARCHAR(511) DEFAULT NULL, "error" smallint DEFAULT 0, "keep_history" INT NOT NULL DEFAULT -2, - "ttl" INT NOT NULL DEFAULT -2, + "ttl" INT NOT NULL DEFAULT 0, "cache_nbEntries" INT DEFAULT 0, "cache_nbUnreads" INT DEFAULT 0, FOREIGN KEY ("category") REFERENCES "%1$scategory" ("id") ON DELETE SET NULL ON UPDATE CASCADE diff --git a/app/SQL/install.sql.sqlite.php b/app/SQL/install.sql.sqlite.php index d485e2120..d8e670bc8 100644 --- a/app/SQL/install.sql.sqlite.php +++ b/app/SQL/install.sql.sqlite.php @@ -20,7 +20,7 @@ $SQL_CREATE_TABLES = array( `httpAuth` varchar(511) DEFAULT NULL, `error` boolean DEFAULT 0, `keep_history` MEDIUMINT NOT NULL DEFAULT -2, - `ttl` INT NOT NULL DEFAULT -2, + `ttl` INT NOT NULL DEFAULT 0, `cache_nbEntries` int DEFAULT 0, `cache_nbUnreads` int DEFAULT 0, FOREIGN KEY (`category`) REFERENCES `category`(`id`) ON DELETE SET NULL ON UPDATE CASCADE, diff --git a/app/i18n/cz/sub.php b/app/i18n/cz/sub.php index 807c249d3..ec77be317 100644 --- a/app/i18n/cz/sub.php +++ b/app/i18n/cz/sub.php @@ -32,12 +32,18 @@ return array( 'description' => 'Popis', 'empty' => 'Kanál je prázdný. Ověřte prosím zda je ještě autorem udržován.', 'error' => 'Vyskytl se problém s kanálem. Ověřte že je vždy dostupný, prosím, a poté jej aktualizujte.', - 'in_main_stream' => 'Zobrazit ve “Všechny kanály”', 'informations' => 'Informace', 'keep_history' => 'Zachovat tento minimální počet článků', 'moved_category_deleted' => 'Po smazání kategorie budou v ní obsažené kanály automaticky přesunuty do %s.', + 'mute' => 'mute', // TODO 'no_selected' => 'Nejsou označeny žádné kanály.', 'number_entries' => '%d článků', + 'priority' => array( + '_' => 'Visibility', // TODO + 'archived' => 'Do not show (archived)', // TODO + 'main_stream' => 'Zobrazit ve “Všechny kanály”', + 'normal' => 'Show in its category', // TODO + ), 'stats' => 'Statistika', 'think_to_add' => 'Můžete přidat kanály.', 'title' => 'Název', diff --git a/app/i18n/de/sub.php b/app/i18n/de/sub.php index 4ffef4302..6d41d0e5a 100644 --- a/app/i18n/de/sub.php +++ b/app/i18n/de/sub.php @@ -32,12 +32,18 @@ return array( 'description' => 'Beschreibung', 'empty' => 'Dieser Feed ist leer. Bitte stellen Sie sicher, dass er noch gepflegt wird.', 'error' => 'Dieser Feed ist auf ein Problem gestoßen. Bitte stellen Sie sicher, dass er immer lesbar ist und aktualisieren Sie ihn dann.', - 'in_main_stream' => 'In Haupt-Feeds zeigen', 'informations' => 'Information', 'keep_history' => 'Minimale Anzahl an Artikeln, die behalten wird', 'moved_category_deleted' => 'Wenn Sie eine Kategorie entfernen, werden deren Feeds automatisch in die Kategorie %s eingefügt.', + 'mute' => 'mute', // TODO 'no_selected' => 'Kein Feed ausgewählt.', 'number_entries' => '%d Artikel', + 'priority' => array( + '_' => 'Visibility', // TODO + 'archived' => 'Do not show (archived)', // TODO + 'main_stream' => 'In Haupt-Feeds zeigen', + 'normal' => 'Show in its category', // TODO + ), 'stats' => 'Statistiken', 'think_to_add' => 'Sie können Feeds hinzufügen.', 'title' => 'Titel', diff --git a/app/i18n/en/sub.php b/app/i18n/en/sub.php index 47b15ae7a..b9bae7955 100644 --- a/app/i18n/en/sub.php +++ b/app/i18n/en/sub.php @@ -32,12 +32,18 @@ return array( 'description' => 'Description', 'empty' => 'This feed is empty. Please verify that it is still maintained.', 'error' => 'This feed has encountered a problem. Please verify that it is always reachable then update it.', - 'in_main_stream' => 'Show in main stream', 'informations' => 'Information', 'keep_history' => 'Minimum number of articles to keep', 'moved_category_deleted' => 'When you delete a category, its feeds are automatically classified under %s.', + 'mute' => 'mute', 'no_selected' => 'No feed selected.', 'number_entries' => '%d articles', + 'priority' => array( + '_' => 'Visibility', + 'archived' => 'Do not show (archived)', + 'main_stream' => 'Show in main stream', + 'normal' => 'Show in its category', + ), 'stats' => 'Statistics', 'think_to_add' => 'You may add some feeds.', 'title' => 'Title', diff --git a/app/i18n/es/sub.php b/app/i18n/es/sub.php index 72eb06eb7..091c1e3e3 100755 --- a/app/i18n/es/sub.php +++ b/app/i18n/es/sub.php @@ -27,12 +27,18 @@ return array( 'description' => 'Descripción', 'empty' => 'La fuente está vacía. Por favor, verifica que siga activa.', 'error' => 'Hay un problema con esta fuente. Por favor, veritica que esté disponible y prueba de nuevo.', - 'in_main_stream' => 'Mostrar en salida principal', 'informations' => 'Información', 'keep_history' => 'Número mínimo de artículos a conservar', 'moved_category_deleted' => 'Al borrar una categoría todas sus fuentes pasan automáticamente a la categoría %s.', + 'mute' => 'mute', // TODO 'no_selected' => 'No hay funentes seleccionadas.', 'number_entries' => '%d artículos', + 'priority' => array( + '_' => 'Visibility', // TODO + 'archived' => 'Do not show (archived)', // TODO + 'main_stream' => 'Mostrar en salida principal', + 'normal' => 'Show in its category', // TODO + ), 'stats' => 'Estadísticas', 'think_to_add' => 'Puedes añadir fuentes.', 'title' => 'Título', diff --git a/app/i18n/fr/sub.php b/app/i18n/fr/sub.php index 607863c8f..04be55aa5 100644 --- a/app/i18n/fr/sub.php +++ b/app/i18n/fr/sub.php @@ -32,12 +32,18 @@ return array( 'description' => 'Description', 'empty' => 'Ce flux est vide. Veuillez vérifier qu’il est toujours maintenu.', 'error' => 'Ce flux a rencontré un problème. Veuillez vérifier qu’il est toujours accessible puis actualisez-le.', - 'in_main_stream' => 'Afficher dans le flux principal', 'informations' => 'Informations', 'keep_history' => 'Nombre minimum d’articles à conserver', 'moved_category_deleted' => 'Lors de la suppression d’une catégorie, ses flux seront automatiquement classés dans %s.', + 'mute' => 'muet', 'no_selected' => 'Aucun flux sélectionné.', 'number_entries' => '%d articles', + 'priority' => array( + '_' => 'Visibilité', + 'archived' => 'Ne pas afficher (archivé)', + 'main_stream' => 'Afficher dans le flux principal', + 'normal' => 'Afficher dans sa catégorie', + ), 'stats' => 'Statistiques', 'think_to_add' => 'Vous pouvez ajouter des flux.', 'title' => 'Titre', diff --git a/app/i18n/he/sub.php b/app/i18n/he/sub.php index 333de0edf..849a1d5bd 100644 --- a/app/i18n/he/sub.php +++ b/app/i18n/he/sub.php @@ -32,12 +32,18 @@ return array( 'description' => 'תיאור', 'empty' => 'הזנה זו ריקה. אנא ודאו שהיא עדיין מתוחזקת.', 'error' => 'הזנה זו נתקלה בשגיאה, אנא ודאו שהיא תקינה ואז נסו שנית.', - 'in_main_stream' => 'הצגה בזרם המרכזי', 'informations' => 'מידע', 'keep_history' => 'מסםר מינימלי של מאמרים לשמור', 'moved_category_deleted' => 'כאשר הקטגוריה נמחקת ההזנות שבתוכה אוטומטית מקוטלגות תחת %s.', + 'mute' => 'mute', // TODO 'no_selected' => 'אף הזנה לא נבחרה.', 'number_entries' => '%d מאמרים', + 'priority' => array( + '_' => 'Visibility', // TODO + 'archived' => 'Do not show (archived)', // TODO + 'main_stream' => 'הצגה בזרם המרכזי', + 'normal' => 'Show in its category', // TODO + ), 'stats' => 'סטטיסטיקות', 'think_to_add' => 'ניתן להוסיף הזנות חדשות.', 'title' => 'כותרת', diff --git a/app/i18n/it/sub.php b/app/i18n/it/sub.php index fe18855fb..698e64481 100644 --- a/app/i18n/it/sub.php +++ b/app/i18n/it/sub.php @@ -32,12 +32,18 @@ return array( 'description' => 'Descrizione', 'empty' => 'Questo feed non contiene articoli. Per favore verifica il sito direttamente.', 'error' => 'Questo feed ha generato un errore. Per favore verifica se ancora disponibile.', - 'in_main_stream' => 'Mostra in homepage', 'informations' => 'Informazioni', 'keep_history' => 'Numero minimo di articoli da mantenere', 'moved_category_deleted' => 'Cancellando una categoria i feed al suo interno verranno classificati automaticamente come %s.', + 'mute' => 'mute', // TODO 'no_selected' => 'Nessun feed selezionato.', 'number_entries' => '%d articoli', + 'priority' => array( + '_' => 'Visibility', // TODO + 'archived' => 'Do not show (archived)', // TODO + 'main_stream' => 'Mostra in homepage', // TODO + 'normal' => 'Show in its category', // TODO + ), 'stats' => 'Statistiche', 'think_to_add' => 'Aggiungi feed.', 'title' => 'Titolo', diff --git a/app/i18n/kr/sub.php b/app/i18n/kr/sub.php index b8f2385b3..d290dd635 100644 --- a/app/i18n/kr/sub.php +++ b/app/i18n/kr/sub.php @@ -32,12 +32,18 @@ return array( 'description' => '설명', 'empty' => '이 피드는 비어있습니다. 피드가 계속 운영되고 있는지 확인하세요.', 'error' => '이 피드에 문제가 발생했습니다. 이 피드에 접근 권한이 있는지 확인하세요.', - 'in_main_stream' => '메인 스트림에 표시하기', 'informations' => '정보', 'keep_history' => '최소 유지 글 개수', 'moved_category_deleted' => '카테고리를 삭제하면, 해당 카테고리 아래에 있던 피드들은 자동적으로 %s 아래로 분류됩니다.', + 'mute' => 'mute', // TODO 'no_selected' => '선택된 피드가 없습니다.', 'number_entries' => '%d 개의 글', + 'priority' => array( + '_' => 'Visibility', // TODO + 'archived' => 'Do not show (archived)', // TODO + 'main_stream' => '메인 스트림에 표시하기', // TODO + 'normal' => 'Show in its category', // TODO + ), 'stats' => '통계', 'think_to_add' => '피드를 추가할 수 있습니다.', 'title' => '제목', diff --git a/app/i18n/nl/sub.php b/app/i18n/nl/sub.php index ce446778c..4b699d894 100644 --- a/app/i18n/nl/sub.php +++ b/app/i18n/nl/sub.php @@ -32,12 +32,18 @@ return array( 'description' => 'Omschrijving', 'empty' => 'Deze feed is leeg. Controleer of deze nog actueel is.', 'error' => 'Deze feed heeft problemen. Verifieer a.u.b het doeladres en actualiseer het.', - 'in_main_stream' => 'Zichtbaar in het overzicht', 'informations' => 'Informatie', 'keep_history' => 'Minimum aantal artikelen om te houden', 'moved_category_deleted' => 'Als u een categorie verwijderd, worden de feeds automatisch geclassificeerd onder %s.', + 'mute' => 'mute', // TODO 'no_selected' => 'Geen feed geselecteerd.', 'number_entries' => '%d artikelen', + 'priority' => array( + '_' => 'Visibility', // TODO + 'archived' => 'Do not show (archived)', // TODO + 'main_stream' => 'Zichtbaar in het overzicht', + 'normal' => 'Show in its category', // TODO + ), 'pubsubhubbub' => 'Directe notificaties met PubSubHubbub', 'stats' => 'Statistieken', 'think_to_add' => 'Voeg wat feeds toe.', diff --git a/app/i18n/pt-br/sub.php b/app/i18n/pt-br/sub.php index 4249dcabf..09dde718f 100644 --- a/app/i18n/pt-br/sub.php +++ b/app/i18n/pt-br/sub.php @@ -32,12 +32,18 @@ return array( 'description' => 'Descrição', 'empty' => 'Este feed está vazio. Por favor verifique ele ainda é mantido.', 'error' => 'Este feed encontra-se com problema. Por favor verifique se ele ainda está disponível e atualize-o.', - 'in_main_stream' => 'Mostrar na tela principal', 'informations' => 'Informações', 'keep_history' => 'Número mínimo de artigos para manter', 'moved_category_deleted' => 'Quando você deleta uma categoria, seus feeds são automaticamente classificados como %s.', + 'mute' => 'mute', // TODO 'no_selected' => 'Nenhum feed selecionado.', 'number_entries' => '%d artigos', + 'priority' => array( + '_' => 'Visibility', // TODO + 'archived' => 'Do not show (archived)', // TODO + 'main_stream' => 'Mostrar na tela principal', + 'normal' => 'Show in its category', // TODO + ), 'stats' => 'Estatísticas', 'think_to_add' => 'Você deve adicionar alguns feeds.', 'title' => 'Título', diff --git a/app/i18n/ru/sub.php b/app/i18n/ru/sub.php index 6a5530de0..9e360630a 100644 --- a/app/i18n/ru/sub.php +++ b/app/i18n/ru/sub.php @@ -32,12 +32,18 @@ return array( 'description' => 'Description',// TODO 'empty' => 'This feed is empty. Please verify that it is still maintained.',// TODO 'error' => 'This feed has encountered a problem. Please verify that it is always reachable then actualize it.',// TODO - 'in_main_stream' => 'Show in main stream',// TODO 'informations' => 'Information',// TODO 'keep_history' => 'Minimum number of articles to keep',// TODO 'moved_category_deleted' => 'When you delete a category, its feeds are automatically classified under %s.',// TODO + 'mute' => 'mute', // TODO 'no_selected' => 'No feed selected.',// TODO 'number_entries' => '%d articles',// TODO + 'priority' => array( + '_' => 'Visibility', // TODO + 'archived' => 'Do not show (archived)', // TODO + 'main_stream' => 'Show in main stream', // TODO + 'normal' => 'Show in its category', // TODO + ), 'stats' => 'Statistics',// TODO 'think_to_add' => 'You may add some feeds.',// TODO 'title' => 'Title',// TODO diff --git a/app/i18n/tr/sub.php b/app/i18n/tr/sub.php index 0bbaeec5b..871731158 100644 --- a/app/i18n/tr/sub.php +++ b/app/i18n/tr/sub.php @@ -32,12 +32,18 @@ return array( 'description' => 'Tanım', 'empty' => 'Bu akış boş. Lütfen akışın aktif olduğuna emin olun.', 'error' => 'Bu akışda bir hatayla karşılaşıldı. Lütfen akışın sürekli ulaşılabilir olduğuna emin olun.', - 'in_main_stream' => 'Ana akışda göster', 'informations' => 'Bilgi', 'keep_history' => 'En az tutulacak makale sayısı', 'moved_category_deleted' => 'Bir kategoriyi silerseniz, içerisindeki akışlar %s içerisine yerleşir.', + 'mute' => 'mute', // TODO 'no_selected' => 'Hiçbir akış seçilmedi.', 'number_entries' => '%d makale', + 'priority' => array( + '_' => 'Visibility', // TODO + 'archived' => 'Do not show (archived)', // TODO + 'main_stream' => 'Ana akışda göster', + 'normal' => 'Show in its category', // TODO + ), 'stats' => 'İstatistikler', 'think_to_add' => 'Akış ekleyebilirsiniz.', 'title' => 'Başlık', diff --git a/app/i18n/zh-cn/sub.php b/app/i18n/zh-cn/sub.php index 026f436d7..c25875b41 100644 --- a/app/i18n/zh-cn/sub.php +++ b/app/i18n/zh-cn/sub.php @@ -32,12 +32,18 @@ return array( 'description' => '描述', 'empty' => '此源为空。请确认它是否正常更新。', 'error' => '此源遇到一些问题。请在确认是否能正常访问后重试。', - 'in_main_stream' => '在首页中显示', 'informations' => '信息', 'keep_history' => '至少保存的文章数', 'moved_category_deleted' => '删除分类时,其中的 RSS 源会自动归类到 %s', + 'mute' => 'mute', // TODO 'no_selected' => '未选择 RSS 源。', 'number_entries' => '%d 篇文章', + 'priority' => array( + '_' => 'Visibility', // TODO + 'archived' => 'Do not show (archived)', // TODO + 'main_stream' => '在首页中显示', + 'normal' => 'Show in its category', // TODO + ), 'stats' => '统计', 'think_to_add' => '你可以添加一些 RSS 源。', 'title' => '标题', diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml index 3e1ee44dd..97c0fb0d9 100644 --- a/app/layout/aside_feed.phtml +++ b/app/layout/aside_feed.phtml @@ -53,7 +53,7 @@ foreach ($feeds as $feed) { $f_active = FreshRSS_Context::isCurrentGet('f_' . $feed->id()); ?> -
  • +
  • - +
    - +
    @@ -111,11 +112,11 @@
    +
    diff --git a/app/views/index/global.phtml b/app/views/index/global.phtml index f35732c8f..2f25b6dc2 100644 --- a/app/views/index/global.phtml +++ b/app/views/index/global.phtml @@ -37,7 +37,7 @@ $empty = $feed->nbEntries() === 0 ? ' empty' : ''; $url_base['params']['get'] = 'f_' . $feed->id(); ?> -
  • +
  • ✇ name(); ?>
  • diff --git a/app/views/subscription/index.phtml b/app/views/subscription/index.phtml index 48f760d3e..26af0bd7c 100644 --- a/app/views/subscription/index.phtml +++ b/app/views/subscription/index.phtml @@ -125,7 +125,7 @@ $error = $feed->inError() ? ' error' : ''; $empty = $feed->nbEntries() == 0 ? ' empty' : ''; ?> -
  • diff --git a/p/api/greader.php b/p/api/greader.php index 99304f4ec..72f886190 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -261,8 +261,8 @@ function subscriptionList() { $pdo = new MyPDO(); $stm = $pdo->prepare('SELECT f.id, f.name, f.url, f.website, c.id as c_id, c.name as c_name FROM `%_feed` f - INNER JOIN `%_category` c ON c.id = f.category'); - $stm->execute(); + INNER JOIN `%_category` c ON c.id = f.category AND f.priority >= :priority_normal'); + $stm->execute(array(':priority_normal' => FreshRSS_Feed::PRIORITY_NORMAL)); $res = $stm->fetchAll(PDO::FETCH_ASSOC); $salt = FreshRSS_Context::$system_conf->salt; diff --git a/p/themes/base-theme/template.css b/p/themes/base-theme/template.css index e5e1bca05..72487ca17 100644 --- a/p/themes/base-theme/template.css +++ b/p/themes/base-theme/template.css @@ -71,6 +71,9 @@ img.favicon { width: 16px; vertical-align: middle; } +.feed.mute::before { + content: '🔇'; +} /*=== Videos */ iframe, embed, object, video { -- cgit v1.2.3 From 7642d334f827d1c077bb1444dfc4e79acf022891 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Tue, 2 Jan 2018 23:53:35 +0100 Subject: Replace "keep history" magic value by a constant (#1759) I think the use of a magic value repeated many times in the code is prone to have some errors made by people not knowing its meaning. Using a constant is a bit more safe. Judging by some comments in the code, I am not the only one. --- app/Controllers/entryController.php | 4 +--- app/Controllers/feedController.php | 6 ++---- app/Controllers/subscriptionController.php | 2 +- app/Models/ConfigurationSetter.php | 4 ++-- app/Models/Feed.php | 7 +++++-- app/Models/FeedDAO.php | 5 +++-- app/views/configure/archiving.phtml | 4 ++-- app/views/helpers/feed/update.phtml | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) (limited to 'app/Controllers') diff --git a/app/Controllers/entryController.php b/app/Controllers/entryController.php index bd8b65b2b..9c6b248a9 100755 --- a/app/Controllers/entryController.php +++ b/app/Controllers/entryController.php @@ -177,9 +177,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController { foreach ($feeds as $feed) { $feed_history = $feed->keepHistory(); - if ($feed_history == -2) { - // TODO: -2 must be a constant! - // -2 means we take the default value from configuration + if (FreshRSS_Feed::KEEP_HISTORY_DEFAULT === $feed_history) { $feed_history = FreshRSS_Context::$user_conf->keep_history_default; } diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 2793577d5..884172112 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -317,10 +317,8 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $feed_history = $feed->keepHistory(); if ($isNewFeed) { - $feed_history = -1; //∞ - } elseif ($feed_history == -2) { - // TODO: -2 must be a constant! - // -2 means we take the default value from configuration + $feed_history = FreshRSS_Feed::KEEP_HISTORY_INFINITE; + } elseif (FreshRSS_Feed::KEEP_HISTORY_DEFAULT === $feed_history) { $feed_history = FreshRSS_Context::$user_conf->keep_history_default; } $needFeedCacheRefresh = false; diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php index b3f3df46e..37efd3b57 100644 --- a/app/Controllers/subscriptionController.php +++ b/app/Controllers/subscriptionController.php @@ -104,7 +104,7 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { 'pathEntries' => Minz_Request::param('path_entries', ''), 'priority' => intval(Minz_Request::param('priority', FreshRSS_Feed::PRIORITY_MAIN_STREAM)), 'httpAuth' => $httpAuth, - 'keep_history' => intval(Minz_Request::param('keep_history', -2)), + 'keep_history' => intval(Minz_Request::param('keep_history', FreshRSS_Feed::KEEP_HISTORY_DEFAULT)), 'ttl' => $ttl * ($mute ? -1 : 1), ); diff --git a/app/Models/ConfigurationSetter.php b/app/Models/ConfigurationSetter.php index ca4709903..645ef644e 100644 --- a/app/Models/ConfigurationSetter.php +++ b/app/Models/ConfigurationSetter.php @@ -81,7 +81,7 @@ class FreshRSS_ConfigurationSetter { private function _keep_history_default(&$data, $value) { $value = intval($value); - $data['keep_history_default'] = $value >= -1 ? $value : 0; + $data['keep_history_default'] = $value >= FreshRSS_Feed::KEEP_HISTORY_INFINITE ? $value : 0; } // It works for system config too! @@ -154,7 +154,7 @@ class FreshRSS_ConfigurationSetter { private function _ttl_default(&$data, $value) { $value = intval($value); - $data['ttl_default'] = $value >= -1 ? $value : 3600; + $data['ttl_default'] = $value > FreshRSS_Feed::TTL_DEFAULT ? $value : 3600; } private function _view_mode(&$data, $value) { diff --git a/app/Models/Feed.php b/app/Models/Feed.php index 216a26d44..13ab13df9 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -7,6 +7,9 @@ class FreshRSS_Feed extends Minz_Model { const TTL_DEFAULT = 0; + const KEEP_HISTORY_DEFAULT = -2; + const KEEP_HISTORY_INFINITE = -1; + private $id = 0; private $url; private $category = 1; @@ -21,7 +24,7 @@ class FreshRSS_Feed extends Minz_Model { private $pathEntries = ''; private $httpAuth = ''; private $error = false; - private $keep_history = -2; + private $keep_history = self::KEEP_HISTORY_DEFAULT; private $ttl = self::TTL_DEFAULT; private $mute = false; private $hash = null; @@ -222,7 +225,7 @@ class FreshRSS_Feed extends Minz_Model { public function _keepHistory($value) { $value = intval($value); $value = min($value, 1000000); - $value = max($value, -2); + $value = max($value, self::KEEP_HISTORY_DEFAULT); $this->keep_history = $value; } public function _ttl($value) { diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php index deda02c63..011b3d112 100644 --- a/app/Models/FeedDAO.php +++ b/app/Models/FeedDAO.php @@ -18,7 +18,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo implements FreshRSS_Searchable { ttl ) VALUES - (?, ?, ?, ?, ?, ?, 10, ?, 0, -2, ?)'; + (?, ?, ?, ?, ?, ?, 10, ?, 0, ?, ?)'; $stm = $this->bd->prepare($sql); $valuesTmp['url'] = safe_ascii($valuesTmp['url']); @@ -32,6 +32,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo implements FreshRSS_Searchable { substr($valuesTmp['description'], 0, 1023), $valuesTmp['lastUpdate'], base64_encode($valuesTmp['httpAuth']), + FreshRSS_Feed::KEEP_HISTORY_DEFAULT, FreshRSS_Feed::TTL_DEFAULT, ); @@ -406,7 +407,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo implements FreshRSS_Searchable { $myFeed->_pathEntries(isset($dao['pathEntries']) ? $dao['pathEntries'] : ''); $myFeed->_httpAuth(isset($dao['httpAuth']) ? base64_decode($dao['httpAuth']) : ''); $myFeed->_error(isset($dao['error']) ? $dao['error'] : 0); - $myFeed->_keepHistory(isset($dao['keep_history']) ? $dao['keep_history'] : -2); + $myFeed->_keepHistory(isset($dao['keep_history']) ? $dao['keep_history'] : FreshRSS_Feed::KEEP_HISTORY_DEFAULT); $myFeed->_ttl(isset($dao['ttl']) ? $dao['ttl'] : FreshRSS_Feed::TTL_DEFAULT); $myFeed->_nbNotRead(isset($dao['cache_nbUnreads']) ? $dao['cache_nbUnreads'] : 0); $myFeed->_nbEntries(isset($dao['cache_nbEntries']) ? $dao['cache_nbEntries'] : 0); diff --git a/app/views/configure/archiving.phtml b/app/views/configure/archiving.phtml index 2254f5dba..09be55fd9 100644 --- a/app/views/configure/archiving.phtml +++ b/app/views/configure/archiving.phtml @@ -19,7 +19,7 @@
    () @@ -34,7 +34,7 @@ 3600 => '1h', 5400 => '1.5h', 7200 => '2h', 10800 => '3h', 14400 => '4h', 18800 => '5h', 21600 => '6h', 25200 => '7h', 28800 => '8h', 36000 => '10h', 43200 => '12h', 64800 => '18h', 86400 => '1d', 129600 => '1.5d', 172800 => '2d', 259200 => '3d', 345600 => '4d', 432000 => '5d', 518400 => '6d', - 604800 => '1wk', -1 => '∞') as $v => $t) { + 604800 => '1wk') as $v => $t) { echo ''; if (FreshRSS_Context::$user_conf->ttl_default == $v) { $found = true; diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml index 595309f49..d379c5df8 100644 --- a/app/views/helpers/feed/update.phtml +++ b/app/views/helpers/feed/update.phtml @@ -101,7 +101,7 @@
    -- cgit v1.2.3 From a14c160beb360ffb00f255621030c77878f6c8a1 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Thu, 11 Jan 2018 19:18:29 +0100 Subject: Update travis config (#1751) I've enabled tests on PHP 7.2 since it's the latest stable version. I've also installed phpcs from composer since PEAR is not available for all versions of PHP. --- .travis.yml | 19 +++++++------------ app/Controllers/extensionController.php | 2 +- 2 files changed, 8 insertions(+), 13 deletions(-) (limited to 'app/Controllers') diff --git a/.travis.yml b/.travis.yml index 7bfefd8ce..0217b61c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,18 +5,20 @@ php: - '5.6' - '7.0' - '7.1' + - '7.2' - hhvm - nightly install: # newest version without https://github.com/squizlabs/PHP_CodeSniffer/pull/1404 - - pear install PHP_CodeSniffer-3.0.0RC4 + - composer global require squizlabs/php_codesniffer "<=3.0.0RC4" script: - phpenv rehash - | if [[ $VALIDATE_STANDARD == yes ]]; then - phpcs . --standard=phpcs.xml --warning-severity=0 --extensions=php -p + COMPOSER_BIN=$(composer global config --absolute bin-dir) + $COMPOSER_BIN/phpcs . --standard=phpcs.xml --warning-severity=0 --extensions=php -p fi - | if [[ $CHECK_TRANSLATION == yes ]]; then @@ -29,18 +31,11 @@ env: matrix: fast_finish: true include: + # PHP 5.3 only runs on Ubuntu 12.04 (precise), not 14.04 (trusty) - php: "5.3" dist: precise - - php: "7.1" + - php: "7.2" env: CHECK_TRANSLATION=yes VALIDATE_STANDARD=no allow_failures: - # PHP 5.3 only runs on Ubuntu 12.04 (precise), not 14.04 (trusty) - - php: "5.3" - dist: precise - - php: "5.4" - - php: "5.5" - - php: "5.6" - - php: "7.0" - - php: hhvm - - php: nightly - env: CHECK_TRANSLATION=yes VALIDATE_STANDARD=no + - dist: precise diff --git a/app/Controllers/extensionController.php b/app/Controllers/extensionController.php index bb846e921..311fd2e96 100644 --- a/app/Controllers/extensionController.php +++ b/app/Controllers/extensionController.php @@ -240,7 +240,7 @@ class FreshRSS_extension_Controller extends Minz_ActionController { $res = recursive_unlink($ext->getPath()); if ($res) { Minz_Request::good(_t('feedback.extensions.removed', $ext_name), - $url_redirect); + $url_redirect); } else { Minz_Request::bad(_t('feedback.extensions.cannot_delete', $ext_name), $url_redirect); -- cgit v1.2.3 From 5faa7aaf66aa2e762922b293cb9b7293a5003a7d Mon Sep 17 00:00:00 2001 From: Django Janny Date: Fri, 2 Feb 2018 13:59:48 +0100 Subject: Trim spaces from user given url --- app/Controllers/feedController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/Controllers') diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 884172112..985b943d2 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -39,12 +39,14 @@ class FreshRSS_feed_Controller extends Minz_ActionController { * @throws FreshRSS_Feed_Exception * @throws Minz_FileNotExistException */ - public static function addFeed($url, $title = '', $cat_id = 0, $new_cat_name = '', $http_auth = '') { + public static function addFeed($param_url, $title = '', $cat_id = 0, $new_cat_name = '', $http_auth = '') { FreshRSS_UserDAO::touch(); @set_time_limit(300); $catDAO = new FreshRSS_CategoryDAO(); + $url = trim($param_url); + $cat = null; if ($new_cat_name != '') { $new_cat_id = $catDAO->addCategory(array('name' => $new_cat_name)); -- cgit v1.2.3 From 80168545eaa9e0183e72931ff7e50bfff36d7c33 Mon Sep 17 00:00:00 2001 From: Django Janny Date: Mon, 5 Feb 2018 20:48:16 +0100 Subject: param name --- app/Controllers/feedController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/Controllers') diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 985b943d2..7f66b10db 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -39,13 +39,13 @@ class FreshRSS_feed_Controller extends Minz_ActionController { * @throws FreshRSS_Feed_Exception * @throws Minz_FileNotExistException */ - public static function addFeed($param_url, $title = '', $cat_id = 0, $new_cat_name = '', $http_auth = '') { + public static function addFeed($url, $title = '', $cat_id = 0, $new_cat_name = '', $http_auth = '') { FreshRSS_UserDAO::touch(); @set_time_limit(300); $catDAO = new FreshRSS_CategoryDAO(); - $url = trim($param_url); + $url = trim($url); $cat = null; if ($new_cat_name != '') { -- cgit v1.2.3 From ac3e38359b420068b75cc848d89a3a6fc7b6e6c6 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Wed, 14 Feb 2018 22:15:34 +0100 Subject: Allow admin user to reset passwords (#1765) See #960 --- app/Controllers/userController.php | 56 ++++++++++++++++++++++++++------------ app/i18n/cz/admin.php | 3 ++ app/i18n/cz/feedback.php | 4 +++ app/i18n/cz/gen.php | 1 + app/i18n/de/admin.php | 3 ++ app/i18n/de/feedback.php | 4 +++ app/i18n/de/gen.php | 1 + app/i18n/en/admin.php | 3 ++ app/i18n/en/feedback.php | 4 +++ app/i18n/en/gen.php | 1 + app/i18n/es/admin.php | 3 ++ app/i18n/es/feedback.php | 4 +++ app/i18n/es/gen.php | 1 + app/i18n/fr/admin.php | 3 ++ app/i18n/fr/feedback.php | 4 +++ app/i18n/fr/gen.php | 1 + app/i18n/he/admin.php | 3 ++ app/i18n/he/feedback.php | 4 +++ app/i18n/he/gen.php | 1 + app/i18n/it/admin.php | 3 ++ app/i18n/it/feedback.php | 4 +++ app/i18n/it/gen.php | 1 + app/i18n/kr/admin.php | 3 ++ app/i18n/kr/feedback.php | 4 +++ app/i18n/kr/gen.php | 1 + app/i18n/nl/admin.php | 3 ++ app/i18n/nl/feedback.php | 4 +++ app/i18n/nl/gen.php | 1 + app/i18n/pt-br/admin.php | 3 ++ app/i18n/pt-br/feedback.php | 4 +++ app/i18n/pt-br/gen.php | 1 + app/i18n/ru/admin.php | 3 ++ app/i18n/ru/feedback.php | 4 +++ app/i18n/ru/gen.php | 1 + app/i18n/tr/admin.php | 3 ++ app/i18n/tr/feedback.php | 4 +++ app/i18n/tr/gen.php | 1 + app/i18n/zh-cn/admin.php | 3 ++ app/i18n/zh-cn/feedback.php | 4 +++ app/i18n/zh-cn/gen.php | 1 + app/views/user/manage.phtml | 41 ++++++++++++++++++++++++++-- cli/update-user.php | 3 +- 42 files changed, 184 insertions(+), 20 deletions(-) (limited to 'app/Controllers') diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php index 2a1d43d9e..820260a08 100644 --- a/app/Controllers/userController.php +++ b/app/Controllers/userController.php @@ -44,29 +44,54 @@ class FreshRSS_user_Controller extends Minz_ActionController { return preg_match('/^' . self::USERNAME_PATTERN . '$/', $username) === 1; } - public static function updateContextUser($passwordPlain, $apiPasswordPlain, $userConfigUpdated = array()) { + public static function updateUser($user, $passwordPlain, $apiPasswordPlain, $userConfigUpdated = array()) { + $userConfig = get_user_configuration($user); if ($passwordPlain != '') { $passwordHash = self::hashPassword($passwordPlain); - FreshRSS_Context::$user_conf->passwordHash = $passwordHash; + $userConfig->passwordHash = $passwordHash; } if ($apiPasswordPlain != '') { $apiPasswordHash = self::hashPassword($apiPasswordPlain); - FreshRSS_Context::$user_conf->apiPasswordHash = $apiPasswordHash; + $userConfig->apiPasswordHash = $apiPasswordHash; } if (is_array($userConfigUpdated)) { foreach ($userConfigUpdated as $configName => $configValue) { if ($configValue !== null) { - FreshRSS_Context::$user_conf->_param($configName, $configValue); + $userConfig->_param($configName, $configValue); } } } - $ok = FreshRSS_Context::$user_conf->save(); + $ok = $userConfig->save(); return $ok; } + public function updateAction() { + if (Minz_Request::isPost()) { + $passwordPlain = Minz_Request::param('newPasswordPlain', '', true); + Minz_Request::_param('newPasswordPlain'); //Discard plain-text password ASAP + $_POST['newPasswordPlain'] = ''; + + $apiPasswordPlain = Minz_Request::param('apiPasswordPlain', '', true); + + $username = Minz_Request::param('username'); + $ok = self::updateUser($username, $passwordPlain, $apiPasswordPlain, array( + 'token' => Minz_Request::param('token', null), + )); + + if ($ok) { + Minz_Request::good(_t('feedback.user.updated', $username), + array('c' => 'user', 'a' => 'manage')); + } else { + Minz_Request::bad(_t('feedback.user.updated.error', $username), + array('c' => 'user', 'a' => 'manage')); + } + + } + } + /** * This action displays the user profile page. */ @@ -84,7 +109,7 @@ class FreshRSS_user_Controller extends Minz_ActionController { $apiPasswordPlain = Minz_Request::param('apiPasswordPlain', '', true); - $ok = self::updateContextUser($passwordPlain, $apiPasswordPlain, array( + $ok = self::updateUser(Minz_Session::param('currentUser'), $passwordPlain, $apiPasswordPlain, array( 'token' => Minz_Request::param('token', null), )); @@ -110,19 +135,16 @@ class FreshRSS_user_Controller extends Minz_ActionController { Minz_View::prependTitle(_t('admin.user.title') . ' · '); - // Get the correct current user. - $username = Minz_Request::param('u', Minz_Session::param('currentUser')); - if (!FreshRSS_UserDAO::exist($username)) { - $username = Minz_Session::param('currentUser'); - } - $this->view->current_user = $username; + $this->view->current_user = Minz_Request::param('u'); - // Get information about the current user. - $entryDAO = FreshRSS_Factory::createEntryDao($this->view->current_user); - $this->view->nb_articles = $entryDAO->count(); + if ($this->view->current_user) { + // Get information about the current user. + $entryDAO = FreshRSS_Factory::createEntryDao($this->view->current_user); + $this->view->nb_articles = $entryDAO->count(); - $databaseDAO = FreshRSS_Factory::createDatabaseDAO(); - $this->view->size_user = $databaseDAO->size(); + $databaseDAO = FreshRSS_Factory::createDatabaseDAO(); + $this->view->size_user = $databaseDAO->size(); + } } public static function createUser($new_user_name, $passwordPlain, $apiPasswordPlain, $userConfig = array(), $insertDefaultFeeds = true) { diff --git a/app/i18n/cz/admin.php b/app/i18n/cz/admin.php index dbfebd4c9..d414ffd07 100644 --- a/app/i18n/cz/admin.php +++ b/app/i18n/cz/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s článků (%s)', 'create' => 'Vytvořit nového uživatele', + 'delete_users' => 'Delete user', // TODO 'language' => 'Jazyk', 'number' => 'Zatím je vytvořen %d účet', 'numbers' => 'Zatím je vytvořeno %d účtů', 'password_form' => 'Heslo
    (pro přihlášení webovým formulářem)', 'password_format' => 'Alespoň 7 znaků', + 'selected' => 'Selected user', // TODO 'title' => 'Správa uživatelů', + 'update_users' => 'Update user', // TODO 'user_list' => 'Seznam uživatelů', 'username' => 'Přihlašovací jméno', 'users' => 'Uživatelé', diff --git a/app/i18n/cz/feedback.php b/app/i18n/cz/feedback.php index f7b8d8c73..22eaf77f7 100644 --- a/app/i18n/cz/feedback.php +++ b/app/i18n/cz/feedback.php @@ -101,6 +101,10 @@ return array( '_' => 'Uživatel %s byl smazán', 'error' => 'Uživatele %s nelze smazat', ), + 'updated' => array( + '_' => 'User %s has been updated', // TODO + 'error' => 'User %s has not been updated', // TODO + ), ), 'profile' => array( 'error' => 'Váš profil nelze změnit', diff --git a/app/i18n/cz/gen.php b/app/i18n/cz/gen.php index fcddf452c..288be61ec 100644 --- a/app/i18n/cz/gen.php +++ b/app/i18n/cz/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => 'Navštívit WWW stránku', 'submit' => 'Odeslat', 'truncate' => 'Smazat všechny články', + 'update' => 'Update', // TODO ), 'auth' => array( 'email' => 'Email', diff --git a/app/i18n/de/admin.php b/app/i18n/de/admin.php index bb2c9352d..45bf2de68 100644 --- a/app/i18n/de/admin.php +++ b/app/i18n/de/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s Artikel (%s)', 'create' => 'Neuen Benutzer erstellen', + 'delete_users' => 'Delete user', // TODO 'language' => 'Sprache', 'number' => 'Es wurde bis jetzt %d Account erstellt', 'numbers' => 'Es wurden bis jetzt %d Accounts erstellt', 'password_form' => 'Passwort
    (für die Anmeldemethode per Webformular)', 'password_format' => 'mindestens 7 Zeichen', + 'selected' => 'Selected user', // TODO 'title' => 'Benutzer verwalten', + 'update_users' => 'Update user', // TODO 'user_list' => 'Liste der Benutzer', 'username' => 'Nutzername', 'users' => 'Benutzer', diff --git a/app/i18n/de/feedback.php b/app/i18n/de/feedback.php index e2e9a71ba..0ac6efefc 100644 --- a/app/i18n/de/feedback.php +++ b/app/i18n/de/feedback.php @@ -101,6 +101,10 @@ return array( '_' => 'Der Benutzer %s ist gelöscht worden', 'error' => 'Der Benutzer %s kann nicht gelöscht werden', ), + 'updated' => array( + '_' => 'User %s has been updated', // TODO + 'error' => 'User %s has not been updated', // TODO + ), ), 'profile' => array( 'error' => 'Ihr Profil kann nicht geändert werden', diff --git a/app/i18n/de/gen.php b/app/i18n/de/gen.php index bed49a4a4..8df0b1f07 100644 --- a/app/i18n/de/gen.php +++ b/app/i18n/de/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => 'Webseite ansehen', 'submit' => 'Abschicken', 'truncate' => 'Alle Artikel löschen', + 'update' => 'Update', // TODO ), 'auth' => array( 'email' => 'E-Mail-Adresse', diff --git a/app/i18n/en/admin.php b/app/i18n/en/admin.php index 187b66a8c..1f857dbab 100644 --- a/app/i18n/en/admin.php +++ b/app/i18n/en/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s articles (%s)', 'create' => 'Create new user', + 'delete_users' => 'Delete user', 'language' => 'Language', 'number' => 'There is %d account created', 'numbers' => 'There are %d accounts created', 'password_form' => 'Password
    (for the Web-form login method)', 'password_format' => 'At least 7 characters', + 'selected' => 'Selected user', 'title' => 'Manage users', + 'update_users' => 'Update user', 'user_list' => 'List of users', 'username' => 'Username', 'users' => 'Users', diff --git a/app/i18n/en/feedback.php b/app/i18n/en/feedback.php index 334d9a8f5..ad7f87fd9 100644 --- a/app/i18n/en/feedback.php +++ b/app/i18n/en/feedback.php @@ -101,6 +101,10 @@ return array( '_' => 'User %s has been deleted', 'error' => 'User %s cannot be deleted', ), + 'updated' => array( + '_' => 'User %s has been updated', + 'error' => 'User %s has not been updated', + ), ), 'profile' => array( 'error' => 'Your profile cannot be modified', diff --git a/app/i18n/en/gen.php b/app/i18n/en/gen.php index ac48e3486..82cd4da72 100644 --- a/app/i18n/en/gen.php +++ b/app/i18n/en/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => 'See website', 'submit' => 'Submit', 'truncate' => 'Delete all articles', + 'update' => 'Update', ), 'auth' => array( 'email' => 'Email address', diff --git a/app/i18n/es/admin.php b/app/i18n/es/admin.php index 93b1e6e5c..2884721c7 100755 --- a/app/i18n/es/admin.php +++ b/app/i18n/es/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s articles (%s)', 'create' => 'Crear nuevo usuario', + 'delete_users' => 'Delete user', // TODO 'language' => 'Idioma', 'number' => 'Hay %d cuenta creada', 'numbers' => 'Hay %d cuentas creadas', 'password_form' => 'Contraseña
    (para el método de identificación por formulario web)', 'password_format' => 'Mínimo de 7 caracteres', + 'selected' => 'Selected user', // TODO 'title' => 'Administrar usuarios', + 'update_users' => 'Update user', // TODO 'user_list' => 'Lista de usuarios', 'username' => 'Nombre de usuario', 'users' => 'Usuarios', diff --git a/app/i18n/es/feedback.php b/app/i18n/es/feedback.php index 136e70179..7b23f1a8d 100755 --- a/app/i18n/es/feedback.php +++ b/app/i18n/es/feedback.php @@ -101,6 +101,10 @@ return array( '_' => 'El usuario %s ha sido eliminado', 'error' => 'El usuario %s no ha podido ser eliminado', ), + 'updated' => array( + '_' => 'User %s has been updated', // TODO + 'error' => 'User %s has not been updated', // TODO + ), ), 'profile' => array( 'error' => 'Tu perfil no puede ser modificado', diff --git a/app/i18n/es/gen.php b/app/i18n/es/gen.php index 32fbcdaee..fe495a63f 100755 --- a/app/i18n/es/gen.php +++ b/app/i18n/es/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => 'Ver web', 'submit' => 'Enviar', 'truncate' => 'Borrar todos los artículos', + 'update' => 'Update', // TODO ), 'auth' => array( 'email' => 'Correo electrónico', diff --git a/app/i18n/fr/admin.php b/app/i18n/fr/admin.php index b2bc48209..6c582d719 100644 --- a/app/i18n/fr/admin.php +++ b/app/i18n/fr/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s articles (%s)', 'create' => 'Créer un nouvel utilisateur', + 'delete_users' => 'Supprimer un utilisateur', 'language' => 'Langue', 'number' => '%d compte a déjà été créé', 'numbers' => '%d comptes ont déjà été créés', 'password_form' => 'Mot de passe
    (pour connexion par formulaire)', 'password_format' => '7 caractères minimum', + 'selected' => 'Utilisateur sélectionné', 'title' => 'Gestion des utilisateurs', + 'update_users' => 'Mettre à jour un utilisateur', 'user_list' => 'Liste des utilisateurs', 'username' => 'Nom d’utilisateur', 'users' => 'Utilisateurs', diff --git a/app/i18n/fr/feedback.php b/app/i18n/fr/feedback.php index aa19cd02b..1abf1b518 100644 --- a/app/i18n/fr/feedback.php +++ b/app/i18n/fr/feedback.php @@ -101,6 +101,10 @@ return array( '_' => 'L’utilisateur %s a été supprimé.', 'error' => 'L’utilisateur %s ne peut pas être supprimé.', ), + 'updated' => array( + '_' => 'L’utilisateur %s a été mis à jour', + 'error' => 'L’utilisateur %s n’a pas été mis à jour', + ), ), 'profile' => array( 'error' => 'Votre profil n’a pas pu être mis à jour', diff --git a/app/i18n/fr/gen.php b/app/i18n/fr/gen.php index 61a24602a..beb578543 100644 --- a/app/i18n/fr/gen.php +++ b/app/i18n/fr/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => 'Voir le site', 'submit' => 'Valider', 'truncate' => 'Supprimer tous les articles', + 'update' => 'Mettre à jour', ), 'auth' => array( 'email' => 'Adresse courriel', diff --git a/app/i18n/he/admin.php b/app/i18n/he/admin.php index b7c83c828..2840213c9 100644 --- a/app/i18n/he/admin.php +++ b/app/i18n/he/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s articles (%s)', // @todo 'create' => 'יצירת משתמש חדש', + 'delete_users' => 'Delete user', // TODO 'language' => 'שפה', 'number' => 'There is %d account created', // @todo 'numbers' => 'There are %d accounts created', // @todo 'password_form' => 'סיסמה
    (לשימוש בטפוס ההרשמה)', 'password_format' => 'At least 7 characters', // @todo + 'selected' => 'Selected user', // TODO 'title' => 'Manage users', // @todo + 'update_users' => 'Update user', // TODO 'user_list' => 'רשימת משתמשים', 'username' => 'שם משתמש', 'users' => 'משתמשים', diff --git a/app/i18n/he/feedback.php b/app/i18n/he/feedback.php index 9a72b2ba0..f773ff270 100644 --- a/app/i18n/he/feedback.php +++ b/app/i18n/he/feedback.php @@ -102,6 +102,10 @@ return array( '_' => 'המשתמש %s נמחק', 'error' => 'User %s cannot be deleted', // @todo ), + 'updated' => array( + '_' => 'User %s has been updated', // TODO + 'error' => 'User %s has not been updated', // TODO + ), ), 'profile' => array( 'error' => 'Your profile cannot be modified', // @todo diff --git a/app/i18n/he/gen.php b/app/i18n/he/gen.php index cacc8eaed..c4262ab66 100644 --- a/app/i18n/he/gen.php +++ b/app/i18n/he/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => 'ראו אתר', 'submit' => 'אישור', 'truncate' => 'מחיקת כל המאמרים', + 'update' => 'Update', // TODO ), 'auth' => array( 'email' => 'Email address', // @todo diff --git a/app/i18n/it/admin.php b/app/i18n/it/admin.php index 0248d9317..a3034777f 100644 --- a/app/i18n/it/admin.php +++ b/app/i18n/it/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s articoli (%s)', 'create' => 'Crea nuovo utente', + 'delete_users' => 'Delete user', // TODO 'language' => 'Lingua', 'number' => ' %d profilo utente creato', 'numbers' => 'Sono presenti %d profili utente', 'password_form' => 'Password
    (per il login classico)', 'password_format' => 'Almeno 7 caratteri', + 'selected' => 'Selected user', // TODO 'title' => 'Gestione utenti', + 'update_users' => 'Update user', // TODO 'user_list' => 'Lista utenti', 'username' => 'Nome utente', 'users' => 'Utenti', diff --git a/app/i18n/it/feedback.php b/app/i18n/it/feedback.php index 8f3cf3ed6..d702eb448 100644 --- a/app/i18n/it/feedback.php +++ b/app/i18n/it/feedback.php @@ -101,6 +101,10 @@ return array( '_' => 'Utente %s cancellato', 'error' => 'Utente %s non cancellato', ), + 'updated' => array( + '_' => 'User %s has been updated', // TODO + 'error' => 'User %s has not been updated', // TODO + ), ), 'profile' => array( 'error' => 'Il tuo profilo non può essere modificato', diff --git a/app/i18n/it/gen.php b/app/i18n/it/gen.php index ccc8c0e7c..d4f83735a 100644 --- a/app/i18n/it/gen.php +++ b/app/i18n/it/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => 'Vai al sito', 'submit' => 'Conferma', 'truncate' => 'Cancella tutti gli articoli', + 'update' => 'Update', // TODO ), 'auth' => array( 'email' => 'Indirizzo email', diff --git a/app/i18n/kr/admin.php b/app/i18n/kr/admin.php index c34007ca9..f9e9c9a8e 100644 --- a/app/i18n/kr/admin.php +++ b/app/i18n/kr/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s 개의 글 (%s)', 'create' => '새 사용자 생성', + 'delete_users' => 'Delete user', // TODO 'language' => '언어', 'number' => '%d 개의 계정이 생성되었습니다', 'numbers' => '%d 개의 계정이 생성되었습니다', 'password_form' => '암호
    (웹폼 로그인 방식 사용시)', 'password_format' => '7 글자 이상이어야 합니다', + 'selected' => 'Selected user', // TODO 'title' => '사용자 관리', + 'update_users' => 'Update user', // TODO 'user_list' => '사용자 목록', 'username' => '사용자 이름', 'users' => '전체 사용자', diff --git a/app/i18n/kr/feedback.php b/app/i18n/kr/feedback.php index 6e13e7a10..bccf1aac0 100644 --- a/app/i18n/kr/feedback.php +++ b/app/i18n/kr/feedback.php @@ -101,6 +101,10 @@ return array( '_' => '%s 사용자를 삭제했습니다', 'error' => '%s 사용자를 삭제할 수 없습니다', ), + 'updated' => array( + '_' => 'User %s has been updated', // TODO + 'error' => 'User %s has not been updated', // TODO + ), ), 'profile' => array( 'error' => '프로필을 변경할 수 없습니다', diff --git a/app/i18n/kr/gen.php b/app/i18n/kr/gen.php index 8997ba14b..4fb6c92ff 100644 --- a/app/i18n/kr/gen.php +++ b/app/i18n/kr/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => '웹사이트 열기', 'submit' => '설정 저장', 'truncate' => '모든 글 삭제', + 'update' => 'Update', // TODO ), 'auth' => array( 'email' => '메일 주소', diff --git a/app/i18n/nl/admin.php b/app/i18n/nl/admin.php index 384242b4d..cbdfd6978 100644 --- a/app/i18n/nl/admin.php +++ b/app/i18n/nl/admin.php @@ -175,6 +175,7 @@ return array( 'user' => array( 'articles_and_size' => '%s artikelen (%s)', 'create' => 'Creëer nieuwe gebruiker', + 'delete_users' => 'Delete user', // TODO 'language' => 'Taal', 'number' => 'Er is %d accounts gemaakt', 'numbers' => 'Er zijn %d accounts gemaakt', @@ -185,7 +186,9 @@ return array( 'help' => '0 betekent dat er geen accountlimiet is', 'number' => 'Max aantal accounts', ), + 'selected' => 'Selected user', // TODO 'title' => 'Beheer gebruikers', + 'update_users' => 'Update user', // TODO 'user_list' => 'Lijst van gebruikers ', 'username' => 'Gebruikersnaam', 'users' => 'Gebruikers', diff --git a/app/i18n/nl/feedback.php b/app/i18n/nl/feedback.php index cf1274767..3fabc97b8 100644 --- a/app/i18n/nl/feedback.php +++ b/app/i18n/nl/feedback.php @@ -101,6 +101,10 @@ return array( '_' => 'Gebruiker %s is verwijderd', 'error' => 'Gebruiker %s kan niet worden verwijderd', ), + 'updated' => array( + '_' => 'User %s has been updated', // TODO + 'error' => 'User %s has not been updated', // TODO + ), 'set_registration' => 'Het maximale aantal accounts is vernieuwd.', ), 'profile' => array( diff --git a/app/i18n/nl/gen.php b/app/i18n/nl/gen.php index 3215bdfec..ea3e720b4 100644 --- a/app/i18n/nl/gen.php +++ b/app/i18n/nl/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => 'Bekijk website', 'submit' => 'Opslaan', 'truncate' => 'Verwijder alle artikelen', + 'update' => 'Update', // TODO ), 'auth' => array( 'email' => 'Email adres', diff --git a/app/i18n/pt-br/admin.php b/app/i18n/pt-br/admin.php index e62718e80..16aa027a8 100644 --- a/app/i18n/pt-br/admin.php +++ b/app/i18n/pt-br/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s artigos (%s)', 'create' => 'Criar novo usuário', + 'delete_users' => 'Delete user', // TODO 'language' => 'Idioma', 'number' => 'Há %d conta criada', 'numbers' => 'Há %d contas criadas', 'password_form' => 'Senha
    (para o login pelo método do formulário)', 'password_format' => 'Ao menos 7 caracteres', + 'selected' => 'Selected user', // TODO 'title' => 'Gerenciar usuários', + 'update_users' => 'Update user', // TODO 'user_list' => 'Lista de usuários', 'username' => 'Usuário', 'users' => 'Usuários', diff --git a/app/i18n/pt-br/feedback.php b/app/i18n/pt-br/feedback.php index 0959ad38e..932bb72b1 100644 --- a/app/i18n/pt-br/feedback.php +++ b/app/i18n/pt-br/feedback.php @@ -101,6 +101,10 @@ return array( '_' => 'Usuário %s foi deletado', 'error' => 'Usuário %s não pode ser deletado', ), + 'updated' => array( + '_' => 'User %s has been updated', // TODO + 'error' => 'User %s has not been updated', // TODO + ), ), 'profile' => array( 'error' => 'Your profile cannot be modified', diff --git a/app/i18n/pt-br/gen.php b/app/i18n/pt-br/gen.php index 4bc8535d6..fa1532787 100644 --- a/app/i18n/pt-br/gen.php +++ b/app/i18n/pt-br/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => 'Ver o site', 'submit' => 'Enviar', 'truncate' => 'Deletar todos os artigos', + 'update' => 'Update', // TODO ), 'auth' => array( 'email' => 'Endereço de e-mail', diff --git a/app/i18n/ru/admin.php b/app/i18n/ru/admin.php index d877c5006..4f5e937d7 100644 --- a/app/i18n/ru/admin.php +++ b/app/i18n/ru/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s статей (%s)', 'create' => 'Создать нового пользователя', + 'delete_users' => 'Delete user', // TODO 'language' => 'Язык', 'number' => 'На данный момент создан %d аккаунт', 'numbers' => 'На данный момент аккаунтов создано: %d', 'password_form' => 'Пароль
    (для входа через Веб-форму)', 'password_format' => 'Минимум 7 символов', + 'selected' => 'Selected user', // TODO 'title' => 'Управление пользователями', + 'update_users' => 'Update user', // TODO 'user_list' => 'Список пользователей', 'username' => 'Имя пользователя', 'users' => 'Пользователи', diff --git a/app/i18n/ru/feedback.php b/app/i18n/ru/feedback.php index ffebd6dc9..9416ed878 100644 --- a/app/i18n/ru/feedback.php +++ b/app/i18n/ru/feedback.php @@ -101,6 +101,10 @@ return array( '_' => 'User %s has been deleted', //TODO 'error' => 'User %s cannot be deleted', //TODO ), + 'updated' => array( + '_' => 'User %s has been updated', // TODO + 'error' => 'User %s has not been updated', // TODO + ), ), 'profile' => array( 'error' => 'Your profile cannot be modified', //TODO diff --git a/app/i18n/ru/gen.php b/app/i18n/ru/gen.php index cc7e8765c..6f9020695 100644 --- a/app/i18n/ru/gen.php +++ b/app/i18n/ru/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => 'See website', 'submit' => 'Submit', 'truncate' => 'Delete all articles', + 'update' => 'Update', // TODO ), 'auth' => array( 'email' => 'Email address', diff --git a/app/i18n/tr/admin.php b/app/i18n/tr/admin.php index aa3aad7b7..f982bf644 100644 --- a/app/i18n/tr/admin.php +++ b/app/i18n/tr/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s makale (%s)', 'create' => 'Yeni kullanıcı oluştur', + 'delete_users' => 'Delete user', // TODO 'language' => 'Dil', 'number' => 'Oluşturulmuş %d hesap var', 'numbers' => 'Oluşturulmuş %d hesap var', 'password_form' => 'Şifre
    (Tarayıcı girişi için)', 'password_format' => 'En az 7 karakter', + 'selected' => 'Selected user', // TODO 'title' => 'Kullanıcıları yönet', + 'update_users' => 'Update user', // TODO 'user_list' => 'Kullanıcı listesi', 'username' => 'Kullanıcı adı', 'users' => 'Kullanıcılar', diff --git a/app/i18n/tr/feedback.php b/app/i18n/tr/feedback.php index be79630be..8f40e7d85 100644 --- a/app/i18n/tr/feedback.php +++ b/app/i18n/tr/feedback.php @@ -101,6 +101,10 @@ return array( '_' => '%s kullanıcısı silindi', 'error' => '%s kullanıcısı silinemedi', ), + 'updated' => array( + '_' => 'User %s has been updated', // TODO + 'error' => 'User %s has not been updated', // TODO + ), ), 'profile' => array( 'error' => 'Profiliniz düzenlenemedi', diff --git a/app/i18n/tr/gen.php b/app/i18n/tr/gen.php index dcfd12c01..293502e74 100644 --- a/app/i18n/tr/gen.php +++ b/app/i18n/tr/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => 'Siteyi gör', 'submit' => 'Onayla', 'truncate' => 'Tüm makaleleri sil', + 'update' => 'Update', // TODO ), 'auth' => array( 'email' => 'Email adresleri', diff --git a/app/i18n/zh-cn/admin.php b/app/i18n/zh-cn/admin.php index 0e31ed12e..1072dc972 100644 --- a/app/i18n/zh-cn/admin.php +++ b/app/i18n/zh-cn/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s 篇文章 (%s)', 'create' => '创建新用户', + 'delete_users' => 'Delete user', // TODO 'language' => '语言', 'number' => '已有 %d 个帐户', 'numbers' => '已有 %d 个帐户', 'password_form' => '密码
    (用于 Web-form 登录方式)', 'password_format' => '至少 7 个字符', + 'selected' => 'Selected user', // TODO 'title' => '用户管理', + 'update_users' => 'Update user', // TODO 'user_list' => '用户列表', 'username' => '用户名', 'users' => '用户', diff --git a/app/i18n/zh-cn/feedback.php b/app/i18n/zh-cn/feedback.php index 4ec833668..a005de0ce 100644 --- a/app/i18n/zh-cn/feedback.php +++ b/app/i18n/zh-cn/feedback.php @@ -101,6 +101,10 @@ return array( '_' => '用户 %s 已删除', 'error' => '用户 %s 删除失败', ), + 'updated' => array( + '_' => 'User %s has been updated', // TODO + 'error' => 'User %s has not been updated', // TODO + ), ), 'profile' => array( 'error' => '你的帐户修改失败', diff --git a/app/i18n/zh-cn/gen.php b/app/i18n/zh-cn/gen.php index 17f30f001..241fce13b 100644 --- a/app/i18n/zh-cn/gen.php +++ b/app/i18n/zh-cn/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => '查看网站', 'submit' => '提交', 'truncate' => '删除所有文章', + 'update' => 'Update', // TODO ), 'auth' => array( 'email' => 'Email 地址', diff --git a/app/views/user/manage.phtml b/app/views/user/manage.phtml index 793a3a0bd..26838fcc1 100644 --- a/app/views/user/manage.phtml +++ b/app/views/user/manage.phtml @@ -46,14 +46,51 @@
    +
    + + + +
    + +
    + +
    +
    + +
    + +
    +
    + /> + +
    + + +
    +
    + +
    +
    + + +
    +
    +
    +
    - +
    - +
    show_nav_buttons ? ' checked="checked"' : ''; ?> data-leave-validation="show_nav_buttons; ?>"/> + + +
    +
    +
    diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml index ba48b2501..c7cab2d3f 100644 --- a/app/views/index/normal.phtml +++ b/app/views/index/normal.phtml @@ -83,7 +83,7 @@ if (!empty($this->entries)) { $this->renderHelper('pagination'); ?>
    -partial('nav_entries'); ?> +show_nav_buttons) $this->partial('nav_entries'); ?>
    diff --git a/config-user.default.php b/config-user.default.php index 2e4a96239..5e67d8d9b 100644 --- a/config-user.default.php +++ b/config-user.default.php @@ -76,5 +76,6 @@ return array ( 'queries' => array ( ), 'html5_notif_timeout' => 0, + 'show_nav_buttons' => true, 'extensions_enabled' => array(), ); -- cgit v1.2.3