diff options
| author | 2017-02-15 14:14:03 +0100 | |
|---|---|---|
| committer | 2017-02-15 14:14:03 +0100 | |
| commit | 5a1bb1393b4496eb35a2ffb3cc63d41c9dc1e2e5 (patch) | |
| tree | 67028e45792c575c25c92616633f64cc7a4a13eb | |
| parent | 7e949d50320317b5c3b5a2da2bdaf324e794b2f7 (diff) | |
| parent | 5f637bd816b7323885bfe1751a1724ee59a822f6 (diff) | |
Merge remote-tracking branch 'FreshRSS/master'
415 files changed, 36067 insertions, 13761 deletions
diff --git a/CHANGELOG b/CHANGELOG deleted file mode 100644 index 5be992da5..000000000 --- a/CHANGELOG +++ /dev/null @@ -1,240 +0,0 @@ -# Journal des modifications - -## 2014-02-19 FreshRSS 0.7.1 - -* Mise à jour des flux plus rapide grâce à une meilleure utilisation du cache - * Utilisation d’une signature MD5 du contenu intéressant pour les flux n’implémentant pas les requêtes conditionnelles -* Modification des raccourcis - * "s" partage directement si un seul moyen de partage - * Moyens de partage accessibles par "1", "2", "3", etc. - * Premier article : Home ; Dernier article : End - * Ajout du déplacement au sein des catégories / flux (via modificateurs shift et alt) -* UI - * Séparation des descriptions des raccourcis par groupes - * Revue rapide de la page de connexion - * Amélioration de l'affichage des notifications sur mobile -* Revue du système de rafraîchissement des flux - * Meilleure gestion de la file de flux à rafraîchir en JSON - * Rafraîchissement uniquement pour les flux non rafraîchis récemment - * Possibilité donnée aux anonymes de rafraîchir les flux -* SimplePie - * Mise à jour de la lib - * Corrige fuite de mémoire - * Meilleure tolérance aux flux invalides -* Corrections divers - * Ne déplie plus l'article lors du clic sur l'icône lien externe - * Ne boucle plus à la fin de la navigation dans les articles - * Suppression du champ category.color inutile - * Corrige bug redirection infinie (Persona) - * Amélioration vérification de la requête POST - * Ajout d'un verrou lorsqu'une action mark_read ou mark_favorite est en cours - - -## 2014-01-29 FreshRSS 0.7 - -* Nouveau mode multi-utilisateur - * L’utilisateur par défaut (administrateur) peut créer et supprimer d’autres utilisateurs - * Nécessite un contrôle d’accès, soit : - * par le nouveau mode de connexion par formulaire (nom d’utilisateur + mot de passe) - * relativement sûr même sans HTTPS (le mot de passe n’est pas transmis en clair) - * requiert JavaScript et PHP 5.3+ - * par HTTP (par exemple sous Apache en créant un fichier ./p/i/.htaccess et .htpasswd) - * le nom d’utilisateur HTTP doit correspondre au nom d’utilisateur FreshRSS - * par Mozilla Persona, en renseignant l’adresse courriel des utilisateurs -* Installateur supportant les mises à jour : - * Depuis une v0.6, placer application.ini et Configuration.array.php dans le nouveau répertoire “./data/” - (voir réorganisation ci-dessous) - * Pour les versions suivantes, juste garder le répertoire “./data/” -* Rafraîchissement automatique du nombre d’articles non lus toutes les deux minutes (utilise le cache HTTP à bon escient) - * Permet aussi de conserver la session valide, surtout dans le cas de Persona -* Nouvelle page de statistiques (nombres d’articles par jour / catégorie) -* Importation OPML instantanée et plus tolérante -* Nouvelle gestion des favicons avec téléchargement en parallèle -* Nouvelles options - * Réorganisation des options - * Gestion des utilisateurs - * Améliorations partage vers Shaarli, Poche, Diaspora*, Facebook, Twitter, Google+, courriel - * Raccourci ‘s’ par défaut - * Permet la suppression de tous les articles d’un flux - * Option pour marquer les articles comme lus dès la réception - * Permet de configurer plus finement le nombre d’articles minimum à conserver par flux - * Permet de modifier la description et l’adresse d’un flux RSS ainsi que le site Web associé - * Nouveau raccourci pour ouvrir/fermer un article (‘c’ par défaut) - * Boutons pour effacer les logs et pour purger les vieux articles - * Nouveaux filtres d’affichage : seulement les articles favoris, et seulement les articles lus -* SQL : - * Nouveau moteur de recherche, aussi accessible depuis la vue mobile - * Mots clefs de recherche “intitle:”, “inurl:”, “author:” - * Les articles sont triés selon la date de leur ajout dans FreshRSS plutôt que la date déclarée (souvent erronée) - * Permet de marquer tout comme lu sans affecter les nouveaux articles arrivés en cours de lecture - * Permet une pagination efficace - * Refactorisation - * Les tables sont préfixées avec le nom d’utilisateur afin de permettre le mode multi-utilisateurs - * Amélioration des performances - * Tolère un beaucoup plus grand nombre d’articles - * Compression des données côté MySQL plutôt que côté PHP - * Incompatible avec la version 0.6 (nécessite une mise à jour grâce à l’installateur) - * Affichage de la taille de la base de données dans FreshRSS - * Correction problème de marquage de tous les favoris comme lus -* HTML5 : - * Support des balises HTML5 audio, video, et éléments associés - * Utilisation de preload="none", et réécriture correcte des adresses, aussi en HTTPS - * Protection HTML5 des iframe (sandbox="allow-scripts allow-same-origin") - * Filtrage des object et embed - * Chargement différé HTML5 (postpone="") pour iframe et video - * Chargement différé JavaScript pour iframe -* CSS : - * Nouveau thème sombre - * Chargement plus robuste des thèmes - * Meilleur support des longs titres d’articles sur des écrans étroits - * Meilleure accessibilité - * FreshRSS fonctionne aussi en mode dégradé sans images (alternatives Unicode) et/ou sans CSS - * Diverses améliorations -* PHP : - * Encore plus tolérant pour les flux comportant des erreurs - * Mise à jour automatique de l’URL du flux (en base de données) lorsque SimplePie découvre qu’elle a changé - * Meilleure gestion des caractères spéciaux dans différents cas - * Compatibilité PHP 5.5+ avec OPcache - * Amélioration des performances - * Chargement automatique des classes - * Alternative dans le cas d’absence de librairie JSON - * Pour le développement, le cache HTTP peut être désactivé en créant un fichier “./data/no-cache.txt” -* Réorganisation des fichiers et répertoires, en particulier : - * Tous les fichiers utilisateur sont dans “./data/” (y compris “cache”, “favicons”, et “log”) - * Déplacement de “./app/configuration/application.ini” vers “./data/config.php” - * Meilleure sécurité et compatibilité - * Déplacement de “./public/data/Configuration.array.php” vers “./data/*_user.php” - * Déplacement de “./public/” vers “./p/” - * Déplacement de “./public/index.php” vers “./p/i/index.php” (voir cookie ci-dessous) - * Déplacement de “./actualize_script.php” vers “./app/actualize_script.php” (pour une meilleure sécurité) - * Pensez à mettre à jour votre Cron ! -* Divers : - * Nouvelle politique de cookie de session (témoin de connexion) - * Utilise un nom poli “FreshRSS” (évite des problèmes avec certains filtres) - * Se limite au répertoire “./FreshRSS/p/i/” pour de meilleures performances HTTP - * Les images, CSS, scripts sont servis sans cookie - * Utilise “HttpOnly” pour plus de sécurité - * Nouvel “agent utilisateur” exposé lors du téléchargement des flux, par exemple : - * “FreshRSS/0.7 (Linux; http://freshrss.org) SimplePie/1.3.1” - * Script d’actualisation avec plus de messages - * Sur la sortie standard, ainsi que dans le log système (syslog) - * Affichage du numéro de version dans "À propos" - - -## 2013-11-21 FreshRSS 0.6.1 - -* Corrige bug chargement du JavaScript -* Affiche un message d’erreur plus explicite si fichier de configuration inaccessible - - -## 2013-11-17 FreshRSS 0.6 - -* Nettoyage du code JavaScript + optimisations -* Utilisation d’adresses relatives -* Amélioration des performances coté client -* Mise à jour automatique du nombre d’articles non lus -* Corrections traductions -* Mise en cache de FreshRSS -* Amélioration des retours utilisateur lorsque la configuration n’est pas bonne -* Actualisation des flux après une importation OPML -* Meilleure prise en charge des flux RSS invalides -* Amélioration de la vue globale -* Possibilité de personnaliser les icônes de lecture -* Suppression de champs lors de l’installation (base_url et sel) -* Correction bugs divers - - -## 2013-10-15 FreshRSS 0.5.1 - -* Correction bug des catégories disparues -* Correction traduction i18n/fr et i18n/en -* Suppression de certains appels à la feuille de style fallback.css - - -## 2013-10-12 FreshRSS 0.5.0 - -* Possibilité d’interdire la lecture anonyme -* Option pour garder l’historique d’un flux -* Lors d’un clic sur “Marquer tous les articles comme lus”, FreshRSS peut désormais sauter à la prochaine catégorie / prochain flux avec des articles non lus. -* Ajout d’un token pour accéder aux flux RSS générés par FreshRSS sans nécessiter de connexion -* Possibilité de partager vers Facebook, Twitter et Google+ -* Possibilité de changer de thème -* Le menu de navigation (article précédent / suivant / haut de page) a été ajouté à la vue non mobile -* La police OpenSans est désormais appliquée -* Amélioration de la page de configuration -* Une meilleure sortie pour l’imprimante -* Quelques retouches du design par défaut -* Les vidéos ne dépassent plus du cadre de l’écran -* Nouveau logo -* Possibilité d’ajouter un préfixe aux tables lors de l’installation -* Ajout d’un champ en base de données keep_history à la table feed -* Si possible, création automatique de la base de données si elle n’existe pas lors de l’installation -* L’utilisation d’UTF-8 est forcée -* Le marquage automatique au défilement de la page a été amélioré -* La vue globale a été énormément améliorée et est beaucoup plus utile -* Amélioration des requêtes SQL -* Amélioration du JavaScript -* Correction bugs divers - - -## 2013-07-02 FreshRSS 0.4.0 - -* Correction bug et ajout notification lors de la phase d’installation -* Affichage d’erreur si fichier OPML invalide -* Les tags sont maintenant cliquables pour filtrer dessus -* Amélioration vue mobile (boutons plus gros et ajout d’une barre de navigation) -* Possibilité d’ajouter directement un flux dans une catégorie dès son ajout -* Affichage des flux en erreur (injoignable par exemple) en rouge pour les différencier -* Possibilité de changer les noms des flux -* Ajout d’une option (désactivable donc) pour charger les images en lazyload permettant de ne pas charger toutes les images d’un coup -* Le framework Minz est maintenant directement inclus dans l’archive (plus besoin de passer par ./build.sh) -* Amélioration des performances pour la récupération des flux tronqués -* Possibilité d’importer des flux sans catégorie lors de l’import OPML -* Suppression de “l’API” (qui était de toute façon très basique) et de la fonctionnalité de “notes” -* Amélioration de la recherche (garde en mémoire si l’on a sélectionné une catégorie) par exemple -* Modification apparence des balises hr et pre -* Meilleure vérification des champs de formulaire -* Remise en place du mode “endless” (permettant de simplement charger les articles qui suivent plutôt que de charger une nouvelle page) -* Ajout d’une page de visualisation des logs -* Ajout d’une option pour optimiser la BDD (diminue sa taille) -* Ajout des vues lecture et globale (assez basique) -* Les vidéos YouTube ne débordent plus du cadre sur les petits écrans -* Ajout d’une option pour marquer les articles comme lus lors du défilement (et suppression de celle au chargement de la page) - - -## 2013-05-05 FreshRSS 0.3.0 - -* Fallback pour les icônes SVG (utilisation de PNG à la place) -* Fallback pour les propriétés CSS3 (utilisation de préfixes) -* Affichage des tags associés aux articles -* Internationalisation de l’application (gestion des langues anglaise et française) -* Gestion des flux protégés par authentification HTTP -* Mise en cache des favicons -* Création d’un logo *temporaire* -* Affichage des vidéos dans les articles -* Gestion de la recherche et filtre par tags pleinement fonctionnels -* Création d’un vrai script CRON permettant de mettre tous les flux à jour -* Correction bugs divers - - -## 2013-04-17 FreshRSS 0.2.0 - -* Création d’un installateur -* Actualisation des flux en Ajax -* Partage par mail et Shaarli ajouté -* Export par flux RSS -* Possibilité de vider une catégorie -* Possibilité de sélectionner les catégories en vue mobile -* Les flux peuvent être sortis du flux principal (système de priorité) -* Amélioration ajout / import / export des flux -* Amélioration actualisation (meilleure gestion des erreurs) -* Améliorations CSS -* Changements dans la base de données -* Màj de la librairie SimplePie -* Flux sans auteurs gérés normalement -* Correction bugs divers - - -## 2013-04-08 FreshRSS 0.1.0 - -* “Première” version diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..da73c285e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,668 @@ +# Changelog + +## 2016-12-26 FreshRSS 1.6.2 + +* Features + * Add git compatibility in Web update system [#1357](https://github.com/FreshRSS/FreshRSS/issues/1357) + * Requires that the initial installation is done with git + * New option `limits.cookie_duration` in `data/config.php` to set the login cookie duration [#1384](https://github.com/FreshRSS/FreshRSS/issues/1384) +* SQL + * More robust export function in the case of large datasets [#1372](https://github.com/FreshRSS/FreshRSS/issues/1372) +* CLI + * New command `./cli/user-info.php` to get some user information [#1345](https://github.com/FreshRSS/FreshRSS/issues/1345) +* Bug fixing + * Fix bug in estimating last user activity [#1358](https://github.com/FreshRSS/FreshRSS/issues/1358) + * PostgreSQL: fix bug when updating cached values [#1360](https://github.com/FreshRSS/FreshRSS/issues/1360) + * Fix bug in confirmation before marking as read [#1348](https://github.com/FreshRSS/FreshRSS/issues/1348) + * Fix small bugs in installer [#1363](https://github.com/FreshRSS/FreshRSS/pull/1363) + * Allow slash in database hostname, when using sockets [#1364](https://github.com/FreshRSS/FreshRSS/issues/1364) + * Add curl user-agent to retrieve favicons [#1380](https://github.com/FreshRSS/FreshRSS/issues/1380) + * Send login cookie only once [#1398](https://github.com/FreshRSS/FreshRSS/pull/1398) + * Add a check for PHP extension fileinfo [#1375](https://github.com/FreshRSS/FreshRSS/issues/1375) + + +## 2016-11-02 FreshRSS 1.6.1 + +* Bug fixing + * Fix regression introduced in 1.6.0 when refreshing articles with *Mark updated articles as unread* [#1349](https://github.com/FreshRSS/FreshRSS/issues/1349) + + +## 2016-10-30 FreshRSS 1.6.0 + +* CLI + * New Command-Line Interface (CLI) [#1095](https://github.com/FreshRSS/FreshRSS/issues/1095) + * Install, add/delete users, actualize, import/export. See [CLI documentation](./cli/README.md). +* API + * Support for editing feeds and categories from client applications [#1254](https://github.com/FreshRSS/FreshRSS/issues/1254) +* Compatibility: + * Support for PostgreSQL [#416](https://github.com/FreshRSS/FreshRSS/issues/416) + * New client supporting FreshRSS on Linux: FeedReader 2.0+ [#1252](https://github.com/FreshRSS/FreshRSS/issues/1252) +* Features + * Rework the “mark as read during scroll” option, enabled by default for new users [#1258](https://github.com/FreshRSS/FreshRSS/issues/1258), [#1309](https://github.com/FreshRSS/FreshRSS/pull/1309) + * Including a *keep unread* function [#1327](https://github.com/FreshRSS/FreshRSS/pull/1327) + * In a multi-user context, take better advantage of other users’ refreshes [#1280](https://github.com/FreshRSS/FreshRSS/pull/1280) + * Better control of number of entries per page or RSS feed [#1249](https://github.com/FreshRSS/FreshRSS/issues/1249) + * Since X hours: `https://freshrss.example/i/?a=rss&hours=3` + * Explicit number: `https://freshrss.example/i/?a=rss&nb=10` + * Limited by `min_posts_per_rss` and `max_posts_per_rss` in user config + * Support custom ports `localhost:3306` for database servers [#1241](https://github.com/FreshRSS/FreshRSS/issues/1241) + * Add date to exported files [#1240](https://github.com/FreshRSS/FreshRSS/issues/1240) + * Auto-refresh favicons once or twice a month [#1181](https://github.com/FreshRSS/FreshRSS/issues/1181), [#1298](https://github.com/FreshRSS/FreshRSS/issues/1298) + * Cron updates will also refresh favicons every 2 weeks [#1306](https://github.com/FreshRSS/FreshRSS/pull/1306) +* Bug fixing + * Correction of bugs related to CSRF tokens introduced in version 1.5.0 [#1253](https://github.com/FreshRSS/FreshRSS/issues/1253), [44f22ab](https://github.com/FreshRSS/FreshRSS/pull/1261/commits/d9bf9b2c6f0b2cc9dec3b638841b7e3040dcf46f) + * Fix bug in Global view introduced in version 1.5.0 [#1269](https://github.com/FreshRSS/FreshRSS/pull/1269) + * Fix sharing bug [#1289](https://github.com/FreshRSS/FreshRSS/issues/1289) + * Fix bug in auto-loading more articles after marking an article as un-read [#1318](https://github.com/FreshRSS/FreshRSS/issues/1318) + * Fix bug during import of favourites [#1315](https://github.com/FreshRSS/FreshRSS/pull/1315), [#1312](https://github.com/FreshRSS/FreshRSS/issues/1312) + * Fix bug not respecting language option for new users [#1273](https://github.com/FreshRSS/FreshRSS/issues/1273) + * Bug in example of URL for FreshRSS RSS output with token [#1274](https://github.com/FreshRSS/FreshRSS/issues/1274) +* Security + * Prevent `<a target="_blank">` attacks with `window.opener` [#1245](https://github.com/FreshRSS/FreshRSS/issues/1245) + * Updated gitignore rules to keep user directories during a `git clean -f -d` [#1307](https://github.com/FreshRSS/FreshRSS/pull/1307) +* Extensions + * Allow extensions for default account in anonymous mode [#1288](https://github.com/FreshRSS/FreshRSS/pull/1288) + * Trigger a `freshrss:load-more` JavaScript event to help extensions [#1278](https://github.com/FreshRSS/FreshRSS/issues/1278) +* SQL + * Slightly modified several SQL requests (MySQL, SQLite) to simplify support of PostgreSQL [#1195](https://github.com/FreshRSS/FreshRSS/pull/1195) + * Increase performances by removing a superfluous category request [#1316](https://github.com/FreshRSS/FreshRSS/pull/1316) +* I18n + * Fix some messages during installation [#1339](https://github.com/FreshRSS/FreshRSS/pull/1339) +* UI + * Fix CSS line-height bug with `<sup>` in dates (English, Russian, Turkish) [#1340](https://github.com/FreshRSS/FreshRSS/pull/1340) + * Disable *Mark all as read* before confirmation script is loaded [#1342](https://github.com/FreshRSS/FreshRSS/issues/1342) + * Download icon 💾 for podcasts [#1236](https://github.com/FreshRSS/FreshRSS/issues/1236) +* SimplePie + * Fix auto-discovery of RSS feeds in Web pages served as `text/xml` [#1264](https://github.com/FreshRSS/FreshRSS/issues/1264) +* Misc. + * Removed *resource-priorities* attributes (`defer`, `lazyload`), deprecated by W3C [#1222](https://github.com/FreshRSS/FreshRSS/pull/1222) + + +## 2016-08-29 FreshRSS 1.5.0 + +* Compatibility + * Require at least MySQL 5.5.3+ [#1153](https://github.com/FreshRSS/FreshRSS/issues/1153) + * Require at least PHP 5.3.3+ [#1183](https://github.com/FreshRSS/FreshRSS/pull/1183) + * Restore compatibility with PHP 5.3.3 [#1208](https://github.com/FreshRSS/FreshRSS/issues/1208) + * Restore compatibility with Microsoft Internet Explorer 11 / Edge [#772](https://github.com/FreshRSS/FreshRSS/issues/772) +* Features + * Mark a search as read [#608](https://github.com/FreshRSS/FreshRSS/issues/608) + * Support for full Unicode such as emoji 💕 in MySQL with utf8mb4 [#1153](https://github.com/FreshRSS/FreshRSS/issues/1153) + * FreshRSS will automatically migrate MySQL tables to utf8mb4 the first time it is needed. +* Security + * Remove Mozilla Persona login (the service closes on 2016-11-30) [#1052](https://github.com/FreshRSS/FreshRSS/issues/1052) + * Use Referrer Policy `<meta name="referrer" content="never" />` for anonymizing HTTP Referer [#955](https://github.com/FreshRSS/FreshRSS/issues/955) + * Implement CSRF tokens for POST security [#570](https://github.com/FreshRSS/FreshRSS/issues/570) +* Bug fixing + * Fixed scroll in log view [#1178](https://github.com/FreshRSS/FreshRSS/issues/1178) + * Fixed JavaScript bug when articles were not always marked as read [#1123](https://github.com/FreshRSS/FreshRSS/issues/1123) + * Fixed Apache Etag issue that prevented caching [#1199](https://github.com/FreshRSS/FreshRSS/pull/1199) + * Fixed OPML import of categories [#1202](https://github.com/FreshRSS/FreshRSS/issues/1202) + * Fixed PubSubHubbub callback address bug on some configurations [1229](https://github.com/FreshRSS/FreshRSS/pull/1229) +* UI + * Use sticky category column [#1172](https://github.com/FreshRSS/FreshRSS/pull/1172) + * Updated to jQuery 3.1.0 and several JavaScript fixes (e.g. drag & drop) [#1197](https://github.com/FreshRSS/FreshRSS/pull/1197) +* API + * Add API link in FreshRSS profile settings to ease set-up [#1186](https://github.com/FreshRSS/FreshRSS/pull/1186) +* Misc. + * Work-around for SuperFeeder time-outs during PubSubHubbub registration [#1184](https://github.com/FreshRSS/FreshRSS/pull/1184) + * JSHint of JavaScript code and better initialisation [#1196](https://github.com/FreshRSS/FreshRSS/pull/1196) + * Updated credits, and images in README [#1201](https://github.com/FreshRSS/FreshRSS/issues/1201) + + +## 2016-07-23 FreshRSS 1.4.0 +## 2016-06-12 FreshRSS 1.3.2-beta + +* Compatibility + * Require at least PHP 5.3+ (drop PHP 5.2) [#1133](https://github.com/FreshRSS/FreshRSS/pull/1133) +* Features + * Support for MySQL 5.7+ (e.g. Ubuntu 16.04 LTS) [#1132](https://github.com/FreshRSS/FreshRSS/pull/1132) + * Speed optimization for HTTP/2 [#1133](https://github.com/FreshRSS/FreshRSS/pull/1133) + * API support for REDIRECT_* HTTP headers (fcgi) [#1128](https://github.com/FreshRSS/FreshRSS/issues/1128) +* SimplePie + * Support for feeds with invalid whitespace [#1142](https://github.com/FreshRSS/FreshRSS/issues/1142) +* Bug fixing + * Fix bug when adding feeds with passwords [#1137](https://github.com/FreshRSS/FreshRSS/pull/1137) + * Fix validator link [#1147](https://github.com/FreshRSS/FreshRSS/pull/1147) + * Fix Favicon small bugs [#1135](https://github.com/FreshRSS/FreshRSS/pull/1135) +* Security + * CSP compatibility for homepage [#1120](https://github.com/FreshRSS/FreshRSS/pull/1120) +* I18n + * Draft of Russian [#1085](https://github.com/FreshRSS/FreshRSS/pull/1085) +* Misc. + * Change default feed timeout to 15 seconds [#1146](https://github.com/FreshRSS/FreshRSS/pull/1146) + * Updated Wallabag v2 [#1150](https://github.com/FreshRSS/FreshRSS/pull/1150) + + +## 2016-03-11 FreshRSS 1.3.1-beta + +* Security + * Added CSP `Content-Security-Policy: default-src 'self'; child-src *; frame-src *; img-src * data:; media-src *` [#1075](https://github.com/FreshRSS/FreshRSS/issues/1075), [#1114](https://github.com/FreshRSS/FreshRSS/issues/1114) + * Added `X-Content-Type-Options: nosniff` [#1116](https://github.com/FreshRSS/FreshRSS/pull/1116) + * Cookie with `Secure` tag when used over HTTPS [#1117](https://github.com/FreshRSS/FreshRSS/pull/1117) + * Limit API post input to 1MB [#1118](https://github.com/FreshRSS/FreshRSS/pull/1118) +* Features + * New list of domains for which to force HTTPS (for images, videos, iframes…) defined in `./data/force-https.default.txt` and `./data/force-https.txt` [#1083](https://github.com/FreshRSS/FreshRSS/issues/1083) + * In particular useful for privacy and to avoid mixed content errors, e.g. to see YouTube videos when FreshRSS is in HTTPS + * Add sharing with “Journal du Hacker” [#1056](https://github.com/FreshRSS/FreshRSS/pull/1056) +* UI + * Updated to jQuery 2.2.1 and changed code for auto-load on scroll [#1050](https://github.com/FreshRSS/FreshRSS/pull/1050), [#1091](https://github.com/FreshRSS/FreshRSS/pull/1091) +* I18n + * Turkish [#1073](https://github.com/FreshRSS/FreshRSS/issues/1073) +* Bug fixing + * Fixed OPML import title bug [#1048](https://github.com/FreshRSS/FreshRSS/issues/1048) + * Fixed upgrade bug with SQLite when articles were marked as unread [#1049](https://github.com/FreshRSS/FreshRSS/issues/1049) + * Fixed error when deleting feeds from statistics page [#1047](https://github.com/FreshRSS/FreshRSS/issues/1047) + * Fixed several small bugs in global and reader view [#1050](https://github.com/FreshRSS/FreshRSS/pull/1050) + * Fixed sharing bug with PHP7 [#1072](https://github.com/FreshRSS/FreshRSS/issues/1072) + * Fixed fall-back when php-json is not installed [#1092](https://github.com/FreshRSS/FreshRSS/issues/1092) +* API + * Possibility to show only read items [#1035](https://github.com/FreshRSS/FreshRSS/pull/1035) +* Misc. + * Filters `<img />` attributes `srcset` and `sizes` [#1077](https://github.com/FreshRSS/FreshRSS/issues/1077), [#1086](https://github.com/FreshRSS/FreshRSS/pull/1086) + * Implement PubSubHubbub unsubscribe responses [#1058](https://github.com/FreshRSS/FreshRSS/issues/1058) + * Restored some compatibility with PHP 5.2 [#1055](https://github.com/FreshRSS/FreshRSS/issues/1055) + * Check for extension php-xml during install [#1094](https://github.com/FreshRSS/FreshRSS/issues/1094) + * Updated the sharing with Movim [#1030](https://github.com/FreshRSS/FreshRSS/pull/1030) + + +## 2015-11-03 FreshRSS 1.2.0 / 1.3.0-beta + +* Features + * Share with Movim [#992](https://github.com/FreshRSS/FreshRSS/issues/992) + * New option to allow robots / search engines [#938](https://github.com/FreshRSS/FreshRSS/issues/938) +* Security + * Invalid logins now return HTTP 403, to be easier to catch (e.g. fail2ban) [#1015](https://github.com/FreshRSS/FreshRSS/issues/1015) +* UI + * Remove "title" field during installation [#858](https://github.com/FreshRSS/FreshRSS/issues/858) + * Visual alert on categories containing feeds in error [#984](https://github.com/FreshRSS/FreshRSS/pull/984) +* I18n + * Italian [#1003](https://github.com/FreshRSS/FreshRSS/issues/1003) +* Misc. + * Support reverse proxy [#975](https://github.com/FreshRSS/FreshRSS/issues/975) + * Make auto-update server URL alterable [#1019](https://github.com/FreshRSS/FreshRSS/issues/1019) + + +## 2015-09-12 FreshRSS 1.1.3-beta + +* UI + * Configuration page for global settings such as limits [#958](https://github.com/FreshRSS/FreshRSS/pull/958) + * Add feed ID in articles to ease styling [#953](https://github.com/FreshRSS/FreshRSS/issues/953) +* I18n + * Dutch [#949](https://github.com/FreshRSS/FreshRSS/issues/949) +* Bug fixing + * Session cookie bug [#924](https://github.com/FreshRSS/FreshRSS/issues/924) + * Better error handling for PubSubHubbub [#939](https://github.com/FreshRSS/FreshRSS/issues/939) + * Fix tag search link from articles [#970](https://github.com/FreshRSS/FreshRSS/issues/970) + * Fix all queries deleted when deleting a feed or category [#982](https://github.com/FreshRSS/FreshRSS/pull/982) + + +## 2015-07-30 FreshRSS 1.1.2-beta + +* Features + * Support for PubSubHubbub for instant notifications from compatible Web sites. [#312](https://github.com/FreshRSS/FreshRSS/issues/312) + * cURL options to use a proxy for retrieving feeds. [#897](https://github.com/FreshRSS/FreshRSS/issues/897) [#675](https://github.com/FreshRSS/FreshRSS/issues/675) + * Allow anonymous users to create an account. [#679](https://github.com/FreshRSS/FreshRSS/issues/679) +* Security + * cURL options to verify or not SSL/TLS certificates (now enabled by default). [#897](https://github.com/FreshRSS/FreshRSS/issues/897) [#502](https://github.com/FreshRSS/FreshRSS/issues/502) + * Support for SSL connection to MySQL. [#868](https://github.com/FreshRSS/FreshRSS/issues/868) + * Workaround for browsers that have disabled support for `<form autocomplete="off">`. [#880](https://github.com/FreshRSS/FreshRSS/issues/880) +* UI + * Force UTF-8 for responses. [#870](https://github.com/FreshRSS/FreshRSS/issues/870) + * Increased pagination limit to 500 articles. [#872](https://github.com/FreshRSS/FreshRSS/issues/872) + * Improved UI for installation. [#855](https://github.com/FreshRSS/FreshRSS/issues/855) +* Misc. + * PHP 7 officially supported (~70% speed improvements on early tests). [#889](https://github.com/FreshRSS/FreshRSS/issues/889) + * Restore support for PHP 5.2.1+. [#214a5cc](https://github.com/Alkarex/FreshRSS/commit/214a5cc9a4c2b821961bc21f22b4b08e34b5be68) [#894](https://github.com/FreshRSS/FreshRSS/issues/894) + * Support for data-src for images of articles retrieved via the full-content module. [#877](https://github.com/FreshRSS/FreshRSS/issues/877) + * Add a couple of default feeds for fresh installations. [#886](https://github.com/FreshRSS/FreshRSS/issues/886) + * Changed some log visibilities. [#885](https://github.com/FreshRSS/FreshRSS/issues/885) + * Fix broken links for extension script / style files. [#862](https://github.com/FreshRSS/FreshRSS/issues/862) + * Load default configuration during installation to avoid hard-coded values. [#890](https://github.com/FreshRSS/FreshRSS/issues/890) + * Fix non-consistent behaviour in Minz_Request::getBaseUrl() and introduce Minz_Request::guessBaseUrl(). [#906](https://github.com/FreshRSS/FreshRSS/issues/906) + * Generate `base_url` during the installation and add a `pubsubhubbub_enabled` configuration key. [#865](https://github.com/FreshRSS/FreshRSS/issues/865) + * Load configuration by recursion to overwrite array values. [#923](https://github.com/FreshRSS/FreshRSS/issues/923) + * Cast `$limits` configuration values in integer. [#925](https://github.com/FreshRSS/FreshRSS/issues/925) + * Don't hide errors in configuration. [#920](https://github.com/FreshRSS/FreshRSS/issues/920) + + +## 2015-05-31 FreshRSS 1.1.1 (beta) + +* Features + * New option to detect and mark updated articles as unread. + * Support for internationalized domain name (IDN). + * Improved logic for automatic deletion of old articles. +* API + * Work-around for News+ bug when there is no unread article on the server. +* UI + * New confirmation message when leaving a configuration page without saving the changes. +* Bug fixing + * Corrected bug introduced in previous beta about handling of HTTP 301 (feeds that have changed address) + * Corrected bug in FreshRSS RSS feeds. +* Security + * Sanitize HTTP request header `Host`. +* Misc. + * Attempt to better handle encoded article titles. + + +## 2015-01-31 FreshRSS 1.0.0 / 1.1.0 (beta) + +* UI + * Slider math with Dark theme + * Add a message if request failed for mark as read / favourite +* I18n + * Fix some sentences + * Add German as a supported language + * Add some indications on password format +* Bug fixing + * Some shortcuts was never saved + * Global view didn't work if set by default + * Minz_Error was badly raised + * Feed update failed if nothing had changed (MySQL only) + * CRON task failed with multiple users + * Tricky bug caused by cookie path + * Email sharing was badly supported (no urlencode()) +* Misc. + * Add a CREDIT file with contributor names + * Update lib_opml + * Default favicon is now served by HTTP code 200 + * Change calls to syslog by Minz_Log::notice + * HTTP credentials are no longer logged + + +## 2015-01-15 FreshRSS 0.9.4 (beta) + +* Feature + * Extension system (!!): some extensions are available at https://github.com/FreshRSS/Extensions +* Refactoring + * Front controller (FreshRSS class) + * Configuration system + * Sharing system + * New data files organization +* Updates + * Remove restriction of 1h for updates + * Show the current version of FreshRSS and the next one +* UI + * Remove the "sticky position" of the feed aside (moved into an extension) + * "Show password" shows the password only while the user is pressing the mouse. + + +## 2014-12-12 FreshRSS 0.9.3 (beta) + +* SimplePie + * Support for content-type application/x-rss+xml + * New force_feed option (for feeds sent with the wrong content-type / MIME) by adding #force_feed at the end of the feed URL + * Improved error messages +* Statistics + * Add information on feed repartition pages + * Add percent repartition for the bigger feeds +* UI + * New theme selector + * Update Screwdriver theme + * Add BlueLagoon theme by Mister aiR +* Misc. + * Add option to remove articles after reading them + * Add comments + * Refactor i18n system to avoid loading unnecessary strings + * Fix security issue in Minz_Error::error() method + * Fix redirection after refreshing a given feed + + +## 2014-10-31 FreshRSS 0.9.2 (beta) + +* UI + * New subscription page (introduce .box items) + * Change feed category by drag and drop + * New feed aside on the main page + * New configuration / administration organization +* Configuration + * New options in config.php for cache duration, timeout, max inactivity, max number of feeds and categories per user. +* Refactoring + * Refactor authentication system (introduce FreshRSS_Auth model) + * Refactor indexController (introduce FreshRSS_Context model) + * Use ```_t()```, ```_i()```, ```_url()```, ```Minz_Request::good()``` and ```Minz_Request::bad()``` as much as possible + * Refactor javascript_vars.phtml + * Better coding style +* I18n + * Introduce a new system for i18n keys (not finished yet) +* Misc. + * Fix global view (did not work anymore) + * Add do_post_update for update system + * Introduce ```checkInstallAction``` to test if FreshRSS installation is ok + + +## 2014-10-09 FreshRSS 0.8.1 / 0.9.1 (beta) + +* UI + * Add a space after tag icon +* Statistics + * Add an average per day on the 30-day period graph + * Add percent of total on top 10 feed +* Bug fixes + * Fix "mark as read" in global view + * Fix "read all" shortcut + * Fix categories not appearing when adding a new feed (GET action) + * Fix enclosure problem + * Fix getExtension() on PHP < 5.3.7 + + +## 2014-09-26 FreshRSS 0.8.0 / 0.9.0 (beta) + +* UI + * New interface for statistics + * Fix filter buttons + * Number of articles divided by 2 in reading view + * Redesign of bigMarkAsRead +* Features + * New automatic update system + * New reset auth system +* Security + * "Mark as read" requires POST requests for several articles + * Test HTTP REFERER in install.php +* Configuration + * New "Show all articles" / "Show only unread" / "Adjust viewing" option + * New notification timeout option +* Misc. + * Improve coding style + comments + * Fix SQLite bug "ON DELETE CASCADE" + * Improve performance when importing articles + + +## 2014-08-24 FreshRSS 0.7.4 + +* UI + * Hide categories/feeds with unread articles when showing only unread articles + * Dynamic favicon showing the number of unread articles + * New theme: Screwdriver by Mister aiR +* Statistics + * New page with article repartition + * Improvements +* Security + * Basic protection against XSRF (Cross-Site Request Forgery) based on HTTP Referer (POST requests only) +* API + * Compatible with lighttpd +* Misc. + * Changed lazyload implementation + * Support of HTML5 notifications for new upcoming articles + * Add option to stay logged in +* Bug fixes in export function, add/remove users, keyboard shortcuts, etc. + + +## 2014-07-21 FreshRSS 0.7.3 + +* New options + * Add system of user queries which are shortcuts to filter the view + * New TTL option to limit the frequency at which feeds are refreshed (by cron or manual refresh button). + It is still possible to manually refresh an individual feed at a higher frequency. +* SQL + * Add support for SQLite (beta) in addition to MySQL +* SimplePie + * Complies with HTTP "301 Moved Permanently" responses by automatically updating the URL of feeds that have changed address. +* Themes + * Flat and Dark designs are based on same template file as Origine +* Statistics + * Refactor code + * Add an idle feed page +* Misc + * Several bug fixes + * Add confirmation option when marking all articles as read + * Fix some typo + + +## 2014-06-13 FreshRSS 0.7.2 + +* API compatible with Google Reader API level 2 + * FreshRSS can now be used from e.g.: + * (Android) News+ https://play.google.com/store/apps/details?id=com.noinnion.android.newsplus.extension.google_reader + * (Android) EasyRSS https://github.com/Alkarex/EasyRSS +* Basic support for audio and video podcasts +* Searching + * New search filters date: and pubdate: accepting ISO 8601 date intervals such as `date:2013-2014` or `pubdate:P1W` + * Possibility to combine search filters, e.g. `date:2014-05 intitle:FreshRSS intitle:Open great reader #Internet` +* Change nav menu with more buttons instead of dropdown menus and add some filters +* New system of import / export + * Support OPML, Json (like Google Reader) and ZIP archives + * Can export and import articles (specific option for favorites) +* Refactor "Origine" theme + * Some improvements + * Based on a template file (other themes will use it too) + + +## 2014-02-19 FreshRSS 0.7.1 + +* Mise à jour des flux plus rapide grâce à une meilleure utilisation du cache + * Utilisation d’une signature MD5 du contenu intéressant pour les flux n’implémentant pas les requêtes conditionnelles +* Modification des raccourcis + * "s" partage directement si un seul moyen de partage + * Moyens de partage accessibles par "1", "2", "3", etc. + * Premier article : Home ; Dernier article : End + * Ajout du déplacement au sein des catégories / flux (via modificateurs shift et alt) +* UI + * Séparation des descriptions des raccourcis par groupes + * Revue rapide de la page de connexion + * Amélioration de l'affichage des notifications sur mobile +* Revue du système de rafraîchissement des flux + * Meilleure gestion de la file de flux à rafraîchir en JSON + * Rafraîchissement uniquement pour les flux non rafraîchis récemment + * Possibilité donnée aux anonymes de rafraîchir les flux +* SimplePie + * Mise à jour de la lib + * Corrige fuite de mémoire + * Meilleure tolérance aux flux invalides +* Corrections divers + * Ne déplie plus l'article lors du clic sur l'icône lien externe + * Ne boucle plus à la fin de la navigation dans les articles + * Suppression du champ category.color inutile + * Corrige bug redirection infinie (Persona) + * Amélioration vérification de la requête POST + * Ajout d'un verrou lorsqu'une action mark_read ou mark_favorite est en cours + + +## 2014-01-29 FreshRSS 0.7 + +* Nouveau mode multi-utilisateur + * L’utilisateur par défaut (administrateur) peut créer et supprimer d’autres utilisateurs + * Nécessite un contrôle d’accès, soit : + * par le nouveau mode de connexion par formulaire (nom d’utilisateur + mot de passe) + * relativement sûr même sans HTTPS (le mot de passe n’est pas transmis en clair) + * requiert JavaScript et PHP 5.3+ + * par HTTP (par exemple sous Apache en créant un fichier ./p/i/.htaccess et .htpasswd) + * le nom d’utilisateur HTTP doit correspondre au nom d’utilisateur FreshRSS + * par Mozilla Persona, en renseignant l’adresse courriel des utilisateurs +* Installateur supportant les mises à jour : + * Depuis une v0.6, placer application.ini et Configuration.array.php dans le nouveau répertoire “./data/” + (voir réorganisation ci-dessous) + * Pour les versions suivantes, juste garder le répertoire “./data/” +* Rafraîchissement automatique du nombre d’articles non lus toutes les deux minutes (utilise le cache HTTP à bon escient) + * Permet aussi de conserver la session valide, surtout dans le cas de Persona +* Nouvelle page de statistiques (nombres d’articles par jour / catégorie) +* Importation OPML instantanée et plus tolérante +* Nouvelle gestion des favicons avec téléchargement en parallèle +* Nouvelles options + * Réorganisation des options + * Gestion des utilisateurs + * Améliorations partage vers Shaarli, Poche, Diaspora*, Facebook, Twitter, Google+, courriel + * Raccourci ‘s’ par défaut + * Permet la suppression de tous les articles d’un flux + * Option pour marquer les articles comme lus dès la réception + * Permet de configurer plus finement le nombre d’articles minimum à conserver par flux + * Permet de modifier la description et l’adresse d’un flux RSS ainsi que le site Web associé + * Nouveau raccourci pour ouvrir/fermer un article (‘c’ par défaut) + * Boutons pour effacer les logs et pour purger les vieux articles + * Nouveaux filtres d’affichage : seulement les articles favoris, et seulement les articles lus +* SQL : + * Nouveau moteur de recherche, aussi accessible depuis la vue mobile + * Mots clefs de recherche “intitle:”, “inurl:”, “author:” + * Les articles sont triés selon la date de leur ajout dans FreshRSS plutôt que la date déclarée (souvent erronée) + * Permet de marquer tout comme lu sans affecter les nouveaux articles arrivés en cours de lecture + * Permet une pagination efficace + * Refactorisation + * Les tables sont préfixées avec le nom d’utilisateur afin de permettre le mode multi-utilisateurs + * Amélioration des performances + * Tolère un beaucoup plus grand nombre d’articles + * Compression des données côté MySQL plutôt que côté PHP + * Incompatible avec la version 0.6 (nécessite une mise à jour grâce à l’installateur) + * Affichage de la taille de la base de données dans FreshRSS + * Correction problème de marquage de tous les favoris comme lus +* HTML5 : + * Support des balises HTML5 audio, video, et éléments associés + * Utilisation de preload="none", et réécriture correcte des adresses, aussi en HTTPS + * Protection HTML5 des iframe (sandbox="allow-scripts allow-same-origin") + * Filtrage des object et embed + * Chargement différé HTML5 (postpone="") pour iframe et video + * Chargement différé JavaScript pour iframe +* CSS : + * Nouveau thème sombre + * Chargement plus robuste des thèmes + * Meilleur support des longs titres d’articles sur des écrans étroits + * Meilleure accessibilité + * FreshRSS fonctionne aussi en mode dégradé sans images (alternatives Unicode) et/ou sans CSS + * Diverses améliorations +* PHP : + * Encore plus tolérant pour les flux comportant des erreurs + * Mise à jour automatique de l’URL du flux (en base de données) lorsque SimplePie découvre qu’elle a changé + * Meilleure gestion des caractères spéciaux dans différents cas + * Compatibilité PHP 5.5+ avec OPcache + * Amélioration des performances + * Chargement automatique des classes + * Alternative dans le cas d’absence de librairie JSON + * Pour le développement, le cache HTTP peut être désactivé en créant un fichier “./data/no-cache.txt” +* Réorganisation des fichiers et répertoires, en particulier : + * Tous les fichiers utilisateur sont dans “./data/” (y compris “cache”, “favicons”, et “log”) + * Déplacement de “./app/configuration/application.ini” vers “./data/config.php” + * Meilleure sécurité et compatibilité + * Déplacement de “./public/data/Configuration.array.php” vers “./data/*_user.php” + * Déplacement de “./public/” vers “./p/” + * Déplacement de “./public/index.php” vers “./p/i/index.php” (voir cookie ci-dessous) + * Déplacement de “./actualize_script.php” vers “./app/actualize_script.php” (pour une meilleure sécurité) + * Pensez à mettre à jour votre Cron ! +* Divers : + * Nouvelle politique de cookie de session (témoin de connexion) + * Utilise un nom poli “FreshRSS” (évite des problèmes avec certains filtres) + * Se limite au répertoire “./FreshRSS/p/i/” pour de meilleures performances HTTP + * Les images, CSS, scripts sont servis sans cookie + * Utilise “HttpOnly” pour plus de sécurité + * Nouvel “agent utilisateur” exposé lors du téléchargement des flux, par exemple : + * “FreshRSS/0.7 (Linux; http://freshrss.org) SimplePie/1.3.1” + * Script d’actualisation avec plus de messages + * Sur la sortie standard, ainsi que dans le log système (syslog) + * Affichage du numéro de version dans "À propos" + + +## 2013-11-21 FreshRSS 0.6.1 + +* Corrige bug chargement du JavaScript +* Affiche un message d’erreur plus explicite si fichier de configuration inaccessible + + +## 2013-11-17 FreshRSS 0.6 + +* Nettoyage du code JavaScript + optimisations +* Utilisation d’adresses relatives +* Amélioration des performances coté client +* Mise à jour automatique du nombre d’articles non lus +* Corrections traductions +* Mise en cache de FreshRSS +* Amélioration des retours utilisateur lorsque la configuration n’est pas bonne +* Actualisation des flux après une importation OPML +* Meilleure prise en charge des flux RSS invalides +* Amélioration de la vue globale +* Possibilité de personnaliser les icônes de lecture +* Suppression de champs lors de l’installation (base_url et sel) +* Correction bugs divers + + +## 2013-10-15 FreshRSS 0.5.1 + +* Correction bug des catégories disparues +* Correction traduction i18n/fr et i18n/en +* Suppression de certains appels à la feuille de style fallback.css + + +## 2013-10-12 FreshRSS 0.5.0 + +* Possibilité d’interdire la lecture anonyme +* Option pour garder l’historique d’un flux +* Lors d’un clic sur “Marquer tous les articles comme lus”, FreshRSS peut désormais sauter à la prochaine catégorie / prochain flux avec des articles non lus. +* Ajout d’un token pour accéder aux flux RSS générés par FreshRSS sans nécessiter de connexion +* Possibilité de partager vers Facebook, Twitter et Google+ +* Possibilité de changer de thème +* Le menu de navigation (article précédent / suivant / haut de page) a été ajouté à la vue non mobile +* La police OpenSans est désormais appliquée +* Amélioration de la page de configuration +* Une meilleure sortie pour l’imprimante +* Quelques retouches du design par défaut +* Les vidéos ne dépassent plus du cadre de l’écran +* Nouveau logo +* Possibilité d’ajouter un préfixe aux tables lors de l’installation +* Ajout d’un champ en base de données keep_history à la table feed +* Si possible, création automatique de la base de données si elle n’existe pas lors de l’installation +* L’utilisation d’UTF-8 est forcée +* Le marquage automatique au défilement de la page a été amélioré +* La vue globale a été énormément améliorée et est beaucoup plus utile +* Amélioration des requêtes SQL +* Amélioration du JavaScript +* Correction bugs divers + + +## 2013-07-02 FreshRSS 0.4.0 + +* Correction bug et ajout notification lors de la phase d’installation +* Affichage d’erreur si fichier OPML invalide +* Les tags sont maintenant cliquables pour filtrer dessus +* Amélioration vue mobile (boutons plus gros et ajout d’une barre de navigation) +* Possibilité d’ajouter directement un flux dans une catégorie dès son ajout +* Affichage des flux en erreur (injoignable par exemple) en rouge pour les différencier +* Possibilité de changer les noms des flux +* Ajout d’une option (désactivable donc) pour charger les images en lazyload permettant de ne pas charger toutes les images d’un coup +* Le framework Minz est maintenant directement inclus dans l’archive (plus besoin de passer par ./build.sh) +* Amélioration des performances pour la récupération des flux tronqués +* Possibilité d’importer des flux sans catégorie lors de l’import OPML +* Suppression de “l’API” (qui était de toute façon très basique) et de la fonctionnalité de “notes” +* Amélioration de la recherche (garde en mémoire si l’on a sélectionné une catégorie) par exemple +* Modification apparence des balises hr et pre +* Meilleure vérification des champs de formulaire +* Remise en place du mode “endless” (permettant de simplement charger les articles qui suivent plutôt que de charger une nouvelle page) +* Ajout d’une page de visualisation des logs +* Ajout d’une option pour optimiser la BDD (diminue sa taille) +* Ajout des vues lecture et globale (assez basique) +* Les vidéos YouTube ne débordent plus du cadre sur les petits écrans +* Ajout d’une option pour marquer les articles comme lus lors du défilement (et suppression de celle au chargement de la page) + + +## 2013-05-05 FreshRSS 0.3.0 + +* Fallback pour les icônes SVG (utilisation de PNG à la place) +* Fallback pour les propriétés CSS3 (utilisation de préfixes) +* Affichage des tags associés aux articles +* Internationalisation de l’application (gestion des langues anglaise et française) +* Gestion des flux protégés par authentification HTTP +* Mise en cache des favicons +* Création d’un logo *temporaire* +* Affichage des vidéos dans les articles +* Gestion de la recherche et filtre par tags pleinement fonctionnels +* Création d’un vrai script CRON permettant de mettre tous les flux à jour +* Correction bugs divers + + +## 2013-04-17 FreshRSS 0.2.0 + +* Création d’un installateur +* Actualisation des flux en Ajax +* Partage par mail et Shaarli ajouté +* Export par flux RSS +* Possibilité de vider une catégorie +* Possibilité de sélectionner les catégories en vue mobile +* Les flux peuvent être sortis du flux principal (système de priorité) +* Amélioration ajout / import / export des flux +* Amélioration actualisation (meilleure gestion des erreurs) +* Améliorations CSS +* Changements dans la base de données +* Màj de la librairie SimplePie +* Flux sans auteurs gérés normalement +* Correction bugs divers + + +## 2013-04-08 FreshRSS 0.1.0 + +* “Première” version diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..133813711 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,57 @@ +# How to contribute to FreshRSS? + +## Join us on the mailing lists + +Do you want to ask us some questions? Do you want to discuss with us? Don't hesitate to subscribe to our mailing lists! + +- The first mailing is destined to generic information, it should be adapted to users. [Join mailing@freshrss.org](https://freshrss.org/mailman/listinfo/mailing). +- The second mailing is mainly for developers. [Join dev@freshrss.org](https://freshrss.org/mailman/listinfo/dev) + +## Report a bug + +You found a bug? Don't panic, here are some steps to report it easily: + +1. Search for it on [the bug tracker](https://github.com/FreshRSS/FreshRSS/issues) (don't forget to use the search bar). +2. If you find a similar bug, don't hesitate to post a comment to add more importance to the related ticket. +3. If you didn't find it, [open a new ticket](https://github.com/FreshRSS/FreshRSS/issues/new). + +If you have to create a new ticket, try to apply the following advices: + +- Give an explicit title to the ticket so it will be easier to find it later. +- Be as exhaustive as possible in the description: what did you do? What is the bug? What are the steps to reproduce the bug? +- We also need some information: + + Your FreshRSS version (on about page or `constants.php` file) + + Your server configuration: type of hosting, PHP version + + Your storage system (MySQL / MariaDB or SQLite) + + If possible, the related logs (PHP logs and FreshRSS logs under `data/users/your_user/log.txt`) + +## Fix a bug + +Did you want to fix a bug? To keep a great coordination between collaborators, you will have to follow these indications: + +1. Be sure the bug is associated to a ticket and say you work on it. +2. [Fork this project repository](https://help.github.com/articles/fork-a-repo/). +3. [Create a new branch](https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/). The name of the branch must be explicit and being prefixed by the related ticket id. For instance, `783-contributing-file` to fix [ticket #783](https://github.com/FreshRSS/FreshRSS/issues/783). +4. Make your changes to your fork and [send a pull request](https://help.github.com/articles/using-pull-requests/) on the **dev branch**. + +If you have to write code, please follow [our coding style recommendations](http://doc2.freshrss.org/en/Developer_documentation/First_steps/Coding_style). + +**Tip:** if you are searching for bugs easy to fix, have a look at the « [New comers](https://github.com/FreshRSS/FreshRSS/labels/New%20comers) » ticket label. + +## Submit an idea + +You have great ideas, yes! Don't be shy and open [a new ticket](https://github.com/FreshRSS/FreshRSS/issues/new) on our bug tracker to ask if we can implement it. The greatest ideas often come from the shyest suggestions! + +If your idea is nice, we'll have a look at it. + +## Contribute to internationalization (i18n) + +If you want to improve internationalization, please open a new ticket first and follow indications from « Fix a bug » section. + +Translations are present in the subdirectories of `./app/i18n/`. + +We are working on a better way to handle internationalization but don't hesitate to suggest any idea! + +## Contribute to documentation + +The documentation needs a lot of improvements in order to be more useful to new contributors and we are working on it. If you want to give some help, meet us on [the dedicated repository](https://github.com/FreshRSS/documentation)! diff --git a/CREDITS.md b/CREDITS.md new file mode 100644 index 000000000..827a8cfd3 --- /dev/null +++ b/CREDITS.md @@ -0,0 +1,37 @@ +This is a credit file of people who have [contributed to FreshRSS](https://github.com/FreshRSS/FreshRSS/graphs/contributors) with, at least, +one commit on one of the FreshRSS repositories (at https://github.com/FreshRSS). +Please note a commit on THIS specific file is not considered as a contribution +(too easy!). Its purpose is to show that even the smallest contribution is important. +People are sorted by name so please keep this order. + +--- + +* [Alexandre Alapetite](https://github.com/Alkarex): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=Alkarex), [Web](http://alexandre.alapetite.fr/) +* [Alexis Degrugillier](https://github.com/aledeg): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=aledeg) +* [Alwaysin](https://github.com/Alwaysin): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=Alwaysin) +* [Amaury Carrade](https://github.com/AmauryCarrade): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=AmauryCarrade), [Web](https://amaury.carrade.eu/) +* [ASMfreaK](https://github.com/ASMfreaK): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=ASMfreaK) +* [Damstre](https://github.com/Damstre): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:Damstre), +* [danc](https://github.com/danc): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=danc), [Web](http://tintouli.free.fr/) +* [ealdraed](https://github.com/ealdraed): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=ealdraed) +* [Frans de Jonge](https://github.com/Frenzie): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=Frenzie), [Web](http://fransdejonge.com/) +* [Guillaume Fillon](https://github.com/kokaz): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:kokaz), [Web](http://www.guillaume-fillon.com/) +* [hckweb](https://github.com/hckweb): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=hckweb) +* [Jaussoin Timothée](https://github.com/edhelas): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=edhelas), [Web](http://edhelas.movim.eu/) +* [Julien Reichardt](https://github.com/j8r): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=j8r), [Web](https://blog.jrei.ch/) +* [Kevin Papst](https://github.com/kevinpapst): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=kevinpapst), [Web](http://www.kevinpapst.de/) +* [Luc Didry](https://github.com/ldidry): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=ldidry), [Web](https://www.fiat-tux.fr/) +* [marcomrc](https://github.com/marcomrc): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=marcomrc) +* [Marcus Rohrmoser](https://github.com/mro): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=mro), [Web](http://mro.name/~me) +* [Marien Fressinaud](https://github.com/marienfressinaud): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=marienfressinaud), [Web](http://marienfressinaud.fr/) +* [Melvyn Laïly](https://github.com/yaurthek): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=yaurthek), [Web](http://x2a.yt/) +* [Nicolas Elie](https://github.com/nicolaselie): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=nicolaselie) +* [Nicolas Lœuillet](https://github.com/nicosomb): [contributions](https://github.com/FreshRSS/documentation/commits?author=nicosomb), [Web](http://www.loeuillet.org/) +* [plopoyop](https://github.com/plopoyop): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=plopoyop) +* [purexo](https://github.com/purexo): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:purexo), [Web](https://purexo.mom/) +* [Quentin Dufour](https://github.com/superboum): [contributions](https://github.com/FreshRSS/documentation/commits?author=superboum), [Web](http://quentin.dufour.io/) +* [romibi](https://github.com/romibi): [contributions](https://github.com/FreshRSS/FreshRSS/commits/dev?author=romibi) +* [subic](https://github.com/subic): [contributions](https://github.com/FreshRSS/documentation/commits?author=subic) +* [Tets42](https://github.com/Tets42): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=Tets42) +* [tomgue](https://github.com/tomgue): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=tomgue) +* [Wanabo](https://github.com/Wanabo): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=Wanabo) diff --git a/README.fr.md b/README.fr.md new file mode 100644 index 000000000..b0b46bf65 --- /dev/null +++ b/README.fr.md @@ -0,0 +1,179 @@ +* [English version](README.md) + +# FreshRSS +FreshRSS est un agrégateur de flux RSS à auto-héberger à l’image de [Leed](http://projet.idleman.fr/leed/) ou de [Kriss Feed](http://tontof.net/kriss/feed/). + +Il se veut léger et facile à prendre en main tout en étant un outil puissant et paramétrable. + +Il permet de gérer plusieurs utilisateurs, et dispose d’un mode de lecture anonyme. +Il supporte [PubSubHubbub](https://code.google.com/p/pubsubhubbub/) pour des notifications instantanées depuis les sites compatibles. +Il y a une API pour les clients (mobiles), ainsi qu’une [interface en ligne de commande](./cli/README.md). +Enfin, il permet l’ajout d’[extensions](#extensions) pour encore plus de personnalisation. + +* Site officiel : http://freshrss.org +* Démo : http://demo.freshrss.org/ +* Licence : [GNU AGPL 3](http://www.gnu.org/licenses/agpl-3.0.html) + + + +# Téléchargement +Voir la [liste des versions](../../releases). + +## À propos des branches +* Utilisez [la branche master](https://github.com/FreshRSS/FreshRSS/tree/master/) si vous visez la stabilité. +* Pour ceux qui veulent bien aider à tester ou déveloper les dernières fonctionnalités, [la branche dev](https://github.com/FreshRSS/FreshRSS/tree/dev) vous ouvre les bras ! + +# Avertissements +Cette application a été développée pour s’adapter principalement à des besoins personnels, et aucune garantie n’est fournie. +Les demandes de fonctionnalités, rapports de bugs, et autres contributions sont les bienvenues. Privilégiez pour cela des [demandes sur GitHub](https://github.com/FreshRSS/FreshRSS/issues). +Nous sommes une communauté amicale. + +# Prérequis +* Serveur modeste, par exemple sous Linux ou Windows + * Fonctionne même sur un Raspberry Pi 1 avec des temps de réponse < 1s (testé sur 150 flux, 22k articles) +* Serveur Web Apache2 (recommandé), ou nginx, lighttpd (non testé sur les autres) +* PHP 5.3.3+ (PHP 5.4+ recommandé, et PHP 5.5+ pour les performances, et PHP 7+ pour d’encore meilleures performances) + * Requis : [cURL](http://php.net/curl), [DOM](http://php.net/dom), [XML](http://php.net/xml), et [PDO_MySQL](http://php.net/pdo-mysql) ou [PDO_SQLite](http://php.net/pdo-sqlite) ou [PDO_PGSQL](http://php.net/pdo-pgsql) + * Recommandés : [JSON](http://php.net/json), [GMP](http://php.net/gmp) (pour accès API sur plateformes < 64 bits), [IDN](http://php.net/intl.idn) (pour les noms de domaines internationalisés), [mbstring](http://php.net/mbstring) et/ou [iconv](http://php.net/iconv) (pour conversion d’encodages), [ZIP](http://php.net/zip) (pour import/export), [zlib](http://php.net/zlib) (pour les flux compressés) +* MySQL 5.5.3+ (recommandé), ou SQLite 3.7.4+, ou PostgreSQL (experimental) +* Un navigateur Web récent tel Firefox, Internet Explorer 11 / Edge, Chrome, Opera, Safari. + * Fonctionne aussi sur mobile + + + +# Installation +1. Récupérez l’application FreshRSS via la commande git ou [en téléchargeant l’archive](../releases) +2. Placez l’application sur votre serveur (la partie à exposer au Web est le répertoire `./p/`) +3. Le serveur Web doit avoir les droits d’écriture dans le répertoire `./data/` +4. Accédez à FreshRSS à travers votre navigateur Web et suivez les instructions d’installation + * ou utilisez [l’interface en ligne de commande](./cli/README.md) +5. Tout devrait fonctionner :) En cas de problème, n’hésitez pas à [nous contacter](https://github.com/FreshRSS/FreshRSS/issues). +6. Des paramètres de configuration avancée peuvent être accédés depuis [config.php](./data/config.default.php). + +## Installation automatisée +* [](https://dfabric.github.io/DPlatform-ShellCore) +* [YunoHost](https://github.com/YunoHost-Apps/freshrss_ynh) + +## Exemple d’installation complète sur Linux Debian/Ubuntu +```sh +# Si vous utilisez le serveur Web Apache (sinon il faut un autre serveur Web) +sudo apt-get install apache2 +sudo a2enmod headers expires rewrite ssl #Modules Apache + +# Pour Ubuntu <= 15.10, Debian <= 8 Jessie +sudo apt-get install php5 php5-curl php5-gmp php5-intl php5-json php5-sqlite +sudo apt-get install libapache2-mod-php5 #Pour Apache +sudo apt-get install mysql-server mysql-client php5-mysql #Base de données MySQL optionnelle +sudo apt-get install postgresql php5-pgsql #Base de données PostgreSQL optionnelle + +# Pour Ubuntu >= 16.04, Debian >= 9 Stretch +sudo apt install php php-curl php-gmp php-intl php-mbstring php-sqlite3 php-xml php-zip +sudo apt install libapache2-mod-php #Pour Apache +sudo apt install mysql-server mysql-client php-mysql #Base de données MySQL optionnelle +sudo apt install postgresql php-pgsql #Base de données PostgreSQL optionnelle + +## Redémarrage du serveur Web +sudo service apache2 restart + +# Pour FreshRSS lui-même (git est optionnel si vous déployez manuellement les fichiers d’installation) +cd /usr/share/ +sudo apt-get install git +sudo git clone https://github.com/FreshRSS/FreshRSS.git +cd FreshRSS + +# Si vous souhaitez utiliser la branche développement de FreshRSS +sudo git checkout -b dev origin/dev + +# Mettre les droits d’accès pour le serveur Web +sudo chown -R :www-data . && sudo chmod -R g+r . && sudo chmod -R g+w ./data/ +# Si vous souhaitez permettre les mises à jour par l’interface Web +sudo chmod -R g+w . + +# Publier FreshRSS dans votre répertoire HTML public +sudo ln -s /usr/share/FreshRSS/p /var/www/html/FreshRSS +# Naviguez vers http://example.net/FreshRSS pour terminer l’installation +# (Si vous le faite depuis localhost, vous pourrez avoir à ajuster le réglage de votre adresse publique) +# ou utilisez l’interface en ligne de commande + +# Mettre à jour FreshRSS vers une nouvelle version par git +cd /usr/share/FreshRSS +sudo git pull +sudo chown -R :www-data . && sudo chmod -R g+r . && sudo chmod -R g+w ./data/ +``` + +## Contrôle d’accès +Il est requis pour le mode multi-utilisateur, et recommandé dans tous les cas, de limiter l’accès à votre FreshRSS. Au choix : +* En utilisant l’identification par formulaire (requiert JavaScript, et PHP 5.3.7+ recommandé – fonctionne avec certaines versions de PHP 5.3.3+) +* En utilisant un contrôle d’accès HTTP défini par votre serveur Web + * Voir par exemple la [documentation d’Apache sur l’authentification](http://httpd.apache.org/docs/trunk/howto/auth.html) + * Créer dans ce cas un fichier `./p/i/.htaccess` avec un fichier `.htpasswd` correspondant. + +# Rafraîchissement automatique des flux +* Vous pouvez ajouter une tâche Cron lançant régulièrement le script d’actualisation automatique des flux. +Consultez la documentation de Cron de votre système d’exploitation ([Debian/Ubuntu](http://doc.ubuntu-fr.org/cron), [Red Hat/Fedora](http://doc.fedora-fr.org/wiki/CRON_:_Configuration_de_t%C3%A2ches_automatis%C3%A9es), [Slackware](http://docs.slackware.com/fr:slackbook:process_control?#cron), [Gentoo](http://wiki.gentoo.org/wiki/Cron/fr), [Arch Linux](http://wiki.archlinux.fr/Cron)…). +C’est une bonne idée d’utiliser le même utilisateur que votre serveur Web (souvent “www-data”). +Par exemple, pour exécuter le script toutes les heures : + +``` +8 * * * * php /usr/share/FreshRSS/app/actualize_script.php > /tmp/FreshRSS.log 2>&1 +``` + +### Exemple pour Debian / Ubuntu +Créer `/etc/cron.d/FreshRSS` avec : + +``` +7,37 * * * * www-data php -f /usr/share/FreshRSS/app/actualize_script.php > /tmp/FreshRSS.log 2>&1 +``` + + +# Conseils +* Pour une meilleure sécurité, faites en sorte que seul le répertoire `./p/` soit accessible depuis le Web, par exemple en faisant pointer un sous-domaine sur le répertoire `./p/`. + * En particulier, les données personnelles se trouvent dans le répertoire `./data/`. +* Le fichier `./constants.php` définit les chemins d’accès aux répertoires clés de l’application. Si vous les bougez, tout se passe ici. +* En cas de problème, les logs peuvent être utile à lire, soit depuis l’interface de FreshRSS, soit manuellement depuis `./data/log/*.log`. + + +# Sauvegarde +* Il faut conserver vos fichiers `./data/config.php` ainsi que `./data/*_user.php` +* Vous pouvez exporter votre liste de flux depuis FreshRSS au format OPML + * soit depuis l’interface Web, soit [en ligne de commande](./cli/README.md) +* Pour sauvegarder les articles eux-mêmes, vous pouvez utiliser [phpMyAdmin](http://www.phpmyadmin.net) ou les outils de MySQL : + +```bash +mysqldump -u utilisateur -p --databases freshrss > freshrss.sql +``` + + +# Extensions +FreshRSS permet l’ajout d’extensions en plus des fonctionnalités natives. +Voir le [dépôt dédié à ces extensions](https://github.com/FreshRSS/Extensions). + + +# Bibliothèques incluses +* [SimplePie](http://simplepie.org/) +* [MINZ](https://github.com/marienfressinaud/MINZ) +* [php-http-304](http://alexandre.alapetite.fr/doc-alex/php-http-304/) +* [jQuery](http://jquery.com/) +* [ArthurHoaro/favicon](https://github.com/ArthurHoaro/favicon) +* [lib_opml](https://github.com/marienfressinaud/lib_opml) +* [jQuery Plugin Sticky-Kit](http://leafo.net/sticky-kit/) +* [keyboard_shortcuts](http://www.openjs.com/scripts/events/keyboard_shortcuts/) +* [flotr2](http://www.humblesoftware.com/flotr2) + +## Uniquement pour certaines options +* [bcrypt.js](https://github.com/dcodeIO/bcrypt.js) +* [phpQuery](http://code.google.com/p/phpquery/) + +## Si les fonctions natives ne sont pas disponibles +* [Services_JSON](http://pear.php.net/pepr/pepr-proposal-show.php?id=198) +* [password_compat](https://github.com/ircmaxell/password_compat) + + +# Clients compatibles +Tout client supportant une API de type Google Reader. Sélection : + +* Android + * [News+](https://play.google.com/store/apps/details?id=com.noinnion.android.newsplus) avec [News+ Google Reader extension](https://play.google.com/store/apps/details?id=com.noinnion.android.newsplus.extension.google_reader) (Propriétaire) + * [EasyRSS](https://github.com/Alkarex/EasyRSS) (Libre, F-Droid) +* Linux + * [FeedReader 2.0+](https://jangernert.github.io/FeedReader/) (Libre) @@ -1,92 +1,179 @@ +* [Version française](README.fr.md) + # FreshRSS -FreshRSS est un agrégateur de flux RSS à auto-héberger à l’image de [Leed](http://projet.idleman.fr/leed/) ou de [Kriss Feed](http://tontof.net/kriss/feed/). +FreshRSS is a self-hosted RSS feed aggregator such as [Leed](http://projet.idleman.fr/leed/) or [Kriss Feed](http://tontof.net/kriss/feed/). + +It is at the same time lightweight, easy to work with, powerful and customizable. + +It is a multi-user application with an anonymous reading mode. +It supports [PubSubHubbub](https://code.google.com/p/pubsubhubbub/) for instant notifications from compatible Web sites. +There is an API for (mobile) clients, and a [Command-Line Interface](./cli/README.md). +Finally, it supports [extensions](#extensions) for further tuning. -Il se veut léger et facile à prendre en main tout en étant un outil puissant et paramétrable. +* Official website: http://freshrss.org +* Demo: http://demo.freshrss.org/ +* License: [GNU AGPL 3](http://www.gnu.org/licenses/agpl-3.0.html) -Il permet de gérer plusieurs utilisateurs, et dispose d’un mode de lecture anonyme. + -* Site officiel : http://freshrss.org -* Démo : http://demo.freshrss.org/ -* Développeur : Marien Fressinaud <dev@marienfressinaud.fr> -* Version actuelle : 0.7.1 -* Date de publication 2014-02-19 -* License [GNU AGPL 3](http://www.gnu.org/licenses/agpl-3.0.html) +# Releases +See the [list of releases](../../releases). - +## About branches +* Use [the master branch](https://github.com/FreshRSS/FreshRSS/tree/master/) if you need a stable version. +* For those willing to help testing or developing the latest features, [the dev branch](https://github.com/FreshRSS/FreshRSS/tree/dev) is waiting for you! # Disclaimer -Cette application a été développée pour s’adapter à des besoins personnels et non professionnels. -Je ne garantis en aucun cas la sécurité de celle-ci, ni son bon fonctionnement. -Je m’engage néanmoins à répondre dans la mesure du possible aux demandes d’évolution si celles-ci me semblent justifiées. -Privilégiez pour cela des demandes sur GitHub -(https://github.com/marienfressinaud/FreshRSS/issues) ou par mail (dev@marienfressinaud.fr) - -# Pré-requis -* Serveur modeste, par exemple sous Linux ou Windows - * Fonctionne même sur un Raspberry Pi avec des temps de réponse < 1s (testé sur 150 flux, 22k articles, soit 32Mo de données partiellement compressées) -* Serveur Web Apache2 ou Nginx (non testé sur les autres) -* PHP 5.2.1+ (PHP 5.3.7+ recommandé) - * Requis : [PDO_MySQL](http://php.net/pdo-mysql), [cURL](http://php.net/curl), [LibXML](http://php.net/xml), [PCRE](http://php.net/pcre), [ctype](http://php.net/ctype) - * Recommandés : [JSON](http://php.net/json), [zlib](http://php.net/zlib), [mbstring](http://php.net/mbstring), [iconv](http://php.net/iconv) -* MySQL 5.0.3+ (ou SQLite 3.7.4+ à venir) -* Un navigateur Web récent tel Firefox 4+, Chrome, Opera, Safari, Internet Explorer 9+ - * Fonctionne aussi sur mobile - - +This application was developed to fulfil personal needs primarily, and comes with absolutely no warranty. +Feature requests, bug reports, and other contributions are welcome. The best way is to [open an issue on GitHub](https://github.com/FreshRSS/FreshRSS/issues). +We are a friendly community. + +# Requirements +* Light server running Linux or Windows + * It even works on Raspberry Pi 1 with response time under a second (tested with 150 feeds, 22k articles) +* A web server: Apache2 (recommended), nginx, lighttpd (not tested on others) +* PHP 5.3.3+ (PHP 5.4+ recommended, and PHP 5.5+ for performance, and PHP 7 for even higher performance) + * Required extensions: [cURL](http://php.net/curl), [DOM](http://php.net/dom), [XML](http://php.net/xml), and [PDO_MySQL](http://php.net/pdo-mysql) or [PDO_SQLite](http://php.net/pdo-sqlite) or [PDO_PGSQL](http://php.net/pdo-pgsql) + * Recommended extensions: [JSON](http://php.net/json), [GMP](http://php.net/gmp) (for API access on platforms < 64 bits), [IDN](http://php.net/intl.idn) (for Internationalized Domain Names), [mbstring](http://php.net/mbstring) and/or [iconv](http://php.net/iconv) (for charset conversion), [ZIP](http://php.net/zip) (for import/export), [zlib](http://php.net/zlib) (for compressed feeds) +* MySQL 5.5.3+ (recommended), or SQLite 3.7.4+, or PostgreSQL (experimental) +* A recent browser like Firefox, Internet Explorer 11 / Edge, Chrome, Opera, Safari. + * Works on mobile + + # Installation -1. Récupérez l’application FreshRSS via la commande git ou [en téléchargeant l’archive](https://github.com/marienfressinaud/FreshRSS/archive/master.zip) -2. Placez l’application sur votre serveur (la partie à exposer au Web est le répertoire `./p/`) -3. Le serveur Web doit avoir les droits d’écriture dans le répertoire `./data/` -4. Accédez à FreshRSS à travers votre navigateur Web et suivez les instructions d’installation -5. Tout devrait fonctionner :) En cas de problème, n’hésitez pas à me contacter. - -# Contrôle d’accès -Il est requis pour le mode multi-utilisateur, et recommandé dans tous les cas, de limiter l’accès à votre FreshRSS : -* En utilisant l’identification par [Mozilla Persona](https://login.persona.org/about) incluse dans FreshRSS -* En utilisant un contrôle d’accès HTTP défini par votre serveur Web - * Voir par exemple la [documentation d’Apache sur l’authentification](http://httpd.apache.org/docs/trunk/howto/auth.html) - * Créer dans ce cas un fichier `./p/i/.htaccess` avec un fichier `.htpasswd` correspondant. - -# Rafraîchissement automatique des flux -* Vous pouvez ajouter une tâche Cron lançant régulièrement le script d’actualisation automatique des flux. -Consultez la documentation de Cron de votre système d’exploitation ([Debian/Ubuntu](http://doc.ubuntu-fr.org/cron), [Red Hat/Fedora](http://doc.fedora-fr.org/wiki/CRON_:_Configuration_de_t%C3%A2ches_automatis%C3%A9es), [Slackware](http://docs.slackware.com/fr:slackbook:process_control?#cron), [Gentoo](http://wiki.gentoo.org/wiki/Cron/fr), [Arch Linux](http://wiki.archlinux.fr/Cron)…). -C’est une bonne idée d’utiliser le même utilisateur que votre serveur Web (souvent “www-data”). -Par exemple, pour exécuter le script toutes les heures : +1. Get FreshRSS with git or [by downloading the archive](https://github.com/FreshRSS/FreshRSS/archive/master.zip) +2. Dump the application on your server (expose only the `./p/` folder) +3. Add write access on `./data/` folder to the webserver user +4. Access FreshRSS with your browser and follow the installation process + * or use the [Command-Line Interface](./cli/README.md) +5. Everything should be working :) If you encounter any problem, feel free [contact us](https://github.com/FreshRSS/FreshRSS/issues). +6. Advanced configuration settings can be seen in [config.php](./data/config.default.php). + +## Automated install +* [](https://dfabric.github.io/DPlatform-ShellCore) +* [YunoHost](https://github.com/YunoHost-Apps/freshrss_ynh) + +## Example of full installation on Linux Debian/Ubuntu +```sh +# If you use an Apache Web server (otherwise you need another Web server) +sudo apt-get install apache2 +sudo a2enmod headers expires rewrite ssl #Apache modules + +# For Ubuntu <= 15.10, Debian <= 8 Jessie +sudo apt-get install php5 php5-curl php5-gmp php5-intl php5-json php5-sqlite +sudo apt-get install libapache2-mod-php5 #For Apache +sudo apt-get install mysql-server mysql-client php5-mysql #Optional MySQL database +sudo apt-get install postgresql php5-pgsql #Optional PostgreSQL database + +# For Ubuntu >= 16.04, Debian >= 9 Stretch +sudo apt install php php-curl php-gmp php-intl php-mbstring php-sqlite3 php-xml php-zip +sudo apt install libapache2-mod-php #For Apache +sudo apt install mysql-server mysql-client php-mysql #Optional MySQL database +sudo apt install postgresql php-pgsql #Optional PostgreSQL database + +# Restart Web server +sudo service apache2 restart + +# For FreshRSS itself (git is optional if you manually download the installation files) +cd /usr/share/ +sudo apt-get install git +sudo git clone https://github.com/FreshRSS/FreshRSS.git +cd FreshRSS + +# If you want to use the development version of FreshRSS +sudo git checkout -b dev origin/dev + +# Set the rights so that your Web server can access the files +sudo chown -R :www-data . && sudo chmod -R g+r . && sudo chmod -R g+w ./data/ +# If you would like to allow updates from the Web interface +sudo chmod -R g+w . + +# Publish FreshRSS in your public HTML directory +sudo ln -s /usr/share/FreshRSS/p /var/www/html/FreshRSS +# Navigate to http://example.net/FreshRSS to complete the installation +# (If you do it from localhost, you may have to adjust the setting of your public address later) +# or use the Command-Line Interface + +# Update to a newer version of FreshRSS with git +cd /usr/share/FreshRSS +sudo git pull +sudo chown -R :www-data . && sudo chmod -R g+r . && sudo chmod -R g+w ./data/ +``` + +## Access control +It is needed for the multi-user mode to limit access to FreshRSS. You can: +* use form authentication (need JavaScript and PHP 5.3.7+, works with some PHP 5.3.3+) +* use HTTP authentication supported by your web server + * See [Apache documentation](http://httpd.apache.org/docs/trunk/howto/auth.html) + * In that case, create a `./p/i/.htaccess` file with a matching `.htpasswd` file. + +## Automatic feed update +* You can add a Cron job to launch the update script. +Check the Cron documentation related to your distribution ([Debian/Ubuntu](https://help.ubuntu.com/community/CronHowto), [Red Hat/Fedora](https://fedoraproject.org/wiki/Administration_Guide_Draft/Cron), [Slackware](http://docs.slackware.com/fr:slackbook:process_control?#cron), [Gentoo](https://wiki.gentoo.org/wiki/Cron), [Arch Linux](https://wiki.archlinux.org/index.php/Cron)…). +It is a good idea to use the Web server user. +For instance, if you want to run the script every hour: ``` -7 * * * * php /chemin/vers/FreshRSS/app/actualize_script.php > /tmp/FreshRSS.log 2>&1 +9 * * * * php /usr/share/FreshRSS/app/actualize_script.php > /tmp/FreshRSS.log 2>&1 ``` -# Conseils -* Pour une meilleure sécurité, faites en sorte que seul le répertoire `./p/` soit accessible depuis le Web, par exemple en faisant pointer un sous-domaine sur le répertoire `./p/`. - * En particulier, les données personnelles se trouvent dans le répertoire `./data/`. -* Le fichier `./constants.php` définit les chemins d’accès aux répertoires clés de l’application. Si vous les bougez, tout se passe ici. -* En cas de problème, les logs peuvent être utile à lire, soit depuis l’interface de FreshRSS, soit manuellement depuis `./data/log/*.log`. +### Example on Debian / Ubuntu +Create `/etc/cron.d/FreshRSS` with: + +``` +6,36 * * * * www-data php -f /usr/share/FreshRSS/app/actualize_script.php > /tmp/FreshRSS.log 2>&1 +``` -# Sauvegarde -* Il faut conserver vos fichiers `./data/config.php` ainsi que `./data/*_user.php` et éventuellement `./data/persona/` -* Vous pouvez exporter votre liste de flux depuis FreshRSS au format OPML -* Pour sauvegarder les articles eux-même, vous pouvez utiliser [phpMyAdmin](http://www.phpmyadmin.net) ou les outils de MySQL : + +# Advices +* For a better security, expose only the `./p/` folder on the web. + * Be aware that the `./data/` folder contains all personal data, so it is a bad idea to expose it. +* The `./constants.php` file defines access to application folder. If you want to customize your installation, every thing happens here. +* If you encounter any problem, logs are accessible from the interface or manually in `./data/log/*.log` files. + + +# Backup +* You need to keep `./data/config.php`, and `./data/*_user.php` files +* You can export your feed list in OPML format from FreshRSS + * either from the Web interface, or from the [Command-Line Interface](./cli/README.md) +* To save articles, you can use [phpMyAdmin](http://www.phpmyadmin.net) or MySQL tools: ```bash -mysqldump -u utilisateur -p --databases freshrss > freshrss.sql +mysqldump -u user -p --databases freshrss > freshrss.sql ``` -# Bibliothèques incluses +# Extensions +FreshRSS supports further customizations by adding extensions on top of its core functionality. +See the [repository dedicated to those extensions](https://github.com/FreshRSS/Extensions). + + +# Included libraries * [SimplePie](http://simplepie.org/) * [MINZ](https://github.com/marienfressinaud/MINZ) * [php-http-304](http://alexandre.alapetite.fr/doc-alex/php-http-304/) * [jQuery](http://jquery.com/) +* [ArthurHoaro/favicon](https://github.com/ArthurHoaro/favicon) +* [lib_opml](https://github.com/marienfressinaud/lib_opml) +* [jQuery Plugin Sticky-Kit](http://leafo.net/sticky-kit/) * [keyboard_shortcuts](http://www.openjs.com/scripts/events/keyboard_shortcuts/) * [flotr2](http://www.humblesoftware.com/flotr2) -## Uniquement pour certaines options +## Only for some options * [bcrypt.js](https://github.com/dcodeIO/bcrypt.js) * [phpQuery](http://code.google.com/p/phpquery/) -* [Lazy Load](http://www.appelsiini.net/projects/lazyload) -## Si les fonctions natives ne sont pas disponibles +## If native functions are not available * [Services_JSON](http://pear.php.net/pepr/pepr-proposal-show.php?id=198) * [password_compat](https://github.com/ircmaxell/password_compat) + + +# Compatible clients +Any client supporting a Google Reader-like API. Selection: + +* Android + * [News+](https://play.google.com/store/apps/details?id=com.noinnion.android.newsplus) with [News+ Google Reader extension](https://play.google.com/store/apps/details?id=com.noinnion.android.newsplus.extension.google_reader) (Closed source) + * [EasyRSS](https://github.com/Alkarex/EasyRSS) (Open source, F-Droid) +* Linux + * [FeedReader 2.0+](https://jangernert.github.io/FeedReader/) (Open source) diff --git a/app/Controllers/authController.php b/app/Controllers/authController.php new file mode 100644 index 000000000..1398e4e49 --- /dev/null +++ b/app/Controllers/authController.php @@ -0,0 +1,212 @@ +<?php + +/** + * This controller handles action about authentication. + */ +class FreshRSS_auth_Controller extends Minz_ActionController { + /** + * This action handles authentication management page. + * + * Parameters are: + * - token (default: current token) + * - anon_access (default: false) + * - anon_refresh (default: false) + * - auth_type (default: none) + * - unsafe_autologin (default: false) + * - api_enabled (default: false) + * + * @todo move unsafe_autologin in an extension. + */ + public function indexAction() { + if (!FreshRSS_Auth::hasAccess('admin')) { + Minz_Error::error(403); + } + + Minz_View::prependTitle(_t('admin.auth.title') . ' · '); + + if (Minz_Request::isPost()) { + $ok = true; + + $current_token = FreshRSS_Context::$user_conf->token; + $token = Minz_Request::param('token', $current_token); + FreshRSS_Context::$user_conf->token = $token; + $ok &= FreshRSS_Context::$user_conf->save(); + + $anon = Minz_Request::param('anon_access', false); + $anon = ((bool)$anon) && ($anon !== 'no'); + $anon_refresh = Minz_Request::param('anon_refresh', false); + $anon_refresh = ((bool)$anon_refresh) && ($anon_refresh !== 'no'); + $auth_type = Minz_Request::param('auth_type', 'none'); + $unsafe_autologin = Minz_Request::param('unsafe_autologin', false); + $api_enabled = Minz_Request::param('api_enabled', false); + if ($anon != FreshRSS_Context::$system_conf->allow_anonymous || + $auth_type != FreshRSS_Context::$system_conf->auth_type || + $anon_refresh != FreshRSS_Context::$system_conf->allow_anonymous_refresh || + $unsafe_autologin != FreshRSS_Context::$system_conf->unsafe_autologin_enabled || + $api_enabled != FreshRSS_Context::$system_conf->api_enabled) { + + // TODO: test values from form + FreshRSS_Context::$system_conf->auth_type = $auth_type; + FreshRSS_Context::$system_conf->allow_anonymous = $anon; + FreshRSS_Context::$system_conf->allow_anonymous_refresh = $anon_refresh; + FreshRSS_Context::$system_conf->unsafe_autologin_enabled = $unsafe_autologin; + FreshRSS_Context::$system_conf->api_enabled = $api_enabled; + + $ok &= FreshRSS_Context::$system_conf->save(); + } + + invalidateHttpCache(); + + if ($ok) { + Minz_Request::good(_t('feedback.conf.updated'), + array('c' => 'auth', 'a' => 'index')); + } else { + Minz_Request::bad(_t('feedback.conf.error'), + array('c' => 'auth', 'a' => 'index')); + } + } + } + + /** + * This action handles the login page. + * + * It forwards to the correct login page (form) or main page if + * the user is already connected. + */ + public function loginAction() { + if (FreshRSS_Auth::hasAccess()) { + Minz_Request::forward(array('c' => 'index', 'a' => 'index'), true); + } + + $auth_type = FreshRSS_Context::$system_conf->auth_type; + switch ($auth_type) { + case 'form': + Minz_Request::forward(array('c' => 'auth', 'a' => 'formLogin')); + break; + case 'http_auth': + case 'none': + // It should not happened! + Minz_Error::error(404); + default: + // TODO load plugin instead + Minz_Error::error(404); + } + } + + /** + * This action handles form login page. + * + * If this action is reached through a POST request, username and password + * are compared to login the current user. + * + * Parameters are: + * - nonce (default: false) + * - username (default: '') + * - challenge (default: '') + * - keep_logged_in (default: false) + * + * @todo move unsafe autologin in an extension. + */ + public function formLoginAction() { + invalidateHttpCache(); + + $file_mtime = @filemtime(PUBLIC_PATH . '/scripts/bcrypt.min.js'); + Minz_View::appendScript(Minz_Url::display('/scripts/bcrypt.min.js?' . $file_mtime)); + + $conf = Minz_Configuration::get('system'); + $limits = $conf->limits; + $this->view->cookie_days = round($limits['cookie_duration'] / 86400, 1); + + if (Minz_Request::isPost()) { + $nonce = Minz_Session::param('nonce'); + $username = Minz_Request::param('username', ''); + $challenge = Minz_Request::param('challenge', ''); + + $conf = get_user_configuration($username); + if (is_null($conf)) { + Minz_Error::error(403, array(_t('feedback.auth.login.invalid')), false); + return; + } + + $ok = FreshRSS_FormAuth::checkCredentials( + $username, $conf->passwordHash, $nonce, $challenge + ); + if ($ok) { + // Set session parameter to give access to the user. + Minz_Session::_param('currentUser', $username); + Minz_Session::_param('passwordHash', $conf->passwordHash); + FreshRSS_Auth::giveAccess(); + + // Set cookie parameter if nedded. + if (Minz_Request::param('keep_logged_in')) { + FreshRSS_FormAuth::makeCookie($username, $conf->passwordHash); + } else { + FreshRSS_FormAuth::deleteCookie(); + } + + // All is good, go back to the index. + Minz_Request::good(_t('feedback.auth.login.success'), + array('c' => 'index', 'a' => 'index')); + } else { + Minz_Log::warning('Password mismatch for' . + ' user=' . $username . + ', nonce=' . $nonce . + ', c=' . $challenge); + Minz_Error::error(403, array(_t('feedback.auth.login.invalid')), false); + } + } elseif (FreshRSS_Context::$system_conf->unsafe_autologin_enabled) { + $username = Minz_Request::param('u', ''); + $password = Minz_Request::param('p', ''); + Minz_Request::_param('p'); + + if (!$username) { + return; + } + + $conf = get_user_configuration($username); + if (is_null($conf)) { + return; + } + + if (!function_exists('password_verify')) { + include_once(LIB_PATH . '/password_compat.php'); + } + + $s = $conf->passwordHash; + $ok = password_verify($password, $s); + unset($password); + if ($ok) { + Minz_Session::_param('currentUser', $username); + Minz_Session::_param('passwordHash', $s); + FreshRSS_Auth::giveAccess(); + + Minz_Request::good(_t('feedback.auth.login.success'), + array('c' => 'index', 'a' => 'index')); + } else { + Minz_Log::warning('Unsafe password mismatch for user ' . $username); + Minz_Error::error(403, array(_t('feedback.auth.login.invalid')), false); + } + } + } + + /** + * This action removes all accesses of the current user. + */ + public function logoutAction() { + invalidateHttpCache(); + FreshRSS_Auth::removeAccess(); + Minz_Request::good(_t('feedback.auth.logout.success'), + array('c' => 'index', 'a' => 'index')); + } + + /** + * This action gives possibility to a user to create an account. + */ + public function registerAction() { + if (max_registrations_reached()) { + Minz_Error::error(403); + } + + Minz_View::prependTitle(_t('gen.auth.registration.title') . ' · '); + } +} diff --git a/app/Controllers/categoryController.php b/app/Controllers/categoryController.php new file mode 100644 index 000000000..922f92844 --- /dev/null +++ b/app/Controllers/categoryController.php @@ -0,0 +1,193 @@ +<?php + +/** + * Controller to handle actions relative to categories. + * User needs to be connected. + */ +class FreshRSS_category_Controller extends Minz_ActionController { + /** + * This action is called before every other action in that class. It is + * the common boiler plate for every action. It is triggered by the + * underlying framework. + * + */ + public function firstAction() { + if (!FreshRSS_Auth::hasAccess()) { + Minz_Error::error(403); + } + + $catDAO = new FreshRSS_CategoryDAO(); + $catDAO->checkDefault(); + } + + /** + * This action creates a new category. + * + * Request parameter is: + * - new-category + */ + public function createAction() { + $catDAO = new FreshRSS_CategoryDAO(); + $url_redirect = array('c' => 'subscription', 'a' => 'index'); + + $limits = FreshRSS_Context::$system_conf->limits; + $this->view->categories = $catDAO->listCategories(false); + + if (count($this->view->categories) >= $limits['max_categories']) { + Minz_Request::bad(_t('feedback.sub.category.over_max', $limits['max_categories']), + $url_redirect); + } + + if (Minz_Request::isPost()) { + invalidateHttpCache(); + + $cat_name = Minz_Request::param('new-category'); + if (!$cat_name) { + Minz_Request::bad(_t('feedback.sub.category.no_name'), $url_redirect); + } + + $cat = new FreshRSS_Category($cat_name); + + if ($catDAO->searchByName($cat->name()) != null) { + Minz_Request::bad(_t('feedback.sub.category.name_exists'), $url_redirect); + } + + $values = array( + 'id' => $cat->id(), + 'name' => $cat->name(), + ); + + if ($catDAO->addCategory($values)) { + Minz_Request::good(_t('feedback.sub.category.created', $cat->name()), $url_redirect); + } else { + Minz_Request::bad(_t('feedback.sub.category.error'), $url_redirect); + } + } + + Minz_Request::forward($url_redirect, true); + } + + /** + * This action updates the given category. + * + * Request parameters are: + * - id + * - name + */ + public function updateAction() { + $catDAO = new FreshRSS_CategoryDAO(); + $url_redirect = array('c' => 'subscription', 'a' => 'index'); + + if (Minz_Request::isPost()) { + invalidateHttpCache(); + + $id = Minz_Request::param('id'); + $name = Minz_Request::param('name', ''); + if (strlen($name) <= 0) { + Minz_Request::bad(_t('feedback.sub.category.no_name'), $url_redirect); + } + + if ($catDAO->searchById($id) == null) { + Minz_Request::bad(_t('feedback.sub.category.not_exist'), $url_redirect); + } + + $cat = new FreshRSS_Category($name); + $values = array( + 'name' => $cat->name(), + ); + + if ($catDAO->updateCategory($id, $values)) { + Minz_Request::good(_t('feedback.sub.category.updated'), $url_redirect); + } else { + Minz_Request::bad(_t('feedback.sub.category.error'), $url_redirect); + } + } + + Minz_Request::forward($url_redirect, true); + } + + /** + * This action deletes a category. + * Feeds in the given category are moved in the default category. + * Related user queries are deleted too. + * + * Request parameter is: + * - id (of a category) + */ + public function deleteAction() { + $feedDAO = FreshRSS_Factory::createFeedDao(); + $catDAO = new FreshRSS_CategoryDAO(); + $url_redirect = array('c' => 'subscription', 'a' => 'index'); + + if (Minz_Request::isPost()) { + invalidateHttpCache(); + + $id = Minz_Request::param('id'); + if (!$id) { + Minz_Request::bad(_t('feedback.sub.category.no_id'), $url_redirect); + } + + if ($id === FreshRSS_CategoryDAO::defaultCategoryId) { + Minz_Request::bad(_t('feedback.sub.category.not_delete_default'), $url_redirect); + } + + if ($feedDAO->changeCategory($id, FreshRSS_CategoryDAO::defaultCategoryId) === false) { + Minz_Request::bad(_t('feedback.sub.category.error'), $url_redirect); + } + + if ($catDAO->deleteCategory($id) === false) { + Minz_Request::bad(_t('feedback.sub.category.error'), $url_redirect); + } + + // Remove related queries. + FreshRSS_Context::$user_conf->queries = remove_query_by_get( + 'c_' . $id, FreshRSS_Context::$user_conf->queries); + FreshRSS_Context::$user_conf->save(); + + Minz_Request::good(_t('feedback.sub.category.deleted'), $url_redirect); + } + + Minz_Request::forward($url_redirect, true); + } + + /** + * This action deletes all the feeds relative to a given category. + * Feed-related queries are deleted. + * + * Request parameter is: + * - id (of a category) + */ + public function emptyAction() { + $feedDAO = FreshRSS_Factory::createFeedDao(); + $url_redirect = array('c' => 'subscription', 'a' => 'index'); + + if (Minz_Request::isPost()) { + invalidateHttpCache(); + + $id = Minz_Request::param('id'); + if (!$id) { + Minz_Request::bad(_t('feedback.sub.category.no_id'), $url_redirect); + } + + // List feeds to remove then related user queries. + $feeds = $feedDAO->listByCategory($id); + + if ($feedDAO->deleteFeedByCategory($id)) { + // TODO: Delete old favicons + + // Remove related queries + foreach ($feeds as $feed) { + FreshRSS_Context::$user_conf->queries = remove_query_by_get( + 'f_' . $feed->id(), FreshRSS_Context::$user_conf->queries); + } + FreshRSS_Context::$user_conf->save(); + + Minz_Request::good(_t('feedback.sub.category.emptied'), $url_redirect); + } else { + Minz_Request::bad(_t('feedback.sub.category.error'), $url_redirect); + } + } + + Minz_Request::forward($url_redirect, true); + } +} diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index ad8bc546a..e73f106a6 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -1,354 +1,331 @@ <?php +/** + * Controller to handle every configuration options. + */ class FreshRSS_configure_Controller extends Minz_ActionController { - public function firstAction () { - if (!$this->view->loginOk) { - Minz_Error::error ( - 403, - array ('error' => array (Minz_Translate::t ('access_denied'))) - ); + /** + * This action is called before every other action in that class. It is + * the common boiler plate for every action. It is triggered by the + * underlying framework. + */ + public function firstAction() { + if (!FreshRSS_Auth::hasAccess()) { + Minz_Error::error(403); } - - $catDAO = new FreshRSS_CategoryDAO (); - $catDAO->checkDefault (); } - public function categorizeAction () { - $feedDAO = new FreshRSS_FeedDAO (); - $catDAO = new FreshRSS_CategoryDAO (); - $defaultCategory = $catDAO->getDefault (); - $defaultId = $defaultCategory->id (); - - if (Minz_Request::isPost ()) { - $cats = Minz_Request::param ('categories', array ()); - $ids = Minz_Request::param ('ids', array ()); - $newCat = trim (Minz_Request::param ('new_category', '')); - - foreach ($cats as $key => $name) { - if (strlen ($name) > 0) { - $cat = new FreshRSS_Category ($name); - $values = array ( - 'name' => $cat->name (), - ); - $catDAO->updateCategory ($ids[$key], $values); - } elseif ($ids[$key] != $defaultId) { - $feedDAO->changeCategory ($ids[$key], $defaultId); - $catDAO->deleteCategory ($ids[$key]); - } - } - - if ($newCat != '') { - $cat = new FreshRSS_Category ($newCat); - $values = array ( - 'id' => $cat->id (), - 'name' => $cat->name (), - ); - - if ($catDAO->searchByName ($newCat) == false) { - $catDAO->addCategory ($values); - } - } + /** + * This action handles the display configuration page. + * + * It displays the display configuration page. + * If this action is reached through a POST request, it stores all new + * configuration values then sends a notification to the user. + * + * The options available on the page are: + * - language (default: en) + * - theme (default: Origin) + * - content width (default: thin) + * - display of read action in header + * - display of favorite action in header + * - display of date in header + * - display of open action in header + * - display of read action in footer + * - display of favorite action in footer + * - display of sharing action in footer + * - display of tags in footer + * - display of date in footer + * - display of open action in footer + * - html5 notification timeout (default: 0) + * Default values are false unless specified. + */ + public function displayAction() { + if (Minz_Request::isPost()) { + FreshRSS_Context::$user_conf->language = Minz_Request::param('language', 'en'); + FreshRSS_Context::$user_conf->theme = Minz_Request::param('theme', FreshRSS_Themes::$defaultTheme); + FreshRSS_Context::$user_conf->content_width = Minz_Request::param('content_width', 'thin'); + FreshRSS_Context::$user_conf->topline_read = Minz_Request::param('topline_read', false); + FreshRSS_Context::$user_conf->topline_favorite = Minz_Request::param('topline_favorite', false); + FreshRSS_Context::$user_conf->topline_date = Minz_Request::param('topline_date', false); + FreshRSS_Context::$user_conf->topline_link = Minz_Request::param('topline_link', false); + FreshRSS_Context::$user_conf->bottomline_read = Minz_Request::param('bottomline_read', false); + FreshRSS_Context::$user_conf->bottomline_favorite = Minz_Request::param('bottomline_favorite', false); + FreshRSS_Context::$user_conf->bottomline_sharing = Minz_Request::param('bottomline_sharing', false); + FreshRSS_Context::$user_conf->bottomline_tags = Minz_Request::param('bottomline_tags', false); + FreshRSS_Context::$user_conf->bottomline_date = Minz_Request::param('bottomline_date', false); + FreshRSS_Context::$user_conf->bottomline_link = Minz_Request::param('bottomline_link', false); + FreshRSS_Context::$user_conf->html5_notif_timeout = Minz_Request::param('html5_notif_timeout', 0); + FreshRSS_Context::$user_conf->save(); + + Minz_Session::_param('language', FreshRSS_Context::$user_conf->language); + Minz_Translate::reset(FreshRSS_Context::$user_conf->language); invalidateHttpCache(); - $notif = array ( - 'type' => 'good', - 'content' => Minz_Translate::t ('categories_updated') - ); - Minz_Session::_param ('notification', $notif); - - Minz_Request::forward (array ('c' => 'configure', 'a' => 'categorize'), true); + Minz_Request::good(_t('feedback.conf.updated'), + array('c' => 'configure', 'a' => 'display')); } - $this->view->categories = $catDAO->listCategories (false); - $this->view->defaultCategory = $catDAO->getDefault (); - $this->view->feeds = $feedDAO->listFeeds (); - $this->view->flux = false; + $this->view->themes = FreshRSS_Themes::get(); - Minz_View::prependTitle (Minz_Translate::t ('categories_management') . ' · '); + Minz_View::prependTitle(_t('conf.display.title') . ' · '); } - public function feedAction () { - $catDAO = new FreshRSS_CategoryDAO (); - $this->view->categories = $catDAO->listCategories (false); - - $feedDAO = new FreshRSS_FeedDAO (); - $this->view->feeds = $feedDAO->listFeeds (); - - $id = Minz_Request::param ('id'); - if ($id == false && !empty ($this->view->feeds)) { - $id = current ($this->view->feeds)->id (); - } - - $this->view->flux = false; - if ($id != false) { - $this->view->flux = $this->view->feeds[$id]; - - if (!$this->view->flux) { - Minz_Error::error ( - 404, - array ('error' => array (Minz_Translate::t ('page_not_found'))) - ); - } else { - if (Minz_Request::isPost () && $this->view->flux) { - $user = Minz_Request::param ('http_user', ''); - $pass = Minz_Request::param ('http_pass', ''); - - $httpAuth = ''; - if ($user != '' || $pass != '') { - $httpAuth = $user . ':' . $pass; - } - - $cat = intval(Minz_Request::param('category', 0)); - - $values = array ( - 'name' => Minz_Request::param ('name', ''), - 'description' => sanitizeHTML(Minz_Request::param('description', '', true)), - 'website' => Minz_Request::param('website', ''), - 'url' => Minz_Request::param('url', ''), - 'category' => $cat, - 'pathEntries' => Minz_Request::param ('path_entries', ''), - 'priority' => intval(Minz_Request::param ('priority', 0)), - 'httpAuth' => $httpAuth, - 'keep_history' => intval(Minz_Request::param ('keep_history', -2)), - ); - - if ($feedDAO->updateFeed ($id, $values)) { - $this->view->flux->_category ($cat); - $this->view->flux->faviconPrepare(); - $notif = array ( - 'type' => 'good', - 'content' => Minz_Translate::t ('feed_updated') - ); - } else { - $notif = array ( - 'type' => 'bad', - 'content' => Minz_Translate::t ('error_occurred_update') - ); - } - invalidateHttpCache(); - - Minz_Session::_param ('notification', $notif); - Minz_Request::forward (array ('c' => 'configure', 'a' => 'feed', 'params' => array ('id' => $id)), true); - } - - Minz_View::prependTitle (Minz_Translate::t ('rss_feed_management') . ' — ' . $this->view->flux->name () . ' · '); - } - } else { - Minz_View::prependTitle (Minz_Translate::t ('rss_feed_management') . ' · '); - } - } - - public function displayAction () { + /** + * This action handles the reading configuration page. + * + * It displays the reading configuration page. + * If this action is reached through a POST request, it stores all new + * configuration values then sends a notification to the user. + * + * The options available on the page are: + * - number of posts per page (default: 10) + * - view mode (default: normal) + * - default article view (default: all) + * - load automatically articles + * - display expanded articles + * - display expanded categories + * - hide categories and feeds without unread articles + * - jump on next category or feed when marked as read + * - image lazy loading + * - stick open articles to the top + * - display a confirmation when reading all articles + * - auto remove article after reading + * - article order (default: DESC) + * - mark articles as read when: + * - displayed + * - opened on site + * - scrolled + * - received + * Default values are false unless specified. + */ + public function readingAction() { 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->_sort_order(Minz_Request::param('sort_order', 'DESC')); - $this->view->conf->_mark_when (array( + FreshRSS_Context::$user_conf->posts_per_page = Minz_Request::param('posts_per_page', 10); + FreshRSS_Context::$user_conf->view_mode = Minz_Request::param('view_mode', 'normal'); + FreshRSS_Context::$user_conf->default_view = Minz_Request::param('default_view', 'adaptive'); + FreshRSS_Context::$user_conf->auto_load_more = Minz_Request::param('auto_load_more', false); + FreshRSS_Context::$user_conf->display_posts = Minz_Request::param('display_posts', false); + FreshRSS_Context::$user_conf->display_categories = Minz_Request::param('display_categories', false); + FreshRSS_Context::$user_conf->hide_read_feeds = Minz_Request::param('hide_read_feeds', false); + FreshRSS_Context::$user_conf->onread_jump_next = Minz_Request::param('onread_jump_next', false); + FreshRSS_Context::$user_conf->lazyload = Minz_Request::param('lazyload', false); + FreshRSS_Context::$user_conf->sticky_post = Minz_Request::param('sticky_post', false); + FreshRSS_Context::$user_conf->reading_confirm = Minz_Request::param('reading_confirm', false); + FreshRSS_Context::$user_conf->auto_remove_article = Minz_Request::param('auto_remove_article', false); + FreshRSS_Context::$user_conf->mark_updated_article_unread = Minz_Request::param('mark_updated_article_unread', false); + FreshRSS_Context::$user_conf->sort_order = Minz_Request::param('sort_order', 'DESC'); + FreshRSS_Context::$user_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; - } - $this->view->conf->_theme($themeId); - $this->view->conf->_topline_read(Minz_Request::param('topline_read', false)); - $this->view->conf->_topline_favorite(Minz_Request::param('topline_favorite', false)); - $this->view->conf->_topline_date(Minz_Request::param('topline_date', false)); - $this->view->conf->_topline_link(Minz_Request::param('topline_link', false)); - $this->view->conf->_bottomline_read(Minz_Request::param('bottomline_read', false)); - $this->view->conf->_bottomline_favorite(Minz_Request::param('bottomline_favorite', false)); - $this->view->conf->_bottomline_sharing(Minz_Request::param('bottomline_sharing', false)); - $this->view->conf->_bottomline_tags(Minz_Request::param('bottomline_tags', false)); - $this->view->conf->_bottomline_date(Minz_Request::param('bottomline_date', false)); - $this->view->conf->_bottomline_link(Minz_Request::param('bottomline_link', 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); + FreshRSS_Context::$user_conf->save(); + invalidateHttpCache(); - Minz_Request::forward (array ('c' => 'configure', 'a' => 'display'), true); + Minz_Request::good(_t('feedback.conf.updated'), + array('c' => 'configure', 'a' => 'reading')); } - $this->view->themes = FreshRSS_Themes::get(); - - Minz_View::prependTitle (Minz_Translate::t ('reading_configuration') . ' · '); + Minz_View::prependTitle(_t('conf.reading.title') . ' · '); } - public function sharingAction () { - if (Minz_Request::isPost ()) { - $this->view->conf->_sharing (array( - 'shaarli' => Minz_Request::param ('shaarli', false), - 'wallabag' => Minz_Request::param ('wallabag', false), - 'diaspora' => Minz_Request::param ('diaspora', false), - 'twitter' => Minz_Request::param ('twitter', false), - 'g+' => Minz_Request::param ('g+', false), - 'facebook' => Minz_Request::param ('facebook', false), - 'email' => Minz_Request::param ('email', false), - 'print' => Minz_Request::param ('print', false), - )); - $this->view->conf->save(); + /** + * This action handles the sharing configuration page. + * + * It displays the sharing configuration page. + * If this action is reached through a POST request, it stores all + * configuration values then sends a notification to the user. + */ + public function sharingAction() { + if (Minz_Request::isPost()) { + $params = Minz_Request::fetchPOST(); + FreshRSS_Context::$user_conf->sharing = $params['share']; + FreshRSS_Context::$user_conf->save(); invalidateHttpCache(); - $notif = array ( - 'type' => 'good', - 'content' => Minz_Translate::t ('configuration_updated') - ); - Minz_Session::_param ('notification', $notif); - - Minz_Request::forward (array ('c' => 'configure', 'a' => 'sharing'), true); + Minz_Request::good(_t('feedback.conf.updated'), + array('c' => 'configure', 'a' => 'sharing')); } - Minz_View::prependTitle (Minz_Translate::t ('sharing') . ' · '); + Minz_View::prependTitle(_t('conf.sharing.title') . ' · '); } - public function importExportAction () { - require_once(LIB_PATH . '/lib_opml.php'); - $catDAO = new FreshRSS_CategoryDAO (); - $this->view->categories = $catDAO->listCategories (); + /** + * This action handles the shortcut configuration page. + * + * It displays the shortcut configuration page. + * If this action is reached through a POST request, it stores all new + * configuration values then sends a notification to the user. + * + * The authorized values for shortcuts are letters (a to z), numbers (0 + * to 9), function keys (f1 to f12), backspace, delete, down, end, enter, + * escape, home, insert, left, page down, page up, return, right, space, + * tab and up. + */ + public function shortcutAction() { + $list_keys = array('a', 'b', 'backspace', 'c', 'd', 'delete', 'down', 'e', 'end', 'enter', + 'escape', 'f', 'g', 'h', 'home', 'i', 'insert', 'j', 'k', 'l', 'left', + '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'); + $this->view->list_keys = $list_keys; - $this->view->req = Minz_Request::param ('q'); + if (Minz_Request::isPost()) { + $shortcuts = Minz_Request::param('shortcuts'); + $shortcuts_ok = array(); + + foreach ($shortcuts as $key => $value) { + if (in_array($value, $list_keys)) { + $shortcuts_ok[$key] = $value; + } + } - if ($this->view->req == 'export') { - Minz_View::_title ('freshrss_feeds.opml'); + FreshRSS_Context::$user_conf->shortcuts = $shortcuts_ok; + FreshRSS_Context::$user_conf->save(); + invalidateHttpCache(); - $this->view->_useLayout (false); - header('Content-Type: application/xml; charset=utf-8'); - header('Content-disposition: attachment; filename=freshrss_feeds.opml'); + Minz_Request::good(_t('feedback.conf.shortcuts_updated'), + array('c' => 'configure', 'a' => 'shortcut')); + } - $feedDAO = new FreshRSS_FeedDAO (); - $catDAO = new FreshRSS_CategoryDAO (); + Minz_View::prependTitle(_t('conf.shortcut.title') . ' · '); + } - $list = array (); - foreach ($catDAO->listCategories () as $key => $cat) { - $list[$key]['name'] = $cat->name (); - $list[$key]['feeds'] = $feedDAO->listByCategory ($cat->id ()); - } + /** + * This action handles the archive configuration page. + * + * It displays the archive configuration page. + * If this action is reached through a POST request, it stores all new + * configuration values then sends a notification to the user. + * + * 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 + */ + 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->save(); + invalidateHttpCache(); - $this->view->categories = $list; - } elseif ($this->view->req == 'import' && Minz_Request::isPost ()) { - if ($_FILES['file']['error'] == 0) { - invalidateHttpCache(); - // on parse le fichier OPML pour récupérer les catégories et les flux associés - try { - list ($categories, $feeds) = opml_import ( - file_get_contents ($_FILES['file']['tmp_name']) - ); - - // On redirige vers le controller feed qui va se charger d'insérer les flux en BDD - // les flux sont mis au préalable dans des variables de Request - Minz_Request::_param ('q', 'null'); - Minz_Request::_param ('categories', $categories); - Minz_Request::_param ('feeds', $feeds); - Minz_Request::forward (array ('c' => 'feed', 'a' => 'massiveImport')); - } catch (FreshRSS_Opml_Exception $e) { - Minz_Log::record ($e->getMessage (), Minz_Log::WARNING); - - $notif = array ( - 'type' => 'bad', - 'content' => Minz_Translate::t ('bad_opml_file') - ); - Minz_Session::_param ('notification', $notif); - - Minz_Request::forward (array ( - 'c' => 'configure', - 'a' => 'importExport' - ), true); - } - } + Minz_Request::good(_t('feedback.conf.updated'), + array('c' => 'configure', 'a' => 'archiving')); } - $feedDAO = new FreshRSS_FeedDAO (); - $this->view->feeds = $feedDAO->listFeeds (); + Minz_View::prependTitle(_t('conf.archiving.title') . ' · '); - // au niveau de la vue, permet de ne pas voir un flux sélectionné dans la liste - $this->view->flux = false; + $entryDAO = FreshRSS_Factory::createEntryDao(); + $this->view->nb_total = $entryDAO->count(); + $this->view->size_user = $entryDAO->size(); - Minz_View::prependTitle (Minz_Translate::t ('import_export_opml') . ' · '); + if (FreshRSS_Auth::hasAccess('admin')) { + $this->view->size_total = $entryDAO->size(true); + } } - public function shortcutAction () { - $list_keys = array ('a', 'b', 'backspace', 'c', 'd', 'delete', 'down', 'e', 'end', 'enter', - 'escape', 'f', 'g', 'h', 'home', 'i', 'insert', 'j', 'k', 'l', 'left', - 'm', 'n', 'o', 'p', 'page_down', 'page_up', 'q', 'r', 'return', 'right', - 's', 'space', 't', 'tab', 'u', 'up', 'v', 'w', 'x', 'y', - 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', - '9', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', - 'f10', 'f11', 'f12'); - $this->view->list_keys = $list_keys; - - if (Minz_Request::isPost ()) { - $shortcuts = Minz_Request::param ('shortcuts'); - $shortcuts_ok = array (); + /** + * This action handles the user queries configuration page. + * + * If this action is reached through a POST request, it stores all new + * configuration values then sends a notification to the user then + * redirect to the same page. + * If this action is not reached through a POST request, it displays the + * configuration page and verifies that every user query is runable by + * checking if categories and feeds are still in use. + */ + public function queriesAction() { + $category_dao = new FreshRSS_CategoryDAO(); + $feed_dao = FreshRSS_Factory::createFeedDao(); + if (Minz_Request::isPost()) { + $params = Minz_Request::param('queries', array()); - foreach ($shortcuts as $key => $value) { - if (in_array($value, $list_keys)) { - $shortcuts_ok[$key] = $value; + foreach ($params as $key => $query) { + if (!$query['name']) { + $query['name'] = _t('conf.query.number', $key + 1); } + $queries[] = new FreshRSS_UserQuery($query, $feed_dao, $category_dao); } + FreshRSS_Context::$user_conf->queries = $queries; + FreshRSS_Context::$user_conf->save(); - $this->view->conf->_shortcuts ($shortcuts_ok); - $this->view->conf->save(); - invalidateHttpCache(); + Minz_Request::good(_t('feedback.conf.updated'), + array('c' => 'configure', 'a' => 'queries')); + } else { + $this->view->queries = array(); + foreach (FreshRSS_Context::$user_conf->queries as $key => $query) { + $this->view->queries[$key] = new FreshRSS_UserQuery($query, $feed_dao, $category_dao); + } + } - $notif = array ( - 'type' => 'good', - 'content' => Minz_Translate::t ('shortcuts_updated') - ); - Minz_Session::_param ('notification', $notif); + Minz_View::prependTitle(_t('conf.query.title') . ' · '); + } - Minz_Request::forward (array ('c' => 'configure', 'a' => 'shortcut'), true); + /** + * This action handles the creation of a user query. + * + * It gets the GET parameters and stores them in the configuration query + * storage. Before it is saved, the unwanted parameters are unset to keep + * lean data. + */ + public function addQueryAction() { + $category_dao = new FreshRSS_CategoryDAO(); + $feed_dao = FreshRSS_Factory::createFeedDao(); + $queries = array(); + foreach (FreshRSS_Context::$user_conf->queries as $key => $query) { + $queries[$key] = new FreshRSS_UserQuery($query, $feed_dao, $category_dao); } + $params = Minz_Request::fetchGET(); + $params['url'] = Minz_Url::display(array('params' => $params)); + $params['name'] = _t('conf.query.number', count($queries) + 1); + $queries[] = new FreshRSS_UserQuery($params, $feed_dao, $category_dao); - Minz_View::prependTitle (Minz_Translate::t ('shortcuts') . ' · '); - } + FreshRSS_Context::$user_conf->queries = $queries; + FreshRSS_Context::$user_conf->save(); - public function usersAction() { - Minz_View::prependTitle(Minz_Translate::t ('users') . ' · '); + Minz_Request::good(_t('feedback.conf.query_created', $query['name']), + array('c' => 'configure', 'a' => 'queries')); } - public function archivingAction () { + /** + * This action handles the system configuration page. + * + * It displays the system configuration page. + * If this action is reach through a POST request, it stores all new + * configuration values then sends a notification to the user. + * + * The options available on the page are: + * - user limit (default: 1) + * - user category limit (default: 16384) + * - user feed limit (default: 16384) + */ + public function systemAction() { + if (!FreshRSS_Auth::hasAccess('admin')) { + Minz_Error::error(403); + } if (Minz_Request::isPost()) { - $old = Minz_Request::param('old_entries', 3); - $keepHistoryDefault = Minz_Request::param('keep_history_default', 0); + $limits = FreshRSS_Context::$system_conf->limits; + $limits['max_registrations'] = Minz_Request::param('max-registrations', 1); + $limits['max_feeds'] = Minz_Request::param('max-feeds', 16384); + $limits['max_categories'] = Minz_Request::param('max-categories', 16384); + FreshRSS_Context::$system_conf->limits = $limits; + FreshRSS_Context::$system_conf->title = Minz_Request::param('instance-name', 'FreshRSS'); + FreshRSS_Context::$system_conf->auto_update_url = Minz_Request::param('auto-update-url', false); + FreshRSS_Context::$system_conf->save(); - $this->view->conf->_old_entries($old); - $this->view->conf->_keep_history_default($keepHistoryDefault); - $this->view->conf->save(); invalidateHttpCache(); - $notif = array( + Minz_Session::_param('notification', array( 'type' => 'good', - 'content' => Minz_Translate::t('configuration_updated') - ); - Minz_Session::_param('notification', $notif); - - Minz_Request::forward(array('c' => 'configure', 'a' => 'archiving'), true); - } - - Minz_View::prependTitle(Minz_Translate::t('archiving_configuration') . ' · '); - - $entryDAO = new FreshRSS_EntryDAO(); - $this->view->nb_total = $entryDAO->count(); - $this->view->size_user = $entryDAO->size(); - - if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { - $this->view->size_total = $entryDAO->size(true); + 'content' => _t('feedback.conf.updated') + )); } } } diff --git a/app/Controllers/entryController.php b/app/Controllers/entryController.php index 1756c91e5..c40588105 100755 --- a/app/Controllers/entryController.php +++ b/app/Controllers/entryController.php @@ -1,158 +1,203 @@ <?php +/** + * Controller to handle every entry actions. + */ class FreshRSS_entry_Controller extends Minz_ActionController { - public function firstAction () { - if (!$this->view->loginOk) { - Minz_Error::error ( - 403, - array ('error' => array (Minz_Translate::t ('access_denied'))) - ); + /** + * This action is called before every other action in that class. It is + * the common boiler plate for every action. It is triggered by the + * underlying framework. + */ + public function firstAction() { + if (!FreshRSS_Auth::hasAccess()) { + Minz_Error::error(403); } - $this->params = array (); - $output = Minz_Request::param('output', ''); - if (($output != '') && ($this->view->conf->view_mode !== $output)) { - $this->params['output'] = $output; - } - - $this->redirect = false; - $ajax = Minz_Request::param ('ajax'); - if ($ajax) { - $this->view->_useLayout (false); + // If ajax request, we do not print layout + $this->ajax = Minz_Request::param('ajax'); + if ($this->ajax) { + $this->view->_useLayout(false); + Minz_Request::_param('ajax'); } } - public function lastAction () { - $ajax = Minz_Request::param ('ajax'); - if (!$ajax && $this->redirect) { - Minz_Request::forward (array ( - 'c' => 'index', - 'a' => 'index', - 'params' => $this->params - ), true); + /** + * Mark one or several entries as read (or not!). + * + * If request concerns several entries, it MUST be a POST request. + * If request concerns several entries, only mark them as read is available. + * + * Parameters are: + * - id (default: false) + * - get (default: false) /(c_\d+|f_\d+|s|a)/ + * - nextGet (default: $get) + * - idMax (default: 0) + * - is_read (default: true) + */ + public function readAction() { + $id = Minz_Request::param('id'); + $get = Minz_Request::param('get'); + $next_get = Minz_Request::param('nextGet', $get); + $id_max = Minz_Request::param('idMax', 0); + FreshRSS_Context::$search = new FreshRSS_Search(Minz_Request::param('search', '')); + + FreshRSS_Context::$state = Minz_Request::param('state', 0); + if (FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_FAVORITE)) { + FreshRSS_Context::$state = FreshRSS_Entry::STATE_FAVORITE; + } elseif (FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_FAVORITE)) { + FreshRSS_Context::$state = FreshRSS_Entry::STATE_NOT_FAVORITE; } else { - Minz_Request::_param ('ajax'); + FreshRSS_Context::$state = 0; } - } - public function readAction () { - $this->redirect = true; + $params = array(); - $id = Minz_Request::param ('id'); - $get = Minz_Request::param ('get'); - $nextGet = Minz_Request::param ('nextGet', $get); - $idMax = Minz_Request::param ('idMax', 0); + $entryDAO = FreshRSS_Factory::createEntryDao(); + if ($id === false) { + // id is false? It MUST be a POST request! + if (!Minz_Request::isPost()) { + Minz_Request::bad(_t('feedback.access.not_found'), array('c' => 'index', 'a' => 'index')); + return; + } - $entryDAO = new FreshRSS_EntryDAO (); - if ($id == false) { if (!$get) { - $entryDAO->markReadEntries ($idMax); + // No get? Mark all entries as read (from $id_max) + $entryDAO->markReadEntries($id_max); } else { - $typeGet = $get[0]; - $get = substr ($get, 2); - switch ($typeGet) { - case 'c': - $entryDAO->markReadCat ($get, $idMax); - break; - case 'f': - $entryDAO->markReadFeed ($get, $idMax); - break; - case 's': - $entryDAO->markReadEntries ($idMax, true); - break; - case 'a': - $entryDAO->markReadEntries ($idMax); - break; + $type_get = $get[0]; + $get = substr($get, 2); + switch($type_get) { + case 'c': + $entryDAO->markReadCat($get, $id_max, FreshRSS_Context::$search, FreshRSS_Context::$state); + break; + case 'f': + $entryDAO->markReadFeed($get, $id_max, FreshRSS_Context::$search, FreshRSS_Context::$state); + break; + case 's': + $entryDAO->markReadEntries($id_max, true, 0, FreshRSS_Context::$search); + break; + case 'a': + $entryDAO->markReadEntries($id_max, false, 0, FreshRSS_Context::$search, FreshRSS_Context::$state); + break; } - if ($nextGet !== 'a') { - $this->params['get'] = $nextGet; + + if ($next_get !== 'a') { + // Redirect to the correct page (category, feed or starred) + // Not "a" because it is the default value if nothing is + // given. + $params['get'] = $next_get; } } - - $notif = array ( - 'type' => 'good', - 'content' => Minz_Translate::t ('feeds_marked_read') - ); - Minz_Session::_param ('notification', $notif); } else { - $is_read = (bool)(Minz_Request::param ('is_read', true)); - $entryDAO->markRead ($id, $is_read); + $is_read = (bool)(Minz_Request::param('is_read', true)); + $entryDAO->markRead($id, $is_read); + } + + if (!$this->ajax) { + Minz_Request::good(_t('feedback.sub.feed.marked_read'), array( + 'c' => 'index', + 'a' => 'index', + 'params' => $params, + ), true); } } - public function bookmarkAction () { - $this->redirect = true; + /** + * This action marks an entry as favourite (bookmark) or not. + * + * Parameter is: + * - id (default: false) + * - is_favorite (default: true) + * If id is false, nothing happened. + */ + public function bookmarkAction() { + $id = Minz_Request::param('id'); + $is_favourite = (bool)Minz_Request::param('is_favorite', true); + if ($id !== false) { + $entryDAO = FreshRSS_Factory::createEntryDao(); + $entryDAO->markFavorite($id, $is_favourite); + } - $id = Minz_Request::param ('id'); - if ($id) { - $entryDAO = new FreshRSS_EntryDAO (); - $entryDAO->markFavorite ($id, (bool)(Minz_Request::param ('is_favorite', true))); + if (!$this->ajax) { + Minz_Request::forward(array( + 'c' => 'index', + 'a' => 'index', + ), true); } } + /** + * This action optimizes database to reduce its size. + * + * This action shouldbe reached by a POST request. + * + * @todo move this action in configure controller. + * @todo call this action through web-cron when available + */ public function optimizeAction() { - if (Minz_Request::isPost()) { - @set_time_limit(300); - - // La table des entrées a tendance à grossir énormément - // Cette action permet d'optimiser cette table permettant de grapiller un peu de place - // Cette fonctionnalité n'est à appeler qu'occasionnellement - $entryDAO = new FreshRSS_EntryDAO(); - $entryDAO->optimizeTable(); - - invalidateHttpCache(); - - $notif = array ( - 'type' => 'good', - 'content' => Minz_Translate::t ('optimization_complete') - ); - Minz_Session::_param ('notification', $notif); + $url_redirect = array( + 'c' => 'configure', + 'a' => 'archiving', + ); + + if (!Minz_Request::isPost()) { + Minz_Request::forward($url_redirect, true); } - Minz_Request::forward(array( - 'c' => 'configure', - 'a' => 'archiving' - ), true); + @set_time_limit(300); + + $entryDAO = FreshRSS_Factory::createEntryDao(); + $entryDAO->optimizeTable(); + + $feedDAO = FreshRSS_Factory::createFeedDao(); + $feedDAO->updateCachedValues(); + + invalidateHttpCache(); + Minz_Request::good(_t('feedback.admin.optimization_complete'), $url_redirect); } + /** + * This action purges old entries from feeds. + * + * @todo should be a POST request + * @todo should be in feedController + */ public function purgeAction() { @set_time_limit(300); - $nb_month_old = max($this->view->conf->old_entries, 1); + $nb_month_old = max(FreshRSS_Context::$user_conf->old_entries, 1); $date_min = time() - (3600 * 24 * 30 * $nb_month_old); - $feedDAO = new FreshRSS_FeedDAO(); - $feeds = $feedDAO->listFeedsOrderUpdate(); - $nbTotal = 0; + $feedDAO = FreshRSS_Factory::createFeedDao(); + $feeds = $feedDAO->listFeeds(); + $nb_total = 0; invalidateHttpCache(); foreach ($feeds as $feed) { - $feedHistory = $feed->keepHistory(); - if ($feedHistory == -2) { //default - $feedHistory = $this->view->conf->keep_history_default; + $feed_history = $feed->keepHistory(); + if ($feed_history == -2) { + // TODO: -2 must be a constant! + // -2 means we take the default value from configuration + $feed_history = FreshRSS_Context::$user_conf->keep_history_default; } - if ($feedHistory >= 0) { - $nb = $feedDAO->cleanOldEntries($feed->id(), $date_min, $feedHistory); + + if ($feed_history >= 0) { + $nb = $feedDAO->cleanOldEntries($feed->id(), $date_min, $feed_history); if ($nb > 0) { - $nbTotal += $nb; - Minz_Log::record($nb . ' old entries cleaned in feed [' . $feed->url() . ']', Minz_Log::DEBUG); - $feedDAO->updateLastUpdate($feed->id()); + $nb_total += $nb; + Minz_Log::debug($nb . ' old entries cleaned in feed [' . $feed->url() . ']'); } } } - invalidateHttpCache(); - - $notif = array( - 'type' => 'good', - 'content' => Minz_Translate::t('purge_completed', $nbTotal) - ); - Minz_Session::_param('notification', $notif); + $feedDAO->updateCachedValues(); - Minz_Request::forward(array( + invalidateHttpCache(); + Minz_Request::good(_t('feedback.sub.purge_completed', $nb_total), array( 'c' => 'configure', 'a' => 'archiving' - ), true); + )); } } diff --git a/app/Controllers/errorController.php b/app/Controllers/errorController.php index dc9a2ee25..b0bafda72 100644 --- a/app/Controllers/errorController.php +++ b/app/Controllers/errorController.php @@ -1,26 +1,53 @@ <?php +/** + * Controller to handle error page. + */ class FreshRSS_error_Controller extends Minz_ActionController { - public function indexAction () { - switch (Minz_Request::param ('code')) { + /** + * This action is the default one for the controller. + * + * It is called by Minz_Error::error() method. + * + * Parameters are passed by Minz_Session to have a proper url: + * - error_code (default: 404) + * - error_logs (default: array()) + */ + public function indexAction() { + $code_int = Minz_Session::param('error_code', 404); + $error_logs = Minz_Session::param('error_logs', array()); + Minz_Session::_param('error_code'); + Minz_Session::_param('error_logs'); + + switch ($code_int) { + case 200 : + header('HTTP/1.1 200 OK'); + break; case 403: + header('HTTP/1.1 403 Forbidden'); $this->view->code = 'Error 403 - Forbidden'; - break; - case 404: - $this->view->code = 'Error 404 - Not found'; + $this->view->errorMessage = _t('feedback.access.denied'); break; case 500: + header('HTTP/1.1 500 Internal Server Error'); $this->view->code = 'Error 500 - Internal Server Error'; break; case 503: + header('HTTP/1.1 503 Service Unavailable'); $this->view->code = 'Error 503 - Service Unavailable'; break; + case 404: default: + header('HTTP/1.1 404 Not Found'); $this->view->code = 'Error 404 - Not found'; + $this->view->errorMessage = _t('feedback.access.not_found'); + } + + $error_message = trim(implode($error_logs)); + if ($error_message !== '') { + $this->view->errorMessage = $error_message; } - - $this->view->logs = Minz_Request::param ('logs'); - - Minz_View::prependTitle ($this->view->code . ' · '); + + Minz_View::prependTitle($this->view->code . ' · '); } } diff --git a/app/Controllers/extensionController.php b/app/Controllers/extensionController.php new file mode 100644 index 000000000..b6d2d3fe4 --- /dev/null +++ b/app/Controllers/extensionController.php @@ -0,0 +1,215 @@ +<?php + +/** + * The controller to manage extensions. + */ +class FreshRSS_extension_Controller extends Minz_ActionController { + /** + * This action is called before every other action in that class. It is + * the common boiler plate for every action. It is triggered by the + * underlying framework. + */ + public function firstAction() { + if (!FreshRSS_Auth::hasAccess()) { + Minz_Error::error(403); + } + } + + /** + * This action lists all the extensions available to the current user. + */ + public function indexAction() { + Minz_View::prependTitle(_t('admin.extensions.title') . ' · '); + $this->view->extension_list = array( + 'system' => array(), + 'user' => array(), + ); + + $extensions = Minz_ExtensionManager::listExtensions(); + foreach ($extensions as $ext) { + $this->view->extension_list[$ext->getType()][] = $ext; + } + } + + /** + * This action handles configuration of a given extension. + * + * Only administrator can configure a system extension. + * + * Parameters are: + * - e: the extension name (urlencoded) + * - additional parameters which should be handle by the extension + * handleConfigureAction() method (POST request). + */ + public function configureAction() { + if (Minz_Request::param('ajax')) { + $this->view->_useLayout(false); + } else { + $this->indexAction(); + $this->view->change_view('extension', 'index'); + } + + $ext_name = urldecode(Minz_Request::param('e')); + $ext = Minz_ExtensionManager::findExtension($ext_name); + + if (is_null($ext)) { + Minz_Error::error(404); + } + if ($ext->getType() === 'system' && !FreshRSS_Auth::hasAccess('admin')) { + Minz_Error::error(403); + } + + $this->view->extension = $ext; + $this->view->extension->handleConfigureAction(); + } + + /** + * This action enables a disabled extension for the current user. + * + * System extensions can only be enabled by an administrator. + * This action must be reached by a POST request. + * + * Parameter is: + * - e: the extension name (urlencoded). + */ + public function enableAction() { + $url_redirect = array('c' => 'extension', 'a' => 'index'); + + if (Minz_Request::isPost()) { + $ext_name = urldecode(Minz_Request::param('e')); + $ext = Minz_ExtensionManager::findExtension($ext_name); + + if (is_null($ext)) { + Minz_Request::bad(_t('feedback.extensions.not_found', $ext_name), + $url_redirect); + } + + if ($ext->isEnabled()) { + Minz_Request::bad(_t('feedback.extensions.already_enabled', $ext_name), + $url_redirect); + } + + $conf = null; + if ($ext->getType() === 'system' && FreshRSS_Auth::hasAccess('admin')) { + $conf = FreshRSS_Context::$system_conf; + } elseif ($ext->getType() === 'user') { + $conf = FreshRSS_Context::$user_conf; + } else { + Minz_Request::bad(_t('feedback.extensions.no_access', $ext_name), + $url_redirect); + } + + $res = $ext->install(); + + if ($res === true) { + $ext_list = $conf->extensions_enabled; + array_push_unique($ext_list, $ext_name); + $conf->extensions_enabled = $ext_list; + $conf->save(); + + Minz_Request::good(_t('feedback.extensions.enable.ok', $ext_name), + $url_redirect); + } else { + Minz_Log::warning('Can not enable extension ' . $ext_name . ': ' . $res); + Minz_Request::bad(_t('feedback.extensions.enable.ko', $ext_name, _url('index', 'logs')), + $url_redirect); + } + } + + Minz_Request::forward($url_redirect, true); + } + + /** + * This action disables an enabled extension for the current user. + * + * System extensions can only be disabled by an administrator. + * This action must be reached by a POST request. + * + * Parameter is: + * - e: the extension name (urlencoded). + */ + public function disableAction() { + $url_redirect = array('c' => 'extension', 'a' => 'index'); + + if (Minz_Request::isPost()) { + $ext_name = urldecode(Minz_Request::param('e')); + $ext = Minz_ExtensionManager::findExtension($ext_name); + + if (is_null($ext)) { + Minz_Request::bad(_t('feedback.extensions.not_found', $ext_name), + $url_redirect); + } + + if (!$ext->isEnabled()) { + Minz_Request::bad(_t('feedback.extensions.not_enabled', $ext_name), + $url_redirect); + } + + $conf = null; + if ($ext->getType() === 'system' && FreshRSS_Auth::hasAccess('admin')) { + $conf = FreshRSS_Context::$system_conf; + } elseif ($ext->getType() === 'user') { + $conf = FreshRSS_Context::$user_conf; + } else { + Minz_Request::bad(_t('feedback.extensions.no_access', $ext_name), + $url_redirect); + } + + $res = $ext->uninstall(); + + if ($res === true) { + $ext_list = $conf->extensions_enabled; + array_remove($ext_list, $ext_name); + $conf->extensions_enabled = $ext_list; + $conf->save(); + + Minz_Request::good(_t('feedback.extensions.disable.ok', $ext_name), + $url_redirect); + } else { + Minz_Log::warning('Can not unable extension ' . $ext_name . ': ' . $res); + Minz_Request::bad(_t('feedback.extensions.disable.ko', $ext_name, _url('index', 'logs')), + $url_redirect); + } + } + + Minz_Request::forward($url_redirect, true); + } + + /** + * This action handles deletion of an extension. + * + * Only administrator can remove an extension. + * This action must be reached by a POST request. + * + * Parameter is: + * -e: extension name (urlencoded) + */ + public function removeAction() { + if (!FreshRSS_Auth::hasAccess('admin')) { + Minz_Error::error(403); + } + + $url_redirect = array('c' => 'extension', 'a' => 'index'); + + if (Minz_Request::isPost()) { + $ext_name = urldecode(Minz_Request::param('e')); + $ext = Minz_ExtensionManager::findExtension($ext_name); + + if (is_null($ext)) { + Minz_Request::bad(_t('feedback.extensions.not_found', $ext_name), + $url_redirect); + } + + $res = recursive_unlink($ext->getPath()); + if ($res) { + Minz_Request::good(_t('feedback.extensions.removed', $ext_name), + $url_redirect); + } else { + Minz_Request::bad(_t('feedback.extensions.cannot_delete', $ext_name), + $url_redirect); + } + } + + Minz_Request::forward($url_redirect, true); + } +} diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index c718fcd5c..f71f26a4e 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -1,451 +1,591 @@ <?php +/** + * Controller to handle every feed actions. + */ class FreshRSS_feed_Controller extends Minz_ActionController { - public function firstAction () { - if (!$this->view->loginOk) { + /** + * This action is called before every other action in that class. It is + * the common boiler plate for every action. It is triggered by the + * underlying framework. + */ + public function firstAction() { + if (!FreshRSS_Auth::hasAccess()) { // Token is useful in the case that anonymous refresh is forbidden // and CRON task cannot be used with php command so the user can // set a CRON task to refresh his feeds by using token inside url - $token = $this->view->conf->token; - $token_param = Minz_Request::param ('token', ''); + $token = FreshRSS_Context::$user_conf->token; + $token_param = Minz_Request::param('token', ''); $token_is_ok = ($token != '' && $token == $token_param); - $action = Minz_Request::actionName (); - if (!(($token_is_ok || Minz_Configuration::allowAnonymousRefresh()) && - $action === 'actualize') - ) { - Minz_Error::error ( - 403, - array ('error' => array (Minz_Translate::t ('access_denied'))) - ); + $action = Minz_Request::actionName(); + $allow_anonymous_refresh = FreshRSS_Context::$system_conf->allow_anonymous_refresh; + if ($action !== 'actualize' || + !($allow_anonymous_refresh || $token_is_ok)) { + Minz_Error::error(403); } } } - public function addAction () { + public static function addFeed($url, $title = '', $cat_id = 0, $new_cat_name = '', $http_auth = '') { + FreshRSS_UserDAO::touch(); @set_time_limit(300); - if (Minz_Request::isPost ()) { - $this->catDAO = new FreshRSS_CategoryDAO (); - $this->catDAO->checkDefault (); + $catDAO = new FreshRSS_CategoryDAO(); - $url = Minz_Request::param ('url_rss'); - $cat = Minz_Request::param ('category', false); - if ($cat === false) { - $def_cat = $this->catDAO->getDefault (); - $cat = $def_cat->id (); + $cat = null; + if ($cat_id > 0) { + $cat = $catDAO->searchById($cat_id); + } + if ($cat == null && $new_cat_name != '') { + $cat = $catDAO->addCategory(array('name' => $new_cat_name)); + } + if ($cat == null) { + $catDAO->checkDefault(); + } + $cat_id = $cat == null ? FreshRSS_CategoryDAO::defaultCategoryId : $cat->id(); + + $feed = new FreshRSS_Feed($url); //Throws FreshRSS_BadUrl_Exception + $feed->_httpAuth($http_auth); + $feed->load(true); //Throws FreshRSS_Feed_Exception, Minz_FileNotExistException + $feed->_category($cat_id); + + $feedDAO = FreshRSS_Factory::createFeedDao(); + if ($feedDAO->searchByUrl($feed->url())) { + throw new FreshRSS_AlreadySubscribed_Exception($url, $feed->name()); + } + + // Call the extension hook + $feed = Minz_ExtensionManager::callHook('feed_before_insert', $feed); + if ($feed === null) { + throw new FreshRSS_FeedNotAdded_Exception($url, $feed->name()); + } + + $values = array( + 'url' => $feed->url(), + 'category' => $feed->category(), + 'name' => $title != '' ? $title : $feed->name(), + 'website' => $feed->website(), + 'description' => $feed->description(), + 'lastUpdate' => time(), + 'httpAuth' => $feed->httpAuth(), + ); + + $id = $feedDAO->addFeed($values); + if (!$id) { + // There was an error in database... we cannot say what here. + throw new FreshRSS_FeedNotAdded_Exception($url, $feed->name()); + } + $feed->_id($id); + + // Ok, feed has been added in database. Now we have to refresh entries. + self::actualizeFeed($id, $url, false, null, true); + + return $feed; + } + + /** + * This action subscribes to a feed. + * + * It can be reached by both GET and POST requests. + * + * GET request displays a form to add and configure a feed. + * Request parameter is: + * - url_rss (default: false) + * + * POST request adds a feed in database. + * Parameters are: + * - url_rss (default: false) + * - category (default: false) + * - new_category (required if category == 'nc') + * - http_user (default: false) + * - http_pass (default: false) + * It tries to get website information from RSS feed. + * If no category is given, feed is added to the default one. + * + * If url_rss is false, nothing happened. + */ + public function addAction() { + $url = Minz_Request::param('url_rss'); + + if ($url === false) { + // No url, do nothing + Minz_Request::forward(array( + 'c' => 'subscription', + 'a' => 'index' + ), true); + } + + $feedDAO = FreshRSS_Factory::createFeedDao(); + $url_redirect = array( + 'c' => 'subscription', + 'a' => 'index', + 'params' => array(), + ); + + $limits = FreshRSS_Context::$system_conf->limits; + $this->view->feeds = $feedDAO->listFeeds(); + if (count($this->view->feeds) >= $limits['max_feeds']) { + Minz_Request::bad(_t('feedback.sub.feed.over_max', $limits['max_feeds']), + $url_redirect); + } + + if (Minz_Request::isPost()) { + $cat = Minz_Request::param('category'); + $new_cat_name = ''; + if ($cat === 'nc') { + // User want to create a new category, new_category parameter + // must exist + $new_cat = Minz_Request::param('new_category'); + $new_cat_name = isset($new_cat['name']) ? $new_cat['name'] : ''; } - $user = Minz_Request::param ('http_user'); - $pass = Minz_Request::param ('http_pass'); - $params = array (); + // HTTP information are useful if feed is protected behind a + // HTTP authentication + $user = trim(Minz_Request::param('http_user', '')); + $pass = Minz_Request::param('http_pass', ''); + $http_auth = ''; + if ($user != '' && $pass != '') { //TODO: Sanitize + $http_auth = $user . ':' . $pass; + } - $transactionStarted = false; try { - $feed = new FreshRSS_Feed ($url); - $feed->_category ($cat); - - $httpAuth = ''; - if ($user != '' || $pass != '') { - $httpAuth = $user . ':' . $pass; - } - $feed->_httpAuth ($httpAuth); - - $feed->load(true); - - $feedDAO = new FreshRSS_FeedDAO (); - $values = array ( - 'url' => $feed->url (), - 'category' => $feed->category (), - 'name' => $feed->name (), - 'website' => $feed->website (), - 'description' => $feed->description (), - 'lastUpdate' => time (), - 'httpAuth' => $feed->httpAuth (), - ); - - if ($feedDAO->searchByUrl ($values['url'])) { - // on est déjà abonné à ce flux - $notif = array ( - 'type' => 'bad', - 'content' => Minz_Translate::t ('already_subscribed', $feed->name ()) - ); - Minz_Session::_param ('notification', $notif); - } else { - $id = $feedDAO->addFeed ($values); - if (!$id) { - // problème au niveau de la base de données - $notif = array ( - 'type' => 'bad', - 'content' => Minz_Translate::t ('feed_not_added', $feed->name ()) - ); - Minz_Session::_param ('notification', $notif); - } else { - $feed->_id ($id); - $feed->faviconPrepare(); - - $is_read = $this->view->conf->mark_when['reception'] ? 1 : 0; - - $entryDAO = new FreshRSS_EntryDAO (); - $entries = array_reverse($feed->entries()); //We want chronological order and SimplePie uses reverse order - - // on calcule la date des articles les plus anciens qu'on accepte - $nb_month_old = $this->view->conf->old_entries; - $date_min = time () - (3600 * 24 * 30 * $nb_month_old); - - $transactionStarted = true; - $feedDAO->beginTransaction (); - // on ajoute les articles en masse sans vérification - foreach ($entries as $entry) { - $values = $entry->toArray (); - $values['id_feed'] = $feed->id (); - $values['id'] = min(time(), $entry->date (true)) . uSecString(); - $values['is_read'] = $is_read; - $entryDAO->addEntry ($values); - } - $feedDAO->updateLastUpdate ($feed->id ()); - $feedDAO->commit (); - $transactionStarted = false; - - // ok, ajout terminé - $notif = array ( - 'type' => 'good', - 'content' => Minz_Translate::t ('feed_added', $feed->name ()) - ); - Minz_Session::_param ('notification', $notif); - - // permet de rediriger vers la page de conf du flux - $params['id'] = $feed->id (); - } - } + $feed = self::addFeed($url, '', $cat, $new_cat_name, $http_auth); } catch (FreshRSS_BadUrl_Exception $e) { - Minz_Log::record ($e->getMessage (), Minz_Log::WARNING); - $notif = array ( - 'type' => 'bad', - 'content' => Minz_Translate::t ('invalid_url', $url) - ); - Minz_Session::_param ('notification', $notif); + // Given url was not a valid url! + Minz_Log::warning($e->getMessage()); + Minz_Request::bad(_t('feedback.sub.feed.invalid_url', $url), $url_redirect); } catch (FreshRSS_Feed_Exception $e) { - Minz_Log::record ($e->getMessage (), Minz_Log::WARNING); - $notif = array ( - 'type' => 'bad', - 'content' => Minz_Translate::t ('internal_problem_feed') - ); - Minz_Session::_param ('notification', $notif); + // Something went bad (timeout, server not found, etc.) + Minz_Log::warning($e->getMessage()); + Minz_Request::bad(_t('feedback.sub.feed.internal_problem', _url('index', 'logs')), $url_redirect); } catch (Minz_FileNotExistException $e) { - // Répertoire de cache n'existe pas - Minz_Log::record ($e->getMessage (), Minz_Log::ERROR); - $notif = array ( - 'type' => 'bad', - 'content' => Minz_Translate::t ('internal_problem_feed') - ); - Minz_Session::_param ('notification', $notif); + // Cache directory doesn't exist! + Minz_Log::error($e->getMessage()); + Minz_Request::bad(_t('feedback.sub.feed.internal_problem', _url('index', 'logs')), $url_redirect); + } catch (FreshRSS_AlreadySubscribed_Exception $e) { + Minz_Request::bad(_t('feedback.sub.feed.already_subscribed', $e->feedName()), $url_redirect); + } catch (FreshRSS_FeedNotAdded_Exception $e) { + Minz_Request::bad(_t('feedback.sub.feed.not_added', $e->feedName()), $url_redirect); } - if ($transactionStarted) { - $feedDAO->rollBack (); + + // Entries are in DB, we redirect to feed configuration page. + $url_redirect['params']['id'] = $feed->id(); + Minz_Request::good(_t('feedback.sub.feed.added', $feed->name()), $url_redirect); + } else { + // GET request: we must ask confirmation to user before adding feed. + Minz_View::prependTitle(_t('sub.feed.title_add') . ' · '); + + $this->catDAO = new FreshRSS_CategoryDAO(); + $this->view->categories = $this->catDAO->listCategories(false); + $this->view->feed = new FreshRSS_Feed($url); + try { + // We try to get more information about the feed. + $this->view->feed->load(true); + $this->view->load_ok = true; + } catch (Exception $e) { + $this->view->load_ok = false; } - Minz_Request::forward (array ('c' => 'configure', 'a' => 'feed', 'params' => $params), true); + $feed = $feedDAO->searchByUrl($this->view->feed->url()); + if ($feed) { + // Already subscribe so we redirect to the feed configuration page. + $url_redirect['params']['id'] = $feed->id(); + Minz_Request::good(_t('feedback.sub.feed.already_subscribed', $feed->name()), $url_redirect); + } } } - public function truncateAction () { - if (Minz_Request::isPost ()) { - $id = Minz_Request::param ('id'); - $feedDAO = new FreshRSS_FeedDAO (); - $n = $feedDAO->truncate($id); - $notif = array( - 'type' => $n === false ? 'bad' : 'good', - 'content' => Minz_Translate::t ('n_entries_deleted', $n) - ); - Minz_Session::_param ('notification', $notif); - invalidateHttpCache(); - Minz_Request::forward (array ('c' => 'configure', 'a' => 'feed', 'params' => array('id' => $id)), true); + /** + * This action remove entries from a given feed. + * + * It should be reached by a POST action. + * + * Parameter is: + * - id (default: false) + */ + public function truncateAction() { + $id = Minz_Request::param('id'); + $url_redirect = array( + 'c' => 'subscription', + 'a' => 'index', + 'params' => array('id' => $id) + ); + + if (!Minz_Request::isPost()) { + Minz_Request::forward($url_redirect, true); + } + + $feedDAO = FreshRSS_Factory::createFeedDao(); + $n = $feedDAO->truncate($id); + + invalidateHttpCache(); + if ($n === false) { + Minz_Request::bad(_t('feedback.sub.feed.error'), $url_redirect); + } else { + Minz_Request::good(_t('feedback.sub.feed.n_entries_deleted', $n), $url_redirect); } } - public function actualizeAction () { + public static function actualizeFeed($feed_id, $feed_url, $force, $simplePiePush = null, $isNewFeed = false) { @set_time_limit(300); - $feedDAO = new FreshRSS_FeedDAO (); - $entryDAO = new FreshRSS_EntryDAO (); + $feedDAO = FreshRSS_Factory::createFeedDao(); + $entryDAO = FreshRSS_Factory::createEntryDao(); - Minz_Session::_param('actualize_feeds', false); - $id = Minz_Request::param ('id'); - $force = Minz_Request::param ('force', false); - - // on créé la liste des flux à mettre à actualiser - // si on veut mettre un flux à jour spécifiquement, on le met - // dans la liste, mais seul (permet d'automatiser le traitement) - $feeds = array (); - if ($id) { - $feed = $feedDAO->searchById ($id); + // Create a list of feeds to actualize. + // If feed_id is set and valid, corresponding feed is added to the list but + // alone in order to automatize further process. + $feeds = array(); + if ($feed_id > 0 || $feed_url) { + $feed = $feed_id > 0 ? $feedDAO->searchById($feed_id) : $feedDAO->searchByUrl($feed_url); if ($feed) { - $feeds = array ($feed); + $feeds[] = $feed; } } else { - $feeds = $feedDAO->listFeedsOrderUpdate (); + $feeds = $feedDAO->listFeedsOrderUpdate(-1); } - // on calcule la date des articles les plus anciens qu'on accepte - $nb_month_old = max($this->view->conf->old_entries, 1); - $date_min = time () - (3600 * 24 * 30 * $nb_month_old); + // Calculate date of oldest entries we accept in DB. + $nb_month_old = max(FreshRSS_Context::$user_conf->old_entries, 1); + $date_min = time() - (3600 * 24 * 30 * $nb_month_old); - $i = 0; - $flux_update = 0; - $is_read = $this->view->conf->mark_when['reception'] ? 1 : 0; + // PubSubHubbub support + $pubsubhubbubEnabledGeneral = FreshRSS_Context::$system_conf->pubsubhubbub_enabled; + $pshbMinAge = time() - (3600 * 24); //TODO: Make a configuration. + + $updated_feeds = 0; + $is_read = FreshRSS_Context::$user_conf->mark_when['reception'] ? 1 : 0; foreach ($feeds as $feed) { + $url = $feed->url(); //For detection of HTTP 301 + + $pubSubHubbubEnabled = $pubsubhubbubEnabledGeneral && $feed->pubSubHubbubEnabled(); + if ((!$simplePiePush) && (!$feed_id) && $pubSubHubbubEnabled && ($feed->lastUpdate() > $pshbMinAge)) { + //$text = 'Skip pull of feed using PubSubHubbub: ' . $url; + //Minz_Log::debug($text); + //file_put_contents(USERS_PATH . '/_/log_pshb.txt', date('c') . "\t" . $text . "\n", FILE_APPEND); + continue; //When PubSubHubbub is used, do not pull refresh so often + } + + $mtime = 0; + $ttl = $feed->ttl(); + if ($ttl == -1) { + continue; //Feed refresh is disabled + } + if ((!$simplePiePush) && (!$feed_id) && + ($feed->lastUpdate() + 10 >= time() - ($ttl == -2 ? 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) { + continue; //Nothing newer from other users + } + //Minz_Log::debug($feed->url() . ' was updated at ' . date('c', $mtime) . ' by another user'); + //Will take advantage of the newer cache + } + if (!$feed->lock()) { - Minz_Log::record('Feed already being actualized: ' . $feed->url(), Minz_Log::NOTICE); + Minz_Log::notice('Feed already being actualized: ' . $feed->url()); continue; } + try { - $url = $feed->url(); - $feedHistory = $feed->keepHistory(); + if ($simplePiePush) { + $feed->loadEntries($simplePiePush); //Used by PubSubHubbub + } else { + $feed->load(false, $isNewFeed); + } + } catch (FreshRSS_Feed_Exception $e) { + Minz_Log::warning($e->getMessage()); + $feedDAO->updateLastUpdate($feed->id(), true); + $feed->unlock(); + continue; + } - $feed->load(false); - $entries = array_reverse($feed->entries()); //We want chronological order and SimplePie uses reverse order - $hasTransaction = false; + $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_Context::$user_conf->keep_history_default; + } - if (count($entries) > 0) { - //For this feed, check last n entry GUIDs already in database - $existingGuids = array_fill_keys ($entryDAO->listLastGuidsByFeed ($feed->id (), count($entries) + 10), 1); - $useDeclaredDate = empty($existingGuids); + // We want chronological order and SimplePie uses reverse order. + $entries = array_reverse($feed->entries()); + if (count($entries) > 0) { + $newGuids = array(); + foreach ($entries as $entry) { + $newGuids[] = safe_ascii($entry->guid()); + } + // For this feed, check existing GUIDs already in database. + $existingHashForGuids = $entryDAO->listHashForFeedGuids($feed->id(), $newGuids); + unset($newGuids); + + $oldGuids = array(); + // Add entries in database if possible. + foreach ($entries as $entry) { + $entry_date = $entry->date(true); + if (isset($existingHashForGuids[$entry->guid()])) { + $existingHash = $existingHashForGuids[$entry->guid()]; + if (strcasecmp($existingHash, $entry->hash()) === 0 || trim($existingHash, '0') == '') { + //This entry already exists and is unchanged. TODO: Remove the test with the zero'ed hash in FreshRSS v1.3 + $oldGuids[] = $entry->guid(); + } else { //This entry already exists but has been updated + //Minz_Log::debug('Entry with GUID `' . $entry->guid() . '` updated in feed ' . $feed->id() . + //', old hash ' . $existingHash . ', new hash ' . $entry->hash()); + //TODO: Make an updated/is_read policy by feed, in addition to the global one. + $entry->_isRead(FreshRSS_Context::$user_conf->mark_updated_article_unread ? false : null); //Change is_read according to policy. + if (!$entryDAO->inTransaction()) { + $entryDAO->beginTransaction(); + } + $entryDAO->updateEntry($entry->toArray()); + } + } elseif ($feed_history == 0 && $entry_date < $date_min) { + // This entry should not be added considering configuration and date. + $oldGuids[] = $entry->guid(); + } else { + if ($isNewFeed) { + $id = min(time(), $entry_date) . uSecString(); + } elseif ($entry_date < $date_min) { + $id = min(time(), $entry_date) . uSecString(); + $entry->_isRead(true); //Old article that was not in database. Probably an error, so mark as read + } else { + $id = uTimeString(); + $entry->_isRead($is_read); + } + $entry->_id($id); - if ($feedHistory == -2) { //default - $feedHistory = $this->view->conf->keep_history_default; - } + $entry = Minz_ExtensionManager::callHook('entry_before_insert', $entry); + if ($entry === null) { + // An extension has returned a null value, there is nothing to insert. + continue; + } - $hasTransaction = true; - $feedDAO->beginTransaction(); - - // On ne vérifie pas strictement que l'article n'est pas déjà en BDD - // La BDD refusera l'ajout car (id_feed, guid) doit être unique - foreach ($entries as $entry) { - $eDate = $entry->date (true); - if ((!isset ($existingGuids[$entry->guid ()])) && - (($feedHistory != 0) || ($eDate >= $date_min))) { - $values = $entry->toArray (); - //Use declared date at first import, otherwise use discovery date - $values['id'] = ($useDeclaredDate || $eDate < $date_min) ? - min(time(), $eDate) . uSecString() : - uTimeString(); - $values['is_read'] = $is_read; - $entryDAO->addEntry ($values); + if ($pubSubHubbubEnabled && !$simplePiePush) { //We use push, but have discovered an article by pull! + $text = 'An article was discovered by pull although we use PubSubHubbub!: Feed ' . $url . ' GUID ' . $entry->guid(); + file_put_contents(USERS_PATH . '/_/log_pshb.txt', date('c') . "\t" . $text . "\n", FILE_APPEND); + Minz_Log::warning($text); + $pubSubHubbubEnabled = false; + $feed->pubSubHubbubError(true); } + + if (!$entryDAO->inTransaction()) { + $entryDAO->beginTransaction(); + } + $entryDAO->addEntry($entry->toArray()); } } + $entryDAO->updateLastSeen($feed->id(), $oldGuids, $mtime); + } - if (($feedHistory >= 0) && (rand(0, 30) === 1)) { - if (!$hasTransaction) { - $feedDAO->beginTransaction(); - } - $nb = $feedDAO->cleanOldEntries ($feed->id (), $date_min, max($feedHistory, count($entries) + 10)); - if ($nb > 0) { - Minz_Log::record ($nb . ' old entries cleaned in feed [' . $feed->url() . ']', Minz_Log::DEBUG); - } + if ($feed_history >= 0 && rand(0, 30) === 1) { + // TODO: move this function in web cron when available (see entry::purge) + // Remove old entries once in 30. + if (!$entryDAO->inTransaction()) { + $entryDAO->beginTransaction(); } - // on indique que le flux vient d'être mis à jour en BDD - $feedDAO->updateLastUpdate ($feed->id (), 0, $hasTransaction); - if ($hasTransaction) { - $feedDAO->commit(); + $nb = $feedDAO->cleanOldEntries($feed->id(), + $date_min, + max($feed_history, count($entries) + 10)); + if ($nb > 0) { + Minz_Log::debug($nb . ' old entries cleaned in feed [' . + $feed->url() . ']'); } - $flux_update++; - if ($feed->url() !== $url) { //URL has changed (auto-discovery) - $feedDAO->updateFeed($feed->id(), array('url' => $feed->url())); + } + + $feedDAO->updateLastUpdate($feed->id(), false, $entryDAO->inTransaction(), $mtime); + if ($entryDAO->inTransaction()) { + $entryDAO->commit(); + } + + if ($feed->hubUrl() && $feed->selfUrl()) { //selfUrl has priority for PubSubHubbub + if ($feed->selfUrl() !== $url) { //https://code.google.com/p/pubsubhubbub/wiki/MovingFeedsOrChangingHubs + $selfUrl = checkUrl($feed->selfUrl()); + if ($selfUrl) { + Minz_Log::debug('PubSubHubbub unsubscribe ' . $feed->url()); + if (!$feed->pubSubHubbubSubscribe(false)) { //Unsubscribe + Minz_Log::warning('Error while PubSubHubbub unsubscribing from ' . $feed->url()); + } + $feed->_url($selfUrl, false); + Minz_Log::notice('Feed ' . $url . ' canonical address moved to ' . $feed->url()); + $feedDAO->updateFeed($feed->id(), array('url' => $feed->url())); + } } - } catch (FreshRSS_Feed_Exception $e) { - Minz_Log::record ($e->getMessage (), Minz_Log::NOTICE); - $feedDAO->updateLastUpdate ($feed->id (), 1); + } + elseif ($feed->url() !== $url) { // HTTP 301 Moved Permanently + Minz_Log::notice('Feed ' . $url . ' moved permanently to ' . $feed->url()); + $feedDAO->updateFeed($feed->id(), array('url' => $feed->url())); } $feed->faviconPrepare(); + if ($pubsubhubbubEnabledGeneral && $feed->pubSubHubbubPrepare()) { + Minz_Log::notice('PubSubHubbub subscribe ' . $feed->url()); + if (!$feed->pubSubHubbubSubscribe(true)) { //Subscribe + Minz_Log::warning('Error while PubSubHubbub subscribing to ' . $feed->url()); + } + } $feed->unlock(); + $updated_feeds++; unset($feed); - // On arrête à 10 flux pour ne pas surcharger le serveur - // sauf si le paramètre $force est à vrai - $i++; - if ($i >= 10 && !$force) { + // No more than 10 feeds unless $force is true to avoid overloading + // the server. + if ($updated_feeds >= 10 && !$force) { break; } } + return array($updated_feeds, reset($feeds)); + } - $url = array (); - if ($flux_update === 1) { - // on a mis un seul flux à jour - $feed = reset ($feeds); - $notif = array ( - 'type' => 'good', - 'content' => Minz_Translate::t ('feed_actualized', $feed->name ()) - ); - } elseif ($flux_update > 1) { - // plusieurs flux on été mis à jour - $notif = array ( - 'type' => 'good', - 'content' => Minz_Translate::t ('n_feeds_actualized', $flux_update) - ); - } else { - // aucun flux n'a été mis à jour, oups - $notif = array ( - 'type' => 'good', - 'content' => Minz_Translate::t ('no_feed_to_refresh') - ); - } + /** + * This action actualizes entries from one or several feeds. + * + * Parameters are: + * - id (default: false): Feed ID + * - url (default: false): Feed URL + * - force (default: false) + * If id and url are not specified, all the feeds are actualized. But if force is + * false, process stops at 10 feeds to avoid time execution problem. + */ + public function actualizeAction() { + Minz_Session::_param('actualize_feeds', false); + $id = Minz_Request::param('id'); + $url = Minz_Request::param('url'); + $force = Minz_Request::param('force'); - if ($i === 1) { - // Si on a voulu mettre à jour qu'un flux - // on filtre l'affichage par ce flux - $feed = reset ($feeds); - $url['params'] = array ('get' => 'f_' . $feed->id ()); - } + list($updated_feeds, $feed) = self::actualizeFeed($id, $url, $force); - if (Minz_Request::param ('ajax', 0) === 0) { - Minz_Session::_param ('notification', $notif); - Minz_Request::forward ($url, true); - } else { - // Une requête Ajax met un seul flux à jour. - // Comme en principe plusieurs requêtes ont lieu, - // on indique que "plusieurs flux ont été mis à jour". - // Cela permet d'avoir une notification plus proche du - // ressenti utilisateur - $notif = array ( + if (Minz_Request::param('ajax')) { + // Most of the time, ajax request is for only one feed. But since + // there are several parallel requests, we should return that there + // are several updated feeds. + $notif = array( 'type' => 'good', - 'content' => Minz_Translate::t ('feeds_actualized') + 'content' => _t('feedback.sub.feed.actualizeds') ); - Minz_Session::_param ('notification', $notif); - // et on désactive le layout car ne sert à rien - $this->view->_useLayout (false); + Minz_Session::_param('notification', $notif); + // No layout in ajax request. + $this->view->_useLayout(false); + } else { + // Redirect to the main page with correct notification. + if ($updated_feeds === 1) { + Minz_Request::good(_t('feedback.sub.feed.actualized', $feed->name()), array( + 'params' => array('get' => 'f_' . $feed->id()) + )); + } elseif ($updated_feeds > 1) { + Minz_Request::good(_t('feedback.sub.feed.n_actualized', $updated_feeds), array()); + } else { + Minz_Request::good(_t('feedback.sub.feed.no_refresh'), array()); + } } + return $updated_feeds; } - public function massiveImportAction () { - @set_time_limit(300); - - $this->catDAO = new FreshRSS_CategoryDAO (); - $this->catDAO->checkDefault (); - - $entryDAO = new FreshRSS_EntryDAO (); - $feedDAO = new FreshRSS_FeedDAO (); + public static function renameFeed($feed_id, $feed_name) { + if ($feed_id <= 0 || $feed_name == '') { + return false; + } + FreshRSS_UserDAO::touch(); + $feedDAO = FreshRSS_Factory::createFeedDao(); + return $feedDAO->updateFeed($feed_id, array('name' => $feed_name)); + } - $categories = Minz_Request::param ('categories', array (), true); - $feeds = Minz_Request::param ('feeds', array (), true); + public static function moveFeed($feed_id, $cat_id, $new_cat_name = '') { + if ($feed_id <= 0 || ($cat_id <= 0 && $new_cat_name == '')) { + return false; + } + FreshRSS_UserDAO::touch(); - // on ajoute les catégories en masse dans une fonction à part - $this->addCategories ($categories); + $catDAO = new FreshRSS_CategoryDAO(); + if ($cat_id > 0) { + $cat = $catDAO->searchById($cat_id); + $cat_id = $cat == null ? 0 : $cat->id(); + } + if ($cat_id <= 1 && $new_cat_name != '') { + $cat_id = $catDAO->addCategory(array('name' => $new_cat_name)); + } + if ($cat_id <= 1) { + $catDAO->checkDefault(); + $cat_id = FreshRSS_CategoryDAO::defaultCategoryId; + } - // on calcule la date des articles les plus anciens qu'on accepte - $nb_month_old = $this->view->conf->old_entries; - $date_min = time () - (3600 * 24 * 30 * $nb_month_old); + $feedDAO = FreshRSS_Factory::createFeedDao(); + return $feedDAO->updateFeed($feed_id, array('category' => $cat_id)); + } - // la variable $error permet de savoir si une erreur est survenue - // Le but est de ne pas arrêter l'import même en cas d'erreur - // L'utilisateur sera mis au courant s'il y a eu des erreurs, mais - // ne connaîtra pas les détails. Ceux-ci seront toutefois logguées - $error = false; - $i = 0; - foreach ($feeds as $feed) { - try { - $values = array ( - 'id' => $feed->id (), - 'url' => $feed->url (), - 'category' => $feed->category (), - 'name' => $feed->name (), - 'website' => $feed->website (), - 'description' => $feed->description (), - 'lastUpdate' => 0, - 'httpAuth' => $feed->httpAuth () - ); - - // ajout du flux que s'il n'est pas déjà en BDD - if (!$feedDAO->searchByUrl ($values['url'])) { - $id = $feedDAO->addFeed ($values); - if ($id) { - $feed->_id ($id); - $feed->faviconPrepare(); - } else { - $error = true; - } - } - } catch (FreshRSS_Feed_Exception $e) { - $error = true; - Minz_Log::record ($e->getMessage (), Minz_Log::WARNING); - } + /** + * This action changes the category of a feed. + * + * This page must be reached by a POST request. + * + * Parameters are: + * - f_id (default: false) + * - c_id (default: false) + * If c_id is false, default category is used. + * + * @todo should handle order of the feed inside the category. + */ + public function moveAction() { + if (!Minz_Request::isPost()) { + Minz_Request::forward(array('c' => 'subscription'), true); } - if ($error) { - $res = Minz_Translate::t ('feeds_imported_with_errors'); + $feed_id = Minz_Request::param('f_id'); + $cat_id = Minz_Request::param('c_id'); + + if (self::moveFeed($feed_id, $cat_id)) { + // TODO: return something useful } else { - $res = Minz_Translate::t ('feeds_imported'); + Minz_Log::warning('Cannot move feed `' . $feed_id . '` ' . + 'in the category `' . $cat_id . '`'); + Minz_Error::error(404); } - - $notif = array ( - 'type' => 'good', - 'content' => $res - ); - Minz_Session::_param ('notification', $notif); - Minz_Session::_param ('actualize_feeds', true); - - // et on redirige vers la page d'accueil - Minz_Request::forward (array ( - 'c' => 'index', - 'a' => 'index' - ), true); } - public function deleteAction () { - if (Minz_Request::isPost ()) { - $type = Minz_Request::param ('type', 'feed'); - $id = Minz_Request::param ('id'); - - $feedDAO = new FreshRSS_FeedDAO (); - if ($type == 'category') { - if ($feedDAO->deleteFeedByCategory ($id)) { - $notif = array ( - 'type' => 'good', - 'content' => Minz_Translate::t ('category_emptied') - ); - //TODO: Delete old favicons - } else { - $notif = array ( - 'type' => 'bad', - 'content' => Minz_Translate::t ('error_occured') - ); - } - } else { - if ($feedDAO->deleteFeed ($id)) { - $notif = array ( - 'type' => 'good', - 'content' => Minz_Translate::t ('feed_deleted') - ); - //TODO: Delete old favicon - } else { - $notif = array ( - 'type' => 'bad', - 'content' => Minz_Translate::t ('error_occured') - ); - } - } + public static function deleteFeed($feed_id) { + FreshRSS_UserDAO::touch(); + $feedDAO = FreshRSS_Factory::createFeedDao(); + if ($feedDAO->deleteFeed($feed_id)) { + // TODO: Delete old favicon - Minz_Session::_param ('notification', $notif); + // Remove related queries + FreshRSS_Context::$user_conf->queries = remove_query_by_get( + 'f_' . $feed_id, FreshRSS_Context::$user_conf->queries); + FreshRSS_Context::$user_conf->save(); - if ($type == 'category') { - Minz_Request::forward (array ('c' => 'configure', 'a' => 'categorize'), true); - } else { - Minz_Request::forward (array ('c' => 'configure', 'a' => 'feed'), true); - } + return true; } + return false; } - private function addCategories ($categories) { - foreach ($categories as $cat) { - if (!$this->catDAO->searchByName ($cat->name ())) { - $values = array ( - 'id' => $cat->id (), - 'name' => $cat->name (), - ); - $catDAO->addCategory ($values); - } + /** + * This action deletes a feed. + * + * This page must be reached by a POST request. + * If there are related queries, they are deleted too. + * + * Parameters are: + * - id (default: false) + * - r (default: false) + * r permits to redirect to a given page at the end of this action. + * + * @todo handle "r" redirection in Minz_Request::forward()? + */ + public function deleteAction() { + $redirect_url = Minz_Request::param('r', false, true); + if (!$redirect_url) { + $redirect_url = array('c' => 'subscription', 'a' => 'index'); + } + if (!Minz_Request::isPost()) { + Minz_Request::forward($redirect_url, true); + } + + $id = Minz_Request::param('id'); + + if (self::deleteFeed($id)) { + Minz_Request::good(_t('feedback.sub.feed.deleted'), $redirect_url); + } else { + Minz_Request::bad(_t('feedback.sub.feed.error'), $redirect_url); } } } diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php new file mode 100644 index 000000000..6ae89defb --- /dev/null +++ b/app/Controllers/importExportController.php @@ -0,0 +1,716 @@ +<?php + +/** + * Controller to handle every import and export actions. + */ +class FreshRSS_importExport_Controller extends Minz_ActionController { + /** + * This action is called before every other action in that class. It is + * the common boiler plate for every action. It is triggered by the + * underlying framework. + */ + public function firstAction() { + if (!FreshRSS_Auth::hasAccess()) { + Minz_Error::error(403); + } + + require_once(LIB_PATH . '/lib_opml.php'); + + $this->catDAO = new FreshRSS_CategoryDAO(); + $this->entryDAO = FreshRSS_Factory::createEntryDao(); + $this->feedDAO = FreshRSS_Factory::createFeedDao(); + } + + /** + * This action displays the main page for import / export system. + */ + public function indexAction() { + $this->view->feeds = $this->feedDAO->listFeeds(); + Minz_View::prependTitle(_t('sub.import_export.title') . ' · '); + } + + public function importFile($name, $path, $username = null) { + require_once(LIB_PATH . '/lib_opml.php'); + + $this->catDAO = new FreshRSS_CategoryDAO($username); + $this->entryDAO = FreshRSS_Factory::createEntryDao($username); + $this->feedDAO = FreshRSS_Factory::createFeedDao($username); + + $type_file = self::guessFileType($name); + + $list_files = array( + 'opml' => array(), + 'json_starred' => array(), + 'json_feed' => array() + ); + + // We try to list all files according to their type + $list = array(); + if ($type_file === 'zip' && extension_loaded('zip')) { + $zip = zip_open($path); + if (!is_resource($zip)) { + // zip_open cannot open file: something is wrong + throw new FreshRSS_Zip_Exception($zip); + } + while (($zipfile = zip_read($zip)) !== false) { + if (!is_resource($zipfile)) { + // zip_entry() can also return an error code! + throw new FreshRSS_Zip_Exception($zipfile); + } else { + $type_zipfile = self::guessFileType(zip_entry_name($zipfile)); + if ($type_file !== 'unknown') { + $list_files[$type_zipfile][] = zip_entry_read( + $zipfile, + zip_entry_filesize($zipfile) + ); + } + } + } + zip_close($zip); + } elseif ($type_file === 'zip') { + // ZIP extension is not loaded + throw new FreshRSS_ZipMissing_Exception(); + } elseif ($type_file !== 'unknown') { + $list_files[$type_file][] = file_get_contents($path); + } + + // Import file contents. + // OPML first(so categories and feeds are imported) + // Starred articles then so the "favourite" status is already set + // And finally all other files. + $ok = true; + foreach ($list_files['opml'] as $opml_file) { + if (!$this->importOpml($opml_file)) { + $ok = false; + if (FreshRSS_Context::$isCli) { + fwrite(STDERR, 'FreshRSS error during OPML import' . "\n"); + } else { + Minz_Log::warning('Error during OPML import'); + } + } + } + foreach ($list_files['json_starred'] as $article_file) { + if (!$this->importJson($article_file, true)) { + $ok = false; + if (FreshRSS_Context::$isCli) { + fwrite(STDERR, 'FreshRSS error during JSON stars import' . "\n"); + } else { + Minz_Log::warning('Error during JSON stars import'); + } + } + } + foreach ($list_files['json_feed'] as $article_file) { + if (!$this->importJson($article_file)) { + $ok = false; + if (FreshRSS_Context::$isCli) { + fwrite(STDERR, 'FreshRSS error during JSON feeds import' . "\n"); + } else { + Minz_Log::warning('Error during JSON feeds import'); + } + } + } + + return $ok; + } + + /** + * This action handles import action. + * + * It must be reached by a POST request. + * + * Parameter is: + * - file (default: nothing!) + * Available file types are: zip, json or xml. + */ + public function importAction() { + if (!Minz_Request::isPost()) { + Minz_Request::forward(array('c' => 'importExport', 'a' => 'index'), true); + } + + $file = $_FILES['file']; + $status_file = $file['error']; + + if ($status_file !== 0) { + Minz_Log::warning('File cannot be uploaded. Error code: ' . $status_file); + Minz_Request::bad(_t('feedback.import_export.file_cannot_be_uploaded'), + array('c' => 'importExport', 'a' => 'index')); + } + + @set_time_limit(300); + + $error = false; + try { + $error = !$this->importFile($file['name'], $file['tmp_name']); + } catch (FreshRSS_ZipMissing_Exception $zme) { + Minz_Request::bad(_t('feedback.import_export.no_zip_extension'), + array('c' => 'importExport', 'a' => 'index')); + } catch (FreshRSS_Zip_Exception $ze) { + Minz_Log::warning('ZIP archive cannot be imported. Error code: ' . $ze->zipErrorCode()); + Minz_Request::bad(_t('feedback.import_export.zip_error'), + array('c' => 'importExport', 'a' => 'index')); + } + + // And finally, we get import status and redirect to the home page + Minz_Session::_param('actualize_feeds', true); + $content_notif = $error === true ? _t('feedback.import_export.feeds_imported_with_errors') : + _t('feedback.import_export.feeds_imported'); + Minz_Request::good($content_notif); + } + + /** + * This method tries to guess the file type based on its name. + * + * Itis a *very* basic guess file type function. Only based on filename. + * That's could be improved but should be enough for what we have to do. + */ + private static function guessFileType($filename) { + if (substr_compare($filename, '.zip', -4) === 0) { + return 'zip'; + } elseif (substr_compare($filename, '.opml', -5) === 0 || + substr_compare($filename, '.xml', -4) === 0) { + return 'opml'; + } elseif (substr_compare($filename, '.json', -5) === 0 && + strpos($filename, 'starred') !== false) { + return 'json_starred'; + } elseif (substr_compare($filename, '.json', -5) === 0) { + return 'json_feed'; + } else { + return 'unknown'; + } + } + + /** + * This method parses and imports an OPML file. + * + * @param string $opml_file the OPML file content. + * @return boolean false if an error occured, true otherwise. + */ + private function importOpml($opml_file) { + $opml_array = array(); + try { + $opml_array = libopml_parse_string($opml_file, false); + } catch (LibOPML_Exception $e) { + if (FreshRSS_Context::$isCli) { + fwrite(STDERR, 'FreshRSS error during OPML parsing: ' . $e->getMessage() . "\n"); + } else { + Minz_Log::warning($e->getMessage()); + } + return false; + } + + $this->catDAO->checkDefault(); + + return $this->addOpmlElements($opml_array['body']); + } + + /** + * This method imports an OPML file based on its body. + * + * @param array $opml_elements an OPML element (body or outline). + * @param string $parent_cat the name of the parent category. + * @return boolean false if an error occured, true otherwise. + */ + private function addOpmlElements($opml_elements, $parent_cat = null) { + $ok = true; + + $nb_feeds = count($this->feedDAO->listFeeds()); + $nb_cats = count($this->catDAO->listCategories(false)); + $limits = FreshRSS_Context::$system_conf->limits; + + foreach ($opml_elements as $elt) { + if (isset($elt['xmlUrl'])) { + // If xmlUrl exists, it means it is a feed + if (FreshRSS_Context::$isCli && $nb_feeds >= $limits['max_feeds']) { + Minz_Log::warning(_t('feedback.sub.feed.over_max', + $limits['max_feeds'])); + $ok = false; + continue; + } + + if ($this->addFeedOpml($elt, $parent_cat)) { + $nb_feeds++; + } else { + $ok = false; + } + } else { + // No xmlUrl? It should be a category! + $limit_reached = ($nb_cats >= $limits['max_categories']); + if (!FreshRSS_Context::$isCli && $limit_reached) { + Minz_Log::warning(_t('feedback.sub.category.over_max', + $limits['max_categories'])); + $ok = false; + continue; + } + + if ($this->addCategoryOpml($elt, $parent_cat, $limit_reached)) { + $nb_cats++; + } else { + $ok = false; + } + } + } + + return $ok; + } + + /** + * This method imports an OPML feed element. + * + * @param array $feed_elt an OPML element (must be a feed element). + * @param string $parent_cat the name of the parent category. + * @return boolean false if an error occured, true otherwise. + */ + private function addFeedOpml($feed_elt, $parent_cat) { + if ($parent_cat == null) { + // This feed has no parent category so we get the default one + $this->catDAO->checkDefault(); + $default_cat = $this->catDAO->getDefault(); + $parent_cat = $default_cat->name(); + } + + $cat = $this->catDAO->searchByName($parent_cat); + if ($cat == null) { + // If there is not $cat, it means parent category does not exist in + // database. + // If it happens, take the default category. + $this->catDAO->checkDefault(); + $cat = $this->catDAO->getDefault(); + } + + // We get different useful information + $url = Minz_Helper::htmlspecialchars_utf8($feed_elt['xmlUrl']); + $name = Minz_Helper::htmlspecialchars_utf8($feed_elt['text']); + $website = ''; + if (isset($feed_elt['htmlUrl'])) { + $website = Minz_Helper::htmlspecialchars_utf8($feed_elt['htmlUrl']); + } + $description = ''; + if (isset($feed_elt['description'])) { + $description = Minz_Helper::htmlspecialchars_utf8($feed_elt['description']); + } + + $error = false; + try { + // Create a Feed object and add it in DB + $feed = new FreshRSS_Feed($url); + $feed->_category($cat->id()); + $feed->_name($name); + $feed->_website($website); + $feed->_description($description); + + // Call the extension hook + $feed = Minz_ExtensionManager::callHook('feed_before_insert', $feed); + if ($feed != null) { + // addFeedObject checks if feed is already in DB so nothing else to + // check here + $id = $this->feedDAO->addFeedObject($feed); + $error = ($id === false); + } else { + $error = true; + } + } catch (FreshRSS_Feed_Exception $e) { + if (FreshRSS_Context::$isCli) { + fwrite(STDERR, 'FreshRSS error during OPML feed import: ' . $e->getMessage() . "\n"); + } else { + Minz_Log::warning($e->getMessage()); + } + $error = true; + } + + if ($error) { + if (FreshRSS_Context::$isCli) { + fwrite(STDERR, 'FreshRSS error during OPML feed import from URL: ' . $url . ' in category ' . $cat->id() . "\n"); + } else { + Minz_Log::warning('Error during OPML feed import from URL: ' . $url . ' in category ' . $cat->id()); + } + } + + return !$error; + } + + /** + * This method imports an OPML category element. + * + * @param array $cat_elt an OPML element (must be a category element). + * @param string $parent_cat the name of the parent category. + * @param boolean $cat_limit_reached indicates if category limit has been reached. + * if yes, category is not added (but we try for feeds!) + * @return boolean false if an error occured, true otherwise. + */ + private function addCategoryOpml($cat_elt, $parent_cat, $cat_limit_reached) { + // Create a new Category object + $catName = Minz_Helper::htmlspecialchars_utf8($cat_elt['text']); + $cat = new FreshRSS_Category($catName); + + $error = true; + if (FreshRSS_Context::$isCli || !$cat_limit_reached) { + $id = $this->catDAO->addCategoryObject($cat); + $error = ($id === false); + } + if ($error) { + if (FreshRSS_Context::$isCli) { + fwrite(STDERR, 'FreshRSS error during OPML category import from URL: ' . $catName . "\n"); + } else { + Minz_Log::warning('Error during OPML category import from URL: ' . $catName); + } + } + + if (isset($cat_elt['@outlines'])) { + // Our cat_elt contains more categories or more feeds, so we + // add them recursively. + // Note: FreshRSS does not support yet category arborescence + $error &= !$this->addOpmlElements($cat_elt['@outlines'], $catName); + } + + return !$error; + } + + /** + * This method import a JSON-based file (Google Reader format). + * + * @param string $article_file the JSON file content. + * @param boolean $starred true if articles from the file must be starred. + * @return boolean false if an error occured, true otherwise. + */ + private function importJson($article_file, $starred = false) { + $article_object = json_decode($article_file, true); + if ($article_object == null) { + if (FreshRSS_Context::$isCli) { + fwrite(STDERR, 'FreshRSS error trying to import a non-JSON file' . "\n"); + } else { + Minz_Log::warning('Try to import a non-JSON file'); + } + return false; + } + + $is_read = FreshRSS_Context::$user_conf->mark_when['reception'] ? 1 : 0; + + $google_compliant = strpos($article_object['id'], 'com.google') !== false; + + $error = false; + $article_to_feed = array(); + + $nb_feeds = count($this->feedDAO->listFeeds()); + $limits = FreshRSS_Context::$system_conf->limits; + + // First, we check feeds of articles are in DB (and add them if needed). + foreach ($article_object['items'] as $item) { + $key = $google_compliant ? 'htmlUrl' : 'feedUrl'; + $feed = new FreshRSS_Feed($item['origin'][$key]); + $feed = $this->feedDAO->searchByUrl($feed->url()); + + if ($feed == null) { + // Feed does not exist in DB,we should to try to add it. + if ((!FreshRSS_Context::$isCli) && ($nb_feeds >= $limits['max_feeds'])) { + // Oops, no more place! + Minz_Log::warning(_t('feedback.sub.feed.over_max', $limits['max_feeds'])); + } else { + $feed = $this->addFeedJson($item['origin'], $google_compliant); + } + + if ($feed == null) { + // Still null? It means something went wrong. + $error = true; + } else { + $nb_feeds++; + } + } + + if ($feed != null) { + $article_to_feed[$item['id']] = $feed->id(); + } + } + + $newGuids = array(); + foreach ($article_object['items'] as $item) { + $newGuids[] = safe_ascii($item['id']); + } + // For this feed, check existing GUIDs already in database. + $existingHashForGuids = $this->entryDAO->listHashForFeedGuids($feed->id(), $newGuids); + unset($newGuids); + + // Then, articles are imported. + $this->entryDAO->beginTransaction(); + foreach ($article_object['items'] as $item) { + if (!isset($article_to_feed[$item['id']])) { + // Related feed does not exist for this entry, do nothing. + continue; + } + + $feed_id = $article_to_feed[$item['id']]; + $author = isset($item['author']) ? $item['author'] : ''; + $key_content = ($google_compliant && !isset($item['content'])) ? + 'summary' : 'content'; + $tags = $item['categories']; + if ($google_compliant) { + // Remove tags containing "/state/com.google" which are useless. + $tags = array_filter($tags, function($var) { + return strpos($var, '/state/com.google') !== false; + }); + } + + $entry = new FreshRSS_Entry( + $feed_id, $item['id'], $item['title'], $author, + $item[$key_content]['content'], $item['alternate'][0]['href'], + $item['published'], $is_read, $starred + ); + $entry->_id(min(time(), $entry->date(true)) . uSecString()); + $entry->_tags($tags); + + $entry = Minz_ExtensionManager::callHook('entry_before_insert', $entry); + if ($entry == null) { + // An extension has returned a null value, there is nothing to insert. + continue; + } + + $values = $entry->toArray(); + if (isset($existingHashForGuids[$entry->guid()])) { + $id = $this->entryDAO->updateEntry($values); + } else { + $id = $this->entryDAO->addEntry($values); + } + + if (!$error && ($id === false)) { + $error = true; + } + } + $this->entryDAO->commit(); + + return !$error; + } + + /** + * This method import a JSON-based feed (Google Reader format). + * + * @param array $origin represents a feed. + * @param boolean $google_compliant takes care of some specific values if true. + * @return FreshRSS_Feed if feed is in database at the end of the process, + * else null. + */ + private function addFeedJson($origin, $google_compliant) { + $return = null; + $key = $google_compliant ? 'htmlUrl' : 'feedUrl'; + $url = $origin[$key]; + $name = $origin['title']; + $website = $origin['htmlUrl']; + + try { + // Create a Feed object and add it in database. + $feed = new FreshRSS_Feed($url); + $feed->_category(FreshRSS_CategoryDAO::defaultCategoryId); + $feed->_name($name); + $feed->_website($website); + + // Call the extension hook + $feed = Minz_ExtensionManager::callHook('feed_before_insert', $feed); + if ($feed != null) { + // addFeedObject checks if feed is already in DB so nothing else to + // check here. + $id = $this->feedDAO->addFeedObject($feed); + + if ($id !== false) { + $feed->_id($id); + $return = $feed; + } + } + } catch (FreshRSS_Feed_Exception $e) { + if (FreshRSS_Context::$isCli) { + fwrite(STDERR, 'FreshRSS error during JSON feed import: ' . $e->getMessage() . "\n"); + } else { + Minz_Log::warning($e->getMessage()); + } + } + + return $return; + } + + public function exportFile($export_opml = true, $export_starred = false, $export_feeds = array(), $maxFeedEntries = 50, $username = null) { + require_once(LIB_PATH . '/lib_opml.php'); + + $this->catDAO = new FreshRSS_CategoryDAO($username); + $this->entryDAO = FreshRSS_Factory::createEntryDao($username); + $this->feedDAO = FreshRSS_Factory::createFeedDao($username); + + $this->entryDAO->disableBuffering(); + + if ($export_feeds === true) { + //All feeds + $export_feeds = $this->feedDAO->listFeedsIds(); + } + if (!is_array($export_feeds)) { + $export_feeds = array(); + } + + $day = date('Y-m-d'); + + $export_files = array(); + if ($export_opml) { + $export_files["feeds_${day}.opml.xml"] = $this->generateOpml(); + } + + if ($export_starred) { + $export_files["starred_${day}.json"] = $this->generateEntries('starred'); + } + + foreach ($export_feeds as $feed_id) { + $feed = $this->feedDAO->searchById($feed_id); + if ($feed) { + $filename = "feed_${day}_" . $feed->category() . '_' + . $feed->id() . '.json'; + $export_files[$filename] = $this->generateEntries('feed', $feed, $maxFeedEntries); + } + } + + $nb_files = count($export_files); + if ($nb_files > 1) { + // If there are more than 1 file to export, we need a ZIP archive. + try { + $this->sendZip($export_files); + } catch (Exception $e) { + throw new FreshRSS_ZipMissing_Exception($e); + } + } elseif ($nb_files === 1) { + // Only one file? Guess its type and export it. + $filename = key($export_files); + $type = self::guessFileType($filename); + $this->sendFile('freshrss_' . $filename, $export_files[$filename], $type); + } + return $nb_files; + } + + /** + * This action handles export action. + * + * This action must be reached by a POST request. + * + * Parameters are: + * - export_opml (default: false) + * - export_starred (default: false) + * - export_feeds (default: array()) a list of feed ids + */ + public function exportAction() { + if (!Minz_Request::isPost()) { + Minz_Request::forward(array('c' => 'importExport', 'a' => 'index'), true); + } + $this->view->_useLayout(false); + + $nb_files = 0; + try { + $nb_files = $this->exportFile( + Minz_Request::param('export_opml', false), + Minz_Request::param('export_starred', false), + Minz_Request::param('export_feeds', array()) + ); + } catch (FreshRSS_ZipMissing_Exception $zme) { + # Oops, there is no ZIP extension! + Minz_Request::bad(_t('feedback.import_export.export_no_zip_extension'), + array('c' => 'importExport', 'a' => 'index')); + } + + if ($nb_files < 1) { + // Nothing to do... + Minz_Request::forward(array('c' => 'importExport', 'a' => 'index'), true); + } + } + + /** + * This method returns the OPML file based on user subscriptions. + * + * @return string the OPML file content. + */ + private function generateOpml() { + $list = array(); + foreach ($this->catDAO->listCategories() as $key => $cat) { + $list[$key]['name'] = $cat->name(); + $list[$key]['feeds'] = $this->feedDAO->listByCategory($cat->id()); + } + + $this->view->categories = $list; + return $this->view->helperToString('export/opml'); + } + + /** + * This method returns a JSON file content. + * + * @param string $type must be "starred" or "feed" + * @param FreshRSS_Feed $feed feed of which we want to get entries. + * @return string the JSON file content. + */ + private function generateEntries($type, $feed = NULL, $maxFeedEntries = 50) { + $this->view->categories = $this->catDAO->listCategories(); + + if ($type == 'starred') { + $this->view->list_title = _t('sub.import_export.starred_list'); + $this->view->type = 'starred'; + $unread_fav = $this->entryDAO->countUnreadReadFavorites(); + $this->view->entriesRaw = $this->entryDAO->listWhereRaw( + 's', '', FreshRSS_Entry::STATE_ALL, 'ASC', $unread_fav['all'] + ); + } elseif ($type === 'feed' && $feed != null) { + $this->view->list_title = _t('sub.import_export.feed_list', $feed->name()); + $this->view->type = 'feed/' . $feed->id(); + $this->view->entriesRaw = $this->entryDAO->listWhereRaw( + 'f', $feed->id(), FreshRSS_Entry::STATE_ALL, 'ASC', + $maxFeedEntries + ); + $this->view->feed = $feed; + } + + return $this->view->helperToString('export/articles'); + } + + /** + * This method zips a list of files and returns it by HTTP. + * + * @param array $files list of files where key is filename and value the content. + * @throws Exception if Zip extension is not loaded. + */ + private function sendZip($files) { + if (!extension_loaded('zip')) { + throw new Exception(); + } + + // From https://stackoverflow.com/questions/1061710/php-zip-files-on-the-fly + $zip_file = tempnam('tmp', 'zip'); + $zip = new ZipArchive(); + $zip->open($zip_file, ZipArchive::OVERWRITE); + + foreach ($files as $filename => $content) { + $zip->addFromString($filename, $content); + } + + // Close and send to user + $zip->close(); + header('Content-Type: application/zip'); + header('Content-Length: ' . filesize($zip_file)); + $day = date('Y-m-d'); + header('Content-Disposition: attachment; filename="freshrss_' . $day . '_export.zip"'); + readfile($zip_file); + unlink($zip_file); + } + + /** + * This method returns a single file (OPML or JSON) by HTTP. + * + * @param string $filename + * @param string $content + * @param string $type the file type (opml, json_feed or json_starred). + * If equals to unknown, nothing happens. + */ + private function sendFile($filename, $content, $type) { + if ($type === 'unknown') { + return; + } + + $content_type = ''; + if ($type === 'opml') { + $content_type = 'application/xml'; + } elseif ($type === 'json_feed' || $type === 'json_starred') { + $content_type = 'application/json'; + } + + header('Content-Type: ' . $content_type . '; charset=utf-8'); + header('Content-disposition: attachment; filename=' . $filename); + print($content); + } +} diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php index 38f4c0e7c..5ca147ff3 100755 --- a/app/Controllers/indexController.php +++ b/app/Controllers/indexController.php @@ -1,371 +1,272 @@ <?php +/** + * This class handles main actions of FreshRSS. + */ class FreshRSS_index_Controller extends Minz_ActionController { - private $nb_not_read_cat = 0; - - public function indexAction () { - $output = Minz_Request::param ('output'); - $token = $this->view->conf->token; - - // check if user is logged in - if (!$this->view->loginOk && !Minz_Configuration::allowAnonymous()) { - $token_param = Minz_Request::param ('token', ''); - $token_is_ok = ($token != '' && $token === $token_param); - if ($output === 'rss' && !$token_is_ok) { - Minz_Error::error ( - 403, - array ('error' => array (Minz_Translate::t ('access_denied'))) - ); - return; - } elseif ($output !== 'rss') { - // "hard" redirection is not required, just ask dispatcher to - // forward to the login form without 302 redirection - Minz_Request::forward(array('c' => 'index', 'a' => 'formLogin')); - return; - } - } - // construction of RSS url of this feed - $params = Minz_Request::params (); - $params['output'] = 'rss'; - if (isset ($params['search'])) { - $params['search'] = urlencode ($params['search']); - } - if (!Minz_Configuration::allowAnonymous()) { - $params['token'] = $token; - } - $this->view->rss_url = array ( + /** + * This action only redirect on the default view mode (normal or global) + */ + public function indexAction() { + $prefered_output = FreshRSS_Context::$user_conf->view_mode; + Minz_Request::forward(array( 'c' => 'index', - 'a' => 'index', - 'params' => $params - ); - - if ($output === 'rss') { - // no layout for RSS output - $this->view->_useLayout (false); - header('Content-Type: application/rss+xml; charset=utf-8'); - } elseif ($output === 'global') { - Minz_View::appendScript (Minz_Url::display ('/scripts/global_view.js?' . @filemtime(PUBLIC_PATH . '/scripts/global_view.js'))); - } + 'a' => $prefered_output + )); + } - $catDAO = new FreshRSS_CategoryDAO(); - $entryDAO = new FreshRSS_EntryDAO(); - - $this->view->cat_aside = $catDAO->listCategories (); - $this->view->nb_favorites = $entryDAO->countUnreadReadFavorites (); - $this->view->nb_not_read = FreshRSS_CategoryDAO::CountUnreads($this->view->cat_aside, 1); - $this->view->currentName = ''; - - $this->view->get_c = ''; - $this->view->get_f = ''; - - $get = Minz_Request::param ('get', 'a'); - $getType = $get[0]; - $getId = substr ($get, 2); - if (!$this->checkAndProcessType ($getType, $getId)) { - Minz_Log::record ('Not found [' . $getType . '][' . $getId . ']', Minz_Log::DEBUG); - Minz_Error::error ( - 404, - array ('error' => array (Minz_Translate::t ('page_not_found'))) - ); + /** + * This action displays the normal view of FreshRSS. + */ + public function normalAction() { + $allow_anonymous = FreshRSS_Context::$system_conf->allow_anonymous; + if (!FreshRSS_Auth::hasAccess() && !$allow_anonymous) { + Minz_Request::forward(array('c' => 'auth', 'a' => 'login')); return; } - // mise à jour des titres - $this->view->rss_title = $this->view->currentName . ' | ' . Minz_View::title(); - if ($this->view->nb_not_read > 0) { - Minz_View::appendTitle (' (' . formatNumber($this->view->nb_not_read) . ')'); + try { + $this->updateContext(); + } catch (FreshRSS_Context_Exception $e) { + Minz_Error::error(404); } - Minz_View::prependTitle ( - $this->view->currentName . - ($this->nb_not_read_cat > 0 ? ' (' . formatNumber($this->nb_not_read_cat) . ')' : '') . - ' · ' - ); - // On récupère les différents éléments de filtrage - $this->view->state = $state = Minz_Request::param ('state', $this->view->conf->default_view); - $filter = Minz_Request::param ('search', ''); - if (!empty($filter)) { - $state = 'all'; //Search always in read and unread articles - } - $this->view->order = $order = Minz_Request::param ('order', $this->view->conf->sort_order); - $nb = Minz_Request::param ('nb', $this->view->conf->posts_per_page); - $first = Minz_Request::param ('next', ''); - - if ($state === 'not_read') { //Any unread article in this category at all? - switch ($getType) { - case 'a': - $hasUnread = $this->view->nb_not_read > 0; - break; - case 's': - $hasUnread = $this->view->nb_favorites['unread'] > 0; - break; - case 'c': - $hasUnread = (!isset($this->view->cat_aside[$getId])) || ($this->view->cat_aside[$getId]->nbNotRead() > 0); - break; - case 'f': - $myFeed = FreshRSS_CategoryDAO::findFeed($this->view->cat_aside, $getId); - $hasUnread = ($myFeed === null) || ($myFeed->nbNotRead() > 0); - break; - default: - $hasUnread = true; - break; + $this->view->callbackBeforeContent = function($view) { + try { + FreshRSS_Context::$number++; //+1 for pagination + $entries = FreshRSS_index_Controller::listEntriesByContext(); + FreshRSS_Context::$number--; + + $nb_entries = count($entries); + if ($nb_entries > FreshRSS_Context::$number) { + // We have more elements for pagination + $last_entry = array_pop($entries); + FreshRSS_Context::$next_id = $last_entry->id(); + } + + $first_entry = $nb_entries > 0 ? $entries[0] : null; + FreshRSS_Context::$id_max = $first_entry === null ? + (time() - 1) . '000000' : + $first_entry->id(); + if (FreshRSS_Context::$order === 'ASC') { + // In this case we do not know but we guess id_max + $id_max = (time() - 1) . '000000'; + if (strcmp($id_max, FreshRSS_Context::$id_max) > 0) { + FreshRSS_Context::$id_max = $id_max; + } + } + + $view->entries = $entries; + } catch (FreshRSS_EntriesGetter_Exception $e) { + Minz_Log::notice($e->getMessage()); + Minz_Error::error(404); } - if (!$hasUnread) { - $this->view->state = $state = 'all'; + + $view->categories = FreshRSS_Context::$categories; + + $view->rss_title = FreshRSS_Context::$name . ' | ' . Minz_View::title(); + $title = FreshRSS_Context::$name; + if (FreshRSS_Context::$get_unread > 0) { + $title = '(' . FreshRSS_Context::$get_unread . ') ' . $title; } - } + Minz_View::prependTitle($title . ' · '); + }; + } - $today = @strtotime('today'); - $this->view->today = $today; + /** + * This action displays the reader view of FreshRSS. + * + * @todo: change this view into specific CSS rules? + */ + public function readerAction() { + $this->normalAction(); + } + + /** + * This action displays the global view of FreshRSS. + */ + public function globalAction() { + $allow_anonymous = FreshRSS_Context::$system_conf->allow_anonymous; + if (!FreshRSS_Auth::hasAccess() && !$allow_anonymous) { + Minz_Request::forward(array('c' => 'auth', 'a' => 'login')); + return; + } - // on calcule la date des articles les plus anciens qu'on affiche - $nb_month_old = $this->view->conf->old_entries; - $date_min = $today - (3600 * 24 * 30 * $nb_month_old); //Do not use a fast changing value such as time() to allow SQL caching - $keepHistoryDefault = $this->view->conf->keep_history_default; + Minz_View::appendScript(Minz_Url::display('/scripts/global_view.js?' . @filemtime(PUBLIC_PATH . '/scripts/global_view.js'))); try { - $entries = $entryDAO->listWhere($getType, $getId, $state, $order, $nb + 1, $first, $filter, $date_min, $keepHistoryDefault); - - // Si on a récupéré aucun article "non lus" - // on essaye de récupérer tous les articles - if ($state === 'not_read' && empty($entries)) { - Minz_Log::record ('Conflicting information about nbNotRead!', Minz_Log::DEBUG); - $this->view->state = 'all'; - $entries = $entryDAO->listWhere($getType, $getId, 'all', $order, $nb, $first, $filter, $date_min, $keepHistoryDefault); - } + $this->updateContext(); + } catch (FreshRSS_Context_Exception $e) { + Minz_Error::error(404); + } - if (count($entries) <= $nb) { - $this->view->nextId = ''; - } else { //We have more elements for pagination - $lastEntry = array_pop($entries); - $this->view->nextId = $lastEntry->id(); - } + $this->view->categories = FreshRSS_Context::$categories; - $this->view->entries = $entries; - } catch (FreshRSS_EntriesGetter_Exception $e) { - Minz_Log::record ($e->getMessage (), Minz_Log::NOTICE); - Minz_Error::error ( - 404, - array ('error' => array (Minz_Translate::t ('page_not_found'))) - ); + $this->view->rss_title = FreshRSS_Context::$name . ' | ' . Minz_View::title(); + $title = _t('index.feed.title_global'); + if (FreshRSS_Context::$get_unread > 0) { + $title = '(' . FreshRSS_Context::$get_unread . ') ' . $title; } + Minz_View::prependTitle($title . ' · '); } - /* - * Vérifie que la catégorie / flux sélectionné existe - * + Initialise correctement les variables de vue get_c et get_f - * + Met à jour la variable $this->nb_not_read_cat + /** + * This action displays the RSS feed of FreshRSS. */ - private function checkAndProcessType ($getType, $getId) { - switch ($getType) { - case 'a': - $this->view->currentName = Minz_Translate::t ('your_rss_feeds'); - $this->nb_not_read_cat = $this->view->nb_not_read; - $this->view->get_c = $getType; - return true; - case 's': - $this->view->currentName = Minz_Translate::t ('your_favorites'); - $this->nb_not_read_cat = $this->view->nb_favorites['unread']; - $this->view->get_c = $getType; - return true; - case 'c': - $cat = isset($this->view->cat_aside[$getId]) ? $this->view->cat_aside[$getId] : null; - if ($cat === null) { - $catDAO = new FreshRSS_CategoryDAO(); - $cat = $catDAO->searchById($getId); - } - if ($cat) { - $this->view->currentName = $cat->name (); - $this->nb_not_read_cat = $cat->nbNotRead (); - $this->view->get_c = $getId; - return true; - } else { - return false; - } - case 'f': - $feed = FreshRSS_CategoryDAO::findFeed($this->view->cat_aside, $getId); - if (empty($feed)) { - $feedDAO = new FreshRSS_FeedDAO(); - $feed = $feedDAO->searchById($getId); - } - if ($feed) { - $this->view->currentName = $feed->name (); - $this->nb_not_read_cat = $feed->nbNotRead (); - $this->view->get_f = $getId; - $this->view->get_c = $feed->category (); - return true; - } else { - return false; - } - default: - return false; + public function rssAction() { + $allow_anonymous = FreshRSS_Context::$system_conf->allow_anonymous; + $token = FreshRSS_Context::$user_conf->token; + $token_param = Minz_Request::param('token', ''); + $token_is_ok = ($token != '' && $token === $token_param); + + // Check if user has access. + if (!FreshRSS_Auth::hasAccess() && + !$allow_anonymous && + !$token_is_ok) { + Minz_Error::error(403); } - } - - public function statsAction () { - if (!$this->view->loginOk) { - Minz_Error::error ( - 403, - array ('error' => array (Minz_Translate::t ('access_denied'))) - ); + + try { + $this->updateContext(); + } catch (FreshRSS_Context_Exception $e) { + Minz_Error::error(404); } - Minz_View::prependTitle (Minz_Translate::t ('stats') . ' · '); + try { + $this->view->entries = FreshRSS_index_Controller::listEntriesByContext(); + } catch (FreshRSS_EntriesGetter_Exception $e) { + Minz_Log::notice($e->getMessage()); + Minz_Error::error(404); + } - $statsDAO = new FreshRSS_StatsDAO (); - Minz_View::appendScript (Minz_Url::display ('/scripts/flotr2.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/flotr2.min.js'))); - $this->view->repartition = $statsDAO->calculateEntryRepartition(); - $this->view->count = ($statsDAO->calculateEntryCount()); - $this->view->feedByCategory = $statsDAO->calculateFeedByCategory(); - $this->view->entryByCategory = $statsDAO->calculateEntryByCategory(); - $this->view->topFeed = $statsDAO->calculateTopFeed(); + // No layout for RSS output. + $this->view->url = empty($_SERVER['QUERY_STRING']) ? '' : '?' . $_SERVER['QUERY_STRING']; + $this->view->rss_title = FreshRSS_Context::$name . ' | ' . Minz_View::title(); + $this->view->_useLayout(false); + header('Content-Type: application/rss+xml; charset=utf-8'); } - public function aboutAction () { - Minz_View::prependTitle (Minz_Translate::t ('about') . ' · '); - } + /** + * This action updates the Context object by using request parameters. + * + * Parameters are: + * - state (default: conf->default_view) + * - search (default: empty string) + * - order (default: conf->sort_order) + * - nb (default: conf->posts_per_page) + * - next (default: empty string) + * - hours (default: 0) + */ + private function updateContext() { + if (empty(FreshRSS_Context::$categories)) { + $catDAO = new FreshRSS_CategoryDAO(); + FreshRSS_Context::$categories = $catDAO->listCategories(); + } - public function logsAction () { - if (!$this->view->loginOk) { - Minz_Error::error ( - 403, - array ('error' => array (Minz_Translate::t ('access_denied'))) - ); + // Update number of read / unread variables. + $entryDAO = FreshRSS_Factory::createEntryDao(); + FreshRSS_Context::$total_starred = $entryDAO->countUnreadReadFavorites(); + FreshRSS_Context::$total_unread = FreshRSS_CategoryDAO::CountUnreads( + FreshRSS_Context::$categories, 1 + ); + + FreshRSS_Context::_get(Minz_Request::param('get', 'a')); + + FreshRSS_Context::$state = Minz_Request::param( + 'state', FreshRSS_Context::$user_conf->default_state + ); + $state_forced_by_user = Minz_Request::param('state', false) !== false; + if (FreshRSS_Context::$user_conf->default_view === 'adaptive' && + FreshRSS_Context::$get_unread <= 0 && + !FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_READ) && + !$state_forced_by_user) { + FreshRSS_Context::$state |= FreshRSS_Entry::STATE_READ; } - Minz_View::prependTitle (Minz_Translate::t ('logs') . ' · '); + FreshRSS_Context::$search = new FreshRSS_Search(Minz_Request::param('search', '')); + FreshRSS_Context::$order = Minz_Request::param( + 'order', FreshRSS_Context::$user_conf->sort_order + ); + FreshRSS_Context::$number = intval(Minz_Request::param('nb', FreshRSS_Context::$user_conf->posts_per_page)); + if (FreshRSS_Context::$number > FreshRSS_Context::$user_conf->max_posts_per_rss) { + FreshRSS_Context::$number = max( + FreshRSS_Context::$user_conf->max_posts_per_rss, + FreshRSS_Context::$user_conf->posts_per_page); + } + FreshRSS_Context::$first_id = Minz_Request::param('next', ''); + FreshRSS_Context::$sinceHours = intval(Minz_Request::param('hours', 0)); + } - if (Minz_Request::isPost ()) { - FreshRSS_LogDAO::truncate(); + /** + * This method returns a list of entries based on the Context object. + */ + public static function listEntriesByContext() { + $entryDAO = FreshRSS_Factory::createEntryDao(); + + $get = FreshRSS_Context::currentGet(true); + if (count($get) > 1) { + $type = $get[0]; + $id = $get[1]; + } else { + $type = $get; + $id = ''; } - $logs = FreshRSS_LogDAO::lines(); //TODO: ask only the necessary lines + $limit = FreshRSS_Context::$number; - //gestion pagination - $page = Minz_Request::param ('page', 1); - $this->view->logsPaginator = new Minz_Paginator ($logs); - $this->view->logsPaginator->_nbItemsPerPage (50); - $this->view->logsPaginator->_currentPage ($page); - } + $date_min = 0; + if (FreshRSS_Context::$sinceHours) { + $date_min = time() - (FreshRSS_Context::$sinceHours * 3600); + $limit = FreshRSS_Context::$user_conf->max_posts_per_rss; + } - public function loginAction () { - $this->view->_useLayout (false); - - $url = 'https://verifier.login.persona.org/verify'; - $assert = Minz_Request::param ('assertion'); - $params = 'assertion=' . $assert . '&audience=' . - urlencode (Minz_Url::display (null, 'php', true)); - $ch = curl_init (); - $options = array ( - CURLOPT_URL => $url, - CURLOPT_RETURNTRANSFER => TRUE, - CURLOPT_POST => 2, - CURLOPT_POSTFIELDS => $params + $entries = $entryDAO->listWhere( + $type, $id, FreshRSS_Context::$state, FreshRSS_Context::$order, + $limit, FreshRSS_Context::$first_id, + FreshRSS_Context::$search, $date_min ); - curl_setopt_array ($ch, $options); - $result = curl_exec ($ch); - curl_close ($ch); - - $res = json_decode ($result, true); - - $loginOk = false; - $reason = ''; - if ($res['status'] === 'okay') { - $email = filter_var($res['email'], FILTER_VALIDATE_EMAIL); - if ($email != '') { - $personaFile = DATA_PATH . '/persona/' . $email . '.txt'; - if (($currentUser = @file_get_contents($personaFile)) !== false) { - $currentUser = trim($currentUser); - if (ctype_alnum($currentUser)) { - try { - $this->conf = new FreshRSS_Configuration($currentUser); - $loginOk = strcasecmp($email, $this->conf->mail_login) === 0; - } catch (Minz_Exception $e) { - $reason = 'Invalid configuration for user [' . $currentUser . ']! ' . $e->getMessage(); //Permission denied or conf file does not exist - } - } else { - $reason = 'Invalid username format [' . $currentUser . ']!'; - } - } - } else { - $reason = 'Invalid email format [' . $res['email'] . ']!'; - } - } - if ($loginOk) { - Minz_Session::_param('currentUser', $currentUser); - Minz_Session::_param ('mail', $email); - $this->view->loginOk = true; - invalidateHttpCache(); - } else { - $res = array (); - $res['status'] = 'failure'; - $res['reason'] = $reason == '' ? Minz_Translate::t ('invalid_login') : $reason; - Minz_Log::record ('Persona: ' . $res['reason'], Minz_Log::WARNING); + + if (FreshRSS_Context::$sinceHours && (count($entries) < FreshRSS_Context::$user_conf->min_posts_per_rss)) { + $date_min = 0; + $limit = FreshRSS_Context::$user_conf->min_posts_per_rss; + $entries = $entryDAO->listWhere( + $type, $id, FreshRSS_Context::$state, FreshRSS_Context::$order, + $limit, FreshRSS_Context::$first_id, + FreshRSS_Context::$search, $date_min + ); } - header('Content-Type: application/json; charset=UTF-8'); - $this->view->res = json_encode ($res); + return $entries; } - public function logoutAction () { - $this->view->_useLayout(false); - invalidateHttpCache(); - Minz_Session::_param('currentUser'); - Minz_Session::_param('mail'); - Minz_Session::_param('passwordHash'); + /** + * This action displays the about page of FreshRSS. + */ + public function aboutAction() { + Minz_View::prependTitle(_t('index.about.title') . ' · '); } - public function formLoginAction () { + /** + * This action displays logs of FreshRSS for the current user. + */ + public function logsAction() { + if (!FreshRSS_Auth::hasAccess()) { + Minz_Error::error(403); + } + + Minz_View::prependTitle(_t('index.log.title') . ' · '); + if (Minz_Request::isPost()) { - $ok = false; - $nonce = Minz_Session::param('nonce'); - $username = Minz_Request::param('username', ''); - $c = Minz_Request::param('challenge', ''); - if (ctype_alnum($username) && ctype_graph($c) && ctype_alnum($nonce)) { - if (!function_exists('password_verify')) { - include_once(LIB_PATH . '/password_compat.php'); - } - try { - $conf = new FreshRSS_Configuration($username); - $s = $conf->passwordHash; - $ok = password_verify($nonce . $s, $c); - if ($ok) { - Minz_Session::_param('currentUser', $username); - Minz_Session::_param('passwordHash', $s); - } else { - Minz_Log::record('Password mismatch for user ' . $username . ', nonce=' . $nonce . ', c=' . $c, Minz_Log::WARNING); - } - } catch (Minz_Exception $me) { - Minz_Log::record('Login failure: ' . $me->getMessage(), Minz_Log::WARNING); - } - } else { - Minz_Log::record('Invalid credential parameters: user=' . $username . ' challenge=' . $c . ' nonce=' . $nonce, Minz_Log::DEBUG); - } - if (!$ok) { - $notif = array( - 'type' => 'bad', - 'content' => Minz_Translate::t('invalid_login') - ); - Minz_Session::_param('notification', $notif); - } - $this->view->_useLayout(false); - Minz_Request::forward(array('c' => 'index', 'a' => 'index'), true); - } elseif (!Minz_Configuration::canLogIn()) { - Minz_Error::error ( - 403, - array ('error' => array (Minz_Translate::t ('access_denied'))) - ); + FreshRSS_LogDAO::truncate(); } - invalidateHttpCache(); - } - public function formLogoutAction () { - $this->view->_useLayout(false); - invalidateHttpCache(); - Minz_Session::_param('currentUser'); - Minz_Session::_param('mail'); - Minz_Session::_param('passwordHash'); - Minz_Request::forward(array('c' => 'index', 'a' => 'index'), true); + $logs = FreshRSS_LogDAO::lines(); //TODO: ask only the necessary lines + + //gestion pagination + $page = Minz_Request::param('page', 1); + $this->view->logsPaginator = new Minz_Paginator($logs); + $this->view->logsPaginator->_nbItemsPerPage(50); + $this->view->logsPaginator->_currentPage($page); } } diff --git a/app/Controllers/javascriptController.php b/app/Controllers/javascriptController.php index 3d741e298..00a7b5c38 100755 --- a/app/Controllers/javascriptController.php +++ b/app/Controllers/javascriptController.php @@ -1,14 +1,14 @@ <?php class FreshRSS_javascript_Controller extends Minz_ActionController { - public function firstAction () { - $this->view->_useLayout (false); + public function firstAction() { + $this->view->_useLayout(false); } - public function actualizeAction () { - header('Content-Type: text/javascript; charset=UTF-8'); - $feedDAO = new FreshRSS_FeedDAO (); - $this->view->feeds = $feedDAO->listFeedsOrderUpdate(); + public function actualizeAction() { + header('Content-Type: application/json; charset=UTF-8'); + $feedDAO = FreshRSS_Factory::createFeedDao(); + $this->view->feeds = $feedDAO->listFeedsOrderUpdate(FreshRSS_Context::$user_conf->ttl_default); } public function nbUnreadsPerFeedAction() { @@ -28,19 +28,27 @@ class FreshRSS_javascript_Controller extends Minz_ActionController { $user = isset($_GET['user']) ? $_GET['user'] : ''; if (ctype_alnum($user)) { try { - $conf = new FreshRSS_Configuration($user); + $salt = FreshRSS_Context::$system_conf->salt; + $conf = get_user_configuration($user); $s = $conf->passwordHash; if (strlen($s) >= 60) { $this->view->salt1 = substr($s, 0, 29); //CRYPT_BLOWFISH Salt: "$2a$", a two digit cost parameter, "$", and 22 characters from the alphabet "./0-9A-Za-z". - $this->view->nonce = sha1(Minz_Configuration::salt() . uniqid(mt_rand(), true)); + $this->view->nonce = sha1($salt . uniqid(mt_rand(), true)); Minz_Session::_param('nonce', $this->view->nonce); return; //Success } } catch (Minz_Exception $me) { - Minz_Log::record('Nonce failure: ' . $me->getMessage(), Minz_Log::WARNING); + Minz_Log::warning('Nonce failure: ' . $me->getMessage()); } + } else { + Minz_Log::notice('Nonce failure due to invalid username!'); + } + //Failure: Return random data. + $this->view->salt1 = sprintf('$2a$%02d$', FreshRSS_user_Controller::BCRYPT_COST); + $alphabet = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + for ($i = 22; $i > 0; $i--) { + $this->view->salt1 .= $alphabet[rand(0, 63)]; } - $this->view->nonce = ''; //Failure - $this->view->salt1 = ''; + $this->view->nonce = sha1(rand()); } } diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.php new file mode 100644 index 000000000..5d1dee72c --- /dev/null +++ b/app/Controllers/statsController.php @@ -0,0 +1,150 @@ +<?php + +/** + * Controller to handle application statistics. + */ +class FreshRSS_stats_Controller extends Minz_ActionController { + + /** + * This action is called before every other action in that class. It is + * the common boiler plate for every action. It is triggered by the + * underlying framework. + */ + public function firstAction() { + if (!FreshRSS_Auth::hasAccess()) { + Minz_Error::error(403); + } + + Minz_View::prependTitle(_t('admin.stats.title') . ' · '); + } + + private function convertToSerie($data) { + $serie = array(); + + foreach ($data as $key => $value) { + $serie[] = array($key, $value); + } + + return $serie; + } + + private function convertToPieSerie($data) { + $serie = array(); + + foreach ($data as $value) { + $value['data'] = array(array(0, (int) $value['data'])); + $serie[] = $value; + } + + return $serie; + } + + /** + * This action handles the statistic main page. + * + * It displays the statistic main page. + * The values computed to display the page are: + * - repartition of read/unread/favorite/not favorite + * - number of article per day + * - number of feed by category + * - number of article by category + * - list of most prolific feed + */ + public function indexAction() { + $statsDAO = FreshRSS_Factory::createStatsDAO(); + Minz_View::appendScript(Minz_Url::display('/scripts/flotr2.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/flotr2.min.js'))); + $this->view->repartition = $statsDAO->calculateEntryRepartition(); + $entryCount = $statsDAO->calculateEntryCount(); + $this->view->count = $this->convertToSerie($entryCount); + $this->view->average = round(array_sum(array_values($entryCount)) / count($entryCount), 2); + $this->view->feedByCategory = $this->convertToPieSerie($statsDAO->calculateFeedByCategory()); + $this->view->entryByCategory = $this->convertToPieSerie($statsDAO->calculateEntryByCategory()); + $this->view->topFeed = $statsDAO->calculateTopFeed(); + } + + /** + * This action handles the idle feed statistic page. + * + * It displays the list of idle feed for different period. The supported + * periods are: + * - last year + * - last 6 months + * - last 3 months + * - last month + * - last week + */ + public function idleAction() { + $statsDAO = FreshRSS_Factory::createStatsDAO(); + $feeds = $statsDAO->calculateFeedLastDate(); + $idleFeeds = array( + 'last_year' => array(), + 'last_6_month' => array(), + 'last_3_month' => array(), + 'last_month' => array(), + 'last_week' => array(), + ); + $now = new \DateTime(); + $feedDate = clone $now; + $lastWeek = clone $now; + $lastWeek->modify('-1 week'); + $lastMonth = clone $now; + $lastMonth->modify('-1 month'); + $last3Month = clone $now; + $last3Month->modify('-3 month'); + $last6Month = clone $now; + $last6Month->modify('-6 month'); + $lastYear = clone $now; + $lastYear->modify('-1 year'); + + foreach ($feeds as $feed) { + $feedDate->setTimestamp($feed['last_date']); + if ($feedDate >= $lastWeek) { + continue; + } + if ($feedDate < $lastYear) { + $idleFeeds['last_year'][] = $feed; + } elseif ($feedDate < $last6Month) { + $idleFeeds['last_6_month'][] = $feed; + } elseif ($feedDate < $last3Month) { + $idleFeeds['last_3_month'][] = $feed; + } elseif ($feedDate < $lastMonth) { + $idleFeeds['last_month'][] = $feed; + } elseif ($feedDate < $lastWeek) { + $idleFeeds['last_week'][] = $feed; + } + } + + $this->view->idleFeeds = $idleFeeds; + } + + /** + * This action handles the article repartition statistic page. + * + * It displays the number of article and the average of article for the + * following periods: + * - hour of the day + * - day of the week + * - month + * + * @todo verify that the metrics used here make some sense. Especially + * for the average. + */ + public function repartitionAction() { + $statsDAO = FreshRSS_Factory::createStatsDAO(); + $categoryDAO = new FreshRSS_CategoryDAO(); + $feedDAO = FreshRSS_Factory::createFeedDao(); + Minz_View::appendScript(Minz_Url::display('/scripts/flotr2.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/flotr2.min.js'))); + $id = Minz_Request::param('id', null); + $this->view->categories = $categoryDAO->listCategories(); + $this->view->feed = $feedDAO->searchById($id); + $this->view->days = $statsDAO->getDays(); + $this->view->months = $statsDAO->getMonths(); + $this->view->repartition = $statsDAO->calculateEntryRepartitionPerFeed($id); + $this->view->repartitionHour = $this->convertToSerie($statsDAO->calculateEntryRepartitionPerFeedPerHour($id)); + $this->view->averageHour = $statsDAO->calculateEntryAveragePerFeedPerHour($id); + $this->view->repartitionDayOfWeek = $this->convertToSerie($statsDAO->calculateEntryRepartitionPerFeedPerDayOfWeek($id)); + $this->view->averageDayOfWeek = $statsDAO->calculateEntryAveragePerFeedPerDayOfWeek($id); + $this->view->repartitionMonth = $this->convertToSerie($statsDAO->calculateEntryRepartitionPerFeedPerMonth($id)); + $this->view->averageMonth = $statsDAO->calculateEntryAveragePerFeedPerMonth($id); + } +} diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php new file mode 100644 index 000000000..03d3ee15e --- /dev/null +++ b/app/Controllers/subscriptionController.php @@ -0,0 +1,116 @@ +<?php + +/** + * Controller to handle subscription actions. + */ +class FreshRSS_subscription_Controller extends Minz_ActionController { + /** + * This action is called before every other action in that class. It is + * the common boiler plate for every action. It is triggered by the + * underlying framework. + */ + public function firstAction() { + if (!FreshRSS_Auth::hasAccess()) { + Minz_Error::error(403); + } + + $catDAO = new FreshRSS_CategoryDAO(); + + $catDAO->checkDefault(); + $this->view->categories = $catDAO->listCategories(false); + $this->view->default_category = $catDAO->getDefault(); + } + + /** + * This action handles the main subscription page + * + * It displays categories and associated feeds. + */ + public function indexAction() { + Minz_View::appendScript(Minz_Url::display('/scripts/category.js?' . + @filemtime(PUBLIC_PATH . '/scripts/category.js'))); + Minz_View::prependTitle(_t('sub.title') . ' · '); + + $id = Minz_Request::param('id'); + if ($id !== false) { + $feedDAO = FreshRSS_Factory::createFeedDao(); + $this->view->feed = $feedDAO->searchById($id); + } + } + + /** + * This action handles the feed configuration page. + * + * It displays the feed configuration page. + * If this action is reached through a POST request, it stores all new + * configuraiton values then sends a notification to the user. + * + * The options available on the page are: + * - name + * - description + * - website URL + * - feed URL + * - category id (default: default category id) + * - CSS path to article on website + * - display in main stream (default: 0) + * - HTTP authentication + * - number of article to retain (default: -2) + * - refresh frequency (default: -2) + * Default values are empty strings unless specified. + */ + public function feedAction() { + if (Minz_Request::param('ajax')) { + $this->view->_useLayout(false); + } + + $feedDAO = FreshRSS_Factory::createFeedDao(); + $this->view->feeds = $feedDAO->listFeeds(); + + $id = Minz_Request::param('id'); + if ($id === false || !isset($this->view->feeds[$id])) { + Minz_Error::error(404); + return; + } + + $this->view->feed = $this->view->feeds[$id]; + + Minz_View::prependTitle(_t('sub.title.feed_management') . ' · ' . $this->view->feed->name() . ' · '); + + if (Minz_Request::isPost()) { + $user = trim(Minz_Request::param('http_user_feed' . $id, '')); + $pass = Minz_Request::param('http_pass_feed' . $id, ''); + + $httpAuth = ''; + if ($user != '' && $pass != '') { //TODO: Sanitize + $httpAuth = $user . ':' . $pass; + } + + $cat = intval(Minz_Request::param('category', 0)); + + $values = array( + 'name' => Minz_Request::param('name', ''), + 'description' => sanitizeHTML(Minz_Request::param('description', '', true)), + 'website' => Minz_Request::param('website', ''), + 'url' => Minz_Request::param('url', ''), + 'category' => $cat, + 'pathEntries' => Minz_Request::param('path_entries', ''), + 'priority' => intval(Minz_Request::param('priority', 0)), + 'httpAuth' => $httpAuth, + 'keep_history' => intval(Minz_Request::param('keep_history', -2)), + 'ttl' => intval(Minz_Request::param('ttl', -2)), + ); + + invalidateHttpCache(); + + $url_redirect = array('c' => 'subscription', 'params' => array('id' => $id)); + if ($feedDAO->updateFeed($id, $values) !== false) { + $this->view->feed->_category($cat); + $this->view->feed->faviconPrepare(); + + Minz_Request::good(_t('feedback.sub.feed.updated'), $url_redirect); + } else { + Minz_Request::bad(_t('feedback.sub.feed.error'), $url_redirect); + } + } + } +} diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php new file mode 100644 index 000000000..8f939dbdb --- /dev/null +++ b/app/Controllers/updateController.php @@ -0,0 +1,226 @@ +<?php + +class FreshRSS_update_Controller extends Minz_ActionController { + + public static function isGit() { + return is_dir(FRESHRSS_PATH . '/.git/'); + } + + public static function hasGitUpdate() { + $cwd = getcwd(); + chdir(FRESHRSS_PATH); + $output = array(); + try { + exec('git fetch', $output, $return); + if ($return == 0) { + exec('git status -sb --porcelain remote', $output, $return); + } else { + $line = is_array($output) ? implode('; ', $output) : '' . $output; + Minz_Log::warning('git fetch warning:' . $line); + } + } catch (Exception $e) { + Minz_Log::warning('git fetch error:' . $e->getMessage()); + } + chdir($cwd); + $line = is_array($output) ? implode('; ', $output) : '' . $output; + return strpos($line, '[behind') !== false; + } + + public static function gitPull() { + $cwd = getcwd(); + chdir(FRESHRSS_PATH); + $output = array(); + $return = 1; + try { + exec('git pull --ff-only', $output, $return); + } catch (Exception $e) { + Minz_Log::warning('git pull error:' . $e->getMessage()); + } + chdir($cwd); + $line = is_array($output) ? implode('; ', $output) : '' . $output; + return $return == 0 ? true : 'Git error: ' . $line; + } + + public function firstAction() { + if (!FreshRSS_Auth::hasAccess('admin')) { + Minz_Error::error(403); + } + + invalidateHttpCache(); + + $this->view->update_to_apply = false; + $this->view->last_update_time = 'unknown'; + $timestamp = @filemtime(join_path(DATA_PATH, 'last_update.txt')); + if ($timestamp !== false) { + $this->view->last_update_time = timestamptodate($timestamp); + } + } + + public function indexAction() { + Minz_View::prependTitle(_t('admin.update.title') . ' · '); + + if (!is_writable(FRESHRSS_PATH)) { + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('gen.short.damn'), + 'body' => _t('feedback.update.file_is_nok', FRESHRSS_PATH) + ); + } elseif (file_exists(UPDATE_FILENAME)) { + // There is an update file to apply! + $version = @file_get_contents(join_path(DATA_PATH, 'last_update.txt')); + if (empty($version)) { + $version = 'unknown'; + } + $this->view->update_to_apply = true; + $this->view->message = array( + 'status' => 'good', + 'title' => _t('gen.short.ok'), + 'body' => _t('feedback.update.can_apply', $version) + ); + } + } + + public function checkAction() { + $this->view->change_view('update', 'index'); + + if (file_exists(UPDATE_FILENAME)) { + // There is already an update file to apply: we don't need to check + // the webserver! + // Or if already check during the last hour, do nothing. + Minz_Request::forward(array('c' => 'update'), true); + + return; + } + + $script = ''; + $version = ''; + + if (self::isGit()) { + if (self::hasGitUpdate()) { + $version = 'git'; + } else { + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('gen.short.damn'), + 'body' => _t('feedback.update.none') + ); + @touch(join_path(DATA_PATH, 'last_update.txt')); + return; + } + } else { + $auto_update_url = FreshRSS_Context::$system_conf->auto_update_url . '?v=' . FRESHRSS_VERSION; + Minz_Log::debug('HTTP GET ' . $auto_update_url); + $c = curl_init($auto_update_url); + curl_setopt($c, CURLOPT_RETURNTRANSFER, true); + curl_setopt($c, CURLOPT_SSL_VERIFYPEER, true); + curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 2); + $result = curl_exec($c); + $c_status = curl_getinfo($c, CURLINFO_HTTP_CODE); + $c_error = curl_error($c); + curl_close($c); + + if ($c_status !== 200) { + Minz_Log::warning( + 'Error during update (HTTP code ' . $c_status . '): ' . $c_error + ); + + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('gen.short.damn'), + 'body' => _t('feedback.update.server_not_found', $auto_update_url) + ); + return; + } + + $res_array = explode("\n", $result, 2); + $status = $res_array[0]; + if (strpos($status, 'UPDATE') !== 0) { + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('gen.short.damn'), + 'body' => _t('feedback.update.none') + ); + @touch(join_path(DATA_PATH, 'last_update.txt')); + return; + } + + $script = $res_array[1]; + $version = explode(' ', $status, 2); + $version = $version[1]; + } + + if (file_put_contents(UPDATE_FILENAME, $script) !== false) { + @file_put_contents(join_path(DATA_PATH, 'last_update.txt'), $version); + Minz_Request::forward(array('c' => 'update'), true); + } else { + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('gen.short.damn'), + 'body' => _t('feedback.update.error', 'Cannot save the update script') + ); + } + } + + public function applyAction() { + if (!file_exists(UPDATE_FILENAME) || !is_writable(FRESHRSS_PATH)) { + Minz_Request::forward(array('c' => 'update'), true); + } + + if (Minz_Request::param('post_conf', false)) { + if (self::isGit()) { + $res = !self::hasGitUpdate(); + } else { + require(UPDATE_FILENAME); + $res = do_post_update(); + } + + Minz_ExtensionManager::callHook('post_update'); + + if ($res === true) { + @unlink(UPDATE_FILENAME); + @file_put_contents(join_path(DATA_PATH, 'last_update.txt'), ''); + Minz_Request::good(_t('feedback.update.finished')); + } else { + Minz_Request::bad(_t('feedback.update.error', $res), + array('c' => 'update', 'a' => 'index')); + } + } else { + $res = false; + + if (self::isGit()) { + $res = self::gitPull(); + } else { + if (Minz_Request::isPost()) { + save_info_update(); + } + if (!need_info_update()) { + $res = apply_update(); + } else { + return; + } + } + + if ($res === true) { + Minz_Request::forward(array( + 'c' => 'update', + 'a' => 'apply', + 'params' => array('post_conf' => true) + ), true); + } else { + Minz_Request::bad(_t('feedback.update.error', $res), + array('c' => 'update', 'a' => 'index')); + } + } + } + + /** + * This action displays information about installation. + */ + public function checkInstallAction() { + Minz_View::prependTitle(_t('admin.check_install.title') . ' · '); + + $this->view->status_php = check_install_php(); + $this->view->status_files = check_install_files(); + $this->view->status_database = check_install_database(); + } +} diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php new file mode 100644 index 000000000..9d6ae18e6 --- /dev/null +++ b/app/Controllers/userController.php @@ -0,0 +1,257 @@ +<?php + +/** + * Controller to handle user actions. + */ +class FreshRSS_user_Controller extends Minz_ActionController { + // Will also have to be computed client side on mobile devices, + // so do not use a too high cost + const BCRYPT_COST = 9; + + /** + * This action is called before every other action in that class. It is + * the common boiler plate for every action. It is triggered by the + * underlying framework. + * + * @todo clean up the access condition. + */ + public function firstAction() { + if (!FreshRSS_Auth::hasAccess() && !( + Minz_Request::actionName() === 'create' && + !max_registrations_reached() + )) { + Minz_Error::error(403); + } + } + + public static function hashPassword($passwordPlain) { + if (!function_exists('password_hash')) { + include_once(LIB_PATH . '/password_compat.php'); + } + $passwordHash = password_hash($passwordPlain, PASSWORD_BCRYPT, array('cost' => self::BCRYPT_COST)); + $passwordPlain = ''; + $passwordHash = preg_replace('/^\$2[xy]\$/', '\$2a\$', $passwordHash); //Compatibility with bcrypt.js + return $passwordHash == '' ? '' : $passwordHash; + } + + /** + * This action displays the user profile page. + */ + public function profileAction() { + Minz_View::prependTitle(_t('conf.profile.title') . ' · '); + + Minz_View::appendScript(Minz_Url::display( + '/scripts/bcrypt.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/bcrypt.min.js') + )); + + if (Minz_Request::isPost()) { + $ok = true; + + $passwordPlain = Minz_Request::param('newPasswordPlain', '', true); + if ($passwordPlain != '') { + Minz_Request::_param('newPasswordPlain'); //Discard plain-text password ASAP + $_POST['newPasswordPlain'] = ''; + $passwordHash = self::hashPassword($passwordPlain); + $ok &= ($passwordHash != ''); + FreshRSS_Context::$user_conf->passwordHash = $passwordHash; + } + Minz_Session::_param('passwordHash', FreshRSS_Context::$user_conf->passwordHash); + + $passwordPlain = Minz_Request::param('apiPasswordPlain', '', true); + if ($passwordPlain != '') { + $passwordHash = self::hashPassword($passwordPlain); + $ok &= ($passwordHash != ''); + FreshRSS_Context::$user_conf->apiPasswordHash = $passwordHash; + } + + $ok &= FreshRSS_Context::$user_conf->save(); + + if ($ok) { + Minz_Request::good(_t('feedback.profile.updated'), + array('c' => 'user', 'a' => 'profile')); + } else { + Minz_Request::bad(_t('feedback.profile.error'), + array('c' => 'user', 'a' => 'profile')); + } + } + } + + /** + * This action displays the user management page. + */ + public function manageAction() { + if (!FreshRSS_Auth::hasAccess('admin')) { + Minz_Error::error(403); + } + + 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; + + // Get information about the current user. + $entryDAO = FreshRSS_Factory::createEntryDao($this->view->current_user); + $this->view->nb_articles = $entryDAO->count(); + $this->view->size_user = $entryDAO->size(); + } + + public static function createUser($new_user_name, $passwordPlain, $apiPasswordPlain, $userConfig = array(), $insertDefaultFeeds = true) { + if (!is_array($userConfig)) { + $userConfig = array(); + } + + $ok = ($new_user_name != '') && ctype_alnum($new_user_name); + + if ($ok) { + $languages = Minz_Translate::availableLanguages(); + if (empty($userConfig['language']) || !in_array($userConfig['language'], $languages)) { + $userConfig['language'] = 'en'; + } + + $ok &= !in_array(strtoupper($new_user_name), array_map('strtoupper', listUsers())); //Not an existing user, case-insensitive + + $configPath = join_path(DATA_PATH, 'users', $new_user_name, 'config.php'); + $ok &= !file_exists($configPath); + } + if ($ok) { + $passwordHash = ''; + if ($passwordPlain != '') { + $passwordHash = self::hashPassword($passwordPlain); + $ok &= ($passwordHash != ''); + } + + $apiPasswordHash = ''; + if ($apiPasswordPlain != '') { + $apiPasswordHash = self::hashPassword($apiPasswordPlain); + $ok &= ($apiPasswordHash != ''); + } + } + if ($ok) { + mkdir(join_path(DATA_PATH, 'users', $new_user_name)); + $userConfig['passwordHash'] = $passwordHash; + $userConfig['apiPasswordHash'] = $apiPasswordHash; + $ok &= (file_put_contents($configPath, "<?php\n return " . var_export($userConfig, true) . ';') !== false); + } + if ($ok) { + $userDAO = new FreshRSS_UserDAO(); + $ok &= $userDAO->createUser($new_user_name, $userConfig['language'], $insertDefaultFeeds); + } + return $ok; + } + + /** + * This action creates a new user. + * + * Request parameters are: + * - new_user_language + * - new_user_name + * - new_user_passwordPlain + * - r (i.e. a redirection url, optional) + * + * @todo clean up this method. Idea: write a method to init a user with basic information. + * @todo handle r redirection in Minz_Request::forward directly? + */ + public function createAction() { + if (Minz_Request::isPost() && ( + FreshRSS_Auth::hasAccess('admin') || + !max_registrations_reached() + )) { + $new_user_name = Minz_Request::param('new_user_name'); + $passwordPlain = Minz_Request::param('new_user_passwordPlain', '', true); + $new_user_language = Minz_Request::param('new_user_language', FreshRSS_Context::$user_conf->language); + + $ok = self::createUser($new_user_name, $passwordPlain, '', array('language' => $new_user_language)); + Minz_Request::_param('new_user_passwordPlain'); //Discard plain-text password ASAP + $_POST['new_user_passwordPlain'] = ''; + invalidateHttpCache(); + + $notif = array( + 'type' => $ok ? 'good' : 'bad', + 'content' => _t('feedback.user.created' . (!$ok ? '.error' : ''), $new_user_name) + ); + Minz_Session::_param('notification', $notif); + } + + $redirect_url = urldecode(Minz_Request::param('r', false, true)); + if (!$redirect_url) { + $redirect_url = array('c' => 'user', 'a' => 'manage'); + } + Minz_Request::forward($redirect_url, true); + } + + public static function deleteUser($username) { + $db = FreshRSS_Context::$system_conf->db; + require_once(APP_PATH . '/SQL/install.sql.' . $db['type'] . '.php'); + + $ok = ctype_alnum($username); + if ($ok) { + $default_user = FreshRSS_Context::$system_conf->default_user; + $ok &= (strcasecmp($username, $default_user) !== 0); //It is forbidden to delete the default user + } + $user_data = join_path(DATA_PATH, 'users', $username); + if ($ok) { + $ok &= is_dir($user_data); + } + if ($ok) { + $userDAO = new FreshRSS_UserDAO(); + $ok &= $userDAO->deleteUser($username); + $ok &= recursive_unlink($user_data); + } + return $ok; + } + + /** + * This action delete an existing user. + * + * Request parameter is: + * - username + * + * @todo clean up this method. Idea: create a User->clean() method. + */ + public function deleteAction() { + $username = Minz_Request::param('username'); + $redirect_url = urldecode(Minz_Request::param('r', false, true)); + if (!$redirect_url) { + $redirect_url = array('c' => 'user', 'a' => 'manage'); + } + + $self_deletion = Minz_Session::param('currentUser', '_') === $username; + + if (Minz_Request::isPost() && ( + FreshRSS_Auth::hasAccess('admin') || + $self_deletion + )) { + $ok = true; + if ($ok && $self_deletion) { + // We check the password if it's a self-destruction + $nonce = Minz_Session::param('nonce'); + $challenge = Minz_Request::param('challenge', ''); + + $ok &= FreshRSS_FormAuth::checkCredentials( + $username, FreshRSS_Context::$user_conf->passwordHash, + $nonce, $challenge + ); + } + if ($ok) { + $ok &= self::deleteUser($username); + } + if ($ok && $self_deletion) { + FreshRSS_Auth::removeAccess(); + $redirect_url = array('c' => 'index', 'a' => 'index'); + } + invalidateHttpCache(); + + $notif = array( + 'type' => $ok ? 'good' : 'bad', + 'content' => _t('feedback.user.deleted' . (!$ok ? '.error' : ''), $username) + ); + Minz_Session::_param('notification', $notif); + } + + Minz_Request::forward($redirect_url, true); + } +} diff --git a/app/Controllers/usersController.php b/app/Controllers/usersController.php deleted file mode 100644 index bb4f34c5e..000000000 --- a/app/Controllers/usersController.php +++ /dev/null @@ -1,183 +0,0 @@ -<?php - -class FreshRSS_users_Controller extends Minz_ActionController { - - const BCRYPT_COST = 9; //Will also have to be computed client side on mobile devices, so do not use a too high cost - - public function firstAction() { - if (!$this->view->loginOk) { - Minz_Error::error( - 403, - array('error' => array(Minz_Translate::t('access_denied'))) - ); - } - } - - public function authAction() { - if (Minz_Request::isPost()) { - $ok = true; - - $passwordPlain = Minz_Request::param('passwordPlain', false); - if ($passwordPlain != '') { - Minz_Request::_param('passwordPlain'); //Discard plain-text password ASAP - $_POST['passwordPlain'] = ''; - if (!function_exists('password_hash')) { - include_once(LIB_PATH . '/password_compat.php'); - } - $passwordHash = password_hash($passwordPlain, PASSWORD_BCRYPT, array('cost' => self::BCRYPT_COST)); - $passwordPlain = ''; - $passwordHash = preg_replace('/^\$2[xy]\$/', '\$2a\$', $passwordHash); //Compatibility with bcrypt.js - $ok &= ($passwordHash != ''); - $this->view->conf->_passwordHash($passwordHash); - } - Minz_Session::_param('passwordHash', $this->view->conf->passwordHash); - - if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { - $this->view->conf->_mail_login(Minz_Request::param('mail_login', false)); - } - $email = $this->view->conf->mail_login; - Minz_Session::_param('mail', $email); - - $ok &= $this->view->conf->save(); - - if ($email != '') { - $personaFile = DATA_PATH . '/persona/' . $email . '.txt'; - @unlink($personaFile); - $ok &= (file_put_contents($personaFile, Minz_Session::param('currentUser', '_')) !== false); - } - - if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { - $current_token = $this->view->conf->token; - $token = Minz_Request::param('token', $current_token); - $this->view->conf->_token($token); - $ok &= $this->view->conf->save(); - - $anon = Minz_Request::param('anon_access', false); - $anon = ((bool)$anon) && ($anon !== 'no'); - $anon_refresh = Minz_Request::param('anon_refresh', false); - $anon_refresh = ((bool)$anon_refresh) && ($anon_refresh !== 'no'); - $auth_type = Minz_Request::param('auth_type', 'none'); - if ($anon != Minz_Configuration::allowAnonymous() || - $auth_type != Minz_Configuration::authType() || - $anon_refresh != Minz_Configuration::allowAnonymousRefresh()) { - - Minz_Configuration::_authType($auth_type); - Minz_Configuration::_allowAnonymous($anon); - Minz_Configuration::_allowAnonymousRefresh($anon_refresh); - $ok &= Minz_Configuration::writeFile(); - } - } - - invalidateHttpCache(); - - $notif = array( - 'type' => $ok ? 'good' : 'bad', - 'content' => Minz_Translate::t($ok ? 'configuration_updated' : 'error_occurred') - ); - Minz_Session::_param('notification', $notif); - } - Minz_Request::forward(array('c' => 'configure', 'a' => 'users'), true); - } - - public function createAction() { - if (Minz_Request::isPost() && Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { - require_once(APP_PATH . '/sql.php'); - - $new_user_language = Minz_Request::param('new_user_language', $this->view->conf->language); - if (!in_array($new_user_language, $this->view->conf->availableLanguages())) { - $new_user_language = $this->view->conf->language; - } - - $new_user_name = Minz_Request::param('new_user_name'); - $ok = ($new_user_name != '') && ctype_alnum($new_user_name); - - if ($ok) { - $ok &= (strcasecmp($new_user_name, Minz_Configuration::defaultUser()) !== 0); //It is forbidden to alter the default user - - $ok &= !in_array(strtoupper($new_user_name), array_map('strtoupper', listUsers())); //Not an existing user, case-insensitive - - $configPath = DATA_PATH . '/' . $new_user_name . '_user.php'; - $ok &= !file_exists($configPath); - } - if ($ok) { - - $passwordPlain = Minz_Request::param('new_user_passwordPlain', false); - $passwordHash = ''; - if ($passwordPlain != '') { - Minz_Request::_param('new_user_passwordPlain'); //Discard plain-text password ASAP - $_POST['new_user_passwordPlain'] = ''; - if (!function_exists('password_hash')) { - include_once(LIB_PATH . '/password_compat.php'); - } - $passwordHash = password_hash($passwordPlain, PASSWORD_BCRYPT, array('cost' => self::BCRYPT_COST)); - $passwordPlain = ''; - $passwordHash = preg_replace('/^\$2[xy]\$/', '\$2a\$', $passwordHash); //Compatibility with bcrypt.js - $ok &= ($passwordHash != ''); - } - if (empty($passwordHash)) { - $passwordHash = ''; - } - - $new_user_email = filter_var($_POST['new_user_email'], FILTER_VALIDATE_EMAIL); - if (empty($new_user_email)) { - $new_user_email = ''; - } else { - $personaFile = DATA_PATH . '/persona/' . $new_user_email . '.txt'; - @unlink($personaFile); - $ok &= (file_put_contents($personaFile, $new_user_name) !== false); - } - } - if ($ok) { - $config_array = array( - 'language' => $new_user_language, - 'passwordHash' => $passwordHash, - 'mail_login' => $new_user_email, - ); - $ok &= (file_put_contents($configPath, "<?php\n return " . var_export($config_array, true) . ';') !== false); - } - if ($ok) { - $userDAO = new FreshRSS_UserDAO(); - $ok &= $userDAO->createUser($new_user_name); - } - invalidateHttpCache(); - - $notif = array( - 'type' => $ok ? 'good' : 'bad', - 'content' => Minz_Translate::t($ok ? 'user_created' : 'error_occurred', $new_user_name) - ); - Minz_Session::_param('notification', $notif); - } - Minz_Request::forward(array('c' => 'configure', 'a' => 'users'), true); - } - - public function deleteAction() { - if (Minz_Request::isPost() && Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { - require_once(APP_PATH . '/sql.php'); - - $username = Minz_Request::param('username'); - $ok = ctype_alnum($username); - - if ($ok) { - $ok &= (strcasecmp($username, Minz_Configuration::defaultUser()) !== 0); //It is forbidden to delete the default user - } - if ($ok) { - $configPath = DATA_PATH . '/' . $username . '_user.php'; - $ok &= file_exists($configPath); - } - if ($ok) { - $userDAO = new FreshRSS_UserDAO(); - $ok &= $userDAO->deleteUser($username); - $ok &= unlink($configPath); - //TODO: delete Persona file - } - invalidateHttpCache(); - - $notif = array( - 'type' => $ok ? 'good' : 'bad', - 'content' => Minz_Translate::t($ok ? 'user_deleted' : 'error_occurred', $username) - ); - Minz_Session::_param('notification', $notif); - } - Minz_Request::forward(array('c' => 'configure', 'a' => 'users'), true); - } -} diff --git a/app/Exceptions/AlreadySubscribedException.php b/app/Exceptions/AlreadySubscribedException.php new file mode 100644 index 000000000..33b9f9555 --- /dev/null +++ b/app/Exceptions/AlreadySubscribedException.php @@ -0,0 +1,14 @@ +<?php + +class FreshRSS_AlreadySubscribed_Exception extends Exception { + private $feedName = ''; + + public function __construct($url, $feedName) { + parent::__construct('Already subscribed! ' . $url, 2135); + $this->feedName = $feedName; + } + + public function feedName() { + return $this->feedName; + } +} diff --git a/app/Exceptions/BadUrlException.php b/app/Exceptions/BadUrlException.php index 7d1fe110e..d2509e4ba 100644 --- a/app/Exceptions/BadUrlException.php +++ b/app/Exceptions/BadUrlException.php @@ -1,6 +1,9 @@ <?php + class FreshRSS_BadUrl_Exception extends FreshRSS_Feed_Exception { - public function __construct ($url) { - parent::__construct ('`' . $url . '` is not a valid URL'); + + public function __construct($url) { + parent::__construct('`' . $url . '` is not a valid URL'); } + } diff --git a/app/Exceptions/ContextException.php b/app/Exceptions/ContextException.php new file mode 100644 index 000000000..00934cbfd --- /dev/null +++ b/app/Exceptions/ContextException.php @@ -0,0 +1,8 @@ +<?php + +/** + * An exception raised when a context is invalid + */ +class FreshRSS_Context_Exception extends Exception { + +} diff --git a/app/Exceptions/DAOException.php b/app/Exceptions/DAOException.php new file mode 100644 index 000000000..14bee3403 --- /dev/null +++ b/app/Exceptions/DAOException.php @@ -0,0 +1,5 @@ +<?php + +class FreshRSS_DAO_Exception extends Exception { + +} diff --git a/app/Exceptions/EntriesGetterException.php b/app/Exceptions/EntriesGetterException.php index eaa330979..3b76195ee 100644 --- a/app/Exceptions/EntriesGetterException.php +++ b/app/Exceptions/EntriesGetterException.php @@ -1,7 +1,5 @@ <?php class FreshRSS_EntriesGetter_Exception extends Exception { - public function __construct ($message) { - parent::__construct ($message); - } + } diff --git a/app/Exceptions/FeedException.php b/app/Exceptions/FeedException.php index 50918ba95..abfcbce79 100644 --- a/app/Exceptions/FeedException.php +++ b/app/Exceptions/FeedException.php @@ -1,6 +1,5 @@ <?php + class FreshRSS_Feed_Exception extends Exception { - public function __construct ($message) { - parent::__construct ($message); - } + } diff --git a/app/Exceptions/FeedNotAddedException.php b/app/Exceptions/FeedNotAddedException.php new file mode 100644 index 000000000..350a17c56 --- /dev/null +++ b/app/Exceptions/FeedNotAddedException.php @@ -0,0 +1,14 @@ +<?php + +class FreshRSS_FeedNotAdded_Exception extends Exception { + private $feedName = ''; + + public function __construct($url, $feedName) { + parent::__construct('Feed not added! ' . $url, 2147); + $this->feedName = $feedName; + } + + public function feedName() { + return $this->feedName; + } +} diff --git a/app/Exceptions/OpmlException.php b/app/Exceptions/OpmlException.php deleted file mode 100644 index e0ea3e493..000000000 --- a/app/Exceptions/OpmlException.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php -class FreshRSS_Opml_Exception extends FreshRSS_Feed_Exception { - public function __construct ($name_file) { - parent::__construct ('OPML file is invalid'); - } -} diff --git a/app/Exceptions/ZipException.php b/app/Exceptions/ZipException.php new file mode 100644 index 000000000..8441daedf --- /dev/null +++ b/app/Exceptions/ZipException.php @@ -0,0 +1,14 @@ +<?php + +class FreshRSS_Zip_Exception extends Exception { + private $zipErrorCode = 0; + + public function __construct($zipErrorCode) { + parent::__construct('ZIP error! ' . $url, 2141); + $this->zipErrorCode = $zipErrorCode; + } + + public function zipErrorCode() { + return $this->zipErrorCode; + } +} diff --git a/app/Exceptions/ZipMissingException.php b/app/Exceptions/ZipMissingException.php new file mode 100644 index 000000000..864cc3991 --- /dev/null +++ b/app/Exceptions/ZipMissingException.php @@ -0,0 +1,4 @@ +<?php + +class FreshRSS_ZipMissing_Exception extends Exception { +} diff --git a/app/FreshRSS.php b/app/FreshRSS.php index 84cf3429b..e4caf23d1 100644 --- a/app/FreshRSS.php +++ b/app/FreshRSS.php @@ -1,146 +1,128 @@ <?php + class FreshRSS extends Minz_FrontController { + /** + * Initialize the different FreshRSS / Minz components. + * + * PLEASE DON'T CHANGE THE ORDER OF INITIALIZATIONS UNLESS YOU KNOW WHAT + * YOU DO!! + * + * Here is the list of components: + * - Create a configuration setter and register it to system conf + * - Init extension manager and enable system extensions (has to be done asap) + * - Init authentication system + * - Init user configuration (need auth system) + * - Init FreshRSS context (need user conf) + * - Init i18n (need context) + * - Init sharing system (need user conf and i18n) + * - Init generic styles and scripts (need user conf) + * - Init notifications + * - Enable user extensions (need all the other initializations) + */ public function init() { if (!isset($_SESSION)) { Minz_Session::init('FreshRSS'); } - $loginOk = $this->accessControl(Minz_Session::param('currentUser', '')); - $this->loadParamsView(); - $this->loadStylesAndScripts($loginOk); //TODO: Do not load that when not needed, e.g. some Ajax requests - $this->loadNotifications(); - } - private function accessControl($currentUser) { - if ($currentUser == '') { - switch (Minz_Configuration::authType()) { - case 'form': - $currentUser = Minz_Configuration::defaultUser(); - Minz_Session::_param('passwordHash'); - $loginOk = false; - break; - case 'http_auth': - $currentUser = httpAuthUser(); - $loginOk = $currentUser != ''; - break; - case 'persona': - $loginOk = false; - $email = filter_var(Minz_Session::param('mail'), FILTER_VALIDATE_EMAIL); - if ($email != '') { //TODO: Remove redundancy with indexController - $personaFile = DATA_PATH . '/persona/' . $email . '.txt'; - if (($currentUser = @file_get_contents($personaFile)) !== false) { - $currentUser = trim($currentUser); - $loginOk = true; - } - } - if (!$loginOk) { - $currentUser = Minz_Configuration::defaultUser(); - } - break; - case 'none': - $currentUser = Minz_Configuration::defaultUser(); - $loginOk = true; - break; - default: - $currentUser = Minz_Configuration::defaultUser(); - $loginOk = false; - break; - } - } else { - $loginOk = true; - } + // Register the configuration setter for the system configuration + $configuration_setter = new FreshRSS_ConfigurationSetter(); + $system_conf = Minz_Configuration::get('system'); + $system_conf->_configurationSetter($configuration_setter); - if (!ctype_alnum($currentUser)) { - Minz_Session::_param('currentUser', ''); - die('Invalid username [' . $currentUser . ']!'); - } + // Load list of extensions and enable the "system" ones. + Minz_ExtensionManager::init(); - try { - $this->conf = new FreshRSS_Configuration($currentUser); - Minz_View::_param ('conf', $this->conf); - Minz_Session::_param('currentUser', $currentUser); - } catch (Minz_Exception $me) { - $loginOk = false; - try { - $this->conf = new FreshRSS_Configuration(Minz_Configuration::defaultUser()); - Minz_Session::_param('currentUser', Minz_Configuration::defaultUser()); - Minz_View::_param('conf', $this->conf); - $notif = array( - 'type' => 'bad', - 'content' => 'Invalid configuration for user [' . $currentUser . ']!', - ); - Minz_Session::_param ('notification', $notif); - Minz_Log::record ($notif['content'] . ' ' . $me->getMessage(), Minz_Log::WARNING); - Minz_Session::_param('currentUser', ''); - } catch (Exception $e) { - die($e->getMessage()); - } - } + // Auth has to be initialized before using currentUser session parameter + // because it's this part which create this parameter. + self::initAuth(); - if ($loginOk) { - switch (Minz_Configuration::authType()) { - case 'form': - $loginOk = Minz_Session::param('passwordHash') === $this->conf->passwordHash; - break; - case 'http_auth': - $loginOk = strcasecmp($currentUser, httpAuthUser()) === 0; - break; - case 'persona': - $loginOk = strcasecmp(Minz_Session::param('mail'), $this->conf->mail_login) === 0; - break; - case 'none': - $loginOk = true; - break; - default: - $loginOk = false; - break; - } + // Then, register the user configuration and use the configuration setter + // created above. + $current_user = Minz_Session::param('currentUser', '_'); + Minz_Configuration::register('user', + join_path(USERS_PATH, $current_user, 'config.php'), + join_path(USERS_PATH, '_', 'config.default.php'), + $configuration_setter); + + // Finish to initialize the other FreshRSS / Minz components. + FreshRSS_Context::init(); + self::initI18n(); + self::loadNotifications(); + // Enable extensions for the current (logged) user. + if (FreshRSS_Auth::hasAccess() || $system_conf->allow_anonymous) { + $ext_list = FreshRSS_Context::$user_conf->extensions_enabled; + Minz_ExtensionManager::enableByList($ext_list); } - Minz_View::_param ('loginOk', $loginOk); - return $loginOk; } - private function loadParamsView () { - Minz_Session::_param ('language', $this->conf->language); - Minz_Translate::init(); - $output = Minz_Request::param ('output', ''); - if (($output === '') || ($output !== 'normal' && $output !== 'rss' && $output !== 'reader' && $output !== 'global')) { - $output = $this->conf->view_mode; - Minz_Request::_param ('output', $output); + private static function initAuth() { + FreshRSS_Auth::init(); + if (Minz_Request::isPost() && !(is_referer_from_same_domain() && FreshRSS_Auth::isCsrfOk())) { + // Basic protection against XSRF attacks + FreshRSS_Auth::removeAccess(); + $http_referer = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER']; + Minz_Translate::init('en'); //TODO: Better choice of fallback language + Minz_Error::error( + 403, + array('error' => array( + _t('feedback.access.denied'), + ' [HTTP_REFERER=' . htmlspecialchars($http_referer) . ']' + )) + ); } } - private function loadStylesAndScripts ($loginOk) { - $theme = FreshRSS_Themes::load($this->conf->theme); + private static function initI18n() { + Minz_Session::_param('language', FreshRSS_Context::$user_conf->language); + Minz_Translate::init(FreshRSS_Context::$user_conf->language); + } + + public static function loadStylesAndScripts() { + $theme = FreshRSS_Themes::load(FreshRSS_Context::$user_conf->theme); if ($theme) { foreach($theme['files'] as $file) { - Minz_View::appendStyle (Minz_Url::display ('/themes/' . $theme['id'] . '/' . $file . '?' . @filemtime(PUBLIC_PATH . '/themes/' . $theme['id'] . '/' . $file))); + if ($file[0] === '_') { + $theme_id = 'base-theme'; + $filename = substr($file, 1); + } else { + $theme_id = $theme['id']; + $filename = $file; + } + $filetime = @filemtime(PUBLIC_PATH . '/themes/' . $theme_id . '/' . $filename); + $url = '/themes/' . $theme_id . '/' . $filename . '?' . $filetime; + header('Link: <' . Minz_Url::display($url, '', 'root') . '>;rel=preload', false); //HTTP2 + Minz_View::appendStyle(Minz_Url::display($url)); } } - switch (Minz_Configuration::authType()) { - case 'form': - if (!$loginOk) { - Minz_View::appendScript(Minz_Url::display ('/scripts/bcrypt.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/bcrypt.min.js'))); - } - break; - case 'persona': - Minz_View::appendScript('https://login.persona.org/include.js'); - break; - } - $includeLazyLoad = $this->conf->lazyload && ($this->conf->display_posts || Minz_Request::param ('output') === 'reader'); - Minz_View::appendScript (Minz_Url::display ('/scripts/jquery.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/jquery.min.js')), false, !$includeLazyLoad, !$includeLazyLoad); - if ($includeLazyLoad) { - Minz_View::appendScript (Minz_Url::display ('/scripts/jquery.lazyload.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/jquery.lazyload.min.js'))); - } - Minz_View::appendScript (Minz_Url::display ('/scripts/shortcut.js?' . @filemtime(PUBLIC_PATH . '/scripts/shortcut.js'))); - Minz_View::appendScript (Minz_Url::display ('/scripts/main.js?' . @filemtime(PUBLIC_PATH . '/scripts/main.js'))); + Minz_View::appendScript(Minz_Url::display('/scripts/jquery.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/jquery.min.js'))); + Minz_View::appendScript(Minz_Url::display('/scripts/shortcut.js?' . @filemtime(PUBLIC_PATH . '/scripts/shortcut.js'))); + Minz_View::appendScript(Minz_Url::display('/scripts/main.js?' . @filemtime(PUBLIC_PATH . '/scripts/main.js'))); } - private function loadNotifications () { - $notif = Minz_Session::param ('notification'); + private static function loadNotifications() { + $notif = Minz_Session::param('notification'); if ($notif) { - Minz_View::_param ('notification', $notif); - Minz_Session::_param ('notification'); + Minz_View::_param('notification', $notif); + Minz_Session::_param('notification'); + } + } + + public static function preLayout() { + switch (Minz_Request::controllerName()) { + case 'index': + header("Content-Security-Policy: default-src 'self'; child-src *; frame-src *; img-src * data:; media-src *"); + break; + case 'stats': + header("Content-Security-Policy: default-src 'self'; style-src 'self' 'unsafe-inline'"); + break; + default: + header("Content-Security-Policy: default-src 'self'"); + break; } + header("X-Content-Type-Options: nosniff"); + + FreshRSS_Share::load(join_path(DATA_PATH, 'shares.php')); + self::loadStylesAndScripts(); } } diff --git a/app/Models/Auth.php b/app/Models/Auth.php new file mode 100644 index 000000000..b3255cfbd --- /dev/null +++ b/app/Models/Auth.php @@ -0,0 +1,264 @@ +<?php + +/** + * This class handles all authentication process. + */ +class FreshRSS_Auth { + /** + * Determines if user is connected. + */ + private static $login_ok = false; + + /** + * This method initializes authentication system. + */ + public static function init() { + self::$login_ok = Minz_Session::param('loginOk', false); + $current_user = Minz_Session::param('currentUser', ''); + if ($current_user === '') { + $conf = Minz_Configuration::get('system'); + $current_user = $conf->default_user; + Minz_Session::_param('currentUser', $current_user); + } + + if (self::$login_ok) { + self::giveAccess(); + } elseif (self::accessControl()) { + self::giveAccess(); + FreshRSS_UserDAO::touch(); + } else { + // Be sure all accesses are removed! + self::removeAccess(); + } + } + + /** + * This method checks if user is allowed to connect. + * + * Required session parameters are also set in this method (such as + * currentUser). + * + * @return boolean true if user can be connected, false else. + */ + private static function accessControl() { + $conf = Minz_Configuration::get('system'); + $auth_type = $conf->auth_type; + switch ($auth_type) { + case 'form': + $credentials = FreshRSS_FormAuth::getCredentialsFromCookie(); + $current_user = ''; + if (isset($credentials[1])) { + $current_user = trim($credentials[0]); + Minz_Session::_param('currentUser', $current_user); + Minz_Session::_param('passwordHash', trim($credentials[1])); + } + return $current_user != ''; + case 'http_auth': + $current_user = httpAuthUser(); + $login_ok = $current_user != ''; + if ($login_ok) { + Minz_Session::_param('currentUser', $current_user); + } + return $login_ok; + case 'none': + return true; + default: + // TODO load extension + return false; + } + } + + /** + * Gives access to the current user. + */ + public static function giveAccess() { + $current_user = Minz_Session::param('currentUser'); + $user_conf = get_user_configuration($current_user); + $system_conf = Minz_Configuration::get('system'); + + switch ($system_conf->auth_type) { + case 'form': + self::$login_ok = Minz_Session::param('passwordHash') === $user_conf->passwordHash; + break; + case 'http_auth': + self::$login_ok = strcasecmp($current_user, httpAuthUser()) === 0; + break; + case 'none': + self::$login_ok = true; + break; + default: + // TODO: extensions + self::$login_ok = false; + } + + Minz_Session::_param('loginOk', self::$login_ok); + } + + /** + * Returns if current user has access to the given scope. + * + * @param string $scope general (default) or admin + * @return boolean true if user has corresponding access, false else. + */ + public static function hasAccess($scope = 'general') { + $conf = Minz_Configuration::get('system'); + $default_user = $conf->default_user; + $ok = self::$login_ok; + switch ($scope) { + case 'general': + break; + case 'admin': + $ok &= Minz_Session::param('currentUser') === $default_user; + break; + default: + $ok = false; + } + return $ok; + } + + /** + * Removes all accesses for the current user. + */ + public static function removeAccess() { + Minz_Session::_param('loginOk'); + self::$login_ok = false; + $conf = Minz_Configuration::get('system'); + Minz_Session::_param('currentUser', $conf->default_user); + Minz_Session::_param('csrf'); + + switch ($conf->auth_type) { + case 'form': + Minz_Session::_param('passwordHash'); + FreshRSS_FormAuth::deleteCookie(); + break; + case 'http_auth': + case 'none': + // Nothing to do... + break; + default: + // TODO: extensions + } + } + + /** + * Return if authentication is enabled on this instance of FRSS. + */ + public static function accessNeedsLogin() { + $conf = Minz_Configuration::get('system'); + $auth_type = $conf->auth_type; + return $auth_type !== 'none'; + } + + /** + * Return if authentication requires a PHP action. + */ + public static function accessNeedsAction() { + $conf = Minz_Configuration::get('system'); + $auth_type = $conf->auth_type; + return $auth_type === 'form'; + } + + public static function csrfToken() { + $csrf = Minz_Session::param('csrf'); + if ($csrf == '') { + $salt = FreshRSS_Context::$system_conf->salt; + $csrf = sha1($salt . uniqid(mt_rand(), true)); + Minz_Session::_param('csrf', $csrf); + } + return $csrf; + } + public static function isCsrfOk($token = null) { + $csrf = Minz_Session::param('csrf'); + if ($csrf == '') { + return true; //Not logged in yet + } + if ($token === null) { + $token = Minz_Request::fetchPOST('_csrf'); + } + return $token === $csrf; + } +} + + +class FreshRSS_FormAuth { + public static function checkCredentials($username, $hash, $nonce, $challenge) { + if (!ctype_alnum($username) || + !ctype_graph($challenge) || + !ctype_alnum($nonce)) { + Minz_Log::debug('Invalid credential parameters:' . + ' user=' . $username . + ' challenge=' . $challenge . + ' nonce=' . $nonce); + return false; + } + + if (!function_exists('password_verify')) { + include_once(LIB_PATH . '/password_compat.php'); + } + + return password_verify($nonce . $hash, $challenge); + } + + public static function getCredentialsFromCookie() { + $token = Minz_Session::getLongTermCookie('FreshRSS_login'); + if (!ctype_alnum($token)) { + return array(); + } + + $token_file = DATA_PATH . '/tokens/' . $token . '.txt'; + $mtime = @filemtime($token_file); + if ($mtime + 2629744 < time()) { + // Token has expired (> 1 month) or does not exist. + // TODO: 1 month -> use a configuration instead + @unlink($token_file); + return array(); + } + + $credentials = @file_get_contents($token_file); + return $credentials === false ? array() : explode("\t", $credentials, 2); + } + + public static function makeCookie($username, $password_hash) { + $conf = Minz_Configuration::get('system'); + do { + $token = sha1($conf->salt . $username . uniqid(mt_rand(), true)); + $token_file = DATA_PATH . '/tokens/' . $token . '.txt'; + } while (file_exists($token_file)); + + if (@file_put_contents($token_file, $username . "\t" . $password_hash) === false) { + return false; + } + + $limits = $conf->limits; + $cookie_duration = empty($limits['cookie_duration']) ? 2629744 : $limits['cookie_duration']; + $expire = time() + $cookie_duration; + Minz_Session::setLongTermCookie('FreshRSS_login', $token, $expire); + return $token; + } + + public static function deleteCookie() { + $token = Minz_Session::getLongTermCookie('FreshRSS_login'); + if (ctype_alnum($token)) { + Minz_Session::deleteLongTermCookie('FreshRSS_login'); + @unlink(DATA_PATH . '/tokens/' . $token . '.txt'); + } + + if (rand(0, 10) === 1) { + self::purgeTokens(); + } + } + + public static function purgeTokens() { + $conf = Minz_Configuration::get('system'); + $limits = $conf->limits; + $cookie_duration = empty($limits['cookie_duration']) ? 2629744 : $limits['cookie_duration']; + $oldest = time() - $cookie_duration; + foreach (new DirectoryIterator(DATA_PATH . '/tokens/') as $file_info) { + // $extension = $file_info->getExtension(); doesn't work in PHP < 5.3.7 + $extension = pathinfo($file_info->getFilename(), PATHINFO_EXTENSION); + if ($extension === 'txt' && $file_info->getMTime() < $oldest) { + @unlink($file_info->getPathname()); + } + } + } +} diff --git a/app/Models/Category.php b/app/Models/Category.php index 328bae799..9a44a2d09 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -6,66 +6,73 @@ class FreshRSS_Category extends Minz_Model { private $nbFeed = -1; private $nbNotRead = -1; private $feeds = null; + private $hasFeedsWithError = false; - public function __construct ($name = '', $feeds = null) { - $this->_name ($name); - if (isset ($feeds)) { - $this->_feeds ($feeds); + public function __construct($name = '', $feeds = null) { + $this->_name($name); + if (isset($feeds)) { + $this->_feeds($feeds); $this->nbFeed = 0; $this->nbNotRead = 0; foreach ($feeds as $feed) { $this->nbFeed++; - $this->nbNotRead += $feed->nbNotRead (); + $this->nbNotRead += $feed->nbNotRead(); + $this->hasFeedsWithError |= $feed->inError(); } } } - public function id () { + public function id() { return $this->id; } - public function name () { + public function name() { return $this->name; } - public function nbFeed () { + public function nbFeed() { if ($this->nbFeed < 0) { - $catDAO = new FreshRSS_CategoryDAO (); - $this->nbFeed = $catDAO->countFeed ($this->id ()); + $catDAO = new FreshRSS_CategoryDAO(); + $this->nbFeed = $catDAO->countFeed($this->id()); } return $this->nbFeed; } - public function nbNotRead () { + public function nbNotRead() { if ($this->nbNotRead < 0) { - $catDAO = new FreshRSS_CategoryDAO (); - $this->nbNotRead = $catDAO->countNotRead ($this->id ()); + $catDAO = new FreshRSS_CategoryDAO(); + $this->nbNotRead = $catDAO->countNotRead($this->id()); } return $this->nbNotRead; } - public function feeds () { + public function feeds() { if ($this->feeds === null) { - $feedDAO = new FreshRSS_FeedDAO (); - $this->feeds = $feedDAO->listByCategory ($this->id ()); + $feedDAO = FreshRSS_Factory::createFeedDao(); + $this->feeds = $feedDAO->listByCategory($this->id()); $this->nbFeed = 0; $this->nbNotRead = 0; foreach ($this->feeds as $feed) { $this->nbFeed++; - $this->nbNotRead += $feed->nbNotRead (); + $this->nbNotRead += $feed->nbNotRead(); + $this->hasFeedsWithError |= $feed->inError(); } } return $this->feeds; } - public function _id ($value) { + public function hasFeedsWithError() { + return $this->hasFeedsWithError; + } + + public function _id($value) { $this->id = $value; } - public function _name ($value) { - $this->name = $value; + public function _name($value) { + $this->name = substr(trim($value), 0, 255); } - public function _feeds ($values) { - if (!is_array ($values)) { - $values = array ($values); + public function _feeds($values) { + if (!is_array($values)) { + $values = array($values); } $this->feeds = $values; diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php index 5355228a5..c2d57c241 100644 --- a/app/Models/CategoryDAO.php +++ b/app/Models/CategoryDAO.php @@ -1,171 +1,190 @@ <?php -class FreshRSS_CategoryDAO extends Minz_ModelPdo { - public function addCategory ($valuesTmp) { - $sql = 'INSERT INTO `' . $this->prefix . 'category` (name) VALUES(?)'; - $stm = $this->bd->prepare ($sql); +class FreshRSS_CategoryDAO extends Minz_ModelPdo implements FreshRSS_Searchable { - $values = array ( + const defaultCategoryId = 1; + + public function addCategory($valuesTmp) { + $sql = 'INSERT INTO `' . $this->prefix . 'category`(name) VALUES(?)'; + $stm = $this->bd->prepare($sql); + + $values = array( substr($valuesTmp['name'], 0, 255), ); - if ($stm && $stm->execute ($values)) { - return $this->bd->lastInsertId(); + if ($stm && $stm->execute($values)) { + return $this->bd->lastInsertId('"' . $this->prefix . 'category_id_seq"'); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error addCategory: ' . $info[2]); return false; } } - public function updateCategory ($id, $valuesTmp) { + public function addCategoryObject($category) { + $cat = $this->searchByName($category->name()); + if (!$cat) { + // Category does not exist yet in DB so we add it before continue + $values = array( + 'name' => $category->name(), + ); + return $this->addCategory($values); + } + + return $cat->id(); + } + + public function updateCategory($id, $valuesTmp) { $sql = 'UPDATE `' . $this->prefix . 'category` SET name=? WHERE id=?'; - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); - $values = array ( + $values = array( $valuesTmp['name'], $id ); - if ($stm && $stm->execute ($values)) { + if ($stm && $stm->execute($values)) { return $stm->rowCount(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error updateCategory: ' . $info[2]); return false; } } - public function deleteCategory ($id) { + public function deleteCategory($id) { + if ($id <= self::defaultCategoryId) { + return false; + } $sql = 'DELETE FROM `' . $this->prefix . 'category` WHERE id=?'; - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); - $values = array ($id); + $values = array($id); - if ($stm && $stm->execute ($values)) { + if ($stm && $stm->execute($values)) { return $stm->rowCount(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error deleteCategory: ' . $info[2]); return false; } } - public function searchById ($id) { + public function searchById($id) { $sql = 'SELECT * FROM `' . $this->prefix . 'category` WHERE id=?'; - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); - $values = array ($id); + $values = array($id); - $stm->execute ($values); - $res = $stm->fetchAll (PDO::FETCH_ASSOC); - $cat = self::daoToCategory ($res); + $stm->execute($values); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); + $cat = self::daoToCategory($res); - if (isset ($cat[0])) { + if (isset($cat[0])) { return $cat[0]; } else { - return false; + return null; } } - public function searchByName ($name) { + public function searchByName($name) { $sql = 'SELECT * FROM `' . $this->prefix . 'category` WHERE name=?'; - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); - $values = array ($name); + $values = array($name); - $stm->execute ($values); - $res = $stm->fetchAll (PDO::FETCH_ASSOC); - $cat = self::daoToCategory ($res); + $stm->execute($values); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); + $cat = self::daoToCategory($res); - if (isset ($cat[0])) { + if (isset($cat[0])) { return $cat[0]; } else { - return false; + return null; } } - public function listCategories ($prePopulateFeeds = true, $details = false) { + 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` ') . 'FROM `' . $this->prefix . 'category` c ' - . 'LEFT OUTER JOIN `' . $this->prefix . 'feed` f ON f.category = c.id ' - . 'GROUP BY f.id ' + . 'LEFT OUTER JOIN `' . $this->prefix . 'feed` f ON f.category=c.id ' + . 'GROUP BY f.id, c_id ' . 'ORDER BY c.name, f.name'; - $stm = $this->bd->prepare ($sql); - $stm->execute (); - return self::daoToCategoryPrepopulated ($stm->fetchAll (PDO::FETCH_ASSOC)); + $stm = $this->bd->prepare($sql); + $stm->execute(); + return self::daoToCategoryPrepopulated($stm->fetchAll(PDO::FETCH_ASSOC)); } else { $sql = 'SELECT * FROM `' . $this->prefix . 'category` ORDER BY name'; - $stm = $this->bd->prepare ($sql); - $stm->execute (); - return self::daoToCategory ($stm->fetchAll (PDO::FETCH_ASSOC)); + $stm = $this->bd->prepare($sql); + $stm->execute(); + return self::daoToCategory($stm->fetchAll(PDO::FETCH_ASSOC)); } } - public function getDefault () { - $sql = 'SELECT * FROM `' . $this->prefix . 'category` WHERE id=1'; - $stm = $this->bd->prepare ($sql); + public function getDefault() { + $sql = 'SELECT * FROM `' . $this->prefix . 'category` WHERE id=' . self::defaultCategoryId; + $stm = $this->bd->prepare($sql); - $stm->execute (); - $res = $stm->fetchAll (PDO::FETCH_ASSOC); - $cat = self::daoToCategory ($res); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); + $cat = self::daoToCategory($res); - if (isset ($cat[0])) { + if (isset($cat[0])) { return $cat[0]; } else { return false; } } - public function checkDefault () { - $def_cat = $this->searchById (1); + public function checkDefault() { + $def_cat = $this->searchById(self::defaultCategoryId); - if ($def_cat === false) { - $cat = new FreshRSS_Category (Minz_Translate::t ('default_category')); - $cat->_id (1); + if ($def_cat == null) { + $cat = new FreshRSS_Category(_t('gen.short.default_category')); + $cat->_id(self::defaultCategoryId); - $values = array ( - 'id' => $cat->id (), - 'name' => $cat->name (), + $values = array( + 'id' => $cat->id(), + 'name' => $cat->name(), ); - $this->addCategory ($values); + $this->addCategory($values); } } - public function count () { + public function count() { $sql = 'SELECT COUNT(*) AS count FROM `' . $this->prefix . 'category`'; - $stm = $this->bd->prepare ($sql); - $stm->execute (); - $res = $stm->fetchAll (PDO::FETCH_ASSOC); + $stm = $this->bd->prepare($sql); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); return $res[0]['count']; } - public function countFeed ($id) { + public function countFeed($id) { $sql = 'SELECT COUNT(*) AS count FROM `' . $this->prefix . 'feed` WHERE category=?'; - $stm = $this->bd->prepare ($sql); - $values = array ($id); - $stm->execute ($values); - $res = $stm->fetchAll (PDO::FETCH_ASSOC); + $stm = $this->bd->prepare($sql); + $values = array($id); + $stm->execute($values); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); return $res[0]['count']; } - public function countNotRead ($id) { - $sql = 'SELECT COUNT(*) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id WHERE category=? AND e.is_read=0'; - $stm = $this->bd->prepare ($sql); - $values = array ($id); - $stm->execute ($values); - $res = $stm->fetchAll (PDO::FETCH_ASSOC); + public function countNotRead($id) { + $sql = 'SELECT COUNT(*) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id WHERE category=? AND e.is_read=0'; + $stm = $this->bd->prepare($sql); + $values = array($id); + $stm->execute($values); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); return $res[0]['count']; } public static function findFeed($categories, $feed_id) { foreach ($categories as $category) { - foreach ($category->feeds () as $feed) { - if ($feed->id () === $feed_id) { + foreach ($category->feeds() as $feed) { + if ($feed->id() === $feed_id) { return $feed; } } @@ -176,8 +195,8 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo { public static function CountUnreads($categories, $minPriority = 0) { $n = 0; foreach ($categories as $category) { - foreach ($category->feeds () as $feed) { - if ($feed->priority () >= $minPriority) { + foreach ($category->feeds() as $feed) { + if ($feed->priority() >= $minPriority) { $n += $feed->nbNotRead(); } } @@ -185,23 +204,24 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo { return $n; } - public static function daoToCategoryPrepopulated ($listDAO) { - $list = array (); + public static function daoToCategoryPrepopulated($listDAO) { + $list = array(); - if (!is_array ($listDAO)) { - $listDAO = array ($listDAO); + if (!is_array($listDAO)) { + $listDAO = array($listDAO); } $previousLine = null; $feedsDao = array(); + $feedDao = FreshRSS_Factory::createFeedDAO(); foreach ($listDAO as $line) { if ($previousLine['c_id'] != null && $line['c_id'] !== $previousLine['c_id']) { // End of the current category, we add it to the $list - $cat = new FreshRSS_Category ( + $cat = new FreshRSS_Category( $previousLine['c_name'], - FreshRSS_FeedDAO::daoToFeed ($feedsDao, $previousLine['c_id']) + $feedDao->daoToFeed($feedsDao, $previousLine['c_id']) ); - $cat->_id ($previousLine['c_id']); + $cat->_id($previousLine['c_id']); $list[$previousLine['c_id']] = $cat; $feedsDao = array(); //Prepare for next category @@ -213,29 +233,29 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo { // add the last category if ($previousLine != null) { - $cat = new FreshRSS_Category ( + $cat = new FreshRSS_Category( $previousLine['c_name'], - FreshRSS_FeedDAO::daoToFeed ($feedsDao, $previousLine['c_id']) + $feedDao->daoToFeed($feedsDao, $previousLine['c_id']) ); - $cat->_id ($previousLine['c_id']); + $cat->_id($previousLine['c_id']); $list[$previousLine['c_id']] = $cat; } return $list; } - public static function daoToCategory ($listDAO) { - $list = array (); + public static function daoToCategory($listDAO) { + $list = array(); - if (!is_array ($listDAO)) { - $listDAO = array ($listDAO); + if (!is_array($listDAO)) { + $listDAO = array($listDAO); } foreach ($listDAO as $key => $dao) { - $cat = new FreshRSS_Category ( + $cat = new FreshRSS_Category( $dao['name'] ); - $cat->_id ($dao['id']); + $cat->_id($dao['id']); $list[$key] = $cat; } diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php deleted file mode 100644 index 2b719c370..000000000 --- a/app/Models/Configuration.php +++ /dev/null @@ -1,249 +0,0 @@ -<?php - -class FreshRSS_Configuration { - private $filename; - - private $data = array( - 'language' => 'en', - 'old_entries' => 3, - 'keep_history_default' => 0, - 'mail_login' => '', - 'token' => '', - 'passwordHash' => '', //CRYPT_BLOWFISH - 'posts_per_page' => 20, - 'view_mode' => 'normal', - 'default_view' => 'not_read', - 'auto_load_more' => true, - 'display_posts' => false, - 'onread_jump_next' => true, - 'lazyload' => true, - 'sort_order' => 'DESC', - 'anon_access' => false, - 'mark_when' => array( - 'article' => true, - 'site' => true, - 'scroll' => false, - 'reception' => false, - ), - 'theme' => 'Origine', - 'shortcuts' => array( - 'mark_read' => 'r', - 'mark_favorite' => 'f', - 'go_website' => 'space', - 'next_entry' => 'j', - 'prev_entry' => 'k', - 'first_entry' => 'home', - 'last_entry' => 'end', - 'collapse_entry' => 'c', - 'load_more' => 'm', - 'auto_share' => 's', - ), - 'topline_read' => true, - 'topline_favorite' => true, - 'topline_date' => true, - 'topline_link' => true, - 'bottomline_read' => true, - 'bottomline_favorite' => true, - 'bottomline_sharing' => true, - 'bottomline_tags' => true, - 'bottomline_date' => true, - 'bottomline_link' => true, - 'sharing' => array( - 'shaarli' => '', - 'wallabag' => '', - 'diaspora' => '', - 'twitter' => true, - 'g+' => true, - 'facebook' => true, - 'email' => true, - 'print' => true, - ), - ); - - private $available_languages = array( - 'en' => 'English', - 'fr' => 'Français', - ); - - public function __construct ($user) { - $this->filename = DATA_PATH . '/' . $user . '_user.php'; - - $data = @include($this->filename); - if (!is_array($data)) { - throw new Minz_PermissionDeniedException($this->filename); - } - - foreach ($data as $key => $value) { - if (isset($this->data[$key])) { - $function = '_' . $key; - $this->$function($value); - } - } - $this->data['user'] = $user; - } - - public function save() { - @rename($this->filename, $this->filename . '.bak.php'); - if (file_put_contents($this->filename, "<?php\n return " . var_export($this->data, true) . ';', LOCK_EX) === false) { - throw new Minz_PermissionDeniedException($this->filename); - } - if (function_exists('opcache_invalidate')) { - opcache_invalidate($this->filename); //Clear PHP 5.5+ cache for include - } - invalidateHttpCache(); - return true; - } - - public function __get($name) { - if (array_key_exists($name, $this->data)) { - return $this->data[$name]; - } else { - $trace = debug_backtrace(); - trigger_error('Undefined FreshRSS_Configuration->' . $name . 'in ' . $trace[0]['file'] . ' line ' . $trace[0]['line'], E_USER_NOTICE); //TODO: Use Minz exceptions - return null; - } - } - - public function sharing($key = false) { - if ($key === false) { - return $this->data['sharing']; - } - if (isset($this->data['sharing'][$key])) { - return $this->data['sharing'][$key]; - } - return false; - } - - public function availableLanguages() { - return $this->available_languages; - } - - public function _language($value) { - if (!isset($this->available_languages[$value])) { - $value = 'en'; - } - $this->data['language'] = $value; - } - public function _posts_per_page ($value) { - $value = intval($value); - $this->data['posts_per_page'] = $value > 0 ? $value : 10; - } - public function _view_mode ($value) { - if ($value === 'global' || $value === 'reader') { - $this->data['view_mode'] = $value; - } else { - $this->data['view_mode'] = 'normal'; - } - } - public function _default_view ($value) { - $this->data['default_view'] = $value === 'all' ? 'all' : 'not_read'; - } - public function _display_posts ($value) { - $this->data['display_posts'] = ((bool)$value) && $value !== 'no'; - } - public function _onread_jump_next ($value) { - $this->data['onread_jump_next'] = ((bool)$value) && $value !== 'no'; - } - public function _lazyload ($value) { - $this->data['lazyload'] = ((bool)$value) && $value !== 'no'; - } - public function _sort_order ($value) { - $this->data['sort_order'] = $value === 'ASC' ? 'ASC' : 'DESC'; - } - public function _old_entries($value) { - $value = intval($value); - $this->data['old_entries'] = $value > 0 ? $value : 3; - } - public function _keep_history_default($value) { - $value = intval($value); - $this->data['keep_history_default'] = $value >= -1 ? $value : 0; - } - public function _shortcuts ($values) { - foreach ($values as $key => $value) { - if (isset($this->data['shortcuts'][$key])) { - $this->data['shortcuts'][$key] = $value; - } - } - } - public function _passwordHash ($value) { - $this->data['passwordHash'] = ctype_graph($value) && (strlen($value) >= 60) ? $value : ''; - } - public function _mail_login ($value) { - $value = filter_var($value, FILTER_VALIDATE_EMAIL); - if ($value) { - $this->data['mail_login'] = $value; - } else { - $this->data['mail_login'] = ''; - } - } - public function _anon_access ($value) { - $this->data['anon_access'] = ((bool)$value) && $value !== 'no'; - } - public function _mark_when ($values) { - foreach ($values as $key => $value) { - if (isset($this->data['mark_when'][$key])) { - $this->data['mark_when'][$key] = ((bool)$value) && $value !== 'no'; - } - } - } - public function _sharing ($values) { - $are_url = array ('shaarli', 'wallabag', 'diaspora'); - foreach ($values as $key => $value) { - if (in_array($key, $are_url)) { - $is_url = ( - filter_var ($value, FILTER_VALIDATE_URL) || - (version_compare(PHP_VERSION, '5.3.3', '<') && - (strpos($value, '-') > 0) && - ($value === filter_var($value, FILTER_SANITIZE_URL))) - ); //PHP bug #51192 - - if (!$is_url) { - $value = ''; - } - } elseif (!is_bool($value)) { - $value = true; - } - - $this->data['sharing'][$key] = $value; - } - } - public function _theme($value) { - $this->data['theme'] = $value; - } - public function _token($value) { - $this->data['token'] = $value; - } - public function _auto_load_more($value) { - $this->data['auto_load_more'] = ((bool)$value) && $value !== 'no'; - } - public function _topline_read($value) { - $this->data['topline_read'] = ((bool)$value) && $value !== 'no'; - } - public function _topline_favorite($value) { - $this->data['topline_favorite'] = ((bool)$value) && $value !== 'no'; - } - public function _topline_date($value) { - $this->data['topline_date'] = ((bool)$value) && $value !== 'no'; - } - public function _topline_link($value) { - $this->data['topline_link'] = ((bool)$value) && $value !== 'no'; - } - public function _bottomline_read($value) { - $this->data['bottomline_read'] = ((bool)$value) && $value !== 'no'; - } - public function _bottomline_favorite($value) { - $this->data['bottomline_favorite'] = ((bool)$value) && $value !== 'no'; - } - public function _bottomline_sharing($value) { - $this->data['bottomline_sharing'] = ((bool)$value) && $value !== 'no'; - } - public function _bottomline_tags($value) { - $this->data['bottomline_tags'] = ((bool)$value) && $value !== 'no'; - } - public function _bottomline_date($value) { - $this->data['bottomline_date'] = ((bool)$value) && $value !== 'no'; - } - public function _bottomline_link($value) { - $this->data['bottomline_link'] = ((bool)$value) && $value !== 'no'; - } -} diff --git a/app/Models/ConfigurationSetter.php b/app/Models/ConfigurationSetter.php new file mode 100644 index 000000000..046f54955 --- /dev/null +++ b/app/Models/ConfigurationSetter.php @@ -0,0 +1,380 @@ +<?php + +class FreshRSS_ConfigurationSetter { + /** + * Return if the given key is supported by this setter. + * @param $key the key to test. + * @return true if the key is supported, false else. + */ + public function support($key) { + $name_setter = '_' . $key; + return is_callable(array($this, $name_setter)); + } + + /** + * Set the given key in data with the current value. + * @param $data an array containing the list of all configuration data. + * @param $key the key to update. + * @param $value the value to set. + */ + public function handle(&$data, $key, $value) { + $name_setter = '_' . $key; + call_user_func_array(array($this, $name_setter), array(&$data, $value)); + } + + /** + * A helper to set boolean values. + * + * @param $value the tested value. + * @return true if value is true and different from no, false else. + */ + private function handleBool($value) { + return ((bool)$value) && $value !== 'no'; + } + + /** + * The (long) list of setters for user configuration. + */ + private function _apiPasswordHash(&$data, $value) { + $data['apiPasswordHash'] = ctype_graph($value) && (strlen($value) >= 60) ? $value : ''; + } + + private function _content_width(&$data, $value) { + $value = strtolower($value); + if (!in_array($value, array('thin', 'medium', 'large', 'no_limit'))) { + $value = 'thin'; + } + + $data['content_width'] = $value; + } + + private function _default_state(&$data, $value) { + $data['default_state'] = (int)$value; + } + + private function _default_view(&$data, $value) { + switch ($value) { + case 'all': + $data['default_view'] = $value; + $data['default_state'] = (FreshRSS_Entry::STATE_READ + + FreshRSS_Entry::STATE_NOT_READ); + break; + case 'adaptive': + case 'unread': + default: + $data['default_view'] = $value; + $data['default_state'] = FreshRSS_Entry::STATE_NOT_READ; + } + } + + // It works for system config too! + private function _extensions_enabled(&$data, $value) { + if (!is_array($value)) { + $value = array($value); + } + $data['extensions_enabled'] = $value; + } + + private function _html5_notif_timeout(&$data, $value) { + $value = intval($value); + $data['html5_notif_timeout'] = $value >= 0 ? $value : 0; + } + + private function _keep_history_default(&$data, $value) { + $value = intval($value); + $data['keep_history_default'] = $value >= -1 ? $value : 0; + } + + // It works for system config too! + private function _language(&$data, $value) { + $value = strtolower($value); + $languages = Minz_Translate::availableLanguages(); + if (!in_array($value, $languages)) { + $value = 'en'; + } + $data['language'] = $value; + } + + private function _old_entries(&$data, $value) { + $value = intval($value); + $data['old_entries'] = $value > 0 ? $value : 3; + } + + private function _passwordHash(&$data, $value) { + $data['passwordHash'] = ctype_graph($value) && (strlen($value) >= 60) ? $value : ''; + } + + private function _posts_per_page(&$data, $value) { + $value = intval($value); + $data['posts_per_page'] = $value > 0 ? $value : 10; + } + + private function _queries(&$data, $values) { + $data['queries'] = array(); + foreach ($values as $value) { + if ($value instanceof FreshRSS_UserQuery) { + $data['queries'][] = $value->toArray(); + } elseif (is_array($value)) { + $data['queries'][] = $value; + } + } + } + + private function _sharing(&$data, $values) { + $data['sharing'] = array(); + foreach ($values as $value) { + if (!is_array($value)) { + continue; + } + + // Verify URL and add default value when needed + if (isset($value['url'])) { + $is_url = filter_var($value['url'], FILTER_VALIDATE_URL); + if (!$is_url) { + continue; + } + } else { + $value['url'] = null; + } + + $data['sharing'][] = $value; + } + } + + private function _shortcuts(&$data, $values) { + if (!is_array($values)) { + return; + } + + $data['shortcuts'] = $values; + } + + private function _sort_order(&$data, $value) { + $data['sort_order'] = $value === 'ASC' ? 'ASC' : 'DESC'; + } + + private function _ttl_default(&$data, $value) { + $value = intval($value); + $data['ttl_default'] = $value >= -1 ? $value : 3600; + } + + private function _view_mode(&$data, $value) { + $value = strtolower($value); + if (!in_array($value, array('global', 'normal', 'reader'))) { + $value = 'normal'; + } + $data['view_mode'] = $value; + } + + /** + * A list of boolean setters. + */ + private function _anon_access(&$data, $value) { + $data['anon_access'] = $this->handleBool($value); + } + + private function _auto_load_more(&$data, $value) { + $data['auto_load_more'] = $this->handleBool($value); + } + + private function _auto_remove_article(&$data, $value) { + $data['auto_remove_article'] = $this->handleBool($value); + } + + private function _mark_updated_article_unread(&$data, $value) { + $data['mark_updated_article_unread'] = $this->handleBool($value); + } + + private function _display_categories(&$data, $value) { + $data['display_categories'] = $this->handleBool($value); + } + + private function _display_posts(&$data, $value) { + $data['display_posts'] = $this->handleBool($value); + } + + private function _hide_read_feeds(&$data, $value) { + $data['hide_read_feeds'] = $this->handleBool($value); + } + + private function _lazyload(&$data, $value) { + $data['lazyload'] = $this->handleBool($value); + } + + private function _mark_when(&$data, $values) { + foreach ($values as $key => $value) { + $data['mark_when'][$key] = $this->handleBool($value); + } + } + + private function _onread_jump_next(&$data, $value) { + $data['onread_jump_next'] = $this->handleBool($value); + } + + private function _reading_confirm(&$data, $value) { + $data['reading_confirm'] = $this->handleBool($value); + } + + private function _sticky_post(&$data, $value) { + $data['sticky_post'] = $this->handleBool($value); + } + + private function _bottomline_date(&$data, $value) { + $data['bottomline_date'] = $this->handleBool($value); + } + private function _bottomline_favorite(&$data, $value) { + $data['bottomline_favorite'] = $this->handleBool($value); + } + private function _bottomline_link(&$data, $value) { + $data['bottomline_link'] = $this->handleBool($value); + } + private function _bottomline_read(&$data, $value) { + $data['bottomline_read'] = $this->handleBool($value); + } + private function _bottomline_sharing(&$data, $value) { + $data['bottomline_sharing'] = $this->handleBool($value); + } + private function _bottomline_tags(&$data, $value) { + $data['bottomline_tags'] = $this->handleBool($value); + } + + private function _topline_date(&$data, $value) { + $data['topline_date'] = $this->handleBool($value); + } + private function _topline_favorite(&$data, $value) { + $data['topline_favorite'] = $this->handleBool($value); + } + private function _topline_link(&$data, $value) { + $data['topline_link'] = $this->handleBool($value); + } + private function _topline_read(&$data, $value) { + $data['topline_read'] = $this->handleBool($value); + } + + /** + * The (not so long) list of setters for system configuration. + */ + private function _allow_anonymous(&$data, $value) { + $data['allow_anonymous'] = $this->handleBool($value) && FreshRSS_Auth::accessNeedsAction(); + } + + private function _allow_anonymous_refresh(&$data, $value) { + $data['allow_anonymous_refresh'] = $this->handleBool($value) && $data['allow_anonymous']; + } + + private function _api_enabled(&$data, $value) { + $data['api_enabled'] = $this->handleBool($value); + } + + private function _auth_type(&$data, $value) { + $value = strtolower($value); + if (!in_array($value, array('form', 'http_auth', 'none'))) { + $value = 'none'; + } + $data['auth_type'] = $value; + $this->_allow_anonymous($data, $data['allow_anonymous']); + } + + private function _db(&$data, $value) { + if (!isset($value['type'])) { + return; + } + + switch ($value['type']) { + case 'mysql': + case 'pgsql': + if (empty($value['host']) || + empty($value['user']) || + empty($value['base']) || + !isset($value['password'])) { + return; + } + + $data['db']['type'] = $value['type']; + $data['db']['host'] = $value['host']; + $data['db']['user'] = $value['user']; + $data['db']['base'] = $value['base']; + $data['db']['password'] = $value['password']; + $data['db']['prefix'] = isset($value['prefix']) ? $value['prefix'] : ''; + break; + case 'sqlite': + $data['db']['type'] = $value['type']; + $data['db']['host'] = ''; + $data['db']['user'] = ''; + $data['db']['base'] = ''; + $data['db']['password'] = ''; + $data['db']['prefix'] = ''; + break; + default: + return; + } + } + + private function _default_user(&$data, $value) { + $user_list = listUsers(); + if (in_array($value, $user_list)) { + $data['default_user'] = $value; + } + } + + private function _environment(&$data, $value) { + $value = strtolower($value); + if (!in_array($value, array('silent', 'development', 'production'))) { + $value = 'production'; + } + $data['environment'] = $value; + } + + private function _limits(&$data, $values) { + $max_small_int = 16384; + $limits_keys = array( + 'cache_duration' => array( + 'min' => 0, + ), + 'timeout' => array( + 'min' => 0, + ), + 'max_inactivity' => array( + 'min' => 0, + ), + 'max_feeds' => array( + 'min' => 0, + 'max' => $max_small_int, + ), + 'max_categories' => array( + 'min' => 0, + 'max' => $max_small_int, + ), + 'max_registrations' => array( + 'min' => 0, + ), + ); + + foreach ($values as $key => $value) { + if (!isset($limits_keys[$key])) { + continue; + } + + $value = intval($value); + $limits = $limits_keys[$key]; + if ( + (!isset($limits['min']) || $value >= $limits['min']) && + (!isset($limits['max']) || $value <= $limits['max']) + ) { + $data['limits'][$key] = $value; + } + } + } + + private function _unsafe_autologin_enabled(&$data, $value) { + $data['unsafe_autologin_enabled'] = $this->handleBool($value); + } + + private function _auto_update_url(&$data, $value) { + if (!$value) { + return; + } + + $data['auto_update_url'] = $value; + } +} diff --git a/app/Models/Context.php b/app/Models/Context.php new file mode 100644 index 000000000..fd0e79fc1 --- /dev/null +++ b/app/Models/Context.php @@ -0,0 +1,326 @@ +<?php + +/** + * The context object handles the current configuration file and different + * useful functions associated to the current view state. + */ +class FreshRSS_Context { + public static $user_conf = null; + public static $system_conf = null; + public static $categories = array(); + + public static $name = ''; + public static $description = ''; + + public static $total_unread = 0; + public static $total_starred = array( + 'all' => 0, + 'read' => 0, + 'unread' => 0, + ); + + public static $get_unread = 0; + public static $current_get = array( + 'all' => false, + 'starred' => false, + 'feed' => false, + 'category' => false, + ); + public static $next_get = 'a'; + + public static $state = 0; + public static $order = 'DESC'; + public static $number = 0; + public static $search; + public static $first_id = ''; + public static $next_id = ''; + public static $id_max = ''; + public static $sinceHours = 0; + + public static $isCli = false; + + /** + * Initialize the context. + * + * Set the correct configurations and $categories variables. + */ + public static function init() { + // Init configuration. + self::$system_conf = Minz_Configuration::get('system'); + self::$user_conf = Minz_Configuration::get('user'); + } + + /** + * Returns if the current state includes $state parameter. + */ + public static function isStateEnabled($state) { + return self::$state & $state; + } + + /** + * Returns the current state with or without $state parameter. + */ + public static function getRevertState($state) { + if (self::$state & $state) { + return self::$state & ~$state; + } else { + return self::$state | $state; + } + } + + /** + * Return the current get as a string or an array. + * + * If $array is true, the first item of the returned value is 'f' or 'c' and + * the second is the id. + */ + public static function currentGet($array = false) { + if (self::$current_get['all']) { + return 'a'; + } elseif (self::$current_get['starred']) { + return 's'; + } elseif (self::$current_get['feed']) { + if ($array) { + return array('f', self::$current_get['feed']); + } else { + return 'f_' . self::$current_get['feed']; + } + } elseif (self::$current_get['category']) { + if ($array) { + return array('c', self::$current_get['category']); + } else { + return 'c_' . self::$current_get['category']; + } + } + } + + /** + * Return true if the current request targets a feed (and not a category or all articles), false otherwise. + */ + public static function isFeed() { + return self::$current_get['feed'] != false; + } + + /** + * Return true if $get parameter correspond to the $current_get attribute. + */ + public static function isCurrentGet($get) { + $type = $get[0]; + $id = substr($get, 2); + + switch($type) { + case 'a': + return self::$current_get['all']; + case 's': + return self::$current_get['starred']; + case 'f': + return self::$current_get['feed'] == $id; + case 'c': + return self::$current_get['category'] == $id; + default: + return false; + } + } + + /** + * Set the current $get attribute. + * + * Valid $get parameter are: + * - a + * - s + * - f_<feed id> + * - c_<category id> + * + * $name and $get_unread attributes are also updated as $next_get + * Raise an exception if id or $get is invalid. + */ + public static function _get($get) { + $type = $get[0]; + $id = substr($get, 2); + $nb_unread = 0; + + if (empty(self::$categories)) { + $catDAO = new FreshRSS_CategoryDAO(); + self::$categories = $catDAO->listCategories(); + } + + switch($type) { + case 'a': + self::$current_get['all'] = true; + self::$name = _t('index.feed.title'); + self::$description = self::$system_conf->meta_description; + self::$get_unread = self::$total_unread; + break; + case 's': + self::$current_get['starred'] = true; + self::$name = _t('index.feed.title_fav'); + self::$description = self::$system_conf->meta_description; + self::$get_unread = self::$total_starred['unread']; + + // Update state if favorite is not yet enabled. + self::$state = self::$state | FreshRSS_Entry::STATE_FAVORITE; + break; + case 'f': + // We try to find the corresponding feed. When allowing robots, always retrieve the full feed including description + $feed = FreshRSS_Context::$system_conf->allow_robots ? null : FreshRSS_CategoryDAO::findFeed(self::$categories, $id); + if ($feed === null) { + $feedDAO = FreshRSS_Factory::createFeedDao(); + $feed = $feedDAO->searchById($id); + + if (!$feed) { + throw new FreshRSS_Context_Exception('Invalid feed: ' . $id); + } + } + + self::$current_get['feed'] = $id; + self::$current_get['category'] = $feed->category(); + self::$name = $feed->name(); + self::$description = $feed->description(); + self::$get_unread = $feed->nbNotRead(); + break; + case 'c': + // We try to find the corresponding category. + self::$current_get['category'] = $id; + if (!isset(self::$categories[$id])) { + $catDAO = new FreshRSS_CategoryDAO(); + $cat = $catDAO->searchById($id); + + if (!$cat) { + throw new FreshRSS_Context_Exception('Invalid category: ' . $id); + } + } else { + $cat = self::$categories[$id]; + } + + self::$name = $cat->name(); + self::$get_unread = $cat->nbNotRead(); + break; + default: + throw new FreshRSS_Context_Exception('Invalid getter: ' . $get); + } + + self::_nextGet(); + } + + /** + * Set the value of $next_get attribute. + */ + private static function _nextGet() { + $get = self::currentGet(); + // By default, $next_get == $get + self::$next_get = $get; + + if (empty(self::$categories)) { + $catDAO = new FreshRSS_CategoryDAO(); + self::$categories = $catDAO->listCategories(); + } + + if (self::$user_conf->onread_jump_next && strlen($get) > 2) { + $another_unread_id = ''; + $found_current_get = false; + switch ($get[0]) { + case 'f': + // We search the next feed with at least one unread article in + // same category as the currend feed. + foreach (self::$categories as $cat) { + if ($cat->id() != self::$current_get['category']) { + // We look into the category of the current feed! + continue; + } + + foreach ($cat->feeds() as $feed) { + if ($feed->id() == self::$current_get['feed']) { + // Here is our current feed! Fine, the next one will + // be a potential candidate. + $found_current_get = true; + continue; + } + + if ($feed->nbNotRead() > 0) { + $another_unread_id = $feed->id(); + if ($found_current_get) { + // We have found our current feed and now we + // have an feed with unread articles. Leave the + // loop! + break; + } + } + } + break; + } + + // If no feed have been found, next_get is the current category. + self::$next_get = empty($another_unread_id) ? + 'c_' . self::$current_get['category'] : + 'f_' . $another_unread_id; + break; + case 'c': + // We search the next category with at least one unread article. + foreach (self::$categories as $cat) { + if ($cat->id() == self::$current_get['category']) { + // Here is our current category! Next one could be our + // champion if it has unread articles. + $found_current_get = true; + continue; + } + + if ($cat->nbNotRead() > 0) { + $another_unread_id = $cat->id(); + if ($found_current_get) { + // Unread articles and the current category has + // already been found? Leave the loop! + break; + } + } + } + + // No unread category? The main stream will be our destination! + self::$next_get = empty($another_unread_id) ? + 'a' : + 'c_' . $another_unread_id; + break; + } + } + } + + /** + * Determine if the auto remove is available in the current context. + * This feature is available if: + * - it is activated in the configuration + * - the "read" state is not enable + * - the "unread" state is enable + * + * @return boolean + */ + public static function isAutoRemoveAvailable() { + if (!self::$user_conf->auto_remove_article) { + return false; + } + if (self::isStateEnabled(FreshRSS_Entry::STATE_READ)) { + return false; + } + if (!self::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ)) { + return false; + } + return true; + } + + /** + * Determine if the "sticky post" option is enabled. It can be enable + * by the user when it is selected in the configuration page or by the + * application when the context allows to auto-remove articles when they + * are read. + * + * @return boolean + */ + public static function isStickyPostEnabled() { + if (self::$user_conf->sticky_post) { + return true; + } + if (self::isAutoRemoveAvailable()) { + return true; + } + return false; + } + +} diff --git a/app/Models/DatabaseDAO.php b/app/Models/DatabaseDAO.php new file mode 100644 index 000000000..0d85718e3 --- /dev/null +++ b/app/Models/DatabaseDAO.php @@ -0,0 +1,83 @@ +<?php + +/** + * This class is used to test database is well-constructed. + */ +class FreshRSS_DatabaseDAO extends Minz_ModelPdo { + public function tablesAreCorrect() { + $sql = 'SHOW TABLES'; + $stm = $this->bd->prepare($sql); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); + + $tables = array( + $this->prefix . 'category' => false, + $this->prefix . 'feed' => false, + $this->prefix . 'entry' => false, + ); + foreach ($res as $value) { + $tables[array_pop($value)] = true; + } + + return count(array_keys($tables, true, true)) == count($tables); + } + + public function getSchema($table) { + $sql = 'DESC ' . $this->prefix . $table; + $stm = $this->bd->prepare($sql); + $stm->execute(); + + return $this->listDaoToSchema($stm->fetchAll(PDO::FETCH_ASSOC)); + } + + public function checkTable($table, $schema) { + $columns = $this->getSchema($table); + + $ok = (count($columns) == count($schema)); + foreach ($columns as $c) { + $ok &= in_array($c['name'], $schema); + } + + return $ok; + } + + public function categoryIsCorrect() { + return $this->checkTable('category', array( + 'id', 'name' + )); + } + + public function feedIsCorrect() { + return $this->checkTable('feed', array( + 'id', 'url', 'category', 'name', 'website', 'description', 'lastUpdate', + 'priority', 'pathEntries', 'httpAuth', 'error', 'keep_history', 'ttl', + 'cache_nbEntries', 'cache_nbUnreads' + )); + } + + public function entryIsCorrect() { + return $this->checkTable('entry', array( + 'id', 'guid', 'title', 'author', 'content_bin', 'link', 'date', 'is_read', + 'is_favorite', 'id_feed', 'tags' + )); + } + + public function daoToSchema($dao) { + return array( + 'name' => $dao['Field'], + 'type' => strtolower($dao['Type']), + 'notnull' => (bool)$dao['Null'], + 'default' => $dao['Default'], + ); + } + + public function listDaoToSchema($listDAO) { + $list = array(); + + foreach ($listDAO as $dao) { + $list[] = $this->daoToSchema($dao); + } + + return $list; + } +} diff --git a/app/Models/DatabaseDAOPGSQL.php b/app/Models/DatabaseDAOPGSQL.php new file mode 100644 index 000000000..a4edaa448 --- /dev/null +++ b/app/Models/DatabaseDAOPGSQL.php @@ -0,0 +1,43 @@ +<?php + +/** + * This class is used to test database is well-constructed. + */ +class FreshRSS_DatabaseDAOPGSQL extends FreshRSS_DatabaseDAO { + public function tablesAreCorrect() { + $db = FreshRSS_Context::$system_conf->db; + $dbowner = $db['user']; + $sql = 'SELECT * FROM pg_catalog.pg_tables where tableowner=?'; + $stm = $this->bd->prepare($sql); + $values = array($dbowner); + $stm->execute($values); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); + + $tables = array( + $this->prefix . 'category' => false, + $this->prefix . 'feed' => false, + $this->prefix . 'entry' => false, + ); + foreach ($res as $value) { + $tables[array_pop($value)] = true; + } + + return count(array_keys($tables, true, true)) == count($tables); + } + + public function getSchema($table) { + $sql = 'select column_name as field, data_type as type, column_default as default, is_nullable as null from INFORMATION_SCHEMA.COLUMNS where table_name = ?'; + $stm = $this->bd->prepare($sql); + $stm->execute(array($this->prefix . $table)); + return $this->listDaoToSchema($stm->fetchAll(PDO::FETCH_ASSOC)); + } + + public function daoToSchema($dao) { + return array( + 'name' => $dao['field'], + 'type' => strtolower($dao['type']), + 'notnull' => (bool)$dao['null'], + 'default' => $dao['default'], + ); + } +} diff --git a/app/Models/DatabaseDAOSQLite.php b/app/Models/DatabaseDAOSQLite.php new file mode 100644 index 000000000..7f53f967d --- /dev/null +++ b/app/Models/DatabaseDAOSQLite.php @@ -0,0 +1,48 @@ +<?php + +/** + * This class is used to test database is well-constructed (SQLite). + */ +class FreshRSS_DatabaseDAOSQLite extends FreshRSS_DatabaseDAO { + public function tablesAreCorrect() { + $sql = 'SELECT name FROM sqlite_master WHERE type="table"'; + $stm = $this->bd->prepare($sql); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); + + $tables = array( + 'category' => false, + 'feed' => false, + 'entry' => false, + ); + foreach ($res as $value) { + $tables[$value['name']] = true; + } + + return count(array_keys($tables, true, true)) == count($tables); + } + + public function getSchema($table) { + $sql = 'PRAGMA table_info(' . $table . ')'; + $stm = $this->bd->prepare($sql); + $stm->execute(); + + return $this->listDaoToSchema($stm->fetchAll(PDO::FETCH_ASSOC)); + } + + public function entryIsCorrect() { + return $this->checkTable('entry', array( + 'id', 'guid', 'title', 'author', 'content', 'link', 'date', 'is_read', + 'is_favorite', 'id_feed', 'tags' + )); + } + + public function daoToSchema($dao) { + return array( + 'name' => $dao['name'], + 'type' => strtolower($dao['type']), + 'notnull' => $dao['notnull'] === '1' ? true : false, + 'default' => $dao['dflt_value'], + ); + } +} diff --git a/app/Models/Entry.php b/app/Models/Entry.php index a6c67221b..a562a963a 100644 --- a/app/Models/Entry.php +++ b/app/Models/Entry.php @@ -1,6 +1,11 @@ <?php class FreshRSS_Entry extends Minz_Model { + const STATE_READ = 1; + const STATE_NOT_READ = 2; + const STATE_ALL = 3; + const STATE_FAVORITE = 4; + const STATE_NOT_FAVORITE = 8; private $id = 0; private $guid; @@ -9,139 +14,154 @@ class FreshRSS_Entry extends Minz_Model { private $content; private $link; private $date; - private $is_read; + private $hash = null; + private $is_read; //Nullable boolean private $is_favorite; private $feed; private $tags; - public function __construct ($feed = '', $guid = '', $title = '', $author = '', $content = '', - $link = '', $pubdate = 0, $is_read = false, $is_favorite = false, $tags = '') { - $this->_guid ($guid); - $this->_title ($title); - $this->_author ($author); - $this->_content ($content); - $this->_link ($link); - $this->_date ($pubdate); - $this->_isRead ($is_read); - $this->_isFavorite ($is_favorite); - $this->_feed ($feed); - $this->_tags (preg_split('/[\s#]/', $tags)); + public function __construct($feed = '', $guid = '', $title = '', $author = '', $content = '', + $link = '', $pubdate = 0, $is_read = false, $is_favorite = false, $tags = '') { + $this->_guid($guid); + $this->_title($title); + $this->_author($author); + $this->_content($content); + $this->_link($link); + $this->_date($pubdate); + $this->_isRead($is_read); + $this->_isFavorite($is_favorite); + $this->_feed($feed); + $this->_tags(preg_split('/[\s#]/', $tags)); } - public function id () { + public function id() { return $this->id; } - public function guid () { + public function guid() { return $this->guid; } - public function title () { + public function title() { return $this->title; } - public function author () { + public function author() { return $this->author === null ? '' : $this->author; } - public function content () { + public function content() { return $this->content; } - public function link () { + public function link() { return $this->link; } - public function date ($raw = false) { + public function date($raw = false) { if ($raw) { return $this->date; } else { - return timestamptodate ($this->date); + return timestamptodate($this->date); } } - public function dateAdded ($raw = false) { + public function dateAdded($raw = false) { $date = intval(substr($this->id, 0, -6)); if ($raw) { return $date; } else { - return timestamptodate ($date); + return timestamptodate($date); } } - public function isRead () { + public function isRead() { return $this->is_read; } - public function isFavorite () { + public function isFavorite() { return $this->is_favorite; } - public function feed ($object = false) { + public function feed($object = false) { if ($object) { - $feedDAO = new FreshRSS_FeedDAO (); - return $feedDAO->searchById ($this->feed); + $feedDAO = FreshRSS_Factory::createFeedDao(); + return $feedDAO->searchById($this->feed); } else { return $this->feed; } } - public function tags ($inString = false) { + public function tags($inString = false) { if ($inString) { - return empty ($this->tags) ? '' : '#' . implode(' #', $this->tags); + return empty($this->tags) ? '' : '#' . implode(' #', $this->tags); } else { return $this->tags; } } - public function _id ($value) { + public function hash() { + if ($this->hash === null) { + //Do not include $this->date because it may be automatically generated when lacking + $this->hash = md5($this->link . $this->title . $this->author . $this->content . $this->tags(true)); + } + return $this->hash; + } + + public function _id($value) { $this->id = $value; } - public function _guid ($value) { + public function _guid($value) { $this->guid = $value; } - public function _title ($value) { + public function _title($value) { + $this->hash = null; $this->title = $value; } - public function _author ($value) { + public function _author($value) { + $this->hash = null; $this->author = $value; } - public function _content ($value) { + public function _content($value) { + $this->hash = null; $this->content = $value; } - public function _link ($value) { + public function _link($value) { + $this->hash = null; $this->link = $value; } - public function _date ($value) { + public function _date($value) { + $this->hash = null; $value = intval($value); $this->date = $value > 1 ? $value : time(); } - public function _isRead ($value) { - $this->is_read = $value; + public function _isRead($value) { + $this->is_read = $value === null ? null : (bool)$value; } - public function _isFavorite ($value) { + public function _isFavorite($value) { $this->is_favorite = $value; } - public function _feed ($value) { + public function _feed($value) { $this->feed = $value; } - public function _tags ($value) { - if (!is_array ($value)) { - $value = array ($value); + public function _tags($value) { + $this->hash = null; + if (!is_array($value)) { + $value = array($value); } foreach ($value as $key => $t) { if (!$t) { - unset ($value[$key]); + unset($value[$key]); } } $this->tags = $value; } - public function isDay ($day, $today) { + public function isDay($day, $today) { $date = $this->dateAdded(true); switch ($day) { - case FreshRSS_Days::TODAY: - $tomorrow = $today + 86400; - return $date >= $today && $date < $tomorrow; - case FreshRSS_Days::YESTERDAY: - $yesterday = $today - 86400; - return $date >= $yesterday && $date < $today; - case FreshRSS_Days::BEFORE_YESTERDAY: - $yesterday = $today - 86400; - return $date < $yesterday; - default: - return false; + case FreshRSS_Days::TODAY: + $tomorrow = $today + 86400; + return $date >= $today && $date < $tomorrow; + case FreshRSS_Days::YESTERDAY: + $yesterday = $today - 86400; + return $date >= $yesterday && $date < $today; + case FreshRSS_Days::BEFORE_YESTERDAY: + $yesterday = $today - 86400; + return $date < $yesterday; + default: + return false; } } @@ -149,10 +169,10 @@ class FreshRSS_Entry extends Minz_Model { // Gestion du contenu // On cherche à récupérer les articles en entier... même si le flux ne le propose pas if ($pathEntries) { - $entryDAO = new FreshRSS_EntryDAO(); + $entryDAO = FreshRSS_Factory::createEntryDao(); $entry = $entryDAO->searchByGuid($this->feed, $this->guid); - if($entry) { + if ($entry) { // l'article existe déjà en BDD, en se contente de recharger ce contenu $this->content = $entry->content(); } else { @@ -162,25 +182,26 @@ class FreshRSS_Entry extends Minz_Model { htmlspecialchars_decode($this->link(), ENT_QUOTES), $pathEntries ); } catch (Exception $e) { - // rien à faire, on garde l'ancien contenu (requête a échoué) + // rien à faire, on garde l'ancien contenu(requête a échoué) } } } } - public function toArray () { - return array ( - 'id' => $this->id (), - 'guid' => $this->guid (), - 'title' => $this->title (), - 'author' => $this->author (), - 'content' => $this->content (), - 'link' => $this->link (), - 'date' => $this->date (true), - 'is_read' => $this->isRead (), - 'is_favorite' => $this->isFavorite (), - 'id_feed' => $this->feed (), - 'tags' => $this->tags (true), + public function toArray() { + return array( + 'id' => $this->id(), + 'guid' => $this->guid(), + 'title' => $this->title(), + 'author' => $this->author(), + 'content' => $this->content(), + 'link' => $this->link(), + 'date' => $this->date(true), + 'hash' => $this->hash(), + 'is_read' => $this->isRead(), + 'is_favorite' => $this->isFavorite(), + 'id_feed' => $this->feed(), + 'tags' => $this->tags(true), ); } } diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index aaf4dcf6a..397471baa 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -1,453 +1,821 @@ <?php -class FreshRSS_EntryDAO extends Minz_ModelPdo { - public function addEntry ($valuesTmp) { - $sql = 'INSERT INTO `' . $this->prefix . 'entry`(id, guid, title, author, content_bin, link, date, is_read, is_favorite, id_feed, tags) ' - . 'VALUES(?, ?, ?, ?, COMPRESS(?), ?, ?, ?, ?, ?, ?)'; - $stm = $this->bd->prepare ($sql); - - $values = array ( - $valuesTmp['id'], - substr($valuesTmp['guid'], 0, 760), - substr($valuesTmp['title'], 0, 255), - substr($valuesTmp['author'], 0, 255), - $valuesTmp['content'], - substr($valuesTmp['link'], 0, 1023), - $valuesTmp['date'], - $valuesTmp['is_read'] ? 1 : 0, - $valuesTmp['is_favorite'] ? 1 : 0, - $valuesTmp['id_feed'], - substr($valuesTmp['tags'], 0, 1023), - ); +class FreshRSS_EntryDAO extends Minz_ModelPdo implements FreshRSS_Searchable { + + public function isCompressed() { + return parent::$sharedDbType === 'mysql'; + } + + public function hasNativeHex() { + return parent::$sharedDbType !== 'sqlite'; + } + + public function sqlHexDecode($x) { + return 'unhex(' . $x . ')'; + } + + public function sqlHexEncode($x) { + return 'hex(' . $x . ')'; + } + + protected function addColumn($name) { + Minz_Log::warning('FreshRSS_EntryDAO::addColumn: ' . $name); + $hasTransaction = false; + try { + $stm = null; + if ($name === 'lastSeen') { //v1.1.1 + if (!$this->bd->inTransaction()) { + $this->bd->beginTransaction(); + $hasTransaction = true; + } + $stm = $this->bd->prepare('ALTER TABLE `' . $this->prefix . 'entry` ADD COLUMN `lastSeen` INT(11) DEFAULT 0'); + if ($stm && $stm->execute()) { + $stm = $this->bd->prepare('CREATE INDEX entry_lastSeen_index ON `' . $this->prefix . 'entry`(`lastSeen`);'); //"IF NOT EXISTS" does not exist in MySQL 5.7 + if ($stm && $stm->execute()) { + if ($hasTransaction) { + $this->bd->commit(); + } + return true; + } + } + if ($hasTransaction) { + $this->bd->rollBack(); + } + } elseif ($name === 'hash') { //v1.1.1 + $stm = $this->bd->prepare('ALTER TABLE `' . $this->prefix . 'entry` ADD COLUMN hash BINARY(16)'); + return $stm && $stm->execute(); + } + } catch (Exception $e) { + Minz_Log::error('FreshRSS_EntryDAO::addColumn error: ' . $e->getMessage()); + if ($hasTransaction) { + $this->bd->rollBack(); + } + } + return false; + } + + private $triedUpdateToUtf8mb4 = false; - if ($stm && $stm->execute ($values)) { + protected function updateToUtf8mb4() { + if ($this->triedUpdateToUtf8mb4) { + return false; + } + $this->triedUpdateToUtf8mb4 = true; + $db = FreshRSS_Context::$system_conf->db; + if ($db['type'] === 'mysql') { + include_once(APP_PATH . '/SQL/install.sql.mysql.php'); + if (defined('SQL_UPDATE_UTF8MB4')) { + Minz_Log::warning('Updating MySQL to UTF8MB4...'); + $hadTransaction = $this->bd->inTransaction(); + if ($hadTransaction) { + $this->bd->commit(); + } + $ok = false; + try { + $sql = sprintf(SQL_UPDATE_UTF8MB4, $this->prefix, $db['base']); + $stm = $this->bd->prepare($sql); + $ok = $stm->execute(); + } catch (Exception $e) { + Minz_Log::error('FreshRSS_EntryDAO::updateToUtf8mb4 error: ' . $e->getMessage()); + } + if ($hadTransaction) { + $this->bd->beginTransaction(); + //NB: Transaction not starting. Why? (tested on PHP 7.0.8-0ubuntu and MySQL 5.7.13-0ubuntu) + } + return $ok; + } + } + return false; + } + + protected function autoUpdateDb($errorInfo) { + if (isset($errorInfo[0])) { + if ($errorInfo[0] === '42S22') { //ER_BAD_FIELD_ERROR + //autoAddColumn + foreach (array('lastSeen', 'hash') as $column) { + if (stripos($errorInfo[2], $column) !== false) { + return $this->addColumn($column); + } + } + } + } + if (isset($errorInfo[1])) { + if ($errorInfo[1] == '1366') { //ER_TRUNCATED_WRONG_VALUE_FOR_FIELD + return $this->updateToUtf8mb4(); + } + } + return false; + } + + private $addEntryPrepared = null; + + public function addEntry($valuesTmp) { + if ($this->addEntryPrepared === null) { + $sql = 'INSERT INTO `' . $this->prefix . 'entry` (id, guid, title, author, ' + . ($this->isCompressed() ? 'content_bin' : 'content') + . ', link, date, `lastSeen`, hash, is_read, is_favorite, id_feed, tags) ' + . 'VALUES(:id, :guid, :title, :author, ' + . ($this->isCompressed() ? 'COMPRESS(:content)' : ':content') + . ', :link, :date, :last_seen, ' + . $this->sqlHexDecode(':hash') + . ', :is_read, :is_favorite, :id_feed, :tags)'; + $this->addEntryPrepared = $this->bd->prepare($sql); + } + $this->addEntryPrepared->bindParam(':id', $valuesTmp['id']); + $valuesTmp['guid'] = substr($valuesTmp['guid'], 0, 760); + $valuesTmp['guid'] = safe_ascii($valuesTmp['guid']); + $this->addEntryPrepared->bindParam(':guid', $valuesTmp['guid']); + $valuesTmp['title'] = substr($valuesTmp['title'], 0, 255); + $this->addEntryPrepared->bindParam(':title', $valuesTmp['title']); + $valuesTmp['author'] = substr($valuesTmp['author'], 0, 255); + $this->addEntryPrepared->bindParam(':author', $valuesTmp['author']); + $this->addEntryPrepared->bindParam(':content', $valuesTmp['content']); + $valuesTmp['link'] = substr($valuesTmp['link'], 0, 1023); + $valuesTmp['link'] = safe_ascii($valuesTmp['link']); + $this->addEntryPrepared->bindParam(':link', $valuesTmp['link']); + $this->addEntryPrepared->bindParam(':date', $valuesTmp['date'], PDO::PARAM_INT); + $valuesTmp['lastSeen'] = time(); + $this->addEntryPrepared->bindParam(':last_seen', $valuesTmp['lastSeen'], PDO::PARAM_INT); + $valuesTmp['is_read'] = $valuesTmp['is_read'] ? 1 : 0; + $this->addEntryPrepared->bindParam(':is_read', $valuesTmp['is_read'], PDO::PARAM_INT); + $valuesTmp['is_favorite'] = $valuesTmp['is_favorite'] ? 1 : 0; + $this->addEntryPrepared->bindParam(':is_favorite', $valuesTmp['is_favorite'], PDO::PARAM_INT); + $this->addEntryPrepared->bindParam(':id_feed', $valuesTmp['id_feed'], PDO::PARAM_INT); + $valuesTmp['tags'] = substr($valuesTmp['tags'], 0, 1023); + $this->addEntryPrepared->bindParam(':tags', $valuesTmp['tags']); + + if ($this->hasNativeHex()) { + $this->addEntryPrepared->bindParam(':hash', $valuesTmp['hash']); + } else { + $valuesTmp['hashBin'] = pack('H*', $valuesTmp['hash']); //hex2bin() is PHP5.4+ + $this->addEntryPrepared->bindParam(':hash', $valuesTmp['hashBin']); + } + + if ($this->addEntryPrepared && $this->addEntryPrepared->execute()) { return $this->bd->lastInsertId(); } else { - $info = $stm->errorInfo(); - if ((int)($info[0] / 1000) !== 23) { //Filter out "SQLSTATE Class code 23: Constraint Violation" because of expected duplicate entries - Minz_Log::record ('SQL error ' . $info[0] . ': ' . $info[1] . ' ' . $info[2] - . ' while adding entry in feed ' . $valuesTmp['id_feed'] . ' with title: ' . $valuesTmp['title'], Minz_Log::ERROR); - } /*else { - Minz_Log::record ('SQL error ' . $info[0] . ': ' . $info[1] . ' ' . $info[2] - . ' while adding entry in feed ' . $valuesTmp['id_feed'] . ' with title: ' . $valuesTmp['title'], Minz_Log::DEBUG); - }*/ + $info = $this->addEntryPrepared == null ? array(0 => '', 1 => '', 2 => 'syntax error') : $this->addEntryPrepared->errorInfo(); + if ($this->autoUpdateDb($info)) { + return $this->addEntry($valuesTmp); + } elseif ((int)($info[0] / 1000) !== 23) { //Filter out "SQLSTATE Class code 23: Constraint Violation" because of expected duplicate entries + Minz_Log::error('SQL error addEntry: ' . $info[0] . ': ' . $info[1] . ' ' . $info[2] + . ' while adding entry in feed ' . $valuesTmp['id_feed'] . ' with title: ' . $valuesTmp['title']); + } return false; } } - public function markFavorite ($id, $is_favorite = true) { - $sql = 'UPDATE `' . $this->prefix . 'entry` e ' - . 'SET e.is_favorite = ? ' - . 'WHERE e.id=?'; - $values = array ($is_favorite ? 1 : 0, $id); - $stm = $this->bd->prepare ($sql); - if ($stm && $stm->execute ($values)) { - return $stm->rowCount(); + private $updateEntryPrepared = null; + + public function updateEntry($valuesTmp) { + if (!isset($valuesTmp['is_read'])) { + $valuesTmp['is_read'] = null; + } + + if ($this->updateEntryPrepared === null) { + $sql = 'UPDATE `' . $this->prefix . 'entry` ' + . 'SET title=:title, author=:author, ' + . ($this->isCompressed() ? 'content_bin=COMPRESS(:content)' : 'content=:content') + . ', link=:link, date=:date, `lastSeen`=:last_seen, ' + . 'hash=' . $this->sqlHexDecode(':hash') + . ', ' . ($valuesTmp['is_read'] === null ? '' : 'is_read=:is_read, ') + . 'tags=:tags ' + . 'WHERE id_feed=:id_feed AND guid=:guid'; + $this->updateEntryPrepared = $this->bd->prepare($sql); + } + + $valuesTmp['guid'] = substr($valuesTmp['guid'], 0, 760); + $this->updateEntryPrepared->bindParam(':guid', $valuesTmp['guid']); + $valuesTmp['title'] = substr($valuesTmp['title'], 0, 255); + $this->updateEntryPrepared->bindParam(':title', $valuesTmp['title']); + $valuesTmp['author'] = substr($valuesTmp['author'], 0, 255); + $this->updateEntryPrepared->bindParam(':author', $valuesTmp['author']); + $this->updateEntryPrepared->bindParam(':content', $valuesTmp['content']); + $valuesTmp['link'] = substr($valuesTmp['link'], 0, 1023); + $valuesTmp['link'] = safe_ascii($valuesTmp['link']); + $this->updateEntryPrepared->bindParam(':link', $valuesTmp['link']); + $this->updateEntryPrepared->bindParam(':date', $valuesTmp['date'], PDO::PARAM_INT); + $valuesTmp['lastSeen'] = time(); + $this->updateEntryPrepared->bindParam(':last_seen', $valuesTmp['lastSeen'], PDO::PARAM_INT); + if ($valuesTmp['is_read'] !== null) { + $this->updateEntryPrepared->bindValue(':is_read', $valuesTmp['is_read'] ? 1 : 0, PDO::PARAM_INT); + } + $this->updateEntryPrepared->bindParam(':id_feed', $valuesTmp['id_feed'], PDO::PARAM_INT); + $valuesTmp['tags'] = substr($valuesTmp['tags'], 0, 1023); + $this->updateEntryPrepared->bindParam(':tags', $valuesTmp['tags']); + + if ($this->hasNativeHex()) { + $this->updateEntryPrepared->bindParam(':hash', $valuesTmp['hash']); + } else { + $valuesTmp['hashBin'] = pack('H*', $valuesTmp['hash']); //hex2bin() is PHP5.4+ + $this->updateEntryPrepared->bindParam(':hash', $valuesTmp['hashBin']); + } + + if ($this->updateEntryPrepared && $this->updateEntryPrepared->execute()) { + return $this->bd->lastInsertId(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $this->updateEntryPrepared == null ? array(0 => '', 1 => '', 2 => 'syntax error') : $this->updateEntryPrepared->errorInfo(); + if ($this->autoUpdateDb($info)) { + return $this->updateEntry($valuesTmp); + } + Minz_Log::error('SQL error updateEntry: ' . $info[0] . ': ' . $info[1] . ' ' . $info[2] + . ' while updating entry with GUID ' . $valuesTmp['guid'] . ' in feed ' . $valuesTmp['id_feed']); return false; } } - public function markRead ($id, $is_read = true) { - $sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id ' - . 'SET e.is_read = ?,' - . 'f.cache_nbUnreads=f.cache_nbUnreads' . ($is_read ? '-' : '+') . '1 ' - . 'WHERE e.id=?'; - $values = array ($is_read ? 1 : 0, $id); - $stm = $this->bd->prepare ($sql); - if ($stm && $stm->execute ($values)) { + + /** + * Toggle favorite marker on one or more article + * + * @todo simplify the query by removing the str_repeat. I am pretty sure + * there is an other way to do that. + * + * @param integer|array $ids + * @param boolean $is_favorite + * @return false|integer + */ + public function markFavorite($ids, $is_favorite = true) { + if (!is_array($ids)) { + $ids = array($ids); + } + if (count($ids) < 1) { + return 0; + } + FreshRSS_UserDAO::touch(); + $sql = 'UPDATE `' . $this->prefix . 'entry` ' + . 'SET is_favorite=? ' + . 'WHERE id IN (' . str_repeat('?,', count($ids) - 1). '?)'; + $values = array($is_favorite ? 1 : 0); + $values = array_merge($values, $ids); + $stm = $this->bd->prepare($sql); + if ($stm && $stm->execute($values)) { return $stm->rowCount(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error markFavorite: ' . $info[2]); return false; } } - public function markReadEntries ($idMax = 0, $favorites = false) { - if ($idMax === 0) { - $sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id ' - . 'SET e.is_read = 1, f.cache_nbUnreads=0 ' - . 'WHERE e.is_read = 0 AND '; - if ($favorites) { - $sql .= 'e.is_favorite = 1'; - } else { - $sql .= 'f.priority > 0'; - } - $stm = $this->bd->prepare ($sql); - if ($stm && $stm->execute ()) { - return $stm->rowCount(); - } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - return false; - } + + /** + * Update the unread article cache held on every feed details. + * Depending on the parameters, it updates the cache on one feed, on all + * feeds from one category or on all feeds. + * + * @todo It can use the query builder refactoring to build that query + * + * @param false|integer $catId category ID + * @param false|integer $feedId feed ID + * @return boolean + */ + protected function updateCacheUnreads($catId = false, $feedId = false) { + $sql = 'UPDATE `' . $this->prefix . 'feed` f ' + . 'LEFT OUTER JOIN (' + . 'SELECT e.id_feed, ' + . 'COUNT(*) AS nbUnreads ' + . 'FROM `' . $this->prefix . 'entry` e ' + . 'WHERE e.is_read=0 ' + . 'GROUP BY e.id_feed' + . ') x ON x.id_feed=f.id ' + . 'SET f.`cache_nbUnreads`=COALESCE(x.nbUnreads, 0)'; + $hasWhere = false; + $values = array(); + if ($feedId !== false) { + $sql .= $hasWhere ? ' AND' : ' WHERE'; + $hasWhere = true; + $sql .= ' f.id=?'; + $values[] = $id; + } + if ($catId !== false) { + $sql .= $hasWhere ? ' AND' : ' WHERE'; + $hasWhere = true; + $sql .= ' f.category=?'; + $values[] = $catId; + } + $stm = $this->bd->prepare($sql); + if ($stm && $stm->execute($values)) { + return true; } else { - $this->bd->beginTransaction (); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error updateCacheUnreads: ' . $info[2]); + return false; + } + } - $sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id ' - . 'SET e.is_read = 1 ' - . 'WHERE e.is_read = 0 AND e.id <= ? AND '; - if ($favorites) { - $sql .= 'e.is_favorite = 1'; - } else { - $sql .= 'f.priority > 0'; + /** + * Toggle the read marker on one or more article. + * Then the cache is updated. + * + * @todo change the way the query is build because it seems there is + * unnecessary code in here. For instance, the part with the str_repeat. + * @todo remove code duplication. It seems the code is basically the + * same if it is an array or not. + * + * @param integer|array $ids + * @param boolean $is_read + * @return integer affected rows + */ + public function markRead($ids, $is_read = true) { + FreshRSS_UserDAO::touch(); + if (is_array($ids)) { //Many IDs at once (used by API) + if (count($ids) < 6) { //Speed heuristics + $affected = 0; + foreach ($ids as $id) { + $affected += $this->markRead($id, $is_read); + } + return $affected; } - $values = array ($idMax); - $stm = $this->bd->prepare ($sql); - if (!($stm && $stm->execute ($values))) { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - $this->bd->rollBack (); + + $sql = 'UPDATE `' . $this->prefix . 'entry` ' + . 'SET is_read=? ' + . 'WHERE id IN (' . str_repeat('?,', count($ids) - 1). '?)'; + $values = array($is_read ? 1 : 0); + $values = array_merge($values, $ids); + $stm = $this->bd->prepare($sql); + if (!($stm && $stm->execute($values))) { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error markRead: ' . $info[2]); return false; } $affected = $stm->rowCount(); - - if ($affected > 0) { - $sql = 'UPDATE `' . $this->prefix . 'feed` f ' - . 'LEFT OUTER JOIN (' - . 'SELECT e.id_feed, ' - . 'COUNT(*) AS nbUnreads ' - . 'FROM `' . $this->prefix . 'entry` e ' - . 'WHERE e.is_read = 0 ' - . 'GROUP BY e.id_feed' - . ') x ON x.id_feed=f.id ' - . 'SET f.cache_nbUnreads=COALESCE(x.nbUnreads, 0)'; - $stm = $this->bd->prepare ($sql); - if (!($stm && $stm->execute ())) { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - $this->bd->rollBack (); - return false; - } + if (($affected > 0) && (!$this->updateCacheUnreads(false, false))) { + return false; } - - $this->bd->commit (); return $affected; - } - } - public function markReadCat ($id, $idMax = 0) { - if ($idMax === 0) { - $sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id ' - . 'SET e.is_read = 1, f.cache_nbUnreads=0 ' - . 'WHERE f.category = ? AND e.is_read = 0'; - $values = array ($id); - $stm = $this->bd->prepare ($sql); - if ($stm && $stm->execute ($values)) { + } else { + $sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id ' + . 'SET e.is_read=?,' + . 'f.`cache_nbUnreads`=f.`cache_nbUnreads`' . ($is_read ? '-' : '+') . '1 ' + . 'WHERE e.id=? AND e.is_read=?'; + $values = array($is_read ? 1 : 0, $ids, $is_read ? 0 : 1); + $stm = $this->bd->prepare($sql); + if ($stm && $stm->execute($values)) { return $stm->rowCount(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - return false; - } - } else { - $this->bd->beginTransaction (); - - $sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id ' - . 'SET e.is_read = 1 ' - . 'WHERE f.category = ? AND e.is_read = 0 AND e.id <= ?'; - $values = array ($id, $idMax); - $stm = $this->bd->prepare ($sql); - if (!($stm && $stm->execute ($values))) { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - $this->bd->rollBack (); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error markRead: ' . $info[2]); return false; } - $affected = $stm->rowCount(); + } + } - if ($affected > 0) { - $sql = 'UPDATE `' . $this->prefix . 'feed` f ' - . 'LEFT OUTER JOIN (' - . 'SELECT e.id_feed, ' - . 'COUNT(*) AS nbUnreads ' - . 'FROM `' . $this->prefix . 'entry` e ' - . 'WHERE e.is_read = 0 ' - . 'GROUP BY e.id_feed' - . ') x ON x.id_feed=f.id ' - . 'SET f.cache_nbUnreads=COALESCE(x.nbUnreads, 0) ' - . 'WHERE f.category = ?'; - $values = array ($id); - $stm = $this->bd->prepare ($sql); - if (!($stm && $stm->execute ($values))) { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - $this->bd->rollBack (); - return false; - } - } + /** + * Mark all entries as read depending on parameters. + * If $onlyFavorites is true, it is used when the user mark as read in + * the favorite pseudo-category. + * If $priorityMin is greater than 0, it is used when the user mark as + * read in the main feed pseudo-category. + * Then the cache is updated. + * + * If $idMax equals 0, a deprecated debug message is logged + * + * @todo refactor this method along with markReadCat and markReadFeed + * since they are all doing the same thing. I think we need to build a + * tool to generate the query instead of having queries all over the + * place. It will be reused also for the filtering making every thing + * separated. + * + * @param integer $idMax fail safe article ID + * @param boolean $onlyFavorites + * @param integer $priorityMin + * @return integer affected rows + */ + public function markReadEntries($idMax = 0, $onlyFavorites = false, $priorityMin = 0, $filter = null, $state = 0) { + FreshRSS_UserDAO::touch(); + if ($idMax == 0) { + $idMax = time() . '000000'; + Minz_Log::debug('Calling markReadEntries(0) is deprecated!'); + } - $this->bd->commit (); - return $affected; + $sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id ' + . 'SET e.is_read=1 ' + . 'WHERE e.is_read=0 AND e.id <= ?'; + if ($onlyFavorites) { + $sql .= ' AND e.is_favorite=1'; + } elseif ($priorityMin >= 0) { + $sql .= ' AND f.priority > ' . intval($priorityMin); + } + $values = array($idMax); + + list($searchValues, $search) = $this->sqlListEntriesWhere('e.', $filter, $state); + + $stm = $this->bd->prepare($sql . $search); + if (!($stm && $stm->execute(array_merge($values, $searchValues)))) { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error markReadEntries: ' . $info[2]); + return false; + } + $affected = $stm->rowCount(); + if (($affected > 0) && (!$this->updateCacheUnreads(false, false))) { + return false; } + return $affected; } - public function markReadFeed ($id, $idMax = 0) { - if ($idMax === 0) { - $sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id ' - . 'SET e.is_read = 1, f.cache_nbUnreads=0 ' - . 'WHERE f.id=? AND e.is_read = 0'; - $values = array ($id); - $stm = $this->bd->prepare ($sql); - if ($stm && $stm->execute ($values)) { - return $stm->rowCount(); - } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - return false; - } - } else { - $this->bd->beginTransaction (); - - $sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id ' - . 'SET e.is_read = 1 ' - . 'WHERE f.id=? AND e.is_read = 0 AND e.id <= ?'; - $values = array ($id, $idMax); - $stm = $this->bd->prepare ($sql); - if (!($stm && $stm->execute ($values))) { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - $this->bd->rollBack (); - return false; - } - $affected = $stm->rowCount(); - if ($affected > 0) { - $sql = 'UPDATE `' . $this->prefix . 'feed` f ' - . 'SET f.cache_nbUnreads=f.cache_nbUnreads-' . $affected - . ' WHERE f.id=?'; - $values = array ($id); - $stm = $this->bd->prepare ($sql); - if (!($stm && $stm->execute ($values))) { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - $this->bd->rollBack (); - return false; - } - } + /** + * Mark all the articles in a category as read. + * There is a fail safe to prevent to mark as read articles that are + * loaded during the mark as read action. Then the cache is updated. + * + * If $idMax equals 0, a deprecated debug message is logged + * + * @param integer $id category ID + * @param integer $idMax fail safe article ID + * @return integer affected rows + */ + public function markReadCat($id, $idMax = 0, $filter = null, $state = 0) { + FreshRSS_UserDAO::touch(); + if ($idMax == 0) { + $idMax = time() . '000000'; + Minz_Log::debug('Calling markReadCat(0) is deprecated!'); + } - $this->bd->commit (); - return $affected; + $sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id ' + . 'SET e.is_read=1 ' + . 'WHERE f.category=? AND e.is_read=0 AND e.id <= ?'; + $values = array($id, $idMax); + + list($searchValues, $search) = $this->sqlListEntriesWhere('e.', $filter, $state); + + $stm = $this->bd->prepare($sql . $search); + if (!($stm && $stm->execute(array_merge($values, $searchValues)))) { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error markReadCat: ' . $info[2]); + return false; + } + $affected = $stm->rowCount(); + if (($affected > 0) && (!$this->updateCacheUnreads($id, false))) { + return false; + } + return $affected; + } + + /** + * Mark all the articles in a feed as read. + * There is a fail safe to prevent to mark as read articles that are + * loaded during the mark as read action. Then the cache is updated. + * + * If $idMax equals 0, a deprecated debug message is logged + * + * @param integer $id_feed feed ID + * @param integer $idMax fail safe article ID + * @return integer affected rows + */ + public function markReadFeed($id_feed, $idMax = 0, $filter = null, $state = 0) { + FreshRSS_UserDAO::touch(); + if ($idMax == 0) { + $idMax = time() . '000000'; + Minz_Log::debug('Calling markReadFeed(0) is deprecated!'); + } + $this->bd->beginTransaction(); + + $sql = 'UPDATE `' . $this->prefix . 'entry` ' + . 'SET is_read=1 ' + . 'WHERE id_feed=? AND is_read=0 AND id <= ?'; + $values = array($id_feed, $idMax); + + list($searchValues, $search) = $this->sqlListEntriesWhere('', $filter, $state); + + $stm = $this->bd->prepare($sql . $search); + if (!($stm && $stm->execute(array_merge($values, $searchValues)))) { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error markReadFeed: ' . $info[2] . ' with SQL: ' . $sql . $search); + $this->bd->rollBack(); + return false; } + $affected = $stm->rowCount(); + + if ($affected > 0) { + $sql = 'UPDATE `' . $this->prefix . 'feed` ' + . 'SET `cache_nbUnreads`=`cache_nbUnreads`-' . $affected + . ' WHERE id=?'; + $values = array($id_feed); + $stm = $this->bd->prepare($sql); + if (!($stm && $stm->execute($values))) { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error markReadFeed cache: ' . $info[2]); + $this->bd->rollBack(); + return false; + } + } + + $this->bd->commit(); + return $affected; } - public function searchByGuid ($feed_id, $id) { + public function searchByGuid($id_feed, $guid) { // un guid est unique pour un flux donné - $sql = 'SELECT id, guid, title, author, UNCOMPRESS(content_bin) AS content, link, date, is_read, is_favorite, id_feed, tags ' + $sql = 'SELECT id, guid, title, author, ' + . ($this->isCompressed() ? 'UNCOMPRESS(content_bin) AS content' : 'content') + . ', link, date, is_read, is_favorite, id_feed, tags ' . 'FROM `' . $this->prefix . 'entry` WHERE id_feed=? AND guid=?'; - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); - $values = array ( - $feed_id, - $id + $values = array( + $id_feed, + $guid, ); - $stm->execute ($values); - $res = $stm->fetchAll (PDO::FETCH_ASSOC); - $entries = self::daoToEntry ($res); - return isset ($entries[0]) ? $entries[0] : false; + $stm->execute($values); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); + $entries = self::daoToEntries($res); + return isset($entries[0]) ? $entries[0] : null; } - public function searchById ($id) { - $sql = 'SELECT id, guid, title, author, UNCOMPRESS(content_bin) AS content, link, date, is_read, is_favorite, id_feed, tags ' + public function searchById($id) { + $sql = 'SELECT id, guid, title, author, ' + . ($this->isCompressed() ? 'UNCOMPRESS(content_bin) AS content' : 'content') + . ', link, date, is_read, is_favorite, id_feed, tags ' . 'FROM `' . $this->prefix . 'entry` WHERE id=?'; - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); - $values = array ($id); + $values = array($id); - $stm->execute ($values); - $res = $stm->fetchAll (PDO::FETCH_ASSOC); - $entries = self::daoToEntry ($res); - return isset ($entries[0]) ? $entries[0] : false; + $stm->execute($values); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); + $entries = self::daoToEntries($res); + return isset($entries[0]) ? $entries[0] : null; } - public function listWhere($type = 'a', $id = '', $state = 'all', $order = 'DESC', $limit = 1, $firstId = '', $filter = '', $date_min = 0, $keepHistoryDefault = 0) { - $where = ''; - $joinFeed = false; + protected function sqlConcat($s1, $s2) { + return 'CONCAT(' . $s1 . ',' . $s2 . ')'; //MySQL + } + + protected function sqlListEntriesWhere($alias = '', $filter = null, $state = FreshRSS_Entry::STATE_ALL, $order = 'DESC', $firstId = '', $date_min = 0) { + $search = ' '; $values = array(); - switch ($type) { - case 'a': - $where .= 'f.priority > 0 '; - $joinFeed = true; - break; - case 's': - $where .= 'e1.is_favorite = 1 '; - break; - case 'c': - $where .= 'f.category = ? '; - $values[] = intval($id); - $joinFeed = true; - break; - case 'f': - $where .= 'e1.id_feed = ? '; - $values[] = intval($id); - break; - default: - throw new FreshRSS_EntriesGetter_Exception ('Bad type in Entry->listByType: [' . $type . ']!'); + if ($state & FreshRSS_Entry::STATE_NOT_READ) { + if (!($state & FreshRSS_Entry::STATE_READ)) { + $search .= 'AND ' . $alias . 'is_read=0 '; + } } - switch ($state) { - case 'all': - break; - case 'not_read': - $where .= 'AND e1.is_read = 0 '; - break; - case 'read': - $where .= 'AND e1.is_read = 1 '; - break; - case 'favorite': - $where .= 'AND e1.is_favorite = 1 '; - break; - default: - throw new FreshRSS_EntriesGetter_Exception ('Bad state in Entry->listByType: [' . $state . ']!'); + elseif ($state & FreshRSS_Entry::STATE_READ) { + $search .= 'AND ' . $alias . 'is_read=1 '; + } + if ($state & FreshRSS_Entry::STATE_FAVORITE) { + if (!($state & FreshRSS_Entry::STATE_NOT_FAVORITE)) { + $search .= 'AND ' . $alias . 'is_favorite=1 '; + } } + elseif ($state & FreshRSS_Entry::STATE_NOT_FAVORITE) { + $search .= 'AND ' . $alias . 'is_favorite=0 '; + } + switch ($order) { case 'DESC': case 'ASC': break; default: - throw new FreshRSS_EntriesGetter_Exception ('Bad order in Entry->listByType: [' . $order . ']!'); + throw new FreshRSS_EntriesGetter_Exception('Bad order in Entry->listByType: [' . $order . ']!'); } + /*if ($firstId === '' && parent::$sharedDbType === 'mysql') { + $firstId = $order === 'DESC' ? '9000000000'. '000000' : '0'; //MySQL optimization. TODO: check if this is needed again, after the filtering for old articles has been removed in 0.9-dev + }*/ if ($firstId !== '') { - $where .= 'AND e1.id ' . ($order === 'DESC' ? '<=' : '>=') . $firstId . ' '; + $search .= 'AND ' . $alias . 'id ' . ($order === 'DESC' ? '<=' : '>=') . $firstId . ' '; } - if (($date_min > 0) && ($type !== 's')) { - $where .= 'AND (e1.id >= ' . $date_min . '000000 OR e1.is_read = 0 OR e1.is_favorite = 1 OR (f.keep_history <> 0'; - if (intval($keepHistoryDefault) === 0) { - $where .= ' AND f.keep_history <> -2'; //default - } - $where .= ')) '; - $joinFeed = true; + if ($date_min > 0) { + $search .= 'AND ' . $alias . 'id >= ' . $date_min . '000000 '; } - $search = ''; - if ($filter !== '') { - $filter = trim($filter); - $filter = addcslashes($filter, '\\%_'); - if (stripos($filter, 'intitle:') === 0) { - $filter = substr($filter, strlen('intitle:')); - $intitle = true; - } else { - $intitle = false; + if ($filter) { + if ($filter->getIntitle()) { + $search .= 'AND ' . $alias . 'title LIKE ? '; + $values[] = "%{$filter->getIntitle()}%"; } - if (stripos($filter, 'inurl:') === 0) { - $filter = substr($filter, strlen('inurl:')); - $inurl = true; - } else { - $inurl = false; + if ($filter->getInurl()) { + $search .= 'AND CONCAT(' . $alias . 'link, ' . $alias . 'guid) LIKE ? '; + $values[] = "%{$filter->getInurl()}%"; } - if (stripos($filter, 'author:') === 0) { - $filter = substr($filter, strlen('author:')); - $author = true; - } else { - $author = false; + if ($filter->getAuthor()) { + $search .= 'AND ' . $alias . 'author LIKE ? '; + $values[] = "%{$filter->getAuthor()}%"; } - $terms = array_unique(explode(' ', $filter)); - sort($terms); //Put #tags first - foreach ($terms as $word) { - $word = trim($word); - if (strlen($word) > 0) { - if ($intitle) { - $search .= 'AND e1.title LIKE ? '; - $values[] = '%' . $word .'%'; - } elseif ($inurl) { - $search .= 'AND CONCAT(e1.link, e1.guid) LIKE ? '; - $values[] = '%' . $word .'%'; - } elseif ($author) { - $search .= 'AND e1.author LIKE ? '; - $values[] = '%' . $word .'%'; - } else { - if ($word[0] === '#' && isset($word[1])) { - $search .= 'AND e1.tags LIKE ? '; - $values[] = '%' . $word .'%'; - } else { - $search .= 'AND CONCAT(e1.title, UNCOMPRESS(e1.content_bin)) LIKE ? '; - $values[] = '%' . $word .'%'; - } - } + if ($filter->getMinDate()) { + $search .= 'AND ' . $alias . 'id >= ? '; + $values[] = "{$filter->getMinDate()}000000"; + } + if ($filter->getMaxDate()) { + $search .= 'AND ' . $alias . 'id <= ? '; + $values[] = "{$filter->getMaxDate()}000000"; + } + if ($filter->getMinPubdate()) { + $search .= 'AND ' . $alias . 'date >= ? '; + $values[] = $filter->getMinPubdate(); + } + if ($filter->getMaxPubdate()) { + $search .= 'AND ' . $alias . 'date <= ? '; + $values[] = $filter->getMaxPubdate(); + } + if ($filter->getTags()) { + $tags = $filter->getTags(); + foreach ($tags as $tag) { + $search .= 'AND ' . $alias . 'tags LIKE ? '; + $values[] = "%{$tag}%"; } } + if ($filter->getSearch()) { + $search_values = $filter->getSearch(); + foreach ($search_values as $search_value) { + $search .= 'AND ' . $this->sqlconcat($alias . 'title', $this->isCompressed() ? 'UNCOMPRESS(' . $alias . 'content_bin)' : '' . $alias . 'content') . ' LIKE ? '; + $values[] = "%{$search_value}%"; + } + } + } + return array($values, $search); + } + + private function sqlListWhere($type = 'a', $id = '', $state = FreshRSS_Entry::STATE_ALL, $order = 'DESC', $limit = 1, $firstId = '', $filter = '', $date_min = 0) { + if (!$state) { + $state = FreshRSS_Entry::STATE_ALL; + } + $where = ''; + $joinFeed = false; + $values = array(); + switch ($type) { + case 'a': + $where .= 'f.priority > 0 '; + $joinFeed = true; + break; + case 's': //Deprecated: use $state instead + $where .= 'e.is_favorite=1 '; + break; + case 'c': + $where .= 'f.category=? '; + $values[] = intval($id); + $joinFeed = true; + break; + case 'f': + $where .= 'e.id_feed=? '; + $values[] = intval($id); + break; + case 'A': + $where .= '1 '; + break; + default: + throw new FreshRSS_EntriesGetter_Exception('Bad type in Entry->listByType: [' . $type . ']!'); } - $sql = 'SELECT e.id, e.guid, e.title, e.author, UNCOMPRESS(e.content_bin) AS content, e.link, e.date, e.is_read, e.is_favorite, e.id_feed, e.tags ' - . 'FROM `' . $this->prefix . 'entry` e ' - . 'INNER JOIN (SELECT e1.id FROM `' . $this->prefix . 'entry` e1 ' - . ($joinFeed ? 'INNER JOIN `' . $this->prefix . 'feed` f ON e1.id_feed = f.id ' : '') - . 'WHERE ' . $where - . $search - . 'ORDER BY e1.id ' . $order - . ($limit > 0 ? ' LIMIT ' . $limit : '') //TODO: See http://explainextended.com/2009/10/23/mysql-order-by-limit-performance-late-row-lookups/ - . ') e2 ON e2.id = e.id ' - . 'ORDER BY e.id ' . $order; + list($searchValues, $search) = $this->sqlListEntriesWhere('e.', $filter, $state, $order, $firstId, $date_min); - $stm = $this->bd->prepare ($sql); - $stm->execute ($values); + 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 ' : '') + . 'WHERE ' . $where + . $search + . 'ORDER BY e.id ' . $order + . ($limit > 0 ? ' LIMIT ' . $limit : '')); //TODO: See http://explainextended.com/2009/10/23/mysql-order-by-limit-performance-late-row-lookups/ + } - return self::daoToEntry ($stm->fetchAll (PDO::FETCH_ASSOC)); + public function listWhereRaw($type = 'a', $id = '', $state = FreshRSS_Entry::STATE_ALL, $order = 'DESC', $limit = 1, $firstId = '', $filter = '', $date_min = 0) { + list($values, $sql) = $this->sqlListWhere($type, $id, $state, $order, $limit, $firstId, $filter, $date_min); + + $sql = 'SELECT e0.id, e0.guid, e0.title, e0.author, ' + . ($this->isCompressed() ? 'UNCOMPRESS(content_bin) AS content' : 'content') + . ', e0.link, e0.date, e0.is_read, e0.is_favorite, e0.id_feed, e0.tags ' + . 'FROM `' . $this->prefix . 'entry` e0 ' + . 'INNER JOIN (' + . $sql + . ') e2 ON e2.id=e0.id ' + . 'ORDER BY e0.id ' . $order; + + $stm = $this->bd->prepare($sql); + $stm->execute($values); + return $stm; } - public function listLastGuidsByFeed($id, $n) { - $sql = 'SELECT guid FROM `' . $this->prefix . 'entry` WHERE id_feed=? ORDER BY id DESC LIMIT ' . intval($n); - $stm = $this->bd->prepare ($sql); - $values = array ($id); - $stm->execute ($values); - return $stm->fetchAll (PDO::FETCH_COLUMN, 0); + public function listWhere($type = 'a', $id = '', $state = FreshRSS_Entry::STATE_ALL, $order = 'DESC', $limit = 1, $firstId = '', $filter = '', $date_min = 0) { + $stm = $this->listWhereRaw($type, $id, $state, $order, $limit, $firstId, $filter, $date_min); + return self::daoToEntries($stm->fetchAll(PDO::FETCH_ASSOC)); } - public function countUnreadRead () { - $sql = 'SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id WHERE priority > 0' - . ' UNION SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id WHERE priority > 0 AND is_read = 0'; - $stm = $this->bd->prepare ($sql); - $stm->execute (); - $res = $stm->fetchAll (PDO::FETCH_COLUMN, 0); + public function listIdsWhere($type = 'a', $id = '', $state = FreshRSS_Entry::STATE_ALL, $order = 'DESC', $limit = 1, $firstId = '', $filter = '', $date_min = 0) { //For API + list($values, $sql) = $this->sqlListWhere($type, $id, $state, $order, $limit, $firstId, $filter, $date_min); + + $stm = $this->bd->prepare($sql); + $stm->execute($values); + + return $stm->fetchAll(PDO::FETCH_COLUMN, 0); + } + + public function listHashForFeedGuids($id_feed, $guids) { + if (count($guids) < 1) { + return array(); + } + $guids = array_unique($guids); + $sql = 'SELECT guid, ' . $this->sqlHexEncode('hash') . ' AS hex_hash FROM `' . $this->prefix . 'entry` WHERE id_feed=? AND guid IN (' . str_repeat('?,', count($guids) - 1). '?)'; + $stm = $this->bd->prepare($sql); + $values = array($id_feed); + $values = array_merge($values, $guids); + if ($stm && $stm->execute($values)) { + $result = array(); + $rows = $stm->fetchAll(PDO::FETCH_ASSOC); + foreach ($rows as $row) { + $result[$row['guid']] = $row['hex_hash']; + } + return $result; + } else { + $info = $stm == null ? array(0 => '', 1 => '', 2 => 'syntax error') : $stm->errorInfo(); + if ($this->autoUpdateDb($info)) { + return $this->listHashForFeedGuids($id_feed, $guids); + } + Minz_Log::error('SQL error listHashForFeedGuids: ' . $info[0] . ': ' . $info[1] . ' ' . $info[2] + . ' while querying feed ' . $id_feed); + return false; + } + } + + public function updateLastSeen($id_feed, $guids, $mtime = 0) { + if (count($guids) < 1) { + return 0; + } + $sql = 'UPDATE `' . $this->prefix . 'entry` SET `lastSeen`=? WHERE id_feed=? AND guid IN (' . str_repeat('?,', count($guids) - 1). '?)'; + $stm = $this->bd->prepare($sql); + if ($mtime <= 0) { + $mtime = time(); + } + $values = array($mtime, $id_feed); + $values = array_merge($values, $guids); + if ($stm && $stm->execute($values)) { + return $stm->rowCount(); + } else { + $info = $stm == null ? array(0 => '', 1 => '', 2 => 'syntax error') : $stm->errorInfo(); + if ($this->autoUpdateDb($info)) { + return $this->updateLastSeen($id_feed, $guids); + } + Minz_Log::error('SQL error updateLastSeen: ' . $info[0] . ': ' . $info[1] . ' ' . $info[2] + . ' while updating feed ' . $id_feed); + return false; + } + } + + public function countUnreadRead() { + $sql = 'SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id WHERE priority > 0' + . ' UNION SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id WHERE priority > 0 AND is_read=0'; + $stm = $this->bd->prepare($sql); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); $all = empty($res[0]) ? 0 : $res[0]; $unread = empty($res[1]) ? 0 : $res[1]; return array('all' => $all, 'unread' => $unread, 'read' => $all - $unread); } - public function count ($minPriority = null) { - $sql = 'SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id'; + public function count($minPriority = null) { + $sql = 'SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id'; if ($minPriority !== null) { $sql = ' WHERE priority > ' . intval($minPriority); } - $stm = $this->bd->prepare ($sql); - $stm->execute (); - $res = $stm->fetchAll (PDO::FETCH_COLUMN, 0); + $stm = $this->bd->prepare($sql); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); return $res[0]; } - public function countNotRead ($minPriority = null) { - $sql = 'SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id WHERE is_read = 0'; + public function countNotRead($minPriority = null) { + $sql = 'SELECT COUNT(e.id) AS count FROM `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id WHERE is_read=0'; if ($minPriority !== null) { $sql = ' AND priority > ' . intval($minPriority); } - $stm = $this->bd->prepare ($sql); - $stm->execute (); - $res = $stm->fetchAll (PDO::FETCH_COLUMN, 0); + $stm = $this->bd->prepare($sql); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); return $res[0]; } - public function countUnreadReadFavorites () { - $sql = 'SELECT COUNT(id) FROM `' . $this->prefix . 'entry` WHERE is_favorite=1' - . ' UNION SELECT COUNT(id) FROM `' . $this->prefix . 'entry` WHERE is_favorite=1 AND is_read = 0'; - $stm = $this->bd->prepare ($sql); - $stm->execute (); - $res = $stm->fetchAll (PDO::FETCH_COLUMN, 0); + 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'; + $stm = $this->bd->prepare($sql); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); $all = empty($res[0]) ? 0 : $res[0]; $unread = empty($res[1]) ? 0 : $res[1]; return array('all' => $all, 'unread' => $unread, 'read' => $all - $unread); } public function optimizeTable() { - $sql = 'OPTIMIZE TABLE `' . $this->prefix . 'entry`'; - $stm = $this->bd->prepare ($sql); - $stm->execute (); + $sql = 'OPTIMIZE TABLE `' . $this->prefix . 'entry`'; //MySQL + $stm = $this->bd->prepare($sql); + if ($stm) { + return $stm->execute(); + } } - public static function daoToEntry ($listDAO) { - $list = array (); - - if (!is_array ($listDAO)) { - $listDAO = array ($listDAO); + public function size($all = false) { + $db = FreshRSS_Context::$system_conf->db; + $sql = 'SELECT SUM(data_length + index_length) FROM information_schema.TABLES WHERE table_schema=?'; //MySQL + $values = array($db['base']); + if (!$all) { + $sql .= ' AND table_name LIKE ?'; + $values[] = $this->prefix . '%'; } + $stm = $this->bd->prepare($sql); + $stm->execute($values); + $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); + return $res[0]; + } - foreach ($listDAO as $key => $dao) { - $entry = new FreshRSS_Entry ( + public static function daoToEntry($dao) { + $entry = new FreshRSS_Entry( $dao['id_feed'], $dao['guid'], $dao['title'], @@ -459,13 +827,24 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { $dao['is_favorite'], $dao['tags'] ); - if (isset ($dao['id'])) { - $entry->_id ($dao['id']); - } - $list[] = $entry; + if (isset($dao['id'])) { + $entry->_id($dao['id']); + } + return $entry; + } + + private static function daoToEntries($listDAO) { + $list = array(); + + if (!is_array($listDAO)) { + $listDAO = array($listDAO); + } + + foreach ($listDAO as $key => $dao) { + $list[] = self::daoToEntry($dao); } - unset ($listDAO); + unset($listDAO); return $list; } diff --git a/app/Models/EntryDAOPGSQL.php b/app/Models/EntryDAOPGSQL.php new file mode 100644 index 000000000..b96a62ebc --- /dev/null +++ b/app/Models/EntryDAOPGSQL.php @@ -0,0 +1,31 @@ +<?php + +class FreshRSS_EntryDAOPGSQL extends FreshRSS_EntryDAOSQLite { + + public function sqlHexDecode($x) { + return 'decode(' . $x . ", 'hex')"; + } + + public function sqlHexEncode($x) { + return 'encode(' . $x . ", 'hex')"; + } + + protected function autoUpdateDb($errorInfo) { + return false; + } + + protected function addColumn($name) { + return false; + } + + public function size($all = true) { + $db = FreshRSS_Context::$system_conf->db; + $sql = 'SELECT pg_size_pretty(pg_database_size(?))'; + $values = array($db['base']); + $stm = $this->bd->prepare($sql); + $stm->execute($values); + $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); + return $res[0]; + } + +} diff --git a/app/Models/EntryDAOSQLite.php b/app/Models/EntryDAOSQLite.php new file mode 100644 index 000000000..34e854608 --- /dev/null +++ b/app/Models/EntryDAOSQLite.php @@ -0,0 +1,204 @@ +<?php + +class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO { + + public function sqlHexDecode($x) { + return $x; + } + + protected function autoUpdateDb($errorInfo) { + if (empty($errorInfo[0]) || $errorInfo[0] == '42S22') { //ER_BAD_FIELD_ERROR + //autoAddColumn + if ($tableInfo = $this->bd->query("SELECT sql FROM sqlite_master where name='entry'")) { + $showCreate = $tableInfo->fetchColumn(); + Minz_Log::debug('FreshRSS_EntryDAOSQLite::autoUpdateDb: ' . $showCreate); + foreach (array('lastSeen', 'hash') as $column) { + if (stripos($showCreate, $column) === false) { + return $this->addColumn($column); + } + } + } + } + return false; + } + + protected function sqlConcat($s1, $s2) { + return $s1 . '||' . $s2; + } + + protected function updateCacheUnreads($catId = false, $feedId = false) { + $sql = 'UPDATE `' . $this->prefix . 'feed` ' + . 'SET `cache_nbUnreads`=(' + . 'SELECT COUNT(*) AS nbUnreads FROM `' . $this->prefix . 'entry` e ' + . 'WHERE e.id_feed=`' . $this->prefix . 'feed`.id AND e.is_read=0)'; + $hasWhere = false; + $values = array(); + if ($feedId !== false) { + $sql .= $hasWhere ? ' AND' : ' WHERE'; + $hasWhere = true; + $sql .= ' id=?'; + $values[] = $feedId; + } + if ($catId !== false) { + $sql .= $hasWhere ? ' AND' : ' WHERE'; + $hasWhere = true; + $sql .= ' category=?'; + $values[] = $catId; + } + $stm = $this->bd->prepare($sql); + if ($stm && $stm->execute($values)) { + return true; + } else { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error updateCacheUnreads: ' . $info[2]); + return false; + } + } + + /** + * Toggle the read marker on one or more article. + * Then the cache is updated. + * + * @todo change the way the query is build because it seems there is + * unnecessary code in here. For instance, the part with the str_repeat. + * @todo remove code duplication. It seems the code is basically the + * same if it is an array or not. + * + * @param integer|array $ids + * @param boolean $is_read + * @return integer affected rows + */ + public function markRead($ids, $is_read = true) { + if (is_array($ids)) { //Many IDs at once (used by API) + if (true) { //Speed heuristics //TODO: Not implemented yet for SQLite (so always call IDs one by one) + $affected = 0; + foreach ($ids as $id) { + $affected += $this->markRead($id, $is_read); + } + return $affected; + } + } else { + $this->bd->beginTransaction(); + $sql = 'UPDATE `' . $this->prefix . 'entry` SET is_read=? WHERE id=? AND is_read=?'; + $values = array($is_read ? 1 : 0, $ids, $is_read ? 0 : 1); + $stm = $this->bd->prepare($sql); + if (!($stm && $stm->execute($values))) { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error markRead 1: ' . $info[2]); + $this->bd->rollBack(); + return false; + } + $affected = $stm->rowCount(); + if ($affected > 0) { + $sql = 'UPDATE `' . $this->prefix . 'feed` SET `cache_nbUnreads`=`cache_nbUnreads`' . ($is_read ? '-' : '+') . '1 ' + . 'WHERE id=(SELECT e.id_feed FROM `' . $this->prefix . 'entry` e WHERE e.id=?)'; + $values = array($ids); + $stm = $this->bd->prepare($sql); + if (!($stm && $stm->execute($values))) { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error markRead 2: ' . $info[2]); + $this->bd->rollBack(); + return false; + } + } + $this->bd->commit(); + return $affected; + } + } + + /** + * Mark all entries as read depending on parameters. + * If $onlyFavorites is true, it is used when the user mark as read in + * the favorite pseudo-category. + * If $priorityMin is greater than 0, it is used when the user mark as + * read in the main feed pseudo-category. + * Then the cache is updated. + * + * If $idMax equals 0, a deprecated debug message is logged + * + * @todo refactor this method along with markReadCat and markReadFeed + * since they are all doing the same thing. I think we need to build a + * tool to generate the query instead of having queries all over the + * place. It will be reused also for the filtering making every thing + * separated. + * + * @param integer $idMax fail safe article ID + * @param boolean $onlyFavorites + * @param integer $priorityMin + * @return integer affected rows + */ + public function markReadEntries($idMax = 0, $onlyFavorites = false, $priorityMin = 0, $filter = null, $state = 0) { + if ($idMax == 0) { + $idMax = time() . '000000'; + Minz_Log::debug('Calling markReadEntries(0) is deprecated!'); + } + + $sql = 'UPDATE `' . $this->prefix . 'entry` SET is_read=1 WHERE is_read=0 AND id <= ?'; + if ($onlyFavorites) { + $sql .= ' AND is_favorite=1'; + } elseif ($priorityMin >= 0) { + $sql .= ' AND id_feed IN (SELECT f.id FROM `' . $this->prefix . 'feed` f WHERE f.priority > ' . intval($priorityMin) . ')'; + } + $values = array($idMax); + + list($searchValues, $search) = $this->sqlListEntriesWhere('', $filter, $state); + + $stm = $this->bd->prepare($sql . $search); + if (!($stm && $stm->execute(array_merge($values, $searchValues)))) { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error markReadEntries: ' . $info[2]); + return false; + } + $affected = $stm->rowCount(); + if (($affected > 0) && (!$this->updateCacheUnreads(false, false))) { + return false; + } + return $affected; + } + + /** + * Mark all the articles in a category as read. + * There is a fail safe to prevent to mark as read articles that are + * loaded during the mark as read action. Then the cache is updated. + * + * If $idMax equals 0, a deprecated debug message is logged + * + * @param integer $id category ID + * @param integer $idMax fail safe article ID + * @return integer affected rows + */ + public function markReadCat($id, $idMax = 0, $filter = null, $state = 0) { + if ($idMax == 0) { + $idMax = time() . '000000'; + Minz_Log::debug('Calling markReadCat(0) is deprecated!'); + } + + $sql = 'UPDATE `' . $this->prefix . 'entry` ' + . 'SET is_read=1 ' + . 'WHERE is_read=0 AND id <= ? AND ' + . 'id_feed IN (SELECT f.id FROM `' . $this->prefix . 'feed` f WHERE f.category=?)'; + $values = array($idMax, $id); + + list($searchValues, $search) = $this->sqlListEntriesWhere('', $filter, $state); + + $stm = $this->bd->prepare($sql . $search); + if (!($stm && $stm->execute(array_merge($values, $searchValues)))) { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error markReadCat: ' . $info[2]); + return false; + } + $affected = $stm->rowCount(); + if (($affected > 0) && (!$this->updateCacheUnreads($id, false))) { + return false; + } + return $affected; + } + + public function optimizeTable() { + //TODO: Search for an equivalent in SQLite + } + + public function size($all = false) { + return @filesize(join_path(DATA_PATH, 'users', $this->current_user, 'db.sqlite')); + } +} diff --git a/app/Models/Factory.php b/app/Models/Factory.php new file mode 100644 index 000000000..6502c38b7 --- /dev/null +++ b/app/Models/Factory.php @@ -0,0 +1,52 @@ +<?php + +class FreshRSS_Factory { + + public static function createFeedDao($username = null) { + $conf = Minz_Configuration::get('system'); + switch ($conf->db['type']) { + case 'sqlite': + case 'pgsql': + return new FreshRSS_FeedDAOSQLite($username); + default: + return new FreshRSS_FeedDAO($username); + } + } + + public static function createEntryDao($username = null) { + $conf = Minz_Configuration::get('system'); + switch ($conf->db['type']) { + case 'sqlite': + return new FreshRSS_EntryDAOSQLite($username); + case 'pgsql': + return new FreshRSS_EntryDAOPGSQL($username); + default: + return new FreshRSS_EntryDAO($username); + } + } + + public static function createStatsDAO($username = null) { + $conf = Minz_Configuration::get('system'); + switch ($conf->db['type']) { + case 'sqlite': + return new FreshRSS_StatsDAOSQLite($username); + case 'pgsql': + return new FreshRSS_StatsDAOPGSQL($username); + default: + return new FreshRSS_StatsDAO($username); + } + } + + public static function createDatabaseDAO($username = null) { + $conf = Minz_Configuration::get('system'); + switch ($conf->db['type']) { + case 'sqlite': + return new FreshRSS_DatabaseDAOSQLite($username); + case 'pgsql': + return new FreshRSS_DatabaseDAOPGSQL($username); + default: + return new FreshRSS_DatabaseDAO($username); + } + } + +} diff --git a/app/Models/Feed.php b/app/Models/Feed.php index 73f9c32fb..97cb1c47e 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -16,98 +16,141 @@ class FreshRSS_Feed extends Minz_Model { private $httpAuth = ''; private $error = false; private $keep_history = -2; + private $ttl = -2; private $hash = null; + private $lockPath = ''; + private $hubUrl = ''; + private $selfUrl = ''; - public function __construct ($url, $validate=true) { + public function __construct($url, $validate=true) { if ($validate) { - $this->_url ($url); + $this->_url($url); } else { $this->url = $url; } } - public function id () { + public static function example() { + $f = new FreshRSS_Feed('http://example.net/', false); + $f->faviconPrepare(); + return $f; + } + + public function id() { return $this->id; } public function hash() { if ($this->hash === null) { - $this->hash = hash('crc32b', Minz_Configuration::salt() . $this->url); + $salt = FreshRSS_Context::$system_conf->salt; + $this->hash = hash('crc32b', $salt . $this->url); } return $this->hash; } - public function url () { + public function url() { return $this->url; } - public function category () { + public function selfUrl() { + return $this->selfUrl; + } + public function hubUrl() { + return $this->hubUrl; + } + public function category() { return $this->category; } - public function entries () { + public function entries() { return $this->entries === null ? array() : $this->entries; } - public function name () { + public function name() { return $this->name; } - public function website () { + public function website() { return $this->website; } - public function description () { + public function description() { return $this->description; } - public function lastUpdate () { + public function lastUpdate() { return $this->lastUpdate; } - public function priority () { + public function priority() { return $this->priority; } - public function pathEntries () { + public function pathEntries() { return $this->pathEntries; } - public function httpAuth ($raw = true) { + public function httpAuth($raw = true) { if ($raw) { return $this->httpAuth; } else { - $pos_colon = strpos ($this->httpAuth, ':'); - $user = substr ($this->httpAuth, 0, $pos_colon); - $pass = substr ($this->httpAuth, $pos_colon + 1); + $pos_colon = strpos($this->httpAuth, ':'); + $user = substr($this->httpAuth, 0, $pos_colon); + $pass = substr($this->httpAuth, $pos_colon + 1); - return array ( + return array( 'username' => $user, 'password' => $pass ); } } - public function inError () { + public function inError() { return $this->error; } - public function keepHistory () { + public function keepHistory() { return $this->keep_history; } - public function nbEntries () { + public function ttl() { + return $this->ttl; + } + // public function ttlExpire() { + // $ttl = $this->ttl; + // if ($ttl == -2) { //Default + // $ttl = FreshRSS_Context::$user_conf->ttl_default; + // } + // if ($ttl == -1) { //Never + // $ttl = 64000000; //~2 years. Good enough for PubSubHubbub logic + // } + // return $this->lastUpdate + $ttl; + // } + public function nbEntries() { if ($this->nbEntries < 0) { - $feedDAO = new FreshRSS_FeedDAO (); - $this->nbEntries = $feedDAO->countEntries ($this->id ()); + $feedDAO = FreshRSS_Factory::createFeedDao(); + $this->nbEntries = $feedDAO->countEntries($this->id()); } return $this->nbEntries; } - public function nbNotRead () { + public function nbNotRead() { if ($this->nbNotRead < 0) { - $feedDAO = new FreshRSS_FeedDAO (); - $this->nbNotRead = $feedDAO->countNotRead ($this->id ()); + $feedDAO = FreshRSS_Factory::createFeedDao(); + $this->nbNotRead = $feedDAO->countNotRead($this->id()); } return $this->nbNotRead; } public function faviconPrepare() { - $file = DATA_PATH . '/favicons/' . $this->hash() . '.txt'; - if (!file_exists ($file)) { - $t = $this->website; - if (empty($t)) { - $t = $this->url; + global $favicons_dir; + require_once(LIB_PATH . '/favicons.php'); + $url = $this->website; + if ($url == '') { + $url = $this->url; + } + $txt = $favicons_dir . $this->hash() . '.txt'; + if (!file_exists($txt)) { + file_put_contents($txt, $url); + } + if (FreshRSS_Context::$isCli) { + $ico = $favicons_dir . $this->hash() . '.ico'; + $ico_mtime = @filemtime($ico); + $txt_mtime = @filemtime($txt); + if ($txt_mtime != false && + ($ico_mtime == false || $ico_mtime < $txt_mtime || ($ico_mtime < time() - (14 * 86400)))) { + // no ico file or we should download a new one. + $url = file_get_contents($txt); + download_favicon($url, $ico) || touch($ico); } - file_put_contents($file, $t); } } public static function faviconDelete($hash) { @@ -115,113 +158,134 @@ class FreshRSS_Feed extends Minz_Model { @unlink($path . '.ico'); @unlink($path . '.txt'); } - public function favicon () { - return Minz_Url::display ('/f.php?' . $this->hash()); + public function favicon() { + return Minz_Url::display('/f.php?' . $this->hash()); } - public function _id ($value) { + public function _id($value) { $this->id = $value; } - public function _url ($value, $validate=true) { + public function _url($value, $validate=true) { + $this->hash = null; if ($validate) { $value = checkUrl($value); } - if (empty ($value)) { - throw new FreshRSS_BadUrl_Exception ($value); + if (empty($value)) { + throw new FreshRSS_BadUrl_Exception($value); } $this->url = $value; } - public function _category ($value) { + public function _category($value) { $value = intval($value); $this->category = $value >= 0 ? $value : 0; } - public function _name ($value) { + public function _name($value) { $this->name = $value === null ? '' : $value; } - public function _website ($value, $validate=true) { + public function _website($value, $validate=true) { if ($validate) { $value = checkUrl($value); } - if (empty ($value)) { + if (empty($value)) { $value = ''; } $this->website = $value; } - public function _description ($value) { + public function _description($value) { $this->description = $value === null ? '' : $value; } - public function _lastUpdate ($value) { + public function _lastUpdate($value) { $this->lastUpdate = $value; } - public function _priority ($value) { + public function _priority($value) { $value = intval($value); $this->priority = $value >= 0 ? $value : 10; } - public function _pathEntries ($value) { + public function _pathEntries($value) { $this->pathEntries = $value; } - public function _httpAuth ($value) { + public function _httpAuth($value) { $this->httpAuth = $value; } - public function _error ($value) { + public function _error($value) { $this->error = (bool)$value; } - public function _keepHistory ($value) { + public function _keepHistory($value) { $value = intval($value); $value = min($value, 1000000); $value = max($value, -2); $this->keep_history = $value; } - public function _nbNotRead ($value) { + public function _ttl($value) { + $value = intval($value); + $value = min($value, 100000000); + $value = max($value, -2); + $this->ttl = $value; + } + public function _nbNotRead($value) { $this->nbNotRead = intval($value); } - public function _nbEntries ($value) { + public function _nbEntries($value) { $this->nbEntries = intval($value); } - public function load ($loadDetails = false) { + public function load($loadDetails = false, $noCache = false) { if ($this->url !== null) { if (CACHE_PATH === false) { - throw new Minz_FileNotExistException ( + throw new Minz_FileNotExistException( 'CACHE_PATH', Minz_Exception::ERROR ); } else { - $url = htmlspecialchars_decode ($this->url, ENT_QUOTES); + $url = htmlspecialchars_decode($this->url, ENT_QUOTES); if ($this->httpAuth != '') { - $url = preg_replace ('#((.+)://)(.+)#', '${1}' . $this->httpAuth . '@${3}', $url); + $url = preg_replace('#((.+)://)(.+)#', '${1}' . $this->httpAuth . '@${3}', $url); } $feed = customSimplePie(); - $feed->set_feed_url ($url); + if (substr($url, -11) === '#force_feed') { + $feed->force_feed(true); + $url = substr($url, 0, -11); + } + $feed->set_feed_url($url); + if (!$loadDetails) { //Only activates auto-discovery when adding a new feed + $feed->set_autodiscovery_level(SIMPLEPIE_LOCATOR_NONE); + } $mtime = $feed->init(); if ((!$mtime) || $feed->error()) { - throw new FreshRSS_Feed_Exception ($feed->error() . ' [' . $url . ']'); + $errorMessage = $feed->error(); + throw new FreshRSS_Feed_Exception(($errorMessage == '' ? 'Unknown error for feed' : $errorMessage) . ' [' . $url . ']'); } - // si on a utilisé l'auto-discover, notre url va avoir changé - $subscribe_url = $feed->subscribe_url (); - if ($subscribe_url !== null && $subscribe_url !== $this->url) { - if ($this->httpAuth != '') { - // on enlève les id si authentification HTTP - $subscribe_url = preg_replace ('#((.+)://)((.+)@)(.+)#', '${1}${5}', $subscribe_url); - } - $this->_url ($subscribe_url); - } + $links = $feed->get_links('self'); + $this->selfUrl = isset($links[0]) ? $links[0] : null; + $links = $feed->get_links('hub'); + $this->hubUrl = isset($links[0]) ? $links[0] : null; if ($loadDetails) { - $title = htmlspecialchars(html_only_entity_decode($feed->get_title()), ENT_COMPAT, 'UTF-8'); - $this->_name ($title === null ? $this->url : $title); + // si on a utilisé l'auto-discover, notre url va avoir changé + $subscribe_url = $feed->subscribe_url(false); + + $title = strtr(html_only_entity_decode($feed->get_title()), array('<' => '<', '>' => '>', '"' => '"')); //HTML to HTML-PRE //ENT_COMPAT except & + $this->_name($title == '' ? $url : $title); $this->_website(html_only_entity_decode($feed->get_link())); $this->_description(html_only_entity_decode($feed->get_description())); + } else { + //The case of HTTP 301 Moved Permanently + $subscribe_url = $feed->subscribe_url(true); + } + + $clean_url = SimplePie_Misc::url_remove_credentials($subscribe_url); + if ($subscribe_url !== null && $subscribe_url !== $url) { + $this->_url($clean_url); } - if (($mtime === true) || ($mtime > $this->lastUpdate)) { - syslog(LOG_DEBUG, 'FreshRSS no cache ' . $mtime . ' > ' . $this->lastUpdate . ' for ' . $subscribe_url); + if (($mtime === true) || ($mtime > $this->lastUpdate) || $noCache) { + //Minz_Log::debug('FreshRSS no cache ' . $mtime . ' > ' . $this->lastUpdate . ' for ' . $clean_url); $this->loadEntries($feed); // et on charge les articles du flux } else { - syslog(LOG_DEBUG, 'FreshRSS use cache for ' . $subscribe_url); + //Minz_Log::debug('FreshRSS use cache for ' . $clean_url); $this->entries = array(); } @@ -231,47 +295,54 @@ class FreshRSS_Feed extends Minz_Model { } } - private function loadEntries ($feed) { - $entries = array (); + public function loadEntries($feed) { + $entries = array(); - foreach ($feed->get_items () as $item) { - $title = html_only_entity_decode (strip_tags ($item->get_title ())); - $author = $item->get_author (); - $link = $item->get_permalink (); - $date = @strtotime ($item->get_date ()); + foreach ($feed->get_items() as $item) { + $title = html_only_entity_decode(strip_tags($item->get_title())); + $author = $item->get_author(); + $link = $item->get_permalink(); + $date = @strtotime($item->get_date()); // gestion des tags (catégorie == tag) - $tags_tmp = $item->get_categories (); - $tags = array (); + $tags_tmp = $item->get_categories(); + $tags = array(); if ($tags_tmp !== null) { foreach ($tags_tmp as $tag) { - $tags[] = html_only_entity_decode ($tag->get_label ()); + $tags[] = html_only_entity_decode($tag->get_label()); } } - $content = html_only_entity_decode ($item->get_content ()); + $content = html_only_entity_decode($item->get_content()); $elinks = array(); foreach ($item->get_enclosures() as $enclosure) { $elink = $enclosure->get_link(); - if (array_key_exists($elink, $elinks)) continue; - $elinks[$elink] = '1'; - $mime = strtolower($enclosure->get_type()); - if (strpos($mime, 'image/') === 0) { - $content .= '<br /><img src="' . $elink . '" alt="" />'; + if (empty($elinks[$elink])) { + $elinks[$elink] = '1'; + $mime = strtolower($enclosure->get_type()); + if (strpos($mime, 'image/') === 0) { + $content .= '<p class="enclosure"><img src="' . $elink . '" alt="" /></p>'; + } elseif (strpos($mime, 'audio/') === 0) { + $content .= '<p class="enclosure"><audio preload="none" src="' . $elink . '" controls="controls"></audio> <a download="" href="' . $elink . '">💾</a></p>'; + } elseif (strpos($mime, 'video/') === 0) { + $content .= '<p class="enclosure"><video preload="none" src="' . $elink . '" controls="controls"></video> <a download="" href="' . $elink . '">💾</a></p>'; + } else { + unset($elinks[$elink]); + } } } - $entry = new FreshRSS_Entry ( - $this->id (), - $item->get_id (), + $entry = new FreshRSS_Entry( + $this->id(), + $item->get_id(), $title === null ? '' : $title, - $author === null ? '' : html_only_entity_decode ($author->name), + $author === null ? '' : html_only_entity_decode($author->name), $content === null ? '' : $content, $link === null ? '' : $link, - $date ? $date : time () + $date ? $date : time() ); - $entry->_tags ($tags); + $entry->_tags($tags); // permet de récupérer le contenu des flux tronqués $entry->loadCompleteContent($this->pathEntries()); @@ -282,21 +353,155 @@ class FreshRSS_Feed extends Minz_Model { $this->entries = $entries; } + function cacheModifiedTime() { + return @filemtime(CACHE_PATH . '/' . md5($this->url) . '.spc'); + } + function lock() { - $lock = TMP_PATH . '/' . md5(Minz_Configuration::salt() . $this->url) . '.freshrss.lock'; - if (file_exists($lock) && ((time() - @filemtime($lock)) > 3600)) { - @unlink($lock); + $this->lockPath = TMP_PATH . '/' . $this->hash() . '.freshrss.lock'; + if (file_exists($this->lockPath) && ((time() - @filemtime($this->lockPath)) > 3600)) { + @unlink($this->lockPath); } - if (($handle = @fopen($lock, 'x')) === false) { + if (($handle = @fopen($this->lockPath, 'x')) === false) { return false; } - //register_shutdown_function('unlink', $lock); + //register_shutdown_function('unlink', $this->lockPath); @fclose($handle); return true; } function unlock() { - $lock = TMP_PATH . '/' . md5(Minz_Configuration::salt() . $this->url) . '.freshrss.lock'; - @unlink($lock); + @unlink($this->lockPath); + } + + //<PubSubHubbub> + + function pubSubHubbubEnabled() { + $url = $this->selfUrl ? $this->selfUrl : $this->url; + $hubFilename = PSHB_PATH . '/feeds/' . base64url_encode($url) . '/!hub.json'; + if ($hubFile = @file_get_contents($hubFilename)) { + $hubJson = json_decode($hubFile, true); + if ($hubJson && empty($hubJson['error']) && + (empty($hubJson['lease_end']) || $hubJson['lease_end'] > time())) { + return true; + } + } + return false; } + + function pubSubHubbubError($error = true) { + $url = $this->selfUrl ? $this->selfUrl : $this->url; + $hubFilename = PSHB_PATH . '/feeds/' . base64url_encode($url) . '/!hub.json'; + $hubFile = @file_get_contents($hubFilename); + $hubJson = $hubFile ? json_decode($hubFile, true) : array(); + if (!isset($hubJson['error']) || $hubJson['error'] !== (bool)$error) { + $hubJson['error'] = (bool)$error; + file_put_contents($hubFilename, json_encode($hubJson)); + file_put_contents(USERS_PATH . '/_/log_pshb.txt', date('c') . "\t" + . 'Set error to ' . ($error ? 1 : 0) . ' for ' . $url . "\n", FILE_APPEND); + } + return false; + } + + function pubSubHubbubPrepare() { + $key = ''; + if (FreshRSS_Context::$system_conf->base_url && $this->hubUrl && $this->selfUrl && @is_dir(PSHB_PATH)) { + $path = PSHB_PATH . '/feeds/' . base64url_encode($this->selfUrl); + $hubFilename = $path . '/!hub.json'; + if ($hubFile = @file_get_contents($hubFilename)) { + $hubJson = json_decode($hubFile, true); + if (!$hubJson || empty($hubJson['key']) || !ctype_xdigit($hubJson['key'])) { + $text = 'Invalid JSON for PubSubHubbub: ' . $this->url; + Minz_Log::warning($text); + file_put_contents(USERS_PATH . '/_/log_pshb.txt', date('c') . "\t" . $text . "\n", FILE_APPEND); + return false; + } + if ((!empty($hubJson['lease_end'])) && ($hubJson['lease_end'] < (time() + (3600 * 23)))) { //TODO: Make a better policy + $text = 'PubSubHubbub lease ends at ' + . date('c', empty($hubJson['lease_end']) ? time() : $hubJson['lease_end']) + . ' and needs renewal: ' . $this->url; + Minz_Log::warning($text); + file_put_contents(USERS_PATH . '/_/log_pshb.txt', date('c') . "\t" . $text . "\n", FILE_APPEND); + $key = $hubJson['key']; //To renew our lease + } elseif (((!empty($hubJson['error'])) || empty($hubJson['lease_end'])) && + (empty($hubJson['lease_start']) || $hubJson['lease_start'] < time() - (3600 * 23))) { //Do not renew too often + $key = $hubJson['key']; //To renew our lease + } + } else { + @mkdir($path, 0777, true); + $key = sha1($path . FreshRSS_Context::$system_conf->salt . uniqid(mt_rand(), true)); + $hubJson = array( + 'hub' => $this->hubUrl, + 'key' => $key, + ); + file_put_contents($hubFilename, json_encode($hubJson)); + @mkdir(PSHB_PATH . '/keys/'); + file_put_contents(PSHB_PATH . '/keys/' . $key . '.txt', base64url_encode($this->selfUrl)); + $text = 'PubSubHubbub prepared for ' . $this->url; + Minz_Log::debug($text); + file_put_contents(USERS_PATH . '/_/log_pshb.txt', date('c') . "\t" . $text . "\n", FILE_APPEND); + } + $currentUser = Minz_Session::param('currentUser'); + if (ctype_alnum($currentUser) && !file_exists($path . '/' . $currentUser . '.txt')) { + touch($path . '/' . $currentUser . '.txt'); + } + } + return $key; + } + + //Parameter true to subscribe, false to unsubscribe. + function pubSubHubbubSubscribe($state) { + if (FreshRSS_Context::$system_conf->base_url && $this->hubUrl && $this->selfUrl) { + $hubFilename = PSHB_PATH . '/feeds/' . base64url_encode($this->selfUrl) . '/!hub.json'; + $hubFile = @file_get_contents($hubFilename); + if ($hubFile === false) { + Minz_Log::warning('JSON not found for PubSubHubbub: ' . $this->url); + return false; + } + $hubJson = json_decode($hubFile, true); + if (!$hubJson || empty($hubJson['key']) || !ctype_xdigit($hubJson['key'])) { + Minz_Log::warning('Invalid JSON for PubSubHubbub: ' . $this->url); + return false; + } + $callbackUrl = checkUrl(Minz_Request::getBaseUrl() . '/api/pshb.php?k=' . $hubJson['key']); + if ($callbackUrl == '') { + Minz_Log::warning('Invalid callback for PubSubHubbub: ' . $this->url); + return false; + } + if (!$state) { //unsubscribe + $hubJson['lease_end'] = time() - 60; + file_put_contents($hubFilename, json_encode($hubJson)); + } + $ch = curl_init(); + curl_setopt_array($ch, array( + CURLOPT_URL => $this->hubUrl, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_USERAGENT => 'FreshRSS/' . FRESHRSS_VERSION . ' (' . PHP_OS . '; ' . FRESHRSS_WEBSITE . ')', + CURLOPT_POSTFIELDS => 'hub.verify=sync' + . '&hub.mode=' . ($state ? 'subscribe' : 'unsubscribe') + . '&hub.topic=' . urlencode($this->selfUrl) + . '&hub.callback=' . urlencode($callbackUrl) + ) + ); + $response = curl_exec($ch); + $info = curl_getinfo($ch); + + file_put_contents(USERS_PATH . '/_/log_pshb.txt', date('c') . "\t" . + 'PubSubHubbub ' . ($state ? 'subscribe' : 'unsubscribe') . ' to ' . $this->selfUrl . + ' with callback ' . $callbackUrl . ': ' . $info['http_code'] . ' ' . $response . "\n", FILE_APPEND); + + if (substr($info['http_code'], 0, 1) == '2') { + return true; + } else { + $hubJson['lease_start'] = time(); //Prevent trying again too soon + $hubJson['error'] = true; + file_put_contents($hubFilename, json_encode($hubJson)); + return false; + } + } + return false; + } + + //</PubSubHubbub> } diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php index 7ebe68d2b..68398efd5 100644 --- a/app/Models/FeedDAO.php +++ b/app/Models/FeedDAO.php @@ -1,244 +1,300 @@ <?php -class FreshRSS_FeedDAO extends Minz_ModelPdo { - public function addFeed ($valuesTmp) { - $sql = 'INSERT INTO `' . $this->prefix . 'feed` (url, category, name, website, description, lastUpdate, priority, httpAuth, error, keep_history) VALUES(?, ?, ?, ?, ?, ?, 10, ?, 0, -2)'; - $stm = $this->bd->prepare ($sql); +class FreshRSS_FeedDAO extends Minz_ModelPdo implements FreshRSS_Searchable { + public function addFeed($valuesTmp) { + $sql = 'INSERT INTO `' . $this->prefix . 'feed` (url, category, name, website, description, `lastUpdate`, priority, `httpAuth`, error, keep_history, ttl) VALUES(?, ?, ?, ?, ?, ?, 10, ?, 0, -2, -2)'; + $stm = $this->bd->prepare($sql); + + $valuesTmp['url'] = safe_ascii($valuesTmp['url']); + $valuesTmp['website'] = safe_ascii($valuesTmp['website']); - $values = array ( + $values = array( substr($valuesTmp['url'], 0, 511), $valuesTmp['category'], substr($valuesTmp['name'], 0, 255), substr($valuesTmp['website'], 0, 255), substr($valuesTmp['description'], 0, 1023), $valuesTmp['lastUpdate'], - base64_encode ($valuesTmp['httpAuth']), + base64_encode($valuesTmp['httpAuth']), ); - if ($stm && $stm->execute ($values)) { - return $this->bd->lastInsertId(); + if ($stm && $stm->execute($values)) { + return $this->bd->lastInsertId('"' . $this->prefix . 'feed_id_seq"'); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error addFeed: ' . $info[2]); return false; } } - public function updateFeed ($id, $valuesTmp) { + public function addFeedObject($feed) { + // TODO: not sure if we should write this method in DAO since DAO + // should not be aware about feed class + + // Add feed only if we don't find it in DB + $feed_search = $this->searchByUrl($feed->url()); + if (!$feed_search) { + $values = array( + 'id' => $feed->id(), + 'url' => $feed->url(), + 'category' => $feed->category(), + 'name' => $feed->name(), + 'website' => $feed->website(), + 'description' => $feed->description(), + 'lastUpdate' => 0, + 'httpAuth' => $feed->httpAuth() + ); + + $id = $this->addFeed($values); + if ($id) { + $feed->_id($id); + $feed->faviconPrepare(); + } + + return $id; + } + + return $feed_search->id(); + } + + public function updateFeed($id, $valuesTmp) { + if (isset($valuesTmp['url'])) { + $valuesTmp['url'] = safe_ascii($valuesTmp['url']); + } + if (isset($valuesTmp['website'])) { + $valuesTmp['website'] = safe_ascii($valuesTmp['website']); + } + $set = ''; foreach ($valuesTmp as $key => $v) { $set .= $key . '=?, '; if ($key == 'httpAuth') { - $valuesTmp[$key] = base64_encode ($v); + $valuesTmp[$key] = base64_encode($v); } } - $set = substr ($set, 0, -2); + $set = substr($set, 0, -2); $sql = 'UPDATE `' . $this->prefix . 'feed` SET ' . $set . ' WHERE id=?'; - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); foreach ($valuesTmp as $v) { $values[] = $v; } $values[] = $id; - if ($stm && $stm->execute ($values)) { + if ($stm && $stm->execute($values)) { return $stm->rowCount(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error updateFeed: ' . $info[2]); return false; } } - public function updateLastUpdate ($id, $inError = 0, $updateCache = true) { + public function updateLastUpdate($id, $inError = false, $updateCache = true, $mtime = 0) { if ($updateCache) { - $sql = 'UPDATE `' . $this->prefix . 'feed` f ' //2 sub-requests with FOREIGN KEY(e.id_feed), INDEX(e.is_read) faster than 1 request with GROUP BY or CASE - . 'SET f.cache_nbEntries=(SELECT COUNT(e1.id) FROM `' . $this->prefix . 'entry` e1 WHERE e1.id_feed=f.id),' - . 'f.cache_nbUnreads=(SELECT COUNT(e2.id) FROM `' . $this->prefix . 'entry` e2 WHERE e2.id_feed=f.id AND e2.is_read=0),' - . 'lastUpdate=?, error=? ' - . 'WHERE f.id=?'; + $sql = 'UPDATE `' . $this->prefix . 'feed` ' //2 sub-requests with FOREIGN KEY(e.id_feed), INDEX(e.is_read) faster than 1 request with GROUP BY or CASE + . 'SET `cache_nbEntries`=(SELECT COUNT(e1.id) FROM `' . $this->prefix . 'entry` e1 WHERE e1.id_feed=`' . $this->prefix . 'feed`.id),' + . '`cache_nbUnreads`=(SELECT COUNT(e2.id) FROM `' . $this->prefix . 'entry` e2 WHERE e2.id_feed=`' . $this->prefix . 'feed`.id AND e2.is_read=0),' + . '`lastUpdate`=?, error=? ' + . 'WHERE id=?'; } else { - $sql = 'UPDATE `' . $this->prefix . 'feed` f ' - . 'SET lastUpdate=?, error=? ' - . 'WHERE f.id=?'; + $sql = 'UPDATE `' . $this->prefix . 'feed` ' + . 'SET `lastUpdate`=?, error=? ' + . 'WHERE id=?'; } - $values = array ( - time(), - $inError, + if ($mtime <= 0) { + $mtime = time(); + } + + $values = array( + $mtime, + $inError ? 1 : 0, $id, ); - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); - if ($stm && $stm->execute ($values)) { + if ($stm && $stm->execute($values)) { return $stm->rowCount(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error updateLastUpdate: ' . $info[2]); return false; } } - public function changeCategory ($idOldCat, $idNewCat) { - $catDAO = new FreshRSS_CategoryDAO (); - $newCat = $catDAO->searchById ($idNewCat); + public function changeCategory($idOldCat, $idNewCat) { + $catDAO = new FreshRSS_CategoryDAO(); + $newCat = $catDAO->searchById($idNewCat); if (!$newCat) { - $newCat = $catDAO->getDefault (); + $newCat = $catDAO->getDefault(); } $sql = 'UPDATE `' . $this->prefix . 'feed` SET category=? WHERE category=?'; - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); - $values = array ( - $newCat->id (), + $values = array( + $newCat->id(), $idOldCat ); - if ($stm && $stm->execute ($values)) { + if ($stm && $stm->execute($values)) { return $stm->rowCount(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error changeCategory: ' . $info[2]); return false; } } - public function deleteFeed ($id) { - /*//For MYISAM (MySQL 5.5-) without FOREIGN KEY - $sql = 'DELETE FROM `' . $this->prefix . 'entry` WHERE id_feed=?'; - $stm = $this->bd->prepare ($sql); - $values = array ($id); - if (!($stm && $stm->execute ($values))) { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - return false; - }*/ - + public function deleteFeed($id) { $sql = 'DELETE FROM `' . $this->prefix . 'feed` WHERE id=?'; - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); - $values = array ($id); + $values = array($id); - if ($stm && $stm->execute ($values)) { + if ($stm && $stm->execute($values)) { return $stm->rowCount(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error deleteFeed: ' . $info[2]); return false; } } - public function deleteFeedByCategory ($id) { - /*//For MYISAM (MySQL 5.5-) without FOREIGN KEY - $sql = 'DELETE FROM `' . $this->prefix . 'entry` e ' - . 'INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id ' - . 'WHERE f.category=?'; - $stm = $this->bd->prepare ($sql); - $values = array ($id); - if (!($stm && $stm->execute ($values))) { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - return false; - }*/ - + public function deleteFeedByCategory($id) { $sql = 'DELETE FROM `' . $this->prefix . 'feed` WHERE category=?'; - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); - $values = array ($id); + $values = array($id); - if ($stm && $stm->execute ($values)) { + if ($stm && $stm->execute($values)) { return $stm->rowCount(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error deleteFeedByCategory: ' . $info[2]); return false; } } - public function searchById ($id) { + public function searchById($id) { $sql = 'SELECT * FROM `' . $this->prefix . 'feed` WHERE id=?'; - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); - $values = array ($id); + $values = array($id); - $stm->execute ($values); - $res = $stm->fetchAll (PDO::FETCH_ASSOC); - $feed = self::daoToFeed ($res); + $stm->execute($values); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); + $feed = self::daoToFeed($res); - if (isset ($feed[$id])) { + if (isset($feed[$id])) { return $feed[$id]; } else { - return false; + return null; } } - public function searchByUrl ($url) { + public function searchByUrl($url) { $sql = 'SELECT * FROM `' . $this->prefix . 'feed` WHERE url=?'; - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); - $values = array ($url); + $values = array($url); - $stm->execute ($values); - $res = $stm->fetchAll (PDO::FETCH_ASSOC); - $feed = current (self::daoToFeed ($res)); + $stm->execute($values); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); + $feed = current(self::daoToFeed($res)); - if (isset ($feed)) { + if (isset($feed) && $feed !== false) { return $feed; } else { - return false; + return null; } } - public function listFeeds () { + public function listFeedsIds() { + $sql = 'SELECT id FROM `' . $this->prefix . 'feed`'; + $stm = $this->bd->prepare($sql); + $stm->execute(); + return $stm->fetchAll(PDO::FETCH_COLUMN, 0); + } + + public function listFeeds() { $sql = 'SELECT * FROM `' . $this->prefix . 'feed` ORDER BY name'; - $stm = $this->bd->prepare ($sql); - $stm->execute (); + $stm = $this->bd->prepare($sql); + $stm->execute(); - return self::daoToFeed ($stm->fetchAll (PDO::FETCH_ASSOC)); + return self::daoToFeed($stm->fetchAll(PDO::FETCH_ASSOC)); + } + + public function arrayFeedCategoryNames() { //For API + $sql = 'SELECT f.id, f.name, c.name as c_name FROM `' . $this->prefix . 'feed` f ' + . 'INNER JOIN `' . $this->prefix . 'category` c ON c.id = f.category'; + $stm = $this->bd->prepare($sql); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); + $feedCategoryNames = array(); + foreach ($res as $line) { + $feedCategoryNames[$line['id']] = array( + 'name' => $line['name'], + 'c_name' => $line['c_name'], + ); + } + return $feedCategoryNames; } - public function listFeedsOrderUpdate ($cacheDuration = 1500) { - $sql = 'SELECT id, name, url, lastUpdate, pathEntries, httpAuth, keep_history ' + /** + * Use $defaultCacheDuration == -1 to return all feeds, without filtering them by TTL. + */ + public function listFeedsOrderUpdate($defaultCacheDuration = 3600) { + $sql = 'SELECT id, url, name, website, `lastUpdate`, `pathEntries`, `httpAuth`, keep_history, ttl ' . 'FROM `' . $this->prefix . 'feed` ' - . 'WHERE lastUpdate < ' . (time() - intval($cacheDuration)) - . ' ORDER BY lastUpdate'; - $stm = $this->bd->prepare ($sql); - $stm->execute (); + . ($defaultCacheDuration < 0 ? '' : 'WHERE ttl <> -1 AND `lastUpdate` < (' . (time() + 60) . '-(CASE WHEN ttl=-2 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(); + } - return self::daoToFeed ($stm->fetchAll (PDO::FETCH_ASSOC)); + return self::daoToFeed($stm->fetchAll(PDO::FETCH_ASSOC)); } - public function listByCategory ($cat) { + public function listByCategory($cat) { $sql = 'SELECT * FROM `' . $this->prefix . 'feed` WHERE category=? ORDER BY name'; - $stm = $this->bd->prepare ($sql); + $stm = $this->bd->prepare($sql); - $values = array ($cat); + $values = array($cat); - $stm->execute ($values); + $stm->execute($values); - return self::daoToFeed ($stm->fetchAll (PDO::FETCH_ASSOC)); + return self::daoToFeed($stm->fetchAll(PDO::FETCH_ASSOC)); } - public function countEntries ($id) { + public function countEntries($id) { $sql = 'SELECT COUNT(*) AS count FROM `' . $this->prefix . 'entry` WHERE id_feed=?'; - $stm = $this->bd->prepare ($sql); - $values = array ($id); - $stm->execute ($values); - $res = $stm->fetchAll (PDO::FETCH_ASSOC); + $stm = $this->bd->prepare($sql); + $values = array($id); + $stm->execute($values); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); return $res[0]['count']; } - public function countNotRead ($id) { + + public function countNotRead($id) { $sql = 'SELECT COUNT(*) AS count FROM `' . $this->prefix . 'entry` WHERE id_feed=? AND is_read=0'; - $stm = $this->bd->prepare ($sql); - $values = array ($id); - $stm->execute ($values); - $res = $stm->fetchAll (PDO::FETCH_ASSOC); + $stm = $this->bd->prepare($sql); + $values = array($id); + $stm->execute($values); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); return $res[0]['count']; } - public function updateCachedValues () { //For one single feed, call updateLastUpdate($id) + + public function updateCachedValues() { //For one single feed, call updateLastUpdate($id) $sql = 'UPDATE `' . $this->prefix . 'feed` f ' . 'INNER JOIN (' . 'SELECT e.id_feed, ' @@ -247,81 +303,82 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo { . 'FROM `' . $this->prefix . 'entry` e ' . 'GROUP BY e.id_feed' . ') x ON x.id_feed=f.id ' - . 'SET f.cache_nbEntries=x.nbEntries, f.cache_nbUnreads=x.nbUnreads'; - $stm = $this->bd->prepare ($sql); - - $values = array ($feed_id); + . 'SET f.`cache_nbEntries`=x.nbEntries, f.`cache_nbUnreads`=x.nbUnreads'; + $stm = $this->bd->prepare($sql); - if ($stm && $stm->execute ($values)) { + if ($stm && $stm->execute()) { return $stm->rowCount(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error updateCachedValues: ' . $info[2]); return false; } } - public function truncate ($id) { - $sql = 'DELETE e.* FROM `' . $this->prefix . 'entry` e WHERE e.id_feed=?'; + public function truncate($id) { + $sql = 'DELETE FROM `' . $this->prefix . 'entry` WHERE id_feed=?'; $stm = $this->bd->prepare($sql); $values = array($id); - $this->bd->beginTransaction (); - if (!($stm && $stm->execute ($values))) { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - $this->bd->rollBack (); - return false; - } + $this->bd->beginTransaction(); + if (!($stm && $stm->execute($values))) { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error truncate: ' . $info[2]); + $this->bd->rollBack(); + return false; + } $affected = $stm->rowCount(); - $sql = 'UPDATE `' . $this->prefix . 'feed` f ' - . 'SET f.cache_nbEntries=0, f.cache_nbUnreads=0 WHERE f.id=?'; - $values = array ($id); - $stm = $this->bd->prepare ($sql); - if (!($stm && $stm->execute ($values))) { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - $this->bd->rollBack (); + $sql = 'UPDATE `' . $this->prefix . 'feed` ' + . 'SET `cache_nbEntries`=0, `cache_nbUnreads`=0 WHERE id=?'; + $values = array($id); + $stm = $this->bd->prepare($sql); + if (!($stm && $stm->execute($values))) { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error truncate: ' . $info[2]); + $this->bd->rollBack(); return false; } - $this->bd->commit (); + $this->bd->commit(); return $affected; } - public function cleanOldEntries ($id, $date_min, $keep = 15) { //Remember to call updateLastUpdate($id) just after - $sql = 'DELETE e.* FROM `' . $this->prefix . 'entry` e ' - . 'WHERE e.id_feed = :id_feed AND e.id <= :id_max AND e.is_favorite = 0 AND e.id NOT IN ' - . '(SELECT id FROM (SELECT e2.id FROM `' . $this->prefix . 'entry` e2 WHERE e2.id_feed = :id_feed ORDER BY id DESC LIMIT :keep) keep)'; //Double select because of: MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' - $stm = $this->bd->prepare ($sql); - - $id_max = intval($date_min) . '000000'; + public function cleanOldEntries($id, $date_min, $keep = 15) { //Remember to call updateLastUpdate($id) or updateCachedValues() just after + $sql = 'DELETE FROM `' . $this->prefix . 'entry` ' + . 'WHERE id_feed=:id_feed AND id<=:id_max ' + . 'AND is_favorite=0 ' //Do not remove favourites + . 'AND `lastSeen` < (SELECT maxLastSeen FROM (SELECT (MAX(e3.`lastSeen`)-99) AS maxLastSeen FROM `' . $this->prefix . 'entry` e3 WHERE e3.id_feed=:id_feed) recent) ' //Do not remove the most newly seen articles, plus a few seconds of tolerance + . 'AND id NOT IN (SELECT id FROM (SELECT e2.id FROM `' . $this->prefix . 'entry` e2 WHERE e2.id_feed=:id_feed ORDER BY id DESC LIMIT :keep) keep)'; //Double select: MySQL doesn't support 'LIMIT & IN/ALL/ANY/SOME subquery' + $stm = $this->bd->prepare($sql); - $stm->bindParam(':id_feed', $id, PDO::PARAM_INT); - $stm->bindParam(':id_max', $id_max, PDO::PARAM_INT); - $stm->bindParam(':keep', $keep, PDO::PARAM_INT); + if ($stm) { + $id_max = intval($date_min) . '000000'; + $stm->bindParam(':id_feed', $id, PDO::PARAM_INT); + $stm->bindParam(':id_max', $id_max, PDO::PARAM_STR); + $stm->bindParam(':keep', $keep, PDO::PARAM_INT); + } - if ($stm && $stm->execute ()) { + if ($stm && $stm->execute()) { return $stm->rowCount(); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error cleanOldEntries: ' . $info[2]); return false; } } - public static function daoToFeed ($listDAO, $catID = null) { - $list = array (); + public static function daoToFeed($listDAO, $catID = null) { + $list = array(); - if (!is_array ($listDAO)) { - $listDAO = array ($listDAO); + if (!is_array($listDAO)) { + $listDAO = array($listDAO); } foreach ($listDAO as $key => $dao) { - if (!isset ($dao['name'])) { + if (!isset($dao['name'])) { continue; } - if (isset ($dao['id'])) { + if (isset($dao['id'])) { $key = $dao['id']; } if ($catID === null) { @@ -338,13 +395,14 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo { $myFeed->_lastUpdate(isset($dao['lastUpdate']) ? $dao['lastUpdate'] : 0); $myFeed->_priority(isset($dao['priority']) ? $dao['priority'] : 10); $myFeed->_pathEntries(isset($dao['pathEntries']) ? $dao['pathEntries'] : ''); - $myFeed->_httpAuth(isset($dao['httpAuth']) ? base64_decode ($dao['httpAuth']) : ''); + $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->_nbNotRead(isset($dao['cache_nbUnreads']) ? $dao['cache_nbUnreads'] : 0); $myFeed->_nbEntries(isset($dao['cache_nbEntries']) ? $dao['cache_nbEntries'] : 0); - if (isset ($dao['id'])) { - $myFeed->_id ($dao['id']); + if (isset($dao['id'])) { + $myFeed->_id($dao['id']); } $list[$key] = $myFeed; } diff --git a/app/Models/FeedDAOSQLite.php b/app/Models/FeedDAOSQLite.php new file mode 100644 index 000000000..440ae74da --- /dev/null +++ b/app/Models/FeedDAOSQLite.php @@ -0,0 +1,19 @@ +<?php + +class FreshRSS_FeedDAOSQLite extends FreshRSS_FeedDAO { + + public function updateCachedValues() { //For one single feed, call updateLastUpdate($id) + $sql = 'UPDATE `' . $this->prefix . 'feed` ' + . 'SET `cache_nbEntries`=(SELECT COUNT(e1.id) FROM `' . $this->prefix . 'entry` e1 WHERE e1.id_feed=`' . $this->prefix . 'feed`.id),' + . '`cache_nbUnreads`=(SELECT COUNT(e2.id) FROM `' . $this->prefix . 'entry` e2 WHERE e2.id_feed=`' . $this->prefix . 'feed`.id AND e2.is_read=0)'; + $stm = $this->bd->prepare($sql); + if ($stm && $stm->execute()) { + return $stm->rowCount(); + } else { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error updateCachedValues: ' . $info[2]); + return false; + } + } + +} diff --git a/app/Models/Log.php b/app/Models/Log.php index d2794458b..df2de72ac 100644 --- a/app/Models/Log.php +++ b/app/Models/Log.php @@ -5,22 +5,22 @@ class FreshRSS_Log extends Minz_Model { private $level; private $information; - public function date () { + public function date() { return $this->date; } - public function level () { + public function level() { return $this->level; } - public function info () { + public function info() { return $this->information; } - public function _date ($date) { + public function _date($date) { $this->date = $date; } - public function _level ($level) { + public function _level($level) { $this->level = $level; } - public function _info ($information) { + public function _info($information) { $this->information = $information; } } diff --git a/app/Models/LogDAO.php b/app/Models/LogDAO.php index d1e515200..ab258cd58 100644 --- a/app/Models/LogDAO.php +++ b/app/Models/LogDAO.php @@ -2,15 +2,15 @@ class FreshRSS_LogDAO { public static function lines() { - $logs = array (); - $handle = @fopen(LOG_PATH . '/' . Minz_Session::param('currentUser', '_') . '.log', 'r'); + $logs = array(); + $handle = @fopen(join_path(DATA_PATH, 'users', Minz_Session::param('currentUser', '_'), 'log.txt'), 'r'); if ($handle) { while (($line = fgets($handle)) !== false) { - if (preg_match ('/^\[([^\[]+)\] \[([^\[]+)\] --- (.*)$/', $line, $matches)) { + if (preg_match('/^\[([^\[]+)\] \[([^\[]+)\] --- (.*)$/', $line, $matches)) { $myLog = new FreshRSS_Log (); - $myLog->_date ($matches[1]); - $myLog->_level ($matches[2]); - $myLog->_info ($matches[3]); + $myLog->_date($matches[1]); + $myLog->_level($matches[2]); + $myLog->_info($matches[3]); $logs[] = $myLog; } } @@ -20,6 +20,11 @@ class FreshRSS_LogDAO { } public static function truncate() { - file_put_contents(LOG_PATH . '/' . Minz_Session::param('currentUser', '_') . '.log', ''); + file_put_contents(join_path(DATA_PATH, 'users', Minz_Session::param('currentUser', '_'), 'log.txt'), ''); + if (FreshRSS_Auth::hasAccess('admin')) { + file_put_contents(join_path(DATA_PATH, 'users', '_', 'log.txt'), ''); + file_put_contents(join_path(DATA_PATH, 'users', '_', 'log_api.txt'), ''); + file_put_contents(join_path(DATA_PATH, 'users', '_', 'log_pshb.txt'), ''); + } } } diff --git a/app/Models/Search.php b/app/Models/Search.php new file mode 100644 index 000000000..575a9a2cb --- /dev/null +++ b/app/Models/Search.php @@ -0,0 +1,229 @@ +<?php + +require_once(LIB_PATH . '/lib_date.php'); + +/** + * Contains a search from the search form. + * + * It allows to extract meaningful bits of the search and store them in a + * convenient object + */ +class FreshRSS_Search { + + // This contains the user input string + private $raw_input = ''; + // The following properties are extracted from the raw input + private $intitle; + private $min_date; + private $max_date; + private $min_pubdate; + private $max_pubdate; + private $inurl; + private $author; + private $tags; + private $search; + + public function __construct($input) { + if (strcmp($input, '') == 0) { + return; + } + $this->raw_input = $input; + $input = $this->parseIntitleSearch($input); + $input = $this->parseAuthorSearch($input); + $input = $this->parseInurlSearch($input); + $input = $this->parsePubdateSearch($input); + $input = $this->parseDateSearch($input); + $input = $this->parseTagsSeach($input); + $this->parseSearch($input); + } + + public function __toString() { + return $this->getRawInput(); + } + + public function getRawInput() { + return $this->raw_input; + } + + public function getIntitle() { + return $this->intitle; + } + + public function getMinDate() { + return $this->min_date; + } + + public function getMaxDate() { + return $this->max_date; + } + + public function getMinPubdate() { + return $this->min_pubdate; + } + + public function getMaxPubdate() { + return $this->max_pubdate; + } + + public function getInurl() { + return $this->inurl; + } + + public function getAuthor() { + return $this->author; + } + + public function getTags() { + return $this->tags; + } + + public function getSearch() { + return $this->search; + } + + /** + * Parse the search string to find intitle keyword and the search related + * to it. + * The search is the first word following the keyword. + * + * @param string $input + * @return string + */ + private function parseIntitleSearch($input) { + if (preg_match('/intitle:(?P<delim>[\'"])(?P<search>.*)(?P=delim)/U', $input, $matches)) { + $this->intitle = $matches['search']; + return str_replace($matches[0], '', $input); + } + if (preg_match('/intitle:(?P<search>\w*)/', $input, $matches)) { + $this->intitle = $matches['search']; + return str_replace($matches[0], '', $input); + } + return $input; + } + + /** + * Parse the search string to find author keyword and the search related + * to it. + * The search is the first word following the keyword except when using + * a delimiter. Supported delimiters are single quote (') and double + * quotes ("). + * + * @param string $input + * @return string + */ + private function parseAuthorSearch($input) { + if (preg_match('/author:(?P<delim>[\'"])(?P<search>.*)(?P=delim)/U', $input, $matches)) { + $this->author = $matches['search']; + return str_replace($matches[0], '', $input); + } + if (preg_match('/author:(?P<search>\w*)/', $input, $matches)) { + $this->author = $matches['search']; + return str_replace($matches[0], '', $input); + } + return $input; + } + + /** + * Parse the search string to find inurl keyword and the search related + * to it. + * The search is the first word following the keyword except. + * + * @param string $input + * @return string + */ + private function parseInurlSearch($input) { + if (preg_match('/inurl:(?P<search>[^\s]*)/', $input, $matches)) { + $this->inurl = $matches['search']; + return str_replace($matches[0], '', $input); + } + return $input; + } + + /** + * Parse the search string to find date keyword and the search related + * to it. + * The search is the first word following the keyword. + * + * @param string $input + * @return string + */ + private function parseDateSearch($input) { + if (preg_match('/date:(?P<search>[^\s]*)/', $input, $matches)) { + list($this->min_date, $this->max_date) = parseDateInterval($matches['search']); + return str_replace($matches[0], '', $input); + } + return $input; + } + + /** + * Parse the search string to find pubdate keyword and the search related + * to it. + * The search is the first word following the keyword. + * + * @param string $input + * @return string + */ + private function parsePubdateSearch($input) { + if (preg_match('/pubdate:(?P<search>[^\s]*)/', $input, $matches)) { + list($this->min_pubdate, $this->max_pubdate) = parseDateInterval($matches['search']); + return str_replace($matches[0], '', $input); + } + return $input; + } + + /** + * Parse the search string to find tags keyword (# followed by a word) + * and the search related to it. + * The search is the first word following the #. + * + * @param string $input + * @return string + */ + private function parseTagsSeach($input) { + if (preg_match_all('/#(?P<search>[^\s]+)/', $input, $matches)) { + $this->tags = $matches['search']; + return str_replace($matches[0], '', $input); + } + return $input; + } + + /** + * Parse the search string to find search values. + * Every word is a distinct search value, except when using a delimiter. + * Supported delimiters are single quote (') and double quotes ("). + * + * @param string $input + * @return string + */ + private function parseSearch($input) { + $input = $this->cleanSearch($input); + if (strcmp($input, '') == 0) { + return; + } + if (preg_match_all('/(?P<delim>[\'"])(?P<search>.*)(?P=delim)/U', $input, $matches)) { + $this->search = $matches['search']; + $input = str_replace($matches[0], '', $input); + } + $input = $this->cleanSearch($input); + if (strcmp($input, '') == 0) { + return; + } + if (is_array($this->search)) { + $this->search = array_merge($this->search, explode(' ', $input)); + } else { + $this->search = explode(' ', $input); + } + } + + /** + * Remove all unnecessary spaces in the search + * + * @param string $input + * @return string + */ + private function cleanSearch($input) { + $input = preg_replace('/\s+/', ' ', $input); + return trim($input); + } + +} diff --git a/app/Models/Searchable.php b/app/Models/Searchable.php new file mode 100644 index 000000000..d5bcea49d --- /dev/null +++ b/app/Models/Searchable.php @@ -0,0 +1,6 @@ +<?php + +interface FreshRSS_Searchable { + + public function searchById($id); +} diff --git a/app/Models/Share.php b/app/Models/Share.php new file mode 100644 index 000000000..1c8a7e767 --- /dev/null +++ b/app/Models/Share.php @@ -0,0 +1,238 @@ +<?php + +/** + * Manage the sharing options in FreshRSS. + */ +class FreshRSS_Share { + /** + * The list of available sharing options. + */ + private static $list_sharing = array(); + + /** + * Register a new sharing option. + * @param $share_options is an array defining the share option. + */ + public static function register($share_options) { + $type = $share_options['type']; + + if (isset(self::$list_sharing[$type])) { + return; + } + + $help_url = isset($share_options['help']) ? $share_options['help'] : ''; + self::$list_sharing[$type] = new FreshRSS_Share( + $type, $share_options['url'], $share_options['transform'], + $share_options['form'], $help_url + ); + } + + /** + * Register sharing options in a file. + * @param $filename the name of the file to load. + */ + public static function load($filename) { + $shares_from_file = @include($filename); + if (!is_array($shares_from_file)) { + $shares_from_file = array(); + } + + foreach ($shares_from_file as $share_type => $share_options) { + $share_options['type'] = $share_type; + self::register($share_options); + } + } + + /** + * Return the list of sharing options. + * @return an array of FreshRSS_Share objects. + */ + public static function enum() { + return self::$list_sharing; + } + + /** + * Return FreshRSS_Share object related to the given type. + * @param $type the share type, null if $type is not registered. + */ + public static function get($type) { + if (!isset(self::$list_sharing[$type])) { + return null; + } + + return self::$list_sharing[$type]; + } + + /** + * + */ + private $type = ''; + private $name = ''; + private $url_transform = ''; + private $transform = array(); + private $form_type = 'simple'; + private $help_url = ''; + private $custom_name = null; + private $base_url = null; + private $title = null; + private $link = null; + + /** + * Create a FreshRSS_Share object. + * @param $type is a unique string defining the kind of share option. + * @param $url_transform defines the url format to use in order to share. + * @param $transform is an array of transformations to apply on link and title. + * @param $form_type defines which form we have to use to complete. "simple" + * is typically for a centralized service while "advanced" is for + * decentralized ones. + * @param $help_url is an optional url to give help on this option. + */ + private function __construct($type, $url_transform, $transform = array(), + $form_type, $help_url = '') { + $this->type = $type; + $this->name = _t('gen.share.' . $type); + $this->url_transform = $url_transform; + $this->help_url = $help_url; + + if (!is_array($transform)) { + $transform = array(); + } + $this->transform = $transform; + + if (!in_array($form_type, array('simple', 'advanced'))) { + $form_type = 'simple'; + } + $this->form_type = $form_type; + } + + /** + * Update a FreshRSS_Share object with information from an array. + * @param $options is a list of informations to update where keys should be + * in this list: name, url, title, link. + */ + public function update($options) { + $available_options = array( + 'name' => 'custom_name', + 'url' => 'base_url', + 'title' => 'title', + 'link' => 'link', + ); + + foreach ($options as $key => $value) { + if (isset($available_options[$key])) { + $this->{$available_options[$key]} = $value; + } + } + } + + /** + * Return the current type of the share option. + */ + public function type() { + return $this->type; + } + + /** + * Return the current form type of the share option. + */ + public function formType() { + return $this->form_type; + } + + /** + * Return the current help url of the share option. + */ + public function help() { + return $this->help_url; + } + + /** + * Return the current name of the share option. + */ + public function name($real = false) { + if ($real || is_null($this->custom_name) || empty($this->custom_name)) { + return $this->name; + } else { + return $this->custom_name; + } + } + + /** + * Return the current base url of the share option. + */ + public function baseUrl() { + return $this->base_url; + } + + /** + * Return the current url by merging url_transform and base_url. + */ + public function url() { + $matches = array( + '~URL~', + '~TITLE~', + '~LINK~', + ); + $replaces = array( + $this->base_url, + $this->title(), + $this->link(), + ); + return str_replace($matches, $replaces, $this->url_transform); + } + + /** + * Return the title. + * @param $raw true if we should get the title without transformations. + */ + public function title($raw = false) { + if ($raw) { + return $this->title; + } + + return $this->transform($this->title, $this->getTransform('title')); + } + + /** + * Return the link. + * @param $raw true if we should get the link without transformations. + */ + public function link($raw = false) { + if ($raw) { + return $this->link; + } + + return $this->transform($this->link, $this->getTransform('link')); + } + + /** + * Transform a data with the given functions. + * @param $data the data to transform. + * @param $tranform an array containing a list of functions to apply. + * @return the transformed data. + */ + private static function transform($data, $transform) { + if (!is_array($transform) || empty($transform)) { + return $data; + } + + foreach ($transform as $action) { + $data = call_user_func($action, $data); + } + + return $data; + } + + /** + * Get the list of transformations for the given attribute. + * @param $attr the attribute of which we want the transformations. + * @return an array containing a list of transformations to apply. + */ + private function getTransform($attr) { + if (array_key_exists($attr, $this->transform)) { + return $this->transform[$attr]; + } + + return $this->transform; + } +} diff --git a/app/Models/StatsDAO.php b/app/Models/StatsDAO.php index 60cec7847..2ce4f2944 100644 --- a/app/Models/StatsDAO.php +++ b/app/Models/StatsDAO.php @@ -2,124 +2,257 @@ class FreshRSS_StatsDAO extends Minz_ModelPdo { + const ENTRY_COUNT_PERIOD = 30; + + protected function sqlFloor($s) { + return "FLOOR($s)"; + } + /** * Calculates entry repartition for all feeds and for main stream. + * + * @return array + */ + public function calculateEntryRepartition() { + return array( + 'main_stream' => $this->calculateEntryRepartitionPerFeed(null, true), + 'all_feeds' => $this->calculateEntryRepartitionPerFeed(null, false), + ); + } + + /** + * Calculates entry repartition for the selection. * The repartition includes: * - total entries * - read entries * - unread entries * - favorite entries - * - * @return type + * + * @param null|integer $feed feed id + * @param boolean $only_main + * @return array */ - public function calculateEntryRepartition() { - $repartition = array(); - - // Generates the repartition for the main stream of entry + public function calculateEntryRepartitionPerFeed($feed = null, $only_main = false) { + $filter = ''; + if ($only_main) { + $filter .= 'AND f.priority = 10'; + } + if (!is_null($feed)) { + $filter .= "AND e.id_feed = {$feed}"; + } $sql = <<<SQL -SELECT COUNT(1) AS `total`, -COUNT(1) - SUM(e.is_read) AS `unread`, -SUM(e.is_read) AS `read`, -SUM(e.is_favorite) AS `favorite` -FROM {$this->prefix}entry AS e -, {$this->prefix}feed AS f +SELECT COUNT(1) AS total, +COUNT(1) - SUM(e.is_read) AS count_unreads, +SUM(e.is_read) AS count_reads, +SUM(e.is_favorite) AS count_favorites +FROM `{$this->prefix}entry` AS e +, `{$this->prefix}feed` AS f WHERE e.id_feed = f.id -AND f.priority = 10 +{$filter} SQL; $stm = $this->bd->prepare($sql); $stm->execute(); $res = $stm->fetchAll(PDO::FETCH_ASSOC); - $repartition['main_stream'] = $res[0]; - // Generates the repartition for all entries + return $res[0]; + } + + /** + * Calculates entry count per day on a 30 days period. + * Returns the result as a JSON object. + * + * @return JSON object + */ + public function calculateEntryCount() { + $count = $this->initEntryCountArray(); + $midnight = mktime(0, 0, 0); + $oldest = $midnight - (self::ENTRY_COUNT_PERIOD * 86400); + + // Get stats per day for the last 30 days + $sqlDay = $this->sqlFloor("(date - $midnight) / 86400"); $sql = <<<SQL -SELECT COUNT(1) AS `total`, -COUNT(1) - SUM(e.is_read) AS `unread`, -SUM(e.is_read) AS `read`, -SUM(e.is_favorite) AS `favorite` -FROM {$this->prefix}entry AS e +SELECT {$sqlDay} AS day, +COUNT(*) as count +FROM `{$this->prefix}entry` +WHERE date >= {$oldest} AND date < {$midnight} +GROUP BY day +ORDER BY day ASC SQL; $stm = $this->bd->prepare($sql); $stm->execute(); $res = $stm->fetchAll(PDO::FETCH_ASSOC); - $repartition['all_feeds'] = $res[0]; - return $repartition; + foreach ($res as $value) { + $count[$value['day']] = (int) $value['count']; + } + + return $count; } /** - * Calculates entry count per day on a 30 days period. - * Returns the result as a JSON string. - * + * Initialize an array for the entry count. + * + * @return array + */ + protected function initEntryCountArray() { + return $this->initStatsArray(-self::ENTRY_COUNT_PERIOD, -1); + } + + /** + * Calculates the number of article per hour of the day per feed + * + * @param integer $feed id * @return string */ - public function calculateEntryCount() { - $count = array(); + public function calculateEntryRepartitionPerFeedPerHour($feed = null) { + return $this->calculateEntryRepartitionPerFeedPerPeriod('%H', $feed); + } + + /** + * Calculates the number of article per day of week per feed + * + * @param integer $feed id + * @return string + */ + public function calculateEntryRepartitionPerFeedPerDayOfWeek($feed = null) { + return $this->calculateEntryRepartitionPerFeedPerPeriod('%w', $feed); + } - // Generates a list of 30 last day to be sure we always have 30 days. - // If we do not do that kind of thing, we'll end up with holes in the - // days if the user do not have a lot of feeds. + /** + * Calculates the number of article per month per feed + * + * @param integer $feed + * @return string + */ + public function calculateEntryRepartitionPerFeedPerMonth($feed = null) { + return $this->calculateEntryRepartitionPerFeedPerPeriod('%m', $feed); + } + + /** + * Calculates the number of article per period per feed + * + * @param string $period format string to use for grouping + * @param integer $feed id + * @return string + */ + protected function calculateEntryRepartitionPerFeedPerPeriod($period, $feed = null) { + $restrict = ''; + if ($feed) { + $restrict = "WHERE e.id_feed = {$feed}"; + } $sql = <<<SQL -SELECT - (tens.val + units.val + 1) AS day -FROM ( - SELECT 0 AS val - UNION ALL SELECT 1 - UNION ALL SELECT 2 - UNION ALL SELECT 3 - UNION ALL SELECT 4 - UNION ALL SELECT 5 - UNION ALL SELECT 6 - UNION ALL SELECT 7 - UNION ALL SELECT 8 - UNION ALL SELECT 9 -) AS units -CROSS JOIN ( - SELECT 0 AS val - UNION ALL SELECT 10 - UNION ALL SELECT 20 -) AS tens -ORDER BY day ASC +SELECT DATE_FORMAT(FROM_UNIXTIME(e.date), '{$period}') AS period +, COUNT(1) AS count +FROM `{$this->prefix}entry` AS e +{$restrict} +GROUP BY period +ORDER BY period ASC SQL; + $stm = $this->bd->prepare($sql); $stm->execute(); - $res = $stm->fetchAll(PDO::FETCH_ASSOC); + $res = $stm->fetchAll(PDO::FETCH_NAMED); + + $repartition = array(); foreach ($res as $value) { - $count[$value['day']] = 0; + $repartition[(int) $value['period']] = (int) $value['count']; } - // Get stats per day for the last 30 days and applies the result on - // the array created with the last query. + return $repartition; + } + + /** + * Calculates the average number of article per hour per feed + * + * @param integer $feed id + * @return integer + */ + public function calculateEntryAveragePerFeedPerHour($feed = null) { + return $this->calculateEntryAveragePerFeedPerPeriod(1 / 24, $feed); + } + + /** + * Calculates the average number of article per day of week per feed + * + * @param integer $feed id + * @return integer + */ + public function calculateEntryAveragePerFeedPerDayOfWeek($feed = null) { + return $this->calculateEntryAveragePerFeedPerPeriod(7, $feed); + } + + /** + * Calculates the average number of article per month per feed + * + * @param integer $feed id + * @return integer + */ + public function calculateEntryAveragePerFeedPerMonth($feed = null) { + return $this->calculateEntryAveragePerFeedPerPeriod(30, $feed); + } + + /** + * Calculates the average number of article per feed + * + * @param float $period number used to divide the number of day in the period + * @param integer $feed id + * @return integer + */ + protected function calculateEntryAveragePerFeedPerPeriod($period, $feed = null) { + $restrict = ''; + if ($feed) { + $restrict = "WHERE e.id_feed = {$feed}"; + } $sql = <<<SQL -SELECT DATEDIFF(FROM_UNIXTIME(e.date), NOW()) AS day, -COUNT(1) AS count -FROM {$this->prefix}entry AS e -WHERE FROM_UNIXTIME(e.date, '%Y%m%d') BETWEEN DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -30 DAY), '%Y%m%d') AND DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -1 DAY), '%Y%m%d') -GROUP BY day -ORDER BY day ASC +SELECT COUNT(1) AS count +, MIN(date) AS date_min +, MAX(date) AS date_max +FROM `{$this->prefix}entry` AS e +{$restrict} SQL; $stm = $this->bd->prepare($sql); $stm->execute(); - $res = $stm->fetchAll(PDO::FETCH_ASSOC); - - foreach ($res as $value) { - $count[$value['day']] = (int) $value['count']; + $res = $stm->fetch(PDO::FETCH_NAMED); + $date_min = new \DateTime(); + $date_min->setTimestamp($res['date_min']); + $date_max = new \DateTime(); + $date_max->setTimestamp($res['date_max']); + $interval = $date_max->diff($date_min, true); + $interval_in_days = $interval->format('%a'); + if ($interval_in_days <= 0) { + // Surely only one article. + // We will return count / (period/period) == count. + $interval_in_days = $period; } - return $this->convertToSerie($count); + return $res['count'] / ($interval_in_days / $period); + } + + /** + * Initialize an array for statistics depending on a range + * + * @param integer $min + * @param integer $max + * @return array + */ + protected function initStatsArray($min, $max) { + return array_map(function () { + return 0; + }, array_flip(range($min, $max))); } /** * Calculates feed count per category. - * Returns the result as a JSON string. - * - * @return string + * Returns the result as a JSON object. + * + * @return JSON object */ public function calculateFeedByCategory() { $sql = <<<SQL SELECT c.name AS label , COUNT(f.id) AS data -FROM {$this->prefix}category AS c, -{$this->prefix}feed AS f +FROM `{$this->prefix}category` AS c, +`{$this->prefix}feed` AS f WHERE c.id = f.category GROUP BY label ORDER BY data DESC @@ -128,22 +261,22 @@ SQL; $stm->execute(); $res = $stm->fetchAll(PDO::FETCH_ASSOC); - return $this->convertToPieSerie($res); + return $res; } /** * Calculates entry count per category. * Returns the result as a JSON string. - * - * @return string + * + * @return JSON object */ public function calculateEntryByCategory() { $sql = <<<SQL SELECT c.name AS label , COUNT(e.id) AS data -FROM {$this->prefix}category AS c, -{$this->prefix}feed AS f, -{$this->prefix}entry AS e +FROM `{$this->prefix}category` AS c, +`{$this->prefix}feed` AS f, +`{$this->prefix}entry` AS e WHERE c.id = f.category AND f.id = e.id_feed GROUP BY label @@ -153,12 +286,12 @@ SQL; $stm->execute(); $res = $stm->fetchAll(PDO::FETCH_ASSOC); - return $this->convertToPieSerie($res); + return $res; } /** * Calculates the 10 top feeds based on their number of entries - * + * * @return array */ public function calculateTopFeed() { @@ -167,12 +300,12 @@ SELECT f.id AS id , MAX(f.name) AS name , MAX(c.name) AS category , COUNT(e.id) AS count -FROM {$this->prefix}category AS c, -{$this->prefix}feed AS f, -{$this->prefix}entry AS e +FROM `{$this->prefix}category` AS c, +`{$this->prefix}feed` AS f, +`{$this->prefix}entry` AS e WHERE c.id = f.category AND f.id = e.id_feed -GROUP BY id +GROUP BY f.id ORDER BY count DESC LIMIT 10 SQL; @@ -181,25 +314,79 @@ SQL; return $stm->fetchAll(PDO::FETCH_ASSOC); } - private function convertToSerie($data) { - $serie = array(); - - foreach ($data as $key => $value) { - $serie[] = array($key, $value); - } + /** + * Calculates the last publication date for each feed + * + * @return array + */ + public function calculateFeedLastDate() { + $sql = <<<SQL +SELECT MAX(f.id) as id +, MAX(f.name) AS name +, MAX(date) AS last_date +, COUNT(*) AS nb_articles +FROM `{$this->prefix}feed` AS f, +`{$this->prefix}entry` AS e +WHERE f.id = e.id_feed +GROUP BY f.id +ORDER BY name +SQL; + $stm = $this->bd->prepare($sql); + $stm->execute(); + return $stm->fetchAll(PDO::FETCH_ASSOC); + } - return json_encode($serie); + /** + * Gets days ready for graphs + * + * @return string + */ + public function getDays() { + return $this->convertToTranslatedJson(array( + 'sun', + 'mon', + 'tue', + 'wed', + 'thu', + 'fri', + 'sat', + )); } - private function convertToPieSerie($data) { - $serie = array(); + /** + * Gets months ready for graphs + * + * @return string + */ + public function getMonths() { + return $this->convertToTranslatedJson(array( + 'jan', + 'feb', + 'mar', + 'apr', + 'may', + 'jun', + 'jul', + 'aug', + 'sep', + 'oct', + 'nov', + 'dec', + )); + } - foreach ($data as $value) { - $value['data'] = array(array(0, (int) $value['data'])); - $serie[] = $value; - } + /** + * Translates array content + * + * @param array $data + * @return JSON object + */ + private function convertToTranslatedJson($data = array()) { + $translated = array_map(function($a) { + return _t('gen.date.' . $a); + }, $data); - return json_encode($serie); + return $translated; } } diff --git a/app/Models/StatsDAOPGSQL.php b/app/Models/StatsDAOPGSQL.php new file mode 100644 index 000000000..1effbb64b --- /dev/null +++ b/app/Models/StatsDAOPGSQL.php @@ -0,0 +1,67 @@ +<?php + +class FreshRSS_StatsDAOPGSQL extends FreshRSS_StatsDAO { + + /** + * Calculates the number of article per hour of the day per feed + * + * @param integer $feed id + * @return string + */ + public function calculateEntryRepartitionPerFeedPerHour($feed = null) { + return $this->calculateEntryRepartitionPerFeedPerPeriod('hour', $feed); + } + + /** + * Calculates the number of article per day of week per feed + * + * @param integer $feed id + * @return string + */ + public function calculateEntryRepartitionPerFeedPerDayOfWeek($feed = null) { + return $this->calculateEntryRepartitionPerFeedPerPeriod('day', $feed); + } + + /** + * Calculates the number of article per month per feed + * + * @param integer $feed + * @return string + */ + public function calculateEntryRepartitionPerFeedPerMonth($feed = null) { + return $this->calculateEntryRepartitionPerFeedPerPeriod('month', $feed); + } + + /** + * Calculates the number of article per period per feed + * + * @param string $period format string to use for grouping + * @param integer $feed id + * @return string + */ + protected function calculateEntryRepartitionPerFeedPerPeriod($period, $feed = null) { + $restrict = ''; + if ($feed) { + $restrict = "WHERE e.id_feed = {$feed}"; + } + $sql = <<<SQL +SELECT extract( {$period} from to_timestamp(e.date)) AS period +, COUNT(1) AS count +FROM "{$this->prefix}entry" AS e +{$restrict} +GROUP BY period +ORDER BY period ASC +SQL; + + $stm = $this->bd->prepare($sql); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_NAMED); + + foreach ($res as $value) { + $repartition[(int) $value['period']] = (int) $value['count']; + } + + return $repartition; + } + +} diff --git a/app/Models/StatsDAOSQLite.php b/app/Models/StatsDAOSQLite.php new file mode 100644 index 000000000..6cfc20463 --- /dev/null +++ b/app/Models/StatsDAOSQLite.php @@ -0,0 +1,36 @@ +<?php + +class FreshRSS_StatsDAOSQLite extends FreshRSS_StatsDAO { + + protected function sqlFloor($s) { + return "CAST(($s) AS INT)"; + } + + protected function calculateEntryRepartitionPerFeedPerPeriod($period, $feed = null) { + if ($feed) { + $restrict = "WHERE e.id_feed = {$feed}"; + } else { + $restrict = ''; + } + $sql = <<<SQL +SELECT strftime('{$period}', e.date, 'unixepoch') AS period +, COUNT(1) AS count +FROM `{$this->prefix}entry` AS e +{$restrict} +GROUP BY period +ORDER BY period ASC +SQL; + + $stm = $this->bd->prepare($sql); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_NAMED); + + $repartition = array(); + foreach ($res as $value) { + $repartition[(int) $value['period']] = (int) $value['count']; + } + + return $repartition; + } + +} diff --git a/app/Models/Themes.php b/app/Models/Themes.php index c7099a1df..5a6ec0a05 100644 --- a/app/Models/Themes.php +++ b/app/Models/Themes.php @@ -31,7 +31,10 @@ class FreshRSS_Themes extends Minz_Model { if (file_exists($json_filename)) { $content = file_get_contents($json_filename); $res = json_decode($content, true); - if ($res && isset($res['files']) && is_array($res['files'])) { + if ($res && + !empty($res['name']) && + isset($res['files']) && + is_array($res['files'])) { $res['id'] = $theme_id; return $res; } @@ -70,6 +73,7 @@ class FreshRSS_Themes extends Minz_Model { 'add' => '✚', 'all' => '☰', 'bookmark' => '★', + 'bookmark-add' => '✚', 'category' => '☷', 'category-white' => '☷', 'close' => '❌', @@ -77,6 +81,9 @@ class FreshRSS_Themes extends Minz_Model { 'down' => '▽', 'favorite' => '★', 'help' => 'ⓘ', + 'icon' => '⊚', + 'import' => '⤓', + 'key' => '⚿', 'link' => '↗', 'login' => '🔒', 'logout' => '🔓', @@ -84,13 +91,18 @@ class FreshRSS_Themes extends Minz_Model { 'non-starred' => '☆', 'prev' => '⏪', 'read' => '☑', + 'rss' => '☄', 'unread' => '☐', 'refresh' => '🔃', //↻ 'search' => '🔍', 'share' => '♺', 'starred' => '★', + 'stats' => '%', 'tag' => '⚐', 'up' => '△', + 'view-normal' => '☰', + 'view-global' => '☷', + 'view-reader' => '☕', ); if (!isset($alts[$name])) { return ''; diff --git a/app/Models/UserDAO.php b/app/Models/UserDAO.php index a25b57f89..32bc6de2f 100644 --- a/app/Models/UserDAO.php +++ b/app/Models/UserDAO.php @@ -1,36 +1,97 @@ <?php class FreshRSS_UserDAO extends Minz_ModelPdo { - public function createUser($username) { - require_once(APP_PATH . '/sql.php'); - $db = Minz_Configuration::dataBase(); - - $sql = sprintf(SQL_CREATE_TABLES, $db['prefix'] . $username . '_'); - $stm = $this->bd->prepare($sql, array(PDO::ATTR_EMULATE_PREPARES => true)); - $values = array( - 'catName' => Minz_Translate::t('default_category'), - ); - if ($stm && $stm->execute($values)) { + public function createUser($username, $new_user_language, $insertDefaultFeeds = true) { + $db = FreshRSS_Context::$system_conf->db; + require_once(APP_PATH . '/SQL/install.sql.' . $db['type'] . '.php'); + + $userPDO = new Minz_ModelPdo($username); + + $currentLanguage = Minz_Translate::language(); + + try { + Minz_Translate::reset($new_user_language); + $ok = false; + $bd_prefix_user = $db['prefix'] . $username . '_'; + if (defined('SQL_CREATE_TABLES')) { //E.g. MySQL + $sql = sprintf(SQL_CREATE_TABLES, $bd_prefix_user, _t('gen.short.default_category')); + $stm = $userPDO->bd->prepare($sql); + $ok = $stm && $stm->execute(); + } else { //E.g. SQLite + global $SQL_CREATE_TABLES; + if (is_array($SQL_CREATE_TABLES)) { + $ok = true; + foreach ($SQL_CREATE_TABLES as $instruction) { + $sql = sprintf($instruction, $bd_prefix_user, _t('gen.short.default_category')); + $stm = $userPDO->bd->prepare($sql); + $ok &= ($stm && $stm->execute()); + } + } + } + if ($insertDefaultFeeds) { + if (defined('SQL_INSERT_FEEDS')) { //E.g. MySQL + $sql = sprintf(SQL_INSERT_FEEDS, $bd_prefix_user); + $stm = $userPDO->bd->prepare($sql); + $ok &= $stm && $stm->execute(); + } else { //E.g. SQLite + global $SQL_INSERT_FEEDS; + if (is_array($SQL_INSERT_FEEDS)) { + foreach ($SQL_INSERT_FEEDS as $instruction) { + $sql = sprintf($instruction, $bd_prefix_user); + $stm = $userPDO->bd->prepare($sql); + $ok &= ($stm && $stm->execute()); + } + } + } + } + } catch (Exception $e) { + Minz_Log::error('Error while creating user: ' . $e->getMessage()); + } + + Minz_Translate::reset($currentLanguage); + + if ($ok) { return true; } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); + $info = empty($stm) ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error: ' . $info[2]); return false; } } public function deleteUser($username) { - require_once(APP_PATH . '/sql.php'); - $db = Minz_Configuration::dataBase(); + $db = FreshRSS_Context::$system_conf->db; + require_once(APP_PATH . '/SQL/install.sql.' . $db['type'] . '.php'); - $sql = sprintf(SQL_DROP_TABLES, $db['prefix'] . $username . '_'); - $stm = $this->bd->prepare($sql); - if ($stm && $stm->execute()) { - return true; + if ($db['type'] === 'sqlite') { + return unlink(join_path(DATA_PATH, 'users', $username, 'db.sqlite')); } else { - $info = $stm->errorInfo(); - Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR); - return false; + $userPDO = new Minz_ModelPdo($username); + + $sql = sprintf(SQL_DROP_TABLES, $db['prefix'] . $username . '_'); + $stm = $userPDO->bd->prepare($sql); + if ($stm && $stm->execute()) { + return true; + } else { + $info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo(); + Minz_Log::error('SQL error : ' . $info[2]); + return false; + } + } + } + + public static function exist($username) { + return is_dir(join_path(DATA_PATH , 'users', $username)); + } + + public static function touch($username = '') { + if (($username == '') || (!ctype_alnum($username))) { + $username = Minz_Session::param('currentUser', '_'); } + return touch(join_path(DATA_PATH , 'users', $username, 'config.php')); + } + + public static function mtime($username) { + return @filemtime(join_path(DATA_PATH , 'users', $username, 'config.php')); } } diff --git a/app/Models/UserQuery.php b/app/Models/UserQuery.php new file mode 100644 index 000000000..52747f538 --- /dev/null +++ b/app/Models/UserQuery.php @@ -0,0 +1,226 @@ +<?php + +/** + * Contains the description of a user query + * + * It allows to extract the meaningful bits of the query to be manipulated in an + * easy way. + */ +class FreshRSS_UserQuery { + + private $deprecated = false; + private $get; + private $get_name; + private $get_type; + private $name; + private $order; + private $search; + private $state; + private $url; + private $feed_dao; + private $category_dao; + + /** + * @param array $query + * @param FreshRSS_Searchable $feed_dao + * @param FreshRSS_Searchable $category_dao + */ + public function __construct($query, FreshRSS_Searchable $feed_dao = null, FreshRSS_Searchable $category_dao = null) { + $this->category_dao = $category_dao; + $this->feed_dao = $feed_dao; + if (isset($query['get'])) { + $this->parseGet($query['get']); + } + if (isset($query['name'])) { + $this->name = $query['name']; + } + if (isset($query['order'])) { + $this->order = $query['order']; + } + if (!isset($query['search'])) { + $query['search'] = ''; + } + // linked to deeply with the search object, need to use dependency injection + $this->search = new FreshRSS_Search($query['search']); + if (isset($query['state'])) { + $this->state = $query['state']; + } + if (isset($query['url'])) { + $this->url = $query['url']; + } + } + + /** + * Convert the current object to an array. + * + * @return array + */ + public function toArray() { + return array_filter(array( + 'get' => $this->get, + 'name' => $this->name, + 'order' => $this->order, + 'search' => $this->search->__toString(), + 'state' => $this->state, + 'url' => $this->url, + )); + } + + /** + * Parse the get parameter in the query string to extract its name and + * type + * + * @param string $get + */ + private function parseGet($get) { + $this->get = $get; + if (preg_match('/(?P<type>[acfs])(_(?P<id>\d+))?/', $get, $matches)) { + switch ($matches['type']) { + case 'a': + $this->parseAll(); + break; + case 'c': + $this->parseCategory($matches['id']); + break; + case 'f': + $this->parseFeed($matches['id']); + break; + case 's': + $this->parseFavorite(); + break; + } + } + } + + /** + * Parse the query string when it is an "all" query + */ + private function parseAll() { + $this->get_name = 'all'; + $this->get_type = 'all'; + } + + /** + * Parse the query string when it is a "category" query + * + * @param integer $id + * @throws FreshRSS_DAO_Exception + */ + private function parseCategory($id) { + if (is_null($this->category_dao)) { + throw new FreshRSS_DAO_Exception('Category DAO is not loaded in UserQuery'); + } + $category = $this->category_dao->searchById($id); + if ($category) { + $this->get_name = $category->name(); + } else { + $this->deprecated = true; + } + $this->get_type = 'category'; + } + + /** + * Parse the query string when it is a "feed" query + * + * @param integer $id + * @throws FreshRSS_DAO_Exception + */ + private function parseFeed($id) { + if (is_null($this->feed_dao)) { + throw new FreshRSS_DAO_Exception('Feed DAO is not loaded in UserQuery'); + } + $feed = $this->feed_dao->searchById($id); + if ($feed) { + $this->get_name = $feed->name(); + } else { + $this->deprecated = true; + } + $this->get_type = 'feed'; + } + + /** + * Parse the query string when it is a "favorite" query + */ + private function parseFavorite() { + $this->get_name = 'favorite'; + $this->get_type = 'favorite'; + } + + /** + * Check if the current user query is deprecated. + * It is deprecated if the category or the feed used in the query are + * not existing. + * + * @return boolean + */ + public function isDeprecated() { + return $this->deprecated; + } + + /** + * Check if the user query has parameters. + * If the type is 'all', it is considered equal to no parameters + * + * @return boolean + */ + public function hasParameters() { + if ($this->get_type === 'all') { + return false; + } + if ($this->hasSearch()) { + return true; + } + if ($this->state) { + return true; + } + if ($this->order) { + return true; + } + if ($this->get) { + return true; + } + return false; + } + + /** + * Check if there is a search in the search object + * + * @return boolean + */ + public function hasSearch() { + return $this->search->getRawInput() != ""; + } + + public function getGet() { + return $this->get; + } + + public function getGetName() { + return $this->get_name; + } + + public function getGetType() { + return $this->get_type; + } + + public function getName() { + return $this->name; + } + + public function getOrder() { + return $this->order; + } + + public function getSearch() { + return $this->search; + } + + public function getState() { + return $this->state; + } + + public function getUrl() { + return $this->url; + } + +} diff --git a/app/SQL/install.sql.mysql.php b/app/SQL/install.sql.mysql.php new file mode 100644 index 000000000..a454829d5 --- /dev/null +++ b/app/SQL/install.sql.mysql.php @@ -0,0 +1,90 @@ +<?php +define('SQL_CREATE_DB', 'CREATE DATABASE IF NOT EXISTS %1$s DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + +define('SQL_CREATE_TABLES', ' +CREATE TABLE IF NOT EXISTS `%1$scategory` ( + `id` SMALLINT NOT NULL AUTO_INCREMENT, -- v0.7 + `name` varchar(191) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY (`name`) -- v0.7 +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci +ENGINE = INNODB; + +CREATE TABLE IF NOT EXISTS `%1$sfeed` ( + `id` SMALLINT NOT NULL AUTO_INCREMENT, -- v0.7 + `url` varchar(511) CHARACTER SET latin1 NOT NULL, + `category` SMALLINT DEFAULT 0, -- v0.7 + `name` varchar(191) NOT NULL, + `website` varchar(255) CHARACTER SET latin1, + `description` text, + `lastUpdate` int(11) DEFAULT 0, -- Until year 2038 + `priority` tinyint(2) NOT NULL DEFAULT 10, + `pathEntries` varchar(511) DEFAULT NULL, + `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 + `cache_nbEntries` int DEFAULT 0, -- v0.7 + `cache_nbUnreads` int DEFAULT 0, -- v0.7 + PRIMARY KEY (`id`), + FOREIGN KEY (`category`) REFERENCES `%1$scategory`(`id`) ON DELETE SET NULL ON UPDATE CASCADE, + UNIQUE KEY (`url`), -- v0.7 + INDEX (`name`), -- v0.7 + INDEX (`priority`), -- v0.7 + INDEX (`keep_history`) -- v0.7 +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci +ENGINE = INNODB; + +CREATE TABLE IF NOT EXISTS `%1$sentry` ( + `id` bigint NOT NULL, -- v0.7 + `guid` varchar(760) CHARACTER SET latin1 NOT NULL, -- Maximum for UNIQUE is 767B + `title` varchar(255) NOT NULL, + `author` varchar(255), + `content_bin` blob, -- v0.7 + `link` varchar(1023) CHARACTER SET latin1 NOT NULL, + `date` int(11), -- Until year 2038 + `lastSeen` INT(11) DEFAULT 0, -- v1.1.1, Until year 2038 + `hash` BINARY(16), -- v1.1.1 + `is_read` boolean NOT NULL DEFAULT 0, + `is_favorite` boolean NOT NULL DEFAULT 0, + `id_feed` SMALLINT, -- v0.7 + `tags` varchar(1023), + PRIMARY KEY (`id`), + FOREIGN KEY (`id_feed`) REFERENCES `%1$sfeed`(`id`) ON DELETE CASCADE ON UPDATE CASCADE, + UNIQUE KEY (`id_feed`,`guid`), -- v0.7 + INDEX (`is_favorite`), -- v0.7 + INDEX (`is_read`), -- v0.7 + INDEX `entry_lastSeen_index` (`lastSeen`) -- v1.1.1 +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci +ENGINE = INNODB; + +INSERT IGNORE INTO `%1$scategory` (id, name) VALUES(1, "%2$s"); +'); + +define('SQL_INSERT_FEEDS', ' +INSERT IGNORE INTO `%1$sfeed` (url, category, name, website, description, ttl) VALUES("http://freshrss.org/feeds/all.atom.xml", 1, "FreshRSS.org", "http://freshrss.org/", "FreshRSS, a free, self-hostable aggregator…", 86400); +INSERT IGNORE INTO `%1$sfeed` (url, category, name, website, description, ttl) VALUES("https://github.com/FreshRSS/FreshRSS/releases.atom", 1, "FreshRSS @ GitHub", "https://github.com/FreshRSS/FreshRSS/", "FreshRSS releases @ GitHub", 86400); +'); + +define('SQL_DROP_TABLES', 'DROP TABLE IF EXISTS `%1$sentry`, `%1$sfeed`, `%1$scategory`'); + +define('SQL_UPDATE_UTF8MB4', ' +ALTER DATABASE `%2$s` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +ALTER TABLE `%1$scategory` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +UPDATE `%1$scategory` SET name=SUBSTRING(name,1,190) WHERE LENGTH(name) > 191; +ALTER TABLE `%1$scategory` MODIFY `name` VARCHAR(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL; +OPTIMIZE TABLE `%1$scategory`; + +ALTER TABLE `%1$sfeed` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +UPDATE `%1$sfeed` SET name=SUBSTRING(name,1,190) WHERE LENGTH(name) > 191; +ALTER TABLE `%1$sfeed` MODIFY `name` VARCHAR(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL; +ALTER TABLE `%1$sfeed` MODIFY `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +OPTIMIZE TABLE `%1$sfeed`; + +ALTER TABLE `%1$sentry` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +ALTER TABLE `%1$sentry` MODIFY `title` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL; +ALTER TABLE `%1$sentry` MODIFY `author` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +ALTER TABLE `%1$sentry` MODIFY `tags` VARCHAR(1023) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +OPTIMIZE TABLE `%1$sentry`; +'); diff --git a/app/SQL/install.sql.pgsql.php b/app/SQL/install.sql.pgsql.php new file mode 100644 index 000000000..9f4240b98 --- /dev/null +++ b/app/SQL/install.sql.pgsql.php @@ -0,0 +1,63 @@ +<?php +define('SQL_CREATE_DB', 'CREATE DATABASE %1$s ENCODING \'UTF8\';'); + +global $SQL_CREATE_TABLES; +$SQL_CREATE_TABLES = array( +'CREATE TABLE IF NOT EXISTS "%1$scategory" ( + "id" SERIAL PRIMARY KEY, + "name" VARCHAR(255) UNIQUE NOT NULL +);', + +'CREATE TABLE IF NOT EXISTS "%1$sfeed" ( + "id" SERIAL PRIMARY KEY, + "url" varchar(511) UNIQUE NOT NULL, + "category" SMALLINT DEFAULT 0, + "name" VARCHAR(255) NOT NULL, + "website" VARCHAR(255), + "description" text, + "lastUpdate" INT DEFAULT 0, + "priority" SMALLINT NOT NULL DEFAULT 10, + "pathEntries" VARCHAR(511) DEFAULT NULL, + "httpAuth" VARCHAR(511) DEFAULT NULL, + "error" smallint DEFAULT 0, + "keep_history" INT NOT NULL DEFAULT -2, + "ttl" INT NOT NULL DEFAULT -2, + "cache_nbEntries" INT DEFAULT 0, + "cache_nbUnreads" INT DEFAULT 0, + FOREIGN KEY ("category") REFERENCES "%1$scategory" ("id") ON DELETE SET NULL ON UPDATE CASCADE +);', +'CREATE INDEX %1$sname_index ON "%1$sfeed" ("name");', +'CREATE INDEX %1$spriority_index ON "%1$sfeed" ("priority");', +'CREATE INDEX %1$skeep_history_index ON "%1$sfeed" ("keep_history");', + +'CREATE TABLE IF NOT EXISTS "%1$sentry" ( + "id" BIGINT NOT NULL PRIMARY KEY, + "guid" VARCHAR(760) UNIQUE NOT NULL, + "title" VARCHAR(255) NOT NULL, + "author" VARCHAR(255), + "content" TEXT, + "link" VARCHAR(1023) NOT NULL, + "date" INT, + "lastSeen" INT DEFAULT 0, + "hash" BYTEA, + "is_read" SMALLINT NOT NULL DEFAULT 0, + "is_favorite" SMALLINT NOT NULL DEFAULT 0, + "id_feed" SMALLINT, + "tags" VARCHAR(1023), + FOREIGN KEY ("id_feed") REFERENCES "%1$sfeed" ("id") ON DELETE CASCADE ON UPDATE CASCADE, + UNIQUE ("id_feed","guid") +);', +'CREATE INDEX %1$sis_favorite_index ON "%1$sentry" ("is_favorite");', +'CREATE INDEX %1$sis_read_index ON "%1$sentry" ("is_read");', +'CREATE INDEX %1$sentry_lastSeen_index ON "%1$sentry" ("lastSeen");', + +'INSERT INTO "%1$scategory" (name) SELECT \'%2$s\' WHERE NOT EXISTS (SELECT id FROM "%1$scategory" WHERE id = 1);', +); + +global $SQL_INSERT_FEEDS; +$SQL_INSERT_FEEDS = array( +'INSERT INTO "%1$sfeed" (url, category, name, website, description, ttl) SELECT \'http://freshrss.org/feeds/all.atom.xml\', 1, \'FreshRSS.org\', \'http://freshrss.org/\', \'FreshRSS, a free, self-hostable aggregator…\', 86400 WHERE NOT EXISTS (SELECT id FROM "%1$sfeed" WHERE url = \'http://freshrss.org/feeds/all.atom.xml\');', +'INSERT INTO "%1$sfeed" (url, category, name, website, description, ttl) SELECT \'https://github.com/FreshRSS/FreshRSS/releases.atom\', 1, \'FreshRSS @ GitHub\', \'https://github.com/FreshRSS/FreshRSS/\', \'FreshRSS releases @ GitHub\', 86400 WHERE NOT EXISTS (SELECT id FROM "%1$sfeed" WHERE url = \'https://github.com/FreshRSS/FreshRSS/releases.atom\');', +); + +define('SQL_DROP_TABLES', 'DROP TABLE IF EXISTS "%1$sentry", "%1$sfeed", "%1$scategory"'); diff --git a/app/SQL/install.sql.sqlite.php b/app/SQL/install.sql.sqlite.php new file mode 100644 index 000000000..68d93ba92 --- /dev/null +++ b/app/SQL/install.sql.sqlite.php @@ -0,0 +1,66 @@ +<?php +global $SQL_CREATE_TABLES; +$SQL_CREATE_TABLES = array( +'CREATE TABLE IF NOT EXISTS `category` ( + `id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + `name` varchar(255) NOT NULL, + UNIQUE (`name`) +);', + +'CREATE TABLE IF NOT EXISTS `feed` ( + `id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + `url` varchar(511) NOT NULL, + `category` SMALLINT DEFAULT 0, + `name` varchar(255) NOT NULL, + `website` varchar(255), + `description` text, + `lastUpdate` int(11) DEFAULT 0, -- Until year 2038 + `priority` tinyint(2) NOT NULL DEFAULT 10, + `pathEntries` varchar(511) DEFAULT NULL, + `httpAuth` varchar(511) DEFAULT NULL, + `error` boolean DEFAULT 0, + `keep_history` MEDIUMINT NOT NULL DEFAULT -2, + `ttl` INT NOT NULL DEFAULT -2, + `cache_nbEntries` int DEFAULT 0, + `cache_nbUnreads` int DEFAULT 0, + FOREIGN KEY (`category`) REFERENCES `category`(`id`) ON DELETE SET NULL ON UPDATE CASCADE, + UNIQUE (`url`) +);', + +'CREATE INDEX IF NOT EXISTS feed_name_index ON `feed`(`name`);', +'CREATE INDEX IF NOT EXISTS feed_priority_index ON `feed`(`priority`);', +'CREATE INDEX IF NOT EXISTS feed_keep_history_index ON `feed`(`keep_history`);', + +'CREATE TABLE IF NOT EXISTS `entry` ( + `id` bigint NOT NULL, + `guid` varchar(760) NOT NULL, + `title` varchar(255) NOT NULL, + `author` varchar(255), + `content` text, + `link` varchar(1023) NOT NULL, + `date` int(11), -- Until year 2038 + `lastSeen` INT(11) DEFAULT 0, -- v1.1.1, Until year 2038 + `hash` BINARY(16), -- v1.1.1 + `is_read` boolean NOT NULL DEFAULT 0, + `is_favorite` boolean NOT NULL DEFAULT 0, + `id_feed` SMALLINT, + `tags` varchar(1023), + PRIMARY KEY (`id`), + FOREIGN KEY (`id_feed`) REFERENCES `feed`(`id`) ON DELETE CASCADE ON UPDATE CASCADE, + UNIQUE (`id_feed`,`guid`) +);', + +'CREATE INDEX IF NOT EXISTS entry_is_favorite_index ON `entry`(`is_favorite`);', +'CREATE INDEX IF NOT EXISTS entry_is_read_index ON `entry`(`is_read`);', +'CREATE INDEX IF NOT EXISTS entry_lastSeen_index ON `entry`(`lastSeen`);', //v1.1.1 + +'INSERT OR IGNORE INTO `category` (id, name) VALUES(1, "%2$s");', +); + +global $SQL_INSERT_FEEDS; +$SQL_INSERT_FEEDS = array( +'INSERT OR IGNORE INTO `feed` (url, category, name, website, description, ttl) VALUES("http://freshrss.org/feeds/all.atom.xml", 1, "FreshRSS.org", "http://freshrss.org/", "FreshRSS, a free, self-hostable aggregator…", 86400);', +'INSERT OR IGNORE INTO `feed` (url, category, name, website, description, ttl) VALUES("https://github.com/FreshRSS/FreshRSS/releases.atom", 1, "FreshRSS releases", "https://github.com/FreshRSS/FreshRSS/", "FreshRSS releases @ GitHub", 86400);', +); + +define('SQL_DROP_TABLES', 'DROP TABLE IF EXISTS entry, feed, category'); diff --git a/app/actualize_script.php b/app/actualize_script.php index 8d81e0189..deaa1bf7c 100755 --- a/app/actualize_script.php +++ b/app/actualize_script.php @@ -7,49 +7,81 @@ ob_implicit_flush(false); ob_start(); echo 'Results: ', "\n"; //Buffered -Minz_Configuration::init(); +if (defined('STDOUT')) { + $begin_date = date_create('now'); + fwrite(STDOUT, 'Starting feed actualization at ' . $begin_date->format('c') . "\n"); //Unbuffered +} + + +// Set the header params ($_GET) to call the FRSS application. +$_GET['c'] = 'feed'; +$_GET['a'] = 'actualize'; +$_GET['ajax'] = 1; +$_GET['force'] = true; +$_SERVER['HTTP_HOST'] = ''; + + +$log_file = join_path(USERS_PATH, '_', 'log.txt'); + + +$app = new FreshRSS(); + +$system_conf = Minz_Configuration::get('system'); +$system_conf->auth_type = 'none'; // avoid necessity to be logged in (not saved!) +FreshRSS_Context::$isCli = true; +// Create the list of users to actualize. +// Users are processed in a random order but always start with admin $users = listUsers(); -shuffle($users); //Process users in random order -array_unshift($users, Minz_Configuration::defaultUser()); //But always start with admin -$users = array_unique($users); +shuffle($users); +if ($system_conf->default_user !== '') { + array_unshift($users, $system_conf->default_user); + $users = array_unique($users); +} + -foreach ($users as $myUser) { - syslog(LOG_INFO, 'FreshRSS actualize ' . $myUser); +$limits = $system_conf->limits; +$min_last_activity = time() - $limits['max_inactivity']; +foreach ($users as $user) { + if (($user !== $system_conf->default_user) && + (FreshRSS_UserDAO::mtime($user) < $min_last_activity)) { + Minz_Log::notice('FreshRSS skip inactive user ' . $user, $log_file); + if (defined('STDOUT')) { + fwrite(STDOUT, 'FreshRSS skip inactive user ' . $user . "\n"); //Unbuffered + } + continue; + } + Minz_Log::notice('FreshRSS actualize ' . $user, $log_file); if (defined('STDOUT')) { - fwrite(STDOUT, 'Actualize ' . $myUser . "...\n"); //Unbuffered + fwrite(STDOUT, 'Actualize ' . $user . "...\n"); //Unbuffered } - echo $myUser, ' '; //Buffered + echo $user, ' '; //Buffered - $_GET['c'] = 'feed'; - $_GET['a'] = 'actualize'; - $_GET['ajax'] = 1; - $_GET['force'] = true; - $_SERVER['HTTP_HOST'] = ''; - $freshRSS = new FreshRSS(); - $freshRSS->_useOb(false); + Minz_Session::_param('currentUser', $user); + new Minz_ModelPdo($user); //TODO: FIXME: Quick-fix while waiting for a better FreshRSS() constructor/init + FreshRSS_Auth::giveAccess(); + $app->init(); + $app->run(); - Minz_Configuration::_authType('none'); - - Minz_Session::init('FreshRSS'); - Minz_Session::_param('currentUser', $myUser); - - $freshRSS->init(); - $freshRSS->run(); if (!invalidateHttpCache()) { - syslog(LOG_NOTICE, 'FreshRSS write access problem in ' . LOG_PATH . '/*.log!'); + Minz_Log::notice('FreshRSS write access problem in ' . join_path(USERS_PATH, $user, 'log.txt'), + $log_file); if (defined('STDERR')) { - fwrite(STDERR, 'Write access problem in ' . LOG_PATH . '/*.log!' . "\n"); + fwrite(STDERR, 'Write access problem in ' . join_path(USERS_PATH, $user, 'log.txt') . "\n"); } } - Minz_Session::unset_session(true); - Minz_ModelPdo::clean(); } -syslog(LOG_INFO, 'FreshRSS actualize done.'); + + +Minz_Log::notice('FreshRSS actualize done.', $log_file); if (defined('STDOUT')) { fwrite(STDOUT, 'Done.' . "\n"); + $end_date = date_create('now'); + $duration = date_diff($end_date, $begin_date); + fwrite(STDOUT, 'Ending feed actualization at ' . $end_date->format('c') . "\n"); //Unbuffered + fwrite(STDOUT, 'Feed actualizations took ' . $duration->format('%a day(s), %h hour(s), %i minute(s) and %s seconds') . ' for ' . count($users) . " users\n"); //Unbuffered } echo 'End.', "\n"; ob_end_flush(); diff --git a/app/i18n/cz/admin.php b/app/i18n/cz/admin.php new file mode 100644 index 000000000..63cee3cca --- /dev/null +++ b/app/i18n/cz/admin.php @@ -0,0 +1,181 @@ +<?php + +return array( + 'auth' => array( + 'allow_anonymous' => 'Umožnit anonymně číst články výchozího uživatele (%s)', + 'allow_anonymous_refresh' => 'Umožnit anonymní obnovení článků', + 'api_enabled' => 'Povolit přístup k <abbr>API</abbr> <small>(vyžadováno mobilními aplikacemi)</small>', + 'form' => 'Webový formulář (tradiční, vyžaduje JavaScript)', + 'http' => 'HTTP (pro pokročilé uživatele s HTTPS)', + 'none' => 'Žádný (nebezpečné)', + 'title' => 'Přihlášení', + 'title_reset' => 'Reset přihlášení', + 'token' => 'Authentizační token', + 'token_help' => 'Umožňuje přístup k RSS kanálu článků výchozího uživatele bez přihlášení:', + 'type' => 'Způsob přihlášení', + 'unsafe_autologin' => 'Povolit nebezpečné automatické přihlášení přes: ', + ), + 'check_install' => array( + 'cache' => array( + 'nok' => 'Zkontrolujte oprávnění adresáře <em>./data/cache</em>. HTTP server musí mít do tohoto adresáře práva zápisu', + 'ok' => 'Oprávnění adresáře cache jsou v pořádku.', + ), + 'categories' => array( + 'nok' => 'Tabulka kategorií je nastavena špatně.', + 'ok' => 'Tabulka kategorií je v pořádku.', + ), + 'connection' => array( + 'nok' => 'Nelze navázat spojení s databází.', + 'ok' => 'Připojení k databázi je v pořádku.', + ), + 'ctype' => array( + 'nok' => 'Nemáte požadovanou knihovnu pro ověřování znaků (php-ctype).', + 'ok' => 'Máte požadovanou knihovnu pro ověřování znaků (ctype).', + ), + 'curl' => array( + 'nok' => 'Nemáte cURL (balíček php-curl).', + 'ok' => 'Máte rozšíření cURL.', + ), + 'data' => array( + 'nok' => 'Zkontrolujte oprávnění adresáře <em>./data</em>. HTTP server musí mít do tohoto adresáře práva zápisu', + 'ok' => 'Oprávnění adresáře data jsou v pořádku.', + ), + 'database' => 'Instalace databáze', + 'dom' => array( + 'nok' => 'Nemáte požadovanou knihovnu pro procházení DOM (balíček php-xml).', + 'ok' => 'Máte požadovanou knihovnu pro procházení DOM.', + ), + 'entries' => array( + 'nok' => 'Tabulka článků je nastavena špatně.', + 'ok' => 'Tabulka kategorií je v pořádku.', + ), + 'favicons' => array( + 'nok' => 'Zkontrolujte oprávnění adresáře <em>./data/favicons</em>. HTTP server musí mít do tohoto adresáře práva zápisu', + 'ok' => 'Oprávnění adresáře favicons jsou v pořádku.', + ), + 'feeds' => array( + 'nok' => 'Tabulka kanálů je nastavena špatně.', + 'ok' => 'Tabulka kanálů je v pořádku.', + ), + 'fileinfo' => array( + 'nok' => 'Nemáte PHP fileinfo (balíček fileinfo).', + 'ok' => 'Máte rozšíření fileinfo.', + ), + 'files' => 'Instalace souborů', + 'json' => array( + 'nok' => 'Nemáte JSON (balíček php5-json).', + 'ok' => 'Máte rozšíření JSON.', + ), + 'minz' => array( + 'nok' => 'Nemáte framework Minz.', + 'ok' => 'Máte framework Minz.', + ), + 'pcre' => array( + 'nok' => 'Nemáte požadovanou knihovnu pro regulární výrazy (php-pcre).', + 'ok' => 'Máte požadovanou knihovnu pro regulární výrazy (PCRE).', + ), + 'pdo' => array( + 'nok' => 'Nemáte PDO nebo některý z podporovaných ovladačů (pdo_mysql, pdo_sqlite, pdo_pgsql).', + 'ok' => 'Máte PDO a alespoň jeden z podporovaných ovladačů (pdo_mysql, pdo_sqlite, pdo_pgsql).', + ), + 'php' => array( + '_' => 'PHP instalace', + 'nok' => 'Vaše verze PHP je %s, ale FreshRSS vyžaduje alespoň verzi %s.', + 'ok' => 'Vaše verze PHP je %s a je kompatibilní s FreshRSS.', + ), + 'tables' => array( + 'nok' => 'V databázi chybí jedna nevo více tabulek.', + 'ok' => 'V databázi jsou všechny tabulky.', + ), + 'title' => 'Kontrola instalace', + 'tokens' => array( + 'nok' => 'Zkontrolujte oprávnění adresáře <em>./data/tokens</em>. HTTP server musí mít do tohoto adresáře práva zápisu', + 'ok' => 'Oprávnění adresáře tokens jsou v pořádku.', + ), + 'users' => array( + 'nok' => 'Zkontrolujte oprávnění adresáře <em>./data/users</em>. HTTP server musí mít do tohoto adresáře práva zápisu', + 'ok' => 'Oprávnění adresáře users jsou v pořádku.', + ), + 'zip' => array( + 'nok' => 'Nemáte rozšíření ZIP (balíček php-zip).', + 'ok' => 'Máte rozšíření ZIP.', + ), + ), + 'extensions' => array( + 'disabled' => 'Vypnuto', + 'empty_list' => 'Není naistalováno žádné rozšíření', + 'enabled' => 'Zapnuto', + 'no_configure_view' => 'Toto rozšíření nemá žádné možnosti nastavení.', + 'system' => array( + '_' => 'Systémová rozšíření', + 'no_rights' => 'Systémová rozšíření (na ně nemáte oprávnění)', + ), + 'title' => 'Rozšíření', + 'user' => 'Uživatelská rozšíření', + ), + 'stats' => array( + '_' => 'Statistika', + 'all_feeds' => 'Všechny kanály', + 'category' => 'Kategorie', + 'entry_count' => 'Počet článků', + 'entry_per_category' => 'Článků na kategorii', + 'entry_per_day' => 'Článků za den (posledních 30 dní)', + 'entry_per_day_of_week' => 'Za den v týdnu (průměr: %.2f zprávy)', + 'entry_per_hour' => 'Za hodinu (průměr: %.2f zprávy)', + 'entry_per_month' => 'Za měsíc (průměr: %.2f zprávy)', + 'entry_repartition' => 'Rozdělení článků', + 'feed' => 'Kanál', + 'feed_per_category' => 'Článků na kategorii', + 'idle' => 'Neaktivní kanály', + 'main' => 'Přehled', + 'main_stream' => 'Všechny kanály', + 'menu' => array( + 'idle' => 'Neaktivní kanály', + 'main' => 'Přehled', + 'repartition' => 'Rozdělení článků', + ), + 'no_idle' => 'Žádné neaktivní kanály!', + 'number_entries' => '%d článků', + 'percent_of_total' => '%% ze všech', + 'repartition' => 'Rozdělení článků', + 'status_favorites' => 'Oblíbené', + 'status_read' => 'Přečtené', + 'status_total' => 'Celkem', + 'status_unread' => 'Nepřečtené', + 'title' => 'Statistika', + 'top_feed' => 'Top ten kanálů', + ), + 'system' => array( + '_' => 'System configuration', // @todo translate + 'auto-update-url' => 'Auto-update server URL', // @todo translate + 'instance-name' => 'Instance name', // @todo translate + 'max-categories' => 'Categories per user limit', // @todo translate + 'max-feeds' => 'Feeds per user limit', // @todo translate + 'registration' => array( + 'help' => '0 znamená žádná omezení účtu', + 'number' => 'Maximální počet účtů', + ), + ), + 'update' => array( + '_' => 'Aktualizace systému', + 'apply' => 'Použít', + 'check' => 'Zkontrolovat aktualizace', + 'current_version' => 'Vaše instalace FreshRSS je verze %s.', + 'last' => 'Poslední kontrola: %s', + 'none' => 'Žádné nové aktualizace', + 'title' => 'Aktualizovat systém', + ), + 'user' => array( + 'articles_and_size' => '%s článků (%s)', + 'create' => 'Vytvořit nového uživatele', + 'language' => 'Jazyk', + 'number' => 'Zatím je vytvořen %d účet', + 'numbers' => 'Zatím je vytvořeno %d účtů', + 'password_form' => 'Heslo<br /><small>(pro přihlášení webovým formulářem)</small>', + 'password_format' => 'Alespoň 7 znaků', + 'title' => 'Správa uživatelů', + 'user_list' => 'Seznam uživatelů', + 'username' => 'Přihlašovací jméno', + 'users' => 'Uživatelé', + ), +); diff --git a/app/i18n/cz/conf.php b/app/i18n/cz/conf.php new file mode 100644 index 000000000..ec25f988c --- /dev/null +++ b/app/i18n/cz/conf.php @@ -0,0 +1,173 @@ +<?php + +return array( + 'archiving' => array( + '_' => 'Archivace', + 'advanced' => 'Pokročilé', + 'delete_after' => 'Smazat články starší než', + 'help' => 'Více možností je dostupných v nastavení jednotlivých kanálů', + 'keep_history_by_feed' => 'Zachovat tento minimální počet článků v každém kanálu', + 'optimize' => 'Optimalizovat databázi', + 'optimize_help' => 'Občasná údržba zmenší velikost databáze', + 'purge_now' => 'Vyčistit nyní', + 'title' => 'Archivace', + 'ttl' => 'Neaktualizovat častěji než', + ), + 'display' => array( + '_' => 'Zobrazení', + 'icon' => array( + 'bottom_line' => 'Spodní řádek', + 'entry' => 'Ikony článků', + 'publication_date' => 'Datum vydání', + 'related_tags' => 'Související tagy', + 'sharing' => 'Sdílení', + 'top_line' => 'Horní řádek', + ), + 'language' => 'Jazyk', + 'notif_html5' => array( + 'seconds' => 'sekund (0 znamená žádný timeout)', + 'timeout' => 'Timeout HTML5 notifikací', + ), + 'theme' => 'Vzhled', + 'title' => 'Zobrazení', + 'width' => array( + 'content' => 'Šířka obsahu', + 'large' => 'Velká', + 'medium' => 'Střední', + 'no_limit' => 'Bez limitu', + 'thin' => 'Tenká', + ), + ), + 'query' => array( + '_' => 'Uživatelské dotazy', + 'deprecated' => 'Tento dotaz již není platný. Odkazovaná kategorie nebo kanál byly smazány.', + 'filter' => 'Filtr aplikován:', + 'get_all' => 'Zobrazit všechny články', + 'get_category' => 'Zobrazit "%s" kategorii', + 'get_favorite' => 'Zobrazit oblíbené články', + 'get_feed' => 'Zobrazit "%s" článkek', + 'no_filter' => 'Zrušit filtr', + 'none' => 'Ještě jste nevytvořil žádný uživatelský dotaz.', + 'number' => 'Dotaz n°%d', + 'order_asc' => 'Zobrazit nejdříve nejstarší články', + 'order_desc' => 'Zobrazit nejdříve nejnovější články', + 'search' => 'Hledat "%s"', + 'state_0' => 'Zobrazit všechny články', + 'state_1' => 'Zobrazit přečtené články', + 'state_2' => 'Zobrazit nepřečtené články', + 'state_3' => 'Zobrazit všechny články', + 'state_4' => 'Zobrazit oblíbené články', + 'state_5' => 'Zobrazit oblíbené přečtené články', + 'state_6' => 'Zobrazit oblíbené nepřečtené články', + 'state_7' => 'Zobrazit oblíbené články', + 'state_8' => 'Zobrazit všechny články vyjma oblíbených', + 'state_9' => 'Zobrazit všechny přečtené články vyjma oblíbených', + 'state_10' => 'Zobrazit všechny nepřečtené články vyjma oblíbených', + 'state_11' => 'Zobrazit všechny články vyjma oblíbených', + 'state_12' => 'Zobrazit všechny články', + 'state_13' => 'Zobrazit přečtené články', + 'state_14' => 'Zobrazit nepřečtené články', + 'state_15' => 'Zobrazit všechny články', + 'title' => 'Uživatelské dotazy', + ), + 'profile' => array( + '_' => 'Správa profilu', + 'delete' => array( + '_' => 'Smazání účtu', + 'warn' => 'Váš účet bude smazán spolu se všemi souvisejícími daty', + ), + 'password_api' => 'Password API<br /><small>(tzn. pro mobilní aplikace)</small>', + 'password_form' => 'Heslo<br /><small>(pro přihlášení webovým formulářem)</small>', + 'password_format' => 'Alespoň 7 znaků', + 'title' => 'Profil', + ), + 'reading' => array( + '_' => 'Čtení', + 'after_onread' => 'Po “označit vše jako přečtené”,', + 'articles_per_page' => 'Počet článků na stranu', + 'auto_load_more' => 'Načítat další články dole na stránce', + 'auto_remove_article' => 'Po přečtení články schovat', + 'mark_updated_article_unread' => 'Označte aktualizované položky jako nepřečtené', + 'confirm_enabled' => 'Vyžadovat potvrzení pro akci “označit vše jako přečtené”', + 'display_articles_unfolded' => 'Ve výchozím stavu zobrazovat články otevřené', + 'display_categories_unfolded' => 'Ve výchozím stavu zobrazovat kategorie zavřené', + 'hide_read_feeds' => 'Schovat kategorie a kanály s nulovým počtem nepřečtených článků (nefunguje s nastavením “Zobrazit všechny články”)', + 'img_with_lazyload' => 'Použít "lazy load" mód pro načítaní obrázků', + 'jump_next' => 'skočit na další nepřečtený (kanál nebo kategorii)', + 'number_divided_when_reader' => 'V režimu “Čtení” děleno dvěma.', + 'read' => array( + 'article_open_on_website' => 'když je otevřen původní web s článkem', + 'article_viewed' => 'během čtení článku', + 'scroll' => 'během skrolování', + 'upon_reception' => 'po načtení článku', + 'when' => 'Označit článek jako přečtený…', + ), + 'show' => array( + '_' => 'Počet zobrazených článků', + 'adaptive' => 'Vyberte zobrazení', + 'all_articles' => 'Zobrazit všechny články', + 'unread' => 'Zobrazit jen nepřečtené', + ), + 'sort' => array( + '_' => 'Řazení', + 'newer_first' => 'Nejdříve nejnovější', + 'older_first' => 'Nejdříve nejstarší', + ), + 'sticky_post' => 'Při otevření posunout článek nahoru', + 'title' => 'Čtení', + 'view' => array( + 'default' => 'Výchozí', + 'global' => 'Přehled', + 'normal' => 'Normální', + 'reader' => 'Čtení', + ), + ), + 'sharing' => array( + '_' => 'Sdílení', + 'blogotext' => 'Blogotext', + 'diaspora' => 'Diaspora*', + 'email' => 'Email', + 'facebook' => 'Facebook', + 'g+' => 'Google+', + 'more_information' => 'Více informací', + 'print' => 'Tisk', + 'shaarli' => 'Shaarli', + 'share_name' => 'Jméno pro zobrazení', + 'share_url' => 'Jakou URL použít pro sdílení', + 'title' => 'Sdílení', + 'twitter' => 'Twitter', + 'wallabag' => 'wallabag', + ), + 'shortcut' => array( + '_' => 'Zkratky', + 'article_action' => 'Články - akce', + 'auto_share' => 'Sdílet', + 'auto_share_help' => 'Je-li nastavena pouze jedna možnost sdílení, bude použita. Další možnosti jsou dostupné pomocí jejich čísla.', + 'close_dropdown' => 'Zavřít menu', + 'collapse_article' => 'Srolovat', + 'first_article' => 'Skočit na první článek', + 'focus_search' => 'Hledání', + 'help' => 'Zobrazit documentaci', + 'javascript' => 'Pro použití zkratek musí být povolen JavaScript', + 'last_article' => 'Skočit na poslední článek', + 'load_more' => 'Načíst více článků', + 'mark_read' => 'Označit jako přečtené', + 'mark_favorite' => 'Označit jako oblíbené', + 'navigation' => 'Navigace', + 'navigation_help' => 'Pomocí přepínače "Shift" fungují navigační zkratky v rámci kanálů.<br/>Pomocí přepínače "Alt" fungují v rámci kategorií.', + 'next_article' => 'Skočit na další článek', + 'other_action' => 'Ostatní akce', + 'previous_article' => 'Skočit na předchozí článek', + 'see_on_website' => 'Navštívit původní webovou stránku', + 'shift_for_all_read' => '+ <code>shift</code> 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.', + ), + 'user' => array( + 'articles_and_size' => '%s článků (%s)', + 'current' => 'Aktuální uživatel', + 'is_admin' => 'je administrátor', + 'users' => 'Uživatelé', + ), +); diff --git a/app/i18n/cz/feedback.php b/app/i18n/cz/feedback.php new file mode 100644 index 000000000..f2bd87c77 --- /dev/null +++ b/app/i18n/cz/feedback.php @@ -0,0 +1,109 @@ +<?php + +return array( + 'admin' => array( + 'optimization_complete' => 'Optimalizace dokončena', + ), + 'access' => array( + 'denied' => 'Nemáte oprávnění přistupovat na tuto stránku', + 'not_found' => 'Tato stránka neexistuje', + ), + 'auth' => array( + 'form' => array( + 'not_set' => 'Nastal problém s konfigurací přihlašovacího systému. Zkuste to prosím později.', + 'set' => 'Webový formulář je nyní výchozí přihlašovací systém.', + ), + 'login' => array( + 'invalid' => 'Login není platný', + 'success' => 'Jste přihlášen', + ), + 'logout' => array( + 'success' => 'Jste odhlášen', + ), + 'no_password_set' => 'Heslo administrátora nebylo nastaveno. Tato funkce není k dispozici.', + ), + 'conf' => array( + 'error' => 'Během ukládání nastavení došlo k chybě', + 'query_created' => 'Dotaz "%s" byl vytvořen.', + 'shortcuts_updated' => 'Zkratky byly aktualizovány', + 'updated' => 'Nastavení bylo aktualizováno', + ), + 'extensions' => array( + 'already_enabled' => '%s je již zapnut', + 'disable' => array( + 'ko' => '%s nelze vypnout. Pro více detailů <a href="%s">zkontrolujte logy FressRSS</a>.', + 'ok' => '%s je nyní vypnut', + ), + 'enable' => array( + 'ko' => '%s nelze zapnout. Pro více detailů <a href="%s">zkontrolujte logy FressRSS</a>.', + 'ok' => '%s je nyní zapnut', + ), + 'no_access' => 'Nemáte přístup k %s', + 'not_enabled' => '%s není ještě zapnut', + 'not_found' => '%s neexistuje', + ), + 'import_export' => array( + 'export_no_zip_extension' => 'Na serveru není naistalována podpora ZIP. Zkuste prosím exportovat soubory jeden po druhém.', + 'feeds_imported' => 'Vaše kanály byly naimportovány a nyní budou aktualizovány', + 'feeds_imported_with_errors' => 'Vaše kanály byly naimportovány, došlo ale k nějakým chybám', + 'file_cannot_be_uploaded' => 'Soubor nelze nahrát!', + 'no_zip_extension' => 'Na serveru není naistalována podpora ZIP.', + 'zip_error' => 'Během importu ZIP souboru došlo k chybě.', + ), + 'sub' => array( + 'actualize' => 'Aktualizovat', + 'category' => array( + 'created' => 'Kategorie %s byla vytvořena.', + 'deleted' => 'Kategorie byla smazána.', + 'emptied' => 'Kategorie byla vyprázdněna', + 'error' => 'Kategorii nelze aktualizovat', + 'name_exists' => 'Název kategorie již existuje.', + 'no_id' => 'Musíte upřesnit id kategorie.', + 'no_name' => 'Název kategorie nemůže být prázdný.', + 'not_delete_default' => 'Nelze smazat výchozí kategorii!', + 'not_exist' => 'Tato kategorie neexistuje!', + 'over_max' => 'Dosáhl jste maximálního počtu kategorií (%d)', + 'updated' => 'Kategorie byla aktualizována.', + ), + 'feed' => array( + 'actualized' => '<em>%s</em> bylo aktualizováno', + 'actualizeds' => 'RSS kanály byly aktualizovány', + 'added' => 'RSS kanál <em>%s</em> byl přidán', + 'already_subscribed' => 'Již jste přihlášen k odběru <em>%s</em>', + 'deleted' => 'Kanál byl smazán', + 'error' => 'Kanál nelze aktualizovat', + 'internal_problem' => 'RSS kanál nelze přidat. Pro detaily <a href="%s">zkontrolujte logy FressRSS</a>.', + 'invalid_url' => 'URL <em>%s</em> není platné', + 'marked_read' => 'Kanály byly označeny jako přečtené', + 'n_actualized' => '%d kanálů bylo aktualizováno', + 'n_entries_deleted' => '%d článků bylo smazáno', + 'no_refresh' => 'Nelze obnovit žádné kanály…', + 'not_added' => '<em>%s</em> nemůže být přidán', + 'over_max' => 'Dosáhl jste maximálního počtu kanálů (%d)', + 'updated' => 'Kanál byl aktualizován', + ), + 'purge_completed' => 'Vyprázdněno (smazáno %d článků)', + ), + 'update' => array( + 'can_apply' => 'FreshRSS bude nyní upgradováno na <strong>verzi %s</strong>.', + 'error' => 'Během upgrade došlo k chybě: %s', + 'file_is_nok' => 'Zkontrolujte oprávnění adresáře <em>%s</em>. HTTP server musí mít do tohoto adresáře práva zápisu', + 'finished' => 'Upgrade hotov!', + 'none' => 'Novější verze není k dispozici', + 'server_not_found' => 'Nelze nalézt server s instalačním souborem. [%s]', + ), + 'user' => array( + 'created' => array( + '_' => 'Uživatel %s byl vytvořen', + 'error' => 'Uživatele %s nelze vytvořit', + ), + 'deleted' => array( + '_' => 'Uživatel %s byl smazán', + 'error' => 'Uživatele %s nelze smazat', + ), + ), + 'profile' => array( + 'error' => 'Váš profil nelze změnit', + 'updated' => 'Váš profil byl změněn', + ), +); diff --git a/app/i18n/cz/gen.php b/app/i18n/cz/gen.php new file mode 100644 index 000000000..3db3a31da --- /dev/null +++ b/app/i18n/cz/gen.php @@ -0,0 +1,181 @@ +<?php + +return array( + 'action' => array( + 'actualize' => 'Aktualizovat', + 'back_to_rss_feeds' => '← Zpět na seznam RSS kanálů', + 'cancel' => 'Zrušit', + 'create' => 'Vytvořit', + 'disable' => 'Zakázat', + 'empty' => 'Vyprázdnit', + 'enable' => 'Povolit', + 'export' => 'Export', + 'filter' => 'Filtrovat', + 'import' => 'Import', + 'manage' => 'Spravovat', + 'mark_read' => 'Označit jako přečtené', + 'mark_favorite' => 'Označit jako oblíbené', + 'remove' => 'Odstranit', + 'see_website' => 'Navštívit WWW stránku', + 'submit' => 'Odeslat', + 'truncate' => 'Smazat všechny články', + ), + 'auth' => array( + 'email' => 'Email', + 'keep_logged_in' => 'Zapamatovat přihlášení <small>(%s dny)</small>', + 'login' => 'Login', + 'logout' => 'Odhlášení', + 'password' => array( + '_' => 'Heslo', + 'format' => '<small>Alespoň 7 znaků</small>', + ), + 'registration' => array( + '_' => 'Nový účet', + 'ask' => 'Vytvořit účet?', + 'title' => 'Vytvoření účtu', + ), + 'reset' => 'Reset přihlášení', + 'username' => array( + '_' => 'Uživatel', + 'admin' => 'Název administrátorského účtu', + 'format' => '<small>maximálně 16 alfanumerických znaků</small>', + ), + ), + 'date' => array( + 'Apr' => '\\D\\u\\b\\e\\n', + 'Aug' => '\\S\\r\\p\\e\\n', + 'Dec' => '\\P\\r\\o\\s\\i\\n\\e\\c', + 'Feb' => '\\Ú\\n\\o\\r', + 'Jan' => '\\L\\e\\d\\e\\n', + 'Jul' => '\\Č\\e\\r\\v\\e\\n\\e\\c', + 'Jun' => '\\Č\\e\\r\\v\\e\\n', + 'Mar' => '\\B\\ř\\e\\z\\e\\n', + 'May' => '\\K\\v\\ě\\t\\e\\n', + 'Nov' => '\\L\\i\\s\\t\\o\\p\\a\\d', + 'Oct' => '\\Ř\\í\\j\\e\\n', + 'Sep' => '\\Z\\á\\ř\\í', + 'apr' => 'dub', + 'april' => 'Dub', + 'aug' => 'srp', + 'august' => 'Srp', + 'before_yesterday' => 'Předevčírem', + 'dec' => 'pro', + 'december' => 'Pro', + 'feb' => 'úno', + 'february' => 'Úno', + 'format_date' => 'j\\. %s Y', + 'format_date_hour' => 'j\\. %s Y \\v H\\:i', + 'fri' => 'Pá', + 'jan' => 'led', + 'january' => 'Led', + 'jul' => 'čvn', + 'july' => 'Čvn', + 'jun' => 'čer', + 'june' => 'Čer', + 'last_3_month' => 'Minulé tři měsíce', + 'last_6_month' => 'Minulých šest měsíců', + 'last_month' => 'Minulý měsíc', + 'last_week' => 'Minulý týden', + 'last_year' => 'Minulý rok', + 'mar' => 'bře', + 'march' => 'Bře', + 'may' => 'Kvě', + 'mon' => 'Po', + 'month' => 'měsíce', + 'nov' => 'lis', + 'november' => 'Lis', + 'oct' => 'říj', + 'october' => 'Říj', + 'sat' => 'So', + 'sep' => 'zář', + 'september' => 'Zář', + 'sun' => 'Ne', + 'thu' => 'Čt', + 'today' => 'Dnes', + 'tue' => 'Út', + 'wed' => 'St', + 'yesterday' => 'Včera', + ), + 'freshrss' => array( + '_' => 'FreshRSS', + 'about' => 'O FreshRSS', + ), + 'js' => array( + 'category_empty' => 'Prázdná kategorie', + 'confirm_action' => 'Jste si jist, že chcete provést tuto akci? Změny nelze vrátit zpět!', + 'confirm_action_feed_cat' => 'Jste si jist, že chcete provést tuto akci? Přijdete o související oblíbené položky a uživatelské dotazy. Změny nelze vrátit zpět!', + 'feedback' => array( + 'body_new_articles' => 'Je %%d nových článků k přečtení v FreshRSS.', + 'request_failed' => 'Požadavek selhal, což může být způsobeno problémy s připojení k internetu.', + 'title_new_articles' => 'FreshRSS: nové články!', + ), + 'new_article' => 'Jsou k dispozici nové články, stránku obnovíte kliknutím zde.', + 'should_be_activated' => 'JavaScript musí být povolen', + ), + 'lang' => array( + 'cz' => 'Čeština', + 'de' => 'Deutsch', + 'en' => 'English', + 'fr' => 'Français', + 'it' => 'Italiano', + 'nl' => 'Nederlands', + 'ru' => 'Русский', + 'tr' => 'Türkçe', + ), + 'menu' => array( + 'about' => 'O aplikaci', + 'admin' => 'Administrace', + 'archiving' => 'Archivace', + 'authentication' => 'Přihlášení', + 'check_install' => 'Ověření instalace', + 'configuration' => 'Nastavení', + 'display' => 'Zobrazení', + 'extensions' => 'Rozšíření', + 'logs' => 'Logy', + 'queries' => 'Uživatelské dotazy', + 'reading' => 'Čtení', + 'search' => 'Hledat výraz nebo #tagy', + 'sharing' => 'Sdílení', + 'shortcuts' => 'Zkratky', + 'stats' => 'Statistika', + 'system' => 'System configuration',// @todo translate + 'update' => 'Aktualizace', + 'user_management' => 'Správa uživatelů', + 'user_profile' => 'Profil', + ), + 'pagination' => array( + 'first' => 'První', + 'last' => 'Poslední', + 'load_more' => 'Načíst více článků', + 'mark_all_read' => 'Označit vše jako přečtené', + 'next' => 'Další', + 'nothing_to_load' => 'Žádné nové články', + 'previous' => 'Předchozí', + ), + 'share' => array( + 'blogotext' => 'Blogotext', + 'diaspora' => 'Diaspora*', + 'email' => 'Email', + 'facebook' => 'Facebook', + 'g+' => 'Google+', + 'movim' => 'Movim', + 'print' => 'Tisk', + 'shaarli' => 'Shaarli', + 'twitter' => 'Twitter', + 'wallabag' => 'wallabag v1', + 'wallabagv2' => 'wallabag v2', + 'jdh' => 'Journal du hacker', + ), + 'short' => array( + 'attention' => 'Upozornění!', + 'blank_to_disable' => 'Zakázat - ponechte prázdné', + 'by_author' => 'Od <em>%s</em>', + 'by_default' => 'Výchozí', + 'damn' => 'Sakra!', + 'default_category' => 'Nezařazeno', + 'no' => 'Ne', + 'ok' => 'Ok!', + 'or' => 'nebo', + 'yes' => 'Ano', + ), +); diff --git a/app/i18n/cz/index.php b/app/i18n/cz/index.php new file mode 100644 index 000000000..cb0e5955d --- /dev/null +++ b/app/i18n/cz/index.php @@ -0,0 +1,61 @@ +<?php + +return array( + 'about' => array( + '_' => 'O FreshRSS', + 'agpl3' => '<a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL 3</a>', + 'bugs_reports' => 'Hlášení chyb', + 'credits' => 'Poděkování', + 'credits_content' => 'Některé designové prvky pocházejí z <a href="http://twitter.github.io/bootstrap/">Bootstrap</a>, FreshRSS ale tuto platformu nevyužívá. <a href="https://git.gnome.org/browse/gnome-icon-theme-symbolic">Ikony</a> pocházejí z <a href="https://www.gnome.org/">GNOME projektu</a>. Font <em>Open Sans</em> vytvořil <a href="https://fonts.google.com/specimen/Open+Sans">Steve Matteson</a>. FreshRSS je založen na PHP framework <a href="https://github.com/marienfressinaud/MINZ">Minz</a>.', + 'freshrss_description' => 'FreshRSS je čtečka RSS kanálů určená k provozu na vlastním serveru, podobná <a href="http://tontof.net/kriss/feed/">Kriss Feed</a> nebo <a href="http://projet.idleman.fr/leed/">Leed</a>. Je to nenáročný a jednoduchý, zároveň ale mocný a konfigurovatelný nástroj.', + 'github' => '<a href="https://github.com/FreshRSS/FreshRSS/issues">na Github</a>', + 'license' => 'Licence', + 'project_website' => 'Stránka projektu', + 'title' => 'O FreshRSS', + 'version' => 'Verze', + 'website' => 'Webové stránka', + ), + 'feed' => array( + 'add' => 'Můžete přidat kanály.', + 'empty' => 'Žádné články k zobrazení.', + 'rss_of' => 'RSS kanál %s', + 'title' => 'RSS kanály', + 'title_global' => 'Přehled', + 'title_fav' => 'Oblíbené', + ), + 'log' => array( + '_' => 'Logy', + 'clear' => 'Vymazat logy', + 'empty' => 'Log je prázdný', + 'title' => 'Logy', + ), + 'menu' => array( + 'about' => 'O FreshRSS', + 'add_query' => 'Vytvořit dotaz', + 'before_one_day' => 'Den nazpět', + 'before_one_week' => 'Před týdnem', + 'favorites' => 'Oblíbené (%s)', + 'global_view' => 'Přehled', + 'main_stream' => 'Všechny kanály', + 'mark_all_read' => 'Označit vše jako přečtené', + 'mark_cat_read' => 'Označit kategorii jako přečtenou', + 'mark_feed_read' => 'Označit kanál jako přečtený', + 'newer_first' => 'Nové nejdříve', + 'non-starred' => 'Zobrazit vše vyjma oblíbených', + 'normal_view' => 'Normální', + 'older_first' => 'Nejstarší nejdříve', + 'queries' => 'Uživatelské dotazy', + 'read' => 'Zobrazovat přečtené', + 'reader_view' => 'Čtení', + 'rss_view' => 'RSS kanál', + 'search_short' => 'Hledat', + 'starred' => 'Zobrazit oblíbené', + 'stats' => 'Statistika', + 'subscription' => 'Správa subskripcí', + 'unread' => 'Zobrazovat nepřečtené', + ), + 'share' => 'Sdílet', + 'tag' => array( + 'related' => 'Související tagy', + ), +); diff --git a/app/i18n/cz/install.php b/app/i18n/cz/install.php new file mode 100644 index 000000000..ea4812ea5 --- /dev/null +++ b/app/i18n/cz/install.php @@ -0,0 +1,119 @@ +<?php + +return array( + 'action' => array( + 'finish' => 'Dokončit instalaci', + 'fix_errors_before' => 'Chyby prosím před přechodem na další krok opravte.', + 'keep_install' => 'Zachovat předchozí instalaci', + 'next_step' => 'Přejít na další krok', + 'reinstall' => 'Reinstalovat FreshRSS', + ), + 'auth' => array( + 'form' => 'Webový formulář (tradiční, vyžaduje JavaScript)', + 'http' => 'HTTP (pro pokročilé uživatele s HTTPS)', + 'none' => 'Žádný (nebezpečné)', + 'password_form' => 'Heslo<br /><small>(pro přihlášení webovým formulářem)</small>', + 'password_format' => 'Alespoň 7 znaků', + 'type' => 'Způsob přihlášení', + ), + 'bdd' => array( + '_' => 'Databáze', + 'conf' => array( + '_' => 'Nastavení databáze', + 'ko' => 'Ověřte informace o databázi.', + 'ok' => 'Nastavení databáze bylo uloženo.', + ), + 'host' => 'Hostitel', + 'prefix' => 'Prefix tabulky', + 'password' => 'Heslo', + 'type' => 'Typ databáze', + 'username' => 'Uživatel', + ), + 'check' => array( + '_' => 'Kontrola', + 'already_installed' => 'Zjistili jsme, že FreshRSS je již nainstalován!', + 'cache' => array( + 'nok' => 'Zkontrolujte oprávnění adresáře <em>./data/cache</em>. HTTP server musí mít do tohoto adresáře práva zápisu', + 'ok' => 'Oprávnění adresáře cache jsou v pořádku.', + ), + 'ctype' => array( + 'nok' => 'Není nainstalována požadovaná knihovna pro ověřování znaků (php-ctype).', + 'ok' => 'Je nainstalována požadovaná knihovna pro ověřování znaků (ctype).', + ), + 'curl' => array( + 'nok' => 'Nemáte cURL (balíček php-curl).', + 'ok' => 'Máte rozšíření cURL.', + ), + 'data' => array( + 'nok' => 'Zkontrolujte oprávnění adresáře <em>./data</em>. HTTP server musí mít do tohoto adresáře práva zápisu', + 'ok' => 'Oprávnění adresáře data jsou v pořádku.', + ), + 'dom' => array( + 'nok' => 'Nemáte požadovanou knihovnu pro procházení DOM.', + 'ok' => 'Máte požadovanou knihovnu pro procházení DOM.', + ), + 'favicons' => array( + 'nok' => 'Zkontrolujte oprávnění adresáře <em>./data/favicons</em>. HTTP server musí mít do tohoto adresáře práva zápisu', + 'ok' => 'Oprávnění adresáře favicons jsou v pořádku.', + ), + 'fileinfo' => array( + 'nok' => 'Nemáte PHP fileinfo (balíček fileinfo).', + 'ok' => 'Máte rozšíření fileinfo.', + ), + 'http_referer' => array( + 'nok' => 'Zkontrolujte prosím že neměníte HTTP REFERER.', + 'ok' => 'Váš HTTP REFERER je znám a odpovídá Vašemu serveru.', + ), + 'json' => array( + 'nok' => 'Pro parsování JSON chybí doporučená knihovna.', + 'ok' => 'Máte doporučenou knihovnu pro parsování JSON.', + ), + 'minz' => array( + 'nok' => 'Nemáte framework Minz.', + 'ok' => 'Máte framework Minz.', + ), + 'pcre' => array( + 'nok' => 'Nemáte požadovanou knihovnu pro regulární výrazy (php-pcre).', + 'ok' => 'Máte požadovanou knihovnu pro regulární výrazy (PCRE).', + ), + 'pdo' => array( + 'nok' => 'Nemáte PDO nebo některý z podporovaných ovladačů (pdo_mysql, pdo_sqlite, pdo_pgsql).', + 'ok' => 'Máte PDO a alespoň jeden z podporovaných ovladačů (pdo_mysql, pdo_sqlite, pdo_pgsql).', + ), + 'php' => array( + 'nok' => 'Vaše verze PHP je %s, ale FreshRSS vyžaduje alespoň verzi %s.', + 'ok' => 'Vaše verze PHP je %s a je kompatibilní s FreshRSS.', + ), + 'users' => array( + 'nok' => 'Zkontrolujte oprávnění adresáře <em>./data/users</em>. HTTP server musí mít do tohoto adresáře práva zápisu', + 'ok' => 'Oprávnění adresáře users jsou v pořádku.', + ), + 'xml' => array( + 'nok' => 'Pro parsování XML chybí požadovaná knihovna.', + 'ok' => 'Máte požadovanou knihovnu pro parsování XML.', + ), + ), + 'conf' => array( + '_' => 'Obecná nastavení', + 'ok' => 'Nastavení bylo uloženo.', + ), + 'congratulations' => 'Gratulujeme!', + 'default_user' => 'Jméno výchozího uživatele <small>(maximálně 16 alfanumerických znaků)</small>', + 'delete_articles_after' => 'Smazat články starší než', + 'fix_errors_before' => 'Chyby prosím před přechodem na další krok opravte.', + 'javascript_is_better' => 'Práce s FreshRSS je příjemnější se zapnutým JavaScriptem', + 'js' => array( + 'confirm_reinstall' => 'Reinstalací FreshRSS ztratíte předchozí konfiguraci. Opravdu chcete pokračovat?', + ), + 'language' => array( + '_' => 'Jazyk', + 'choose' => 'Vyberte jazyk FreshRSS', + 'defined' => 'Jazyk byl nastaven.', + ), + 'not_deleted' => 'Nastala chyba, soubor <em>%s</em> musíte smazat ručně.', + 'ok' => 'Instalace byla úspěšná.', + 'step' => 'krok %d', + 'steps' => 'Kroky', + 'title' => 'Instalace · FreshRSS', + 'this_is_the_end' => 'Konec', +); diff --git a/app/i18n/cz/sub.php b/app/i18n/cz/sub.php new file mode 100644 index 000000000..274cf16e1 --- /dev/null +++ b/app/i18n/cz/sub.php @@ -0,0 +1,62 @@ +<?php + +return array( + 'category' => array( + '_' => 'Kategorie', + 'add' => 'Přidat kategorii', + 'empty' => 'Vyprázdit kategorii', + 'new' => 'Nová kategorie', + ), + 'feed' => array( + 'add' => 'Přidat RSS kanál', + 'advanced' => 'Pokročilé', + 'archiving' => 'Archivace', + 'auth' => array( + 'configuration' => 'Přihlášení', + 'help' => 'Umožní přístup k RSS kanálům chráneným HTTP autentizací', + 'http' => 'HTTP přihlášení', + 'password' => 'Heslo', + 'username' => 'Přihlašovací jméno', + ), + 'css_help' => 'Stáhne zkrácenou verzi RSS kanálů (pozor, náročnější na čas!)', + 'css_path' => 'Původní CSS soubor článku z webových stránek', + '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 <em>%s</em>.', + 'no_selected' => 'Nejsou označeny žádné kanály.', + 'number_entries' => '%d článků', + 'stats' => 'Statistika', + 'think_to_add' => 'Můžete přidat kanály.', + 'title' => 'Název', + 'title_add' => 'Přidat RSS kanál', + 'ttl' => 'Neobnovovat častěji než', + 'url' => 'URL kanálu', + 'validator' => 'Zkontrolovat platnost kanálu', + 'website' => 'URL webové stránky', + 'pubsubhubbub' => 'Okamžité oznámení s PubSubHubbub', + ), + 'import_export' => array( + 'export' => 'Export', + 'export_opml' => 'Exportovat seznam kanálů (OPML)', + 'export_starred' => 'Exportovat oblíbené', + 'feed_list' => 'Seznam %s článků', + 'file_to_import' => 'Soubor k importu<br />(OPML, JSON nebo ZIP)', + 'file_to_import_no_zip' => 'Soubor k importu<br />(OPML nebo JSON)', + 'import' => 'Import', + 'starred_list' => 'Seznam oblíbených článků', + 'title' => 'Import / export', + ), + 'menu' => array( + 'bookmark' => 'Přihlásit (FreshRSS bookmark)', + 'import_export' => 'Import / export', + 'subscription_management' => 'Správa subskripcí', + ), + 'title' => array( + '_' => 'Správa subskripcí', + 'feed_management' => 'Správa RSS kanálů', + ), +); diff --git a/app/i18n/de/admin.php b/app/i18n/de/admin.php new file mode 100644 index 000000000..8fc43a7bb --- /dev/null +++ b/app/i18n/de/admin.php @@ -0,0 +1,181 @@ +<?php + +return array( + 'auth' => array( + 'allow_anonymous' => 'Anonymes Lesen der Artikel des Standardbenutzers (%s) erlauben', + 'allow_anonymous_refresh' => 'Anonymes Aktualisieren der Artikel erlauben', + 'api_enabled' => '<abbr>API</abbr>-Zugriff erlauben <small>(für mobile Anwendungen benötigt)</small>', + 'form' => 'Webformular (traditionell, benötigt JavaScript)', + 'http' => 'HTTP (HTTPS für erfahrene Benutzer)', + 'none' => 'Keine (gefährlich)', + 'title' => 'Authentifizierung', + 'title_reset' => 'Zurücksetzen der Authentifizierung', + 'token' => 'Authentifizierungs-Token', + 'token_help' => 'Erlaubt den Zugriff auf die RSS-Ausgabe des Standardbenutzers ohne Authentifizierung.', + 'type' => 'Authentifizierungsmethode', + 'unsafe_autologin' => 'Erlaube unsicheres automatisches Anmelden mit folgendem Format: ', + ), + 'check_install' => array( + 'cache' => array( + 'nok' => 'Überprüfen Sie die Berechtigungen des Verzeichnisses <em>./data/cache</em>. Der HTTP-Server muss Schreibrechte besitzen.', + 'ok' => 'Die Berechtigungen des Verzeichnisses <em>./data/cache</em> sind in Ordnung.', + ), + 'categories' => array( + 'nok' => 'Die Tabelle <em>category</em> ist schlecht konfiguriert.', + 'ok' => 'Die Tabelle <em>category</em> ist korrekt konfiguriert.', + ), + 'connection' => array( + 'nok' => 'Verbindung zur Datenbank kann nicht aufgebaut werden.', + 'ok' => 'Verbindung zur Datenbank konnte aufgebaut werden.', + ), + 'ctype' => array( + 'nok' => 'Ihnen fehlt eine benötigte Bibliothek für die Überprüfung von Zeichentypen (php-ctype).', + 'ok' => 'Sie haben die benötigte Bibliothek für die Überprüfung von Zeichentypen (ctype).', + ), + 'curl' => array( + 'nok' => 'Ihnen fehlt cURL (Paket php-curl).', + 'ok' => 'Sie haben die cURL-Erweiterung.', + ), + 'data' => array( + 'nok' => 'Überprüfen Sie die Berechtigungen des Verzeichnisses <em>./data</em>. Der HTTP-Server muss Schreibrechte besitzen.', + 'ok' => 'Die Berechtigungen des Verzeichnisses <em>./data</em> sind in Ordnung.', + ), + 'database' => 'Datenbank-Installation', + 'dom' => array( + 'nok' => 'Ihnen fehlt eine benötigte Bibliothek um DOM zu durchstöbern (Paket php-xml).', + 'ok' => 'Sie haben die benötigte Bibliothek um DOM zu durchstöbern.', + ), + 'entries' => array( + 'nok' => 'Die Tabelle <em>entry</em> ist schlecht konfiguriert.', + 'ok' => 'Die Tabelle <em>entry</em> ist korrekt konfiguriert.', + ), + 'favicons' => array( + 'nok' => 'Überprüfen Sie die Berechtigungen des Verzeichnisses <em>./data/favicons</em>. Der HTTP-Server muss Schreibrechte besitzen.', + 'ok' => 'Die Berechtigungen des Verzeichnisses <em>./data/favicons</em> sind in Ordnung.', + ), + 'feeds' => array( + 'nok' => 'Die Tabelle <em>feed</em> ist schlecht konfiguriert.', + 'ok' => 'Die Tabelle <em>feed</em> ist korrekt konfiguriert.', + ), + 'fileinfo' => array( + 'nok' => 'Ihnen fehlt PHP fileinfo (Paket fileinfo).', + 'ok' => 'Sie haben die fileinfo-Erweiterung.', + ), + 'files' => 'Datei-Installation', + 'json' => array( + 'nok' => 'Ihnen fehlt die JSON-Erweiterung (Paket php5-json).', + 'ok' => 'Sie haben die JSON-Erweiterung.', + ), + 'minz' => array( + 'nok' => 'Ihnen fehlt das Minz-Framework.', + 'ok' => 'Sie haben das Minz-Framework.', + ), + 'pcre' => array( + 'nok' => 'Ihnen fehlt eine benötigte Bibliothek für reguläre Ausdrücke (php-pcre).', + 'ok' => 'Sie haben die benötigte Bibliothek für reguläre Ausdrücke (PCRE).', + ), + 'pdo' => array( + 'nok' => 'Ihnen fehlt PDO oder einer der unterstützten Treiber (pdo_mysql, pdo_sqlite, pdo_pgsql).', + 'ok' => 'Sie haben PDO und mindestens einen der unterstützten Treiber (pdo_mysql, pdo_sqlite, pdo_pgsql).', + ), + 'php' => array( + '_' => 'PHP-Installation', + 'nok' => 'Ihre PHP-Version ist %s aber FreshRSS benötigt mindestens Version %s.', + 'ok' => 'Ihre PHP-Version ist %s, welche kompatibel mit FreshRSS ist.', + ), + 'tables' => array( + 'nok' => 'Es fehlen eine oder mehrere Tabellen in der Datenbank.', + 'ok' => 'Tabellen existieren in der Datenbank.', + ), + 'title' => 'Installationsüberprüfung', + 'tokens' => array( + 'nok' => 'Überprüfen Sie die Berechtigungen des Verzeichnisses <em>./data/tokens</em>. Der HTTP-Server muss Schreibrechte besitzen.', + 'ok' => 'Die Berechtigungen des Verzeichnisses <em>./data/tokens</em> sind in Ordnung.', + ), + 'users' => array( + 'nok' => 'Überprüfen Sie die Berechtigungen des Verzeichnisses <em>./data/users</em>. Der HTTP-Server muss Schreibrechte besitzen.', + 'ok' => 'Die Berechtigungen des Verzeichnisses <em>./data/users</em> sind in Ordnung.', + ), + 'zip' => array( + 'nok' => 'Ihnen fehlt die ZIP-Erweiterung (Paket php-zip).', + 'ok' => 'Sie haben die ZIP-Erweiterung.', + ), + ), + 'extensions' => array( + 'disabled' => 'Deaktiviert', + 'empty_list' => 'Es gibt keine installierte Erweiterung.', + 'enabled' => 'Aktiviert', + 'no_configure_view' => 'Diese Erweiterung kann nicht konfiguriert werden.', + 'system' => array( + '_' => 'System-Erweiterungen', + 'no_rights' => 'System-Erweiterung (Sie haben keine Berechtigung dafür)', + ), + 'title' => 'Erweiterungen', + 'user' => 'Benutzer-Erweiterungen', + ), + 'stats' => array( + '_' => 'Statistiken', + 'all_feeds' => 'Alle Feeds', + 'category' => 'Kategorie', + 'entry_count' => 'Anzahl der Einträge', + 'entry_per_category' => 'Einträge pro Kategorie', + 'entry_per_day' => 'Einträge pro Tag (letzten 30 Tage)', + 'entry_per_day_of_week' => 'Pro Wochentag (Durchschnitt: %.2f Nachrichten)', + 'entry_per_hour' => 'Pro Stunde (Durchschnitt: %.2f Nachrichten)', + 'entry_per_month' => 'Pro Monat (Durchschnitt: %.2f Nachrichten)', + 'entry_repartition' => 'Einträge-Verteilung', + 'feed' => 'Feed', + 'feed_per_category' => 'Feeds pro Kategorie', + 'idle' => 'Inaktive Feeds', + 'main' => 'Haupt-Statistiken', + 'main_stream' => 'Haupt-Feeds', + 'menu' => array( + 'idle' => 'Inaktive Feeds', + 'main' => 'Haupt-Statistiken', + 'repartition' => 'Artikel-Verteilung', + ), + 'no_idle' => 'Es gibt keinen inaktiven Feed!', + 'number_entries' => '%d Artikel', + 'percent_of_total' => '%% Gesamt', + 'repartition' => 'Artikel-Verteilung', + 'status_favorites' => 'Favoriten', + 'status_read' => 'Gelesen', + 'status_total' => 'Gesamt', + 'status_unread' => 'Ungelesen', + 'title' => 'Statistiken', + 'top_feed' => 'Top 10-Feeds', + ), + 'system' => array( + '_' => 'System configuration', // @todo translate + 'auto-update-url' => 'Auto-update server URL', // @todo translate + 'instance-name' => 'Instance name', // @todo translate + 'max-categories' => 'Categories per user limit', // @todo translate + 'max-feeds' => 'Feeds per user limit', // @todo translate + 'registration' => array( + 'help' => '0 meint, dass es kein Account Limit gibt', + 'number' => 'Maximale Anzahl von Accounts', + ), + ), + 'update' => array( + '_' => 'System aktualisieren', + 'apply' => 'Anwenden', + 'check' => 'Auf neue Aktualisierungen prüfen', + 'current_version' => 'Ihre aktuelle Version von FreshRSS ist %s.', + 'last' => 'Letzte Überprüfung: %s', + 'none' => 'Keine ausstehende Aktualisierung', + 'title' => 'System aktualisieren', + ), + 'user' => array( + 'articles_and_size' => '%s Artikel (%s)', + 'create' => 'Neuen Benutzer erstellen', + 'language' => 'Sprache', + 'number' => 'Es wurde bis jetzt %d Account erstellt', + 'numbers' => 'Es wurden bis jetzt %d Accounts erstellt', + 'password_form' => 'Passwort<br /><small>(für die Anmeldemethode per Webformular)</small>', + 'password_format' => 'mindestens 7 Zeichen', + 'title' => 'Benutzer verwalten', + 'user_list' => 'Liste der Benutzer', + 'username' => 'Nutzername', + 'users' => 'Benutzer', + ), +); diff --git a/app/i18n/de/conf.php b/app/i18n/de/conf.php new file mode 100644 index 000000000..7c57d5655 --- /dev/null +++ b/app/i18n/de/conf.php @@ -0,0 +1,173 @@ +<?php + +return array( + 'archiving' => array( + '_' => 'Archivierung', + 'advanced' => 'Erweitert', + 'delete_after' => 'Entferne Artikel nach', + 'help' => 'Weitere Optionen sind in den Einstellungen der individuellen Feeds verfügbar.', + 'keep_history_by_feed' => 'Minimale Anzahl an Artikeln, die pro Feed behalten werden', + 'optimize' => 'Datenbank optimieren', + 'optimize_help' => 'Sollte gelegentlich durchgeführt werden, um die Größe der Datenbank zu reduzieren.', + 'purge_now' => 'Jetzt bereinigen', + 'title' => 'Archivierung', + 'ttl' => 'Aktualisiere automatisch nicht öfter als', + ), + 'display' => array( + '_' => 'Anzeige', + 'icon' => array( + 'bottom_line' => 'Fußzeile', + 'entry' => 'Artikel-Symbole', + 'publication_date' => 'Datum der Veröffentlichung', + 'related_tags' => 'Verwandte Tags', + 'sharing' => 'Teilen', + 'top_line' => 'Kopfzeile', + ), + 'language' => 'Sprache', + 'notif_html5' => array( + 'seconds' => 'Sekunden (0 bedeutet keine Zeitüberschreitung)', + 'timeout' => 'Zeitüberschreitung für HTML5-Benachrichtigung', + ), + 'theme' => 'Erscheinungsbild', + 'title' => 'Anzeige', + 'width' => array( + 'content' => 'Inhaltsbreite', + 'large' => 'Gross', + 'medium' => 'Mittel', + 'no_limit' => 'Keine Begrenzung', + 'thin' => 'Klein', + ), + ), + 'query' => array( + '_' => 'Benutzerabfragen', + 'deprecated' => 'Diese Abfrage ist nicht länger gültig. Die referenzierte Kategorie oder der Feed ist gelöscht worden.', + 'filter' => 'Angewendeter Filter:', + 'get_all' => 'Alle Artikel anzeigen', + 'get_category' => 'Kategorie "%s" anzeigen', + 'get_favorite' => 'Lieblingsartikel anzeigen', + 'get_feed' => 'Feed "%s" anzeigen', + 'no_filter' => 'Kein Filter', + 'none' => 'Sie haben bisher keine Benutzerabfrage erstellt.', + 'number' => 'Abfrage Nr. %d', + 'order_asc' => 'Älteste Artikel zuerst anzeigen', + 'order_desc' => 'Neueste Artikel zuerst anzeigen', + 'search' => 'Suche nach "%s"', + 'state_0' => 'Alle Artikel anzeigen', + 'state_1' => 'Gelesene Artikel anzeigen', + 'state_2' => 'Ungelesene Artikel anzeigen', + 'state_3' => 'Alle Artikel anzeigen', + 'state_4' => 'Lieblingsartikel anzeigen', + 'state_5' => 'Gelesene Lieblingsartikel anzeigen', + 'state_6' => 'Ungelesene Lieblingsartikel anzeigen', + 'state_7' => 'Lieblingsartikel anzeigen', + 'state_8' => 'Keine Lieblingsartikel anzeigen', + 'state_9' => 'Gelesene ohne Lieblingsartikel anzeigen', + 'state_10' => 'Ungelesene ohne Lieblingsartikel anzeigen', + 'state_11' => 'Keine Lieblingsartikel anzeigen', + 'state_12' => 'Alle Artikel anzeigen', + 'state_13' => 'Gelesene Artikel anzeigen', + 'state_14' => 'Ungelesene Artikel anzeigen', + 'state_15' => 'Alle Artikel anzeigen', + 'title' => 'Benutzerabfragen', + ), + 'profile' => array( + '_' => 'Profil-Verwaltung', + 'delete' => array( + '_' => 'Accountlöschung', + 'warn' => 'Dein Account und alle damit bezogenen Daten werden gelöscht.', + ), + 'password_api' => 'Passwort-API<br /><small>(z. B. für mobile Anwendungen)</small>', + 'password_form' => 'Passwort<br /><small>(für die Anmeldemethode per Webformular)</small>', + 'password_format' => 'mindestens 7 Zeichen', + 'title' => 'Profil', + ), + 'reading' => array( + '_' => 'Lesen', + 'after_onread' => 'Nach „Alle als gelesen markieren“,', + 'articles_per_page' => 'Anzahl der Artikel pro Seite', + 'auto_load_more' => 'Die nächsten Artikel am Seitenende laden', + 'auto_remove_article' => 'Artikel nach dem Lesen verstecken', + 'mark_updated_article_unread' => 'Markieren Sie aktualisierte Artikel als ungelesen', + 'confirm_enabled' => 'Bei der Aktion „Alle als gelesen markieren“ einen Bestätigungsdialog anzeigen', + 'display_articles_unfolded' => 'Artikel standardmäßig ausgeklappt zeigen', + 'display_categories_unfolded' => 'Kategorien standardmäßig eingeklappt zeigen', + 'hide_read_feeds' => 'Kategorien & Feeds ohne ungelesene Artikel verstecken (funktioniert nicht mit der Einstellung „Alle Artikel zeigen“)', + 'img_with_lazyload' => 'Verwende die "träges Laden"-Methode zum Laden von Bildern', + 'jump_next' => 'springe zum nächsten ungelesenen Geschwisterelement (Feed oder Kategorie)', + 'number_divided_when_reader' => 'Geteilt durch 2 in der Lese-Ansicht.', + 'read' => array( + 'article_open_on_website' => 'wenn der Artikel auf der Original-Webseite geöffnet wird', + 'article_viewed' => 'wenn der Artikel angesehen wird', + 'scroll' => 'beim Blättern', + 'upon_reception' => 'beim Empfang des Artikels', + 'when' => 'Artikel als gelesen markieren…', + ), + 'show' => array( + '_' => 'Artikel zum Anzeigen', + 'adaptive' => 'Anzeige anpassen', + 'all_articles' => 'Alle Artikel zeigen', + 'unread' => 'Nur ungelesene zeigen', + ), + 'sort' => array( + '_' => 'Sortierreihenfolge', + 'newer_first' => 'Neuere zuerst', + 'older_first' => 'Ältere zuerst', + ), + 'sticky_post' => 'Wenn geöffnet, den Artikel ganz oben anheften', + 'title' => 'Lesen', + 'view' => array( + 'default' => 'Standard-Ansicht', + 'global' => 'Globale Ansicht', + 'normal' => 'Normale Ansicht', + 'reader' => 'Lese-Ansicht', + ), + ), + 'sharing' => array( + '_' => 'Teilen', + 'blogotext' => 'Blogotext', + 'diaspora' => 'Diaspora*', + 'email' => 'E-Mail', + 'facebook' => 'Facebook', + 'g+' => 'Google+', + 'more_information' => 'Weitere Informationen', + 'print' => 'Drucken', + 'shaarli' => 'Shaarli', + 'share_name' => 'Anzuzeigender Teilen-Name', + 'share_url' => 'Zu verwendende Teilen-URL', + 'title' => 'Teilen', + 'twitter' => 'Twitter', + 'wallabag' => 'wallabag', + ), + 'shortcut' => array( + '_' => 'Tastenkombination', + 'article_action' => 'Artikelaktionen', + 'auto_share' => 'Teilen', + 'auto_share_help' => 'Wenn es nur eine Option zum Teilen gibt, wird diese verwendet. Ansonsten sind die Optionen über ihre Nummer erreichbar.', + 'close_dropdown' => 'Menüs schließen', + 'collapse_article' => 'Einklappen', + 'first_article' => 'Zum ersten Artikel springen', + 'focus_search' => 'Auf das Suchfeld zugreifen', + 'help' => 'Dokumentation anzeigen', + 'javascript' => 'JavaScript muss aktiviert sein, um Tastaturkürzel benutzen zu können', + 'last_article' => 'Zum letzten Artikel springen', + 'load_more' => 'Weitere Artikel laden', + 'mark_read' => 'Als gelesen markieren', + 'mark_favorite' => 'Als Favorit markieren', + 'navigation' => 'Navigation', + 'navigation_help' => 'Mit der "Umschalttaste" finden die Tastenkombination auf Feeds Anwendung.<br/>Mit der "Alt-Taste" finden die Tastenkombination auf Kategorien Anwendung.', + 'next_article' => 'Zum nächsten Artikel springen', + 'other_action' => 'Andere Aktionen', + 'previous_article' => 'Zum vorherigen Artikel springen', + 'see_on_website' => 'Auf der Original-Webseite ansehen', + 'shift_for_all_read' => '+ <code>Umschalttaste</code>, 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.', + ), + 'user' => array( + 'articles_and_size' => '%s Artikel (%s)', + 'current' => 'Aktueller Benutzer', + 'is_admin' => 'ist Administrator', + 'users' => 'Benutzer', + ), +); diff --git a/app/i18n/de/feedback.php b/app/i18n/de/feedback.php new file mode 100644 index 000000000..195083b36 --- /dev/null +++ b/app/i18n/de/feedback.php @@ -0,0 +1,109 @@ +<?php + +return array( + 'admin' => array( + 'optimization_complete' => 'Optimierung abgeschlossen', + ), + 'access' => array( + 'denied' => 'Sie haben nicht die Berechtigung, diese Seite aufzurufen', + 'not_found' => 'Sie suchen nach einer Seite, die nicht existiert', + ), + 'auth' => array( + 'form' => array( + 'not_set' => 'Während der Konfiguration des Authentifikationssystems trat ein Fehler auf. Bitte versuchen Sie es später erneut.', + 'set' => 'Formular ist ab sofort ihr Standard-Authentifikationssystem.', + ), + 'login' => array( + 'invalid' => 'Anmeldung ist ungültig', + 'success' => 'Sie sind angemeldet', + ), + 'logout' => array( + 'success' => 'Sie sind abgemeldet', + ), + 'no_password_set' => 'Administrator-Passwort ist nicht gesetzt worden. Dieses Feature ist nicht verfügbar.', + ), + 'conf' => array( + 'error' => 'Während der Speicherung der Konfiguration trat ein Fehler auf', + 'query_created' => 'Abfrage "%s" ist erstellt worden.', + 'shortcuts_updated' => 'Die Tastenkombinationen sind aktualisiert worden', + 'updated' => 'Die Konfiguration ist aktualisiert worden', + ), + 'extensions' => array( + 'already_enabled' => '%s ist bereits aktiviert', + 'disable' => array( + 'ko' => '%s kann nicht deaktiviert werden. Für Details <a href="%s">prüfen Sie die FressRSS-Protokolle</a>.', + 'ok' => '%s ist jetzt deaktiviert', + ), + 'enable' => array( + 'ko' => '%s kann nicht aktiviert werden. Für Details <a href="%s">prüfen Sie die FressRSS-Protokolle</a>.', + 'ok' => '%s ist jetzt aktiviert', + ), + 'no_access' => 'Sie haben keinen Zugang zu %s', + 'not_enabled' => '%s ist noch nicht aktiviert', + 'not_found' => '%s existiert nicht', + ), + 'import_export' => array( + 'export_no_zip_extension' => 'Die ZIP-Erweiterung fehlt auf Ihrem Server. Bitte versuchen Sie die Dateien eine nach der anderen zu exportieren.', + 'feeds_imported' => 'Ihre Feeds sind importiert worden und werden jetzt aktualisiert', + 'feeds_imported_with_errors' => 'Ihre Feeds sind importiert worden, aber es traten einige Fehler auf', + 'file_cannot_be_uploaded' => 'Die Datei kann nicht hochgeladen werden!', + 'no_zip_extension' => 'Die ZIP-Erweiterung ist auf Ihrem Server nicht vorhanden.', + 'zip_error' => 'Ein Fehler trat während des ZIP-Imports auf.', + ), + 'sub' => array( + 'actualize' => 'Aktualisieren', + 'category' => array( + 'created' => 'Die Kategorie %s ist erstellt worden.', + 'deleted' => 'Die Kategorie ist gelöscht worden.', + 'emptied' => 'Die Kategorie ist geleert worden.', + 'error' => 'Die Kategorie kann nicht aktualisiert werden', + 'name_exists' => 'Der Kategorie-Name existiert bereits.', + 'no_id' => 'Sie müssen die ID der Kategorie präzisieren.', + 'no_name' => 'Der Kategorie-Name kann nicht leer sein.', + 'not_delete_default' => 'Sie können die Vorgabe-Kategorie nicht löschen!', + 'not_exist' => 'Die Kategorie existiert nicht!', + 'over_max' => 'Sie haben Ihre Kategorien-Limite erreicht (%d)', + 'updated' => 'Die Kategorie ist aktualisiert worden.', + ), + 'feed' => array( + 'actualized' => '<em>%s</em> ist aktualisiert worden', + 'actualizeds' => 'Die RSS-Feeds sind aktualisiert worden', + 'added' => 'Der RSS-Feed <em>%s</em> ist hinzugefügt worden', + 'already_subscribed' => 'Sie haben <em>%s</em> bereits abonniert', + 'deleted' => 'Der Feed ist gelöscht worden', + 'error' => 'Der Feed kann nicht aktualisiert werden', + 'internal_problem' => 'Der RSS-Feed konnte nicht hinzugefügt werden. Für Details <a href="%s">prüfen Sie die FressRSS-Protokolle</a>.', + 'invalid_url' => 'Die URL <em>%s</em> ist ungültig', + 'marked_read' => 'Die Feeds sind als gelesen markiert worden', + 'n_actualized' => 'Die %d Feeds sind aktualisiert worden', + 'n_entries_deleted' => 'Die %d Artikel sind gelöscht worden', + 'no_refresh' => 'Es gibt keinen Feed zum Aktualisieren…', + 'not_added' => '<em>%s</em> konnte nicht hinzugefügt werden', + 'over_max' => 'Sie haben Ihre Feeds-Limite erreicht (%d)', + 'updated' => 'Der Feed ist aktualisiert worden', + ), + 'purge_completed' => 'Bereinigung abgeschlossen (%d Artikel gelöscht)', + ), + 'update' => array( + 'can_apply' => 'FreshRSS wird nun auf die <strong>Version %s</strong> aktualisiert.', + 'error' => 'Der Aktualisierungsvorgang stieß auf einen Fehler: %s', + 'file_is_nok' => 'Überprüfen Sie die Berechtigungen des Verzeichnisses <em>%s</em>. Der HTTP-Server muss Schreibrechte besitzen', + 'finished' => 'Aktualisierung abgeschlossen!', + 'none' => 'Keine Aktualisierung zum Anwenden', + 'server_not_found' => 'Der Aktualisierungs-Server kann nicht gefunden werden. [%s]', + ), + 'user' => array( + 'created' => array( + '_' => 'Der Benutzer %s ist erstellt worden', + 'error' => 'Der Benutzer %s kann nicht erstellt werden', + ), + 'deleted' => array( + '_' => 'Der Benutzer %s ist gelöscht worden', + 'error' => 'Der Benutzer %s kann nicht gelöscht werden', + ), + ), + 'profile' => array( + 'error' => 'Ihr Profil kann nicht geändert werden', + 'updated' => 'Ihr Profil ist geändert worden', + ), +); diff --git a/app/i18n/de/gen.php b/app/i18n/de/gen.php new file mode 100644 index 000000000..c73aedbfe --- /dev/null +++ b/app/i18n/de/gen.php @@ -0,0 +1,182 @@ +<?php + +return array( + 'action' => array( + 'actualize' => 'Aktualisieren', + 'back_to_rss_feeds' => '← Zurück zu Ihren RSS-Feeds gehen', + 'cancel' => 'Abbrechen', + 'create' => 'Erstellen', + 'disable' => 'Deaktivieren', + 'empty' => 'Leeren', + 'enable' => 'Aktivieren', + 'export' => 'Exportieren', + 'filter' => 'Filtern', + 'import' => 'Importieren', + 'manage' => 'Verwalten', + 'mark_read' => 'Als gelesen markieren', + 'mark_favorite' => 'Als Favorit markieren', + 'remove' => 'Entfernen', + 'see_website' => 'Webseite ansehen', + 'submit' => 'Abschicken', + 'truncate' => 'Alle Artikel löschen', + ), + 'auth' => array( + 'email' => 'E-Mail-Adresse', + 'keep_logged_in' => 'Eingeloggt bleiben <small>(%s Tage)</small>', + 'login' => 'Anmelden', + 'logout' => 'Abmelden', + 'password' => array( + '_' => 'Passwort', + 'format' => '<small>mindestens 7 Zeichen</small>', + ), + 'registration' => array( + '_' => 'Neuer Account', + 'ask' => 'Erstelle einen Account?', + 'title' => 'Accounterstellung', + ), + 'reset' => 'Zurücksetzen der Authentifizierung', + 'username' => array( + '_' => 'Nutzername', + 'admin' => 'Administrator-Nutzername', + 'format' => '<small>maximal 16 alphanumerische Zeichen</small>', + ), + ), + 'date' => array( + 'Apr' => '\\A\\p\\r\\i\\l', + 'Aug' => '\\A\\u\\g\\u\\s\\t', + 'Dec' => '\\D\\e\\z\\e\\m\\b\\e\\r', + 'Feb' => '\\F\\e\\b\\r\\u\\a\\r', + 'Jan' => '\\J\\a\\n\\u\\a\\r', + 'Jul' => '\\J\\u\\l\\i', + 'Jun' => '\\J\\u\\n\\i', + 'Mar' => '\\M\\ä\\r\\z', + 'May' => '\\M\\a\\i', + 'Nov' => '\\N\\o\\v\\e\\m\\b\\e\\r', + 'Oct' => '\\O\\k\\t\\o\\b\\e\\r', + 'Sep' => '\\S\\e\\p\\t\\e\\m\\b\\e\\r', + 'apr' => 'Apr', + 'april' => 'April', + 'aug' => 'Aug', + 'august' => 'August', + 'before_yesterday' => 'Vor vorgestern', + 'dec' => 'Dez', + 'december' => 'Dezember', + 'feb' => 'Feb', + 'february' => 'Februar', + 'format_date' => 'd\\. %s Y', + 'format_date_hour' => 'd\\. %s Y \\u\\m H\\:i', + 'fri' => 'Fr', + 'jan' => 'Jan', + 'january' => 'Januar', + 'jul' => 'Jul', + 'july' => 'Juli', + 'jun' => 'Jun', + 'june' => 'Juni', + 'last_3_month' => 'Letzte drei Monate', + 'last_6_month' => 'Letzte sechs Monate', + 'last_month' => 'Letzter Monat', + 'last_week' => 'Letzte Woche', + 'last_year' => 'Letztes Jahr', + 'mar' => 'Mär', + 'march' => 'März', + 'may' => 'Mai', + 'mon' => 'Mo', + 'month' => 'Monat(en)', + 'nov' => 'Nov', + 'november' => 'November', + 'oct' => 'Okt', + 'october' => 'Oktober', + 'sat' => 'Sa', + 'sep' => 'Sep', + 'september' => 'September', + 'sun' => 'So', + 'thu' => 'Do', + 'today' => 'Heute', + 'tue' => 'Di', + 'wed' => 'Mi', + 'yesterday' => 'Gestern', + ), + 'freshrss' => array( + '_' => 'FreshRSS', + 'about' => 'Über FreshRSS', + ), + 'js' => array( + 'category_empty' => 'Kategorie leeren', + 'confirm_action' => 'Sind Sie sicher, dass Sie diese Aktion durchführen wollen? Diese Aktion kann nicht abgebrochen werden!', + 'confirm_action_feed_cat' => 'Sind Sie sicher, dass Sie diese Aktion durchführen wollen? Sie werden zugehörige Favoriten und Benutzerabfragen verlieren. Dies kann nicht abgebrochen werden!', + 'feedback' => array( + 'body_new_articles' => 'Es gibt %%d neue Artikel zum Lesen auf FreshRSS.', + 'request_failed' => 'Eine Anfrage ist fehlgeschlagen, dies könnte durch Probleme mit der Internetverbindung verursacht worden sein.', + 'title_new_articles' => 'FreshRSS: neue Artikel!', + ), + 'new_article' => 'Es gibt neue verfügbare Artikel. Klicken Sie, um die Seite zu aktualisieren.', + 'should_be_activated' => 'JavaScript muss aktiviert sein', + ), + 'lang' => array( + 'cz' => 'Čeština', + 'de' => 'Deutsch', + 'en' => 'English', + 'fr' => 'Français', + 'it' => 'Italiano', + 'nl' => 'Nederlands', + 'ru' => 'Русский', + 'tr' => 'Türkçe', + ), + 'menu' => array( + 'about' => 'Über', + 'admin' => 'Administration', + 'archiving' => 'Archivierung', + 'authentication' => 'Authentifizierung', + 'check_install' => 'Installationsüberprüfung', + 'configuration' => 'Konfiguration', + 'display' => 'Anzeige', + 'extensions' => 'Erweiterungen', + 'logs' => 'Protokolle', + 'queries' => 'Benutzerabfragen', + 'reading' => 'Lesen', + 'search' => 'Suche Worte oder #Tags', + 'sharing' => 'Teilen', + 'shortcuts' => 'Tastaturkürzel', + 'stats' => 'Statistiken', + 'system' => 'System configuration',// @todo translate + 'update' => 'Aktualisieren', + 'user_management' => 'Benutzer verwalten', + 'user_profile' => 'Profil', + ), + 'pagination' => array( + 'first' => 'Erste', + 'last' => 'Letzte', + 'load_more' => 'Weitere Artikel laden', + 'mark_all_read' => 'Alle als gelesen markieren', + 'next' => 'Nächste', + 'nothing_to_load' => 'Es gibt keine weiteren Artikel', + 'previous' => 'Vorherige', + ), + 'share' => array( + 'blogotext' => 'Blogotext', + 'diaspora' => 'Diaspora*', + 'email' => 'E-Mail', + 'facebook' => 'Facebook', + 'g+' => 'Google+', + 'movim' => 'Movim', + 'print' => 'Drucken', + 'shaarli' => 'Shaarli', + 'twitter' => 'Twitter', + 'wallabag' => 'wallabag v1', + 'wallabagv2' => 'wallabag v2', + 'jdh' => 'Journal du hacker', + ), + 'short' => array( + 'attention' => 'Achtung!', + 'blank_to_disable' => 'Zum Deaktivieren frei lassen', + 'by_author' => 'Von <em>%s</em>', + 'by_default' => 'standardmäßig', + 'damn' => 'Verdammt!', + 'default_category' => 'Unkategorisiert', + 'no' => 'Nein', + 'not_applicable' => 'Nicht verfügbar', + 'ok' => 'OK!', + 'or' => 'oder', + 'yes' => 'Ja', + ), +); diff --git a/app/i18n/de/index.php b/app/i18n/de/index.php new file mode 100644 index 000000000..df92d8085 --- /dev/null +++ b/app/i18n/de/index.php @@ -0,0 +1,61 @@ +<?php + +return array( + 'about' => array( + '_' => 'Über', + 'agpl3' => '<a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL 3</a>', + 'bugs_reports' => 'Fehlerberichte', + 'credits' => 'Credits', + 'credits_content' => 'Einige Designelemente stammen von <a href="http://twitter.github.io/bootstrap/">Bootstrap</a>, obwohl FreshRSS dieses Framework nicht nutzt. <a href="https://git.gnome.org/browse/gnome-icon-theme-symbolic">Icons</a> stammen vom <a href="https://www.gnome.org/">GNOME project</a>. <em>Open Sans</em> Font wurde von <a href="https://fonts.google.com/specimen/Open+Sans">Steve Matteson</a> erstellt. FreshRSS basiert auf <a href="https://github.com/marienfressinaud/MINZ">Minz</a>, einem PHP-Framework.', + 'freshrss_description' => 'FreshRSS ist ein RSS-Feedsaggregator zum selbst hosten wie zum Beispiel <a href="http://tontof.net/kriss/feed/">Kriss Feed</a> oder <a href="http://projet.idleman.fr/leed/">Leed</a>. Er ist leicht und einfach zu handhaben und gleichzeitig ein leistungsstarkes und konfigurierbares Werkzeug.', + 'github' => '<a href="https://github.com/FreshRSS/FreshRSS/issues">on Github</a>', + 'license' => 'Lizenz', + 'project_website' => 'Projekt-Webseite', + 'title' => 'Über', + 'version' => 'Version', + 'website' => 'Webseite', + ), + 'feed' => array( + 'add' => 'Sie können Feeds hinzufügen.', + 'empty' => 'Es gibt keinen Artikel zum Anzeigen.', + 'rss_of' => 'RSS-Feed von %s', + 'title' => 'Ihre RSS-Feeds', + 'title_global' => 'Globale Ansicht', + 'title_fav' => 'Ihre Favoriten', + ), + 'log' => array( + '_' => 'Protokolle', + 'clear' => 'Protokolle leeren', + 'empty' => 'Protokolldatei ist leer.', + 'title' => 'Protokolle', + ), + 'menu' => array( + 'about' => 'Über FreshRSS', + 'add_query' => 'Eine Abfrage hinzufügen', + 'before_one_day' => 'Vor einem Tag', + 'before_one_week' => 'Vor einer Woche', + 'favorites' => 'Favoriten (%s)', + 'global_view' => 'Globale Ansicht', + 'main_stream' => 'Haupt-Feeds', + 'mark_all_read' => 'Alle als gelesen markieren', + 'mark_cat_read' => 'Kategorie als gelesen markieren', + 'mark_feed_read' => 'Feed als gelesen markieren', + 'newer_first' => 'Neuere zuerst', + 'non-starred' => 'Alle außer Favoriten zeigen', + 'normal_view' => 'Normale Ansicht', + 'older_first' => 'Ältere zuerst', + 'queries' => 'Benutzerabfragen', + 'read' => 'Nur gelesene zeigen', + 'reader_view' => 'Lese-Ansicht', + 'rss_view' => 'RSS-Feed', + 'search_short' => 'Suchen', + 'starred' => 'Nur Favoriten zeigen', + 'stats' => 'Statistiken', + 'subscription' => 'Abonnementverwaltung', + 'unread' => 'Nur ungelesene zeigen', + ), + 'share' => 'Teilen', + 'tag' => array( + 'related' => 'Verwandte Tags', + ), +); diff --git a/app/i18n/de/install.php b/app/i18n/de/install.php new file mode 100644 index 000000000..b747d1551 --- /dev/null +++ b/app/i18n/de/install.php @@ -0,0 +1,119 @@ +<?php + +return array( + 'action' => array( + 'finish' => 'Installation fertigstellen', + 'fix_errors_before' => 'Bitte Fehler korrigieren, bevor zum nächsten Schritt gesprungen wird.', + 'keep_install' => 'Vorherige Konfiguration beibehalten', + 'next_step' => 'Zum nächsten Schritt springen', + 'reinstall' => 'Neuinstallation von FreshRSS', + ), + 'auth' => array( + 'form' => 'Webformular (traditionell, benötigt JavaScript)', + 'http' => 'HTTP (HTTPS für erfahrene Benutzer)', + 'none' => 'Keine (gefährlich)', + 'password_form' => 'Passwort<br /><small>(für die Anmeldemethode per Webformular)</small>', + 'password_format' => 'mindestens 7 Zeichen', + 'type' => 'Authentifizierungsmethode', + ), + 'bdd' => array( + '_' => 'Datenbank', + 'conf' => array( + '_' => 'Datenbank-Konfiguration', + 'ko' => 'Überprüfen Sie Ihre Datenbank-Information.', + 'ok' => 'Datenbank-Konfiguration ist gespeichert worden.', + ), + 'host' => 'Host', + 'prefix' => 'Tabellen-Präfix', + 'password' => 'SQL-Password', + 'type' => 'Datenbank-Typ', + 'username' => 'SQL-Nutzername', + ), + 'check' => array( + '_' => 'Überprüfungen', + 'already_installed' => 'Wir haben festgestellt, dass FreshRSS bereits installiert wurde!', + 'cache' => array( + 'nok' => 'Überprüfen Sie die Berechtigungen des Verzeichnisses <em>./data/cache</em>. Der HTTP-Server muss Schreibrechte besitzen.', + 'ok' => 'Die Berechtigungen des Verzeichnisses <em>./data/cache</em> sind in Ordnung.', + ), + 'ctype' => array( + 'nok' => 'Ihnen fehlt eine benötigte Bibliothek für die Überprüfung von Zeichentypen (php-ctype).', + 'ok' => 'Sie haben die benötigte Bibliothek für die Überprüfung von Zeichentypen (ctype).', + ), + 'curl' => array( + 'nok' => 'Ihnen fehlt cURL (Paket php-curl).', + 'ok' => 'Sie haben die cURL-Erweiterung.', + ), + 'data' => array( + 'nok' => 'Überprüfen Sie die Berechtigungen des Verzeichnisses <em>./data</em>. Der HTTP-Server muss Schreibrechte besitzen.', + 'ok' => 'Die Berechtigungen des Verzeichnisses <em>./data</em> sind in Ordnung.', + ), + 'dom' => array( + 'nok' => 'Ihnen fehlt eine benötigte Bibliothek um DOM zu durchstöbern.', + 'ok' => 'Sie haben die benötigte Bibliothek um DOM zu durchstöbern.', + ), + 'favicons' => array( + 'nok' => 'Überprüfen Sie die Berechtigungen des Verzeichnisses <em>./data/favicons</em>. Der HTTP-Server muss Schreibrechte besitzen.', + 'ok' => 'Die Berechtigungen des Verzeichnisses <em>./data/favicons</em> sind in Ordnung.', + ), + 'fileinfo' => array( + 'nok' => 'Ihnen fehlt PHP fileinfo (Paket fileinfo).', + 'ok' => 'Sie haben die fileinfo-Erweiterung.', + ), + 'http_referer' => array( + 'nok' => 'Bitte stellen Sie sicher, dass Sie Ihren HTTP REFERER nicht abändern.', + 'ok' => 'Ihr HTTP REFERER ist bekannt und entspricht Ihrem Server.', + ), + 'json' => array( + 'nok' => 'Ihnen fehlt eine empfohlene Bibliothek um JSON zu parsen.', + 'ok' => 'Sie haben eine empfohlene Bibliothek um JSON zu parsen.', + ), + 'minz' => array( + 'nok' => 'Ihnen fehlt das Minz-Framework.', + 'ok' => 'Sie haben das Minz-Framework.', + ), + 'pcre' => array( + 'nok' => 'Ihnen fehlt eine benötigte Bibliothek für reguläre Ausdrücke (php-pcre).', + 'ok' => 'Sie haben die benötigte Bibliothek für reguläre Ausdrücke (PCRE).', + ), + 'pdo' => array( + 'nok' => 'Ihnen fehlt PDO oder einer der unterstützten Treiber (pdo_mysql, pdo_sqlite, pdo_pgsql).', + 'ok' => 'Sie haben PDO und mindestens einen der unterstützten Treiber (pdo_mysql, pdo_sqlite, pdo_pgsql).', + ), + 'php' => array( + 'nok' => 'Ihre PHP-Version ist %s aber FreshRSS benötigt mindestens Version %s.', + 'ok' => 'Ihre PHP-Version ist %s, welche kompatibel mit FreshRSS ist.', + ), + 'users' => array( + 'nok' => 'Überprüfen Sie die Berechtigungen des Verzeichnisses <em>./data/users</em>. Der HTTP-Server muss Schreibrechte besitzen.', + 'ok' => 'Die Berechtigungen des Verzeichnisses <em>./data/users</em> sind in Ordnung.', + ), + 'xml' => array( + 'nok' => 'Ihnen fehlt die benötigte Bibliothek um XML zu parsen.', + 'ok' => 'Sie haben die benötigte Bibliothek um XML zu parsen.', + ), + ), + 'conf' => array( + '_' => 'Allgemeine Konfiguration', + 'ok' => 'Die allgemeine Konfiguration ist gespeichert worden.', + ), + 'congratulations' => 'Glückwunsch!', + 'default_user' => 'Nutzername des Standardbenutzers <small>(maximal 16 alphanumerische Zeichen)</small>', + 'delete_articles_after' => 'Entferne Artikel nach', + 'fix_errors_before' => 'Bitte den Fehler korrigieren, bevor zum nächsten Schritt gesprungen wird.', + 'javascript_is_better' => 'FreshRSS ist ansprechender mit aktiviertem JavaScript', + 'js' => array( + 'confirm_reinstall' => 'Du wirst deine vorherige Konfiguration (Daten) verlieren FreshRSS. Bist du sicher, dass du fortfahren willst?', + ), + 'language' => array( + '_' => 'Sprache', + 'choose' => 'Wählen Sie eine Sprache für FreshRSS', + 'defined' => 'Die Sprache ist festgelegt worden.', + ), + 'not_deleted' => 'Etwas ist schiefgelaufen; Sie müssen die Datei <em>%s</em> manuell löschen.', + 'ok' => 'Der Installationsvorgang war erfolgreich.', + 'step' => 'Schritt %d', + 'steps' => 'Schritte', + 'title' => 'Installation · FreshRSS', + 'this_is_the_end' => 'Das ist das Ende', +); diff --git a/app/i18n/de/sub.php b/app/i18n/de/sub.php new file mode 100644 index 000000000..cc98fd25c --- /dev/null +++ b/app/i18n/de/sub.php @@ -0,0 +1,62 @@ +<?php + +return array( + 'category' => array( + '_' => 'Kategorie', + 'add' => 'Eine Kategorie hinzufügen', + 'empty' => 'Leere Kategorie', + 'new' => 'Neue Kategorie', + ), + 'feed' => array( + 'add' => 'Einen RSS-Feed hinzufügen', + 'advanced' => 'Erweitert', + 'archiving' => 'Archivierung', + 'auth' => array( + 'configuration' => 'Anmelden', + 'help' => 'Die Verbindung erlaubt Zugriff auf HTTP-geschützte RSS-Feeds', + 'http' => 'HTTP-Authentifizierung', + 'password' => 'HTTP-Passwort', + 'username' => 'HTTP-Nutzername', + ), + 'css_help' => 'Ruft gekürzte RSS-Feeds ab (Achtung, benötigt mehr Zeit!)', + 'css_path' => 'Pfad zur CSS-Datei des Artikels auf der Original-Webseite', + '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 <em>%s</em> eingefügt.', + 'no_selected' => 'Kein Feed ausgewählt.', + 'number_entries' => '%d Artikel', + 'stats' => 'Statistiken', + 'think_to_add' => 'Sie können Feeds hinzufügen.', + 'title' => 'Titel', + 'title_add' => 'Einen RSS-Feed hinzufügen', + 'ttl' => 'Aktualisiere automatisch nicht öfter als', + 'url' => 'Feed-URL', + 'validator' => 'Überprüfen Sie die Gültigkeit des Feeds', + 'website' => 'Webseiten-URL', + 'pubsubhubbub' => 'Sofortbenachrichtigung mit PubSubHubbub', + ), + 'import_export' => array( + 'export' => 'Exportieren', + 'export_opml' => 'Liste der Feeds exportieren (OPML)', + 'export_starred' => 'Ihre Favoriten exportieren', + 'feed_list' => 'Liste von %s Artikeln', + 'file_to_import' => 'Zu importierende Datei<br />(OPML, JSON oder ZIP)', + 'file_to_import_no_zip' => 'Zu importierende Datei<br />(OPML oder JSON)', + 'import' => 'Importieren', + 'starred_list' => 'Liste der Lieblingsartikel', + 'title' => 'Importieren / Exportieren', + ), + 'menu' => array( + 'bookmark' => 'Abonnieren (FreshRSS-Lesezeichen)', + 'import_export' => 'Importieren / Exportieren', + 'subscription_management' => 'Abonnementverwaltung', + ), + 'title' => array( + '_' => 'Abonnementverwaltung', + 'feed_management' => 'Verwaltung der RSS-Feeds', + ), +); diff --git a/app/i18n/en.php b/app/i18n/en.php deleted file mode 100644 index 932513588..000000000 --- a/app/i18n/en.php +++ /dev/null @@ -1,326 +0,0 @@ -<?php - -return array ( - // LAYOUT - 'login' => 'Login', - 'login_with_persona' => 'Login with Persona', - 'logout' => 'Logout', - 'search' => 'Search words or #tags', - 'search_short' => 'Search', - - 'configuration' => 'Configuration', - 'users' => 'Users', - 'categories' => 'Categories', - 'category' => 'Category', - 'feed' => 'Feed', - 'feeds' => 'Feeds', - 'shortcuts' => 'Shortcuts', - 'about' => 'About', - 'stats' => 'Statistics', - - 'your_rss_feeds' => 'Your RSS feeds', - 'add_rss_feed' => 'Add a RSS feed', - 'no_rss_feed' => 'No RSS feed', - 'import_export_opml' => 'Import / export (OPML)', - - 'subscription_management' => 'Subscriptions management', - 'main_stream' => 'Main stream', - 'all_feeds' => 'All feeds', - 'favorite_feeds' => 'Favourites (%d)', - 'not_read' => '%d unread', - 'not_reads' => '%d unread', - - 'filter' => 'Filter', - 'see_website' => 'See website', - 'administration' => 'Manage', - 'actualize' => 'Actualize', - - 'mark_read' => 'Mark as read', - 'mark_favorite' => 'Mark as favourite', - 'mark_all_read' => 'Mark all as read', - 'mark_feed_read' => 'Mark feed as read', - 'mark_cat_read' => 'Mark category as read', - 'before_one_day' => 'Before one day', - 'before_one_week' => 'Before one week', - 'display' => 'Display', - 'normal_view' => 'Normal view', - 'reader_view' => 'Reading view', - 'global_view' => 'Global view', - 'rss_view' => 'RSS feed', - 'show_all_articles' => 'Show all articles', - 'show_not_reads' => 'Show only unread', - 'show_read' => 'Show only read', - 'show_favorite' => 'Show favorites', - 'older_first' => 'Oldest first', - 'newer_first' => 'Newer first', - - // Pagination - 'first' => 'First', - 'previous' => 'Previous', - 'next' => 'Next', - 'last' => 'Last', - - // CONTROLLERS - 'article_published_on' => 'This article originally appeared on <a href="%s">%s</a>', - 'article_published_on_author' => 'This article originally appeared on <a href="%s">%s</a> by %s', - - 'access_denied' => 'You don’t have permission to access this page', - 'page_not_found' => 'You are looking for a page which doesn’t exist', - 'error_occurred' => 'An error occurred', - 'error_occurred_update' => 'Nothing was changed', - - 'default_category' => 'Uncategorized', - 'categories_updated' => 'Categories have been updated', - 'categories_management' => 'Categories management', - 'feed_updated' => 'Feed has been updated', - 'rss_feed_management' => 'RSS feeds management', - 'configuration_updated' => 'Configuration has been updated', - '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', - 'shortcuts_other_action' => 'Other actions', - 'feeds_marked_read' => 'Feeds have been marked as read', - 'updated' => 'Modifications have been updated', - - 'already_subscribed' => 'You have already subscribed to <em>%s</em>', - 'feed_added' => 'RSS feed <em>%s</em> has been added', - 'feed_not_added' => '<em>%s</em> could not be added', - 'internal_problem_feed' => 'The RSS feed could not be added. Check FressRSS logs for details.', - 'invalid_url' => 'URL <em>%s</em> is invalid', - 'feed_actualized' => '<em>%s</em> has been updated', - 'n_feeds_actualized' => '%d feeds have been updated', - 'feeds_actualized' => 'RSS feeds have been updated', - 'no_feed_actualized' => 'No RSS feed has been updated', - 'n_entries_deleted' => '%d articles have been deleted', - 'feeds_imported_with_errors' => 'Your feeds have been imported but some errors occurred', - 'feeds_imported' => 'Your feeds have been imported and will now be updated', - 'category_emptied' => 'Category has been emptied', - 'feed_deleted' => 'Feed has been deleted', - 'feed_validator' => 'Check the validity of the feed', - - 'optimization_complete' => 'Optimization complete', - - 'your_rss_feeds' => 'Your RSS feeds', - 'your_favorites' => 'Your favourites', - 'public' => 'Public', - 'invalid_login' => 'Login is invalid', - - // VIEWS - 'save' => 'Save', - 'delete' => 'Delete', - 'cancel' => 'Cancel', - - 'back_to_rss_feeds' => '← Go back to your RSS feeds', - 'feeds_moved_category_deleted' => 'When you delete a category, their feeds are automatically classified under <em>%s</em>.', - 'category_number' => 'Category n°%d', - 'ask_empty' => 'Clear?', - 'number_feeds' => '%d feeds', - 'can_not_be_deleted' => 'Cannot be deleted', - 'add_category' => 'Add a category', - 'new_category' => 'New category', - - 'javascript_for_shortcuts' => 'JavaScript must be enabled in order to use shortcuts', - 'javascript_should_be_activated'=> 'JavaScript must be enabled', - 'shift_for_all_read' => '+ <code>shift</code> to mark all articles as read', - 'see_on_website' => 'See on original website', - 'next_article' => 'Skip to the next article', - 'last_article' => 'Skip to the last article', - 'previous_article' => 'Skip to the previous article', - 'first_article' => 'Skip to the first article', - 'next_page' => 'Skip to the next page', - 'previous_page' => 'Skip to the previous page', - 'collapse_article' => 'Collapse', - 'auto_share' => 'Share', - 'auto_share_help' => 'If there is only one sharing mode, it is used. Else modes are accessible by their number.', - - 'file_to_import' => 'File to import', - 'import' => 'Import', - 'export' => 'Export', - 'or' => 'or', - - 'informations' => 'Information', - 'damn' => 'Damn!', - 'feed_in_error' => 'This feed has encountered a problem. Please verify that it is always reachable then actualize it.', - 'feed_empty' => 'This feed is empty. Please verify that it is still maintained.', - 'feed_description' => 'Description', - 'website_url' => 'Website URL', - 'feed_url' => 'Feed URL', - 'articles' => 'articles', - 'number_articles' => 'Number of articles', - 'by_feed' => 'by feed', - 'by_default' => 'By default', - 'keep_history' => 'Minimum number of articles to keep', - 'categorize' => 'Store in a category', - 'truncate' => 'Delete all articles', - 'advanced' => 'Advanced', - 'show_in_all_flux' => 'Show in main stream', - 'yes' => 'Yes', - 'no' => 'No', - 'css_path_on_website' => 'Articles CSS path on original website', - 'retrieve_truncated_feeds' => 'Retrieves truncated RSS feeds (attention, requires more time!)', - 'http_authentication' => 'HTTP Authentication', - 'http_username' => 'HTTP username', - 'http_password' => 'HTTP password', - 'blank_to_disable' => 'Leave blank to disable', - 'not_yet_implemented' => 'Not yet implemented', - 'access_protected_feeds' => 'Connection allows to access HTTP protected RSS feeds', - 'no_selected_feed' => 'No feed selected.', - 'think_to_add' => '<a href="./?c=configure&a=feed">You may add some feeds</a>.', - - 'current_user' => 'Current user', - 'default_user' => 'Username of the default user <small>(maximum 16 alphanumeric characters)</small>', - 'password_form' => 'Password<br /><small>(for the Web-form login method)</small>', - 'persona_connection_email' => 'Login mail address<br /><small>(for <a href="https://persona.org/" rel="external">Mozilla Persona</a>)</small>', - 'allow_anonymous' => 'Allow anonymous reading of the articles of the default user (%s)', - 'allow_anonymous_refresh' => 'Allow anonymous refresh of the articles', - 'auth_token' => 'Authentication token', - 'explain_token' => 'Allows to access RSS output of the default user without authentication.<br /><kbd>%s?output=rss&token=%s</kbd>', - 'login_configuration' => 'Login', - 'is_admin' => 'is administrator', - 'auth_type' => 'Authentication method', - 'auth_none' => 'None (dangerous)', - 'auth_form' => 'Web form (traditional, requires JavaScript)', - 'http_auth' => 'HTTP (for advanced users with HTTPS)', - 'auth_persona' => 'Mozilla Persona (modern, requires JavaScript)', - 'users_list' => 'List of users', - 'create_user' => 'Create new user', - 'username' => 'Username', - 'password' => 'Password', - 'create' => 'Create', - 'user_created' => 'User %s has been created', - 'user_deleted' => 'User %s has been deleted', - - 'language' => 'Language', - 'month' => 'months', - 'archiving_configuration' => 'Archiving', - 'delete_articles_every' => 'Remove articles after', - 'purge_now' => 'Purge now', - 'purge_completed' => 'Purge completed (%d articles deleted)', - 'archiving_configuration_help' => 'More options are available in the individual stream settings', - 'reading_configuration' => 'Reading', - 'articles_per_page' => 'Number of articles per page', - 'default_view' => 'Default view', - 'sort_order' => 'Sort order', - 'auto_load_more' => 'Load next articles at the page bottom', - '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', - 'top_line' => 'Top line', - 'bottom_line' => 'Bottom line', - 'img_with_lazyload' => 'Use "lazy load" mode to load pictures', - 'auto_read_when' => 'Mark article as read…', - 'article_selected' => 'when article is selected', - 'article_open_on_website' => 'when article is opened on its original website', - 'scroll' => 'during page scrolls', - 'upon_reception' => 'upon reception of the article', - 'your_shaarli' => 'Your Shaarli', - 'your_wallabag' => 'Your wallabag', - 'your_diaspora_pod' => 'Your Diaspora* pod', - 'sharing' => 'Sharing', - 'share' => 'Share', - 'by_email' => 'By email', - 'optimize_bdd' => 'Optimize database', - 'optimize_todo_sometimes' => 'To do occasionally to reduce the size of the database', - 'theme' => 'Theme', - 'more_information' => 'More information', - 'activate_sharing' => 'Activate sharing', - 'shaarli' => 'Shaarli', - 'wallabag' => 'wallabag', - 'diaspora' => 'Diaspora*', - 'twitter' => 'Twitter', - 'g+' => 'Google+', - 'facebook' => 'Facebook', - 'email' => 'Email', - 'print' => 'Print', - - 'article' => 'Article', - 'title' => 'Title', - 'author' => 'Author', - 'publication_date' => 'Date of publication', - 'by' => 'by', - - 'load_more' => 'Load more articles', - 'nothing_to_load' => 'There are no more articles', - - 'rss_feeds_of' => 'RSS feed of %s', - - 'refresh' => 'Refresh', - 'no_feed_to_refresh' => 'There is no feed to refresh…', - - 'today' => 'Today', - 'yesterday' => 'Yesterday', - 'before_yesterday' => 'Before yesterday', - 'new_article' => 'There are new available articles, click to refresh the page.', - 'by_author' => 'By <em>%s</em>', - 'related_tags' => 'Related tags', - 'no_feed_to_display' => 'There is no article to show.', - - 'about_freshrss' => 'About FreshRSS', - 'project_website' => 'Project website', - 'lead_developer' => 'Lead developer', - 'website' => 'Website', - 'bugs_reports' => 'Bugs reports', - 'github_or_email' => '<a href="https://github.com/marienfressinaud/FreshRSS/issues">on Github</a> or <a href="mailto:dev@marienfressinaud.fr">by mail</a>', - 'license' => 'License', - 'agpl3' => '<a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL 3</a>', - 'freshrss_description' => 'FreshRSS is a RSS feeds aggregator to self-host like <a href="http://tontof.net/kriss/feed/">Kriss Feed</a> or <a href="http://projet.idleman.fr/leed/">Leed</a>. It is light and easy to take in hand while being powerful and configurable tool.', - 'credits' => 'Credits', - 'credits_content' => 'Some design elements come from <a href="http://twitter.github.io/bootstrap/">Bootstrap</a> although FreshRSS doesn’t use this framework. <a href="https://git.gnome.org/browse/gnome-icon-theme-symbolic">Icons</a> come from <a href="https://www.gnome.org/">GNOME project</a>. <em>Open Sans</em> font police used has been created by <a href="https://www.google.com/webfonts/specimen/Open+Sans">Steve Matteson</a>. Favicons are collected with <a href="https://getfavicon.appspot.com/">getFavicon API</a>. FreshRSS is based on <a href="https://github.com/marienfressinaud/MINZ">Minz</a>, a PHP framework.', - 'version' => 'Version', - - 'logs' => 'Logs', - 'logs_empty' => 'Log file is empty', - 'clear_logs' => 'Clear the logs', - - 'forbidden_access' => 'Access is forbidden!', - 'login_required' => 'Login required:', - - 'confirm_action' => 'Are you sure you want to perform this action? It cannot be cancelled!', - - // DATE - 'january' => 'january', - 'february' => 'february', - 'march' => 'march', - 'april' => 'april', - 'may' => 'may', - 'june' => 'june', - 'july' => 'july', - 'august' => 'august', - 'september' => 'september', - 'october' => 'october', - 'november' => 'november', - 'december' => 'december', - // special format for date() function - 'Jan' => '\J\a\n\u\a\r\y', - 'Feb' => '\F\e\b\r\u\a\r\y', - 'Mar' => '\M\a\r\c\h', - 'Apr' => '\A\p\r\i\l', - 'May' => '\M\a\y', - 'Jun' => '\J\u\n\e', - 'Jul' => '\J\u\l\y', - 'Aug' => '\A\u\g\u\s\t', - 'Sep' => '\S\e\p\t\e\m\b\e\r', - 'Oct' => '\O\c\t\o\b\e\r', - 'Nov' => '\N\o\v\e\m\b\e\r', - 'Dec' => '\D\e\c\e\m\b\e\r', - // format for date() function, %s allows to indicate month in letter - 'format_date' => '%s j\<\s\u\p\>S\<\/\s\u\p\> Y', - 'format_date_hour' => '%s j\<\s\u\p\>S\<\/\s\u\p\> Y \a\t H\:i', - - 'status_favorites' => 'Favourites', - 'status_read' => 'Read', - 'status_unread' => 'Unread', - 'status_total' => 'Total', - - 'stats_entry_repartition' => 'Entries repartition', - 'stats_entry_per_day' => 'Entries per day (last 30 days)', - 'stats_feed_per_category' => 'Feeds per category', - 'stats_entry_per_category' => 'Entries per category', - 'stats_top_feed' => 'Top ten feeds', - 'stats_entry_count' => 'Entry count', -); diff --git a/app/i18n/en/admin.php b/app/i18n/en/admin.php new file mode 100644 index 000000000..e94d9fa80 --- /dev/null +++ b/app/i18n/en/admin.php @@ -0,0 +1,181 @@ +<?php + +return array( + 'auth' => array( + 'allow_anonymous' => 'Allow anonymous reading of the articles of the default user (%s)', + 'allow_anonymous_refresh' => 'Allow anonymous refresh of the articles', + 'api_enabled' => 'Allow <abbr>API</abbr> access <small>(required for mobile apps)</small>', + 'form' => 'Web form (traditional, requires JavaScript)', + 'http' => 'HTTP (for advanced users with HTTPS)', + 'none' => 'None (dangerous)', + 'title' => 'Authentication', + 'title_reset' => 'Authentication reset', + 'token' => 'Authentication token', + 'token_help' => 'Allows access to RSS output of the default user without authentication:', + 'type' => 'Authentication method', + 'unsafe_autologin' => 'Allow unsafe automatic login using the format: ', + ), + 'check_install' => array( + 'cache' => array( + 'nok' => 'Check permissions on <em>./data/cache</em> directory. HTTP server must have rights to write into', + 'ok' => 'Permissions on cache directory are good.', + ), + 'categories' => array( + 'nok' => 'Category table is bad configured.', + 'ok' => 'Category table is ok.', + ), + 'connection' => array( + 'nok' => 'Connection to the database cannot being established.', + 'ok' => 'Connection to the database is ok.', + ), + 'ctype' => array( + 'nok' => 'Cannot find a required library for character type checking (php-ctype).', + 'ok' => 'You have the required library for character type checking (ctype).', + ), + 'curl' => array( + 'nok' => 'Cannot find the cURL library (php-curl package).', + 'ok' => 'You have the cURL library.', + ), + 'data' => array( + 'nok' => 'Check permissions on <em>./data</em> directory. HTTP server must have rights to write into', + 'ok' => 'Permissions on data directory are good.', + ), + 'database' => 'Database installation', + 'dom' => array( + 'nok' => 'Cannot find a required library to browse the DOM (php-xml package).', + 'ok' => 'You have the required library to browse the DOM.', + ), + 'entries' => array( + 'nok' => 'Entry table is bad configured.', + 'ok' => 'Entry table is ok.', + ), + 'favicons' => array( + 'nok' => 'Check permissions on <em>./data/favicons</em> directory. HTTP server must have rights to write into', + 'ok' => 'Permissions on favicons directory are good.', + ), + 'feeds' => array( + 'nok' => 'Feed table is bad configured.', + 'ok' => 'Feed table is ok.', + ), + 'fileinfo' => array( + 'nok' => 'Cannot find the PHP fileinfo library (fileinfo package).', + 'ok' => 'You have the fileinfo library.', + ), + 'files' => 'File installation', + 'json' => array( + 'nok' => 'Cannot find JSON (php5-json package).', + 'ok' => 'You have JSON extension.', + ), + 'minz' => array( + 'nok' => 'Cannot find the Minz framework.', + 'ok' => 'You have the Minz framework.', + ), + 'pcre' => array( + 'nok' => 'Cannot find a required library for regular expressions (php-pcre).', + 'ok' => 'You have the required library for regular expressions (PCRE).', + ), + 'pdo' => array( + 'nok' => 'Cannot find PDO or one of the supported drivers (pdo_mysql, pdo_sqlite, pdo_pgsql).', + 'ok' => 'You have PDO and at least one of the supported drivers (pdo_mysql, pdo_sqlite, pdo_pgsql).', + ), + 'php' => array( + '_' => 'PHP installation', + 'nok' => 'Your PHP version is %s but FreshRSS requires at least version %s.', + 'ok' => 'Your PHP version is %s, which is compatible with FreshRSS.', + ), + 'tables' => array( + 'nok' => 'There is one or more lacking tables in the database.', + 'ok' => 'Tables are existing in the database.', + ), + 'title' => 'Installation checking', + 'tokens' => array( + 'nok' => 'Check permissions on <em>./data/tokens</em> directory. HTTP server must have rights to write into', + 'ok' => 'Permissions on tokens directory are good.', + ), + 'users' => array( + 'nok' => 'Check permissions on <em>./data/users</em> directory. HTTP server must have rights to write into', + 'ok' => 'Permissions on users directory are good.', + ), + 'zip' => array( + 'nok' => 'Cannot find ZIP extension (php-zip package).', + 'ok' => 'You have ZIP extension.', + ), + ), + 'extensions' => array( + 'disabled' => 'Disabled', + 'empty_list' => 'There is no installed extension', + 'enabled' => 'Enabled', + 'no_configure_view' => 'This extension cannot be configured.', + 'system' => array( + '_' => 'System extensions', + 'no_rights' => 'System extension (you have no rights on it)', + ), + 'title' => 'Extensions', + 'user' => 'User extensions', + ), + 'stats' => array( + '_' => 'Statistics', + 'all_feeds' => 'All feeds', + 'category' => 'Category', + 'entry_count' => 'Entry count', + 'entry_per_category' => 'Entries per category', + 'entry_per_day' => 'Entries per day (last 30 days)', + 'entry_per_day_of_week' => 'Per day of week (average: %.2f messages)', + 'entry_per_hour' => 'Per hour (average: %.2f messages)', + 'entry_per_month' => 'Per month (average: %.2f messages)', + 'entry_repartition' => 'Entries repartition', + 'feed' => 'Feed', + 'feed_per_category' => 'Feeds per category', + 'idle' => 'Idle feeds', + 'main' => 'Main statistics', + 'main_stream' => 'Main stream', + 'menu' => array( + 'idle' => 'Idle feeds', + 'main' => 'Main statistics', + 'repartition' => 'Articles repartition', + ), + 'no_idle' => 'There is no idle feed!', + 'number_entries' => '%d articles', + 'percent_of_total' => '%% of total', + 'repartition' => 'Articles repartition', + 'status_favorites' => 'Favourites', + 'status_read' => 'Read', + 'status_total' => 'Total', + 'status_unread' => 'Unread', + 'title' => 'Statistics', + 'top_feed' => 'Top ten feeds', + ), + 'system' => array( + '_' => 'System configuration', + 'auto-update-url' => 'Auto-update server URL', + 'instance-name' => 'Instance name', + 'max-categories' => 'Categories per user limit', + 'max-feeds' => 'Feeds per user limit', + 'registration' => array( + 'help' => '0 means that there is no account limit', + 'number' => 'Max number of accounts', + ), + ), + 'update' => array( + '_' => 'Update system', + 'apply' => 'Apply', + 'check' => 'Check for new updates', + 'current_version' => 'Your current version of FreshRSS is the %s.', + 'last' => 'Last verification: %s', + 'none' => 'No update to apply', + 'title' => 'Update system', + ), + 'user' => array( + 'articles_and_size' => '%s articles (%s)', + 'create' => 'Create new user', + 'language' => 'Language', + 'number' => 'There is %d account created yet', + 'numbers' => 'There are %d accounts created yet', + 'password_form' => 'Password<br /><small>(for the Web-form login method)</small>', + 'password_format' => 'At least 7 characters', + 'title' => 'Manage users', + 'user_list' => 'List of users', + 'username' => 'Username', + 'users' => 'Users', + ), +); diff --git a/app/i18n/en/conf.php b/app/i18n/en/conf.php new file mode 100644 index 000000000..b5ab73510 --- /dev/null +++ b/app/i18n/en/conf.php @@ -0,0 +1,173 @@ +<?php + +return array( + 'archiving' => array( + '_' => 'Archiving', + 'advanced' => 'Advanced', + 'delete_after' => 'Remove articles after', + 'help' => 'More options are available in the individual feed settings', + 'keep_history_by_feed' => 'Minimum number of articles to keep by feed', + 'optimize' => 'Optimise database', + 'optimize_help' => 'To do occasionally to reduce the size of the database', + 'purge_now' => 'Purge now', + 'title' => 'Archiving', + 'ttl' => 'Do not automatically refresh more often than', + ), + 'display' => array( + '_' => 'Display', + 'icon' => array( + 'bottom_line' => 'Bottom line', + 'entry' => 'Article icons', + 'publication_date' => 'Date of publication', + 'related_tags' => 'Related tags', + 'sharing' => 'Sharing', + 'top_line' => 'Top line', + ), + 'language' => 'Language', + 'notif_html5' => array( + 'seconds' => 'seconds (0 means no timeout)', + 'timeout' => 'HTML5 notification timeout', + ), + 'theme' => 'Theme', + 'title' => 'Display', + 'width' => array( + 'content' => 'Content width', + 'large' => 'Large', + 'medium' => 'Medium', + 'no_limit' => 'No limit', + 'thin' => 'Thin', + ), + ), + 'query' => array( + '_' => 'User queries', + 'deprecated' => 'This query is no longer valid. The referenced category or feed has been deleted.', + 'filter' => 'Filter applied:', + 'get_all' => 'Display all articles', + 'get_category' => 'Display "%s" category', + 'get_favorite' => 'Display favorite articles', + 'get_feed' => 'Display "%s" feed', + 'no_filter' => 'No filter', + 'none' => 'You haven’t created any user query yet.', + 'number' => 'Query n°%d', + 'order_asc' => 'Display oldest articles first', + 'order_desc' => 'Display newest articles first', + 'search' => 'Search for "%s"', + 'state_0' => 'Display all articles', + 'state_1' => 'Display read articles', + 'state_2' => 'Display unread articles', + 'state_3' => 'Display all articles', + 'state_4' => 'Display favorite articles', + 'state_5' => 'Display read favorite articles', + 'state_6' => 'Display unread favorite articles', + 'state_7' => 'Display favorite articles', + 'state_8' => 'Display not favorite articles', + 'state_9' => 'Display read not favorite articles', + 'state_10' => 'Display unread not favorite articles', + 'state_11' => 'Display not favorite articles', + 'state_12' => 'Display all articles', + 'state_13' => 'Display read articles', + 'state_14' => 'Display unread articles', + 'state_15' => 'Display all articles', + 'title' => 'User queries', + ), + 'profile' => array( + '_' => 'Profile management', + 'delete' => array( + '_' => 'Account deletion', + 'warn' => 'Your account and all the related data will be deleted.', + ), + 'password_api' => 'API password<br /><small>(e.g., for mobile apps)</small>', + 'password_form' => 'Password<br /><small>(for the Web-form login method)</small>', + 'password_format' => 'At least 7 characters', + 'title' => 'Profile', + ), + 'reading' => array( + '_' => 'Reading', + 'after_onread' => 'After “mark all as read”,', + 'articles_per_page' => 'Number of articles per page', + 'auto_load_more' => 'Load next articles at the page bottom', + 'auto_remove_article' => 'Hide articles after reading', + 'mark_updated_article_unread' => 'Mark updated articles as unread', + 'confirm_enabled' => 'Display a confirmation dialog on “mark all as read” actions', + 'display_articles_unfolded' => 'Show articles unfolded by default', + 'display_categories_unfolded' => 'Show categories folded by default', + 'hide_read_feeds' => 'Hide categories & feeds with no unread article (does not work with “Show all articles” configuration)', + 'img_with_lazyload' => 'Use "lazy load" mode to load pictures', + 'jump_next' => 'jump to next unread sibling (feed or category)', + 'number_divided_when_reader' => 'Divided by 2 in the reading view.', + 'read' => array( + 'article_open_on_website' => 'when article is opened on its original website', + 'article_viewed' => 'when article is viewed', + 'scroll' => 'while scrolling', + 'upon_reception' => 'upon reception of the article', + 'when' => 'Mark article as read…', + ), + 'show' => array( + '_' => 'Articles to display', + 'adaptive' => 'Adjust showing', + 'all_articles' => 'Show all articles', + 'unread' => 'Show only unread', + ), + 'sort' => array( + '_' => 'Sort order', + 'newer_first' => 'Newer first', + 'older_first' => 'Oldest first', + ), + 'sticky_post' => 'Stick the article to the top when opened', + 'title' => 'Reading', + 'view' => array( + 'default' => 'Default view', + 'global' => 'Global view', + 'normal' => 'Normal view', + 'reader' => 'Reading view', + ), + ), + 'sharing' => array( + '_' => 'Sharing', + 'blogotext' => 'Blogotext', + 'diaspora' => 'Diaspora*', + 'email' => 'Email', + 'facebook' => 'Facebook', + 'g+' => 'Google+', + 'more_information' => 'More information', + 'print' => 'Print', + 'shaarli' => 'Shaarli', + 'share_name' => 'Share name to display', + 'share_url' => 'Share URL to use', + 'title' => 'Sharing', + 'twitter' => 'Twitter', + 'wallabag' => 'wallabag', + ), + 'shortcut' => array( + '_' => 'Shortcuts', + 'article_action' => 'Article actions', + 'auto_share' => 'Share', + 'auto_share_help' => 'If there is only one sharing mode, it is used. Else modes are accessible by their number.', + 'close_dropdown' => 'Close menus', + 'collapse_article' => 'Collapse', + 'first_article' => 'Skip to the first article', + 'focus_search' => 'Access search box', + 'help' => 'Display documentation', + 'javascript' => 'JavaScript must be enabled in order to use shortcuts', + 'last_article' => 'Skip to the last article', + 'load_more' => 'Load more articles', + 'mark_read' => 'Mark as read', + 'mark_favorite' => 'Mark as favourite', + 'navigation' => 'Navigation', + 'navigation_help' => 'With the "Shift" modifier, navigation shortcuts apply on feeds.<br/>With the "Alt" modifier, navigation shortcuts apply on categories.', + 'next_article' => 'Skip to the next article', + 'other_action' => 'Other actions', + 'previous_article' => 'Skip to the previous article', + 'see_on_website' => 'See on original website', + 'shift_for_all_read' => '+ <code>shift</code> 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.', + ), + 'user' => array( + 'articles_and_size' => '%s articles (%s)', + 'current' => 'Current user', + 'is_admin' => 'is administrator', + 'users' => 'Users', + ), +); diff --git a/app/i18n/en/feedback.php b/app/i18n/en/feedback.php new file mode 100644 index 000000000..e7f6b9f85 --- /dev/null +++ b/app/i18n/en/feedback.php @@ -0,0 +1,109 @@ +<?php + +return array( + 'admin' => array( + 'optimization_complete' => 'Optimisation complete', + ), + 'access' => array( + 'denied' => 'You don’t have permission to access this page', + 'not_found' => 'You are looking for a page which doesn’t exist', + ), + 'auth' => array( + 'form' => array( + 'not_set' => 'A problem occured during authentication system configuration. Please retry later.', + 'set' => 'Form is now your default authentication system.', + ), + 'login' => array( + 'invalid' => 'Login is invalid', + 'success' => 'You are connected', + ), + 'logout' => array( + 'success' => 'You are disconnected', + ), + 'no_password_set' => 'Administrator password hasn’t been set. This feature isn’t available.', + ), + 'conf' => array( + 'error' => 'An error occurred during configuration saving', + 'query_created' => 'Query "%s" has been created.', + 'shortcuts_updated' => 'Shortcuts have been updated', + 'updated' => 'Configuration has been updated', + ), + 'extensions' => array( + 'already_enabled' => '%s is already enabled', + 'disable' => array( + 'ko' => '%s cannot be disabled. <a href="%s">Check FressRSS logs</a> for details.', + 'ok' => '%s is now disabled', + ), + 'enable' => array( + 'ko' => '%s cannot be enabled. <a href="%s">Check FressRSS logs</a> for details.', + 'ok' => '%s is now enabled', + ), + 'no_access' => 'You have no access on %s', + 'not_enabled' => '%s is not enabled yet', + 'not_found' => '%s does not exist', + ), + 'import_export' => array( + 'export_no_zip_extension' => 'ZIP extension is not present on your server. Please try to export files one by one.', + 'feeds_imported' => 'Your feeds have been imported and will now be updated', + 'feeds_imported_with_errors' => 'Your feeds have been imported but some errors occurred', + 'file_cannot_be_uploaded' => 'File cannot be uploaded!', + 'no_zip_extension' => 'ZIP extension is not present on your server.', + 'zip_error' => 'An error occured during ZIP import.', + ), + 'sub' => array( + 'actualize' => 'Actualise', + 'category' => array( + 'created' => 'Category %s has been created.', + 'deleted' => 'Category has been deleted.', + 'emptied' => 'Category has been emptied', + 'error' => 'Category cannot be updated', + 'name_exists' => 'Category name already exists.', + 'no_id' => 'You must precise the id of the category.', + 'no_name' => 'Category name cannot be empty.', + 'not_delete_default' => 'You cannot delete the default category!', + 'not_exist' => 'The category does not exist!', + 'over_max' => 'You have reached your limit of categories (%d)', + 'updated' => 'Category has been updated.', + ), + 'feed' => array( + 'actualized' => '<em>%s</em> has been updated', + 'actualizeds' => 'RSS feeds have been updated', + 'added' => 'RSS feed <em>%s</em> has been added', + 'already_subscribed' => 'You have already subscribed to <em>%s</em>', + 'deleted' => 'Feed has been deleted', + 'error' => 'Feed cannot be updated', + 'internal_problem' => 'The RSS feed could not be added. <a href="%s">Check FressRSS logs</a> for details.', + 'invalid_url' => 'URL <em>%s</em> is invalid', + 'marked_read' => 'Feeds have been marked as read', + 'n_actualized' => '%d feeds have been updated', + 'n_entries_deleted' => '%d articles have been deleted', + 'no_refresh' => 'There is no feed to refresh…', + 'not_added' => '<em>%s</em> could not be added', + 'over_max' => 'You have reached your limit of feeds (%d)', + 'updated' => 'Feed has been updated', + ), + 'purge_completed' => 'Purge completed (%d articles deleted)', + ), + 'update' => array( + 'can_apply' => 'FreshRSS will now be updated to the <strong>version %s</strong>.', + 'error' => 'The update process has encountered an error: %s', + 'file_is_nok' => 'Check permissions on <em>%s</em> directory. HTTP server must have rights to write into', + 'finished' => 'Update completed!', + 'none' => 'No update to apply', + 'server_not_found' => 'Update server cannot be found. [%s]', + ), + 'user' => array( + 'created' => array( + '_' => 'User %s has been created', + 'error' => 'User %s cannot be created', + ), + 'deleted' => array( + '_' => 'User %s has been deleted', + 'error' => 'User %s cannot be deleted', + ), + ), + 'profile' => array( + 'error' => 'Your profile cannot be modified', + 'updated' => 'Your profile has been modified', + ), +); diff --git a/app/i18n/en/gen.php b/app/i18n/en/gen.php new file mode 100644 index 000000000..3f86cfd19 --- /dev/null +++ b/app/i18n/en/gen.php @@ -0,0 +1,182 @@ +<?php + +return array( + 'action' => array( + 'actualize' => 'Actualize', + 'back_to_rss_feeds' => '← Go back to your RSS feeds', + 'cancel' => 'Cancel', + 'create' => 'Create', + 'disable' => 'Disable', + 'empty' => 'Empty', + 'enable' => 'Enable', + 'export' => 'Export', + 'filter' => 'Filter', + 'import' => 'Import', + 'manage' => 'Manage', + 'mark_read' => 'Mark as read', + 'mark_favorite' => 'Mark as favourite', + 'remove' => 'Remove', + 'see_website' => 'See website', + 'submit' => 'Submit', + 'truncate' => 'Delete all articles', + ), + 'auth' => array( + 'email' => 'Email address', + 'keep_logged_in' => 'Keep me logged in <small>(%s days)</small>', + 'login' => 'Login', + 'logout' => 'Logout', + 'password' => array( + '_' => 'Password', + 'format' => '<small>At least 7 characters</small>', + ), + 'registration' => array( + '_' => 'New account', + 'ask' => 'Create an account?', + 'title' => 'Account creation', + ), + 'reset' => 'Authentication reset', + 'username' => array( + '_' => 'Username', + 'admin' => 'Administrator username', + 'format' => '<small>maximum 16 alphanumeric characters</small>', + ), + ), + 'date' => array( + 'Apr' => '\\A\\p\\r\\i\\l', + 'Aug' => '\\A\\u\\g\\u\\s\\t', + 'Dec' => '\\D\\e\\c\\e\\m\\b\\e\\r', + 'Feb' => '\\F\\e\\b\\r\\u\\a\\r\\y', + 'Jan' => '\\J\\a\\n\\u\\a\\r\\y', + 'Jul' => '\\J\\u\\l\\y', + 'Jun' => '\\J\\u\\n\\e', + 'Mar' => '\\M\\a\\r\\c\\h', + 'May' => '\\M\\a\\y', + 'Nov' => '\\N\\o\\v\\e\\m\\b\\e\\r', + 'Oct' => '\\O\\c\\t\\o\\b\\e\\r', + 'Sep' => '\\S\\e\\p\\t\\e\\m\\b\\e\\r', + 'apr' => 'apr', + 'april' => 'Apr', + 'aug' => 'aug', + 'august' => 'Aug', + 'before_yesterday' => 'Before yesterday', + 'dec' => 'dec', + 'december' => 'Dec', + 'feb' => 'feb', + 'february' => 'Feb', + 'format_date' => '%s j\\<\\s\\u\\p\\>S\\<\\/\\s\\u\\p\\> Y', + 'format_date_hour' => '%s j\\<\\s\\u\\p\\>S\\<\\/\\s\\u\\p\\> Y \\a\\t H\\:i', + 'fri' => 'Fri', + 'jan' => 'jan', + 'january' => 'Jan', + 'jul' => 'jul', + 'july' => 'Jul', + 'jun' => 'jun', + 'june' => 'Jun', + 'last_3_month' => 'Last three months', + 'last_6_month' => 'Last six months', + 'last_month' => 'Last month', + 'last_week' => 'Last week', + 'last_year' => 'Last year', + 'mar' => 'mar', + 'march' => 'Mar', + 'may' => 'May', + 'mon' => 'Mon', + 'month' => 'months', + 'nov' => 'nov', + 'november' => 'Nov', + 'oct' => 'oct', + 'october' => 'Oct', + 'sat' => 'Sat', + 'sep' => 'sep', + 'september' => 'Sep', + 'sun' => 'Sun', + 'thu' => 'Thu', + 'today' => 'Today', + 'tue' => 'Tue', + 'wed' => 'Wed', + 'yesterday' => 'Yesterday', + ), + 'freshrss' => array( + '_' => 'FreshRSS', + 'about' => 'About FreshRSS', + ), + 'js' => array( + 'category_empty' => 'Empty category', + 'confirm_action' => 'Are you sure you want to perform this action? It cannot be cancelled!', + 'confirm_action_feed_cat' => 'Are you sure you want to perform this action? You will lose related favorites and user queries. It cannot be cancelled!', + 'feedback' => array( + 'body_new_articles' => 'There are %%d new articles to read on FreshRSS.', + 'request_failed' => 'A request has failed, it may have been caused by Internet connection problems.', + 'title_new_articles' => 'FreshRSS: new articles!', + ), + 'new_article' => 'There are new available articles, click to refresh the page.', + 'should_be_activated' => 'JavaScript must be enabled', + ), + 'lang' => array( + 'cz' => 'Čeština', + 'de' => 'Deutsch', + 'en' => 'English', + 'fr' => 'Français', + 'it' => 'Italiano', + 'nl' => 'Nederlands', + 'ru' => 'Русский', + 'tr' => 'Türkçe', + ), + 'menu' => array( + 'about' => 'About', + 'admin' => 'Administration', + 'archiving' => 'Archiving', + 'authentication' => 'Authentication', + 'check_install' => 'Installation checking', + 'configuration' => 'Configuration', + 'display' => 'Display', + 'extensions' => 'Extensions', + 'logs' => 'Logs', + 'queries' => 'User queries', + 'reading' => 'Reading', + 'search' => 'Search words or #tags', + 'sharing' => 'Sharing', + 'shortcuts' => 'Shortcuts', + 'stats' => 'Statistics', + 'system' => 'System configuration', + 'update' => 'Update', + 'user_management' => 'Manage users', + 'user_profile' => 'Profile', + ), + 'pagination' => array( + 'first' => 'First', + 'last' => 'Last', + 'load_more' => 'Load more articles', + 'mark_all_read' => 'Mark all as read', + 'next' => 'Next', + 'nothing_to_load' => 'There are no more articles', + 'previous' => 'Previous', + ), + 'share' => array( + 'blogotext' => 'Blogotext', + 'diaspora' => 'Diaspora*', + 'email' => 'Email', + 'facebook' => 'Facebook', + 'g+' => 'Google+', + 'movim' => 'Movim', + 'print' => 'Print', + 'shaarli' => 'Shaarli', + 'twitter' => 'Twitter', + 'wallabag' => 'wallabag v1', + 'wallabagv2' => 'wallabag v2', + 'jdh' => 'Journal du hacker', + ), + 'short' => array( + 'attention' => 'Warning!', + 'blank_to_disable' => 'Leave blank to disable', + 'by_author' => 'By <em>%s</em>', + 'by_default' => 'By default', + 'damn' => 'Damn!', + 'default_category' => 'Uncategorized', + 'no' => 'No', + 'not_applicable' => 'Not available', + 'ok' => 'Ok!', + 'or' => 'or', + 'yes' => 'Yes', + ), +); diff --git a/app/i18n/en/index.php b/app/i18n/en/index.php new file mode 100644 index 000000000..eb6413e3c --- /dev/null +++ b/app/i18n/en/index.php @@ -0,0 +1,61 @@ +<?php + +return array( + 'about' => array( + '_' => 'About', + 'agpl3' => '<a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL 3</a>', + 'bugs_reports' => 'Bugs reports', + 'credits' => 'Credits', + 'credits_content' => 'Some design elements come from <a href="http://twitter.github.io/bootstrap/">Bootstrap</a> although FreshRSS doesn’t use this framework. <a href="https://git.gnome.org/browse/gnome-icon-theme-symbolic">Icons</a> come from <a href="https://www.gnome.org/">GNOME project</a>. <em>Open Sans</em> font police has been created by <a href="https://fonts.google.com/specimen/Open+Sans">Steve Matteson</a>. FreshRSS is based on <a href="https://github.com/marienfressinaud/MINZ">Minz</a>, a PHP framework.', + 'freshrss_description' => 'FreshRSS is a RSS feeds aggregator to self-host like <a href="http://tontof.net/kriss/feed/">Kriss Feed</a> or <a href="http://projet.idleman.fr/leed/">Leed</a>. It is light and easy to take in hand while being powerful and configurable tool.', + 'github' => '<a href="https://github.com/FreshRSS/FreshRSS/issues">on Github</a>', + 'license' => 'License', + 'project_website' => 'Project website', + 'title' => 'About', + 'version' => 'Version', + 'website' => 'Website', + ), + 'feed' => array( + 'add' => 'You may add some feeds.', + 'empty' => 'There is no article to show.', + 'rss_of' => 'RSS feed of %s', + 'title' => 'Your RSS feeds', + 'title_global' => 'Global view', + 'title_fav' => 'Your favourites', + ), + 'log' => array( + '_' => 'Logs', + 'clear' => 'Clear the logs', + 'empty' => 'Log file is empty', + 'title' => 'Logs', + ), + 'menu' => array( + 'about' => 'About FreshRSS', + 'add_query' => 'Add a query', + 'before_one_day' => 'Before one day', + 'before_one_week' => 'Before one week', + 'favorites' => 'Favourites (%s)', + 'global_view' => 'Global view', + 'main_stream' => 'Main stream', + 'mark_all_read' => 'Mark all as read', + 'mark_cat_read' => 'Mark category as read', + 'mark_feed_read' => 'Mark feed as read', + 'newer_first' => 'Newer first', + 'non-starred' => 'Show all but favorites', + 'normal_view' => 'Normal view', + 'older_first' => 'Oldest first', + 'queries' => 'User queries', + 'read' => 'Show only read', + 'reader_view' => 'Reading view', + 'rss_view' => 'RSS feed', + 'search_short' => 'Search', + 'starred' => 'Show only favorites', + 'stats' => 'Statistics', + 'subscription' => 'Subscriptions management', + 'unread' => 'Show only unread', + ), + 'share' => 'Share', + 'tag' => array( + 'related' => 'Related tags', + ), +); diff --git a/app/i18n/en/install.php b/app/i18n/en/install.php new file mode 100644 index 000000000..40fff37dd --- /dev/null +++ b/app/i18n/en/install.php @@ -0,0 +1,119 @@ +<?php + +return array( + 'action' => array( + 'finish' => 'Complete installation', + 'fix_errors_before' => 'Please fix errors before skipping to the next step.', + 'keep_install' => 'Keep previous configuration', + 'next_step' => 'Go to the next step', + 'reinstall' => 'Reinstall FreshRSS', + ), + 'auth' => array( + 'form' => 'Web form (traditional, requires JavaScript)', + 'http' => 'HTTP (for advanced users with HTTPS)', + 'none' => 'None (dangerous)', + 'password_form' => 'Password<br /><small>(for the Web-form login method)</small>', + 'password_format' => 'At least 7 characters', + 'type' => 'Authentication method', + ), + 'bdd' => array( + '_' => 'Database', + 'conf' => array( + '_' => 'Database configuration', + 'ko' => 'Verify your database information.', + 'ok' => 'Database configuration has been saved.', + ), + 'host' => 'Host', + 'prefix' => 'Table prefix', + 'password' => 'Database password', + 'type' => 'Type of database', + 'username' => 'Database username', + ), + 'check' => array( + '_' => 'Checks', + 'already_installed' => 'We have detected that FreshRSS is already installed!', + 'cache' => array( + 'nok' => 'Check permissions on <em>./data/cache</em> directory. HTTP server must have rights to write into', + 'ok' => 'Permissions on cache directory are good.', + ), + 'ctype' => array( + 'nok' => 'Cannot find a required library for character type checking (php-ctype).', + 'ok' => 'You have the required library for character type checking (ctype).', + ), + 'curl' => array( + 'nok' => 'Cannot find the cURL library (php-curl package).', + 'ok' => 'You have the cURL library.', + ), + 'data' => array( + 'nok' => 'Check permissions on <em>./data</em> directory. HTTP server must have rights to write into', + 'ok' => 'Permissions on data directory are good.', + ), + 'dom' => array( + 'nok' => 'Cannot find a required library to browse the DOM.', + 'ok' => 'You have the required library to browse the DOM.', + ), + 'favicons' => array( + 'nok' => 'Check permissions on <em>./data/favicons</em> directory. HTTP server must have rights to write into', + 'ok' => 'Permissions on favicons directory are good.', + ), + 'fileinfo' => array( + 'nok' => 'Cannot find the PHP fileinfo library (fileinfo package).', + 'ok' => 'You have the fileinfo library.', + ), + 'http_referer' => array( + 'nok' => 'Please check that you are not altering your HTTP REFERER.', + 'ok' => 'Your HTTP REFERER is known and corresponds to your server.', + ), + 'json' => array( + 'nok' => 'Cannot find a recommended library to parse JSON.', + 'ok' => 'You have a recommended library to parse JSON.', + ), + 'minz' => array( + 'nok' => 'Cannot find the Minz framework.', + 'ok' => 'You have the Minz framework.', + ), + 'pcre' => array( + 'nok' => 'Cannot find a required library for regular expressions (php-pcre).', + 'ok' => 'You have the required library for regular expressions (PCRE).', + ), + 'pdo' => array( + 'nok' => 'Cannot find PDO or one of the supported drivers (pdo_mysql, pdo_sqlite, pdo_pgsql).', + 'ok' => 'You have PDO and at least one of the supported drivers (pdo_mysql, pdo_sqlite, pdo_pgsql).', + ), + 'php' => array( + 'nok' => 'Your PHP version is %s but FreshRSS requires at least version %s.', + 'ok' => 'Your PHP version is %s, which is compatible with FreshRSS.', + ), + 'users' => array( + 'nok' => 'Check permissions on <em>./data/users</em> directory. HTTP server must have rights to write into', + 'ok' => 'Permissions on users directory are good.', + ), + 'xml' => array( + 'nok' => 'Cannot find the required library to parse XML.', + 'ok' => 'You have the required library to parse XML.', + ), + ), + 'conf' => array( + '_' => 'General configuration', + 'ok' => 'General configuration has been saved.', + ), + 'congratulations' => 'Congratulations!', + 'default_user' => 'Username of the default user <small>(maximum 16 alphanumeric characters)</small>', + 'delete_articles_after' => 'Remove articles after', + 'fix_errors_before' => 'Please fix errors before skipping to the next step.', + 'javascript_is_better' => 'FreshRSS is more pleasant with JavaScript enabled', + 'js' => array( + 'confirm_reinstall' => 'You will lose your previous configuration by reinstalling FreshRSS. Are you sure you want to continue?', + ), + 'language' => array( + '_' => 'Language', + 'choose' => 'Choose a language for FreshRSS', + 'defined' => 'Language has been defined.', + ), + 'not_deleted' => 'Something went wrong; you must delete the file <em>%s</em> manually.', + 'ok' => 'The installation process was successful.', + 'step' => 'step %d', + 'steps' => 'Steps', + 'title' => 'Installation · FreshRSS', + 'this_is_the_end' => 'This is the end', +); diff --git a/app/i18n/en/sub.php b/app/i18n/en/sub.php new file mode 100644 index 000000000..789433ee6 --- /dev/null +++ b/app/i18n/en/sub.php @@ -0,0 +1,62 @@ +<?php + +return array( + 'category' => array( + '_' => 'Category', + 'add' => 'Add a category', + 'empty' => 'Empty category', + 'new' => 'New category', + ), + 'feed' => array( + 'add' => 'Add a RSS feed', + 'advanced' => 'Advanced', + 'archiving' => 'Archivage', + 'auth' => array( + 'configuration' => 'Login', + 'help' => 'Connection allows to access HTTP protected RSS feeds', + 'http' => 'HTTP Authentication', + 'password' => 'HTTP password', + 'username' => 'HTTP username', + ), + 'css_help' => 'Retrieves truncated RSS feeds (caution, requires more time!)', + 'css_path' => 'Articles CSS path on original website', + '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 actualize 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 <em>%s</em>.', + 'no_selected' => 'No feed selected.', + 'number_entries' => '%d articles', + 'stats' => 'Statistics', + 'think_to_add' => 'You may add some feeds.', + 'title' => 'Title', + 'title_add' => 'Add a RSS feed', + 'ttl' => 'Do not automatically refresh more often than', + 'url' => 'Feed URL', + 'validator' => 'Check the validity of the feed', + 'website' => 'Website URL', + 'pubsubhubbub' => 'Instant notification with PubSubHubbub', + ), + 'import_export' => array( + 'export' => 'Export', + 'export_opml' => 'Export list of feeds (OPML)', + 'export_starred' => 'Export your favourites', + 'feed_list' => 'List of %s articles', + 'file_to_import' => 'File to import<br />(OPML, JSON or ZIP)', + 'file_to_import_no_zip' => 'File to import<br />(OPML or JSON)', + 'import' => 'Import', + 'starred_list' => 'List of favourite articles', + 'title' => 'Import / export', + ), + 'menu' => array( + 'bookmark' => 'Subscribe (FreshRSS bookmark)', + 'import_export' => 'Import / export', + 'subscription_management' => 'Subscriptions management', + ), + 'title' => array( + '_' => 'Subscriptions management', + 'feed_management' => 'RSS feeds management', + ), +); diff --git a/app/i18n/fr.php b/app/i18n/fr.php deleted file mode 100644 index ab7843d12..000000000 --- a/app/i18n/fr.php +++ /dev/null @@ -1,326 +0,0 @@ -<?php - -return array ( - // LAYOUT - 'login' => 'Connexion', - 'login_with_persona' => 'Connexion avec Persona', - 'logout' => 'Déconnexion', - 'search' => 'Rechercher des mots ou des #tags', - 'search_short' => 'Rechercher', - - 'configuration' => 'Configuration', - 'users' => 'Utilisateurs', - 'categories' => 'Catégories', - 'category' => 'Catégorie', - 'feed' => 'Flux', - 'feeds' => 'Flux', - 'shortcuts' => 'Raccourcis', - 'about' => 'À propos', - 'stats' => 'Statistiques', - - 'your_rss_feeds' => 'Vos flux RSS', - 'add_rss_feed' => 'Ajouter un flux RSS', - 'no_rss_feed' => 'Aucun flux RSS', - 'import_export_opml' => 'Importer / exporter (OPML)', - - 'subscription_management' => 'Gestion des abonnements', - 'main_stream' => 'Flux principal', - 'all_feeds' => 'Tous les flux', - 'favorite_feeds' => 'Favoris (%d)', - 'not_read' => '%d non lu', - 'not_reads' => '%d non lus', - - 'filter' => 'Filtrer', - 'see_website' => 'Voir le site', - 'administration' => 'Gestion', - 'actualize' => 'Actualiser', - - 'mark_read' => 'Marquer comme lu', - 'mark_favorite' => 'Mettre en favori', - 'mark_all_read' => 'Tout marquer comme lu', - 'mark_feed_read' => 'Marquer le flux comme lu', - 'mark_cat_read' => 'Marquer la catégorie comme lue', - 'before_one_day' => 'Antérieurs à 1 jour', - 'before_one_week' => 'Antérieurs à 1 semaine', - 'display' => 'Affichage', - 'normal_view' => 'Vue normale', - 'reader_view' => 'Vue lecture', - 'global_view' => 'Vue globale', - 'rss_view' => 'Flux RSS', - 'show_all_articles' => 'Afficher tous les articles', - 'show_not_reads' => 'Afficher les non lus', - 'show_read' => 'Afficher les lus', - 'show_favorite' => 'Afficher les favoris', - 'older_first' => 'Plus anciens en premier', - 'newer_first' => 'Plus récents en premier', - - // Pagination - 'first' => 'Début', - 'previous' => 'Précédent', - 'next' => 'Suivant', - 'last' => 'Fin', - - // CONTROLLERS - 'article_published_on' => 'Article publié initialement sur <a href="%s">%s</a>', - 'article_published_on_author' => 'Article publié initialement sur <a href="%s">%s</a> par %s', - - 'access_denied' => 'Vous n’avez pas le droit d’accéder à cette page', - 'page_not_found' => 'La page que vous cherchez n’existe pas', - 'error_occurred' => 'Une erreur est survenue', - 'error_occurred_update' => 'Rien n’a été modifié', - - 'default_category' => 'Sans catégorie', - 'categories_updated' => 'Les catégories ont été mises à jour', - 'categories_management' => 'Gestion des catégories', - 'feed_updated' => 'Le flux a été mis à jour', - 'rss_feed_management' => 'Gestion des flux RSS', - 'configuration_updated' => 'La configuration a été mise à jour', - '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', - 'shortcuts_other_action' => 'Autres actions', - 'feeds_marked_read' => 'Les flux ont été marqués comme lus', - 'updated' => 'Modifications enregistrées', - - 'already_subscribed' => 'Vous êtes déjà abonné à <em>%s</em>', - 'feed_added' => 'Le flux <em>%s</em> a bien été ajouté', - 'feed_not_added' => '<em>%s</em> n’a pas pu être ajouté', - 'internal_problem_feed' => 'Le flux n’a pas pu être ajouté. Consulter les logs de FreshRSS pour plus de détails.', - 'invalid_url' => 'L’url <em>%s</em> est invalide', - 'feed_actualized' => '<em>%s</em> a été mis à jour', - 'n_feeds_actualized' => '%d flux ont été mis à jour', - 'feeds_actualized' => 'Les flux ont été mis à jour', - 'no_feed_actualized' => 'Aucun flux n’a pu être mis à jour', - 'n_entries_deleted' => '%d articles ont été supprimés', - 'feeds_imported_with_errors' => 'Vos flux ont été importés mais des erreurs sont survenues', - 'feeds_imported' => 'Vos flux ont été importés et vont maintenant être actualisés', - 'category_emptied' => 'La catégorie a été vidée', - 'feed_deleted' => 'Le flux a été supprimé', - 'feed_validator' => 'Vérifier la valididé du flux', - - 'optimization_complete' => 'Optimisation terminée', - - 'your_rss_feeds' => 'Vos flux RSS', - 'your_favorites' => 'Vos favoris', - 'public' => 'Public', - 'invalid_login' => 'L’identifiant est invalide', - - // VIEWS - 'save' => 'Enregistrer', - 'delete' => 'Supprimer', - 'cancel' => 'Annuler', - - 'back_to_rss_feeds' => '← Retour à vos flux RSS', - 'feeds_moved_category_deleted' => 'Lors de la suppression d’une catégorie, ses flux seront automatiquement classés dans <em>%s</em>.', - 'category_number' => 'Catégorie n°%d', - 'ask_empty' => 'Vider ?', - 'number_feeds' => '%d flux', - 'can_not_be_deleted' => 'Ne peut pas être supprimée', - 'add_category' => 'Ajouter une catégorie', - 'new_category' => 'Nouvelle catégorie', - - 'javascript_for_shortcuts' => 'Le JavaScript doit être activé pour pouvoir profiter des raccourcis', - 'javascript_should_be_activated'=> 'Le JavaScript doit être activé', - 'shift_for_all_read' => '+ <code>shift</code> pour marquer tous les articles comme lus', - 'see_on_website' => 'Voir sur le site d’origine', - 'next_article' => 'Passer à l’article suivant', - 'last_article' => 'Passer au dernier article', - 'previous_article' => 'Passer à l’article précédent', - 'first_article' => 'Passer au premier article', - 'next_page' => 'Passer à la page suivante', - 'previous_page' => 'Passer à la page précédente', - 'collapse_article' => 'Refermer', - 'auto_share' => 'Partager', - 'auto_share_help' => 'Si il n’y a qu’un mode de partage, celui ci est utilisé automatiquement. Sinon ils sont accessibles par leur numéro.', - - 'file_to_import' => 'Fichier à importer', - 'import' => 'Importer', - 'export' => 'Exporter', - 'or' => 'ou', - - 'informations' => 'Informations', - 'damn' => 'Arf !', - 'feed_in_error' => 'Ce flux a rencontré un problème. Veuillez vérifier qu’il est toujours accessible puis actualisez-le.', - 'feed_empty' => 'Ce flux est vide. Veuillez vérifier qu’il est toujours maintenu.', - 'feed_description' => 'Description', - 'website_url' => 'URL du site', - 'feed_url' => 'URL du flux', - 'articles' => 'articles', - 'number_articles' => 'Nombre d’articles', - 'by_feed' => 'par flux', - 'by_default' => 'Par défaut', - 'keep_history' => 'Nombre minimum d’articles à conserver', - 'categorize' => 'Ranger dans une catégorie', - 'truncate' => 'Supprimer tous les articles', - 'advanced' => 'Avancé', - 'show_in_all_flux' => 'Afficher dans le flux principal', - 'yes' => 'Oui', - 'no' => 'Non', - 'css_path_on_website' => 'Sélecteur CSS des articles sur le site d’origine', - 'retrieve_truncated_feeds' => 'Permet de récupérer les flux tronqués (attention, demande plus de temps !)', - 'http_authentication' => 'Authentification HTTP', - 'http_username' => 'Identifiant HTTP', - 'http_password' => 'Mot de passe HTTP', - 'blank_to_disable' => 'Laissez vide pour désactiver', - 'not_yet_implemented' => 'Pas encore implémenté', - 'access_protected_feeds' => 'La connexion permet d’accéder aux flux protégés par une authentification HTTP', - 'no_selected_feed' => 'Aucun flux sélectionné.', - 'think_to_add' => '<a href="./?c=configure&a=feed">Vous pouvez ajouter des flux</a>.', - - 'current_user' => 'Utilisateur actuel', - 'password_form' => 'Mot de passe<br /><small>(pour connexion par formulaire)</small>', - 'default_user' => 'Nom de l’utilisateur par défaut <small>(16 caractères alphanumériques maximum)</small>', - 'persona_connection_email' => 'Adresse courriel de connexion<br /><small>(pour <a href="https://persona.org/" rel="external">Mozilla Persona</a>)</small>', - 'allow_anonymous' => 'Autoriser la lecture anonyme des articles de l’utilisateur par défaut (%s)', - 'allow_anonymous_refresh' => 'Autoriser le rafraîchissement anonyme des flux', - 'auth_token' => 'Jeton d’identification', - 'explain_token' => 'Permet d’accéder à la sortie RSS de l’utilisateur par défaut sans besoin de s’authentifier.<br /><kbd>%s?output=rss&token=%s</kbd>', - 'login_configuration' => 'Identification', - 'is_admin' => 'est administrateur', - 'auth_type' => 'Méthode d’authentification', - 'auth_none' => 'Aucune (dangereux)', - 'auth_form' => 'Formulaire (traditionnel, requiert JavaScript)', - 'http_auth' => 'HTTP (pour utilisateurs avancés avec HTTPS)', - 'auth_persona' => 'Mozilla Persona (moderne, requiert JavaScript)', - 'users_list' => 'Liste des utilisateurs', - 'create_user' => 'Créer un nouvel utilisateur', - 'username' => 'Nom d’utilisateur', - 'password' => 'Mot de passe', - 'create' => 'Créer', - 'user_created' => 'L’utilisateur %s a été créé', - 'user_deleted' => 'L’utilisateur %s a été supprimé', - - 'language' => 'Langue', - 'month' => 'mois', - 'archiving_configuration' => 'Archivage', - 'delete_articles_every' => 'Supprimer les articles après', - 'purge_now' => 'Purger maintenant', - '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', - 'articles_per_page' => 'Nombre d’articles par page', - 'default_view' => 'Vue par défaut', - 'sort_order' => 'Ordre de tri', - 'auto_load_more' => 'Charger les articles suivants en bas de page', - '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', - 'top_line' => 'Ligne du haut', - 'bottom_line' => 'Ligne du bas', - 'img_with_lazyload' => 'Utiliser le mode “chargement différé” pour les images', - 'auto_read_when' => 'Marquer un article comme lu…', - 'article_selected' => 'lorsque l’article est sélectionné', - 'article_open_on_website' => 'lorsque l’article est ouvert sur le site d’origine', - 'scroll' => 'au défilement de la page', - 'upon_reception' => 'dès la réception du nouvel article', - 'your_shaarli' => 'Votre Shaarli', - 'your_wallabag' => 'Votre wallabag', - 'your_diaspora_pod' => 'Votre pod Diaspora*', - 'sharing' => 'Partage', - 'share' => 'Partager', - 'by_email' => 'Par courriel', - 'optimize_bdd' => 'Optimiser la base de données', - 'optimize_todo_sometimes' => 'À faire de temps en temps pour réduire la taille de la BDD', - 'theme' => 'Thème', - 'more_information' => 'Plus d’informations', - 'activate_sharing' => 'Activer le partage', - 'shaarli' => 'Shaarli', - 'wallabag' => 'wallabag', - 'diaspora' => 'Diaspora*', - 'twitter' => 'Twitter', - 'g+' => 'Google+', - 'facebook' => 'Facebook', - 'email' => 'Courriel', - 'print' => 'Imprimer', - - 'article' => 'Article', - 'title' => 'Titre', - 'author' => 'Auteur', - 'publication_date' => 'Date de publication', - 'by' => 'par', - - 'load_more' => 'Charger plus d’articles', - 'nothing_to_load' => 'Fin des articles', - - 'rss_feeds_of' => 'Flux RSS de %s', - - 'refresh' => 'Actualisation', - 'no_feed_to_refresh' => 'Il n’y a aucun flux à actualiser…', - - 'today' => 'Aujourd’hui', - 'yesterday' => 'Hier', - 'before_yesterday' => 'À partir d’avant-hier', - 'new_article' => 'Il y a de nouveaux articles disponibles, cliquez pour rafraîchir la page.', - 'by_author' => 'Par <em>%s</em>', - 'related_tags' => 'Tags associés', - 'no_feed_to_display' => 'Il n’y a aucun article à afficher.', - - 'about_freshrss' => 'À propos de FreshRSS', - 'project_website' => 'Site du projet', - 'lead_developer' => 'Développeur principal', - 'website' => 'Site Internet', - 'bugs_reports' => 'Rapports de bugs', - 'github_or_email' => '<a href="https://github.com/marienfressinaud/FreshRSS/issues">sur Github</a> ou <a href="mailto:dev@marienfressinaud.fr">par courriel</a>', - 'license' => 'Licence', - 'agpl3' => '<a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL 3</a>', - 'freshrss_description' => 'FreshRSS est un agrégateur de flux RSS à auto-héberger à l’image de <a href="http://tontof.net/kriss/feed/">Kriss Feed</a> ou <a href="http://projet.idleman.fr/leed/">Leed</a>. Il se veut léger et facile à prendre en main tout en étant un outil puissant et paramétrable.', - 'credits' => 'Crédits', - 'credits_content' => 'Des éléments de design sont issus du <a href="http://twitter.github.io/bootstrap/">projet Bootstrap</a> bien que FreshRSS n’utilise pas ce framework. Les <a href="https://git.gnome.org/browse/gnome-icon-theme-symbolic">icônes</a> sont issues du <a href="https://www.gnome.org/">projet GNOME</a>. La police <em>Open Sans</em> utilisée a été créée par <a href="https://www.google.com/webfonts/specimen/Open+Sans">Steve Matteson</a>. Les favicons sont récupérés grâce au site <a href="https://getfavicon.appspot.com/">getFavicon</a>. FreshRSS repose sur <a href="https://github.com/marienfressinaud/MINZ">Minz</a>, un framework PHP.', - 'version' => 'Version', - - 'logs' => 'Logs', - 'logs_empty' => 'Les logs sont vides', - 'clear_logs' => 'Effacer les logs', - - 'forbidden_access' => 'L’accès vous est interdit !', - 'login_required' => 'Accès protégé par mot de passe :', - - 'confirm_action' => 'Êtes-vous sûr(e) de vouloir continuer ? Cette action ne peut être annulée !', - - // DATE - 'january' => 'janvier', - 'february' => 'février', - 'march' => 'mars', - 'april' => 'avril', - 'may' => 'mai', - 'june' => 'juin', - 'july' => 'juillet', - 'august' => 'août', - 'september' => 'septembre', - 'october' => 'octobre', - 'november' => 'novembre', - 'december' => 'décembre', - // format spécial pour la fonction date() - 'Jan' => '\j\a\n\v\i\e\r', - 'Feb' => '\f\é\v\r\i\e\r', - 'Mar' => '\m\a\r\s', - 'Apr' => '\a\v\r\i\l', - 'May' => '\m\a\i', - 'Jun' => '\j\u\i\n', - 'Jul' => '\j\u\i\l\l\e\t', - 'Aug' => '\a\o\û\t', - 'Sep' => '\s\e\p\t\e\m\b\r\e', - 'Oct' => '\o\c\t\o\b\r\e', - 'Nov' => '\n\o\v\e\m\b\r\e', - 'Dec' => '\d\é\c\e\m\b\r\e', - // format pour la fonction date(), %s permet d'indiquer le mois en toutes lettres - 'format_date' => 'j %s Y', - 'format_date_hour' => 'j %s Y \à H\:i', - - 'status_favorites' => 'favoris', - 'status_read' => 'lus', - 'status_unread' => 'non lus', - 'status_total' => 'total', - - 'stats_entry_repartition' => 'Répartition des articles', - 'stats_entry_per_day' => 'Nombre d’articles par jour (30 derniers jours)', - 'stats_feed_per_category' => 'Flux par catégorie', - 'stats_entry_per_category' => 'Articles par catégorie', - 'stats_top_feed' => 'Les dix plus gros flux', - 'stats_entry_count' => 'Nombre d’articles', -); diff --git a/app/i18n/fr/admin.php b/app/i18n/fr/admin.php new file mode 100644 index 000000000..9a13ecc21 --- /dev/null +++ b/app/i18n/fr/admin.php @@ -0,0 +1,181 @@ +<?php + +return array( + 'auth' => array( + 'allow_anonymous' => 'Autoriser la lecture anonyme des articles de l’utilisateur par défaut (%s)', + 'allow_anonymous_refresh' => 'Autoriser le rafraîchissement anonyme des flux', + 'api_enabled' => 'Autoriser l’accès par <abbr>API</abbr> <small>(nécessaire pour les applis mobiles)</small>', + 'form' => 'Formulaire (traditionnel, requiert JavaScript)', + 'http' => 'HTTP (pour utilisateurs avancés avec HTTPS)', + 'none' => 'Aucune (dangereux)', + 'title' => 'Authentification', + 'title_reset' => 'Réinitialisation de l’authentification', + 'token' => 'Jeton d’identification', + 'token_help' => 'Permet d’accéder à la sortie RSS de l’utilisateur par défaut sans besoin de s’authentifier :', + 'type' => 'Méthode d’authentification', + 'unsafe_autologin' => 'Autoriser les connexions automatiques non-sûres au format : ', + ), + 'check_install' => array( + 'cache' => array( + 'nok' => 'Veuillez vérifier les droits sur le répertoire <em>./data/cache</em>. Le serveur HTTP doit être capable d’écrire dedans', + 'ok' => 'Les droits sur le répertoire de cache sont bons.', + ), + 'categories' => array( + 'nok' => 'La table category est mal configurée.', + 'ok' => 'La table category est bien configurée.', + ), + 'connection' => array( + 'nok' => 'La connexion à la base de données est impossible.', + 'ok' => 'La connexion à la base de données est bonne.', + ), + 'ctype' => array( + 'nok' => 'Impossible de trouver une librairie pour la vérification des types de caractères (php-ctype).', + 'ok' => 'Vous disposez de la librairie pour la vérification des types de caractères (ctype).', + ), + 'curl' => array( + 'nok' => 'Impossible de trouver la librairie cURL (paquet php-curl).', + 'ok' => 'Vous disposez de la librairie cURL.', + ), + 'data' => array( + 'nok' => 'Veuillez vérifier les droits sur le répertoire <em>./data</em>. Le serveur HTTP doit être capable d’écrire dedans', + 'ok' => 'Les droits sur le répertoire de data sont bons.', + ), + 'database' => 'Installation de la base de données', + 'dom' => array( + 'nok' => 'Impossible de trouver une librairie pour parcourir le DOM (paquet php-xml).', + 'ok' => 'Vous disposez de la librairie pour parcourir le DOM.', + ), + 'entries' => array( + 'nok' => 'La table entry est mal configurée.', + 'ok' => 'La table entry est bien configurée.', + ), + 'favicons' => array( + 'nok' => 'Veuillez vérifier les droits sur le répertoire <em>./data/favicons</em>. Le serveur HTTP doit être capable d’écrire dedans', + 'ok' => 'Les droits sur le répertoire des favicons sont bons.', + ), + 'feeds' => array( + 'nok' => 'La table feed est mal configurée.', + 'ok' => 'La table feed est bien configurée.', + ), + 'fileinfo' => array( + 'nok' => 'Impossible de trouver la librairie PHP fileinfo (paquet fileinfo).', + 'ok' => 'Vous disposez de la librairie fileinfo.', + ), + 'files' => 'Installation des fichiers', + 'json' => array( + 'nok' => 'Vous ne disposez pas de JSON (paquet php5-json).', + 'ok' => 'Vous disposez de l’extension JSON.', + ), + 'minz' => array( + 'nok' => 'Vous ne disposez pas de la librairie Minz.', + 'ok' => 'Vous disposez du framework Minz', + ), + 'pcre' => array( + 'nok' => 'Impossible de trouver une librairie pour les expressions régulières (php-pcre).', + 'ok' => 'Vous disposez de la librairie pour les expressions régulières (PCRE).', + ), + 'pdo' => array( + 'nok' => 'Vous ne disposez pas de PDO ou d’un des drivers supportés (pdo_mysql, pdo_sqlite, pdo_pgsql).', + 'ok' => 'Vous disposez de PDO et d’au moins un des drivers supportés (pdo_mysql, pdo_sqlite, pdo_pgsql).', + ), + 'php' => array( + '_' => 'Installation de PHP', + 'nok' => 'Votre version de PHP est la %s mais FreshRSS requiert au moins la version %s.', + 'ok' => 'Votre version de PHP est la %s, qui est compatible avec FreshRSS.', + ), + 'tables' => array( + 'nok' => 'Impossible de trouver une ou plusieurs tables en base de données.', + 'ok' => 'Les tables sont bien présentes en base de données.', + ), + 'title' => 'Vérification de l’installation', + 'tokens' => array( + 'nok' => 'Veuillez vérifier les droits sur le répertoire <em>./data/tokens</em>. Le serveur HTTP doit être capable d’écrire dedans', + 'ok' => 'Les droits sur le répertoire des tokens sont bons.', + ), + 'users' => array( + 'nok' => 'Veuillez vérifier les droits sur le répertoire <em>./data/users</em>. Le serveur HTTP doit être capable d’écrire dedans', + 'ok' => 'Les droits sur le répertoire des utilisateurs sont bons.', + ), + 'zip' => array( + 'nok' => 'Vous ne disposez pas de l’extension ZIP (paquet php-zip).', + 'ok' => 'Vous disposez de l’extension ZIP.', + ), + ), + 'extensions' => array( + 'disabled' => 'Désactivée', + 'empty_list' => 'Il n’y a aucune extension installée.', + 'enabled' => 'Activée', + 'no_configure_view' => 'Cette extension ne peut pas être configurée.', + 'system' => array( + '_' => 'Extensions système', + 'no_rights' => 'Extension système (vous n’avez aucun droit dessus)', + ), + 'title' => 'Extensions', + 'user' => 'Extensions utilisateur', + ), + 'stats' => array( + '_' => 'Statistiques', + 'all_feeds' => 'Tous les flux', + 'category' => 'Catégorie', + 'entry_count' => 'Nombre d’articles', + 'entry_per_category' => 'Articles par catégorie', + 'entry_per_day' => 'Nombre d’articles par jour (30 derniers jours)', + 'entry_per_day_of_week' => 'Par jour de la semaine (moyenne : %.2f messages)', + 'entry_per_hour' => 'Par heure (moyenne : %.2f messages)', + 'entry_per_month' => 'Par mois (moyenne : %.2f messages)', + 'entry_repartition' => 'Répartition des articles', + 'feed' => 'Flux', + 'feed_per_category' => 'Flux par catégorie', + 'idle' => 'Flux inactifs', + 'main' => 'Statistiques principales', + 'main_stream' => 'Flux principal', + 'menu' => array( + 'idle' => 'Flux inactifs', + 'main' => 'Statistiques principales', + 'repartition' => 'Répartition des articles', + ), + 'no_idle' => 'Il n’y a aucun flux inactif !', + 'number_entries' => '%d articles', + 'percent_of_total' => '%% du total', + 'repartition' => 'Répartition des articles', + 'status_favorites' => 'favoris', + 'status_read' => 'lus', + 'status_total' => 'total', + 'status_unread' => 'non lus', + 'title' => 'Statistiques', + 'top_feed' => 'Les dix plus gros flux', + ), + 'system' => array( + '_' => 'Configuration du système', + 'auto-update-url' => 'URL du service de mise à jour', + 'instance-name' => 'Nom de l’instance', + 'max-categories' => 'Limite de catégories par utilisateur', + 'max-feeds' => 'Limite de flux par utilisateur', + 'registration' => array( + 'help' => 'Un chiffre de 0 signifie que l’on peut créer un nombre infini de comptes', + 'number' => 'Nombre max de comptes', + ), + ), + 'update' => array( + '_' => 'Système de mise à jour', + 'apply' => 'Appliquer la mise à jour', + 'check' => 'Vérifier les mises à jour', + 'current_version' => 'Votre version actuelle de FreshRSS est la %s.', + 'last' => 'Dernière vérification : %s', + 'none' => 'Aucune mise à jour à appliquer', + 'title' => 'Système de mise à jour', + ), + 'user' => array( + 'articles_and_size' => '%s articles (%s)', + 'create' => 'Créer un nouvel 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<br /><small>(pour connexion par formulaire)</small>', + 'password_format' => '7 caractères minimum', + 'title' => 'Gestion des utilisateurs', + 'user_list' => 'Liste des utilisateurs', + 'username' => 'Nom d’utilisateur', + 'users' => 'Utilisateurs', + ), +); diff --git a/app/i18n/fr/conf.php b/app/i18n/fr/conf.php new file mode 100644 index 000000000..7a6d12e17 --- /dev/null +++ b/app/i18n/fr/conf.php @@ -0,0 +1,173 @@ +<?php + +return array( + 'archiving' => array( + '_' => 'Archivage', + 'advanced' => 'Avancé', + 'delete_after' => 'Supprimer les articles après', + 'help' => 'D’autres options sont disponibles dans la configuration individuelle des flux.', + 'keep_history_by_feed' => 'Nombre minimum d’articles à conserver par flux', + 'optimize' => 'Optimiser la base de données', + 'optimize_help' => 'À faire de temps en temps pour réduire la taille de la BDD', + 'purge_now' => 'Purger maintenant', + 'title' => 'Archivage', + 'ttl' => 'Ne pas automatiquement rafraîchir plus souvent que', + ), + 'display' => array( + '_' => 'Affichage', + 'icon' => array( + 'bottom_line' => 'Ligne du bas', + 'entry' => 'Icônes d’article', + 'publication_date' => 'Date de publication', + 'related_tags' => 'Tags associés', + 'sharing' => 'Partage', + 'top_line' => 'Ligne du haut', + ), + 'language' => 'Langue', + 'notif_html5' => array( + 'seconds' => 'secondes (0 signifie aucun timeout)', + 'timeout' => 'Temps d’affichage de la notification HTML5', + ), + 'theme' => 'Thème', + 'title' => 'Affichage', + 'width' => array( + 'content' => 'Largeur du contenu', + 'large' => 'Large', + 'medium' => 'Moyenne', + 'no_limit' => 'Pas de limite', + 'thin' => 'Fine', + ), + ), + 'query' => array( + '_' => 'Filtres utilisateurs', + 'deprecated' => 'Ce filtre n’est plus valide. La catégorie ou le flux concerné a été supprimé.', + 'filter' => 'Filtres appliqués :', + 'get_all' => 'Afficher tous les articles', + 'get_category' => 'Afficher la catégorie "%s"', + 'get_favorite' => 'Afficher les articles favoris', + 'get_feed' => 'Afficher le flux "%s"', + 'no_filter' => 'Aucun filtre appliqué', + 'none' => 'Vous n’avez pas encore créé de filtre.', + 'number' => 'Filtre n°%d', + 'order_asc' => 'Afficher les articles les plus anciens en premier', + 'order_desc' => 'Afficher les articles les plus récents en premier', + 'search' => 'Recherche de "%s"', + 'state_0' => 'Afficher tous les articles', + 'state_1' => 'Afficher les articles lus', + 'state_2' => 'Afficher les articles non lus', + 'state_3' => 'Afficher tous les articles', + 'state_4' => 'Afficher les articles favoris', + 'state_5' => 'Afficher les articles lus et favoris', + 'state_6' => 'Afficher les articles non lus et favoris', + 'state_7' => 'Afficher les articles favoris', + 'state_8' => 'Afficher les articles non favoris', + 'state_9' => 'Afficher les articles lus et non favoris', + 'state_10' => 'Afficher les articles non lus et non favoris', + 'state_11' => 'Afficher les articles non favoris', + 'state_12' => 'Afficher tous les articles', + 'state_13' => 'Afficher les articles lus', + 'state_14' => 'Afficher les articles non lus', + 'state_15' => 'Afficher tous les articles', + 'title' => 'Filtres utilisateurs', + ), + 'profile' => array( + '_' => 'Gestion du profil', + 'delete' => array( + '_' => 'Suppression du compte', + 'warn' => 'Le compte et toutes les données associées vont être supprimées.', + ), + 'password_api' => 'Mot de passe API<br /><small>(ex. : pour applis mobiles)</small>', + 'password_form' => 'Mot de passe<br /><small>(pour connexion par formulaire)</small>', + 'password_format' => '7 caractères minimum', + 'title' => 'Profil', + ), + 'reading' => array( + '_' => 'Lecture', + 'after_onread' => 'Après “marquer tout comme lu”,', + 'articles_per_page' => 'Nombre d’articles par page', + 'auto_load_more' => 'Charger les articles suivants en bas de page', + 'auto_remove_article' => 'Cacher les articles après lecture', + 'mark_updated_article_unread' => 'Marquer les articles mis à jour comme non-lus', + 'confirm_enabled' => 'Afficher une confirmation lors des actions “marquer tout comme lu”', + 'display_articles_unfolded' => 'Afficher les articles dépliés par défaut', + 'display_categories_unfolded' => 'Afficher les catégories pliées par défaut', + 'hide_read_feeds' => 'Cacher les catégories & flux sans article non-lu (ne fonctionne pas avec la configuration “Afficher tous les articles”)', + 'img_with_lazyload' => 'Utiliser le mode “chargement différé” pour les images', + 'jump_next' => 'sauter au prochain voisin non lu (flux ou catégorie)', + 'number_divided_when_reader' => 'Divisé par 2 dans la vue de lecture.', + 'read' => array( + 'article_open_on_website' => 'lorsque l’article est ouvert sur le site d’origine', + 'article_viewed' => 'lorsque l’article est affiché', + 'scroll' => 'au défilement de la page', + 'upon_reception' => 'dès la réception du nouvel article', + 'when' => 'Marquer un article comme lu…', + ), + 'show' => array( + '_' => 'Articles à afficher', + 'adaptive' => 'Adapter l’affichage', + 'all_articles' => 'Afficher tous les articles', + 'unread' => 'Afficher les non lus', + ), + 'sort' => array( + '_' => 'Ordre de tri', + 'newer_first' => 'Plus récents en premier', + 'older_first' => 'Plus anciens en premier', + ), + 'sticky_post' => 'Aligner l’article en haut quand il est ouvert', + 'title' => 'Lecture', + 'view' => array( + 'default' => 'Vue par défaut', + 'global' => 'Vue globale', + 'normal' => 'Vue normale', + 'reader' => 'Vue lecture', + ), + ), + 'sharing' => array( + '_' => 'Partage', + 'blogotext' => 'Blogotext', + 'diaspora' => 'Diaspora*', + 'email' => 'Courriel', + 'facebook' => 'Facebook', + 'g+' => 'Google+', + 'more_information' => 'Plus d’informations', + 'print' => 'Print', + 'shaarli' => 'Shaarli', + 'share_name' => 'Nom du partage à afficher', + 'share_url' => 'URL du partage à utiliser', + 'title' => 'Partage', + 'twitter' => 'Twitter', + 'wallabag' => 'wallabag', + ), + 'shortcut' => array( + '_' => 'Raccourcis', + 'article_action' => 'Actions associées à l’article courant', + 'auto_share' => 'Partager', + 'auto_share_help' => 'S’il n’y a qu’un mode de partage, celui-ci est utilisé automatiquement. Sinon ils sont accessibles par leur numéro.', + 'close_dropdown' => 'Fermer les menus', + 'collapse_article' => 'Refermer', + 'first_article' => 'Passer au premier article', + 'focus_search' => 'Accéder à la recherche', + 'help' => 'Afficher la documentation', + 'javascript' => 'Le JavaScript doit être activé pour pouvoir profiter des raccourcis.', + 'last_article' => 'Passer au dernier article', + 'load_more' => 'Charger plus d’articles', + 'mark_read' => 'Marquer comme lu', + 'mark_favorite' => 'Mettre en favori', + 'navigation' => 'Navigation', + '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.', + 'next_article' => 'Passer à l’article suivant', + 'other_action' => 'Autres actions', + 'previous_article' => 'Passer à l’article précédent', + 'see_on_website' => 'Voir sur le site d’origine', + 'shift_for_all_read' => '+ <code>shift</code> 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.', + ), + 'user' => array( + 'articles_and_size' => '%s articles (%s)', + 'current' => 'Utilisateur actuel', + 'is_admin' => 'est administrateur', + 'users' => 'Utilisateurs', + ), +); diff --git a/app/i18n/fr/feedback.php b/app/i18n/fr/feedback.php new file mode 100644 index 000000000..5966fc3a7 --- /dev/null +++ b/app/i18n/fr/feedback.php @@ -0,0 +1,109 @@ +<?php + +return array( + 'admin' => array( + 'optimization_complete' => 'Optimisation terminée.', + ), + 'access' => array( + 'denied' => 'Vous n’avez pas le droit d’accéder à cette page !', + 'not_found' => 'La page que vous cherchez n’existe pas !', + ), + 'auth' => array( + 'form' => array( + 'not_set' => 'Un problème est survenu lors de la configuration de votre système d’authentification. Veuillez réessayer plus tard.', + 'set' => 'Le formulaire est désormais votre système d’authentification.', + ), + 'login' => array( + 'invalid' => 'L’identifiant est invalide', + 'success' => 'Vous êtes désormais connecté', + ), + 'logout' => array( + 'success' => 'Vous avez été déconnecté', + ), + 'no_password_set' => 'Aucun mot de passe administrateur n’a été précisé. Cette fonctionnalité n’est pas disponible.', + ), + 'conf' => array( + 'error' => 'Une erreur est survenue durant la sauvegarde de la configuration', + 'query_created' => 'Le filtre "%s" a bien été créé.', + 'shortcuts_updated' => 'Les raccourcis ont été mis à jour.', + 'updated' => 'La configuration a été mise à jour', + ), + 'extensions' => array( + 'already_enabled' => '%s est déjà activée', + 'disable' => array( + 'ko' => '%s ne peut pas être désactivée. <a href="%s">Consulter les logs de FreshRSS</a> pour plus de détails.', + 'ok' => '%s est désormais désactivée', + ), + 'enable' => array( + 'ko' => '%s ne peut pas être activée. <a href="%s">Consulter les logs de FreshRSS</a> pour plus de détails.', + 'ok' => '%s est désormais activée', + ), + 'no_access' => 'Vous n’avez aucun accès sur %s', + 'not_enabled' => '%s n’est pas encore activée', + 'not_found' => '%s n’existe pas', + ), + 'import_export' => array( + 'export_no_zip_extension' => 'L’extension ZIP n’est pas présente sur votre serveur. Veuillez essayer d’exporter les fichiers un par un.', + 'feeds_imported' => 'Vos flux ont été importés et vont maintenant être actualisés.', + 'feeds_imported_with_errors' => 'Vos flux ont été importés mais des erreurs sont survenues.', + 'file_cannot_be_uploaded' => 'Le fichier ne peut pas être téléchargé !', + 'no_zip_extension' => 'L’extension ZIP n’est pas présente sur votre serveur.', + 'zip_error' => 'Une erreur est survenue durant l’import du fichier ZIP.', + ), + 'sub' => array( + 'actualize' => 'Actualiser', + 'category' => array( + 'created' => 'La catégorie %s a été créée.', + 'deleted' => 'La catégorie a été supprimée.', + 'emptied' => 'La catégorie a été vidée.', + 'error' => 'La catégorie n’a pas pu être modifiée', + 'name_exists' => 'Une catégorie possède déjà ce nom.', + 'no_id' => 'Vous devez préciser l’id de la catégorie.', + 'no_name' => 'Vous devez préciser un nom pour la catégorie.', + 'not_delete_default' => 'Vous ne pouvez pas supprimer la catégorie par défaut !', + 'not_exist' => 'Cette catégorie n’existe pas !', + 'over_max' => 'Vous avez atteint votre limite de catégories (%d)', + 'updated' => 'La catégorie a été mise à jour.', + ), + 'feed' => array( + 'actualized' => '<em>%s</em> a été mis à jour.', + 'actualizeds' => 'Les flux ont été mis à jour.', + 'added' => 'Le flux <em>%s</em> a bien été ajouté.', + 'already_subscribed' => 'Vous êtes déjà abonné à <em>%s</em>', + 'deleted' => 'Le flux a été supprimé.', + 'error' => 'Une erreur est survenue', + 'internal_problem' => 'Le flux ne peut pas être ajouté. <a href="%s">Consulter les logs de FreshRSS</a> pour plus de détails.', + 'invalid_url' => 'L’url <em>%s</em> est invalide.', + 'marked_read' => 'Les flux ont été marqués comme lus.', + 'n_actualized' => '%d flux ont été mis à jour.', + 'n_entries_deleted' => '%d articles ont été supprimés.', + 'no_refresh' => 'Il n’y a aucun flux à actualiser…', + 'not_added' => '<em>%s</em> n’a pas pu être ajouté.', + 'over_max' => 'Vous avez atteint votre limite de flux (%d)', + 'updated' => 'Le flux a été mis à jour', + ), + 'purge_completed' => 'Purge effectuée (%d articles supprimés).', + ), + 'update' => array( + 'can_apply' => 'FreshRSS va maintenant être mis à jour vers la <strong>version %s</strong>.', + 'error' => 'La mise à jour a rencontré un problème : %s', + 'file_is_nok' => 'Veuillez vérifier les droits sur le répertoire <em>%s</em>. Le serveur HTTP doit être capable d’écrire dedans', + 'finished' => 'La mise à jour est terminée !', + 'none' => 'Aucune mise à jour à appliquer', + 'server_not_found' => 'Le serveur de mise à jour n’a pas été trouvé. [%s]', + ), + 'user' => array( + 'created' => array( + '_' => 'L’utilisateur %s a été créé.', + 'error' => 'L’utilisateur %s ne peut pas être créé.', + ), + 'deleted' => array( + '_' => 'L’utilisateur %s a été supprimé.', + 'error' => 'L’utilisateur %s ne peut pas être supprimé.', + ), + ), + 'profile' => array( + 'error' => 'Votre profil n’a pas pu être mis à jour', + 'updated' => 'Votre profil a été mis à jour', + ), +); diff --git a/app/i18n/fr/gen.php b/app/i18n/fr/gen.php new file mode 100644 index 000000000..b5dc098ae --- /dev/null +++ b/app/i18n/fr/gen.php @@ -0,0 +1,182 @@ +<?php + +return array( + 'action' => array( + 'actualize' => 'Actualiser', + 'back_to_rss_feeds' => '← Retour à vos flux RSS', + 'cancel' => 'Annuler', + 'create' => 'Créer', + 'disable' => 'Désactiver', + 'empty' => 'Vider', + 'enable' => 'Activer', + 'export' => 'Exporter', + 'filter' => 'Filtrer', + 'import' => 'Importer', + 'manage' => 'Gérer', + 'mark_read' => 'Marquer comme lu', + 'mark_favorite' => 'Mettre en favori', + 'remove' => 'Supprimer', + 'see_website' => 'Voir le site', + 'submit' => 'Valider', + 'truncate' => 'Supprimer tous les articles', + ), + 'auth' => array( + 'email' => 'Adresse courriel', + 'keep_logged_in' => 'Rester connecté <small>(%s jours)</small>', + 'login' => 'Connexion', + 'logout' => 'Déconnexion', + 'password' => array( + '_' => 'Mot de passe', + 'format' => '<small>7 caractères minimum</small>', + ), + 'registration' => array( + '_' => 'Nouveau compte', + 'ask' => 'Créer un compte ?', + 'title' => 'Création de compte', + ), + 'reset' => 'Réinitialisation de l’authentification', + 'username' => array( + '_' => 'Nom d’utilisateur', + 'admin' => 'Nom d’utilisateur administrateur', + 'format' => '<small>16 caractères alphanumériques maximum</small>', + ), + ), + 'date' => array( + 'Apr' => '\\a\\v\\r\\i\\l', + 'Aug' => '\\a\\o\\û\\t', + 'Dec' => '\\d\\é\\c\\e\\m\\b\\r\\e', + 'Feb' => '\\f\\é\\v\\r\\i\\e\\r', + 'Jan' => '\\j\\a\\n\\v\\i\\e\\r', + 'Jul' => '\\j\\u\\i\\l\\l\\e\\t', + 'Jun' => '\\j\\u\\i\\n', + 'Mar' => '\\m\\a\\r\\s', + 'May' => '\\m\\a\\i', + 'Nov' => '\\n\\o\\v\\e\\m\\b\\r\\e', + 'Oct' => '\\o\\c\\t\\o\\b\\r\\e', + 'Sep' => '\\s\\e\\p\\t\\e\\m\\b\\r\\e', + 'apr' => 'avr.', + 'april' => 'avril', + 'aug' => 'août', + 'august' => 'août', + 'before_yesterday' => 'À partir d’avant-hier', + 'dec' => 'déc.', + 'december' => 'décembre', + 'feb' => 'fév.', + 'february' => 'février', + 'format_date' => 'j %s Y', + 'format_date_hour' => 'j %s Y \\à H\\:i', + 'fri' => 'ven.', + 'jan' => 'jan.', + 'january' => 'janvier', + 'jul' => 'jui.', + 'july' => 'juillet', + 'jun' => 'juin', + 'june' => 'juin', + 'last_3_month' => 'Depuis les trois derniers mois', + 'last_6_month' => 'Depuis les six derniers mois', + 'last_month' => 'Depuis le mois dernier', + 'last_week' => 'Depuis la semaine dernière', + 'last_year' => 'Depuis l’année dernière', + 'mar' => 'mar.', + 'march' => 'mars', + 'may' => 'mai.', + 'mon' => 'lun.', + 'month' => 'mois', + 'nov' => 'nov.', + 'november' => 'novembre', + 'oct' => 'oct.', + 'october' => 'octobre', + 'sat' => 'sam.', + 'sep' => 'sep.', + 'september' => 'septembre', + 'sun' => 'dim.', + 'thu' => 'jeu.', + 'today' => 'Aujourd’hui', + 'tue' => 'mar.', + 'wed' => 'mer.', + 'yesterday' => 'Hier', + ), + 'freshrss' => array( + '_' => 'FreshRSS', + 'about' => 'À propos de FreshRSS', + ), + 'js' => array( + 'category_empty' => 'Catégorie vide', + 'confirm_action' => 'Êtes-vous sûr(e) de vouloir continuer ? Cette action ne peut être annulée !', + 'confirm_action_feed_cat' => 'Êtes-vous sûr(e) de vouloir continuer ? Vous perdrez les favoris et les filtres associés. Cette action ne peut être annulée !', + 'feedback' => array( + 'body_new_articles' => 'Il y a %%d nouveaux articles à lire sur FreshRSS.', + 'request_failed' => 'Une requête a échoué, cela peut être dû à des problèmes de connexion à Internet.', + 'title_new_articles' => 'FreshRSS : nouveaux articles !', + ), + 'new_article' => 'Il y a de nouveaux articles disponibles, cliquez pour rafraîchir la page.', + 'should_be_activated' => 'Le JavaScript doit être activé.', + ), + 'lang' => array( + 'cz' => 'Čeština', + 'de' => 'Deutsch', + 'en' => 'English', + 'fr' => 'Français', + 'it' => 'Italiano', + 'nl' => 'Nederlands', + 'ru' => 'Русский', + 'tr' => 'Türkçe', + ), + 'menu' => array( + 'about' => 'À propos', + 'admin' => 'Administration', + 'archiving' => 'Archivage', + 'authentication' => 'Authentification', + 'check_install' => 'Vérification de l’installation', + 'configuration' => 'Configuration', + 'display' => 'Affichage', + 'extensions' => 'Extensions', + 'logs' => 'Logs', + 'queries' => 'Filtres utilisateurs', + 'reading' => 'Lecture', + 'search' => 'Rechercher des mots ou des #tags', + 'sharing' => 'Partage', + 'shortcuts' => 'Raccourcis', + 'stats' => 'Statistiques', + 'system' => 'Configuration du système', + 'update' => 'Mise à jour', + 'user_management' => 'Gestion des utilisateurs', + 'user_profile' => 'Profil', + ), + 'pagination' => array( + 'first' => 'Début', + 'last' => 'Fin', + 'load_more' => 'Charger plus d’articles', + 'mark_all_read' => 'Tout marquer comme lu', + 'next' => 'Suivant', + 'nothing_to_load' => 'Fin des articles', + 'previous' => 'Précédent', + ), + 'share' => array( + 'blogotext' => 'Blogotext', + 'diaspora' => 'Diaspora*', + 'email' => 'Courriel', + 'facebook' => 'Facebook', + 'g+' => 'Google+', + 'movim' => 'Movim', + 'print' => 'Imprimer', + 'shaarli' => 'Shaarli', + 'twitter' => 'Twitter', + 'wallabag' => 'wallabag v1', + 'wallabagv2' => 'wallabag v2', + 'jdh' => 'Journal du hacker', + ), + 'short' => array( + 'attention' => 'Attention !', + 'blank_to_disable' => 'Laissez vide pour désactiver', + 'by_author' => 'Par <em>%s</em>', + 'by_default' => 'Par défaut', + 'damn' => 'Arf !', + 'default_category' => 'Sans catégorie', + 'no' => 'Non', + 'not_applicable' => 'Non disponible', + 'ok' => 'Ok !', + 'or' => 'ou', + 'yes' => 'Oui', + ), +); diff --git a/app/i18n/fr/index.php b/app/i18n/fr/index.php new file mode 100644 index 000000000..62eedc280 --- /dev/null +++ b/app/i18n/fr/index.php @@ -0,0 +1,61 @@ +<?php + +return array( + 'about' => array( + '_' => 'À propos', + 'agpl3' => '<a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL 3</a>', + 'bugs_reports' => 'Rapports de bugs', + 'credits' => 'Crédits', + 'credits_content' => 'Des éléments de design sont issus du <a href="http://twitter.github.io/bootstrap/">projet Bootstrap</a> bien que FreshRSS n’utilise pas ce framework. Les <a href="https://git.gnome.org/browse/gnome-icon-theme-symbolic">icônes</a> sont issues du <a href="https://www.gnome.org/">projet GNOME</a>. La police <em>Open Sans</em> utilisée a été créée par <a href="https://fonts.google.com/specimen/Open+Sans">Steve Matteson</a>. FreshRSS repose sur <a href="https://github.com/marienfressinaud/MINZ">Minz</a>, un framework PHP.', + 'freshrss_description' => 'FreshRSS est un agrégateur de flux RSS à auto-héberger à l’image de <a href="http://tontof.net/kriss/feed/">Kriss Feed</a> ou <a href="http://projet.idleman.fr/leed/">Leed</a>. Il se veut léger et facile à prendre en main tout en étant un outil puissant et paramétrable.', + 'github' => '<a href="https://github.com/FreshRSS/FreshRSS/issues">sur Github</a>', + 'license' => 'Licence', + 'project_website' => 'Site du projet', + 'title' => 'À propos', + 'version' => 'Version', + 'website' => 'Site Internet', + ), + 'feed' => array( + 'add' => 'Vous pouvez ajouter des flux.', + 'empty' => 'Il n’y a aucun article à afficher.', + 'rss_of' => 'Flux RSS de %s', + 'title' => 'Vos flux RSS', + 'title_global' => 'Vue globale', + 'title_fav' => 'Vos favoris', + ), + 'log' => array( + '_' => 'Logs', + 'clear' => 'Effacer les logs', + 'empty' => 'Les logs sont vides.', + 'title' => 'Logs', + ), + 'menu' => array( + 'about' => 'À propos de FreshRSS', + 'add_query' => 'Créer un filtre', + 'before_one_day' => 'Antérieurs à 1 jour', + 'before_one_week' => 'Antérieurs à 1 semaine', + 'favorites' => 'Favoris (%s)', + 'global_view' => 'Vue globale', + 'main_stream' => 'Flux principal', + 'mark_all_read' => 'Tout marquer comme lu', + 'mark_cat_read' => 'Marquer la catégorie comme lue', + 'mark_feed_read' => 'Marquer le flux comme lu', + 'newer_first' => 'Plus récents en premier', + 'non-starred' => 'Afficher tout sauf les favoris', + 'normal_view' => 'Vue normale', + 'older_first' => 'Plus anciens en premier', + 'queries' => 'Filtres utilisateurs', + 'read' => 'Afficher les lus', + 'reader_view' => 'Vue lecture', + 'rss_view' => 'Flux RSS', + 'search_short' => 'Rechercher', + 'starred' => 'Afficher les favoris', + 'stats' => 'Statistiques', + 'subscription' => 'Gestion des abonnements', + 'unread' => 'Afficher les non lus', + ), + 'share' => 'Partager', + 'tag' => array( + 'related' => 'Tags associés', + ), +); diff --git a/app/i18n/fr/install.php b/app/i18n/fr/install.php new file mode 100644 index 000000000..09625de78 --- /dev/null +++ b/app/i18n/fr/install.php @@ -0,0 +1,119 @@ +<?php + +return array( + 'action' => array( + 'finish' => 'Terminer l’installation', + 'fix_errors_before' => 'Veuillez corriger les erreurs avant de passer à l’étape suivante.', + 'keep_install' => 'Garder l’ancienne configuration', + 'next_step' => 'Passer à l’étape suivante', + 'reinstall' => 'Réinstaller FreshRSS', + ), + 'auth' => array( + 'form' => 'Formulaire (traditionnel, requiert JavaScript)', + 'http' => 'HTTP (pour utilisateurs avancés avec HTTPS)', + 'none' => 'Aucune (dangereux)', + 'password_form' => 'Mot de passe<br /><small>(pour connexion par formulaire)</small>', + 'password_format' => '7 caractères minimum', + 'type' => 'Méthode d’authentification', + ), + 'bdd' => array( + '_' => 'Base de données', + 'conf' => array( + '_' => 'Configuration de la base de données', + 'ko' => 'Vérifiez les informations d’accès à la base de données.', + 'ok' => 'La configuration de la base de données a été enregistrée.', + ), + 'host' => 'Hôte', + 'password' => 'Mot de passe pour base de données', + 'prefix' => 'Préfixe des tables', + 'type' => 'Type de base de données', + 'username' => 'Nom d’utilisateur pour base de données', + ), + 'check' => array( + '_' => 'Vérifications', + 'already_installed' => 'FreshRSS semble avoir déjà été installé !', + 'cache' => array( + 'nok' => 'Veuillez vérifier les droits sur le répertoire <em>./data/cache</em>. Le serveur HTTP doit être capable d’écrire dedans', + 'ok' => 'Les droits sur le répertoire de cache sont bons.', + ), + 'ctype' => array( + 'nok' => 'Impossible de trouver une librairie pour la vérification des types de caractères (php-ctype).', + 'ok' => 'Vous disposez de la librairie pour la vérification des types de caractères (ctype).', + ), + 'curl' => array( + 'nok' => 'Vous ne disposez pas de cURL (paquet php-curl).', + 'ok' => 'Vous disposez de cURL.', + ), + 'data' => array( + 'nok' => 'Veuillez vérifier les droits sur le répertoire <em>./data</em>. Le serveur HTTP doit être capable d’écrire dedans', + 'ok' => 'Les droits sur le répertoire de data sont bons.', + ), + 'dom' => array( + 'nok' => 'Impossible de trouver une librairie pour parcourir le DOM.', + 'ok' => 'Vous disposez de la librairie pour parcourir le DOM.', + ), + 'favicons' => array( + 'nok' => 'Veuillez vérifier les droits sur le répertoire <em>./data/favicons</em>. Le serveur HTTP doit être capable d’écrire dedans', + 'ok' => 'Les droits sur le répertoire des favicons sont bons.', + ), + 'fileinfo' => array( + 'nok' => 'Vous ne disposez pas de PHP fileinfo (paquet fileinfo).', + 'ok' => 'Vous disposez de fileinfo.', + ), + 'http_referer' => array( + 'nok' => 'Veuillez vérifier que vous ne modifiez pas votre HTTP REFERER.', + 'ok' => 'Le HTTP REFERER est connu et semble correspondre à votre serveur.', + ), + 'json' => array( + 'nok' => 'Impossible de trouver une librairie recommandée pour JSON.', + 'ok' => 'Vouz disposez de la librairie recommandée pour JSON.', + ), + 'minz' => array( + 'nok' => 'Vous ne disposez pas de la librairie Minz.', + 'ok' => 'Vous disposez du framework Minz', + ), + 'pcre' => array( + 'nok' => 'Impossible de trouver une librairie pour les expressions régulières (php-pcre).', + 'ok' => 'Vous disposez de la librairie pour les expressions régulières (PCRE).', + ), + 'pdo' => array( + 'nok' => 'Vous ne disposez pas de PDO ou d’un des drivers supportés (pdo_mysql, pdo_sqlite, pdo_pgsql).', + 'ok' => 'Vous disposez de PDO et d’au moins un des drivers supportés (pdo_mysql, pdo_sqlite, pdo_pgsql).', + ), + 'php' => array( + 'nok' => 'Votre version de PHP est la %s mais FreshRSS requiert au moins la version %s.', + 'ok' => 'Votre version de PHP est la %s, qui est compatible avec FreshRSS.', + ), + 'users' => array( + 'nok' => 'Veuillez vérifier les droits sur le répertoire <em>./data/users</em>. Le serveur HTTP doit être capable d’écrire dedans', + 'ok' => 'Les droits sur le répertoire des utilisateurs sont bons.', + ), + 'xml' => array( + 'nok' => 'Impossible de trouver une librairie requise pour XML.', + 'ok' => 'Vouz disposez de la librairie requise pour XML.', + ), + ), + 'conf' => array( + '_' => 'Configuration générale', + 'ok' => 'La configuration générale a été enregistrée.', + ), + 'congratulations' => 'Félicitations !', + 'default_user' => 'Nom de l’utilisateur par défaut <small>(16 caractères alphanumériques maximum)</small>', + 'delete_articles_after' => 'Supprimer les articles après', + 'fix_errors_before' => 'Veuillez corriger les erreurs avant de passer à l’étape suivante.', + 'javascript_is_better' => 'FreshRSS est plus agréable à utiliser avec JavaScript activé', + 'js' => array( + 'confirm_reinstall' => 'Réinstaller FreshRSS vous fera perdre la configuration précédente. Êtes-vous sûr de vouloir continuer ?', + ), + 'language' => array( + '_' => 'Langue', + 'choose' => 'Choisissez la langue pour FreshRSS', + 'defined' => 'La langue a bien été définie.', + ), + 'not_deleted' => 'Quelque chose s’est mal passé, vous devez supprimer le fichier <em>%s</em> à la main.', + 'ok' => 'L’installation s’est bien passée.', + 'step' => 'étape %d', + 'steps' => 'Étapes', + 'title' => 'Installation · FreshRSS', + 'this_is_the_end' => 'This is the end', +); diff --git a/app/i18n/fr/sub.php b/app/i18n/fr/sub.php new file mode 100644 index 000000000..bb3f2fefc --- /dev/null +++ b/app/i18n/fr/sub.php @@ -0,0 +1,62 @@ +<?php + +return array( + 'category' => array( + '_' => 'Catégorie', + 'add' => 'Ajouter une catégorie', + 'empty' => 'Catégorie vide', + 'new' => 'Nouvelle catégorie', + ), + 'feed' => array( + 'add' => 'Ajouter un flux RSS', + 'advanced' => 'Avancé', + 'archiving' => 'Archivage', + 'auth' => array( + 'configuration' => 'Identification', + 'help' => 'La connexion permet d’accéder aux flux protégés par une authentification HTTP.', + 'http' => 'Authentification HTTP', + 'password' => 'Mot de passe HTTP', + 'username' => 'Identifiant HTTP', + ), + 'css_help' => 'Permet de récupérer les flux tronqués (attention, demande plus de temps !)', + 'css_path' => 'Sélecteur CSS des articles sur le site d’origine', + '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 <em>%s</em>.', + 'no_selected' => 'Aucun flux sélectionné.', + 'number_entries' => '%d articles', + 'stats' => 'Statistiques', + 'think_to_add' => 'Vous pouvez ajouter des flux.', + 'title' => 'Titre', + 'title_add' => 'Ajouter un flux RSS', + 'ttl' => 'Ne pas automatiquement rafraîchir plus souvent que', + 'url' => 'URL du flux', + 'validator' => 'Vérifier la validité du flux', + 'website' => 'URL du site', + 'pubsubhubbub' => 'Notification instantanée par PubSubHubbub', + ), + 'import_export' => array( + 'export' => 'Exporter', + 'export_opml' => 'Exporter la liste des flux (OPML)', + 'export_starred' => 'Exporter les favoris', + 'feed_list' => 'Liste des articles de %s', + 'file_to_import' => 'Fichier à importer<br />(OPML, JSON ou ZIP)', + 'file_to_import_no_zip' => 'Fichier à importer<br />(OPML ou JSON)', + 'import' => 'Importer', + 'starred_list' => 'Liste des articles favoris', + 'title' => 'Importer / exporter', + ), + 'menu' => array( + 'bookmark' => 'S’abonner (bookmark FreshRSS)', + 'import_export' => 'Importer / exporter', + 'subscription_management' => 'Gestion des abonnements', + ), + 'title' => array( + '_' => 'Gestion des abonnements', + 'feed_management' => 'Gestion des flux RSS', + ), +); diff --git a/app/i18n/install.en.php b/app/i18n/install.en.php deleted file mode 100644 index 0311ee9a4..000000000 --- a/app/i18n/install.en.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php -return array ( - 'freshrss_installation' => 'Installation · FreshRSS', - 'freshrss' => 'FreshRSS', - 'installation_step' => 'Installation — step %d · FreshRSS', - 'steps' => 'Steps', - 'checks' => 'Checks', - 'general_configuration' => 'General configuration', - 'bdd_configuration' => 'Database configuration', - 'bdd_type' => 'Type of database', - 'version_update' => 'Update', - 'this_is_the_end' => 'This is the end', - - 'ok' => 'Ok!', - 'congratulations' => 'Congratulations!', - 'attention' => 'Attention!', - 'damn' => 'Damn!', - 'oops' => 'Oops!', - 'next_step' => 'Go to the next step', - - 'language_defined' => 'Language has been defined.', - 'choose_language' => 'Choose a language for FreshRSS', - - 'javascript_is_better' => 'FreshRSS is more pleasant with JavaScript enabled', - 'php_is_ok' => 'Your PHP version is %s, which is compatible with FreshRSS', - 'php_is_nok' => 'Your PHP version is %s but FreshRSS requires at least version %s', - 'minz_is_ok' => 'You have the Minz framework', - 'minz_is_nok' => 'You lack the Minz framework. You should execute <em>build.sh</em> script or <a href="https://github.com/marienfressinaud/MINZ">download it on Github</a> and install in <em>%s</em> directory the content of its <em>/lib</em> directory.', - 'curl_is_ok' => 'You have version %s of cURL', - 'curl_is_nok' => 'You lack cURL (php5-curl package)', - 'pdomysql_is_ok' => 'You have PDO and its driver for MySQL', - 'pdomysql_is_nok' => 'You lack PDO or its driver for MySQL (php5-mysql package)', - 'dom_is_ok' => 'You have the required library to browse the DOM', - 'dom_is_nok' => 'You lack a required library to browse the DOM (php-xml package)', - 'pcre_is_ok' => 'You have the required library for regular expressions (PCRE)', - 'pcre_is_nok' => 'You lack a required library for regular expressions (php-pcre)', - 'ctype_is_ok' => 'You have the required library for character type checking (ctype)', - 'ctype_is_nok' => 'You lack a required library for character type checking (php-ctype)', - 'cache_is_ok' => 'Permissions on cache directory are good', - 'log_is_ok' => 'Permissions on logs directory are good', - 'favicons_is_ok' => 'Permissions on favicons directory are good', - 'data_is_ok' => 'Permissions on data directory are good', - 'persona_is_ok' => 'Permissions on Mozilla Persona directory are good', - 'file_is_nok' => 'Check permissions on <em>%s</em> directory. HTTP server must have rights to write into', - 'fix_errors_before' => 'Fix errors before skip to the next step.', - - 'general_conf_is_ok' => 'General configuration has been saved.', - 'random_string' => 'Random string', - 'change_value' => 'You should change this value by any other', - 'base_url' => 'Base URL', - 'do_not_change_if_doubt' => 'Don’t change if you doubt about it', - - 'bdd_conf_is_ok' => 'Database configuration has been saved.', - 'bdd_conf_is_ko' => 'Verify your database information.', - 'host' => 'Host', - 'bdd' => 'Database', - 'prefix' => 'Table prefix', - - 'update_start' => 'Start update process', - 'update_long' => 'This can take a long time, depending on the size of your database. You may have to wait for this page to time out (~5 minutes) and then refresh this page.', - 'update_end' => 'Update process is completed, now you can go to the final step.', - - - 'installation_is_ok' => 'The installation process was successful.<br />The final step will now attempt to delete the <kbd>./p/i/install.php</kbd> file and any database backup created during the update process.<br />You may choose to skip this step and delete <kbd>./p/i/install.php</kbd> manually.', - 'finish_installation' => 'Complete installation', - 'install_not_deleted' => 'Something went wrong; you must delete the file <em>%s</em> manually.', -); diff --git a/app/i18n/install.fr.php b/app/i18n/install.fr.php deleted file mode 100644 index bb183642f..000000000 --- a/app/i18n/install.fr.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php -return array ( - 'freshrss_installation' => 'Installation · FreshRSS', - 'freshrss' => 'FreshRSS', - 'installation_step' => 'Installation — étape %d · FreshRSS', - 'steps' => 'Étapes', - 'checks' => 'Vérifications', - 'general_configuration' => 'Configuration générale', - 'bdd_configuration' => 'Base de données', - 'bdd_type' => 'Type de base de données', - 'version_update' => 'Mise à jour', - 'this_is_the_end' => 'This is the end', - - 'ok' => 'Ok !', - 'congratulations' => 'Félicitations !', - 'attention' => 'Attention !', - 'damn' => 'Arf !', - 'oops' => 'Oups !', - 'next_step' => 'Passer à l’étape suivante', - - 'language_defined' => 'La langue a bien été définie.', - 'choose_language' => 'Choisissez la langue pour FreshRSS', - - 'javascript_is_better' => 'FreshRSS est plus agréable à utiliser avec JavaScript activé', - 'php_is_ok' => 'Votre version de PHP est la %s, qui est compatible avec FreshRSS', - 'php_is_nok' => 'Votre version de PHP est la %s mais FreshRSS requiert au moins la version %s', - 'minz_is_ok' => 'Vous disposez du framework Minz', - 'minz_is_nok' => 'Vous ne disposez pas de la librairie Minz. Vous devriez exécuter le script <em>build.sh</em> ou bien <a href="https://github.com/marienfressinaud/MINZ">la télécharger sur Github</a> et installer dans le répertoire <em>%s</em> le contenu de son répertoire <em>/lib</em>.', - 'curl_is_ok' => 'Vous disposez de cURL dans sa version %s', - 'curl_is_nok' => 'Vous ne disposez pas de cURL (paquet php5-curl)', - 'pdomysql_is_ok' => 'Vous disposez de PDO et de son driver pour MySQL (paquet php5-mysql)', - 'pdomysql_is_nok' => 'Vous ne disposez pas de PDO ou de son driver pour MySQL', - 'dom_is_ok' => 'Vous disposez du nécessaire pour parcourir le DOM', - 'dom_is_nok' => 'Il manque une librairie pour parcourir le DOM (paquet php-xml)', - 'pcre_is_ok' => 'Vous disposez du nécessaire pour les expressions régulières (PCRE)', - 'pcre_is_nok' => 'Il manque une librairie pour les expressions régulières (php-pcre)', - 'ctype_is_ok' => 'Vous disposez du nécessaire pour la vérification des types de caractères (ctype)', - 'ctype_is_nok' => 'Il manque une librairie pour la vérification des types de caractères (php-ctype)', - 'cache_is_ok' => 'Les droits sur le répertoire de cache sont bons', - 'log_is_ok' => 'Les droits sur le répertoire des logs sont bons', - 'favicons_is_ok' => 'Les droits sur le répertoire des favicons sont bons', - 'data_is_ok' => 'Les droits sur le répertoire de data sont bons', - 'persona_is_ok' => 'Les droits sur le répertoire de Mozilla Persona sont bons', - 'file_is_nok' => 'Veuillez vérifier les droits sur le répertoire <em>%s</em>. Le serveur HTTP doit être capable d’écrire dedans', - 'fix_errors_before' => 'Veuillez corriger les erreurs avant de passer à l’étape suivante.', - - 'general_conf_is_ok' => 'La configuration générale a été enregistrée.', - 'random_string' => 'Chaîne aléatoire', - 'change_value' => 'Vous devriez changer cette valeur par n’importe quelle autre', - 'base_url' => 'Base de l’URL', - 'do_not_change_if_doubt' => 'Laissez tel quel dans le doute', - - 'bdd_conf_is_ok' => 'La configuration de la base de données a été enregistrée.', - 'bdd_conf_is_ko' => 'Vérifiez les informations d’accès à la base de données.', - 'host' => 'Hôte', - 'bdd' => 'Base de données', - 'prefix' => 'Préfixe des tables', - - 'update_start' => 'Lancer la mise à jour', - 'update_long' => 'Ce processus peut prendre longtemps, selon la taille de votre base de données. Vous aurez peut-être à attendre que cette page dépasse son temps maximum d’exécution (~5 minutes) puis à la recharger.', - 'update_end' => 'La mise à jour est terminée, vous pouvez maintenant passer à l’étape finale.', - - 'installation_is_ok' => 'L’installation s’est bien passée.<br />La dernière étape va maintenant tenter de supprimer le fichier <kbd>./p/i/install.php</kbd>, ainsi que d’éventuelles copies de base de données créées durant le processus de mise à jour.<br />Vous pouvez choisir de sauter cette étape et de supprimer <kbd>./p/i/install.php</kbd> manuellement.', - 'finish_installation' => 'Terminer l’installation', - 'install_not_deleted' => 'Quelque chose s’est mal passé, vous devez supprimer le fichier <em>%s</em> à la main.', -); diff --git a/app/i18n/it/admin.php b/app/i18n/it/admin.php new file mode 100644 index 000000000..ae46818ae --- /dev/null +++ b/app/i18n/it/admin.php @@ -0,0 +1,181 @@ +<?php + +return array( + 'auth' => array( + 'allow_anonymous' => 'Consenti la lettura agli utenti anonimi degli articoli dell utente predefinito (%s)', + 'allow_anonymous_refresh' => 'Consenti agli utenti anonimi di aggiornare gli articoli', + 'api_enabled' => 'Consenti le <abbr>API</abbr> di accesso <small>(richiesto per le app mobili)</small>', + 'form' => 'Web form (tradizionale, richiede JavaScript)', + 'http' => 'HTTP (per gli utenti avanzati con HTTPS)', + 'none' => 'Nessuno (pericoloso)', + 'title' => 'Autenticazione', + 'title_reset' => 'Reset autenticazione', + 'token' => 'Token di autenticazione', + 'token_help' => 'Consenti accesso agli RSS dell utente predefinito senza autenticazione:', + 'type' => 'Metodo di autenticazione', + 'unsafe_autologin' => 'Consenti accesso automatico non sicuro usando il formato: ', + ), + 'check_install' => array( + 'cache' => array( + 'nok' => 'Verifica i permessi sulla cartella <em>./data/cache</em>. Il server HTTP deve avere i permessi per scriverci dentro', + 'ok' => 'I permessi sulla cartella della cache sono corretti.', + ), + 'categories' => array( + 'nok' => 'La tabella delle categorie ha una configurazione errata.', + 'ok' => 'Tabella delle categorie OK.', + ), + 'connection' => array( + 'nok' => 'La connessione al database non può essere stabilita.', + 'ok' => 'Connessione al database OK', + ), + 'ctype' => array( + 'nok' => 'Manca una libreria richiesta per il controllo dei caratteri (php-ctype).', + 'ok' => 'Libreria richiesta per il controllo dei caratteri presente (ctype).', + ), + 'curl' => array( + 'nok' => 'Manca il supporto per cURL (pacchetto php-curl).', + 'ok' => 'Estensione cURL presente.', + ), + 'data' => array( + 'nok' => 'Verifica i permessi sulla cartella <em>./data</em>. Il server HTTP deve avere i permessi per scriverci dentro', + 'ok' => 'I permessi sulla cartella data sono corretti.', + ), + 'database' => 'Installazione database', + 'dom' => array( + 'nok' => 'Manca una libreria richiesta per leggere DOM (pacchetto php-xml).', + 'ok' => 'Libreria richiesta per leggere DOM presente.', + ), + 'entries' => array( + 'nok' => 'La tabella Entry ha una configurazione errata.', + 'ok' => 'Tabella Entry OK.', + ), + 'favicons' => array( + 'nok' => 'Verifica i permessi sulla cartella <em>./data/favicons</em>. Il server HTTP deve avere i permessi per scriverci dentro', + 'ok' => 'I permessi sulla cartella favicons sono corretti.', + ), + 'feeds' => array( + 'nok' => 'La tabella Feed ha una configurazione errata.', + 'ok' => 'Tabella Feed OK.', + ), + 'fileinfo' => array( + 'nok' => 'Manca il supporto per PHP fileinfo (pacchetto fileinfo).', + 'ok' => 'Estensione fileinfo presente.', + ), + 'files' => 'Installazione files', + 'json' => array( + 'nok' => 'Manca il supoorto a JSON (pacchetto php5-json).', + 'ok' => 'Estensione JSON presente.', + ), + 'minz' => array( + 'nok' => 'Manca il framework Minz.', + 'ok' => 'Framework Minz presente.', + ), + 'pcre' => array( + 'nok' => 'Manca una libreria richiesta per le regular expressions (php-pcre).', + 'ok' => 'Libreria richiesta per le regular expressions presente (PCRE).', + ), + 'pdo' => array( + 'nok' => 'Manca PDO o uno degli altri driver supportati (pdo_mysql, pdo_sqlite, pdo_pgsql).', + 'ok' => 'PDO e altri driver supportati (pdo_mysql, pdo_sqlite, pdo_pgsql).', + ), + 'php' => array( + '_' => 'Installazione PHP', + 'nok' => 'Versione PHP %s FreshRSS richiede almeno la versione %s.', + 'ok' => 'Versione PHP %s, compatibile con FreshRSS.', + ), + 'tables' => array( + 'nok' => 'Rilevate tabelle mancanti nel database.', + 'ok' => 'Tutte le tabelle sono presenti nel database.', + ), + 'title' => 'Verifica installazione', + 'tokens' => array( + 'nok' => 'Verifica i permessi sulla cartella <em>./data/tokens</em>. Il server HTTP deve avere i permessi per scriverci dentro', + 'ok' => 'I permessi sulla cartella tokens sono corretti.', + ), + 'users' => array( + 'nok' => 'Verifica i permessi sulla cartella <em>./data/users</em>. Il server HTTP deve avere i permessi per scriverci dentro', + 'ok' => 'I permessi sulla cartella users sono corretti.', + ), + 'zip' => array( + 'nok' => 'Manca estensione ZIP (pacchetto php-zip).', + 'ok' => 'Estensione ZIP presente.', + ), + ), + 'extensions' => array( + 'disabled' => 'Disabilitata', + 'empty_list' => 'Non ci sono estensioni installate', + 'enabled' => 'Abilitata', + 'no_configure_view' => 'Questa estensioni non può essere configurata.', + 'system' => array( + '_' => 'Estensioni di sistema', + 'no_rights' => 'Estensione di sistema (non hai i permessi su questo tipo)', + ), + 'title' => 'Estensioni', + 'user' => 'Estensioni utente', + ), + 'stats' => array( + '_' => 'Statistiche', + 'all_feeds' => 'Tutti i feeds', + 'category' => 'Categoria', + 'entry_count' => 'Articoli', + 'entry_per_category' => 'Articoli per categoria', + 'entry_per_day' => 'Articoli per giorno (ultimi 30 giorni)', + 'entry_per_day_of_week' => 'Per giorno della settimana (media: %.2f articoli)', + 'entry_per_hour' => 'Per ora (media: %.2f articoli)', + 'entry_per_month' => 'Per mese (media: %.2f articoli)', + 'entry_repartition' => 'Ripartizione contenuti', + 'feed' => 'Feed', + 'feed_per_category' => 'Feeds per categoria', + 'idle' => 'Feeds non aggiornati', + 'main' => 'Statistiche principali', + 'main_stream' => 'Flusso principale', + 'menu' => array( + 'idle' => 'Feeds non aggiornati', + 'main' => 'Statistiche principali', + 'repartition' => 'Ripartizione articoli', + ), + 'no_idle' => 'Non ci sono feed non aggiornati', + 'number_entries' => '%d articoli', + 'percent_of_total' => '%% del totale', + 'repartition' => 'Ripartizione articoli', + 'status_favorites' => 'Preferiti', + 'status_read' => 'Letti', + 'status_total' => 'Totale', + 'status_unread' => 'Non letti', + 'title' => 'Statistiche', + 'top_feed' => 'I migliori 10 feeds', + ), + 'system' => array( + '_' => 'Configurazione di sistema', + 'auto-update-url' => 'Auto-update server URL', // @todo translate + 'instance-name' => 'Nome istanza', + 'max-categories' => 'Limite categorie per utente', + 'max-feeds' => 'Limite feeds per utente', + 'registration' => array( + 'help' => '0 significa che non esiste limite sui profili', + 'number' => 'Numero massimo di profili', + ), + ), + 'update' => array( + '_' => 'Aggiornamento sistema', + 'apply' => 'Applica', + 'check' => 'Controlla la presenza di nuovi aggiornamenti', + 'current_version' => 'FreshRSS versione %s.', + 'last' => 'Ultima verifica: %s', + 'none' => 'Nessun aggiornamento da applicare', + 'title' => 'Aggiorna sistema', + ), + 'user' => array( + 'articles_and_size' => '%s articoli (%s)', + 'create' => 'Crea nuovo utente', + 'language' => 'Lingua', + 'number' => ' %d profilo utente creato', + 'numbers' => 'Sono presenti %d profili utente', + 'password_form' => 'Password<br /><small>(per il login classico)</small>', + 'password_format' => 'Almeno 7 caratteri', + 'title' => 'Gestione utenti', + 'user_list' => 'Lista utenti', + 'username' => 'Nome utente', + 'users' => 'Utenti', + ), +); diff --git a/app/i18n/it/conf.php b/app/i18n/it/conf.php new file mode 100644 index 000000000..19b62c9a7 --- /dev/null +++ b/app/i18n/it/conf.php @@ -0,0 +1,173 @@ +<?php + +return array( + 'archiving' => array( + '_' => 'Archiviazione', + 'advanced' => 'Avanzate', + 'delete_after' => 'Rimuovi articoli dopo', + 'help' => 'Altre opzioni sono disponibili nelle impostazioni dei singoli feed', + 'keep_history_by_feed' => 'Numero minimo di articoli da mantenere per feed', + 'optimize' => 'Ottimizza database', + 'optimize_help' => 'Da fare occasionalmente per ridurre le dimensioni del database', + 'purge_now' => 'Cancella ora', + 'title' => 'Archiviazione', + 'ttl' => 'Non effettuare aggiornamenti per più di', + ), + 'display' => array( + '_' => 'Visualizzazione', + 'icon' => array( + 'bottom_line' => 'Barra in fondo', + 'entry' => 'Icone degli articoli', + 'publication_date' => 'Data di pubblicazione', + 'related_tags' => 'Tags correlati', + 'sharing' => 'Condivisione', + 'top_line' => 'Barra in alto', + ), + 'language' => 'Lingua', + 'notif_html5' => array( + 'seconds' => 'secondi (0 significa nessun timeout)', + 'timeout' => 'Notifica timeout HTML5', + ), + 'theme' => 'Tema', + 'title' => 'Visualizzazione', + 'width' => array( + 'content' => 'Larghezza contenuto', + 'large' => 'Largo', + 'medium' => 'Medio', + 'no_limit' => 'Nessun limite', + 'thin' => 'Stretto', + ), + ), + 'query' => array( + '_' => 'Ricerche personali', + 'deprecated' => 'Questa query non è più valida. La categoria o il feed di riferimento non stati cancellati.', + 'filter' => 'Filtro applicato:', + 'get_all' => 'Mostra tutti gli articoli', + 'get_category' => 'Mostra la categoria "%s" ', + 'get_favorite' => 'Mostra articoli preferiti', + 'get_feed' => 'Mostra feed "%s" ', + 'no_filter' => 'Nessun filtro', + 'none' => 'Non hai creato nessuna ricerca personale.', + 'number' => 'Ricerca n°%d', + 'order_asc' => 'Mostra prima gli articoli più vecchi', + 'order_desc' => 'Mostra prima gli articoli più nuovi', + 'search' => 'Cerca per "%s"', + 'state_0' => 'Mostra tutti gli articoli', + 'state_1' => 'Mostra gli articoli letti', + 'state_2' => 'Mostra gli articoli non letti', + 'state_3' => 'Mostra tutti gli articoli', + 'state_4' => 'Mostra gli articoli preferiti', + 'state_5' => 'Mostra gli articoli preferiti letti', + 'state_6' => 'Mostra gli articoli preferiti non letti', + 'state_7' => 'Mostra gli articoli preferiti', + 'state_8' => 'Non mostrare gli articoli preferiti', + 'state_9' => 'Mostra gli articoli letti non preferiti', + 'state_10' => 'Mostra gli articoli non letti e non preferiti', + 'state_11' => 'Non mostrare gli articoli preferiti', + 'state_12' => 'Mostra tutti gli articoli', + 'state_13' => 'Mostra gli articoli letti', + 'state_14' => 'Mostra gli articoli non letti', + 'state_15' => 'Mostra tutti gli articoli', + 'title' => 'Ricerche personali', + ), + 'profile' => array( + '_' => 'Gestione profili', + 'delete' => array( + '_' => 'Cancellazione account', + 'warn' => 'Il tuo account e tutti i dati associati saranno cancellati.', + ), + 'password_api' => 'Password API<br /><small>(e.g., per applicazioni mobili)</small>', + 'password_form' => 'Password<br /><small>(per il login classico)</small>', + 'password_format' => 'Almeno 7 caratteri', + 'title' => 'Profilo', + ), + 'reading' => array( + '_' => 'Lettura', + 'after_onread' => 'Dopo “segna tutto come letto”,', + 'articles_per_page' => 'Numero di articoli per pagina', + 'auto_load_more' => 'Carica articoli successivi a fondo pagina', + 'auto_remove_article' => 'Nascondi articoli dopo la lettura', + 'mark_updated_article_unread' => 'Segna articoli aggiornati come non letti', + 'confirm_enabled' => 'Mostra una conferma per “segna tutto come letto”', + 'display_articles_unfolded' => 'Mostra articoli aperti di predefinito', + 'display_categories_unfolded' => 'Mostra categorie aperte di predefinito', + 'hide_read_feeds' => 'Nascondi categorie e feeds con articoli già letti (non funziona se “Mostra tutti gli articoli” è selezionato)', + 'img_with_lazyload' => 'Usa la modalità "caricamento ritardato" per le immagini', + 'jump_next' => 'Salta al successivo feed o categoria non letto', + 'number_divided_when_reader' => 'Diviso 2 nella modalità di lettura.', + 'read' => array( + 'article_open_on_website' => 'Quando un articolo è aperto nel suo sito di origine', + 'article_viewed' => 'Quando un articolo viene letto', + 'scroll' => 'Scorrendo la pagina', + 'upon_reception' => 'Alla ricezione del contenuto', + 'when' => 'Segna articoli come letti…', + ), + 'show' => array( + '_' => 'Articoli da visualizzare', + 'adaptive' => 'Adatta visualizzazione', + 'all_articles' => 'Mostra tutti gli articoli', + 'unread' => 'Mostra solo non letti', + ), + 'sort' => array( + '_' => 'Ordinamento', + 'newer_first' => 'Prima i più recenti', + 'older_first' => 'Prima i più vecchi', + ), + 'sticky_post' => 'Blocca il contenuto a inizio pagina quando aperto', + 'title' => 'Lettura', + 'view' => array( + 'default' => 'Visualizzazione predefinita', + 'global' => 'Vista globale per categorie', + 'normal' => 'Vista elenco', + 'reader' => 'Modalità di lettura', + ), + ), + 'sharing' => array( + '_' => 'Condivisione', + 'blogotext' => 'Blogotext', + 'diaspora' => 'Diaspora*', + 'email' => 'Email', + 'facebook' => 'Facebook', + 'g+' => 'Google+', + 'more_information' => 'Ulteriori informazioni', + 'print' => 'Stampa', + 'shaarli' => 'Shaarli', + 'share_name' => 'Nome condivisione', + 'share_url' => 'URL condivisione', + 'title' => 'Condividi', + 'twitter' => 'Twitter', + 'wallabag' => 'wallabag', + ), + 'shortcut' => array( + '_' => 'Comandi tastiera', + 'article_action' => 'Azioni sugli articoli', + 'auto_share' => 'Condividi', + 'auto_share_help' => 'Se è presente un solo servizio di condivisione verrà usato quello, altrimenti usare anche il numero associato.', + 'close_dropdown' => 'Chiudi menù', + 'collapse_article' => 'Collassa articoli', + 'first_article' => 'Salta al primo articolo', + 'focus_search' => 'Modulo di ricerca', + 'help' => 'Mostra documentazione', + 'javascript' => 'JavaScript deve essere abilitato per poter usare i comandi da tastiera', + 'last_article' => 'Salta all ultimo articolo', + 'load_more' => 'Carica altri articoli', + 'mark_read' => 'Segna come letto', + 'mark_favorite' => 'Segna come preferito', + 'navigation' => 'Navigazione', + 'navigation_help' => 'Con il tasto "Shift" i comandi di navigazione verranno applicati ai feeds.<br/>Con il tasto "Alt" i comandi di navigazione verranno applicati alle categorie.', + 'next_article' => 'Salta al contenuto successivo', + 'other_action' => 'Altre azioni', + 'previous_article' => 'Salta al contenuto precedente', + 'see_on_website' => 'Vai al sito fonte', + 'shift_for_all_read' => '+ <code>shift</code> 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.', + ), + 'user' => array( + 'articles_and_size' => '%s articoli (%s)', + 'current' => 'Utente connesso', + 'is_admin' => 'è amministratore', + 'users' => 'Utenti', + ), +); diff --git a/app/i18n/it/feedback.php b/app/i18n/it/feedback.php new file mode 100644 index 000000000..5851cb2e6 --- /dev/null +++ b/app/i18n/it/feedback.php @@ -0,0 +1,109 @@ +<?php + +return array( + 'admin' => array( + 'optimization_complete' => 'Ottimizzazione completata', + ), + 'access' => array( + 'denied' => 'Non hai i permessi per accedere a questa pagina', + 'not_found' => 'Pagina non disponibile', + ), + 'auth' => array( + 'form' => array( + 'not_set' => 'Si è verificato un problema alla configurazione del sistema di autenticazione. Per favore riprova più tardi.', + 'set' => 'Sistema di autenticazione tramite Form impostato come predefinito.', + ), + 'login' => array( + 'invalid' => 'Autenticazione non valida', + 'success' => 'Autenticazione effettuata', + ), + 'logout' => array( + 'success' => 'Disconnessione effettuata', + ), + 'no_password_set' => 'Password di amministrazione non impostata. Opzione non disponibile.', + ), + 'conf' => array( + 'error' => 'Si è verificato un errore durante il salvataggio della configurazione', + 'query_created' => 'Ricerca "%s" creata.', + 'shortcuts_updated' => 'Collegamenti tastiera aggiornati', + 'updated' => 'Configurazione aggiornata', + ), + 'extensions' => array( + 'already_enabled' => '%s è già abilitata', + 'disable' => array( + 'ko' => '%s non può essere disabilitata. <a href="%s">Verifica i logs</a> per dettagli.', + 'ok' => '%s è disabilitata', + ), + 'enable' => array( + 'ko' => '%s non può essere abilitata. <a href="%s">Verifica i logs</a> per dettagli.', + 'ok' => '%s è ora abilitata', + ), + 'no_access' => 'Accesso negato a %s', + 'not_enabled' => '%s non abilitato', + 'not_found' => '%s non disponibile', + ), + 'import_export' => array( + 'export_no_zip_extension' => 'Estensione ZIP non presente sul server. Per favore esporta i files singolarmente.', + 'feeds_imported' => 'I tuoi feed sono stati importati e saranno aggiornati', + 'feeds_imported_with_errors' => 'I tuoi feeds sono stati importati ma si sono verificati alcuni errori', + 'file_cannot_be_uploaded' => 'Il file non può essere caricato!', + 'no_zip_extension' => 'Estensione ZIP non presente sul server.', + 'zip_error' => 'Si è verificato un errore importando il file ZIP', + ), + 'sub' => array( + 'actualize' => 'Aggiorna', + 'category' => array( + 'created' => 'Categoria %s creata.', + 'deleted' => 'Categoria cancellata', + 'emptied' => 'Categoria svuotata', + 'error' => 'Categoria non aggiornata', + 'name_exists' => 'Categoria già esistente.', + 'no_id' => 'Categoria senza ID.', + 'no_name' => 'Il nome della categoria non può essere lasciato vuoto.', + 'not_delete_default' => 'Non puoi cancellare la categoria predefinita!', + 'not_exist' => 'La categoria non esite!', + 'over_max' => 'Hai raggiunto il numero limite di categorie (%d)', + 'updated' => 'Categoria aggiornata.', + ), + 'feed' => array( + 'actualized' => '<em>%s</em> aggiornato', + 'actualizeds' => 'RSS feeds aggiornati', + 'added' => 'RSS feed <em>%s</em> aggiunti', + 'already_subscribed' => 'Hai già sottoscritto <em>%s</em>', + 'deleted' => 'Feed cancellato', + 'error' => 'Feed non aggiornato', + 'internal_problem' => 'RSS feed non aggiunto. <a href="%s">Verifica i logs</a> per dettagli.', + 'invalid_url' => 'URL <em>%s</em> non valido', + 'marked_read' => 'Feeds segnati come letti', + 'n_actualized' => '%d feeds aggiornati', + 'n_entries_deleted' => '%d articoli cancellati', + 'no_refresh' => 'Nessun aggiornamento disponibile…', + 'not_added' => '<em>%s</em> non può essere aggiunto', + 'over_max' => 'Hai raggiunto il numero limite di feed (%d)', + 'updated' => 'Feed aggiornato', + ), + 'purge_completed' => 'Svecchiamento completato (%d articoli cancellati)', + ), + 'update' => array( + 'can_apply' => 'FreshRSS verrà aggiornato alla <strong>versione %s</strong>.', + 'error' => 'Il processo di aggiornamento ha riscontrato il seguente errore: %s', + 'file_is_nok' => 'Verifica i permessi della cartella <em>%s</em>. Il server HTTP deve avere i permessi per la scrittura ', + 'finished' => 'Aggiornamento completato con successo!', + 'none' => 'Nessun aggiornamento disponibile', + 'server_not_found' => 'Server per aggiornamento non disponibile. [%s]', + ), + 'user' => array( + 'created' => array( + '_' => 'Utente %s creato', + 'error' => 'Errore nella creazione utente %s ', + ), + 'deleted' => array( + '_' => 'Utente %s cancellato', + 'error' => 'Utente %s non cancellato', + ), + ), + 'profile' => array( + 'error' => 'Il tuo profilo non può essere modificato', + 'updated' => 'Il tuo profilo è stato modificato', + ), +); diff --git a/app/i18n/it/gen.php b/app/i18n/it/gen.php new file mode 100644 index 000000000..a9a8709d3 --- /dev/null +++ b/app/i18n/it/gen.php @@ -0,0 +1,182 @@ +<?php + +return array( + 'action' => array( + 'actualize' => 'Aggiorna', + 'back_to_rss_feeds' => '← Indietro', + 'cancel' => 'Annulla', + 'create' => 'Crea', + 'disable' => 'Disabilita', + 'empty' => 'Vuoto', + 'enable' => 'Abilita', + 'export' => 'Esporta', + 'filter' => 'Filtra', + 'import' => 'Importa', + 'manage' => 'Gestisci', + 'mark_read' => 'Segna come letto', + 'mark_favorite' => 'Segna come preferito', + 'remove' => 'Rimuovi', + 'see_website' => 'Vai al sito', + 'submit' => 'Conferma', + 'truncate' => 'Cancella tutti gli articoli', + ), + 'auth' => array( + 'email' => 'Indirizzo email', + 'keep_logged_in' => 'Ricorda i dati <small>(%s giorni)</small>', + 'login' => 'Accedi', + 'logout' => 'Esci', + 'password' => array( + '_' => 'Password', + 'format' => '<small>almeno 7 caratteri</small>', + ), + 'registration' => array( + '_' => 'Nuovo profilo', + 'ask' => 'Vuoi creare un nuovo profilo?', + 'title' => 'Creazione profilo', + ), + 'reset' => 'Reset autenticazione', + 'username' => array( + '_' => 'Username', + 'admin' => 'Username amministratore', + 'format' => '<small>massimo 16 caratteri alfanumerici</small>', + ), + ), + 'date' => array( + 'Apr' => '\\A\\p\\r\\i\\l\\e', + 'Aug' => '\\A\\g\\o\\s\\t\\o', + 'Dec' => '\\D\\i\\c\\e\\m\\b\\r\\e', + 'Feb' => '\\F\\e\\b\\b\\r\\a\\i\\o', + 'Jan' => '\\G\\e\\n\\u\\a\\i\\o', + 'Jul' => '\\L\\u\\g\\l\\i\\o', + 'Jun' => '\\G\\i\\u\\g\\n\\o', + 'Mar' => '\\M\\a\\r\\z\\o', + 'May' => '\\M\\a\\g\\g\\i\\o', + 'Nov' => '\\N\\o\\v\\e\\m\\b\\r\\e', + 'Oct' => '\\O\\t\\t\\o\\b\\r\\e', + 'Sep' => '\\S\\e\\t\\t\\e\\m\\b\\r\\e', + 'apr' => 'apr', + 'april' => 'Apr', + 'aug' => 'aug', + 'august' => 'Aug', + 'before_yesterday' => 'Meno recenti', + 'dec' => 'dec', + 'december' => 'Dec', + 'feb' => 'feb', + 'february' => 'Feb', + 'format_date' => 'j\\ %s Y', + 'format_date_hour' => 'j\\ %s Y \\o\\r\\e H\\:i', + 'fri' => 'Fri', + 'jan' => 'jan', + 'january' => 'Jan', + 'jul' => 'jul', + 'july' => 'Jul', + 'jun' => 'jun', + 'june' => 'Jun', + 'last_3_month' => 'Ultimi 3 mesi', + 'last_6_month' => 'Ultimi 6 mesi', + 'last_month' => 'Ultimo mese', + 'last_week' => 'Ultima settimana', + 'last_year' => 'Ultimo anno', + 'mar' => 'mar', + 'march' => 'Mar', + 'may' => 'May', + 'mon' => 'Mon', + 'month' => 'mesi', + 'nov' => 'nov', + 'november' => 'Nov', + 'oct' => 'oct', + 'october' => 'Oct', + 'sat' => 'Sat', + 'sep' => 'sep', + 'september' => 'Sep', + 'sun' => 'Sun', + 'thu' => 'Thu', + 'today' => 'Oggi', + 'tue' => 'Tue', + 'wed' => 'Wed', + 'yesterday' => 'Ieri', + ), + 'freshrss' => array( + '_' => 'Feed RSS Reader', + 'about' => 'Informazioni', + ), + 'js' => array( + 'category_empty' => 'Categoria vuota', + 'confirm_action' => 'Sei sicuro di voler continuare?', + 'confirm_action_feed_cat' => 'Sei sicuro di voler continuare? Verranno persi i preferiti e le ricerche utente correlate!', + 'feedback' => array( + 'body_new_articles' => 'Ci sono %%d nuovi articoli da leggere.', + 'request_failed' => 'Richiesta fallita, probabilmente a causa di problemi di connessione', + 'title_new_articles' => 'Feed RSS Reader: nuovi articoli!', + ), + 'new_article' => 'Sono disponibili nuovi articoli, clicca qui per caricarli.', + 'should_be_activated' => 'JavaScript deve essere abilitato', + ), + 'lang' => array( + 'cz' => 'Čeština', + 'de' => 'Deutsch', + 'en' => 'English', + 'fr' => 'Français', + 'it' => 'Italiano', + 'nl' => 'Nederlands', + 'ru' => 'Русский', + 'tr' => 'Türkçe', + ), + 'menu' => array( + 'about' => 'Informazioni', + 'admin' => 'Amministrazione', + 'archiving' => 'Archiviazione', + 'authentication' => 'Autenticazione', + 'check_install' => 'Installazione', + 'configuration' => 'Configurazione', + 'display' => 'Visualizzazione', + 'extensions' => 'Estensioni', + 'logs' => 'Logs', + 'queries' => 'Ricerche personali', + 'reading' => 'Lettura', + 'search' => 'Ricerca parole o #tags', + 'sharing' => 'Condivisione', + 'shortcuts' => 'Comandi tastiera', + 'stats' => 'Statistiche', + 'system' => 'Configurazione sistema', + 'update' => 'Aggiornamento', + 'user_management' => 'Gestione utenti', + 'user_profile' => 'Profilo', + ), + 'pagination' => array( + 'first' => 'Prima', + 'last' => 'Ultima', + 'load_more' => 'Carica altri articoli', + 'mark_all_read' => 'Segna tutto come letto', + 'next' => 'Successiva', + 'nothing_to_load' => 'Non ci sono altri articoli', + 'previous' => 'Precedente', + ), + 'share' => array( + 'blogotext' => 'Blogotext', + 'diaspora' => 'Diaspora*', + 'email' => 'Email', + 'facebook' => 'Facebook', + 'g+' => 'Google+', + 'movim' => 'Movim', + 'print' => 'Stampa', + 'shaarli' => 'Shaarli', + 'twitter' => 'Twitter', + 'wallabag' => 'wallabag v1', + 'wallabagv2' => 'wallabag v2', + 'jdh' => 'Journal du hacker', + ), + 'short' => array( + 'attention' => 'Attenzione!', + 'blank_to_disable' => 'Lascia vuoto per disabilitare', + 'by_author' => 'di <em>%s</em>', + 'by_default' => 'predefinito', + 'damn' => 'Ops!', + 'default_category' => 'Senza categoria', + 'no' => 'No', + 'not_applicable' => 'Non disponibile', + 'ok' => 'OK!', + 'or' => 'o', + 'yes' => 'Si', + ), +); diff --git a/app/i18n/it/index.php b/app/i18n/it/index.php new file mode 100644 index 000000000..d79502c79 --- /dev/null +++ b/app/i18n/it/index.php @@ -0,0 +1,61 @@ +<?php + +return array( + 'about' => array( + '_' => 'Informazioni', + 'agpl3' => '<a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL 3</a>', + 'bugs_reports' => 'Bugs', + 'credits' => 'Crediti', + 'credits_content' => 'Alcuni elementi di design provengono da <a href="http://twitter.github.io/bootstrap/">Bootstrap</a> sebbene FreshRSS non usi questo framework. Le <a href="https://git.gnome.org/browse/gnome-icon-theme-symbolic">icone</a> provengono dal progetto <a href="https://www.gnome.org/">GNOME</a>. Il carattere <em>Open Sans</em> è stato creato da <a href="https://fonts.google.com/specimen/Open+Sans">Steve Matteson</a>. FreshRSS è basato su <a href="https://github.com/marienfressinaud/MINZ">Minz</a>, un framework PHP.', + 'freshrss_description' => 'FreshRSS è un aggregatore di feeds RSS da installare sul proprio host come <a href="http://tontof.net/kriss/feed/">Kriss Feed</a> o <a href="http://projet.idleman.fr/leed/">Leed</a>. Leggero e facile da mantenere pur essendo molto configurabile e potente.', + 'github' => '<a href="https://github.com/FreshRSS/FreshRSS/issues">su Github</a>', + 'license' => 'Licenza', + 'project_website' => 'Sito del progetto', + 'title' => 'Informazioni', + 'version' => 'Versione', + 'website' => 'Sito', + ), + 'feed' => array( + 'add' => 'Aggiungi un Feed RSS', + 'empty' => 'Non ci sono articoli da mostrare.', + 'rss_of' => 'RSS feed di %s', + 'title' => 'RSS feeds', + 'title_global' => 'Vista globale per categorie', + 'title_fav' => 'Preferiti', + ), + 'log' => array( + '_' => 'Logs', + 'clear' => 'Svuota logs', + 'empty' => 'File di log vuoto', + 'title' => 'Logs', + ), + 'menu' => array( + 'about' => 'Informazioni', + 'add_query' => 'Aggiungi ricerca', + 'before_one_day' => 'Giorno precedente', + 'before_one_week' => 'Settimana precedente', + 'favorites' => 'Preferiti (%s)', + 'global_view' => 'Vista globale per categorie', + 'main_stream' => 'Flusso principale', + 'mark_all_read' => 'Segna tutto come letto', + 'mark_cat_read' => 'Segna la categoria come letta', + 'mark_feed_read' => 'Segna il feed come letto', + 'newer_first' => 'Mostra prima i recenti', + 'non-starred' => 'Escludi preferiti', + 'normal_view' => 'Vista elenco', + 'older_first' => 'Ordina per meno recenti', + 'queries' => 'Chiavi di ricerca', + 'read' => 'Mostra solo letti', + 'reader_view' => 'Modalità di lettura', + 'rss_view' => 'RSS feed', + 'search_short' => 'Cerca', + 'starred' => 'Mostra solo preferiti', + 'stats' => 'Statistiche', + 'subscription' => 'Gestione sottoscrizioni', + 'unread' => 'Mostra solo non letti', + ), + 'share' => 'Condividi', + 'tag' => array( + 'related' => 'Tags correlati', + ), +); diff --git a/app/i18n/it/install.php b/app/i18n/it/install.php new file mode 100644 index 000000000..18f8cc337 --- /dev/null +++ b/app/i18n/it/install.php @@ -0,0 +1,120 @@ +<?php + +return array( + 'action' => array( + 'finish' => 'Installazione completata', + 'fix_errors_before' => 'Per favore correggi gli errori prima di passare al passaggio successivo.', + 'keep_install' => 'Mantieni configurazione precedente', + 'next_step' => 'Vai al prossimo passaggio', + 'reinstall' => 'Reinstalla FreshRSS', + ), + 'auth' => array( + 'form' => 'Web form (tradizionale, richiede JavaScript)', + 'http' => 'HTTP (per gli utenti avanzati con HTTPS)', + 'none' => 'Nessuno (pericoloso)', + 'password_form' => 'Password<br /><small>(per il login tramite Web-form tradizionale)</small>', + 'password_format' => 'Almeno 7 caratteri', + 'type' => 'Metodo di autenticazione', + ), + 'bdd' => array( + '_' => 'Database', + 'conf' => array( + '_' => 'Configurazione database', + 'ko' => 'Verifica le informazioni del database.', + 'ok' => 'Le configurazioni del database sono state salvate.', + ), + 'host' => 'Host', + 'prefix' => 'Prefisso tabella', + 'password' => 'Password del database', + 'type' => 'Tipo di database', + 'username' => 'Nome utente del database', + ), + 'check' => array( + '_' => 'Controlli', + 'already_installed' => 'FreshRSS risulta già installato!', + 'cache' => array( + 'nok' => 'Verifica i permessi sulla cartella <em>./data/cache</em>. Il server HTTP deve avere i permessi per scriverci dentro', + 'ok' => 'I permessi sulla cartella della cache sono corretti.', + ), + 'ctype' => array( + 'nok' => 'Manca una libreria richiesta per il controllo dei caratteri (php-ctype).', + 'ok' => 'Libreria richiesta per il controllo dei caratteri presente (ctype).', + ), + 'curl' => array( + 'nok' => 'Manca il supporto per cURL (pacchetto php-curl).', + 'ok' => 'Estensione cURL presente.', + ), + 'data' => array( + 'nok' => 'Verifica i permessi sulla cartella <em>./data</em>. Il server HTTP deve avere i permessi per scriverci dentro', + 'ok' => 'I permessi sulla cartella data sono corretti.', + ), + 'dom' => array( + 'nok' => 'Manca una libreria richiesta per leggere DOM.', + 'ok' => 'Libreria richiesta per leggere DOM presente.', + ), + 'favicons' => array( + 'nok' => 'Verifica i permessi sulla cartella <em>./data/favicons</em>. Il server HTTP deve avere i permessi per scriverci dentro', + 'ok' => 'I permessi sulla cartella favicons sono corretti.', + ), + 'fileinfo' => array( + 'nok' => 'Manca il supporto per PHP fileinfo (pacchetto fileinfo).', + 'ok' => 'Estensione fileinfo presente.', + ), + 'http_referer' => array( + 'nok' => 'Per favore verifica che non stai alterando il tuo HTTP REFERER.', + 'ok' => 'Il tuo HTTP REFERER riconosciuto corrisponde al tuo server.', + ), + 'json' => array( + 'nok' => 'You lack a recommended library to parse JSON.', + 'ok' => 'You have a recommended library to parse JSON.', + ), + 'minz' => array( + 'nok' => 'Manca il framework Minz.', + 'ok' => 'Framework Minz presente.', + ), + 'pcre' => array( + 'nok' => 'Manca una libreria richiesta per le regular expressions (php-pcre).', + 'ok' => 'Libreria richiesta per le regular expressions presente (PCRE).', + ), + 'pdo' => array( + 'nok' => 'Manca PDO o uno degli altri driver supportati (pdo_mysql, pdo_sqlite, pdo_pgsql).', + 'ok' => 'PDO e altri driver supportati (pdo_mysql, pdo_sqlite, pdo_pgsql).', + ), + 'php' => array( + '_' => 'Installazione PHP', + 'nok' => 'Versione di PHP %s FreshRSS richiede almeno la versione %s.', + 'ok' => 'Versione di PHP %s, compatibile con FreshRSS.', + ), + 'users' => array( + 'nok' => 'Verifica i permessi sulla cartella <em>./data/users</em>. Il server HTTP deve avere i permessi per scriverci dentro', + 'ok' => 'I permessi sulla cartella users sono corretti.', + ), + 'xml' => array( + 'nok' => 'You lack the required library to parse XML.', + 'ok' => 'You have the required library to parse XML.', + ), + ), + 'conf' => array( + '_' => 'Configurazioni generali', + 'ok' => 'Configurazioni generali salvate.', + ), + 'congratulations' => 'Congratulazione!', + 'default_user' => 'Username utente predefinito <small>(massimo 16 caratteri alfanumerici)</small>', + 'delete_articles_after' => 'Rimuovi articoli dopo', + 'fix_errors_before' => 'Per favore correggi gli errori prima di passare al passaggio successivo.', + 'javascript_is_better' => 'FreshRSS funziona meglio con JavaScript abilitato', + 'js' => array( + 'confirm_reinstall' => 'Reinstallando FreshRSS perderai la configurazione precedente. Sei sicuro di voler procedere?', + ), + 'language' => array( + '_' => 'Lingua', + 'choose' => 'Seleziona la lingua per FreshRSS', + 'defined' => 'Lingua impostata.', + ), + 'not_deleted' => 'Qualcosa non ha funzionato; devi cancellare il file <em>%s</em> manualmente.', + 'ok' => 'Processo di installazione terminato con successo.', + 'step' => 'Passaggio %d', + 'steps' => 'Passaggi', + 'title' => 'Installazione · FreshRSS', + 'this_is_the_end' => 'Fine', +); diff --git a/app/i18n/it/sub.php b/app/i18n/it/sub.php new file mode 100644 index 000000000..758e322c5 --- /dev/null +++ b/app/i18n/it/sub.php @@ -0,0 +1,62 @@ +<?php + +return array( + 'category' => array( + '_' => 'Categoria', + 'add' => 'Aggiungi una categoria', + 'empty' => 'Categoria vuota', + 'new' => 'Nuova categoria', + ), + 'feed' => array( + 'add' => 'Aggiungi un Feed RSS', + 'advanced' => 'Avanzate', + 'archiving' => 'Archiviazione', + 'auth' => array( + 'configuration' => 'Autenticazione', + 'help' => 'Accesso per feeds protetti', + 'http' => 'Autenticazione HTTP', + 'password' => 'HTTP password', + 'username' => 'HTTP username', + ), + 'css_help' => 'In caso di RSS feeds troncati (attenzione, richiede molto tempo!)', + 'css_path' => 'Percorso del foglio di stile CSS del sito di origine', + '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 <em>%s</em>.', + 'no_selected' => 'Nessun feed selezionato.', + 'number_entries' => '%d articoli', + 'stats' => 'Statistiche', + 'think_to_add' => 'Aggiungi feed.', + 'title' => 'Titolo', + 'title_add' => 'Aggiungi RSS feed', + 'ttl' => 'Non aggiornare automaticamente piu di', + 'url' => 'Feed URL', + 'validator' => 'Controlla la validita del feed ', + 'website' => 'URL del sito', + 'pubsubhubbub' => 'Notifica istantanea con PubSubHubbub', + ), + 'import_export' => array( + 'export' => 'Esporta', + 'export_opml' => 'Esporta tutta la lista dei feed (OPML)', + 'export_starred' => 'Esporta i tuoi preferiti', + 'feed_list' => 'Elenco di %s articoli', + 'file_to_import' => 'File da importare<br />(OPML, JSON o ZIP)', + 'file_to_import_no_zip' => 'File da importare<br />(OPML o JSON)', + 'import' => 'Importa', + 'starred_list' => 'Elenco articoli preferiti', + 'title' => 'Importa / esporta', + ), + 'menu' => array( + 'bookmark' => 'Bookmark (trascina nei preferiti)', + 'import_export' => 'Importa / esporta', + 'subscription_management' => 'Gestione sottoscrizioni', + ), + 'title' => array( + '_' => 'Gestione sottoscrizioni', + 'feed_management' => 'Gestione RSS feeds', + ), +); diff --git a/app/i18n/nl/admin.php b/app/i18n/nl/admin.php new file mode 100644 index 000000000..607fb1892 --- /dev/null +++ b/app/i18n/nl/admin.php @@ -0,0 +1,186 @@ +<?php +/* Dutch translation by Wanabo. http://www.nieuwskop.be */ +return array( + 'auth' => array( + 'allow_anonymous' => 'Sta bezoekers toe om artikelen te lezen van de standaard gebruiker (%s)', + 'allow_anonymous_refresh' => 'Sta bezoekers toe om de artikelen te vernieuwen', + 'api_enabled' => 'Sta <abbr>API</abbr> toegang toe <small>(nodig voor mobiele apps)</small>', + 'form' => 'Web formulier (traditioneel, benodigd JavaScript)', + 'http' => 'HTTP (voor geavanceerde gebruikers met HTTPS)', + 'none' => 'Geen (gevaarlijk)', + 'title' => 'Authenticatie', + 'title_reset' => 'Authenticatie terugzetten', + 'token' => 'Authenticatie teken', + 'token_help' => 'Sta toegang toe tot de RSS uitvoer van de standaard gebruiker zonder authenticatie:', + 'type' => 'Authenticatie methode', + 'unsafe_autologin' => 'Sta onveilige automatische log in toe met het volgende formaat: ', + ), + 'check_install' => array( + 'cache' => array( + 'nok' => 'Controleer de permissies van de <em>./data/cache</em> map. HTTP server moet rechten hebben om hierin te schrijven', + 'ok' => 'Permissies van de cache map zijn goed.', + ), + 'categories' => array( + 'nok' => 'Categorie tabel is slecht geconfigureerd.', + 'ok' => 'Categorie tabel is ok.', + ), + 'connection' => array( + 'nok' => 'Verbinding met de database kan niet worden gemaakt.', + 'ok' => 'Verbinding met de database is ok.', + ), + 'ctype' => array( + 'nok' => 'U mist de benodigde bibliotheek voor character type checking (php-ctype).', + 'ok' => 'U hebt de benodigde bibliotheek voor character type checking (ctype).', + ), + 'curl' => array( + 'nok' => 'U mist de cURL (php-curl package).', + 'ok' => 'U hebt de cURL uitbreiding.', + ), + 'data' => array( + 'nok' => 'Controleer de permissies op de <em>./data</em> map. HTTP server moet rechten hebben om hierin te schrijven', + 'ok' => 'Permissies op de data map zijn goed.', + ), + 'database' => 'Database installatie', + 'dom' => array( + 'nok' => 'U mist de benodigde bibliotheek voor het bladeren van DOM (php-xml package).', + 'ok' => 'U hebt de benodigde bibliotheek voor het bladeren van DOM.', + ), + 'entries' => array( + 'nok' => 'Invoer tabel is slecht geconfigureerd.', + 'ok' => 'Invoer tabel is ok.', + ), + 'favicons' => array( + 'nok' => 'Controleer de permissies op de <em>./data/favicons</em> map. HTTP server moet rechten hebben om hierin te schrijven', + 'ok' => 'Permissies op de favicons map zijn goed.', + ), + 'feeds' => array( + 'nok' => 'Feed tabel is slecht geconfigureerd.', + 'ok' => 'Feed tabel is ok.', + ), + 'fileinfo' => array( + 'nok' => 'U mist de PHP fileinfo (fileinfo package).', + 'ok' => 'U hebt de fileinfo uitbreiding.', + ), + 'files' => 'Bestanden installatie', + 'json' => array( + 'nok' => 'U mist JSON (php5-json package).', + 'ok' => 'U hebt JSON uitbreiding.', + ), + 'minz' => array( + 'nok' => 'U mist Minz framework.', + 'ok' => 'U hebt Minz framework.', + ), + 'pcre' => array( + 'nok' => 'U mist de benodigde bibliotheek voor regular expressions (php-pcre).', + 'ok' => 'U hebt de benodigde bibliotheek voor regular expressions (PCRE).', + ), + 'pdo' => array( + 'nok' => 'U mist PDO of een van de ondersteunde drivers (pdo_mysql, pdo_sqlite, pdo_pgsql).', + 'ok' => 'U hebt PDO en ten minste één van de ondersteunde drivers (pdo_mysql, pdo_sqlite, pdo_pgsql).', + ), + 'php' => array( + '_' => 'PHP installatie', + 'nok' => 'Uw PHP versie is %s maar FreshRSS benodigd tenminste versie %s.', + 'ok' => 'Uw PHP versie is %s, welke compatibel is met FreshRSS.', + ), + 'tables' => array( + 'nok' => 'Er zijn één of meer ontbrekende tabellen in de database.', + 'ok' => 'Alle tabellen zijn aanwezig in de database.', + ), + 'title' => 'Installatie controle', + 'tokens' => array( + 'nok' => 'Controleer de permissies op de <em>./data/tokens</em> map. HTTP server moet rechten hebben om hierin te schrijven', + 'ok' => 'Permissies op de tokens map zijn goed.', + ), + 'users' => array( + 'nok' => 'Controleer de permissies op de <em>./data/users</em> map. HTTP server moet rechten hebben om hierin te schrijven', + 'ok' => 'Permissies op de users map zijn goed.', + ), + 'zip' => array( + 'nok' => 'U mist ZIP uitbreiding (php-zip package).', + 'ok' => 'U hebt ZIP uitbreiding.', + ), + ), + 'extensions' => array( + 'disabled' => 'Uitgeschakeld', + 'empty_list' => 'Er zijn geïnstalleerde uitbreidingen', + 'enabled' => 'Ingeschakeld', + 'no_configure_view' => 'Deze uitbreiding kan niet worden geconfigureerd.', + 'system' => array( + '_' => 'Systeem uitbreidingen', + 'no_rights' => 'Systeem uitbreidingen (U hebt hier geen rechten op)', + ), + 'title' => 'Uitbreidingen', + 'user' => 'Gebruikers uitbreidingen', + ), + 'stats' => array( + '_' => 'Statistieken', + 'all_feeds' => 'Alle feeds', + 'category' => 'Categorie', + 'entry_count' => 'Invoer aantallen', + 'entry_per_category' => 'Aantallen per categorie', + 'entry_per_day' => 'Aantallen per dag (laatste 30 dagen)', + 'entry_per_day_of_week' => 'Per dag of week (gemiddeld: %.2f berichten)', + 'entry_per_hour' => 'Per uur (gemiddeld: %.2f berichten)', + 'entry_per_month' => 'Per maand (gemiddeld: %.2f berichten)', + 'entry_repartition' => 'Invoer verdeling', + 'feed' => 'Feed', + 'feed_per_category' => 'Feeds per categorie', + 'idle' => 'Gepauzeerde feeds', + 'main' => 'Hoofd statistieken', + 'main_stream' => 'Overzicht', + 'menu' => array( + 'idle' => 'Gepauzeerde feeds', + 'main' => 'Hoofd statistieken', + 'repartition' => 'Artikelen verdeling', + ), + 'no_idle' => 'Er is geen gepauzeerde feed!', + 'number_entries' => '%d artikelen', + 'percent_of_total' => '%% van totaal', + 'repartition' => 'Artikelen verdeling', + 'status_favorites' => 'Favorieten', + 'status_read' => 'Gelezen', + 'status_total' => 'Totaal', + 'status_unread' => 'Ongelezen', + 'title' => 'Statistieken', + 'top_feed' => 'Top tien feeds', + ), + 'system' => array( + '_' => 'Systeem configuratie', + 'auto-update-url' => 'Automatische update server URL', + 'instance-name' => 'Voorbeeld naam', + 'max-categories' => 'Categoriën limiet per gebruiker', + 'max-feeds' => 'Feed limiet per gebruiker', + 'registration' => array( + 'help' => '0 betekent geen account limiet', + 'number' => 'Maximum aantal accounts', + ), + ), + 'update' => array( + '_' => 'Versie controle', + 'apply' => 'Toepassen', + 'check' => 'Controleer op nieuwe versies', + 'current_version' => 'Uw huidige versie van FreshRSS is %s.', + 'last' => 'Laatste controle: %s', + 'none' => 'Geen nieuwe versie om toe te passen', + 'title' => 'Vernieuw systeem', + ), + 'user' => array( + 'articles_and_size' => '%s artikelen (%s)', + 'create' => 'Creëer nieuwe gebruiker', + 'language' => 'Taal', + 'number' => 'Er is %d accounts gemaakt', + 'numbers' => 'Er zijn %d accounts gemaakt', + 'password_form' => 'Wachtwoord<br /><small>(voor de Web-formulier log in methode)</small>', + 'password_format' => 'Ten minste 7 tekens', + 'registration' => array( + 'allow' => 'Sta het maken van nieuwe accounts toe', + 'help' => '0 betekent dat er geen account limiet is', + 'number' => 'Max aantal accounts', + ), + 'title' => 'Beheer gebruikers', + 'user_list' => 'Lijst van gebruikers ', + 'username' => 'Gebruikers naam', + 'users' => 'Gebruikers', + ), +); diff --git a/app/i18n/nl/conf.php b/app/i18n/nl/conf.php new file mode 100644 index 000000000..573dabf45 --- /dev/null +++ b/app/i18n/nl/conf.php @@ -0,0 +1,173 @@ +<?php +/* Dutch translation by Wanabo. http://www.nieuwskop.be */ +return array( + 'archiving' => array( + '_' => 'Archivering', + 'advanced' => 'Geavanceerd', + 'delete_after' => 'Verwijder artikelen na', + 'help' => 'Meer opties zijn beschikbaar in de persoonlijke stroom instellingen', + 'keep_history_by_feed' => 'Minimum aantal te behouden artikelen in de feed', + 'optimize' => 'Optimaliseer database', + 'optimize_help' => 'Doe dit zo af en toe om de omvang van de database te verkleinen', + 'purge_now' => 'Schoon nu op', + 'title' => 'Archivering', + 'ttl' => 'Vernieuw niet automatisch meer dan', + ), + 'display' => array( + '_' => 'Opmaak', + 'icon' => array( + 'bottom_line' => 'Onderaan', + 'entry' => 'Artikel pictogrammen', + 'publication_date' => 'Publicatie datum', + 'related_tags' => 'Gerelateerde labels', + 'sharing' => 'Delen', + 'top_line' => 'Bovenaan', + ), + 'language' => 'Taal', + 'notif_html5' => array( + 'seconds' => 'seconden (0 betekent geen stop)', + 'timeout' => 'HTML5 notificatie stop', + ), + 'theme' => 'Thema', + 'title' => 'Opmaak', + 'width' => array( + 'content' => 'Inhoud breedte', + 'large' => 'Breed', + 'medium' => 'Normaal', + 'no_limit' => 'Geen limiet', + 'thin' => 'Smal', + ), + ), + 'query' => array( + '_' => 'Gebruikers queries (informatie aanvragen)', + 'deprecated' => 'Deze query (informatie aanvraag) is niet langer geldig. De bedoelde categorie of feed is al verwijderd.', + 'filter' => 'Filter toegepast:', + 'get_all' => 'Toon alle artikelen', + 'get_category' => 'Toon "%s" categorie', + 'get_favorite' => 'Toon favoriete artikelen', + 'get_feed' => 'Toon "%s" feed', + 'no_filter' => 'Geen filter', + 'none' => 'U hebt nog geen gebruikers query aangemaakt..', + 'number' => 'Query n°%d', + 'order_asc' => 'Toon oudste artikelen eerst', + 'order_desc' => 'Toon nieuwste artikelen eerst', + 'search' => 'Zoek naar "%s"', + 'state_0' => 'Toon alle artikelen', + 'state_1' => 'Toon gelezen artikelen', + 'state_2' => 'Toon ongelezen artikelen', + 'state_3' => 'Toon alle artikelen', + 'state_4' => 'Toon favoriete artikelen', + 'state_5' => 'Toon gelezen favoriete artikelen', + 'state_6' => 'Toon ongelezen favoriete artikelen', + 'state_7' => 'Toon favoriete artikelen', + 'state_8' => 'Toon niet favoriete artikelen', + 'state_9' => 'Toon gelezen niet favoriete artikelen', + 'state_10' => 'Toon ongelezen niet favoriete artikelen', + 'state_11' => 'Toon niet favoriete artikelen', + 'state_12' => 'Toon alle artikelen', + 'state_13' => 'Toon gelezen artikelen', + 'state_14' => 'Toon ongelezen artikelen', + 'state_15' => 'Toon alle artikelen', + 'title' => 'Gebruikers queries', + ), + 'profile' => array( + '_' => 'Profiel beheer', + 'delete' => array( + '_' => 'Account verwijderen', + 'warn' => 'Uw account en alle gerelateerde gegvens worden verwijderd.', + ), + 'password_api' => 'Wachtwoord API<br /><small>(e.g., voor mobiele apps)</small>', + 'password_form' => 'Wachtwoord<br /><small>(voor de Web-formulier log in methode)</small>', + 'password_format' => 'Ten minste 7 tekens', + 'title' => 'Profiel', + ), + 'reading' => array( + '_' => 'Lezen', + 'after_onread' => 'Na “markeer alles als gelezen”,', + 'articles_per_page' => 'Aantal artikelen per pagina', + 'auto_load_more' => 'Laad volgende artikel onderaan de pagina', + 'auto_remove_article' => 'Verberg artikel na lezen', + 'confirm_enabled' => 'Toon een bevestigings dialoog op “markeer alles als gelezen” acties', + 'display_articles_unfolded' => 'Toon artikelen uitgeklapt als standaard', + 'display_categories_unfolded' => 'Toon categoriën ingeklapt als standaard', + 'hide_read_feeds' => 'Verberg categoriën en feeds zonder ongelezen artikelen (werkt niet met “Toon alle artikelen” configuratie)', + 'img_with_lazyload' => 'Gebruik "lazy load" methode om afbeeldingen te laden', + 'jump_next' => 'Ga naar volgende ongelezen (feed of categorie)', + 'mark_updated_article_unread' => 'Markeer vernieuwd artikel als ongelezen', + 'number_divided_when_reader' => 'Gedeeld door 2 in de lees modus.', + 'read' => array( + 'article_open_on_website' => 'Als het artikel is geopend op de originele website', + 'article_viewed' => 'Als het artikel is bekeken', + 'scroll' => 'Tijdens scrollen', + 'upon_reception' => 'Tijdens ontvangst van het artikel', + 'when' => 'Markeer artikel als gelezen…', + ), + 'show' => array( + '_' => 'Artikelen om te tonen', + 'adaptive' => 'Pas weergave aan', + 'all_articles' => 'Bekijk alle artikelen', + 'unread' => 'Bekijk alleen ongelezen', + ), + 'sort' => array( + '_' => 'Sorteer volgorde', + 'newer_first' => 'Nieuwste eerst', + 'older_first' => 'Oudste eerst', + ), + 'sticky_post' => 'Koppel artikel aan de bovenkant als het geopend wordt', + 'title' => 'Lees modus', + 'view' => array( + 'default' => 'Standaard weergave', + 'global' => 'Globale weergave', + 'normal' => 'Normale weergave', + 'reader' => 'Lees weergave', + ), + ), + 'sharing' => array( + '_' => 'Delen', + 'blogotext' => 'Blogotext', + 'diaspora' => 'Diaspora*', + 'email' => 'Email', + 'facebook' => 'Facebook', + 'g+' => 'Google+', + 'more_information' => 'Meer informatie', + 'print' => 'Afdrukken', + 'shaarli' => 'Shaarli', + 'share_name' => 'Gedeelde naam om weer te geven', + 'share_url' => 'Deel URL voor gebruik', + 'title' => 'Delen', + 'twitter' => 'Twitter', + 'wallabag' => 'wallabag', + ), + 'shortcut' => array( + '_' => 'Shortcuts', + 'article_action' => 'Artikel acties', + 'auto_share' => 'Delen', + 'auto_share_help' => 'Als er slechts één deel methode i, dan wordt deze gebruikt. Anders zijn ze toegankelijk met hun nummer.', + 'close_dropdown' => 'Sluit menu', + 'collapse_article' => 'Inklappen', + 'first_article' => 'Spring naar eerste artikel', + 'focus_search' => 'Toegang zoek venster', + 'help' => 'Toon documentatie', + 'javascript' => 'JavaScript moet geactiveerd zijn om verwijzingen te gebruiken', + 'last_article' => 'Spring naar laatste artikel', + 'load_more' => 'Laad meer artikelen', + 'mark_read' => 'Markeer als gelezen', + 'mark_favorite' => 'Markeer als favoriet', + 'navigation' => 'Navigatie', + 'navigation_help' => 'Met de "Shift" toets, kunt u navigatie verwijzingen voor feeds gebruiken.<br/>Met de "Alt" toets, kunt u navigatie verwijzingen voor categoriën gebruiken.', + 'next_article' => 'Spring naar volgende artikel', + 'other_action' => 'Andere acties', + 'previous_article' => 'Spring naar vorige artikel', + 'see_on_website' => 'Bekijk op originale website', + 'shift_for_all_read' => '+ <code>shift</code> 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.', + ), + 'user' => array( + 'articles_and_size' => '%s artikelen (%s)', + 'current' => 'Huidige gebruiker', + 'is_admin' => 'is administrateur', + 'users' => 'Gebruikers', + ), +); diff --git a/app/i18n/nl/feedback.php b/app/i18n/nl/feedback.php new file mode 100644 index 000000000..386b8d415 --- /dev/null +++ b/app/i18n/nl/feedback.php @@ -0,0 +1,110 @@ +<?php +/* Dutch translation by Wanabo. http://www.nieuwskop.be */ +return array( + 'admin' => array( + 'optimization_complete' => 'Optimalisatie compleet', + ), + 'access' => array( + 'denied' => 'U hebt geen rechten om deze pagina te bekijken.', + 'not_found' => 'Deze pagina bestaat niet', + ), + 'auth' => array( + 'form' => array( + 'not_set' => 'Een probleem is opgetreden tijdens de controle van de systeem configuratie. Probeer het later nog eens.', + 'set' => 'Formulier is nu uw standaard authenticatie systeem.', + ), + 'login' => array( + 'invalid' => 'Log in is ongeldig', + 'success' => 'U bent ingelogd', + ), + 'logout' => array( + 'success' => 'U bent uitgelogd', + ), + 'no_password_set' => 'Administrateur wachtwoord is niet ingesteld. Deze mogelijkheid is niet beschikbaar.', + ), + 'conf' => array( + 'error' => 'Er is een fout opgetreden tijdens het opslaan van de configuratie', + 'query_created' => 'Query "%s" is gemaakt.', + 'shortcuts_updated' => 'Verwijzingen zijn vernieuwd', + 'updated' => 'Configuratie is vernieuwd', + ), + 'extensions' => array( + 'already_enabled' => '%s is al ingeschakeld', + 'disable' => array( + 'ko' => '%s kan niet worden uitgeschakeld. <a href="%s">Controleer FressRSS log bestanden</a> voor details.', + 'ok' => '%s is nu uitgeschakeld', + ), + 'enable' => array( + 'ko' => '%s kan niet worden ingeschakeld. <a href="%s">Controleer FressRSS log bestanden</a> voor details.', + 'ok' => '%s is nn ingeschakeld', + ), + 'no_access' => 'U hebt geen toegang voor %s', + 'not_enabled' => '%s is nog niet ingeschakeld', + 'not_found' => '%s bestaat niet', + ), + 'import_export' => array( + 'export_no_zip_extension' => 'ZIP uitbreiding is niet aanwezig op uw server. Exporteer a.u.b. uw bestanden één voor één.', + 'feeds_imported' => 'Uw feeds zijn geimporteerd en worden nu vernieuwd', + 'feeds_imported_with_errors' => 'Uw feeds zijn geimporteerd maar er zijn enige fouten opgetreden', + 'file_cannot_be_uploaded' => 'Bestand kan niet worden verzonden!', + 'no_zip_extension' => 'ZIP uitbreiding is niet aanwezig op uw server.', + 'zip_error' => 'Er is een fout opgetreden tijdens het imporeren van het ZIP bestand.', + ), + 'sub' => array( + 'actualize' => 'Actualiseren', + 'category' => array( + 'created' => 'Categorie %s is gemaakt.', + 'deleted' => 'Categorie is verwijderd.', + 'emptied' => 'Categorie is leeg gemaakt', + 'error' => 'Categorie kan niet worden vernieuwd', + 'name_exists' => 'Categorie naam bestaat al.', + 'no_id' => 'U moet de id specificeren of de categorie.', + 'no_name' => 'Categorie naam mag niet leeg zijn.', + 'not_delete_default' => 'U kunt de standaard categorie niet verwijderen!', + 'not_exist' => 'De categorie bestaat niet!', + 'over_max' => 'U hebt het maximale aantal categoriën bereikt (%d)', + 'updated' => 'Categorie is vernieuwd.', + ), + 'feed' => array( + 'actualized' => '<em>%s</em> is vernieuwd', + 'actualizeds' => 'RSS feeds zijn vernieuwd', + 'added' => 'RSS feed <em>%s</em> is toegevoegd', + 'already_subscribed' => 'U bent al geabonneerd op <em>%s</em>', + 'deleted' => 'Feed is verwijderd', + 'error' => 'Feed kan niet worden vernieuwd', + 'internal_problem' => 'De RSS feed kon niet worden toegevoegd. <a href="%s">Controleer FressRSS log bestanden</a> voor details.', + 'invalid_url' => 'URL <em>%s</em> is ongeldig', + 'marked_read' => 'Feeds zijn gemarkeerd als gelezen', + 'n_actualized' => '%d feeds zijn vernieuwd', + 'n_entries_deleted' => '%d artikelen zijn verwijderd', + 'no_refresh' => 'Er is geen feed om te vernieuwen…', + 'not_added' => '<em>%s</em> kon niet worden toegevoegd', + 'over_max' => 'U hebt het maximale aantal feeds bereikt(%d)', + 'updated' => 'Feed is vernieuwd', + ), + 'purge_completed' => 'Opschonen klaar (%d artikelen verwijderd)', + ), + 'update' => array( + 'can_apply' => 'FreshRSS word nu vernieud naar <strong>versie %s</strong>.', + 'error' => 'Het vernieuwingsproces kwam een fout tegen: %s', + 'file_is_nok' => 'Controleer permissies op <em>%s</em> map. HTTP server moet rechten hebben om er in te schrijven', + 'finished' => 'Vernieuwing compleet!', + 'none' => 'Geen vernieuwing om toe te passen', + 'server_not_found' => 'Vernieuwings server kan niet worden gevonden. [%s]', + ), + 'user' => array( + 'created' => array( + '_' => 'Gebruiker %s is aangemaakt', + 'error' => 'Gebruiker %s kan niet worden aangemaakt', + ), + 'deleted' => array( + '_' => 'Gebruiker %s is verwijderd', + 'error' => 'Gebruiker %s kan niet worden verwijderd', + ), + 'set_registration' => 'Het maximale aantal accounts is vernieuwd.', + ), + 'profile' => array( + 'error' => 'Uw profiel kan niet worden aangepast', + 'updated' => 'Uw profiel is aangepast', + ), +); diff --git a/app/i18n/nl/gen.php b/app/i18n/nl/gen.php new file mode 100644 index 000000000..83811ce68 --- /dev/null +++ b/app/i18n/nl/gen.php @@ -0,0 +1,182 @@ +<?php +/* Dutch translation by Wanabo. http://www.nieuwskop.be */ +return array( + 'action' => array( + 'actualize' => 'Actualiseren', + 'back_to_rss_feeds' => '← Ga terug naar je RSS feeds', + 'cancel' => 'Annuleren', + 'create' => 'Opslaan', + 'disable' => 'Uitzetten', + 'empty' => 'Leeg', + 'enable' => 'Aanzetten', + 'export' => 'Exporteren', + 'filter' => 'Filteren', + 'import' => 'Importeren', + 'manage' => 'Beheren', + 'mark_read' => 'Markeer als gelezen', + 'mark_favorite' => 'Markeer als favoriet', + 'remove' => 'Verwijder', + 'see_website' => 'Bekijk website', + 'submit' => 'Opslaan', + 'truncate' => 'Verwijder alle artikelen', + ), + 'auth' => array( + 'email' => 'Email adres', + 'keep_logged_in' => 'Ingelogd blijven voor <small>(%s dagen)</small>', + 'login' => 'Log in', + 'logout' => 'Log uit', + 'password' => array( + '_' => 'Wachtwoord', + 'format' => '<small>Ten minste 7 tekens</small>', + ), + 'registration' => array( + '_' => 'Nieuw account', + 'ask' => 'Maak een account?', + 'title' => 'Account maken', + ), + 'reset' => 'Authenticatie reset', + 'username' => array( + '_' => 'Gebruikersnaam', + 'admin' => 'Administrator gebruikersnaam', + 'format' => '<small>maximaal 16 alphanumerieke tekens</small>', + ), + ), + 'date' => array( + 'Apr' => '\\A\\p\\r\\i\\l', + 'Aug' => '\\A\\u\\g\\u\\s\\t\\u\\s', + 'Dec' => '\\D\\e\\c\\e\\m\\b\\e\\r', + 'Feb' => '\\F\\e\\b\\r\\u\\a\\r\\i', + 'Jan' => '\\J\\a\\n\\u\\a\\r\\i', + 'Jul' => '\\J\\u\\l\\i', + 'Jun' => '\\J\\u\\n\\i', + 'Mar' => '\\M\\a\\a\\r\\t', + 'May' => '\\M\\e\\i', + 'Nov' => '\\N\\o\\v\\e\\m\\b\\e\\r', + 'Oct' => '\\O\\k\\t\\o\\b\\e\\r', + 'Sep' => '\\S\\e\\p\\t\\e\\m\\b\\e\\r', + 'apr' => 'apr', + 'april' => 'Apr', + 'aug' => 'aug', + 'august' => 'Aug', + 'before_yesterday' => 'Ouder', + 'dec' => 'dec', + 'december' => 'Dec', + 'feb' => 'feb', + 'february' => 'Feb', + 'format_date' => 'j %s Y', //<-- European date format // 'format_date' => '%s j\\<\\s\\u\\p\\>S\\<\\/\\s\\u\\p\\> Y', + 'format_date_hour' => 'j %s Y \\o\\m H\\:i', //<-- European date format // 'format_date_hour' => '%s j\\<\\s\\u\\p\\>S\\<\\/\\s\\u\\p\\> Y \\a\\t H\\:i', + 'fri' => 'Vr', + 'jan' => 'jan', + 'january' => 'Jan', + 'jul' => 'jul', + 'july' => 'Jul', + 'jun' => 'jun', + 'june' => 'Jun', + 'last_3_month' => 'Laatste drie maanden', + 'last_6_month' => 'Laatste zes maanden', + 'last_month' => 'Vorige maand', + 'last_week' => 'Vorige week', + 'last_year' => 'Vorig jaar', + 'mar' => 'mar', + 'march' => 'Mar', + 'may' => 'Mei', + 'mon' => 'Ma', + 'month' => 'maanden', + 'nov' => 'nov', + 'november' => 'Nov', + 'oct' => 'okt', + 'october' => 'Okt', + 'sat' => 'Za', + 'sep' => 'sep', + 'september' => 'Sep', + 'sun' => 'Zo', + 'thu' => 'Do', + 'today' => 'Vandaag', + 'tue' => 'Di', + 'wed' => 'Wo', + 'yesterday' => 'Gisteren', + ), + 'freshrss' => array( + '_' => 'FreshRSS', + 'about' => 'Over FreshRSS', + ), + 'js' => array( + 'category_empty' => 'Lege categorie', + 'confirm_action' => 'Weet u zeker dat u dit wilt doen? Het kan niet ongedaan worden gemaakt!', + 'confirm_action_feed_cat' => 'Weet u zeker dat u dit wilt doen? U verliest alle gereleteerde favorieten en gebruikers informatie. Het kan niet ongedaan worden gemaakt!', + 'feedback' => array( + 'body_new_articles' => 'Er zijn %%d nieuwe artikelen om te lezen op FreshRSS.', + 'request_failed' => 'Een opdracht is mislukt, mogelijk door Internet verbindings problemen.', + 'title_new_articles' => 'FreshRSS: nieuwe artikelen!', + ), + 'new_article' => 'Er zijn nieuwe artikelen beschikbaar, klik om de pagina te vernieuwen.', + 'should_be_activated' => 'JavaScript moet aan staan', + ), + 'lang' => array( + 'cz' => 'Čeština', + 'de' => 'Deutsch', + 'en' => 'English', + 'fr' => 'Français', + 'it' => 'Italiano', + 'nl' => 'Nederlands', + 'ru' => 'Русский', + 'tr' => 'Türkçe', + ), + 'menu' => array( + 'about' => 'Over', + 'admin' => 'Administratie', + 'archiving' => 'Archiveren', + 'authentication' => 'Authenticatie', + 'check_install' => 'Installatie controle', + 'configuration' => 'Configuratie', + 'display' => 'Opmaak', + 'extensions' => 'Uitbreidingen', + 'logs' => 'Log boeken', + 'queries' => 'Gebruikers informatie', + 'reading' => 'Lezen', + 'search' => 'Zoek woorden of #labels', + 'sharing' => 'Delen', + 'shortcuts' => 'Snelle toegang', + 'stats' => 'Statistieken', + 'system' => 'Systeem configuratie', + 'update' => 'Versie controle', + 'user_management' => 'Beheer gebruikers', + 'user_profile' => 'Profiel', + ), + 'pagination' => array( + 'first' => 'Eerste', + 'last' => 'Laatste', + 'load_more' => 'Laad meer artikelen', + 'mark_all_read' => 'Markeer alle als gelezen', + 'next' => 'Volgende', + 'nothing_to_load' => 'Er zijn geen artikelen meer', + 'previous' => 'Vorige', + ), + 'share' => array( + 'blogotext' => 'Blogotext', + 'diaspora' => 'Diaspora*', + 'email' => 'Email', + 'facebook' => 'Facebook', + 'g+' => 'Google+', + 'movim' => 'Movim', + 'print' => 'Print', + 'shaarli' => 'Shaarli', + 'twitter' => 'Twitter', + 'wallabag' => 'wallabag v1', + 'wallabagv2' => 'wallabag v2', + 'jdh' => 'Journal du hacker', + ), + 'short' => array( + 'attention' => 'Attentie!', + 'blank_to_disable' => 'Laat leeg om uit te zetten', + 'by_author' => 'Door <em>%s</em>', + 'by_default' => 'Door standaard', + 'damn' => 'Potverdorie!', + 'default_category' => 'Niet ingedeeld', + 'no' => 'Nee', + 'not_applicable' => 'Niet aanwezig', + 'ok' => 'Ok!', + 'or' => 'of', + 'yes' => 'Ja', + ), +); diff --git a/app/i18n/nl/index.php b/app/i18n/nl/index.php new file mode 100644 index 000000000..751806bfa --- /dev/null +++ b/app/i18n/nl/index.php @@ -0,0 +1,61 @@ +<?php +/* Dutch translation by Wanabo. http://www.nieuwskop.be */ +return array( + 'about' => array( + '_' => 'Over', + 'agpl3' => '<a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL 3</a>', + 'bugs_reports' => 'Rapporteer fouten', + 'credits' => 'Waarderingen', + 'credits_content' => 'Sommige ontwerp elementen komen van <a href="http://twitter.github.io/bootstrap/">Bootstrap</a> alhoewel FreshRSS dit raamwerk niet gebruikt. <a href="https://git.gnome.org/browse/gnome-icon-theme-symbolic">Pictogrammen</a> komen van het <a href="https://www.gnome.org/">GNOME project</a>. <em>De Open Sans</em> font police is gemaakt door <a href="https://fonts.google.com/specimen/Open+Sans">Steve Matteson</a>. FreshRSS is gebaseerd op <a href="https://github.com/marienfressinaud/MINZ">Minz</a>, een PHP raamwerk. Nederlandse vertaling door Wanabo, <a href="http://www.nieuwskop.be" title="NieuwsKop">NieuwsKop.be</a>. Link naar de Nederlandse vertaling, <a href="https://github.com/Wanabo/FreshRSS-Dutch-translation/tree/master">FreshRSS-Dutch-translation</a>.', + 'freshrss_description' => 'FreshRSS is een RSS feed aggregator om zelf te hosten zoals <a href="http://tontof.net/kriss/feed/">Kriss Feed</a> of <a href="http://projet.idleman.fr/leed/">Leed</a>. Het gebruikt weinig systeembronnen en is makkelijk te administreren terwijl het een krachtig en makkelijk te configureren programma is.', + 'github' => '<a href="https://github.com/FreshRSS/FreshRSS/issues">op Github</a>', + 'license' => 'License', + 'project_website' => 'Project website', + 'title' => 'Over', + 'version' => 'Versie', + 'website' => 'Website', + ), + 'feed' => array( + 'add' => 'U kunt wat feeds toevoegen.', + 'empty' => 'Er is geen artikel om te laten zien.', + 'rss_of' => 'RSS feed van %s', + 'title' => 'Overzicht RSS feeds', + 'title_global' => 'Globale weergave', + 'title_fav' => 'Uw favorieten', + ), + 'log' => array( + '_' => 'Log bestanden', + 'clear' => 'Leeg de log bestanden', + 'empty' => 'Log bestand is leeg', + 'title' => 'Log bestanden', + ), + 'menu' => array( + 'about' => 'Over FreshRSS', + 'add_query' => 'Voeg een query toe', + 'before_one_day' => 'Ouder als een dag', + 'before_one_week' => 'Ouder als een week', + 'favorites' => 'Favorieten (%s)', + 'global_view' => 'Globale weergave', + 'main_stream' => 'Overzicht', + 'mark_all_read' => 'Markeer alles als gelezen', + 'mark_cat_read' => 'Markeer categorie als gelezen', + 'mark_feed_read' => 'Markeer feed als gelezen', + 'newer_first' => 'Nieuwste eerst', + 'non-starred' => 'Laat alles zien behalve favorieten', + 'normal_view' => 'Normale weergave', + 'older_first' => 'Oudste eerst', + 'queries' => 'Gebruikers queries', + 'read' => 'Laat alleen gelezen zien', + 'reader_view' => 'Lees modus', + 'rss_view' => 'RSS feed', + 'search_short' => 'Zoeken', + 'starred' => 'Laat alleen favorieten zien', + 'stats' => 'Statistieken', + 'subscription' => 'Abonnementen beheer', + 'unread' => 'Laat alleen ongelezen zien', + ), + 'share' => 'Delen', + 'tag' => array( + 'related' => 'Verwante labels', + ), +); diff --git a/app/i18n/nl/install.php b/app/i18n/nl/install.php new file mode 100644 index 000000000..79db9c794 --- /dev/null +++ b/app/i18n/nl/install.php @@ -0,0 +1,119 @@ +<?php +/* Dutch translation by Wanabo. http://www.nieuwskop.be */ +return array( + 'action' => array( + 'finish' => 'Completeer installatie', + 'fix_errors_before' => 'Repareer de fouten alvorens naar de volgende stap te gaan.', + 'keep_install' => 'Behoud de vorige installatie', + 'next_step' => 'Ga naar de volgende stap', + 'reinstall' => 'Installeer FreshRSS opnieuw', + ), + 'auth' => array( + 'form' => 'Web formulier (traditioneel, benodigd JavaScript)', + 'http' => 'HTTP (voor geavanceerde gebruikers met HTTPS)', + 'none' => 'Geen (gevaarlijk)', + 'password_form' => 'Wachtwoord<br /><small>(voor de Web-formulier log in methode)</small>', + 'password_format' => 'Tenminste 7 tekens', + 'type' => 'Authenticatie methode', + ), + 'bdd' => array( + '_' => 'Database', + 'conf' => array( + '_' => 'Database configuratie', + 'ko' => 'Controleer uw database informatie.', + 'ok' => 'Database configuratie is opgeslagen.', + ), + 'host' => 'Host', + 'prefix' => 'Tabel voorvoegsel', + 'password' => 'Database wachtwoord', + 'type' => 'Type database', + 'username' => 'Database gebruikersnaam', + ), + 'check' => array( + '_' => 'Controles', + 'already_installed' => 'We hebben geconstateerd dat FreshRSS al is geïnstallerd!', + 'cache' => array( + 'nok' => 'Controleer permissies van de <em>./data/cache</em> map. HTTP server moet rechten hebben om er in te kunnen schrijven', + 'ok' => 'Permissies van de cache map zijn goed.', + ), + 'ctype' => array( + 'nok' => 'U mist een benodigde bibliotheek voor character type checking (php-ctype).', + 'ok' => 'U hebt de benodigde bibliotheek voor character type checking (ctype).', + ), + 'curl' => array( + 'nok' => 'U mist cURL (php-curl package).', + 'ok' => 'U hebt de cURL uitbreiding.', + ), + 'data' => array( + 'nok' => 'Controleer permissies van de <em>./data</em> map. HTTP server moet rechten hebben om er in te kunnen schrijven', + 'ok' => 'Permissies van de data map zijn goed.', + ), + 'dom' => array( + 'nok' => 'U mist een benodigde bibliotheek om te bladeren in de DOM.', + 'ok' => 'U hebt de benodigde bibliotheek om te bladeren in de DOM.', + ), + 'favicons' => array( + 'nok' => 'Controleer permissies van de <em>./data/favicons</em> map. HTTP server moet rechten hebben om er in te kunnen schrijven', + 'ok' => 'Permissies van de favicons map zijn goed.', + ), + 'fileinfo' => array( + 'nok' => 'U mist PHP fileinfo (fileinfo package).', + 'ok' => 'U hebt de fileinfo uitbreiding.', + ), + 'http_referer' => array( + 'nok' => 'Controleer a.u.b. dat u niet uw HTTP REFERER wijzigd.', + 'ok' => 'Uw HTTP REFERER is bekend en komt overeen met uw server.', + ), + 'json' => array( + 'nok' => 'U mist een benodigede bibliotheek om JSON te gebruiken.', + 'ok' => 'U hebt de benodigde bibliotheek om JSON te gebruiken.', + ), + 'minz' => array( + 'nok' => 'U mist het Minz framework.', + 'ok' => 'U hebt het Minz framework.', + ), + 'pcre' => array( + 'nok' => 'U mist een benodigde bibliotheek voor regular expressions (php-pcre).', + 'ok' => 'U hebt de benodigde bibliotheek voor regular expressions (PCRE).', + ), + 'pdo' => array( + 'nok' => 'U mist PDO of één van de ondersteunde (pdo_mysql, pdo_sqlite, pdo_pgsql).', + 'ok' => 'U hebt PDO en ten minste één van de ondersteunde drivers (pdo_mysql, pdo_sqlite, pdo_pgsql).', + ), + 'php' => array( + 'nok' => 'Uw PHP versie is %s maar FreshRSS benodigd tenminste versie %s.', + 'ok' => 'Uw PHP versie is %s, welke compatibel is met FreshRSS.', + ), + 'users' => array( + 'nok' => 'Controleer permissies van de <em>./data/users</em> map. HTTP server moet rechten hebben om er in te kunnen schrijven', + 'ok' => 'Permissies van de users map zijn goed.', + ), + 'xml' => array( + 'nok' => 'U mist de benodigde bibliotheek om XML te gebruiken.', + 'ok' => 'U hebt de benodigde bibliotheek om XML te gebruiken.', + ), + ), + 'conf' => array( + '_' => 'Algemene configuratie', + 'ok' => 'Algemene configuratie is opgeslagen.', + ), + 'congratulations' => 'Gefeliciteerd!', + 'default_user' => 'Gebruikersnaam van de standaard gebruiker <small>(maximaal 16 alphanumerieke tekens)</small>', + 'delete_articles_after' => 'Verwijder artikelen na', + 'fix_errors_before' => 'Repareer fouten alvorens U naar de volgende stap gaat.', + 'javascript_is_better' => 'FreshRSS werkt beter JavaScript ingeschakeld', + 'js' => array( + 'confirm_reinstall' => 'U verliest uw vorige configuratie door FreshRSS opnieuw te installeren. Weet u zeker dat u verder wilt gaan?', + ), + 'language' => array( + '_' => 'Taal', + 'choose' => 'Kies een taal voor FreshRSS', + 'defined' => 'Taal is bepaald.', + ), + 'not_deleted' => 'Er ging iets fout! U moet het bestand <em>%s</em> handmatig verwijderen.', + 'ok' => 'De installatie procedure is geslaagd.', + 'step' => 'stap %d', + 'steps' => 'Stappen', + 'title' => 'Installatie · FreshRSS', + 'this_is_the_end' => 'Dit is het einde', +); diff --git a/app/i18n/nl/sub.php b/app/i18n/nl/sub.php new file mode 100644 index 000000000..a1ba3f03d --- /dev/null +++ b/app/i18n/nl/sub.php @@ -0,0 +1,62 @@ +<?php +/* Dutch translation by Wanabo. http://www.nieuwskop.be */ +return array( + 'category' => array( + '_' => 'Categorie', + 'add' => 'Voeg categorie toe', + 'empty' => 'Lege categorie', + 'new' => 'Nieuwe categorie', + ), + 'feed' => array( + 'add' => 'Voeg een RSS feed toe', + 'advanced' => 'Geavanceerd', + 'archiving' => 'Archiveren', + 'auth' => array( + 'configuration' => 'Log in', + 'help' => 'Verbinding toestaan toegang te krijgen tot HTTP beveiligde RSS feeds', + 'http' => 'HTTP Authenticatie', + 'password' => 'HTTP wachtwoord', + 'username' => 'HTTP gebruikers naam', + ), + 'css_help' => 'Haalt verstoorde RSS feeds op (attentie, heeft meer tijd nodig!)', + 'css_path' => 'Artikelen CSS pad op originele website', + '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 <em>%s</em>.', + 'no_selected' => 'Geen feed geselecteerd.', + 'number_entries' => '%d artikelen', + 'pubsubhubbub' => 'Directe notificaties met PubSubHubbub', + 'stats' => 'Statistieken', + 'think_to_add' => 'Voeg wat feeds toe.', + 'title' => 'Titel', + 'title_add' => 'Voeg een RSS feed toe', + 'ttl' => 'Vernieuw automatisch niet vaker dan', + 'url' => 'Feed URL', + 'validator' => 'Controleer de geldigheid van de feed', + 'website' => 'Website URL', + ), + 'import_export' => array( + 'export' => 'Exporteer', + 'export_opml' => 'Exporteer lijst van feeds (OPML)', + 'export_starred' => 'Exporteer je fovorieten', + 'feed_list' => 'Lijst van %s artikelen', + 'file_to_import' => 'Bestand om te importeren<br />(OPML, JSON of ZIP)', + 'file_to_import_no_zip' => 'Bestand om te importeren<br />(OPML of JSON)', + 'import' => 'Importeer', + 'starred_list' => 'Lijst van favoriete artikelen', + 'title' => 'Importeren / exporteren', + ), + 'menu' => array( + 'bookmark' => 'Abonneer (FreshRSS bladwijzer)', + 'import_export' => 'Importeer / exporteer', + 'subscription_management' => 'Abonnementen beheer', + ), + 'title' => array( + '_' => 'Abonnementen beheer', + 'feed_management' => 'RSS feed beheer', + ), +); diff --git a/app/i18n/ru/admin.php b/app/i18n/ru/admin.php new file mode 100644 index 000000000..f5da97371 --- /dev/null +++ b/app/i18n/ru/admin.php @@ -0,0 +1,181 @@ +<?php + +return array( + 'auth' => array( + 'allow_anonymous' => 'Разрешить анонимное чтение статей для пользователя по умолчанию (%s)', + 'allow_anonymous_refresh' => 'Разрешить анонимное обновление статей', + 'api_enabled' => 'Включить доступ к <abbr>API</abbr> <small>(необходимо для мобильных приложений)</small>', + 'form' => 'На основе веб-формы (традиционный, необходим JavaScript)', + 'http' => 'HTTP (для продвинутых пользователей - по HTTPS)', + 'none' => 'Без аутентификации (небезопасный)', + 'title' => 'Аутентификации', + 'title_reset' => 'Сброс аутентицикации', + 'token' => 'Токен аутентификации', + 'token_help' => 'Разрешает доступ к RSS ленте пользователя по умолчанию без аутентификации:', + 'type' => 'Метод аутентификации', + 'unsafe_autologin' => 'Разрешить небезопасный автоматический вход с использованием следующего формата: ', + ), + 'check_install' => array( + 'cache' => array( + 'nok' => 'Проверьте права доступа к папке <em>./data/cache</em>. Сервер HTTP должен иметь права на запись в эту папку', + 'ok' => 'Права на <em>./data/cache</em> в порядке.', + ), + 'categories' => array( + 'nok' => 'Таблица категорий настроена неправильно.', + 'ok' => 'Таблица категорий настроена правильно.', + ), + 'connection' => array( + 'nok' => 'Подключение к базе данных не может быть установлено.', + 'ok' => 'Подключение к базе данных в порядке.', + ), + 'ctype' => array( + 'nok' => 'У вас не установлена библиотека для проверки типов символов (php-ctype).', + 'ok' => 'У вас не установлена библиотека для проверки типов символов (ctype).', + ), + 'curl' => array( + 'nok' => 'У вас не установлено расширение cURL (пакет php-curl).', + 'ok' => 'У вас установлено расширение cURL.', + ), + 'data' => array( + 'nok' => 'Проверьте права доступа к папке <em>./data</em> . Сервер HTTP должен иметь права на запись в эту папку.', + 'ok' => 'Права на <em>./data/</em> в порядке.', + ), + 'database' => 'Установка базы данных', + 'dom' => array( + 'nok' => 'У вас не установлена библиотека для просмотра DOM (пакет php-xml).', + 'ok' => 'У вас установлена библиотека для просмотра DOM.', + ), + 'entries' => array( + 'nok' => 'Таблица статей (entry) неправильно настроена.', + 'ok' => 'Таблица статей (entry) настроена правильно.', + ), + 'favicons' => array( + 'nok' => 'Проверьте права доступа к папке <em>./data/favicons</em> . Сервер HTTP должен иметь права на запись в эту папку.', + 'ok' => 'Права на папку значков в порядке.', + ), + 'feeds' => array( + 'nok' => 'Таблица подписок (feed) неправильно настроена.', + 'ok' => 'Таблица подписок (feed) настроена правильно.', + ), + 'fileinfo' => array( + 'nok' => 'У вас не установлено расширение PHP fileinfo (пакет fileinfo).', + 'ok' => 'У вас установлено расширение fileinfo.', + ), + 'files' => 'Установка файлов', + 'json' => array( + 'nok' => 'У вас не установлена библиотека для работы с JSON (пакет php5-json).', + 'ok' => 'У вас установлена библиотека для работы с JSON.', + ), + 'minz' => array( + 'nok' => 'У вас не установлен фрейворк Minz.', + 'ok' => 'У вас установлен фрейворк Minz.', + ), + 'pcre' => array( + 'nok' => 'У вас не установлена необходимая библиотека для работы с регулярными выражениями (php-pcre).', + 'ok' => 'У вас установлена необходимая библиотека для работы с регулярными выражениями (PCRE).', + ), + 'pdo' => array( + 'nok' => 'У вас не установлен PDO или один из необходимых драйверов (pdo_mysql, pdo_sqlite, pdo_pgsql).', + 'ok' => 'У вас установлен PDO и как минимум один из поддерживаемых драйверов (pdo_mysql, pdo_sqlite, pdo_pgsql).', + ), + 'php' => array( + '_' => 'PHP installation', + 'nok' => 'У вас установлен PHP версии %s, но FreshRSS необходима версия не ниже %s.', + 'ok' => 'У вас установлен PHP версии %s, который совместим с FreshRSS.', + ), + 'tables' => array( + 'nok' => 'В базе данных отсуствует одна или больше таблица.', + 'ok' => 'Все таблицы есть в базе данных.', + ), + 'title' => 'Проверка установки и настройки', + 'tokens' => array( + 'nok' => 'Проверьте права доступа к папке <em>./data/tokens</em> . Сервер HTTP должен иметь права на запись в эту папку.', + 'ok' => 'Права на папку tokens в порядке.', + ), + 'users' => array( + 'nok' => 'Проверьте права доступа к папке <em>./data/users</em> . Сервер HTTP должен иметь права на запись в эту папку.', + 'ok' => 'Права на папку users в порядке.', + ), + 'zip' => array( + 'nok' => 'You lack ZIP extension (php-zip package).', + 'ok' => 'You have ZIP extension.', + ), + ), + 'extensions' => array( + 'disabled' => 'Отключены', + 'empty_list' => 'Расширения не установлены', + 'enabled' => 'Включены', + 'no_configure_view' => 'Это расширение нельзя настроить.', + 'system' => array( + '_' => 'Системные расширения', + 'no_rights' => 'Системные расширения (у вас нет к ним доступа)', + ), + 'title' => 'Расширения', + 'user' => 'Расширения пользователя', + ), + 'stats' => array( + '_' => 'Статистика', + 'all_feeds' => 'Все подписки', + 'category' => 'Категория', + 'entry_count' => 'Количество статей', + 'entry_per_category' => 'Статей в категории', + 'entry_per_day' => 'Статей за день (за последние 30 дней)', + 'entry_per_day_of_week' => 'За неделю (в среднем - %.2f сообщений)', + 'entry_per_hour' => 'За час (в среднем - %.2f сообщений)', + 'entry_per_month' => 'За месяц (в среднем - %.2f сообщений)', + 'entry_repartition' => 'Перерасределение статей', + 'feed' => 'Подписка', + 'feed_per_category' => 'Подписок в категории', + 'idle' => 'Неактивные подписки', + 'main' => 'Основная статистика', + 'main_stream' => 'Основной поток', + 'menu' => array( + 'idle' => 'Неактивные подписки', + 'main' => 'Основная статистика', + 'repartition' => 'Перерасределение статей', + ), + 'no_idle' => 'Нет неактивных подписок!', + 'number_entries' => 'статей: %d', + 'percent_of_total' => '%% от всего', + 'repartition' => 'Перераспределение статей', + 'status_favorites' => 'Избранное', + 'status_read' => 'Читать', + 'status_total' => 'Всего', + 'status_unread' => 'Не прочитано', + 'title' => 'Статистика', + 'top_feed' => '10 лучших подписок', + ), + 'system' => array( + '_' => 'Системные настройки', + 'auto-update-url' => 'Адрес сервера для автоматического обновления', + 'instance-name' => 'Название этого сервера', + 'max-categories' => 'Количество категорий на пользователя', + 'max-feeds' => 'Количество статей на пользователя', + 'registration' => array( + 'help' => '0 означает неограниченное количество пользователей', + 'number' => 'Максимальное количество пользователей', + ), + ), + 'update' => array( + '_' => 'Обновление системы', + 'apply' => 'Применить', + 'check' => 'Проверить обновления', + 'current_version' => 'Ваша текущая версия FreshRSS: %s.', + 'last' => 'Последняя проверка: %s', + 'none' => 'Нечего обновлять', + 'title' => 'Обновить систему', + ), + 'user' => array( + 'articles_and_size' => '%s статей (%s)', + 'create' => 'Создать нового пользователя', + 'language' => 'Язык', + 'number' => 'На данный момент создан %d аккаунт', + 'numbers' => 'На данный момент аккаунтов создано: %d', + 'password_form' => 'Пароль<br /><small>(для входа через Веб-форму)</small>', + 'password_format' => 'Минимум 7 символов', + 'title' => 'Управление пользователями', + 'user_list' => 'Список пользователей', + 'username' => 'Имя пользователя', + 'users' => 'Пользователи', + ), +); diff --git a/app/i18n/ru/conf.php b/app/i18n/ru/conf.php new file mode 100644 index 000000000..557fbe369 --- /dev/null +++ b/app/i18n/ru/conf.php @@ -0,0 +1,173 @@ +<?php + +return array( + 'archiving' => array( + '_' => 'Архивация', + 'advanced' => 'Продвинутые настройки', + 'delete_after' => 'Удалять статьи после', + 'help' => 'Каждую подписку можно настроить более гибко', + 'keep_history_by_feed' => 'Minimum number of articles to keep by feed', + 'optimize' => 'Оптимизировать базу данных', + 'optimize_help' => 'To do occasionally to reduce the size of the database', + 'purge_now' => 'Очистить сейчас', + 'title' => 'Архивация', + 'ttl' => 'Не обновлять чаще чем', + ), + 'display' => array( + '_' => 'Display', + 'icon' => array( + 'bottom_line' => 'Bottom line', + 'entry' => 'Article icons', + 'publication_date' => 'Date of publication', + 'related_tags' => 'Related tags', + 'sharing' => 'Sharing', + 'top_line' => 'Top line', + ), + 'language' => 'Язык', + 'notif_html5' => array( + 'seconds' => 'seconds (0 means no timeout)', + 'timeout' => 'HTML5 notification timeout', + ), + 'theme' => 'Тема', + 'title' => 'Display', + 'width' => array( + 'content' => 'Content width', + 'large' => 'Large', + 'medium' => 'Medium', + 'no_limit' => 'No limit', + 'thin' => 'Thin', + ), + ), + 'query' => array( + '_' => 'User queries', + 'deprecated' => 'This query is no longer valid. The referenced category or feed has been deleted.', + 'filter' => 'Filter applied:', + 'get_all' => 'Display all articles', + 'get_category' => 'Display "%s" category', + 'get_favorite' => 'Display favorite articles', + 'get_feed' => 'Display "%s" feed', + 'no_filter' => 'No filter', + 'none' => 'You haven’t created any user query yet.', + 'number' => 'Query n°%d', + 'order_asc' => 'Display oldest articles first', + 'order_desc' => 'Display newest articles first', + 'search' => 'Search for "%s"', + 'state_0' => 'Display all articles', + 'state_1' => 'Display read articles', + 'state_2' => 'Display unread articles', + 'state_3' => 'Display all articles', + 'state_4' => 'Display favorite articles', + 'state_5' => 'Display read favorite articles', + 'state_6' => 'Display unread favorite articles', + 'state_7' => 'Display favorite articles', + 'state_8' => 'Display not favorite articles', + 'state_9' => 'Display read not favorite articles', + 'state_10' => 'Display unread not favorite articles', + 'state_11' => 'Display not favorite articles', + 'state_12' => 'Display all articles', + 'state_13' => 'Display read articles', + 'state_14' => 'Display unread articles', + 'state_15' => 'Display all articles', + 'title' => 'User queries', + ), + 'profile' => array( + '_' => 'Profile management', + 'delete' => array( + '_' => 'Account deletion', + 'warn' => 'Your account and all the related data will be deleted.', + ), + 'password_api' => 'Password API<br /><small>(e.g., for mobile apps)</small>', + 'password_form' => 'Password<br /><small>(for the Web-form login method)</small>', + 'password_format' => 'At least 7 characters', + 'title' => 'Profile', + ), + 'reading' => array( + '_' => 'Reading', + 'after_onread' => 'After “mark all as read”,', + 'articles_per_page' => 'Number of articles per page', + 'auto_load_more' => 'Load next articles at the page bottom', + 'auto_remove_article' => 'Hide articles after reading', + 'mark_updated_article_unread' => 'Mark updated articles as unread', + 'confirm_enabled' => 'Display a confirmation dialog on “mark all as read” actions', + 'display_articles_unfolded' => 'Show articles unfolded by default', + 'display_categories_unfolded' => 'Show categories folded by default', + 'hide_read_feeds' => 'Hide categories & feeds with no unread article (does not work with “Show all articles” configuration)', + 'img_with_lazyload' => 'Use "lazy load" mode to load pictures', + 'jump_next' => 'jump to next unread sibling (feed or category)', + 'number_divided_when_reader' => 'Divided by 2 in the reading view.', + 'read' => array( + 'article_open_on_website' => 'when article is opened on its original website', + 'article_viewed' => 'when article is viewed', + 'scroll' => 'while scrolling', + 'upon_reception' => 'upon reception of the article', + 'when' => 'Mark article as read…', + ), + 'show' => array( + '_' => 'Articles to display', + 'adaptive' => 'Adjust showing', + 'all_articles' => 'Show all articles', + 'unread' => 'Show only unread', + ), + 'sort' => array( + '_' => 'Sort order', + 'newer_first' => 'Newer first', + 'older_first' => 'Oldest first', + ), + 'sticky_post' => 'Stick the article to the top when opened', + 'title' => 'Reading', + 'view' => array( + 'default' => 'Default view', + 'global' => 'Global view', + 'normal' => 'Normal view', + 'reader' => 'Reading view', + ), + ), + 'sharing' => array( + '_' => 'Sharing', + 'blogotext' => 'Blogotext', + 'diaspora' => 'Diaspora*', + 'email' => 'Email', + 'facebook' => 'Facebook', + 'g+' => 'Google+', + 'more_information' => 'More information', + 'print' => 'Print', + 'shaarli' => 'Shaarli', + 'share_name' => 'Share name to display', + 'share_url' => 'Share URL to use', + 'title' => 'Sharing', + 'twitter' => 'Twitter', + 'wallabag' => 'wallabag', + ), + 'shortcut' => array( + '_' => 'Shortcuts', + 'article_action' => 'Article actions', + 'auto_share' => 'Share', + 'auto_share_help' => 'If there is only one sharing mode, it is used. Else modes are accessible by their number.', + 'close_dropdown' => 'Close menus', + 'collapse_article' => 'Collapse', + 'first_article' => 'Skip to the first article', + 'focus_search' => 'Access search box', + 'help' => 'Display documentation', + 'javascript' => 'JavaScript must be enabled in order to use shortcuts', + 'last_article' => 'Skip to the last article', + 'load_more' => 'Load more articles', + 'mark_read' => 'Mark as read', + 'mark_favorite' => 'Mark as favourite', + 'navigation' => 'Navigation', + 'navigation_help' => 'With the "Shift" modifier, navigation shortcuts apply on feeds.<br/>With the "Alt" modifier, navigation shortcuts apply on categories.', + 'next_article' => 'Skip to the next article', + 'other_action' => 'Other actions', + 'previous_article' => 'Skip to the previous article', + 'see_on_website' => 'See on original website', + 'shift_for_all_read' => '+ <code>shift</code> 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.', + ), + 'user' => array( + 'articles_and_size' => '%s articles (%s)', + 'current' => 'Current user', + 'is_admin' => 'is administrator', + 'users' => 'Users', + ), +); diff --git a/app/i18n/ru/feedback.php b/app/i18n/ru/feedback.php new file mode 100644 index 000000000..e7f6b9f85 --- /dev/null +++ b/app/i18n/ru/feedback.php @@ -0,0 +1,109 @@ +<?php + +return array( + 'admin' => array( + 'optimization_complete' => 'Optimisation complete', + ), + 'access' => array( + 'denied' => 'You don’t have permission to access this page', + 'not_found' => 'You are looking for a page which doesn’t exist', + ), + 'auth' => array( + 'form' => array( + 'not_set' => 'A problem occured during authentication system configuration. Please retry later.', + 'set' => 'Form is now your default authentication system.', + ), + 'login' => array( + 'invalid' => 'Login is invalid', + 'success' => 'You are connected', + ), + 'logout' => array( + 'success' => 'You are disconnected', + ), + 'no_password_set' => 'Administrator password hasn’t been set. This feature isn’t available.', + ), + 'conf' => array( + 'error' => 'An error occurred during configuration saving', + 'query_created' => 'Query "%s" has been created.', + 'shortcuts_updated' => 'Shortcuts have been updated', + 'updated' => 'Configuration has been updated', + ), + 'extensions' => array( + 'already_enabled' => '%s is already enabled', + 'disable' => array( + 'ko' => '%s cannot be disabled. <a href="%s">Check FressRSS logs</a> for details.', + 'ok' => '%s is now disabled', + ), + 'enable' => array( + 'ko' => '%s cannot be enabled. <a href="%s">Check FressRSS logs</a> for details.', + 'ok' => '%s is now enabled', + ), + 'no_access' => 'You have no access on %s', + 'not_enabled' => '%s is not enabled yet', + 'not_found' => '%s does not exist', + ), + 'import_export' => array( + 'export_no_zip_extension' => 'ZIP extension is not present on your server. Please try to export files one by one.', + 'feeds_imported' => 'Your feeds have been imported and will now be updated', + 'feeds_imported_with_errors' => 'Your feeds have been imported but some errors occurred', + 'file_cannot_be_uploaded' => 'File cannot be uploaded!', + 'no_zip_extension' => 'ZIP extension is not present on your server.', + 'zip_error' => 'An error occured during ZIP import.', + ), + 'sub' => array( + 'actualize' => 'Actualise', + 'category' => array( + 'created' => 'Category %s has been created.', + 'deleted' => 'Category has been deleted.', + 'emptied' => 'Category has been emptied', + 'error' => 'Category cannot be updated', + 'name_exists' => 'Category name already exists.', + 'no_id' => 'You must precise the id of the category.', + 'no_name' => 'Category name cannot be empty.', + 'not_delete_default' => 'You cannot delete the default category!', + 'not_exist' => 'The category does not exist!', + 'over_max' => 'You have reached your limit of categories (%d)', + 'updated' => 'Category has been updated.', + ), + 'feed' => array( + 'actualized' => '<em>%s</em> has been updated', + 'actualizeds' => 'RSS feeds have been updated', + 'added' => 'RSS feed <em>%s</em> has been added', + 'already_subscribed' => 'You have already subscribed to <em>%s</em>', + 'deleted' => 'Feed has been deleted', + 'error' => 'Feed cannot be updated', + 'internal_problem' => 'The RSS feed could not be added. <a href="%s">Check FressRSS logs</a> for details.', + 'invalid_url' => 'URL <em>%s</em> is invalid', + 'marked_read' => 'Feeds have been marked as read', + 'n_actualized' => '%d feeds have been updated', + 'n_entries_deleted' => '%d articles have been deleted', + 'no_refresh' => 'There is no feed to refresh…', + 'not_added' => '<em>%s</em> could not be added', + 'over_max' => 'You have reached your limit of feeds (%d)', + 'updated' => 'Feed has been updated', + ), + 'purge_completed' => 'Purge completed (%d articles deleted)', + ), + 'update' => array( + 'can_apply' => 'FreshRSS will now be updated to the <strong>version %s</strong>.', + 'error' => 'The update process has encountered an error: %s', + 'file_is_nok' => 'Check permissions on <em>%s</em> directory. HTTP server must have rights to write into', + 'finished' => 'Update completed!', + 'none' => 'No update to apply', + 'server_not_found' => 'Update server cannot be found. [%s]', + ), + 'user' => array( + 'created' => array( + '_' => 'User %s has been created', + 'error' => 'User %s cannot be created', + ), + 'deleted' => array( + '_' => 'User %s has been deleted', + 'error' => 'User %s cannot be deleted', + ), + ), + 'profile' => array( + 'error' => 'Your profile cannot be modified', + 'updated' => 'Your profile has been modified', + ), +); diff --git a/app/i18n/ru/gen.php b/app/i18n/ru/gen.php new file mode 100644 index 000000000..bc42afaa8 --- /dev/null +++ b/app/i18n/ru/gen.php @@ -0,0 +1,182 @@ +<?php + +return array( + 'action' => array( + 'actualize' => 'Actualize', + 'back_to_rss_feeds' => '← Go back to your RSS feeds', + 'cancel' => 'Cancel', + 'create' => 'Create', + 'disable' => 'Disable', + 'empty' => 'Empty', + 'enable' => 'Enable', + 'export' => 'Export', + 'filter' => 'Filter', + 'import' => 'Import', + 'manage' => 'Manage', + 'mark_read' => 'Mark as read', + 'mark_favorite' => 'Mark as favourite', + 'remove' => 'Remove', + 'see_website' => 'See website', + 'submit' => 'Submit', + 'truncate' => 'Delete all articles', + ), + 'auth' => array( + 'email' => 'Email address', + 'keep_logged_in' => 'Keep me logged in <small>(%s дней)</small>', + 'login' => 'Login', + 'logout' => 'Logout', + 'password' => array( + '_' => 'Password', + 'format' => '<small>At least 7 characters</small>', + ), + 'registration' => array( + '_' => 'New account', + 'ask' => 'Create an account?', + 'title' => 'Account creation', + ), + 'reset' => 'Authentication reset', + 'username' => array( + '_' => 'Username', + 'admin' => 'Administrator username', + 'format' => '<small>maximum 16 alphanumeric characters</small>', + ), + ), + 'date' => array( + 'Apr' => '\\A\\p\\r\\i\\l', + 'Aug' => '\\A\\u\\g\\u\\s\\t', + 'Dec' => '\\D\\e\\c\\e\\m\\b\\e\\r', + 'Feb' => '\\F\\e\\b\\r\\u\\a\\r\\y', + 'Jan' => '\\J\\a\\n\\u\\a\\r\\y', + 'Jul' => '\\J\\u\\l\\y', + 'Jun' => '\\J\\u\\n\\e', + 'Mar' => '\\M\\a\\r\\c\\h', + 'May' => '\\M\\a\\y', + 'Nov' => '\\N\\o\\v\\e\\m\\b\\e\\r', + 'Oct' => '\\O\\c\\t\\o\\b\\e\\r', + 'Sep' => '\\S\\e\\p\\t\\e\\m\\b\\e\\r', + 'apr' => 'apr', + 'april' => 'Apr', + 'aug' => 'aug', + 'august' => 'Aug', + 'before_yesterday' => 'Before yesterday', + 'dec' => 'dec', + 'december' => 'Dec', + 'feb' => 'feb', + 'february' => 'Feb', + 'format_date' => '%s j\\<\\s\\u\\p\\>S\\<\\/\\s\\u\\p\\> Y', + 'format_date_hour' => '%s j\\<\\s\\u\\p\\>S\\<\\/\\s\\u\\p\\> Y \\a\\t H\\:i', + 'fri' => 'Fri', + 'jan' => 'jan', + 'january' => 'Jan', + 'jul' => 'jul', + 'july' => 'Jul', + 'jun' => 'jun', + 'june' => 'Jun', + 'last_3_month' => 'Last three months', + 'last_6_month' => 'Last six months', + 'last_month' => 'Last month', + 'last_week' => 'Last week', + 'last_year' => 'Last year', + 'mar' => 'mar', + 'march' => 'Mar', + 'may' => 'May', + 'mon' => 'Mon', + 'month' => 'months', + 'nov' => 'nov', + 'november' => 'Nov', + 'oct' => 'oct', + 'october' => 'Oct', + 'sat' => 'Sat', + 'sep' => 'sep', + 'september' => 'Sep', + 'sun' => 'Sun', + 'thu' => 'Thu', + 'today' => 'Today', + 'tue' => 'Tue', + 'wed' => 'Wed', + 'yesterday' => 'Yesterday', + ), + 'freshrss' => array( + '_' => 'FreshRSS', + 'about' => 'About FreshRSS', + ), + 'js' => array( + 'category_empty' => 'Empty category', + 'confirm_action' => 'Are you sure you want to perform this action? It cannot be cancelled!', + 'confirm_action_feed_cat' => 'Are you sure you want to perform this action? You will lose related favorites and user queries. It cannot be cancelled!', + 'feedback' => array( + 'body_new_articles' => 'There are %%d new articles to read on FreshRSS.', + 'request_failed' => 'A request has failed, it may have been caused by Internet connection problems.', + 'title_new_articles' => 'FreshRSS: new articles!', + ), + 'new_article' => 'There are new available articles, click to refresh the page.', + 'should_be_activated' => 'JavaScript must be enabled', + ), + 'lang' => array( + 'cz' => 'Čeština', + 'de' => 'Deutsch', + 'en' => 'English', + 'fr' => 'Français', + 'it' => 'Italiano', + 'nl' => 'Nederlands', + 'ru' => 'Русский', + 'tr' => 'Türkçe', + ), + 'menu' => array( + 'about' => 'About', + 'admin' => 'Administration', + 'archiving' => 'Archiving', + 'authentication' => 'Authentication', + 'check_install' => 'Installation checking', + 'configuration' => 'Configuration', + 'display' => 'Display', + 'extensions' => 'Extensions', + 'logs' => 'Logs', + 'queries' => 'User queries', + 'reading' => 'Reading', + 'search' => 'Search words or #tags', + 'sharing' => 'Sharing', + 'shortcuts' => 'Shortcuts', + 'stats' => 'Statistics', + 'system' => 'System configuration', + 'update' => 'Update', + 'user_management' => 'Manage users', + 'user_profile' => 'Profile', + ), + 'pagination' => array( + 'first' => 'First', + 'last' => 'Last', + 'load_more' => 'Load more articles', + 'mark_all_read' => 'Mark all as read', + 'next' => 'Next', + 'nothing_to_load' => 'There are no more articles', + 'previous' => 'Previous', + ), + 'share' => array( + 'blogotext' => 'Blogotext', + 'diaspora' => 'Diaspora*', + 'email' => 'Email', + 'facebook' => 'Facebook', + 'g+' => 'Google+', + 'jdh' => 'Journal du hacker', + 'movim' => 'Movim', + 'print' => 'Print', + 'shaarli' => 'Shaarli', + 'twitter' => 'Twitter', + 'wallabag' => 'wallabag v1', + 'wallabagv2' => 'wallabag v2', + ), + 'short' => array( + 'attention' => 'Warning!', + 'blank_to_disable' => 'Leave blank to disable', + 'by_author' => 'By <em>%s</em>', + 'by_default' => 'By default', + 'damn' => 'Damn!', + 'default_category' => 'Uncategorized', + 'no' => 'No', + 'not_applicable' => 'Not available', + 'ok' => 'Ok!', + 'or' => 'or', + 'yes' => 'Yes', + ), +); diff --git a/app/i18n/ru/index.php b/app/i18n/ru/index.php new file mode 100644 index 000000000..eb6413e3c --- /dev/null +++ b/app/i18n/ru/index.php @@ -0,0 +1,61 @@ +<?php + +return array( + 'about' => array( + '_' => 'About', + 'agpl3' => '<a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL 3</a>', + 'bugs_reports' => 'Bugs reports', + 'credits' => 'Credits', + 'credits_content' => 'Some design elements come from <a href="http://twitter.github.io/bootstrap/">Bootstrap</a> although FreshRSS doesn’t use this framework. <a href="https://git.gnome.org/browse/gnome-icon-theme-symbolic">Icons</a> come from <a href="https://www.gnome.org/">GNOME project</a>. <em>Open Sans</em> font police has been created by <a href="https://fonts.google.com/specimen/Open+Sans">Steve Matteson</a>. FreshRSS is based on <a href="https://github.com/marienfressinaud/MINZ">Minz</a>, a PHP framework.', + 'freshrss_description' => 'FreshRSS is a RSS feeds aggregator to self-host like <a href="http://tontof.net/kriss/feed/">Kriss Feed</a> or <a href="http://projet.idleman.fr/leed/">Leed</a>. It is light and easy to take in hand while being powerful and configurable tool.', + 'github' => '<a href="https://github.com/FreshRSS/FreshRSS/issues">on Github</a>', + 'license' => 'License', + 'project_website' => 'Project website', + 'title' => 'About', + 'version' => 'Version', + 'website' => 'Website', + ), + 'feed' => array( + 'add' => 'You may add some feeds.', + 'empty' => 'There is no article to show.', + 'rss_of' => 'RSS feed of %s', + 'title' => 'Your RSS feeds', + 'title_global' => 'Global view', + 'title_fav' => 'Your favourites', + ), + 'log' => array( + '_' => 'Logs', + 'clear' => 'Clear the logs', + 'empty' => 'Log file is empty', + 'title' => 'Logs', + ), + 'menu' => array( + 'about' => 'About FreshRSS', + 'add_query' => 'Add a query', + 'before_one_day' => 'Before one day', + 'before_one_week' => 'Before one week', + 'favorites' => 'Favourites (%s)', + 'global_view' => 'Global view', + 'main_stream' => 'Main stream', + 'mark_all_read' => 'Mark all as read', + 'mark_cat_read' => 'Mark category as read', + 'mark_feed_read' => 'Mark feed as read', + 'newer_first' => 'Newer first', + 'non-starred' => 'Show all but favorites', + 'normal_view' => 'Normal view', + 'older_first' => 'Oldest first', + 'queries' => 'User queries', + 'read' => 'Show only read', + 'reader_view' => 'Reading view', + 'rss_view' => 'RSS feed', + 'search_short' => 'Search', + 'starred' => 'Show only favorites', + 'stats' => 'Statistics', + 'subscription' => 'Subscriptions management', + 'unread' => 'Show only unread', + ), + 'share' => 'Share', + 'tag' => array( + 'related' => 'Related tags', + ), +); diff --git a/app/i18n/ru/install.php b/app/i18n/ru/install.php new file mode 100644 index 000000000..1dea2cd66 --- /dev/null +++ b/app/i18n/ru/install.php @@ -0,0 +1,111 @@ +<?php + +return array( + 'action' => array( + 'finish' => 'Завершить установку', + 'fix_errors_before' => 'Пожалуйста, исправьте ошибки прежде чем переходить к следующему этапу.', + 'keep_install' => 'Сохранить предыдущую установку', + 'next_step' => 'Перейти к следующему этапу', + 'reinstall' => 'Переустановить FreshRSS', + ), + 'auth' => array( + 'form' => 'Вэб-форма (традиционный, необходим JavaScript)', + 'http' => 'HTTP (для продвинутых пользователей с HTTPS)', + 'none' => 'Никакого (опасно)', + 'password_form' => 'Пароль<br /><small>(для метода аутентификации на Вэб-формах)</small>', + 'password_format' => 'Как минимум 7 букв', + 'type' => 'Метод аутентификации', + ), + 'bdd' => array( + '_' => 'База данных', + 'conf' => array( + '_' => 'Конфигурация базы данныхDatabase configuration', + 'ko' => 'Проверьте конфигурацию базы данных.', + 'ok' => 'Конфигурация базы данных сохранена.', + ), + 'host' => 'Хост', + 'prefix' => 'Префикс таблицы', + 'password' => 'Пароль базы данных', + 'type' => 'Тип базы данных', + 'username' => 'Имя пользователя базы данных', + ), + 'check' => array( + '_' => 'Проверки', + 'already_installed' => 'Обнаружена предыдущая установка FreshRSS!', + 'cache' => array( + 'nok' => 'Проверьте права доступа к папке <em>./data/cache</em> . Сервер HTTP должен иметь права на запись в эту папку.', + 'ok' => 'Права на папку кэша в порядке.', + ), + 'ctype' => array( + 'nok' => 'У вас не установлена необходимая библиотека для проверки типов символов (php-ctype).', + 'ok' => 'У вас установлена необходимая библиотека для проверки типов символов (ctype).', + ), + 'curl' => array( + 'nok' => 'У вас нет расширения cURL (пакет php-curl).', + 'ok' => 'У вас установлено расширение cURL.', + ), + 'data' => array( + 'nok' => 'Проверьте права доступа к папке <em>./data</em> . Сервер HTTP должен иметь права на запись в эту папку.', + 'ok' => 'Права на <em>./data/</em> в порядке.', + ), + 'dom' => array( + 'nok' => 'У вас не установлена необходимая библиотека для просмотра DOM (пакет php-xml).', + 'ok' => 'У вас установлена необходимая библиотека для просмотра DOM.', + ), + 'favicons' => array( + 'nok' => 'Проверьте права доступа к папке <em>./data/favicons</em> . Сервер HTTP должен иметь права на запись в эту папку.', + 'ok' => 'Права на папку значков в порядке.', + ), + 'fileinfo' => array( + 'nok' => 'У вас нет расширения PHP fileinfo (пакет fileinfo).', + 'ok' => 'У вас установлено расширение fileinfo.', + ), + 'http_referer' => array( + 'nok' => 'Убедитесь, что вы не изменяете ваш HTTP REFERER.', + 'ok' => 'Ваш HTTP REFERER известен и соотвествует вашему серверу.', + ), + 'minz' => array( + 'nok' => 'У вас не установлен фрейворк Minz.', + 'ok' => 'У вас установлен фрейворк Minz.', + ), + 'pcre' => array( + 'nok' => 'У вас не установлена необходимая библиотека для работы с регулярными выражениями (php-pcre).', + 'ok' => 'У вас установлена необходимая библиотека для работы с регулярными выражениями (PCRE).', + ), + 'pdo' => array( + 'nok' => 'У вас не установлен PDO или один из необходимых драйверов (pdo_mysql, pdo_sqlite, pdo_pgsql).', + 'ok' => 'У вас установлен PDO и как минимум один из поддерживаемых драйверов (pdo_mysql, pdo_sqlite, pdo_pgsql).', + ), + 'php' => array( + 'nok' => 'У вас установлен PHP версии %s, но FreshRSS необходима версия не ниже %s.', + 'ok' => 'У вас установлен PHP версии %s, который совместим с FreshRSS.', + ), + 'users' => array( + 'nok' => 'Проверьте права доступа к папке <em>./data/users</em> . Сервер HTTP должен иметь права на запись в эту папку.', + 'ok' => 'Права на папку users в порядке.', + ), + ), + 'conf' => array( + '_' => 'Общие настройки', + 'ok' => 'Общие настройки были сохранены.', + ), + 'congratulations' => 'Поздравляем!', + 'default_user' => 'Имя пользователя по умолчанию <small>(максимум 16 латинских букв и/или цифр)</small>', + 'delete_articles_after' => 'Удалять статьи после', + 'fix_errors_before' => 'Пожалуйста, исправьте ошибки прежде чем переходить к следующему этапу..', + 'javascript_is_better' => 'FreshRSS принесёт больше удовольствия, если включить JavaScript', + 'js' => array( + 'confirm_reinstall' => 'Переустанавливая FreshRSS, вы потеряете предыдущую конфигурацию. Вы хотите продолжить?', + ), + 'language' => array( + '_' => 'Язык', + 'choose' => 'Выберите язык для FreshRSS', + 'defined' => 'Язык выбран.', + ), + 'not_deleted' => 'Что-то пошло не так; удалите файл <em>%s</em> вручную.', + 'ok' => 'Установка успешна.', + 'step' => '%d этап', + 'steps' => 'Этапы', + 'title' => 'Установка · FreshRSS', + 'this_is_the_end' => 'Это конец', +); diff --git a/app/i18n/ru/sub.php b/app/i18n/ru/sub.php new file mode 100644 index 000000000..789433ee6 --- /dev/null +++ b/app/i18n/ru/sub.php @@ -0,0 +1,62 @@ +<?php + +return array( + 'category' => array( + '_' => 'Category', + 'add' => 'Add a category', + 'empty' => 'Empty category', + 'new' => 'New category', + ), + 'feed' => array( + 'add' => 'Add a RSS feed', + 'advanced' => 'Advanced', + 'archiving' => 'Archivage', + 'auth' => array( + 'configuration' => 'Login', + 'help' => 'Connection allows to access HTTP protected RSS feeds', + 'http' => 'HTTP Authentication', + 'password' => 'HTTP password', + 'username' => 'HTTP username', + ), + 'css_help' => 'Retrieves truncated RSS feeds (caution, requires more time!)', + 'css_path' => 'Articles CSS path on original website', + '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 actualize 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 <em>%s</em>.', + 'no_selected' => 'No feed selected.', + 'number_entries' => '%d articles', + 'stats' => 'Statistics', + 'think_to_add' => 'You may add some feeds.', + 'title' => 'Title', + 'title_add' => 'Add a RSS feed', + 'ttl' => 'Do not automatically refresh more often than', + 'url' => 'Feed URL', + 'validator' => 'Check the validity of the feed', + 'website' => 'Website URL', + 'pubsubhubbub' => 'Instant notification with PubSubHubbub', + ), + 'import_export' => array( + 'export' => 'Export', + 'export_opml' => 'Export list of feeds (OPML)', + 'export_starred' => 'Export your favourites', + 'feed_list' => 'List of %s articles', + 'file_to_import' => 'File to import<br />(OPML, JSON or ZIP)', + 'file_to_import_no_zip' => 'File to import<br />(OPML or JSON)', + 'import' => 'Import', + 'starred_list' => 'List of favourite articles', + 'title' => 'Import / export', + ), + 'menu' => array( + 'bookmark' => 'Subscribe (FreshRSS bookmark)', + 'import_export' => 'Import / export', + 'subscription_management' => 'Subscriptions management', + ), + 'title' => array( + '_' => 'Subscriptions management', + 'feed_management' => 'RSS feeds management', + ), +); diff --git a/app/i18n/tr/admin.php b/app/i18n/tr/admin.php new file mode 100644 index 000000000..9d10ef9dd --- /dev/null +++ b/app/i18n/tr/admin.php @@ -0,0 +1,181 @@ +<?php + +return array( + 'auth' => array( + 'allow_anonymous' => 'Öntanımlı kullanıcının makalelerinin anonim okunmasına izin ver (%s)', + 'allow_anonymous_refresh' => 'Anonim makale yenilemesine izin ver', + 'api_enabled' => '<abbr>API</abbr> erişimine izin ver <small>(mobil uygulamalar için gerekli)</small>', + 'form' => 'Web formu (geleneksel, JavaScript gerektirir)', + 'http' => 'HTTP (ileri kullanıcılar için, HTTPS)', + 'none' => 'Hiçbiri (tehlikeli)', + 'title' => 'Kimlik doğrulama', + 'title_reset' => 'Kimlik doğrulama sıfırla', + 'token' => 'Kimlik doğrulama işareti', + 'token_help' => 'Kimlik doğrulama olmaksızın öntanımlı kullanıcının RSS çıktısına erişime izin ver:', + 'type' => 'Kimlik doğrulama yöntemi', + 'unsafe_autologin' => 'Güvensiz otomatik girişe izin ver: ', + ), + 'check_install' => array( + 'cache' => array( + 'nok' => '<em>./data/cache</em> klasör yetkisini kontrol edin. HTTP yazma yetkisi olmalı', + 'ok' => 'Önbellek klasörü yetkileri sorunsuz.', + ), + 'categories' => array( + 'nok' => 'Kategori tablosu kötü yapılandırılmış.', + 'ok' => 'Kategori tablosu sorunsuz.', + ), + 'connection' => array( + 'nok' => 'Veritabanı ile bağlantı kurulamıyor.', + 'ok' => 'Veritabanı ile bağlantı sorunsuz.', + ), + 'ctype' => array( + 'nok' => 'Karakter yazım kontrolü için kütüphane eksik (php-ctype).', + 'ok' => 'Karakter yazım kontrolü için kütüphane sorunsuz (ctype).', + ), + 'curl' => array( + 'nok' => 'cURL eksik (php-curl package).', + 'ok' => 'cURL eklentisi sorunsuz.', + ), + 'data' => array( + 'nok' => '<em>./data</em> klasör yetkisini kontrol edin. HTTP yazma yetkisi olmalı', + 'ok' => 'Veri klasörü yetkileri sorunsuz.', + ), + 'database' => 'Veritabanı kurulumu', + 'dom' => array( + 'nok' => 'DOM kütüpbanesi eksik (php-xml package).', + 'ok' => 'DOM kütüphanesi sorunsuz.', + ), + 'entries' => array( + 'nok' => 'Giriş tablosu kötü yapılandırılmış.', + 'ok' => 'Giriş tablosu sorunsuz.', + ), + 'favicons' => array( + 'nok' => '<em>./data/favicons</em> klasör yetkisini kontrol edin. HTTP yazma yetkisi olmalı', + 'ok' => 'Site ikonu klasörü yetkileri sorunsuz.', + ), + 'feeds' => array( + 'nok' => 'Akış tablosu kötü yapılandırılmış.', + 'ok' => 'Akış tablosu sorunsuz.', + ), + 'fileinfo' => array( + 'nok' => 'PHP fileinfo eksik (fileinfo package).', + 'ok' => 'fileinfo eklentisi sorunsuz.', + ), + 'files' => 'Dosya kurulumu', + 'json' => array( + 'nok' => 'JSON eklentisi eksik (php5-json package).', + 'ok' => 'JSON eklentisi sorunsuz.', + ), + 'minz' => array( + 'nok' => 'Minz framework eksik.', + 'ok' => 'Minz framework sorunsuz.', + ), + 'pcre' => array( + 'nok' => 'Düzenli ifadeler kütüphanesi eksik (php-pcre).', + 'ok' => 'Düzenli ifadeler kütüphanesi sorunsuz (PCRE).', + ), + 'pdo' => array( + 'nok' => 'PDO veya PDO destekli bir sürücü eksik (pdo_mysql, pdo_sqlite, pdo_pgsql).', + 'ok' => 'PDO sorunsuz (pdo_mysql, pdo_sqlite, pdo_pgsql).', + ), + 'php' => array( + '_' => 'PHP kurulumu', + 'nok' => 'PHP versiyonunuz %s fakat FreshRSS için gerekli olan en düşük sürüm %s.', + 'ok' => 'PHP versiyonunuz %s, FreshRSS ile tam uyumlu.', + ), + 'tables' => array( + 'nok' => 'Veritabanında bir veya daha fazla tablo eksik.', + 'ok' => 'Veritabanı tabloları sorunsuz.', + ), + 'title' => 'Kurulum kontrolü', + 'tokens' => array( + 'nok' => '<em>./data/tokens</em> klasör yetkisini kontrol edin. HTTP yazma yetkisi olmalı', + 'ok' => 'İşaretler klasörü yetkileri sorunsuz..', + ), + 'users' => array( + 'nok' => '<em>./data/users</em> klasör yetkisini kontrol edin. HTTP yazma yetkisi olmalı', + 'ok' => 'Kullanıcılar klasörü yetkileri sorunsuz.', + ), + 'zip' => array( + 'nok' => 'ZIP eklentisi eksik (php-zip package).', + 'ok' => 'ZIP eklentisi sorunsuz.', + ), + ), + 'extensions' => array( + 'disabled' => 'Pasif', + 'empty_list' => 'Yüklenmiş eklenti bulunmamaktadır', + 'enabled' => 'Aktif', + 'no_configure_view' => 'Bu eklenti yapılandırılamaz.', + 'system' => array( + '_' => 'Sistem eklentileri', + 'no_rights' => 'Sistem eklentileri (düzenleme hakkınız yok)', + ), + 'title' => 'Eklentiler', + 'user' => 'Kullanıcı eklentileri', + ), + 'stats' => array( + '_' => 'İstatistikler', + 'all_feeds' => 'Tüm akış', + 'category' => 'Kategori', + 'entry_count' => 'Makale sayısı', + 'entry_per_category' => 'Kategori başı makale sayısı', + 'entry_per_day' => 'Günlük makale sayısı (last 30 days)', + 'entry_per_day_of_week' => 'Haftanın günü (ortalama: %.2f makale)', + 'entry_per_hour' => 'Saatlik (ortalama: %.2f makale)', + 'entry_per_month' => 'Aylık (average: %.2f makale)', + 'entry_repartition' => 'Giriş dağılımı', + 'feed' => 'Akış', + 'feed_per_category' => 'Kategoriye göre akışlar', + 'idle' => 'Boştaki akışlar', + 'main' => 'Ana istatistikler', + 'main_stream' => 'Ana akış', + 'menu' => array( + 'idle' => 'Boştaki akışlar', + 'main' => 'Ana istatistikler', + 'repartition' => 'Makale dağılımı', + ), + 'no_idle' => 'Boşta akış yok!', + 'number_entries' => '%d makale', + 'percent_of_total' => '%% toplamın yüzdesi', + 'repartition' => 'Makale dağılımı', + 'status_favorites' => 'Favoriler', + 'status_read' => 'Okunmuş', + 'status_total' => 'Toplam', + 'status_unread' => 'Okunmamış', + 'title' => 'İstatistikler', + 'top_feed' => 'İlk 10 akış', + ), + 'system' => array( + '_' => 'Sistem yapılandırması', + 'auto-update-url' => 'Otomatik güncelleme sunucu URL', + 'instance-name' => 'Örnek isim', + 'max-categories' => 'Kullanıcı başına kategori limiti', + 'max-feeds' => 'Kullanıcı başına akış limiti', + 'registration' => array( + 'help' => '0 sınır yok anlamındadır', + 'number' => 'En fazla hesap sayısı', + ), + ), + 'update' => array( + '_' => 'Sistem güncelleme', + 'apply' => 'Uygula', + 'check' => 'Güncelleme kontrolü', + 'current_version' => 'Mevcut FreshRSS sürümünüz %s.', + 'last' => 'Son kontrol: %s', + 'none' => 'Yeni güncelleme yok', + 'title' => 'Sistem güncelleme', + ), + 'user' => array( + 'articles_and_size' => '%s makale (%s)', + 'create' => 'Yeni kullanıcı oluştur', + 'language' => 'Dil', + 'number' => 'Oluşturulmuş %d hesap var', + 'numbers' => 'Oluşturulmuş %d hesap var', + 'password_form' => 'Şifre<br /><small>(Tarayıcı girişi için)</small>', + 'password_format' => 'En az 7 karakter', + 'title' => 'Kullanıcıları yönet', + 'user_list' => 'Kullanıcı listesi', + 'username' => 'Kullanıcı adı', + 'users' => 'Kullanıcılar', + ), +); diff --git a/app/i18n/tr/conf.php b/app/i18n/tr/conf.php new file mode 100644 index 000000000..2fdc248e4 --- /dev/null +++ b/app/i18n/tr/conf.php @@ -0,0 +1,173 @@ +<?php + +return array( + 'archiving' => array( + '_' => 'Arşiv', + 'advanced' => 'Gelişmiş', + 'delete_after' => 'Makelelerin tutulacağı süre', + 'help' => 'Akış ayarlarında daha çok ayar bulabilirsiniz', + 'keep_history_by_feed' => 'Akışta en az tutulacak makale sayısı', + 'optimize' => 'Veritabanı optimize et', + 'optimize_help' => 'Bu işlem bazen veritabanı boyutunu düşürmeye yardımcı olur', + 'purge_now' => 'Şimdi temizle', + 'title' => 'Arşiv', + 'ttl' => 'Şu süreden sık otomatik yenileme yapma', + ), + 'display' => array( + '_' => 'Görünüm', + 'icon' => array( + 'bottom_line' => 'Alt çizgi', + 'entry' => 'Makale ikonları', + 'publication_date' => 'Yayınlama Tarihi', + 'related_tags' => 'İlgili etiketler', + 'sharing' => 'Paylaşım', + 'top_line' => 'Üst çizgi', + ), + 'language' => 'Dil', + 'notif_html5' => array( + 'seconds' => 'saniye (0 zaman aşımı yok demektir)', + 'timeout' => 'HTML5 bildirim zaman aşımı', + ), + 'theme' => 'Tema', + 'title' => 'Görünüm', + 'width' => array( + 'content' => 'İçerik genişliği', + 'large' => 'Geniş', + 'medium' => 'Orta', + 'no_limit' => 'Sınırsız', + 'thin' => 'Zayıf', + ), + ), + 'query' => array( + '_' => 'Kullanıcı sorguları', + 'deprecated' => 'Bu sorgu artık geçerli değil. İlgili akış veya kategori silinmiş.', + 'filter' => 'Filtre uygulandı:', + 'get_all' => 'Tüm makaleleri göster', + 'get_category' => '"%s" kategorisini göster', + 'get_favorite' => 'Favori makaleleri göster', + 'get_feed' => '"%s" akışını göster', + 'no_filter' => 'Filtre yok', + 'none' => 'Henüz hiç kullanıcı sorgusu oluşturmadınız.', + 'number' => 'Sorgu n°%d', + 'order_asc' => 'Önce eski makaleleri göster', + 'order_desc' => 'Önce yeni makaleleri göster', + 'search' => '"%s" için arama', + 'state_0' => 'Tüm makaleleri göster', + 'state_1' => 'Okunmuş makaleleri göster', + 'state_2' => 'Okunmamış makaleleri göster', + 'state_3' => 'Tüm makaleleri göster', + 'state_4' => 'Favori makaleleri göster', + 'state_5' => 'Okunmuş favori makaleleri göster', + 'state_6' => 'Okunmamış favori makaleleri göster', + 'state_7' => 'Favori makaleleri göster', + 'state_8' => 'Favori olmayan makaleleri göster', + 'state_9' => 'Favori olmayan okunmuş makaleleri göster', + 'state_10' => 'Favori olmayan okunmamış makaleleri göster', + 'state_11' => 'Favori olmayan makaleleri göster', + 'state_12' => 'Tüm makaleleri göster', + 'state_13' => 'Okunmuş makaleleri göster', + 'state_14' => 'Okunmamış makaleleri göster', + 'state_15' => 'Tüm makaleleri göster', + 'title' => 'Kullanıcı sorguları', + ), + 'profile' => array( + '_' => 'Profil yönetimi', + 'delete' => array( + '_' => 'Hesap silme', + 'warn' => 'Hesabınız ve tüm verileriniz silinecek.', + ), + 'password_api' => 'API Şifresi<br /><small>(ör. mobil uygulamalar için)</small>', + 'password_form' => 'Şifre<br /><small>(Tarayıcı girişi için)</small>', + 'password_format' => 'En az 7 karakter', + 'title' => 'Profil', + ), + 'reading' => array( + '_' => 'Okuma', + 'after_onread' => '"Hepsini okundu say" dedinten sonra,', + 'articles_per_page' => 'Sayfa başına makale sayısı', + 'auto_load_more' => 'Sayfa sonunda yeni makaleleri yükle', + 'auto_remove_article' => 'Okuduktan sonra makaleleri gizle', + 'mark_updated_article_unread' => 'Güncellenen makaleleri okundu olarak işaretle', + 'confirm_enabled' => '"Hepsini okundu say" eylemi için onay iste', + 'display_articles_unfolded' => 'Show articles unfolded by default', + 'display_categories_unfolded' => 'Show categories folded by default', + 'hide_read_feeds' => 'Okunmamış makalesi olmayan kategori veya akışı gizle ("Tüm makaleleri göster" komutunda çalışmaz)', + 'img_with_lazyload' => 'Resimleri yüklemek için "tembel modu" kullan', + 'jump_next' => 'Bir sonraki benzer okunmamışa geç (akış veya kategori)', + 'number_divided_when_reader' => 'Okuma modunda ikiye bölünecek.', + 'read' => array( + 'article_open_on_website' => 'orijinal makale sitesi açıldığında', + 'article_viewed' => 'makale görüntülendiğinde', + 'scroll' => 'kaydırma yapılırken', + 'upon_reception' => 'makale üzerinde gelince', + 'when' => 'Makaleyi okundu olarak işaretle…', + ), + 'show' => array( + '_' => 'Gösterilecek makaleler', + 'adaptive' => 'Ayarlanmış gösterim', + 'all_articles' => 'Tüm makaleleri göster', + 'unread' => 'Sadece okunmamış makaleleri göster', + ), + 'sort' => array( + '_' => 'Sıralama', + 'newer_first' => 'Önce yeniler', + 'older_first' => 'Önce eskiler', + ), + 'sticky_post' => 'Makale açıldığında yukarı getir', + 'title' => 'Okuma', + 'view' => array( + 'default' => 'Öntanımlı görünüm', + 'global' => 'Global görünüm', + 'normal' => 'Normal görünüm', + 'reader' => 'Okuma görünümü', + ), + ), + 'sharing' => array( + '_' => 'Paylaşım', + 'blogotext' => 'Blogotext', + 'diaspora' => 'Diaspora*', + 'email' => 'Email', + 'facebook' => 'Facebook', + 'g+' => 'Google+', + 'more_information' => 'Daha fazla bilgi', + 'print' => 'Yazdır', + 'shaarli' => 'Shaarli', + 'share_name' => 'Paylaşım ismi', + 'share_url' => 'Paylaşım URL si', + 'title' => 'Paylaşım', + 'twitter' => 'Twitter', + 'wallabag' => 'wallabag', + ), + 'shortcut' => array( + '_' => 'Kısayollar', + 'article_action' => 'Makale eylemleri', + 'auto_share' => 'Paylaş', + 'auto_share_help' => 'Sadece 1 paylaşım modu varsa bu kullanılır. Yoksa kendi paylaşım numaraları ile kullanılır.', + 'close_dropdown' => 'Menüleri kapat', + 'collapse_article' => 'Kapat', + 'first_article' => 'İlk makaleyi atla', + 'focus_search' => 'Arama kutusuna eriş', + 'help' => 'Dokümantasyonu göster', + 'javascript' => 'Kısayolları kullanabilmek için JavaScript aktif olmalıdır', + 'last_article' => 'Son makaleyi atla', + 'load_more' => 'Daha fazla makale yükle', + 'mark_read' => 'Okundu olarak işaretle', + 'mark_favorite' => 'Favori olarak işaretle', + 'navigation' => 'Genel eylemler', + 'navigation_help' => '"Shift" tuşu ile kısayollar akışlar için geçerli olur.<br/>"Alt" tuşu ile kısayollar kategoriler için geçerli olur.', + 'next_article' => 'Sonraki makaleye geç', + 'other_action' => 'Diğer eylemler', + 'previous_article' => 'Önceki makaleye geç', + 'see_on_website' => 'Orijinal sitede göster', + 'shift_for_all_read' => '+ <code>shift</code> 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.', + ), + 'user' => array( + 'articles_and_size' => '%s makale (%s)', + 'current' => 'Mevcut kullanıcı', + 'is_admin' => 'yöneticidir', + 'users' => 'Kullanıcılar', + ), +); diff --git a/app/i18n/tr/feedback.php b/app/i18n/tr/feedback.php new file mode 100644 index 000000000..87361ff51 --- /dev/null +++ b/app/i18n/tr/feedback.php @@ -0,0 +1,109 @@ +<?php + +return array( + 'admin' => array( + 'optimization_complete' => 'Optimizasyon tamamlandı', + ), + 'access' => array( + 'denied' => 'Bu sayfaya erişim yetkiniz yok', + 'not_found' => 'Varolmayan bir sayfa arıyorsunuz', + ), + 'auth' => array( + 'form' => array( + 'not_set' => 'Sistem yapılandırma kimlik doğrulaması sırasında hata oldu. Lütfen daha sonra tekrar deneyin.', + 'set' => 'Kimlik doğrulama sistemi tamamnaldı.', + ), + 'login' => array( + 'invalid' => 'Giriş geçersiz', + 'success' => 'Bağlantı kuruldu', + ), + 'logout' => array( + 'success' => 'Bağlantı koptu', + ), + 'no_password_set' => 'Yönetici şifresi ayarlanmadı. Bu özellik kullanıma uygun değil.', + ), + 'conf' => array( + 'error' => 'Yapılandırma ayarları kaydedilirken hata oluştu', + 'query_created' => 'Sorgu "%s" oluşturuldu.', + 'shortcuts_updated' => 'Kısayollar yenilendi', + 'updated' => 'Yapılandırm ayarları yenilendi', + ), + 'extensions' => array( + 'already_enabled' => '%s zaten aktif', + 'disable' => array( + 'ko' => '%s gösterilemiyor. Detaylar için <a href="%s">FressRSS log kayıtlarını</a> kontrol edin.', + 'ok' => '%s pasif', + ), + 'enable' => array( + 'ko' => '%s aktifleştirilemiyor. Detaylar için <a href="%s">FressRSS log kayıtlarını</a> kontrol edin.', + 'ok' => '%s aktif', + ), + 'no_access' => '%s de yetkiniz yok', + 'not_enabled' => '%s henüz aktif değil', + 'not_found' => '%s bulunmamaktadır', + ), + 'import_export' => array( + 'export_no_zip_extension' => 'ZIP eklentisi mevcut sunucunuzda yer almıyor. Lütfen başka dosya formatında dışarı aktarmayı deneyin.', + 'feeds_imported' => 'Akışlarınız içe aktarıldı ve şimdi güncellenecek', + 'feeds_imported_with_errors' => 'Akışlarınız içeri aktarıldı ama bazı hatalar meydana geldi', + 'file_cannot_be_uploaded' => 'Dosya yüklenemedi!', + 'no_zip_extension' => 'ZIP eklentisi mevcut sunucunuzda yer almıyor.', + 'zip_error' => 'ZIP içe aktarımı sırasında hata meydana geldi.', + ), + 'sub' => array( + 'actualize' => 'Güncelleme', + 'category' => array( + 'created' => 'Kategori %s oluşturuldu.', + 'deleted' => 'Kategori silindi.', + 'emptied' => 'Kategori boşaltıldı', + 'error' => 'Kategori güncellenemedi', + 'name_exists' => 'Kategori ismi zaten bulunmakta.', + 'no_id' => 'Kategori id sinden emin olmalısınız.', + 'no_name' => 'Kategori ismi boş olamaz.', + 'not_delete_default' => 'Öntanımlı kategoriyi silemezsiniz!', + 'not_exist' => 'Kategori bulunmamakta!', + 'over_max' => 'Kategori limitini aştınız (%d)', + 'updated' => 'Karegori güncellendi.', + ), + 'feed' => array( + 'actualized' => '<em>%s</em> güncellendi', + 'actualizeds' => 'RSS akışları güncellendi', + 'added' => '<em>%s</em> RSS akışı eklendi', + 'already_subscribed' => '<em>%s</em> için zaten aboneliğiniz bulunmakta', + 'deleted' => 'Akış silindi', + 'error' => 'Akış güncellenemiyor', + 'internal_problem' => 'RSS akışı eklenemiyor. Detaylar için <a href="%s">FressRSS log kayıtlarını</a> kontrol edin.', + 'invalid_url' => 'URL <em>%s</em> geçersiz', + 'marked_read' => 'Akışlar okundu olarak işaretlendi', + 'n_actualized' => '%d akışları güncellendi', + 'n_entries_deleted' => '%d makaleleri silindi', + 'no_refresh' => 'Yenilenecek akış yok…', + 'not_added' => '<em>%s</em> eklenemedi', + 'over_max' => 'Akış limitini aştınız (%d)', + 'updated' => 'Akış güncellendi', + ), + 'purge_completed' => 'Temizleme tamamlandı (%d makale silindi)', + ), + 'update' => array( + 'can_apply' => 'FreshRSS <strong>%s versiyonuna</strong> güncellenecek.', + 'error' => 'Güncelleme işlemi sırasında hata: %s', + 'file_is_nok' => '<em>%s</em> klasör yetkisini kontrol edin. HTTP yazma yetkisi olmalı', + 'finished' => 'Güncelleme tamamlandı!', + 'none' => 'Güncelleme yok', + 'server_not_found' => 'Güncelleme sunucusu bulunamadı. [%s]', + ), + 'user' => array( + 'created' => array( + '_' => '%s kullanıcısı oluşturuldu', + 'error' => '%s kullanıcısı oluşturulamadı', + ), + 'deleted' => array( + '_' => '%s kullanıcısı silindi', + 'error' => '%s kullanıcısı silinemedi', + ), + ), + 'profile' => array( + 'error' => 'Profiliniz düzenlenemedi', + 'updated' => 'Profiliniz düzenlendi', + ), +); diff --git a/app/i18n/tr/gen.php b/app/i18n/tr/gen.php new file mode 100644 index 000000000..bcc839daf --- /dev/null +++ b/app/i18n/tr/gen.php @@ -0,0 +1,182 @@ +<?php + +return array( + 'action' => array( + 'actualize' => 'Yenile', + 'back_to_rss_feeds' => '← RSS akışlarınız için geri gidin', + 'cancel' => 'İptal', + 'create' => 'Oluştur', + 'disable' => 'Pasif', + 'empty' => 'Boş', + 'enable' => 'Aktif', + 'export' => 'Dışa Aktar', + 'filter' => 'Filtrele', + 'import' => 'İçe Aktar', + 'manage' => 'Yönet', + 'mark_read' => 'Okundu olarak işaretle', + 'mark_favorite' => 'Favoriye ekle', + 'remove' => 'Sil', + 'see_website' => 'Siteyi gör', + 'submit' => 'Onayla', + 'truncate' => 'Tüm makaleleri sil', + ), + 'auth' => array( + 'email' => 'Email adresleri', + 'keep_logged_in' => '<small>(%s günler)</small> oturumu açık tut', + 'login' => 'Giriş', + 'logout' => 'Çıkış', + 'password' => array( + '_' => 'Şifre', + 'format' => '<small>En az 7 karakter</small>', + ), + 'registration' => array( + '_' => 'Yeni hesap', + 'ask' => 'Yeni bir hesap oluştur', + 'title' => 'Hesap oluşturma', + ), + 'reset' => 'Kimlik doğrulama sıfırla', + 'username' => array( + '_' => 'Kullancı adı', + 'admin' => 'Yönetici kullanıcı adı', + 'format' => '<small>en fazla 16 alfanümerik karakter</small>', + ), + ), + 'date' => array( + 'Apr' => '\\N\\i\\s\\a\\n', + 'Aug' => '\\A\\ğ\\u\\s\\t\\o\\s', + 'Dec' => '\\A\\r\\a\\l\\ı\\k', + 'Feb' => '\\Ş\\u\\b\\a\\t', + 'Jan' => '\\O\\c\\a\\k', + 'Jul' => '\\T\\e\\m\\m\\u\\z', + 'Jun' => '\\H\\a\\z\\i\\r\\a\\n', + 'Mar' => '\\M\\a\\r\\t', + 'May' => '\\M\\a\\y\\ı\\s', + 'Nov' => '\\K\\a\\s\\ı\\m', + 'Oct' => '\\E\\k\\i\\m', + 'Sep' => '\\E\\y\\l\\ü\\l', + 'apr' => 'nis', + 'april' => 'Nis', + 'aug' => 'ağu', + 'august' => 'Ağu', + 'before_yesterday' => 'Dünden önceki gün', + 'dec' => 'ara', + 'december' => 'Ara', + 'feb' => 'şub', + 'february' => 'Şub', + 'format_date' => '%s j\\<\\s\\u\\p\\>S\\<\\/\\s\\u\\p\\> Y', + 'format_date_hour' => '%s j\\<\\s\\u\\p\\>S\\<\\/\\s\\u\\p\\> Y \\a\\t H\\:i', + 'fri' => 'Cum', + 'jan' => 'oca', + 'january' => 'Oca', + 'jul' => 'tem', + 'july' => 'Tem', + 'jun' => 'haz', + 'june' => 'Haz', + 'last_3_month' => 'Son 3 ay', + 'last_6_month' => 'Son 6 ay', + 'last_month' => 'Geçen ay', + 'last_week' => 'Geçen hafta', + 'last_year' => 'Geçen yıl', + 'mar' => 'mar', + 'march' => 'Mar', + 'may' => 'May', + 'mon' => 'Pzt', + 'month' => 'ay', + 'nov' => 'kas', + 'november' => 'Kas', + 'oct' => 'ekm', + 'october' => 'Ekm', + 'sat' => 'Cts', + 'sep' => 'eyl', + 'september' => 'Eyl', + 'sun' => 'Pzr', + 'thu' => 'Per', + 'today' => 'Bugün', + 'tue' => 'Sal', + 'wed' => 'Çar', + 'yesterday' => 'Dün', + ), + 'freshrss' => array( + '_' => 'FreshRSS', + 'about' => 'FreshRSS hakkında', + ), + 'js' => array( + 'category_empty' => 'Boş kategori', + 'confirm_action' => 'Bunu yapmak istediğinize emin misiniz ? Daha sonra iptal edilemez!', + 'confirm_action_feed_cat' => 'Bunu yapmak istediğinize emin misiniz ? Favorileriniz ve sorgularınız silinecek. Daha sonra iptal edilemez!', + 'feedback' => array( + 'body_new_articles' => 'FreshRSS de okunmaz üzere %%d yeni makale var.', + 'request_failed' => 'Hata. İnternet bağlantınızı kontrol edin.', + 'title_new_articles' => 'FreshRSS: yeni makaleler!', + ), + 'new_article' => 'Yeni makaleler mevcut. Sayfayı yenilemek için tıklayın.', + 'should_be_activated' => 'JavaScript aktif olmalıdır.', + ), + 'lang' => array( + 'cz' => 'Čeština', + 'de' => 'Deutsch', + 'en' => 'English', + 'fr' => 'Français', + 'it' => 'Italiano', + 'nl' => 'Nederlands', + 'ru' => 'Русский', + 'tr' => 'Türkçe', + ), + 'menu' => array( + 'about' => 'Hakkında', + 'admin' => 'Yönetim', + 'archiving' => 'Arşiv', + 'authentication' => 'Kimlik doğrulama', + 'check_install' => 'Kurulum kontrolü', + 'configuration' => 'Yapılandırma', + 'display' => 'Görünüm', + 'extensions' => 'Eklentiler', + 'logs' => 'Log kayıtları', + 'queries' => 'Kullanıcı sorguları', + 'reading' => 'Okuma', + 'search' => 'Kelime veya #etiket ara', + 'sharing' => 'Paylaşım', + 'shortcuts' => 'Kısayollar', + 'stats' => 'İstatistikler', + 'system' => 'Sistem yapılandırması', + 'update' => 'Güncelleme', + 'user_management' => 'Kullanıcıları yönet', + 'user_profile' => 'Profil', + ), + 'pagination' => array( + 'first' => 'İlk', + 'last' => 'Son', + 'load_more' => 'Daha fazla makale yükle', + 'mark_all_read' => 'Tümünü okundu say', + 'next' => 'Sonraki', + 'nothing_to_load' => 'Başka makale yok', + 'previous' => 'Önceki', + ), + 'share' => array( + 'blogotext' => 'Blogotext', + 'diaspora' => 'Diaspora*', + 'email' => 'Email', + 'facebook' => 'Facebook', + 'g+' => 'Google+', + 'movim' => 'Movim', + 'print' => 'Print', + 'shaarli' => 'Shaarli', + 'twitter' => 'Twitter', + 'wallabag' => 'wallabag v1', + 'wallabagv2' => 'wallabag v2', + 'jdh' => 'Journal du hacker', + ), + 'short' => array( + 'attention' => 'Tehlike!', + 'blank_to_disable' => 'Devredışı bırakmak için boş bırakın', + 'by_author' => '<em>%s</em> tarafından', + 'by_default' => 'Öntanımlı', + 'damn' => 'Hay aksi!', + 'default_category' => 'Kategorisiz', + 'no' => 'Hayır', + 'not_applicable' => 'Uygun değil', + 'ok' => 'Tamam!', + 'or' => 'ya da', + 'yes' => 'Evet', + ), +); diff --git a/app/i18n/tr/index.php b/app/i18n/tr/index.php new file mode 100644 index 000000000..cb36d6717 --- /dev/null +++ b/app/i18n/tr/index.php @@ -0,0 +1,61 @@ +<?php + +return array( + 'about' => array( + '_' => 'Hakkında', + 'agpl3' => '<a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL 3</a>', + 'bugs_reports' => 'Hata raporu', + 'credits' => 'Tanıtım', + 'credits_content' => 'Bu frameworkü kullanmamasına rağmen FreshRSS bazı tasarım ögelerini <a href="http://twitter.github.io/bootstrap/">Bootstrap</a> dan almıştır. <a href="https://git.gnome.org/browse/gnome-icon-theme-symbolic">İkonlar</a> <a href="https://www.gnome.org/">GNOME projesinden</a> alınmıştır. <em>Open Sans</em> yazı tipi <a href="https://fonts.google.com/specimen/Open+Sans">Steve Matteson</a> tarafından oluşturulmuştur. FreshRSS bir PHP framework olan <a href="https://github.com/marienfressinaud/MINZ">Minz</a> i temel alır.', + 'freshrss_description' => 'FreshRSS <a href="http://tontof.net/kriss/feed/">Kriss Feed</a> veya <a href="http://projet.idleman.fr/leed/">Leed</a> gibi kendi hostunuzda çalışan bir RSS akış toplayıcısıdır. Güçlü ve yapılandırılabilir araçlarıyla basit ve kullanımı kolay bir uygulamadır.', + 'github' => '<a href="https://github.com/FreshRSS/FreshRSS/issues">Github sayfası</a>', + 'license' => 'Lisans', + 'project_website' => 'Proje sayfası', + 'title' => 'Hakkında', + 'version' => 'Versiyon', + 'website' => 'Website', + ), + 'feed' => array( + 'add' => 'Akış ekleyebilirsin.', + 'empty' => 'Gösterilecek makale yok.', + 'rss_of' => 'RSS feed of %s', + 'title' => 'RSS akışlarınız', + 'title_global' => 'Global görünüm', + 'title_fav' => 'Favorilerin', + ), + 'log' => array( + '_' => 'Log Kayıtları', + 'clear' => 'Log kayıt dosyasını temizle', + 'empty' => 'Log kayır dosyası boş', + 'title' => 'Log Kayıtları', + ), + 'menu' => array( + 'about' => 'FreshRSS hakkında', + 'add_query' => 'Sorgu ekle', + 'before_one_day' => 'Bir gün önce', + 'before_one_week' => 'Bir hafta önce', + 'favorites' => 'Favoriler (%s)', + 'global_view' => 'Global görünüm', + 'main_stream' => 'Ana akış', + 'mark_all_read' => 'Hepsini okundu olarak işaretle', + 'mark_cat_read' => 'Kategoriyi okundu olarak işaretle', + 'mark_feed_read' => 'Akışı okundu olarak işaretle', + 'newer_first' => 'Önce yeniler', + 'non-starred' => 'Favori dışındakileri göster', + 'normal_view' => 'Normal görünüm', + 'older_first' => 'Önce eskiler', + 'queries' => 'Kullanıcı sorguları', + 'read' => 'Okunmuşları göster', + 'reader_view' => 'Okuma görünümü', + 'rss_view' => 'RSS akışı', + 'search_short' => 'Ara', + 'starred' => 'Favorileri göster', + 'stats' => 'İstatistikler', + 'subscription' => 'Abonelik yönetimi', + 'unread' => 'Okunmamışları göster', + ), + 'share' => 'Share', + 'tag' => array( + 'related' => 'İlgili etiketler', + ), +); diff --git a/app/i18n/tr/install.php b/app/i18n/tr/install.php new file mode 100644 index 000000000..d5564297b --- /dev/null +++ b/app/i18n/tr/install.php @@ -0,0 +1,119 @@ +<?php + +return array( + 'action' => array( + 'finish' => 'Kurulumu tamamla', + 'fix_errors_before' => 'Lütfen sonraki adıma geçmek için hataları düzeltin.', + 'keep_install' => 'Önceki kuruluma devam et', + 'next_step' => 'Sonraki adım', + 'reinstall' => 'FreshRSS i yeniden yükle', + ), + 'auth' => array( + 'form' => 'Web formu (geleneksel, JavaScript gerektirir)', + 'http' => 'HTTP (ileri kullanıcılar için, HTTPS)', + 'none' => 'Hiçbiri (tehlikeli)', + 'password_form' => 'Şifre<br /><small>(Tarayıcı girişi için)</small>', + 'password_format' => 'En az 7 karakter', + 'type' => 'Kimlik doğrulama yöntemi', + ), + 'bdd' => array( + '_' => 'Veritabanı', + 'conf' => array( + '_' => 'Veritabanı yapılandırılması', + 'ko' => 'Veritabanı bilginizi doğrulayın.', + 'ok' => 'Veritabanı yapılandırılması kayıt edildi.', + ), + 'host' => 'Sunucu', + 'prefix' => 'Tablo ön eki', + 'password' => 'Veritabanı şifresi', + 'type' => 'Veritabanı türü', + 'username' => 'Veritabanı kullanıcı adı', + ), + 'check' => array( + '_' => 'Kontroller', + 'already_installed' => 'FreshRSS zaten yüklü!', + 'cache' => array( + 'nok' => '<em>./data/cache</em> klasör yetkisini kontrol edin. HTTP yazma yetkisi olmalı', + 'ok' => 'Önbellek klasörü yetkileri sorunsuz.', + ), + 'ctype' => array( + 'nok' => 'Karakter yazım kontrolü için kütüphane eksik (php-ctype).', + 'ok' => 'Karakter yazım kontrolü için kütüphane sorunsuz (ctype).', + ), + 'curl' => array( + 'nok' => 'cURL eksik (php-curl package).', + 'ok' => 'cURL eklentisi sorunsuz.', + ), + 'data' => array( + 'nok' => '<em>./data</em> klasör yetkisini kontrol edin. HTTP yazma yetkisi olmalı', + 'ok' => 'Veri klasörü yetkileri sorunsuz.', + ), + 'dom' => array( + 'nok' => 'DOM kütüpbanesi eksik.', + 'ok' => 'DOM kütüphanesi sorunsuz.', + ), + 'favicons' => array( + 'nok' => '<em>./data/favicons</em> klasör yetkisini kontrol edin. HTTP yazma yetkisi olmalı', + 'ok' => 'Site ikonu klasörü yetkileri sorunsuz.', + ), + 'fileinfo' => array( + 'nok' => 'PHP fileinfo eksik (fileinfo package).', + 'ok' => 'fileinfo eklentisi sorunsuz.', + ), + 'http_referer' => array( + 'nok' => 'Lütfen HTTP REFERER değiştirmediğinize emin olun.', + 'ok' => 'HTTP REFERER ve sunucunuz arası iletişim sorunsuz.', + ), + 'json' => array( + 'nok' => 'Tavsiye edilen JSON çözümleme kütüphanesi eksik.', + 'ok' => 'Tavsiye edilen JSON çözümleme kütüphanesi sorunsuz.', + ), + 'minz' => array( + 'nok' => 'Minz framework eksik.', + 'ok' => 'Minz framework sorunsuz.', + ), + 'pcre' => array( + 'nok' => 'Düzenli ifadeler kütüphanesi eksik (php-pcre).', + 'ok' => 'Düzenli ifadeler kütüphanesi sorunsuz (PCRE).', + ), + 'pdo' => array( + 'nok' => 'PDO veya PDO destekli bir sürücü eksik (pdo_mysql, pdo_sqlite, pdo_pgsql).', + 'ok' => 'PDO sorunsuz (pdo_mysql, pdo_sqlite, pdo_pgsql).', + ), + 'php' => array( + 'nok' => 'PHP versiyonunuz %s fakat FreshRSS için gerekli olan en düşük sürüm %s.', + 'ok' => 'PHP versiyonunuz %s, FreshRSS ile tam uyumlu.', + ), + 'users' => array( + 'nok' => '<em>./data/users</em> klasör yetkisini kontrol edin. HTTP yazma yetkisi olmalı', + 'ok' => 'Kullanıcılar klasörü yetkileri sorunsuz.', + ), + 'xml' => array( + 'nok' => 'You lack the required library to parse XML.', + 'ok' => 'You have the required library to parse XML.', + ), + ), + 'conf' => array( + '_' => 'Genel yapılandırma', + 'ok' => 'Genel yapılandırma ayarları kayıt edildi.', + ), + 'congratulations' => 'Tebrikler!', + 'default_user' => 'Öntanımlı kullanıcı adı <small>(en fazla 16 alfanümerik karakter)</small>', + 'delete_articles_after' => 'Makaleleri şu süre sonunda sil', + 'fix_errors_before' => 'Lütfen sonraki adıma geçmek için hataları düzeltin.', + 'javascript_is_better' => 'FreshRSS JavaScript ile daha işlevseldir', + 'js' => array( + 'confirm_reinstall' => 'FressRSS i yeniden kurarak önceki yapılandırma ayarlarınızı kaybedeceksiniz. Devam etmek istiyor musunuz ?', + ), + 'language' => array( + '_' => 'Dil', + 'choose' => 'FreshRSS için bir dil seçin', + 'defined' => 'Dil belirlendi.', + ), + 'not_deleted' => 'Hata meydana geldi; <em>%s</em> dosyasını elle silmelisiniz.', + 'ok' => 'Kurulum başarıyla tamamlandı.', + 'step' => 'adım %d', + 'steps' => 'Adımlar', + 'title' => 'Kurulum · FreshRSS', + 'this_is_the_end' => 'Son Adım', +); diff --git a/app/i18n/tr/sub.php b/app/i18n/tr/sub.php new file mode 100644 index 000000000..7592096d9 --- /dev/null +++ b/app/i18n/tr/sub.php @@ -0,0 +1,62 @@ +<?php + +return array( + 'category' => array( + '_' => 'Kategori', + 'add' => 'Kategori ekle', + 'empty' => 'Boş kategori', + 'new' => 'Yeni kategori', + ), + 'feed' => array( + 'add' => 'RSS akışı ekle', + 'advanced' => 'Gelişmiş', + 'archiving' => 'Arşiv', + 'auth' => array( + 'configuration' => 'Giriş', + 'help' => 'HTTP korumalı RSS akışlarına bağlantı izni sağlar', + 'http' => 'HTTP Kimlik Doğrulama', + 'password' => 'HTTP şifre', + 'username' => 'HTTP kullanıcı adı', + ), + 'css_help' => 'Dikkat, daha çok zaman gerekir!', + 'css_path' => 'Makaleleri kendi CSS görünümü ile göster', + '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 <em>%s</em> içerisine yerleşir.', + 'no_selected' => 'Hiçbir akış seçilmedi.', + 'number_entries' => '%d makale', + 'stats' => 'İstatistikler', + 'think_to_add' => 'Akış ekleyebilirsiniz.', + 'title' => 'Başlık', + 'title_add' => 'RSS akışı ekle', + 'ttl' => 'Şu kadar süreden fazla otomatik yenileme yapma', + 'url' => 'Akış URL', + 'validator' => 'Akış geçerliliğini kontrol edin', + 'website' => 'Site URL', + 'pubsubhubbub' => 'PubSubHubbub ile anlık bildirim', + ), + 'import_export' => array( + 'export' => 'Dışa aktar', + 'export_opml' => 'Akış listesini dışarı aktar (OPML)', + 'export_starred' => 'Favorileri dışarı aktar', + 'feed_list' => '%s makalenin listesi', + 'file_to_import' => 'Dosyadan içe aktar<br />(OPML, JSON or ZIP)', + 'file_to_import_no_zip' => 'Dosyadan içe aktar<br />(OPML or JSON)', + 'import' => 'İçe aktar', + 'starred_list' => 'Favori makaleleirn listesi', + 'title' => 'İçe / dışa aktar', + ), + 'menu' => array( + 'bookmark' => 'Abonelik (FreshRSS yer imleri)', + 'import_export' => 'İçe / dışa aktar', + 'subscription_management' => 'Abonelik yönetimi', + ), + 'title' => array( + '_' => 'Abonelik yönetimi', + 'feed_management' => 'RSS akış yönetimi', + ), +); diff --git a/app/install.php b/app/install.php new file mode 100644 index 000000000..986a7dc60 --- /dev/null +++ b/app/install.php @@ -0,0 +1,786 @@ +<?php +if (function_exists('opcache_reset')) { + opcache_reset(); +} +header("Content-Security-Policy: default-src 'self'"); + +require(LIB_PATH . '/lib_install.php'); + +session_name('FreshRSS'); +session_set_cookie_params(0, dirname(empty($_SERVER['REQUEST_URI']) ? '/' : dirname($_SERVER['REQUEST_URI'])), null, false, true); +session_start(); + +if (isset($_GET['step'])) { + define('STEP',(int)$_GET['step']); +} else { + define('STEP', 0); +} + +if (STEP === 3 && isset($_POST['type'])) { + $_SESSION['bd_type'] = $_POST['type']; +} + +if (isset($_SESSION['bd_type'])) { + switch ($_SESSION['bd_type']) { + case 'mysql': + include_once(APP_PATH . '/SQL/install.sql.mysql.php'); + break; + case 'sqlite': + include_once(APP_PATH . '/SQL/install.sql.sqlite.php'); + break; + case 'pgsql': + include_once(APP_PATH . '/SQL/install.sql.pgsql.php'); + break; + } +} + +function param($key, $default = false) { + if (isset($_POST[$key])) { + return $_POST[$key]; + } else { + return $default; + } +} + + +// gestion internationalisation +function initTranslate() { + Minz_Translate::init(); + $available_languages = Minz_Translate::availableLanguages(); + + if (!isset($_SESSION['language'])) { + $_SESSION['language'] = get_best_language(); + } + + if (!in_array($_SESSION['language'], $available_languages)) { + $_SESSION['language'] = 'en'; + } + + Minz_Translate::reset($_SESSION['language']); +} + +function get_best_language() { + $accept = $_SERVER['HTTP_ACCEPT_LANGUAGE']; + return strtolower(substr($accept, 0, 2)); +} + + +/*** SAUVEGARDES ***/ +function saveLanguage() { + if (!empty($_POST)) { + if (!isset($_POST['language'])) { + return false; + } + + $_SESSION['language'] = $_POST['language']; + + header('Location: index.php?step=1'); + } +} + +function saveStep1() { + if (isset($_POST['freshrss-keep-install']) && + $_POST['freshrss-keep-install'] === '1') { + // We want to keep our previous installation of FreshRSS + // so we need to make next steps valid by setting $_SESSION vars + // with values from the previous installation + + // First, we try to get previous configurations + Minz_Configuration::register('system', + join_path(DATA_PATH, 'config.php'), + join_path(DATA_PATH, 'config.default.php')); + $system_conf = Minz_Configuration::get('system'); + + $current_user = $system_conf->default_user; + Minz_Configuration::register('user', + join_path(USERS_PATH, $current_user, 'config.php'), + join_path(USERS_PATH, '_', 'config.default.php')); + $user_conf = Minz_Configuration::get('user'); + + // Then, we set $_SESSION vars + $_SESSION['title'] = $system_conf->title; + $_SESSION['auth_type'] = $system_conf->auth_type; + $_SESSION['old_entries'] = $user_conf->old_entries; + $_SESSION['default_user'] = $current_user; + $_SESSION['passwordHash'] = $user_conf->passwordHash; + + $db = $system_conf->db; + $_SESSION['bd_type'] = $db['type']; + $_SESSION['bd_host'] = $db['host']; + $_SESSION['bd_user'] = $db['user']; + $_SESSION['bd_password'] = $db['password']; + $_SESSION['bd_base'] = $db['base']; + $_SESSION['bd_prefix'] = $db['prefix']; + $_SESSION['bd_error'] = ''; + + header('Location: index.php?step=4'); + } +} + +function saveStep2() { + $user_default_config = Minz_Configuration::get('default_user'); + if (!empty($_POST)) { + $system_default_config = Minz_Configuration::get('default_system'); + $_SESSION['title'] = $system_default_config->title; + $_SESSION['old_entries'] = param('old_entries', $user_default_config->old_entries); + $_SESSION['auth_type'] = param('auth_type', 'form'); + $_SESSION['default_user'] = substr(preg_replace('/[^a-zA-Z0-9]/', '', param('default_user', '')), 0, 16); + + $password_plain = param('passwordPlain', false); + if ($password_plain !== false && cryptAvailable()) { + $_SESSION['passwordHash'] = FreshRSS_user_Controller::hashPassword($password_plain); + } + + if (empty($_SESSION['old_entries']) || + empty($_SESSION['auth_type']) || + empty($_SESSION['default_user'])) { + return false; + } + + if ($_SESSION['auth_type'] === 'form' && empty($_SESSION['passwordHash'])) { + return false; + } + + $_SESSION['salt'] = generateSalt(); + if ((!ctype_digit($_SESSION['old_entries'])) ||($_SESSION['old_entries'] < 1)) { + $_SESSION['old_entries'] = $user_default_config->old_entries; + } + + $token = ''; + + $config_array = array( + 'language' => $_SESSION['language'], + 'theme' => $user_default_config->theme, + 'old_entries' => $_SESSION['old_entries'], + 'passwordHash' => $_SESSION['passwordHash'], + 'token' => $token, + ); + + // Create default user files but first, we delete previous data to + // avoid access right problems. + $user_dir = join_path(USERS_PATH, $_SESSION['default_user']); + $user_config_path = join_path($user_dir, 'config.php'); + + recursive_unlink($user_dir); + mkdir($user_dir); + file_put_contents($user_config_path, "<?php\n return " . var_export($config_array, true) . ";\n"); + + header('Location: index.php?step=3'); + } +} + +function saveStep3() { + if (!empty($_POST)) { + if ($_SESSION['bd_type'] === 'sqlite') { + $_SESSION['bd_base'] = $_SESSION['default_user']; + $_SESSION['bd_host'] = ''; + $_SESSION['bd_user'] = ''; + $_SESSION['bd_password'] = ''; + $_SESSION['bd_prefix'] = ''; + $_SESSION['bd_prefix_user'] = ''; //No prefix for SQLite + } else { + if (empty($_POST['type']) || + empty($_POST['host']) || + empty($_POST['user']) || + empty($_POST['base'])) { + $_SESSION['bd_error'] = 'Missing parameters!'; + } + $_SESSION['bd_base'] = substr($_POST['base'], 0, 64); + $_SESSION['bd_host'] = $_POST['host']; + $_SESSION['bd_user'] = $_POST['user']; + $_SESSION['bd_password'] = $_POST['pass']; + $_SESSION['bd_prefix'] = substr($_POST['prefix'], 0, 16); + $_SESSION['bd_prefix_user'] = $_SESSION['bd_prefix'] . (empty($_SESSION['default_user']) ? '' : ($_SESSION['default_user'] . '_')); + } + if ($_SESSION['bd_type'] === 'pgsql') { + $_SESSION['bd_base'] = strtolower($_SESSION['bd_base']); + } + + // We use dirname to remove the /i part + $base_url = dirname(Minz_Request::guessBaseUrl()); + $config_array = array( + 'salt' => $_SESSION['salt'], + 'base_url' => $base_url, + 'title' => $_SESSION['title'], + 'default_user' => $_SESSION['default_user'], + 'auth_type' => $_SESSION['auth_type'], + 'db' => array( + 'type' => $_SESSION['bd_type'], + 'host' => $_SESSION['bd_host'], + 'user' => $_SESSION['bd_user'], + 'password' => $_SESSION['bd_password'], + 'base' => $_SESSION['bd_base'], + 'prefix' => $_SESSION['bd_prefix'], + 'pdo_options' => array(), + ), + 'pubsubhubbub_enabled' => server_is_public($base_url), + ); + + @unlink(join_path(DATA_PATH, 'config.php')); //To avoid access-rights problems + file_put_contents(join_path(DATA_PATH, 'config.php'), "<?php\n return " . var_export($config_array, true) . ";\n"); + + $config_array['db']['default_user'] = $config_array['default_user']; + $config_array['db']['prefix_user'] = $_SESSION['bd_prefix_user']; + $ok = checkDb($config_array['db']) && checkDbUser($config_array['db']); + if (!$ok) { + @unlink(join_path(DATA_PATH, 'config.php')); + } + + if ($ok) { + $_SESSION['bd_error'] = ''; + header('Location: index.php?step=4'); + } else { + $_SESSION['bd_error'] = empty($config_array['db']['error']) ? 'Unknown error!' : $config_array['db']['error']; + } + } + invalidateHttpCache(); +} + + +/*** VÉRIFICATIONS ***/ +function checkStep() { + $s0 = checkStep0(); + $s1 = checkRequirements(); + $s2 = checkStep2(); + $s3 = checkStep3(); + if (STEP > 0 && $s0['all'] != 'ok') { + header('Location: index.php?step=0'); + } elseif (STEP > 1 && $s1['all'] != 'ok') { + header('Location: index.php?step=1'); + } elseif (STEP > 2 && $s2['all'] != 'ok') { + header('Location: index.php?step=2'); + } elseif (STEP > 3 && $s3['all'] != 'ok') { + header('Location: index.php?step=3'); + } + $_SESSION['actualize_feeds'] = true; +} + +function checkStep0() { + $languages = Minz_Translate::availableLanguages(); + $language = isset($_SESSION['language']) && + in_array($_SESSION['language'], $languages); + + return array( + 'language' => $language ? 'ok' : 'ko', + 'all' => $language ? 'ok' : 'ko' + ); +} + +function freshrss_already_installed() { + $conf_path = join_path(DATA_PATH, 'config.php'); + if (!file_exists($conf_path)) { + return false; + } + + // A configuration file already exists, we try to load it. + $system_conf = null; + try { + Minz_Configuration::register('system', $conf_path); + $system_conf = Minz_Configuration::get('system'); + } catch (Minz_FileNotExistException $e) { + return false; + } + + // ok, the global conf exists... but what about default user conf? + $current_user = $system_conf->default_user; + try { + Minz_Configuration::register('user', join_path(USERS_PATH, $current_user, 'config.php')); + } catch (Minz_FileNotExistException $e) { + return false; + } + + // ok, ok, default user exists too! + return true; +} + +function checkStep2() { + $conf = !empty($_SESSION['old_entries']) && + !empty($_SESSION['default_user']); + + $form = ( + isset($_SESSION['auth_type']) && + ($_SESSION['auth_type'] != 'form' || !empty($_SESSION['passwordHash'])) + ); + + $defaultUser = empty($_POST['default_user']) ? null : $_POST['default_user']; + if ($defaultUser === null) { + $defaultUser = empty($_SESSION['default_user']) ? '' : $_SESSION['default_user']; + } + $data = is_writable(join_path(USERS_PATH, $defaultUser, 'config.php')); + + return array( + 'conf' => $conf ? 'ok' : 'ko', + 'form' => $form ? 'ok' : 'ko', + 'data' => $data ? 'ok' : 'ko', + 'all' => $conf && $form && $data ? 'ok' : 'ko' + ); +} + +function checkStep3() { + $conf = is_writable(join_path(DATA_PATH, 'config.php')); + + $bd = isset($_SESSION['bd_type']) && + isset($_SESSION['bd_host']) && + isset($_SESSION['bd_user']) && + isset($_SESSION['bd_password']) && + isset($_SESSION['bd_base']) && + isset($_SESSION['bd_prefix']) && + isset($_SESSION['bd_error']); + $conn = empty($_SESSION['bd_error']); + + return array( + 'bd' => $bd ? 'ok' : 'ko', + 'conn' => $conn ? 'ok' : 'ko', + 'conf' => $conf ? 'ok' : 'ko', + 'all' => $bd && $conn && $conf ? 'ok' : 'ko' + ); +} + +function checkDbUser(&$dbOptions) { + $ok = false; + $str = $dbOptions['dsn']; + $driver_options = $dbOptions['options']; + try { + $c = new PDO($str, $dbOptions['user'], $dbOptions['password'], $driver_options); + + if (defined('SQL_CREATE_TABLES')) { + $sql = sprintf(SQL_CREATE_TABLES, $dbOptions['prefix_user'], _t('gen.short.default_category')); + $stm = $c->prepare($sql); + $ok = $stm->execute(); + } else { + global $SQL_CREATE_TABLES; + if (is_array($SQL_CREATE_TABLES)) { + $ok = true; + foreach ($SQL_CREATE_TABLES as $instruction) { + $sql = sprintf($instruction, $dbOptions['prefix_user'], _t('gen.short.default_category')); + $stm = $c->prepare($sql); + $ok &= $stm->execute(); + } + } + } + + if (defined('SQL_INSERT_FEEDS')) { + $sql = sprintf(SQL_INSERT_FEEDS, $dbOptions['prefix_user']); + $stm = $c->prepare($sql); + $ok &= $stm->execute(); + } else { + global $SQL_INSERT_FEEDS; + if (is_array($SQL_INSERT_FEEDS)) { + foreach ($SQL_INSERT_FEEDS as $instruction) { + $sql = sprintf($instruction, $dbOptions['prefix_user']); + $stm = $c->prepare($sql); + $ok &= $stm->execute(); + } + } + } + } catch (PDOException $e) { + $ok = false; + $dbOptions['error'] = $e->getMessage(); + } + return $ok; +} + +/*** AFFICHAGE ***/ +function printStep0() { + $actual = Minz_Translate::language(); + $languages = Minz_Translate::availableLanguages(); +?> + <?php $s0 = checkStep0(); if ($s0['all'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('gen.short.ok'); ?></span> <?php echo _t('install.language.defined'); ?></p> + <?php } ?> + + <form action="index.php?step=0" method="post"> + <legend><?php echo _t('install.language.choose'); ?></legend> + <div class="form-group"> + <label class="group-name" for="language"><?php echo _t('install.language'); ?></label> + <div class="group-controls"> + <select name="language" id="language" tabindex="1" > + <?php foreach ($languages as $lang) { ?> + <option value="<?php echo $lang; ?>"<?php echo $actual == $lang ? ' selected="selected"' : ''; ?>> + <?php echo _t('gen.lang.' . $lang); ?> + </option> + <?php } ?> + </select> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important" tabindex="2" ><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn" tabindex="3" ><?php echo _t('gen.action.cancel'); ?></button> + <?php if ($s0['all'] == 'ok') { ?> + <a class="btn btn-important next-step" href="?step=1" tabindex="4" ><?php echo _t('install.action.next_step'); ?></a> + <?php } ?> + </div> + </div> + </form> +<?php +} + +// @todo refactor this view with the check_install action +function printStep1() { + $res = checkRequirements(); +?> + <noscript><p class="alert alert-warn"><span class="alert-head"><?php echo _t('gen.short.attention'); ?></span> <?php echo _t('install.javascript_is_better'); ?></p></noscript> + + <?php if ($res['php'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('gen.short.ok'); ?></span> <?php echo _t('install.check.php.ok', PHP_VERSION); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('install.check.php.nok', PHP_VERSION, '5.3.3'); ?></p> + <?php } ?> + + <?php if ($res['minz'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('gen.short.ok'); ?></span> <?php echo _t('install.check.minz.ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('install.check.minz.nok', join_path(LIB_PATH, 'Minz')); ?></p> + <?php } ?> + + <?php if ($res['pdo'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('gen.short.ok'); ?></span> <?php echo _t('install.check.pdo.ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('install.check.pdo.nok'); ?></p> + <?php } ?> + + <?php if ($res['curl'] == 'ok') { ?> + <?php $version = curl_version(); ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('gen.short.ok'); ?></span> <?php echo _t('install.check.curl.ok', $version['version']); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('install.check.curl.nok'); ?></p> + <?php } ?> + + <?php if ($res['json'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('gen.short.ok'); ?></span> <?php echo _t('install.check.json.ok'); ?></p> + <?php } else { ?> + <p class="alert alert-warn"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('install.check.json.nok'); ?></p> + <?php } ?> + + <?php if ($res['pcre'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('gen.short.ok'); ?></span> <?php echo _t('install.check.pcre.ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('install.check.pcre.nok'); ?></p> + <?php } ?> + + <?php if ($res['ctype'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('gen.short.ok'); ?></span> <?php echo _t('install.check.ctype.ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('install.check.ctype.nok'); ?></p> + <?php } ?> + + <?php if ($res['dom'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('gen.short.ok'); ?></span> <?php echo _t('install.check.dom.ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('install.check.dom.nok'); ?></p> + <?php } ?> + + <?php if ($res['xml'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('gen.short.ok'); ?></span> <?php echo _t('install.check.xml.ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('install.check.xml.nok'); ?></p> + <?php } ?> + + <?php if ($res['fileinfo'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('gen.short.ok'); ?></span> <?php echo _t('install.check.fileinfo.ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('install.check.fileinfo.nok'); ?></p> + <?php } ?> + + <?php if ($res['data'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('gen.short.ok'); ?></span> <?php echo _t('install.check.data.ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('install.check.data.nok', DATA_PATH); ?></p> + <?php } ?> + + <?php if ($res['cache'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('gen.short.ok'); ?></span> <?php echo _t('install.check.cache.ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('install.check.cache.nok', CACHE_PATH); ?></p> + <?php } ?> + + <?php if ($res['users'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('gen.short.ok'); ?></span> <?php echo _t('install.check.users.ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('install.check.users.nok', USERS_PATH); ?></p> + <?php } ?> + + <?php if ($res['favicons'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('gen.short.ok'); ?></span> <?php echo _t('install.check.favicons.ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('install.check.favicons.nok', DATA_PATH . '/favicons'); ?></p> + <?php } ?> + + <?php if ($res['http_referer'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('gen.short.ok'); ?></span> <?php echo _t('install.check.http_referer.ok'); ?></p> + <?php } else { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('install.check.http_referer.nok'); ?></p> + <?php } ?> + + <?php if (freshrss_already_installed() && $res['all'] == 'ok') { ?> + <p class="alert alert-warn"><span class="alert-head"><?php echo _t('gen.short.attention'); ?></span> <?php echo _t('install.check.already_installed'); ?></p> + + <form action="index.php?step=1" method="post"> + <input type="hidden" name="freshrss-keep-install" value="1" /> + <button type="submit" class="btn btn-important next-step" tabindex="1" ><?php echo _t('install.action.keep_install'); ?></button> + <a class="btn btn-attention next-step confirm" data-str-confirm="<?php echo _t('install.js.confirm_reinstall'); ?>" href="?step=2" tabindex="2" ><?php echo _t('install.action.reinstall'); ?></a> + </form> + + <?php } elseif ($res['all'] == 'ok') { ?> + <a class="btn btn-important next-step" href="?step=2" tabindex="1" ><?php echo _t('install.action.next_step'); ?></a> + <?php } else { ?> + <p class="alert alert-error"><?php echo _t('install.action.fix_errors_before'); ?></p> + <?php } ?> +<?php +} + +function printStep2() { + $user_default_config = Minz_Configuration::get('default_user'); +?> + <?php $s2 = checkStep2(); if ($s2['all'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('gen.short.ok'); ?></span> <?php echo _t('install.conf.ok'); ?></p> + <?php } elseif (!empty($_POST)) { ?> + <p class="alert alert-error"><?php echo _t('install.fix_errors_before'); ?></p> + <?php } ?> + + <form action="index.php?step=2" method="post"> + <legend><?php echo _t('install.conf'); ?></legend> + + <div class="form-group"> + <label class="group-name" for="old_entries"><?php echo _t('install.delete_articles_after'); ?></label> + <div class="group-controls"> + <input type="number" id="old_entries" name="old_entries" required="required" min="1" max="1200" value="<?php echo isset($_SESSION['old_entries']) ? $_SESSION['old_entries'] : $user_default_config->old_entries; ?>" tabindex="2" /> <?php echo _t('gen.date.month'); ?> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="default_user"><?php echo _t('install.default_user'); ?></label> + <div class="group-controls"> + <input type="text" id="default_user" name="default_user" required="required" size="16" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" value="<?php echo isset($_SESSION['default_user']) ? $_SESSION['default_user'] : ''; ?>" placeholder="<?php echo httpAuthUser() == '' ? 'alice' : httpAuthUser(); ?>" tabindex="3" /> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="auth_type"><?php echo _t('install.auth.type'); ?></label> + <div class="group-controls"> + <select id="auth_type" name="auth_type" required="required" tabindex="4"> + <?php + function no_auth($auth_type) { + return !in_array($auth_type, array('form', 'http_auth', 'none')); + } + $auth_type = isset($_SESSION['auth_type']) ? $_SESSION['auth_type'] : ''; + ?> + <option value="form"<?php echo $auth_type === 'form' || (no_auth($auth_type) && cryptAvailable()) ? ' selected="selected"' : '', cryptAvailable() ? '' : ' disabled="disabled"'; ?>><?php echo _t('install.auth.form'); ?></option> + <option value="http_auth"<?php echo $auth_type === 'http_auth' ? ' selected="selected"' : '', httpAuthUser() == '' ? ' disabled="disabled"' : ''; ?>><?php echo _t('install.auth.http'); ?>(REMOTE_USER = '<?php echo httpAuthUser(); ?>')</option> + <option value="none"<?php echo $auth_type === 'none' || (no_auth($auth_type) && !cryptAvailable()) ? ' selected="selected"' : ''; ?>><?php echo _t('install.auth.none'); ?></option> + </select> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="passwordPlain"><?php echo _t('install.auth.password_form'); ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="password" id="passwordPlain" name="passwordPlain" pattern=".{7,}" autocomplete="off" <?php echo $auth_type === 'form' ? ' required="required"' : ''; ?> tabindex="5" /> + <a class="btn toggle-password" data-toggle="passwordPlain"><?php echo FreshRSS_Themes::icon('key'); ?></a> + </div> + <?php echo _i('help'); ?> <?php echo _t('install.auth.password_format'); ?> + <noscript><b><?php echo _t('gen.js.should_be_activated'); ?></b></noscript> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important" tabindex="7" ><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn" tabindex="8" ><?php echo _t('gen.action.cancel'); ?></button> + <?php if ($s2['all'] == 'ok') { ?> + <a class="btn btn-important next-step" href="?step=3" tabindex="9" ><?php echo _t('install.action.next_step'); ?></a> + <?php } ?> + </div> + </div> + </form> +<?php +} + +function printStep3() { + $system_default_config = Minz_Configuration::get('default_system'); +?> + <?php $s3 = checkStep3(); if ($s3['all'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('gen.short.ok'); ?></span> <?php echo _t('install.bdd.conf.ok'); ?></p> + <?php } elseif ($s3['conn'] == 'ko') { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('install.bdd.conf.ko'),(empty($_SESSION['bd_error']) ? '' : ' : ' . $_SESSION['bd_error']); ?></p> + <?php } ?> + + <form action="index.php?step=3" method="post" autocomplete="off"> + <legend><?php echo _t('install.bdd.conf'); ?></legend> + <div class="form-group"> + <label class="group-name" for="type"><?php echo _t('install.bdd.type'); ?></label> + <div class="group-controls"> + <select name="type" id="type" tabindex="1"> + <?php if (extension_loaded('pdo_mysql')) {?> + <option value="mysql" + <?php echo(isset($_SESSION['bd_type']) && $_SESSION['bd_type'] === 'mysql') ? 'selected="selected"' : ''; ?>> + MySQL + </option> + <?php }?> + <?php if (extension_loaded('pdo_sqlite')) {?> + <option value="sqlite" + <?php echo(isset($_SESSION['bd_type']) && $_SESSION['bd_type'] === 'sqlite') ? 'selected="selected"' : ''; ?>> + SQLite + </option> + <?php }?> + <?php if (extension_loaded('pdo_pgsql')) {?> + <option value="pgsql" + <?php echo(isset($_SESSION['bd_type']) && $_SESSION['bd_type'] === 'pgsql') ? 'selected="selected"' : ''; ?>> + PostgreSQL (⚠️ experimental) + </option> + <?php }?> + </select> + </div> + </div> + + <div id="mysql"> + <div class="form-group"> + <label class="group-name" for="host"><?php echo _t('install.bdd.host'); ?></label> + <div class="group-controls"> + <input type="text" id="host" name="host" pattern="[0-9A-Z/a-z_.-]{1,64}(:[0-9]{2,5})?" value="<?php echo isset($_SESSION['bd_host']) ? $_SESSION['bd_host'] : $system_default_config->db['host']; ?>" tabindex="2" /> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="user"><?php echo _t('install.bdd.username'); ?></label> + <div class="group-controls"> + <input type="text" id="user" name="user" maxlength="16" pattern="[0-9A-Za-z_.-]{1,16}" value="<?php echo isset($_SESSION['bd_user']) ? $_SESSION['bd_user'] : ''; ?>" tabindex="3" /> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="pass"><?php echo _t('install.bdd.password'); ?></label> + <div class="group-controls"> + <input type="password" id="pass" name="pass" value="<?php echo isset($_SESSION['bd_password']) ? $_SESSION['bd_password'] : ''; ?>" tabindex="4" autocomplete="off" /> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="base"><?php echo _t('install.bdd'); ?></label> + <div class="group-controls"> + <input type="text" id="base" name="base" maxlength="64" pattern="[0-9A-Za-z_]{1,64}" value="<?php echo isset($_SESSION['bd_base']) ? $_SESSION['bd_base'] : ''; ?>" tabindex="5" /> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="prefix"><?php echo _t('install.bdd.prefix'); ?></label> + <div class="group-controls"> + <input type="text" id="prefix" name="prefix" maxlength="16" pattern="[0-9A-Za-z_]{1,16}" value="<?php echo isset($_SESSION['bd_prefix']) ? $_SESSION['bd_prefix'] : $system_default_config->db['prefix']; ?>" tabindex="6" /> + </div> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important" tabindex="7" ><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn" tabindex="8" ><?php echo _t('gen.action.cancel'); ?></button> + <?php if ($s3['all'] == 'ok') { ?> + <a class="btn btn-important next-step" href="?step=4" tabindex="9" ><?php echo _t('install.action.next_step'); ?></a> + <?php } ?> + </div> + </div> + </form> +<?php +} + +function printStep4() { +?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t('install.congratulations'); ?></span> <?php echo _t('install.ok'); ?></p> + <a class="btn btn-important next-step" href="?step=5" tabindex="1"><?php echo _t('install.action.finish'); ?></a> +<?php +} + +function printStep5() { +?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('install.not_deleted', DATA_PATH . '/do-install.txt'); ?></p> +<?php +} + +initTranslate(); + +checkStep(); + +switch (STEP) { +case 0: +default: + saveLanguage(); + break; +case 1: + saveStep1(); + break; +case 2: + saveStep2(); + break; +case 3: + saveStep3(); + break; +case 4: + break; +case 5: + if (deleteInstall()) { + header('Location: index.php'); + } + break; +} +?> +<!DOCTYPE html> +<html> + <head> + <meta charset="UTF-8" /> + <meta name="viewport" content="initial-scale=1.0" /> + <title><?php echo _t('install.title'); ?></title> + <link rel="stylesheet" href="../themes/base-theme/template.css?<?php echo @filemtime(PUBLIC_PATH . '/themes/base-theme/template.css'); ?>" /> + <link rel="stylesheet" href="../themes/Origine/origine.css?<?php echo @filemtime(PUBLIC_PATH . '/themes/Origine/origine.css'); ?>" /> + <meta name="robots" content="noindex,nofollow" /> + </head> + <body> + +<div class="header"> + <div class="item title"> + <h1><a href="index.php"><?php echo _t('install.title'); ?></a></h1> + <h2><?php echo _t('install.step', STEP); ?></h2> + </div> +</div> + +<div id="global"> + <ul class="nav nav-list aside"> + <li class="nav-header"><?php echo _t('install.steps'); ?></li> + <li class="item<?php echo STEP == 0 ? ' active' : ''; ?>"><a href="?step=0"><?php echo _t('install.language'); ?></a></li> + <li class="item<?php echo STEP == 1 ? ' active' : ''; ?>"><a href="?step=1"><?php echo _t('install.check'); ?></a></li> + <li class="item<?php echo STEP == 2 ? ' active' : ''; ?>"><a href="?step=2"><?php echo _t('install.conf'); ?></a></li> + <li class="item<?php echo STEP == 3 ? ' active' : ''; ?>"><a href="?step=3"><?php echo _t('install.bdd.conf'); ?></a></li> + <li class="item<?php echo STEP == 4 ? ' active' : ''; ?>"><a href="?step=4"><?php echo _t('install.this_is_the_end'); ?></a></li> + </ul> + + <div class="post"> + <?php + switch (STEP) { + case 0: + default: + printStep0(); + break; + case 1: + printStep1(); + break; + case 2: + printStep2(); + break; + case 3: + printStep3(); + break; + case 4: + printStep4(); + break; + case 5: + printStep5(); + break; + } + ?> + </div> +</div> + <script src="../scripts/install.js?<?php echo @filemtime(PUBLIC_PATH . '/scripts/install.js'); ?>"></script> + </body> +</html> diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml index 27f11ab6d..d956ec21f 100644 --- a/app/layout/aside_configure.phtml +++ b/app/layout/aside_configure.phtml @@ -1,19 +1,49 @@ <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> + <li class="nav-header"><?php echo _t('gen.menu.configuration'); ?></li> + <li class="item<?php echo Minz_Request::actionName() === 'display' ? ' active' : ''; ?>"> + <a href="<?php echo _url('configure', 'display'); ?>"><?php echo _t('gen.menu.display'); ?></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> + <li class="item<?php echo Minz_Request::actionName() === 'reading' ? ' active' : ''; ?>"> + <a href="<?php echo _url('configure', 'reading'); ?>"><?php echo _t('gen.menu.reading'); ?></a> </li> - <li class="item<?php echo Minz_Request::actionName () == 'sharing' ? ' active' : ''; ?>"> - <a href="<?php echo _url ('configure', 'sharing'); ?>"><?php echo Minz_Translate::t ('sharing'); ?></a> + <li class="item<?php echo Minz_Request::actionName() === 'archiving' ? ' active' : ''; ?>"> + <a href="<?php echo _url('configure', 'archiving'); ?>"><?php echo _t('gen.menu.archiving'); ?></a> </li> - <li class="item<?php echo Minz_Request::actionName () == 'shortcut' ? ' active' : ''; ?>"> - <a href="<?php echo _url ('configure', 'shortcut'); ?>"><?php echo Minz_Translate::t ('shortcuts'); ?></a> + <li class="item<?php echo Minz_Request::actionName() === 'sharing' ? ' active' : ''; ?>"> + <a href="<?php echo _url('configure', 'sharing'); ?>"><?php echo _t('gen.menu.sharing'); ?></a> </li> - <li class="separator"></li> - <li class="item<?php echo Minz_Request::actionName () == 'users' ? ' active' : ''; ?>"> - <a href="<?php echo _url ('configure', 'users'); ?>"><?php echo Minz_Translate::t ('users'); ?></a> + <li class="item<?php echo Minz_Request::actionName() === 'shortcut' ? ' active' : ''; ?>"> + <a href="<?php echo _url('configure', 'shortcut'); ?>"><?php echo _t('gen.menu.shortcuts'); ?></a> </li> + <li class="item<?php echo Minz_Request::actionName() === 'queries' ? ' active' : ''; ?>"> + <a href="<?php echo _url('configure', 'queries'); ?>"><?php echo _t('gen.menu.queries'); ?></a> + </li> + <li class="item<?php echo Minz_Request::controllerName() === 'user' && + Minz_Request::actionName() === 'profile'? ' active' : ''; ?>"> + <a href="<?php echo _url('user', 'profile'); ?>"><?php echo _t('gen.menu.user_profile'); ?></a> + </li> + <li class="item<?php echo Minz_Request::controllerName() === 'extension' ? ' active' : ''; ?>"> + <a href="<?php echo _url('extension', 'index'); ?>"><?php echo _t('gen.menu.extensions'); ?></a> + </li> + <?php if (FreshRSS_Auth::hasAccess('admin')) { ?> + <li class="nav-header"><?php echo _t('gen.menu.admin'); ?></li> + <li class="item<?php echo Minz_Request::actionName() === 'system' ? ' active' : ''; ?>"> + <a href="<?php echo _url('configure', 'system')?>"><?php echo _t('gen.menu.system'); ?></a> + </li> + <li class="item<?php echo Minz_Request::controllerName() === 'user' && + Minz_Request::actionName() === 'manage' ? ' active' : ''; ?>"> + <a href="<?php echo _url('user', 'manage'); ?>"><?php echo _t('gen.menu.user_management'); ?></a> + </li> + <li class="item<?php echo Minz_Request::controllerName() === 'auth' ? ' active' : ''; ?>"> + <a href="<?php echo _url('auth', 'index'); ?>"><?php echo _t('gen.menu.authentication'); ?></a> + </li> + <li class="item<?php echo Minz_Request::controllerName() === 'update' && + Minz_Request::actionName() === 'checkInstall' ? ' active' : ''; ?>"> + <a href="<?php echo _url('update', 'checkInstall'); ?>"><?php echo _t('gen.menu.check_install'); ?></a> + </li> + <li class="item<?php echo Minz_Request::controllerName() === 'update' && + Minz_Request::actionName() === 'index' ? ' active' : ''; ?>"> + <a href="<?php echo _url('update', 'index'); ?>"><?php echo _t('gen.menu.update'); ?></a> + </li> + <?php } ?> </ul> diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml index e324b15bd..3e1ee44dd 100644 --- a/app/layout/aside_feed.phtml +++ b/app/layout/aside_feed.phtml @@ -1,64 +1,96 @@ -<ul class="nav nav-list aside aside_feed"> - <li class="nav-header"><?php echo Minz_Translate::t ('your_rss_feeds'); ?></li> +<?php + $class = ''; + if (FreshRSS_Context::$user_conf->hide_read_feeds && + FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) && + !FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_READ)) { + $class = ' state_unread'; + } +?> - <li class="nav-form"><form id="add_rss" method="post" action="<?php echo Minz_Url::display (array ('c' => 'feed', 'a' => 'add')); ?>" autocomplete="off"> - <div class="stick"> - <input type="url" name="url_rss" placeholder="<?php echo Minz_Translate::t ('add_rss_feed'); ?>" /> - <div class="dropdown"> - <div id="dropdown-cat" class="dropdown-target"></div> +<div class="aside aside_feed<?php echo $class; ?>" id="aside_feed"> + <a class="toggle_aside" href="#close"><?php echo _i('close'); ?></a> - <a class="dropdown-toggle btn" href="#dropdown-cat"><?php echo FreshRSS_Themes::icon('down'); ?></a> - <ul class="dropdown-menu"> - <li class="dropdown-close"><a href="#close">❌</a></li> - - <li class="dropdown-header"><?php echo Minz_Translate::t ('category'); ?></li> - - <li class="input"> - <select name="category" id="category"> - <?php foreach ($this->categories as $cat) { ?> - <option value="<?php echo $cat->id (); ?>"<?php echo $cat->id () == 1 ? ' selected="selected"' : ''; ?>> - <?php echo $cat->name (); ?> - </option> - <?php } ?> - </select> - </li> - - <li class="separator"></li> + <?php if (FreshRSS_Auth::hasAccess()) { ?> + <div class="stick configure-feeds no-mobile"> + <a class="btn btn-important" href="<?php echo _url('subscription', 'index'); ?>"><?php echo _t('index.menu.subscription'); ?></a> + <a class="btn btn-important" href="<?php echo _url('importExport', 'index'); ?>"><?php echo _i('import'); ?></a> + </div> + <?php } elseif (FreshRSS_Auth::accessNeedsLogin()) { ?> + <a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('index.menu.about'); ?></a> + <?php } ?> - <li class="dropdown-header"><?php echo Minz_Translate::t ('http_authentication'); ?></li> - <li class="input"> - <input type="text" name="http_user" id="http_user_add" autocomplete="off" placeholder="<?php echo Minz_Translate::t ('username'); ?>" /> - </li> - <li class="input"> - <input type="password" name="http_pass" id="http_pass_add" autocomplete="off" placeholder="<?php echo Minz_Translate::t ('password'); ?>" /> - </li> - </ul> + <form id="mark-read-aside" method="post"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <ul class="tree"> + <li class="tree-folder category all<?php echo FreshRSS_Context::isCurrentGet('a') ? ' active' : ''; ?>"> + <div class="tree-folder-title"> + <?php echo _i('all'); ?> <a class="title" data-unread="<?php echo format_number(FreshRSS_Context::$total_unread); ?>" href="<?php echo _url('index', 'index'); ?>"><?php echo _t('index.menu.main_stream'); ?></a> </div> - <button class="btn" type="submit"><?php echo FreshRSS_Themes::icon('add'); ?></button> - </div> - </form></li> + </li> - <li class="item<?php echo Minz_Request::actionName () == 'importExport' ? ' active' : ''; ?>"> - <a href="<?php echo _url ('configure', 'importExport'); ?>"><?php echo Minz_Translate::t ('import_export_opml'); ?></a> - </li> + <li class="tree-folder category favorites<?php echo FreshRSS_Context::isCurrentGet('s') ? ' active' : ''; ?>"> + <div class="tree-folder-title"> + <?php echo _i('bookmark'); ?> <a class="title" data-unread="<?php echo format_number(FreshRSS_Context::$total_starred['unread']); ?>" href="<?php echo _url('index', 'index', 'get', 's'); ?>"><?php echo _t('index.menu.favorites', format_number(FreshRSS_Context::$total_starred['all'])); ?></a> + </div> + </li> - <li class="item<?php echo Minz_Request::actionName () == 'categorize' ? ' active' : ''; ?>"> - <a href="<?php echo _url ('configure', 'categorize'); ?>"><?php echo Minz_Translate::t ('categories_management'); ?></a> - </li> + <?php + foreach ($this->categories as $cat) { + $feeds = $cat->feeds(); + if (!empty($feeds)) { + $c_active = FreshRSS_Context::isCurrentGet('c_' . $cat->id()); + $c_show = $c_active && (!FreshRSS_Context::$user_conf->display_categories || + FreshRSS_Context::$current_get['feed']); + ?> + <li class="tree-folder category<?php echo $c_active ? ' active' : ''; ?>" data-unread="<?php echo $cat->nbNotRead(); ?>"> + <div class="tree-folder-title"> + <a class="dropdown-toggle" href="#"><?php echo _i($c_show ? 'up' : 'down'); ?></a> + <a class="title<?php echo $cat->hasFeedsWithError() ? ' error' : ''; ?>" data-unread="<?php echo format_number($cat->nbNotRead()); ?>" href="<?php echo _url('index', 'index', 'get', 'c_' . $cat->id()); ?>"><?php echo $cat->name(); ?></a> + </div> - <li class="separator"></li> + <ul class="tree-folder-items<?php echo $c_show ? ' active' : ''; ?>"> + <?php + foreach ($feeds as $feed) { + $f_active = FreshRSS_Context::isCurrentGet('f_' . $feed->id()); + ?> + <li id="f_<?php echo $feed->id(); ?>" class="item feed<?php echo $f_active ? ' active' : ''; ?><?php echo $feed->inError() ? ' error' : ''; ?><?php echo $feed->nbEntries() <= 0 ? ' empty' : ''; ?>" data-unread="<?php echo $feed->nbNotRead(); ?>" data-priority="<?php echo $feed->priority(); ?>"> + <div class="dropdown no-mobile"> + <div class="dropdown-target"></div> + <a class="dropdown-toggle" data-fweb="<?php echo $feed->website(); ?>"><?php echo _i('configure'); ?></a> + <?php /* feed_config_template */ ?> + </div> + <img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" /> <a class="item-title" data-unread="<?php echo format_number($feed->nbNotRead()); ?>" href="<?php echo _url('index', 'index', 'get', 'f_' . $feed->id()); ?>"><?php echo $feed->name(); ?></a> + </li> + <?php } ?> + </ul> + </li> + <?php + } + } + ?> + </ul> + </form> +</div> - <?php if (!empty ($this->feeds)) { ?> - <?php foreach ($this->feeds as $feed) { ?> - <?php $nbEntries = $feed->nbEntries (); ?> - <li class="item<?php echo ($this->flux && $this->flux->id () == $feed->id ()) ? ' active' : ''; ?><?php echo $feed->inError () ? ' error' : ''; ?><?php echo $nbEntries == 0 ? ' empty' : ''; ?>"> - <a href="<?php echo _url ('configure', 'feed', 'id', $feed->id ()); ?>"> - <img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> - <?php echo $feed->name (); ?> - </a> - </li> - <?php } ?> - <?php } else { ?> - <li class="item disable"><?php echo Minz_Translate::t ('no_rss_feed'); ?></li> - <?php } ?> -</ul> +<script id="feed_config_template" type="text/html"> + <ul class="dropdown-menu"> + <li class="dropdown-close"><a href="#close">❌</a></li> + <li class="item"><a href="<?php echo _url('index', 'index', 'get', 'f_------'); ?>"><?php echo _t('gen.action.filter'); ?></a></li> + <?php if (FreshRSS_Auth::hasAccess()) { ?> + <li class="item"><a href="<?php echo _url('stats', 'repartition', 'id', '------'); ?>"><?php echo _t('index.menu.stats'); ?></a></li> + <?php } ?> + <li class="item"><a target="_blank" rel="noreferrer" href="http://example.net/"><?php echo _t('gen.action.see_website'); ?></a></li> + <?php if (FreshRSS_Auth::hasAccess()) { ?> + <li class="separator"></li> + <li class="item"><a href="<?php echo _url('subscription', 'index', 'id', '------'); ?>"><?php echo _t('gen.action.manage'); ?></a></li> + <li class="item"><a href="<?php echo _url('feed', 'actualize', 'id', '------'); ?>"><?php echo _t('gen.action.actualize'); ?></a></li> + <li class="item"> + <?php $confirm = FreshRSS_Context::$user_conf->reading_confirm ? 'confirm" disabled="disabled' : ''; ?> + <button class="read_all as-link <?php echo $confirm; ?>" + form="mark-read-aside" + formaction="<?php echo _url('entry', 'read', 'get', 'f_------'); ?>" + type="submit"><?php echo _t('gen.action.mark_read'); ?></button> + </li> + <?php } ?> + </ul> +</script> diff --git a/app/layout/aside_flux.phtml b/app/layout/aside_flux.phtml deleted file mode 100644 index 817dae676..000000000 --- a/app/layout/aside_flux.phtml +++ /dev/null @@ -1,88 +0,0 @@ -<div class="aside aside_flux" id="aside_flux"> - <a class="toggle_aside" href="#close"><?php echo FreshRSS_Themes::icon('close'); ?></a> - - <ul class="categories"> - <?php if ($this->loginOk) { ?> - <li> - <div class="stick"> - <a class="btn btn-important" href="<?php echo _url ('configure', 'feed'); ?>"><?php echo Minz_Translate::t ('subscription_management'); ?></a> - <a class="btn btn-important" href="<?php echo _url ('configure', 'categorize'); ?>" title="<?php echo Minz_Translate::t ('categories_management'); ?>"><?php echo FreshRSS_Themes::icon('category-white'); ?></a> - </div> - </li> - <?php } elseif (Minz_Configuration::needsLogin()) { ?> - <li><a href="<?php echo _url ('index', 'about'); ?>"><?php echo Minz_Translate::t ('about_freshrss'); ?></a></li> - <?php } ?> - - <?php - $arUrl = array('c' => 'index', 'a' => 'index', 'params' => array()); - if ($this->conf->view_mode !== Minz_Request::param('output', 'normal')) { - $arUrl['params']['output'] = 'normal'; - } - ?> - <li> - <div class="category all<?php echo $this->get_c == 'a' ? ' active' : ''; ?>"> - <a data-unread="<?php echo formatNumber($this->nb_not_read); ?>" class="btn<?php echo $this->get_c == 'a' ? ' active' : ''; ?>" href="<?php echo Minz_Url::display($arUrl); ?>"> - <?php echo FreshRSS_Themes::icon('all'); ?> - <?php echo Minz_Translate::t ('main_stream'); ?> - </a> - </div> - </li> - - <li> - <div class="category favorites<?php echo $this->get_c == 's' ? ' active' : ''; ?>"> - <a data-unread="<?php echo formatNumber($this->nb_favorites['unread']); ?>" class="btn<?php echo $this->get_c == 's' ? ' active' : ''; ?>" href="<?php $arUrl['params']['get'] = 's'; echo Minz_Url::display($arUrl); ?>"> - <?php echo FreshRSS_Themes::icon('bookmark'); ?> - <?php echo Minz_Translate::t('favorite_feeds', formatNumber($this->nb_favorites['all'])); ?> - </a> - </div> - </li> - - <?php - foreach ($this->cat_aside as $cat) { - $feeds = $cat->feeds (); - if (!empty ($feeds)) { - ?><li><?php - $c_active = false; - if ($this->get_c == $cat->id ()) { - $c_active = true; - } - ?><div class="category stick<?php echo $c_active ? ' active' : ''; ?>"><?php - ?><a data-unread="<?php echo formatNumber($cat->nbNotRead()); ?>" class="btn<?php echo $c_active ? ' active' : ''; ?>" href="<?php $arUrl['params']['get'] = 'c_' . $cat->id(); echo Minz_Url::display($arUrl); ?>"><?php echo $cat->name (); ?></a><?php - ?><a class="btn dropdown-toggle" href="#"><?php echo FreshRSS_Themes::icon($c_active ? 'up' : 'down'); ?></a><?php - ?></div><?php - ?><ul class="feeds<?php echo $c_active ? ' active' : ''; ?>"><?php - foreach ($feeds as $feed) { - $feed_id = $feed->id (); - $nbEntries = $feed->nbEntries (); - $f_active = ($this->get_f == $feed_id); - ?><li id="f_<?php echo $feed_id; ?>" class="item<?php echo $f_active ? ' active' : ''; ?><?php echo $feed->inError () ? ' error' : ''; ?><?php echo $nbEntries == 0 ? ' empty' : ''; ?>"><?php - ?><div class="dropdown"><?php - ?><div class="dropdown-target"></div><?php - ?><a class="dropdown-toggle" data-fweb="<?php echo $feed->website (); ?>"><?php echo FreshRSS_Themes::icon('configure'); ?></a><?php - /* feed_config_template */ - ?></div><?php - ?> <img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> <?php - ?><a class="feed" data-unread="<?php echo formatNumber($feed->nbNotRead()); ?>" data-priority="<?php echo $feed->priority (); ?>" href="<?php $arUrl['params']['get'] = 'f_' . $feed_id; echo Minz_Url::display($arUrl); ?>"><?php echo $feed->name(); ?></a><?php - ?></li><?php - } - ?></ul><?php - ?></li><?php - } - } ?> - </ul> - <span class="aside_flux_ender"><!-- For fixed menu --></span> -</div> - -<script id="feed_config_template" type="text/html"> - <ul class="dropdown-menu"> - <li class="dropdown-close"><a href="#close">❌</a></li> - <li class="item"><a href="<?php echo _url ('index', 'index', 'get', 'f_!!!!!!'); ?>"><?php echo Minz_Translate::t ('filter'); ?></a></li> - <li class="item"><a target="_blank" href="http://example.net/"><?php echo Minz_Translate::t ('see_website'); ?></a></li> - <?php if ($this->loginOk) { ?> - <li class="separator"></li> - <li class="item"><a href="<?php echo _url ('configure', 'feed', 'id', '!!!!!!'); ?>"><?php echo Minz_Translate::t ('administration'); ?></a></li> - <li class="item"><a href="<?php echo _url ('feed', 'actualize', 'id', '!!!!!!'); ?>"><?php echo Minz_Translate::t ('actualize'); ?></a></li> - <li class="item"><a href="<?php echo _url ('entry', 'read', 'get', 'f_!!!!!!'); ?>"><?php echo Minz_Translate::t ('mark_read'); ?></a></li> - <?php } ?> - </ul> -</script> diff --git a/app/layout/aside_stats.phtml b/app/layout/aside_stats.phtml new file mode 100644 index 000000000..4bdaf7165 --- /dev/null +++ b/app/layout/aside_stats.phtml @@ -0,0 +1,12 @@ +<ul class="nav nav-list aside"> + <li class="nav-header"><?php echo _t('admin.stats'); ?></li> + <li class="item<?php echo Minz_Request::actionName() == 'index' ? ' active' : ''; ?>"> + <a href="<?php echo _url('stats', 'index'); ?>"><?php echo _t('admin.stats.menu.main'); ?></a> + </li> + <li class="item<?php echo Minz_Request::actionName() == 'idle' ? ' active' : ''; ?>"> + <a href="<?php echo _url('stats', 'idle'); ?>"><?php echo _t('admin.stats.menu.idle'); ?></a> + </li> + <li class="item<?php echo Minz_Request::actionName() == 'repartition' ? ' active' : ''; ?>"> + <a href="<?php echo _url('stats', 'repartition'); ?>"><?php echo _t('admin.stats.menu.repartition'); ?></a> + </li> +</ul> diff --git a/app/layout/aside_subscription.phtml b/app/layout/aside_subscription.phtml new file mode 100644 index 000000000..e14afe2a7 --- /dev/null +++ b/app/layout/aside_subscription.phtml @@ -0,0 +1,17 @@ +<ul class="nav nav-list aside"> + <li class="nav-header"><?php echo _t('sub.menu.subscription_management'); ?></li> + + <li class="item<?php echo Minz_Request::controllerName() == 'subscription' ? ' active' : ''; ?>"> + <a href="<?php echo _url('subscription', 'index'); ?>"><?php echo _t('sub.menu.subscription_management'); ?></a> + </li> + + <li class="item<?php echo Minz_Request::controllerName() == 'importExport' ? ' active' : ''; ?>"> + <a href="<?php echo _url('importExport', 'index'); ?>"><?php echo _t('sub.menu.import_export'); ?></a> + </li> + + <li class="item"> + <a class="bookmarkClick" href="javascript:(function(){var%20url%20=%20location.href;var%20otherWindow=window.open('about:blank','_blank');otherWindow.opener=null;otherWindow.location='<?php echo Minz_Url::display(array('c' => 'feed', 'a' => 'add'), 'html', true); ?>&url_rss='+encodeURIComponent(url);})();"> + <?php echo _t('sub.menu.bookmark'); ?> + </a> + </li> +</ul> diff --git a/app/layout/header.phtml b/app/layout/header.phtml index d20f7487f..238c664b0 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -1,22 +1,12 @@ <?php -if (Minz_Configuration::canLogIn()) { + +if (FreshRSS_Auth::accessNeedsAction()) { ?><ul class="nav nav-head nav-login"><?php - switch (Minz_Configuration::authType()) { - case 'form': - if ($this->loginOk) { - ?><li class="item"><?php echo FreshRSS_Themes::icon('logout'); ?> <a class="signout" href="<?php echo _url ('index', 'formLogout'); ?>"><?php echo Minz_Translate::t ('logout'); ?></a></li><?php - } else { - ?><li class="item"><?php echo FreshRSS_Themes::icon('login'); ?> <a class="signin" href="<?php echo _url ('index', 'formLogin'); ?>"><?php echo Minz_Translate::t ('login'); ?></a></li><?php - } - break; - case 'persona': - if ($this->loginOk) { - ?><li class="item"><?php echo FreshRSS_Themes::icon('logout'); ?> <a class="signout" href="#"><?php echo Minz_Translate::t ('logout'); ?></a></li><?php - } else { - ?><li class="item"><?php echo FreshRSS_Themes::icon('login'); ?> <a class="signin" href="#"><?php echo Minz_Translate::t ('login'); ?></a></li><?php - } - break; - } + if (FreshRSS_Auth::hasAccess()) { + ?><li class="item"><?php echo _i('logout'); ?> <a class="signout" href="<?php echo _url('auth', 'logout'); ?>"><?php echo _t('gen.auth.logout'); ?></a></li><?php + } else { + ?><li class="item"><?php echo _i('login'); ?> <a class="signin" href="<?php echo _url('auth', 'login'); ?>"><?php echo _t('gen.auth.login'); ?></a></li><?php + } ?></ul><?php } ?> @@ -24,84 +14,80 @@ if (Minz_Configuration::canLogIn()) { <div class="header"> <div class="item title"> <h1> - <a href="<?php echo _url ('index', 'index'); ?>"> - <img class="logo" src="<?php echo Minz_Url::display ('/themes/icons/icon.svg'); ?>" alt="⊚" /> - <?php echo Minz_Configuration::title (); ?> + <a href="<?php echo _url('index', 'index'); ?>"> + <img class="logo" src="<?php echo _i('icon', true); ?>" alt="⊚" /> + <?php echo FreshRSS_Context::$system_conf->title; ?> </a> </h1> </div> <div class="item search"> - <?php if ($this->loginOk || Minz_Configuration::allowAnonymous()) { ?> - <form action="<?php echo _url ('index', 'index'); ?>" method="get"> + <?php if (FreshRSS_Auth::hasAccess() || FreshRSS_Context::$system_conf->allow_anonymous) { ?> + <form action="<?php echo _url('index', 'index'); ?>" method="get"> <div class="stick"> - <?php $search = Minz_Request::param ('search', ''); ?> - <input type="search" name="search" id="search" class="extend" value="<?php echo $search; ?>" placeholder="<?php echo Minz_Translate::t ('search'); ?>" /> + <input type="search" name="search" id="search" class="extend" value="<?php echo FreshRSS_Context::$search; ?>" placeholder="<?php echo _t('gen.menu.search'); ?>" /> - <?php $get = Minz_Request::param ('get', ''); ?> - <?php if($get != '') { ?> + <?php $get = Minz_Request::param('get', ''); ?> + <?php if ($get != '') { ?> <input type="hidden" name="get" value="<?php echo $get; ?>" /> <?php } ?> - <?php $order = Minz_Request::param ('order', ''); ?> - <?php if($order != '') { ?> + <?php $order = Minz_Request::param('order', ''); ?> + <?php if ($order != '') { ?> <input type="hidden" name="order" value="<?php echo $order; ?>" /> <?php } ?> - <?php $state = Minz_Request::param ('state', ''); ?> - <?php if($state != '') { ?> + <?php $state = Minz_Request::param('state', ''); ?> + <?php if ($state != '') { ?> <input type="hidden" name="state" value="<?php echo $state; ?>" /> <?php } ?> - <button class="btn" type="submit"><?php echo FreshRSS_Themes::icon('search'); ?></button> + <button class="btn" type="submit"><?php echo _i('search'); ?></button> </div> </form> <?php } ?> </div> - <?php if ($this->loginOk) { ?> + <?php if (FreshRSS_Auth::hasAccess()) { ?> <div class="item configure"> <div class="dropdown"> <div id="dropdown-configure" class="dropdown-target"></div> - <a class="btn dropdown-toggle" href="#dropdown-configure"><?php echo FreshRSS_Themes::icon('configure'); ?></a> + <a class="btn dropdown-toggle" href="#dropdown-configure"><?php echo _i('configure'); ?></a> <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', '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> + <li class="dropdown-header"><?php echo _t('gen.menu.configuration'); ?></li> + <li class="item"><a href="<?php echo _url('configure', 'display'); ?>"><?php echo _t('gen.menu.display'); ?></a></li> + <li class="item"><a href="<?php echo _url('configure', 'reading'); ?>"><?php echo _t('gen.menu.reading'); ?></a></li> + <li class="item"><a href="<?php echo _url('configure', 'archiving'); ?>"><?php echo _t('gen.menu.archiving'); ?></a></li> + <li class="item"><a href="<?php echo _url('configure', 'sharing'); ?>"><?php echo _t('gen.menu.sharing'); ?></a></li> + <li class="item"><a href="<?php echo _url('configure', 'shortcut'); ?>"><?php echo _t('gen.menu.shortcuts'); ?></a></li> + <li class="item"><a href="<?php echo _url('configure', 'queries'); ?>"><?php echo _t('gen.menu.queries'); ?></a></li> + <li class="item"><a href="<?php echo _url('user', 'profile'); ?>"><?php echo _t('gen.menu.user_profile'); ?></a></li> + <li class="item"><a href="<?php echo _url('extension', 'index'); ?>"><?php echo _t('gen.menu.extensions'); ?></a></li> + <?php if (FreshRSS_Auth::hasAccess('admin')) { ?> <li class="separator"></li> - <li class="item"><a href="<?php echo _url ('configure', 'users'); ?>"><?php echo Minz_Translate::t ('users'); ?></a></li> + <li class="dropdown-header"><?php echo _t('gen.menu.admin'); ?></li> + <li class="item"><a href="<?php echo _url('configure', 'system'); ?>"><?php echo _t('gen.menu.system'); ?></a></li> + <li class="item"><a href="<?php echo _url('user', 'manage'); ?>"><?php echo _t('gen.menu.user_management'); ?></a></li> + <li class="item"><a href="<?php echo _url('auth', 'index'); ?>"><?php echo _t('gen.menu.authentication'); ?></a></li> + <li class="item"><a href="<?php echo _url('update', 'checkInstall'); ?>"><?php echo _t('gen.menu.check_install'); ?></a></li> + <li class="item"><a href="<?php echo _url('update', 'index'); ?>"><?php echo _t('gen.menu.update'); ?></a></li> + <?php } ?> <li class="separator"></li> - <li class="item"><a href="<?php echo _url ('index', 'stats'); ?>"><?php echo Minz_Translate::t ('stats'); ?></a></li> - <li class="item"><a href="<?php echo _url ('index', 'logs'); ?>"><?php echo Minz_Translate::t ('logs'); ?></a></li> - <li class="item"><a href="<?php echo _url ('index', 'about'); ?>"><?php echo Minz_Translate::t ('about'); ?></a></li> + <li class="item"><a href="<?php echo _url('stats', 'index'); ?>"><?php echo _t('gen.menu.stats'); ?></a></li> + <li class="item"><a href="<?php echo _url('index', 'logs'); ?>"><?php echo _t('gen.menu.logs'); ?></a></li> + <li class="item"><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('gen.menu.about'); ?></a></li> <?php - if (Minz_Configuration::canLogIn()) { - ?><li class="separator"></li><?php - switch (Minz_Configuration::authType()) { - case 'form': - ?><li class="item"><a class="signout" href="<?php echo _url ('index', 'formLogout'); ?>"><?php echo FreshRSS_Themes::icon('logout'), ' ', Minz_Translate::t ('logout'); ?></a></li><?php - break; - case 'persona': - ?><li class="item"><a class="signout" href="#"><?php echo FreshRSS_Themes::icon('logout'), ' ', Minz_Translate::t ('logout'); ?></a></li><?php - break; - } + if (FreshRSS_Auth::accessNeedsAction()) { + ?><li class="separator"></li> + <li class="item"><a class="signout" href="<?php echo _url('auth', 'logout'); ?>"><?php echo _i('logout'), ' ', _t('gen.auth.logout'); ?></a></li><?php } ?> </ul> </div> </div> - <?php } elseif (Minz_Configuration::canLogIn()) { - ?><div class="item configure"><?php - switch (Minz_Configuration::authType()) { - case 'form': - echo FreshRSS_Themes::icon('login'); ?><a class="signin" href="<?php echo _url ('index', 'formLogin'); ?>"><?php echo Minz_Translate::t ('login'); ?></a></li><?php - break; - case 'persona': - echo FreshRSS_Themes::icon('login'); ?><a class="signin" href="#"><?php echo Minz_Translate::t ('login'); ?></a></li><?php - break; - } - ?></div><?php - } ?> + <?php } elseif (FreshRSS_Auth::accessNeedsAction()) { ?> + <div class="item configure"> + <?php echo _i('login'); ?><a class="signin" href="<?php echo _url('auth', 'login'); ?>"><?php echo _t('gen.auth.login'); ?></a> + </div> + <?php } ?> </div> diff --git a/app/layout/layout.phtml b/app/layout/layout.phtml index 1501df3c3..1f11e0af1 100644 --- a/app/layout/layout.phtml +++ b/app/layout/layout.phtml @@ -1,53 +1,78 @@ +<?php FreshRSS::preLayout(); ?> <!DOCTYPE html> -<html lang="<?php echo $this->conf->language; ?>" xml:lang="<?php echo $this->conf->language; ?>"> +<html lang="<?php echo FreshRSS_Context::$user_conf->language; ?>" xml:lang="<?php echo FreshRSS_Context::$user_conf->language; ?>"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="initial-scale=1.0" /> - <?php echo self::headTitle (); ?> - <?php echo self::headStyle (); ?> - <?php echo self::headScript (); ?> - <script>//<![CDATA[ -<?php $this->renderHelper ('javascript_vars'); ?> - //]]></script> -<?php - if (!empty($this->nextId)) { - $params = Minz_Request::params (); - $params['next'] = $this->nextId; -?> - <link id="prefetch" rel="next prefetch" href="<?php echo Minz_Url::display (array ('c' => Minz_Request::controllerName (), 'a' => Minz_Request::actionName (), 'params' => $params)); ?>" /> -<?php } ?> - <link rel="shortcut icon" type="image/x-icon" sizes="16x16 64x64" href="<?php echo Minz_Url::display('/favicon.ico'); ?>" /> + <?php echo self::headStyle(); ?> + <script id="jsonVars" type="application/json"> +<?php $this->renderHelper('javascript_vars'); ?> + </script> + <?php echo self::headScript(); ?> + <link rel="shortcut icon" id="favicon" type="image/x-icon" sizes="16x16 64x64" href="<?php echo Minz_Url::display('/favicon.ico'); ?>" /> <link rel="icon msapplication-TileImage apple-touch-icon" type="image/png" sizes="256x256" href="<?php echo Minz_Url::display('/themes/icons/favicon-256.png'); ?>" /> -<?php if (isset ($this->rss_url)) { ?> - <link rel="alternate" type="application/rss+xml" title="<?php echo $this->rss_title; ?>" href="<?php echo Minz_Url::display ($this->rss_url); ?>" /> -<?php } ?> - <link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('starred', true); ?>"> - <link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('non-starred', true); ?>"> - <link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('read', true); ?>"> - <link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('unread', true); ?>"> + <link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('starred', true); ?>" /> + <link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('non-starred', true); ?>" /> + <link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('read', true); ?>" /> + <link rel="prefetch" href="<?php echo FreshRSS_Themes::icon('unread', true); ?>" /> + <link rel="apple-touch-icon" href="<?php echo Minz_Url::display('/themes/icons/apple-touch-icon.png'); ?>" /> + <meta name="apple-mobile-web-app-capable" content="yes" /> + <meta name="apple-mobile-web-app-status-bar-style" content="black" /> + <meta name="apple-mobile-web-app-title" content="<?php echo FreshRSS_Context::$system_conf->title; ?>"> <meta name="msapplication-TileColor" content="#FFF" /> +<?php if (!FreshRSS_Context::$system_conf->allow_referrer) { ?> + <meta name="referrer" content="never" /> +<?php + } + flush(); + if (isset($this->callbackBeforeContent)) { + call_user_func($this->callbackBeforeContent, $this); + } +?> + <?php echo self::headTitle(); ?> +<?php + $url_base = Minz_Request::currentRequest(); + if (FreshRSS_Context::$next_id !== '') { + $url_next = $url_base; + $url_next['params']['next'] = FreshRSS_Context::$next_id; + $url_next['params']['ajax'] = 1; +?> + <link id="prefetch" rel="next prefetch" href="<?php echo Minz_Url::display($url_next); ?>" /> +<?php + } if (isset($this->rss_title)) { + $url_rss = $url_base; + $url_rss['a'] = 'rss'; + if (FreshRSS_Context::$user_conf->since_hours_posts_per_rss) { + $url_rss['params']['hours'] = FreshRSS_Context::$user_conf->since_hours_posts_per_rss; + } +?> + <link rel="alternate" type="application/rss+xml" title="<?php echo $this->rss_title; ?>" href="<?php echo Minz_Url::display($url_rss); ?>" /> +<?php } if (FreshRSS_Context::$system_conf->allow_robots) { ?> + <meta name="description" content="<?php echo htmlspecialchars(FreshRSS_Context::$name . ' | ' . FreshRSS_Context::$description, ENT_COMPAT, 'UTF-8'); ?>" /> +<?php } else { ?> <meta name="robots" content="noindex,nofollow" /> +<?php } ?> </head> - <body class="<?php echo Minz_Request::param('output', 'normal'); ?>"> -<?php $this->partial ('header'); ?> + <body class="<?php echo Minz_Request::actionName(); ?>"> +<?php $this->partial('header'); ?> <div id="global"> - <?php $this->render (); ?> + <?php $this->render(); ?> </div> <?php $msg = ''; $status = 'closed'; - if (isset ($this->notification)) { + if (isset($this->notification)) { $msg = $this->notification['content']; $status = $this->notification['type']; invalidateHttpCache(); } ?> -<div id="notification" class="<?php echo $status; ?>"> +<div id="notification" class="notification <?php echo $status; ?>"> <span class="msg"><?php echo $msg; ?></span> - <a class="close" href=""><?php echo FreshRSS_Themes::icon('close'); ?></a> + <a class="close" href=""><?php echo _i('close'); ?></a> </div> </body> </html> diff --git a/app/layout/nav_entries.phtml b/app/layout/nav_entries.phtml index 3141e92a0..ca6849193 100644 --- a/app/layout/nav_entries.phtml +++ b/app/layout/nav_entries.phtml @@ -1,5 +1,5 @@ <ul id="nav_entries"> - <li class="item"><a class="previous_entry" href="#"><?php echo FreshRSS_Themes::icon('prev'); ?></a></li> - <li class="item"><a class="up" href="#"><?php echo FreshRSS_Themes::icon('up'); ?></a></li> - <li class="item"><a class="next_entry" href="#"><?php echo FreshRSS_Themes::icon('next'); ?></a></li> + <li class="item"><a class="previous_entry" href="#"><?php echo _i('prev'); ?></a></li> + <li class="item"><a class="up" href="#"><?php echo _i('up'); ?></a></li> + <li class="item"><a class="next_entry" href="#"><?php echo _i('next'); ?></a></li> </ul>
\ No newline at end of file diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 98064a6f7..f6d824d55 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -1,228 +1,204 @@ -<?php - $actual_view = Minz_Request::param('output', 'normal'); -?> +<?php $actual_view = Minz_Request::actionName(); ?> + <div class="nav_menu"> <?php if ($actual_view === 'normal') { ?> - <a class="btn toggle_aside" href="#aside_flux"><?php echo FreshRSS_Themes::icon('category'); ?></a> + <a class="btn toggle_aside" href="#aside_feed"><?php echo _i('category'); ?></a> <?php } ?> - <?php if ($this->loginOk || Minz_Configuration::allowAnonymousRefresh()) { ?> - <a id="actualize" class="btn" href="<?php echo _url ('feed', 'actualize'); ?>"><?php echo FreshRSS_Themes::icon('refresh'); ?></a> - <?php } ?> + <?php if (FreshRSS_Auth::hasAccess()) { ?> + <div id="nav_menu_actions" class="stick"> + <?php + $states = array( + 'read' => FreshRSS_Entry::STATE_READ, + 'unread' => FreshRSS_Entry::STATE_NOT_READ, + 'starred' => FreshRSS_Entry::STATE_FAVORITE, + 'non-starred' => FreshRSS_Entry::STATE_NOT_FAVORITE, + ); + + foreach ($states as $state_str => $state) { + $state_enabled = FreshRSS_Context::isStateEnabled($state); + $url_state = Minz_Request::currentRequest(); + $url_state['params']['state'] = FreshRSS_Context::getRevertState($state); + ?> + <a id="toggle-<?php echo $state_str; ?>" + class="btn <?php echo $state_enabled ? 'active' : ''; ?>" + role="checkbox" aria-checked="<?php echo $state_enabled ? 'true' : 'false'; ?>" + title="<?php echo _t('index.menu.' . $state_str); ?>" + href="<?php echo Minz_Url::display($url_state); ?>"><?php echo _i($state_str); ?></a> + <?php } ?> + + <div class="dropdown"> + <div id="dropdown-query" class="dropdown-target"></div> + + <a class="dropdown-toggle btn" href="#dropdown-query"><?php echo _i('down'); ?></a> + <ul class="dropdown-menu"> + <li class="dropdown-close"><a href="#close">❌</a></li> + + <li class="dropdown-header"> + <?php echo _t('index.menu.queries'); ?> + <a class="no-mobile" href="<?php echo _url('configure', 'queries'); ?>"><?php echo _i('configure'); ?></a> + </li> + + <?php foreach (FreshRSS_Context::$user_conf->queries as $query) { ?> + <li class="item query"> + <a href="<?php echo $query['url']; ?>"><?php echo $query['name']; ?></a> + </li> + <?php } ?> + + <?php if (count(FreshRSS_Context::$user_conf->queries) > 0) { ?> + <li class="separator no-mobile"></li> + <?php } ?> + + <?php + $url_query = Minz_Request::currentRequest();; + $url_query['c'] = 'configure'; + $url_query['a'] = 'addQuery'; + ?> + <li class="item no-mobile"><a href="<?php echo Minz_Url::display($url_query); ?>"><?php echo _i('bookmark-add'); ?> <?php echo _t('index.menu.add_query'); ?></a></li> + </ul> + </div> + </div> - <?php if ($this->loginOk) { ?> <?php - $get = false; - $string_mark = Minz_Translate::t ('mark_all_read'); - if ($this->get_f) { - $get = 'f_' . $this->get_f; - $string_mark = Minz_Translate::t ('mark_feed_read'); - } elseif ($this->get_c && $this->get_c != 'a') { - if ($this->get_c === 's') { - $get = 's'; - } else { - $get = 'c_' . $this->get_c; - } - $string_mark = Minz_Translate::t ('mark_cat_read'); - } - $nextGet = $get; - if ($this->conf->onread_jump_next && (strlen ($get) > 2)) { - $anotherUnreadId = ''; - $foundCurrent = false; - switch ($get[0]) { - case 'c': - foreach ($this->cat_aside as $cat) { - if ($cat->id () == $this->get_c) { - $foundCurrent = true; - continue; - } - if ($cat->nbNotRead () <= 0) continue; - $anotherUnreadId = $cat->id (); - if ($foundCurrent) break; - } - $nextGet = empty ($anotherUnreadId) ? 'a' : 'c_' . $anotherUnreadId; - break; - case 'f': - foreach ($this->cat_aside as $cat) { - if ($cat->id () == $this->get_c) { - foreach ($cat->feeds () as $feed) { - if ($feed->id () == $this->get_f) { - $foundCurrent = true; - continue; - } - if ($feed->nbNotRead () <= 0) continue; - $anotherUnreadId = $feed->id (); - if ($foundCurrent) break; - } - break; - } - } - $nextGet = empty ($anotherUnreadId) ? 'c_' . $this->get_c : 'f_' . $anotherUnreadId; - break; - } + $get = FreshRSS_Context::currentGet(); + $string_mark = _t('index.menu.mark_all_read'); + if ($get[0] == 'f') { + $string_mark = _t('index.menu.mark_feed_read'); + } elseif ($get[0] == 'c') { + $string_mark = _t('index.menu.mark_cat_read'); } - $p = isset($this->entries[0]) ? $this->entries[0] : null; - $idMax = $p === null ? '0' : $p->id(); - $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('get' => $get, 'nextGet' => $nextGet, 'idMax' => $idMax)); - $output = Minz_Request::param('output', ''); - if (($output != '') && ($this->conf->view_mode !== $output)) { - $arUrl['params']['output'] = $output; - } - $markReadUrl = Minz_Url::display($arUrl); - Minz_Session::_param ('markReadUrl', $markReadUrl); + $mark_read_url = array( + 'c' => 'entry', + 'a' => 'read', + 'params' => array( + 'get' => $get, + 'nextGet' => FreshRSS_Context::$next_get, + 'idMax' => FreshRSS_Context::$id_max, + 'search' => FreshRSS_Context::$search, + 'state' => FreshRSS_Context::$state, + ) + ); ?> <div class="stick" id="nav_menu_read_all"> - <a class="read_all btn" href="<?php echo $markReadUrl; ?>"><?php echo Minz_Translate::t ('mark_read'); ?></a> + <form id="mark-read-menu" method="post"> + <?php $confirm = FreshRSS_Context::$user_conf->reading_confirm ? 'confirm" disabled="disabled' : ''; ?> + <button class="read_all btn <?php echo $confirm; ?>" + form="mark-read-menu" + formaction="<?php echo Minz_Url::display($mark_read_url); ?>" + type="submit"><?php echo _t('gen.action.mark_read'); ?></button> + <div class="dropdown"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> <div id="dropdown-read" class="dropdown-target"></div> - <a class="dropdown-toggle btn" href="#dropdown-read"><?php echo FreshRSS_Themes::icon('down'); ?></a> + <a class="dropdown-toggle btn" href="#dropdown-read"><?php echo _i('down'); ?></a> <ul class="dropdown-menu"> <li class="dropdown-close"><a href="#close">❌</a></li> - <li class="item"><a href="<?php echo $markReadUrl; ?>"><?php echo $string_mark; ?></a></li> + <li class="item"> + <button class="as-link <?php echo $confirm; ?>" + form="mark-read-menu" + formaction="<?php echo Minz_Url::display($mark_read_url); ?>" + type="submit"><?php echo $string_mark; ?></button> + </li> <li class="separator"></li> <?php - $today = $this->today; - $one_week = $today - 604800; + $today = @strtotime('today'); + $mark_before_today = $mark_read_url; + $mark_before_today['params']['idMax'] = $today . '000000'; + $mark_before_one_week = $mark_read_url; + $mark_before_one_week['params']['idMax'] = ($today - 604800) . '000000'; ?> - <li class="item"><a href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', $get, 'idMax', $today . '000000'); ?>"><?php echo Minz_Translate::t ('before_one_day'); ?></a></li> - <li class="item"><a href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', $get, 'idMax', $one_week . '000000'); ?>"><?php echo Minz_Translate::t ('before_one_week'); ?></a></li> + <li class="item"> + <button class="as-link <?php echo $confirm; ?>" + form="mark-read-menu" + formaction="<?php echo Minz_Url::display($mark_before_today); ?>" + type="submit"><?php echo _t('index.menu.before_one_day'); ?></button> + </li> + <li class="item"> + <button class="as-link <?php echo $confirm; ?>" + form="mark-read-menu" + formaction="<?php echo Minz_Url::display($mark_before_one_week); ?>" + type="submit"><?php echo _t('index.menu.before_one_week'); ?></button> + </li> </ul> </div> + </form> </div> <?php } ?> - <?php - $params = Minz_Request::params (); - if (isset ($params['search'])) { - $params['search'] = urlencode ($params['search']); - } - $url = array ( - 'c' => 'index', - 'a' => 'index', - 'params' => $params - ); - ?> - <div class="dropdown" id="nav_menu_views"> - <div id="dropdown-views" class="dropdown-target"></div> - <a class="dropdown-toggle btn" href="#dropdown-views"><?php echo Minz_Translate::t ('display'); ?> <?php echo FreshRSS_Themes::icon('down'); ?></a> - <ul class="dropdown-menu"> - <li class="dropdown-close"><a href="#close">❌</a></li> - - <?php - $url_output = $url; - if ($actual_view !== 'normal') { ?> - <li class="item"> - <?php $url_output['params']['output'] = 'normal'; ?> - <a class="view_normal" href="<?php echo Minz_Url::display ($url_output); ?>"> - <?php echo Minz_Translate::t ('normal_view'); ?> - </a> - </li> - <?php } if($actual_view !== 'reader') { ?> - <li class="item"> - <?php $url_output['params']['output'] = 'reader'; ?> - <a class="view_normal" href="<?php echo Minz_Url::display ($url_output); ?>"> - <?php echo Minz_Translate::t ('reader_view'); ?> - </a> - </li> - <?php } if($actual_view !== 'global') { ?> - <li class="item"> - <?php $url_output['params']['output'] = 'global'; ?> - <a class="view_normal" href="<?php echo Minz_Url::display ($url_output); ?>"> - <?php echo Minz_Translate::t ('global_view'); ?> - </a> - </li> - <?php } ?> - - <li class="separator"></li> - - <?php - $url_state = $url; - $url_state['params']['state'] = 'all'; - ?> - <li class="item" role="checkbox" aria-checked="<?php echo ($this->state === 'all') ? 'true' :'false'; ?>"> - <a class="print_all" href="<?php echo Minz_Url::display ($url_state); ?>"> - <?php echo Minz_Translate::t ('show_all_articles'); ?> - </a> - </li> - <?php - $url_state['params']['state'] = 'not_read'; - ?> - <li class="item" role="checkbox" aria-checked="<?php echo ($this->state === 'not_read') ? 'true' :'false'; ?>"> - <a class="print_non_read" href="<?php echo Minz_Url::display ($url_state); ?>"> - <?php echo Minz_Translate::t ('show_not_reads'); ?> - </a> - </li> - <?php - $url_state['params']['state'] = 'read'; - ?> - <li class="item" role="checkbox" aria-checked="<?php echo ($this->state === 'read') ? 'true' :'false'; ?>"> - <a class="print_read" href="<?php echo Minz_Url::display ($url_state); ?>"> - <?php echo Minz_Translate::t ('show_read'); ?> - </a> - </li> - <?php - $url_state['params']['state'] = 'favorite'; - ?> - <li class="item" role="checkbox" aria-checked="<?php echo ($this->state === 'favorite') ? 'true' :'false'; ?>"> - <a class="print_favorite" href="<?php echo Minz_Url::display ($url_state); ?>"> - <?php echo Minz_Translate::t ('show_favorite'); ?> - </a> - </li> - - <li class="separator"></li> - - <li class="item"> - <?php - $url_order = $url; - if ($this->order === 'DESC') { - $url_order['params']['order'] = 'ASC'; - ?> - <a href="<?php echo Minz_Url::display ($url_order); ?>"> - <?php echo Minz_Translate::t ('older_first'); ?> - </a> - <?php - } else { - $url_order['params']['order'] = 'DESC'; - ?> - <a href="<?php echo Minz_Url::display ($url_order); ?>"> - <?php echo Minz_Translate::t ('newer_first'); ?> - </a> - <?php } ?> - </li> - - <li class="separator"></li> - - <li class="item"> - <a class="view_rss" target="_blank" href="<?php echo Minz_Url::display ($this->rss_url); ?>"> - <?php echo Minz_Translate::t ('rss_view'); ?> - </a> - </li> - </ul> + <?php $url_output = Minz_Request::currentRequest(); ?> + <div class="stick" id="nav_menu_views"> + <?php $url_output['a'] = 'normal'; ?> + <a class="view_normal btn <?php echo $actual_view == 'normal'? 'active' : ''; ?>" title="<?php echo _t('index.menu.normal_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>"> + <?php echo _i("view-normal"); ?> + </a> + + <?php $url_output['a'] = 'global'; ?> + <a class="view_global btn <?php echo $actual_view == 'global'? 'active' : ''; ?>" title="<?php echo _t('index.menu.global_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>"> + <?php echo _i("view-global"); ?> + </a> + + <?php $url_output['a'] = 'reader'; ?> + <a class="view_reader btn <?php echo $actual_view == 'reader'? 'active' : ''; ?>" title="<?php echo _t('index.menu.reader_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>"> + <?php echo _i("view-reader"); ?> + </a> + + <?php + $url_output['a'] = 'rss'; + if (FreshRSS_Context::$user_conf->token) { + $url_output['params']['token'] = FreshRSS_Context::$user_conf->token; + } + if (FreshRSS_Context::$user_conf->since_hours_posts_per_rss) { + $url_output['params']['hours'] = FreshRSS_Context::$user_conf->since_hours_posts_per_rss; + } + ?> + <a class="view_rss btn" target="_blank" rel="noreferrer" title="<?php echo _t('index.menu.rss_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>"> + <?php echo _i('rss'); ?> + </a> </div> <div class="item search"> - <form action="<?php echo _url ('index', 'index'); ?>" method="get"> - <?php $search = Minz_Request::param ('search', ''); ?> - <input type="search" name="search" class="extend" value="<?php echo $search; ?>" placeholder="<?php echo Minz_Translate::t ('search_short'); ?>" /> + <form action="<?php echo _url('index', 'index'); ?>" method="get"> + <input type="search" name="search" class="extend" value="<?php echo FreshRSS_Context::$search; ?>" placeholder="<?php echo _t('index.menu.search_short'); ?>" /> - <?php $get = Minz_Request::param ('get', ''); ?> + <?php $get = Minz_Request::param('get', ''); ?> <?php if($get != '') { ?> <input type="hidden" name="get" value="<?php echo $get; ?>" /> <?php } ?> - <?php $order = Minz_Request::param ('order', ''); ?> + <?php $order = Minz_Request::param('order', ''); ?> <?php if($order != '') { ?> <input type="hidden" name="order" value="<?php echo $order; ?>" /> <?php } ?> - <?php $state = Minz_Request::param ('state', ''); ?> + <?php $state = Minz_Request::param('state', ''); ?> <?php if($state != '') { ?> <input type="hidden" name="state" value="<?php echo $state; ?>" /> <?php } ?> </form> </div> + + <?php + if (FreshRSS_Context::$order === 'DESC') { + $order = 'ASC'; + $icon = 'up'; + $title = 'index.menu.older_first'; + } else { + $order = 'DESC'; + $icon = 'down'; + $title = 'index.menu.newer_first'; + } + $url_order = Minz_Request::currentRequest(); + $url_order['params']['order'] = $order; + ?> + <a id="toggle-order" class="btn" href="<?php echo Minz_Url::display($url_order); ?>" title="<?php echo _t($title); ?>"> + <?php echo _i($icon); ?> + </a> + + <?php if (FreshRSS_Auth::hasAccess() || FreshRSS_Context::$system_conf->allow_anonymous_refresh) { ?> + <a id="actualize" class="btn" href="<?php echo _url('feed', 'actualize'); ?>" title="<?php echo _t('gen.action.actualize'); ?>"><?php echo _i('refresh'); ?></a> + <?php } ?> </div> diff --git a/app/sql.php b/app/sql.php deleted file mode 100644 index 5cd7c52ed..000000000 --- a/app/sql.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php -define('SQL_CREATE_TABLES', ' -CREATE TABLE IF NOT EXISTS `%1$scategory` ( - `id` SMALLINT NOT NULL AUTO_INCREMENT, -- v0.7 - `name` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY (`name`) -- v0.7 -) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci -ENGINE = INNODB; - -CREATE TABLE IF NOT EXISTS `%1$sfeed` ( - `id` SMALLINT NOT NULL AUTO_INCREMENT, -- v0.7 - `url` varchar(511) CHARACTER SET latin1 NOT NULL, - `category` SMALLINT DEFAULT 0, -- v0.7 - `name` varchar(255) NOT NULL, - `website` varchar(255) CHARACTER SET latin1, - `description` text, - `lastUpdate` int(11) DEFAULT 0, - `priority` tinyint(2) NOT NULL DEFAULT 10, - `pathEntries` varchar(511) DEFAULT NULL, - `httpAuth` varchar(511) DEFAULT NULL, - `error` boolean DEFAULT 0, - `keep_history` MEDIUMINT NOT NULL DEFAULT -2, -- v0.7 - `cache_nbEntries` int DEFAULT 0, -- v0.7 - `cache_nbUnreads` int DEFAULT 0, -- v0.7 - PRIMARY KEY (`id`), - FOREIGN KEY (`category`) REFERENCES `%1$scategory`(`id`) ON DELETE SET NULL ON UPDATE CASCADE, - UNIQUE KEY (`url`), -- v0.7 - INDEX (`name`), -- v0.7 - INDEX (`priority`), -- v0.7 - INDEX (`keep_history`) -- v0.7 -) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci -ENGINE = INNODB; - -CREATE TABLE IF NOT EXISTS `%1$sentry` ( - `id` bigint NOT NULL, -- v0.7 - `guid` varchar(760) CHARACTER SET latin1 NOT NULL, -- Maximum for UNIQUE is 767B - `title` varchar(255) NOT NULL, - `author` varchar(255), - `content_bin` blob, -- v0.7 - `link` varchar(1023) CHARACTER SET latin1 NOT NULL, - `date` int(11), - `is_read` boolean NOT NULL DEFAULT 0, - `is_favorite` boolean NOT NULL DEFAULT 0, - `id_feed` SMALLINT, -- v0.7 - `tags` varchar(1023), - PRIMARY KEY (`id`), - FOREIGN KEY (`id_feed`) REFERENCES `%1$sfeed`(`id`) ON DELETE CASCADE ON UPDATE CASCADE, - UNIQUE KEY (`id_feed`,`guid`), -- v0.7 - INDEX (`is_favorite`), -- v0.7 - INDEX (`is_read`) -- v0.7 -) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci -ENGINE = INNODB; - -INSERT IGNORE INTO `%1$scategory` (id, name) VALUES(1, :catName); -'); - -define('SQL_DROP_TABLES', 'DROP TABLES %1$sentry, %1$sfeed, %1$scategory'); diff --git a/app/views/auth/formLogin.phtml b/app/views/auth/formLogin.phtml new file mode 100644 index 000000000..a8213b7ae --- /dev/null +++ b/app/views/auth/formLogin.phtml @@ -0,0 +1,33 @@ +<div class="prompt"> + <h1><?php echo _t('gen.auth.login'); ?></h1> + + <?php if (!max_registrations_reached()) { ?> + <a href="<?php echo _url('auth', 'register'); ?>"><?php echo _t('gen.auth.registration.ask'); ?></a> + <?php } ?> + + <form id="crypto-form" method="post" action="<?php echo _url('auth', 'login'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <div> + <label for="username"><?php echo _t('gen.auth.username'); ?></label> + <input type="text" id="username" name="username" size="16" required="required" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" autofocus="autofocus" /> + </div> + <div> + <label for="passwordPlain"><?php echo _t('gen.auth.password'); ?></label> + <input type="password" id="passwordPlain" required="required" /> + <input type="hidden" id="challenge" name="challenge" /><br /> + <noscript><strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> + </div> + <div> + <label class="checkbox" for="keep_logged_in"> + <input type="checkbox" name="keep_logged_in" id="keep_logged_in" value="1" /> + <?php echo _t('gen.auth.keep_logged_in', $this->cookie_days); ?> + </label> + <br /> + </div> + <div> + <button id="loginButton" type="submit" class="btn btn-important"><?php echo _t('gen.auth.login'); ?></button> + </div> + </form> + + <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('gen.freshrss.about'); ?></a></p> +</div> diff --git a/app/views/auth/index.phtml b/app/views/auth/index.phtml new file mode 100644 index 000000000..010eae33f --- /dev/null +++ b/app/views/auth/index.phtml @@ -0,0 +1,85 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <form method="post" action="<?php echo _url('auth', 'index'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('admin.auth.type'); ?></legend> + + <div class="form-group"> + <label class="group-name" for="auth_type"><?php echo _t('admin.auth.type'); ?></label> + <div class="group-controls"> + <select id="auth_type" name="auth_type" required="required" data-leave-validation="<?php echo FreshRSS_Context::$system_conf->auth_type; ?>"> + <?php if (!in_array(FreshRSS_Context::$system_conf->auth_type, array('form', 'http_auth', 'none'))) { ?> + <option selected="selected"></option> + <?php } ?> + <option value="form"<?php echo FreshRSS_Context::$system_conf->auth_type === 'form' ? ' selected="selected"' : '', cryptAvailable() ? '' : ' disabled="disabled"'; ?>><?php echo _t('admin.auth.form'); ?></option> + <option value="http_auth"<?php echo FreshRSS_Context::$system_conf->auth_type === 'http_auth' ? ' selected="selected"' : '', httpAuthUser() == '' ? ' disabled="disabled"' : ''; ?>><?php echo _t('admin.auth.http'); ?> (REMOTE_USER = '<?php echo httpAuthUser(); ?>')</option> + <option value="none"<?php echo FreshRSS_Context::$system_conf->auth_type === 'none' ? ' selected="selected"' : ''; ?>><?php echo _t('admin.auth.none'); ?></option> + </select> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="anon_access"> + <input type="checkbox" name="anon_access" id="anon_access" value="1"<?php echo FreshRSS_Context::$system_conf->allow_anonymous ? ' checked="checked"' : '', + FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"'; ?> data-leave-validation="<?php echo FreshRSS_Context::$system_conf->allow_anonymous; ?>"/> + <?php echo _t('admin.auth.allow_anonymous', FreshRSS_Context::$system_conf->default_user); ?> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="anon_refresh"> + <input type="checkbox" name="anon_refresh" id="anon_refresh" value="1"<?php echo FreshRSS_Context::$system_conf->allow_anonymous_refresh ? ' checked="checked"' : '', + FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"'; ?> data-leave-validation="<?php echo FreshRSS_Context::$system_conf->allow_anonymous_refresh; ?>"/> + <?php echo _t('admin.auth.allow_anonymous_refresh'); ?> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="unsafe_autologin"> + <input type="checkbox" name="unsafe_autologin" id="unsafe_autologin" value="1"<?php echo FreshRSS_Context::$system_conf->unsafe_autologin_enabled ? ' checked="checked"' : '', + FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"'; ?> data-leave-validation="<?php echo FreshRSS_Context::$system_conf->unsafe_autologin_enabled; ?>"/> + <?php echo _t('admin.auth.unsafe_autologin'); ?> + <kbd><?php echo Minz_Url::display(array('c' => 'auth', 'a' => 'login', 'params' => array('u' => 'alice', 'p' => '1234')), 'html', true); ?></kbd> + </label> + </div> + </div> + + <?php if (FreshRSS_Auth::accessNeedsAction()) { ?> + <div class="form-group"> + <label class="group-name" for="token"><?php echo _t('admin.auth.token'); ?></label> + <?php $token = FreshRSS_Context::$user_conf->token; ?> + <div class="group-controls"> + <input type="text" id="token" name="token" value="<?php echo $token; ?>" placeholder="<?php echo _t('gen.short.blank_to_disable'); ?>"<?php + echo FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"'; ?> data-leave-validation="<?php echo $token; ?>"/> + <?php echo _i('help'); ?> <?php echo _t('admin.auth.token_help'); ?> + <kbd><?php echo Minz_Url::display(array('a' => 'rss', 'params' => array('token' => $token, 'hours' => FreshRSS_Context::$user_conf->since_hours_posts_per_rss)), 'html', true); ?></kbd> + </div> + </div> + <?php } ?> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="api_enabled"> + <input type="checkbox" name="api_enabled" id="api_enabled" value="1"<?php echo FreshRSS_Context::$system_conf->api_enabled ? ' checked="checked"' : '', + FreshRSS_Auth::accessNeedsLogin() ? '' : ' disabled="disabled"'; ?> data-leave-validation="<?php echo FreshRSS_Context::$system_conf->api_enabled; ?>"/> + <?php echo _t('admin.auth.api_enabled'); ?> + </label> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> + </div> + </div> + </form> +</div> diff --git a/app/views/auth/logout.phtml b/app/views/auth/logout.phtml new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/app/views/auth/logout.phtml diff --git a/app/views/auth/register.phtml b/app/views/auth/register.phtml new file mode 100644 index 000000000..1f9976391 --- /dev/null +++ b/app/views/auth/register.phtml @@ -0,0 +1,34 @@ +<div class="prompt"> + <h1><?php echo _t('gen.auth.registration'); ?></h1> + + <form method="post" action="<?php echo _url('user', 'create'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <div> + <label class="group-name" for="new_user_name"><?php echo _t('gen.auth.username'), '<br />', _i('help'), ' ', _t('gen.auth.username.format'); ?></label> + <input id="new_user_name" name="new_user_name" type="text" size="16" required="required" maxlength="16" autocomplete="off" pattern="[0-9a-zA-Z]{1,16}" /> + </div> + + <div> + <label class="group-name" for="new_user_passwordPlain"><?php echo _t('gen.auth.password'), '<br />', _i('help'), ' ', _t('gen.auth.password.format'); ?></label> + <div class="stick"> + <input type="password" id="new_user_passwordPlain" name="new_user_passwordPlain" required="required" autocomplete="off" pattern=".{7,}" /> + <a class="btn toggle-password" data-toggle="new_user_passwordPlain"><?php echo _i('key'); ?></a> + </div> + <noscript><b><?php echo _t('gen.js.should_be_activated'); ?></b></noscript> + </div> + + <div> + <?php + $redirect_url = urlencode(Minz_Url::display( + array('c' => 'index', 'a' => 'index'), + 'php', true + )); + ?> + <input type="hidden" name="r" value="<?php echo $redirect_url; ?>" /> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.create'); ?></button> + <a class="btn" href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.cancel'); ?></a> + </div> + </form> + + <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('gen.freshrss.about'); ?></a></p> +</div> diff --git a/app/views/configure/archiving.phtml b/app/views/configure/archiving.phtml index e144d0f45..2254f5dba 100644 --- a/app/views/configure/archiving.phtml +++ b/app/views/configure/archiving.phtml @@ -1,56 +1,84 @@ <?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> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> <form method="post" action="<?php echo _url('configure', 'archiving'); ?>"> - <legend><?php echo Minz_Translate::t('archiving_configuration'); ?></legend> - <p><?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('archiving_configuration_help'); ?></p> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('conf.archiving'); ?></legend> + <p><?php echo _i('help'); ?> <?php echo _t('conf.archiving.help'); ?></p> <div class="form-group"> - <label class="group-name" for="old_entries"><?php echo Minz_Translate::t('delete_articles_every'); ?></label> + <label class="group-name" for="old_entries"><?php echo _t('conf.archiving.delete_after'); ?></label> <div class="group-controls"> - <input type="number" id="old_entries" name="old_entries" min="1" max="1200" value="<?php echo $this->conf->old_entries; ?>" /> <?php echo Minz_Translate::t('month'); ?> - <a class="btn confirm" href="<?php echo _url('entry', 'purge'); ?>"><?php echo Minz_Translate::t('purge_now'); ?></a> + <input type="number" id="old_entries" name="old_entries" min="1" max="1200" value="<?php echo FreshRSS_Context::$user_conf->old_entries; ?>" data-leave-validation="<?php echo FreshRSS_Context::$user_conf->old_entries; ?>"/> <?php echo _t('gen.date.month'); ?> + <a class="btn confirm" href="<?php echo _url('entry', 'purge'); ?>"><?php echo _t('conf.archiving.purge_now'); ?></a> </div> </div> <div class="form-group"> - <label class="group-name" for="keep_history_default"><?php echo Minz_Translate::t('keep_history'), ' ', Minz_Translate::t('by_feed'); ?></label> + <label class="group-name" for="keep_history_default"><?php echo _t('conf.archiving.keep_history_by_feed'); ?></label> <div class="group-controls"> - <select class="number" name="keep_history_default" id="keep_history_default" required="required"><?php + <select class="number" name="keep_history_default" id="keep_history_default" required="required" data-leave-validation="<?php echo FreshRSS_Context::$user_conf->keep_history_default; ?>"><?php foreach (array('' => '', 0 => '0', 10 => '10', 50 => '50', 100 => '100', 500 => '500', 1000 => '1 000', 5000 => '5 000', 10000 => '10 000', -1 => '∞') as $v => $t) { - echo '<option value="' . $v . ($this->conf->keep_history_default == $v ? '" selected="selected' : '') . '">' . $t . ' </option>'; + echo '<option value="' . $v . (FreshRSS_Context::$user_conf->keep_history_default == $v ? '" selected="selected' : '') . '">' . $t . ' </option>'; } - ?></select> (<?php echo Minz_Translate::t('by_default'); ?>) + ?></select> (<?php echo _t('gen.short.by_default'); ?>) + </div> + </div> + <div class="form-group"> + <label class="group-name" for="ttl_default"><?php echo _t('conf.archiving.ttl'); ?></label> + <div class="group-controls"> + <select class="number" name="ttl_default" id="ttl_default" required="required" data-leave-validation="<?php echo FreshRSS_Context::$user_conf->ttl_default; ?>"><?php + $found = false; + foreach (array(1200 => '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min', + 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) { + echo '<option value="' . $v . (FreshRSS_Context::$user_conf->ttl_default == $v ? '" selected="selected' : '') . '">' . $t . '</option>'; + if (FreshRSS_Context::$user_conf->ttl_default == $v) { + $found = true; + } + } + if (!$found) { + echo '<option value="' . intval(FreshRSS_Context::$user_conf->ttl_default) . '" selected="selected">' . intval(FreshRSS_Context::$user_conf->ttl_default) . 's</option>'; + } + ?></select> (<?php echo _t('gen.short.by_default'); ?>) </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> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> </div> </div> </form> <form method="post" action="<?php echo _url('entry', 'optimize'); ?>"> - <legend><?php echo Minz_Translate::t ('advanced'); ?></legend> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('conf.archiving.advanced'); ?></legend> <div class="form-group"> - <p class="group-name"><?php echo Minz_Translate::t('current_user'); ?></p> + <label class="group-name"><?php echo _t('conf.user.current'); ?></label> <div class="group-controls"> - <p><?php echo formatNumber($this->nb_total), ' ', Minz_Translate::t('articles'), ', ', formatBytes($this->size_user); ?></p> - <input type="hidden" name="optimiseDatabase" value="1" /> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('optimize_bdd'); ?></button> - <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('optimize_todo_sometimes'); ?> + <?php echo _t('conf.user.articles_and_size', format_number($this->nb_total), format_bytes($this->size_user)); ?> </div> </div> - <?php if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { ?> + <?php if (FreshRSS_Auth::hasAccess('admin')) { ?> <div class="form-group"> - <p class="group-name"><?php echo Minz_Translate::t('users'); ?></p> + <label class="group-name"><?php echo _t('conf.user.users'); ?></label> <div class="group-controls"> - <p><?php echo formatBytes($this->size_total); ?></p> + <?php echo format_bytes($this->size_total); ?> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <input type="hidden" name="optimiseDatabase" value="1" /> + <button type="submit" class="btn btn-important"><?php echo _t('conf.archiving.optimize'); ?></button> + <?php echo _i('help'); ?> <?php echo _t('conf.archiving.optimize_help'); ?> </div> </div> <?php } ?> diff --git a/app/views/configure/categorize.phtml b/app/views/configure/categorize.phtml deleted file mode 100644 index a564e8cdd..000000000 --- a/app/views/configure/categorize.phtml +++ /dev/null @@ -1,47 +0,0 @@ -<?php $this->partial ('aside_feed'); ?> - -<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', 'categorize'); ?>"> - <legend><?php echo Minz_Translate::t ('categories_management'); ?></legend> - - <p class="alert alert-warn"><?php echo Minz_Translate::t ('feeds_moved_category_deleted', $this->defaultCategory->name ()); ?></p> - - <?php $i = 0; foreach ($this->categories as $cat) { $i++; ?> - <div class="form-group"> - <label class="group-name" for="cat_<?php echo $cat->id (); ?>"> - <?php echo Minz_Translate::t ('category_number', $i); ?> - </label> - <div class="group-controls"> - <input type="text" id="cat_<?php echo $cat->id (); ?>" name="categories[]" value="<?php echo $cat->name (); ?>" /> - - <?php if ($cat->nbFeed () > 0) { ?> - <a class="confirm" href="<?php echo _url ('feed', 'delete', 'id', $cat->id (), 'type', 'category'); ?>"><?php echo Minz_Translate::t ('ask_empty'); ?></a> - <?php } ?> - (<?php echo Minz_Translate::t ('number_feeds', $cat->nbFeed ()); ?>) - - <?php if ($cat->id () == $this->defaultCategory->id ()) { ?> - <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('can_not_be_deleted'); ?> - <?php } ?> - - <input type="hidden" name="ids[]" value="<?php echo $cat->id (); ?>" /> - </div> - </div> - <?php } ?> - - <div class="form-group"> - <label class="group-name" for="new_category"><?php echo Minz_Translate::t ('add_category'); ?></label> - <div class="group-controls"> - <input type="text" id="new_category" name="new_category" placeholder="<?php echo Minz_Translate::t ('new_category'); ?>" /> - </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/display.phtml b/app/views/configure/display.phtml index 9104e4ef1..62ecc1080 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -1,194 +1,123 @@ -<?php $this->partial ('aside_configure'); ?> +<?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> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> - <form method="post" action="<?php echo _url ('configure', 'display'); ?>"> - <legend><?php echo Minz_Translate::t ('theme'); ?></legend> + <form method="post" action="<?php echo _url('configure', 'display'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('conf.display'); ?></legend> <div class="form-group"> - <label class="group-name" for="language"><?php echo Minz_Translate::t ('language'); ?></label> + <label class="group-name" for="language"><?php echo _t('conf.display.language'); ?></label> <div class="group-controls"> - <select name="language" id="language"> - <?php $languages = $this->conf->availableLanguages (); ?> - <?php foreach ($languages as $short => $lib) { ?> - <option value="<?php echo $short; ?>"<?php echo $this->conf->language === $short ? ' selected="selected"' : ''; ?>><?php echo $lib; ?></option> + <select name="language" id="language" data-leave-validation="<?php echo FreshRSS_Context::$user_conf->language; ?>"> + <?php $languages = Minz_Translate::availableLanguages(); ?> + <?php foreach ($languages as $lang) { ?> + <option value="<?php echo $lang; ?>"<?php echo FreshRSS_Context::$user_conf->language === $lang ? ' selected="selected"' : ''; ?>><?php echo _t('gen.lang.' . $lang); ?></option> <?php } ?> </select> </div> </div> <div class="form-group"> - <label class="group-name" for="theme"><?php echo Minz_Translate::t ('theme'); ?></label> + <label class="group-name" for="theme"><?php echo _t('conf.display.theme'); ?></label> <div class="group-controls"> - <select name="theme" id="theme" required=""><?php - $found = false; - foreach ($this->themes as $theme) { - ?><option value="<?php echo $theme['id']; ?>"<?php if ($this->conf->theme === $theme['id']) { echo ' selected="selected"'; $found = true; } ?>><?php - echo $theme['name'] . ' — ' . Minz_Translate::t ('by') . ' ' . $theme['author']; - ?></option><?php - } - if (!$found) { - ?><option selected="selected"></option><?php - } - ?></select> - </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> + <ul class="slides"> + <?php $slides = count($this->themes); $i = 1; ?> + <?php foreach($this->themes as $theme) { ?> + <input type="radio" name="theme" id="img-<?php echo $i ?>" <?php if (FreshRSS_Context::$user_conf->theme === $theme['id']) {echo "checked";}?> value="<?php echo $theme['id'] ?>" data-leave-validation="<?php echo (FreshRSS_Context::$user_conf->theme === $theme['id']) ? 1 : 0; ?>"/> + <li class="slide-container"> + <div class="slide"> + <img src="<?php echo Minz_Url::display('/themes/' . $theme['id'] . '/thumbs/original.png')?>"/> + </div> + <div class="nav"> + <?php if ($i !== 1) {?> + <label for="img-<?php echo $i - 1 ?>" class="prev">‹</label> + <?php } ?> + <?php if ($i !== $slides) {?> + <label for="img-<?php echo $i + 1 ?>" class="next">›</label> + <?php } ?> + </div> + <div class="properties"> + <div><?php echo sprintf('%s — %s', $theme['name'], _t('gen.short.by_author', $theme['author'])); ?></div> + <div><?php echo $theme['description'] ?></div> + <div class="page-number"><?php echo sprintf('%d/%d', $i, $slides) ?></div> + </div> + </li> + <?php $i++ ?> + <?php } ?> + </ul> </div> </div> + <?php $width = FreshRSS_Context::$user_conf->content_width; ?> <div class="form-group"> - <label class="group-name" for="view_mode"><?php echo Minz_Translate::t ('default_view'); ?></label> + <label class="group-name" for="content_width"><?php echo _t('conf.display.width.content'); ?></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 name="content_width" id="content_width" required="" data-leave-validation="<?php echo $width; ?>"> + <option value="thin" <?php echo $width === 'thin'? 'selected="selected"' : ''; ?>> + <?php echo _t('conf.display.width.thin'); ?> + </option> + <option value="medium" <?php echo $width === 'medium'? 'selected="selected"' : ''; ?>> + <?php echo _t('conf.display.width.medium'); ?> + </option> + <option value="large" <?php echo $width === 'large'? 'selected="selected"' : ''; ?>> + <?php echo _t('conf.display.width.large'); ?> + </option> + <option value="no_limit" <?php echo $width === 'no_limit'? 'selected="selected"' : ''; ?>> + <?php echo _t('conf.display.width.no_limit'); ?> + </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"> - <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 _t('conf.display.icon.entry'); ?></label> <table> <thead> <tr> <th> </th> - <th title="<?php echo Minz_Translate::t ('mark_read'); ?>"><?php echo FreshRSS_Themes::icon('read'); ?></th> - <th title="<?php echo Minz_Translate::t ('mark_favorite'); ?>"><?php echo FreshRSS_Themes::icon('bookmark'); ?></th> - <th><?php echo Minz_Translate::t ('sharing'); ?></th> - <th><?php echo Minz_Translate::t ('related_tags'); ?></th> - <th><?php echo Minz_Translate::t ('publication_date'); ?></th> - <th><?php echo FreshRSS_Themes::icon('link'); ?></th> + <th title="<?php echo _t('gen.action.mark_read'); ?>"><?php echo _i('read'); ?></th> + <th title="<?php echo _t('gen.action.mark_favorite'); ?>"><?php echo _i('bookmark'); ?></th> + <th><?php echo _t('conf.display.icon.sharing'); ?></th> + <th><?php echo _t('conf.display.icon.related_tags'); ?></th> + <th><?php echo _t('conf.display.icon.publication_date'); ?></th> + <th><?php echo _i('link'); ?></th> </tr> </thead> <tbody> <tr> - <th><?php echo Minz_Translate::t ('top_line'); ?></th> - <td><input type="checkbox" name="topline_read" value="1"<?php echo $this->conf->topline_read ? ' checked="checked"' : ''; ?> /></td> - <td><input type="checkbox" name="topline_favorite" value="1"<?php echo $this->conf->topline_favorite ? ' checked="checked"' : ''; ?> /></td> + <th><?php echo _t('conf.display.icon.top_line'); ?></th> + <td><input type="checkbox" name="topline_read" value="1"<?php echo FreshRSS_Context::$user_conf->topline_read ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->topline_read; ?>"/></td> + <td><input type="checkbox" name="topline_favorite" value="1"<?php echo FreshRSS_Context::$user_conf->topline_favorite ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->topline_favorite; ?>"/></td> <td><input type="checkbox" disabled="disabled" /></td> <td><input type="checkbox" disabled="disabled" /></td> - <td><input type="checkbox" name="topline_date" value="1"<?php echo $this->conf->topline_date ? ' checked="checked"' : ''; ?> /></td> - <td><input type="checkbox" name="topline_link" value="1"<?php echo $this->conf->topline_link ? ' checked="checked"' : ''; ?> /></td> + <td><input type="checkbox" name="topline_date" value="1"<?php echo FreshRSS_Context::$user_conf->topline_date ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->topline_date; ?>"/></td> + <td><input type="checkbox" name="topline_link" value="1"<?php echo FreshRSS_Context::$user_conf->topline_link ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->topline_link; ?>"/></td> </tr><tr> - <th><?php echo Minz_Translate::t ('bottom_line'); ?></th> - <td><input type="checkbox" name="bottomline_read" value="1"<?php echo $this->conf->bottomline_read ? ' checked="checked"' : ''; ?> /></td> - <td><input type="checkbox" name="bottomline_favorite" value="1"<?php echo $this->conf->bottomline_favorite ? ' checked="checked"' : ''; ?> /></td> - <td><input type="checkbox" name="bottomline_sharing" value="1"<?php echo $this->conf->bottomline_sharing ? ' checked="checked"' : ''; ?> /></td> - <td><input type="checkbox" name="bottomline_tags" value="1"<?php echo $this->conf->bottomline_tags ? ' checked="checked"' : ''; ?> /></td> - <td><input type="checkbox" name="bottomline_date" value="1"<?php echo $this->conf->bottomline_date ? ' checked="checked"' : ''; ?> /></td> - <td><input type="checkbox" name="bottomline_link" value="1"<?php echo $this->conf->bottomline_link ? ' checked="checked"' : ''; ?> /></td> + <th><?php echo _t('conf.display.icon.bottom_line'); ?></th> + <td><input type="checkbox" name="bottomline_read" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_read ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->bottomline_read; ?>"/></td> + <td><input type="checkbox" name="bottomline_favorite" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_favorite ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->bottomline_favorite; ?>"/></td> + <td><input type="checkbox" name="bottomline_sharing" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_sharing ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->bottomline_sharing; ?>"/></td> + <td><input type="checkbox" name="bottomline_tags" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_tags ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->bottomline_tags; ?>"/></td> + <td><input type="checkbox" name="bottomline_date" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_date ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->bottomline_date; ?>"/></td> + <td><input type="checkbox" name="bottomline_link" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_link ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->bottomline_link; ?>"/></td> </tr> </tbody> </table><br /> </div> + + <div class="form-group"> + <label class="group-name" for="html5_notif_timeout"><?php echo _t('conf.display.notif_html5.timeout'); ?></label> + <div class="group-controls"> + <input type="number" id="html5_notif_timeout" name="html5_notif_timeout" value="<?php echo FreshRSS_Context::$user_conf->html5_notif_timeout; ?>" data-leave-validation="<?php echo FreshRSS_Context::$user_conf->html5_notif_timeout; ?>"/> <?php echo _t('conf.display.notif_html5.seconds'); ?> + </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> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> </div> </div> </form> diff --git a/app/views/configure/feed.phtml b/app/views/configure/feed.phtml deleted file mode 100644 index 2da04ac2d..000000000 --- a/app/views/configure/feed.phtml +++ /dev/null @@ -1,150 +0,0 @@ -<?php $this->partial ('aside_feed'); ?> - -<?php if ($this->flux) { ?> -<div class="post"> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> <?php echo Minz_Translate::t ('or'); ?> <a href="<?php echo _url ('index', 'index', 'get', 'f_' . $this->flux->id ()); ?>"><?php echo Minz_Translate::t ('filter'); ?></a> - - <h1><?php echo $this->flux->name (); ?></h1> - <?php echo $this->flux->description (); ?> - - <?php $nbEntries = $this->flux->nbEntries (); ?> - - <?php if ($this->flux->inError ()) { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo Minz_Translate::t ('damn'); ?></span> <?php echo Minz_Translate::t ('feed_in_error'); ?></p> - <?php } elseif ($nbEntries === 0) { ?> - <p class="alert alert-warn"><?php echo Minz_Translate::t ('feed_empty'); ?></p> - <?php } ?> - - <form method="post" action="<?php echo _url ('configure', 'feed', 'id', $this->flux->id ()); ?>" autocomplete="off"> - <legend><?php echo Minz_Translate::t ('informations'); ?></legend> - <div class="form-group"> - <label class="group-name" for="name"><?php echo Minz_Translate::t ('title'); ?></label> - <div class="group-controls"> - <input type="text" name="name" id="name" class="extend" value="<?php echo $this->flux->name () ; ?>" /> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="description"><?php echo Minz_Translate::t ('feed_description'); ?></label> - <div class="group-controls"> - <textarea name="description" id="description"><?php echo htmlspecialchars($this->flux->description(), ENT_NOQUOTES, 'UTF-8'); ?></textarea> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="website"><?php echo Minz_Translate::t ('website_url'); ?></label> - <div class="group-controls"> - <input type="text" name="website" id="website" class="extend" value="<?php echo $this->flux->website (); ?>" /> - <a target="_blank" href="<?php echo $this->flux->website (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="url"><?php echo Minz_Translate::t ('feed_url'); ?></label> - <div class="group-controls"> - <input type="text" name="url" id="url" class="extend" value="<?php echo $this->flux->url (); ?>" /> - <a target="_blank" href="<?php echo $this->flux->url (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> - <a class="btn" target="_blank" href="http://validator.w3.org/feed/check.cgi?url=<?php echo $this->flux->url (); ?>"><?php echo Minz_Translate::t ('feed_validator'); ?></a> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="category"><?php echo Minz_Translate::t ('category'); ?></label> - <div class="group-controls"> - <select name="category" id="category"> - <?php foreach ($this->categories as $cat) { ?> - <option value="<?php echo $cat->id (); ?>"<?php echo $cat->id ()== $this->flux->category () ? ' selected="selected"' : ''; ?>> - <?php echo $cat->name (); ?> - </option> - <?php } ?> - </select> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="priority"><?php echo Minz_Translate::t ('show_in_all_flux'); ?></label> - <div class="group-controls"> - <label class="checkbox" for="priority"> - <input type="checkbox" name="priority" id="priority" value="10"<?php echo $this->flux->priority () > 0 ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('yes'); ?> - </label> - </div> - </div> - <div class="form-group form-actions"> - <div class="group-controls"> - <button class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> - <button class="btn btn-attention confirm" formmethod="post" formaction="<?php echo Minz_Url::display (array ('c' => 'feed', 'a' => 'delete', 'params' => array ('id' => $this->flux->id ()))); ?>"><?php echo Minz_Translate::t ('delete'); ?></button> - </div> - </div> - - <legend><?php echo Minz_Translate::t ('archiving_configuration'); ?></legend> - - <div class="form-group"> - <label class="group-name"></label> - <div class="group-controls"> - <a class="btn" href="<?php echo _url ('feed', 'actualize', 'id', $this->flux->id ()); ?>"> - <?php echo FreshRSS_Themes::icon('refresh'); ?> <?php echo Minz_Translate::t('actualize'); ?> - </a> - </div> - </div> - <div class="form-group"> - <label class="group-name"><?php echo Minz_Translate::t ('number_articles'); ?></label> - <div class="group-controls"> - <span class="control"><?php echo $nbEntries; ?></span> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="keep_history"><?php echo Minz_Translate::t ('keep_history'); ?></label> - <div class="group-controls"> - <select class="number" name="keep_history" id="keep_history" required="required"><?php - foreach (array('' => '', -2 => Minz_Translate::t('by_default'), 0 => '0', 10 => '10', 50 => '50', 100 => '100', 500 => '500', 1000 => '1 000', 5000 => '5 000', 10000 => '10 000', -1 => '∞') as $v => $t) { - echo '<option value="' . $v . ($this->flux->keepHistory() === $v ? '" selected="selected' : '') . '">' . $t . '</option>'; - } - ?></select> - </div> - </div> - <div class="form-group form-actions"> - <div class="group-controls"> - <button class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> - <button class="btn btn-attention confirm" formmethod="post" formaction="<?php echo Minz_Url::display (array ('c' => 'feed', 'a' => 'truncate', 'params' => array ('id' => $this->flux->id ()))); ?>"><?php echo Minz_Translate::t ('truncate'); ?></button> - </div> - </div> - - <legend><?php echo Minz_Translate::t ('login_configuration'); ?></legend> - <?php $auth = $this->flux->httpAuth (false); ?> - <div class="form-group"> - <label class="group-name" for="http_user"><?php echo Minz_Translate::t ('http_username'); ?></label> - <div class="group-controls"> - <input type="text" name="http_user" id="http_user" class="extend" value="<?php echo $auth['username']; ?>" autocomplete="off" /> - <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('access_protected_feeds'); ?> - </div> - - <label class="group-name" for="http_pass"><?php echo Minz_Translate::t ('http_password'); ?></label> - <div class="group-controls"> - <input type="password" name="http_pass" id="http_pass" class="extend" value="<?php echo $auth['password']; ?>" autocomplete="off" /> - </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 ('advanced'); ?></legend> - <div class="form-group"> - <label class="group-name" for="path_entries"><?php echo Minz_Translate::t ('css_path_on_website'); ?></label> - <div class="group-controls"> - <input type="text" name="path_entries" id="path_entries" class="extend" value="<?php echo $this->flux->pathEntries (); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" /> - <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('retrieve_truncated_feeds'); ?> - </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> - -<?php } else { ?> -<div class="alert alert-warn"><span class="alert-head"><?php echo Minz_Translate::t ('no_selected_feed'); ?></span> <?php echo Minz_Translate::t ('think_to_add'); ?></div> -<?php } ?> diff --git a/app/views/configure/importExport.phtml b/app/views/configure/importExport.phtml deleted file mode 100644 index e2217d9ed..000000000 --- a/app/views/configure/importExport.phtml +++ /dev/null @@ -1,40 +0,0 @@ -<?php -require_once(LIB_PATH . '/lib_opml.php'); -if ($this->req == 'export') { - echo '<?xml version="1.0" encoding="UTF-8" ?>'; -?> -<!-- Generated by <?php echo Minz_Configuration::title (); ?> --> -<opml version="2.0"> - <head> - <title><?php echo Minz_Configuration::title (); ?> OPML Feed</title> - <dateCreated><?php echo date('D, d M Y H:i:s'); ?></dateCreated> - </head> - <body> -<?php echo opml_export ($this->categories); ?> - </body> -</opml> -<?php } else { ?> -<?php $this->partial ('aside_feed'); ?> - -<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 Minz_Url::display (array ('c' => 'configure', 'a' => 'importExport', 'params' => array ('q' => 'import'))); ?>" enctype="multipart/form-data"> - <legend><?php echo Minz_Translate::t ('import_export_opml'); ?></legend> - <div class="form-group"> - <label class="group-name" for="file"><?php echo Minz_Translate::t ('file_to_import'); ?></label> - <div class="group-controls"> - <input type="file" name="file" id="file" /> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('import'); ?></button> - <?php echo Minz_Translate::t ('or'); ?> - <a target="_blank" class="btn btn-important" href="<?php echo _url ('configure', 'importExport', 'q', 'export'); ?>"><?php echo Minz_Translate::t ('export'); ?></a> - </div> - </div> - </form> -</div> -<?php } ?> diff --git a/app/views/configure/queries.phtml b/app/views/configure/queries.phtml new file mode 100644 index 000000000..0dffa268d --- /dev/null +++ b/app/views/configure/queries.phtml @@ -0,0 +1,88 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <form method="post" action="<?php echo _url('configure', 'queries'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('conf.query'); ?></legend> + + <?php foreach ($this->queries as $key => $query) { ?> + <div class="form-group" id="query-group-<?php echo $key; ?>"> + <label class="group-name" for="queries_<?php echo $key; ?>_name"> + <?php echo _t('conf.query.number', $key + 1); ?> + </label> + + <div class="group-controls"> + <input type="hidden" id="queries_<?php echo $key; ?>_search" name="queries[<?php echo $key; ?>][url]" value="<?php echo $query->getUrl(); ?>"/> + <input type="hidden" id="queries_<?php echo $key; ?>_search" name="queries[<?php echo $key; ?>][search]" value="<?php echo $query->getSearch(); ?>"/> + <input type="hidden" id="queries_<?php echo $key; ?>_state" name="queries[<?php echo $key; ?>][state]" value="<?php echo $query->getState(); ?>"/> + <input type="hidden" id="queries_<?php echo $key; ?>_order" name="queries[<?php echo $key; ?>][order]" value="<?php echo $query->getOrder(); ?>"/> + <input type="hidden" id="queries_<?php echo $key; ?>_get" name="queries[<?php echo $key; ?>][get]" value="<?php echo $query->getGet(); ?>"/> + + <div class="stick"> + <input class="extend" + type="text" + id="queries_<?php echo $key; ?>_name" + name="queries[<?php echo $key; ?>][name]" + value="<?php echo $query->getName(); ?>" + data-leave-validation="<?php echo $query->getName(); ?>" + /> + + <a class="btn" href="<?php echo $query->getUrl(); ?>"> + <?php echo _i('link'); ?> + </a> + + <a class="btn btn-attention remove" href="#" data-remove="query-group-<?php echo $key; ?>"> + <?php echo _i('close'); ?> + </a> + </div> + + <?php if (!$query->hasParameters()) { ?> + <div class="alert alert-warn"> + <div class="alert-head"><?php echo _t('conf.query.no_filter'); ?></div> + </div> + <?php } elseif ($query->isDeprecated()) { ?> + <div class="alert alert-error"> + <div class="alert-head"><?php echo _t('conf.query.deprecated'); ?></div> + </div> + <?php } else { ?> + <div class="alert alert-success"> + <div class="alert-head"><?php echo _t('conf.query.filter'); ?></div> + + <ul> + <?php if ($query->hasSearch()) { ?> + <li class="item"><?php echo _t('conf.query.search', $query->getSearch()->getRawInput()); ?></li> + <?php } ?> + + <?php if ($query->getState()) { ?> + <li class="item"><?php echo _t('conf.query.state_' . $query->getState()); ?></li> + <?php } ?> + + <?php if ($query->getOrder()) { ?> + <li class="item"><?php echo _t('conf.query.order_' . strtolower($query->getOrder())); ?></li> + <?php } ?> + + <?php if ($query->getGet()) { ?> + <li class="item"><?php echo _t('conf.query.get_' . $query->getGetType(), $query->getGetName()); ?></li> + <?php } ?> + </ul> + </div> + <?php } ?> + </div> + </div> + <?php } ?> + + <?php if (count(FreshRSS_Context::$user_conf->queries) > 0) { ?> + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> + </div> + </div> + <?php } else { ?> + <p class="alert alert-warn"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('conf.query.none'); ?></p> + <?php } ?> + </form> + +</div>
\ No newline at end of file diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml new file mode 100644 index 000000000..07dabf15f --- /dev/null +++ b/app/views/configure/reading.phtml @@ -0,0 +1,178 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <form method="post" action="<?php echo _url('configure', 'reading'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('conf.reading'); ?></legend> + + <div class="form-group"> + <label class="group-name" for="posts_per_page"><?php echo _t('conf.reading.articles_per_page'); ?></label> + <div class="group-controls"> + <input type="number" id="posts_per_page" name="posts_per_page" value="<?php echo FreshRSS_Context::$user_conf->posts_per_page; ?>" min="5" max="500" data-leave-validation="<?php echo FreshRSS_Context::$user_conf->posts_per_page; ?>"/> + <?php echo _i('help'); ?> <?php echo _t('conf.reading.number_divided_when_reader'); ?> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="sort_order"><?php echo _t('conf.reading.sort'); ?></label> + <div class="group-controls"> + <select name="sort_order" id="sort_order" data-leave-validation="<?php echo FreshRSS_Context::$user_conf->sort_order; ?>"> + <option value="DESC"<?php echo FreshRSS_Context::$user_conf->sort_order === 'DESC' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.sort.newer_first'); ?></option> + <option value="ASC"<?php echo FreshRSS_Context::$user_conf->sort_order === 'ASC' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.sort.older_first'); ?></option> + </select> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="view_mode"><?php echo _t('conf.reading.view.default'); ?></label> + <div class="group-controls"> + <select name="view_mode" id="view_mode" data-leave-validation="<?php echo FreshRSS_Context::$user_conf->view_mode; ?>"> + <option value="normal"<?php echo FreshRSS_Context::$user_conf->view_mode === 'normal' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.view.normal'); ?></option> + <option value="reader"<?php echo FreshRSS_Context::$user_conf->view_mode === 'reader' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.view.reader'); ?></option> + <option value="global"<?php echo FreshRSS_Context::$user_conf->view_mode === 'global' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.view.global'); ?></option> + </select> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="view_mode"><?php echo _t('conf.reading.show'); ?></label> + <div class="group-controls"> + <select name="default_view" id="default_view" data-leave-validation="<?php echo FreshRSS_Context::$user_conf->default_view; ?>"> + <option value="adaptive"<?php echo FreshRSS_Context::$user_conf->default_view === 'adaptive' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.show.adaptive'); ?></option> + <option value="all"<?php echo FreshRSS_Context::$user_conf->default_view === 'all' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.show.all_articles'); ?></option> + <option value="unread"<?php echo FreshRSS_Context::$user_conf->default_view === 'unread' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.show.unread'); ?></option> + </select> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="hide_read_feeds"> + <input type="checkbox" name="hide_read_feeds" id="hide_read_feeds" value="1"<?php echo FreshRSS_Context::$user_conf->hide_read_feeds ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->hide_read_feeds; ?>"/> + <?php echo _t('conf.reading.hide_read_feeds'); ?> + </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 FreshRSS_Context::$user_conf->display_posts ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->display_posts; ?>"/> + <?php echo _t('conf.reading.display_articles_unfolded'); ?> + <noscript> — <strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="display_categories"> + <input type="checkbox" name="display_categories" id="display_categories" value="1"<?php echo FreshRSS_Context::$user_conf->display_categories ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->display_categories; ?>"/> + <?php echo _t('conf.reading.display_categories_unfolded'); ?> + <noscript> — <strong><?php echo _t('gen.js.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 FreshRSS_Context::$user_conf->sticky_post ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->sticky_post; ?>"/> + <?php echo _t('conf.reading.sticky_post'); ?> + <noscript> — <strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> + </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 FreshRSS_Context::$user_conf->auto_load_more ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->auto_load_more; ?>"/> + <?php echo _t('conf.reading.auto_load_more'); ?> + <noscript> — <strong><?php echo _t('gen.js.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 FreshRSS_Context::$user_conf->lazyload ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->lazyload; ?>"/> + <?php echo _t('conf.reading.img_with_lazyload'); ?> + <noscript> — <strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="reading_confirm"> + <input type="checkbox" name="reading_confirm" id="reading_confirm" value="1"<?php echo FreshRSS_Context::$user_conf->reading_confirm ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->reading_confirm; ?>"/> + <?php echo _t('conf.reading.confirm_enabled'); ?> + <noscript> — <strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="auto_remove_article"> + <input type="checkbox" name="auto_remove_article" id="auto_remove_article" value="1"<?php echo FreshRSS_Context::$user_conf->auto_remove_article ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->auto_remove_article; ?>"/> + <?php echo _t('conf.reading.auto_remove_article'); ?> + <noscript> — <strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="mark_updated_article_unread"> + <input type="checkbox" name="mark_updated_article_unread" id="mark_updated_article_unread" value="1"<?php echo FreshRSS_Context::$user_conf->mark_updated_article_unread ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->mark_updated_article_unread; ?>"/> + <?php echo _t('conf.reading.mark_updated_article_unread'); ?> + </label> + </div> + </div> + + <div class="form-group"> + <label class="group-name"><?php echo _t('conf.reading.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 FreshRSS_Context::$user_conf->mark_when['article'] ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->mark_when['article']; ?>"/> + <?php echo _t('conf.reading.read.article_viewed'); ?> + </label> + <label class="checkbox" for="check_open_site"> + <input type="checkbox" name="mark_open_site" id="check_open_site" value="1"<?php echo FreshRSS_Context::$user_conf->mark_when['site'] ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->mark_when['site']; ?>"/> + <?php echo _t('conf.reading.read.article_open_on_website'); ?> + </label> + <label class="checkbox" for="check_scroll"> + <input type="checkbox" name="mark_scroll" id="check_scroll" value="1"<?php echo FreshRSS_Context::$user_conf->mark_when['scroll'] ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->mark_when['scroll']; ?>"/> + <?php echo _t('conf.reading.read.scroll'); ?> + </label> + <label class="checkbox" for="check_reception"> + <input type="checkbox" name="mark_upon_reception" id="check_reception" value="1"<?php echo FreshRSS_Context::$user_conf->mark_when['reception'] ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->mark_when['reception']; ?>"/> + <?php echo _t('conf.reading.read.upon_reception'); ?> + </label> + </div> + </div> + + <div class="form-group"> + <label class="group-name"><?php echo _t('conf.reading.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 FreshRSS_Context::$user_conf->onread_jump_next ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->onread_jump_next; ?>"/> + <?php echo _t('conf.reading.jump_next'); ?> + </label> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> + </div> + </div> + + </form> +</div> diff --git a/app/views/configure/sharing.phtml b/app/views/configure/sharing.phtml index e3ea11665..ffcfb8b29 100644 --- a/app/views/configure/sharing.phtml +++ b/app/views/configure/sharing.phtml @@ -1,63 +1,66 @@ -<?php $this->partial ('aside_configure'); ?> +<?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> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> - <form method="post" action="<?php echo _url ('configure', 'sharing'); ?>"> - <legend><?php echo Minz_Translate::t ('sharing'); ?></legend> - <div class="form-group"> - <label class="group-name" for="shaarli"> - <?php echo Minz_Translate::t ('your_shaarli'); ?> - </label> - <div class="group-controls"> - <input type="url" id="shaarli" name="shaarli" class="extend" value="<?php echo $this->conf->sharing ('shaarli'); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" size="64" /> - - <?php echo FreshRSS_Themes::icon('help'); ?> <a target="_blank" href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli"><?php echo Minz_Translate::t ('more_information'); ?></a> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="wallabag"> - <?php echo Minz_Translate::t ('your_wallabag'); ?> - </label> - <div class="group-controls"> - <input type="url" id="wallabag" name="wallabag" class="extend" value="<?php echo $this->conf->sharing ('wallabag'); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" size="64" /> - - <?php echo FreshRSS_Themes::icon('help'); ?> <a target="_blank" href="http://www.wallabag.org"><?php echo Minz_Translate::t ('more_information'); ?></a> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="diaspora"> - <?php echo Minz_Translate::t ('your_diaspora_pod'); ?> - </label> - <div class="group-controls"> - <input type="url" id="diaspora" name="diaspora" class="extend" value="<?php echo $this->conf->sharing ('diaspora'); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" size="64" /> - - <?php echo FreshRSS_Themes::icon('help'); ?> <a target="_blank" href="https://diasporafoundation.org/"><?php echo Minz_Translate::t ('more_information'); ?></a> + <form method="post" action="<?php echo _url('configure', 'sharing'); ?>" + data-simple='<div class="form-group" id="group-share-##key##"><label class="group-name">##label##</label><div class="group-controls"><div class="stick"><input type="text" id="share_##key##_name" name="share[##key##][name]" class="extend" value="##label##" placeholder="<?php echo _t('conf.sharing.share_name'); ?>" size="64" /> + <input type="url" id="share_##key##_url" name="share[##key##][url]" class="extend" value="" placeholder="<?php echo _t('gen.short.not_applicable'); ?>" size="64" disabled /><a href="#" class="remove btn btn-attention" data-remove="group-share-##key##"><?php echo _i('close'); ?></a></div> + <input type="hidden" id="share_##key##_type" name="share[##key##][type]" value="##type##" /></div></div>' + data-advanced='<div class="form-group" id="group-share-##key##"><label class="group-name">##label##</label><div class="group-controls"> + <input type="hidden" id="share_##key##_type" name="share[##key##][type]" value="##type##" /> + <div class="stick"> + <input type="text" id="share_##key##_name" name="share[##key##][name]" class="extend" value="" placeholder="<?php echo _t('conf.sharing.share_name'); ?>" size="64" /> + <input type="url" id="share_##key##_url" name="share[##key##][url]" class="extend" value="" placeholder="<?php echo _t('conf.sharing.share_url'); ?>" size="64" /> + <a href="#" class="remove btn btn-attention" data-remove="group-share-##key##"><?php echo _i('close'); ?></a></div> + <a target="_blank" rel="noreferrer" class="btn" title="<?php echo _t('conf.sharing.more_information'); ?>" href="##help##"><?php echo _i('help'); ?></a> + </div></div>'> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('conf.sharing'); ?></legend> + <?php + foreach (FreshRSS_Context::$user_conf->sharing as $key => $share_options) { + $share = FreshRSS_Share::get($share_options['type']); + $share->update($share_options); + ?> + <div class="form-group group-share" id="group-share-<?php echo $key; ?>"> + <label class="group-name"> + <?php echo $share->name(true); ?> + </label> + <div class="group-controls"> + <input type='hidden' id='share_<?php echo $key; ?>_type' name="share[<?php echo $key; ?>][type]" value='<?php echo $share->type(); ?>' /> + <div class="stick"> + <input type="text" id="share_<?php echo $key; ?>_name" name="share[<?php echo $key; ?>][name]" class="extend" value="<?php echo $share->name(); ?>" placeholder="<?php echo _t('conf.sharing.share_name'); ?>" size="64" data-leave-validation="<?php echo $share->name(); ?>"/> + <?php if ($share->formType() === 'advanced') { ?> + <input type="url" id="share_<?php echo $key; ?>_url" name="share[<?php echo $key; ?>][url]" class="extend" value="<?php echo $share->baseUrl(); ?>" placeholder="<?php echo _t('conf.sharing.share_url'); ?>" size="64" data-leave-validation="<?php echo $share->baseUrl(); ?>"/> + <?php } else { ?> + <input type="url" id="share_<?php echo $key; ?>_url" name="share[<?php echo $key; ?>][url]" class="extend" value="<?php echo $share->baseUrl(); ?>" placeholder="<?php echo _t('gen.short.not_applicable'); ?>" size="64" disabled/> + <?php } ?> + <a href='#' class='remove btn btn-attention' data-remove="group-share-<?php echo $key; ?>"><?php echo _i('close'); ?></a> + </div> + <?php if ($share->formType() === 'advanced') { ?> + <a target="_blank" rel="noreferrer" class="btn" title="<?php echo _t('conf.sharing.more_information'); ?>" href="<?php echo $share->help(); ?>"><?php echo _i('help'); ?></a> + <?php } ?> + </div> </div> - </div> + <?php } ?> <div class="form-group"> - <label class="group-name"><?php echo Minz_Translate::t ('activate_sharing'); ?></label> <div class="group-controls"> - <?php - $services = array ('twitter', 'g+', 'facebook', 'email', 'print'); - - foreach ($services as $service) { - ?> - <label class="checkbox" for="<?php echo $service; ?>"> - <input type="checkbox" name="<?php echo $service; ?>" id="<?php echo $service; ?>" value="1"<?php echo $this->conf->sharing($service) ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ($service); ?> - </label> - <?php } ?> + <select> + <?php foreach (FreshRSS_Share::enum() as $share) { ?> + <option value='<?php echo $share->type(); ?>' data-form='<?php echo $share->formType(); ?>' data-help='<?php echo $share->help(); ?>'> + <?php echo $share->name(true); ?> + </option> + <?php } ?> + </select> + <a href='#' class='share add btn'><?php echo _i('add'); ?></a> </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> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> </div> </div> </form> diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtml index 748a65d17..dceeb17de 100644 --- a/app/views/configure/shortcut.phtml +++ b/app/views/configure/shortcut.phtml @@ -1,7 +1,7 @@ -<?php $this->partial ('aside_configure'); ?> +<?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> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> <datalist id="keys"> <?php foreach ($this->list_keys as $key) { ?> @@ -9,97 +9,127 @@ <?php } ?> </datalist> - <?php $s = $this->conf->shortcuts; ?> + <?php $s = FreshRSS_Context::$user_conf->shortcuts; ?> - <form method="post" action="<?php echo _url ('configure', 'shortcut'); ?>"> - <legend><?php echo Minz_Translate::t ('shortcuts_management'); ?></legend> + <form method="post" action="<?php echo _url('configure', 'shortcut'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('conf.shortcut'); ?></legend> - <noscript><p class="alert alert-error"><?php echo Minz_Translate::t ('javascript_for_shortcuts'); ?></p></noscript> + <noscript><p class="alert alert-error"><?php echo _t('conf.shortcut.javascript'); ?></p></noscript> - <legend><?php echo Minz_Translate::t ('shortcuts_navigation'); ?></legend> + <legend><?php echo _t('conf.shortcut.navigation'); ?></legend> + + <p class="alert alert-warn"><?php echo _t('conf.shortcut.navigation_help');?></p> + + <div class="form-group"> + <label class="group-name" for="next_entry"><?php echo _t('conf.shortcut.next_article'); ?></label> + <div class="group-controls"> + <input type="text" id="next_entry" name="shortcuts[next_entry]" list="keys" value="<?php echo $s['next_entry']; ?>" data-leave-validation="<?php echo $s['next_entry']; ?>"/> + </div> + </div> <div class="form-group"> - <label class="group-name" for="next_entry"><?php echo Minz_Translate::t ('next_article'); ?></label> + <label class="group-name" for="prev_entry"><?php echo _t('conf.shortcut.previous_article'); ?></label> <div class="group-controls"> - <input type="text" id="next_entry" name="shortcuts[next_entry]" list="keys" value="<?php echo $s['next_entry']; ?>" /> + <input type="text" id="prev_entry" name="shortcuts[prev_entry]" list="keys" value="<?php echo $s['prev_entry']; ?>" data-leave-validation="<?php echo $s['prev_entry']; ?>"/> </div> </div> <div class="form-group"> - <label class="group-name" for="prev_entry"><?php echo Minz_Translate::t ('previous_article'); ?></label> + <label class="group-name" for="first_entry"><?php echo _t('conf.shortcut.first_article'); ?></label> <div class="group-controls"> - <input type="text" id="prev_entry" name="shortcuts[prev_entry]" list="keys" value="<?php echo $s['prev_entry']; ?>" /> + <input type="text" id="first_entry" name="shortcuts[first_entry]" list="keys" value="<?php echo $s['first_entry']; ?>" data-leave-validation="<?php echo $s['first_entry']; ?>"/> </div> </div> <div class="form-group"> - <label class="group-name" for="first_entry"><?php echo Minz_Translate::t ('first_article'); ?></label> + <label class="group-name" for="last_entry"><?php echo _t('conf.shortcut.last_article'); ?></label> <div class="group-controls"> - <input type="text" id="first_entry" name="shortcuts[first_entry]" list="keys" value="<?php echo $s['first_entry']; ?>" /> + <input type="text" id="last_entry" name="shortcuts[last_entry]" list="keys" value="<?php echo $s['last_entry']; ?>" data-leave-validation="<?php echo $s['last_entry']; ?>"/> </div> </div> + <legend><?php echo _t('conf.shortcut.article_action');?></legend> + <div class="form-group"> - <label class="group-name" for="last_entry"><?php echo Minz_Translate::t ('last_article'); ?></label> + <label class="group-name" for="mark_read"><?php echo _t('conf.shortcut.mark_read'); ?></label> <div class="group-controls"> - <input type="text" id="last_entry" name="shortcuts[last_entry]" list="keys" value="<?php echo $s['last_entry']; ?>" /> + <input type="text" id="mark_read" name="shortcuts[mark_read]" list="keys" value="<?php echo $s['mark_read']; ?>" data-leave-validation="<?php echo $s['mark_read']; ?>"/> + <?php echo _t('conf.shortcut.shift_for_all_read'); ?> </div> </div> - <div><?php echo Minz_Translate::t ('shortcuts_navigation_help');?></div> + <div class="form-group"> + <label class="group-name" for="mark_favorite"><?php echo _t('conf.shortcut.mark_favorite'); ?></label> + <div class="group-controls"> + <input type="text" id="mark_favorite" name="shortcuts[mark_favorite]" list="keys" value="<?php echo $s['mark_favorite']; ?>" data-leave-validation="<?php echo $s['mark_favorite']; ?>"/> + </div> + </div> - <legend><?php echo Minz_Translate::t ('shortcuts_article_action');?></legend> + <div class="form-group"> + <label class="group-name" for="go_website"><?php echo _t('conf.shortcut.see_on_website'); ?></label> + <div class="group-controls"> + <input type="text" id="go_website" name="shortcuts[go_website]" list="keys" value="<?php echo $s['go_website']; ?>" data-leave-validation="<?php echo $s['go_website']; ?>"/> + </div> + </div> <div class="form-group"> - <label class="group-name" for="mark_read"><?php echo Minz_Translate::t ('mark_read'); ?></label> + <label class="group-name" for="auto_share_shortcut"><?php echo _t('conf.shortcut.auto_share'); ?></label> <div class="group-controls"> - <input type="text" id="mark_read" name="shortcuts[mark_read]" list="keys" value="<?php echo $s['mark_read']; ?>" /> - <?php echo Minz_Translate::t ('shift_for_all_read'); ?> + <input type="text" id="auto_share_shortcut" name="shortcuts[auto_share]" list="keys" value="<?php echo $s['auto_share']; ?>" data-leave-validation="<?php echo $s['auto_share']; ?>"/> + <?php echo _t('conf.shortcut.auto_share_help'); ?> </div> </div> <div class="form-group"> - <label class="group-name" for="mark_favorite"><?php echo Minz_Translate::t ('mark_favorite'); ?></label> + <label class="group-name" for="collapse_entry"><?php echo _t('conf.shortcut.collapse_article'); ?></label> <div class="group-controls"> - <input type="text" id="mark_favorite" name="shortcuts[mark_favorite]" list="keys" value="<?php echo $s['mark_favorite']; ?>" /> + <input type="text" id="collapse_entry" name="shortcuts[collapse_entry]" list="keys" value="<?php echo $s['collapse_entry']; ?>" data-leave-validation="<?php echo $s['collapse_entry']; ?>"/> </div> </div> + <legend><?php echo _t('conf.shortcut.other_action');?></legend> + <div class="form-group"> - <label class="group-name" for="go_website"><?php echo Minz_Translate::t ('see_on_website'); ?></label> + <label class="group-name" for="load_more_shortcut"><?php echo _t('conf.shortcut.load_more'); ?></label> <div class="group-controls"> - <input type="text" id="go_website" name="shortcuts[go_website]" list="keys" value="<?php echo $s['go_website']; ?>" /> + <input type="text" id="load_more_shortcut" name="shortcuts[load_more]" list="keys" value="<?php echo $s['load_more']; ?>" data-leave-validation="<?php echo $s['load_more']; ?>"/> </div> </div> <div class="form-group"> - <label class="group-name" for="auto_share_shortcut"><?php echo Minz_Translate::t ('auto_share'); ?></label> + <label class="group-name" for="focus_search_shortcut"><?php echo _t('conf.shortcut.focus_search'); ?></label> <div class="group-controls"> - <input type="text" id="auto_share_shortcut" name="shortcuts[auto_share]" list="keys" value="<?php echo $s['auto_share']; ?>" /> - <?php echo Minz_Translate::t ('auto_share_help'); ?> + <input type="text" id="focus_search_shortcut" name="shortcuts[focus_search]" list="keys" value="<?php echo $s['focus_search']; ?>" data-leave-validation="<?php echo $s['focus_search']; ?>"/> </div> </div> <div class="form-group"> - <label class="group-name" for="collapse_entry"><?php echo Minz_Translate::t ('collapse_article'); ?></label> + <label class="group-name" for="user_filter_shortcut"><?php echo _t('conf.shortcut.user_filter'); ?></label> <div class="group-controls"> - <input type="text" id="collapse_entry" name="shortcuts[collapse_entry]" list="keys" value="<?php echo $s['collapse_entry']; ?>" /> + <input type="text" id="user_filter_shortcut" name="shortcuts[user_filter]" list="keys" value="<?php echo $s['user_filter']; ?>" data-leave-validation="<?php echo $s['user_filter']; ?>"/> + <?php echo _t('conf.shortcut.user_filter_help'); ?> </div> </div> - <legend><?php echo Minz_Translate::t ('shortcuts_other_action');?></legend> + <div class="form-group"> + <label class="group-name" for="close_dropdown_shortcut"><?php echo _t('conf.shortcut.close_dropdown'); ?></label> + <div class="group-controls"> + <input type="text" id="close_dropdown" name="shortcuts[close_dropdown]" list="keys" value="<?php echo $s['close_dropdown']; ?>" data-leave-validation="<?php echo $s['close_dropdown']; ?>"/> + </div> + </div> <div class="form-group"> - <label class="group-name" for="load_more_shortcut"><?php echo Minz_Translate::t ('load_more'); ?></label> + <label class="group-name" for="help_shortcut"><?php echo _t('conf.shortcut.help'); ?></label> <div class="group-controls"> - <input type="text" id="load_more_shortcut" name="shortcuts[load_more]" list="keys" value="<?php echo $s['load_more']; ?>" /> + <input type="text" id="help_shortcut" name="shortcuts[help]" list="keys" value="<?php echo $s['help']; ?>" data-leave-validation="<?php echo $s['help']; ?>"/> </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> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> </div> </div> </form> diff --git a/app/views/configure/system.phtml b/app/views/configure/system.phtml new file mode 100644 index 000000000..935b49fda --- /dev/null +++ b/app/views/configure/system.phtml @@ -0,0 +1,62 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <form method="post" action="<?php echo _url('configure', 'system'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('admin.system'); ?></legend> + + <div class="form-group"> + <label class="group-name" for="instance-name"><?php echo _t('admin.system.instance-name'); ?></label> + <div class="group-controls"> + <input type="text" class="extend" id="instance-name" name="instance-name" value="<?php echo FreshRSS_Context::$system_conf->title; ?>" data-leave-validation="<?php echo FreshRSS_Context::$system_conf->title; ?>"/> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="auto-update-url"><?php echo _t('admin.system.auto-update-url'); ?></label> + <div class="group-controls"> + <input type="text" class="extend" id="auto-update-url" name="auto-update-url" value="<?php echo FreshRSS_Context::$system_conf->auto_update_url; ?>" data-leave-validation="<?php echo FreshRSS_Context::$system_conf->auto_update_url; ?>"/> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="max-registrations"><?php echo _t('admin.system.registration.number'); ?></label> + <div class="group-controls"> + <input type="number" id="max-registrations" name="max-registrations" value="<?php echo FreshRSS_Context::$system_conf->limits['max_registrations']; ?>" min="0" data-leave-validation="<?php echo FreshRSS_Context::$system_conf->limits['max_registrations']; ?>"/> + <?php echo _i('help'); ?> <?php echo _t('admin.system.registration.help'); ?> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <?php + $number = count(listUsers()); + echo _t($number > 1 ? 'admin.user.numbers' : 'admin.user.number', $number); + ?> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="max-feeds"><?php echo _t('admin.system.max-feeds'); ?></label> + <div class="group-controls"> + <input type="number" id="max-feeds" name="max-feeds" value="<?php echo FreshRSS_Context::$system_conf->limits['max_feeds']; ?>" min="1" data-leave-validation="<?php echo FreshRSS_Context::$system_conf->limits['max_feeds']; ?>"/> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="max-categories"><?php echo _t('admin.system.max-categories'); ?></label> + <div class="group-controls"> + <input type="number" id="max-categories" name="max-categories" value="<?php echo FreshRSS_Context::$system_conf->limits['max_categories']; ?>" min="1" data-leave-validation="<?php echo FreshRSS_Context::$system_conf->limits['max_categories']; ?>"/> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> + </div> + </div> + </form> +</div> diff --git a/app/views/configure/users.phtml b/app/views/configure/users.phtml deleted file mode 100644 index 1305feac9..000000000 --- a/app/views/configure/users.phtml +++ /dev/null @@ -1,172 +0,0 @@ -<?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('users', 'auth'); ?>"> - <legend><?php echo Minz_Translate::t('login_configuration'); ?></legend> - - <div class="form-group"> - <label class="group-name" for="current_user"><?php echo Minz_Translate::t('current_user'); ?></label> - <div class="group-controls"> - <input id="current_user" type="text" disabled="disabled" value="<?php echo Minz_Session::param('currentUser', '_'); ?>" /> - <label class="checkbox" for="is_admin"> - <input type="checkbox" id="is_admin" disabled="disabled" <?php echo Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_')) ? 'checked="checked" ' : ''; ?>/> - <?php echo Minz_Translate::t('is_admin'); ?> - </label> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="passwordPlain"><?php echo Minz_Translate::t('password_form'); ?></label> - <div class="group-controls"> - <input type="password" id="passwordPlain" name="passwordPlain" autocomplete="off" pattern=".{7,}" /> - <noscript><b><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></b></noscript> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="mail_login"><?php echo Minz_Translate::t('persona_connection_email'); ?></label> - <?php $mail = $this->conf->mail_login; ?> - <div class="group-controls"> - <input type="email" id="mail_login" name="mail_login" class="extend" autocomplete="off" value="<?php echo $mail; ?>" <?php echo Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_')) ? '' : 'disabled="disabled"'; ?> placeholder="alice@example.net" /> - <noscript><b><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></b></noscript> - </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> - - <?php if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { ?> - - <legend><?php echo Minz_Translate::t('auth_type'); ?></legend> - - <div class="form-group"> - <label class="group-name" for="auth_type"><?php echo Minz_Translate::t('auth_type'); ?></label> - <div class="group-controls"> - <select id="auth_type" name="auth_type" required="required"> - <?php if (!in_array(Minz_Configuration::authType(), array('form', 'persona', 'http_auth', 'none'))) { ?> - <option selected="selected"></option> - <?php } ?> - <option value="form"<?php echo Minz_Configuration::authType() === 'form' ? ' selected="selected"' : '', version_compare(PHP_VERSION, '5.3', '<') ? ' disabled="disabled"' : ''; ?>><?php echo Minz_Translate::t('auth_form'); ?></option> - <option value="persona"<?php echo Minz_Configuration::authType() === 'persona' ? ' selected="selected"' : '', $this->conf->mail_login == '' ? ' disabled="disabled"' : ''; ?>><?php echo Minz_Translate::t('auth_persona'); ?></option> - <option value="http_auth"<?php echo Minz_Configuration::authType() === 'http_auth' ? ' selected="selected"' : '', httpAuthUser() == '' ? ' disabled="disabled"' : ''; ?>><?php echo Minz_Translate::t('http_auth'); ?> (REMOTE_USER = '<?php echo httpAuthUser(); ?>')</option> - <option value="none"<?php echo Minz_Configuration::authType() === 'none' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t('auth_none'); ?></option> - </select> - </div> - </div> - - <div class="form-group"> - <div class="group-controls"> - <label class="checkbox" for="anon_access"> - <input type="checkbox" name="anon_access" id="anon_access" value="1"<?php echo Minz_Configuration::allowAnonymous() ? ' checked="checked"' : '', - Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> /> - <?php echo Minz_Translate::t('allow_anonymous', Minz_Configuration::defaultUser()); ?> - </label> - </div> - </div> - - <div class="form-group"> - <div class="group-controls"> - <label class="checkbox" for="anon_refresh"> - <input type="checkbox" name="anon_refresh" id="anon_refresh" value="1"<?php echo Minz_Configuration::allowAnonymousRefresh() ? ' checked="checked"' : '', - Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> /> - <?php echo Minz_Translate::t('allow_anonymous_refresh'); ?> - </label> - </div> - </div> - - <?php if (Minz_Configuration::canLogIn()) { ?> - <div class="form-group"> - <label class="group-name" for="token"><?php echo Minz_Translate::t('auth_token'); ?></label> - <?php $token = $this->conf->token; ?> - <div class="group-controls"> - <input type="text" id="token" name="token" value="<?php echo $token; ?>" placeholder="<?php echo Minz_Translate::t('blank_to_disable'); ?>"<?php - echo Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> /> - <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('explain_token', Minz_Url::display(null, 'html', true), $token); ?> - </div> - </div> - <?php } ?> - - <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> - - <form method="post" action="<?php echo _url('users', 'delete'); ?>"> - <legend><?php echo Minz_Translate::t('users'); ?></legend> - - <div class="form-group"> - <label class="group-name" for="users_list"><?php echo Minz_Translate::t('users_list'); ?></label> - <div class="group-controls"> - <select id="users_list" name="username"><?php - foreach (listUsers() as $user) { - echo '<option>', $user, '</option>'; - } - ?></select> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-attention confirm"><?php echo Minz_Translate::t('delete'); ?></button> - </div> - </div> - </form> - - <form method="post" action="<?php echo _url('users', 'create'); ?>"> - <legend><?php echo Minz_Translate::t('create_user'); ?></legend> - - <div class="form-group"> - <label class="group-name" for="new_user_language"><?php echo Minz_Translate::t ('language'); ?></label> - <div class="group-controls"> - <select name="new_user_language" id="new_user_language"> - <?php $languages = $this->conf->availableLanguages (); ?> - <?php foreach ($languages as $short => $lib) { ?> - <option value="<?php echo $short; ?>"<?php echo $this->conf->language === $short ? ' selected="selected"' : ''; ?>><?php echo $lib; ?></option> - <?php } ?> - </select> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="new_user_name"><?php echo Minz_Translate::t('username'); ?></label> - <div class="group-controls"> - <input id="new_user_name" name="new_user_name" type="text" size="16" required="required" maxlength="16" autocomplete="off" pattern="[0-9a-zA-Z]{1,16}" placeholder="demo" /> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="new_user_passwordPlain"><?php echo Minz_Translate::t('password_form'); ?></label> - <div class="group-controls"> - <input type="password" id="new_user_passwordPlain" name="new_user_passwordPlain" autocomplete="off" pattern=".{7,}" /> - <noscript><b><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></b></noscript> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="new_user_email"><?php echo Minz_Translate::t('persona_connection_email'); ?></label> - <?php $mail = $this->conf->mail_login; ?> - <div class="group-controls"> - <input type="email" id="new_user_email" name="new_user_email" class="extend" autocomplete="off" placeholder="alice@example.net" /> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('create'); ?></button> - <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button> - </div> - </div> - - </form> - - <?php } ?> -</div> diff --git a/app/views/entry/bookmark.phtml b/app/views/entry/bookmark.phtml index c1fc32b7f..d85706669 100755 --- a/app/views/entry/bookmark.phtml +++ b/app/views/entry/bookmark.phtml @@ -1,16 +1,16 @@ <?php header('Content-Type: application/json; charset=UTF-8'); -if (Minz_Request::param ('is_favorite', true)) { - Minz_Request::_param ('is_favorite', 0); -} else { - Minz_Request::_param ('is_favorite', 1); -} +$url = array( + 'c' => Minz_Request::controllerName(), + 'a' => Minz_Request::actionName(), + 'params' => Minz_Request::fetchGET(), +); -$url = Minz_Url::display (array ( - 'c' => Minz_Request::controllerName (), - 'a' => Minz_Request::actionName (), - 'params' => Minz_Request::params (), -)); +$url['params']['is_favorite'] = Minz_Request::param('is_favorite', true) ? '0' : '1'; -echo json_encode (array ('url' => str_ireplace ('&', '&', $url), 'icon' => FreshRSS_Themes::icon(Minz_Request::param ('is_favorite') ? 'non-starred' : 'starred'))); +FreshRSS::loadStylesAndScripts(); +echo json_encode(array( + 'url' => str_ireplace('&', '&', Minz_Url::display($url)), + 'icon' => _i($url['params']['is_favorite'] === '1' ? 'non-starred' : 'starred') + )); diff --git a/app/views/entry/read.phtml b/app/views/entry/read.phtml index 9e79d4c07..73977d94b 100755 --- a/app/views/entry/read.phtml +++ b/app/views/entry/read.phtml @@ -1,16 +1,16 @@ <?php header('Content-Type: application/json; charset=UTF-8'); -if (Minz_Request::param ('is_read', true)) { - Minz_Request::_param ('is_read', 0); -} else { - Minz_Request::_param ('is_read', 1); -} +$url = array( + 'c' => Minz_Request::controllerName(), + 'a' => Minz_Request::actionName(), + 'params' => Minz_Request::fetchGET(), +); -$url = Minz_Url::display (array ( - 'c' => Minz_Request::controllerName (), - 'a' => Minz_Request::actionName (), - 'params' => Minz_Request::params (), -)); +$url['params']['is_read'] = Minz_Request::param('is_read', true) ? '0' : '1'; -echo json_encode (array ('url' => str_ireplace ('&', '&', $url), 'icon' => FreshRSS_Themes::icon(Minz_Request::param ('is_read') ? 'unread' : 'read'))); +FreshRSS::loadStylesAndScripts(); +echo json_encode(array( + 'url' => str_ireplace('&', '&', Minz_Url::display($url)), + 'icon' => _i($url['params']['is_read'] === '1' ? 'unread' : 'read') + )); diff --git a/app/views/error/index.phtml b/app/views/error/index.phtml index 6a09c3aa2..fe3abf8c4 100644 --- a/app/views/error/index.phtml +++ b/app/views/error/index.phtml @@ -1,18 +1,9 @@ <div class="post"> <div class="alert alert-error"> <h1 class="alert-head"><?php echo $this->code; ?></h1> - <p> - <?php - switch(Minz_Request::param ('code')) { - case 403: - echo Minz_Translate::t ('forbidden_access'); - break; - case 404: - default: - echo Minz_Translate::t ('page_not_found'); - } ?><br /> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> + <?php echo $this->errorMessage; ?><br /> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> </p> </div> </div> diff --git a/app/views/extension/configure.phtml b/app/views/extension/configure.phtml new file mode 100644 index 000000000..8933eeae5 --- /dev/null +++ b/app/views/extension/configure.phtml @@ -0,0 +1,3 @@ +<?php + +$this->renderHelper('extension/configure'); diff --git a/app/views/extension/index.phtml b/app/views/extension/index.phtml new file mode 100644 index 000000000..7cb16bfff --- /dev/null +++ b/app/views/extension/index.phtml @@ -0,0 +1,46 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <h1><?php echo _t('admin.extensions.title'); ?></h1> + + <form id="form-extension" method="post"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <?php if (!empty($this->extension_list['system'])) { ?> + <h2><?php echo _t('admin.extensions.system'); ?></h2> + <?php + foreach ($this->extension_list['system'] as $ext) { + $this->ext_details = $ext; + $this->renderHelper('extension/details'); + } + ?> + <?php } ?> + + <?php if (!empty($this->extension_list['user'])) { ?> + <h2><?php echo _t('admin.extensions.user'); ?></h2> + <?php + foreach ($this->extension_list['user'] as $ext) { + $this->ext_details = $ext; + $this->renderHelper('extension/details'); + } + ?> + <?php + } + + if (empty($this->extension_list['system']) && empty($this->extension_list['user'])) { + ?> + <p class="alert alert-warn"><?php echo _t('admin.extensions.empty_list'); ?></p> + <?php } ?> + </form> +</div> + +<?php $class = isset($this->extension) ? ' class="active"' : ''; ?> +<a href="#" id="close-slider"<?php echo $class; ?>></a> +<div id="slider"<?php echo $class; ?>> +<?php + if (isset($this->extension)) { + $this->renderHelper('extension/configure'); + } +?> +</div> diff --git a/app/views/feed/add.phtml b/app/views/feed/add.phtml new file mode 100644 index 000000000..5cd59d298 --- /dev/null +++ b/app/views/feed/add.phtml @@ -0,0 +1,92 @@ +<?php if ($this->feed) { ?> +<div class="post"> + <h1><?php echo _t('sub.feed.add'); ?></h1> + + <?php if (!$this->load_ok) { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('feedback.sub.feed.internal_problem', _url('index', 'logs')); ?></p> + <?php } ?> + + <form method="post" action="<?php echo _url('feed', 'add'); ?>" autocomplete="off"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('sub.feed.informations'); ?></legend> + <?php if ($this->load_ok) { ?> + <div class="form-group"> + <label class="group-name"><?php echo _t('sub.feed.title'); ?></label> + <div class="group-controls"> + <label><?php echo $this->feed->name() ; ?></label> + </div> + </div> + + <?php $desc = $this->feed->description(); if ($desc != '') { ?> + <div class="form-group"> + <label class="group-name"><?php echo _t('sub.feed.description'); ?></label> + <div class="group-controls"> + <label><?php echo htmlspecialchars($desc, ENT_NOQUOTES, 'UTF-8'); ?></label> + </div> + </div> + <?php } ?> + + <div class="form-group"> + <label class="group-name"><?php echo _t('sub.feed.website'); ?></label> + <div class="group-controls"> + <?php echo $this->feed->website(); ?> + <a class="btn" target="_blank" rel="noreferrer" href="<?php echo $this->feed->website(); ?>"><?php echo _i('link'); ?></a> + </div> + </div> + <?php } ?> + + <div class="form-group"> + <label class="group-name" for="url"><?php echo _t('sub.feed.url'); ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="text" name="url_rss" id="url" class="extend" value="<?php echo $this->feed->url(); ?>" /> + <a class="btn" target="_blank" rel="noreferrer" href="<?php echo $this->feed->url(); ?>"><?php echo _i('link'); ?></a> + </div> + <a class="btn" target="_blank" rel="noreferrer" href="http://validator.w3.org/feed/check.cgi?url=<?php echo $this->feed->url(); ?>"><?php echo _t('sub.feed.validator'); ?></a> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="category"><?php echo _t('sub.category'); ?></label> + <div class="group-controls"> + <select name="category" id="category"> + <?php foreach ($this->categories as $cat) { ?> + <option value="<?php echo $cat->id(); ?>"<?php echo $cat->id() == 1 ? ' selected="selected"' : ''; ?>> + <?php echo $cat->name(); ?> + </option> + <?php } ?> + <option value="nc"><?php echo _t('sub.category.new'); ?></option> + </select> + + <span aria-hidden="true"> + <input type="text" name="new_category[name]" id="new_category_name" autocomplete="off" placeholder="<?php echo _t('sub.category.new'); ?>" /> + </span> + </div> + </div> + + <legend><?php echo _t('sub.feed.auth.http'); ?></legend> + <?php $auth = $this->feed->httpAuth(false); ?> + <div class="form-group"> + <label class="group-name" for="http_user"><?php echo _t('sub.feed.auth.username'); ?></label> + <div class="group-controls"> + <input type="text" name="http_user" id="http_user" class="extend" value="<?php echo empty($auth['username']) ? ' ' : $auth['username']; ?>" autocomplete="off" /> + </div> + + <label class="group-name" for="http_pass"><?php echo _t('sub.feed.auth.password'); ?></label> + <div class="group-controls"> + <input type="password" name="http_pass" id="http_pass" class="extend" value="<?php echo $auth['password']; ?>" autocomplete="off" /> + </div> + + <div class="group-controls"> + <?php echo _i('help'); ?> <?php echo _t('sub.feed.auth.help'); ?> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> + </div> + </div> + </form> +</div> +<?php } ?> diff --git a/app/views/feed/move.phtml b/app/views/feed/move.phtml new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/app/views/feed/move.phtml diff --git a/app/views/helpers/export/articles.phtml b/app/views/helpers/export/articles.phtml new file mode 100644 index 000000000..49c370023 --- /dev/null +++ b/app/views/helpers/export/articles.phtml @@ -0,0 +1,66 @@ +<?php +$username = Minz_Session::param('currentUser', '_'); + +$options = 0; +if (version_compare(PHP_VERSION, '5.4.0') >= 0) { + $options = JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; +} + +$articles = array( + 'id' => 'user/' . str_replace('/', '', $username) . '/state/org.freshrss/' . $this->type, + 'title' => $this->list_title, + 'author' => $username, + 'items' => array(), +); + +echo rtrim(json_encode($articles, $options), " ]}\n\r\t"), "\n"; +$first = true; + +foreach ($this->entriesRaw as $entryRaw) { + if (empty($entryRaw)) { + continue; + } + $entry = FreshRSS_EntryDAO::daoToEntry($entryRaw); + if (!isset($this->feed)) { + $feed = FreshRSS_CategoryDAO::findFeed($this->categories, $entry->feed()); + if ($feed == null) { + $feed = $entry->feed(true); + } + } else { + $feed = $this->feed; + } + + $article = array( + 'id' => $entry->guid(), + 'categories' => array_values($entry->tags()), + 'title' => $entry->title(), + 'author' => $entry->author(), + 'published' => $entry->date(true), + 'updated' => $entry->date(true), + 'alternate' => array(array( + 'href' => $entry->link(), + 'type' => 'text/html', + )), + 'content' => array( + 'content' => $entry->content(), + ), + 'origin' => array( + 'streamId' => $feed == null ? '' : $feed->id(), + 'title' => $feed == null ? '' : $feed->name(), + 'htmlUrl' => $feed == null ? '' : $feed->website(), + 'feedUrl' => $feed == null ? '' : $feed->url(), + ) + ); + + $line = json_encode($article, $options); + if ($line != '') { + if ($first) { + $first = false; + } else { + echo ",\n"; + } + echo $line; + } +} + +echo "\n]}\n"; diff --git a/app/views/helpers/export/opml.phtml b/app/views/helpers/export/opml.phtml new file mode 100644 index 000000000..236cca303 --- /dev/null +++ b/app/views/helpers/export/opml.phtml @@ -0,0 +1,28 @@ +<?php + +$opml_array = array( + 'head' => array( + 'title' => FreshRSS_Context::$system_conf->title, + 'dateCreated' => date('D, d M Y H:i:s') + ), + 'body' => array() +); + +foreach ($this->categories as $key => $cat) { + $opml_array['body'][$key] = array( + 'text' => $cat['name'], + '@outlines' => array() + ); + + foreach ($cat['feeds'] as $feed) { + $opml_array['body'][$key]['@outlines'][] = array( + 'text' => htmlspecialchars_decode($feed->name()), + 'type' => 'rss', + 'xmlUrl' => htmlspecialchars_decode($feed->url()), + 'htmlUrl' => htmlspecialchars_decode($feed->website()), + 'description' => htmlspecialchars_decode($feed->description()), + ); + } +} + +echo libopml_render($opml_array); diff --git a/app/views/helpers/extension/configure.phtml b/app/views/helpers/extension/configure.phtml new file mode 100644 index 000000000..95d968aba --- /dev/null +++ b/app/views/helpers/extension/configure.phtml @@ -0,0 +1,19 @@ +<div class="post"> + <h1> + <?php echo $this->extension->getName(); ?> (<?php echo $this->extension->getVersion(); ?>) — + <?php echo $this->extension->isEnabled() ? _t('admin.extensions.enabled') + : _t('admin.extensions.disabled'); ?> + </h1> + + <p class="alert alert-warn"><?php echo $this->extension->getDescription(); ?> — <?php echo _t('gen.short.by_author', $this->extension->getAuthor()); ?></p> + + <h2><?php echo _t('gen.action.manage'); ?></h2> + <?php + $configure_view = $this->extension->getConfigureView(); + if ($configure_view !== false) { + echo $configure_view; + } else { + ?> + <p class="alert alert-warn"><?php echo _t('admin.extensions.no_configure_view'); ?></p> + <?php } ?> +</div> diff --git a/app/views/helpers/extension/details.phtml b/app/views/helpers/extension/details.phtml new file mode 100644 index 000000000..acba4e816 --- /dev/null +++ b/app/views/helpers/extension/details.phtml @@ -0,0 +1,21 @@ +<ul class="horizontal-list"> + <li class="item"> + <?php if ($this->ext_details->getType() === 'user' || FreshRSS_Auth::hasAccess('admin')) { ?> + <?php $name_encoded = urlencode($this->ext_details->getName()); ?> + <div class="stick"> + <a class="btn open-slider" href="<?php echo _url('extension', 'configure', 'e', $name_encoded); ?>"><?php echo _i('configure'); ?> <?php echo _t('gen.action.manage'); ?></a> + <?php if ($this->ext_details->isEnabled()) { ?> + <button class="btn active" form="form-extension" formaction="<?php echo _url('extension', 'disable', 'e', $name_encoded); ?>"><?php echo _t('gen.action.disable'); ?></button> + <?php } else { ?> + <button class="btn" form="form-extension" formaction="<?php echo _url('extension', 'enable', 'e', $name_encoded); ?>"><?php echo _t('gen.action.enable'); ?></button> + <?php } ?> + <?php if (FreshRSS_Auth::hasAccess('admin')) { ?> + <button class="btn btn-attention confirm" form="form-extension" formaction="<?php echo _url('extension', 'remove', 'e', $name_encoded); ?>"><?php echo _t('gen.action.remove'); ?></button> + <?php } ?> + </div> + <?php } else { ?> + <?php echo _t('admin.extensions.system.no_rights'); ?> + <?php } ?> + </li> + <li class="item"><?php echo $this->ext_details->getName(); ?></li> +</ul> diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml new file mode 100644 index 000000000..bf87a255a --- /dev/null +++ b/app/views/helpers/feed/update.phtml @@ -0,0 +1,183 @@ +<div class="post"> + <h1><?php echo $this->feed->name(); ?></h1> + + <div> + <a href="<?php echo _url('index', 'index', 'get', 'f_' . $this->feed->id()); ?>"><?php echo _i('link'); ?> <?php echo _t('gen.action.filter'); ?></a> + <?php echo _t('gen.short.or'); ?> + <a href="<?php echo _url('stats', 'repartition', 'id', $this->feed->id()); ?>"><?php echo _i('stats'); ?> <?php echo _t('sub.feed.stats'); ?></a> + </div> + + <p><?php echo $this->feed->description(); ?></p> + + <?php $nbEntries = $this->feed->nbEntries(); ?> + + <?php if ($this->feed->inError()) { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('sub.feed.error'); ?></p> + <?php } elseif ($nbEntries === 0) { ?> + <p class="alert alert-warn"><?php echo _t('sub.feed.empty'); ?></p> + <?php } ?> + + <form method="post" action="<?php echo _url('subscription', 'feed', 'id', $this->feed->id()); ?>" autocomplete="off"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('sub.feed.informations'); ?></legend> + <div class="form-group"> + <label class="group-name" for="name"><?php echo _t('sub.feed.title'); ?></label> + <div class="group-controls"> + <input type="text" name="name" id="name" class="extend" value="<?php echo $this->feed->name() ; ?>" /> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="description"><?php echo _t('sub.feed.description'); ?></label> + <div class="group-controls"> + <textarea name="description" id="description"><?php echo htmlspecialchars($this->feed->description(), ENT_NOQUOTES, 'UTF-8'); ?></textarea> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="website"><?php echo _t('sub.feed.website'); ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="text" name="website" id="website" class="extend" value="<?php echo $this->feed->website(); ?>" /> + <a class="btn" target="_blank" rel="noreferrer" href="<?php echo $this->feed->website(); ?>"><?php echo _i('link'); ?></a> + </div> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="url"><?php echo _t('sub.feed.url'); ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="text" name="url" id="url" class="extend" value="<?php echo $this->feed->url(); ?>" /> + <a class="btn" target="_blank" rel="noreferrer" href="<?php echo $this->feed->url(); ?>"><?php echo _i('link'); ?></a> + </div> + + <a class="btn" target="_blank" rel="noreferrer" href="http://validator.w3.org/feed/check.cgi?url=<?php echo rawurlencode(htmlspecialchars_decode($this->feed->url(), ENT_QUOTES)); ?>"><?php echo _t('sub.feed.validator'); ?></a> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="category"><?php echo _t('sub.category'); ?></label> + <div class="group-controls"> + <select name="category" id="category"> + <?php foreach ($this->categories as $cat) { ?> + <option value="<?php echo $cat->id(); ?>"<?php echo $cat->id()== $this->feed->category() ? ' selected="selected"' : ''; ?>> + <?php echo $cat->name(); ?> + </option> + <?php } ?> + </select> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="priority"><?php echo _t('sub.feed.in_main_stream'); ?></label> + <div class="group-controls"> + <label class="checkbox" for="priority"> + <input type="checkbox" name="priority" id="priority" value="10"<?php echo $this->feed->priority() > 0 ? ' checked="checked"' : ''; ?> /> + <?php echo _t('gen.short.yes'); ?> + </label> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button class="btn btn-attention confirm" + data-str-confirm="<?php echo _t('gen.js.confirm_action_feed_cat'); ?>" + formaction="<?php echo _url('feed', 'delete', 'id', $this->feed->id()); ?>" + formmethod="post"><?php echo _t('gen.action.remove'); ?></button> + </div> + </div> + + <legend><?php echo _t('sub.feed.archiving'); ?></legend> + + <div class="form-group"> + <div class="group-controls"> + <div class="stick"> + <input type="text" value="<?php echo _t('sub.feed.number_entries', $nbEntries); ?>" disabled="disabled" /> + <a class="btn" href="<?php echo _url('feed', 'actualize', 'id', $this->feed->id()); ?>"> + <?php echo _i('refresh'); ?> <?php echo _t('gen.action.actualize'); ?> + </a> + </div> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="keep_history"><?php echo _t('sub.feed.keep_history'); ?></label> + <div class="group-controls"> + <select class="number" name="keep_history" id="keep_history" required="required"><?php + foreach (array('' => '', -2 => _t('gen.short.by_default'), 0 => '0', 10 => '10', 50 => '50', 100 => '100', 500 => '500', 1000 => '1 000', 5000 => '5 000', 10000 => '10 000', -1 => '∞') as $v => $t) { + echo '<option value="' . $v . ($this->feed->keepHistory() === $v ? '" selected="selected' : '') . '">' . $t . '</option>'; + } + ?></select> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="ttl"><?php echo _t('sub.feed.ttl'); ?></label> + <div class="group-controls"> + <select class="number" name="ttl" id="ttl" required="required"><?php + $found = false; + foreach (array(-2 => _t('gen.short.by_default'), 900 => '15min', 1200 => '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min', + 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', 1209600 => '2wk', 1814400 => '3wk', 2419200 => '4wk', 2629744 => '1mo', -1 => '∞') as $v => $t) { + echo '<option value="' . $v . ($this->feed->ttl() === $v ? '" selected="selected' : '') . '">' . $t . '</option>'; + if ($this->feed->ttl() == $v) { + $found = true; + } + } + if (!$found) { + echo '<option value="' . intval($this->feed->ttl()) . '" selected="selected">' . intval($this->feed->ttl()) . 's</option>'; + } + ?></select> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="pubsubhubbub"><?php echo _t('sub.feed.pubsubhubbub'); ?></label> + <div class="group-controls"> + <label class="checkbox" for="pubsubhubbub"> + <input type="checkbox" name="pubsubhubbub" id="pubsubhubbub" disabled="disabled" value="1"<?php echo $this->feed->pubSubHubbubEnabled() ? ' checked="checked"' : ''; ?> /> + </label> + </div> + </div> + <div class="form-group form-actions"> + <div class="group-controls"> + <button class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button class="btn btn-attention confirm" formmethod="post" formaction="<?php echo _url('feed', 'truncate', 'id', $this->feed->id()); ?>"><?php echo _t('gen.action.truncate'); ?></button> + </div> + </div> + + <legend><?php echo _t('sub.feed.auth.configuration'); ?></legend> + <?php $auth = $this->feed->httpAuth(false); ?> + <div class="form-group"> + <label class="group-name" for="http_user_feed<?php echo $this->feed->id(); ?>"><?php echo _t('sub.feed.auth.username'); ?></label> + <div class="group-controls"> + <input type="text" name="http_user_feed<?php echo $this->feed->id(); ?>" id="http_user_feed<?php echo $this->feed->id(); ?>" class="extend" value="<?php echo empty($auth['username']) ? ' ' : $auth['username']; ?>" autocomplete="off" /> + <?php echo _i('help'); ?> <?php echo _t('sub.feed.auth.help'); ?> + </div> + + <label class="group-name" for="http_pass_feed<?php echo $this->feed->id(); ?>"><?php echo _t('sub.feed.auth.password'); ?></label> + <div class="group-controls"> + <input type="password" name="http_pass_feed<?php echo $this->feed->id(); ?>" id="http_pass_feed<?php echo $this->feed->id(); ?>" class="extend" value="<?php echo $auth['password']; ?>" autocomplete="off" /> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> + </div> + </div> + + <legend><?php echo _t('sub.feed.advanced'); ?></legend> + <div class="form-group"> + <label class="group-name" for="path_entries"><?php echo _t('sub.feed.css_path'); ?></label> + <div class="group-controls"> + <input type="text" name="path_entries" id="path_entries" class="extend" value="<?php echo $this->feed->pathEntries(); ?>" placeholder="<?php echo _t('gen.short.blank_to_disable'); ?>" /> + <?php echo _i('help'); ?> <?php echo _t('sub.feed.css_help'); ?> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> + </div> + </div> + </form> +</div> diff --git a/app/views/helpers/index/normal/entry_bottom.phtml b/app/views/helpers/index/normal/entry_bottom.phtml new file mode 100644 index 000000000..a9d5a80ca --- /dev/null +++ b/app/views/helpers/index/normal/entry_bottom.phtml @@ -0,0 +1,86 @@ +<?php + $sharing = array(); + if (FreshRSS_Auth::hasAccess()) { + $sharing = FreshRSS_Context::$user_conf->sharing; + } + + $bottomline_read = FreshRSS_Context::$user_conf->bottomline_read; + $bottomline_favorite = FreshRSS_Context::$user_conf->bottomline_favorite; + $bottomline_sharing = FreshRSS_Context::$user_conf->bottomline_sharing && (count($sharing) > 0); + $bottomline_tags = FreshRSS_Context::$user_conf->bottomline_tags; + $bottomline_date = FreshRSS_Context::$user_conf->bottomline_date; + $bottomline_link = FreshRSS_Context::$user_conf->bottomline_link; +?><ul class="horizontal-list bottom"><?php + if (FreshRSS_Auth::hasAccess()) { + if ($bottomline_read) { + ?><li class="item manage"><?php + $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $this->entry->id())); + if ($this->entry->isRead()) { + $arUrl['params']['is_read'] = 0; + } + ?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php + echo _i($this->entry->isRead() ? 'read' : 'unread'); ?></a><?php + ?></li><?php + } + if ($bottomline_favorite) { + ?><li class="item manage"><?php + $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $this->entry->id())); + if ($this->entry->isFavorite()) { + $arUrl['params']['is_favorite'] = 0; + } + ?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php + echo _i($this->entry->isFavorite() ? 'starred' : 'non-starred'); ?></a><?php + ?></li><?php + } + } ?> + <li class="item"><?php + if ($bottomline_sharing) { + ?><div class="dropdown"> + <div id="dropdown-share-<?php echo $this->entry->id();?>" class="dropdown-target"></div> + <a class="dropdown-toggle" href="#dropdown-share-<?php echo $this->entry->id();?>"> + <?php echo _i('share'); ?> + <?php echo _t('index.share'); ?> + </a> + + <ul class="dropdown-menu"> + <li class="dropdown-close"><a href="#close">❌</a></li><?php + $link = $this->entry->link(); + $title = $this->entry->title() . ' · ' . $this->feed->name(); + foreach (FreshRSS_Context::$user_conf->sharing as $share_options) { + $share = FreshRSS_Share::get($share_options['type']); + $share_options['link'] = $link; + $share_options['title'] = $title; + $share->update($share_options); + ?><li class="item share"> + <a target="_blank" rel="noreferrer" href="<?php echo $share->url(); ?>"><?php echo $share->name(); ?></a> + </li><?php + } + ?></ul> + </div> + <?php } ?> + </li><?php + $tags = $bottomline_tags ? $this->entry->tags() : null; + if (!empty($tags)) { + ?><li class="item"> + <div class="dropdown"> + <div id="dropdown-tags-<?php echo $this->entry->id();?>" class="dropdown-target"></div> + <?php echo _i('tag'); ?> + <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $this->entry->id();?>"><?php + echo _t('index.tag.related'); + ?></a> + <ul class="dropdown-menu"> + <li class="dropdown-close"><a href="#close">❌</a></li><?php + foreach($tags as $tag) { + ?><li class="item"><a href="<?php echo _url('index', 'index', 'search', '#' . htmlspecialchars_decode($tag)); ?>"><?php echo $tag; ?></a></li><?php + } ?> + </ul> + </div> + </li><?php + } + if ($bottomline_date) { + ?><li class="item date"><?php echo $this->entry->date(); ?></li><?php + } + if ($bottomline_link) { + ?><li class="item link"><a target="_blank" rel="noreferrer" href="<?php echo $this->entry->link(); ?>"><?php echo _i('link'); ?></a></li><?php + } ?> +</ul> diff --git a/app/views/helpers/index/normal/entry_header.phtml b/app/views/helpers/index/normal/entry_header.phtml new file mode 100644 index 000000000..86298e59f --- /dev/null +++ b/app/views/helpers/index/normal/entry_header.phtml @@ -0,0 +1,33 @@ +<?php + $topline_read = FreshRSS_Context::$user_conf->topline_read; + $topline_favorite = FreshRSS_Context::$user_conf->topline_favorite; + $topline_date = FreshRSS_Context::$user_conf->topline_date; + $topline_link = FreshRSS_Context::$user_conf->topline_link; +?><ul class="horizontal-list flux_header"><?php + if (FreshRSS_Auth::hasAccess()) { + if ($topline_read) { + ?><li class="item manage"><?php + $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $this->entry->id())); + if ($this->entry->isRead()) { + $arUrl['params']['is_read'] = 0; + } + ?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php + echo _i($this->entry->isRead() ? 'read' : 'unread'); ?></a><?php + ?></li><?php + } + if ($topline_favorite) { + ?><li class="item manage"><?php + $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $this->entry->id())); + if ($this->entry->isFavorite()) { + $arUrl['params']['is_favorite'] = 0; + } + ?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php + echo _i($this->entry->isFavorite() ? 'starred' : 'non-starred'); ?></a><?php + ?></li><?php + } + } + ?><li class="item website"><a href="<?php echo _url('index', 'index', 'get', 'f_' . $this->feed->id()); ?>"><img class="favicon" src="<?php echo $this->feed->favicon(); ?>" alt="✇" /> <span><?php echo $this->feed->name(); ?></span></a></li> + <li class="item title"><a target="_blank" rel="noreferrer" href="<?php echo $this->entry->link(); ?>"><?php echo $this->entry->title(); ?></a></li> + <?php if ($topline_date) { ?><li class="item date"><?php echo $this->entry->date(); ?> </li><?php } ?> + <?php if ($topline_link) { ?><li class="item link"><a target="_blank" rel="noreferrer" href="<?php echo $this->entry->link(); ?>"><?php echo _i('link'); ?></a></li><?php } ?> +</ul> diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 3d7c8a98f..745baa195 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -1,52 +1,53 @@ <?php - -echo '"use strict";', "\n"; - -$mark = $this->conf->mark_when; -echo 'var ', - 'hide_posts=', ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'false' : 'true', - ',auto_mark_article=', $mark['article'] ? 'true' : 'false', - ',auto_mark_site=', $mark['site'] ? 'true' : 'false', - ',auto_mark_scroll=', $mark['scroll'] ? 'true' : 'false', - ',auto_load_more=', $this->conf->auto_load_more ? 'true' : 'false', - ',full_lazyload=', $this->conf->lazyload && ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'true' : 'false', - ',does_lazyload=', $this->conf->lazyload ? 'true' : 'false'; - -$s = $this->conf->shortcuts; -echo ',shortcuts={', - 'mark_read:"', $s['mark_read'], '",', - 'mark_favorite:"', $s['mark_favorite'], '",', - 'go_website:"', $s['go_website'], '",', - 'prev_entry:"', $s['prev_entry'], '",', - 'next_entry:"', $s['next_entry'], '",', - 'first_entry:"', $s['first_entry'], '",', - 'last_entry:"', $s['last_entry'], '",', - 'collapse_entry:"', $s['collapse_entry'], '",', - 'load_more:"', $s['load_more'], '",', - 'auto_share:"', $s['auto_share'], '"', -"},\n"; - -if (Minz_Request::param ('output') === 'global') { - echo "iconClose='", FreshRSS_Themes::icon('close'), "',\n"; -} - -$authType = Minz_Configuration::authType(); -if ($authType === 'persona') { - // If user is disconnected, current_user_mail MUST be null - $mail = Minz_Session::param ('mail', false); - if ($mail) { - echo 'current_user_mail="' . $mail . '",'; - } else { - echo 'current_user_mail=null,'; - } -} - -echo 'authType="', $authType, '",', - 'url_freshrss="', _url ('index', 'index'), '",', - 'url_login="', _url ('index', 'login'), '",', - 'url_logout="', _url ('index', 'logout'), '",'; - -echo 'str_confirmation="', Minz_Translate::t('confirm_action'), '"', ",\n"; - -$autoActualise = Minz_Session::param('actualize_feeds', false); -echo 'auto_actualize_feeds=', $autoActualise ? 'true' : 'false', ";\n"; +$mark = FreshRSS_Context::$user_conf->mark_when; +$s = FreshRSS_Context::$user_conf->shortcuts; +echo htmlspecialchars(json_encode(array( + 'context' => array( + 'auto_remove_article' => !!FreshRSS_Context::isAutoRemoveAvailable(), + 'hide_posts' => !(FreshRSS_Context::$user_conf->display_posts || Minz_Request::actionName() === 'reader'), + 'display_order' => Minz_Request::param('order', FreshRSS_Context::$user_conf->sort_order), + 'auto_mark_article' => !!$mark['article'], + 'auto_mark_site' => !!$mark['site'], + 'auto_mark_scroll' => !!$mark['scroll'], + 'auto_load_more' => !!FreshRSS_Context::$user_conf->auto_load_more, + 'auto_actualize_feeds' => !!Minz_Session::param('actualize_feeds', false), + 'does_lazyload' => !!FreshRSS_Context::$user_conf->lazyload , + 'sticky_post' => !!FreshRSS_Context::isStickyPostEnabled(), + 'html5_notif_timeout' => FreshRSS_Context::$user_conf->html5_notif_timeout, + 'auth_type' => FreshRSS_Context::$system_conf->auth_type, + 'current_view' => Minz_Request::actionName(), + 'csrf' => FreshRSS_Auth::csrfToken(), + ), + 'shortcuts' => array( + 'mark_read' => @$s['mark_read'], + 'mark_favorite' => @$s['mark_favorite'], + 'go_website' => @$s['go_website'], + 'prev_entry' => @$s['prev_entry'], + 'next_entry' => @$s['next_entry'], + 'first_entry' => @$s['first_entry'], + 'last_entry' => @$s['last_entry'], + 'collapse_entry' => @$s['collapse_entry'], + 'load_more' => @$s['load_more'], + 'auto_share' => @$s['auto_share'], + 'focus_search' => @$s['focus_search'], + 'user_filter' => @$s['user_filter'], + 'help' => @$s['help'], + 'close_dropdown' => @$s['close_dropdown'], + ), + 'url' => array( + 'index' => _url('index', 'index'), + 'login' => Minz_Url::display(array('c' => 'auth', 'a' => 'login'), 'php'), + 'logout' => Minz_Url::display(array('c' => 'auth', 'a' => 'logout'), 'php'), + 'help' => FRESHRSS_WIKI, + ), + 'i18n' => array( + 'confirmation_default' => _t('gen.js.confirm_action'), + 'notif_title_articles' => _t('gen.js.feedback.title_new_articles'), + 'notif_body_articles' => _t('gen.js.feedback.body_new_articles'), + 'notif_request_failed' => _t('gen.js.feedback.request_failed'), + 'category_empty' => _t('gen.js.category_empty'), + ), + 'icons' => array( + 'close' => _i('close'), + ), +), JSON_UNESCAPED_UNICODE), ENT_NOQUOTES); diff --git a/app/views/helpers/logs_pagination.phtml b/app/views/helpers/logs_pagination.phtml index e3d14810e..bf9d91f04 100755 --- a/app/views/helpers/logs_pagination.phtml +++ b/app/views/helpers/logs_pagination.phtml @@ -1,7 +1,7 @@ <?php - $c = Minz_Request::controllerName (); - $a = Minz_Request::actionName (); - $params = Minz_Request::params (); + $c = Minz_Request::controllerName(); + $a = Minz_Request::actionName(); + $params = Minz_Request::fetchGET(); ?> <?php if ($this->nbPage > 1) { ?> @@ -9,14 +9,14 @@ <?php $params[$getteur] = 1; ?> <li class="item pager-first"> <?php if ($this->currentPage > 1) { ?> - <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">« <?php echo Minz_Translate::t('first'); ?></a> + <a href="<?php echo Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)); ?>">« <?php echo _t('gen.pagination.first'); ?></a> <?php } ?> </li> <?php $params[$getteur] = $this->currentPage - 1; ?> <li class="item pager-previous"> <?php if ($this->currentPage > 1) { ?> - <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">‹ <?php echo Minz_Translate::t('previous'); ?></a> + <a href="<?php echo Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)); ?>">‹ <?php echo _t('gen.pagination.previous'); ?></a> <?php } ?> </li> @@ -24,7 +24,7 @@ <?php if($i > 0 && $i <= $this->nbPage) { ?> <?php if ($i != $this->currentPage) { ?> <?php $params[$getteur] = $i; ?> - <li class="item pager-item"><a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo $i; ?></a></li> + <li class="item pager-item"><a href="<?php echo Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo $i; ?></a></li> <?php } else { ?> <li class="item pager-current"><?php echo $i; ?></li> <?php } ?> @@ -34,13 +34,13 @@ <?php $params[$getteur] = $this->currentPage + 1; ?> <li class="item pager-next"> <?php if ($this->currentPage < $this->nbPage) { ?> - <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Minz_Translate::t('next'); ?> ›</a> + <a href="<?php echo Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo _t('gen.pagination.next'); ?> ›</a> <?php } ?> </li> <?php $params[$getteur] = $this->nbPage; ?> <li class="item pager-last"> <?php if ($this->currentPage < $this->nbPage) { ?> - <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Minz_Translate::t('last'); ?> »</a> + <a href="<?php echo Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo _t('gen.pagination.last'); ?> »</a> <?php } ?> </li> </ul> diff --git a/app/views/helpers/pagination.phtml b/app/views/helpers/pagination.phtml index d4983a32e..893451af9 100755 --- a/app/views/helpers/pagination.phtml +++ b/app/views/helpers/pagination.phtml @@ -1,26 +1,45 @@ <?php - $c = Minz_Request::controllerName (); - $a = Minz_Request::actionName (); - $params = Minz_Request::params (); - $markReadUrl = Minz_Session::param ('markReadUrl'); - Minz_Session::_param ('markReadUrl', false); + $url_next = Minz_Request::currentRequest(); + $url_next['params']['next'] = FreshRSS_Context::$next_id; + $url_next['params']['state'] = FreshRSS_Context::$state; + $url_next['params']['ajax'] = 1; + + $url_mark_read = array( + 'c' => 'entry', + 'a' => 'read', + 'params' => array( + 'get' => FreshRSS_Context::currentGet(), + 'nextGet' => FreshRSS_Context::$next_get, + 'idMax' => FreshRSS_Context::$id_max, + 'search' => FreshRSS_Context::$search, + 'state' => FreshRSS_Context::$state, + ) + ); ?> +<form id="mark-read-pagination" method="post"> +<input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> <ul class="pagination"> <li class="item pager-next"> - <?php if (!empty($this->nextId)) { ?> - <?php $params['next'] = $this->nextId; ?> - <a id="load_more" href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Minz_Translate::t ('load_more'); ?></a> - <?php } elseif ($markReadUrl) { ?> - <a id="bigMarkAsRead" href="<?php echo $markReadUrl; ?>"> - <?php echo Minz_Translate::t ('nothing_to_load'); ?><br /> - <span class="bigTick">✔</span><br /> - <?php echo Minz_Translate::t ('mark_all_read'); ?> - </a> + <?php if (FreshRSS_Context::$next_id) { ?> + <a id="load_more" href="<?php echo Minz_Url::display($url_next); ?>"> + <?php echo _t('gen.pagination.load_more'); ?> + </a> + <?php } elseif ($url_mark_read) { ?> + <button id="bigMarkAsRead" + class="as-link <?php echo FreshRSS_Context::$user_conf->reading_confirm ? 'confirm" disabled="disabled' : ''; ?>" + form="mark-read-pagination" + formaction="<?php echo Minz_Url::display($url_mark_read); ?>" + type="submit"> + <?php echo _t('gen.pagination.nothing_to_load'); ?><br /> + <span class="bigTick">✓</span><br /> + <?php echo _t('gen.pagination.mark_all_read'); ?> + </button> <?php } else { ?> - <a id="bigMarkAsRead" href="."> - <?php echo Minz_Translate::t ('nothing_to_load'); ?><br /> - </a> + <a id="bigMarkAsRead" href="."> + <?php echo _t('gen.pagination.nothing_to_load'); ?><br /> + </a> <?php } ?> </li> </ul> +</form> diff --git a/app/views/helpers/view/global_view.phtml b/app/views/helpers/view/global_view.phtml deleted file mode 100644 index db937eeae..000000000 --- a/app/views/helpers/view/global_view.phtml +++ /dev/null @@ -1,45 +0,0 @@ -<?php $this->partial ('nav_menu'); ?> - -<div id="stream" class="global categories"> -<?php - $arUrl = array('c' => 'index', 'a' => 'index', 'params' => array()); - if ($this->conf->view_mode !== 'normal') { - $arUrl['params']['output'] = 'normal'; - } - $p = Minz_Request::param('state', ''); - if (($p != '') && ($this->conf->default_view !== $p)) { - $arUrl['params']['state'] = $p; - } - - foreach ($this->cat_aside as $cat) { - $feeds = $cat->feeds (); - if (!empty ($feeds)) { -?> - <div class="box-category"> - <div class="category"> - <a data-unread="<?php echo formatNumber($cat->nbNotRead()); ?>" class="btn" href="<?php $arUrl['params']['get'] = 'c_' . $cat->id (); echo Minz_Url::display($arUrl); ?>"> - <?php echo $cat->name(); ?> - </a> - </div> - <ul class="feeds"> - <?php foreach ($feeds as $feed) { ?> - <?php $not_read = $feed->nbNotRead (); ?> - <li id="f_<?php echo $feed->id (); ?>" class="item<?php echo $feed->inError () ? ' error' : ''; ?><?php echo $feed->nbEntries () == 0 ? ' empty' : ''; ?>"> - <img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> - <a class="feed" data-unread="<?php echo formatNumber($feed->nbNotRead()); ?>" data-priority="<?php echo $feed->priority (); ?>" href="<?php $arUrl['params']['get'] = 'f_' . $feed->id(); echo Minz_Url::display($arUrl); ?>"> - <?php echo $feed->name(); ?> - </a> - </li> - <?php } ?> - </ul> - </div> -<?php - } - } -?> -</div> - -<div id="overlay"></div> -<div id="panel"<?php echo $this->conf->display_posts ? '' : ' class="hide_posts"'; ?>> - <a class="close" href="#"><?php echo FreshRSS_Themes::icon('close'); ?></a> -</div> diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml deleted file mode 100644 index ae93b627c..000000000 --- a/app/views/helpers/view/normal_view.phtml +++ /dev/null @@ -1,240 +0,0 @@ -<?php - -$this->partial ('aside_flux'); -$this->partial ('nav_menu'); - -if (!empty($this->entries)) { - $display_today = true; - $display_yesterday = true; - $display_others = true; - if ($this->loginOk) { - $shaarli = $this->conf->sharing ('shaarli'); - $wallabag = $this->conf->sharing ('wallabag'); - $diaspora = $this->conf->sharing ('diaspora'); - } else { - $shaarli = ''; - $wallabag = ''; - $diaspora = ''; - } - $twitter = $this->conf->sharing ('twitter'); - $google_plus = $this->conf->sharing ('g+'); - $facebook = $this->conf->sharing ('facebook'); - $email = $this->conf->sharing ('email'); - $print = $this->conf->sharing ('print'); - $hidePosts = !$this->conf->display_posts; - $lazyload = $this->conf->lazyload; - $topline_read = $this->conf->topline_read; - $topline_favorite = $this->conf->topline_favorite; - $topline_date = $this->conf->topline_date; - $topline_link = $this->conf->topline_link; - $bottomline_read = $this->conf->bottomline_read; - $bottomline_favorite = $this->conf->bottomline_favorite; - $bottomline_sharing = $this->conf->bottomline_sharing && ( - $shaarli || $wallabag || $diaspora || $twitter || - $google_plus || $facebook || $email || $print); - $bottomline_tags = $this->conf->bottomline_tags; - $bottomline_date = $this->conf->bottomline_date; - $bottomline_link = $this->conf->bottomline_link; -?> - -<div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>"><?php - ?><div id="new-article"> - <a href="<?php echo _url('index', 'index'); ?>"><?php echo Minz_Translate::t ('new_article'); ?></a> - </div><?php - foreach ($this->entries as $item) { - if ($display_today && $item->isDay (FreshRSS_Days::TODAY, $this->today)) { - ?><div class="day" id="day_today"><?php - echo Minz_Translate::t ('today'); - ?><span class="date"> — <?php echo timestamptodate (time (), false); ?></span><?php - ?><span class="name"><?php echo $this->currentName; ?></span><?php - ?></div><?php - $display_today = false; - } - if ($display_yesterday && $item->isDay (FreshRSS_Days::YESTERDAY, $this->today)) { - ?><div class="day" id="day_yesterday"><?php - echo Minz_Translate::t ('yesterday'); - ?><span class="date"> — <?php echo timestamptodate (time () - 86400, false); ?></span><?php - ?><span class="name"><?php echo $this->currentName; ?></span><?php - ?></div><?php - $display_yesterday = false; - } - if ($display_others && $item->isDay (FreshRSS_Days::BEFORE_YESTERDAY, $this->today)) { - ?><div class="day" id="day_before_yesterday"><?php - echo Minz_Translate::t ('before_yesterday'); - ?><span class="name"><?php echo $this->currentName; ?></span><?php - ?></div><?php - $display_others = false; - } - ?><div class="flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id (); ?>"> - <ul class="horizontal-list flux_header"><?php - if ($this->loginOk) { - if ($topline_read) { - ?><li class="item manage"><?php - $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id ())); - if ($item->isRead()) { - $arUrl['params']['is_read'] = 0; - } - ?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php - echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php - ?></li><?php - } - if ($topline_favorite) { - ?><li class="item manage"><?php - $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id ())); - if ($item->isFavorite()) { - $arUrl['params']['is_favorite'] = 0; - } - ?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php - echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php - ?></li><?php - } - } - $feed = FreshRSS_CategoryDAO::findFeed($this->cat_aside, $item->feed ()); //We most likely already have the feed object in cache - if (empty($feed)) $feed = $item->feed (true); - ?><li class="item website"><a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>"><img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span></a></li> - <li class="item title"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo $item->title (); ?></a></li> - <?php if ($topline_date) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?> - <?php if ($topline_link) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?> - </ul> - - <div class="flux_content"> - <div class="content"> - <h1 class="title"><?php echo $item->title (); ?></h1> - <?php - $author = $item->author (); - echo $author != '' ? '<div class="author">' . Minz_Translate::t ('by_author', $author) . '</div>' : ''; - if ($lazyload) { - echo $hidePosts ? lazyIframe(lazyimg($item->content())) : lazyimg($item->content()); - } else { - echo $item->content(); - } - ?> - </div> - <ul class="horizontal-list bottom"><?php - if ($this->loginOk) { - if ($bottomline_read) { - ?><li class="item manage"><?php - $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id ())); - if ($item->isRead()) { - $arUrl['params']['is_read'] = 0; - } - ?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php - echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php - ?></li><?php - } - if ($bottomline_favorite) { - ?><li class="item manage"><?php - $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id ())); - if ($item->isFavorite()) { - $arUrl['params']['is_favorite'] = 0; - } - ?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php - echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php - ?></li><?php - } - } ?> - <li class="item"><?php - if ($bottomline_sharing) { - $link = urlencode ($item->link ()); - $title = urlencode ($item->title () . ' · ' . $feed->name ()); - ?><div class="dropdown"> - <div id="dropdown-share-<?php echo $item->id ();?>" class="dropdown-target"></div> - <a class="dropdown-toggle" href="#dropdown-share-<?php echo $item->id ();?>"> - <?php echo FreshRSS_Themes::icon('share'); ?> - <?php echo Minz_Translate::t ('share'); ?> - </a> - - <ul class="dropdown-menu"> - <li class="dropdown-close"><a href="#close">❌</a></li> - <?php if ($shaarli) { ?> - <li class="item share"> - <a target="_blank" href="<?php echo $shaarli . '?post=' . $link . '&title=' . $title . '&source=FreshRSS'; ?>"> - <?php echo Minz_Translate::t ('shaarli'); ?> - </a> - </li> - <?php } if ($wallabag) { ?> - <li class="item share"> - <a target="_blank" href="<?php echo $wallabag . '?action=add&url=' . base64_encode (urldecode($link)); ?>"> - <?php echo Minz_Translate::t ('wallabag'); ?> - </a> - </li> - <?php } if ($diaspora) { ?> - <li class="item share"> - <a target="_blank" href="<?php echo $diaspora . '/bookmarklet?url=' . $link . '&title=' . $title; ?>"> - <?php echo Minz_Translate::t ('diaspora'); ?> - </a> - </li> - <?php } if ($twitter) { ?> - <li class="item share"> - <a target="_blank" href="https://twitter.com/share?url=<?php echo $link; ?>&text=<?php echo $title; ?>"> - <?php echo Minz_Translate::t ('twitter'); ?> - </a> - </li> - <?php } if ($google_plus) { ?> - <li class="item share"> - <a target="_blank" href="https://plus.google.com/share?url=<?php echo $link; ?>"> - <?php echo Minz_Translate::t ('g+'); ?> - </a> - </li> - <?php } if ($facebook) { ?> - <li class="item share"> - <a target="_blank" href="https://www.facebook.com/sharer.php?u=<?php echo $link; ?>&t=<?php echo $title; ?>"> - <?php echo Minz_Translate::t ('facebook'); ?> - </a> - </li> - <?php } if ($email) { ?> - <li class="item share"> - <a href="mailto:?subject=<?php echo urldecode($title); ?>&body=<?php echo $link; ?>"> - <?php echo Minz_Translate::t ('by_email'); ?> - </a> - </li> - <?php } if ($print) { ?> - <li class="item share"> - <a href="#" class="print-article"> - <?php echo Minz_Translate::t ('print'); ?> - </a> - </li> - <?php } ?> - </ul> - </div> - <?php } ?> - </li><?php - $tags = $bottomline_tags ? $item->tags() : null; - if (!empty($tags)) { - ?><li class="item"> - <div class="dropdown"> - <div id="dropdown-tags-<?php echo $item->id ();?>" class="dropdown-target"></div> - <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $item->id ();?>"><?php - echo FreshRSS_Themes::icon('tag'), Minz_Translate::t ('related_tags'); - ?></a> - <ul class="dropdown-menu"> - <li class="dropdown-close"><a href="#close">❌</a></li><?php - foreach($tags as $tag) { - ?><li class="item"><a href="<?php echo _url ('index', 'index', 'search', urlencode ('#' . $tag)); ?>"><?php echo $tag; ?></a></li><?php - } ?> - </ul> - </div> - </li><?php - } - if ($bottomline_date) { - ?><li class="item date"><?php echo $item->date (); ?></li><?php - } - if ($bottomline_link) { - ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php - } ?> - </ul> - </div> - </div> - <?php } ?> - - <?php $this->renderHelper('pagination'); ?> -</div> - -<?php $this->partial ('nav_entries'); ?> - -<?php } else { ?> -<div id="stream" class="alert alert-warn normal"> - <span class="alert-head"><?php echo Minz_Translate::t ('no_feed_to_display'); ?></span> - <?php echo Minz_Translate::t ('think_to_add'); ?> -</div> -<?php } ?> diff --git a/app/views/helpers/view/reader_view.phtml b/app/views/helpers/view/reader_view.phtml deleted file mode 100644 index bda96e86d..000000000 --- a/app/views/helpers/view/reader_view.phtml +++ /dev/null @@ -1,49 +0,0 @@ -<?php -$this->partial ('nav_menu'); - -if (!empty($this->entries)) { - $lazyload = $this->conf->lazyload; -?> - -<div id="stream" class="reader"> - <?php foreach ($this->entries as $item) { ?> - - <div class="flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id (); ?>"> - <div class="flux_content"> - <div class="content"> - <?php - $feed = FreshRSS_CategoryDAO::findFeed($this->cat_aside, $item->feed ()); //We most likely already have the feed object in cache - if (empty($feed)) $feed = $item->feed (true); - ?> - <a href="<?php echo $item->link (); ?>"> - <img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span> - </a> - <h1 class="title"><?php echo $item->title (); ?></h1> - - <div class="author"> - <?php $author = $item->author (); ?> - <?php echo $author != '' ? Minz_Translate::t ('by_author', $author) . ' — ' : ''; ?> - <?php echo $item->date (); ?> - </div> - - <?php - if ($lazyload) { - echo lazyimg($item->content ()); - } else { - echo $item->content(); - } - ?> - </div> - </div> - </div> - <?php } ?> - - <?php $this->renderHelper('pagination'); ?> -</div> - -<?php } else { ?> -<div id="stream" class="alert alert-warn reader"> - <span class="alert-head"><?php echo Minz_Translate::t ('no_feed_to_display'); ?></span> - <?php echo Minz_Translate::t ('think_to_add'); ?> -</div> -<?php } ?> diff --git a/app/views/importExport/export.phtml b/app/views/importExport/export.phtml new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/app/views/importExport/export.phtml diff --git a/app/views/importExport/index.phtml b/app/views/importExport/index.phtml new file mode 100644 index 000000000..c5049e3ea --- /dev/null +++ b/app/views/importExport/index.phtml @@ -0,0 +1,63 @@ +<?php $this->partial('aside_subscription'); ?> + +<div class="post "> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <form method="post" action="<?php echo _url('importExport', 'import'); ?>" enctype="multipart/form-data"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('sub.import_export.import'); ?></legend> + <div class="form-group"> + <label class="group-name" for="file"> + <?php echo extension_loaded('zip') ? _t('sub.import_export.file_to_import') : _t('sub.import_export.file_to_import_no_zip'); ?> + </label> + <div class="group-controls"> + <input type="file" name="file" id="file" /> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.import'); ?></button> + </div> + </div> + </form> + + <?php if (count($this->feeds) > 0) { ?> + <form method="post" action="<?php echo _url('importExport', 'export'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('sub.import_export.export'); ?></legend> + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="export_opml"> + <input type="checkbox" name="export_opml" id="export_opml" value="1" checked="checked" /> + <?php echo _t('sub.import_export.export_opml'); ?> + </label> + + <label class="checkbox" for="export_starred"> + <input type="checkbox" name="export_starred" id="export_starred" value="1" <?php echo extension_loaded('zip') ? 'checked="checked"' : ''; ?> /> + <?php echo _t('sub.import_export.export_starred'); ?> + </label> + + <?php + $select_args = ''; + if (extension_loaded('zip')) { + $select_args = ' size="' . min(10, count($this->feeds)) .'" multiple="multiple"'; + } + ?> + <select name="export_feeds[]"<?php echo $select_args; ?> size="10"> + <?php echo extension_loaded('zip') ? '' : '<option></option>'; ?> + <?php foreach ($this->feeds as $feed) { ?> + <option value="<?php echo $feed->id(); ?>"><?php echo $feed->name(); ?></option> + <?php } ?> + </select> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.export'); ?></button> + </div> + </div> + </form> + <?php } ?> +</div> diff --git a/app/views/index/about.phtml b/app/views/index/about.phtml index 76ff804d8..3fdb5160d 100644 --- a/app/views/index/about.phtml +++ b/app/views/index/about.phtml @@ -1,27 +1,24 @@ <div class="post content"> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> - <h1><?php echo Minz_Translate::t ('about_freshrss'); ?></h1> + <h1><?php echo _t('index.about'); ?></h1> <dl class="infos"> - <dt><?php echo Minz_Translate::t ('project_website'); ?></dt> + <dt><?php echo _t('index.about.project_website'); ?></dt> <dd><a href="<?php echo FRESHRSS_WEBSITE; ?>"><?php echo FRESHRSS_WEBSITE; ?></a></dd> - <dt><?php echo Minz_Translate::t ('lead_developer'); ?></dt> - <dd><a href="mailto:contact@marienfressinaud.fr">Marien Fressinaud</a> — <a href="http://marienfressinaud.fr"><?php echo Minz_Translate::t ('website'); ?></a></dd> + <dt><?php echo _t('index.about.bugs_reports'); ?></dt> + <dd><?php echo _t('index.about.github'); ?></dd> - <dt><?php echo Minz_Translate::t ('bugs_reports'); ?></dt> - <dd><?php echo Minz_Translate::t ('github_or_email'); ?></dd> + <dt><?php echo _t('index.about.license'); ?></dt> + <dd><?php echo _t('index.about.agpl3'); ?></dd> - <dt><?php echo Minz_Translate::t ('license'); ?></dt> - <dd><?php echo Minz_Translate::t ('agpl3'); ?></dd> - - <dt><?php echo Minz_Translate::t ('version'); ?></dt> + <dt><?php echo _t('index.about.version'); ?></dt> <dd><?php echo FRESHRSS_VERSION; ?></dd> </dl> - <p><?php echo Minz_Translate::t ('freshrss_description'); ?></p> + <p><?php echo _t('index.about.freshrss_description'); ?></p> - <h1><?php echo Minz_Translate::t ('credits'); ?></h1> - <p><?php echo Minz_Translate::t ('credits_content'); ?></p> + <h1><?php echo _t('index.about.credits'); ?></h1> + <p><?php echo _t('index.about.credits_content'); ?></p> </div> diff --git a/app/views/index/formLogin.phtml b/app/views/index/formLogin.phtml deleted file mode 100644 index cc925ea59..000000000 --- a/app/views/index/formLogin.phtml +++ /dev/null @@ -1,32 +0,0 @@ -<div class="prompt"> - <h1><?php echo Minz_Translate::t('login'); ?></h1><?php - - switch (Minz_Configuration::authType()) { - case 'form': - ?><form id="loginForm" method="post" action="<?php echo _url('index', 'formLogin'); ?>"> - <div> - <label for="username"><?php echo Minz_Translate::t('username'); ?></label> - <input type="text" id="username" name="username" size="16" required="required" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" autofocus="autofocus" /> - </div> - <div> - <label for="passwordPlain"><?php echo Minz_Translate::t('password'); ?></label> - <input type="password" id="passwordPlain" required="required" /> - <input type="hidden" id="challenge" name="challenge" /><br /> - <noscript><strong><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></strong></noscript> - </div> - <div> - <button id="loginButton" type="submit" class="btn btn-important"><?php echo Minz_Translate::t('login'); ?></button> - </div> - </form><?php - break; - - case 'persona': - ?><p> - <?php echo FreshRSS_Themes::icon('login'); ?> - <a class="signin" href="#"><?php echo Minz_Translate::t('login_with_persona'); ?></a> - </p><?php - break; - } ?> - - <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo Minz_Translate::t('about_freshrss'); ?></a></p> -</div> diff --git a/app/views/index/global.phtml b/app/views/index/global.phtml new file mode 100644 index 000000000..f35732c8f --- /dev/null +++ b/app/views/index/global.phtml @@ -0,0 +1,57 @@ +<?php + $this->partial('nav_menu'); + + $class = ''; + if (FreshRSS_Context::$user_conf->hide_read_feeds && + FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) && + !FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_READ)) { + $class = ' state_unread'; + } +?> + +<div id="stream" class="global<?php echo $class; ?>"> +<?php + $params = Minz_Request::fetchGET(); + unset($params['c']); + unset($params['a']); + $url_base = array( + 'c' => 'index', + 'a' => 'normal', + 'params' => $params, + ); + + foreach ($this->categories as $cat) { + $feeds = $cat->feeds(); + $url_base['params']['get'] = 'c_' . $cat->id(); + + if (!empty($feeds)) { +?> + <div class="box category" data-unread="<?php echo $cat->nbNotRead(); ?>"> + <div class="box-title"><a class="title" data-unread="<?php echo format_number($cat->nbNotRead()); ?>" href="<?php echo Minz_Url::display($url_base); ?>"><?php echo $cat->name(); ?></a></div> + + <ul class="box-content"> + <?php + foreach ($feeds as $feed) { + $nb_not_read = $feed->nbNotRead(); + $error = $feed->inError() ? ' error' : ''; + $empty = $feed->nbEntries() === 0 ? ' empty' : ''; + $url_base['params']['get'] = 'f_' . $feed->id(); + ?> + <li id="f_<?php echo $feed->id(); ?>" class="item feed<?php echo $error, $empty; ?>" data-unread="<?php echo $feed->nbNotRead(); ?>" data-priority="<?php echo $feed->priority(); ?>"> + <img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" /> + <a class="item-title" data-unread="<?php echo format_number($feed->nbNotRead()); ?>" href="<?php echo Minz_Url::display($url_base); ?>"><?php echo $feed->name(); ?></a> + </li> + <?php } ?> + </ul> + </div> +<?php + } + } +?> +</div> + +<div id="overlay"> + <a class="close" href="#"><?php echo _i('close'); ?></a> +</div> +<div id="panel"<?php echo FreshRSS_Context::$user_conf->display_posts ? '' : ' class="hide_posts"'; ?>> +</div> diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml index 1ff36ca8e..e69de29bb 100644 --- a/app/views/index/index.phtml +++ b/app/views/index/index.phtml @@ -1,25 +0,0 @@ -<?php - -$output = Minz_Request::param ('output', 'normal'); - -if ($this->loginOk || Minz_Configuration::allowAnonymous()) { - if ($output === 'normal') { - $this->renderHelper ('view/normal_view'); - } elseif ($output === 'reader') { - $this->renderHelper ('view/reader_view'); - } elseif ($output === 'global') { - $this->renderHelper ('view/global_view'); - } elseif ($output === 'rss') { - $this->renderHelper ('view/rss_view'); - } else { - Minz_Request::_param ('output', 'normal'); - $output = 'normal'; - $this->renderHelper ('view/normal_view'); - } -} elseif ($output === 'rss') { - // token has already been checked in the controller so we can show the view - $this->renderHelper ('view/rss_view'); -} else { - // Normally, it should not happen, but log it anyway - Minz_Log::record ('Something is wrong in ' . __FILE__ . ' line ' . __LINE__, Minz_Log::ERROR); -} diff --git a/app/views/index/login.phtml b/app/views/index/login.phtml deleted file mode 100644 index cc814deff..000000000 --- a/app/views/index/login.phtml +++ /dev/null @@ -1 +0,0 @@ -<?php print_r ($this->res); ?> diff --git a/app/views/index/logout.phtml b/app/views/index/logout.phtml deleted file mode 100644 index a0aba9318..000000000 --- a/app/views/index/logout.phtml +++ /dev/null @@ -1 +0,0 @@ -OK
\ No newline at end of file diff --git a/app/views/index/logs.phtml b/app/views/index/logs.phtml index 1b77b39af..a88f89278 100644 --- a/app/views/index/logs.phtml +++ b/app/views/index/logs.phtml @@ -1,25 +1,26 @@ <div class="post content"> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> - <h1><?php echo Minz_Translate::t ('logs'); ?></h1> - <form method="post" action="<?php echo _url ('index', 'logs'); ?>"><p> + <h1><?php echo _t('index.log'); ?></h1> + <form method="post" action="<?php echo _url('index', 'logs'); ?>"><p> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> <input type="hidden" name="clearLogs" /> - <button type="submit" class="btn"><?php echo Minz_Translate::t ('clear_logs'); ?></button> + <button type="submit" class="btn"><?php echo _t('index.log.clear'); ?></button> </p></form> - <?php $items = $this->logsPaginator->items (); ?> + <?php $items = $this->logsPaginator->items(); ?> - <?php if (!empty ($items)) { ?> - <div class="logs"> - <?php $this->logsPaginator->render ('logs_pagination.phtml', 'page'); ?> + <?php if (!empty($items)) { ?> + <div class="loglist"> + <?php $this->logsPaginator->render('logs_pagination.phtml', 'page'); ?> <?php foreach ($items as $log) { ?> - <div class="log <?php echo $log->level (); ?>"><span class="date"><?php echo @date ('Y-m-d H:i:s', @strtotime ($log->date ())); ?></span><?php echo htmlspecialchars ($log->info (), ENT_NOQUOTES, 'UTF-8'); ?></div> + <div class="log <?php echo $log->level(); ?>"><span class="date"><?php echo @date('Y-m-d H:i:s', @strtotime($log->date())); ?></span><?php echo htmlspecialchars($log->info(), ENT_NOQUOTES, 'UTF-8'); ?></div> <?php } ?> - <?php $this->logsPaginator->render ('logs_pagination.phtml','page'); ?> + <?php $this->logsPaginator->render('logs_pagination.phtml','page'); ?> </div> <?php } else { ?> - <p class="alert alert-warn"><?php echo Minz_Translate::t ('logs_empty'); ?></p> + <p class="alert alert-warn"><?php echo _t('index.log.empty'); ?></p> <?php } ?> </div> diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml new file mode 100644 index 000000000..6fda11ed9 --- /dev/null +++ b/app/views/index/normal.phtml @@ -0,0 +1,93 @@ +<?php + +$this->partial('aside_feed'); +$this->partial('nav_menu'); + +if (!empty($this->entries)) { + $display_today = true; + $display_yesterday = true; + $display_others = true; + $hidePosts = !FreshRSS_Context::$user_conf->display_posts; + $lazyload = FreshRSS_Context::$user_conf->lazyload; + $content_width = FreshRSS_Context::$user_conf->content_width; + + $today = @strtotime('today'); +?> + +<div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>"><?php + ?><div id="new-article"> + <a href="<?php echo Minz_Url::display(Minz_Request::currentRequest()); ?>"><?php echo _t('gen.js.new_article'); /* TODO: move string in JS*/ ?></a> + </div><?php + foreach ($this->entries as $item) { + $this->entry = Minz_ExtensionManager::callHook('entry_before_display', $item); + if (is_null($this->entry)) { + continue; + } + + // We most likely already have the feed object in cache + $this->feed = FreshRSS_CategoryDAO::findFeed($this->categories, $this->entry->feed()); + if ($this->feed == null) { + $this->feed = $this->entry->feed(true); + if ($this->feed == null) { + $this->feed = FreshRSS_Feed::example(); + } + } + + if ($display_today && $this->entry->isDay(FreshRSS_Days::TODAY, $today)) { + ?><div class="day" id="day_today"><?php + echo _t('gen.date.today'); + ?><span class="date"> — <?php echo timestamptodate(time(), false); ?></span><?php + ?><span class="name"><?php echo FreshRSS_Context::$name; ?></span><?php + ?></div><?php + $display_today = false; + } + if ($display_yesterday && $this->entry->isDay(FreshRSS_Days::YESTERDAY, $today)) { + ?><div class="day" id="day_yesterday"><?php + echo _t('gen.date.yesterday'); + ?><span class="date"> — <?php echo timestamptodate(time() - 86400, false); ?></span><?php + ?><span class="name"><?php echo FreshRSS_Context::$name; ?></span><?php + ?></div><?php + $display_yesterday = false; + } + if ($display_others && $this->entry->isDay(FreshRSS_Days::BEFORE_YESTERDAY, $today)) { + ?><div class="day" id="day_before_yesterday"><?php + echo _t('gen.date.before_yesterday'); + ?><span class="name"><?php echo FreshRSS_Context::$name; ?></span><?php + ?></div><?php + $display_others = false; + } + ?><div class="flux<?php echo !$this->entry->isRead() ? ' not_read' : ''; + ?><?php echo $this->entry->isFavorite() ? ' favorite' : ''; + ?>" id="flux_<?php echo $this->entry->id(); + ?>" data-feed="<?php echo $this->feed->id(); + ?>"><?php + + $this->renderHelper('index/normal/entry_header'); + + ?><div class="flux_content"> + <div class="content <?php echo $content_width; ?>"> + <h1 class="title"><a target="_blank" rel="noreferrer" href="<?php echo $this->entry->link(); ?>"><?php echo $this->entry->title(); ?></a></h1> + <?php + $author = $this->entry->author(); + echo $author != '' ? '<div class="author">' . _t('gen.short.by_author', $author) . '</div>' : '', + $lazyload && $hidePosts ? lazyimg($this->entry->content()) : $this->entry->content(); + ?> + </div><?php + + $this->renderHelper('index/normal/entry_bottom'); + + ?></div> + </div><?php + } + + $this->renderHelper('pagination'); +?></div> + +<?php $this->partial('nav_entries'); ?> + +<?php } else { ?> +<div id="stream" class="prompt alert alert-warn normal"> + <h2><?php echo _t('index.feed.empty'); ?></h2> + <a href="<?php echo _url('subscription', 'index'); ?>"><?php echo _t('index.feed.add'); ?></a><br /><br /> +</div> +<?php } ?> diff --git a/app/views/index/reader.phtml b/app/views/index/reader.phtml new file mode 100644 index 000000000..a19ee322e --- /dev/null +++ b/app/views/index/reader.phtml @@ -0,0 +1,47 @@ +<?php +$this->partial('nav_menu'); + +if (!empty($this->entries)) { + $lazyload = FreshRSS_Context::$user_conf->lazyload; + $content_width = FreshRSS_Context::$user_conf->content_width; +?> + +<div id="stream" class="reader"><?php + foreach ($this->entries as $item) { + $item = Minz_ExtensionManager::callHook('entry_before_display', $item); + if (is_null($item)) { + continue; + } + ?><div class="flux<?php echo !$item->isRead() ? ' not_read' : ''; ?><?php echo $item->isFavorite() ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id(); ?>"> + <div class="flux_content"> + <div class="content <?php echo $content_width; ?>"> + <?php + $feed = FreshRSS_CategoryDAO::findFeed($this->categories, $item->feed()); //We most likely already have the feed object in cache + if (empty($feed)) $feed = $item->feed(true); + ?> + <a href="<?php echo $item->link(); ?>"> + <img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span> + </a> + <h1 class="title"><?php echo $item->title(); ?></h1> + + <div class="author"><?php + $author = $item->author(); + echo $author != '' ? _t('gen.short.by_author', $author) . ' — ' : '', + $item->date(); + ?></div> + + <?php echo $item->content(); ?> + </div> + </div> + </div> + <?php } ?> + + <?php $this->renderHelper('pagination'); ?> +</div> + +<?php } else { ?> +<div id="stream" class="prompt alert alert-warn reader"> + <h2><?php echo _t('index.feed.empty'); ?></h2> + <a href="<?php echo _url('subscription', 'index'); ?>"><?php echo _t('index.feed.add'); ?></a><br /><br /> +</div> +<?php } ?> diff --git a/app/views/helpers/view/rss_view.phtml b/app/views/index/rss.phtml index 620bf1388..86074517c 100755 --- a/app/views/helpers/view/rss_view.phtml +++ b/app/views/index/rss.phtml @@ -3,25 +3,25 @@ <channel> <title><?php echo $this->rss_title; ?></title> <link><?php echo Minz_Url::display(null, 'html', true); ?></link> - <description><?php echo Minz_Translate::t ('rss_feeds_of', $this->rss_title); ?></description> + <description><?php echo _t('index.feed.rss_of', $this->rss_title); ?></description> <pubDate><?php echo date('D, d M Y H:i:s O'); ?></pubDate> <lastBuildDate><?php echo gmdate('D, d M Y H:i:s'); ?> GMT</lastBuildDate> - <atom:link href="<?php echo Minz_Url::display ($this->rss_url, 'html', true); ?>" rel="self" type="application/rss+xml" /> + <atom:link href="<?php echo Minz_Url::display($this->url, 'html', true); ?>" rel="self" type="application/rss+xml" /> <?php foreach ($this->entries as $item) { ?> <item> - <title><?php echo $item->title (); ?></title> - <link><?php echo $item->link (); ?></link> - <?php $author = $item->author (); ?> + <title><?php echo $item->title(); ?></title> + <link><?php echo $item->link(); ?></link> + <?php $author = $item->author(); ?> <?php if ($author != '') { ?> <dc:creator><?php echo $author; ?></dc:creator> <?php } ?> <description><![CDATA[<?php - echo $item->content (); + echo $item->content(); ?>]]></description> - <pubDate><?php echo date('D, d M Y H:i:s O', $item->date (true)); ?></pubDate> - <guid isPermaLink="false"><?php echo $item->id (); ?></guid> + <pubDate><?php echo date('D, d M Y H:i:s O', $item->date(true)); ?></pubDate> + <guid isPermaLink="false"><?php echo $item->id(); ?></guid> </item> <?php } ?> diff --git a/app/views/index/stats.phtml b/app/views/index/stats.phtml deleted file mode 100644 index b5c18813d..000000000 --- a/app/views/index/stats.phtml +++ /dev/null @@ -1,125 +0,0 @@ -<div class="post content"> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> - - <h1><?php echo Minz_Translate::t ('stats'); ?></h1> - - <div class="stat"> - <h2><?php echo Minz_Translate::t ('stats_entry_repartition'); ?></h2> - <table> - <thead> - <tr> - <th> </th> - <th><?php echo Minz_Translate::t ('main_stream'); ?></th> - <th><?php echo Minz_Translate::t ('all_feeds'); ?></th> - </tr> - </thead> - <tbody> - <tr> - <th><?php echo Minz_Translate::t ('status_total'); ?></th> - <td class="numeric"><?php echo formatNumber($this->repartition['main_stream']['total']); ?></td> - <td class="numeric"><?php echo formatNumber($this->repartition['all_feeds']['total']); ?></td> - </tr> - <tr> - <th><?php echo Minz_Translate::t ('status_read'); ?></th> - <td class="numeric"><?php echo formatNumber($this->repartition['main_stream']['read']); ?></td> - <td class="numeric"><?php echo formatNumber($this->repartition['all_feeds']['read']); ?></td> - </tr> - <tr> - <th><?php echo Minz_Translate::t ('status_unread'); ?></th> - <td class="numeric"><?php echo formatNumber($this->repartition['main_stream']['unread']); ?></td> - <td class="numeric"><?php echo formatNumber($this->repartition['all_feeds']['unread']); ?></td> - </tr> - <tr> - <th><?php echo Minz_Translate::t ('status_favorites'); ?></th> - <td class="numeric"><?php echo formatNumber($this->repartition['main_stream']['favorite']); ?></td> - <td class="numeric"><?php echo formatNumber($this->repartition['all_feeds']['favorite']); ?></td> - </tr> - </tbody> - </table> - </div> - - <div class="stat"> - <h2><?php echo Minz_Translate::t ('stats_entry_per_day'); ?></h2> - <div id="statsEntryPerDay" style="height: 300px"></div> - </div> - - <div class="stat"> - <h2><?php echo Minz_Translate::t ('stats_feed_per_category'); ?></h2> - <div id="statsFeedPerCategory" style="height: 300px"></div> - <div id="statsFeedPerCategoryLegend"></div> - </div> - - <div class="stat"> - <h2><?php echo Minz_Translate::t ('stats_entry_per_category'); ?></h2> - <div id="statsEntryPerCategory" style="height: 300px"></div> - <div id="statsEntryPerCategoryLegend"></div> - </div> - - <div class="stat"> - <h2><?php echo Minz_Translate::t ('stats_top_feed'); ?></h2> - <table> - <thead> - <tr> - <th><?php echo Minz_Translate::t ('feed'); ?></th> - <th><?php echo Minz_Translate::t ('category'); ?></th> - <th><?php echo Minz_Translate::t ('stats_entry_count'); ?></th> - </tr> - </thead> - <tbody> - <?php foreach ($this->topFeed as $feed): ?> - <tr> - <td><?php echo $feed['name']; ?></td> - <td><?php echo $feed['category']; ?></td> - <td class="numeric"><?php echo formatNumber($feed['count']); ?></td> - </tr> - <?php endforeach;?> - </tbody> - </table> - </div> -</div> - -<script> -"use strict"; -function initStats() { - if (!window.Flotr) { - if (window.console) { - console.log('FreshRSS waiting for Flotr…'); - } - window.setTimeout(initStats, 50); - return; - } - // Entry per day - Flotr.draw(document.getElementById('statsEntryPerDay'), - [<?php echo $this->count ?>], - { - grid: {verticalLines: false}, - bars: {horizontal: false, show: true}, - xaxis: {noTicks: 6, showLabels: false, tickDecimals: 0}, - yaxis: {min: 0}, - mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return numberFormat(obj.y);}} - }); - // Feed per category - Flotr.draw(document.getElementById('statsFeedPerCategory'), - <?php echo $this->feedByCategory ?>, - { - grid: {verticalLines: false, horizontalLines: false}, - pie: {explode: 10, show: true, labelFormatter: function(){return '';}}, - xaxis: {showLabels: false}, - yaxis: {showLabels: false}, - mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return obj.series.label + ' - '+ numberFormat(obj.y) + ' ('+ (obj.fraction * 100).toFixed(1) + '%)';}}, - legend: {container: document.getElementById('statsFeedPerCategoryLegend'), noColumns: 3} - }); - // Entry per category - Flotr.draw(document.getElementById('statsEntryPerCategory'), - <?php echo $this->entryByCategory ?>, - { - grid: {verticalLines: false, horizontalLines: false}, - pie: {explode: 10, show: true, labelFormatter: function(){return '';}}, - xaxis: {showLabels: false}, - yaxis: {showLabels: false}, - mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return obj.series.label + ' - '+ numberFormat(obj.y) + ' ('+ (obj.fraction * 100).toFixed(1) + '%)';}}, - legend: {container: document.getElementById('statsEntryPerCategoryLegend'), noColumns: 3} - }); -} -initStats(); -</script> diff --git a/app/views/javascript/actualize.phtml b/app/views/javascript/actualize.phtml index 3b12ad774..3baabf748 100644 --- a/app/views/javascript/actualize.phtml +++ b/app/views/javascript/actualize.phtml @@ -1,55 +1,13 @@ -"use strict"; -var feeds = [<?php - foreach ($this->feeds as $feed) { - echo "'", Minz_Url::display(array('c' => 'feed', 'a' => 'actualize', 'params' => array('id' => $feed->id(), 'ajax' => '1')), 'php'), "',\n"; - } - ?>], - feed_processed = 0, - feed_count = feeds.length; - -function initProgressBar(init) { - if (init) { - $("body").after("\<div id=\"actualizeProgress\" class=\"actualizeProgress\">\ - <?php echo Minz_Translate::t ('refresh'); ?> <span class=\"progress\">0 / " + feed_count + "</span><br />\ - <progress id=\"actualizeProgressBar\" value=\"0\" max=\"" + feed_count + "\"></progress>\ - </div>"); - } else { - window.location.reload(); - } -} -function updateProgressBar(i) { - $("#actualizeProgressBar").val(i); - $("#actualizeProgress .progress").html(i + " / " + feed_count); -} - -function updateFeeds() { - if (feed_count === 0) { - openNotification("<?php echo Minz_Translate::t ('no_feed_to_refresh'); ?>", "good"); - return; - } - initProgressBar(true); - - for (var i = 0; i < 10; i++) { - updateFeed(); - } -} - -function updateFeed() { - var feed = feeds.pop(); - if (feed == undefined) { - return; - } - $.ajax({ - type: 'POST', - url: feed, - }).complete(function (data) { - feed_processed++; - updateProgressBar(feed_processed); - - if (feed_processed === feed_count) { - initProgressBar(false); - } else { - updateFeed(); - } - }); -} +<?php +$feeds = array(); +foreach ($this->feeds as $feed) { + $feeds[] = array( + 'url' => Minz_Url::display(array('c' => 'feed', 'a' => 'actualize', 'params' => array('id' => $feed->id(), 'ajax' => '1')), 'php'), + 'title' => $feed->name(), + ); +} +echo json_encode(array( + 'feeds' => $feeds, + 'feedback_no_refresh' => _t('feedback.sub.feed.no_refresh'), + 'feedback_actualize' => _t('feedback.sub.actualize'), +)); diff --git a/app/views/stats/idle.phtml b/app/views/stats/idle.phtml new file mode 100644 index 000000000..88c78d465 --- /dev/null +++ b/app/views/stats/idle.phtml @@ -0,0 +1,49 @@ +<?php $this->partial('aside_stats'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <h1><?php echo _t('admin.stats.idle'); ?></h1> + + <?php + $current_url = Minz_Url::display( + array('c' => 'stats', 'a' => 'idle'), + 'php', true + ); + $nothing = true; + foreach ($this->idleFeeds as $period => $feeds) { + if (!empty($feeds)) { + $nothing = false; + ?> + <div class="stat"> + <h2><?php echo _t('gen.date.' . $period); ?></h2> + + <form id="form-delete" method="post"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <?php foreach ($feeds as $feed) { ?> + <ul class="horizontal-list"> + <li class="item"> + <div class="stick"> + <a class="btn" href="<?php echo _url('index', 'index', 'get', 'f_' . $feed['id']); ?>"><?php echo _i('link'); ?> <?php echo _t('gen.action.filter'); ?></a> + <a class="btn" href="<?php echo _url('subscription', 'index', 'id', $feed['id']); ?>"><?php echo _i('configure'); ?> <?php echo _t('gen.action.manage'); ?></a> + <button class="btn btn-attention confirm" form="form-delete" formaction="<?php echo _url('feed', 'delete', 'id', $feed['id'], 'r', $current_url); ?>"><?php echo _t('gen.action.remove'); ?></button> + </div> + </li> + <li class="item"> + <span title="<?php echo timestamptodate($feed['last_date'], false); ?>"><?php echo $feed['name']; ?> (<?php echo _t('admin.stats.number_entries', $feed['nb_articles']); ?>)</span> + </li> + </ul> + <?php } ?> + </form> + </div> + <?php + } + } + + if ($nothing) { + ?> + <p class="alert alert-warn"> + <span class="alert-head"><?php echo _t('admin.stats.no_idle'); ?></span> + </p> + <?php } ?> +</div> diff --git a/app/views/stats/index.phtml b/app/views/stats/index.phtml new file mode 100644 index 000000000..a36f812a8 --- /dev/null +++ b/app/views/stats/index.phtml @@ -0,0 +1,93 @@ +<?php $this->partial('aside_stats'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <h1><?php echo _t('admin.stats.main'); ?></h1> + + <div class="stat half"> + <h2><?php echo _t('admin.stats.entry_repartition'); ?></h2> + <table> + <thead> + <tr> + <th> </th> + <th><?php echo _t('admin.stats.main_stream'); ?></th> + <th><?php echo _t('admin.stats.all_feeds'); ?></th> + </tr> + </thead> + <tbody> + <tr> + <th><?php echo _t('admin.stats.status_total'); ?></th> + <td class="numeric"><?php echo format_number($this->repartition['main_stream']['total']); ?></td> + <td class="numeric"><?php echo format_number($this->repartition['all_feeds']['total']); ?></td> + </tr> + <tr> + <th><?php echo _t('admin.stats.status_read'); ?></th> + <td class="numeric"><?php echo format_number($this->repartition['main_stream']['count_reads']); ?></td> + <td class="numeric"><?php echo format_number($this->repartition['all_feeds']['count_reads']); ?></td> + </tr> + <tr> + <th><?php echo _t('admin.stats.status_unread'); ?></th> + <td class="numeric"><?php echo format_number($this->repartition['main_stream']['count_unreads']); ?></td> + <td class="numeric"><?php echo format_number($this->repartition['all_feeds']['count_unreads']); ?></td> + </tr> + <tr> + <th><?php echo _t('admin.stats.status_favorites'); ?></th> + <td class="numeric"><?php echo format_number($this->repartition['main_stream']['count_favorites']); ?></td> + <td class="numeric"><?php echo format_number($this->repartition['all_feeds']['count_favorites']); ?></td> + </tr> + </tbody> + </table> + </div><!-- + + --><div class="stat half"> + <h2><?php echo _t('admin.stats.top_feed'); ?></h2> + <table> + <thead> + <tr> + <th><?php echo _t('admin.stats.feed'); ?></th> + <th><?php echo _t('admin.stats.category'); ?></th> + <th><?php echo _t('admin.stats.entry_count'); ?></th> + <th><?php echo _t('admin.stats.percent_of_total'); ?></th> + </tr> + </thead> + <tbody> + <?php foreach ($this->topFeed as $feed) { ?> + <tr> + <td><a href="<?php echo _url('stats', 'repartition', 'id', $feed['id']); ?>"><?php echo $feed['name']; ?></a></td> + <td><?php echo $feed['category']; ?></td> + <td class="numeric"><?php echo format_number($feed['count']); ?></td> + <td class="numeric"><?php echo format_number($feed['count'] / $this->repartition['all_feeds']['total'] * 100, 1);?></td> + </tr> + <?php } ?> + </tbody> + </table> + </div> + + <div class="stat"> + <h2><?php echo _t('admin.stats.entry_per_day'); ?></h2> + <div id="statsEntryPerDay" class="statGraph"></div> + </div> + + <div class="stat half"> + <h2><?php echo _t('admin.stats.feed_per_category'); ?></h2> + <div id="statsFeedPerCategory" class="statGraph"></div> + <div id="statsFeedPerCategoryLegend"></div> + </div> + + <div class="stat half"> + <h2><?php echo _t('admin.stats.entry_per_category'); ?></h2> + <div id="statsEntryPerCategory" class="statGraph"></div> + <div id="statsEntryPerCategoryLegend"></div> + </div> +</div> + +<script id="jsonStats" type="application/json"><?php +echo htmlspecialchars(json_encode(array( + 'average' => $this->average, + 'dataCount' => $this->count, + 'feedByCategory' => $this->feedByCategory, + 'entryByCategory' => $this->entryByCategory, +), JSON_UNESCAPED_UNICODE), ENT_NOQUOTES); +?></script> +<script src="../scripts/stats.js?<?php echo @filemtime(PUBLIC_PATH . '/scripts/stats.js'); ?>"></script> diff --git a/app/views/stats/repartition.phtml b/app/views/stats/repartition.phtml new file mode 100644 index 000000000..5ebcdce5a --- /dev/null +++ b/app/views/stats/repartition.phtml @@ -0,0 +1,74 @@ +<?php $this->partial('aside_stats'); ?> + +<div class="post "> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <h1><?php echo _t('admin.stats.repartition'); ?></h1> + + <select id="feed_select" class="select-change"> + <option data-url="<?php echo _url('stats', 'repartition')?>"><?php echo _t('admin.stats.all_feeds')?></option> + <?php foreach ($this->categories as $category) { + $feeds = $category->feeds(); + if (!empty($feeds)) { + echo '<optgroup label="', $category->name(), '">'; + foreach ($feeds as $feed) { + if ($this->feed && $feed->id() == $this->feed->id()) { + echo '<option value="', $feed->id(), '" selected="selected" data-url="', _url('stats', 'repartition', 'id', $feed->id()), '">', $feed->name(), '</option>'; + } else { + echo '<option value="', $feed->id(), '" data-url="', _url('stats', 'repartition', 'id', $feed->id()), '">', $feed->name(), '</option>'; + } + } + echo '</optgroup>'; + } + }?> + </select> + + <?php if ($this->feed) {?> + <a class="btn" href="<?php echo _url('subscription', 'index', 'id', $this->feed->id()); ?>"> + <?php echo _i('configure'); ?> <?php echo _t('gen.action.manage'); ?> + </a> + <?php }?> + + <div class="stat"> + <table> + <tr> + <th><?php echo _t('admin.stats.status_total'); ?></th> + <th><?php echo _t('admin.stats.status_read'); ?></th> + <th><?php echo _t('admin.stats.status_unread'); ?></th> + <th><?php echo _t('admin.stats.status_favorites'); ?></th> + </tr> + <tr> + <td class="numeric"><?php echo $this->repartition['total']; ?></td> + <td class="numeric"><?php echo $this->repartition['count_reads']; ?></td> + <td class="numeric"><?php echo $this->repartition['count_unreads']; ?></td> + <td class="numeric"><?php echo $this->repartition['count_favorites']; ?></td> + </tr> + </table> + </div> + + <div class="stat"> + <h2><?php echo _t('admin.stats.entry_per_hour', $this->averageHour); ?></h2> + <div id="statsEntryPerHour" class="statGraph"></div> + </div> + + <div class="stat half"> + <h2><?php echo _t('admin.stats.entry_per_day_of_week', $this->averageDayOfWeek); ?></h2> + <div id="statsEntryPerDayOfWeek" class="statGraph"></div> + </div> + + <div class="stat half"> + <h2><?php echo _t('admin.stats.entry_per_month', $this->averageMonth); ?></h2> + <div id="statsEntryPerMonth" class="statGraph"></div> + </div> +</div> + +<script id="jsonRepartition" type="application/json"><?php +echo htmlspecialchars(json_encode(array( + 'repartitionHour' => $this->repartitionHour, + 'repartitionDayOfWeek' => $this->repartitionDayOfWeek, + 'days' => $this->days, + 'repartitionMonth' => $this->repartitionMonth, + 'months' => $this->months, +), JSON_UNESCAPED_UNICODE), ENT_NOQUOTES); +?></script> +<script src="../scripts/repartition.js?<?php echo @filemtime(PUBLIC_PATH . '/scripts/repartition.js'); ?>"></script> diff --git a/app/views/subscription/feed.phtml b/app/views/subscription/feed.phtml new file mode 100644 index 000000000..60664fdee --- /dev/null +++ b/app/views/subscription/feed.phtml @@ -0,0 +1,15 @@ +<?php + +if (!Minz_Request::param('ajax')) { + $this->partial('aside_subscription'); +} + +if ($this->feed) { + $this->renderHelper('feed/update'); +} else { +?> +<div class="alert alert-warn"> + <span class="alert-head"><?php echo _t('sub.feed.no_selected'); ?></span> + <?php echo _t('sub.feed.think_to_add'); ?> +</div> +<?php } ?> diff --git a/app/views/subscription/index.phtml b/app/views/subscription/index.phtml new file mode 100644 index 000000000..48f760d3e --- /dev/null +++ b/app/views/subscription/index.phtml @@ -0,0 +1,153 @@ +<?php $this->partial('aside_subscription'); ?> + +<div class="post drop-section"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <h2><?php echo _t('sub.title'); ?></h2> + + <form id="add_rss" method="post" action="<?php echo _url('feed', 'add'); ?>" autocomplete="off"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <div class="stick"> + <input type="url" name="url_rss" class="long" placeholder="<?php echo _t('sub.feed.add'); ?>" /> + <div class="dropdown"> + <div id="dropdown-cat" class="dropdown-target"></div> + + <a class="dropdown-toggle btn" href="#dropdown-cat"><?php echo _i('down'); ?></a> + <ul class="dropdown-menu"> + <li class="dropdown-close"><a href="#close">❌</a></li> + + <li class="dropdown-header"><?php echo _t('sub.category'); ?></li> + + <li class="input"> + <select name="category" id="category"> + <?php foreach ($this->categories as $cat) { ?> + <option value="<?php echo $cat->id(); ?>"<?php echo $cat->id() == 1 ? ' selected="selected"' : ''; ?>> + <?php echo $cat->name(); ?> + </option> + <?php } ?> + <option value="nc"><?php echo _t('sub.category.new'); ?></option> + </select> + </li> + + <li class="input" aria-hidden="true"> + <input type="text" name="new_category[name]" id="new_category_name" autocomplete="off" placeholder="<?php echo _t('sub.category.new'); ?>" /> + </li> + + <li class="separator"></li> + + <li class="dropdown-header"><?php echo _t('sub.feed.auth.http'); ?></li> + <li class="input"> + <input type="text" name="http_user" id="http_user_feed" value=" " autocomplete="off" placeholder="<?php echo _t('sub.feed.auth.username'); ?>" /> + </li> + <li class="input"> + <input type="password" name="http_pass" id="http_pass_feed" autocomplete="off" placeholder="<?php echo _t('sub.feed.auth.password'); ?>" /> + </li> + </ul> + </div> + <button class="btn" type="submit"><?php echo _i('add'); ?></button> + </div> + </form> + + <p class="alert alert-warn"> + <?php echo _t('sub.feed.moved_category_deleted', $this->default_category->name()); ?> + </p> + + <div class="box"> + <div class="box-title"><label for="new-category"><?php echo _t('sub.category.add'); ?></label></div> + + <ul class="box-content box-content-centered"> + <form action="<?php echo _url('category', 'create'); ?>" method="post"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <li class="item"><input type="text" id="new-category" name="new-category" placeholder="<?php echo _t('sub.category.new'); ?>" /></li> + <li class="item"><button class="btn btn-important" type="submit"><?php echo _t('gen.action.submit'); ?></button></li> + </form> + </ul> + </div> + + <form id="controller-category" method="post" aria-hidden="true"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + </form> + + <?php + foreach ($this->categories as $cat) { + $feeds = $cat->feeds(); + ?> + <div class="box"> + <div class="box-title"> + <form action="<?php echo _url('category', 'update', 'id', $cat->id()); ?>" method="post"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <input type="text" name="name" value="<?php echo $cat->name(); ?>" /> + + <div class="dropdown"> + <div id="dropdown-cat-<?php echo $cat->id(); ?>" class="dropdown-target"></div> + + <a class="dropdown-toggle btn" href="#dropdown-cat-<?php echo $cat->id(); ?>"><?php echo _i('down'); ?></a> + <ul class="dropdown-menu"> + <li class="dropdown-close"><a href="#close">❌</a></li> + + <li class="item"><a href="<?php echo _url('index', 'index', 'get', 'c_' . $cat->id()); ?>"><?php echo _t('gen.action.filter'); ?></a></li> + + <?php + $no_feed = empty($feeds); + $is_default = ($cat->id() === $this->default_category->id()); + + if (!$no_feed || !$is_default) { + ?> + <li class="separator"></li> + <?php } if (!$no_feed) { ?> + <li class="item"> + <button class="as-link confirm" + data-str-confirm="<?php echo _t('gen.js.confirm_action_feed_cat'); ?>" + type="submit" + form="controller-category" + formaction="<?php echo _url('category', 'empty', 'id', $cat->id()); ?>"> + <?php echo _t('gen.action.empty'); ?></button> + </li> + <?php } if (!$is_default) { ?> + <li class="item"> + <button class="as-link confirm" + data-str-confirm="<?php echo _t('gen.js.confirm_action_feed_cat'); ?>" + type="submit" + form="controller-category" + formaction="<?php echo _url('category', 'delete', 'id', $cat->id()); ?>"> + <?php echo _t('gen.action.remove'); ?></button> + </li> + <?php } ?> + </ul> + </div> + </form> + </div> + + <ul class="box-content" data-cat-id="<?php echo $cat->id(); ?>"> + <?php if (!empty($feeds)) { ?> + <?php + foreach ($feeds as $feed) { + $error = $feed->inError() ? ' error' : ''; + $empty = $feed->nbEntries() == 0 ? ' empty' : ''; + ?> + <li class="item feed<?php echo $error, $empty; ?>" + draggable="true" + data-feed-id="<?php echo $feed->id(); ?>" + dropzone="move"> + <a class="configure open-slider" href="<?php echo _url('subscription', 'feed', 'id', $feed->id()); ?>"><?php echo _i('configure'); ?></a> + <img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" /> <?php echo $feed->name(); ?> + </li> + <?php } + } else { + ?> + <li class="item disabled" dropzone="move"><?php echo _t('sub.category.empty'); ?></li> + <?php } ?> + </ul> + </div> + <?php } ?> +</div> + +<?php $class = isset($this->feed) ? ' class="active"' : ''; ?> +<a href="#" id="close-slider"<?php echo $class; ?>></a> +<div id="slider"<?php echo $class; ?>> +<?php + if (isset($this->feed)) { + $this->renderHelper('feed/update'); + } +?> +</div> diff --git a/app/views/update/apply.phtml b/app/views/update/apply.phtml new file mode 100644 index 000000000..8221929ae --- /dev/null +++ b/app/views/update/apply.phtml @@ -0,0 +1,9 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <h1><?php echo _t('admin.update'); ?></h1> + + <?php ask_info_update(); ?> +</div> diff --git a/app/views/update/checkInstall.phtml b/app/views/update/checkInstall.phtml new file mode 100644 index 000000000..543ab43de --- /dev/null +++ b/app/views/update/checkInstall.phtml @@ -0,0 +1,38 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <h2><?php echo _t('admin.check_install.php'); ?></h2> + + <?php foreach ($this->status_php as $key => $status) { ?> + <p class="alert <?php echo $status ? 'alert-success' : 'alert-error'; ?>"> + <?php + if ($key === 'php') { + echo _t('admin.check_install.' . $key . '.' . ($status ? 'ok' : 'nok'), PHP_VERSION, '5.3.3'); + } else { + echo _t('admin.check_install.' . $key . '.' . ($status ? 'ok' : 'nok')); + } + ?> + </p> + <?php } ?> + + <h2><?php echo _t('admin.check_install.files'); ?></h2> + + <?php foreach ($this->status_files as $key => $status) { ?> + <p class="alert <?php echo $status ? 'alert-success' : 'alert-error'; ?>"> + <?php echo _t('admin.check_install.' . $key . '.' . ($status ? 'ok' : 'nok')); ?> + </p> + <?php } ?> + + <?php /* + <h2><?php echo _t('admin.check_install.database'); ?></h2> + + <?php foreach ($this->status_database as $key => $status) { ?> + <p class="alert <?php echo $status ? 'alert-success' : 'alert-error'; ?>"> + <?php echo _t('admin.check_install.' . $key . '.' . ($status ? 'ok' : 'nok')); ?> + </p> + <?php } ?> + */ ?> + +</div> diff --git a/app/views/update/index.phtml b/app/views/update/index.phtml new file mode 100644 index 000000000..da1bc7ef5 --- /dev/null +++ b/app/views/update/index.phtml @@ -0,0 +1,34 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <h1><?php echo _t('admin.update'); ?></h1> + + <p> + <?php echo _i('help'); ?> <?php echo _t('admin.update.current_version', FRESHRSS_VERSION); ?> + </p> + + <p> + <?php echo _t('admin.update.last', $this->last_update_time); ?> + </p> + + <?php if (!empty($this->message)) { ?> + <p class="alert <?php echo $this->message['status'] === 'bad' ? 'alert-error' : 'alert-warn'; ?>"> + <span class="alert-head"><?php echo $this->message['title']; ?></span> + <?php echo $this->message['body']; ?> + </p> + <?php } ?> + + <?php + if (empty($this->message) || $this->message['status'] !== 'good') { + ?> + <p> + <a href="<?php echo _url('update', 'check'); ?>" class="btn"><?php echo _t('admin.update.check'); ?></a> + </p> + <?php } ?> + + <?php if ($this->update_to_apply) { ?> + <a class="btn btn-important" href="<?php echo _url('update', 'apply'); ?>"><?php echo _t('admin.update.apply'); ?></a> + <?php } ?> +</div> diff --git a/app/views/user/manage.phtml b/app/views/user/manage.phtml new file mode 100644 index 000000000..a32247d14 --- /dev/null +++ b/app/views/user/manage.phtml @@ -0,0 +1,74 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <form method="post" action="<?php echo _url('user', 'create'); ?>" autocomplete="off"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('admin.user.create'); ?></legend> + + <div class="form-group"> + <label class="group-name" for="new_user_language"><?php echo _t('admin.user.language'); ?></label> + <div class="group-controls"> + <select name="new_user_language" id="new_user_language"> + <?php $languages = Minz_Translate::availableLanguages(); ?> + <?php foreach ($languages as $lang) { ?> + <option value="<?php echo $lang; ?>"<?php echo FreshRSS_Context::$user_conf->language === $lang ? ' selected="selected"' : ''; ?>><?php echo _t('gen.lang.' . $lang); ?></option> + <?php } ?> + </select> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="new_user_name"><?php echo _t('admin.user.username'); ?></label> + <div class="group-controls"> + <input id="new_user_name" name="new_user_name" type="text" size="16" required="required" maxlength="16" autocomplete="off" pattern="[0-9a-zA-Z]{1,16}" placeholder="demo" /> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="new_user_passwordPlain"><?php echo _t('admin.user.password_form'); ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="password" id="new_user_passwordPlain" name="new_user_passwordPlain" autocomplete="new-password" pattern=".{7,}" /> + <a class="btn toggle-password" data-toggle="new_user_passwordPlain"><?php echo _i('key'); ?></a> + </div> + <?php echo _i('help'); ?> <?php echo _t('admin.user.password_format'); ?> + <noscript><b><?php echo _t('gen.js.should_be_activated'); ?></b></noscript> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.create'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> + </div> + </div> + </form> + + <form method="post" action="<?php echo _url('user', 'delete'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('admin.user.users'); ?></legend> + + <div class="form-group"> + <label class="group-name" for="user-list"><?php echo _t('admin.user.user_list'); ?></label> + <div class="group-controls"> + <select id="user-list" class="select-change" name="username"> + <?php foreach (listUsers() as $username) { ?> + <option data-url="<?php echo _url('user', 'manage', 'u', $username); ?>" <?php echo $this->current_user === $username ? 'selected="selected"' : ''; ?> value="<?php echo $username; ?>"><?php echo $username; ?></option> + <?php } ?> + </select> + + <p><?php echo _t('admin.user.articles_and_size', + format_number($this->nb_articles), + format_bytes($this->size_user)); ?></p> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-attention confirm"><?php echo _t('gen.action.remove'); ?></button> + </div> + </div> + </form> +</div> diff --git a/app/views/user/profile.phtml b/app/views/user/profile.phtml new file mode 100644 index 000000000..429375e44 --- /dev/null +++ b/app/views/user/profile.phtml @@ -0,0 +1,85 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <form method="post" action="<?php echo _url('user', 'profile'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('conf.profile'); ?></legend> + + <div class="form-group"> + <label class="group-name" for="current_user"><?php echo _t('conf.user.current'); ?></label> + <div class="group-controls"> + <input id="current_user" type="text" disabled="disabled" value="<?php echo Minz_Session::param('currentUser', '_'); ?>" /> + <label class="checkbox" for="is_admin"> + <input type="checkbox" id="is_admin" disabled="disabled" <?php echo FreshRSS_Auth::hasAccess('admin') ? 'checked="checked" ' : ''; ?>/> + <?php echo _t('conf.user.is_admin'); ?> + </label> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="newPasswordPlain"><?php echo _t('conf.profile.password_form'); ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="password" id="newPasswordPlain" name="newPasswordPlain" autocomplete="off" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/> + <a class="btn toggle-password" data-toggle="newPasswordPlain"><?php echo _i('key'); ?></a> + </div> + <?php echo _i('help'); ?> <?php echo _t('conf.profile.password_format'); ?> + <noscript><b><?php echo _t('gen.js.should_be_activated'); ?></b></noscript> + </div> + </div> + + <?php if (FreshRSS_Context::$system_conf->api_enabled) { ?> + <div class="form-group"> + <label class="group-name" for="apiPasswordPlain"><?php echo _t('conf.profile.password_api'); ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="password" id="apiPasswordPlain" name="apiPasswordPlain" autocomplete="off" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/> + <a class="btn toggle-password" data-toggle="apiPasswordPlain"><?php echo _i('key'); ?></a> + </div> + <?php echo _i('help'); ?> <kbd><a href="../api/"><?php echo Minz_Url::display('/api/greader.php', 'html', true); ?></a></kbd> + </div> + </div> + <?php } ?> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> + </div> + </div> + </form> + + <?php if (!FreshRSS_Auth::hasAccess('admin')) { ?> + <form id="crypto-form" method="post" action="<?php echo _url('user', 'delete'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('conf.profile.delete'); ?></legend> + + <p class="alert alert-warn"><span class="alert-head"><?php echo _t('gen.short.attention'); ?></span> <?php echo _t('conf.profile.delete.warn'); ?></p> + + <div class="form-group"> + <label class="group-name" for="passwordPlain"><?php echo _t('gen.auth.password'); ?></label> + <div class="group-controls"> + <input type="password" id="passwordPlain" required="required" /> + <input type="hidden" id="challenge" name="challenge" /><br /> + <noscript><strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <?php + $redirect_url = urlencode(Minz_Url::display( + array('c' => 'user', 'a' => 'profile'), + 'php', true + )); + ?> + <input type="hidden" name="r" value="<?php echo $redirect_url; ?>" /> + <input type="hidden" name="username" id="username" value="<?php echo Minz_Session::param('currentUser', '_'); ?>" /> + <button type="submit" class="btn btn-attention confirm"><?php echo _t('gen.action.remove'); ?></button> + </div> + </div> + </form> + <?php } ?> +</div> diff --git a/cli/.htaccess b/cli/.htaccess new file mode 100644 index 000000000..9e768397d --- /dev/null +++ b/cli/.htaccess @@ -0,0 +1,3 @@ +Order Allow,Deny +Deny from all +Satisfy all diff --git a/cli/README.md b/cli/README.md new file mode 100644 index 000000000..e4d3409a2 --- /dev/null +++ b/cli/README.md @@ -0,0 +1,80 @@ +* Back to [main read-me](../README.md) + +# FreshRSS Command-Line Interface (CLI) + +## Note on access rights + +When using the command-line interface, remember that your user might not be the same as the one used by your Web server. +This might create some access right problems. + +It is recommended to invoke commands using the same user as your Web server: + +```sh +cd /usr/share/FreshRSS +sudo -u www-data sh -c './cli/list-users.php' +``` + +In any case, when you are done with a series of commands, you should re-apply the access rights: + +```sh +cd /usr/share/FreshRSS +sudo chown -R :www-data . +sudo chmod -R g+r . +sudo chmod -R g+w ./data/ +``` + + +## Commands + +Options in parenthesis are optional. + + +```sh +cd /usr/share/FreshRSS + +./cli/do-install.php --default_user admin ( --auth_type form --environment production --base_url https://rss.example.net/ --title FreshRSS --allow_anonymous --api_enabled --db-type mysql --db-host localhost:3306 --db-user freshrss --db-password dbPassword123 --db-base freshrss --db-prefix freshrss ) +# --auth_type can be: 'form' (default), 'http_auth' (using the Web server access control), 'none' (dangerous) +# --db-type can be: 'sqlite' (default), 'mysql' (MySQL or MariaDB), 'pgsql' (PostgreSQL) +# --environment can be: 'production' (default), 'development' (for additional log messages) +# --db-prefix is an optional prefix in front of the names of the tables. We suggest using 'freshrss_' +# This command does not create the default user. Do that with ./cli/create-user.php + +./cli/create-user.php --user username ( --password 'password' --api-password 'api_password' --language en --email user@example.net --token 'longRandomString' --no-default-feeds ) +# --language can be: 'en' (default), 'fr', or one of the [supported languages](../app/i18n/) + +./cli/delete-user.php --user username + +./cli/list-users.php +# Return a list of users, with the default/admin user first + +./cli/actualize-user.php --user username + +./cli/import-for-user.php --user username --filename /path/to/file.ext +# The extension of the file { .json, .opml, .xml, .zip } is used to detect the type of import + +./cli/export-opml-for-user.php --user username > /path/to/file.opml.xml + +./cli/export-zip-for-user.php --user username ( --max-feed-entries 100 ) > /path/to/file.zip + +./cli/user-info.php -h --user username +# -h is to use a human-readable format +# --user can be a username, or '*' to loop on all users +# Returns a * if the user is admin, the name of the user, the date/time of last action, and the size occupied +``` + + +## Unix piping + +It is possible to invoke a command multiple times, e.g. with different usernames, thanks to the `xargs -n1` command. + +Example showing user information for all users which username starts with 'a': + +```sh +./cli/list-users.php | grep '^a' | xargs -n1 ./cli/user-info.php -h --user +``` + +Example showing all users ranked by date of last activity: + +```sh +./cli/user-info.php -h --user '*' | sort -k2 -r +``` diff --git a/cli/_cli.php b/cli/_cli.php new file mode 100644 index 000000000..7d1a7c6b2 --- /dev/null +++ b/cli/_cli.php @@ -0,0 +1,49 @@ +<?php +if (php_sapi_name() !== 'cli') { + die('FreshRSS error: This PHP script may only be invoked from command line!'); +} + +require(dirname(__FILE__) . '/../constants.php'); +require(LIB_PATH . '/lib_rss.php'); + +Minz_Configuration::register('system', + DATA_PATH . '/config.php', + DATA_PATH . '/config.default.php'); +FreshRSS_Context::$system_conf = Minz_Configuration::get('system'); +Minz_Translate::init('en'); + +FreshRSS_Context::$isCli = true; + +function fail($message) { + fwrite(STDERR, $message . "\n"); + die(1); +} + +function cliInitUser($username) { + if (!ctype_alnum($username)) { + fail('FreshRSS error: invalid username: ' . $username . "\n"); + } + + $usernames = listUsers(); + if (!in_array($username, $usernames)) { + fail('FreshRSS error: user not found: ' . $username . "\n"); + } + + FreshRSS_Context::$user_conf = get_user_configuration($username); + if (FreshRSS_Context::$user_conf == null) { + fail('FreshRSS error: invalid configuration for user: ' . $username . "\n"); + } + new Minz_ModelPdo($username); + + return $username; +} + +function accessRights() { + echo '• Remember to re-apply the appropriate access rights, such as:' , "\n", + "\t", 'sudo chown -R :www-data . && sudo chmod -R g+r . && sudo chmod -R g+w ./data/', "\n"; +} + +function done($ok = true) { + fwrite(STDERR, 'Result: ' . ($ok ? 'success' : 'fail') . "\n"); + exit($ok ? 0 : 1); +} diff --git a/cli/actualize-user.php b/cli/actualize-user.php new file mode 100755 index 000000000..29d51753a --- /dev/null +++ b/cli/actualize-user.php @@ -0,0 +1,23 @@ +#!/usr/bin/php +<?php +require('_cli.php'); + +$options = getopt('', array( + 'user:', + )); + +if (empty($options['user'])) { + fail('Usage: ' . basename(__FILE__) . " --user username"); +} + +$username = cliInitUser($options['user']); + +fwrite(STDERR, 'FreshRSS actualizing user “' . $username . "”…\n"); + +list($nbUpdatedFeeds, $feed) = FreshRSS_feed_Controller::actualizeFeed(0, '', true); + +echo "FreshRSS actualized $nbUpdatedFeeds feeds for $username\n"; + +invalidateHttpCache($username); + +done($nbUpdatedFeeds > 0); diff --git a/cli/create-user.php b/cli/create-user.php new file mode 100755 index 000000000..444264cc7 --- /dev/null +++ b/cli/create-user.php @@ -0,0 +1,51 @@ +#!/usr/bin/php +<?php +require('_cli.php'); + +$options = getopt('', array( + 'user:', + 'password:', + 'api-password:', + 'language:', + 'email:', + 'token:', + 'no-default-feeds', + )); + +if (empty($options['user'])) { + fail('Usage: ' . basename(__FILE__) . " --user username ( --password 'password' --api-password 'api_password'" . + " --language en --email user@example.net --token 'longRandomString --no-default-feeds' )"); +} +$username = $options['user']; +if (!ctype_alnum($username)) { + fail('FreshRSS error: invalid username “' . $username . '”'); +} + +$usernames = listUsers(); +if (preg_grep("/^$username$/i", $usernames)) { + fail('FreshRSS error: username already taken “' . $username . '”'); +} + +echo 'FreshRSS creating user “', $username, "”…\n"; + +$ok = FreshRSS_user_Controller::createUser($username, + empty($options['password']) ? '' : $options['password'], + empty($options['api-password']) ? '' : $options['api-password'], + array( + 'language' => empty($options['language']) ? '' : $options['language'], + 'token' => empty($options['token']) ? '' : $options['token'], + ), + !isset($options['no-default-feeds'])); + +if (!$ok) { + fail('FreshRSS could not create user!'); +} + +invalidateHttpCache(FreshRSS_Context::$system_conf->default_user); + +echo '• Remember to refresh the feeds of the user: ', $username , "\n", + "\t", './cli/actualize-user.php --user ', $username, "\n"; + +accessRights(); + +done($ok); diff --git a/cli/delete-user.php b/cli/delete-user.php new file mode 100755 index 000000000..6f0e86e17 --- /dev/null +++ b/cli/delete-user.php @@ -0,0 +1,32 @@ +#!/usr/bin/php +<?php +require('_cli.php'); + +$options = getopt('', array( + 'user:', + )); + +if (empty($options['user'])) { + fail('Usage: ' . basename(__FILE__) . " --user username"); +} +$username = $options['user']; +if (!ctype_alnum($username)) { + fail('FreshRSS error: invalid username “' . $username . '”'); +} + +$usernames = listUsers(); +if (!preg_grep("/^$username$/i", $usernames)) { + fail('FreshRSS error: username not found “' . $username . '”'); +} + +if (strcasecmp($username, FreshRSS_Context::$system_conf->default_user) === 0) { + fail('FreshRSS error: default user must not be deleted: “' . $username . '”'); +} + +echo 'FreshRSS deleting user “', $username, "”…\n"; + +$ok = FreshRSS_user_Controller::deleteUser($username); + +invalidateHttpCache(FreshRSS_Context::$system_conf->default_user); + +done($ok); diff --git a/cli/do-install.php b/cli/do-install.php new file mode 100755 index 000000000..100d4947f --- /dev/null +++ b/cli/do-install.php @@ -0,0 +1,101 @@ +#!/usr/bin/php +<?php +require('_cli.php'); +require(LIB_PATH . '/lib_install.php'); + +$params = array( + 'environment:', + 'base_url:', + 'title:', + 'default_user:', + 'allow_anonymous', + 'allow_anonymous_refresh', + 'auth_type:', + 'api_enabled', + 'allow_robots', + ); + +$dBparams = array( + 'db-type:', + 'db-host:', + 'db-user:', + 'db-password:', + 'db-base:', + 'db-prefix:', + ); + +$options = getopt('', array_merge($params, $dBparams)); + +if (empty($options['default_user'])) { + fail('Usage: ' . basename(__FILE__) . " --default_user admin ( --auth_type form" . + " --environment production --base_url https://rss.example.net/" . + " --title FreshRSS --allow_anonymous --api_enabled" . + " --db-type mysql --db-host localhost:3306 --db-user freshrss --db-password dbPassword123" . + " --db-base freshrss --db-prefix freshrss_ )"); +} + +fwrite(STDERR, 'FreshRSS install…' . "\n"); + +$requirements = checkRequirements(); +if ($requirements['all'] !== 'ok') { + $message = 'FreshRSS install failed requirements:' . "\n"; + foreach ($requirements as $requirement => $check) { + if ($check !== 'ok' && $requirement !== 'all') { + $message .= '• ' . $requirement . "\n"; + } + } + fail($message); +} + +if (!ctype_alnum($options['default_user'])) { + fail('FreshRSS invalid default username (must be ASCII alphanumeric): ' . $options['default_user']); +} + +if (isset($options['auth_type']) && !in_array($options['auth_type'], array('form', 'http_auth', 'none'))) { + fail('FreshRSS invalid authentication method (auth_type must be one of { form, http_auth, none }: ' . $options['auth_type']); +} + +$config = array( + 'salt' => generateSalt(), + 'db' => FreshRSS_Context::$system_conf->db, + ); + +foreach ($params as $param) { + $param = rtrim($param, ':'); + if (isset($options[$param])) { + $config[$param] = $options[$param] === false ? true : $options[$param]; + } +} + +if ((!empty($config['base_url'])) && server_is_public($config['base_url'])) { + $config['pubsubhubbub_enabled'] = true; +} + +foreach ($dBparams as $dBparam) { + $dBparam = rtrim($dBparam, ':'); + if (!empty($options[$dBparam])) { + $param = substr($dBparam, strlen('db-')); + $config['db'][$param] = $options[$dBparam]; + } +} + +if (file_put_contents(join_path(DATA_PATH, 'config.php'), "<?php\n return " . var_export($config, true) . ";\n") === false) { + fail('FreshRSS could not write configuration file!: ' . join_path(DATA_PATH, 'config.php')); +} + +$config['db']['default_user'] = $config['default_user']; +if (!checkDb($config['db'])) { + @unlink(join_path(DATA_PATH, 'config.php')); + fail('FreshRSS database error: ' . (empty($config['db']['error']) ? 'Unknown error' : $config['db']['error'])); +} + +echo '• Remember to create the default user: ', $config['default_user'] , "\n", + "\t", './cli/create-user.php --user ', $config['default_user'], " --password 'password' --more-options\n"; + +accessRights(); + +if (!deleteInstall()) { + fail('FreshRSS access right problem while deleting install file!'); +} + +done(); diff --git a/cli/export-opml-for-user.php b/cli/export-opml-for-user.php new file mode 100755 index 000000000..95b12281f --- /dev/null +++ b/cli/export-opml-for-user.php @@ -0,0 +1,24 @@ +#!/usr/bin/php +<?php +require('_cli.php'); + +$options = getopt('', array( + 'user:', + )); + +if (empty($options['user'])) { + fail('Usage: ' . basename(__FILE__) . " --user username > /path/to/file.opml.xml"); +} + +$username = cliInitUser($options['user']); + +fwrite(STDERR, 'FreshRSS exporting OPML for user “' . $username . "”…\n"); + +$importController = new FreshRSS_importExport_Controller(); + +$ok = false; +$ok = $importController->exportFile(true, false, array(), 0, $username); + +invalidateHttpCache($username); + +done($ok); diff --git a/cli/export-zip-for-user.php b/cli/export-zip-for-user.php new file mode 100755 index 000000000..92fe9bf9a --- /dev/null +++ b/cli/export-zip-for-user.php @@ -0,0 +1,30 @@ +#!/usr/bin/php +<?php +require('_cli.php'); + +$options = getopt('', array( + 'user:', + 'max-feed-entries:', + )); + +if (empty($options['user'])) { + fail('Usage: ' . basename(__FILE__) . " --user username ( --max-feed-entries 100 ) > /path/to/file.zip"); +} + +$username = cliInitUser($options['user']); + +fwrite(STDERR, 'FreshRSS exporting ZIP for user “' . $username . "”…\n"); + +$importController = new FreshRSS_importExport_Controller(); + +$ok = false; +try { + $ok = $importController->exportFile(true, true, true, + empty($options['max-feed-entries']) ? 100 : intval($options['max-feed-entries']), + $username); +} catch (FreshRSS_ZipMissing_Exception $zme) { + fail('FreshRSS error: Lacking php-zip extension!'); +} +invalidateHttpCache($username); + +done($ok); diff --git a/cli/import-for-user.php b/cli/import-for-user.php new file mode 100755 index 000000000..29084f062 --- /dev/null +++ b/cli/import-for-user.php @@ -0,0 +1,35 @@ +#!/usr/bin/php +<?php +require('_cli.php'); + +$options = getopt('', array( + 'user:', + 'filename:', + )); + +if (empty($options['user']) || empty($options['filename'])) { + fail('Usage: ' . basename(__FILE__) . " --user username --filename /path/to/file.ext"); +} + +$username = cliInitUser($options['user']); + +$filename = $options['filename']; +if (!is_readable($filename)) { + fail('FreshRSS error: file is not readable “' . $filename . '”'); +} + +echo 'FreshRSS importing ZIP/OPML/JSON for user “', $username, "”…\n"; + +$importController = new FreshRSS_importExport_Controller(); + +$ok = false; +try { + $ok = $importController->importFile($filename, $filename, $username); +} catch (FreshRSS_ZipMissing_Exception $zme) { + fail('FreshRSS error: Lacking php-zip extension!'); +} catch (FreshRSS_Zip_Exception $ze) { + fail('FreshRSS error: ZIP archive cannot be imported! Error code: ' . $ze->zipErrorCode()); +} +invalidateHttpCache($username); + +done($ok); diff --git a/data/log/index.html b/cli/index.html index 85faaa37e..85faaa37e 100644 --- a/data/log/index.html +++ b/cli/index.html diff --git a/cli/list-users.php b/cli/list-users.php new file mode 100755 index 000000000..e690ff451 --- /dev/null +++ b/cli/list-users.php @@ -0,0 +1,14 @@ +#!/usr/bin/php +<?php +require('_cli.php'); + +$users = listUsers(); +sort($users); +if (FreshRSS_Context::$system_conf->default_user !== '') { + array_unshift($users, FreshRSS_Context::$system_conf->default_user); + $users = array_unique($users); +} + +foreach ($users as $user) { + echo $user, "\n"; +} diff --git a/cli/user-info.php b/cli/user-info.php new file mode 100755 index 000000000..dd38e6c7f --- /dev/null +++ b/cli/user-info.php @@ -0,0 +1,35 @@ +#!/usr/bin/php +<?php +require('_cli.php'); + +$options = getopt('h', array( + 'user:', + )); + +if (empty($options['user'])) { + fail('Usage: ' . basename(__FILE__) . " -h --user username"); +} + +$users = $options['user'] === '*' ? listUsers() : array($options['user']); + +foreach ($users as $username) { + $username = cliInitUser($username); + + $entryDAO = FreshRSS_Factory::createEntryDao($username); + + echo $username === FreshRSS_Context::$system_conf->default_user ? '*' : ' ', "\t"; + + if (isset($options['h'])) { //Human format + echo + $username, "\t", + date('c', FreshRSS_UserDAO::mtime($username)), "\t", + format_bytes($entryDAO->size()), "\t", + "\n"; + } else { + echo + $username, "\t", + FreshRSS_UserDAO::mtime($username), "\t", + $entryDAO->size(), "\t", + "\n"; + } +} diff --git a/constants.php b/constants.php index 6af1c5738..cb00839e2 100644 --- a/constants.php +++ b/constants.php @@ -1,20 +1,27 @@ <?php -define('FRESHRSS_VERSION', '0.7.1'); +define('FRESHRSS_VERSION', '1.6.2'); define('FRESHRSS_WEBSITE', 'http://freshrss.org'); +define('FRESHRSS_WIKI', 'http://doc.freshrss.org'); + +// PHP text output compression http://php.net/ob_gzhandler (better to do it at Web server level) +define('PHP_COMPRESSION', false); // Constantes de chemins define('FRESHRSS_PATH', dirname(__FILE__)); define('PUBLIC_PATH', FRESHRSS_PATH . '/p'); - define('INDEX_PATH', PUBLIC_PATH . '/i'); + define('PUBLIC_TO_INDEX_PATH', '/i'); + define('INDEX_PATH', PUBLIC_PATH . PUBLIC_TO_INDEX_PATH); define('PUBLIC_RELATIVE', '..'); define('DATA_PATH', FRESHRSS_PATH . '/data'); - define('LOG_PATH', DATA_PATH . '/log'); + define('UPDATE_FILENAME', DATA_PATH . '/update.php'); + define('USERS_PATH', DATA_PATH . '/users'); define('CACHE_PATH', DATA_PATH . '/cache'); + define('PSHB_PATH', DATA_PATH . '/PubSubHubbub'); define('LIB_PATH', FRESHRSS_PATH . '/lib'); - define('APP_PATH', FRESHRSS_PATH . '/app'); + define('APP_PATH', FRESHRSS_PATH . '/app'); + define('EXTENSIONS_PATH', FRESHRSS_PATH . '/extensions'); -//define('TMP_PATH', sys_get_temp_dir()); // need more tests so... -define('TMP_PATH', DATA_PATH); // ... we use DATA_PATH for the 0.7.1 +define('TMP_PATH', sys_get_temp_dir()); diff --git a/data/.gitignore b/data/.gitignore index afb16d9aa..76314fc12 100644 --- a/data/.gitignore +++ b/data/.gitignore @@ -1,8 +1,6 @@ -application.ini config.php -*_user.php -*.sqlite -touch.txt +config.php.bak.php +force-https.txt +last_update.txt no-cache.txt -*.bak.php -*.lock.txt +update.php diff --git a/data/PubSubHubbub/feeds/.gitignore b/data/PubSubHubbub/feeds/.gitignore new file mode 100644 index 000000000..d8f9df042 --- /dev/null +++ b/data/PubSubHubbub/feeds/.gitignore @@ -0,0 +1,3 @@ +*/ +*/*.json +*/*.txt diff --git a/data/PubSubHubbub/feeds/README.md b/data/PubSubHubbub/feeds/README.md new file mode 100644 index 000000000..a01a3197f --- /dev/null +++ b/data/PubSubHubbub/feeds/README.md @@ -0,0 +1,7 @@ +List of canonical URLS of the various feeds users have subscribed to. +Several users can have subscribed to the same feed. + +* ./base64url(canonicalUrl)/ + * ./!hub.json + * ./user1.txt + * ./user2.txt diff --git a/data/PubSubHubbub/keys/.gitignore b/data/PubSubHubbub/keys/.gitignore new file mode 100644 index 000000000..2211df63d --- /dev/null +++ b/data/PubSubHubbub/keys/.gitignore @@ -0,0 +1 @@ +*.txt diff --git a/data/PubSubHubbub/keys/README.md b/data/PubSubHubbub/keys/README.md new file mode 100644 index 000000000..bb1e57cd4 --- /dev/null +++ b/data/PubSubHubbub/keys/README.md @@ -0,0 +1,4 @@ +List of keys given to PubSubHubbub hubs + +* ./sha1(random + salt).txt + * base64url(canonicalUrl) diff --git a/data/config.default.php b/data/config.default.php new file mode 100644 index 000000000..433207a9c --- /dev/null +++ b/data/config.default.php @@ -0,0 +1,149 @@ +<?php + +# Do not modify this file, which defines default values, +# but edit `config.php` instead, after the install process is completed. +return array( + + # Set to `development` to get additional error messages, + # or to `production` to get only the most important messages. + 'environment' => 'production', + + # Used to make crypto more unique. Generated during install. + 'salt' => '', + + # Specify address of the FreshRSS instance, + # used when building absolute URLs, e.g. for PubSubHubbub. + # Examples: + # https://example.net/FreshRSS/p/ + # https://freshrss.example.net/ + 'base_url' => '', + + # Specify address of the FreshRSS auto-update server. + 'auto_update_url' => 'https://update.freshrss.org', + + # Natural language of the user interface, e.g. `en`, `fr`. + 'language' => 'en', + + # Title of this FreshRSS instance in the Web user interface. + 'title' => 'FreshRSS', + + # Meta description used when `allow_robots` is true. + 'meta_description' => '', + + # Name of the user that has administration rights. + 'default_user' => '_', + + # Allow or not visitors without login to see the articles + # of the default user. + 'allow_anonymous' => false, + + # Allow or not anonymous users to start the refresh process. + 'allow_anonymous_refresh' => false, + + # Login method: + # `none` is without password and shows only the default user; + # `form` is a conventional Web login form; + # `http_auth` is an access controled by the HTTP Web server (e.g. `/FreshRSS/p/i/.htaccess` for Apache) + # if you use `http_auth`, remember to protect only `/FreshRSS/p/i/`, + # and in particular not protect `/FreshRSS/p/api/` if you would like to use the API (different login system). + 'auth_type' => 'form', + + # Allow or not the use of the API, used for mobile apps. + # End-point is http://example.net/FreshRSS/p/api/greader.php + # You need to set the user's API password. + 'api_enabled' => false, + + # Allow or not the use of an unsafe login, + # by providing username and password in the login URL: + # http://example.net/FreshRSS/p/i/?c=auth&a=login&u=alice&p=1234 + 'unsafe_autologin_enabled' => false, + + # Enable or not the use of syslog to log the activity of + # SimplePie, which is retrieving RSS feeds via HTTP requests. + 'simplepie_syslog_enabled' => true, + + # Enable or not support of PubSubHubbub. + # /!\ It should NOT be enabled if base_url is not reachable by an external server. + 'pubsubhubbub_enabled' => false, + + # Allow or not Web robots (e.g. search engines) in HTML headers. + 'allow_robots' => false, + + # If true does nothing, if false restricts HTTP Referer via: meta referrer origin + 'allow_referrer' => false, + + 'limits' => array( + + # Duration in seconds of the login cookie. + 'cookie_duration' => 2592000, + + # Duration in seconds of the SimplePie cache, + # during which a query to the RSS feed will return the local cached version. + # Especially important for multi-user setups. + 'cache_duration' => 800, + + # SimplePie HTTP request timeout in seconds. + 'timeout' => 15, + + # If a user has not used FreshRSS for more than x seconds, + # then its feeds are not refreshed anymore. + 'max_inactivity' => PHP_INT_MAX, + + # Max number of feeds for a user. + 'max_feeds' => 16384, + + # Max number of categories for a user. + 'max_categories' => 16384, + + # Max number of accounts that anonymous users can create + # 0 for an unlimited number of accounts + # 1 is to not allow user registrations (1 is corresponding to the admin account) + 'max_registrations' => 1, + ), + + # Options used by cURL when making HTTP requests, e.g. when the SimplePie library retrieves feeds. + # http://php.net/manual/function.curl-setopt + 'curl_options' => array( + # Options to disable SSL/TLS certificate check (e.g. for self-signed HTTPS) + //CURLOPT_SSL_VERIFYHOST => 0, + //CURLOPT_SSL_VERIFYPEER => false, + + # Options to use a proxy for retrieving feeds. + //CURLOPT_PROXYTYPE => CURLPROXY_HTTP, + //CURLOPT_PROXY => '127.0.0.1', + //CURLOPT_PROXYPORT => 8080, + //CURLOPT_PROXYAUTH => CURLAUTH_BASIC, + //CURLOPT_PROXYUSERPWD => 'user:password', + ), + + 'db' => array( + + # Type of database: `sqlite` or `mysql`. + 'type' => 'sqlite', + + # MySQL host. + 'host' => 'localhost', + + # MySQL user. + 'user' => '', + + # MySQL password. + 'password' => '', + + # MySQL database. + 'base' => '', + + # MySQL table prefix. + 'prefix' => 'freshrss_', + + 'pdo_options' => array( + //PDO::MYSQL_ATTR_SSL_KEY => '/path/to/client-key.pem', + //PDO::MYSQL_ATTR_SSL_CERT => '/path/to/client-cert.pem', + //PDO::MYSQL_ATTR_SSL_CA => '/path/to/ca-cert.pem', + ), + + ), + + # List of enabled FreshRSS extensions. + 'extensions_enabled' => array(), +); diff --git a/data/do-install.txt b/data/do-install.txt new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/data/do-install.txt diff --git a/data/force-https.default.txt b/data/force-https.default.txt new file mode 100644 index 000000000..044620098 --- /dev/null +++ b/data/force-https.default.txt @@ -0,0 +1,7 @@ +dailymotion.com +feedburner.com +gravatar.com +gstatic.com +tumblr.com +wordpress.com +youtube.com diff --git a/data/log/.gitignore b/data/log/.gitignore deleted file mode 100644 index bf0824e59..000000000 --- a/data/log/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.log
\ No newline at end of file diff --git a/data/persona/.gitignore b/data/persona/.gitignore deleted file mode 100644 index 314f02b1b..000000000 --- a/data/persona/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.txt
\ No newline at end of file diff --git a/data/shares.php b/data/shares.php new file mode 100644 index 000000000..1295a26ac --- /dev/null +++ b/data/shares.php @@ -0,0 +1,92 @@ +<?php + +/* + * This is a configuration file. You shouldn't modify it unless you know what + * you are doing. If you want to add a share type, this is where you need to do + * it. + * + * For each share there is different configuration options. Here is the description + * of those options: + * - url is a mandatory option. It is a string representing the share URL. It + * supports 3 different placeholders for custom data. The ~URL~ placeholder + * represents the URL of the system used to share, it is configured by the + * user. The ~LINK~ placeholder represents the link of the shared article. + * The ~TITLE~ placeholder represents the title of the shared article. + * - transform is an array of transformation to apply on links and titles + * - help is a URL to a help page + */ + +return array( + 'shaarli' => array( + 'url' => '~URL~?post=~LINK~&title=~TITLE~&source=FreshRSS', + 'transform' => array('rawurlencode'), + 'help' => 'http://sebsauvage.net/wiki/doku.php?id=php:shaarli', + 'form' => 'advanced', + ), + 'blogotext' => array( + 'url' => '~URL~/admin/links.php?url=~LINK~', + 'transform' => array(), + 'help' => 'http://lehollandaisvolant.net/blogotext/fr/', + 'form' => 'advanced', + ), + 'wallabag' => array( + 'url' => '~URL~?action=add&url=~LINK~', + 'transform' => array( + 'link' => array('base64_encode'), + 'title' => array(), + ), + 'help' => 'http://www.wallabag.org/', + 'form' => 'advanced', + ), + 'wallabagv2' => array( + 'url' => '~URL~/bookmarklet?url=~LINK~', + 'transform' => array( + 'link' => array('rawurlencode'), + 'title' => array(), + ), + 'help' => 'http://www.wallabag.org/', + 'form' => 'advanced', + ), + 'diaspora' => array( + 'url' => '~URL~/bookmarklet?url=~LINK~&title=~TITLE~', + 'transform' => array('rawurlencode'), + 'help' => 'https://diasporafoundation.org/', + 'form' => 'advanced', + ), + 'movim' => array( + 'url' => '~URL~/?share/~LINK~', + 'transform' => array('rawurlencode', 'urlencode'), + 'help' => 'https://github.com/edhelas/movim', + 'form' => 'advanced', + ), + 'twitter' => array( + 'url' => 'https://twitter.com/share?url=~LINK~&text=~TITLE~', + 'transform' => array('rawurlencode'), + 'form' => 'simple', + ), + 'g+' => array( + 'url' => 'https://plus.google.com/share?url=~LINK~', + 'transform' => array('rawurlencode'), + 'form' => 'simple', + ), + 'facebook' => array( + 'url' => 'https://www.facebook.com/sharer.php?u=~LINK~&t=~TITLE~', + 'transform' => array('rawurlencode'), + 'form' => 'simple', + ), + 'email' => array( + 'url' => 'mailto:?subject=~TITLE~&body=~LINK~', + 'transform' => array('rawurlencode'), + 'form' => 'simple', + ), + 'print' => array( + 'url' => '#', + 'transform' => array(), + 'form' => 'simple', + ), + 'jdh' => array( + 'url' => 'https://www.journalduhacker.net/stories/new?url=~LINK~&title=~TITLE~', + 'transform' => array('rawurlencode'), + 'form' => 'simple', + ), +); diff --git a/data/tokens/.gitignore b/data/tokens/.gitignore new file mode 100644 index 000000000..2211df63d --- /dev/null +++ b/data/tokens/.gitignore @@ -0,0 +1 @@ +*.txt diff --git a/data/persona/index.html b/data/tokens/index.html index 85faaa37e..85faaa37e 100644 --- a/data/persona/index.html +++ b/data/tokens/index.html diff --git a/data/users/.gitignore b/data/users/.gitignore new file mode 100644 index 000000000..3705c06b7 --- /dev/null +++ b/data/users/.gitignore @@ -0,0 +1,5 @@ +*/ +*/config.php +*/db.sqlite +!_/ +*/log*.txt diff --git a/data/users/_/config.default.php b/data/users/_/config.default.php new file mode 100644 index 000000000..f28ef9724 --- /dev/null +++ b/data/users/_/config.default.php @@ -0,0 +1,75 @@ +<?php + +return array ( + 'language' => 'en', + 'old_entries' => 3, + 'keep_history_default' => 50, + 'ttl_default' => 3600, + 'mail_login' => '', + 'token' => '', + 'passwordHash' => '', + 'apiPasswordHash' => '', + 'posts_per_page' => 20, + 'since_hours_posts_per_rss' => 168, + 'min_posts_per_rss' => 2, + 'max_posts_per_rss' => 400, + 'view_mode' => 'normal', + 'default_view' => 'adaptive', + 'default_state' => FreshRSS_Entry::STATE_NOT_READ, + 'auto_load_more' => true, + 'display_posts' => false, + 'display_categories' => false, + 'hide_read_feeds' => true, + 'onread_jump_next' => true, + 'lazyload' => true, + 'sticky_post' => true, + 'reading_confirm' => false, + 'auto_remove_article' => false, + + # In the case an article has changed (e.g. updated content): + # Set to `true` to mark it unread, or `false` to leave it as-is. + 'mark_updated_article_unread' => false, //TODO: -1 => ignore, 0 => update, 1 => update and mark as unread + + 'sort_order' => 'DESC', + 'anon_access' => false, + 'mark_when' => array ( + 'article' => true, + 'site' => true, + 'scroll' => true, + 'reception' => false, + ), + 'theme' => 'Origine', + 'content_width' => 'thin', + 'shortcuts' => array ( + 'mark_read' => 'r', + 'mark_favorite' => 'f', + 'go_website' => 'space', + 'next_entry' => 'j', + 'prev_entry' => 'k', + 'first_entry' => 'home', + 'last_entry' => 'end', + 'collapse_entry' => 'c', + 'load_more' => 'm', + 'auto_share' => 's', + 'focus_search' => 'a', + 'user_filter' => 'u', + 'help' => 'f1', + 'close_dropdown' => 'escape', + ), + 'topline_read' => true, + 'topline_favorite' => true, + 'topline_date' => true, + 'topline_link' => true, + 'bottomline_read' => true, + 'bottomline_favorite' => true, + 'bottomline_sharing' => true, + 'bottomline_tags' => true, + 'bottomline_date' => true, + 'bottomline_link' => true, + 'sharing' => array ( + ), + 'queries' => array ( + ), + 'html5_notif_timeout' => 0, + 'extensions_enabled' => array(), +); diff --git a/data/users/index.html b/data/users/index.html new file mode 100644 index 000000000..85faaa37e --- /dev/null +++ b/data/users/index.html @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB"> +<head> +<meta charset="UTF-8" /> +<meta http-equiv="Refresh" content="0; url=/" /> +<title>Redirection</title> +<meta name="robots" content="noindex" /> +</head> + +<body> +<p><a href="/">Redirection</a></p> +</body> +</html> diff --git a/doc/FreshRSS-logo.png b/doc/FreshRSS-logo.png Binary files differnew file mode 100644 index 000000000..763b19cb1 --- /dev/null +++ b/doc/FreshRSS-logo.png diff --git a/doc/FreshRSS-screenshot.png b/doc/FreshRSS-screenshot.png Binary files differnew file mode 100644 index 000000000..2bcd6e6bf --- /dev/null +++ b/doc/FreshRSS-screenshot.png diff --git a/extensions/.gitignore b/extensions/.gitignore new file mode 100644 index 000000000..cd5592022 --- /dev/null +++ b/extensions/.gitignore @@ -0,0 +1 @@ +[xX]* diff --git a/extensions/README.md b/extensions/README.md new file mode 100644 index 000000000..62766d6f2 --- /dev/null +++ b/extensions/README.md @@ -0,0 +1,5 @@ +# FreshRSS extensions + +You may place custom extensions for FreshRSS in this directory. + +You can find some extensions in our [GitHub repository](https://github.com/FreshRSS/Extensions). diff --git a/index.html b/index.html index 6ac025960..5414211a1 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ <meta charset="UTF-8" /> <meta http-equiv="Refresh" content="0; url=p/" /> <title>Redirection</title> -<meta name="robots" content="noindex,nofollow" /> +<meta name="robots" content="noindex" /> </head> <body> diff --git a/lib/Favicon/DataAccess.php b/lib/Favicon/DataAccess.php new file mode 100644 index 000000000..ae7509881 --- /dev/null +++ b/lib/Favicon/DataAccess.php @@ -0,0 +1,41 @@ +<?php + +namespace Favicon; + +/** + * DataAccess is a wrapper used to read/write data locally or remotly + * Aside from SOLID principles, this wrapper is also useful to mock remote resources in unit tests + * Note: remote access warning are silenced because we don't care if a website is unreachable + **/ +class DataAccess { + public function retrieveUrl($url) { + $this->set_context(); + return @file_get_contents($url); + } + + public function retrieveHeader($url) { + $this->set_context(); + $headers = @get_headers($url, 1); + return $headers ? array_change_key_case($headers) : array(); + } + + public function saveCache($file, $data) { + file_put_contents($file, $data); + } + + public function readCache($file) { + return file_get_contents($file); + } + + private function set_context() { + stream_context_set_default( + array( + 'http' => array( + 'method' => 'GET', + 'timeout' => 10, + 'header' => "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:20.0; Favicon; +https://github.com/ArthurHoaro/favicon) Gecko/20100101 Firefox/32.0\r\n", + ) + ) + ); + } +}
\ No newline at end of file diff --git a/lib/Favicon/Favicon.php b/lib/Favicon/Favicon.php new file mode 100644 index 000000000..1912050d6 --- /dev/null +++ b/lib/Favicon/Favicon.php @@ -0,0 +1,293 @@ +<?php + +namespace Favicon; + +class Favicon +{ + protected $url = ''; + protected $cacheDir; + protected $cacheTimeout; + protected $dataAccess; + + public function __construct($args = array()) + { + if (isset($args['url'])) { + $this->url = $args['url']; + } + + $this->cacheDir = __DIR__ . '/../../resources/cache'; + $this->dataAccess = new DataAccess(); + } + + public function cache($args = array()) { + if (isset($args['dir'])) { + $this->cacheDir = $args['dir']; + } + + if (!empty($args['timeout'])) { + $this->cacheTimeout = $args['timeout']; + } else { + $this->cacheTimeout = 0; + } + } + + public static function baseUrl($url, $path = false) + { + $return = ''; + + if (!$url = parse_url($url)) { + return FALSE; + } + + // Scheme + $scheme = isset($url['scheme']) ? strtolower($url['scheme']) : null; + if ($scheme != 'http' && $scheme != 'https') { + + return FALSE; + } + $return .= "{$scheme}://"; + + // Username and password + if (isset($url['user'])) { + $return .= $url['user']; + if (isset($url['pass'])) { + $return .= ":{$url['pass']}"; + } + $return .= '@'; + } + + // Hostname + if( !isset($url['host']) ) { + return FALSE; + } + + $return .= $url['host']; + + // Port + if (isset($url['port'])) { + $return .= ":{$url['port']}"; + } + + // Path + if( $path && isset($url['path']) ) { + $return .= $url['path']; + } + $return .= '/'; + + return $return; + } + + public function info($url) + { + if(empty($url) || $url === false) { + return false; + } + + $max_loop = 5; + + // Discover real status by following redirects. + $loop = TRUE; + while ($loop && $max_loop-- > 0) { + $headers = $this->dataAccess->retrieveHeader($url); + $exploded = explode(' ', $headers[0]); + + if( !isset($exploded[1]) ) { + return false; + } + list(,$status) = $exploded; + + switch ($status) { + case '301': + case '302': + $url = isset($headers['location']) ? $headers['location'] : ''; + break; + default: + $loop = FALSE; + break; + } + } + + return array('status' => $status, 'url' => $url); + } + + public function endRedirect($url) { + $out = $this->info($url); + return !empty($out['url']) ? $out['url'] : false; + } + + /** + * Find remote (or cached) favicon + * @return favicon URL, false if nothing was found + **/ + public function get($url = '') + { + // URLs passed to this method take precedence. + if (!empty($url)) { + $this->url = $url; + } + + // Get the base URL without the path for clearer concatenations. + $original = rtrim($this->baseUrl($this->url, true), '/'); + $url = rtrim($this->endRedirect($this->baseUrl($this->url, false)), '/'); + + if(($favicon = $this->checkCache($url)) || ($favicon = $this->getFavicon($url))) { + $base = true; + } + elseif(($favicon = $this->checkCache($original)) || ($favicon = $this->getFavicon($original, false))) { + $base = false; + } + else + return false; + + // Save cache if necessary + $cache = $this->cacheDir . '/' . md5($base ? $url : $original); + if ($this->cacheTimeout && !file_exists($cache) || (is_writable($cache) && time() - filemtime($cache) > $this->cacheTimeout)) { + $this->dataAccess->saveCache($cache, $favicon); + } + + return $favicon; + } + + private function getFavicon($url, $checkDefault = true) { + $favicon = false; + + if(empty($url)) { + return false; + } + + // Try /favicon.ico first. + if( $checkDefault ) { + $info = $this->info("{$url}/favicon.ico"); + if ($info['status'] == '200') { + $favicon = $info['url']; + } + } + + // See if it's specified in a link tag in domain url. + if (!$favicon) { + $favicon = $this->getInPage($url); + } + + // Make sure the favicon is an absolute URL. + if( $favicon && filter_var($favicon, FILTER_VALIDATE_URL) === false ) { + $favicon = $url . '/' . $favicon; + } + + // Sometimes people lie, so check the status. + // And sometimes, it's not even an image. Sneaky bastards! + // If cacheDir isn't writable, that's not our problem + if ($favicon && is_writable($this->cacheDir) && !$this->checkImageMType($favicon)) { + $favicon = false; + } + + return $favicon; + } + + private function getInPage($url) { + $html = $this->dataAccess->retrieveUrl("{$url}/"); + preg_match('!<head.*?>.*</head>!ims', $html, $match); + + if(empty($match) || count($match) == 0) { + return false; + } + + $head = $match[0]; + + $dom = new \DOMDocument(); + // Use error supression, because the HTML might be too malformed. + if (@$dom->loadHTML($head)) { + $links = $dom->getElementsByTagName('link'); + foreach ($links as $link) { + if ($link->hasAttribute('rel') && strtolower($link->getAttribute('rel')) == 'shortcut icon') { + return $link->getAttribute('href'); + } elseif ($link->hasAttribute('rel') && strtolower($link->getAttribute('rel')) == 'icon') { + return $link->getAttribute('href'); + } elseif ($link->hasAttribute('href') && strpos($link->getAttribute('href'), 'favicon') !== FALSE) { + return $link->getAttribute('href'); + } + } + } + return false; + } + + private function checkCache($url) { + if ($this->cacheTimeout) { + $cache = $this->cacheDir . '/' . md5($url); + if (file_exists($cache) && is_readable($cache) && (time() - filemtime($cache) < $this->cacheTimeout)) { + return $this->dataAccess->readCache($cache); + } + } + return false; + } + + private function checkImageMType($url) { + $tmpFile = $this->cacheDir . '/tmp.ico'; + + $fileContent = $this->dataAccess->retrieveUrl($url); + $this->dataAccess->saveCache($tmpFile, $fileContent); + + $finfo = finfo_open(FILEINFO_MIME_TYPE); + $isImage = strpos(finfo_file($finfo, $tmpFile), 'image') !== false; + finfo_close($finfo); + + unlink($tmpFile); + + return $isImage; + } + + /** + * @return mixed + */ + public function getCacheDir() + { + return $this->cacheDir; + } + + /** + * @param mixed $cacheDir + */ + public function setCacheDir($cacheDir) + { + $this->cacheDir = $cacheDir; + } + + /** + * @return mixed + */ + public function getCacheTimeout() + { + return $this->cacheTimeout; + } + + /** + * @param mixed $cacheTimeout + */ + public function setCacheTimeout($cacheTimeout) + { + $this->cacheTimeout = $cacheTimeout; + } + + /** + * @return string + */ + public function getUrl() + { + return $this->url; + } + + /** + * @param string $url + */ + public function setUrl($url) + { + $this->url = $url; + } + + /** + * @param DataAccess $dataAccess + */ + public function setDataAccess($dataAccess) + { + $this->dataAccess = $dataAccess; + } +} diff --git a/lib/Minz/ActionController.php b/lib/Minz/ActionController.php index 409d9611f..b47c54554 100644 --- a/lib/Minz/ActionController.php +++ b/lib/Minz/ActionController.php @@ -8,16 +8,12 @@ * La classe ActionController représente le contrôleur de l'application */ class Minz_ActionController { - protected $router; protected $view; /** * Constructeur - * @param $controller nom du controller - * @param $action nom de l'action à lancer */ - public function __construct ($router) { - $this->router = $router; + public function __construct () { $this->view = new Minz_View (); $this->view->attributeParams (); } diff --git a/lib/Minz/BadConfigurationException.php b/lib/Minz/BadConfigurationException.php deleted file mode 100644 index a7b77d687..000000000 --- a/lib/Minz/BadConfigurationException.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php -class Minz_BadConfigurationException extends Minz_Exception { - public function __construct ($part_missing, $code = self::ERROR) { - $message = '`' . $part_missing - . '` in the configuration file is missing or is misconfigured'; - - parent::__construct ($message, $code); - } -} diff --git a/lib/Minz/Cache.php b/lib/Minz/Cache.php deleted file mode 100644 index fcb627eb2..000000000 --- a/lib/Minz/Cache.php +++ /dev/null @@ -1,116 +0,0 @@ -<?php -/** - * MINZ - Copyright 2011 Marien Fressinaud - * Sous licence AGPL3 <http://www.gnu.org/licenses/> -*/ - -/** - * La classe Cache permet de gérer facilement les pages en cache - */ -class Minz_Cache { - /** - * $expire timestamp auquel expire le cache de $url - */ - private $expire = 0; - - /** - * $file est le nom du fichier de cache - */ - private $file = ''; - - /** - * $enabled permet de déterminer si le cache est activé - */ - private static $enabled = true; - - /** - * Constructeur - */ - public function __construct () { - $this->_fileName (); - $this->_expire (); - } - - /** - * Setteurs - */ - public function _fileName () { - $file = md5 (Minz_Request::getURI ()); - - $this->file = CACHE_PATH . '/'.$file; - } - - public function _expire () { - if ($this->exist ()) { - $this->expire = filemtime ($this->file) - + Minz_Configuration::delayCache (); - } - } - - /** - * Permet de savoir si le cache est activé - * @return true si activé, false sinon - */ - public static function isEnabled () { - return Minz_Configuration::cacheEnabled () && self::$enabled; - } - - /** - * Active / désactive le cache - */ - public static function switchOn () { - self::$enabled = true; - } - public static function switchOff () { - self::$enabled = false; - } - - /** - * Détermine si le cache de $url a expiré ou non - * @return true si il a expiré, false sinon - */ - public function expired () { - return time () > $this->expire; - } - - /** - * Affiche le contenu du cache - * @print le code html du cache - */ - public function render () { - if ($this->exist ()) { - include ($this->file); - } - } - - /** - * Enregistre $html en cache - * @param $html le html à mettre en cache - */ - public function cache ($html) { - file_put_contents ($this->file, $html); - } - - /** - * Permet de savoir si le cache existe - * @return true si il existe, false sinon - */ - public function exist () { - return file_exists ($this->file); - } - - /** - * Nettoie le cache en supprimant tous les fichiers - */ - public static function clean () { - $files = opendir (CACHE_PATH); - - while ($fic = readdir ($files)) { - if ($fic != '.' && $fic != '..') { - unlink (CACHE_PATH.'/'.$fic); - } - } - - closedir ($files); - } -} diff --git a/lib/Minz/Configuration.php b/lib/Minz/Configuration.php index b3de9e39e..d695d4a53 100644 --- a/lib/Minz/Configuration.php +++ b/lib/Minz/Configuration.php @@ -1,357 +1,215 @@ <?php -/** - * MINZ - Copyright 2011 Marien Fressinaud - * Sous licence AGPL3 <http://www.gnu.org/licenses/> -*/ /** - * La classe Configuration permet de gérer la configuration de l'application + * Manage configuration for the application. */ class Minz_Configuration { - const CONF_PATH_NAME = '/config.php'; - /** - * VERSION est la version actuelle de MINZ + * The list of configurations. */ - const VERSION = '1.3.1.freshrss'; // version spéciale FreshRSS + private static $config_list = array(); /** - * valeurs possibles pour l'"environment" - * SILENT rend l'application muette (pas de log) - * PRODUCTION est recommandée pour une appli en production - * (log les erreurs critiques) - * DEVELOPMENT log toutes les erreurs + * Add a new configuration to the list of configuration. + * + * @param $namespace the name of the current configuration + * @param $config_filename the filename of the configuration + * @param $default_filename a filename containing default values for the configuration + * @param $configuration_setter an optional helper to set values in configuration */ - const SILENT = 0; - const PRODUCTION = 1; - const DEVELOPMENT = 2; + public static function register($namespace, $config_filename, $default_filename = null, + $configuration_setter = null) { + self::$config_list[$namespace] = new Minz_Configuration( + $namespace, $config_filename, $default_filename, $configuration_setter + ); + } /** - * définition des variables de configuration - * $salt une chaîne de caractères aléatoires (obligatoire) - * $environment gère le niveau d'affichage pour log et erreurs - * $use_url_rewriting indique si on utilise l'url_rewriting - * $base_url le chemin de base pour accéder à l'application - * $title le nom de l'application - * $language la langue par défaut de l'application - * $cacheEnabled permet de savoir si le cache doit être activé - * $delayCache la limite de cache - * $db paramètres pour la base de données (tableau) - * - host le serveur de la base - * - user nom d'utilisateur - * - password mot de passe de l'utilisateur - * - base le nom de la base de données + * Parse a file and return its data. + * + * If the file does not contain a valid PHP code returning an array, an + * empty array is returned anyway. + * + * @param $filename the name of the file to parse. + * @return an array of values + * @throws Minz_FileNotExistException if the file does not exist. */ - private static $salt = ''; - private static $environment = Minz_Configuration::PRODUCTION; - private static $base_url = ''; - private static $use_url_rewriting = false; - private static $title = ''; - private static $language = 'en'; - private static $cache_enabled = false; - private static $delay_cache = 3600; - private static $default_user = ''; - private static $allow_anonymous = false; - private static $allow_anonymous_refresh = false; - private static $auth_type = 'none'; - - private static $db = array ( - 'type' => 'mysql', - 'host' => '', - 'user' => '', - 'password' => '', - 'base' => '', - 'prefix' => '', - ); + public static function load($filename) { + if (!file_exists($filename)) { + throw new Minz_FileNotExistException($filename); + } - /* - * Getteurs - */ - public static function salt () { - return self::$salt; + $data = include($filename); + if (is_array($data)) { + return $data; + } else { + return array(); + } } - public static function environment ($str = false) { - $env = self::$environment; - if ($str) { - switch (self::$environment) { - case self::SILENT: - $env = 'silent'; - break; - case self::DEVELOPMENT: - $env = 'development'; - break; - case self::PRODUCTION: - default: - $env = 'production'; - } + /** + * Return the configuration related to a given namespace. + * + * @param $namespace the name of the configuration to get. + * @return a Minz_Configuration object + * @throws Minz_ConfigurationNamespaceException if the namespace does not exist. + */ + public static function get($namespace) { + if (!isset(self::$config_list[$namespace])) { + throw new Minz_ConfigurationNamespaceException( + $namespace . ' namespace does not exist' + ); } - return $env; - } - public static function baseUrl () { - return self::$base_url; - } - public static function useUrlRewriting () { - return self::$use_url_rewriting; - } - public static function title () { - return self::$title; - } - public static function language () { - return self::$language; - } - public static function cacheEnabled () { - return self::$cache_enabled; - } - public static function delayCache () { - return self::$delay_cache; - } - public static function dataBase () { - return self::$db; - } - public static function defaultUser () { - return self::$default_user; - } - public static function isAdmin($currentUser) { - return $currentUser === self::$default_user; - } - public static function allowAnonymous() { - return self::$allow_anonymous; - } - public static function allowAnonymousRefresh() { - return self::$allow_anonymous_refresh; - } - public static function authType() { - return self::$auth_type; - } - public static function needsLogin() { - return self::$auth_type !== 'none'; - } - public static function canLogIn() { - return self::$auth_type === 'form' || self::$auth_type === 'persona'; + return self::$config_list[$namespace]; } - public static function _allowAnonymous($allow = false) { - self::$allow_anonymous = ((bool)$allow) && self::canLogIn(); - } - public static function _allowAnonymousRefresh($allow = false) { - self::$allow_anonymous_refresh = ((bool)$allow) && self::allowAnonymous(); + /** + * The namespace of the current configuration. + */ + private $namespace = ''; + + /** + * The filename for the current configuration. + */ + private $config_filename = ''; + + /** + * The filename for the current default values, null by default. + */ + private $default_filename = null; + + /** + * The configuration values, an empty array by default. + */ + private $data = array(); + + /** + * An object which help to set good values in configuration. + */ + private $configuration_setter = null; + + public function removeExtension($ext_name) { + self::$extensions_enabled = array_diff( + self::$extensions_enabled, + array($ext_name) + ); } - public static function _authType($value) { - $value = strtolower($value); - switch ($value) { - case 'form': - case 'http_auth': - case 'persona': - case 'none': - self::$auth_type = $value; - break; + public function addExtension($ext_name) { + $found = array_search($ext_name, self::$extensions_enabled) !== false; + if (!$found) { + self::$extensions_enabled[] = $ext_name; } - self::_allowAnonymous(self::$allow_anonymous); } /** - * Initialise les variables de configuration - * @exception Minz_FileNotExistException si le CONF_PATH_NAME n'existe pas - * @exception Minz_BadConfigurationException si CONF_PATH_NAME mal formaté + * Create a new Minz_Configuration object. + * + * @param $namespace the name of the current configuration. + * @param $config_filename the file containing configuration values. + * @param $default_filename the file containing default values, null by default. + * @param $configuration_setter an optional helper to set values in configuration */ - public static function init () { + private function __construct($namespace, $config_filename, $default_filename = null, + $configuration_setter = null) { + $this->namespace = $namespace; + $this->config_filename = $config_filename; + $this->default_filename = $default_filename; + $this->_configurationSetter($configuration_setter); + + if (!is_null($this->default_filename)) { + $this->data = self::load($this->default_filename); + } + try { - self::parseFile (); - self::setReporting (); + $this->data = array_replace_recursive( + $this->data, self::load($this->config_filename) + ); } catch (Minz_FileNotExistException $e) { - throw $e; - } catch (Minz_BadConfigurationException $e) { - throw $e; + if (is_null($this->default_filename)) { + throw $e; + } } } - public static function writeFile() { - $ini_array = array( - 'general' => array( - 'environment' => self::environment(true), - 'use_url_rewriting' => self::$use_url_rewriting, - 'salt' => self::$salt, - 'base_url' => self::$base_url, - 'title' => self::$title, - 'default_user' => self::$default_user, - 'allow_anonymous' => self::$allow_anonymous, - 'allow_anonymous_refresh' => self::$allow_anonymous_refresh, - 'auth_type' => self::$auth_type, - ), - 'db' => self::$db, - ); - @rename(DATA_PATH . self::CONF_PATH_NAME, DATA_PATH . self::CONF_PATH_NAME . '.bak.php'); - $result = file_put_contents(DATA_PATH . self::CONF_PATH_NAME, "<?php\n return " . var_export($ini_array, true) . ';'); - if (function_exists('opcache_invalidate')) { - opcache_invalidate(DATA_PATH . self::CONF_PATH_NAME); //Clear PHP 5.5+ cache for include + /** + * Set a configuration setter for the current configuration. + * @param $configuration_setter the setter to call when modifying data. It + * must implement an handle($key, $value) method. + */ + public function _configurationSetter($configuration_setter) { + if (is_callable(array($configuration_setter, 'handle'))) { + $this->configuration_setter = $configuration_setter; } - return (bool)$result; } /** - * Parse un fichier de configuration - * @exception Minz_PermissionDeniedException si le CONF_PATH_NAME n'est pas accessible - * @exception Minz_BadConfigurationException si CONF_PATH_NAME mal formaté + * Return the value of the given param. + * + * @param $key the name of the param. + * @param $default default value to return if key does not exist. + * @return the value corresponding to the key. + * @throws Minz_ConfigurationParamException if the param does not exist */ - private static function parseFile () { - $ini_array = include(DATA_PATH . self::CONF_PATH_NAME); - - if (!is_array($ini_array)) { - throw new Minz_PermissionDeniedException ( - DATA_PATH . self::CONF_PATH_NAME, - Minz_Exception::ERROR - ); + public function param($key, $default = null) { + if (isset($this->data[$key])) { + return $this->data[$key]; + } elseif (!is_null($default)) { + return $default; + } else { + Minz_Log::warning($key . ' does not exist in configuration'); + return null; } + } - // [general] est obligatoire - if (!isset ($ini_array['general'])) { - throw new Minz_BadConfigurationException ( - '[general]', - Minz_Exception::ERROR - ); - } - $general = $ini_array['general']; + /** + * A wrapper for param(). + */ + public function __get($key) { + return $this->param($key); + } - // salt est obligatoire - if (!isset ($general['salt'])) { - if (isset($general['sel_application'])) { //v0.6 - $general['salt'] = $general['sel_application']; - } else { - throw new Minz_BadConfigurationException ( - 'salt', - Minz_Exception::ERROR - ); - } + /** + * Set or remove a param. + * + * @param $key the param name to set. + * @param $value the value to set. If null, the key is removed from the configuration. + */ + public function _param($key, $value = null) { + if (!is_null($this->configuration_setter) && $this->configuration_setter->support($key)) { + $this->configuration_setter->handle($this->data, $key, $value); + } elseif (isset($this->data[$key]) && is_null($value)) { + unset($this->data[$key]); + } elseif (!is_null($value)) { + $this->data[$key] = $value; } - self::$salt = $general['salt']; + } - if (isset ($general['environment'])) { - switch ($general['environment']) { - case 'silent': - self::$environment = Minz_Configuration::SILENT; - break; - case 'development': - self::$environment = Minz_Configuration::DEVELOPMENT; - break; - case 'production': - self::$environment = Minz_Configuration::PRODUCTION; - break; - default: - if ($general['environment'] >= 0 && - $general['environment'] <= 2) { - // fallback 0.7-beta - self::$environment = $general['environment']; - } else { - throw new Minz_BadConfigurationException ( - 'environment', - Minz_Exception::ERROR - ); - } - } + /** + * A wrapper for _param(). + */ + public function __set($key, $value) { + $this->_param($key, $value); + } - } - if (isset ($general['base_url'])) { - self::$base_url = $general['base_url']; - } - if (isset ($general['use_url_rewriting'])) { - self::$use_url_rewriting = $general['use_url_rewriting']; - } + /** + * Save the current configuration in the configuration file. + */ + public function save() { + $back_filename = $this->config_filename . '.bak.php'; + @rename($this->config_filename, $back_filename); - if (isset ($general['title'])) { - self::$title = $general['title']; - } - if (isset ($general['language'])) { - self::$language = $general['language']; - } - if (isset ($general['cache_enabled'])) { - self::$cache_enabled = $general['cache_enabled']; - if (CACHE_PATH === false && self::$cache_enabled) { - throw new FileNotExistException ( - 'CACHE_PATH', - Minz_Exception::ERROR - ); - } + if (file_put_contents($this->config_filename, + "<?php\nreturn " . var_export($this->data, true) . ';', + LOCK_EX) === false) { + return false; } - if (isset ($general['delay_cache'])) { - self::$delay_cache = inval($general['delay_cache']); - } - if (isset ($general['default_user'])) { - self::$default_user = $general['default_user']; - } - if (isset ($general['auth_type'])) { - self::_authType($general['auth_type']); - } - if (isset ($general['allow_anonymous'])) { - self::$allow_anonymous = ( - ((bool)($general['allow_anonymous'])) && - ($general['allow_anonymous'] !== 'no') - ); - } - if (isset ($general['allow_anonymous_refresh'])) { - self::$allow_anonymous_refresh = ( - ((bool)($general['allow_anonymous_refresh'])) && - ($general['allow_anonymous_refresh'] !== 'no') - ); - } - - // Base de données - if (isset ($ini_array['db'])) { - $db = $ini_array['db']; - if (empty($db['host'])) { - throw new Minz_BadConfigurationException ( - 'host', - Minz_Exception::ERROR - ); - } - if (empty($db['user'])) { - throw new Minz_BadConfigurationException ( - 'user', - Minz_Exception::ERROR - ); - } - if (!isset ($db['password'])) { - throw new Minz_BadConfigurationException ( - 'password', - Minz_Exception::ERROR - ); - } - if (empty($db['base'])) { - throw new Minz_BadConfigurationException ( - 'base', - Minz_Exception::ERROR - ); - } - if (!empty($db['type'])) { - self::$db['type'] = $db['type']; - } - self::$db['host'] = $db['host']; - self::$db['user'] = $db['user']; - self::$db['password'] = $db['password']; - self::$db['base'] = $db['base']; - if (isset($db['prefix'])) { - self::$db['prefix'] = $db['prefix']; - } + // Clear PHP 5.5+ cache for include + if (function_exists('opcache_invalidate')) { + opcache_invalidate($this->config_filename); } - } - private static function setReporting() { - switch (self::$environment) { - case self::PRODUCTION: - error_reporting(E_ALL); - ini_set('display_errors','Off'); - ini_set('log_errors', 'On'); - break; - case self::DEVELOPMENT: - error_reporting(E_ALL); - ini_set('display_errors','On'); - ini_set('log_errors', 'On'); - break; - case self::SILENT: - error_reporting(0); - break; - } + return true; } } diff --git a/lib/Minz/ConfigurationException.php b/lib/Minz/ConfigurationException.php new file mode 100644 index 000000000..f294c3341 --- /dev/null +++ b/lib/Minz/ConfigurationException.php @@ -0,0 +1,8 @@ +<?php + +class Minz_ConfigurationException extends Minz_Exception { + public function __construct($error, $code = self::ERROR) { + $message = 'Configuration error: ' . $error; + parent::__construct($message, $code); + } +} diff --git a/lib/Minz/ConfigurationNamespaceException.php b/lib/Minz/ConfigurationNamespaceException.php new file mode 100644 index 000000000..f4278c5d6 --- /dev/null +++ b/lib/Minz/ConfigurationNamespaceException.php @@ -0,0 +1,4 @@ +<?php + +class Minz_ConfigurationNamespaceException extends Minz_ConfigurationException { +} diff --git a/lib/Minz/ConfigurationParamException.php b/lib/Minz/ConfigurationParamException.php new file mode 100644 index 000000000..eac977935 --- /dev/null +++ b/lib/Minz/ConfigurationParamException.php @@ -0,0 +1,4 @@ +<?php + +class Minz_ConfigurationParamException extends Minz_ConfigurationException { +} diff --git a/lib/Minz/Dispatcher.php b/lib/Minz/Dispatcher.php index 71dfe8ac6..125ce5757 100644 --- a/lib/Minz/Dispatcher.php +++ b/lib/Minz/Dispatcher.php @@ -14,97 +14,72 @@ class Minz_Dispatcher { /* singleton */ private static $instance = null; + private static $needsReset; + private static $registrations = array(); - private $router; private $controller; /** * Récupère l'instance du Dispatcher */ - public static function getInstance ($router) { + public static function getInstance () { if (self::$instance === null) { - self::$instance = new Minz_Dispatcher ($router); + self::$instance = new Minz_Dispatcher (); } return self::$instance; } /** - * Constructeur - */ - private function __construct ($router) { - $this->router = $router; - } - - /** * Lance le controller indiqué dans Request * Remplit le body de Response à partir de la Vue * @exception Minz_Exception */ - public function run ($ob = true) { - $cache = new Minz_Cache(); - // Le ob_start est dupliqué : sans ça il y a un bug sous Firefox - // ici on l'appelle avec 'ob_gzhandler', après sans. - // Vraisemblablement la compression fonctionne mais c'est sale - // J'ignore les effets de bord :( - if ($ob) { - ob_start ('ob_gzhandler'); - } + public function run () { + do { + self::$needsReset = false; - if (Minz_Cache::isEnabled () && !$cache->expired ()) { - if ($ob) { - ob_start (); - } - $cache->render (); - if ($ob) { - $text = ob_get_clean(); - } - } else { - $text = ''; //TODO: Clean this code - while (Minz_Request::$reseted) { - Minz_Request::$reseted = false; - - try { - $this->createController ('FreshRSS_' . Minz_Request::controllerName () . '_Controller'); - $this->controller->init (); - $this->controller->firstAction (); + try { + $this->createController (Minz_Request::controllerName ()); + $this->controller->init (); + $this->controller->firstAction (); + if (!self::$needsReset) { $this->launchAction ( Minz_Request::actionName () . 'Action' ); - $this->controller->lastAction (); - - if (!Minz_Request::$reseted) { - if ($ob) { - ob_start (); - } - $this->controller->view ()->build (); - if ($ob) { - $text = ob_get_clean(); - } - } - } catch (Minz_Exception $e) { - throw $e; } - } + $this->controller->lastAction (); - if (Minz_Cache::isEnabled ()) { - $cache->cache ($text); + if (!self::$needsReset) { + $this->controller->view ()->build (); + } + } catch (Minz_Exception $e) { + throw $e; } - } + } while (self::$needsReset); + } - Minz_Response::setBody ($text); + /** + * Informe le contrôleur qu'il doit recommancer car la requête a été modifiée + */ + public static function reset() { + self::$needsReset = true; } /** * Instancie le Controller - * @param $controller_name le nom du controller à instancier + * @param $base_name le nom du controller à instancier * @exception ControllerNotExistException le controller n'existe pas * @exception ControllerNotActionControllerException controller n'est * > pas une instance de ActionController */ - private function createController ($controller_name) { - $filename = APP_PATH . self::CONTROLLERS_PATH_NAME . '/' - . $controller_name . '.php'; + private function createController ($base_name) { + if (self::isRegistered($base_name)) { + self::loadController($base_name); + $controller_name = 'FreshExtension_' . $base_name . '_Controller'; + } else { + $controller_name = 'FreshRSS_' . $base_name . '_Controller'; + } if (!class_exists ($controller_name)) { throw new Minz_ControllerNotExistException ( @@ -112,7 +87,7 @@ class Minz_Dispatcher { Minz_Exception::ERROR ); } - $this->controller = new $controller_name ($this->router); + $this->controller = new $controller_name (); if (! ($this->controller instanceof Minz_ActionController)) { throw new Minz_ControllerNotActionControllerException ( @@ -129,21 +104,57 @@ class Minz_Dispatcher { * le controller */ private function launchAction ($action_name) { - if (!Minz_Request::$reseted) { - if (!is_callable (array ( - $this->controller, - $action_name - ))) { - throw new Minz_ActionException ( - get_class ($this->controller), - $action_name, - Minz_Exception::ERROR - ); - } - call_user_func (array ( - $this->controller, - $action_name - )); + if (!is_callable (array ( + $this->controller, + $action_name + ))) { + throw new Minz_ActionException ( + get_class ($this->controller), + $action_name, + Minz_Exception::ERROR + ); } + call_user_func (array ( + $this->controller, + $action_name + )); + } + + /** + * Register a controller file. + * + * @param $base_name the base name of the controller (i.e. ./?c=<base_name>) + * @param $base_path the base path where we should look into to find info. + */ + public static function registerController($base_name, $base_path) { + if (!self::isRegistered($base_name)) { + self::$registrations[$base_name] = $base_path; + } + } + + /** + * Return if a controller is registered. + * + * @param $base_name the base name of the controller. + * @return true if the controller has been registered, false else. + */ + public static function isRegistered($base_name) { + return isset(self::$registrations[$base_name]); + } + + /** + * Load a controller file (include). + * + * @param $base_name the base name of the controller. + */ + private static function loadController($base_name) { + $base_path = self::$registrations[$base_name]; + $controller_filename = $base_path . '/controllers/' . $base_name . 'Controller.php'; + include_once $controller_filename; + } + + private static function setViewPath($controller, $base_name) { + $base_path = self::$registrations[$base_name]; + $controller->view()->setBasePathname($base_path); } } diff --git a/lib/Minz/Error.php b/lib/Minz/Error.php index 337ab6c0a..3e4a3e8f3 100644 --- a/lib/Minz/Error.php +++ b/lib/Minz/Error.php @@ -19,41 +19,28 @@ class Minz_Error { * > $logs['notice'] * @param $redirect indique s'il faut forcer la redirection (les logs ne seront pas transmis) */ - public static function error ($code = 404, $logs = array (), $redirect = false) { + public static function error ($code = 404, $logs = array (), $redirect = true) { $logs = self::processLogs ($logs); $error_filename = APP_PATH . '/Controllers/errorController.php'; if (file_exists ($error_filename)) { - $params = array ( - 'code' => $code, - 'logs' => $logs - ); + Minz_Session::_param('error_code', $code); + Minz_Session::_param('error_logs', $logs); - Minz_Response::setHeader ($code); - if ($redirect) { - Minz_Request::forward (array ( - 'c' => 'error' - ), true); - } else { - Minz_Request::forward (array ( - 'c' => 'error', - 'params' => $params - ), false); - } + Minz_Request::forward (array ( + 'c' => 'error' + ), $redirect); } else { - $text = '<h1>An error occured</h1>'."\n"; + echo '<h1>An error occured</h1>' . "\n"; if (!empty ($logs)) { - $text .= '<ul>'."\n"; + echo '<ul>' . "\n"; foreach ($logs as $log) { - $text .= '<li>' . $log . '</li>'."\n"; + echo '<li>' . $log . '</li>' . "\n"; } - $text .= '</ul>'."\n"; + echo '</ul>' . "\n"; } - Minz_Response::setHeader ($code); - Minz_Response::setBody ($text); - Minz_Response::send (); exit (); } } @@ -66,7 +53,8 @@ class Minz_Error { * > en fonction de l'environment */ private static function processLogs ($logs) { - $env = Minz_Configuration::environment (); + $conf = Minz_Configuration::get('system'); + $env = $conf->environment; $logs_ok = array (); $error = array (); $warning = array (); @@ -82,10 +70,10 @@ class Minz_Error { $notice = $logs['notice']; } - if ($env == Minz_Configuration::PRODUCTION) { + if ($env == 'production') { $logs_ok = $error; } - if ($env == Minz_Configuration::DEVELOPMENT) { + if ($env == 'development') { $logs_ok = array_merge ($error, $warning, $notice); } diff --git a/lib/Minz/Extension.php b/lib/Minz/Extension.php new file mode 100644 index 000000000..78b8a2725 --- /dev/null +++ b/lib/Minz/Extension.php @@ -0,0 +1,208 @@ +<?php + +/** + * The extension base class. + */ +class Minz_Extension { + private $name; + private $entrypoint; + private $path; + private $author; + private $description; + private $version; + private $type; + + public static $authorized_types = array( + 'system', + 'user', + ); + + private $is_enabled; + + /** + * The constructor to assign specific information to the extension. + * + * Available fields are: + * - name: the name of the extension (required). + * - entrypoint: the extension class name (required). + * - path: the pathname to the extension files (required). + * - author: the name and / or email address of the extension author. + * - description: a short description to describe the extension role. + * - version: a version for the current extension. + * - type: "system" or "user" (default). + * + * It must not be redefined by child classes. + * + * @param $meta_info contains information about the extension. + */ + public function __construct($meta_info) { + $this->name = $meta_info['name']; + $this->entrypoint = $meta_info['entrypoint']; + $this->path = $meta_info['path']; + $this->author = isset($meta_info['author']) ? $meta_info['author'] : ''; + $this->description = isset($meta_info['description']) ? $meta_info['description'] : ''; + $this->version = isset($meta_info['version']) ? $meta_info['version'] : '0.1'; + $this->setType(isset($meta_info['type']) ? $meta_info['type'] : 'user'); + + $this->is_enabled = false; + } + + /** + * Used when installing an extension (e.g. update the database scheme). + * + * It must be redefined by child classes. + * + * @return true if the extension has been installed or a string explaining + * the problem. + */ + public function install() { + return true; + } + + /** + * Used when uninstalling an extension (e.g. revert the database scheme to + * cancel changes from install). + * + * It must be redefined by child classes. + * + * @return true if the extension has been uninstalled or a string explaining + * the problem. + */ + public function uninstall() { + return true; + } + + /** + * Call at the initialization of the extension (i.e. when the extension is + * enabled by the extension manager). + * + * It must be redefined by child classes. + */ + public function init() {} + + /** + * Set the current extension to enable. + */ + public function enable() { + $this->is_enabled = true; + } + + /** + * Return if the extension is currently enabled. + * + * @return true if extension is enabled, false else. + */ + public function isEnabled() { + return $this->is_enabled; + } + + /** + * Return the content of the configure view for the current extension. + * + * @return the html content from ext_dir/configure.phtml, false if it does + * not exist. + */ + public function getConfigureView() { + $filename = $this->path . '/configure.phtml'; + if (!file_exists($filename)) { + return false; + } + + ob_start(); + include($filename); + return ob_get_clean(); + } + + /** + * Handle the configure action. + * + * It must be redefined by child classes. + */ + public function handleConfigureAction() {} + + /** + * Getters and setters. + */ + public function getName() { + return $this->name; + } + public function getEntrypoint() { + return $this->entrypoint; + } + public function getPath() { + return $this->path; + } + public function getAuthor() { + return $this->author; + } + public function getDescription() { + return $this->description; + } + public function getVersion() { + return $this->version; + } + public function getType() { + return $this->type; + } + private function setType($type) { + if (!in_array($type, self::$authorized_types)) { + throw new Minz_ExtensionException('invalid `type` info', $this->name); + } + $this->type = $type; + } + + /** + * Return the url for a given file. + * + * @param $filename name of the file to serve. + * @param $type the type (js or css) of the file to serve. + * @return the url corresponding to the file. + */ + public function getFileUrl($filename, $type) { + $dir = substr(strrchr($this->path, '/'), 1); + $file_name_url = urlencode($dir . '/static/' . $filename); + + $absolute_path = $this->path . '/static/' . $filename; + $mtime = @filemtime($absolute_path); + + $url = '/ext.php?f=' . $file_name_url . + '&t=' . $type . + '&' . $mtime; + return Minz_Url::display($url, 'php'); + } + + /** + * Register a controller in the Dispatcher. + * + * @param @base_name the base name of the controller. Final name will be: + * FreshExtension_<base_name>_Controller. + */ + public function registerController($base_name) { + Minz_Dispatcher::registerController($base_name, $this->path); + } + + /** + * Register the views in order to be accessible by the application. + */ + public function registerViews() { + Minz_View::addBasePathname($this->path); + } + + /** + * Register i18n files from ext_dir/i18n/ + */ + public function registerTranslates() { + $i18n_dir = $this->path . '/i18n'; + Minz_Translate::registerPath($i18n_dir); + } + + /** + * Register a new hook. + * + * @param $hook_name the hook name (must exist). + * @param $hook_function the function name to call (must be callable). + */ + public function registerHook($hook_name, $hook_function) { + Minz_ExtensionManager::addHook($hook_name, $hook_function, $this); + } +} diff --git a/lib/Minz/ExtensionException.php b/lib/Minz/ExtensionException.php new file mode 100644 index 000000000..647f1a9b9 --- /dev/null +++ b/lib/Minz/ExtensionException.php @@ -0,0 +1,15 @@ +<?php + +class Minz_ExtensionException extends Minz_Exception { + public function __construct ($message, $extension_name = false, $code = self::ERROR) { + if ($extension_name) { + $message = 'An error occured in `' . $extension_name + . '` extension with the message: ' . $message; + } else { + $message = 'An error occured in an unnamed ' + . 'extension with the message: ' . $message; + } + + parent::__construct($message, $code); + } +} diff --git a/lib/Minz/ExtensionManager.php b/lib/Minz/ExtensionManager.php new file mode 100644 index 000000000..c5c68a8d4 --- /dev/null +++ b/lib/Minz/ExtensionManager.php @@ -0,0 +1,301 @@ +<?php + +/** + * An extension manager to load extensions present in EXTENSIONS_PATH. + * + * @todo see coding style for methods!! + */ +class Minz_ExtensionManager { + private static $ext_metaname = 'metadata.json'; + private static $ext_entry_point = 'extension.php'; + private static $ext_list = array(); + private static $ext_list_enabled = array(); + + private static $ext_auto_enabled = array(); + + // List of available hooks. Please keep this list sorted. + private static $hook_list = array( + 'entry_before_display' => array( // function($entry) -> Entry | null + 'list' => array(), + 'signature' => 'OneToOne', + ), + 'entry_before_insert' => array( // function($entry) -> Entry | null + 'list' => array(), + 'signature' => 'OneToOne', + ), + 'feed_before_insert' => array( // function($feed) -> Feed | null + 'list' => array(), + 'signature' => 'OneToOne', + ), + 'post_update' => array( // function(none) -> none + 'list' => array(), + 'signature' => 'NoneToNone', + ), + ); + private static $ext_to_hooks = array(); + + /** + * Initialize the extension manager by loading extensions in EXTENSIONS_PATH. + * + * A valid extension is a directory containing metadata.json and + * extension.php files. + * metadata.json is a JSON structure where the only required fields are + * `name` and `entry_point`. + * extension.php should contain at least a class named <name>Extension where + * <name> must match with the entry point in metadata.json. This class must + * inherit from Minz_Extension class. + */ + public static function init() { + $list_potential_extensions = array_values(array_diff( + scandir(EXTENSIONS_PATH), + array('..', '.') + )); + + $system_conf = Minz_Configuration::get('system'); + self::$ext_auto_enabled = $system_conf->extensions_enabled; + + foreach ($list_potential_extensions as $ext_dir) { + $ext_pathname = EXTENSIONS_PATH . '/' . $ext_dir; + if (!is_dir($ext_pathname)) { + continue; + } + $metadata_filename = $ext_pathname . '/' . self::$ext_metaname; + + // Try to load metadata file. + if (!file_exists($metadata_filename)) { + // No metadata file? Invalid! + continue; + } + $meta_raw_content = file_get_contents($metadata_filename); + $meta_json = json_decode($meta_raw_content, true); + if (!$meta_json || !self::isValidMetadata($meta_json)) { + // metadata.json is not a json file? Invalid! + // or metadata.json is invalid (no required information), invalid! + Minz_Log::warning('`' . $metadata_filename . '` is not a valid metadata file'); + continue; + } + + $meta_json['path'] = $ext_pathname; + + // Try to load extension itself + $extension = self::load($meta_json); + if (!is_null($extension)) { + self::register($extension); + } + } + } + + /** + * Indicates if the given parameter is a valid metadata array. + * + * Required fields are: + * - `name`: the name of the extension + * - `entry_point`: a class name to load the extension source code + * If the extension class name is `TestExtension`, entry point will be `Test`. + * `entry_point` must be composed of alphanumeric characters. + * + * @param $meta is an array of values. + * @return true if the array is valid, false else. + */ + public static function isValidMetadata($meta) { + $valid_chars = array('_'); + return !(empty($meta['name']) || + empty($meta['entrypoint']) || + !ctype_alnum(str_replace($valid_chars, '', $meta['entrypoint']))); + } + + /** + * Load the extension source code based on info metadata. + * + * @param $info an array containing information about extension. + * @return an extension inheriting from Minz_Extension. + */ + public static function load($info) { + $entry_point_filename = $info['path'] . '/' . self::$ext_entry_point; + $ext_class_name = $info['entrypoint'] . 'Extension'; + + include_once($entry_point_filename); + + // Test if the given extension class exists. + if (!class_exists($ext_class_name)) { + Minz_Log::warning('`' . $ext_class_name . + '` cannot be found in `' . $entry_point_filename . '`'); + return null; + } + + // Try to load the class. + $extension = null; + try { + $extension = new $ext_class_name($info); + } catch (Minz_ExtensionException $e) { + // We cannot load the extension? Invalid! + Minz_Log::warning('In `' . $metadata_filename . '`: ' . $e->getMessage()); + return null; + } + + // Test if class is correct. + if (!($extension instanceof Minz_Extension)) { + Minz_Log::warning('`' . $ext_class_name . + '` is not an instance of `Minz_Extension`'); + return null; + } + + return $extension; + } + + /** + * Add the extension to the list of the known extensions ($ext_list). + * + * If the extension is present in $ext_auto_enabled and if its type is "system", + * it will be enabled in the same time. + * + * @param $ext a valid extension. + */ + public static function register($ext) { + $name = $ext->getName(); + self::$ext_list[$name] = $ext; + + if ($ext->getType() === 'system' && + in_array($name, self::$ext_auto_enabled)) { + self::enable($ext->getName()); + } + + self::$ext_to_hooks[$name] = array(); + } + + /** + * Enable an extension so it will be called when necessary. + * + * The extension init() method will be called. + * + * @param $ext_name is the name of a valid extension present in $ext_list. + */ + public static function enable($ext_name) { + if (isset(self::$ext_list[$ext_name])) { + $ext = self::$ext_list[$ext_name]; + self::$ext_list_enabled[$ext_name] = $ext; + $ext->enable(); + $ext->init(); + } + } + + /** + * Enable a list of extensions. + * + * @param $ext_list the names of extensions we want to load. + */ + public static function enableByList($ext_list) { + foreach ($ext_list as $ext_name) { + self::enable($ext_name); + } + } + + /** + * Return a list of extensions. + * + * @param $only_enabled if true returns only the enabled extensions (false by default). + * @return an array of extensions. + */ + public static function listExtensions($only_enabled = false) { + if ($only_enabled) { + return self::$ext_list_enabled; + } else { + return self::$ext_list; + } + } + + /** + * Return an extension by its name. + * + * @param $ext_name the name of the extension. + * @return the corresponding extension or null if it doesn't exist. + */ + public static function findExtension($ext_name) { + if (!isset(self::$ext_list[$ext_name])) { + return null; + } + + return self::$ext_list[$ext_name]; + } + + /** + * Add a hook function to a given hook. + * + * The hook name must be a valid one. For the valid list, see self::$hook_list + * array keys. + * + * @param $hook_name the hook name (must exist). + * @param $hook_function the function name to call (must be callable). + * @param $ext the extension which register the hook. + */ + public static function addHook($hook_name, $hook_function, $ext) { + if (isset(self::$hook_list[$hook_name]) && is_callable($hook_function)) { + self::$hook_list[$hook_name]['list'][] = $hook_function; + self::$ext_to_hooks[$ext->getName()][] = $hook_name; + } + } + + /** + * Call functions related to a given hook. + * + * The hook name must be a valid one. For the valid list, see self::$hook_list + * array keys. + * + * @param $hook_name the hook to call. + * @param additionnal parameters (for signature, please see self::$hook_list). + * @return the final result of the called hook. + */ + public static function callHook($hook_name) { + if (!isset(self::$hook_list[$hook_name])) { + return; + } + + $signature = self::$hook_list[$hook_name]['signature']; + $signature = 'self::call' . $signature; + $args = func_get_args(); + + return call_user_func_array($signature, $args); + } + + /** + * Call a hook which takes one argument and return a result. + * + * The result is chained between the extension, for instance, first extension + * hook will receive the initial argument and return a result which will be + * passed as an argument to the next extension hook and so on. + * + * If a hook return a null value, the method is stopped and return null. + * + * @param $hook_name is the hook to call. + * @param $arg is the argument to pass to the first extension hook. + * @return the final chained result of the hooks. If nothing is changed, + * the initial argument is returned. + */ + private static function callOneToOne($hook_name, $arg) { + $result = $arg; + foreach (self::$hook_list[$hook_name]['list'] as $function) { + $result = call_user_func($function, $arg); + + if (is_null($result)) { + break; + } + + $arg = $result; + } + return $result; + } + + /** + * Call a hook which takes no argument and returns nothing. + * + * This case is simpler than callOneToOne because hooks are called one by + * one, without any consideration of argument nor result. + * + * @param $hook_name is the hook to call. + */ + private static function callNoneToNone($hook_name) { + foreach (self::$hook_list[$hook_name]['list'] as $function) { + call_user_func($function); + } + } +} diff --git a/lib/Minz/FrontController.php b/lib/Minz/FrontController.php index 80eda8877..f9eff3db6 100644 --- a/lib/Minz/FrontController.php +++ b/lib/Minz/FrontController.php @@ -24,50 +24,67 @@ */ class Minz_FrontController { protected $dispatcher; - protected $router; - - private $useOb = true; /** * Constructeur - * Initialise le router et le dispatcher + * Initialise le dispatcher, met à jour la Request */ public function __construct () { - if (LOG_PATH === false) { - $this->killApp ('Path not found: LOG_PATH'); - } - try { - Minz_Configuration::init (); + Minz_Configuration::register('system', + DATA_PATH . '/config.php', + DATA_PATH . '/config.default.php'); + $this->setReporting(); - Minz_Request::init (); + Minz_Request::init(); - $this->router = new Minz_Router (); - $this->router->init (); - } catch (Minz_RouteNotFoundException $e) { - Minz_Log::record ($e->getMessage (), Minz_Log::ERROR); - Minz_Error::error ( - 404, - array ('error' => array ($e->getMessage ())) + $url = $this->buildUrl(); + $url['params'] = array_merge ( + $url['params'], + Minz_Request::fetchPOST () ); + Minz_Request::forward ($url); } catch (Minz_Exception $e) { - Minz_Log::record ($e->getMessage (), Minz_Log::ERROR); + Minz_Log::error($e->getMessage()); $this->killApp ($e->getMessage ()); } - $this->dispatcher = Minz_Dispatcher::getInstance ($this->router); + $this->dispatcher = Minz_Dispatcher::getInstance(); } /** - * Démarre l'application (lance le dispatcher et renvoie la réponse + * Retourne un tableau représentant l'url passée par la barre d'adresses + * @return tableau représentant l'url + */ + private function buildUrl() { + $url = array (); + + $url['c'] = Minz_Request::fetchGET ( + 'c', + Minz_Request::defaultControllerName () + ); + $url['a'] = Minz_Request::fetchGET ( + 'a', + Minz_Request::defaultActionName () + ); + $url['params'] = Minz_Request::fetchGET (); + + // post-traitement + unset ($url['params']['c']); + unset ($url['params']['a']); + + return $url; + } + + /** + * Démarre l'application (lance le dispatcher et renvoie la réponse) */ public function run () { try { - $this->dispatcher->run ($this->useOb); - Minz_Response::send (); + $this->dispatcher->run(); } catch (Minz_Exception $e) { try { - Minz_Log::record ($e->getMessage (), Minz_Log::ERROR); + Minz_Log::error($e->getMessage()); } catch (Minz_PermissionDeniedException $e) { $this->killApp ($e->getMessage ()); } @@ -97,14 +114,22 @@ class Minz_FrontController { exit ('### Application problem ###<br />'."\n".$txt); } - public function useOb() { - return $this->useOb; - } - - /** - * Use ob_start('ob_gzhandler') or not. - */ - public function _useOb($ob) { - return $this->useOb = (bool)$ob; + private function setReporting() { + $conf = Minz_Configuration::get('system'); + switch($conf->environment) { + case 'production': + error_reporting(E_ALL); + ini_set('display_errors','Off'); + ini_set('log_errors', 'On'); + break; + case 'development': + error_reporting(E_ALL); + ini_set('display_errors','On'); + ini_set('log_errors', 'On'); + break; + case 'silent': + error_reporting(0); + break; + } } } diff --git a/lib/Minz/Helper.php b/lib/Minz/Helper.php index b058211d3..f4a547c4e 100644 --- a/lib/Minz/Helper.php +++ b/lib/Minz/Helper.php @@ -12,11 +12,22 @@ class Minz_Helper { * Annule les effets des magic_quotes pour une variable donnée * @param $var variable à traiter (tableau ou simple variable) */ - public static function stripslashes_r ($var) { - if (is_array ($var)){ - return array_map (array ('Helper', 'stripslashes_r'), $var); + public static function stripslashes_r($var) { + if (is_array($var)){ + return array_map(array('Minz_Helper', 'stripslashes_r'), $var); } else { return stripslashes($var); } } + + /** + * Wrapper for htmlspecialchars. + * Force UTf-8 value and can be used on array too. + */ + public static function htmlspecialchars_utf8($var) { + if (is_array($var)) { + return array_map(array('Minz_Helper', 'htmlspecialchars_utf8'), $var); + } + return htmlspecialchars($var, ENT_COMPAT, 'UTF-8'); + } } diff --git a/lib/Minz/Log.php b/lib/Minz/Log.php index e710aad4a..9559a0bd4 100644 --- a/lib/Minz/Log.php +++ b/lib/Minz/Log.php @@ -28,16 +28,25 @@ class Minz_Log { * - level = NOTICE et environment = PRODUCTION * @param $information message d'erreur / information à enregistrer * @param $level niveau d'erreur - * @param $file_name fichier de log, par défaut LOG_PATH/application.log + * @param $file_name fichier de log */ public static function record ($information, $level, $file_name = null) { - $env = Minz_Configuration::environment (); + try { + $conf = Minz_Configuration::get('system'); + $env = $conf->environment; + } catch (Minz_ConfigurationException $e) { + $env = 'production'; + } - if (! ($env === Minz_Configuration::SILENT - || ($env === Minz_Configuration::PRODUCTION + if (! ($env === 'silent' + || ($env === 'production' && ($level >= Minz_Log::NOTICE)))) { if ($file_name === null) { - $file_name = LOG_PATH . '/' . Minz_Session::param('currentUser', '_') . '.log'; + $username = Minz_Session::param('currentUser', ''); + if ($username == '') { + $username = '_'; + } + $file_name = join_path(USERS_PATH, $username, 'log.txt'); } switch ($level) { @@ -71,7 +80,7 @@ class Minz_Log { * Automatise le log des variables globales $_GET et $_POST * Fait appel à la fonction record(...) * Ne fonctionne qu'en environnement "development" - * @param $file_name fichier de log, par défaut LOG_PATH/application.log + * @param $file_name fichier de log */ public static function recordRequest($file_name = null) { $msg_get = str_replace("\n", '', '$_GET content : ' . print_r($_GET, true)); @@ -80,4 +89,21 @@ class Minz_Log { self::record($msg_get, Minz_Log::DEBUG, $file_name); self::record($msg_post, Minz_Log::DEBUG, $file_name); } + + /** + * Some helpers to Minz_Log::record() method + * Parameters are the same of those of the record() method. + */ + public static function debug($msg, $file_name = null) { + self::record($msg, Minz_Log::DEBUG, $file_name); + } + public static function notice($msg, $file_name = null) { + self::record($msg, Minz_Log::NOTICE, $file_name); + } + public static function warning($msg, $file_name = null) { + self::record($msg, Minz_Log::WARNING, $file_name); + } + public static function error($msg, $file_name = null) { + self::record($msg, Minz_Log::ERROR, $file_name); + } } diff --git a/lib/Minz/ModelPdo.php b/lib/Minz/ModelPdo.php index 831df13a2..caab1d114 100644 --- a/lib/Minz/ModelPdo.php +++ b/lib/Minz/ModelPdo.php @@ -16,54 +16,83 @@ class Minz_ModelPdo { public static $useSharedBd = true; private static $sharedBd = null; private static $sharedPrefix; + private static $sharedCurrentUser; + protected static $sharedDbType; /** * $bd variable représentant la base de données */ protected $bd; + protected $current_user; protected $prefix; + public function dbType() { + return self::$sharedDbType; + } + /** * Créé la connexion à la base de données à l'aide des variables * HOST, BASE, USER et PASS définies dans le fichier de configuration */ - public function __construct () { - if (self::$useSharedBd && self::$sharedBd != null) { + public function __construct($currentUser = null) { + if ($currentUser === null) { + $currentUser = Minz_Session::param('currentUser'); + } + if (self::$useSharedBd && self::$sharedBd != null && + ($currentUser == null || $currentUser === self::$sharedCurrentUser)) { $this->bd = self::$sharedBd; $this->prefix = self::$sharedPrefix; + $this->current_user = self::$sharedCurrentUser; return; } + $this->current_user = $currentUser; + self::$sharedCurrentUser = $currentUser; + + $conf = Minz_Configuration::get('system'); + $db = $conf->db; - $db = Minz_Configuration::dataBase (); - $driver_options = null; + $driver_options = isset($conf->db['pdo_options']) && is_array($conf->db['pdo_options']) ? $conf->db['pdo_options'] : array(); + $dbServer = parse_url('db://' . $db['host']); try { - $type = $db['type']; - if($type == 'mysql') { - $string = $type - . ':host=' . $db['host'] - . ';dbname=' . $db['base'] - . ';charset=utf8'; - $driver_options = array( - PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8' - ); - } elseif($type == 'sqlite') { - $string = $type . ':/' . DATA_PATH . $db['base'] . '.sqlite'; //TODO: DEBUG UTF-8 http://www.siteduzero.com/forum/sujet/sqlite-connexion-utf-8-18797 + switch ($db['type']) { + case 'mysql': + $string = 'mysql:host=' . $dbServer['host'] . ';dbname=' . $db['base'] . ';charset=utf8mb4'; + if (!empty($dbServer['port'])) { + $string .= ';port=' . $dbServer['port']; + } + $driver_options[PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET NAMES utf8mb4'; + $this->prefix = $db['prefix'] . $currentUser . '_'; + $this->bd = new MinzPDOMySql($string, $db['user'], $db['password'], $driver_options); + break; + case 'sqlite': + $string = 'sqlite:' . join_path(DATA_PATH, 'users', $currentUser, 'db.sqlite'); + $this->prefix = ''; + $this->bd = new MinzPDOMSQLite($string, $db['user'], $db['password'], $driver_options); + $this->bd->exec('PRAGMA foreign_keys = ON;'); + break; + case 'pgsql': + $string = 'pgsql:host=' . $dbServer['host'] . ';dbname=' . $db['base']; + if (!empty($dbServer['port'])) { + $string .= ';port=' . $dbServer['port']; + } + $this->prefix = $db['prefix'] . $currentUser . '_'; + $this->bd = new MinzPDOPGSQL($string, $db['user'], $db['password'], $driver_options); + $this->bd->exec("SET NAMES 'UTF8';"); + break; + default: + throw new Minz_PDOConnectionException( + 'Invalid database type!', + $db['user'], Minz_Exception::ERROR + ); + break; } - - $this->bd = new FreshPDO ( - $string, - $db['user'], - $db['password'], - $driver_options - ); self::$sharedBd = $this->bd; - - $this->prefix = $db['prefix'] . Minz_Session::param('currentUser', '_') . '_'; + self::$sharedDbType = $db['type']; self::$sharedPrefix = $this->prefix; } catch (Exception $e) { - throw new Minz_PDOConnectionException ( + throw new Minz_PDOConnectionException( $string, $db['user'], Minz_Exception::ERROR ); @@ -73,6 +102,9 @@ class Minz_ModelPdo { public function beginTransaction() { $this->bd->beginTransaction(); } + public function inTransaction() { + return $this->bd->inTransaction(); //requires PHP >= 5.3.3 + } public function commit() { $this->bd->commit(); } @@ -80,40 +112,62 @@ class Minz_ModelPdo { $this->bd->rollBack(); } - public function size($all = false) { - $db = Minz_Configuration::dataBase (); - $sql = 'SELECT SUM(data_length + index_length) FROM information_schema.TABLES WHERE table_schema = ?'; - $values = array ($db['base']); - if (!$all) { - $sql .= ' AND table_name LIKE ?'; - $values[] = $this->prefix . '%'; - } - $stm = $this->bd->prepare ($sql); - $stm->execute ($values); - $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); - return $res[0]; - } - public static function clean() { self::$sharedBd = null; self::$sharedPrefix = ''; } + + public function disableBuffering() { + if ((self::$sharedDbType === 'mysql') && defined('PDO::MYSQL_ATTR_USE_BUFFERED_QUERY')) { + $this->bd->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false); + } + } } -class FreshPDO extends PDO { +class MinzPDO extends PDO { private static function check($statement) { if (preg_match('/^(?:UPDATE|INSERT|DELETE)/i', $statement)) { invalidateHttpCache(); } } - public function prepare ($statement, $driver_options = array()) { - FreshPDO::check($statement); + protected function compatibility($statement) { + return $statement; + } + + public function prepare($statement, $driver_options = array()) { + MinzPDO::check($statement); + $statement = $this->compatibility($statement); return parent::prepare($statement, $driver_options); } - public function exec ($statement) { - FreshPDO::check($statement); + public function exec($statement) { + MinzPDO::check($statement); + $statement = $this->compatibility($statement); return parent::exec($statement); } + + public function query($statement) { + MinzPDO::check($statement); + $statement = $this->compatibility($statement); + return parent::query($statement); + } +} + +class MinzPDOMySql extends MinzPDO { + public function lastInsertId($name = null) { + return parent::lastInsertId(); //We discard the name, only used by PostgreSQL + } +} + +class MinzPDOMSQLite extends MinzPDO { + public function lastInsertId($name = null) { + return parent::lastInsertId(); //We discard the name, only used by PostgreSQL + } +} + +class MinzPDOPGSQL extends MinzPDO { + protected function compatibility($statement) { + return str_replace(array('`', ' LIKE '), array('"', ' ILIKE '), $statement); + } } diff --git a/lib/Minz/Request.php b/lib/Minz/Request.php index 282d47a77..f80b707d6 100644 --- a/lib/Minz/Request.php +++ b/lib/Minz/Request.php @@ -10,68 +10,68 @@ class Minz_Request { private static $controller_name = ''; private static $action_name = ''; - private static $params = array (); + private static $params = array(); private static $default_controller_name = 'index'; private static $default_action_name = 'index'; - public static $reseted = true; - /** * Getteurs */ - public static function controllerName () { + public static function controllerName() { return self::$controller_name; } - public static function actionName () { + public static function actionName() { return self::$action_name; } - public static function params () { + public static function params() { return self::$params; } - static function htmlspecialchars_utf8 ($p) { - return htmlspecialchars($p, ENT_COMPAT, 'UTF-8'); - } - public static function param ($key, $default = false, $specialchars = false) { - if (isset (self::$params[$key])) { + public static function param($key, $default = false, $specialchars = false) { + if (isset(self::$params[$key])) { $p = self::$params[$key]; - if(is_object($p) || $specialchars) { + if (is_object($p) || $specialchars) { return $p; - } elseif(is_array($p)) { - return array_map('self::htmlspecialchars_utf8', $p); } else { - return self::htmlspecialchars_utf8($p); + return Minz_Helper::htmlspecialchars_utf8($p); } } else { return $default; } } - public static function defaultControllerName () { + public static function defaultControllerName() { return self::$default_controller_name; } - public static function defaultActionName () { + public static function defaultActionName() { return self::$default_action_name; } + public static function currentRequest() { + return array( + 'c' => self::$controller_name, + 'a' => self::$action_name, + 'params' => self::$params, + ); + } /** * Setteurs */ - public static function _controllerName ($controller_name) { + public static function _controllerName($controller_name) { self::$controller_name = $controller_name; } - public static function _actionName ($action_name) { + public static function _actionName($action_name) { self::$action_name = $action_name; } - public static function _params ($params) { + public static function _params($params) { if (!is_array($params)) { - $params = array ($params); + $params = array($params); } self::$params = $params; } - public static function _param ($key, $value = false) { + public static function _param($key, $value = false) { if ($value === false) { - unset (self::$params[$key]); + unset(self::$params[$key]); } else { self::$params[$key] = $value; } @@ -80,48 +80,69 @@ class Minz_Request { /** * Initialise la Request */ - public static function init () { - self::magicQuotesOff (); + public static function init() { + self::magicQuotesOff(); } /** - * Retourn le nom de domaine du site + * Return true if the request is over HTTPS, false otherwise (HTTP) */ - public static function getDomainName () { - return $_SERVER['HTTP_HOST']; + public static function isHttps() { + if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) { + return strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) === 'https'; + } else { + return isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on'; + } } /** - * Détermine la base de l'url - * @return la base de l'url + * Try to guess the base URL from $_SERVER information + * + * @return the base url (e.g. http://example.com/) */ - public static function getBaseUrl () { - $defaultBaseUrl = Minz_Configuration::baseUrl(); - if (!empty($defaultBaseUrl)) { - return $defaultBaseUrl; - } elseif (isset($_SERVER['REQUEST_URI'])) { - return dirname($_SERVER['REQUEST_URI']) . '/'; + public static function guessBaseUrl() { + $url = 'http'; + + $https = self::isHttps(); + + if (!empty($_SERVER['HTTP_HOST'])) { + $host = $_SERVER['HTTP_HOST']; + } elseif (!empty($_SERVER['SERVER_NAME'])) { + $host = $_SERVER['SERVER_NAME']; } else { - return '/'; + $host = 'localhost'; } - } - /** - * Récupère l'URI de la requête - * @return l'URI - */ - public static function getURI () { - if (isset ($_SERVER['REQUEST_URI'])) { - $base_url = self::getBaseUrl (); - $uri = $_SERVER['REQUEST_URI']; + if (!empty($_SERVER['HTTP_X_FORWARDED_PORT'])) { + $port = intval($_SERVER['HTTP_X_FORWARDED_PORT']); + } elseif (!empty($_SERVER['SERVER_PORT'])) { + $port = intval($_SERVER['SERVER_PORT']); + } else { + $port = $https ? 443 : 80; + } - $len_base_url = strlen ($base_url); - $real_uri = substr ($uri, $len_base_url); + if ($https) { + $url .= 's://' . $host . ($port == 443 ? '' : ':' . $port); } else { - $real_uri = ''; + $url .= '://' . $host . ($port == 80 ? '' : ':' . $port); } + if (isset($_SERVER['REQUEST_URI'])) { + $path = $_SERVER['REQUEST_URI']; + $url .= substr($path, -1) === '/' ? substr($path, 0, -1) : dirname($path); + } + + return filter_var($url, FILTER_SANITIZE_URL); + } - return $real_uri; + /** + * Return the base_url from configuration and add a suffix if given. + * + * @return the base_url with a suffix. + */ + public static function getBaseUrl() { + $conf = Minz_Configuration::get('system'); + $url = rtrim($conf->base_url, '/\\'); + return filter_var($url, FILTER_SANITIZE_URL); } /** @@ -130,24 +151,53 @@ class Minz_Request { * @param $redirect si vrai, force la redirection http * > sinon, le dispatcher recharge en interne */ - public static function forward ($url = array (), $redirect = false) { - $url = Minz_Url::checkUrl ($url); + public static function forward($url = array(), $redirect = false) { + if (!is_array($url)) { + header('Location: ' . $url); + exit(); + } + + $url = Minz_Url::checkUrl($url); if ($redirect) { - header ('Location: ' . Minz_Url::display ($url, 'php')); - exit (); + header('Location: ' . Minz_Url::display($url, 'php')); + exit(); } else { - self::$reseted = true; - - self::_controllerName ($url['c']); - self::_actionName ($url['a']); - self::_params (array_merge ( + self::_controllerName($url['c']); + self::_actionName($url['a']); + self::_params(array_merge( self::$params, $url['params'] )); + Minz_Dispatcher::reset(); } } + + /** + * Wrappers good notifications + redirection + * @param $msg notification content + * @param $url url array to where we should be forwarded + */ + public static function good($msg, $url = array()) { + Minz_Session::_param('notification', array( + 'type' => 'good', + 'content' => $msg + )); + + Minz_Request::forward($url, true); + } + + public static function bad($msg, $url = array()) { + Minz_Session::_param('notification', array( + 'type' => 'bad', + 'content' => $msg + )); + + Minz_Request::forward($url, true); + } + + /** * Permet de récupérer une variable de type $_GET * @param $param nom de la variable @@ -156,10 +206,10 @@ class Minz_Request { * $_GET si $param = false * $default si $_GET[$param] n'existe pas */ - public static function fetchGET ($param = false, $default = false) { + public static function fetchGET($param = false, $default = false) { if ($param === false) { return $_GET; - } elseif (isset ($_GET[$param])) { + } elseif (isset($_GET[$param])) { return $_GET[$param]; } else { return $default; @@ -174,10 +224,10 @@ class Minz_Request { * $_POST si $param = false * $default si $_POST[$param] n'existe pas */ - public static function fetchPOST ($param = false, $default = false) { + public static function fetchPOST($param = false, $default = false) { if ($param === false) { return $_POST; - } elseif (isset ($_POST[$param])) { + } elseif (isset($_POST[$param])) { return $_POST[$param]; } else { return $default; @@ -190,15 +240,16 @@ class Minz_Request { * $_POST * $_COOKIE */ - private static function magicQuotesOff () { - if (get_magic_quotes_gpc ()) { - $_GET = Minz_Helper::stripslashes_r ($_GET); - $_POST = Minz_Helper::stripslashes_r ($_POST); - $_COOKIE = Minz_Helper::stripslashes_r ($_COOKIE); + private static function magicQuotesOff() { + if (get_magic_quotes_gpc()) { + $_GET = Minz_Helper::stripslashes_r($_GET); + $_POST = Minz_Helper::stripslashes_r($_POST); + $_COOKIE = Minz_Helper::stripslashes_r($_COOKIE); } } - public static function isPost () { - return $_SERVER['REQUEST_METHOD'] === 'POST'; + public static function isPost() { + return isset($_SERVER['REQUEST_METHOD']) && + $_SERVER['REQUEST_METHOD'] === 'POST'; } } diff --git a/lib/Minz/Response.php b/lib/Minz/Response.php deleted file mode 100644 index f8ea3d946..000000000 --- a/lib/Minz/Response.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php -/** - * MINZ - Copyright 2011 Marien Fressinaud - * Sous licence AGPL3 <http://www.gnu.org/licenses/> -*/ - -/** - * Response représente la requête http renvoyée à l'utilisateur - */ -class Minz_Response { - private static $header = 'HTTP/1.0 200 OK'; - private static $body = ''; - - /** - * Mets à jour le body de la Response - * @param $text le texte à incorporer dans le body - */ - public static function setBody ($text) { - self::$body = $text; - } - - /** - * Mets à jour le header de la Response - * @param $code le code HTTP, valeurs possibles - * - 200 (OK) - * - 403 (Forbidden) - * - 404 (Forbidden) - * - 500 (Forbidden) -> par défaut si $code erroné - * - 503 (Forbidden) - */ - public static function setHeader ($code) { - switch ($code) { - case 200 : - self::$header = 'HTTP/1.0 200 OK'; - break; - case 403 : - self::$header = 'HTTP/1.0 403 Forbidden'; - break; - case 404 : - self::$header = 'HTTP/1.0 404 Not Found'; - break; - case 500 : - self::$header = 'HTTP/1.0 500 Internal Server Error'; - break; - case 503 : - self::$header = 'HTTP/1.0 503 Service Unavailable'; - break; - default : - self::$header = 'HTTP/1.0 500 Internal Server Error'; - } - } - - /** - * Envoie la Response à l'utilisateur - */ - public static function send () { - header (self::$header); - echo self::$body; - } -} diff --git a/lib/Minz/RouteNotFoundException.php b/lib/Minz/RouteNotFoundException.php deleted file mode 100644 index dc4f6fbad..000000000 --- a/lib/Minz/RouteNotFoundException.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php -class Minz_RouteNotFoundException extends Minz_Exception { - private $route; - - public function __construct ($route, $code = self::ERROR) { - $this->route = $route; - - $message = 'Route `' . $route . '` not found'; - - parent::__construct ($message, $code); - } - - public function route () { - return $this->route; - } -} diff --git a/lib/Minz/Router.php b/lib/Minz/Router.php deleted file mode 100644 index 1ccd72597..000000000 --- a/lib/Minz/Router.php +++ /dev/null @@ -1,209 +0,0 @@ -<?php -/** - * MINZ - Copyright 2011 Marien Fressinaud - * Sous licence AGPL3 <http://www.gnu.org/licenses/> -*/ - -/** - * La classe Router gère le routage de l'application - * Les routes sont définies dans APP_PATH.'/configuration/routes.php' - */ -class Minz_Router { - const ROUTES_PATH_NAME = '/configuration/routes.php'; - - private $routes = array (); - - /** - * Constructeur - * @exception FileNotExistException si ROUTES_PATH_NAME n'existe pas - * et que l'on utilise l'url rewriting - */ - public function __construct () { - if (Minz_Configuration::useUrlRewriting ()) { - if (file_exists (APP_PATH . self::ROUTES_PATH_NAME)) { - $routes = include ( - APP_PATH . self::ROUTES_PATH_NAME - ); - - if (!is_array ($routes)) { - $routes = array (); - } - - $this->routes = array_map ( - array ('Url', 'checkUrl'), - $routes - ); - } else { - throw new Minz_FileNotExistException ( - self::ROUTES_PATH_NAME, - Minz_Exception::ERROR - ); - } - } - } - - /** - * Initialise le Router en déterminant le couple Controller / Action - * Mets à jour la Request - * @exception RouteNotFoundException si l'uri n'est pas présente dans - * > la table de routage - */ - public function init () { - $url = array (); - - if (Minz_Configuration::useUrlRewriting ()) { - try { - $url = $this->buildWithRewriting (); - } catch (Minz_RouteNotFoundException $e) { - throw $e; - } - } else { - $url = $this->buildWithoutRewriting (); - } - - $url['params'] = array_merge ( - $url['params'], - Minz_Request::fetchPOST () - ); - - Minz_Request::forward ($url); - } - - /** - * Retourne un tableau représentant l'url passée par la barre d'adresses - * Ne se base PAS sur la table de routage - * @return tableau représentant l'url - */ - public function buildWithoutRewriting () { - $url = array (); - - $url['c'] = Minz_Request::fetchGET ( - 'c', - Minz_Request::defaultControllerName () - ); - $url['a'] = Minz_Request::fetchGET ( - 'a', - Minz_Request::defaultActionName () - ); - $url['params'] = Minz_Request::fetchGET (); - - // post-traitement - unset ($url['params']['c']); - unset ($url['params']['a']); - - return $url; - } - - /** - * Retourne un tableau représentant l'url passée par la barre d'adresses - * Se base sur la table de routage - * @return tableau représentant l'url - * @exception RouteNotFoundException si l'uri n'est pas présente dans - * > la table de routage - */ - public function buildWithRewriting () { - $url = array (); - $uri = Minz_Request::getURI (); - $find = false; - - foreach ($this->routes as $route) { - $regex = '*^' . $route['route'] . '$*'; - if (preg_match ($regex, $uri, $matches)) { - $url['c'] = $route['controller']; - $url['a'] = $route['action']; - $url['params'] = $this->getParams ( - $route['params'], - $matches - ); - $find = true; - break; - } - } - - if (!$find && $uri != '/') { - throw new Minz_RouteNotFoundException ( - $uri, - Minz_Exception::ERROR - ); - } - - // post-traitement - $url = Minz_Url::checkUrl ($url); - - return $url; - } - - /** - * Retourne l'uri d'une url en se basant sur la table de routage - * @param l'url sous forme de tableau - * @return l'uri formatée (string) selon une route trouvée - */ - public function printUriRewrited ($url) { - $route = $this->searchRoute ($url); - - if ($route !== false) { - return $this->replaceParams ($route, $url['params']); - } - - return ''; - } - - /** - * Recherche la route correspondante à une url - * @param l'url sous forme de tableau - * @return la route telle que spécifiée dans la table de routage, - * false si pas trouvée - */ - public function searchRoute ($url) { - foreach ($this->routes as $route) { - if ($route['controller'] == $url['c'] - && $route['action'] == $url['a']) { - // calcule la différence des tableaux de params - $params = array_flip ($route['params']); - $difference_params = array_diff_key ( - $params, - $url['params'] - ); - - // vérifie que pas de différence - // et le cas où $params est vide et pas $url['params'] - if (empty ($difference_params) - && (!empty ($params) || empty ($url['params']))) { - return $route; - } - } - } - - return false; - } - - /** - * Récupère un tableau dont - * - les clés sont définies dans $params_route - * - les valeurs sont situées dans $matches - * Le tableau $matches est décalé de +1 par rapport à $params_route - */ - private function getParams($params_route, $matches) { - $params = array (); - - for ($i = 0; $i < count ($params_route); $i++) { - $param = $params_route[$i]; - $params[$param] = $matches[$i + 1]; - } - - return $params; - } - - /** - * Remplace les éléments de la route par les valeurs contenues dans $params - */ - private function replaceParams ($route, $params_replace) { - $uri = $route['route']; - $params = array(); - foreach($route['params'] as $param) { - $uri = preg_replace('#\((.+)\)#U', $params_replace[$param], $uri, 1); - } - - return stripslashes($uri); - } -} diff --git a/lib/Minz/Session.php b/lib/Minz/Session.php index ddabc4658..c94f2b646 100644 --- a/lib/Minz/Session.php +++ b/lib/Minz/Session.php @@ -2,28 +2,20 @@ /** * La classe Session gère la session utilisateur - * C'est un singleton */ class Minz_Session { /** - * $session stocke les variables de session - */ - private static $session = array (); //TODO: Try to avoid having another local copy - - /** * Initialise la session, avec un nom - * Le nom de session est utilisé comme nom pour les cookies et les URLs (i.e. PHPSESSID). + * Le nom de session est utilisé comme nom pour les cookies et les URLs(i.e. PHPSESSID). * Il ne doit contenir que des caractères alphanumériques ; il doit être court et descriptif */ - public static function init ($name) { - // démarre la session - session_name ($name); - session_set_cookie_params (0, dirname(empty($_SERVER['REQUEST_URI']) ? '/' : dirname($_SERVER['REQUEST_URI'])), null, false, true); - session_start (); + public static function init($name) { + $cookie = session_get_cookie_params(); + self::keepCookie($cookie['lifetime']); - if (isset ($_SESSION)) { - self::$session = $_SESSION; - } + // démarre la session + session_name($name); + session_start(); } @@ -32,8 +24,8 @@ class Minz_Session { * @param $p le paramètre à récupérer * @return la valeur de la variable de session, false si n'existe pas */ - public static function param ($p, $default = false) { - return isset(self::$session[$p]) ? self::$session[$p] : $default; + public static function param($p, $default = false) { + return isset($_SESSION[$p]) ? $_SESSION[$p] : $default; } @@ -42,13 +34,11 @@ class Minz_Session { * @param $p le paramètre à créer ou modifier * @param $v la valeur à attribuer, false pour supprimer */ - public static function _param ($p, $v = false) { + public static function _param($p, $v = false) { if ($v === false) { - unset ($_SESSION[$p]); - unset (self::$session[$p]); + unset($_SESSION[$p]); } else { $_SESSION[$p] = $v; - self::$session[$p] = $v; } } @@ -57,15 +47,54 @@ class Minz_Session { * Permet d'effacer une session * @param $force si à false, n'efface pas le paramètre de langue */ - public static function unset_session ($force = false) { - $language = self::param ('language'); + public static function unset_session($force = false) { + $language = self::param('language'); session_destroy(); - self::$session = array (); + $_SESSION = array(); if (!$force) { - self::_param ('language', $language); - Minz_Translate::reset (); + self::_param('language', $language); + Minz_Translate::reset($language); } } + + public static function getCookieDir() { + // Get the script_name (e.g. /p/i/index.php) and keep only the path. + $cookie_dir = empty($_SERVER['REQUEST_URI']) ? '/' : $_SERVER['REQUEST_URI']; + if (substr($cookie_dir, -1) !== '/') { + $cookie_dir = dirname($cookie_dir) . '/'; + } + return $cookie_dir; + } + + /** + * Spécifie la durée de vie des cookies + * @param $l la durée de vie + */ + public static function keepCookie($l) { + session_set_cookie_params($l, self::getCookieDir(), '', Minz_Request::isHttps(), true); + } + + + /** + * Régénère un id de session. + * Utile pour appeler session_set_cookie_params après session_start() + */ + public static function regenerateID() { + session_regenerate_id(true); + } + + public static function deleteLongTermCookie($name) { + setcookie($name, '', 1, '', '', Minz_Request::isHttps(), true); + } + + public static function setLongTermCookie($name, $value, $expire) { + setcookie($name, $value, $expire, '', '', Minz_Request::isHttps(), true); + } + + public static function getLongTermCookie($name) { + return isset($_COOKIE[$name]) ? $_COOKIE[$name] : null; + } + } diff --git a/lib/Minz/Translate.php b/lib/Minz/Translate.php index e14f783f7..baddcb424 100644 --- a/lib/Minz/Translate.php +++ b/lib/Minz/Translate.php @@ -5,67 +5,226 @@ */ /** - * La classe Translate se charge de la traduction - * Utilise les fichiers du répertoire /app/i18n/ + * This class is used for the internationalization. + * It uses files in `./app/i18n/` */ class Minz_Translate { /** - * $language est la langue à afficher + * $path_list is the list of registered base path to search translations. */ - private static $language; - + private static $path_list = array(); + + /** + * $lang_name is the name of the current language to use. + */ + private static $lang_name; + + /** + * $lang_files is a list of registered i18n files. + */ + private static $lang_files = array(); + + /** + * $translates is a cache for i18n translation. + */ + private static $translates = array(); + + /** + * Init the translation object. + * @param $lang_name the lang to show. + */ + public static function init($lang_name = null) { + self::$lang_name = $lang_name; + self::$lang_files = array(); + self::$translates = array(); + self::registerPath(APP_PATH . '/i18n'); + foreach (self::$path_list as $path) { + self::loadLang($path); + } + } + /** - * $translates est le tableau de correspondance - * $key => $traduction + * Reset the translation object with a new language. + * @param $lang_name the new language to use */ - private static $translates = array (); - + public static function reset($lang_name) { + self::$lang_name = $lang_name; + self::$lang_files = array(); + self::$translates = array(); + foreach (self::$path_list as $path) { + self::loadLang($path); + } + } + /** - * Inclus le fichier de langue qui va bien - * l'enregistre dans $translates + * Return the list of available languages. + * @return an array containing langs found in different registered paths. */ - public static function init () { - $l = Minz_Configuration::language (); - self::$language = Minz_Session::param ('language', $l); - - $l_path = APP_PATH . '/i18n/' . self::$language . '.php'; - - if (file_exists ($l_path)) { - self::$translates = include ($l_path); + public static function availableLanguages() { + $list_langs = array(); + + foreach (self::$path_list as $path) { + $path_langs = array_values(array_diff( + scandir($path), + array('..', '.') + )); + + $list_langs = array_merge($list_langs, $path_langs); } + + return array_unique($list_langs); } - + /** - * Alias de init + * Register a new path. + * @param $path a path containing i18n directories (e.g. ./en/, ./fr/). */ - public static function reset () { - self::init (); + public static function registerPath($path) { + if (in_array($path, self::$path_list)) { + return; + } + + self::$path_list[] = $path; + self::loadLang($path); } - + /** - * Traduit une clé en sa valeur du tableau $translates - * @param $key la clé à traduire - * @return la valeur correspondante à la clé - * > si non présente dans le tableau, on retourne la clé elle-même + * Load translations of the current language from the given path. + * @param $path the path containing i18n directories. + */ + private static function loadLang($path) { + $lang_path = $path . '/' . self::$lang_name; + if (!file_exists($lang_path) || is_null(self::$lang_name)) { + // The lang path does not exist, nothing more to do. + return; + } + + $list_i18n_files = array_values(array_diff( + scandir($lang_path), + array('..', '.') + )); + + // Each file basename correspond to a top-level i18n key. For each of + // these keys we store the file pathname and mark translations must be + // reloaded (by setting $translates[$i18n_key] to null). + foreach ($list_i18n_files as $i18n_filename) { + $i18n_key = basename($i18n_filename, '.php'); + if (!isset(self::$lang_files[$i18n_key])) { + self::$lang_files[$i18n_key] = array(); + } + self::$lang_files[$i18n_key][] = $lang_path . '/' . $i18n_filename; + self::$translates[$i18n_key] = null; + } + } + + /** + * Load the files associated to $key into $translates. + * @param $key the top level i18n key we want to load. + */ + private static function loadKey($key) { + // The top level key is not in $lang_files, it means it does not exist! + if (!isset(self::$lang_files[$key])) { + Minz_Log::debug($key . ' is not a valid top level key'); + return false; + } + + self::$translates[$key] = array(); + + foreach (self::$lang_files[$key] as $lang_pathname) { + $i18n_array = include($lang_pathname); + if (!is_array($i18n_array)) { + Minz_Log::warning('`' . $lang_pathname . '` does not contain a PHP array'); + continue; + } + + // We must avoid to erase previous data so we just override them if + // needed. + self::$translates[$key] = array_replace_recursive( + self::$translates[$key], $i18n_array + ); + } + + return true; + } + + /** + * Translate a key into its corresponding value based on selected language. + * @param $key the key to translate. + * @param additional parameters for variable keys. + * @return the value corresponding to the key. + * If no value is found, return the key itself. */ - public static function t ($key) { - $translate = $key; - - if (isset (self::$translates[$key])) { - $translate = self::$translates[$key]; + public static function t($key) { + $group = explode('.', $key); + + if (count($group) < 2) { + Minz_Log::debug($key . ' is not in a valid format'); + $top_level = 'gen'; + } else { + $top_level = array_shift($group); } - $args = func_get_args (); + // If $translates[$top_level] is null it means we have to load the + // corresponding files. + if (!isset(self::$translates[$top_level]) || + is_null(self::$translates[$top_level])) { + $res = self::loadKey($top_level); + if (!$res) { + return $key; + } + } + + // Go through the i18n keys to get the correct translation value. + $translates = self::$translates[$top_level]; + $size_group = count($group); + $level_processed = 0; + $translation_value = $key; + foreach ($group as $i18n_level) { + $level_processed++; + if (!isset($translates[$i18n_level])) { + Minz_Log::debug($key . ' is not a valid key'); + return $key; + } + + if ($level_processed < $size_group) { + $translates = $translates[$i18n_level]; + } else { + $translation_value = $translates[$i18n_level]; + } + } + + if (is_array($translation_value)) { + if (isset($translation_value['_'])) { + $translation_value = $translation_value['_']; + } else { + Minz_Log::debug($key . ' is not a valid key'); + return $key; + } + } + + // Get the facultative arguments to replace i18n variables. + $args = func_get_args(); unset($args[0]); - - return vsprintf ($translate, $args); + + return vsprintf($translation_value, $args); } - + /** - * Retourne la langue utilisée actuellement - * @return la langue + * Return the current language. */ - public static function language () { - return self::$language; + public static function language() { + return self::$lang_name; } } + + +/** + * Alias for Minz_Translate::t() + */ +function _t($key) { + $args = func_get_args(); + unset($args[0]); + array_unshift($args, $key); + + return call_user_func_array('Minz_Translate::t', $args); +} diff --git a/lib/Minz/Url.php b/lib/Minz/Url.php index 17f1ddece..99c0443c1 100644 --- a/lib/Minz/Url.php +++ b/lib/Minz/Url.php @@ -5,13 +5,11 @@ */ class Minz_Url { /** - * Affiche une Url formatée selon que l'on utilise l'url_rewriting ou non - * si oui, on cherche dans la table de routage la correspondance pour formater + * Affiche une Url formatée * @param $url l'url à formater définie comme un tableau : * $url['c'] = controller * $url['a'] = action * $url['params'] = tableau des paramètres supplémentaires - * $url['protocol'] = protocole à utiliser (http par défaut) * ou comme une chaîne de caractère * @param $encodage pour indiquer comment encoder les & (& ou & pour html) * @return l'url formatée @@ -20,77 +18,77 @@ class Minz_Url { $isArray = is_array($url); if ($isArray) { - $url = self::checkUrl ($url); + $url = self::checkUrl($url); } $url_string = ''; if ($absolute) { - if ($isArray && isset ($url['protocol'])) { - $protocol = $url['protocol']; - } elseif (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') { - $protocol = 'https:'; - } else { - $protocol = 'http:'; + $url_string = Minz_Request::getBaseUrl(); + if ($url_string == '') { + $url_string = Minz_Request::guessBaseUrl(); + } + if ($isArray) { + $url_string .= PUBLIC_TO_INDEX_PATH; + } + if ($absolute === 'root') { + $url_string = parse_url($url_string, PHP_URL_PATH); } - $url_string = $protocol . '//' . Minz_Request::getDomainName () . Minz_Request::getBaseUrl (); } else { $url_string = $isArray ? '.' : PUBLIC_RELATIVE; } if ($isArray) { - $router = new Minz_Router (); - - if (Minz_Configuration::useUrlRewriting ()) { - $url_string .= $router->printUriRewrited ($url); - } else { - $url_string .= self::printUri ($url, $encodage); - } + $url_string .= self::printUri($url, $encodage); + } elseif ($encodage === 'html') { + $url_string = Minz_Helper::htmlspecialchars_utf8($url_string . $url); } else { $url_string .= $url; } return $url_string; } - + /** - * Construit l'URI d'une URL sans url rewriting + * Construit l'URI d'une URL * @param l'url sous forme de tableau * @param $encodage pour indiquer comment encoder les & (& ou & pour html) * @return l'uri sous la forme ?key=value&key2=value2 */ - private static function printUri ($url, $encodage) { + private static function printUri($url, $encodage) { $uri = ''; - $separator = '/?'; - - if($encodage == 'html') { + $separator = '?'; + + if ($encodage === 'html') { $and = '&'; } else { $and = '&'; } - - if (isset ($url['c']) - && $url['c'] != Minz_Request::defaultControllerName ()) { + + if (isset($url['c']) + && $url['c'] != Minz_Request::defaultControllerName()) { $uri .= $separator . 'c=' . $url['c']; $separator = $and; } - - if (isset ($url['a']) - && $url['a'] != Minz_Request::defaultActionName ()) { + + if (isset($url['a']) + && $url['a'] != Minz_Request::defaultActionName()) { $uri .= $separator . 'a=' . $url['a']; $separator = $and; } - - if (isset ($url['params'])) { + + if (isset($url['params'])) { + unset($url['params']['c']); + unset($url['params']['a']); foreach ($url['params'] as $key => $param) { - $uri .= $separator . $key . '=' . $param; + $uri .= $separator . urlencode($key) . '=' . urlencode($param); $separator = $and; } } - + return $uri; } - + /** * Vérifie que les éléments du tableau représentant une url soit ok * @param l'url sous forme de tableau (sinon renverra directement $url) @@ -98,7 +96,7 @@ class Minz_Url { */ public static function checkUrl ($url) { $url_checked = $url; - + if (is_array ($url)) { if (!isset ($url['c'])) { $url_checked['c'] = Minz_Request::defaultControllerName (); @@ -110,7 +108,7 @@ class Minz_Url { $url_checked['params'] = array (); } } - + return $url_checked; } } diff --git a/lib/Minz/View.php b/lib/Minz/View.php index e170bd406..8c5230ab6 100644 --- a/lib/Minz/View.php +++ b/lib/Minz/View.php @@ -13,8 +13,9 @@ class Minz_View { const LAYOUT_FILENAME = '/layout.phtml'; private $view_filename = ''; - private $use_layout = null; + private $use_layout = true; + private static $base_pathnames = array(APP_PATH); private static $title = ''; private static $styles = array (); private static $scripts = array (); @@ -26,21 +27,37 @@ class Minz_View { * Détermine si on utilise un layout ou non */ public function __construct () { - $this->view_filename = APP_PATH - . self::VIEWS_PATH_NAME . '/' - . Minz_Request::controllerName () . '/' - . Minz_Request::actionName () . '.phtml'; + $this->change_view(Minz_Request::controllerName(), + Minz_Request::actionName()); - self::$title = Minz_Configuration::title (); + $conf = Minz_Configuration::get('system'); + self::$title = $conf->title; + } + + /** + * Change le fichier de vue en fonction d'un controller / action + */ + public function change_view($controller_name, $action_name) { + $this->view_filename = self::VIEWS_PATH_NAME . '/' + . $controller_name . '/' + . $action_name . '.phtml'; + } + + /** + * Add a base pathname to search views. + * + * New pathnames will be added at the beginning of the list. + * + * @param $base_pathname the new base pathname. + */ + public static function addBasePathname($base_pathname) { + array_unshift(self::$base_pathnames, $base_pathname); } /** * Construit la vue */ public function build () { - if ($this->use_layout === null) { //TODO: avoid file_exists and require views to be explicit - $this->use_layout = file_exists (APP_PATH . self::LAYOUT_PATH_NAME . self::LAYOUT_FILENAME); - } if ($this->use_layout) { $this->buildLayout (); } else { @@ -49,24 +66,41 @@ class Minz_View { } /** + * Include a view file. + * + * The file is searched inside list of $base_pathnames. + * + * @param $filename the name of the file to include. + * @return true if the file has been included, false else. + */ + private function includeFile($filename) { + // We search the filename in the list of base pathnames. Only the first view + // found is considered. + foreach (self::$base_pathnames as $base) { + $absolute_filename = $base . $filename; + if (file_exists($absolute_filename)) { + include $absolute_filename; + return true; + } + } + + return false; + } + + /** * Construit le layout */ public function buildLayout () { - include ( - APP_PATH - . self::LAYOUT_PATH_NAME - . self::LAYOUT_FILENAME - ); + header('Content-Type: text/html; charset=UTF-8'); + $this->includeFile(self::LAYOUT_PATH_NAME . self::LAYOUT_FILENAME); } /** * Affiche la Vue en elle-même */ public function render () { - if ((include($this->view_filename)) === false) { - Minz_Log::record ('File not found: `' - . $this->view_filename . '`', - Minz_Log::NOTICE); + if (!$this->includeFile($this->view_filename)) { + Minz_Log::notice('File not found: `' . $this->view_filename . '`'); } } @@ -75,14 +109,9 @@ class Minz_View { * @param $part l'élément partial à ajouter */ public function partial ($part) { - $fic_partial = APP_PATH - . self::LAYOUT_PATH_NAME . '/' - . $part . '.phtml'; - - if ((include($fic_partial)) === false) { - Minz_Log::record ('File not found: `' - . $fic_partial . '`', - Minz_Log::WARNING); + $fic_partial = self::LAYOUT_PATH_NAME . '/' . $part . '.phtml'; + if (!$this->includeFile($fic_partial)) { + Minz_Log::warning('File not found: `' . $fic_partial . '`'); } } @@ -91,18 +120,23 @@ class Minz_View { * @param $helper l'élément à afficher */ public function renderHelper ($helper) { - $fic_helper = APP_PATH - . '/views/helpers/' - . $helper . '.phtml'; - - if ((include($fic_helper)) === false) {; - Minz_Log::record ('File not found: `' - . $fic_helper . '`', - Minz_Log::WARNING); + $fic_helper = '/views/helpers/' . $helper . '.phtml'; + if (!$this->includeFile($fic_helper)) { + Minz_Log::warning('File not found: `' . $fic_helper . '`'); } } /** + * Retourne renderHelper() dans une chaîne + * @param $helper l'élément à traîter + */ + public function helperToString($helper) { + ob_start(); + $this->renderHelper($helper); + return ob_get_clean(); + } + + /** * Permet de choisir si on souhaite utiliser le layout * @param $use true si on souhaite utiliser le layout, false sinon */ diff --git a/lib/SimplePie/SimplePie.php b/lib/SimplePie/SimplePie.php index d7aaeb0c5..0f2fdbb87 100644 --- a/lib/SimplePie/SimplePie.php +++ b/lib/SimplePie/SimplePie.php @@ -75,6 +75,12 @@ define('SIMPLEPIE_USERAGENT', SIMPLEPIE_NAME . '/' . SIMPLEPIE_VERSION . ' (Feed define('SIMPLEPIE_LINKBACK', '<a href="' . SIMPLEPIE_URL . '" title="' . SIMPLEPIE_NAME . ' ' . SIMPLEPIE_VERSION . '">' . SIMPLEPIE_NAME . '</a>'); /** + * Use syslog to report HTTP requests done by SimplePie. + * @see SimplePie::set_syslog() + */ +define('SIMPLEPIE_SYSLOG', true); //FreshRSS + +/** * No Autodiscovery * @see SimplePie::set_autodiscovery_level() */ @@ -446,6 +452,13 @@ class SimplePie public $feed_url; /** + * @var string Original feed URL, or new feed URL iff HTTP 301 Moved Permanently + * @see SimplePie::subscribe_url() + * @access private + */ + public $permanent_url = null; + + /** * @var object Instance of SimplePie_File to use as a feed * @see SimplePie::set_file() * @access private @@ -467,6 +480,13 @@ class SimplePie public $timeout = 10; /** + * @var array Custom curl options + * @see SimplePie::set_curl_options() + * @access private + */ + public $curl_options = array(); + + /** * @var bool Forces fsockopen() to be used for remote files instead * of cURL, even if a new enough version is installed * @see SimplePie::force_fsockopen() @@ -616,6 +636,12 @@ class SimplePie public $strip_htmltags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style'); /** + * Use syslog to report HTTP requests done by SimplePie. + * @see SimplePie::set_syslog() + */ + public $syslog_enabled = SIMPLEPIE_SYSLOG; + + /** * The SimplePie class contains feed level data and options * * To use SimplePie, create the SimplePie object with no parameters. You can @@ -735,6 +761,7 @@ class SimplePie else { $this->feed_url = $this->registry->call('Misc', 'fix_protocol', array($url, 1)); + $this->permanent_url = $this->feed_url; } } @@ -749,6 +776,7 @@ class SimplePie if ($file instanceof SimplePie_File) { $this->feed_url = $file->url; + $this->permanent_url = $this->feed_url; $this->file =& $file; return true; } @@ -786,6 +814,19 @@ class SimplePie { $this->timeout = (int) $timeout; } + + /** + * Set custom curl options + * + * This allows you to change default curl options + * + * @since 1.0 Beta 3 + * @param array $curl_options Curl options to add to default settings + */ + public function set_curl_options(array $curl_options = array()) + { + $this->curl_options = $curl_options; + } /** * Force SimplePie to use fsockopen() instead of cURL @@ -1082,6 +1123,7 @@ class SimplePie $this->strip_attributes(false); $this->add_attributes(false); $this->set_image_handler(false); + $this->set_https_domains(array()); } } @@ -1127,7 +1169,7 @@ class SimplePie $this->sanitize->strip_attributes($attribs); } - public function add_attributes($attribs = '') + public function add_attributes($attribs = '') //FreshRSS { if ($attribs === '') { @@ -1137,6 +1179,14 @@ class SimplePie } /** + * Use syslog to report HTTP requests done by SimplePie. + */ + public function set_syslog($value = SIMPLEPIE_SYSLOG) //FreshRSS + { + $this->syslog_enabled = $value == true; + } + + /** * Set the output encoding * * Allows you to override SimplePie's output to match that of your webpage. @@ -1185,6 +1235,19 @@ class SimplePie } /** + * Set the list of domains for which force HTTPS. + * @see SimplePie_Sanitize::set_https_domains() + * FreshRSS + */ + public function set_https_domains($domains = array()) + { + if (is_array($domains)) + { + $this->sanitize->set_https_domains($domains); + } + } + + /** * Set the handler to enable the display of cached images. * * @param str $page Web-accessible path to the handler_image.php file. @@ -1222,7 +1285,8 @@ class SimplePie $this->enable_exceptions = $enable; } - function cleanMd5($rss) { //FreshRSS + function cleanMd5($rss) + { return md5(preg_replace(array('#<(lastBuildDate|pubDate|updated|feedDate|dc:date|slash:comments)>[^<]+</\\1>#', '#<!--.+?-->#s'), '', $rss)); } @@ -1240,6 +1304,7 @@ class SimplePie // Check absolute bare minimum requirements. if (!extension_loaded('xml') || !extension_loaded('pcre')) { + $this->error = 'XML or PCRE extensions not loaded!'; return false; } // Then check the xml extension is sane (i.e., libxml 2.7.x issue on PHP < 5.2.9 and libxml 2.7.0 to 2.7.2 on any version) if we don't have xmlreader. @@ -1267,7 +1332,7 @@ class SimplePie // Pass whatever was set with config options over to the sanitizer. // Pass the classes in for legacy support; new classes should use the registry instead $this->sanitize->pass_cache_data($this->cache, $this->cache_location, $this->cache_name_function, $this->registry->get_class('Cache')); - $this->sanitize->pass_file_data($this->registry->get_class('File'), $this->timeout, $this->useragent, $this->force_fsockopen); + $this->sanitize->pass_file_data($this->registry->get_class('File'), $this->timeout, $this->useragent, $this->force_fsockopen, $this->curl_options); if (!empty($this->multifeed_url)) { @@ -1312,7 +1377,7 @@ class SimplePie // Fetch the data via SimplePie_File into $this->raw_data if (($fetched = $this->fetch_data($cache)) === true) { - return $this->data['mtime']; //FreshRSS + return $this->data['mtime']; } elseif ($fetched === false) { return false; @@ -1320,7 +1385,8 @@ class SimplePie list($headers, $sniffed) = $fetched; - if (isset($this->data['md5'])) { //FreshRSS + if (isset($this->data['md5'])) + { $md5 = $this->data['md5']; } } @@ -1331,7 +1397,7 @@ class SimplePie // First check to see if input has been overridden. if ($this->input_encoding !== false) { - $encodings[] = strtoupper($this->input_encoding); //FreshRSS + $encodings[] = strtoupper($this->input_encoding); } $application_types = array('application/xml', 'application/xml-dtd', 'application/xml-external-parsed-entity'); @@ -1355,7 +1421,7 @@ class SimplePie { if (isset($headers['content-type']) && preg_match('/;\x20?charset=([^;]*)/i', $headers['content-type'], $charset)) { - $encodings[] = strtoupper($charset[1]); //FreshRSS + $encodings[] = strtoupper($charset[1]); } else { @@ -1404,8 +1470,8 @@ class SimplePie $this->data['headers'] = $headers; } $this->data['build'] = SIMPLEPIE_BUILD; - $this->data['mtime'] = time(); //FreshRSS - $this->data['md5'] = empty($md5) ? $this->cleanMd5($this->raw_data) : $md5; //FreshRSS + $this->data['mtime'] = time(); + $this->data['md5'] = empty($md5) ? $this->cleanMd5($this->raw_data) : $md5; // Cache the file if caching is enabled if ($cache && !$cache->save($this)) @@ -1420,7 +1486,7 @@ class SimplePie if (isset($parser)) { // We have an error, just set SimplePie_Misc::error to it and quit - $this->error = sprintf('This XML document is invalid, likely due to invalid characters. XML error: %s at line %d, column %d', $parser->get_error_string(), $parser->get_current_line(), $parser->get_current_column()); + $this->error = sprintf('This XML document is invalid, likely due to invalid characters. XML error: %s at line %d, column %d, encoding %s, URL: %s', $parser->get_error_string(), $parser->get_current_line(), $parser->get_current_column(), $encoding, $this->feed_url); } else { @@ -1446,7 +1512,12 @@ class SimplePie { // Load the Cache $this->data = $cache->load(); - if (!empty($this->data)) + if ($cache->mtime() + $this->cache_duration > time()) + { + $this->raw_data = false; + return true; // If the cache is still valid, just return true + } + elseif (!empty($this->data)) { // If the cache is for an outdated build of SimplePie if (!isset($this->data['build']) || $this->data['build'] !== SIMPLEPIE_BUILD) @@ -1478,63 +1549,58 @@ class SimplePie } } // Check if the cache has been updated - elseif ($cache->mtime() + $this->cache_duration < time()) + else { - // If we have last-modified and/or etag set - //if (isset($this->data['headers']['last-modified']) || isset($this->data['headers']['etag'])) //FreshRSS removed + $headers = array( + 'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1', + ); + if (isset($this->data['headers']['last-modified'])) { - $headers = array( - 'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1', - ); - if (isset($this->data['headers']['last-modified'])) - { - $headers['if-modified-since'] = $this->data['headers']['last-modified']; - } - if (isset($this->data['headers']['etag'])) - { - $headers['if-none-match'] = $this->data['headers']['etag']; - } + $headers['if-modified-since'] = $this->data['headers']['last-modified']; + } + if (isset($this->data['headers']['etag'])) + { + $headers['if-none-match'] = $this->data['headers']['etag']; + } - $file = $this->registry->create('File', array($this->feed_url, $this->timeout, 5, $headers, $this->useragent, $this->force_fsockopen)); //FreshRSS + $file = $this->registry->create('File', array($this->feed_url, $this->timeout, 5, $headers, $this->useragent, $this->force_fsockopen, $this->curl_options)); - if ($file->success) + if ($file->success) + { + if ($file->status_code === 304) { - if ($file->status_code === 304) - { - $cache->touch(); - return true; - } + $cache->touch(); + return true; } - else + } + else + { + $cache->touch(); + $this->error = $file->error; + return !empty($this->data); + } + + $md5 = $this->cleanMd5($file->body); + if ($this->data['md5'] === $md5) { + if ($this->syslog_enabled) { - $this->error = $file->error; //FreshRSS - return !empty($this->data); //FreshRSS - //unset($file); //FreshRSS removed + syslog(LOG_DEBUG, 'SimplePie MD5 cache match for ' . SimplePie_Misc::url_remove_credentials($this->feed_url)); } - } - { //FreshRSS - $md5 = $this->cleanMd5($file->body); - if ($this->data['md5'] === $md5) { - syslog(LOG_DEBUG, 'SimplePie MD5 cache match for ' . $this->feed_url); - $cache->touch(); - return true; //Content unchanged even though server did not send a 304 - } else { - syslog(LOG_DEBUG, 'SimplePie MD5 cache no match for ' . $this->feed_url); - $this->data['md5'] = $md5; + $cache->touch(); + return true; //Content unchanged even though server did not send a 304 + } else { + if ($this->syslog_enabled) + { + syslog(LOG_DEBUG, 'SimplePie MD5 cache no match for ' . SimplePie_Misc::url_remove_credentials($this->feed_url)); } + $this->data['md5'] = $md5; } } - // If the cache is still valid, just return true - else - { - $this->raw_data = false; - return true; - } } - // If the cache is empty, delete it + // If the cache is empty else { - $cache->unlink(); + $cache->touch(); //To keep the date/time of the last tentative update $this->data = array(); } } @@ -1550,7 +1616,7 @@ class SimplePie $headers = array( 'Accept' => 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1', ); - $file = $this->registry->create('File', array($this->feed_url, $this->timeout, 5, $headers, $this->useragent, $this->force_fsockopen)); + $file = $this->registry->create('File', array($this->feed_url, $this->timeout, 5, $headers, $this->useragent, $this->force_fsockopen, $this->curl_options)); } } // If the file connection has an error, set SimplePie::error to that and quit @@ -1567,13 +1633,15 @@ class SimplePie if (!$locate->is_feed($file)) { + $copyStatusCode = $file->status_code; + $copyContentType = $file->headers['content-type']; // We need to unset this so that if SimplePie::set_file() has been called that object is untouched unset($file); try { if (!($file = $locate->find($this->autodiscovery, $this->all_discovered_feeds))) { - $this->error = "A feed could not be found at $this->feed_url. A feed with an invalid mime type may fall victim to this error, or " . SIMPLEPIE_NAME . " was unable to auto-discover it.. Use force_feed() if you are certain this URL is a real feed."; + $this->error = "A feed could not be found at `$this->feed_url`; the status code is `$copyStatusCode` and content-type is `$copyContentType`"; $this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, __FILE__, __LINE__)); return false; } @@ -1588,8 +1656,8 @@ class SimplePie if ($cache) { $this->data = array('url' => $this->feed_url, 'feed_url' => $file->url, 'build' => SIMPLEPIE_BUILD); - $this->data['mtime'] = time(); //FreshRSS - $this->data['md5'] = empty($md5) ? $this->cleanMd5($file->body) : $md5; //FreshRSS + $this->data['mtime'] = time(); + $this->data['md5'] = empty($md5) ? $this->cleanMd5($file->body) : $md5; if (!$cache->save($this)) { trigger_error("$this->cache_location is not writeable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.", E_USER_WARNING); @@ -1601,8 +1669,9 @@ class SimplePie $locate = null; } + $file->body = trim($file->body); $this->raw_data = $file->body; - + $this->permanent_url = $file->permanent_url; $headers = $file->headers; $sniffer = $this->registry->create('Content_Type_Sniffer', array(&$file)); $sniffed = $sniffer->get_type(); @@ -1788,26 +1857,39 @@ class SimplePie /** * Get the URL for the feed + * + * When the 'permanent' mode is enabled, returns the original feed URL, + * except in the case of an `HTTP 301 Moved Permanently` status response, + * in which case the location of the first redirection is returned. * - * May or may not be different from the URL passed to {@see set_feed_url()}, + * When the 'permanent' mode is disabled (default), + * may or may not be different from the URL passed to {@see set_feed_url()}, * depending on whether auto-discovery was used. * * @since Preview Release (previously called `get_feed_url()` since SimplePie 0.8.) - * @todo If we have a perm redirect we should return the new URL - * @todo When we make the above change, let's support <itunes:new-feed-url> as well + * @todo Support <itunes:new-feed-url> * @todo Also, |atom:link|@rel=self + * @param bool $permanent Permanent mode to return only the original URL or the first redirection + * iff it is a 301 redirection * @return string|null */ - public function subscribe_url() + public function subscribe_url($permanent = false) { - if ($this->feed_url !== null) + if ($permanent) { - return $this->sanitize($this->feed_url, SIMPLEPIE_CONSTRUCT_IRI); + if ($this->permanent_url !== null) + { + return $this->sanitize($this->permanent_url, SIMPLEPIE_CONSTRUCT_IRI); + } } else { - return null; + if ($this->feed_url !== null) + { + return $this->sanitize($this->feed_url, SIMPLEPIE_CONSTRUCT_IRI); + } } + return null; } /** diff --git a/lib/SimplePie/SimplePie/Cache/File.php b/lib/SimplePie/SimplePie/Cache/File.php index 3b163545b..72e75a4b6 100644 --- a/lib/SimplePie/SimplePie/Cache/File.php +++ b/lib/SimplePie/SimplePie/Cache/File.php @@ -136,11 +136,7 @@ class SimplePie_Cache_File implements SimplePie_Cache_Base */ public function mtime() { - if (file_exists($this->name)) - { - return filemtime($this->name); - } - return false; + return @filemtime($this->name); } /** @@ -150,11 +146,7 @@ class SimplePie_Cache_File implements SimplePie_Cache_Base */ public function touch() { - if (file_exists($this->name)) - { - return touch($this->name); - } - return false; + return @touch($this->name); } /** diff --git a/lib/SimplePie/SimplePie/Content/Type/Sniffer.php b/lib/SimplePie/SimplePie/Content/Type/Sniffer.php index a32f47f59..ec0bf0952 100644 --- a/lib/SimplePie/SimplePie/Content/Type/Sniffer.php +++ b/lib/SimplePie/SimplePie/Content/Type/Sniffer.php @@ -109,9 +109,7 @@ class SimplePie_Content_Type_Sniffer { return $this->unknown(); } - elseif (substr($official, -4) === '+xml' - || $official === 'text/xml' - || $official === 'application/xml') + elseif (substr($official, -4) === '+xml') { return $official; } @@ -126,7 +124,9 @@ class SimplePie_Content_Type_Sniffer return $official; } } - elseif ($official === 'text/html') + elseif ($official === 'text/html' + || $official === 'text/xml' + || $official === 'application/xml') { return $this->feed_or_html(); } @@ -256,7 +256,12 @@ class SimplePie_Content_Type_Sniffer public function feed_or_html() { $len = strlen($this->file->body); - $pos = strspn($this->file->body, "\x09\x0A\x0D\x20"); + $pos = 0; + if (isset($this->file->body[2]) && $this->file->body[0] === "\xEF" && + $this->file->body[1] === "\xBB" && $this->file->body[2] === "\xBF") { + $pos += 3; //UTF-8 BOM + } + $pos += strspn($this->file->body, "\x09\x0A\x0D\x20", $pos); while ($pos < $len) { diff --git a/lib/SimplePie/SimplePie/Decode/HTML/Entities.php b/lib/SimplePie/SimplePie/Decode/HTML/Entities.php index cde06c884..46b3a1dff 100644 --- a/lib/SimplePie/SimplePie/Decode/HTML/Entities.php +++ b/lib/SimplePie/SimplePie/Decode/HTML/Entities.php @@ -169,7 +169,6 @@ class SimplePie_Decode_HTML_Entities case "\x09": case "\x0A": case "\x0B": - case "\x0B": case "\x0C": case "\x20": case "\x3C": diff --git a/lib/SimplePie/SimplePie/File.php b/lib/SimplePie/SimplePie/File.php index faf5dd1f1..45994d102 100644 --- a/lib/SimplePie/SimplePie/File.php +++ b/lib/SimplePie/SimplePie/File.php @@ -64,8 +64,9 @@ class SimplePie_File var $redirects = 0; var $error; var $method = SIMPLEPIE_FILE_SOURCE_NONE; + var $permanent_url; //FreshRSS - public function __construct($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false) + public function __construct($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false, $curl_options = array(), $syslog_enabled = SIMPLEPIE_SYSLOG) { if (class_exists('idna_convert')) { @@ -74,10 +75,14 @@ class SimplePie_File $url = SimplePie_Misc::compress_parse_url($parsed['scheme'], $idn->encode($parsed['authority']), $parsed['path'], $parsed['query'], $parsed['fragment']); } $this->url = $url; + $this->permanent_url = $url; $this->useragent = $useragent; if (preg_match('/^http(s)?:\/\//i', $url)) { - syslog(LOG_INFO, 'SimplePie GET ' . $url); //FreshRSS + if ($syslog_enabled) + { + syslog(LOG_INFO, 'SimplePie GET ' . SimplePie_Misc::url_remove_credentials($url)); //FreshRSS + } if ($useragent === null) { $useragent = ini_get('user_agent'); @@ -108,12 +113,15 @@ class SimplePie_File curl_setopt($fp, CURLOPT_REFERER, $url); curl_setopt($fp, CURLOPT_USERAGENT, $useragent); curl_setopt($fp, CURLOPT_HTTPHEADER, $headers2); - curl_setopt($fp, CURLOPT_SSL_VERIFYPEER, false); //FreshRSS if (!ini_get('open_basedir') && !ini_get('safe_mode') && version_compare(SimplePie_Misc::get_curl_version(), '7.15.2', '>=')) { curl_setopt($fp, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($fp, CURLOPT_MAXREDIRS, $redirects); } + foreach ($curl_options as $curl_param => $curl_value) + { + curl_setopt($fp, $curl_param, $curl_value); + } $this->headers = curl_exec($fp); if (curl_errno($fp) === 23 || curl_errno($fp) === 61) @@ -142,7 +150,10 @@ class SimplePie_File { $this->redirects++; $location = SimplePie_Misc::absolutize_url($this->headers['location'], $url); - return $this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen); + $previousStatusCode = $this->status_code; + $this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen); + $this->permanent_url = ($previousStatusCode == 301) ? $location : $url; + return; } } } @@ -224,7 +235,10 @@ class SimplePie_File { $this->redirects++; $location = SimplePie_Misc::absolutize_url($this->headers['location'], $url); - return $this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen); + $previousStatusCode = $this->status_code; + $this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen); + $this->permanent_url = ($previousStatusCode == 301) ? $location : $url; //FreshRSS + return; } if (isset($this->headers['content-encoding'])) { diff --git a/lib/SimplePie/SimplePie/Item.php b/lib/SimplePie/SimplePie/Item.php index 7bd96c15f..19ba7c8f4 100644 --- a/lib/SimplePie/SimplePie/Item.php +++ b/lib/SimplePie/SimplePie/Item.php @@ -406,6 +406,30 @@ class SimplePie_Item return null; } } + + /** + * Get the media:thumbnail of the item + * + * Uses `<media:thumbnail>` + * + * + * @return array|null + */ + public function get_thumbnail() + { + if (!isset($this->data['thumbnail'])) + { + if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'thumbnail')) + { + $this->data['thumbnail'] = $return[0]['attribs']['']; + } + else + { + $this->data['thumbnail'] = null; + } + } + return $this->data['thumbnail']; + } /** * Get a category for the item @@ -738,31 +762,31 @@ class SimplePie_Item { $this->data['date']['raw'] = $return[0]['data']; } - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'updated')) + elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'pubDate')) { $this->data['date']['raw'] = $return[0]['data']; } - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'issued')) + elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'date')) { $this->data['date']['raw'] = $return[0]['data']; } - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'created')) + elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'date')) { $this->data['date']['raw'] = $return[0]['data']; } - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'modified')) + elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'updated')) { $this->data['date']['raw'] = $return[0]['data']; } - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'pubDate')) + elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'issued')) { $this->data['date']['raw'] = $return[0]['data']; } - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'date')) + elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'created')) { $this->data['date']['raw'] = $return[0]['data']; } - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'date')) + elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'modified')) { $this->data['date']['raw'] = $return[0]['data']; } @@ -2733,7 +2757,9 @@ class SimplePie_Item { foreach ($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail) { - $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); + if (isset($thumbnail['attribs']['']['url'])) { + $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); + } } if (is_array($thumbnails)) { @@ -2851,6 +2877,7 @@ class SimplePie_Item $width = null; $url = $this->sanitize($enclosure[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($enclosure[0])); + $url = $this->feed->sanitize->https_url($url); //FreshRSS if (isset($enclosure[0]['attribs']['']['type'])) { $type = $this->sanitize($enclosure[0]['attribs']['']['type'], SIMPLEPIE_CONSTRUCT_TEXT); diff --git a/lib/SimplePie/SimplePie/Locator.php b/lib/SimplePie/SimplePie/Locator.php index 90ee7a302..ba4a843b0 100644 --- a/lib/SimplePie/SimplePie/Locator.php +++ b/lib/SimplePie/SimplePie/Locator.php @@ -148,7 +148,7 @@ class SimplePie_Locator { $sniffer = $this->registry->create('Content_Type_Sniffer', array($file)); $sniffed = $sniffer->get_type(); - if (in_array($sniffed, array('application/rss+xml', 'application/rdf+xml', 'text/rdf', 'application/atom+xml', 'text/xml', 'application/xml'))) + if (in_array($sniffed, array('application/rss+xml', 'application/rdf+xml', 'text/rdf', 'application/atom+xml', 'text/xml', 'application/xml', 'application/x-rss+xml'))) { return true; } diff --git a/lib/SimplePie/SimplePie/Misc.php b/lib/SimplePie/SimplePie/Misc.php index 5a263a2e5..2d154cbcb 100644 --- a/lib/SimplePie/SimplePie/Misc.php +++ b/lib/SimplePie/SimplePie/Misc.php @@ -79,9 +79,9 @@ class SimplePie_Misc public static function absolutize_url($relative, $base) { - if (substr($relative, 0, 2) === '//') //FreshRSS: disable absolutize_url for "//www.example.net" which will pick HTTP or HTTPS automatically - { - return $relative; + if (substr($relative, 0, 2) === '//') + {//Protocol-relative URLs "//www.example.net" + return 'https:' . $relative; } $iri = SimplePie_IRI::absolutize(new SimplePie_IRI($base), $relative); if ($iri === false) @@ -128,7 +128,7 @@ class SimplePie_Misc { $attribs[$j][2] = $attribs[$j][1]; } - $return[$i]['attribs'][strtolower($attribs[$j][1])]['data'] = SimplePie_Misc::entities_decode(end($attribs[$j]), 'UTF-8'); //FreshRSS + $return[$i]['attribs'][strtolower($attribs[$j][1])]['data'] = SimplePie_Misc::entities_decode(end($attribs[$j]), 'UTF-8'); } } } @@ -142,7 +142,7 @@ class SimplePie_Misc foreach ($element['attribs'] as $key => $value) { $key = strtolower($key); - $full .= " $key=\"" . htmlspecialchars($value['data'], ENT_COMPAT, 'UTF-8') . '"'; //FreshRSS + $full .= " $key=\"" . htmlspecialchars($value['data'], ENT_COMPAT, 'UTF-8') . '"'; } if ($element['self_closing']) { @@ -2240,5 +2240,15 @@ function embed_wmedia(width, height, link) { { // No-op } + + /** + * Sanitize a URL by removing HTTP credentials. + * @param $url the URL to sanitize. + * @return the same URL without HTTP credentials. + */ + public static function url_remove_credentials($url) //FreshRSS + { + return preg_replace('#^(https?://)[^/:@]+:[^/:@]+@#i', '$1', $url); + } } diff --git a/lib/SimplePie/SimplePie/Parse/Date.php b/lib/SimplePie/SimplePie/Parse/Date.php index ef800f125..50bb5cffa 100644 --- a/lib/SimplePie/SimplePie/Parse/Date.php +++ b/lib/SimplePie/SimplePie/Parse/Date.php @@ -173,7 +173,7 @@ class SimplePie_Parse_Date 'aug' => 8, 'august' => 8, 'sep' => 9, - 'september' => 8, + 'september' => 9, 'oct' => 10, 'october' => 10, 'nov' => 11, @@ -332,6 +332,7 @@ class SimplePie_Parse_Date 'CDT' => -18000, 'CEDT' => 7200, 'CET' => 3600, + 'CEST' => 7200, 'CGST' => -7200, 'CGT' => -10800, 'CHADT' => 49500, @@ -720,7 +721,7 @@ class SimplePie_Parse_Date { $output .= substr($string, $position, $pos - $position); $position = $pos + 1; - if ($string[$pos - 1] !== '\\') + if ($pos === 0 || $string[$pos - 1] !== '\\') { $depth++; while ($depth && $position < $length) diff --git a/lib/SimplePie/SimplePie/Parser.php b/lib/SimplePie/SimplePie/Parser.php index 9300b4ba9..7fb7bd9be 100644 --- a/lib/SimplePie/SimplePie/Parser.php +++ b/lib/SimplePie/SimplePie/Parser.php @@ -142,7 +142,7 @@ class SimplePie_Parser $dom = new DOMDocument(); $dom->recover = true; $dom->strictErrorChecking = false; - $dom->loadXML($data); + @$dom->loadXML($data); $this->encoding = $encoding = $dom->encoding = 'UTF-8'; $data2 = $dom->saveXML(); if (function_exists('mb_convert_encoding')) diff --git a/lib/SimplePie/SimplePie/Registry.php b/lib/SimplePie/SimplePie/Registry.php index bd9c1f535..dac55e34e 100755 --- a/lib/SimplePie/SimplePie/Registry.php +++ b/lib/SimplePie/SimplePie/Registry.php @@ -113,7 +113,7 @@ class SimplePie_Registry */ public function register($type, $class, $legacy = false) { - if (!is_subclass_of($class, $this->default[$type])) + if (!@is_subclass_of($class, $this->default[$type])) { return false; } @@ -222,4 +222,4 @@ class SimplePie_Registry $result = call_user_func_array(array($class, $method), $parameters); return $result; } -}
\ No newline at end of file +} diff --git a/lib/SimplePie/SimplePie/Sanitize.php b/lib/SimplePie/SimplePie/Sanitize.php index 168a5e2e8..bdc601100 100644 --- a/lib/SimplePie/SimplePie/Sanitize.php +++ b/lib/SimplePie/SimplePie/Sanitize.php @@ -73,6 +73,15 @@ class SimplePie_Sanitize var $force_fsockopen = false; var $replace_url_attributes = null; + /** + * List of domains for which force HTTPS. + * @see SimplePie_Sanitize::set_https_domains() + * Array is tree split at DNS levels. Example: + * array('biz' => true, 'com' => array('example' => true), 'net' => array('example') => array('www' => true)) + * FreshRSS + */ + var $https_domains = array('com' => array('dailymotion' => true, 'youtube' => true)); + public function __construct() { // Set defaults @@ -242,6 +251,71 @@ class SimplePie_Sanitize $this->replace_url_attributes = (array) $element_attribute; } + /** + * Set the list of domains for which force HTTPS. + * @see SimplePie_Misc::https_url() + * Example array('biz', 'example.com', 'example.org', 'www.example.net'); + * FreshRSS + */ + public function set_https_domains($domains) + { + $this->https_domains = array(); + foreach ($domains as $domain) + { + $domain = trim($domain, ". \t\n\r\0\x0B"); + $segments = array_reverse(explode('.', $domain)); + $node =& $this->https_domains; + foreach ($segments as $segment) + {//Build a tree + if ($node === true) + { + break; + } + if (!isset($node[$segment])) + { + $node[$segment] = array(); + } + $node =& $node[$segment]; + } + $node = true; + } + } + + /** + * Check if the domain is in the list of forced HTTPS + * FreshRSS + */ + protected function is_https_domain($domain) + { + $domain = trim($domain, '. '); + $segments = array_reverse(explode('.', $domain)); + $node =& $this->https_domains; + foreach ($segments as $segment) + {//Explore the tree + if (isset($node[$segment])) + { + $node =& $node[$segment]; + } + else + { + break; + } + } + return $node === true; + } + + /** + * Force HTTPS for selected Web sites + * FreshRSS + */ + public function https_url($url) + { + return (strtolower(substr($url, 0, 7)) === 'http://') && + $this->is_https_domain(parse_url($url, PHP_URL_HOST)) ? + substr_replace($url, 's', 4, 0) : //Add the 's' to HTTPS + $url; + } + public function sanitize($data, $type, $base = '') { $data = trim($data); @@ -249,6 +323,7 @@ class SimplePie_Sanitize { if ($type & SIMPLEPIE_CONSTRUCT_MAYBE_HTML) { + $data = htmlspecialchars_decode($data, ENT_QUOTES); if (preg_match('/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\/[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>)/', $data)) { $type |= SIMPLEPIE_CONSTRUCT_HTML; @@ -279,7 +354,7 @@ class SimplePie_Sanitize $document->loadHTML($data); restore_error_handler(); - $xpath = new DOMXPath($document); //FreshRSS + $xpath = new DOMXPath($document); // Strip comments if ($this->strip_comments) @@ -450,7 +525,8 @@ class SimplePie_Sanitize if ($element->hasAttribute($attribute)) { $value = $this->registry->call('Misc', 'absolutize_url', array($element->getAttribute($attribute), $this->base)); - if ($value !== false) + $value = $this->https_url($value); //FreshRSS + if ($value) { $element->setAttribute($attribute, $value); } diff --git a/lib/favicons.php b/lib/favicons.php new file mode 100644 index 000000000..d8c97964e --- /dev/null +++ b/lib/favicons.php @@ -0,0 +1,43 @@ +<?php + +include(LIB_PATH . '/Favicon/Favicon.php'); +include(LIB_PATH . '/Favicon/DataAccess.php'); + +$favicons_dir = DATA_PATH . '/favicons/'; +$default_favicon = PUBLIC_PATH . '/themes/icons/default_favicon.ico'; + +function download_favicon($website, $dest) { + global $favicons_dir, $default_favicon; + + syslog(LOG_INFO, 'FreshRSS Favicon discovery GET ' . $website); + $favicon_getter = new \Favicon\Favicon(); + $favicon_getter->setCacheDir($favicons_dir); + $favicon_url = $favicon_getter->get($website); + + if ($favicon_url === false) { + return @copy($default_favicon, $dest); + } + + syslog(LOG_INFO, 'FreshRSS Favicon GET ' . $favicon_url); + $c = curl_init($favicon_url); + curl_setopt($c, CURLOPT_HEADER, false); + curl_setopt($c, CURLOPT_RETURNTRANSFER, true); + curl_setopt($c, CURLOPT_BINARYTRANSFER, true); + curl_setopt($c, CURLOPT_USERAGENT, 'FreshRSS/' . FRESHRSS_VERSION . ' (' . PHP_OS . '; ' . FRESHRSS_WEBSITE . ')'); + $img_raw = curl_exec($c); + $status_code = curl_getinfo($c, CURLINFO_HTTP_CODE); + curl_close($c); + + if ($status_code === 200) { + $file = fopen($dest, 'w'); + if ($file !== false) { + fwrite($file, $img_raw); + fclose($file); + return true; + } + } else { + syslog(LOG_WARNING, 'FreshRSS Favicon GET ' . $favicon_url . ' error ' . $status_code); + } + + return false; +} diff --git a/lib/http-conditional.php b/lib/http-conditional.php index 59fbef41f..6d3a0a97f 100644 --- a/lib/http-conditional.php +++ b/lib/http-conditional.php @@ -35,12 +35,12 @@ ... //Rest of the script, just as you would do normally. ?> - Version 1.7 beta, 2013-12-02, http://alexandre.alapetite.fr/doc-alex/php-http-304/ + Version 1.8 beta, 2016-08-07, http://alexandre.alapetite.fr/doc-alex/php-http-304/ ------------------------------------------------------------------ Written by Alexandre Alapetite, http://alexandre.alapetite.fr/cv/ - Copyright 2004-2013, Licence: Creative Commons "Attribution-ShareAlike 2.0 France" BY-SA (FR), + Copyright 2004-2016, Licence: Creative Commons "Attribution-ShareAlike 2.0 France" BY-SA (FR), http://creativecommons.org/licenses/by-sa/2.0/fr/ http://alexandre.alapetite.fr/divers/apropos/#by-sa - Attribution. You must give the original author credit @@ -96,7 +96,8 @@ function httpConditional($UnixTimeStamp,$cacheSeconds=0,$cachePrivacy=0,$feedMod if ((!$is412)&&isset($_SERVER['HTTP_IF_MATCH'])) {//rfc2616-sec14.html#sec14.24 $etagsClient=stripslashes($_SERVER['HTTP_IF_MATCH']); - $is412=(($etagClient!=='*')&&(strpos($etagsClient,$etagServer)===false)); + $etagsClient=str_ireplace('-gzip','',$etagsClient); + $is412=(($etagsClient!=='*')&&(strpos($etagsClient,$etagServer)===false)); } if ($is304&&isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {//rfc2616-sec14.html#sec14.25 //rfc1945.txt @@ -111,6 +112,7 @@ function httpConditional($UnixTimeStamp,$cacheSeconds=0,$cachePrivacy=0,$feedMod {//rfc2616-sec14.html#sec14.26 $nbCond++; $etagClient=stripslashes($_SERVER['HTTP_IF_NONE_MATCH']); + $etagClient=str_ireplace('-gzip','',$etagClient); $is304=(($etagClient===$etagServer)||($etagClient==='*')); } if ((!$is412)&&isset($_SERVER['HTTP_IF_UNMODIFIED_SINCE'])) diff --git a/lib/lib_date.php b/lib/lib_date.php new file mode 100644 index 000000000..9533711e3 --- /dev/null +++ b/lib/lib_date.php @@ -0,0 +1,131 @@ +<?php +/** + * Author: Alexandre Alapetite http://alexandre.alapetite.fr + * 2014-06-01 + * License: GNU AGPLv3 http://www.gnu.org/licenses/agpl-3.0.html + * + * Parser of ISO 8601 time intervals http://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * Examples: "2014-02/2014-04", "2014-02/04", "2014-06", "P1M" + */ + +/* +example('2014-03'); +example('201403'); +example('2014-03-30'); +example('2014-05-30T13'); +example('2014-05-30T13:30'); +example('2014-02/2014-04'); +example('2014-02--2014-04'); +example('2014-02/04'); +example('2014-02-03/05'); +example('2014-02-03T22:00/22:15'); +example('2014-02-03T22:00/15'); +example('2014-03/'); +example('/2014-03'); +example('2014-03/P1W'); +example('P1W/2014-05-25T23:59:59'); +example('P1Y/'); +example('P1Y'); +example('P2M/'); +example('P3W/'); +example('P4D/'); +example('PT5H/'); +example('PT6M/'); +example('PT7S/'); +example('P1DT1H/'); + +function example($dateInterval) { + $dateIntervalArray = parseDateInterval($dateInterval); + echo $dateInterval, "\t=>\t", + $dateIntervalArray[0] == null ? 'null' : @date('c', $dateIntervalArray[0]), '/', + $dateIntervalArray[1] == null ? 'null' : @date('c', $dateIntervalArray[1]), "\n"; +} +*/ + +function _dateFloor($isoDate) { + $x = explode('T', $isoDate, 2); + $t = isset($x[1]) ? str_pad($x[1], 6, '0') : '000000'; + return str_pad($x[0], 8, '01') . 'T' . $t; +} + +function _dateCeiling($isoDate) { + $x = explode('T', $isoDate, 2); + $t = isset($x[1]) && strlen($x[1]) > 1 ? str_pad($x[1], 6, '59') : '235959'; + switch (strlen($x[0])) { + case 4: + return $x[0] . '1231T' . $t; + case 6: + $d = @strtotime($x[0] . '01'); + return $x[0] . date('t', $d) . 'T' . $t; + default: + return $x[0] . 'T' . $t; + } +} + +function _noDelimit($isoDate) { + return $isoDate === null || $isoDate === '' ? null : + str_replace(array('-', ':'), '', $isoDate); //FIXME: Bug with negative time zone +} + +function _dateRelative($d1, $d2) { + if ($d2 === null) { + return $d1 !== null && $d1[0] !== 'P' ? $d1 : null; + } elseif ($d2 !== '' && $d2[0] != 'P' && $d1 !== null && $d1[0] !== 'P') { + $y2 = substr($d2, 0, 4); + if (strlen($y2) < 4 || !ctype_digit($y2)) { //Does not start by a year + $d2 = _noDelimit($d2); + return substr($d1, 0, -strlen($d2)) . $d2; //Add prefix from $d1 + } + } + return _noDelimit($d2); +} + +/** + * Parameter $dateInterval is a string containing an ISO 8601 time interval. + * Returns an array with the minimum and maximum Unix timestamp of this interval, + * or null if open interval, or false if error. + */ +function parseDateInterval($dateInterval) { + $dateInterval = trim($dateInterval); + $dateInterval = str_replace('--', '/', $dateInterval); + $dateInterval = strtoupper($dateInterval); + $min = null; + $max = null; + $x = explode('/', $dateInterval, 2); + $d1 = _noDelimit($x[0]); + $d2 = _dateRelative($d1, count($x) > 1 ? $x[1] : null); + if ($d1 !== null && $d1[0] !== 'P') { + $min = @strtotime(_dateFloor($d1)); + } + if ($d2 !== null) { + if ($d2[0] === 'P') { + try { + $di2 = new DateInterval($d2); + $dt1 = @date_create(); //new DateTime() would create an Exception if the default time zone is not defined + if ($min !== null && $min !== false) { + $dt1->setTimestamp($min); + } + $max = $dt1->add($di2)->getTimestamp() - 1; + } catch (Exception $e) { + $max = false; + } + } elseif ($d1 === null || $d1[0] !== 'P') { + $max = @strtotime(_dateCeiling($d2)); + } else { + $max = @strtotime($d2); + } + } + if ($d1 !== null && $d1[0] === 'P') { + try { + $di1 = new DateInterval($d1); + $dt2 = @date_create(); + if ($max !== null && $max !== false) { + $dt2->setTimestamp($max); + } + $min = $dt2->sub($di1)->getTimestamp() + 1; + } catch (Exception $e) { + $min = false; + } + } + return array($min, $max); +} diff --git a/lib/lib_install.php b/lib/lib_install.php new file mode 100644 index 000000000..c5cae4293 --- /dev/null +++ b/lib/lib_install.php @@ -0,0 +1,121 @@ +<?php + +define('BCRYPT_COST', 9); + +Minz_Configuration::register('default_system', join_path(DATA_PATH, 'config.default.php')); +Minz_Configuration::register('default_user', join_path(USERS_PATH, '_', 'config.default.php')); + +function checkRequirements() { + $php = version_compare(PHP_VERSION, '5.3.3') >= 0; + $minz = file_exists(join_path(LIB_PATH, 'Minz')); + $curl = extension_loaded('curl'); + $pdo_mysql = extension_loaded('pdo_mysql'); + $pdo_sqlite = extension_loaded('pdo_sqlite'); + $pdo_pgsql = extension_loaded('pdo_pgsql'); + $pdo = $pdo_mysql || $pdo_sqlite || $pdo_pgsql; + $pcre = extension_loaded('pcre'); + $ctype = extension_loaded('ctype'); + $fileinfo = extension_loaded('fileinfo'); + $dom = class_exists('DOMDocument'); + $xml = function_exists('xml_parser_create'); + $json = function_exists('json_encode'); + $data = DATA_PATH && is_writable(DATA_PATH); + $cache = CACHE_PATH && is_writable(CACHE_PATH); + $users = USERS_PATH && is_writable(USERS_PATH); + $favicons = is_writable(join_path(DATA_PATH, 'favicons')); + $http_referer = is_referer_from_same_domain(); + + return array( + 'php' => $php ? 'ok' : 'ko', + 'minz' => $minz ? 'ok' : 'ko', + 'curl' => $curl ? 'ok' : 'ko', + 'pdo-mysql' => $pdo_mysql ? 'ok' : 'ko', + 'pdo-sqlite' => $pdo_sqlite ? 'ok' : 'ko', + 'pdo-pgsql' => $pdo_pgsql ? 'ok' : 'ko', + 'pdo' => $pdo ? 'ok' : 'ko', + 'pcre' => $pcre ? 'ok' : 'ko', + 'ctype' => $ctype ? 'ok' : 'ko', + 'fileinfo' => $fileinfo ? 'ok' : 'ko', + 'dom' => $dom ? 'ok' : 'ko', + 'xml' => $xml ? 'ok' : 'ko', + 'json' => $json ? 'ok' : 'ko', + 'data' => $data ? 'ok' : 'ko', + 'cache' => $cache ? 'ok' : 'ko', + 'users' => $users ? 'ok' : 'ko', + 'favicons' => $favicons ? 'ok' : 'ko', + 'http_referer' => $http_referer ? 'ok' : 'ko', + 'all' => $php && $minz && $curl && $pdo && $pcre && $ctype && $fileinfo && $dom && $xml && + $data && $cache && $users && $favicons && $http_referer ? + 'ok' : 'ko' + ); +} + +function generateSalt() { + return sha1(uniqid(mt_rand(), true).implode('', stat(__FILE__))); +} + +function checkDb(&$dbOptions) { + $dsn = ''; + $driver_options = null; + try { + switch ($dbOptions['type']) { + case 'mysql': + include_once(APP_PATH . '/SQL/install.sql.mysql.php'); + $driver_options = array( + PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4' + ); + try { // on ouvre une connexion juste pour créer la base si elle n'existe pas + $dsn = 'mysql:host=' . $dbOptions['host'] . ';'; + $c = new PDO($dsn, $dbOptions['user'], $dbOptions['password'], $driver_options); + $sql = sprintf(SQL_CREATE_DB, $dbOptions['base']); + $res = $c->query($sql); + } catch (PDOException $e) { + syslog(LOG_DEBUG, 'FreshRSS MySQL warning: ' . $e->getMessage()); + } + // on écrase la précédente connexion en sélectionnant la nouvelle BDD + $dsn = 'mysql:host=' . $dbOptions['host'] . ';dbname=' . $dbOptions['base']; + break; + case 'sqlite': + include_once(APP_PATH . '/SQL/install.sql.sqlite.php'); + $dsn = 'sqlite:' . join_path(USERS_PATH, $dbOptions['default_user'], 'db.sqlite'); + $driver_options = array( + PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, + ); + break; + case 'pgsql': + include_once(APP_PATH . '/SQL/install.sql.pgsql.php'); + $driver_options = array( + PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, + ); + try { // on ouvre une connexion juste pour créer la base si elle n'existe pas + $dsn = 'pgsql:host=' . $dbOptions['host'] . ';dbname=postgres'; + $c = new PDO($dsn, $dbOptions['user'], $dbOptions['password'], $driver_options); + $sql = sprintf(SQL_CREATE_DB, $dbOptions['base']); + $res = $c->query($sql); + } catch (PDOException $e) { + syslog(LOG_DEBUG, 'FreshRSS PostgreSQL warning: ' . $e->getMessage()); + } + // on écrase la précédente connexion en sélectionnant la nouvelle BDD + $dsn = 'pgsql:host=' . $dbOptions['host'] . ';dbname=' . $dbOptions['base']; + break; + default: + return false; + } + + $c = new PDO($dsn, $dbOptions['user'], $dbOptions['password'], $driver_options); + $res = $c->query('SELECT 1'); + } catch (PDOException $e) { + $dsn = ''; + syslog(LOG_DEBUG, 'FreshRSS SQL warning: ' . $e->getMessage()); + $dbOptions['error'] = $e->getMessage(); + } + $dbOptions['dsn'] = $dsn; + $dbOptions['options'] = $driver_options; + return $dsn != ''; +} + +function deleteInstall() { + $path = join_path(DATA_PATH, 'do-install.txt'); + @unlink($path); + return !file_exists($path); +} diff --git a/lib/lib_opml.php b/lib/lib_opml.php index 9feb12ae0..b89e92977 100644 --- a/lib/lib_opml.php +++ b/lib/lib_opml.php @@ -1,120 +1,342 @@ <?php -function opml_export ($cats) { - $txt = ''; - foreach ($cats as $cat) { - $txt .= '<outline text="' . $cat['name'] . '">' . "\n"; +/** + * lib_opml is a free library to manage OPML format in PHP. + * + * By default, it takes in consideration version 2.0 but can be compatible with + * OPML 1.0. More information on http://dev.opml.org. + * Difference is "text" attribute is optional in version 1.0. It is highly + * recommended to use this attribute. + * + * lib_opml requires SimpleXML (php.net/simplexml) and DOMDocument (php.net/domdocument) + * + * @author Marien Fressinaud <dev@marienfressinaud.fr> + * @link https://github.com/marienfressinaud/lib_opml + * @version 0.2-FreshRSS~1.5.1 + * @license public domain + * + * Usages: + * > include('lib_opml.php'); + * > $filename = 'my_opml_file.xml'; + * > $opml_array = libopml_parse_file($filename); + * > print_r($opml_array); + * + * > $opml_string = [...]; + * > $opml_array = libopml_parse_string($opml_string); + * > print_r($opml_array); + * + * > $opml_array = [...]; + * > $opml_string = libopml_render($opml_array); + * > $opml_object = libopml_render($opml_array, true); + * > echo $opml_string; + * > print_r($opml_object); + * + * You can set $strict argument to false if you want to bypass "text" attribute + * requirement. + * + * If parsing fails for any reason (e.g. not an XML string, does not match with + * the specifications), a LibOPML_Exception is raised. + * + * lib_opml array format is described here: + * $array = array( + * 'head' => array( // 'head' element is optional (but recommended) + * 'key' => 'value', // key must be a part of available OPML head elements + * ), + * 'body' => array( // body is required + * array( // this array represents an outline (at least one) + * 'text' => 'value', // 'text' element is required if $strict is true + * 'key' => 'value', // key and value are what you want (optional) + * '@outlines' = array( // @outlines is a special value and represents sub-outlines + * array( + * [...] // where [...] is a valid outline definition + * ), + * ), + * ), + * array( // other outline definitions + * [...] + * ), + * [...], + * ) + * ) + * + */ + +/** + * A simple Exception class which represents any kind of OPML problem. + * Message should precise the current problem. + */ +class LibOPML_Exception extends Exception {} - foreach ($cat['feeds'] as $feed) { - $txt .= "\t" . '<outline text="' . $feed->name () . '" type="rss" xmlUrl="' . $feed->url () . '" htmlUrl="' . $feed->website () . '" description="' . htmlspecialchars($feed->description(), ENT_COMPAT, 'UTF-8') . '" />' . "\n"; + +// Define the list of available head attributes. All of them are optional. +define('HEAD_ELEMENTS', serialize(array( + 'title', 'dateCreated', 'dateModified', 'ownerName', 'ownerEmail', + 'ownerId', 'docs', 'expansionState', 'vertScrollState', 'windowTop', + 'windowLeft', 'windowBottom', 'windowRight' +))); + + +/** + * Parse an XML object as an outline object and return corresponding array + * + * @param SimpleXMLElement $outline_xml the XML object we want to parse + * @param bool $strict true if "text" attribute is required, false else + * @return array corresponding to an outline and following format described above + * @throws LibOPML_Exception + * @access private + */ +function libopml_parse_outline($outline_xml, $strict = true) { + $outline = array(); + + // An outline may contain any kind of attributes but "text" attribute is + // required ! + $text_is_present = false; + foreach ($outline_xml->attributes() as $key => $value) { + $outline[$key] = (string)$value; + + if ($key === 'text') { + $text_is_present = true; } + } + + if (!$text_is_present && $strict) { + throw new LibOPML_Exception( + 'Outline does not contain any text attribute' + ); + } + + if (empty($outline['text']) && isset($outline['title'])) { + $outline['text'] = $outline['title']; + } - $txt .= '</outline>' . "\n"; + foreach ($outline_xml->children() as $key => $value) { + // An outline may contain any number of outline children + if ($key === 'outline') { + $outline['@outlines'][] = libopml_parse_outline($value, $strict); + } else { + throw new LibOPML_Exception( + 'Body can contain only outline elements' + ); + } } - return $txt; + return $outline; } -function opml_import ($xml) { - $xml = html_only_entity_decode($xml); //!\ Assume UTF-8 +/** + * Reformat the XML document as a hierarchy when + * the OPML 2.0 category attribute is used + */ +function preprocessing_categories($doc) { + $outline_categories = array(); + $body = $doc->getElementsByTagName('body')->item(0); + $xpath = new DOMXpath($doc); + $outlines = $xpath->query('/opml/body/outline[@category]'); + foreach ($outlines as $outline) { + $category = trim($outline->getAttribute('category')); + if ($category != '') { + $outline_categorie = null; + if (!isset($outline_categories[$category])) { + $outline_categorie = $doc->createElement('outline'); + $outline_categorie->setAttribute('text', $category); + $body->insertBefore($outline_categorie, $body->firstChild); + $outline_categories[$category] = $outline_categorie; + } else { + $outline_categorie = $outline_categories[$category]; + } + $outline->parentNode->removeChild($outline); + $outline_categorie->appendChild($outline); + } + } +} +/** + * Parse a string as a XML one and returns the corresponding array + * + * @param string $xml is the string we want to parse + * @param bool $strict true if "text" attribute is required, false else + * @return array corresponding to the XML string and following format described above + * @throws LibOPML_Exception + * @access public + */ +function libopml_parse_string($xml, $strict = true) { $dom = new DOMDocument(); $dom->recover = true; $dom->strictErrorChecking = false; $dom->loadXML($xml); $dom->encoding = 'UTF-8'; + //Partial compatibility with the category attribute of OPML 2.0 + preprocessing_categories($dom); + $opml = simplexml_import_dom($dom); if (!$opml) { - throw new FreshRSS_Opml_Exception (); + throw new LibOPML_Exception(); + } + + $array = array( + 'version' => (string)$opml['version'], + 'head' => array(), + 'body' => array() + ); + + // First, we get all "head" elements. Head is required but its sub-elements + // are optional. + foreach ($opml->head->children() as $key => $value) { + if (in_array($key, unserialize(HEAD_ELEMENTS), true)) { + $array['head'][$key] = (string)$value; + } else { + throw new LibOPML_Exception( + $key . 'is not part of OPML format' + ); + } } - $catDAO = new FreshRSS_CategoryDAO(); - $catDAO->checkDefault(); - $defCat = $catDAO->getDefault(); + // Then, we get body oulines. Body must contain at least one outline + // element. + $at_least_one_outline = false; + foreach ($opml->body->children() as $key => $value) { + if ($key === 'outline') { + $at_least_one_outline = true; + $array['body'][] = libopml_parse_outline($value, $strict); + } else { + throw new LibOPML_Exception( + 'Body can contain only outline elements' + ); + } + } - $categories = array (); - $feeds = array (); + if (!$at_least_one_outline) { + throw new LibOPML_Exception( + 'Body must contain at least one outline element' + ); + } + + return $array; +} - foreach ($opml->body->outline as $outline) { - if (!isset ($outline['xmlUrl'])) { - // Catégorie - $title = ''; - if (isset ($outline['text'])) { - $title = (string) $outline['text']; - } elseif (isset ($outline['title'])) { - $title = (string) $outline['title']; - } +/** + * Parse a string contained into a file as a XML string and returns the corresponding array + * + * @param string $filename should indicates a valid XML file + * @param bool $strict true if "text" attribute is required, false else + * @return array corresponding to the file content and following format described above + * @throws LibOPML_Exception + * @access public + */ +function libopml_parse_file($filename, $strict = true) { + $file_content = file_get_contents($filename); + + if ($file_content === false) { + throw new LibOPML_Exception( + $filename . ' cannot be found' + ); + } + + return libopml_parse_string($file_content, $strict); +} + + +/** + * Create a XML outline object in a parent object. + * + * @param SimpleXMLElement $parent_elt is the parent object of current outline + * @param array $outline array representing an outline object + * @param bool $strict true if "text" attribute is required, false else + * @throws LibOPML_Exception + * @access private + */ +function libopml_render_outline($parent_elt, $outline, $strict) { + // Outline MUST be an array! + if (!is_array($outline)) { + throw new LibOPML_Exception( + 'Outline element must be defined as array' + ); + } - if ($title) { - // Permet d'éviter les soucis au niveau des id : - // ceux-ci sont générés en fonction de la date, - // un flux pourrait être dans une catégorie X avec l'id Y - // alors qu'il existe déjà la catégorie X mais avec l'id Z - // Y ne sera pas ajouté et le flux non plus vu que l'id - // de sa catégorie n'exisera pas - $title = htmlspecialchars($title, ENT_COMPAT, 'UTF-8'); - $catDAO = new FreshRSS_CategoryDAO (); - $cat = $catDAO->searchByName ($title); - if ($cat === false) { - $cat = new FreshRSS_Category ($title); - $values = array ( - 'name' => $cat->name () - ); - $cat->_id ($catDAO->addCategory ($values)); - } - - $feeds = array_merge ($feeds, getFeedsOutline ($outline, $cat->id ())); + $outline_elt = $parent_elt->addChild('outline'); + $text_is_present = false; + foreach ($outline as $key => $value) { + // Only outlines can be an array and so we consider children are also + // outline elements. + if ($key === '@outlines' && is_array($value)) { + foreach ($value as $outline_child) { + libopml_render_outline($outline_elt, $outline_child, $strict); } + } elseif (is_array($value)) { + throw new LibOPML_Exception( + 'Type of outline elements cannot be array: ' . $key + ); } else { - // Flux rss sans catégorie, on récupère l'ajoute dans la catégorie par défaut - $feeds[] = getFeed ($outline, $defCat->id()); + // Detect text attribute is present, that's good :) + if ($key === 'text') { + $text_is_present = true; + } + + $outline_elt->addAttribute($key, $value); } } - return array ($categories, $feeds); + if (!$text_is_present && $strict) { + throw new LibOPML_Exception( + 'You must define at least a text element for all outlines' + ); + } } + /** - * import all feeds of a given outline tag + * Render an array as an OPML string or a XML object. + * + * @param array $array is the array we want to render and must follow structure defined above + * @param bool $as_xml_object false if function must return a string, true for a XML object + * @param bool $strict true if "text" attribute is required, false else + * @return string|SimpleXMLElement XML string corresponding to $array or XML object + * @throws LibOPML_Exception + * @access public */ -function getFeedsOutline ($outline, $cat_id) { - $feeds = array (); +function libopml_render($array, $as_xml_object = false, $strict = true) { + $opml = new SimpleXMLElement('<opml></opml>'); + $opml->addAttribute('version', $strict ? '2.0' : '1.0'); - foreach ($outline->children () as $child) { - if (isset ($child['xmlUrl'])) { - $feeds[] = getFeed ($child, $cat_id); - } else { - $feeds = array_merge( - $feeds, - getFeedsOutline ($child, $cat_id) - ); + // Create head element. $array['head'] is optional but head element will + // exist in the final XML object. + $head = $opml->addChild('head'); + if (isset($array['head'])) { + foreach ($array['head'] as $key => $value) { + if (in_array($key, unserialize(HEAD_ELEMENTS), true)) { + $head->addChild($key, $value); + } } } - return $feeds; -} + // Check body is set and contains at least one element + if (!isset($array['body'])) { + throw new LibOPML_Exception( + '$array must contain a body element' + ); + } + if (count($array['body']) <= 0) { + throw new LibOPML_Exception( + 'Body element must contain at least one element (array)' + ); + } + + // Create outline elements + $body = $opml->addChild('body'); + foreach ($array['body'] as $outline) { + libopml_render_outline($body, $outline, $strict); + } -function getFeed ($outline, $cat_id) { - $url = (string) $outline['xmlUrl']; - $url = htmlspecialchars($url, ENT_COMPAT, 'UTF-8'); - $title = ''; - if (isset ($outline['text'])) { - $title = (string) $outline['text']; - } elseif (isset ($outline['title'])) { - $title = (string) $outline['title']; - } - $title = htmlspecialchars($title, ENT_COMPAT, 'UTF-8'); - $feed = new FreshRSS_Feed ($url); - $feed->_category ($cat_id); - $feed->_name ($title); - if (isset($outline['htmlUrl'])) { - $feed->_website(htmlspecialchars((string)$outline['htmlUrl'], ENT_COMPAT, 'UTF-8')); - } - if (isset($outline['description'])) { - $feed->_description(sanitizeHTML((string)$outline['description'])); - } - return $feed; + // And return the final result + if ($as_xml_object) { + return $opml; + } else { + $dom = dom_import_simplexml($opml)->ownerDocument; + $dom->formatOutput = true; + $dom->encoding = 'UTF-8'; + return $dom->saveXML(); + } } diff --git a/lib/lib_rss.php b/lib/lib_rss.php index a13d9e951..560e5b256 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -1,20 +1,33 @@ <?php if (!function_exists('json_decode')) { require_once('JSON.php'); - function json_decode($var) { - $JSON = new Services_JSON; - return (array)($JSON->decode($var)); + function json_decode($var, $assoc = false) { + $JSON = new Services_JSON($assoc ? SERVICES_JSON_LOOSE_TYPE : 0); + return $JSON->decode($var); } } if (!function_exists('json_encode')) { require_once('JSON.php'); function json_encode($var) { - $JSON = new Services_JSON; + $JSON = new Services_JSON(); return $JSON->encodeUnsafe($var); } } +defined('JSON_UNESCAPED_UNICODE') or define('JSON_UNESCAPED_UNICODE', 256); //PHP 5.3 + +/** + * Build a directory path by concatenating a list of directory names. + * + * @param $path_parts a list of directory names + * @return a string corresponding to the final pathname + */ +function join_path() { + $path_parts = func_get_args(); + return join(DIRECTORY_SEPARATOR, $path_parts); +} + //<Auto-loading> function classAutoloader($class) { if (strpos($class, 'FreshRSS') === 0) { @@ -40,6 +53,21 @@ function classAutoloader($class) { spl_autoload_register('classAutoloader'); //</Auto-loading> +function idn_to_puny($url) { + if (function_exists('idn_to_ascii')) { + $parts = parse_url($url); + if (!empty($parts['host'])) { + $idn = $parts['host']; + $puny = idn_to_ascii($idn); + $pos = strpos($url, $idn); + if ($pos !== false) { + return substr_replace($url, $puny, $pos, strlen($idn)); + } + } + } + return $url; +} + function checkUrl($url) { if (empty ($url)) { return ''; @@ -47,47 +75,74 @@ function checkUrl($url) { if (!preg_match ('#^https?://#i', $url)) { $url = 'http://' . $url; } - if (filter_var($url, FILTER_VALIDATE_URL) || - (version_compare(PHP_VERSION, '5.3.3', '<') && (strpos($url, '-') > 0) && //PHP bug #51192 - ($url === filter_var($url, FILTER_SANITIZE_URL)))) { + $url = idn_to_puny($url); //PHP bug #53474 IDN + if (filter_var($url, FILTER_VALIDATE_URL)) { return $url; } else { return false; } } -// tiré de Shaarli de Seb Sauvage //Format RFC 4648 base64url -function small_hash ($txt) { - $t = rtrim (base64_encode (hash ('crc32', $txt, true)), '='); - return strtr ($t, '+/', '-_'); +function safe_ascii($text) { + return filter_var($text, FILTER_DEFAULT, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH); } -function formatNumber($n, $precision = 0) { - return str_replace(' ', ' ', //Espace insécable //TODO: remplacer par une espace _fine_ insécable - number_format($n, $precision, '.', ' ')); //number_format does not seem to be Unicode-compatible +/** + * Test if a given server address is publicly accessible. + * + * Note: for the moment it tests only if address is corresponding to a + * localhost address. + * + * @param $address the address to test, can be an IP or a URL. + * @return true if server is accessible, false else. + * @todo improve test with a more valid technique (e.g. test with an external server?) + */ +function server_is_public($address) { + $host = parse_url($address, PHP_URL_HOST); + + $is_public = !in_array($host, array( + '127.0.0.1', + 'localhost', + 'localhost.localdomain', + '[::1]', + 'localhost6', + 'localhost6.localdomain6', + )); + + return $is_public; } -function formatBytes($bytes, $precision = 2, $system = 'IEC') { + +function format_number($n, $precision = 0) { + // number_format does not seem to be Unicode-compatible + return str_replace(' ', ' ', //Espace fine insécable + number_format($n, $precision, '.', ' ') + ); +} + +function format_bytes($bytes, $precision = 2, $system = 'IEC') { if ($system === 'IEC') { $base = 1024; $units = array('B', 'KiB', 'MiB', 'GiB', 'TiB'); } elseif ($system === 'SI') { $base = 1000; $units = array('B', 'KB', 'MB', 'GB', 'TB'); + } else { + return format_number($bytes, $precision); } $bytes = max(intval($bytes), 0); $pow = $bytes === 0 ? 0 : floor(log($bytes) / log($base)); $pow = min($pow, count($units) - 1); $bytes /= pow($base, $pow); - return formatNumber($bytes, $precision) . ' ' . $units[$pow]; + return format_number($bytes, $precision) . ' ' . $units[$pow]; } function timestamptodate ($t, $hour = true) { - $month = Minz_Translate::t (date('M', $t)); + $month = _t('gen.date.' . date('M', $t)); if ($hour) { - $date = Minz_Translate::t ('format_date_hour', $month); + $date = _t('gen.date.format_date_hour', $month); } else { - $date = Minz_Translate::t ('format_date', $month); + $date = _t('gen.date.format_date', $month); } return @date ($date, $t); @@ -112,10 +167,15 @@ function html_only_entity_decode($text) { } function customSimplePie() { + $system_conf = Minz_Configuration::get('system'); + $limits = $system_conf->limits; $simplePie = new SimplePie(); - $simplePie->set_useragent(Minz_Translate::t('freshrss') . '/' . FRESHRSS_VERSION . ' (' . PHP_OS . '; ' . FRESHRSS_WEBSITE . ') ' . SIMPLEPIE_NAME . '/' . SIMPLEPIE_VERSION); + $simplePie->set_useragent('FreshRSS/' . FRESHRSS_VERSION . ' (' . PHP_OS . '; ' . FRESHRSS_WEBSITE . ') ' . SIMPLEPIE_NAME . '/' . SIMPLEPIE_VERSION); + $simplePie->set_syslog($system_conf->simplepie_syslog_enabled); $simplePie->set_cache_location(CACHE_PATH); - $simplePie->set_cache_duration(1500); + $simplePie->set_cache_duration($limits['cache_duration']); + $simplePie->set_timeout($limits['timeout']); + $simplePie->set_curl_options($system_conf->curl_options); $simplePie->strip_htmltags(array( 'base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', @@ -125,12 +185,11 @@ function customSimplePie() { $simplePie->strip_attributes(array_merge($simplePie->strip_attributes, array( 'autoplay', 'onload', 'onunload', 'onclick', 'ondblclick', 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout', 'onfocus', 'onblur', - 'onkeypress', 'onkeydown', 'onkeyup', 'onselect', 'onchange', 'seamless'))); + 'onkeypress', 'onkeydown', 'onkeyup', 'onselect', 'onchange', 'seamless', 'sizes', 'srcset'))); $simplePie->add_attributes(array( - 'img' => array('lazyload' => ''), //http://www.w3.org/TR/resource-priorities/ 'audio' => array('preload' => 'none'), - 'iframe' => array('postpone' => '', 'sandbox' => 'allow-scripts allow-same-origin'), - 'video' => array('postpone' => '', 'preload' => 'none'), + 'iframe' => array('sandbox' => 'allow-scripts allow-same-origin'), + 'video' => array('preload' => 'none'), )); $simplePie->set_url_replacements(array( 'a' => 'href', @@ -154,6 +213,16 @@ function customSimplePie() { 'src', ), )); + $https_domains = array(); + $force = @file(DATA_PATH . '/force-https.default.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + if (is_array($force)) { + $https_domains = array_merge($https_domains, $force); + } + $force = @file(DATA_PATH . '/force-https.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + if (is_array($force)) { + $https_domains = array_merge($https_domains, $force); + } + $simplePie->set_https_domains($https_domains); return $simplePie; } @@ -168,17 +237,27 @@ function sanitizeHTML($data, $base = '') { /* permet de récupérer le contenu d'un article pour un flux qui n'est pas complet */ function get_content_by_parsing ($url, $path) { - require_once (LIB_PATH . '/lib_phpQuery.php'); + require_once(LIB_PATH . '/lib_phpQuery.php'); - syslog(LOG_INFO, 'FreshRSS GET ' . $url); - $html = file_get_contents ($url); + Minz_Log::notice('FreshRSS GET ' . SimplePie_Misc::url_remove_credentials($url)); + $html = file_get_contents($url); if ($html) { - $doc = phpQuery::newDocument ($html); - $content = $doc->find ($path); + $doc = phpQuery::newDocument($html); + $content = $doc->find($path); + + foreach (pq('img[data-src]') as $img) { + $imgP = pq($img); + $dataSrc = $imgP->attr('data-src'); + if (strlen($dataSrc) > 4) { + $imgP->attr('src', $dataSrc); + $imgP->removeAttr('data-src'); + } + } + return sanitizeHTML($content->__toString(), $url); } else { - throw new Exception (); + throw new Exception(); } } @@ -189,16 +268,8 @@ function get_content_by_parsing ($url, $path) { */ function lazyimg($content) { return preg_replace( - '/<img([^>]+?)src=[\'"]([^"\']+)[\'"]([^>]*)>/i', - '<img$1src="' . Minz_Url::display('/themes/icons/grey.gif') . '" data-original="$2"$3>', - $content - ); -} - -function lazyIframe($content) { - return preg_replace( - '/<iframe([^>]+?)src=[\'"]([^"\']+)[\'"]([^>]*)>/i', - '<iframe$1src="about:blank" data-original="$2"$3>', + '/<((?:img|iframe)[^>]+?)src=[\'"]([^"\']+)[\'"]([^>]*)>/i', + '<$1src="' . Minz_Url::display('/themes/icons/grey.gif') . '" data-original="$2"$3>', $content ); } @@ -213,23 +284,247 @@ function uSecString() { return str_pad($t['usec'], 6, '0'); } -function invalidateHttpCache() { - Minz_Session::_param('touch', uTimeString()); - return touch(LOG_PATH . '/' . Minz_Session::param('currentUser', '_') . '.log'); +function invalidateHttpCache($username = '') { + if (($username == '') || (!ctype_alnum($username))) { + Minz_Session::_param('touch', uTimeString()); + $username = Minz_Session::param('currentUser', '_'); + } + return touch(join_path(DATA_PATH, 'users', $username, 'log.txt')); } -function usernameFromPath($userPath) { - if (preg_match('%/([a-z0-9]{1,16})_user\.php$%', $userPath, $matches)) { - return $matches[1]; - } else { - return ''; +function listUsers() { + $final_list = array(); + $base_path = join_path(DATA_PATH, 'users'); + $dir_list = array_values(array_diff( + scandir($base_path), + array('..', '.', '_') + )); + + foreach ($dir_list as $file) { + if (is_dir(join_path($base_path, $file))) { + $final_list[] = $file; + } } + + return $final_list; } -function listUsers() { - return array_map('usernameFromPath', glob(DATA_PATH . '/*_user.php')); + +/** + * Return if the maximum number of registrations has been reached. + * + * Note a max_regstrations of 0 means there is no limit. + * + * @return true if number of users >= max registrations, false else. + */ +function max_registrations_reached() { + $system_conf = Minz_Configuration::get('system'); + $limit_registrations = $system_conf->limits['max_registrations']; + $number_accounts = count(listUsers()); + + return $limit_registrations > 0 && $number_accounts >= $limit_registrations; } + +/** + * Register and return the configuration for a given user. + * + * Note this function has been created to generate temporary configuration + * objects. If you need a long-time configuration, please don't use this function. + * + * @param $username the name of the user of which we want the configuration. + * @return a Minz_Configuration object, null if the configuration cannot be loaded. + */ +function get_user_configuration($username) { + $namespace = 'user_' . $username; + try { + Minz_Configuration::register($namespace, + join_path(USERS_PATH, $username, 'config.php'), + join_path(USERS_PATH, '_', 'config.default.php')); + } catch (Minz_ConfigurationNamespaceException $e) { + // namespace already exists, do nothing. + } catch (Minz_FileNotExistException $e) { + Minz_Log::warning($e->getMessage()); + return null; + } + + return Minz_Configuration::get($namespace); +} + + function httpAuthUser() { return isset($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'] : ''; } + +function cryptAvailable() { + try { + $hash = '$2y$04$usesomesillystringfore7hnbRJHxXVLeakoG8K30oukPsA.ztMG'; + return $hash === @crypt('password', $hash); + } catch (Exception $e) { + } + return false; +} + +function is_referer_from_same_domain() { + if (empty($_SERVER['HTTP_REFERER'])) { + return true; //Accept empty referer while waiting for good support of meta referrer same-origin policy in browsers + } + $host = parse_url(((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') ? 'https://' : 'http://') . + (empty($_SERVER['HTTP_HOST']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'])); + $referer = parse_url($_SERVER['HTTP_REFERER']); + if (empty($host['host']) || empty($referer['host']) || $host['host'] !== $referer['host']) { + return false; + } + //TODO: check 'scheme', taking into account the case of a proxy + if ((isset($host['port']) ? $host['port'] : 0) !== (isset($referer['port']) ? $referer['port'] : 0)) { + return false; + } + return true; +} + + +/** + * Check PHP and its extensions are well-installed. + * + * @return array of tested values. + */ +function check_install_php() { + $pdo_mysql = extension_loaded('pdo_mysql'); + $pdo_sqlite = extension_loaded('pdo_sqlite'); + return array( + 'php' => version_compare(PHP_VERSION, '5.3.3') >= 0, + 'minz' => file_exists(LIB_PATH . '/Minz'), + 'curl' => extension_loaded('curl'), + 'pdo' => $pdo_mysql || $pdo_sqlite, + 'pcre' => extension_loaded('pcre'), + 'ctype' => extension_loaded('ctype'), + 'fileinfo' => extension_loaded('fileinfo'), + 'dom' => class_exists('DOMDocument'), + 'json' => extension_loaded('json'), + 'zip' => extension_loaded('zip'), + ); +} + + +/** + * Check different data files and directories exist. + * + * @return array of tested values. + */ +function check_install_files() { + return array( + 'data' => DATA_PATH && is_writable(DATA_PATH), + 'cache' => CACHE_PATH && is_writable(CACHE_PATH), + 'users' => USERS_PATH && is_writable(USERS_PATH), + 'favicons' => is_writable(DATA_PATH . '/favicons'), + 'tokens' => is_writable(DATA_PATH . '/tokens'), + ); +} + + +/** + * Check database is well-installed. + * + * @return array of tested values. + */ +function check_install_database() { + $status = array( + 'connection' => true, + 'tables' => false, + 'categories' => false, + 'feeds' => false, + 'entries' => false, + ); + + try { + $dbDAO = FreshRSS_Factory::createDatabaseDAO(); + + $status['tables'] = $dbDAO->tablesAreCorrect(); + $status['categories'] = $dbDAO->categoryIsCorrect(); + $status['feeds'] = $dbDAO->feedIsCorrect(); + $status['entries'] = $dbDAO->entryIsCorrect(); + } catch(Minz_PDOConnectionException $e) { + $status['connection'] = false; + } + + return $status; +} + +/** + * Remove a directory recursively. + * + * From http://php.net/rmdir#110489 + * + * @param $dir the directory to remove + */ +function recursive_unlink($dir) { + if (!is_dir($dir)) { + return true; + } + + $files = array_diff(scandir($dir), array('.', '..')); + foreach ($files as $filename) { + $filename = $dir . '/' . $filename; + if (is_dir($filename)) { + @chmod($filename, 0777); + recursive_unlink($filename); + } else { + unlink($filename); + } + } + + return rmdir($dir); +} + + +/** + * Remove queries where $get is appearing. + * @param $get the get attribute which should be removed. + * @param $queries an array of queries. + * @return the same array whithout those where $get is appearing. + */ +function remove_query_by_get($get, $queries) { + $final_queries = array(); + foreach ($queries as $key => $query) { + if (empty($query['get']) || $query['get'] !== $get) { + $final_queries[$key] = $query; + } + } + return $final_queries; +} + + +/** + * Add a value in an array and take care it is unique. + * @param $array the array in which we add the value. + * @param $value the value to add. + */ +function array_push_unique(&$array, $value) { + $found = array_search($value, $array) !== false; + if (!$found) { + $array[] = $value; + } +} + + +/** + * Remove a value from an array. + * @param $array the array from wich value is removed. + * @param $value the value to remove. + */ +function array_remove(&$array, $value) { + $array = array_diff($array, array($value)); +} + +//RFC 4648 +function base64url_encode($data) { + return strtr(rtrim(base64_encode($data), '='), '+/', '-_'); +} +//RFC 4648 +function base64url_decode($data) { + return base64_decode(strtr($data, '-_', '+/')); +} + +function _i($icon, $url_only = false) { + return FreshRSS_Themes::icon($icon, $url_only); +} diff --git a/p/.htaccess b/p/.htaccess index 2b1e27a88..4321c82d7 100644 --- a/p/.htaccess +++ b/p/.htaccess @@ -6,13 +6,8 @@ FileETag None AddDefaultCharset UTF-8 <IfModule mod_mime.c> - AddType application/json .map - AddType application/font-woff .woff - - AddCharset UTF-8 .css AddCharset UTF-8 .html AddCharset UTF-8 .js - AddCharset UTF-8 .svg </IfModule> <IfModule mod_deflate.c> @@ -21,15 +16,9 @@ AddDefaultCharset UTF-8 <IfModule mod_expires.c> ExpiresActive on - ExpiresByType application/font-woff "access plus 1 month" ExpiresByType application/javascript "access plus 1 month" - ExpiresByType application/json "access plus 1 month" ExpiresByType application/xhtml+xml "access plus 1 month" - ExpiresByType image/gif "access plus 1 month" - ExpiresByType image/png "access plus 1 month" - ExpiresByType image/svg+xml "access plus 1 month" ExpiresByType image/x-icon "access plus 1 month" - ExpiresByType text/css "access plus 1 month" ExpiresByType text/html "access plus 1 month" ExpiresByType text/javascript "access plus 1 month" <FilesMatch "\.php$"> @@ -38,7 +27,7 @@ AddDefaultCharset UTF-8 </IfModule> <IfModule mod_headers.c> - <FilesMatch "\.(css|html|js|ico|gif|png|woff)$"> + <FilesMatch "\.(css|gif|html|ico|js|png|svg|woff)$"> Header merge Cache-Control "public" </FilesMatch> </IfModule> diff --git a/p/api/.htaccess b/p/api/.htaccess new file mode 100644 index 000000000..41b653d96 --- /dev/null +++ b/p/api/.htaccess @@ -0,0 +1,4 @@ +<IfModule mod_rewrite.c> + RewriteEngine on + RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] +</IfModule> diff --git a/p/api/greader.php b/p/api/greader.php new file mode 100644 index 000000000..4965ffd3b --- /dev/null +++ b/p/api/greader.php @@ -0,0 +1,848 @@ +<?php +/** +== Description == +Server-side API compatible with Google Reader API layer 2 + for the FreshRSS project http://freshrss.org + +== Credits == +* 2014-03: Released by Alexandre Alapetite http://alexandre.alapetite.fr + under GNU AGPL 3 license http://www.gnu.org/licenses/agpl-3.0.html + +== Documentation == +* http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI +* http://web.archive.org/web/20130718025427/http://undoc.in/ +* http://ranchero.com/downloads/GoogleReaderAPI-2009.pdf +* http://code.google.com/p/google-reader-api/w/list +* http://blog.martindoms.com/2009/10/16/using-the-google-reader-api-part-2/ +* https://github.com/noinnion/newsplus/blob/master/extensions/GoogleReaderCloneExtension/src/com/noinnion/android/newsplus/extension/google_reader/GoogleReaderClient.java +* https://github.com/ericmann/gReader-Library/blob/master/greader.class.php +* https://github.com/devongovett/reader +* https://github.com/theoldreader/api +*/ + +require('../../constants.php'); +require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader + +$ORIGINAL_INPUT = file_get_contents('php://input', false, null, -1, 1048576); + +if (PHP_INT_SIZE < 8) { //32-bit + function dec2hex($dec) { + return str_pad(gmp_strval(gmp_init($dec, 10), 16), 16, '0', STR_PAD_LEFT); + } + function hex2dec($hex) { + return gmp_strval(gmp_init($hex, 16), 10); + } +} else { //64-bit + function dec2hex($dec) { //http://code.google.com/p/google-reader-api/wiki/ItemId + return str_pad(dechex($dec), 16, '0', STR_PAD_LEFT); + } + function hex2dec($hex) { + return hexdec($hex); + } +} + +function headerVariable($headerName, $varName) { + $header = ''; + $upName = 'HTTP_' . strtoupper($headerName); + if (isset($_SERVER[$upName])) { + $header = $_SERVER[$upName]; + } elseif (isset($_SERVER['REDIRECT_' . $upName])) { + $header = $_SERVER['REDIRECT_' . $upName]; + } elseif (function_exists('getallheaders')) { + $ALL_HEADERS = getallheaders(); + if (isset($ALL_HEADERS[$headerName])) { + $header = $ALL_HEADERS[$headerName]; + } + } + parse_str($header, $pairs); + return isset($pairs[$varName]) ? $pairs[$varName] : null; +} + +function multiplePosts($name) { //https://bugs.php.net/bug.php?id=51633 + global $ORIGINAL_INPUT; + $inputs = explode('&', $ORIGINAL_INPUT); + $result = array(); + $prefix = $name . '='; + $prefixLength = strlen($prefix); + foreach ($inputs as $input) { + if (strpos($input, $prefix) === 0) { + $result[] = urldecode(substr($input, $prefixLength)); + } + } + return $result; +} + +class MyPDO extends Minz_ModelPdo { + function prepare($sql) { + return $this->bd->prepare(str_replace('%_', $this->prefix, $sql)); + } +} + +function logMe($text) { + file_put_contents(join_path(USERS_PATH, '_', 'log_api.txt'), date('c') . "\t" . $text . "\n", FILE_APPEND); +} + +function debugInfo() { + if (function_exists('getallheaders')) { + $ALL_HEADERS = getallheaders(); + } else { //nginx http://php.net/getallheaders#84262 + $ALL_HEADERS = ''; + foreach ($_SERVER as $name => $value) { + if (substr($name, 0, 5) === 'HTTP_') { + $ALL_HEADERS[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value; + } + } + } + global $ORIGINAL_INPUT; + return print_r(array('date' => date('c'), 'headers' => $ALL_HEADERS, '_SERVER' => $_SERVER, '_GET' => $_GET, '_POST' => $_POST, '_COOKIE' => $_COOKIE, 'INPUT' => $ORIGINAL_INPUT), true); +} + +function badRequest() { + logMe("badRequest()"); + logMe(debugInfo()); + header('HTTP/1.1 400 Bad Request'); + header('Content-Type: text/plain; charset=UTF-8'); + die('Bad Request!'); +} + +function unauthorized() { + logMe("unauthorized()"); + logMe(debugInfo()); + header('HTTP/1.1 401 Unauthorized'); + header('Content-Type: text/plain; charset=UTF-8'); + header('Google-Bad-Token: true'); + die('Unauthorized!'); +} + +function notImplemented() { + logMe("notImplemented()"); + logMe(debugInfo()); + header('HTTP/1.1 501 Not Implemented'); + header('Content-Type: text/plain; charset=UTF-8'); + die('Not Implemented!'); +} + +function serviceUnavailable() { + logMe("serviceUnavailable()"); + header('HTTP/1.1 503 Service Unavailable'); + header('Content-Type: text/plain; charset=UTF-8'); + die('Service Unavailable!'); +} + +function checkCompatibility() { + logMe("checkCompatibility()"); + header('Content-Type: text/plain; charset=UTF-8'); + if (PHP_INT_SIZE < 8 && !function_exists('gmp_init')) { + die('FAIL 64-bit or GMP extension!'); + } + if ((!array_key_exists('HTTP_AUTHORIZATION', $_SERVER)) && //Apache mod_rewrite trick should be fine + (!array_key_exists('REDIRECT_HTTP_AUTHORIZATION', $_SERVER)) && //Apache mod_rewrite with FCGI + (empty($_SERVER['SERVER_SOFTWARE']) || (stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') === false)) && //nginx should be fine + (empty($_SERVER['SERVER_SOFTWARE']) || (stripos($_SERVER['SERVER_SOFTWARE'], 'lighttpd') === false)) && //lighttpd should be fine + ((!function_exists('getallheaders')) || (stripos(php_sapi_name(), 'cgi') !== false))) { //Main problem is Apache/CGI mode + die('FAIL getallheaders! (probably)'); + } + echo 'PASS'; + exit(); +} + +function authorizationToUser() { + $headerAuth = headerVariable('Authorization', 'GoogleLogin_auth'); //Input is 'GoogleLogin auth', but PHP replaces spaces by '_' http://php.net/language.variables.external + if ($headerAuth != '') { + $headerAuthX = explode('/', $headerAuth, 2); + if (count($headerAuthX) === 2) { + $user = $headerAuthX[0]; + if (ctype_alnum($user)) { + FreshRSS_Context::$user_conf = get_user_configuration($user); + if (FreshRSS_Context::$user_conf == null) { + Minz_Log::warning('Invalid API user ' . $user . ': configuration cannot be found.'); + unauthorized(); + } + if ($headerAuthX[1] === sha1(FreshRSS_Context::$system_conf->salt . $user . FreshRSS_Context::$user_conf->apiPasswordHash)) { + return $user; + } else { + logMe('Invalid API authorisation for user ' . $user . ': ' . $headerAuthX[1]); + Minz_Log::warning('Invalid API authorisation for user ' . $user . ': ' . $headerAuthX[1]); + unauthorized(); + } + } else { + badRequest(); + } + } + } + return ''; +} + +function clientLogin($email, $pass) { //http://web.archive.org/web/20130604091042/http://undoc.in/clientLogin.html + //logMe('clientLogin(' . $email . ")"); + if (ctype_alnum($email)) { + if (!function_exists('password_verify')) { + include_once(LIB_PATH . '/password_compat.php'); + } + + FreshRSS_Context::$user_conf = get_user_configuration($email); + if (FreshRSS_Context::$user_conf == null) { + Minz_Log::warning('Invalid API user ' . $email . ': configuration cannot be found.'); + unauthorized(); + } + + if (FreshRSS_Context::$user_conf->apiPasswordHash != '' && password_verify($pass, FreshRSS_Context::$user_conf->apiPasswordHash)) { + header('Content-Type: text/plain; charset=UTF-8'); + $auth = $email . '/' . sha1(FreshRSS_Context::$system_conf->salt . $email . FreshRSS_Context::$user_conf->apiPasswordHash); + echo 'SID=', $auth, "\n", + 'Auth=', $auth, "\n"; + exit(); + } else { + Minz_Log::warning('Password API mismatch for user ' . $email); + unauthorized(); + } + } else { + badRequest(); + } + die(); +} + +function token($conf) { +//http://blog.martindoms.com/2009/08/15/using-the-google-reader-api-part-1/ +//https://github.com/ericmann/gReader-Library/blob/master/greader.class.php + $user = Minz_Session::param('currentUser', '_'); + //logMe('token('. $user . ")"); //TODO: Implement real token that expires + $token = str_pad(sha1(FreshRSS_Context::$system_conf->salt . $user . $conf->apiPasswordHash), 57, 'Z'); //Must have 57 characters + echo $token, "\n"; + exit(); +} + +function checkToken($conf, $token) { +//http://code.google.com/p/google-reader-api/wiki/ActionToken + $user = Minz_Session::param('currentUser', '_'); + //logMe('checkToken(' . $token . ")"); + if ($token === str_pad(sha1(FreshRSS_Context::$system_conf->salt . $user . $conf->apiPasswordHash), 57, 'Z')) { + return true; + } + unauthorized(); +} + +function userInfo() { //https://github.com/theoldreader/api#user-info + //logMe("userInfo()"); + $user = Minz_Session::param('currentUser', '_'); + exit(json_encode(array( + 'userId' => $user, + 'userName' => $user, + 'userProfileId' => $user, + 'userEmail' => FreshRSS_Context::$user_conf->mail_login, + ))); +} + +function tagList() { + //logMe("tagList()"); + header('Content-Type: application/json; charset=UTF-8'); + + $pdo = new MyPDO(); + $stm = $pdo->prepare('SELECT c.name FROM `%_category` c'); + $stm->execute(); + $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); + + $tags = array( + array('id' => 'user/-/state/com.google/starred'), + //array('id' => 'user/-/state/com.google/broadcast', 'sortid' => '2'), + ); + + foreach ($res as $cName) { + $tags[] = array( + 'id' => 'user/-/label/' . $cName, + //'sortid' => $cName, + ); + } + + echo json_encode(array('tags' => $tags)), "\n"; + exit(); +} + +function subscriptionList() { + //logMe("subscriptionList()"); + header('Content-Type: application/json; charset=UTF-8'); + + $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(); + $res = $stm->fetchAll(PDO::FETCH_ASSOC); + + $salt = FreshRSS_Context::$system_conf->salt; + $subscriptions = array(); + + foreach ($res as $line) { + $subscriptions[] = array( + 'id' => 'feed/' . $line['id'], + 'title' => $line['name'], + 'categories' => array( + array( + 'id' => 'user/-/label/' . $line['c_name'], + 'label' => $line['c_name'], + ), + ), + //'sortid' => $line['name'], + //'firstitemmsec' => 0, + 'url' => $line['url'], + 'htmlUrl' => $line['website'], + 'iconUrl' => Minz_Url::display('/f.php?' . hash('crc32b', $salt . $line['url']), '', true), + ); + } + + echo json_encode(array('subscriptions' => $subscriptions)), "\n"; + exit(); +} + +function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = '') { + //logMe("subscriptionEdit()"); + //https://github.com/mihaip/google-reader-api/blob/master/wiki/ApiSubscriptionEdit.wiki + switch ($action) { + case 'subscribe': + case 'unsubscribe': + case 'edit': + break; + default: + badRequest(); + } + $addCatId = 0; + $categoryDAO = null; + if ($add != '' || $remove != '') { + $categoryDAO = new FreshRSS_CategoryDAO(); + } + $c_name = ''; + if ($add != '' && strpos($add, 'user/') === 0) { //user/-/label/Example ; user/username/label/Example + if (strpos($add, 'user/-/label/') === 0) { + $c_name = substr($add, 13); + } else { + $user = Minz_Session::param('currentUser', '_'); + $prefix = 'user/' . $user . '/label/'; + if (strpos($add, $prefix) === 0) { + $c_name = substr($add, strlen($prefix)); + } else { + $c_name = ''; + } + } + $cat = $categoryDAO->searchByName($c_name); + $addCatId = $cat == null ? 0 : $cat->id(); + } else if ($remove != '' && strpos($remove, 'user/-/label/')) { + $addCatId = 1; //Default category + } + $feedDAO = FreshRSS_Factory::createFeedDao(); + for ($i = count($streamNames) - 1; $i >= 0; $i--) { + $streamName = $streamNames[$i]; //feed/http://example.net/sample.xml ; feed/338 + if (strpos($streamName, 'feed/') === 0) { + $streamName = substr($streamName, 5); + $feedId = 0; + if (ctype_digit($streamName)) { + if ($action === 'subscribe') { + continue; + } + $feedId = $streamName; + } else { + $feed = $feedDAO->searchByUrl($streamName); + $feedId = $feed == null ? -1 : $feed->id(); + } + $title = isset($titles[$i]) ? $titles[$i] : ''; + switch ($action) { + case 'subscribe': + if ($feedId <= 0) { + $http_auth = ''; //TODO + try { + $feed = FreshRSS_feed_Controller::addFeed($streamName, $title, $addCatId, $c_name, $http_auth); + continue; + } catch (Exception $e) { + logMe("subscriptionEdit error subscribe: " . $e->getMessage()); + } + } + badRequest(); + break; + case 'unsubscribe': + if (!($feedId > 0 && FreshRSS_feed_Controller::deleteFeed($feedId))) { + badRequest(); + } + break; + case 'edit': + if ($feedId > 0) { + if ($addCatId > 0 || $c_name != '') { + FreshRSS_feed_Controller::moveFeed($feedId, $addCatId, $c_name); + } + if ($title != '') { + FreshRSS_feed_Controller::renameFeed($feedId, $title); + } + } else { + badRequest(); + } + break; + } + } + } + exit('OK'); +} + +function quickadd($url) { + //logMe("quickadd($url)"); + try { + $feed = FreshRSS_feed_Controller::addFeed($url); + exit(json_encode(array( + 'numResults' => 1, + 'streamId' => $feed->id(), + ))); + } catch (Exception $e) { + logMe("subscriptionEdit error subscribe: " . $e->getMessage()); + die(json_encode(array( + 'numResults' => 0, + 'error' => $e->getMessage(), + ))); + } +} + +function unreadCount() { //http://blog.martindoms.com/2009/10/16/using-the-google-reader-api-part-2/#unread-count + //logMe("unreadCount()"); + header('Content-Type: application/json; charset=UTF-8'); + + $totalUnreads = 0; + $totalLastUpdate = 0; + + $categoryDAO = new FreshRSS_CategoryDAO(); + foreach ($categoryDAO->listCategories(true, true) as $cat) { + $catLastUpdate = 0; + foreach ($cat->feeds() as $feed) { + $lastUpdate = $feed->lastUpdate(); + $unreadcounts[] = array( + 'id' => 'feed/' . $feed->id(), + 'count' => $feed->nbNotRead(), + 'newestItemTimestampUsec' => $lastUpdate . '000000', + ); + if ($catLastUpdate < $lastUpdate) { + $catLastUpdate = $lastUpdate; + } + } + $unreadcounts[] = array( + 'id' => 'user/-/label/' . $cat->name(), + 'count' => $cat->nbNotRead(), + 'newestItemTimestampUsec' => $catLastUpdate . '000000', + ); + $totalUnreads += $cat->nbNotRead(); + if ($totalLastUpdate < $catLastUpdate) { + $totalLastUpdate = $catLastUpdate; + } + } + + $unreadcounts[] = array( + 'id' => 'user/-/state/com.google/reading-list', + 'count' => $totalUnreads, + 'newestItemTimestampUsec' => $totalLastUpdate . '000000', + ); + + echo json_encode(array( + 'max' => $totalUnreads, + 'unreadcounts' => $unreadcounts, + )), "\n"; + exit(); +} + +function streamContents($path, $include_target, $start_time, $count, $order, $exclude_target, $continuation) { +//http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI +//http://blog.martindoms.com/2009/10/16/using-the-google-reader-api-part-2/#feed + //logMe("streamContents($path, $include_target, $start_time, $count, $order, $exclude_target, $continuation)"); + header('Content-Type: application/json; charset=UTF-8'); + + $feedDAO = FreshRSS_Factory::createFeedDao(); + $arrayFeedCategoryNames = $feedDAO->arrayFeedCategoryNames(); + + switch ($path) { + case 'reading-list': + $type = 'A'; + break; + case 'starred': + $type = 's'; + break; + case 'feed': + $type = 'f'; + break; + case 'label': + $type = 'c'; + $categoryDAO = new FreshRSS_CategoryDAO(); + $cat = $categoryDAO->searchByName($include_target); + $include_target = $cat == null ? -1 : $cat->id(); + break; + default: + $type = 'A'; + break; + } + + switch ($exclude_target) { + case 'user/-/state/com.google/read': + $state = FreshRSS_Entry::STATE_NOT_READ; + break; + case 'user/-/state/com.google/unread': + $state = FreshRSS_Entry::STATE_READ; + break; + default: + $state = FreshRSS_Entry::STATE_ALL; + break; + } + + if (!empty($continuation)) { + $count++; //Shift by one element + } + + $entryDAO = FreshRSS_Factory::createEntryDao(); + $entries = $entryDAO->listWhere($type, $include_target, $state, $order === 'o' ? 'ASC' : 'DESC', $count, $continuation, new FreshRSS_Search(''), $start_time); + + $items = array(); + foreach ($entries as $entry) { + $f_id = $entry->feed(); + if (isset($arrayFeedCategoryNames[$f_id])) { + $c_name = $arrayFeedCategoryNames[$f_id]['c_name']; + $f_name = $arrayFeedCategoryNames[$f_id]['name']; + } else { + $c_name = '_'; + $f_name = '_'; + } + $item = array( + 'id' => /*'tag:google.com,2005:reader/item/' .*/ dec2hex($entry->id()), //64-bit hexa http://code.google.com/p/google-reader-api/wiki/ItemId + 'crawlTimeMsec' => substr($entry->id(), 0, -3), + 'timestampUsec' => $entry->id(), //EasyRSS + 'published' => $entry->date(true), + 'title' => $entry->title(), + 'summary' => array('content' => $entry->content()), + 'alternate' => array( + array('href' => $entry->link()), + ), + 'categories' => array( + 'user/-/state/com.google/reading-list', + 'user/-/label/' . $c_name, + ), + 'origin' => array( + 'streamId' => 'feed/' . $f_id, + 'title' => $f_name, //EasyRSS + //'htmlUrl' => $line['f_website'], + ), + ); + if ($entry->author() != '') { + $item['author'] = $entry->author(); + } + if ($entry->isRead()) { + $item['categories'][] = 'user/-/state/com.google/read'; + } + if ($entry->isFavorite()) { + $item['categories'][] = 'user/-/state/com.google/starred'; + } + $items[] = $item; + } + + if (!empty($continuation)) { + array_shift($items); //Discard first element that was already sent in the previous response + } + + $response = array( + 'id' => 'user/-/state/com.google/reading-list', + 'updated' => time(), + 'items' => $items, + ); + if ((count($entries) >= $count) && (!empty($entry))) { + $response['continuation'] = $entry->id(); + } + + echo json_encode($response), "\n"; + exit(); +} + +function streamContentsItemsIds($streamId, $start_time, $count, $order, $exclude_target) { +//http://code.google.com/p/google-reader-api/wiki/ApiStreamItemsIds +//http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI +//http://blog.martindoms.com/2009/10/16/using-the-google-reader-api-part-2/#feed + //logMe("streamContentsItemsIds($streamId, $start_time, $count, $order, $exclude_target)"); + + $type = 'A'; + $id = ''; + if ($streamId === 'user/-/state/com.google/reading-list') { + $type = 'A'; + } elseif ('user/-/state/com.google/starred') { + $type = 's'; + } elseif (strpos($streamId, 'feed/') === 0) { + $type = 'f'; + $id = basename($streamId); + } elseif (strpos($streamId, 'user/-/label/') === 0) { + $type = 'c'; + $c_name = substr($streamId, 13); + $categoryDAO = new FreshRSS_CategoryDAO(); + $cat = $categoryDAO->searchByName($c_name); + $id = $cat == null ? -1 : $cat->id(); + } + + switch ($exclude_target) { + case 'user/-/state/com.google/read': + $state = FreshRSS_Entry::STATE_NOT_READ; + break; + default: + $state = FreshRSS_Entry::STATE_ALL; + break; + } + + $entryDAO = FreshRSS_Factory::createEntryDao(); + $ids = $entryDAO->listIdsWhere($type, $id, $state, $order === 'o' ? 'ASC' : 'DESC', $count, '', new FreshRSS_Search(''), $start_time); + + if (empty($ids)) { //For News+ bug https://github.com/noinnion/newsplus/issues/84#issuecomment-57834632 + $ids[] = 0; + } + $itemRefs = array(); + foreach ($ids as $id) { + $itemRefs[] = array( + 'id' => $id, //64-bit decimal + ); + } + + echo json_encode(array( + 'itemRefs' => $itemRefs, + )), "\n"; + exit(); +} + +function editTag($e_ids, $a, $r) { + //logMe("editTag()"); + + foreach ($e_ids as $i => $e_id) { + $e_ids[$i] = hex2dec(basename($e_id)); //Strip prefix 'tag:google.com,2005:reader/item/' + } + + $entryDAO = FreshRSS_Factory::createEntryDao(); + + switch ($a) { + case 'user/-/state/com.google/read': + $entryDAO->markRead($e_ids, true); + break; + case 'user/-/state/com.google/starred': + $entryDAO->markFavorite($e_ids, true); + break; + /*case 'user/-/state/com.google/tracking-kept-unread': + break; + case 'user/-/state/com.google/like': + break; + case 'user/-/state/com.google/broadcast': + break;*/ + } + switch ($r) { + case 'user/-/state/com.google/read': + $entryDAO->markRead($e_ids, false); + break; + case 'user/-/state/com.google/starred': + $entryDAO->markFavorite($e_ids, false); + break; + } + + exit('OK'); +} + +function renameTag($s, $dest) { + //logMe("renameTag()"); + if ($s != '' && strpos($s, 'user/-/label/') === 0 && + $dest != '' && strpos($dest, 'user/-/label/') === 0) { + $s = substr($s, 13); + $categoryDAO = new FreshRSS_CategoryDAO(); + $cat = $categoryDAO->searchByName($s); + if ($cat != null) { + $dest = substr($dest, 13); + $categoryDAO->updateCategory($cat->id(), array('name' => $dest)); + exit('OK'); + } + } + badRequest(); +} + +function disableTag($s) { + //logMe("disableTag($s)"); + if ($s != '' && strpos($s, 'user/-/label/') === 0) { + $s = substr($s, 13); + $categoryDAO = new FreshRSS_CategoryDAO(); + $cat = $categoryDAO->searchByName($s); + if ($cat != null) { + $feedDAO = FreshRSS_Factory::createFeedDao(); + $feedDAO->changeCategory($cat->id(), 0); + if ($cat->id() > 1) { + $categoryDAO->deleteCategory($cat->id()); + } + exit('OK'); + } + } + badRequest(); +} + +function markAllAsRead($streamId, $olderThanId) { + //logMe("markAllAsRead($streamId, $olderThanId)"); + $entryDAO = FreshRSS_Factory::createEntryDao(); + if (strpos($streamId, 'feed/') === 0) { + $f_id = basename($streamId); + $entryDAO->markReadFeed($f_id, $olderThanId); + } elseif (strpos($streamId, 'user/-/label/') === 0) { + $c_name = substr($streamId, 13); + $categoryDAO = new FreshRSS_CategoryDAO(); + $cat = $categoryDAO->searchByName($c_name); + $entryDAO->markReadCat($cat === null ? -1 : $cat->id(), $olderThanId); + } elseif ($streamId === 'user/-/state/com.google/reading-list') { + $entryDAO->markReadEntries($olderThanId, false, -1); + } + + exit('OK'); +} + +//logMe('----------------------------------------------------------------'); +//logMe(debugInfo()); + +$pathInfo = empty($_SERVER['PATH_INFO']) ? '/Error' : urldecode($_SERVER['PATH_INFO']); +$pathInfos = explode('/', $pathInfo); + +Minz_Configuration::register('system', + DATA_PATH . '/config.php', + DATA_PATH . '/config.default.php'); +FreshRSS_Context::$system_conf = Minz_Configuration::get('system'); +if (!FreshRSS_Context::$system_conf->api_enabled) { + serviceUnavailable(); +} + +Minz_Session::init('FreshRSS'); + +$user = authorizationToUser(); +FreshRSS_Context::$user_conf = null; +if ($user !== '') { + FreshRSS_Context::$user_conf = get_user_configuration($user); +} + +//logMe('User => ' . $user); + +Minz_Session::_param('currentUser', $user); + +if (count($pathInfos) < 3) { + badRequest(); +} +elseif ($pathInfos[1] === 'accounts') { + if (($pathInfos[2] === 'ClientLogin') && isset($_REQUEST['Email']) && isset($_REQUEST['Passwd'])) { + clientLogin($_REQUEST['Email'], $_REQUEST['Passwd']); + } +} +elseif ($pathInfos[1] === 'reader' && $pathInfos[2] === 'api' && isset($pathInfos[3]) && $pathInfos[3] === '0' && isset($pathInfos[4])) { + if ($user == '') { + unauthorized(); + } + $timestamp = isset($_GET['ck']) ? intval($_GET['ck']) : 0; //ck=[unix timestamp] : Use the current Unix time here, helps Google with caching. + switch ($pathInfos[4]) { + case 'stream': + $exclude_target = isset($_GET['xt']) ? $_GET['xt'] : ''; //xt=[exclude target] : Used to exclude certain items from the feed. For example, using xt=user/-/state/com.google/read will exclude items that the current user has marked as read, or xt=feed/[feedurl] will exclude items from a particular feed (obviously not useful in this request, but xt appears in other listing requests). + $count = isset($_GET['n']) ? intval($_GET['n']) : 20; //n=[integer] : The maximum number of results to return. + $order = isset($_GET['r']) ? $_GET['r'] : 'd'; //r=[d|n|o] : Sort order of item results. d or n gives items in descending date order, o in ascending order. + $start_time = isset($_GET['ot']) ? intval($_GET['ot']) : 0; //ot=[unix timestamp] : The time from which you want to retrieve items. Only items that have been crawled by Google Reader after this time will be returned. + $continuation = isset($_GET['c']) ? $_GET['c'] : ''; //Continuation token. If a StreamContents response does not represent all items in a timestamp range, it will have a continuation attribute. The same request can be re-issued with the value of that attribute put in this parameter to get more items + if (isset($pathInfos[5]) && $pathInfos[5] === 'contents' && isset($pathInfos[6])) { + if (isset($pathInfos[7])) { + if ($pathInfos[6] === 'feed') { + $include_target = $pathInfos[7]; + StreamContents($pathInfos[6], $include_target, $start_time, $count, $order, $exclude_target, $continuation); + } elseif ($pathInfos[6] === 'user' && isset($pathInfos[8]) && isset($pathInfos[9])) { + if ($pathInfos[8] === 'state') { + if ($pathInfos[9] === 'com.google' && isset($pathInfos[10])) { + if ($pathInfos[10] === 'reading-list' || $pathInfos[10] === 'starred') { + $include_target = ''; + streamContents($pathInfos[10], $include_target, $start_time, $count, $order, $exclude_target, $continuation); + } + } + } elseif ($pathInfos[8] === 'label') { + $include_target = $pathInfos[9]; + streamContents($pathInfos[8], $include_target, $start_time, $count, $order, $exclude_target, $continuation); + } + } + } else { //EasyRSS + $include_target = ''; + streamContents('reading-list', $include_target, $start_time, $count, $order, $exclude_target, $continuation); + } + } elseif ($pathInfos[5] === 'items') { + if ($pathInfos[6] === 'ids' && isset($_GET['s'])) { + $streamId = $_GET['s']; //StreamId for which to fetch the item IDs. The parameter may be repeated to fetch the item IDs from multiple streams at once (more efficient from a backend perspective than multiple requests). + streamContentsItemsIds($streamId, $start_time, $count, $order, $exclude_target); + } + } + break; + case 'tag': + if (isset($pathInfos[5]) && $pathInfos[5] === 'list') { + $output = isset($_GET['output']) ? $_GET['output'] : ''; + if ($output !== 'json') notImplemented(); + tagList($output); + } + break; + case 'subscription': + if (isset($pathInfos[5])) { + switch ($pathInfos[5]) { + case 'list': + $output = isset($_GET['output']) ? $_GET['output'] : ''; + if ($output !== 'json') notImplemented(); + subscriptionList($_GET['output']); + break; + case 'edit': + if (isset($_POST['s']) && isset($_POST['ac'])) { + $streamNames = multiplePosts('s'); //StreamId to operate on. The parameter may be repeated to edit multiple subscriptions at once + $titles = multiplePosts('t'); //Title to use for the subscription. For the `subscribe` action, if not specified then the feed's current title will be used. Can be used with the `edit` action to rename a subscription + $action = $_POST['ac']; //Action to perform on the given StreamId. Possible values are `subscribe`, `unsubscribe` and `edit` + $add = isset($_POST['a']) ? $_POST['a'] : ''; //StreamId to add the subscription to (generally a user label) + $remove = isset($_POST['r']) ? $_POST['r'] : ''; //StreamId to remove the subscription from (generally a user label) + subscriptionEdit($streamNames, $titles, $action, $add, $remove); + } + break; + case 'quickadd': //https://github.com/theoldreader/api + if (isset($_GET['quickadd'])) { + quickadd($_GET['quickadd']); + } + break; + } + } + break; + case 'unread-count': + $output = isset($_GET['output']) ? $_GET['output'] : ''; + if ($output !== 'json') notImplemented(); + $all = isset($_GET['all']) ? $_GET['all'] : ''; + unreadCount($all); + break; + case 'edit-tag': //http://blog.martindoms.com/2010/01/20/using-the-google-reader-api-part-3/ + $token = isset($_POST['T']) ? trim($_POST['T']) : ''; + checkToken(FreshRSS_Context::$user_conf, $token); + $a = isset($_POST['a']) ? $_POST['a'] : ''; //Add: user/-/state/com.google/read user/-/state/com.google/starred + $r = isset($_POST['r']) ? $_POST['r'] : ''; //Remove: user/-/state/com.google/read user/-/state/com.google/starred + $e_ids = multiplePosts('i'); //item IDs + editTag($e_ids, $a, $r); + break; + case 'rename-tag': //https://github.com/theoldreader/api + $token = isset($_POST['T']) ? trim($_POST['T']) : ''; + checkToken(FreshRSS_Context::$user_conf, $token); + $s = isset($_POST['s']) ? $_POST['s'] : ''; //user/-/label/Folder + $dest = isset($_POST['dest']) ? $_POST['dest'] : ''; //user/-/label/NewFolder + renameTag($s, $dest); + break; + case 'disable-tag': //https://github.com/theoldreader/api + $token = isset($_POST['T']) ? trim($_POST['T']) : ''; + checkToken(FreshRSS_Context::$user_conf, $token); + $s_s = multiplePosts('s'); + foreach ($s_s as $s) { + disableTag($s); //user/-/label/Folder + } + break; + case 'mark-all-as-read': + $token = isset($_POST['T']) ? trim($_POST['T']) : ''; + checkToken(FreshRSS_Context::$user_conf, $token); + $streamId = $_POST['s']; //StreamId + $ts = isset($_POST['ts']) ? $_POST['ts'] : '0'; //Older than timestamp in nanoseconds + if (!ctype_digit($ts)) { + $ts = '0'; + } + markAllAsRead($streamId, $ts); + break; + case 'token': + token(FreshRSS_Context::$user_conf); + break; + case 'user-info': + userInfo(); + break; + } +} elseif ($pathInfos[1] === 'check' && $pathInfos[2] === 'compatibility') { + checkCompatibility(); +} + +badRequest(); diff --git a/p/api/index.php b/p/api/index.php new file mode 100644 index 000000000..3ab4e02b3 --- /dev/null +++ b/p/api/index.php @@ -0,0 +1,29 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB"> +<head> +<meta charset="UTF-8" /> +<title>FreshRSS API</title> +<meta name="robots" content="noindex" /> +<link rel="start" href="../i/" /> +</head> + +<body> +<h1>FreshRSS API</h1> + +<h2>Google Reader compatible API</h2> +<dl> +<dt>Your API address:</dt> +<dd><?php +require('../../constants.php'); +require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader +Minz_Configuration::register('system', DATA_PATH . '/config.php', DATA_PATH . '/config.default.php'); +echo Minz_Url::display('/api/greader.php', 'html', true); +?></dd> +</dl> +<ul> +<li><a href="greader.php/check%2Fcompatibility" rel="nofollow">Check full server configuration</a></li> +<li><a href="greader.php/check/compatibility" rel="nofollow">Check partial server configuration (without <code>%2F</code> support)</a></li> +</ul> + +</body> +</html> diff --git a/p/api/pshb.php b/p/api/pshb.php new file mode 100644 index 000000000..e9b66b167 --- /dev/null +++ b/p/api/pshb.php @@ -0,0 +1,143 @@ +<?php +require('../../constants.php'); +require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader + +define('MAX_PAYLOAD', 3145728); + +header('Content-Type: text/plain; charset=UTF-8'); +header('X-Content-Type-Options: nosniff'); + +function logMe($text) { + file_put_contents(USERS_PATH . '/_/log_pshb.txt', date('c') . "\t" . $text . "\n", FILE_APPEND); +} + +$ORIGINAL_INPUT = file_get_contents('php://input', false, null, -1, MAX_PAYLOAD); + +//logMe(print_r(array('_SERVER' => $_SERVER, '_GET' => $_GET, '_POST' => $_POST, 'INPUT' => $ORIGINAL_INPUT), true)); + +$key = isset($_GET['k']) ? substr($_GET['k'], 0, 128) : ''; +if (!ctype_xdigit($key)) { + header('HTTP/1.1 422 Unprocessable Entity'); + die('Invalid feed key format!'); +} +chdir(PSHB_PATH); +$canonical64 = @file_get_contents('keys/' . $key . '.txt'); +if ($canonical64 === false) { + header('HTTP/1.1 404 Not Found'); + logMe('Error: Feed key not found!: ' . $key); + die('Feed key not found!'); +} +$canonical64 = trim($canonical64); +if (!preg_match('/^[A-Za-z0-9_-]+$/D', $canonical64)) { + header('HTTP/1.1 500 Internal Server Error'); + logMe('Error: Invalid key reference!: ' . $canonical64); + die('Invalid key reference!'); +} +$hubFile = @file_get_contents('feeds/' . $canonical64 . '/!hub.json'); +if ($hubFile === false) { + header('HTTP/1.1 404 Not Found'); + //@unlink('keys/' . $key . '.txt'); + logMe('Error: Feed info not found!: ' . $canonical64); + die('Feed info not found!'); +} +$hubJson = json_decode($hubFile, true); +if (!$hubJson || empty($hubJson['key']) || $hubJson['key'] !== $key) { + header('HTTP/1.1 500 Internal Server Error'); + logMe('Error: Invalid key cross-check!: ' . $key); + die('Invalid key cross-check!'); +} +chdir('feeds/' . $canonical64); +$users = glob('*.txt', GLOB_NOSORT); +if (empty($users)) { + header('HTTP/1.1 410 Gone'); + logMe('Error: Nobody is subscribed to this feed anymore!: ' . $canonical64); + die('Nobody is subscribed to this feed anymore!'); +} + +if (!empty($_REQUEST['hub_mode']) && $_REQUEST['hub_mode'] === 'subscribe') { + $leaseSeconds = empty($_REQUEST['hub_lease_seconds']) ? 0 : intval($_REQUEST['hub_lease_seconds']); + if ($leaseSeconds > 60) { + $hubJson['lease_end'] = time() + $leaseSeconds; + } else { + unset($hubJson['lease_end']); + } + $hubJson['lease_start'] = time(); + if (!isset($hubJson['error'])) { + $hubJson['error'] = true; //Do not assume that PubSubHubbub works until the first successul push + } + file_put_contents('./!hub.json', json_encode($hubJson)); + header('Connection: close'); + exit(isset($_REQUEST['hub_challenge']) ? $_REQUEST['hub_challenge'] : ''); +} + +if (!empty($_REQUEST['hub_mode']) && $_REQUEST['hub_mode'] === 'unsubscribe') { + if (empty($hubJson['lease_end']) || $hubJson['lease_end'] < time()) { + header('Connection: close'); + exit(isset($_REQUEST['hub_challenge']) ? $_REQUEST['hub_challenge'] : ''); + } else { + header('HTTP/1.1 422 Unprocessable Entity'); + die('We did not ask to unsubscribe!'); + } +} + +if ($ORIGINAL_INPUT == '') { + header('HTTP/1.1 422 Unprocessable Entity'); + die('Missing XML payload!'); +} + +Minz_Configuration::register('system', DATA_PATH . '/config.php', DATA_PATH . '/config.default.php'); +$system_conf = Minz_Configuration::get('system'); +$system_conf->auth_type = 'none'; // avoid necessity to be logged in (not saved!) + +$simplePie = customSimplePie(); +$simplePie->set_raw_data($ORIGINAL_INPUT); +$simplePie->init(); +unset($ORIGINAL_INPUT); + +$links = $simplePie->get_links('self'); +$self = isset($links[0]) ? $links[0] : null; + +if ($self !== base64url_decode($canonical64)) { + //header('HTTP/1.1 422 Unprocessable Entity'); + logMe('Warning: Self URL [' . $self . '] does not match registered canonical URL!: ' . base64url_decode($canonical64)); + //die('Self URL does not match registered canonical URL!'); + $self = base64url_decode($canonical64); +} + +$nb = 0; +foreach ($users as $userFilename) { + $username = basename($userFilename, '.txt'); + if (!file_exists(USERS_PATH . '/' . $username . '/config.php')) { + break; + } + + try { + Minz_Session::_param('currentUser', $username); + Minz_Configuration::register('user', + join_path(USERS_PATH, $username, 'config.php'), + join_path(USERS_PATH, '_', 'config.default.php')); + new Minz_ModelPdo($username); //TODO: FIXME: Quick-fix while waiting for a better FreshRSS() constructor/init + FreshRSS_Context::init(); + list($updated_feeds, $feed) = FreshRSS_feed_Controller::actualizeFeed(0, $self, false, $simplePie); + if ($updated_feeds > 0) { + $nb++; + } + } catch (Exception $e) { + logMe('Error: ' . $e->getMessage()); + } +} + +$simplePie->__destruct(); +unset($simplePie); + +if ($nb === 0) { + header('HTTP/1.1 410 Gone'); + logMe('Error: Nobody is subscribed to this feed anymore after all!: ' . $self); + die('Nobody is subscribed to this feed anymore after all!'); +} elseif (!empty($hubJson['error'])) { + $hubJson['error'] = false; + file_put_contents('./!hub.json', json_encode($hubJson)); +} + +logMe('PubSubHubbub ' . $self . ' done: ' . $nb); +exit('Done: ' . $nb . "\n"); diff --git a/p/ext.php b/p/ext.php new file mode 100644 index 000000000..5c9f9125f --- /dev/null +++ b/p/ext.php @@ -0,0 +1,71 @@ +<?php +if (!isset($_GET['f']) || + !isset($_GET['t'])) { + header('HTTP/1.1 400 Bad Request'); + die(); +} + +require('../constants.php'); + +/** + * Check if a file can be served by ext.php. A valid file is under a + * EXTENSIONS_PATH/extension_name/static/ directory. + * + * You should sanitize path by using the realpath() function. + * + * @param $path the path to the file we want to serve. + * @return true if it can be served, false else. + * + */ +function is_valid_path($path) { + // It must be under the extension path. + $in_ext_path = (substr($path, 0, strlen(EXTENSIONS_PATH)) === EXTENSIONS_PATH); + if (!$in_ext_path) { + return false; + } + + // File to serve must be under a `ext_dir/static/` directory. + $path_relative_to_ext = substr($path, strlen(EXTENSIONS_PATH) + 1); + $path_splitted = explode('/', $path_relative_to_ext); + if (count($path_splitted) < 3 || $path_splitted[1] !== 'static') { + return false; + } + + return true; +} + +$file_name = urldecode($_GET['f']); +$file_type = $_GET['t']; + +$absolute_filename = realpath(EXTENSIONS_PATH . '/' . $file_name); + +if (!is_valid_path($absolute_filename)) { + header('HTTP/1.1 400 Bad Request'); + die(); +} + +switch ($file_type) { +case 'css': + header('Content-Type: text/css; charset=UTF-8'); + header('Content-Disposition: inline; filename="' . $file_name . '"'); + break; +case 'js': + header('Content-Type: application/javascript; charset=UTF-8'); + header('Content-Disposition: inline; filename="' . $file_name . '"'); + break; +default: + header('HTTP/1.1 400 Bad Request'); + die(); +} + +$mtime = @filemtime($absolute_filename); +if ($mtime === false) { + header('HTTP/1.1 404 Not Found'); + die(); +} + +require(LIB_PATH . '/http-conditional.php'); + +if (!httpConditional($mtime, 604800, 2)) { + readfile($absolute_filename); +} @@ -1,36 +1,22 @@ <?php + require('../constants.php'); -$favicons_dir = DATA_PATH . '/favicons/'; +require(LIB_PATH . '/favicons.php'); +require(LIB_PATH . '/http-conditional.php'); -/* Télécharge le favicon d'un site et le place sur le serveur */ -function download_favicon ($website, $dest) { - $ok = false; - $url = 'http://g.etfv.co/' . $website; +function show_default_favicon($cacheSeconds = 3600) { + global $default_favicon; - $c = curl_init ($url); - curl_setopt ($c, CURLOPT_HEADER, false); - curl_setopt ($c, CURLOPT_RETURNTRANSFER, true); - curl_setopt ($c, CURLOPT_BINARYTRANSFER, true); - $imgRaw = curl_exec ($c); + header('Content-Disposition: inline; filename="default_favicon.ico"'); - if (curl_getinfo ($c, CURLINFO_HTTP_CODE) == 200) { - $file = fopen ($dest, 'w'); - if ($file !== false) { - fwrite ($file, $imgRaw); - fclose ($file); - $ok = true; - } - } - curl_close ($c); - if (!$ok) { - header('Location: ' . $url); - return false; + $default_mtime = @filemtime($default_favicon); + if (!httpConditional($default_mtime, $cacheSeconds, 2)) { + readfile($default_favicon); } - return true; } -$id = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '0'; +$id = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '0'; if (!ctype_xdigit($id)) { $id = '0'; } @@ -38,27 +24,32 @@ if (!ctype_xdigit($id)) { $txt = $favicons_dir . $id . '.txt'; $ico = $favicons_dir . $id . '.ico'; -$icoMTime = @filemtime($ico); -$txtMTime = @filemtime($txt); +$ico_mtime = @filemtime($ico); +$txt_mtime = @filemtime($txt); -if (($icoMTime == false) || ($txtMTime > $icoMTime)) { - if ($txtMTime == false) { - header('HTTP/1.1 404 Not Found'); - header('Content-Type: image/gif'); - readfile(PUBLIC_PATH . '/themes/icons/grey.gif'); //TODO: Better 404 favicon - die(); +header('Content-Type: image/x-icon'); + +if ($ico_mtime == false || $ico_mtime < $txt_mtime || ($ico_mtime < time() - (rand(15, 20) * 86400))) { + if ($txt_mtime == false) { + show_default_favicon(1800); + exit(); } + + // no ico file or we should download a new one. $url = file_get_contents($txt); if (!download_favicon($url, $ico)) { - die(); + // Download failed + if ($ico_mtime == false) { + show_default_favicon(86400); + exit(); + } else { + touch($ico); + } } } -require(LIB_PATH . '/http-conditional.php'); - -header('Content-Type: image/x-icon'); header('Content-Disposition: inline; filename="' . $id . '.ico"'); -if (!httpConditional($icoMTime, 2592000, 2)) { +if (!httpConditional($ico_mtime, rand(14, 21) * 86400, 2)) { readfile($ico); } diff --git a/p/i/.gitignore b/p/i/.gitignore new file mode 100644 index 000000000..03c88fd7a --- /dev/null +++ b/p/i/.gitignore @@ -0,0 +1 @@ +.htaccess diff --git a/p/i/index.php b/p/i/index.php index 187bbabe8..d3fc0b37c 100755 --- a/p/i/index.php +++ b/p/i/index.php @@ -18,12 +18,12 @@ # # ***** END LICENSE BLOCK ***** -if (file_exists ('install.php')) { - require('install.php'); -} else { - require('../../constants.php'); - require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader +require('../../constants.php'); +require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader +if (file_exists(DATA_PATH . '/do-install.txt')) { + require(APP_PATH . '/install.php'); +} else { session_cache_limiter(''); Minz_Session::init('FreshRSS'); Minz_Session::_param('keepAlive', 1); //For Persona @@ -32,21 +32,21 @@ if (file_exists ('install.php')) { require(LIB_PATH . '/http-conditional.php'); $currentUser = Minz_Session::param('currentUser', ''); $dateLastModification = $currentUser === '' ? time() : max( - @filemtime(LOG_PATH . '/' . $currentUser . '.log'), - @filemtime(DATA_PATH . '/config.php') + @filemtime(join_path(USERS_PATH, $currentUser, 'log.txt')), + @filemtime(join_path(DATA_PATH, 'config.php')) ); - if (httpConditional($dateLastModification, 0, 0, false, false, true)) { + if (httpConditional($dateLastModification, 0, 0, false, PHP_COMPRESSION, true)) { exit(); //No need to send anything } } try { $front_controller = new FreshRSS(); - $front_controller->init (); - $front_controller->run (); + $front_controller->init(); + $front_controller->run(); } catch (Exception $e) { echo '### Fatal error! ###<br />', "\n"; - Minz_Log::record ($e->getMessage (), Minz_Log::ERROR); + Minz_Log::error($e->getMessage()); echo 'See logs files.'; } } diff --git a/p/i/install.php b/p/i/install.php deleted file mode 100644 index 90ee0b8a9..000000000 --- a/p/i/install.php +++ /dev/null @@ -1,1082 +0,0 @@ -<?php -if (function_exists('opcache_reset')) { - opcache_reset(); -} - -require('../../constants.php'); -define('BCRYPT_COST', 9); - -include(LIB_PATH . '/lib_rss.php'); - -session_name('FreshRSS'); -session_set_cookie_params(0, dirname(empty($_SERVER['REQUEST_URI']) ? '/' : dirname($_SERVER['REQUEST_URI'])), null, false, true); -session_start(); - -if (isset ($_GET['step'])) { - define ('STEP', $_GET['step']); -} else { - define ('STEP', 1); -} - -define('SQL_CREATE_DB', 'CREATE DATABASE IF NOT EXISTS %1$s DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); - -include(APP_PATH . '/sql.php'); - -//<updates> -define('SQL_SHOW_TABLES', 'SHOW tables;'); - -define('SQL_BACKUP006', 'RENAME TABLE `%1$scategory` TO `%1$scategory006`, `%1$sfeed` TO `%1$sfeed006`, `%1$sentry` TO `%1$sentry006`;'); - -define('SQL_SHOW_COLUMNS_UPDATEv006', 'SHOW columns FROM `%1$sentry006` LIKE "id2";'); - -define('SQL_UPDATEv006', ' -ALTER TABLE `%1$scategory006` ADD id2 SMALLINT; - -SET @i = 0; -UPDATE `%1$scategory006` SET id2=(@i:=@i+1) ORDER BY id; - -ALTER TABLE `%1$sfeed006` ADD id2 SMALLINT, ADD category2 SMALLINT; - -SET @i = 0; -UPDATE `%1$sfeed006` SET id2=(@i:=@i+1) ORDER BY name; - -UPDATE `%1$sfeed006` f -INNER JOIN `%1$scategory006` c ON f.category = c.id -SET f.category2 = c.id2; - -INSERT IGNORE INTO `%2$scategory` (name) -SELECT name -FROM `%1$scategory006` -ORDER BY id2; - -INSERT IGNORE INTO `%2$sfeed` (url, category, name, website, description, priority, pathEntries, httpAuth, keep_history) -SELECT url, category2, name, website, description, priority, pathEntries, httpAuth, IF(keep_history = 1, -1, -2) -FROM `%1$sfeed006` -ORDER BY id2; - -ALTER TABLE `%1$sentry006` ADD id2 bigint; - -UPDATE `%1$sentry006` SET id2 = ((date * 1000000) + (rand() * 100000000)); - -INSERT IGNORE INTO `%2$sentry` (id, guid, title, author, link, date, is_read, is_favorite, id_feed, tags) -SELECT e0.id2, e0.guid, e0.title, e0.author, e0.link, e0.date, e0.is_read, e0.is_favorite, f0.id2, e0.tags -FROM `%1$sentry006` e0 -INNER JOIN `%1$sfeed006` f0 ON e0.id_feed = f0.id; -'); - -define('SQL_CONVERT_SELECTv006', ' -SELECT e0.id2, e0.content -FROM `%1$sentry006` e0 -INNER JOIN `%2$sentry` e1 ON e0.id2 = e1.id -WHERE e1.content_bin IS NULL'); - -define('SQL_CONVERT_UPDATEv006', 'UPDATE `%1$sentry` SET content_bin=COMPRESS(?) WHERE id=?;'); - -define('SQL_DROP_BACKUPv006', 'DROP TABLE IF EXISTS `%1$sentry006`, `%1$sfeed006`, `%1$scategory006`;'); - -define('SQL_UPDATE_CACHED_VALUES', ' -UPDATE `%1$sfeed` f -INNER JOIN ( - SELECT e.id_feed, - COUNT(CASE WHEN e.is_read = 0 THEN 1 END) AS nbUnreads, - COUNT(e.id) AS nbEntries - FROM `%1$sentry` e - GROUP BY e.id_feed -) x ON x.id_feed=f.id -SET f.cache_nbEntries=x.nbEntries, f.cache_nbUnreads=x.nbUnreads -'); - -define('SQL_UPDATE_HISTORYv007b', 'UPDATE `%1$sfeed` SET keep_history = CASE WHEN keep_history = 0 THEN -2 WHEN keep_history = 1 THEN -1 ELSE keep_history END;'); - -define('SQL_GET_FEEDS', 'SELECT id, url, website FROM `%1$sfeed`;'); -//</updates> - -// gestion internationalisation -$translates = array (); -$actual = 'en'; -function initTranslate () { - global $translates; - global $actual; - - $actual = isset($_SESSION['language']) ? $_SESSION['language'] : getBetterLanguage('en'); - - $file = APP_PATH . '/i18n/' . $actual . '.php'; - if (file_exists($file)) { - $translates = array_merge($translates, include($file)); - } - - $file = APP_PATH . '/i18n/install.' . $actual . '.php'; - if (file_exists($file)) { - $translates = array_merge($translates, include($file)); - } -} - -function getBetterLanguage ($fallback) { - $available = availableLanguages (); - $accept = $_SERVER['HTTP_ACCEPT_LANGUAGE']; - $language = strtolower (substr ($accept, 0, 2)); - - if (isset ($available[$language])) { - return $language; - } else { - return $fallback; - } -} -function availableLanguages () { - return array ( - 'en' => 'English', - 'fr' => 'Français' - ); -} -function _t ($key) { - global $translates; - $translate = $key; - if (isset ($translates[$key])) { - $translate = $translates[$key]; - } - - $args = func_get_args (); - unset($args[0]); - - return vsprintf ($translate, $args); -} - -/*** SAUVEGARDES ***/ -function saveLanguage () { - if (!empty ($_POST)) { - if (!isset ($_POST['language'])) { - return false; - } - - $_SESSION['language'] = $_POST['language']; - - header ('Location: index.php?step=1'); - } -} -function saveStep2 () { - if (!empty ($_POST)) { - if (empty ($_POST['title']) || - empty ($_POST['old_entries']) || - empty ($_POST['auth_type']) || - empty ($_POST['default_user'])) { - return false; - } - - $_SESSION['salt'] = sha1(uniqid(mt_rand(), true).implode('', stat(__FILE__))); - $_SESSION['title'] = substr(trim($_POST['title']), 0, 25); - $_SESSION['old_entries'] = $_POST['old_entries']; - if ((!ctype_digit($_SESSION['old_entries'])) || ($_SESSION['old_entries'] < 1)) { - $_SESSION['old_entries'] = 3; - } - $_SESSION['mail_login'] = filter_var($_POST['mail_login'], FILTER_VALIDATE_EMAIL); - $_SESSION['default_user'] = substr(preg_replace('/[^a-zA-Z0-9]/', '', $_POST['default_user']), 0, 16); - $_SESSION['auth_type'] = $_POST['auth_type']; - if (!empty($_POST['passwordPlain'])) { - if (!function_exists('password_hash')) { - include_once(LIB_PATH . '/password_compat.php'); - } - $passwordHash = password_hash($_POST['passwordPlain'], PASSWORD_BCRYPT, array('cost' => BCRYPT_COST)); - $passwordHash = preg_replace('/^\$2[xy]\$/', '\$2a\$', $passwordHash); //Compatibility with bcrypt.js - $_SESSION['passwordHash'] = $passwordHash; - } - - $token = ''; - if ($_SESSION['mail_login']) { - $token = sha1($_SESSION['salt'] . $_SESSION['mail_login']); - } - - $config_array = array ( - 'language' => $_SESSION['language'], - 'theme' => $_SESSION['theme'], - 'old_entries' => $_SESSION['old_entries'], - 'mail_login' => $_SESSION['mail_login'], - 'passwordHash' => $_SESSION['passwordHash'], - 'token' => $token, - ); - - $configPath = DATA_PATH . '/' . $_SESSION['default_user'] . '_user.php'; - @unlink($configPath); //To avoid access-rights problems - file_put_contents($configPath, "<?php\n return " . var_export($config_array, true) . ';'); - - if ($_SESSION['mail_login'] != '') { - $personaFile = DATA_PATH . '/persona/' . $_SESSION['mail_login'] . '.txt'; - @unlink($personaFile); - file_put_contents($personaFile, $_SESSION['default_user']); - } - - header ('Location: index.php?step=3'); - } -} - -function saveStep3 () { - if (!empty ($_POST)) { - if (empty ($_POST['type']) || - empty ($_POST['host']) || - empty ($_POST['user']) || - empty ($_POST['base'])) { - $_SESSION['bd_error'] = 'Missing parameters!'; - } - - $_SESSION['bd_type'] = isset ($_POST['type']) ? $_POST['type'] : 'mysql'; - $_SESSION['bd_host'] = $_POST['host']; - $_SESSION['bd_user'] = $_POST['user']; - $_SESSION['bd_password'] = $_POST['pass']; - $_SESSION['bd_base'] = substr($_POST['base'], 0, 64); - $_SESSION['bd_prefix'] = substr($_POST['prefix'], 0, 16); - $_SESSION['bd_prefix_user'] = $_SESSION['bd_prefix'] . (empty($_SESSION['default_user']) ? '' : ($_SESSION['default_user'] . '_')); - - $ini_array = array( - 'general' => array( - 'environment' => empty($_SESSION['environment']) ? 'production' : $_SESSION['environment'], - 'use_url_rewriting' => false, - 'salt' => $_SESSION['salt'], - 'base_url' => '', - 'title' => $_SESSION['title'], - 'default_user' => $_SESSION['default_user'], - 'auth_type' => $_SESSION['auth_type'], - 'allow_anonymous' => isset($_SESSION['allow_anonymous']) ? $_SESSION['allow_anonymous'] : false, - ), - 'db' => array( - 'type' => $_SESSION['bd_type'], - 'host' => $_SESSION['bd_host'], - 'user' => $_SESSION['bd_user'], - 'password' => $_SESSION['bd_password'], - 'base' => $_SESSION['bd_base'], - 'prefix' => $_SESSION['bd_prefix'], - ), - ); - - @unlink(DATA_PATH . '/config.php'); //To avoid access-rights problems - file_put_contents(DATA_PATH . '/config.php', "<?php\n return " . var_export($ini_array, true) . ';'); - - if (file_exists(DATA_PATH . '/config.php') && file_exists(DATA_PATH . '/application.ini')) { - @unlink(DATA_PATH . '/application.ini'); //v0.6 - } - - $res = checkBD (); - - if ($res) { - $_SESSION['bd_error'] = ''; - header ('Location: index.php?step=4'); - } elseif (empty($_SESSION['bd_error'])) { - $_SESSION['bd_error'] = 'Unknown error!'; - } - } - invalidateHttpCache(); -} - -function updateDatabase($perform = false) { - $needs = array('bd_type', 'bd_host', 'bd_base', 'bd_user', 'bd_password', 'bd_prefix', 'bd_prefix_user'); - foreach ($needs as $need) { - if (!isset($_SESSION[$need])) { - return false; - } - } - - try { - $str = ''; - switch ($_SESSION['bd_type']) { - case 'mysql': - $str = 'mysql:host=' . $_SESSION['bd_host'] . ';dbname=' . $_SESSION['bd_base']; - $driver_options = array( - PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', - ); - break; - case 'sqlite': - $str = 'sqlite:' . DATA_PATH . $_SESSION['bd_base'] . '.sqlite'; - $driver_options = null; - break; - default: - return false; - } - - $c = new PDO($str, $_SESSION['bd_user'], $_SESSION['bd_password'], $driver_options); - - $stm = $c->prepare(SQL_SHOW_TABLES); - $stm->execute(); - $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); - if (!in_array($_SESSION['bd_prefix'] . 'entry006', $res)) { - return false; - } - - $sql = sprintf(SQL_SHOW_COLUMNS_UPDATEv006, $_SESSION['bd_prefix']); - $stm = $c->prepare($sql); - $stm->execute(); - $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); - if (!in_array('id2', $res)) { - if (!$perform) { - return true; - } - $sql = sprintf(SQL_UPDATEv006, $_SESSION['bd_prefix'], $_SESSION['bd_prefix_user']); - $stm = $c->prepare($sql, array(PDO::ATTR_EMULATE_PREPARES => true)); - $stm->execute(); - } - - $sql = sprintf(SQL_CONVERT_SELECTv006, $_SESSION['bd_prefix'], $_SESSION['bd_prefix_user']); - if (!$perform) { - $sql .= ' LIMIT 1'; - } - $stm = $c->prepare($sql); - $stm->execute(); - if (!$perform) { - $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); - return count($res) > 0; - } else { - @set_time_limit(300); - } - - $c2 = new PDO($str, $_SESSION['bd_user'], $_SESSION['bd_password'], $driver_options); - $sql = sprintf(SQL_CONVERT_UPDATEv006, $_SESSION['bd_prefix_user']); - $stm2 = $c2->prepare($sql); - while ($row = $stm->fetch(PDO::FETCH_ASSOC)) { - $id = $row['id2']; - $content = unserialize(gzinflate(base64_decode($row['content']))); - $stm2->execute(array($content, $id)); - } - - return true; - } catch (PDOException $e) { - return false; - } - return false; -} - -function newPdo() { - switch ($_SESSION['bd_type']) { - case 'mysql': - $str = 'mysql:host=' . $_SESSION['bd_host'] . ';dbname=' . $_SESSION['bd_base']; - $driver_options = array( - PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', - ); - break; - case 'sqlite': - $str = 'sqlite:' . DATA_PATH . $_SESSION['bd_base'] . '.sqlite'; - $driver_options = null; - break; - default: - return false; - } - return new PDO($str, $_SESSION['bd_user'], $_SESSION['bd_password'], $driver_options); -} - -function postUpdate() { - $c = newPdo(); - - $sql = sprintf(SQL_UPDATE_HISTORYv007b, $_SESSION['bd_prefix_user']); - $stm = $c->prepare($sql); - $stm->execute(); - - $sql = sprintf(SQL_UPDATE_CACHED_VALUES, $_SESSION['bd_prefix_user']); - $stm = $c->prepare($sql); - $stm->execute(); - - //<favicons> - $sql = sprintf(SQL_GET_FEEDS, $_SESSION['bd_prefix_user']); - $stm = $c->prepare($sql); - $stm->execute(); - $res = $stm->fetchAll(PDO::FETCH_ASSOC); - foreach ($res as $feed) { - if (empty($feed['url'])) { - continue; - } - $hash = hash('crc32b', $_SESSION['salt'] . $feed['url']); - @file_put_contents(DATA_PATH . '/favicons/' . $hash . '.txt', - empty($feed['website']) ? $feed['url'] : $feed['website']); - } - //</favicons> -} - -function deleteInstall () { - $res = unlink (INDEX_PATH . '/install.php'); - if ($res) { - header ('Location: index.php'); - } - - $needs = array('bd_type', 'bd_host', 'bd_base', 'bd_user', 'bd_password', 'bd_prefix'); - foreach ($needs as $need) { - if (!isset($_SESSION[$need])) { - return false; - } - } - - try { - $c = newPdo(); - $sql = sprintf(SQL_DROP_BACKUPv006, $_SESSION['bd_prefix']); - $stm = $c->prepare($sql); - $stm->execute(); - - return true; - } catch (PDOException $e) { - return false; - } - return false; -} - -function moveOldFiles() { - $mvs = array( - '/app/configuration/application.ini' => '/data/application.ini', //v0.6 - '/public/data/Configuration.array.php' => '/data/Configuration.array.php', //v0.6 - ); - $ok = true; - foreach ($mvs as $fFrom => $fTo) { - if (file_exists(FRESHRSS_PATH . $fFrom)) { - if (copy(FRESHRSS_PATH . $fFrom, FRESHRSS_PATH . $fTo)) { - @unlink(FRESHRSS_PATH . $fFrom); - } else { - $ok = false; - } - } - } - return $ok; -} - -function delTree($dir) { //http://php.net/rmdir#110489 - if (!is_dir($dir)) { - return true; - } - $files = array_diff(scandir($dir), array('.', '..')); - foreach ($files as $file) { - $f = $dir . '/' . $file; - if (is_dir($f)) { - @chmod($f, 0777); - delTree($f); - } - else unlink($f); - } - return rmdir($dir); -} - -/*** VÉRIFICATIONS ***/ -function checkStep () { - $s0 = checkStep0 (); - $s1 = checkStep1 (); - $s2 = checkStep2 (); - $s3 = checkStep3 (); - if (STEP > 0 && $s0['all'] != 'ok') { - header ('Location: index.php?step=0'); - } elseif (STEP > 1 && $s1['all'] != 'ok') { - header ('Location: index.php?step=1'); - } elseif (STEP > 2 && $s2['all'] != 'ok') { - header ('Location: index.php?step=2'); - } elseif (STEP > 3 && $s3['all'] != 'ok') { - header ('Location: index.php?step=3'); - } - $_SESSION['actualize_feeds'] = true; -} -function checkStep0 () { - moveOldFiles(); - - if (file_exists(DATA_PATH . '/config.php')) { - $ini_array = include(DATA_PATH . '/config.php'); - } elseif (file_exists(DATA_PATH . '/application.ini')) { //v0.6 - $ini_array = parse_ini_file(DATA_PATH . '/application.ini', true); - $ini_array['general']['title'] = empty($ini_array['general']['title']) ? '' : stripslashes($ini_array['general']['title']); - } else { - $ini_array = null; - } - - if ($ini_array) { - $ini_general = isset($ini_array['general']) ? $ini_array['general'] : null; - if ($ini_general) { - $keys = array('environment', 'salt', 'title', 'default_user', 'allow_anonymous', 'auth_type'); - foreach ($keys as $key) { - if ((empty($_SESSION[$key])) && isset($ini_general[$key])) { - $_SESSION[$key] = $ini_general[$key]; - } - } - } - $ini_db = isset($ini_array['db']) ? $ini_array['db'] : null; - if ($ini_db) { - $keys = array('type', 'host', 'user', 'password', 'base', 'prefix'); - foreach ($keys as $key) { - if ((!isset($_SESSION['bd_' . $key])) && isset($ini_db[$key])) { - $_SESSION['bd_' . $key] = $ini_db[$key]; - } - } - } - } - - if (isset($_SESSION['default_user']) && file_exists(DATA_PATH . '/' . $_SESSION['default_user'] . '_user.php')) { - $userConfig = include(DATA_PATH . '/' . $_SESSION['default_user'] . '_user.php'); - } elseif (file_exists(DATA_PATH . '/Configuration.array.php')) { - $userConfig = include(DATA_PATH . '/Configuration.array.php'); //v0.6 - if (empty($_SESSION['auth_type'])) { - $_SESSION['auth_type'] = empty($userConfig['mail_login']) ? 'none' : 'persona'; - } - if (!isset($_SESSION['allow_anonymous'])) { - $_SESSION['allow_anonymous'] = empty($userConfig['anon_access']) ? false : ($userConfig['anon_access'] === 'yes'); - } - } else { - $userConfig = array(); - } - if (empty($_SESSION['auth_type'])) { //v0.7b - $_SESSION['auth_type'] = ''; - } - - $keys = array('language', 'theme', 'old_entries', 'mail_login', 'passwordHash'); - foreach ($keys as $key) { - if ((!isset($_SESSION[$key])) && isset($userConfig[$key])) { - $_SESSION[$key] = $userConfig[$key]; - } - } - - $languages = availableLanguages (); - $language = isset ($_SESSION['language']) && - isset ($languages[$_SESSION['language']]); - - if (empty($_SESSION['passwordHash'])) { //v0.7b - $_SESSION['passwordHash'] = ''; - } - if (empty($_SESSION['theme'])) { - $_SESSION['theme'] = 'Origine'; - } else { - switch (strtolower($_SESSION['theme'])) { - case 'default': //v0.7b - $_SESSION['theme'] = 'Origine'; - break; - case 'flat-design': //v0.7b - $_SESSION['theme'] = 'Flat'; - break; - case 'default_dark': //v0.7b - $_SESSION['theme'] = 'Dark'; - break; - } - } - - return array ( - 'language' => $language ? 'ok' : 'ko', - 'all' => $language ? 'ok' : 'ko' - ); -} - -function checkStep1 () { - $php = version_compare (PHP_VERSION, '5.2.1') >= 0; - $minz = file_exists (LIB_PATH . '/Minz'); - $curl = extension_loaded ('curl'); - $pdo = extension_loaded ('pdo_mysql'); - $pcre = extension_loaded ('pcre'); - $ctype = extension_loaded ('ctype'); - $dom = class_exists('DOMDocument'); - $data = DATA_PATH && is_writable (DATA_PATH); - $cache = CACHE_PATH && is_writable (CACHE_PATH); - $log = LOG_PATH && is_writable (LOG_PATH); - $favicons = is_writable (DATA_PATH . '/favicons'); - $persona = is_writable (DATA_PATH . '/persona'); - - return array ( - 'php' => $php ? 'ok' : 'ko', - 'minz' => $minz ? 'ok' : 'ko', - 'curl' => $curl ? 'ok' : 'ko', - 'pdo-mysql' => $pdo ? 'ok' : 'ko', - 'pcre' => $pcre ? 'ok' : 'ko', - 'ctype' => $ctype ? 'ok' : 'ko', - 'dom' => $dom ? 'ok' : 'ko', - 'data' => $data ? 'ok' : 'ko', - 'cache' => $cache ? 'ok' : 'ko', - 'log' => $log ? 'ok' : 'ko', - 'favicons' => $favicons ? 'ok' : 'ko', - 'persona' => $persona ? 'ok' : 'ko', - 'all' => $php && $minz && $curl && $pdo && $pcre && $ctype && $dom && $data && $cache && $log && $favicons && $persona ? 'ok' : 'ko' - ); -} - -function checkStep2 () { - $conf = !empty($_SESSION['salt']) && - !empty($_SESSION['title']) && - !empty($_SESSION['old_entries']) && - isset($_SESSION['mail_login']) && - !empty($_SESSION['default_user']); - $defaultUser = empty($_POST['default_user']) ? null : $_POST['default_user']; - if ($defaultUser === null) { - $defaultUser = empty($_SESSION['default_user']) ? '' : $_SESSION['default_user']; - } - $data = is_writable(DATA_PATH . '/' . $defaultUser . '_user.php'); - if ($data) { - @unlink(DATA_PATH . '/Configuration.array.php'); //v0.6 - } - - return array ( - 'conf' => $conf ? 'ok' : 'ko', - 'data' => $data ? 'ok' : 'ko', - 'all' => $conf && $data ? 'ok' : 'ko' - ); -} -function checkStep3 () { - $conf = is_writable(DATA_PATH . '/config.php'); - - $bd = isset ($_SESSION['bd_type']) && - isset ($_SESSION['bd_host']) && - isset ($_SESSION['bd_user']) && - isset ($_SESSION['bd_password']) && - isset ($_SESSION['bd_base']) && - isset ($_SESSION['bd_prefix']) && - isset ($_SESSION['bd_error']); - $conn = empty($_SESSION['bd_error']); - - return array ( - 'bd' => $bd ? 'ok' : 'ko', - 'conn' => $conn ? 'ok' : 'ko', - 'conf' => $conf ? 'ok' : 'ko', - 'all' => $bd && $conn && $conf ? 'ok' : 'ko' - ); -} - -function checkBD () { - $ok = false; - - try { - $str = ''; - $driver_options = null; - switch ($_SESSION['bd_type']) { - case 'mysql': - $driver_options = array( - PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8' - ); - - try { // on ouvre une connexion juste pour créer la base si elle n'existe pas - $str = 'mysql:host=' . $_SESSION['bd_host'] . ';'; - $c = new PDO ($str, $_SESSION['bd_user'], $_SESSION['bd_password'], $driver_options); - $sql = sprintf (SQL_CREATE_DB, $_SESSION['bd_base']); - $res = $c->query ($sql); - } catch (PDOException $e) { - } - - // on écrase la précédente connexion en sélectionnant la nouvelle BDD - $str = 'mysql:host=' . $_SESSION['bd_host'] . ';dbname=' . $_SESSION['bd_base']; - break; - case 'sqlite': - $str = 'sqlite:' . DATA_PATH . $_SESSION['bd_base'] . '.sqlite'; - break; - default: - return false; - } - - $c = new PDO ($str, $_SESSION['bd_user'], $_SESSION['bd_password'], $driver_options); - - $stm = $c->prepare(SQL_SHOW_TABLES); - $stm->execute(); - $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); - if (in_array($_SESSION['bd_prefix'] . 'entry', $res) && !in_array($_SESSION['bd_prefix'] . 'entry006', $res)) { - $sql = sprintf(SQL_BACKUP006, $_SESSION['bd_prefix']); //v0.6 - $res = $c->query($sql); //Backup tables - } - - $sql = sprintf(SQL_CREATE_TABLES, $_SESSION['bd_prefix_user']); - $stm = $c->prepare($sql, array(PDO::ATTR_EMULATE_PREPARES => true)); - $values = array( - 'catName' => _t('default_category'), - ); - $ok = $stm->execute($values); - } catch (PDOException $e) { - $ok = false; - $_SESSION['bd_error'] = $e->getMessage(); - } - - if (!$ok) { - @unlink(DATA_PATH . '/config.php'); - } - - return $ok; -} - -/*** AFFICHAGE ***/ -function printStep0 () { - global $actual; -?> - <?php $s0 = checkStep0 (); if ($s0['all'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('language_defined'); ?></p> - <?php } ?> - - <form action="index.php?step=0" method="post"> - <legend><?php echo _t ('choose_language'); ?></legend> - <div class="form-group"> - <label class="group-name" for="language"><?php echo _t ('language'); ?></label> - <div class="group-controls"> - <select name="language" id="language"> - <?php $languages = availableLanguages (); ?> - <?php foreach ($languages as $short => $lib) { ?> - <option value="<?php echo $short; ?>"<?php echo $actual == $short ? ' selected="selected"' : ''; ?>><?php echo $lib; ?></option> - <?php } ?> - </select> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo _t ('save'); ?></button> - <button type="reset" class="btn"><?php echo _t ('cancel'); ?></button> - <?php if ($s0['all'] == 'ok') { ?> - <a class="btn btn-important next-step" href="?step=1"><?php echo _t ('next_step'); ?></a> - <?php } ?> - </div> - </div> - </form> -<?php -} - -function printStep1 () { - $res = checkStep1 (); -?> - <noscript><p class="alert alert-warn"><span class="alert-head"><?php echo _t ('attention'); ?></span> <?php echo _t ('javascript_is_better'); ?></p></noscript> - - <?php if ($res['php'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('php_is_ok', PHP_VERSION); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('php_is_nok', PHP_VERSION, '5.2.1'); ?></p> - <?php } ?> - - <?php if ($res['minz'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('minz_is_ok'); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('minz_is_nok', LIB_PATH . '/Minz'); ?></p> - <?php } ?> - - <?php if ($res['pdo-mysql'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('pdomysql_is_ok'); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('pdomysql_is_nok'); ?></p> - <?php } ?> - - <?php if ($res['curl'] == 'ok') { ?> - <?php $version = curl_version(); ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('curl_is_ok', $version['version']); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('curl_is_nok'); ?></p> - <?php } ?> - - <?php if ($res['pcre'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('pcre_is_ok'); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('pcre_is_nok'); ?></p> - <?php } ?> - - <?php if ($res['ctype'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('ctype_is_ok'); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('ctype_is_nok'); ?></p> - <?php } ?> - - <?php if ($res['dom'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('dom_is_ok'); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('dom_is_nok'); ?></p> - <?php } ?> - - <?php if ($res['data'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('data_is_ok'); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('file_is_nok', DATA_PATH); ?></p> - <?php } ?> - - <?php if ($res['cache'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('cache_is_ok'); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('file_is_nok', CACHE_PATH); ?></p> - <?php } ?> - - <?php if ($res['log'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('log_is_ok'); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('file_is_nok', LOG_PATH); ?></p> - <?php } ?> - - <?php if ($res['favicons'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('favicons_is_ok'); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('file_is_nok', DATA_PATH . '/favicons'); ?></p> - <?php } ?> - - <?php if ($res['persona'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('persona_is_ok'); ?></p> - <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('file_is_nok', DATA_PATH . '/persona'); ?></p> - <?php } ?> - - <?php if ($res['all'] == 'ok') { ?> - <a class="btn btn-important next-step" href="?step=2"><?php echo _t ('next_step'); ?></a> - <?php } else { ?> - <p class="alert alert-error"><?php echo _t ('fix_errors_before'); ?></p> - <?php } ?> -<?php -} - -function printStep2 () { -?> - <?php $s2 = checkStep2 (); if ($s2['all'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('general_conf_is_ok'); ?></p> - <?php } ?> - - <form action="index.php?step=2" method="post"> - <legend><?php echo _t ('general_configuration'); ?></legend> - - <div class="form-group"> - <label class="group-name" for="title"><?php echo _t ('title'); ?></label> - <div class="group-controls"> - <input type="text" id="title" name="title" value="<?php echo isset ($_SESSION['title']) ? $_SESSION['title'] : _t ('freshrss'); ?>" /> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="old_entries"><?php echo _t ('delete_articles_every'); ?></label> - <div class="group-controls"> - <input type="number" id="old_entries" name="old_entries" required="required" min="1" max="1200" value="<?php echo isset ($_SESSION['old_entries']) ? $_SESSION['old_entries'] : '3'; ?>" /> <?php echo _t ('month'); ?> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="default_user"><?php echo _t ('default_user'); ?></label> - <div class="group-controls"> - <input type="text" id="default_user" name="default_user" required="required" size="16" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" value="<?php echo isset ($_SESSION['default_user']) ? $_SESSION['default_user'] : ''; ?>" placeholder="<?php echo httpAuthUser() == '' ? 'user1' : httpAuthUser(); ?>" /> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="auth_type"><?php echo _t('auth_type'); ?></label> - <div class="group-controls"> - <select id="auth_type" name="auth_type" required="required"> - <?php if (!in_array($_SESSION['auth_type'], array('form', 'persona', 'http_auth', 'none'))) { ?> - <option selected="selected"></option> - <?php } ?> - <option value="form"<?php echo $_SESSION['auth_type'] === 'form' ? ' selected="selected"' : '', version_compare(PHP_VERSION, '5.3', '<') ? ' disabled="disabled"' : ''; ?>><?php echo _t('auth_form'); ?></option> - <option value="persona"<?php echo $_SESSION['auth_type'] === 'persona' ? ' selected="selected"' : ''; ?>><?php echo _t('auth_persona'); ?></option> - <option value="http_auth"<?php echo $_SESSION['auth_type'] === 'http_auth' ? ' selected="selected"' : '', httpAuthUser() == '' ? ' disabled="disabled"' : ''; ?>><?php echo _t('http_auth'); ?> (REMOTE_USER = '<?php echo httpAuthUser(); ?>')</option> - <option value="none"<?php echo $_SESSION['auth_type'] === 'none' ? ' selected="selected"' : ''; ?>><?php echo _t('auth_none'); ?></option> - </select> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="passwordPlain"><?php echo _t('password_form'); ?></label> - <div class="group-controls"> - <input type="password" id="passwordPlain" name="passwordPlain" pattern=".{7,}" autocomplete="off" /> - <noscript><b><?php echo _t('javascript_should_be_activated'); ?></b></noscript> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="mail_login"><?php echo _t ('persona_connection_email'); ?></label> - <div class="group-controls"> - <input type="email" id="mail_login" name="mail_login" value="<?php echo isset ($_SESSION['mail_login']) ? $_SESSION['mail_login'] : ''; ?>" placeholder="alice@example.net" /> - <noscript><b><?php echo _t ('javascript_should_be_activated'); ?></b></noscript> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo _t ('save'); ?></button> - <button type="reset" class="btn"><?php echo _t ('cancel'); ?></button> - <?php if ($s2['all'] == 'ok') { ?> - <a class="btn btn-important next-step" href="?step=3"><?php echo _t ('next_step'); ?></a> - <?php } ?> - </div> - </div> - </form> -<?php -} - -function printStep3 () { -?> - <?php $s3 = checkStep3 (); if ($s3['all'] == 'ok') { ?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('bdd_conf_is_ok'); ?></p> - <?php } elseif ($s3['conn'] == 'ko') { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('bdd_conf_is_ko'), (empty($_SESSION['bd_error']) ? '' : ' : ' . $_SESSION['bd_error']); ?></p> - <?php } ?> - - <form action="index.php?step=3" method="post"> - <legend><?php echo _t ('bdd_configuration'); ?></legend> - <div class="form-group"> - <label class="group-name" for="type"><?php echo _t ('bdd_type'); ?></label> - <div class="group-controls"> - <select name="type" id="type"> - <option value="mysql" - <?php echo (isset($_SESSION['bd_type']) && $_SESSION['bd_type'] === 'mysql') ? 'selected="selected"' : ''; ?>> - MySQL - </option> - <!-- TODO : l'utilisation de SQLite n'est pas encore possible. Pour tester tout de même, décommentez ce bloc - <option value="sqlite" - <?php echo (isset($_SESSION['bd_type']) && $_SESSION['bd_type'] === 'sqlite') ? 'selected="selected"' : ''; ?>> - SQLite - </option>--> - </select> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="host"><?php echo _t ('host'); ?></label> - <div class="group-controls"> - <input type="text" id="host" name="host" pattern="[0-9A-Za-z_.-]{1,64}" value="<?php echo isset ($_SESSION['bd_host']) ? $_SESSION['bd_host'] : 'localhost'; ?>" /> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="user"><?php echo _t ('username'); ?></label> - <div class="group-controls"> - <input type="text" id="user" name="user" maxlength="16" pattern="[0-9A-Za-z_]{1,16}" value="<?php echo isset ($_SESSION['bd_user']) ? $_SESSION['bd_user'] : ''; ?>" /> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="pass"><?php echo _t ('password'); ?></label> - <div class="group-controls"> - <input type="password" id="pass" name="pass" value="<?php echo isset ($_SESSION['bd_password']) ? $_SESSION['bd_password'] : ''; ?>" /> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="base"><?php echo _t ('bdd'); ?></label> - <div class="group-controls"> - <input type="text" id="base" name="base" maxlength="64" pattern="[0-9A-Za-z_]{1,64}" value="<?php echo isset ($_SESSION['bd_base']) ? $_SESSION['bd_base'] : ''; ?>" placeholder="freshrss" /> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="prefix"><?php echo _t ('prefix'); ?></label> - <div class="group-controls"> - <input type="text" id="prefix" name="prefix" maxlength="16" pattern="[0-9A-Za-z_]{1,16}" value="<?php echo isset ($_SESSION['bd_prefix']) ? $_SESSION['bd_prefix'] : 'freshrss_'; ?>" /> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo _t ('save'); ?></button> - <button type="reset" class="btn"><?php echo _t ('cancel'); ?></button> - <?php if ($s3['all'] == 'ok') { ?> - <a class="btn btn-important next-step" href="?step=4"><?php echo _t ('next_step'); ?></a> - <?php } ?> - </div> - </div> - </form> -<?php -} - -function printStep4 () { -?> - <form action="index.php?step=4" method="post"> - <legend><?php echo _t ('version_update'); ?></legend> - - <?php if (updateDatabase(false)) { ?> - <p class="alert alert-warn"><?php echo _t ('update_long'); ?></p> - - <div class="form-group form-actions"> - <div class="group-controls"> - <input type="hidden" name="updateDatabase" value="1" /> - <button type="submit" class="btn btn-important"><?php echo _t ('update_start'); ?></button> - </div> - </div> - - <?php } else { ?> - <p class="alert alert-warn"><?php echo _t ('update_end'); ?></p> - - <div class="form-group form-actions"> - <div class="group-controls"> - <a class="btn btn-important next-step" href="?step=5"><?php echo _t ('next_step'); ?></a> - </div> - </div> - <?php } ?> - </form> -<?php -} - -function printStep5 () { -?> - <p class="alert alert-success"><span class="alert-head"><?php echo _t ('congratulations'); ?></span> <?php echo _t ('installation_is_ok'); ?></p> - <a class="btn btn-important next-step" href="?step=6"><?php echo _t ('finish_installation'); ?></a> -<?php -} - -function printStep6 () { -?> - <p class="alert alert-error"><span class="alert-head"><?php echo _t ('oops'); ?></span> <?php echo _t ('install_not_deleted', INDEX_PATH . '/install.php'); ?></p> -<?php -} - -checkStep (); - -initTranslate (); - -switch (STEP) { -case 0: -default: - saveLanguage (); - break; -case 1: - break; -case 2: - saveStep2 (); - break; -case 3: - saveStep3 (); - break; -case 4: - if (!empty($_POST['updateDatabase'])) { - updateDatabase(true); - } - break; -case 5: - postUpdate(); - break; -case 6: - deleteInstall (); - break; -} -?> -<!DOCTYPE html> -<html lang="fr"> - <head> - <meta charset="utf-8"> - <meta name="viewport" content="initial-scale=1.0"> - <title><?php echo _t ('freshrss_installation'); ?></title> - <link rel="stylesheet" type="text/css" media="all" href="../themes/Origine/global.css" /> - <link rel="stylesheet" type="text/css" media="all" href="../themes/Origine/freshrss.css" /> - </head> - <body> - -<div class="header"> - <div class="item title"> - <h1><a href="index.php"><?php echo _t ('freshrss'); ?></a></h1> - <h2><?php echo _t ('installation_step', STEP); ?></h2> - </div> -</div> - -<div id="global"> - <ul class="nav nav-list aside"> - <li class="nav-header"><?php echo _t ('steps'); ?></li> - <li class="item<?php echo STEP == 0 ? ' active' : ''; ?>"><a href="?step=0"><?php echo _t ('language'); ?></a></li> - <li class="item<?php echo STEP == 1 ? ' active' : ''; ?>"><a href="?step=1"><?php echo _t ('checks'); ?></a></li> - <li class="item<?php echo STEP == 2 ? ' active' : ''; ?>"><a href="?step=2"><?php echo _t ('general_configuration'); ?></a></li> - <li class="item<?php echo STEP == 3 ? ' active' : ''; ?>"><a href="?step=3"><?php echo _t ('bdd_configuration'); ?></a></li> - <li class="item<?php echo STEP == 4 ? ' active' : ''; ?>"><a href="?step=4"><?php echo _t ('version_update'); ?></a></li> - <li class="item<?php echo STEP == 5 ? ' active' : ''; ?>"><a href="?step=5"><?php echo _t ('this_is_the_end'); ?></a></li> - </ul> - - <div class="post"> - <?php - switch (STEP) { - case 0: - default: - printStep0 (); - break; - case 1: - printStep1 (); - break; - case 2: - printStep2 (); - break; - case 3: - printStep3 (); - break; - case 4: - printStep4 (); - break; - case 5: - printStep5 (); - break; - case 6: - printStep6 (); - break; - } - ?> - </div> -</div> - </body> -</html> diff --git a/p/index.html b/p/index.html index 260f437bd..3f4284eb5 100644 --- a/p/index.html +++ b/p/index.html @@ -5,27 +5,11 @@ <meta name="viewport" content="initial-scale=1.0" /> <meta http-equiv="Refresh" content="0; url=i/" /> <title>FreshRSS</title> +<link rel="stylesheet" href="themes/p.css" /> <link rel="shortcut icon" type="image/x-icon" sizes="16x16 64x64" href="favicon.ico" /> <link rel="icon msapplication-TileImage apple-touch-icon" type="image/png" sizes="256x256" href="themes/icons/favicon-256.png" /> <meta name="msapplication-TileColor" content="#FFF" /> -<meta name="robots" content="noindex,nofollow" /> -<style> -body { - font-family: sans-serif; - text-align: center; -} -h1 { - font-size: xx-large; - text-shadow: 1px -1px 0 #CCCCCC; -} -h1 a { - color: #0062BE; - text-decoration: none; -} -img { - border: 0; -} -</style> +<meta name="robots" content="noindex" /> </head> <body> diff --git a/p/scripts/bcrypt.min.js b/p/scripts/bcrypt.min.js index 6892caddc..614f0c259 100644 --- a/p/scripts/bcrypt.min.js +++ b/p/scripts/bcrypt.min.js @@ -1,41 +1,45 @@ -/* +(function(){/* bcrypt.js (c) 2013 Daniel Wirtz <dcode@dcode.io> Released under the Apache License, Version 2.0 see: https://github.com/dcodeIO/bcrypt.js for details */ -function p(n){throw n;}var q=null; -(function(n){function u(c,a,b,f){for(var d,e=c[a],l=c[a+1],e=e^b[0],h=0;14>=h;)d=f[e>>24&255],d+=f[256|e>>16&255],d^=f[512|e>>8&255],d+=f[768|e&255],l^=d^b[++h],d=f[l>>24&255],d+=f[256|l>>16&255],d^=f[512|l>>8&255],d+=f[768|l&255],e^=d^b[++h];c[a]=l^b[17];c[a+1]=e;return c}function s(c,a){var b,f=0;for(b=0;4>b;b++)f=f<<8|c[a]&255,a=(a+1)%c.length;return{key:f,a:a}}function y(c,a,b){for(var f=0,d=[0,0],e=a.length,l=b.length,h=0;h<e;h++){var g=s(c,f),f=g.a;a[h]^=g.key}for(h=0;h<e;h+=2)d=u(d,0,a,b), -a[h]=d[0],a[h+1]=d[1];for(h=0;h<l;h+=2)d=u(d,0,a,b),b[h]=d[0],b[h+1]=d[1]}function C(c,a,b,f){for(var d=0,e=[0,0],l=b.length,h=f.length,g,k=0;k<l;k++)g=s(a,d),d=g.a,b[k]^=g.key;for(k=d=0;k<l;k+=2)g=s(c,d),d=g.a,e[0]^=g.key,g=s(c,d),d=g.a,e[1]^=g.key,e=u(e,0,b,f),b[k]=e[0],b[k+1]=e[1];for(k=0;k<h;k+=2)g=s(c,d),d=g.a,e[0]^=g.key,g=s(c,d),d=g.a,e[1]^=g.key,e=u(e,0,b,f),f[k]=e[0],f[k+1]=e[1]}function z(c){"undefined"!==typeof process&&"function"===typeof process.nextTick?process.nextTick(c):setTimeout(c, -0)}function A(c,a,b,f){function d(){if(k<b)for(var n=new Date;k<b&&!(k+=1,y(c,h,g),y(a,h,g),100<Date.now()-n););else{for(k=0;64>k;k++)for(m=0;m<l>>1;m++)u(e,m<<1,h,g);n=[];for(k=0;k<l;k++)n.push((e[k]>>24&255)>>>0),n.push((e[k]>>16&255)>>>0),n.push((e[k]>>8&255)>>>0),n.push((e[k]&255)>>>0);return f?(f(q,n),q):n}f&&z(d);return q}var e=B.slice(),l=e.length;(4>b||31<b)&&p(Error("Illegal number of rounds: "+b));16!=a.length&&p(Error("Illegal salt length: "+a.length+" != 16"));b=1<<b;var h=D.slice(),g= -E.slice();C(a,c,h,g);var k=0,m;if("undefined"!==typeof f)return d(),q;for(var n;;)if((n=d())!==q)return n}function F(c){for(var a,b,f=[],d=0;d<c.length;d++){a=c.charCodeAt(d);b=[];do b.push(a&255),a>>=8;while(a);f=f.concat(b.reverse())}return f}function w(c,a,b){function f(a){var b=[];b.push("$2");"a"<=d&&b.push(d);b.push("$");10>l&&b.push("0");b.push(l.toString());b.push("$");b.push(v.b(h,h.length));b.push(v.b(a,4*B.length-1));return b.join("")}var d,e;("$"!=a.charAt(0)||"2"!=a.charAt(1))&&p(Error("Invalid salt version: "+ -a.substring(0,2)));"$"==a.charAt(2)?(d=String.fromCharCode(0),e=3):(d=a.charAt(2),("a"!=d||"$"!=a.charAt(3))&&p(Error("Invalid salt revision: "+a.substring(2,4))),e=4);"$"<a.charAt(e+2)&&p(Error("Missing salt rounds"));var l=10*parseInt(a.substring(e,e+1),10)+parseInt(a.substring(e+1,e+2),10);a=a.substring(e+3,e+25);c=F(c+("a"<=d?"\x00":""));var h=[],h=v.c(a,16);if("undefined"==typeof b)return f(A(c,h,l));A(c,h,l,function(a,c){a?b(a,q):b(q,f(c))});return q}function G(){if("undefined"!==typeof module&& -module.exports)return require("crypto").randomBytes(16);var c=new Uint32Array(16);n.crypto&&"function"===typeof n.crypto.getRandomValues?n.crypto.getRandomValues(c):"function"===typeof x?x(c):p(Error("Failed to generate random values: Web Crypto API not available / no polyfill set"));return Array.prototype.slice.call(c)}var t="./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),r=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, --1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,54,55,56,57,58,59,60,61,62,63,-1,-1,-1,-1,-1,-1,-1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,-1,-1,-1,-1,-1,-1,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,-1,-1,-1,-1,-1],v={b:function(c,a){var b=0,f=[],d,e;for((0>=a||a>c.length)&&p(Error("Invalid 'len': "+a));b<a;){d=c[b++]&255;f.push(t[d>>2&63]);d=(d&3)<<4;if(b>=a){f.push(t[d&63]);break}e=c[b++]&255;d|=e>>4&15;f.push(t[d&63]);d=(e&15)<< -2;if(b>=a){f.push(t[d&63]);break}e=c[b++]&255;d|=e>>6&3;f.push(t[d&63]);f.push(t[e&63])}return f.join("")},c:function(c,a){var b=0,f=c.length,d=0,e=[],l,h,g;for(0>=a&&p(Error("Illegal 'len': "+a));b<f-1&&d<a;){g=c.charCodeAt(b++);l=g<r.length?r[g]:-1;g=c.charCodeAt(b++);h=g<r.length?r[g]:-1;if(-1==l||-1==h)break;g=l<<2>>>0;g|=(h&48)>>4;e.push(String.fromCharCode(g));if(++d>=a||b>=f)break;g=c.charCodeAt(b++);l=g<r.length?r[g]:-1;if(-1==l)break;g=(h&15)<<4>>>0;g|=(l&60)>>2;e.push(String.fromCharCode(g)); -if(++d>=a||b>=f)break;g=c.charCodeAt(b++);h=g<r.length?r[g]:-1;g=(l&3)<<6>>>0;g|=h;e.push(String.fromCharCode(g));++d}f=[];for(b=0;b<d;b++)f.push(e[b].charCodeAt(0));return f}},m={},D=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],E=[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374, -1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131, -1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968, -3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899, -3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193, -3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195, -705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946,1266315497,3048417604,3681880366,3289982499,290971E4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060, -2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842, -3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102, -3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641, -2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569, -3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055,3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037, -2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547, -1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079, -4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015, -3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264, -448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278, -3720792119,3617206836,2455994898,1729034894,1080033504,976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729, -2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361, -1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417, -2941484381,1077988104,1320477388,886195818,18198404,3786409E3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597, -3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138, -3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462],B=[1332899944,1700884034,1701343084,1684370003,1668446532,1869963892],x=q;m.setRandomPolyfill=function(c){x=c};m.genSaltSync=function(c){c||(c=10);var a;c=c||10;(4>c||31<c)&&p(Error("Illegal number of rounds: "+c));var b=[]; -b.push("$2a$");10>c&&b.push("0");b.push(c.toString());b.push("$");try{b.push(v.b(G(),16)),a=b.join("")}catch(f){p(f)}return a};m.genSalt=function(c,a,b){"function"==typeof a&&(b=a,a=-1);var f;"function"==typeof c?(b=c,f=10):f=parseInt(c,10);"function"!=typeof b&&p(Error("Illegal or missing 'callback': "+b));z(function(){try{var a=m.genSaltSync(f);b(q,a)}catch(c){b(c,q)}})};m.hashSync=function(c,a){a||(a=10);"number"==typeof a&&(a=m.genSaltSync(a));return w(c,a)};m.hash=function(c,a,b){"function"!= -typeof b&&p(Error("Illegal 'callback': "+b));"number"==typeof a?m.genSalt(a,function(a,d){w(c,d,b)}):w(c,a,b)};m.compareSync=function(c,a){("string"!=typeof c||"string"!=typeof a)&&p(Error("Illegal argument types: "+typeof c+", "+typeof a));60!=a.length&&p(Error("Illegal hash length: "+a.length+" != 60"));for(var b=m.hashSync(c,a.substr(0,a.length-31)),f=b.length==a.length,d=b.length<a.length?b.length:a.length,e=0;e<d;++e)b.length>=e&&(a.length>=e&&b[e]!=a[e])&&(f=!1);return f};m.compare=function(c, -a,b){"function"!=typeof b&&p(Error("Illegal 'callback': "+b));m.hash(c,a.substr(0,29),function(c,d){b(c,a===d)})};m.getRounds=function(c){"string"!=typeof c&&p(Error("Illegal type of 'hash': "+typeof c));return parseInt(c.split("$")[2],10)};m.getSalt=function(c){"string"!=typeof c&&p(Error("Illegal type of 'hash': "+typeof c));60!=c.length&&p(Error("Illegal hash length: "+c.length+" != 60"));return c.substring(0,29)};"undefined"!=typeof module&&module.exports?module.exports=m:"undefined"!=typeof define&& -define.amd?define("bcrypt",function(){return m}):(n.dcodeIO||(n.dcodeIO={}),n.dcodeIO.bcrypt=m)})(this); +function l(t){throw t;}var p=null; +(function(t){function B(c){if("undefined"!==typeof module&&module&&module.exports)try{return require("crypto").randomBytes(c)}catch(a){}try{var b;(t.crypto||t.msCrypto).getRandomValues(b=new Uint32Array(c));return Array.prototype.slice.call(b)}catch(d){}x||l(Error("Neither WebCryptoAPI nor a crypto module is available. Use bcrypt.setRandomFallback to set an alternative"));return x(c)}function F(c){var a=[],b=0;G.f(function(){return b>=c.length?p:c.charCodeAt(b++)},function(b){a.push(b)});return a} +function y(c,a){var b=0,d=[],f,e;for((0>=a||a>c.length)&&l(Error("Illegal len: "+a));b<a;){f=c[b++]&255;d.push(u[f>>2&63]);f=(f&3)<<4;if(b>=a){d.push(u[f&63]);break}e=c[b++]&255;f|=e>>4&15;d.push(u[f&63]);f=(e&15)<<2;if(b>=a){d.push(u[f&63]);break}e=c[b++]&255;f|=e>>6&3;d.push(u[f&63]);d.push(u[e&63])}return d.join("")}function H(c){for(var a=0,b=c.length,d=0,f=[],e,k,h;a<b-1&&16>d;){h=c.charCodeAt(a++);e=h<r.length?r[h]:-1;h=c.charCodeAt(a++);k=h<r.length?r[h]:-1;if(-1==e||-1==k)break;h=e<<2>>>0; +h|=(k&48)>>4;f.push(z(h));if(16<=++d||a>=b)break;h=c.charCodeAt(a++);e=h<r.length?r[h]:-1;if(-1==e)break;h=(k&15)<<4>>>0;h|=(e&60)>>2;f.push(z(h));if(16<=++d||a>=b)break;h=c.charCodeAt(a++);k=h<r.length?r[h]:-1;h=(e&3)<<6>>>0;h|=k;f.push(z(h));++d}c=[];for(a=0;a<d;a++)c.push(f[a].charCodeAt(0));return c}function w(c,a,b,d){for(var f,e=c[a],k=c[a+1],e=e^b[0],h=0;14>=h;)f=d[e>>24&255],f+=d[256|e>>16&255],f^=d[512|e>>8&255],f+=d[768|e&255],k^=f^b[++h],f=d[k>>24&255],f+=d[256|k>>16&255],f^=d[512|k>>8& +255],f+=d[768|k&255],e^=f^b[++h];c[a]=k^b[17];c[a+1]=e;return c}function v(c,a){for(var b=0,d=0;4>b;++b)d=d<<8|c[a]&255,a=(a+1)%c.length;return{key:d,a:a}}function C(c,a,b){for(var d=0,f=[0,0],e=a.length,k=b.length,h,g=0;g<e;g++)h=v(c,d),d=h.a,a[g]^=h.key;for(g=0;g<e;g+=2)f=w(f,0,a,b),a[g]=f[0],a[g+1]=f[1];for(g=0;g<k;g+=2)f=w(f,0,a,b),b[g]=f[0],b[g+1]=f[1]}function I(c,a,b,d){for(var f=0,e=[0,0],k=b.length,h=d.length,g,m=0;m<k;m++)g=v(a,f),f=g.a,b[m]^=g.key;for(m=f=0;m<k;m+=2)g=v(c,f),f=g.a,e[0]^= +g.key,g=v(c,f),f=g.a,e[1]^=g.key,e=w(e,0,b,d),b[m]=e[0],b[m+1]=e[1];for(m=0;m<h;m+=2)g=v(c,f),f=g.a,e[0]^=g.key,g=v(c,f),f=g.a,e[1]^=g.key,e=w(e,0,b,d),d[m]=e[0],d[m+1]=e[1]}function D(c,a,b,d,f){function e(){f&&f(q/b);if(q<b)for(var g=Date.now();q<b&&!(q+=1,C(c,m,n),C(a,m,n),100<Date.now()-g););else{for(q=0;64>q;q++)for(r=0;r<h>>1;r++)w(k,r<<1,m,n);g=[];for(q=0;q<h;q++)g.push((k[q]>>24&255)>>>0),g.push((k[q]>>16&255)>>>0),g.push((k[q]>>8&255)>>>0),g.push((k[q]&255)>>>0);if(d){d(p,g);return}return g}d&& +s(e)}var k=E.slice(),h=k.length,g;if(4>b||31<b){g=Error("Illegal number of rounds (4-31): "+b);if(d){s(d.bind(this,g));return}l(g)}if(16!==a.length){g=Error("Illegal salt length: "+a.length+" != 16");if(d){s(d.bind(this,g));return}l(g)}b=1<<b;var m=J.slice(),n=K.slice(),q=0,r;I(a,c,m,n);if("undefined"!==typeof d)e();else for(;;)if("undefined"!==typeof(g=e()))return g||[]}function A(c,a,b,d){function f(a){var b=[];b.push("$2");"a"<=k&&b.push(k);b.push("$");10>g&&b.push("0");b.push(g.toString());b.push("$"); +b.push(y(m,m.length));b.push(y(a,4*E.length-1));return b.join("")}var e;if("string"!==typeof c||"string"!==typeof a){e=Error("Invalid string / salt: Not a string");if(b){s(b.bind(this,e));return}l(e)}var k,h;if("$"!==a.charAt(0)||"2"!==a.charAt(1)){e=Error("Invalid salt version: "+a.substring(0,2));if(b){s(b.bind(this,e));return}l(e)}if("$"===a.charAt(2))k=String.fromCharCode(0),h=3;else{k=a.charAt(2);if("a"!==k&&"y"!==k||"$"!==a.charAt(3)){e=Error("Invalid salt revision: "+a.substring(2,4));if(b){s(b.bind(this, +e));return}l(e)}h=4}if("$"<a.charAt(h+2)){e=Error("Missing salt rounds");if(b){s(b.bind(this,e));return}l(e)}var g=10*parseInt(a.substring(h,h+1),10)+parseInt(a.substring(h+1,h+2),10);a=a.substring(h+3,h+25);c=F(c+("a"<=k?"\x00":""));var m=H(a);if("undefined"==typeof b)return f(D(c,m,g));D(c,m,g,function(a,d){a?b(a,p):b(p,f(d))},d)}var n={},x=p;try{B(1)}catch(L){}x=p;n.l=function(c){x=c};n.genSaltSync=function(c,a){"undefined"===typeof c?c=10:"number"!==typeof c&&l(Error("Illegal arguments: "+typeof c+ +", "+typeof a));(4>c||31<c)&&l(Error("Illegal number of rounds (4-31): "+c));var b=[];b.push("$2a$");10>c&&b.push("0");b.push(c.toString());b.push("$");b.push(y(B(16),16));return b.join("")};n.genSalt=function(c,a,b){"function"===typeof a&&(b=a,a=void 0);"function"===typeof c&&(b=c,c=10);"function"!==typeof b&&l(Error("Illegal callback: "+typeof b));"number"!==typeof c?s(b.bind(this,Error("Illegal arguments: "+typeof c))):s(function(){try{b(p,n.genSaltSync(c))}catch(a){b(a)}})};n.hashSync=function(c, +a){"undefined"===typeof a&&(a=10);"number"===typeof a&&(a=n.genSaltSync(a));("string"!==typeof c||"string"!==typeof a)&&l(Error("Illegal arguments: "+typeof c+", "+typeof a));return A(c,a)};n.hash=function(c,a,b,d){"function"!==typeof b&&l(Error("Illegal callback: "+typeof b));"string"===typeof c&&"number"===typeof a?n.genSalt(a,function(a,e){A(c,e,b,d)}):"string"===typeof c&&"string"===typeof a?A(c,a,b,d):s(b.bind(this,Error("Illegal arguments: "+typeof c+", "+typeof a)))};n.compareSync=function(c, +a){("string"!==typeof c||"string"!==typeof a)&&l(Error("Illegal arguments: "+typeof c+", "+typeof a));if(60!==a.length)return!1;for(var b=n.hashSync(c,a.substr(0,a.length-31)),d=b.length===a.length,f=b.length<a.length?b.length:a.length,e=0;e<f;++e)b.length>=e&&(a.length>=e&&b[e]!=a[e])&&(d=!1);return d};n.compare=function(c,a,b,d){"function"!==typeof b&&l(Error("Illegal callback: "+typeof b));"string"!==typeof c||"string"!==typeof a?s(b.bind(this,Error("Illegal arguments: "+typeof c+", "+typeof a))): +n.hash(c,a.substr(0,29),function(d,c){b(d,a===c)},d)};n.getRounds=function(c){"string"!==typeof c&&l(Error("Illegal arguments: "+typeof c));return parseInt(c.split("$")[2],10)};n.getSalt=function(c){"string"!==typeof c&&l(Error("Illegal arguments: "+typeof c));60!==c.length&&l(Error("Illegal hash length: "+c.length+" != 60"));return c.substring(0,29)};var s="undefined"!==typeof process&&process&&"function"===typeof process.nextTick?"function"===typeof setImmediate?setImmediate:process.nextTick:setTimeout, +u="./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),r=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,54,55,56,57,58,59,60,61,62,63,-1,-1,-1,-1,-1,-1,-1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,-1,-1,-1,-1,-1,-1,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,-1,-1,-1,-1,-1],z=String.fromCharCode,G=function(){var c={h:1114111, +g:function(a,b){var d=p;"number"===typeof a&&(d=a,a=function(){return p});for(;d!==p||(d=a())!==p;)128>d?b(d&127):(2048>d?b(d>>6&31|192):(65536>d?b(d>>12&15|224):(b(d>>18&7|240),b(d>>12&63|128)),b(d>>6&63|128)),b(d&63|128)),d=p},e:function(a,b){function d(a){a=a.slice(0,a.indexOf(p));var b=Error(a.toString());b.name="TruncatedError";b.bytes=a;l(b)}for(var c,e,k,h;(c=a())!==p;)0===(c&128)?b(c):192===(c&224)?((e=a())===p&&d([c,e]),b((c&31)<<6|e&63)):224===(c&240)?(((e=a())===p||(k=a())===p)&&d([c,e, +k]),b((c&15)<<12|(e&63)<<6|k&63)):240===(c&248)?(((e=a())===p||(k=a())===p||(h=a())===p)&&d([c,e,k,h]),b((c&7)<<18|(e&63)<<12|(k&63)<<6|h&63)):l(RangeError("Illegal starting byte: "+c))},b:function(a,b){for(var c,f=p;(c=f!==p?f:a())!==p;)55296<=c&&57343>=c&&(f=a())!==p&&56320<=f&&57343>=f?(b(1024*(c-55296)+f-56320+65536),f=p):b(c);f!==p&&b(f)},d:function(a,b){var c=p;"number"===typeof a&&(c=a,a=function(){return p});for(;c!==p||(c=a())!==p;)65535>=c?b(c):(c-=65536,b((c>>10)+55296),b(c%1024+56320)), +c=p},f:function(a,b){c.b(a,function(a){c.g(a,b)})},k:function(a,b){c.e(a,function(a){c.d(a,b)})},c:function(a){return 128>a?1:2048>a?2:65536>a?3:4},j:function(a){for(var b,d=0;(b=a())!==p;)d+=c.c(b);return d},i:function(a){var b=0,d=0;c.b(a,function(a){++b;d+=c.c(a)});return[b,d]}};return c}();Date.now=Date.now||function(){return+new Date};var J=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069, +3041331479,2450970073,2306472731],K=[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828, +289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486, +1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557, +442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592, +3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370, +48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946,1266315497,3048417604,3681880366,3289982499,290971E4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509, +1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880, +613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303, +2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385, +1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030, +4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055,3913112168, +2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499, +499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905, +3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651, +309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610, +1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037, +2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504,976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200, +2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241, +3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891, +3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409E3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588, +3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493, +1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462],E=[1332899944,1700884034,1701343084,1684370003,1668446532, +1869963892];"undefined"!==typeof module&&module.exports?module.exports=n:"undefined"!==typeof define&&define.amd?define(function(){return n}):(t.dcodeIO=t.dcodeIO||{}).bcrypt=n})(this);})(); diff --git a/p/scripts/category.js b/p/scripts/category.js new file mode 100644 index 000000000..fbcd83a01 --- /dev/null +++ b/p/scripts/category.js @@ -0,0 +1,125 @@ +"use strict"; +/* globals i18n */ +/* jshint globalstrict: true */ + +var loading = false, + dnd_successful = false; + +function dragend_process(t) { + t.setAttribute('draggable', 'false'); + + if (loading) { + window.setTimeout(function() { + dragend_process(t); + }, 50); + return; + } + + if (!dnd_successful) { + t.style.display = ''; + t.style.opacity = ''; + t.setAttribute('draggable', 'true'); + } else { + var parent = $(t.parentNode); + $(t).remove(); + + if (parent.children().length <= 0) { + parent.append('<li class="item disabled" dropzone="move">' + i18n.category_empty + '</li>'); + } + } +} + +var dragFeedId = '', + dragHtml = ''; + +function init_draggable() { + if (!(window.$ && window.i18n)) { + if (window.console) { + console.log('FreshRSS waiting for JS…'); + } + window.setTimeout(init_draggable, 50); + return; + } + + var draggable = '[draggable="true"]', + dropzone = '[dropzone="move"]'; + + $('.drop-section').on('dragstart', draggable, function(e) { + var drag = $(e.target).closest('[draggable]')[0]; + e.originalEvent.dataTransfer.effectAllowed = 'move'; + dragHtml = drag.outerHTML; + dragFeedId = drag.getAttribute('data-feed-id'); + e.originalEvent.dataTransfer.setData('text', dragFeedId); + drag.style.opacity = 0.3; + + dnd_successful = false; + }); + $('.drop-section').on('dragend', draggable, function(e) { + dragend_process(e.target); + }); + + $('.drop-section').on('dragenter', dropzone, function(e) { + $(this).addClass('drag-hover'); + + e.preventDefault(); + }); + $('.drop-section').on('dragleave', dropzone, function(e) { + var pos_this = $(this).position(), + scroll_top = $(document).scrollTop(), + top = pos_this.top, + left = pos_this.left, + right = left + $(this).width(), + bottom = top + $(this).height(), + mouse_x = e.originalEvent.screenX, + mouse_y = e.originalEvent.clientY + scroll_top; + + if (left <= mouse_x && mouse_x <= right && + top <= mouse_y && mouse_y <= bottom) { + // HACK because dragleave is triggered when hovering children! + return; + } + $(this).removeClass('drag-hover'); + }); + $('.drop-section').on('dragover', dropzone, function(e) { + e.originalEvent.dataTransfer.dropEffect = "move"; + + e.preventDefault(); + return false; + }); + $('.drop-section').on('drop', dropzone, function(e) { + loading = true; + + $.ajax({ + type: 'POST', + url: './?c=feed&a=move', + data : { + f_id: dragFeedId, + c_id: e.target.parentNode.getAttribute('data-cat-id'), + _csrf: context.csrf, + } + }).done(function() { + $(e.target).after(dragHtml); + if ($(e.target).hasClass('disabled')) { + $(e.target).remove(); + } + dnd_successful = true; + }).always(function() { + loading = false; + dragFeedId = ''; + dragHtml = ''; + }); + + $(this).removeClass('drag-hover'); + + e.preventDefault(); + }); +} + + +if (document.readyState && document.readyState !== 'loading') { + init_draggable(); +} else if (document.addEventListener) { + document.addEventListener('DOMContentLoaded', function () { + init_draggable(); + }, false); +} diff --git a/p/scripts/global_view.js b/p/scripts/global_view.js index 7105520a6..de0b9cb9f 100644 --- a/p/scripts/global_view.js +++ b/p/scripts/global_view.js @@ -1,4 +1,7 @@ "use strict"; +/* globals init_load_more, init_posts, init_stream */ +/* jshint globalstrict: true */ + var panel_loading = false; function load_panel(link) { @@ -9,7 +12,7 @@ function load_panel(link) { panel_loading = true; $.get(link, function (data) { - $("#panel").append($(".nav_menu, #stream .day, #stream .flux, #stream .pagination", data)); + $("#panel").append($(".nav_menu, #stream .day, #stream .flux, #stream .pagination, #stream.prompt", data)); $("#panel .nav_menu").children().not("#nav_menu_read_all").remove(); @@ -23,13 +26,15 @@ function load_panel(link) { // Sans ça, si l'on scroll en lisant une catégorie par exemple, // en en ouvrant une autre ensuite, on se retrouve au même point de scroll $("#panel").scrollTop(0); + $(window).scrollTop(0); - $('#panel').on('click', '#nav_menu_read_all > a, #nav_menu_read_all .item > a, #bigMarkAsRead', function () { + $('#panel').on('click', '#nav_menu_read_all button, #bigMarkAsRead', function () { + console.log($(this).attr("formaction")); $.ajax({ - url: $(this).attr("href"), + type: "POST", + url: $(this).attr("formaction"), async: false }); - //$("#panel .close").first().click(); window.location.reload(false); return false; }); @@ -39,9 +44,8 @@ function load_panel(link) { } function init_close_panel() { - $("#panel .close").click(function () { - $("#panel").html('<a class="close" href="#">' + window.iconClose + '</a>'); - init_close_panel(); + $("#overlay .close").click(function () { + $("#panel").html(''); $("#panel").slideToggle(); $("#overlay").fadeOut(); @@ -50,7 +54,8 @@ function init_close_panel() { } function init_global_view() { - $("#stream .box-category a").click(function () { + // TODO: should be based on generic classes. + $(".box a").click(function () { var link = $(this).attr("href"); load_panel(link); diff --git a/p/scripts/install.js b/p/scripts/install.js new file mode 100644 index 000000000..b7975fd6e --- /dev/null +++ b/p/scripts/install.js @@ -0,0 +1,73 @@ +"use strict"; +/* jshint globalstrict: true */ + +function show_password() { + var button = this; + var passwordField = document.getElementById(button.getAttribute('data-toggle')); + passwordField.setAttribute('type', 'text'); + button.className += ' active'; + return false; +} +function hide_password() { + var button = this; + var passwordField = document.getElementById(button.getAttribute('data-toggle')); + passwordField.setAttribute('type', 'password'); + button.className = button.className.replace(/(?:^|\s)active(?!\S)/g , ''); + return false; +} +var toggles = document.getElementsByClassName('toggle-password'); +for (var i = 0 ; i < toggles.length ; i++) { + toggles[i].addEventListener('mousedown', show_password); + toggles[i].addEventListener('mouseup', hide_password); +} + +function auth_type_change() { + var auth_type = document.getElementById('auth_type'); + if (auth_type) { + var auth_value = auth_type.value, + password_input = document.getElementById('passwordPlain'); + + if (auth_value === 'form') { + password_input.required = true; + } else { + password_input.required = false; + } + } +} +var auth_type = document.getElementById('auth_type'); +if (auth_type) { + auth_type_change(); + auth_type.addEventListener('change', auth_type_change); +} + +function mySqlShowHide() { + var mysql = document.getElementById('mysql'); + if (mysql) { + if (document.getElementById('type').value === 'sqlite') { + document.getElementById('host').value = ''; + document.getElementById('user').value = ''; + document.getElementById('pass').value = ''; + document.getElementById('base').value = ''; + document.getElementById('prefix').value = ''; + mysql.style.display = 'none'; + } else { + mysql.style.display = 'block'; + } + } +} +var bd_type = document.getElementById('type'); +if (bd_type) { + mySqlShowHide(); + bd_type.addEventListener('change', mySqlShowHide); +} + +function ask_confirmation(e) { + var str_confirmation = this.getAttribute('data-str-confirm'); + if (!confirm(str_confirmation)) { + e.preventDefault(); + } +} +var confirms = document.getElementsByClassName('confirm'); +for (var i = 0 ; i < confirms.length ; i++) { + confirms[i].addEventListener('click', ask_confirmation); +} diff --git a/p/scripts/jquery.lazyload.min.js b/p/scripts/jquery.lazyload.min.js deleted file mode 100644 index 8dd097dc3..000000000 --- a/p/scripts/jquery.lazyload.min.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Lazy Load - jQuery plugin for lazy loading images - * - * Copyright (c) 2007-2013 Mika Tuupola - * - * Licensed under the MIT license: - * http://www.opensource.org/licenses/mit-license.php - * - * Project home: - * http://www.appelsiini.net/projects/lazyload - * - * Version: 1.9.0 - * - */ -!function(a,b,c,d){var e=a(b);a.fn.lazyload=function(f){function g(){var b=0;i.each(function(){var c=a(this);if(!j.skip_invisible||c.is(":visible"))if(a.abovethetop(this,j)||a.leftofbegin(this,j));else if(a.belowthefold(this,j)||a.rightoffold(this,j)){if(++b>j.failure_limit)return!1}else c.trigger("appear"),b=0})}var h,i=this,j={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!0,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};return f&&(d!==f.failurelimit&&(f.failure_limit=f.failurelimit,delete f.failurelimit),d!==f.effectspeed&&(f.effect_speed=f.effectspeed,delete f.effectspeed),a.extend(j,f)),h=j.container===d||j.container===b?e:a(j.container),0===j.event.indexOf("scroll")&&h.bind(j.event,function(){return g()}),this.each(function(){var b=this,c=a(b);b.loaded=!1,(c.attr("src")===d||c.attr("src")===!1)&&c.attr("src",j.placeholder),c.one("appear",function(){if(!this.loaded){if(j.appear){var d=i.length;j.appear.call(b,d,j)}a("<img />").bind("load",function(){var d=c.data(j.data_attribute);c.hide(),c.is("img")?c.attr("src",d):c.css("background-image","url('"+d+"')"),c[j.effect](j.effect_speed),b.loaded=!0;var e=a.grep(i,function(a){return!a.loaded});if(i=a(e),j.load){var f=i.length;j.load.call(b,f,j)}}).attr("src",c.data(j.data_attribute))}}),0!==j.event.indexOf("scroll")&&c.bind(j.event,function(){b.loaded||c.trigger("appear")})}),e.bind("resize",function(){g()}),/iphone|ipod|ipad.*os 5/gi.test(navigator.appVersion)&&e.bind("pageshow",function(b){b.originalEvent&&b.originalEvent.persisted&&i.each(function(){a(this).trigger("appear")})}),a(c).ready(function(){g()}),this},a.belowthefold=function(c,f){var g;return g=f.container===d||f.container===b?(b.innerHeight?b.innerHeight:e.height())+e.scrollTop():a(f.container).offset().top+a(f.container).height(),g<=a(c).offset().top-f.threshold},a.rightoffold=function(c,f){var g;return g=f.container===d||f.container===b?e.width()+e.scrollLeft():a(f.container).offset().left+a(f.container).width(),g<=a(c).offset().left-f.threshold},a.abovethetop=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollTop():a(f.container).offset().top,g>=a(c).offset().top+f.threshold+a(c).height()},a.leftofbegin=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollLeft():a(f.container).offset().left,g>=a(c).offset().left+f.threshold+a(c).width()},a.inviewport=function(b,c){return!(a.rightoffold(b,c)||a.leftofbegin(b,c)||a.belowthefold(b,c)||a.abovethetop(b,c))},a.extend(a.expr[":"],{"below-the-fold":function(b){return a.belowthefold(b,{threshold:0})},"above-the-top":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-screen":function(b){return a.rightoffold(b,{threshold:0})},"left-of-screen":function(b){return!a.rightoffold(b,{threshold:0})},"in-viewport":function(b){return a.inviewport(b,{threshold:0})},"above-the-fold":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-fold":function(b){return a.rightoffold(b,{threshold:0})},"left-of-fold":function(b){return!a.rightoffold(b,{threshold:0})}})}(jQuery,window,document);
\ No newline at end of file diff --git a/p/scripts/jquery.min.js b/p/scripts/jquery.min.js index cbe6abe59..4c5be4c0f 100644 --- a/p/scripts/jquery.min.js +++ b/p/scripts/jquery.min.js @@ -1,4 +1,4 @@ -/*! jQuery v2.1.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ -!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m=a.document,n="2.1.0",o=function(a,b){return new o.fn.init(a,b)},p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};o.fn=o.prototype={jquery:n,constructor:o,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=o.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return o.each(this,a,b)},map:function(a){return this.pushStack(o.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},o.extend=o.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||o.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(o.isPlainObject(d)||(e=o.isArray(d)))?(e?(e=!1,f=c&&o.isArray(c)?c:[]):f=c&&o.isPlainObject(c)?c:{},g[b]=o.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},o.extend({expando:"jQuery"+(n+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===o.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isPlainObject:function(a){if("object"!==o.type(a)||a.nodeType||o.isWindow(a))return!1;try{if(a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(b){return!1}return!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=o.trim(a),a&&(1===a.indexOf("use strict")?(b=m.createElement("script"),b.text=a,m.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":k.call(a)},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?o.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),o.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||o.guid++,f):void 0},now:Date.now,support:l}),o.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=o.type(a);return"function"===c||o.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(n&&!e){if(f=Z.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return G.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--)m[j]=q+pb(m[j]);u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v)try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML="<select t=''><option selected=''></option></select>",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},z=b?function(a,b){if(a===b)return j=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b)return j=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0;if(f===g)return ib(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)k.unshift(c);while(h[d]===k[d])d++;return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b)))try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return i=null,a},e=db.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=db.selectors={cacheLength:50,createPseudo:fb,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||db.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ab,bb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),t=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[u,n,m];break}}else if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(t&&((l[s]||(l[s]={}))[a]=[u,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do if(c=n?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=jb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=kb(b);function nb(){}nb.prototype=d.filters=d.pseudos,d.setFilters=new nb;function ob(a,b){var c,e,f,g,h,i,j,k=x[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=Q.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?db.error(a):x(a,i).slice(0)}function pb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[u,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function rb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function sb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return!g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=d.relative[a[j].type])m=[qb(rb(m),c)];else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++)if(d.relative[a[e].type])break;return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++])if(o(m,g,i)){j.push(m);break}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++])o(r,s,g,i);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=E.call(j));s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--)f=ub(b[c]),f[s]?d.push(f):e.push(f);f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++)db(a,b[d],c);return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b)return e;a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type])break;if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a)return G.apply(e,f),e;break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(a);o.find=t,o.expr=t.selectors,o.expr[":"]=o.expr.pseudos,o.unique=t.uniqueSort,o.text=t.getText,o.isXMLDoc=t.isXML,o.contains=t.contains;var u=o.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(o.isFunction(b))return o.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return o.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return o.filter(b,a,c);b=o.filter(b,a)}return o.grep(a,function(a){return g.call(b,a)>=0!==c})}o.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?o.find.matchesSelector(d,a)?[d]:[]:o.find.matches(a,o.grep(b,function(a){return 1===a.nodeType}))},o.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(o(a).filter(function(){for(b=0;c>b;b++)if(o.contains(e[b],this))return!0}));for(b=0;c>b;b++)o.find(a,e[b],d);return d=this.pushStack(c>1?o.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?o(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=o.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof o?b[0]:b,o.merge(this,o.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:m,!0)),v.test(c[1])&&o.isPlainObject(b))for(c in b)o.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=m.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=m,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):o.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(o):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),o.makeArray(a,this))};A.prototype=o.fn,y=o(m);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};o.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&o(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),o.fn.extend({has:function(a){var b=o(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(o.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?o(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&o.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?o.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(o(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(o.unique(o.merge(this.get(),o(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}o.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return o.dir(a,"parentNode")},parentsUntil:function(a,b,c){return o.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return o.dir(a,"nextSibling")},prevAll:function(a){return o.dir(a,"previousSibling")},nextUntil:function(a,b,c){return o.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return o.dir(a,"previousSibling",c)},siblings:function(a){return o.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return o.sibling(a.firstChild)},contents:function(a){return a.contentDocument||o.merge([],a.childNodes)}},function(a,b){o.fn[a]=function(c,d){var e=o.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=o.filter(d,e)),this.length>1&&(C[a]||o.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return o.each(a.match(E)||[],function(a,c){b[c]=!0}),b}o.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):o.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){o.each(b,function(b,c){var d=o.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&o.each(arguments,function(a,b){var c;while((c=o.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?o.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},o.extend({Deferred:function(a){var b=[["resolve","done",o.Callbacks("once memory"),"resolved"],["reject","fail",o.Callbacks("once memory"),"rejected"],["notify","progress",o.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return o.Deferred(function(c){o.each(b,function(b,f){var g=o.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&o.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?o.extend(a,d):d}},e={};return d.pipe=d.then,o.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&o.isFunction(a.promise)?e:0,g=1===f?a:o.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&o.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;o.fn.ready=function(a){return o.ready.promise().done(a),this},o.extend({isReady:!1,readyWait:1,holdReady:function(a){a?o.readyWait++:o.ready(!0)},ready:function(a){(a===!0?--o.readyWait:o.isReady)||(o.isReady=!0,a!==!0&&--o.readyWait>0||(H.resolveWith(m,[o]),o.fn.trigger&&o(m).trigger("ready").off("ready")))}});function I(){m.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),o.ready()}o.ready.promise=function(b){return H||(H=o.Deferred(),"complete"===m.readyState?setTimeout(o.ready):(m.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},o.ready.promise();var J=o.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===o.type(c)){e=!0;for(h in c)o.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,o.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(o(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};o.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=o.expando+Math.random()}K.uid=1,K.accepts=o.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,o.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(o.isEmptyObject(f))o.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,o.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{o.isArray(b)?d=b.concat(b.map(o.camelCase)):(e=o.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!o.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?o.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}o.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),o.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length; -while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=o.camelCase(d.slice(5)),P(f,d,e[d]));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=o.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),o.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||o.isArray(c)?d=L.access(a,b,o.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=o.queue(a,b),d=c.length,e=c.shift(),f=o._queueHooks(a,b),g=function(){o.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:o.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),o.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?o.queue(this[0],a):void 0===b?this:this.each(function(){var c=o.queue(this,a,b);o._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&o.dequeue(this,a)})},dequeue:function(a){return this.each(function(){o.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=o.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===o.css(a,"display")||!o.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=m.createDocumentFragment(),b=a.appendChild(m.createElement("div"));b.innerHTML="<input type='radio' checked='checked' name='t'/>",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";l.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return m.activeElement}catch(a){}}o.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=o.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof o!==U&&o.event.triggered!==b.type?o.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],n=q=h[1],p=(h[2]||"").split(".").sort(),n&&(l=o.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=o.event.special[n]||{},k=o.extend({type:n,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&o.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(n,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),o.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],n=q=h[1],p=(h[2]||"").split(".").sort(),n){l=o.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||o.removeEvent(a,n,r.handle),delete i[n])}else for(n in i)o.event.remove(a,n+b[j],c,d,!0);o.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,p=[d||m],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||m,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+o.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[o.expando]?b:new o.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:o.makeArray(c,[b]),n=o.event.special[q]||{},e||!n.trigger||n.trigger.apply(d,c)!==!1)){if(!e&&!n.noBubble&&!o.isWindow(d)){for(i=n.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||m)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:n.bindType||q,l=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),l&&l.apply(g,c),l=k&&g[k],l&&l.apply&&o.acceptData(g)&&(b.result=l.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||n._default&&n._default.apply(p.pop(),c)!==!1||!o.acceptData(d)||k&&o.isFunction(d[q])&&!o.isWindow(d)&&(h=d[k],h&&(d[k]=null),o.event.triggered=q,d[q](),o.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=o.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=o.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=o.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((o.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?o(e,this).index(i)>=0:o.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||m,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[o.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new o.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=m),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&o.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return o.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=o.extend(new o.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?o.event.trigger(e,null,b):o.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},o.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},o.Event=function(a,b){return this instanceof o.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.getPreventDefault&&a.getPreventDefault()?Z:$):this.type=a,b&&o.extend(this,b),this.timeStamp=a&&a.timeStamp||o.now(),void(this[o.expando]=!0)):new o.Event(a,b)},o.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z,this.stopPropagation()}},o.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){o.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!o.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.focusinBubbles||o.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){o.event.simulate(b,a.target,o.event.fix(a),!0)};o.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),o.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return o().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=o.guid++)),this.each(function(){o.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,o(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=$),this.each(function(){o.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){o.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?o.event.trigger(a,b,c,!0):void 0}});var ab=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ib={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return o.nodeName(a,"table")&&o.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)o.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=o.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&o.nodeName(a,b)?o.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}o.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=o.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||o.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,n=a.length;n>m;m++)if(e=a[m],e||0===e)if("object"===o.type(e))o.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;o.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===o.inArray(e,d))&&(i=o.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f,g,h=o.event.special,i=0;void 0!==(c=a[i]);i++){if(o.acceptData(c)&&(f=c[L.expando],f&&(b=L.cache[f]))){if(d=Object.keys(b.events||{}),d.length)for(g=0;void 0!==(e=d[g]);g++)h[e]?o.event.remove(c,e):o.removeEvent(c,e,b.handle);L.cache[f]&&delete L.cache[f]}delete M.cache[c[M.expando]]}}}),o.fn.extend({text:function(a){return J(this,function(a){return void 0===a?o.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?o.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||o.cleanData(ob(c)),c.parentNode&&(b&&o.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(o.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return o.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(o.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,o.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,k=this.length,m=this,n=k-1,p=a[0],q=o.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(k&&(c=o.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=o.map(ob(c,"script"),kb),g=f.length;k>j;j++)h=c,j!==n&&(h=o.clone(h,!0,!0),g&&o.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,o.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&o.contains(i,h)&&(h.src?o._evalUrl&&o._evalUrl(h.src):o.globalEval(h.textContent.replace(hb,"")))}return this}}),o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){o.fn[a]=function(a){for(var c,d=[],e=o(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),o(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d=o(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:o.css(d[0],"display");return d.detach(),e}function tb(a){var b=m,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||o("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qb[0].contentDocument,b.write(),b.close(),c=sb(a,b),qb.detach()),rb[a]=c),c}var ub=/^margin/,vb=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)};function xb(a,b,c){var d,e,f,g,h=a.style;return c=c||wb(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||o.contains(a.ownerDocument,a)||(g=o.style(a,b)),vb.test(g)&&ub.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function yb(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d="padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",e=m.documentElement,f=m.createElement("div"),g=m.createElement("div");g.style.backgroundClip="content-box",g.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===g.style.backgroundClip,f.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",f.appendChild(g);function h(){g.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",e.appendChild(f);var d=a.getComputedStyle(g,null);b="1%"!==d.top,c="4px"===d.width,e.removeChild(f)}a.getComputedStyle&&o.extend(l,{pixelPosition:function(){return h(),b},boxSizingReliable:function(){return null==c&&h(),c},reliableMarginRight:function(){var b,c=g.appendChild(m.createElement("div"));return c.style.cssText=g.style.cssText=d,c.style.marginRight=c.style.width="0",g.style.width="1px",e.appendChild(f),b=!parseFloat(a.getComputedStyle(c,null).marginRight),e.removeChild(f),g.innerHTML="",b}})}(),o.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var zb=/^(none|table(?!-c[ea]).+)/,Ab=new RegExp("^("+Q+")(.*)$","i"),Bb=new RegExp("^([+-])=("+Q+")","i"),Cb={position:"absolute",visibility:"hidden",display:"block"},Db={letterSpacing:0,fontWeight:400},Eb=["Webkit","O","Moz","ms"];function Fb(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Eb.length;while(e--)if(b=Eb[e]+c,b in a)return b;return d}function Gb(a,b,c){var d=Ab.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Hb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=o.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=o.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=o.css(a,"border"+R[f]+"Width",!0,e))):(g+=o.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=o.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ib(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wb(a),g="border-box"===o.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xb(a,b,f),(0>e||null==e)&&(e=a.style[b]),vb.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Hb(a,b,c||(g?"border":"content"),d,f)+"px"}function Jb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",tb(d.nodeName)))):f[g]||(e=S(d),(c&&"none"!==c||!e)&&L.set(d,"olddisplay",e?c:o.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}o.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=o.camelCase(b),i=a.style;return b=o.cssProps[h]||(o.cssProps[h]=Fb(i,h)),g=o.cssHooks[b]||o.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Bb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(o.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||o.cssNumber[h]||(c+="px"),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]="",i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=o.camelCase(b);return b=o.cssProps[h]||(o.cssProps[h]=Fb(a.style,h)),g=o.cssHooks[b]||o.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xb(a,b,d)),"normal"===e&&b in Db&&(e=Db[b]),""===c||c?(f=parseFloat(e),c===!0||o.isNumeric(f)?f||0:e):e}}),o.each(["height","width"],function(a,b){o.cssHooks[b]={get:function(a,c,d){return c?0===a.offsetWidth&&zb.test(o.css(a,"display"))?o.swap(a,Cb,function(){return Ib(a,b,d)}):Ib(a,b,d):void 0},set:function(a,c,d){var e=d&&wb(a);return Gb(a,c,d?Hb(a,b,d,"border-box"===o.css(a,"boxSizing",!1,e),e):0)}}}),o.cssHooks.marginRight=yb(l.reliableMarginRight,function(a,b){return b?o.swap(a,{display:"inline-block"},xb,[a,"marginRight"]):void 0}),o.each({margin:"",padding:"",border:"Width"},function(a,b){o.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ub.test(a)||(o.cssHooks[a+b].set=Gb)}),o.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(o.isArray(b)){for(d=wb(a),e=b.length;e>g;g++)f[b[g]]=o.css(a,b[g],!1,d);return f}return void 0!==c?o.style(a,b,c):o.css(a,b)},a,b,arguments.length>1)},show:function(){return Jb(this,!0)},hide:function(){return Jb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?o(this).show():o(this).hide()})}});function Kb(a,b,c,d,e){return new Kb.prototype.init(a,b,c,d,e)}o.Tween=Kb,Kb.prototype={constructor:Kb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(o.cssNumber[c]?"":"px")},cur:function(){var a=Kb.propHooks[this.prop];return a&&a.get?a.get(this):Kb.propHooks._default.get(this)},run:function(a){var b,c=Kb.propHooks[this.prop];return this.pos=b=this.options.duration?o.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Kb.propHooks._default.set(this),this}},Kb.prototype.init.prototype=Kb.prototype,Kb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=o.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){o.fx.step[a.prop]?o.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[o.cssProps[a.prop]]||o.cssHooks[a.prop])?o.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Kb.propHooks.scrollTop=Kb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},o.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},o.fx=Kb.prototype.init,o.fx.step={};var Lb,Mb,Nb=/^(?:toggle|show|hide)$/,Ob=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pb=/queueHooks$/,Qb=[Vb],Rb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Ob.exec(b),f=e&&e[3]||(o.cssNumber[a]?"":"px"),g=(o.cssNumber[a]||"px"!==f&&+d)&&Ob.exec(o.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,o.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sb(){return setTimeout(function(){Lb=void 0}),Lb=o.now()}function Tb(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ub(a,b,c){for(var d,e=(Rb[b]||[]).concat(Rb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Vb(a,b,c){var d,e,f,g,h,i,j,k=this,l={},m=a.style,n=a.nodeType&&S(a),p=L.get(a,"fxshow");c.queue||(h=o._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,k.always(function(){k.always(function(){h.unqueued--,o.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],j=o.css(a,"display"),"none"===j&&(j=tb(a.nodeName)),"inline"===j&&"none"===o.css(a,"float")&&(m.display="inline-block")),c.overflow&&(m.overflow="hidden",k.always(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Nb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(n?"hide":"show")){if("show"!==e||!p||void 0===p[d])continue;n=!0}l[d]=p&&p[d]||o.style(a,d)}if(!o.isEmptyObject(l)){p?"hidden"in p&&(n=p.hidden):p=L.access(a,"fxshow",{}),f&&(p.hidden=!n),n?o(a).show():k.done(function(){o(a).hide()}),k.done(function(){var b;L.remove(a,"fxshow");for(b in l)o.style(a,b,l[b])});for(d in l)g=Ub(n?p[d]:0,d,k),d in p||(p[d]=g.start,n&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wb(a,b){var c,d,e,f,g;for(c in a)if(d=o.camelCase(c),e=b[d],f=a[c],o.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=o.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xb(a,b,c){var d,e,f=0,g=Qb.length,h=o.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Lb||Sb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:o.extend({},b),opts:o.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:Lb||Sb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=o.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wb(k,j.opts.specialEasing);g>f;f++)if(d=Qb[f].call(j,a,k,j.opts))return d;return o.map(k,Ub,j),o.isFunction(j.opts.start)&&j.opts.start.call(a,j),o.fx.timer(o.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}o.Animation=o.extend(Xb,{tweener:function(a,b){o.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Rb[c]=Rb[c]||[],Rb[c].unshift(b)},prefilter:function(a,b){b?Qb.unshift(a):Qb.push(a)}}),o.speed=function(a,b,c){var d=a&&"object"==typeof a?o.extend({},a):{complete:c||!c&&b||o.isFunction(a)&&a,duration:a,easing:c&&b||b&&!o.isFunction(b)&&b};return d.duration=o.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in o.fx.speeds?o.fx.speeds[d.duration]:o.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){o.isFunction(d.old)&&d.old.call(this),d.queue&&o.dequeue(this,d.queue)},d},o.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=o.isEmptyObject(a),f=o.speed(b,c,d),g=function(){var b=Xb(this,o.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=o.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&o.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=o.timers,g=d?d.length:0;for(c.finish=!0,o.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),o.each(["toggle","show","hide"],function(a,b){var c=o.fn[b];o.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Tb(b,!0),a,d,e)}}),o.each({slideDown:Tb("show"),slideUp:Tb("hide"),slideToggle:Tb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){o.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),o.timers=[],o.fx.tick=function(){var a,b=0,c=o.timers;for(Lb=o.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||o.fx.stop(),Lb=void 0},o.fx.timer=function(a){o.timers.push(a),a()?o.fx.start():o.timers.pop()},o.fx.interval=13,o.fx.start=function(){Mb||(Mb=setInterval(o.fx.tick,o.fx.interval))},o.fx.stop=function(){clearInterval(Mb),Mb=null},o.fx.speeds={slow:600,fast:200,_default:400},o.fn.delay=function(a,b){return a=o.fx?o.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=m.createElement("input"),b=m.createElement("select"),c=b.appendChild(m.createElement("option"));a.type="checkbox",l.checkOn=""!==a.value,l.optSelected=c.selected,b.disabled=!0,l.optDisabled=!c.disabled,a=m.createElement("input"),a.value="t",a.type="radio",l.radioValue="t"===a.value}();var Yb,Zb,$b=o.expr.attrHandle;o.fn.extend({attr:function(a,b){return J(this,o.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){o.removeAttr(this,a)})}}),o.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?o.prop(a,b,c):(1===f&&o.isXMLDoc(a)||(b=b.toLowerCase(),d=o.attrHooks[b]||(o.expr.match.bool.test(b)?Zb:Yb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=o.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void o.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=o.propFix[c]||c,o.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&o.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Zb={set:function(a,b,c){return b===!1?o.removeAttr(a,c):a.setAttribute(c,c),c}},o.each(o.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$b[b]||o.find.attr;$b[b]=function(a,b,d){var e,f; -return d||(f=$b[b],$b[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$b[b]=f),e}});var _b=/^(?:input|select|textarea|button)$/i;o.fn.extend({prop:function(a,b){return J(this,o.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[o.propFix[a]||a]})}}),o.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!o.isXMLDoc(a),f&&(b=o.propFix[b]||b,e=o.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_b.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),l.optSelected||(o.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),o.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){o.propFix[this.toLowerCase()]=this});var ac=/[\t\r\n\f]/g;o.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(o.isFunction(a))return this.each(function(b){o(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=o.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(o.isFunction(a))return this.each(function(b){o(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?o.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(o.isFunction(a)?function(c){o(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=o(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ac," ").indexOf(b)>=0)return!0;return!1}});var bc=/\r/g;o.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=o.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,o(this).val()):a,null==e?e="":"number"==typeof e?e+="":o.isArray(e)&&(e=o.map(e,function(a){return null==a?"":a+""})),b=o.valHooks[this.type]||o.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=o.valHooks[e.type]||o.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bc,""):null==c?"":c)}}}),o.extend({valHooks:{select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(l.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&o.nodeName(c.parentNode,"optgroup"))){if(b=o(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=o.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=o.inArray(o(d).val(),f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),o.each(["radio","checkbox"],function(){o.valHooks[this]={set:function(a,b){return o.isArray(b)?a.checked=o.inArray(o(a).val(),b)>=0:void 0}},l.checkOn||(o.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),o.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){o.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),o.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cc=o.now(),dc=/\?/;o.parseJSON=function(a){return JSON.parse(a+"")},o.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&o.error("Invalid XML: "+a),b};var ec,fc,gc=/#.*$/,hc=/([?&])_=[^&]*/,ic=/^(.*?):[ \t]*([^\r\n]*)$/gm,jc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,kc=/^(?:GET|HEAD)$/,lc=/^\/\//,mc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,nc={},oc={},pc="*/".concat("*");try{fc=location.href}catch(qc){fc=m.createElement("a"),fc.href="",fc=fc.href}ec=mc.exec(fc.toLowerCase())||[];function rc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(o.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function sc(a,b,c,d){var e={},f=a===oc;function g(h){var i;return e[h]=!0,o.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function tc(a,b){var c,d,e=o.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&o.extend(!0,a,d),a}function uc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function vc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}o.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:fc,type:"GET",isLocal:jc.test(ec[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":pc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":o.parseJSON,"text xml":o.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?tc(tc(a,o.ajaxSettings),b):tc(o.ajaxSettings,a)},ajaxPrefilter:rc(nc),ajaxTransport:rc(oc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=o.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?o(l):o.event,n=o.Deferred(),p=o.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=ic.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(n.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||fc)+"").replace(gc,"").replace(lc,ec[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=o.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=mc.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===ec[1]&&h[2]===ec[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(ec[3]||("http:"===ec[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=o.param(k.data,k.traditional)),sc(nc,k,b,v),2===t)return v;i=k.global,i&&0===o.active++&&o.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!kc.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(dc.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=hc.test(d)?d.replace(hc,"$1_="+cc++):d+(dc.test(d)?"&":"?")+"_="+cc++)),k.ifModified&&(o.lastModified[d]&&v.setRequestHeader("If-Modified-Since",o.lastModified[d]),o.etag[d]&&v.setRequestHeader("If-None-Match",o.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+pc+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=sc(oc,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=uc(k,v,f)),u=vc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(o.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(o.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?n.resolveWith(l,[r,x,v]):n.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--o.active||o.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return o.get(a,b,c,"json")},getScript:function(a,b){return o.get(a,void 0,b,"script")}}),o.each(["get","post"],function(a,b){o[b]=function(a,c,d,e){return o.isFunction(c)&&(e=e||d,d=c,c=void 0),o.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),o.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){o.fn[b]=function(a){return this.on(b,a)}}),o._evalUrl=function(a){return o.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},o.fn.extend({wrapAll:function(a){var b;return o.isFunction(a)?this.each(function(b){o(this).wrapAll(a.call(this,b))}):(this[0]&&(b=o(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(o.isFunction(a)?function(b){o(this).wrapInner(a.call(this,b))}:function(){var b=o(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=o.isFunction(a);return this.each(function(c){o(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){o.nodeName(this,"body")||o(this).replaceWith(this.childNodes)}).end()}}),o.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},o.expr.filters.visible=function(a){return!o.expr.filters.hidden(a)};var wc=/%20/g,xc=/\[\]$/,yc=/\r?\n/g,zc=/^(?:submit|button|image|reset|file)$/i,Ac=/^(?:input|select|textarea|keygen)/i;function Bc(a,b,c,d){var e;if(o.isArray(b))o.each(b,function(b,e){c||xc.test(a)?d(a,e):Bc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==o.type(b))d(a,b);else for(e in b)Bc(a+"["+e+"]",b[e],c,d)}o.param=function(a,b){var c,d=[],e=function(a,b){b=o.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=o.ajaxSettings&&o.ajaxSettings.traditional),o.isArray(a)||a.jquery&&!o.isPlainObject(a))o.each(a,function(){e(this.name,this.value)});else for(c in a)Bc(c,a[c],b,e);return d.join("&").replace(wc,"+")},o.fn.extend({serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=o.prop(this,"elements");return a?o.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!o(this).is(":disabled")&&Ac.test(this.nodeName)&&!zc.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=o(this).val();return null==c?null:o.isArray(c)?o.map(c,function(a){return{name:b.name,value:a.replace(yc,"\r\n")}}):{name:b.name,value:c.replace(yc,"\r\n")}}).get()}}),o.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Cc=0,Dc={},Ec={0:200,1223:204},Fc=o.ajaxSettings.xhr();a.ActiveXObject&&o(a).on("unload",function(){for(var a in Dc)Dc[a]()}),l.cors=!!Fc&&"withCredentials"in Fc,l.ajax=Fc=!!Fc,o.ajaxTransport(function(a){var b;return l.cors||Fc&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Cc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Dc[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Ec[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Dc[g]=b("abort"),f.send(a.hasContent&&a.data||null)},abort:function(){b&&b()}}:void 0}),o.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return o.globalEval(a),a}}}),o.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),o.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=o("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),m.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Gc=[],Hc=/(=)\?(?=&|$)|\?\?/;o.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Gc.pop()||o.expando+"_"+cc++;return this[a]=!0,a}}),o.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Hc.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Hc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=o.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Hc,"$1"+e):b.jsonp!==!1&&(b.url+=(dc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||o.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Gc.push(e)),g&&o.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),o.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||m;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=o.buildFragment([a],b,e),e&&e.length&&o(e).remove(),o.merge([],d.childNodes))};var Ic=o.fn.load;o.fn.load=function(a,b,c){if("string"!=typeof a&&Ic)return Ic.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=a.slice(h),a=a.slice(0,h)),o.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&o.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?o("<div>").append(o.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},o.expr.filters.animated=function(a){return o.grep(o.timers,function(b){return a===b.elem}).length};var Jc=a.document.documentElement;function Kc(a){return o.isWindow(a)?a:9===a.nodeType&&a.defaultView}o.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=o.css(a,"position"),l=o(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=o.css(a,"top"),i=o.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),o.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},o.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){o.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,o.contains(b,d)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Kc(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===o.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),o.nodeName(a[0],"html")||(d=a.offset()),d.top+=o.css(a[0],"borderTopWidth",!0),d.left+=o.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-o.css(c,"marginTop",!0),left:b.left-d.left-o.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||Jc;while(a&&!o.nodeName(a,"html")&&"static"===o.css(a,"position"))a=a.offsetParent;return a||Jc})}}),o.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;o.fn[b]=function(e){return J(this,function(b,e,f){var g=Kc(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),o.each(["top","left"],function(a,b){o.cssHooks[b]=yb(l.pixelPosition,function(a,c){return c?(c=xb(a,b),vb.test(c)?o(a).position()[b]+"px":c):void 0})}),o.each({Height:"height",Width:"width"},function(a,b){o.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){o.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return J(this,function(b,c,d){var e;return o.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?o.css(b,c,g):o.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),o.fn.size=function(){return this.length},o.fn.andSelf=o.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return o});var Lc=a.jQuery,Mc=a.$;return o.noConflict=function(b){return a.$===o&&(a.$=Mc),b&&a.jQuery===o&&(a.jQuery=Lc),o},typeof b===U&&(a.jQuery=a.$=o),o}); +/*! jQuery v3.1.1 | (c) jQuery Foundation | jquery.org/license */ +!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.1.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c<b?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||r.isFunction(g)||(g={}),h===i&&(g=this,h--);h<i;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=r.isArray(d)))?(e?(e=!1,f=c&&r.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return!(!a||"[object Object]"!==k.call(a))&&(!(b=e(a))||(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n))},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;d<c;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;d<c;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;f<g;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;f<d;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;if("string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a))return d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){j["[object "+b+"]"]=b.toLowerCase()});function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"!==c&&!r.isWindow(a)&&("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c<b;c+=2)a.push(c);return a}),odd:pa(function(a,b){for(var c=1;c<b;c+=2)a.push(c);return a}),lt:pa(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function ra(){}ra.prototype=d.filters=d.pseudos,d.setFilters=new ra,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=Q.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function sa(a){for(var b=0,c=a.length,d="";b<c;b++)d+=a[b].value;return d}function ta(a,b,c){var d=b.dir,e=b.next,f=e||d,g=c&&"parentNode"===f,h=x++;return b.first?function(b,c,e){while(b=b[d])if(1===b.nodeType||g)return a(b,c,e);return!1}:function(b,c,i){var j,k,l,m=[w,h];if(i){while(b=b[d])if((1===b.nodeType||g)&&a(b,c,i))return!0}else while(b=b[d])if(1===b.nodeType||g)if(l=b[u]||(b[u]={}),k=l[b.uniqueID]||(l[b.uniqueID]={}),e&&e===b.nodeName.toLowerCase())b=b[d]||b;else{if((j=k[f])&&j[0]===w&&j[1]===h)return m[2]=j[2];if(k[f]=m,m[2]=a(b,c,i))return!0}return!1}}function ua(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d<e;d++)ga(a,b[d],c);return c}function wa(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;h<i;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function xa(a,b,c,d,e,f){return d&&!d[u]&&(d=xa(d)),e&&!e[u]&&(e=xa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||va(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:wa(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=wa(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i<f;i++)if(c=d.relative[a[i].type])m=[ta(ua(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;e<f;e++)if(d.relative[a[e].type])break;return xa(i>1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i<e&&ya(a.slice(i,e)),e<f&&ya(a=a.slice(e)),e<f&&sa(a))}m.push(c)}return ua(m)}function za(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):C.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b<d;b++)if(r.contains(e[b],this))return!0}));for(c=this.pushStack([]),b=0;b<d;b++)r.find(a,e[b],c);return d>1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a<c;a++)if(r.contains(this,b[a]))return!0})},closest:function(a,b){var c,d=0,e=this.length,f=[],g="string"!=typeof a&&r(a);if(!A.test(a))for(;d<e;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/[^\x20\t\r\n\f]+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){r.each(b,function(b,c){r.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==r.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return r.each(arguments,function(a,b){var c;while((c=r.inArray(b,f,c))>-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b<f)){if(a=d.apply(h,i),a===c.promise())throw new TypeError("Thenable self-resolution");j=a&&("object"==typeof a||"function"==typeof a)&&a.then,r.isFunction(j)?e?j.call(a,g(f,c,M,e),g(f,c,N,e)):(f++,j.call(a,g(f,c,M,e),g(f,c,N,e),g(f,c,M,c.notifyWith))):(d!==M&&(h=void 0,i=[a]),(e||c.resolveWith)(h,i))}},k=e?j:function(){try{j()}catch(a){r.Deferred.exceptionHook&&r.Deferred.exceptionHook(a,k.stackTrace),b+1>=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R), +a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h<i;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},T=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function U(){this.expando=r.expando+U.uid++}U.uid=1,U.prototype={cache:function(a){var b=a[this.expando];return b||(b={},T(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){r.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(K)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var V=new U,W=new U,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Y=/[A-Z]/g;function Z(a){return"true"===a||"false"!==a&&("null"===a?null:a===+a+""?+a:X.test(a)?JSON.parse(a):a)}function $(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Y,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c=Z(c)}catch(e){}W.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return W.hasData(a)||V.hasData(a)},data:function(a,b,c){return W.access(a,b,c)},removeData:function(a,b){W.remove(a,b)},_data:function(a,b,c){return V.access(a,b,c)},_removeData:function(a,b){V.remove(a,b)}}),r.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=W.get(f),1===f.nodeType&&!V.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),$(f,d,e[d])));V.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){W.set(this,a)}):S(this,function(b){var c;if(f&&void 0===b){if(c=W.get(f,a),void 0!==c)return c;if(c=$(f,a),void 0!==c)return c}else this.each(function(){W.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?r.queue(this[0],a):void 0===b?this:this.each(function(){var c=r.queue(this,a,b);r._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&r.dequeue(this,a)})},dequeue:function(a){return this.each(function(){r.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=r.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=V.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var _=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,aa=new RegExp("^(?:([+-])=|)("+_+")([a-z%]*)$","i"),ba=["Top","Right","Bottom","Left"],ca=function(a,b){return a=b||a,"none"===a.style.display||""===a.style.display&&r.contains(a.ownerDocument,a)&&"none"===r.css(a,"display")},da=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};function ea(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return r.css(a,b,"")},i=h(),j=c&&c[3]||(r.cssNumber[b]?"":"px"),k=(r.cssNumber[b]||"px"!==j&&+i)&&aa.exec(r.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,r.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var fa={};function ga(a){var b,c=a.ownerDocument,d=a.nodeName,e=fa[d];return e?e:(b=c.body.appendChild(c.createElement(d)),e=r.css(b,"display"),b.parentNode.removeChild(b),"none"===e&&(e="block"),fa[d]=e,e)}function ha(a,b){for(var c,d,e=[],f=0,g=a.length;f<g;f++)d=a[f],d.style&&(c=d.style.display,b?("none"===c&&(e[f]=V.get(d,"display")||null,e[f]||(d.style.display="")),""===d.style.display&&ca(d)&&(e[f]=ga(d))):"none"!==c&&(e[f]="none",V.set(d,"display",c)));for(f=0;f<g;f++)null!=e[f]&&(a[f].style.display=e[f]);return a}r.fn.extend({show:function(){return ha(this,!0)},hide:function(){return ha(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){ca(this)?r(this).show():r(this).hide()})}});var ia=/^(?:checkbox|radio)$/i,ja=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,ka=/^$|\/(?:java|ecma)script/i,la={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};la.optgroup=la.option,la.tbody=la.tfoot=la.colgroup=la.caption=la.thead,la.th=la.td;function ma(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&r.nodeName(a,b)?r.merge([a],c):c}function na(a,b){for(var c=0,d=a.length;c<d;c++)V.set(a[c],"globalEval",!b||V.get(b[c],"globalEval"))}var oa=/<|&#?\w+;/;function pa(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],n=0,o=a.length;n<o;n++)if(f=a[n],f||0===f)if("object"===r.type(f))r.merge(m,f.nodeType?[f]:f);else if(oa.test(f)){g=g||l.appendChild(b.createElement("div")),h=(ja.exec(f)||["",""])[1].toLowerCase(),i=la[h]||la._default,g.innerHTML=i[1]+r.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;r.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",n=0;while(f=m[n++])if(d&&r.inArray(f,d)>-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=ma(l.appendChild(f),"script"),j&&na(g),c){k=0;while(f=g[k++])ka.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var qa=d.documentElement,ra=/^key/,sa=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ta=/^([^.]*)(?:\.(.+)|)/;function ua(){return!0}function va(){return!1}function wa(){try{return d.activeElement}catch(a){}}function xa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)xa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=va;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(qa,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(K)||[""],j=b.length;while(j--)h=ta.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=ta.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&V.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(V.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c<arguments.length;c++)i[c]=arguments[c];if(b.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,b)!==!1){h=r.event.handlers.call(this,b,j),c=0;while((f=h[c++])&&!b.isPropagationStopped()){b.currentTarget=f.elem,d=0;while((g=f.handlers[d++])&&!b.isImmediatePropagationStopped())b.rnamespace&&!b.rnamespace.test(g.namespace)||(b.handleObj=g,b.data=g.data,e=((r.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(b.result=e)===!1&&(b.preventDefault(),b.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,b),b.result}},handlers:function(a,b){var c,d,e,f,g,h=[],i=b.delegateCount,j=a.target;if(i&&j.nodeType&&!("click"===a.type&&a.button>=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c<i;c++)d=b[c],e=d.selector+" ",void 0===g[e]&&(g[e]=d.needsContext?r(e,this).index(j)>-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i<b.length&&h.push({elem:j,handlers:b.slice(i)}),h},addProp:function(a,b){Object.defineProperty(r.Event.prototype,a,{enumerable:!0,configurable:!0,get:r.isFunction(b)?function(){if(this.originalEvent)return b(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[a]},set:function(b){Object.defineProperty(this,a,{enumerable:!0,configurable:!0,writable:!0,value:b})}})},fix:function(a){return a[r.expando]?a:new r.Event(a)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==wa()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===wa()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&r.nodeName(this,"input"))return this.click(),!1},_default:function(a){return r.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},r.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},r.Event=function(a,b){return this instanceof r.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ua:va,this.target=a.target&&3===a.target.nodeType?a.target.parentNode:a.target,this.currentTarget=a.currentTarget,this.relatedTarget=a.relatedTarget):this.type=a,b&&r.extend(this,b),this.timeStamp=a&&a.timeStamp||r.now(),void(this[r.expando]=!0)):new r.Event(a,b)},r.Event.prototype={constructor:r.Event,isDefaultPrevented:va,isPropagationStopped:va,isImmediatePropagationStopped:va,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ua,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ua,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ua,a&&!this.isSimulated&&a.stopImmediatePropagation(),this.stopPropagation()}},r.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(a){var b=a.button;return null==a.which&&ra.test(a.type)?null!=a.charCode?a.charCode:a.keyCode:!a.which&&void 0!==b&&sa.test(a.type)?1&b?1:2&b?3:4&b?2:0:a.which}},r.event.addProp),r.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){r.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||r.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),r.fn.extend({on:function(a,b,c,d){return xa(this,a,b,c,d)},one:function(a,b,c,d){return xa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,r(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=va),this.each(function(){r.event.remove(this,a,c,b)})}});var ya=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,za=/<script|<style|<link/i,Aa=/checked\s*(?:[^=]|=\s*.checked.)/i,Ba=/^true\/(.*)/,Ca=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Da(a,b){return r.nodeName(a,"table")&&r.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function Ea(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Fa(a){var b=Ba.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ga(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(V.hasData(a)&&(f=V.access(a),g=V.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c<d;c++)r.event.add(b,e,j[e][c])}W.hasData(a)&&(h=W.access(a),i=r.extend({},h),W.set(b,i))}}function Ha(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ia.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function Ia(a,b,c,d){b=g.apply([],b);var e,f,h,i,j,k,l=0,m=a.length,n=m-1,q=b[0],s=r.isFunction(q);if(s||m>1&&"string"==typeof q&&!o.checkClone&&Aa.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ia(f,b,c,d)});if(m&&(e=pa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(ma(e,"script"),Ea),i=h.length;l<m;l++)j=e,l!==n&&(j=r.clone(j,!0,!0),i&&r.merge(h,ma(j,"script"))),c.call(a[l],j,l);if(i)for(k=h[h.length-1].ownerDocument,r.map(h,Fa),l=0;l<i;l++)j=h[l],ka.test(j.type||"")&&!V.access(j,"globalEval")&&r.contains(k,j)&&(j.src?r._evalUrl&&r._evalUrl(j.src):p(j.textContent.replace(Ca,""),k))}return a}function Ja(a,b,c){for(var d,e=b?r.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||r.cleanData(ma(d)),d.parentNode&&(c&&r.contains(d.ownerDocument,d)&&na(ma(d,"script")),d.parentNode.removeChild(d));return a}r.extend({htmlPrefilter:function(a){return a.replace(ya,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=ma(h),f=ma(a),d=0,e=f.length;d<e;d++)Ha(f[d],g[d]);if(b)if(c)for(f=f||ma(a),g=g||ma(h),d=0,e=f.length;d<e;d++)Ga(f[d],g[d]);else Ga(a,h);return g=ma(h,"script"),g.length>0&&na(g,!i&&ma(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(T(c)){if(b=c[V.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[V.expando]=void 0}c[W.expando]&&(c[W.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ja(this,a,!0)},remove:function(a){return Ja(this,a)},text:function(a){return S(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ia(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Da(this,a);b.appendChild(a)}})},prepend:function(){return Ia(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Da(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ia(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ia(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(ma(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return S(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!za.test(a)&&!la[(ja.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c<d;c++)b=this[c]||{},1===b.nodeType&&(r.cleanData(ma(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ia(this,arguments,function(b){var c=this.parentNode;r.inArray(this,a)<0&&(r.cleanData(ma(this)),c&&c.replaceChild(b,this))},a)}}),r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){r.fn[a]=function(a){for(var c,d=[],e=r(a),f=e.length-1,g=0;g<=f;g++)c=g===f?this:this.clone(!0),r(e[g])[b](c),h.apply(d,c.get());return this.pushStack(d)}});var Ka=/^margin/,La=new RegExp("^("+_+")(?!px)[a-z%]+$","i"),Ma=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)};!function(){function b(){if(i){i.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",i.innerHTML="",qa.appendChild(h);var b=a.getComputedStyle(i);c="1%"!==b.top,g="2px"===b.marginLeft,e="4px"===b.width,i.style.marginRight="50%",f="4px"===b.marginRight,qa.removeChild(h),i=null}}var c,e,f,g,h=d.createElement("div"),i=d.createElement("div");i.style&&(i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",o.clearCloneStyle="content-box"===i.style.backgroundClip,h.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",h.appendChild(i),r.extend(o,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return b(),e},pixelMarginRight:function(){return b(),f},reliableMarginLeft:function(){return b(),g}}))}();function Na(a,b,c){var d,e,f,g,h=a.style;return c=c||Ma(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||r.contains(a.ownerDocument,a)||(g=r.style(a,b)),!o.pixelMarginRight()&&La.test(g)&&Ka.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function Oa(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Pa=/^(none|table(?!-c[ea]).+)/,Qa={position:"absolute",visibility:"hidden",display:"block"},Ra={letterSpacing:"0",fontWeight:"400"},Sa=["Webkit","Moz","ms"],Ta=d.createElement("div").style;function Ua(a){if(a in Ta)return a;var b=a[0].toUpperCase()+a.slice(1),c=Sa.length;while(c--)if(a=Sa[c]+b,a in Ta)return a}function Va(a,b,c){var d=aa.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Wa(a,b,c,d,e){var f,g=0;for(f=c===(d?"border":"content")?4:"width"===b?1:0;f<4;f+=2)"margin"===c&&(g+=r.css(a,c+ba[f],!0,e)),d?("content"===c&&(g-=r.css(a,"padding"+ba[f],!0,e)),"margin"!==c&&(g-=r.css(a,"border"+ba[f]+"Width",!0,e))):(g+=r.css(a,"padding"+ba[f],!0,e),"padding"!==c&&(g+=r.css(a,"border"+ba[f]+"Width",!0,e)));return g}function Xa(a,b,c){var d,e=!0,f=Ma(a),g="border-box"===r.css(a,"boxSizing",!1,f);if(a.getClientRects().length&&(d=a.getBoundingClientRect()[b]),d<=0||null==d){if(d=Na(a,b,f),(d<0||null==d)&&(d=a.style[b]),La.test(d))return d;e=g&&(o.boxSizingReliable()||d===a.style[b]),d=parseFloat(d)||0}return d+Wa(a,b,c||(g?"border":"content"),e,f)+"px"}r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Na(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=r.camelCase(b),i=a.style;return b=r.cssProps[h]||(r.cssProps[h]=Ua(h)||h),g=r.cssHooks[b]||r.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=aa.exec(c))&&e[1]&&(c=ea(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(r.cssNumber[h]?"":"px")),o.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=r.camelCase(b);return b=r.cssProps[h]||(r.cssProps[h]=Ua(h)||h),g=r.cssHooks[b]||r.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Na(a,b,d)),"normal"===e&&b in Ra&&(e=Ra[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),r.each(["height","width"],function(a,b){r.cssHooks[b]={get:function(a,c,d){if(c)return!Pa.test(r.css(a,"display"))||a.getClientRects().length&&a.getBoundingClientRect().width?Xa(a,b,d):da(a,Qa,function(){return Xa(a,b,d)})},set:function(a,c,d){var e,f=d&&Ma(a),g=d&&Wa(a,b,d,"border-box"===r.css(a,"boxSizing",!1,f),f);return g&&(e=aa.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=r.css(a,b)),Va(a,c,g)}}}),r.cssHooks.marginLeft=Oa(o.reliableMarginLeft,function(a,b){if(b)return(parseFloat(Na(a,"marginLeft"))||a.getBoundingClientRect().left-da(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px"}),r.each({margin:"",padding:"",border:"Width"},function(a,b){r.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];d<4;d++)e[a+ba[d]+b]=f[d]||f[d-2]||f[0];return e}},Ka.test(a)||(r.cssHooks[a+b].set=Va)}),r.fn.extend({css:function(a,b){return S(this,function(a,b,c){var d,e,f={},g=0;if(r.isArray(b)){for(d=Ma(a),e=b.length;g<e;g++)f[b[g]]=r.css(a,b[g],!1,d);return f}return void 0!==c?r.style(a,b,c):r.css(a,b)},a,b,arguments.length>1)}});function Ya(a,b,c,d,e){return new Ya.prototype.init(a,b,c,d,e)}r.Tween=Ya,Ya.prototype={constructor:Ya,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=Ya.propHooks[this.prop];return a&&a.get?a.get(this):Ya.propHooks._default.get(this)},run:function(a){var b,c=Ya.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ya.propHooks._default.set(this),this}},Ya.prototype.init.prototype=Ya.prototype,Ya.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},Ya.propHooks.scrollTop=Ya.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=Ya.prototype.init,r.fx.step={};var Za,$a,_a=/^(?:toggle|show|hide)$/,ab=/queueHooks$/;function bb(){$a&&(a.requestAnimationFrame(bb),r.fx.tick())}function cb(){return a.setTimeout(function(){Za=void 0}),Za=r.now()}function db(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ba[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function eb(a,b,c){for(var d,e=(hb.tweeners[b]||[]).concat(hb.tweeners["*"]),f=0,g=e.length;f<g;f++)if(d=e[f].call(c,b,a))return d}function fb(a,b,c){var d,e,f,g,h,i,j,k,l="width"in b||"height"in b,m=this,n={},o=a.style,p=a.nodeType&&ca(a),q=V.get(a,"fxshow");c.queue||(g=r._queueHooks(a,"fx"),null==g.unqueued&&(g.unqueued=0,h=g.empty.fire,g.empty.fire=function(){g.unqueued||h()}),g.unqueued++,m.always(function(){m.always(function(){g.unqueued--,r.queue(a,"fx").length||g.empty.fire()})}));for(d in b)if(e=b[d],_a.test(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}n[d]=q&&q[d]||r.style(a,d)}if(i=!r.isEmptyObject(b),i||!r.isEmptyObject(n)){l&&1===a.nodeType&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=q&&q.display,null==j&&(j=V.get(a,"display")),k=r.css(a,"display"),"none"===k&&(j?k=j:(ha([a],!0),j=a.style.display||j,k=r.css(a,"display"),ha([a]))),("inline"===k||"inline-block"===k&&null!=j)&&"none"===r.css(a,"float")&&(i||(m.done(function(){o.display=j}),null==j&&(k=o.display,j="none"===k?"":k)),o.display="inline-block")),c.overflow&&(o.overflow="hidden",m.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]})),i=!1;for(d in n)i||(q?"hidden"in q&&(p=q.hidden):q=V.access(a,"fxshow",{display:j}),f&&(q.hidden=!p),p&&ha([a],!0),m.done(function(){p||ha([a]),V.remove(a,"fxshow");for(d in n)r.style(a,d,n[d])})),i=eb(p?q[d]:0,d,m),d in q||(q[d]=i.start,p&&(i.end=i.start,i.start=0))}}function gb(a,b){var c,d,e,f,g;for(c in a)if(d=r.camelCase(c),e=b[d],f=a[c],r.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=r.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function hb(a,b,c){var d,e,f=0,g=hb.prefilters.length,h=r.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Za||cb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;g<i;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),f<1&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:r.extend({},b),opts:r.extend(!0,{specialEasing:{},easing:r.easing._default},c),originalProperties:b,originalOptions:c,startTime:Za||cb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=r.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;c<d;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(gb(k,j.opts.specialEasing);f<g;f++)if(d=hb.prefilters[f].call(j,a,k,j.opts))return r.isFunction(d.stop)&&(r._queueHooks(j.elem,j.opts.queue).stop=r.proxy(d.stop,d)),d;return r.map(k,eb,j),r.isFunction(j.opts.start)&&j.opts.start.call(a,j),r.fx.timer(r.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}r.Animation=r.extend(hb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return ea(c.elem,a,aa.exec(b),c),c}]},tweener:function(a,b){r.isFunction(a)?(b=a,a=["*"]):a=a.match(K);for(var c,d=0,e=a.length;d<e;d++)c=a[d],hb.tweeners[c]=hb.tweeners[c]||[],hb.tweeners[c].unshift(b)},prefilters:[fb],prefilter:function(a,b){b?hb.prefilters.unshift(a):hb.prefilters.push(a)}}),r.speed=function(a,b,c){var e=a&&"object"==typeof a?r.extend({},a):{complete:c||!c&&b||r.isFunction(a)&&a,duration:a,easing:c&&b||b&&!r.isFunction(b)&&b};return r.fx.off||d.hidden?e.duration=0:"number"!=typeof e.duration&&(e.duration in r.fx.speeds?e.duration=r.fx.speeds[e.duration]:e.duration=r.fx.speeds._default),null!=e.queue&&e.queue!==!0||(e.queue="fx"),e.old=e.complete,e.complete=function(){r.isFunction(e.old)&&e.old.call(this),e.queue&&r.dequeue(this,e.queue)},e},r.fn.extend({fadeTo:function(a,b,c,d){return this.filter(ca).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=r.isEmptyObject(a),f=r.speed(b,c,d),g=function(){var b=hb(this,r.extend({},a),f);(e||V.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=r.timers,g=V.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&ab.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||r.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=V.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=r.timers,g=d?d.length:0;for(c.finish=!0,r.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;b<g;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),r.each(["toggle","show","hide"],function(a,b){var c=r.fn[b];r.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(db(b,!0),a,d,e)}}),r.each({slideDown:db("show"),slideUp:db("hide"),slideToggle:db("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){r.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),r.timers=[],r.fx.tick=function(){var a,b=0,c=r.timers;for(Za=r.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||r.fx.stop(),Za=void 0},r.fx.timer=function(a){r.timers.push(a),a()?r.fx.start():r.timers.pop()},r.fx.interval=13,r.fx.start=function(){$a||($a=a.requestAnimationFrame?a.requestAnimationFrame(bb):a.setInterval(r.fx.tick,r.fx.interval))},r.fx.stop=function(){a.cancelAnimationFrame?a.cancelAnimationFrame($a):a.clearInterval($a),$a=null},r.fx.speeds={slow:600,fast:200,_default:400},r.fn.delay=function(b,c){return b=r.fx?r.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",o.checkOn=""!==a.value,o.optSelected=c.selected,a=d.createElement("input"),a.value="t",a.type="radio",o.radioValue="t"===a.value}();var ib,jb=r.expr.attrHandle;r.fn.extend({attr:function(a,b){return S(this,r.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?ib:void 0)), +void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&r.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(K);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),ib={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=jb[b]||r.find.attr;jb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=jb[g],jb[g]=e,e=null!=c(a,b,d)?g:null,jb[g]=f),e}});var kb=/^(?:input|select|textarea|button)$/i,lb=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return S(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):kb.test(a.nodeName)||lb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function mb(a){var b=a.match(K)||[];return b.join(" ")}function nb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,nb(this)))});if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=nb(c),d=1===c.nodeType&&" "+mb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=mb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,nb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=nb(c),d=1===c.nodeType&&" "+mb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=mb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,nb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(K)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=nb(this),b&&V.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":V.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+mb(nb(c))+" ").indexOf(b)>-1)return!0;return!1}});var ob=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":r.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(ob,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:mb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d<i;d++)if(c=e[d],(c.selected||d===f)&&!c.disabled&&(!c.parentNode.disabled||!r.nodeName(c.parentNode,"optgroup"))){if(b=r(c).val(),g)return b;h.push(b)}return h},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(r.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var pb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!pb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,pb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(V.get(h,"events")||{})[b.type]&&V.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&T(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!T(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=V.access(d,b);e||d.addEventListener(a,c,!0),V.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=V.access(d,b)-1;e?V.access(d,b,e):(d.removeEventListener(a,c,!0),V.remove(d,b))}}});var qb=a.location,rb=r.now(),sb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var tb=/\[\]$/,ub=/\r?\n/g,vb=/^(?:submit|button|image|reset|file)$/i,wb=/^(?:input|select|textarea|keygen)/i;function xb(a,b,c,d){var e;if(r.isArray(b))r.each(b,function(b,e){c||tb.test(a)?d(a,e):xb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)xb(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(r.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)xb(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&wb.test(this.nodeName)&&!vb.test(a)&&(this.checked||!ia.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(ub,"\r\n")}}):{name:b.name,value:c.replace(ub,"\r\n")}}).get()}});var yb=/%20/g,zb=/#.*$/,Ab=/([?&])_=[^&]*/,Bb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Cb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Db=/^(?:GET|HEAD)$/,Eb=/^\/\//,Fb={},Gb={},Hb="*/".concat("*"),Ib=d.createElement("a");Ib.href=qb.href;function Jb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(K)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Kb(a,b,c,d){var e={},f=a===Gb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Lb(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Mb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Nb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qb.href,type:"GET",isLocal:Cb.test(qb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Hb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Lb(Lb(a,r.ajaxSettings),b):Lb(r.ajaxSettings,a)},ajaxPrefilter:Jb(Fb),ajaxTransport:Jb(Gb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Bb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||qb.href)+"").replace(Eb,qb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(K)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Ib.protocol+"//"+Ib.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Kb(Fb,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Db.test(o.type),f=o.url.replace(zb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(yb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(sb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Ab,"$1"),n=(sb.test(f)?"&":"?")+"_="+rb++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Hb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Kb(Gb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Mb(o,y,d)),v=Nb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Ob={0:200,1223:204},Pb=r.ajaxSettings.xhr();o.cors=!!Pb&&"withCredentials"in Pb,o.ajax=Pb=!!Pb,r.ajaxTransport(function(b){var c,d;if(o.cors||Pb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Ob[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Qb=[],Rb=/(=)\?(?=&|$)|\?\?/;r.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Qb.pop()||r.expando+"_"+rb++;return this[a]=!0,a}}),r.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Rb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Rb.test(b.data)&&"data");if(h||"jsonp"===b.dataTypes[0])return e=b.jsonpCallback=r.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Rb,"$1"+e):b.jsonp!==!1&&(b.url+=(sb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||r.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?r(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Qb.push(e)),g&&r.isFunction(f)&&f(g[0]),g=f=void 0}),"script"}),o.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="<form></form><form></form>",2===a.childNodes.length}(),r.parseHTML=function(a,b,c){if("string"!=typeof a)return[];"boolean"==typeof b&&(c=b,b=!1);var e,f,g;return b||(o.createHTMLDocument?(b=d.implementation.createHTMLDocument(""),e=b.createElement("base"),e.href=d.location.href,b.head.appendChild(e)):b=d),f=B.exec(a),g=!c&&[],f?[b.createElement(f[1])]:(f=pa([a],b,g),g&&g.length&&r(g).remove(),r.merge([],f.childNodes))},r.fn.load=function(a,b,c){var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=mb(a.slice(h)),a=a.slice(0,h)),r.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&r.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?r("<div>").append(r.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},r.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){r.fn[b]=function(a){return this.on(b,a)}}),r.expr.pseudos.animated=function(a){return r.grep(r.timers,function(b){return a===b.elem}).length};function Sb(a){return r.isWindow(a)?a:9===a.nodeType&&a.defaultView}r.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=r.css(a,"position"),l=r(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=r.css(a,"top"),i=r.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),r.isFunction(b)&&(b=b.call(a,c,r.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},r.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){r.offset.setOffset(this,a,b)});var b,c,d,e,f=this[0];if(f)return f.getClientRects().length?(d=f.getBoundingClientRect(),d.width||d.height?(e=f.ownerDocument,c=Sb(e),b=e.documentElement,{top:d.top+c.pageYOffset-b.clientTop,left:d.left+c.pageXOffset-b.clientLeft}):d):{top:0,left:0}},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===r.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),r.nodeName(a[0],"html")||(d=a.offset()),d={top:d.top+r.css(a[0],"borderTopWidth",!0),left:d.left+r.css(a[0],"borderLeftWidth",!0)}),{top:b.top-d.top-r.css(c,"marginTop",!0),left:b.left-d.left-r.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===r.css(a,"position"))a=a.offsetParent;return a||qa})}}),r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;r.fn[a]=function(d){return S(this,function(a,d,e){var f=Sb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),r.each(["top","left"],function(a,b){r.cssHooks[b]=Oa(o.pixelPosition,function(a,c){if(c)return c=Na(a,b),La.test(c)?r(a).position()[b]+"px":c})}),r.each({Height:"height",Width:"width"},function(a,b){r.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){r.fn[d]=function(e,f){var g=arguments.length&&(c||"boolean"!=typeof e),h=c||(e===!0||f===!0?"margin":"border");return S(this,function(b,c,e){var f;return r.isWindow(b)?0===d.indexOf("outer")?b["inner"+a]:b.document.documentElement["client"+a]:9===b.nodeType?(f=b.documentElement,Math.max(b.body["scroll"+a],f["scroll"+a],b.body["offset"+a],f["offset"+a],f["client"+a])):void 0===e?r.css(b,c,h):r.style(b,c,e,h)},b,g?e:void 0,g)}})}),r.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),r.parseJSON=JSON.parse,"function"==typeof define&&define.amd&&define("jquery",[],function(){return r});var Tb=a.jQuery,Ub=a.$;return r.noConflict=function(b){return a.$===r&&(a.$=Ub),b&&a.jQuery===r&&(a.jQuery=Tb),r},b||(a.jQuery=a.$=r),r}); diff --git a/p/scripts/jquery.sticky-kit.min.js b/p/scripts/jquery.sticky-kit.min.js new file mode 100644 index 000000000..e2a3c6de9 --- /dev/null +++ b/p/scripts/jquery.sticky-kit.min.js @@ -0,0 +1,9 @@ +/* + Sticky-kit v1.1.2 | WTFPL | Leaf Corcoran 2015 | http://leafo.net +*/ +(function(){var b,f;b=this.jQuery||window.jQuery;f=b(window);b.fn.stick_in_parent=function(d){var A,w,J,n,B,K,p,q,k,E,t;null==d&&(d={});t=d.sticky_class;B=d.inner_scrolling;E=d.recalc_every;k=d.parent;q=d.offset_top;p=d.spacer;w=d.bottoming;null==q&&(q=0);null==k&&(k=void 0);null==B&&(B=!0);null==t&&(t="is_stuck");A=b(document);null==w&&(w=!0);J=function(a,d,n,C,F,u,r,G){var v,H,m,D,I,c,g,x,y,z,h,l;if(!a.data("sticky_kit")){a.data("sticky_kit",!0);I=A.height();g=a.parent();null!=k&&(g=g.closest(k)); +if(!g.length)throw"failed to find stick parent";v=m=!1;(h=null!=p?p&&a.closest(p):b("<div />"))&&h.css("position",a.css("position"));x=function(){var c,f,e;if(!G&&(I=A.height(),c=parseInt(g.css("border-top-width"),10),f=parseInt(g.css("padding-top"),10),d=parseInt(g.css("padding-bottom"),10),n=g.offset().top+c+f,C=g.height(),m&&(v=m=!1,null==p&&(a.insertAfter(h),h.detach()),a.css({position:"",top:"",width:"",bottom:""}).removeClass(t),e=!0),F=a.offset().top-(parseInt(a.css("margin-top"),10)||0)-q, +u=a.outerHeight(!0),r=a.css("float"),h&&h.css({width:a.outerWidth(!0),height:u,display:a.css("display"),"vertical-align":a.css("vertical-align"),"float":r}),e))return l()};x();if(u!==C)return D=void 0,c=q,z=E,l=function(){var b,l,e,k;if(!G&&(e=!1,null!=z&&(--z,0>=z&&(z=E,x(),e=!0)),e||A.height()===I||x(),e=f.scrollTop(),null!=D&&(l=e-D),D=e,m?(w&&(k=e+u+c>C+n,v&&!k&&(v=!1,a.css({position:"fixed",bottom:"",top:c}).trigger("sticky_kit:unbottom"))),e<F&&(m=!1,c=q,null==p&&("left"!==r&&"right"!==r||a.insertAfter(h), +h.detach()),b={position:"",width:"",top:""},a.css(b).removeClass(t).trigger("sticky_kit:unstick")),B&&(b=f.height(),u+q>b&&!v&&(c-=l,c=Math.max(b-u,c),c=Math.min(q,c),m&&a.css({top:c+"px"})))):e>F&&(m=!0,b={position:"fixed",top:c},b.width="border-box"===a.css("box-sizing")?a.outerWidth()+"px":a.width()+"px",a.css(b).addClass(t),null==p&&(a.after(h),"left"!==r&&"right"!==r||h.append(a)),a.trigger("sticky_kit:stick")),m&&w&&(null==k&&(k=e+u+c>C+n),!v&&k)))return v=!0,"static"===g.css("position")&&g.css({position:"relative"}), +a.css({position:"absolute",bottom:d,top:"auto"}).trigger("sticky_kit:bottom")},y=function(){x();return l()},H=function(){G=!0;f.off("touchmove",l);f.off("scroll",l);f.off("resize",y);b(document.body).off("sticky_kit:recalc",y);a.off("sticky_kit:detach",H);a.removeData("sticky_kit");a.css({position:"",bottom:"",top:"",width:""});g.position("position","");if(m)return null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),h.remove()),a.removeClass(t)},f.on("touchmove",l),f.on("scroll",l),f.on("resize", +y),b(document.body).on("sticky_kit:recalc",y),a.on("sticky_kit:detach",H),setTimeout(l,0)}};n=0;for(K=this.length;n<K;n++)d=this[n],J(b(d));return this}}).call(this); diff --git a/p/scripts/main.js b/p/scripts/main.js index 34042c945..14e0c5be5 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -1,14 +1,11 @@ "use strict"; -var $stream = null, - isCollapsed = true; - -function is_normal_mode() { - return $stream.hasClass('normal'); -} +/* globals context, i18n, shortcut, shortcuts, url */ +/* jshint globalstrict: true */ -function is_global_mode() { - return $stream.hasClass('global'); -} +var $stream = null, + isCollapsed = true, + shares = 0, + ajax_loading = false; function redirect(url, new_tab) { if (url) { @@ -31,7 +28,7 @@ function needsScroll($elem) { } function str2int(str) { - if (str == '') { + if (!str) { return 0; } return parseInt(str.replace(/\D/g, ''), 10) || 0; @@ -53,30 +50,38 @@ function numberFormat(nStr) { return x1 + x2; } -function incLabel(p, inc) { +function incLabel(p, inc, spaceAfter) { var i = str2int(p) + inc; - return i > 0 ? ' (' + numberFormat(i) + ')' : ''; + return i > 0 ? ((spaceAfter ? '' : ' ') + '(' + numberFormat(i) + ')' + (spaceAfter ? ' ' : '')) : ''; } function incUnreadsFeed(article, feed_id, nb) { //Update unread: feed - var elem = $('#' + feed_id + '>.feed').get(0), + var elem = $('#' + feed_id).get(0), feed_unreads = elem ? str2int(elem.getAttribute('data-unread')) : 0, feed_priority = elem ? str2int(elem.getAttribute('data-priority')) : 0; if (elem) { - elem.setAttribute('data-unread', numberFormat(feed_unreads + nb)); + elem.setAttribute('data-unread', feed_unreads + nb); + elem = $(elem).children('.item-title').get(0); + if (elem) { + elem.setAttribute('data-unread', numberFormat(feed_unreads + nb)); + } } //Update unread: category - elem = $('#' + feed_id).parent().prevAll('.category').children(':first').get(0); + elem = $('#' + feed_id).parents('.category').get(0); feed_unreads = elem ? str2int(elem.getAttribute('data-unread')) : 0; if (elem) { - elem.setAttribute('data-unread', numberFormat(feed_unreads + nb)); + elem.setAttribute('data-unread', feed_unreads + nb); + elem = $(elem).find('.title').get(0); + if (elem) { + elem.setAttribute('data-unread', numberFormat(feed_unreads + nb)); + } } //Update unread: all if (feed_priority > 0) { - elem = $('#aside_flux .all').children(':first').get(0); + elem = $('#aside_feed .all .title').get(0); if (elem) { feed_unreads = elem ? str2int(elem.getAttribute('data-unread')) : 0; elem.setAttribute('data-unread', numberFormat(feed_unreads + nb)); @@ -85,7 +90,7 @@ function incUnreadsFeed(article, feed_id, nb) { //Update unread: favourites if (article && article.closest('div').hasClass('favorite')) { - elem = $('#aside_flux .favorites').children(':first').get(0); + elem = $('#aside_feed .favorites .title').get(0); if (elem) { feed_unreads = elem ? str2int(elem.getAttribute('data-unread')) : 0; elem.setAttribute('data-unread', numberFormat(feed_unreads + nb)); @@ -93,60 +98,68 @@ function incUnreadsFeed(article, feed_id, nb) { } var isCurrentView = false; - //Update unread: title - document.title = document.title.replace(/((?: \([ 0-9]+\))?)( · .*?)((?: \([ 0-9]+\))?)$/, function (m, p1, p2, p3) { + // Update unread: title + document.title = document.title.replace(/^((?:\([ 0-9]+\) )?)/, function (m, p1) { var $feed = $('#' + feed_id); if (article || ($feed.closest('.active').length > 0 && $feed.siblings('.active').length === 0)) { isCurrentView = true; - return incLabel(p1, nb) + p2 + incLabel(p3, feed_priority > 0 ? nb : 0); + return incLabel(p1, nb, true); + } else if ($('.all.active').length > 0) { + isCurrentView = feed_priority > 0; + return incLabel(p1, feed_priority > 0 ? nb : 0, true); } else { - return p1 + p2 + incLabel(p3, feed_priority > 0 ? nb : 0); + return p1; } }); return isCurrentView; } -var pending_feeds = []; +var pending_entries = {}; function mark_read(active, only_not_read) { - if (active.length === 0 || - (only_not_read === true && !active.hasClass("not_read"))) { + if ((active.length === 0) || (!active.attr('id')) || + (only_not_read && !active.hasClass("not_read"))) { return false; } - var url = active.find("a.read").attr("href"); - if (url === undefined) { + if (pending_entries[active.attr('id')]) { return false; } + pending_entries[active.attr('id')] = true; - var feed_url = active.find(".website>a").attr("href"), - feed_id = feed_url.substr(feed_url.lastIndexOf('f_')), - index_pending = pending_feeds.indexOf(feed_id); - - if (index_pending !== -1) { - return false; - } - - pending_feeds.push(feed_id); + var url = '.?c=entry&a=read&id=' + active.attr('id').replace(/^flux_/, '') + + (active.hasClass('not_read') ? '' : '&is_read=0'); $.ajax({ type: 'POST', url: url, - data : { ajax: true } + data : { + ajax: true, + _csrf: context.csrf, + }, }).done(function (data) { var $r = active.find("a.read").attr("href", data.url), inc = 0; if (active.hasClass("not_read")) { active.removeClass("not_read"); inc--; - } else if (only_not_read !== true || active.hasClass("not_read")) { + } else { active.addClass("not_read"); + active.addClass("keep_unread"); inc++; } $r.find('.icon').replaceWith(data.icon); - incUnreadsFeed(active, feed_id, inc); + var feed_url = active.find(".website>a").attr("href"); + if (feed_url) { + var feed_id = feed_url.substr(feed_url.lastIndexOf('f_')); + incUnreadsFeed(active, feed_id, inc); + } + faviconNbUnread(); - pending_feeds.splice(index_pending, 1); + delete pending_entries[active.attr('id')]; + }).fail(function (data) { + openNotification(i18n.notif_request_failed, 'bad'); + delete pending_entries[active.attr('id')]; }); } @@ -160,20 +173,18 @@ function mark_favorite(active) { return false; } - var feed_url = active.find(".website>a").attr("href"), - feed_id = feed_url.substr(feed_url.lastIndexOf('f_')), - index_pending = pending_feeds.indexOf(feed_id); - - if (index_pending !== -1) { + if (pending_entries[active.attr('id')]) { return false; } - - pending_feeds.push(feed_id); + pending_entries[active.attr('id')] = true; $.ajax({ type: 'POST', url: url, - data : { ajax: true } + data : { + ajax: true, + _csrf: context.csrf, + }, }).done(function (data) { var $b = active.find("a.bookmark").attr("href", data.url), inc = 0; @@ -186,35 +197,34 @@ function mark_favorite(active) { } $b.find('.icon').replaceWith(data.icon); - var favourites = $('.favorites>a').contents().last().get(0); + var favourites = $('#aside_feed .favorites .title').contents().last().get(0); if (favourites && favourites.textContent) { favourites.textContent = favourites.textContent.replace(/((?: \([ 0-9]+\))?\s*)$/, function (m, p1) { - return incLabel(p1, inc); + return incLabel(p1, inc, false); }); } if (active.closest('div').hasClass('not_read')) { - var elem = $('#aside_flux .favorites').children(':first').get(0), + var elem = $('#aside_feed .favorites .title').get(0), feed_unreads = elem ? str2int(elem.getAttribute('data-unread')) : 0; if (elem) { elem.setAttribute('data-unread', numberFormat(feed_unreads + inc)); } } - pending_feeds.splice(index_pending, 1); + delete pending_entries[active.attr('id')]; + }).fail(function (data) { + openNotification(i18n.notif_request_failed, 'bad'); + delete pending_entries[active.attr('id')]; }); } function toggleContent(new_active, old_active) { - old_active.removeClass("active"); - if (new_active.length === 0) { return; } - old_active.removeClass("current"); - - if (does_lazyload) { + if (context.does_lazyload) { new_active.find('img[data-original], iframe[data-original]').each(function () { this.setAttribute('src', this.getAttribute('data-original')); this.removeAttribute('data-original'); @@ -225,45 +235,64 @@ function toggleContent(new_active, old_active) { if (isCollapsed) { new_active.addClass("active"); } + old_active.removeClass("active current"); new_active.addClass("current"); + if (context.auto_remove_article && !old_active.hasClass('not_read')) { + auto_remove(old_active); + } + } else { + new_active.toggleClass('active'); } - var box_to_move = "html,body", - relative_move = false; - if (is_global_mode()) { - box_to_move = "#panel"; - relative_move = true; - } - - var new_pos = new_active.position().top, - old_scroll = $(box_to_move).scrollTop(); - if (hide_posts) { + var relative_move = context.current_view === 'global', + box_to_move = $(relative_move ? "#panel" : "html,body"); - new_pos = new_active.position().top; - old_scroll = $(box_to_move).scrollTop(); + if (context.sticky_post) { + var prev_article = new_active.prevAll('.flux'), + new_pos = new_active.offset().top, + old_scroll = box_to_move.scrollTop(); - if (relative_move) { - new_pos += old_scroll; + if (prev_article.length > 0 && new_pos - prev_article.offset().top <= 150) { + new_pos = prev_article.offset().top; + if (relative_move) { + new_pos -= box_to_move.offset().top; + } } - if (old_active[0] !== new_active[0]) { - new_active.children(".flux_content").first().each(function () { - $(box_to_move).scrollTop(new_pos).scrollTop(); - }); - } - } else { - if (relative_move) { - new_pos += old_scroll; - } + if (context.hide_posts) { + if (relative_move) { + new_pos += old_scroll; + } + + if (old_active[0] !== new_active[0]) { + new_active.children(".flux_content").first().each(function () { + box_to_move.scrollTop(new_pos).scrollTop(); + }); + } + } else { + if (relative_move) { + new_pos += old_scroll; + } - $(box_to_move).scrollTop(new_pos).scrollTop(); + box_to_move.scrollTop(new_pos).scrollTop(); + } } - if (auto_mark_article) { + if (context.auto_mark_article && new_active.hasClass('active')) { mark_read(new_active, true); } } +function auto_remove(element) { + var p = element.prev(); + var n = element.next(); + if (p.hasClass('day') && n.hasClass('day')) { + p.remove(); + } + element.remove(); + $('#stream > .flux:not(.not_read):not(.active)').remove(); +} + function prev_entry() { var old_active = $(".flux.current"), new_active = old_active.length === 0 ? $(".flux:last") : old_active.prevAll(".flux:first"); @@ -275,51 +304,48 @@ function next_entry() { new_active = old_active.length === 0 ? $(".flux:first") : old_active.nextAll(".flux:first"); toggleContent(new_active, old_active); - if (!auto_load_more) { - var last_active = $(".flux:last"); - if (last_active.attr("id") === new_active.attr("id")) { - load_more_posts(); - } + if (new_active.nextAll().length < 3) { + load_more_posts(); } } function prev_feed() { - var active_feed = $("#aside_flux .feeds li.active"); + var active_feed = $("#aside_feed .tree-folder-items .item.active"); if (active_feed.length > 0) { - active_feed.prev().find('a.feed').each(function(){this.click();}); + active_feed.prevAll(':visible:first').find('a').each(function(){this.click();}); } else { last_feed(); } } function next_feed() { - var active_feed = $("#aside_flux .feeds li.active"); + var active_feed = $("#aside_feed .tree-folder-items .item.active"); if (active_feed.length > 0) { - active_feed.next().find('a.feed').each(function(){this.click();}); + active_feed.nextAll(':visible:first').find('a').each(function(){this.click();}); } else { first_feed(); } } function first_feed() { - var feed = $("#aside_flux .feeds.active li:first"); + var feed = $("#aside_feed .tree-folder-items.active .item:visible:first"); if (feed.length > 0) { feed.find('a')[1].click(); } } function last_feed() { - var feed = $("#aside_flux .feeds.active li:last"); + var feed = $("#aside_feed .tree-folder-items.active .item:visible:last"); if (feed.length > 0) { feed.find('a')[1].click(); } } function prev_category() { - var active_cat = $("#aside_flux .category.stick.active"); + var active_cat = $("#aside_feed .tree-folder.active"); if (active_cat.length > 0) { - var prev_cat = active_cat.parent('li').prev().find('.category.stick a.btn'); + var prev_cat = active_cat.prevAll(':visible:first').find('.tree-folder-title .title'); if (prev_cat.length > 0) { prev_cat[0].click(); } @@ -330,10 +356,10 @@ function prev_category() { } function next_category() { - var active_cat = $("#aside_flux .category.stick.active"); + var active_cat = $("#aside_feed .tree-folder.active"); if (active_cat.length > 0) { - var next_cat = active_cat.parent('li').next().find('.category.stick a.btn'); + var next_cat = active_cat.nextAll(':visible:first').find('.tree-folder-title .title'); if (next_cat.length > 0) { next_cat[0].click(); } @@ -344,22 +370,55 @@ function next_category() { } function first_category() { - var cat = $("#aside_flux .category.stick:first"); + var cat = $("#aside_feed .tree-folder:visible:first"); if (cat.length > 0) { - cat.find('a.btn')[0].click(); + cat.find('.tree-folder-title .title')[0].click(); } } function last_category() { - var cat = $("#aside_flux .category.stick:last"); + var cat = $("#aside_feed .tree-folder:visible:last"); if (cat.length > 0) { - cat.find('a.btn')[0].click(); + cat.find('.tree-folder-title .title')[0].click(); } } function collapse_entry() { isCollapsed = !isCollapsed; - $(".flux.current").toggleClass("active"); + + var flux_current = $(".flux.current"); + flux_current.toggleClass("active"); + if (isCollapsed && context.auto_mark_article) { + mark_read(flux_current, true); + } +} + +function user_filter(key) { + var filter = $('#dropdown-query'); + var filters = filter.siblings('.dropdown-menu').find('.item.query a'); + if (typeof key === "undefined") { + if (!filter.length) { + return; + } + // Display the filter div + window.location.hash = filter.attr('id'); + // Force scrolling to the filter div + var scroll = needsScroll($('.header')); + if (scroll !== 0) { + $('html,body').scrollTop(scroll); + } + // Force the key value if there is only one action, so we can trigger it automatically + if (filters.length === 1) { + key = 1; + } else { + return; + } + } + // Trigger selected share action + key = parseInt(key); + if (key <= filters.length) { + filters[key - 1].click(); + } } function auto_share(key) { @@ -391,75 +450,78 @@ function auto_share(key) { } } -function inMarkViewport(flux, box_to_follow, relative_follow) { - var top = flux.position().top; - if (relative_follow) { - top += box_to_follow.scrollTop(); - } - var height = flux.height(), - begin = top + 3 * height / 4, - bot = Math.min(begin + 75, top + height), - windowTop = box_to_follow.scrollTop(), - windowBot = windowTop + box_to_follow.height() / 2; - - return (windowBot >= begin && bot >= windowBot); -} - -function init_lazyload() { - if ($.fn.lazyload) { - if (is_global_mode()) { - $(".flux_content img").lazyload({ - container: $("#panel") - }); - } else { - $(".flux_content img").lazyload(); - } - } +function scrollAsRead(box_to_follow) { + var minTop = 40 + (context.current_view === 'global' ? box_to_follow.offset().top : box_to_follow.scrollTop()); + $('.not_read:not(.keep_unread):visible').each(function () { + var $this = $(this); + if ($this.offset().top + $this.height() < minTop) { + mark_read($this, true); + } + }); } function init_posts() { - init_lazyload(); + var box_to_follow = context.current_view === 'global' ? $("#panel") : $(window); - var box_to_follow = $(window), - relative_follow = false; - if (is_global_mode()) { - box_to_follow = $("#panel"); - relative_follow = true; - } - - if (auto_mark_scroll) { + if (context.auto_mark_scroll) { + var lastScroll = 0, //Throttle + timerId = 0; box_to_follow.scroll(function () { - $('.not_read:visible').each(function () { - if ($(this).children(".flux_content").is(':visible') && inMarkViewport($(this), box_to_follow, relative_follow)) { - mark_read($(this), true); - } - }); + window.clearTimeout(timerId); + if (lastScroll + 500 < Date.now()) { + lastScroll = Date.now(); + scrollAsRead(box_to_follow); + } else { + timerId = window.setTimeout(function() { + scrollAsRead(box_to_follow); + }, 500); + } }); } - if (auto_load_more) { + if (context.auto_load_more) { box_to_follow.scroll(function () { var load_more = $("#load_more"); if (!load_more.is(':visible')) { return; } var boxBot = box_to_follow.scrollTop() + box_to_follow.height(), - load_more_top = load_more.position().top; - if (relative_follow) { - load_more_top += box_to_follow.scrollTop(); - } + load_more_top = load_more.offset().top; if (boxBot >= load_more_top) { load_more_posts(); } }); + box_to_follow.scroll(); + } +} + +function inject_script(name) { + var script = document.createElement('script'); + script.async = 'async'; + script.defer = 'defer'; + script.src = '../scripts/' + name; + document.head.appendChild(script); +} + +function init_sticky_column() { + if (!window.$ || !window.$.fn.stick_in_parent) { + if (window.console) { + console.log('FreshRSS waiting for Sticky-kit…'); + } + window.setTimeout(init_sticky_column, 200); + return; + } + if ($('.toggle_aside').css('display') === 'none') { + $('#aside_feed .tree').stick_in_parent({parent:'#aside_feed'}); } } function init_column_categories() { - if (!is_normal_mode()) { + if (context.current_view !== 'normal') { return; } - $('#aside_flux').on('click', '.category>a.dropdown-toggle', function () { + + $('#aside_feed').on('click', '.tree-folder>.tree-folder-title>a.dropdown-toggle', function () { $(this).children().each(function() { if (this.alt === '▽') { this.src = this.src.replace('/icons/down.', '/icons/up.'); @@ -469,17 +531,19 @@ function init_column_categories() { this.alt = '▽'; } }); - $(this).parent().next(".feeds").slideToggle(); + $(this).parent().next(".tree-folder-items").slideToggle(300 , function() { $(document.body).trigger("sticky_kit:recalc"); }); return false; }); - $('#aside_flux').on('click', '.feeds .dropdown-toggle', function () { + $('#aside_feed').on('click', '.tree-folder-items .item .dropdown-toggle', function () { if ($(this).nextAll('.dropdown-menu').length === 0) { - var feed_id = $(this).closest('li').attr('id').substr(2), + var feed_id = $(this).closest('.item').attr('id').substr(2), feed_web = $(this).data('fweb'), - template = $('#feed_config_template').html().replace(/!!!!!!/g, feed_id).replace('http://example.net/', feed_web); + template = $('#feed_config_template').html().replace(/------/g, feed_id).replace('http://example.net/', feed_web); $(this).attr('href', '#dropdown-' + feed_id).prev('.dropdown-target').attr('id', 'dropdown-' + feed_id).parent().append(template); } }); + + init_sticky_column(); } function init_shortcuts() { @@ -487,7 +551,7 @@ function init_shortcuts() { if (window.console) { console.log('FreshRSS waiting for sortcut.js…'); } - window.setTimeout(init_shortcuts, 50); + window.setTimeout(init_shortcuts, 200); return; } // Touches de manipulation @@ -500,8 +564,7 @@ function init_shortcuts() { }); shortcut.add("shift+" + shortcuts.mark_read, function () { // on marque tout comme lu - var url = $(".nav_menu a.read_all").attr("href"); - redirect(url, false); + $(".nav_menu .read_all").click(); }, { 'disable_in_input': true }); @@ -522,10 +585,22 @@ function init_shortcuts() { }, { 'disable_in_input': true }); - for(var i = 1; i < 10; i++){ - shortcut.add(i.toString(), function (e) { - auto_share(String.fromCharCode(e.keyCode)); - }, { + + shortcut.add(shortcuts.user_filter, function () { + user_filter(); + }, { + 'disable_in_input': true + }); + + function addShortcut(evt) { + if ($('#dropdown-query').siblings('.dropdown-menu').is(':visible')) { + user_filter(String.fromCharCode(evt.keyCode)); + } else { + auto_share(String.fromCharCode(evt.keyCode)); + } + } + for(var i = 1; i < 10; i++) { + shortcut.add(i.toString(), addShortcut, { 'disable_in_input': true }); } @@ -585,9 +660,9 @@ function init_shortcuts() { }); shortcut.add(shortcuts.go_website, function () { - var url_website = $(".flux.current .link a").attr("href"); + var url_website = $('.flux.current > .flux_header > .title > a').attr("href"); - if (auto_mark_site) { + if (context.auto_mark_site) { $(".flux.current").each(function () { mark_read($(this), true); }); @@ -603,18 +678,37 @@ function init_shortcuts() { }, { 'disable_in_input': true }); + + shortcut.add(shortcuts.focus_search, function () { + focus_search(); + }, { + 'disable_in_input': true + }); + + shortcut.add(shortcuts.help, function () { + redirect(url.help, true); + }, { + 'disable_in_input': true + }); + + shortcut.add(shortcuts.close_dropdown, function () { + window.location.hash = null; + }, { + 'disable_in_input': true + }); + } function init_stream(divStream) { - divStream.on('click', '.flux_header', function (e) { //flux_header_toggle - if ($(e.target).closest('.item.website, .item.link').length > 0) { + divStream.on('click', '.flux_header,.flux_content', function (e) { //flux_toggle + if ($(e.target).closest('.content, .item.website, .item.link').length > 0) { return; } var old_active = $(".flux.current"), new_active = $(this).parent(); - isCollapsed = true; + isCollapsed = true; if (e.target.tagName.toUpperCase() === 'A') { //Leave real links alone - if (auto_mark_article) { + if (context.auto_mark_article) { mark_read(new_active, true); } return true; @@ -624,6 +718,9 @@ function init_stream(divStream) { divStream.on('click', '.flux a.read', function () { var active = $(this).parents(".flux"); + if (context.auto_remove_article && active.hasClass('not_read')) { + auto_remove(active); + } mark_read(active, false); return false; }); @@ -635,20 +732,40 @@ function init_stream(divStream) { }); divStream.on('click', '.item.title > a', function (e) { + // Allow default control-click behaviour such as open in backround-tab. + return e.ctrlKey; + }); + divStream.on('mouseup', '.item.title > a', function (e) { + // Mouseup enables us to catch middle click. if (e.ctrlKey) { - return true; //Allow default control-click behaviour such as open in backround-tab + // CTRL+click, it will be manage by previous rule. + return; + } + + if (e.which == 2) { + // If middle click, we want same behaviour as CTRL+click. + var ev = jQuery.Event("click"); + ev.ctrlKey = true; + $(this).trigger(ev); + } else if(e.which == 1) { + // Normal click, just toggle article. + $(this).parent().click(); } - $(this).parent().click(); //Will perform toggle flux_content - return false; }); divStream.on('click', '.flux .content a', function () { - $(this).attr('target', '_blank'); + $(this).attr('target', '_blank').attr('rel', 'noreferrer'); }); - if (auto_mark_site) { - divStream.on('click', '.flux .link > a', function () { - mark_read($(this).parent().parent().parent(), true); + if (context.auto_mark_site) { + // catch mouseup instead of click so we can have the correct behaviour + // with middle button click (scroll button). + divStream.on('mouseup', '.flux .link > a', function (e) { + if (e.which == 3) { + return; + } + + mark_read($(this).parents(".flux"), true); }); } } @@ -666,7 +783,7 @@ function init_nav_entries() { $nav_entries.find('.up').click(function () { var active_item = $(".flux.current"), windowTop = $(window).scrollTop(), - item_top = active_item.position().top; + item_top = active_item.offset().top; if (windowTop > item_top) { $("html,body").scrollTop(item_top); @@ -677,27 +794,74 @@ function init_nav_entries() { }); } +// <actualize> +var feed_processed = 0; + +function updateFeed(feeds, feeds_count) { + var feed = feeds.pop(); + if (!feed) { + return; + } + + $.ajax({ + type: 'POST', + url: feed.url, + data : { + _csrf: context.csrf, + }, + }).always(function (data) { + feed_processed++; + $("#actualizeProgress .progress").html(feed_processed + " / " + feeds_count); + $("#actualizeProgress .title").html(feed.title); + + if (feed_processed === feeds_count) { + window.location.reload(); + } else { + updateFeed(feeds, feeds_count); + } + }); +} + function init_actualize() { var auto = false; $("#actualize").click(function () { - $.getScript('./?c=javascript&a=actualize').done(function () { - if (auto && feed_count < 1) { + if (ajax_loading) { + return false; + } + + ajax_loading = true; + + $.getJSON('./?c=javascript&a=actualize').done(function (data) { + if (auto && data.feeds.length < 1) { auto = false; + ajax_loading = false; + return false; + } + if (data.feeds.length === 0) { + openNotification(data.feedback_no_refresh, "good"); + ajax_loading = false; return; } - - updateFeeds(); + //Progress bar + var feeds_count = data.feeds.length; + $('body').after('<div id="actualizeProgress" class="notification good">' + data.feedback_actualize + + '<br /><span class="title">/</span><br /><span class="progress">0 / ' + feeds_count + + '</span></div>'); + for (var i = 10; i > 0; i--) { + updateFeed(data.feeds, feeds_count); + } }); + return false; }); - if (auto_actualize_feeds) { + if (context.auto_actualize_feeds) { auto = true; $("#actualize").click(); } } - +// </actualize> // <notification> var notification = null, @@ -712,11 +876,12 @@ function openNotification(msg, status) { notification_working = true; notification.removeClass(); + notification.addClass("notification"); notification.addClass(status); notification.find(".msg").html(msg); notification.fadeIn(300); - notification_interval = window.setInterval(closeNotification, 4000); + notification_interval = window.setTimeout(closeNotification, 4000); } function closeNotification() { @@ -739,23 +904,78 @@ function init_notifications() { if (notification.find(".msg").html().length > 0) { notification_working = true; - notification_interval = window.setInterval(closeNotification, 4000); + notification_interval = window.setTimeout(closeNotification, 4000); } } // </notification> +// <notifs html5> +var notifs_html5_permission = 'denied'; + +function notifs_html5_is_supported() { + return window.Notification !== undefined; +} + +function notifs_html5_ask_permission() { + window.Notification.requestPermission(function () { + notifs_html5_permission = window.Notification.permission; + }); +} + +function notifs_html5_show(nb) { + if (notifs_html5_permission !== "granted") { + return; + } + + var notification = new window.Notification(i18n.notif_title_articles, { + icon: "../themes/icons/favicon-256.png", + body: i18n.notif_body_articles.replace('%d', nb), + tag: "freshRssNewArticles" + }); + + notification.onclick = function() { + window.location.reload(); + }; + + if (context.html5_notif_timeout !== 0) { + setTimeout(function() { + notification.close(); + }, context.html5_notif_timeout * 1000); + } +} + +function init_notifs_html5() { + if (!notifs_html5_is_supported()) { + return; + } + + notifs_html5_permission = notifs_html5_ask_permission(); +} +// </notifs html5> + function refreshUnreads() { $.getJSON('./?c=javascript&a=nbUnreadsPerFeed').done(function (data) { - var isAll = $('.category.all > .active').length > 0; + var isAll = $('.category.all.active').length > 0, + new_articles = false; + $.each(data, function(feed_id, nbUnreads) { feed_id = 'f_' + feed_id; - var elem = $('#' + feed_id + '>.feed').get(0), + var elem = $('#' + feed_id).get(0), feed_unreads = elem ? str2int(elem.getAttribute('data-unread')) : 0; + if ((incUnreadsFeed(null, feed_id, nbUnreads - feed_unreads) || isAll) && //Update of current view? (nbUnreads - feed_unreads > 0)) { - $('#new-article').show(); - }; + $('#new-article').attr('aria-hidden', 'false').show(); + new_articles = true; + } }); + + var nb_unreads = str2int($('.category.all .title').attr('data-unread')); + + if (nb_unreads > 0 && new_articles) { + faviconNbUnread(nb_unreads); + notifs_html5_show(nb_unreads); + } }); } @@ -774,7 +994,15 @@ function load_more_posts() { $.get(url_load_more, function (data) { box_load_more.children('.flux:last').after($('#stream', data).children('.flux, .day')); $('.pagination').replaceWith($('.pagination', data)); - $('#bigMarkAsRead').attr('href', $('#nav_menu_read_all>a').attr('href')); + if (context.display_order === 'ASC') { + $('#nav_menu_read_all .read_all').attr( + 'formaction', $('#bigMarkAsRead').attr('formaction') + ); + } else { + $('#bigMarkAsRead').attr( + 'formaction', $('#nav_menu_read_all .read_all').attr('formaction') + ); + } $('[id^=day_]').each(function (i) { var ids = $('[id="' + this.id + '"]'); @@ -784,16 +1012,25 @@ function load_more_posts() { }); init_load_more(box_load_more); - init_lazyload(); $('#load_more').removeClass('loading'); load_more = false; + $(document.body).trigger('sticky_kit:recalc'); }); } +function focus_search() { + $('#search').focus(); +} + +var freshrssLoadMoreEvent = document.createEvent('Event'); +freshrssLoadMoreEvent.initEvent('freshrss:load-more', true, true); + function init_load_more(box) { box_load_more = box; + document.body.dispatchEvent(freshrssLoadMoreEvent); + var $next_link = $("#load_more"); if (!$next_link.length) { // no more article to load @@ -816,7 +1053,7 @@ function init_load_more(box) { } //</endless_mode> -//<Web login form> +//<crypto form (Web login)> function poormanSalt() { //If crypto.getRandomValues is not available var text = '$2a$04$', base = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ.0123456789/abcdefghijklmnopqrstuvwxyz'; @@ -826,170 +1063,331 @@ function poormanSalt() { //If crypto.getRandomValues is not available return text; } -function init_loginForm() { - var $loginForm = $('#loginForm'); - if ($loginForm.length === 0) { +function init_crypto_form() { + /* globals dcodeIO */ + var $crypto_form = $('#crypto-form'); + if ($crypto_form.length === 0) { return; } + if (!(window.dcodeIO)) { if (window.console) { console.log('FreshRSS waiting for bcrypt.js…'); } - window.setTimeout(init_loginForm, 100); + window.setTimeout(init_crypto_form, 100); return; } - $loginForm.on('submit', function() { - $('#loginButton').attr('disabled', ''); + + $crypto_form.on('submit', function() { + var $submit_button = $(this).find('button[type="submit"]'); + $submit_button.attr('disabled', ''); + var success = false; $.ajax({ url: './?c=javascript&a=nonce&user=' + $('#username').val(), dataType: 'json', async: false }).done(function (data) { - if (data.salt1 == '' || data.nonce == '') { - alert('Invalid user!'); + if (!data.salt1 || !data.nonce) { + openNotification('Invalid user!', 'bad'); } else { try { var strong = window.Uint32Array && window.crypto && (typeof window.crypto.getRandomValues === 'function'), s = dcodeIO.bcrypt.hashSync($('#passwordPlain').val(), data.salt1), - c = dcodeIO.bcrypt.hashSync(data.nonce + s, strong ? 4 : poormanSalt()); + c = dcodeIO.bcrypt.hashSync(data.nonce + s, strong ? dcodeIO.bcrypt.genSaltSync(4) : poormanSalt()); $('#challenge').val(c); - if (s == '' || c == '') { - alert('Crypto error!'); + if (!s || !c) { + openNotification('Crypto error!', 'bad'); } else { success = true; } } catch (e) { - alert('Crypto exception! ' + e); + openNotification('Crypto exception! ' + e, 'bad'); } } }).fail(function() { - alert('Communication error!'); + openNotification('Communication error!', 'bad'); }); - $('#loginButton').removeAttr('disabled'); + + $submit_button.removeAttr('disabled'); return success; }); } -//</Web login form> +//</crypto form (Web login)> -//<persona> -function init_persona() { - if (!(navigator.id)) { - if (window.console) { - console.log('FreshRSS waiting for Persona…'); + + +function init_confirm_action() { + $('body').on('click', '.confirm', function () { + var str_confirmation = $(this).attr('data-str-confirm'); + if (!str_confirmation) { + str_confirmation = i18n.confirmation_default; + } + + return confirm(str_confirmation); + }); + $('button.confirm').removeAttr('disabled'); +} + +function init_print_action() { + $('.item.share > a[href="#"]').click(function () { + var content = "<html><head><style>" + + "body { font-family: Serif; text-align: justify; }" + + "a { color: #000; text-decoration: none; }" + + "a:after { content: ' [' attr(href) ']'}" + + "</style></head><body>" + + $(".flux.current .content").html() + + "</body></html>"; + + var tmp_window = window.open(); + tmp_window.document.writeln(content); + tmp_window.document.close(); + tmp_window.focus(); + tmp_window.print(); + tmp_window.close(); + + return false; + }); +} + +function init_share_observers() { + shares = $('.group-share').length; + + $('.share.add').on('click', function(e) { + var opt = $(this).siblings('select').find(':selected'); + var row = $(this).parents('form').data(opt.data('form')); + row = row.replace(/##label##/g, opt.html().trim()); + row = row.replace(/##type##/g, opt.val()); + row = row.replace(/##help##/g, opt.data('help')); + row = row.replace(/##key##/g, shares); + $(this).parents('.form-group').before(row); + shares++; + + return false; + }); +} + +function init_stats_observers() { + $('.select-change').on('change', function(e) { + redirect($(this).find(':selected').data('url')); + }); +} + +function init_remove_observers() { + $('.post').on('click', 'a.remove', function(e) { + var remove_what = $(this).attr('data-remove'); + + if (remove_what !== undefined) { + var remove_obj = $('#' + remove_what); + remove_obj.remove(); } - window.setTimeout(init_persona, 100); + + return false; + }); +} + +function init_feed_observers() { + $('select[id="category"]').on('change', function() { + var detail = $('#new_category_name').parent(); + if ($(this).val() === 'nc') { + detail.attr('aria-hidden', 'false').show(); + detail.find('input').focus(); + } else { + detail.attr('aria-hidden', 'true').hide(); + } + }); +} + +function init_password_observers() { + $('.toggle-password').on('mousedown', function(e) { + var button = $(this); + var passwordField = $('#' + button.attr('data-toggle')); + passwordField.attr('type', 'text'); + button.addClass('active'); + + return false; + }).on('mouseup', function(e) { + var button = $(this); + var passwordField = $('#' + button.attr('data-toggle')); + passwordField.attr('type', 'password'); + button.removeClass('active'); + + return false; + }); +} + +function faviconNbUnread(n) { + if (typeof n === 'undefined') { + n = str2int($('.category.all .title').attr('data-unread')); + } + //http://remysharp.com/2010/08/24/dynamic-favicons/ + var canvas = document.createElement('canvas'), + link = document.getElementById('favicon').cloneNode(true); + if (canvas.getContext && link) { + canvas.height = canvas.width = 16; + var img = document.createElement('img'); + img.onload = function () { + var ctx = canvas.getContext('2d'); + ctx.drawImage(this, 0, 0, canvas.width, canvas.height); + if (n > 0) { + var text = ''; + if (n < 1000) { + text = n; + } else if (n < 100000) { + text = Math.floor(n / 1000) + 'k'; + } else { + text = 'E' + Math.floor(Math.log10(n)); + } + ctx.font = 'bold 9px "Arial", sans-serif'; + ctx.fillStyle = 'rgba(255, 255, 255, 0.8)'; + ctx.fillRect(0, 7, ctx.measureText(text).width, 9); + ctx.fillStyle = '#F00'; + ctx.fillText(text, 0, canvas.height - 1); + } + link.href = canvas.toDataURL('image/png'); + $('link[rel~=icon]').remove(); + document.head.appendChild(link); + }; + img.src = '../favicon.ico'; + } +} + +function init_slider_observers() { + var slider = $('#slider'), + closer = $('#close-slider'); + if (slider.length < 1) { return; } - $('a.signin').click(function() { - navigator.id.request(); + + $('.post').on('click', '.open-slider', function() { + if (ajax_loading) { + return false; + } + + ajax_loading = true; + var url_slide = $(this).attr('href'); + + $.ajax({ + type: 'GET', + url: url_slide, + data : { ajax: true } + }).done(function (data) { + slider.html(data); + closer.addClass('active'); + slider.addClass('active'); + ajax_loading = false; + }); + return false; }); - $('a.signout').click(function() { - navigator.id.logout(); + closer.on('click', function() { + closer.removeClass('active'); + slider.removeClass('active'); return false; }); +} - navigator.id.watch({ - loggedInUser: current_user_mail, - - onlogin: function(assertion) { - // A user has logged in! Here you need to: - // 1. Send the assertion to your backend for verification and to create a session. - // 2. Update your UI. - $.ajax ({ - type: 'POST', - url: url_login, - data: {assertion: assertion}, - success: function(res, status, xhr) { - /*if (res.status === 'failure') { - alert (res_obj.reason); - } else*/ if (res.status === 'okay') { - location.href = url_freshrss; - } - }, - error: function(res, status, xhr) { - alert("Login failure: " + res); +function init_configuration_alert() { + $(window).on('submit', function(e) { + window.hasSubmit = true; + }); + $(window).on('beforeunload', function(e) { + if (window.hasSubmit) { + return; + } + var fields = $("[data-leave-validation]"); + for (var i = 0; i < fields.length; i++) { + if ($(fields[i]).attr('type') === 'checkbox' || $(fields[i]).attr('type') === 'radio') { + // The use of != is done on purpose to check boolean against integer + if ($(fields[i]).is(':checked') != $(fields[i]).attr('data-leave-validation')) { + return false; } - }); - }, - onlogout: function() { - // A user has logged out! Here you need to: - // Tear down the user's session by redirecting the user or making a call to your backend. - // Also, make sure loggedInUser will get set to null on the next page load. - // (That's a literal JavaScript null. Not false, 0, or undefined. null.) - $.ajax ({ - type: 'POST', - url: url_logout, - success: function(res, status, xhr) { - location.href = url_freshrss; - }, - error: function(res, status, xhr) { - //alert("logout failure" + res); + } else { + if ($(fields[i]).attr('data-leave-validation') !== $(fields[i]).val()) { + return false; } - }); + } } + return; }); } -//</persona> -function init_confirm_action() { - $('.confirm').click(function () { - return confirm(str_confirmation); +function init_subscription() { + $('body').on('click', '.bookmarkClick', function (e) { + return false; }); } -function init_print_action() { - $('.print-article').click(function () { - var content = "<html><head><style>" - + "body { font-family: Serif; text-align: justify; }" - + "a { color: #000; text-decoration: none; }" - + "a:after { content: ' [' attr(href) ']'}" - + "</style></head><body>" - + $(".flux.current .content").html() - + "</body></html>"; +function parseJsonVars() { + var jsonVars = document.getElementById('jsonVars'), + json = JSON.parse(jsonVars.innerHTML); + jsonVars.outerHTML = ''; + window.context = json.context; + window.shortcuts = json.shortcuts; + window.url = json.url; + window.i18n = json.i18n; + window.icons = json.icons; +} - var tmp_window = window.open(); - tmp_window.document.writeln(content); - tmp_window.document.close(); - tmp_window.focus(); - tmp_window.print(); - tmp_window.close(); +function init_normal() { + $stream = $('#stream'); + if ($stream.length < 1) { + if (window.console) { + console.log('FreshRSS waiting for content…'); + } + window.setTimeout(init_normal, 100); + return; + } + init_column_categories(); + init_stream($stream); + init_shortcuts(); + init_actualize(); + faviconNbUnread(); +} - return false; - }); +function init_beforeDOM() { + if (!window.$) { + if (window.console) { + console.log('FreshRSS waiting for jQuery…'); + } + window.setTimeout(init_beforeDOM, 100); + return; + } + if (['normal', 'reader', 'global'].indexOf(context.current_view) >= 0) { + inject_script('jquery.sticky-kit.min.js'); + init_normal(); + } } -function init_all() { - if (!(window.$ && window.url_freshrss && ((!full_lazyload) || $.fn.lazyload))) { +function init_afterDOM() { + if (!window.$) { if (window.console) { - console.log('FreshRSS waiting for JS…'); + console.log('FreshRSS waiting again for jQuery…'); } - window.setTimeout(init_all, 50); + window.setTimeout(init_afterDOM, 100); return; } init_notifications(); - switch (authType) { - case 'form': - init_loginForm(); - break; - case 'persona': - init_persona(); - break; - } - init_confirm_action(); $stream = $('#stream'); if ($stream.length > 0) { - init_actualize(); - init_column_categories(); + init_confirm_action(); init_load_more($stream); init_posts(); - init_stream($stream); init_nav_entries(); - init_shortcuts(); init_print_action(); + init_notifs_html5(); window.setInterval(refreshUnreads, 120000); + } else { + init_subscription(); + init_crypto_form(); + init_share_observers(); + init_remove_observers(); + init_feed_observers(); + init_password_observers(); + init_stats_observers(); + init_slider_observers(); + init_configuration_alert(); } if (window.console) { @@ -997,16 +1395,16 @@ function init_all() { } } +parseJsonVars(); +init_beforeDOM(); //Can be called before DOM is fully loaded + if (document.readyState && document.readyState !== 'loading') { - if (window.console) { - console.log('FreshRSS immediate init…'); - } - init_all(); + init_afterDOM(); } else if (document.addEventListener) { document.addEventListener('DOMContentLoaded', function () { if (window.console) { console.log('FreshRSS waiting for DOMContentLoaded…'); } - init_all(); + init_afterDOM(); }, false); } diff --git a/p/scripts/repartition.js b/p/scripts/repartition.js new file mode 100644 index 000000000..be70456fa --- /dev/null +++ b/p/scripts/repartition.js @@ -0,0 +1,72 @@ +"use strict"; +/* globals Flotr, numberFormat */ +/* jshint globalstrict: true */ + +function initStats() { + if (!window.Flotr) { + if (window.console) { + console.log('FreshRSS waiting for Flotr…'); + } + window.setTimeout(initStats, 50); + return; + } + var jsonRepartition = document.getElementById('jsonRepartition'), + stats = JSON.parse(jsonRepartition.innerHTML); + jsonRepartition.outerHTML = ''; + // Entry per hour + Flotr.draw(document.getElementById('statsEntryPerHour'), + [{ + data: stats.repartitionHour, + bars: {horizontal: false, show: true} + }], + { + grid: {verticalLines: false}, + xaxis: {noTicks: 23, + tickFormatter: function(x1) { + return 1 + parseInt(x1); + }, + min: -0.9, + max: 23.9, + tickDecimals: 0}, + yaxis: {min: 0}, + mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return numberFormat(obj.y);}} + }); + // Entry per day of week + Flotr.draw(document.getElementById('statsEntryPerDayOfWeek'), + [{ + data: stats.repartitionDayOfWeek, + bars: {horizontal: false, show: true} + }], + { + grid: {verticalLines: false}, + xaxis: {noTicks: 6, + tickFormatter: function(x2) { + return stats.days[parseInt(x2)]; + }, + min: -0.9, + max: 6.9, + tickDecimals: 0}, + yaxis: {min: 0}, + mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return numberFormat(obj.y);}} + }); + // Entry per month + Flotr.draw(document.getElementById('statsEntryPerMonth'), + [{ + data: stats.repartitionMonth, + bars: {horizontal: false, show: true} + }], + { + grid: {verticalLines: false}, + xaxis: {noTicks: 12, + tickFormatter: function(x3) { + return stats.months[parseInt(x3) - 1]; + }, + min: 0.1, + max: 12.9, + tickDecimals: 0}, + yaxis: {min: 0}, + mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return numberFormat(obj.y);}} + }); + +} +initStats(); diff --git a/p/scripts/shortcut.js b/p/scripts/shortcut.js index debaffbaa..e78cf6f5e 100644 --- a/p/scripts/shortcut.js +++ b/p/scripts/shortcut.js @@ -43,7 +43,9 @@ shortcut = { //Find Which key is pressed if (e.keyCode) code = e.keyCode; else if (e.which) code = e.which; - var character = String.fromCharCode(code).toLowerCase(); + if (code == 32 || (code >= 48 && code <= 90) || (code >= 96 && code <= 111) || (code >= 186 && code <= 192) || (code >= 219 && code <= 222)) { //FreshRSS + var character = String.fromCharCode(code).toLowerCase(); + } if(code == 188) character=","; //If the user presses , when the type is onkeydown if(code == 190) character="."; //If the user presses , when the type is onkeydown diff --git a/p/scripts/stats.js b/p/scripts/stats.js new file mode 100644 index 000000000..9cd14721c --- /dev/null +++ b/p/scripts/stats.js @@ -0,0 +1,59 @@ +"use strict"; +/* globals Flotr, numberFormat */ +/* jshint globalstrict: true */ + +function initStats() { + if (!window.Flotr) { + if (window.console) { + console.log('FreshRSS waiting for Flotr…'); + } + window.setTimeout(initStats, 50); + return; + } + var jsonStats = document.getElementById('jsonStats'), + stats = JSON.parse(jsonStats.innerHTML); + jsonStats.outerHTML = ''; + // Entry per day + var avg = []; + for (var i = -31; i <= 0; i++) { + avg.push([i, stats.average]); + } + Flotr.draw(document.getElementById('statsEntryPerDay'), + [{ + data: stats.dataCount, + bars: {horizontal: false, show: true} + },{ + data: avg, + lines: {show: true}, + label: stats.average, + }], + { + grid: {verticalLines: false}, + xaxis: {noTicks: 6, showLabels: false, tickDecimals: 0, min: -30.75, max: -0.25}, + yaxis: {min: 0}, + mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return numberFormat(obj.y);}} + }); + // Feed per category + Flotr.draw(document.getElementById('statsFeedPerCategory'), + stats.feedByCategory, + { + grid: {verticalLines: false, horizontalLines: false}, + pie: {explode: 10, show: true, labelFormatter: function(){return '';}}, + xaxis: {showLabels: false}, + yaxis: {showLabels: false}, + mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return obj.series.label + ' - '+ numberFormat(obj.y) + ' ('+ (obj.fraction * 100).toFixed(1) + '%)';}}, + legend: {container: document.getElementById('statsFeedPerCategoryLegend'), noColumns: 3} + }); + // Entry per category + Flotr.draw(document.getElementById('statsEntryPerCategory'), + stats.entryByCategory, + { + grid: {verticalLines: false, horizontalLines: false}, + pie: {explode: 10, show: true, labelFormatter: function(){return '';}}, + xaxis: {showLabels: false}, + yaxis: {showLabels: false}, + mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return obj.series.label + ' - '+ numberFormat(obj.y) + ' ('+ (obj.fraction * 100).toFixed(1) + '%)';}}, + legend: {container: document.getElementById('statsEntryPerCategoryLegend'), noColumns: 3} + }); +} +initStats(); diff --git a/p/themes/.htaccess b/p/themes/.htaccess new file mode 100644 index 000000000..bde718537 --- /dev/null +++ b/p/themes/.htaccess @@ -0,0 +1,21 @@ +<IfModule mod_mime.c> + AddType application/font-woff .woff + + AddCharset UTF-8 .css + AddCharset UTF-8 .svg +</IfModule> + +<IfModule mod_expires.c> + ExpiresActive on + ExpiresByType application/font-woff "access plus 1 month" + ExpiresByType image/gif "access plus 1 month" + ExpiresByType image/png "access plus 1 month" + ExpiresByType image/svg+xml "access plus 1 month" + ExpiresByType text/css "access plus 1 month" +</IfModule> + +<IfModule mod_headers.c> + <FilesMatch "\.svg$"> + Header set Content-Security-Policy "default-src 'self'; style-src 'self' 'unsafe-inline'" + </FilesMatch> +</IfModule> diff --git a/p/themes/BlueLagoon/BlueLagoon.css b/p/themes/BlueLagoon/BlueLagoon.css new file mode 100644 index 000000000..27bae5404 --- /dev/null +++ b/p/themes/BlueLagoon/BlueLagoon.css @@ -0,0 +1,1205 @@ +@charset "UTF-8"; + +/*=== FONTS */ +@font-face { + font-family: "OpenSans"; + src: url("../fonts/openSans.woff") format("woff"); +} + +/*=== GENERAL */ +/*============*/ +html, body { + height: 100%; + font-family: "OpenSans", "Cantarell", "Helvetica", "Arial", sans-serif; + background: #fafafa; + font-size: 92%; +} + +/*=== Links */ +a, button.as-link { + color: #0062BE; + outline: none; +} + +/*=== Forms */ +.form-group{ + width: 100%; + float: left; + height: auto; + display: inline-block; +} +legend { + margin: 20px 0 5px; + padding: 5px 0; + border-bottom: 1px solid #ddd; + font-size: 1.4em; +} +label { + min-height: 25px; + padding: 5px 0; + cursor: pointer; +} +textarea { + width: 360px; + height: 100px; +} +input, select, textarea { + min-height: 25px; + padding: 5px; + background: #fff; + border: 1px solid #ccc; + border-radius: 3px; + color: #222; + line-height: 25px; + vertical-align: middle; + box-shadow: 0 1px 2px #ccc inset, 0 1px #fff; +} +option { + padding: 0 .5em; +} +input:focus, select:focus, textarea:focus { + color: #0F0F0F; + box-shadow: 0 0 3px #0062BF; + border: solid 1px #0062BF; +} +input:invalid, select:invalid { + border-color: #f00; + box-shadow: 0 0 2px 2px #fdd inset; +} +input:disabled, select:disabled { + background: #eee; +} +input.extend { + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; +} + +/*=== Tables */ +table { + border-collapse: collapse; +} + +tr, th, td { + padding: 0.5em; + border: 1px solid #ddd; +} +th { + background: #f6f6f6; +} +form td, +form th { + font-weight: normal; + text-align: center; +} + +/*=== COMPONENTS */ +/*===============*/ +/*=== Forms */ +.form-group.form-actions { + padding: 5px 0; + background: #f4f4f4; + border-top: 1px solid #ddd; +} +.form-group.form-actions .btn { + margin: 0 10px; + border-radius: 4px; + box-shadow:0 1px rgba(255,255,255,0.08) inset; +} +.form-group .group-name { + padding: 10px 0; + text-align: right; +} +.form-group .group-controls { + min-height: 25px; + padding: 5px 0; +} +.form-group table { + margin: 10px 0 0 220px; +} + +/*=== Buttons */ + +.dropdown-menu .input select, .dropdown-menu .input input { + background:#444; + color:#fff; + box-shadow:0 2px 2px #222 inset, 0px 1px rgba(255, 255, 255, 0.08); + border:solid 1px #171717; +} + +.stick { + vertical-align: middle; + font-size: 0; +} +.stick input, +.stick .btn { + border-radius: 0; +} +.stick .btn:first-child,.stick input:first-child { + border-radius: 6px 0 0 6px; +} +.stick .btn-important:first-child { +} +.stick .btn:last-child, .stick input:last-child { + border-radius: 0 6px 6px 0; +} +.stick .btn + .btn, +.stick .btn + input, +.stick .btn + .dropdown > .btn, +.stick input + .btn, +.stick input + input, +.stick input + .dropdown > .btn, +.stick .dropdown + .btn, +.stick .dropdown + input, +.stick .dropdown + .dropdown > .btn { + border-left: none; +} +.stick .btn + .dropdown > .btn { + border-left: none; + border-radius: 0 3px 3px 0; +} + +.btn { + display: inline-block; + min-height: 37px; + min-width: 15px; + margin: 0; + padding: 5px 10px; + color:#222; + border: solid 1px #ccc; + border-radius: 4px; + background: linear-gradient(0deg, #EDE7DE 0%, #FFF 100%) #EDE7DE; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #FFF 100%); + text-shadow: 0px -1px rgba(255,255,255,0.08); + font-size: 0.9rem; + vertical-align: middle; + cursor: pointer; + overflow: hidden; +} +a.btn { + min-height: 25px; + line-height: 25px; +} +.btn:hover { + text-shadow: 0 0 2px #fff; + text-decoration:none; +} +.btn.active,.btn:active,.dropdown-target:target ~ .btn.dropdown-toggle { + background: linear-gradient(180deg, #EDE7DE 0%, #FFF 100%) #EDE7DE; + background: -webkit-linear-gradient(top, #EDE7DE 0%, #FFF 100%); +} + +.nav_menu .btn.active, .nav_menu .btn:active, .nav_menu .dropdown-target:target ~ .btn.dropdown-toggle{ + box-shadow: 0 1px #fff; + border-radius: 4px; + background: linear-gradient(180deg, #EDE7DE 0%, #F6F6F6 100%) #EDE7DE; + background: -webkit-linear-gradient(top, #EDE7DE 0%, #F6F6F6 100%); + border: solid 1px #ccc; +} +.nav_menu .btn { + border: 0; + background:transparent; +} + +.read_all { + color:#222; +} +.btn.dropdown-toggle[href="#dropdown-configure"]{ + background: linear-gradient(0deg, #EDE7DE 0%, #FFF 100%) #EDE7DE; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #FFF 100%); + border-radius: 4px; + border: solid 1px #ccc; + box-shadow: 0 1px #fff; +} +.btn.dropdown-toggle:active { + background:transparent; +} +.btn-important { + background: linear-gradient(180deg, #0090FF 0%, #0062BE 100%) #E4992C; + background: -webkit-linear-gradient(top, #0090FF 0%, #0062BE 100%); + color: #FFF; + box-shadow: 0 1px rgba(255,255,255,0.08) inset; + border-radius: 4px; + text-shadow: 0px -1px rgba(255,255,255,0.08); + font-weight: normal; +} +.btn-important:hover { +} +.btn-important:active { + background: linear-gradient(0deg, #E4992C 0%, #D18114 100%) #E4992C; + background: -webkit-linear-gradient(bottom, #E4992C 0%, #D18114 100%); +} + +.btn-attention { + background: #E95B57; + background: linear-gradient(to bottom, #E95B57, #BD362F); + background: -webkit-linear-gradient(top, #E95B57 0%, #BD362F 100%); + color: #fff; + border: 1px solid #C44742; + text-shadow: 0px -1px 0px #666; +} +.btn-attention:hover { + background: linear-gradient(to bottom, #D14641, #BD362F); + background: -webkit-linear-gradient(top, #D14641 0%, #BD362F 100%); +} +.btn-attention:active { + background: #BD362F; + box-shadow: none; +} +.btn[type="reset"]{ + color: #fff; + background:linear-gradient(180deg, #222 0%, #171717 100%) #171717; + background: -webkit-linear-gradient(top, #222 0%, #171717 100%); + box-shadow:0 -1px rgba(255,255,255,0.08) inset; +} +/*=== Navigation */ +.nav-list .nav-header, +.nav-list .item { + height: 2.5em; + line-height: 2.5em; + font-size: 0.9rem; +} +.nav-list .item:hover { + text-shadow: 0 0 2px rgba(255,255,255,0.28); + color:#fff; +} + +.nav-list .item.active { + background: linear-gradient(180deg, #0090FF 0%, #0062BE 100%) #E4992C; + background: -webkit-linear-gradient(top, #0090FF 0%, #0062BE 100%); + border-width: medium medium 1px; + border-style: none none solid; + border-color: -moz-use-text-color -moz-use-text-color #171717; + box-shadow: -1px 2px 2px #171717, 0px 1px rgba(255, 255, 255, 0.08) inset; + margin: 0; +} +.nav-list .item.active a { + color: #fff; +} +.nav-list .disable { + color: #aaa; + background: #fafafa; + text-align: center; +} +.nav-list .item > a { + padding: 0 10px; + color:#ccc; +} +.nav-list a:hover { + text-decoration: none; +} +.nav-list .item.empty a { + color: #f39c12; +} +.nav-list .item.active.empty a { + color: #fff; + background: linear-gradient(180deg, #E4992C 0%, #D18114 100%) #E4992C; + background: -webkit-linear-gradient(180deg, #E4992C 0%, #D18114 100%); +} +.nav-list .item.error a { + color: #BD362F; +} +.nav-list .item.active.error a { + color: #fff; + background: #BD362F; +} + +.nav-list .nav-header { + padding: 0 10px; + color: #222; + background: transparent; +} + +.nav-list .nav-form { + padding: 3px; + text-align: center; +} + +.nav-head { + margin: 0; + background: linear-gradient(0deg, #EDE7DE 0%, #FFF 100%) #EDE7DE; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #FFF 100%); + text-align: right; +} +.nav-head .item { + padding: 5px 10px; + font-size: 0.9rem; + line-height: 1.5rem; +} + +/*=== Horizontal-list */ +.horizontal-list { + margin: 0; + padding: 0; +} +.horizontal-list .item { + vertical-align: middle; +} + +/*=== Dropdown */ +.dropdown-menu { + margin: 5px 0 0; + padding: 5px 0; + border: 1px solid #171717; + border-radius: 4px; + box-shadow: 0 0 3px #000; + font-size: 0.8rem; + text-align: left; + background: #222; +} +.dropdown-menu::after { + content: ""; + position: absolute; + top: -6px; + right: 13px; + width: 10px; + height: 10px; + background: #222; + border-top: 1px solid #171717; + border-left: 1px solid #171717; + z-index: -10; + transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); +} +.dropdown-header { + display:none; +} +.dropdown-menu > .item > a { + padding: 0 25px; + line-height: 2.5em; + color: #ccc; +} +.dropdown-menu > .item > span, +.dropdown-menu > .item > .as-link { + padding: 0 22px; + line-height: 2em; + color: #ccc; +} +.dropdown-menu > .item:hover { + background: linear-gradient(180deg, #0090FF 0%, #0062BE 100%) #E4992C; + background: -webkit-linear-gradient(top, #0090FF 0%, #0062BE 100%); + color: #fff; +} +.dropdown-menu > .item[aria-checked="true"] > a::before { + font-weight: bold; + margin: 0 0 0 -14px; +} +.dropdown-menu > .item:hover > a { + color: #fff; + text-decoration: none; +} +.dropdown-menu .input select, +.dropdown-menu .input input { + margin: 0 auto 5px; + padding: 2px 5px; + border-radius: 3px; +} + +.separator { + margin: 5px 0; + border-bottom: 1px solid #171717; + box-shadow: 0 1px rgba(255,255,255,0.08); +} + +/*=== Alerts */ +.alert { + margin: 15px auto; + padding: 10px 15px; + background: #f4f4f4; + border: 1px solid #ccc; + border-right: 1px solid #aaa; + border-bottom: 1px solid #aaa; + border-radius: 5px; + color: #aaa; + text-shadow: 0 0 1px #eee; + font-size: 0.9em; +} +.alert-head { + font-size: 1.15em; +} +.alert > a { + color: inherit; + text-decoration: underline; +} +.alert-warn { + background: #ffe; + border: 1px solid #eeb; + color: #c95; +} +.alert-success { + background: #dfd; + border: 1px solid #cec; + color: #484; +} +.alert-error { + background: #fdd; + border: 1px solid #ecc; + color: #844; +} + +/*=== Pagination */ +.pagination { + background: #fafafa; + text-align: center; + color: #333; + font-size: 0.8em; +} +.content .pagination { + margin: 0; + padding: 0; +} +.pagination .item.pager-current { + font-weight: bold; + font-size: 1.5em; +} +.pagination .item a { + display: block; + color: #333; + font-style: italic; + line-height: 3em; + text-decoration: none; +} +.pagination .item a:hover { + background: #ddd; +} +.pagination:first-child .item { + border-bottom: 1px solid #aaa; +} +.pagination:last-child .item { + border-top: 1px solid #ddd; +} + +.pagination .loading, +.pagination a:hover.loading { + background: url("loader.gif") center center no-repeat #fff; + font-size: 0; + height:55px +} + +/*=== Boxes */ +.box { + background: #F9F7F4; + border-radius: 4px; + box-shadow: 0 1px #fff; +} +.box .box-title { + margin: 0; + padding: 5px 10px; + background: linear-gradient(0deg, #EDE7DE 0%, #fff 100%) #171717; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #fff 100%); + box-shadow: 0px -1px #fff inset,0 -2px #ccc inset; + color: #888; + text-shadow: 0 1px #ccc; + border-radius: 4px 4px 0 0; + font-size: 1.1rem; + font-weight: normal; +} +.box .box-content { + max-height: 260px; +} + +.box .box-content .item { + padding: 0 10px; + font-size: 0.9rem; + line-height: 2.5em; +} + +.box .box-content .item .configure { + visibility: hidden; +} +.box .box-content .item:hover .configure { + visibility: visible; +} + +/*=== Tree */ +.tree { + margin: 10px 0; +} +.tree-folder-title { + position: relative; + padding: 0 10px; + line-height: 2.5rem; + font-size: 0.9rem; +} +.tree-folder-title .title { + background: inherit; + color: #fff; +} +.tree-folder-title .title:hover { + text-decoration: none; +} +.tree-folder.active .tree-folder-title { + background: linear-gradient(180deg, #222 0%, #171717 100%) #171717; + background: -webkit-linear-gradient(top, #222 0%, #171717 100%); + box-shadow: 0px 1px #171717, 0px 1px rgba(255, 255, 255, 0.08) inset; + text-shadow: 0 0 2px rgba(255,255,255,0.28); + color: #fff; +} +.tree-folder.active > .tree-folder-title > a.title{ + color: #0090FF; + text-shadow: 0 1px rgba(255,255,255,0.08); +} +.tree-folder-items { + background: #171717; + padding: 8px 0; + box-shadow: 0 4px 4px #171717 inset, 0 1px rgba(255,255,255,0.08),0 -1px rgba(255,255,255,0.08); +} +.tree-folder-items > .item { + padding: 0 10px; + line-height: 2.5rem; + font-size: 0.8rem; +} +.tree-folder-items > .item.active { + background: linear-gradient(180deg, #222 0%, #171717 100%) #171717; + background: -webkit-linear-gradient(top, #222 0%, #171717 100%); + border-radius: 4px; + margin: 0px 8px; + box-shadow: 0px 1px #171717, 0px 1px rgba(255, 255, 255, 0.08) inset, 0 2px 2px #111; +} +.tree-folder-items > .item > a { + text-decoration: none; + color: #fff; + font-size: 0.92em; +} +.tree-folder-items > .item.active > a { + color: #0090FF +} + +/*=== STRUCTURE */ +/*===============*/ +/*=== Header */ +.header { + height: 55px; + background: linear-gradient(0deg, #EDE7DE 0%, #FFF 100%) #EDE7DE; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #FFF 100%); + border-bottom: solid 1px #BDB7AE; + box-shadow: 0 -1px rgba(255,255,255,0.28) inset; +} +.header > .item { + padding: 0; + vertical-align: middle; + text-align: center; +} +.header > .item.title .logo { + height: 60px; + width: 60px; +} +.header > .item.title{ + width: 250px; +} +.header > .item.title h1 { + margin: 0.5em 0; +} +.header > .item.title h1 a { + text-decoration: none; + font-size: 28px; + color:#222; + text-shadow: 0 1px #fff; +} +.header > .item.search input { + width: 230px; +} +.header .item.search input:focus { + width: 350px; +} + +/*=== Body */ +#global { + background:#F9F7F4; + height: calc(100% - 60px); +} +.aside { + box-shadow: 0 2px 2px #171717 inset; + background: #222; + width: 235px; +} +.aside.aside_feed { + padding: 10px 0; + text-align: center; +} +.aside.aside_feed .tree { + margin: 10px 0 50px; +} + +/*=== Aside main page (categories) */ +.aside_feed .tree-folder-title > .title:not([data-unread="0"])::after { + position: absolute; + right: 3px; + padding: 1px 5px; + color: #fff; + text-shadow: 0 1px rgba(255,255,255,0.08); +} +.aside_feed .btn-important { + border: none; +} + +/*=== Aside main page (feeds) */ +.feed.item.empty, +.feed.item.empty > a { + color: #e67e22; +} +.feed.item.error, +.feed.item.error > a { + color: #BD362F; +} +.aside_feed .tree-folder-items .dropdown-menu::after { + left: 2px; +} +.aside_feed .tree-folder-items .item .dropdown-target:target ~ .dropdown-toggle > .icon, +.aside_feed .tree-folder-items .item:hover .dropdown-toggle > .icon, +.aside_feed .tree-folder-items .item.active .dropdown-toggle > .icon { + border-radius: 3px; +} + +/*=== Configuration pages */ +.post { + padding: 10px 50px; + font-size: 0.9em; +} +.post form { + margin: 10px 0; +} +.post.content { + max-width: 550px; +} + +/*=== Prompt (centered) */ +.prompt { + text-align: center; + padding: 14px 0px; + text-shadow: 0 1px rgba(255,255,255,0.08); +} +.prompt label { + text-align: left; +} +.prompt form { + margin: 10px auto 20px auto; + width: 180px; +} +.prompt input { + margin: 5px auto; + width: 100%; +} +.prompt p { + margin: 20px 0; +} +.prompt input#username,.prompt input#passwordPlain{ + border:solid 1px #ccc; + box-shadow: 0 4px -4px #ccc inset,0px 1px rgba(255, 255, 255, 0.08); + background:#fff; +} +.prompt input#username:focus,.prompt input#passwordPlain:focus{ + border: solid 1px #0062BE; + box-shadow: 0 0 3px #0062BE; +} + +/*=== New article notification */ +#new-article { + background: #0084CC; + text-align: center; + font-size: 0.9em; +} +#new-article:hover { + background: #0066CC; +} +#new-article > a { + line-height: 3em; + color: #fff; + font-weight: bold; +} +#new-article > a:hover { + text-decoration: none; +} + +/*=== Day indication */ +.day { + padding: 0 10px; + font-style:italic; + line-height: 3em; + box-shadow: 0 -1px #ccc, 0 -1px rgba(255,255,255,0.28) inset; + background: #F9F7F4; + color: #666; + text-shadow: 0 1px rgba(255,255,255,0.28); + text-align: center; +} +#new-article + .day { + border-top: none; +} +.day .name { + display: none; +} + +/*=== Index menu */ +.nav_menu { + background: linear-gradient(0deg, #EDE7DE 0%, #C2BCB3 100%) #EDE7DE; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #C2BCB3 100%); + border-bottom: 1px solid #ccc; + box-shadow:0 -1px rgba(255, 255, 255, 0.28) inset; + text-align: center; + padding: 5px 0; +} +#panel >.nav_menu{ + background: linear-gradient(0deg, #EDE7DE 0%, #FFF 100%) #EDE7DE; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #FFF 100%); +} +#panel > .nav_menu > #nav_menu_read_all{ + background: linear-gradient(0deg, #EDE7DE 0%, #FFF 100%) #EDE7DE; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #FFF 100%); + border-radius: 4px; + border: 1px solid #CCC; + box-shadow: 0px 1px #FFF; +} +#panel > .nav_menu > #nav_menu_read_all .dropdown > .btn.dropdown-toggle { + border-radius: 0 4px 4px 0; + border:none; + border-left: solid 1px #ccc; +} + +/*=== Feed articles */ +.flux_content { + background: #FFF; +} +.flux { + background: #F9F7F4; +} +.flux:hover { + background: #F9F7F4; +} +.flux:not(.current):hover .item.title { + background: #F9F7F4; +} +.flux.current .flux .item.title a { + text-shadow:0 0 2px #ccc; +} +.flux.not_read:not(.current):hover .item.title { + opacity:0.85; +} +.flux.favorite { + background: #FFF6DA; +} +.flux.favorite:not(.current):hover{ + background: #F9F7F4; +} +.flux.favorite:not(.current):hover .item.title { + background: #F9F7F4; +} +.flux.current { + background: linear-gradient(0deg, #DAD4CB 0%, #FFF 100%) #DAD4CB; + background: -webkit-linear-gradient(bottom, #DAD4CB 0%, #FFF 100%); + box-shadow: 0 -1px #fff inset, 0 2px #ccc; + border-left: solid 4px #0062BF; +} + +.flux .item.title { +opacity: 0.35; +} +.flux.favorite .item.title { +opacity: 1; +} +.flux.not_read .item.title { +opacity: 1; +} +.flux.current .item.title a { + color: #0f0f0f; +} +.flux .item.title a { + color: #333; +} + +.flux_header { + border-top: 1px solid #ddd; + font-size: 0.8rem; + cursor: pointer; + box-shadow: 0 -1px rgba(255,255,255,0.28) inset; +} +.flux_header .title { + font-size: 0.9rem; +} +.flux .website .favicon { + padding: 5px; +} +.flux .date { + color: #666; + font-size: 0.7rem; +} + +.flux .bottom { + font-size: 0.8rem; + text-align: center; +} + +/*=== Content of feed articles */ +.content { + padding: 20px 10px; +} +.content > h1.title > a { + color: #000; +} + +.content hr { + margin: 30px 10px; + height: 1px; + background: #ddd; + border: 0; + box-shadow: 0 2px 5px #ccc; +} + +.content pre { + margin: 10px auto; + padding: 10px 20px; + overflow: auto; + background: #222; + color: #fff; + font-size: 0.9rem; + border-radius: 3px; +} +.content code { + padding: 2px 5px; + color: #dd1144; + background: #fafafa; + border: 1px solid #eee; + border-radius: 3px; +} +.content pre code { + background: transparent; + color: #fff; + border: none; +} + +.content blockquote { + display: block; + margin: 0; + padding: 5px 20px; + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + background: #fafafa; + color: #333; +} +.content blockquote p { + margin: 0; +} + +/*=== Notification and actualize notification */ +.notification { + padding: 0 0 0 5px; + text-align: center; + background:#222; + border: none; + border-radius: 0 0 6px 6px; + box-shadow: 0px 0px 4px rgba(0,0,0,0.45), 0 -1px rgba(255,255,255,0.08) inset, 0 2px 2px #171717 inset; + color:#fff; + font-weight: bold; + font-size: 0.9em; + line-height: 3em; + position:absolute; + top:0; + z-index: 10; + vertical-align: middle; +} +.notification.good { + color: #fff; +} +.notification.bad { + background: #222222; + color: #EB2901; +} +.notification a.close { + padding: 0 15px; + line-height: 3em; +} +.notification#actualizeProgress { + line-height: 2em; +} + +/*=== "Load more" part */ +#bigMarkAsRead { + text-align: center; + text-decoration: none; + text-shadow: 0 -1px 0 #aaa; + color: #666; + background: #F9F7F4; + box-shadow: 0 1px rgba(255,255,255,0.28)inset; +} +#bigMarkAsRead:hover { + color: #000; + background: #F9F7F4; + background: radial-gradient(circle at 50% -25% , #ccc 0%, #F9F7F4 50%); +} +#bigMarkAsRead:hover .bigTick { + text-shadow: 0 0 10px #666; +} + +/*=== Navigation menu (for articles) */ +#nav_entries { + background: linear-gradient(180deg, #222 0%, #171717 100%) #222; + background: -webkit-linear-gradient(top, #222 0%, #171717 100%); + border-top: 1px solid #171717; + text-align: center; + line-height: 3em; + table-layout: fixed; + box-shadow: 0 1px rgba(255,255,255,0.08) inset, 0 -2px 2px #171717; + width:235px; +} + +/*=== READER VIEW */ +/*================*/ +#stream.reader .flux { + padding: 0 0 50px; + border: none; + background: #f0f0f0; + color: #333; +} +#stream.reader .flux .author { + margin: 0 0 10px; + font-size: 90%; + color: #666; +} + +/*=== GLOBAL VIEW */ +/*================*/ +#stream.global { + padding: 24px 0; +} + +.box.category .box-title { + background: linear-gradient(0deg, #EDE7DE 0%, #fff 100%) #171717; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #fff 100%); + box-shadow: 0px -1px #fff inset,0 -2px #ccc inset; + border-radius: none; + line-height: 2em; + font-size: 1.2rem; + text-shadow:0 1px #ccc; +} +.box.category .box-title .title { + font-weight: normal; + text-decoration: none; + text-align: left; + color: #888; +} +.box.category:not([data-unread="0"]) .box-title { +} +.box.category:not([data-unread="0"]) .box-title:active { +} +.box.category:not([data-unread="0"]) .box-title .title { + color: #222; + font-weight: bold; +} +.box.category .title:not([data-unread="0"])::after { + position: absolute; + top: 5px; right: 10px; + border: 0; + background: none; + font-weight: bold; +} +.box.category .item.feed { + padding: 2px 10px; + font-size: 0.8rem; +} +.box.category .item.feed:not(.empty):not(.error) .item-title { + color: #222; +} + +/*=== PANEL */ +/*===========*/ +#panel { + box-shadow: 0px 0px 4px #000; + border-radius: 8px; + background:#F9F7F4; +} +/*=== DIVERS */ +/*===========*/ +.aside.aside_feed .nav-form input,.aside.aside_feed .nav-form select { + width: 130px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu { + right: -20px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu::after { + right: 33px; +} + +/*=== STATISTICS */ +/*===============*/ +.stat { + margin: 10px 0 20px; +} + +.stat th, +.stat td, +.stat tr { + border: none; +} +.stat > table td, +.stat > table th { + border-bottom: 1px solid #ccc; + background: rgba(255,255,255,0.38); + box-shadow: 0 1px #fff; +} + +.stat > .horizontal-list { + margin: 0 0 5px; +} +.stat > .horizontal-list .item { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.stat > .horizontal-list .item:first-child { + width: 250px; +} + +/*=== LOGS */ +/*=========*/ +.loglist { + border: 1px solid #aaa; + border-radius: 5px; + overflow: hidden; +} +.log { + padding: 5px 10px; + background: #fafafa; + color: #333; + font-size: 0.8rem; +} +.log+.log { + border-top: 1px solid #aaa; +} +.log .date { + display: block; + font-weight: bold; +} +.log.error { + background: #fdd; + color: #844; +} +.log.warning { + background: #ffe; + color: #c95; +} +.log.notice { + background: #f4f4f4; + color: #aaa; +} +.log.debug { + background: #333; + color: #eee; +} + +#slider.active { + box-shadow: -4px 0 4px rgba(15, 15, 15, 0.55); + background: #F8F8F8; +} +#close-slider.active { + background: rgba(15, 15, 15, 0.35); +} + +/*=== MOBILE */ +/*===========*/ +@media screen and (max-width: 840px) { + .header { + display: table; + } + .nav-login { + display: none; + } + + .aside { + width: 0; + border-top: none; + box-shadow: 3px 0 3px #000; + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; + } + .aside:target { + width: 235px; + } + .aside .toggle_aside, + #panel .close { + display: block; + width: 100%; + height: 40px; + line-height: 40px; + text-align: center; + background: #171717; + box-shadow: 0 1px rgba(255,255,255,0.08); + } + .aside .btn-important { + display: inline-block; + margin: 20px 0 0; + } + + .aside.aside_feed { + padding: 0; + } + + .nav_menu .btn { + margin: 5px 10px; + } + .nav_menu .stick { + margin: 0 10px; + } + .nav_menu .stick .btn { + margin: 5px 0; + } + .nav_menu .search { + display: inline-block; + max-width: 97%; + } + .nav_menu .search input { + max-width: 97%; + width: 90px; + } + .nav_menu .search input:focus { + width: 400px; + } + + .day .name { + display: none; + } + + .pagination { + margin: 0 0 3.5em; + } + + .notification a.close { + display: block; + left: 0; + background: transparent; + } + .notification a.close:hover { + opacity: 0.5; + } + .notification a.close .icon { + display: none; + } + .nav_menu .search { + display: none; + } + + #nav_entries { + width: 100%; + } +} + +@media (max-width: 700px) { + .header{ + display: none; + } + .nav-login { + display: inline-block; + width: 100%; + } + .nav_menu .search { + display: inline-block; + } + .aside .btn-important { + display: none; + } +} diff --git a/p/themes/BlueLagoon/README.md b/p/themes/BlueLagoon/README.md new file mode 100644 index 000000000..a83dd6743 --- /dev/null +++ b/p/themes/BlueLagoon/README.md @@ -0,0 +1,38 @@ +Blue Lagoon +======= + +**C'est un cocktail (bis)! C'est la version plus "fresh" de [Screwdriver](https://github.com/misterair/Screwdriver). C'est... c'est... un thème pour l'agrégateur de flux RSS [FreshRSS](https://github.com/FreshRSS/FreshRSS/)** + + +En toute modestie, ce thème tue du Nyan Cat. + + + + +Installation +----------------- +1. Placez le dossier du thème dans ledossier /FreshRSS/p/themes/Screwdriver de votre FreshRSS; +2. Allez dans les paramètres d'Affichage et changez de thème; +3. Profitez de votre Blue Laggon sans modération! +4. Remontez les problèmes sur Github (*facultatif mais fortement apprécié*) + + + +Blue Lagoon est distribué sous license AlcoholWare: +----------------- + +« LICENCE ALCOHOLWARE » (Révision 42): + +mister.air@gmail.com a créé ce fichier. Tant que vous conservez cet avertissement, + +vous pouvez faire ce que vous voulez de ce truc. Si on se rencontre un jour et + +que vous pensez que ce truc vaut le coup, vous pouvez me payer un verre (rempli) en retour. + +*Mister aiR* + + + + + + diff --git a/p/themes/BlueLagoon/icons/bookmark.svg b/p/themes/BlueLagoon/icons/bookmark.svg new file mode 100644 index 000000000..7f33d9753 --- /dev/null +++ b/p/themes/BlueLagoon/icons/bookmark.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg"> +<g fill="#0062bf" transform="translate(-41.000202,-397)"> +<path style="color:#000000;enable-background:accumulate;" d="m530.95,186.71c-0.77941,0.55189-3.1576-1.906-4.1125-1.9179-0.95532-0.0119-3.3949,2.3858-4.161,1.8149-0.76573-0.57072,0.83698-3.592,0.55319-4.5039-0.2839-0.91223-3.3182-2.4915-3.0119-3.3965,0.30617-0.90461,3.6749-0.31399,4.4544-0.86567,0.77986-0.5519,1.3442-3.9257,2.2995-3.914,0.95494,0.0116,1.4342,3.398,2.1998,3.9689,0.76588,0.57114,4.1489,0.0653,4.4331,0.97746,0.28402,0.9118-2.7885,2.414-3.0949,3.3186-0.30652,0.90489,1.22,3.966,0.44027,4.5182z" fill-rule="nonzero" transform="matrix(1.0472113,-0.00871584,0.00871584,1.0472113,-504.35434,220.15425)" fill="#0062bf"/> +</g> +</svg> diff --git a/p/themes/BlueLagoon/icons/favicon-16-32-48-64.ico b/p/themes/BlueLagoon/icons/favicon-16-32-48-64.ico Binary files differnew file mode 100644 index 000000000..7c5eb5517 --- /dev/null +++ b/p/themes/BlueLagoon/icons/favicon-16-32-48-64.ico diff --git a/p/themes/BlueLagoon/icons/favicon-256.png b/p/themes/BlueLagoon/icons/favicon-256.png Binary files differnew file mode 100644 index 000000000..dbe4ec4b7 --- /dev/null +++ b/p/themes/BlueLagoon/icons/favicon-256.png diff --git a/p/themes/BlueLagoon/icons/favicon.svg b/p/themes/BlueLagoon/icons/favicon.svg new file mode 100644 index 000000000..1b6801a26 --- /dev/null +++ b/p/themes/BlueLagoon/icons/favicon.svg @@ -0,0 +1,32 @@ +<svg xmlns="http://www.w3.org/2000/svg"> +<defs> +<linearGradient id="linearGradient3802" y2="53.018" gradientUnits="userSpaceOnUse" x2="72.873" y1="14.64" x1="115.7"> +<stop stop-color="#0090ff" offset="0"/> +<stop stop-color="#0062be" offset="1"/> +</linearGradient> +</defs> +<g fill="#FFF" transform="matrix(1.7556028,0,0,1.7556028,2.4536682,156.92143)"> +<g transform="matrix(0.9774773,0,0,0.9774773,0.92631875,-74.208835)"> +<path d="m64.102-11.469,0,14.25c36.018,0.0418,65.198,29.235,65.218,65.259h15.189c-0.46275-43.994-36.228-79.509-80.332-79.509-0.02635,0-0.05196-0.000025-0.0783,0z"/> +<path d="m64.102,14.799,0,14.876c21.188,0.12639,38.346,17.217,38.639,38.365h15.581c-0.21-29.445-24.175-53.241-53.669-53.241-0.18468,0-0.36384-0.0019-0.54807,0z"/> +</g> +<g transform="translate(-4.1395349,-75.482558)"> +<path d="M61.077,4.2013c-32.069,3.4709-57.062,30.537-57.188,63.5h11.906c-0.001-0.13569,0-0.27032,0-0.40625,0-26.472,19.725-48.306,45.281-51.656v-11.437z"/> +<path d="m61.077,25.42c-20.105,3.4776-35.409,20.946-35.469,42.031h11.125c0.11711-14.724,10.509-27.002,24.344-30.062v-11.969z"/> +<path d="m68.171,50.108c-9.502,0-17.188,7.6855-17.188,17.188,0,9.502,7.6855,17.219,17.188,17.219,9.502,0,17.219-7.7167,17.219-17.219,0-9.502-7.7167-17.188-17.219-17.188z"/> +<path d="m98.14,74.17c-2.9607,13.954-15.281,24.445-30.094,24.562v11.656c0.12455,0.001,0.2502,0,0.375,0,21.41,0,39.173-15.697,42.344-36.219h-12.625z"/> +<path d="m119.58,74.17c-3.3587,25.459-25.062,45.157-51.406,45.281v12.656c33.284-0.0636,60.6-25.457,63.719-57.938h-12.312z"/> +</g> +</g> +<g fill="url(#linearGradient3802)" transform="matrix(1.7160619,0,0,1.7160619,5.3998589,23.251436)"> +<path d="m64.102-11.469,0,14.25c36.018,0.0418,65.198,29.235,65.218,65.259h15.189c-0.46275-43.994-36.228-79.509-80.332-79.509-0.02635,0-0.05196-0.000025-0.0783,0z"/> +<path d="m64.102,14.799,0,14.876c21.188,0.12639,38.346,17.217,38.639,38.365h15.581c-0.21-29.445-24.175-53.241-53.669-53.241-0.18468,0-0.36384-0.0019-0.54807,0z"/> +</g> +<g fill="#222" transform="matrix(1.7556028,0,0,1.7556028,-3.4937681,21.015289)"> +<path d="M61.077,4.2013c-32.069,3.4709-57.062,30.537-57.188,63.5h11.906c-0.001-0.13569,0-0.27032,0-0.40625,0-26.472,19.725-48.306,45.281-51.656v-11.437z"/> +<path d="m61.077,25.42c-20.105,3.4776-35.409,20.946-35.469,42.031h11.125c0.11711-14.724,10.509-27.002,24.344-30.062v-11.969z"/> +<path d="m68.171,50.108c-9.502,0-17.188,7.6855-17.188,17.188,0,9.502,7.6855,17.219,17.188,17.219,9.502,0,17.219-7.7167,17.219-17.219,0-9.502-7.7167-17.188-17.219-17.188z"/> +<path d="m98.14,74.17c-2.9607,13.954-15.281,24.445-30.094,24.562v11.656c0.12455,0.001,0.2502,0,0.375,0,21.41,0,39.173-15.697,42.344-36.219h-12.625z"/> +<path d="m119.58,74.17c-3.3587,25.459-25.062,45.157-51.406,45.281v12.656c33.284-0.0636,60.6-25.457,63.719-57.938h-12.312z"/> +</g> +</svg> diff --git a/p/themes/BlueLagoon/icons/icon.svg b/p/themes/BlueLagoon/icons/icon.svg new file mode 100644 index 000000000..8abfea179 --- /dev/null +++ b/p/themes/BlueLagoon/icons/icon.svg @@ -0,0 +1,34 @@ +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<defs> +<linearGradient id="linearGradient3796"> +<stop stop-color="#0090ff" offset="0"/> +<stop stop-color="#0062be" offset="1"/> +</linearGradient> +<linearGradient id="linearGradient3802" y2="53.018" xlink:href="#linearGradient3796" gradientUnits="userSpaceOnUse" x2="72.873" y1="14.64" x1="115.7"/> +</defs> +<g fill="#FFF" transform="matrix(0.41471269,0,0,0.41471269,0.4367596,36.849335)"> +<g transform="matrix(0.9774773,0,0,0.9774773,0.92631875,-74.208835)"> +<path d="m64.102-11.469,0,14.25c36.018,0.0418,65.198,29.235,65.218,65.259h15.189c-0.46275-43.994-36.228-79.509-80.332-79.509-0.02635,0-0.05196-0.000025-0.0783,0z"/> +<path d="m64.102,14.799,0,14.876c21.188,0.12639,38.346,17.217,38.639,38.365h15.581c-0.21-29.445-24.175-53.241-53.669-53.241-0.18468,0-0.36384-0.0019-0.54807,0z"/> +</g> +<g transform="translate(-4.1395349,-75.482558)"> +<path d="M61.077,4.2013c-32.069,3.4709-57.062,30.537-57.188,63.5h11.906c-0.001-0.13569,0-0.27032,0-0.40625,0-26.472,19.725-48.306,45.281-51.656v-11.437z"/> +<path d="m61.077,25.42c-20.105,3.4776-35.409,20.946-35.469,42.031h11.125c0.11711-14.724,10.509-27.002,24.344-30.062v-11.969z"/> +<path d="m68.171,50.108c-9.502,0-17.188,7.6855-17.188,17.188,0,9.502,7.6855,17.219,17.188,17.219,9.502,0,17.219-7.7167,17.219-17.219,0-9.502-7.7167-17.188-17.219-17.188z"/> +<path d="m98.14,74.17c-2.9607,13.954-15.281,24.445-30.094,24.562v11.656c0.12455,0.001,0.2502,0,0.375,0,21.41,0,39.173-15.697,42.344-36.219h-12.625z"/> +<path d="m119.58,74.17c-3.3587,25.459-25.062,45.157-51.406,45.281v12.656c33.284-0.0636,60.6-25.457,63.719-57.938h-12.312z"/> +</g> +</g> +<g fill="url(#linearGradient3802)" transform="matrix(0.40537224,0,0,0.40537224,1.1327158,5.273491)"> +<path d="m64.102-11.469,0,14.25c36.018,0.0418,65.198,29.235,65.218,65.259h15.189c-0.46275-43.994-36.228-79.509-80.332-79.509-0.02635,0-0.05196-0.000025-0.0783,0z"/> +<path d="m64.102,14.799,0,14.876c21.188,0.12639,38.346,17.217,38.639,38.365h15.581c-0.21-29.445-24.175-53.241-53.669-53.241-0.18468,0-0.36384-0.0019-0.54807,0z"/> +</g> +<g fill="#222" transform="matrix(0.41471269,0,0,0.41471269,-0.96815804,4.7452623)"> +<path d="M61.077,4.2013c-32.069,3.4709-57.062,30.537-57.188,63.5h11.906c-0.001-0.13569,0-0.27032,0-0.40625,0-26.472,19.725-48.306,45.281-51.656v-11.437z"/> +<path d="m61.077,25.42c-20.105,3.4776-35.409,20.946-35.469,42.031h11.125c0.11711-14.724,10.509-27.002,24.344-30.062v-11.969z"/> +<path d="m68.171,50.108c-9.502,0-17.188,7.6855-17.188,17.188,0,9.502,7.6855,17.219,17.188,17.219,9.502,0,17.219-7.7167,17.219-17.219,0-9.502-7.7167-17.188-17.219-17.188z"/> +<path d="m98.14,74.17c-2.9607,13.954-15.281,24.445-30.094,24.562v11.656c0.12455,0.001,0.2502,0,0.375,0,21.41,0,39.173-15.697,42.344-36.219h-12.625z"/> +<path d="m119.58,74.17c-3.3587,25.459-25.062,45.157-51.406,45.281v12.656c33.284-0.0636,60.6-25.457,63.719-57.938h-12.312z"/> +</g> +</svg> diff --git a/p/themes/BlueLagoon/icons/non-starred.svg b/p/themes/BlueLagoon/icons/non-starred.svg new file mode 100644 index 000000000..d5c1f5ee0 --- /dev/null +++ b/p/themes/BlueLagoon/icons/non-starred.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg"> +<g fill="#666" transform="translate(-61.000202,-397)"> +<path style="direction:ltr;baseline-shift:baseline;block-progression:tb;text-indent:0;color:#000000;enable-background:accumulate;text-transform:none;text-align:start;" d="m69.003,398.01c-0.2659-0.00099-0.49859,0.1006-0.6647,0.2393-0.16611,0.13869-0.27742,0.32137-0.38968,0.50028-0.22453,0.35782-0.39269,0.76873-0.56546,1.2036-0.17277,0.43483-0.34713,0.88766-0.5046,1.2323-0.15747,0.34465-0.3456,0.57871-0.35862,0.58776-0.01287,0.009-0.30722,0.117-0.69576,0.15181-0.38855,0.0348-0.88122,0.0492-1.3632,0.0694-0.48202,0.0202-0.9703,0.0362-1.393,0.12817-0.21138,0.046-0.4154,0.10148-0.60434,0.20956s-0.36689,0.28631-0.45004,0.53002-0.04901,0.50627,0.03636,0.70157c0.08537,0.19531,0.22656,0.36514,0.3682,0.52344,0.2833,0.31663,0.6327,0.60557,1.0079,0.89849s0.77671,0.55926,1.0678,0.81027c0.29104,0.25101,0.45422,0.50796,0.45912,0.52271,0.0048,0.0146,0.03119,0.33498-0.05456,0.70231-0.08575,0.36732-0.2238,0.81174-0.35282,1.2603-0.12902,0.44861-0.25176,0.90196-0.2917,1.3184-0.01997,0.20819-0.04285,0.40729,0.0053,0.61409,0.04814,0.20679,0.1845,0.43007,0.39902,0.58168,0.21451,0.15161,0.44936,0.1881,0.66823,0.1701s0.43535-0.0703,0.63515-0.15132c0.39961-0.16214,0.80177-0.42851,1.2064-0.68231,0.40465-0.2538,0.80822-0.52155,1.1456-0.71107,0.33734-0.18952,0.6484-0.2686,0.66445-0.26854,0.01586,0.00006,0.30338,0.0951,0.63894,0.28732,0.33556,0.19221,0.72532,0.46503,1.1276,0.72205,0.40229,0.25702,0.81996,0.49752,1.218,0.66284,0.19903,0.0827,0.38893,0.15086,0.60762,0.17059,0.2187,0.0197,0.47978-0.031,0.69551-0.18105,0.21572-0.15001,0.33928-0.35235,0.38918-0.55877s0.04291-0.43517,0.02476-0.64358c-0.03632-0.41683-0.15899-0.86394-0.2841-1.3137-0.12511-0.44978-0.26165-0.88661-0.34421-1.2548-0.08256-0.36813-0.07169-0.68662-0.06666-0.70133,0.005-0.0145,0.18746-0.25247,0.4806-0.50101,0.29313-0.24854,0.67599-0.53755,1.0536-0.82731,0.37764-0.28976,0.76716-0.57158,1.0531-0.88579,0.14298-0.1571,0.2418-0.33444,0.32882-0.52904s0.136-0.42874,0.05481-0.67306-0.27108-0.41314-0.45912-0.52272-0.36679-0.18158-0.57782-0.22931c-0.42206-0.0955-0.91359-0.14009-1.3956-0.16426-0.48198-0.0242-0.94584-0.039-1.3342-0.077s-0.71565-0.13122-0.72859-0.14037c-0.01279-0.009-0.18402-0.23636-0.3384-0.58217s-0.32658-0.78819-0.49548-1.2243c-0.1689-0.4361-0.33477-0.86429-0.55609-1.2238-0.11067-0.17977-0.23335-0.35397-0.39826-0.49396s-0.40309-0.25684-0.66899-0.25783zm0.0086,0.99424c0.0422,0.0358,0.10671,0.13602,0.1841,0.26173,0.15477,0.25141,0.33068,0.6272,0.49397,1.0488,0.16329,0.42163,0.31905,0.88645,0.49598,1.2828,0.17693,0.39633,0.31456,0.73379,0.6753,0.98889,0.36072,0.25509,0.77019,0.29763,1.2152,0.34118,0.44506,0.0435,0.92882,0.0532,1.3948,0.0765,0.46599,0.0234,0.91824,0.0697,1.2135,0.13647,0.14763,0.0334,0.25558,0.0572,0.30381,0.0853-0.02227,0.0498-0.07958,0.15478-0.17956,0.26464-0.19997,0.21973-0.53749,0.48746-0.90261,0.7676-0.36511,0.28015-0.77804,0.57219-1.114,0.85704-0.33595,0.28485-0.63992,0.53221-0.77987,0.94209-0.13995,0.40986-0.05396,0.77681,0.04065,1.1987s0.25406,0.87813,0.37502,1.313c0.12096,0.43486,0.22688,0.84692,0.25228,1.1385,0.01156,0.13264-0.01699,0.23485-0.02778,0.29267-0.05993-0.008-0.1764-0.0324-0.30381-0.0853-0.27836-0.11561-0.64649-0.32808-1.0354-0.57657-0.38894-0.24849-0.8039-0.53053-1.1885-0.75081-0.38457-0.22028-0.70791-0.39837-1.1551-0.40015-0.44722-0.002-0.79205,0.17245-1.1786,0.38965-0.38659,0.21719-0.78438,0.49517-1.1756,0.74055-0.39123,0.24538-0.77636,0.4507-1.0559,0.56412-0.13977,0.0567-0.24616,0.0856-0.3023,0.0902-0.01026-0.0578-0.01522-0.16008-0.0025-0.29243,0.02793-0.29118,0.13818-0.70893,0.26291-1.1426,0.12473-0.43372,0.25404-0.89785,0.35232-1.3188,0.09828-0.42099,0.18672-0.78846,0.05027-1.1994-0.13644-0.41097-0.43218-0.64202-0.76571-0.92967-0.33353-0.28766-0.70551-0.58555-1.0683-0.86876-0.36275-0.2832-0.7178-0.56075-0.91597-0.78224-0.09908-0.11075-0.16221-0.21163-0.1841-0.26173,0.04834-0.0276,0.15448-0.058,0.3023-0.0902,0.29562-0.0643,0.74518-0.10714,1.2112-0.1267,0.46603-0.0196,0.94824-0.0298,1.3935-0.0697,0.44531-0.0399,0.84679-0.0499,1.2097-0.30216,0.36289-0.25221,0.5383-0.60511,0.71876-1.0001,0.18046-0.39497,0.33731-0.84115,0.50435-1.2616,0.16704-0.42041,0.31848-0.83556,0.47556-1.0859,0.07853-0.12515,0.16751-0.20007,0.21012-0.23565z" fill="#666"/> +</g> +</svg> diff --git a/p/themes/BlueLagoon/icons/read.svg b/p/themes/BlueLagoon/icons/read.svg new file mode 100644 index 000000000..269b75738 --- /dev/null +++ b/p/themes/BlueLagoon/icons/read.svg @@ -0,0 +1,4 @@ +<svg xmlns="http://www.w3.org/2000/svg"> +<path fill="#666" d="M7.9688,3.5312c-3.434,0-6.3812,1.9854-7.8438,4.9063,0.69719,1.3923,1.7293,2.5805,3,3.4375l1.0625-1.063c-0.0318-0.019-0.0622-0.042-0.0937-0.062-0.9251-0.59-1.6925-1.3818-2.2813-2.3125,0.5888-0.9307,1.3562-1.7225,2.2813-2.3125,0.0602-0.0384,0.1262-0.0572,0.1874-0.0938-0.1531,0.4203-0.25,0.8706-0.25,1.3438,0,0.9994,0.3864,1.8995,1,2.5938l1.6563-1.6563c-0.0596,0.0073-0.126,0.0313-0.1875,0.0313-0.8153,0-1.4688-0.6535-1.4688-1.4688s0.6535-1.4688,1.4688-1.4688,1.4688,0.6535,1.4688,1.4688c0,0.0615-0.024,0.1279-0.0313,0.1875l3.0005-3c-0.926-0.3356-1.9313-0.5313-2.9692-0.5313zm5.9692,2.3438l-1.063,1.0625c0.486,0.4467,0.925,0.9377,1.281,1.5-0.589,0.9306-1.356,1.7225-2.281,2.3125-1.162,0.741-2.5291,1.156-3.9062,1.156h-0.0626l-1.3437,1.344c0.4628,0.076,0.9224,0.125,1.4063,0.125,3.4342,0,6.4122-2.017,7.8752-4.9375-0.486-0.9691-1.127-1.8356-1.906-2.5625zm-2.063,2.0625l-3.3125,3.3125c1.7095-0.254,3.0625-1.6016,3.3125-3.3125z"/> +<path d="M2.4921,13.891,13.301,3.0128,15.437,2.9605,4.3409,13.891z" fill="#666"/> +</svg> diff --git a/p/themes/BlueLagoon/icons/starred.svg b/p/themes/BlueLagoon/icons/starred.svg new file mode 100644 index 000000000..10a16f04a --- /dev/null +++ b/p/themes/BlueLagoon/icons/starred.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg"> +<g transform="translate(-41.000202,-397)"> +<path style="color:#000000;enable-background:accumulate;" d="m530.95,186.71c-0.77941,0.55189-3.1576-1.906-4.1125-1.9179-0.95532-0.0119-3.3949,2.3858-4.161,1.8149-0.76573-0.57072,0.83698-3.592,0.55319-4.5039-0.2839-0.91223-3.3182-2.4915-3.0119-3.3965,0.30617-0.90461,3.6749-0.31399,4.4544-0.86567,0.77986-0.5519,1.3442-3.9257,2.2995-3.914,0.95494,0.0116,1.4342,3.398,2.1998,3.9689,0.76588,0.57114,4.1489,0.0653,4.4331,0.97746,0.28402,0.9118-2.7885,2.414-3.0949,3.3186-0.30652,0.90489,1.22,3.966,0.44027,4.5182z" fill-rule="nonzero" transform="matrix(1.0472113,-0.00871584,0.00871584,1.0472113,-504.35434,220.15425)" fill="#0062bf"/> +</g> +</svg> diff --git a/p/themes/BlueLagoon/icons/unread.svg b/p/themes/BlueLagoon/icons/unread.svg new file mode 100644 index 000000000..bd39d683a --- /dev/null +++ b/p/themes/BlueLagoon/icons/unread.svg @@ -0,0 +1,3 @@ +<svg xmlns="http://www.w3.org/2000/svg"> +<path fill="#666" d="m7.9824,3.529c-3.4339,0-6.4103,1.9996-7.8729,4.9206,1.4626,2.9214,4.439,4.9204,7.8729,4.9204,3.4338,0,6.4102-1.9996,7.8729-4.9206-1.462-2.9207-4.439-4.9204-7.8726-4.9204zm3.8819,2.6095c0.9251,0.59007,1.709,1.3804,2.2978,2.3111-0.58881,0.93063-1.3727,1.721-2.2978,2.3111-1.1624,0.7414-2.5047,1.1333-3.8818,1.1333s-2.7195-0.39189-3.8819-1.1333c-0.9248-0.59-1.7087-1.3807-2.2975-2.3114,0.5888-0.9307,1.3727-1.721,2.2978-2.3111,0.0602-0.0384,0.1211-0.0757,0.1823-0.1122-0.15312,0.42021-0.23692,0.87374-0.23692,1.3469,0,2.174,1.7624,3.9364,3.9365,3.9364,2.174,0,3.9365-1.7624,3.9365-3.9364,0-0.4732-0.0838-0.92673-0.23692-1.347,0.0612,0.036566,0.12206,0.073839,0.18234,0.11228zm-3.8816,0.7427c0,0.81528-0.66089,1.4762-1.4762,1.4762-0.81528,0-1.4762-0.66089-1.4762-1.4762,0-0.81528,0.66089-1.4762,1.4762-1.4762,0.81527,0,1.4762,0.66089,1.4762,1.4762z"/> +</svg> diff --git a/p/themes/BlueLagoon/loader.gif b/p/themes/BlueLagoon/loader.gif Binary files differnew file mode 100644 index 000000000..a0839dcc7 --- /dev/null +++ b/p/themes/BlueLagoon/loader.gif diff --git a/p/themes/BlueLagoon/metadata.json b/p/themes/BlueLagoon/metadata.json new file mode 100644 index 000000000..2c415a613 --- /dev/null +++ b/p/themes/BlueLagoon/metadata.json @@ -0,0 +1,7 @@ +{ + "name": "Blue Lagoon", + "author": "Mister aiR", + "description": "C'est un cocktail (bis)! C'est la version plus fresh de Screwdriver. C'est... c'est... un thème pour l'agrégateur de flux RSS FreshRSS. En toute modestie, ce thème tue du Nyan Cat.", + "version": 1.0, + "files": ["_template.css","BlueLagoon.css"] +} diff --git a/p/themes/BlueLagoon/template.css b/p/themes/BlueLagoon/template.css new file mode 100644 index 000000000..8c1a4ed21 --- /dev/null +++ b/p/themes/BlueLagoon/template.css @@ -0,0 +1,695 @@ +@charset "UTF-8"; + +/*=== GENERAL */ +/*============*/ +html, body { + margin: 0; + padding: 0; + font-size: 92%; +} + +/*=== Links */ +a { + text-decoration: none; +} +a:hover { + text-decoration: underline; +} + +/*=== Lists */ +ul, ol, dd { + margin: 0; + padding: 0; +} + +/*=== Titles */ +h1 { + margin: 0.6em 0 0.3em; + font-size: 1.5em; + line-height: 1.6em; +} +h2 { + margin: 0.5em 0 0.25em; + font-size: 1.3em; + line-height: 2em; +} +h3 { + margin: 0.5em 0 0.25em; + font-size: 1.1em; + line-height: 2em; +} + +/*=== Paragraphs */ +p { + margin: 1em 0 0.5em; + font-size: 1em; +} + +/*=== Images */ +img { + height: auto; + max-width: 100%; +} +img.favicon { + height: 16px; + width: 16px; + vertical-align: middle; +} + +/*=== Videos */ +iframe, embed, object, video { + max-width: 100%; +} + +/*=== Forms */ +legend { + display: block; + width: 100%; + clear: both; +} +label { + display: block; +} +input { + width: 180px; +} +textarea { + width: 300px; +} +input, select, textarea { + display: inline-block; + max-width: 100%; +} +input[type="radio"], +input[type="checkbox"] { + width: 15px !important; + min-height: 15px !important; +} +input.extend:focus { + width: 300px; +} + +/*=== COMPONENTS */ +/*===============*/ +/*=== Forms */ +.form-group::after { + content: ""; + display: block; + clear: both; +} +.form-group.form-actions { + min-width: 250px; +} +.form-group .group-name { + display: block; + float: left; + width: 200px; +} +.form-group .group-controls { + min-width: 250px; + margin: 0 0 0 220px; +} +.form-group .group-controls .control { + display: block; +} + +/*=== Buttons */ +.stick { + display: inline-block; + white-space: nowrap; +} +.btn, +a.btn { + display: inline-block; + cursor: pointer; + overflow: hidden; +} +.btn-important { + font-weight: bold; +} + +/*=== Navigation */ +.nav-list .nav-header, +.nav-list .item { + display: block; +} +.nav-list .item, +.nav-list .item > a { + display: block; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.nav-head { + display: block; +} +.nav-head .item { + display: inline-block; +} + +/*=== Horizontal-list */ +.horizontal-list { + display: table; + table-layout: fixed; + width: 100%; +} +.horizontal-list .item { + display: table-cell; +} + +/*=== Dropdown */ +.dropdown { + position: relative; + display: inline-block; +} +.dropdown-target { + display: none; +} +.dropdown-menu { + display: none; + min-width: 200px; + margin: 0; + position: absolute; + right: 0; + background: #fff; + border: 1px solid #aaa; +} +.dropdown-header { + display: block; +} +.dropdown-menu > .item { + display: block; +} +.dropdown-menu > .item > a, +.dropdown-menu > .item > span { + display: block; +} +.dropdown-menu > .item[aria-checked="true"] > a::before { + content: '✓'; +} +.dropdown-menu .input { + display: block; +} +.dropdown-menu .input select, +.dropdown-menu .input input { + display: block; + max-width: 95%; +} +.dropdown-target:target ~ .dropdown-menu { + display: block; + z-index: 10; +} +.dropdown-close { + display: inline; +} +.dropdown-close a { + font-size: 0; + position: fixed; + top: 0; bottom: 0; + left: 0; right: 0; + display: block; + z-index: -10; +} +.separator { + display: block; + height: 0; + border-bottom: 1px solid #aaa; +} + +/*=== Alerts */ +.alert { + display: block; + width: 90%; +} +.group-controls .alert { + width: 100% +} +.alert-head { + margin: 0; + font-weight: bold; +} +.alert ul { + margin: 5px 20px; +} + +/*=== Icons */ +.icon { + display: inline-block; + width: 16px; + height: 16px; + vertical-align: middle; + line-height: 16px; +} + +/*=== Pagination */ +.pagination { + display: table; + width: 100%; + margin: 0; + padding: 0; + table-layout: fixed; +} +.pagination .item { + display: table-cell; +} +.pagination .pager-first, +.pagination .pager-previous, +.pagination .pager-next, +.pagination .pager-last { + width: 100px; +} + +/*=== STRUCTURE */ +/*===============*/ +/*=== Header */ +.header { + display: table; + width: 100%; + table-layout: fixed; +} +.header > .item { + display: table-cell; +} +.header > .item.title { + width: 250px; + white-space: nowrap; +} +.header > .item.title h1 { + display: inline-block; +} +.header > .item.title .logo { + display: inline-block; + height: 32px; + width: 32px; + vertical-align: middle; +} +.header > .item.configure { + width: 100px; +} + +/*=== Body */ +#global { + display: table; + width: 100%; + height: 100%; + table-layout: fixed; +} +.aside { + display: table-cell; + height: 100%; + width: 250px; + vertical-align: top; +} +.aside.aside_flux { + background: #fff; +} + +/*=== Aside main page (categories) */ +.categories { + list-style: none; + margin: 0; +} +.category { + display: block; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.category .btn:not([data-unread="0"])::after { + content: attr(data-unread); +} + +/*=== Aside main page (feeds) */ +.categories .feeds { + width: 100%; + list-style: none; +} +.categories .feeds:not(.active) { + display: none; +} +.categories .feeds .feed { + display: inline-block; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + vertical-align: middle; +} +.categories .feeds .feed:not([data-unread="0"])::before { + content: "(" attr(data-unread) ") "; +} +.categories .feeds .dropdown-menu { + left: 0; +} +.categories .feeds .item .dropdown-toggle > .icon { + visibility: hidden; + cursor: pointer; + vertical-align: top; +} +.categories .feeds .item .dropdown-target:target ~ .dropdown-toggle > .icon, +.categories .feeds .item:hover .dropdown-toggle > .icon, +.categories .feeds .item.active .dropdown-toggle > .icon { + visibility: visible; +} + +/*=== New article notification */ +#new-article { + display: none; +} +#new-article > a { + display: block; +} + +/*=== Day indication */ +.day .name { + position: absolute; + right: 0; + width: 50%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +/*=== Feed article header and footer */ +.flux_header { + position: relative; +} +.flux .item { + line-height: 40px; + white-space: nowrap; +} +.flux .item.manage, +.flux .item.link { + width: 40px; + text-align: center; +} +.flux .item.website { + width: 200px; +} +.flux.not_read .item.title, +.flux.current .item.title { + font-weight: bold; +} +.flux:not(.current):hover .item.title { + position: absolute; + max-width: calc(100% - 320px); + background: #fff; +} +.flux .item.title a { + color: #000; + text-decoration: none; +} +.flux .item.date { + width: 145px; + text-align: right; +} +.flux .item > a { + display: block; +} +.flux .item > a { + display: block; + text-decoration: none; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.flux .item.share > a { + display: list-item; + list-style-position: inside; + list-style-type: decimal; +} + +/*=== Feed article content */ +.hide_posts > .flux:not(.active) > .flux_content { + display: none; +} +.content { + min-height: 20em; + margin: auto; + line-height: 1.7em; + word-wrap: break-word; +} +.content.large { + max-width: 1000px; +} +.content.medium { + max-width: 800px; +} +.content.thin { + max-width: 550px; +} +.content ul, +.content ol, +.content dd { + margin: 0 0 0 15px; + padding: 0 0 5px 15px; +} +.content pre { + overflow: auto; +} + +/*=== Notification and actualize notification */ +.notification { + position: absolute; + top: 1em; + left: 25%; right: 25%; + z-index: 10; + background: #fff; + border: 1px solid #aaa; +} +.notification.closed { + display: none; +} +.notification a.close { + position: absolute; + top: 0; bottom: 0; + right: 0; + display: inline-block; +} + +#actualizeProgress { + position: fixed; +} +#actualizeProgress progress { + max-width: 100%; + vertical-align: middle; +} +#actualizeProgress .progress { + vertical-align: middle; +} + +/*=== Navigation menu (for articles) */ +#nav_entries { + position: fixed; + bottom: 0; left: 0; + display: table; + width: 250px; + background: #fff; + table-layout: fixed; +} +#nav_entries .item { + display: table-cell; + width: 30%; +} +#nav_entries a { + display: block; +} + +/*=== "Load more" part */ +#load_more { + min-height: 40px; +} +.loading { + background: url("loader.gif") center center no-repeat; + font-size: 0; +} +#bigMarkAsRead { + display: block; + padding: 3em 0; + text-align: center; +} +.bigTick { + font-size: 7em; + line-height: 1.6em; +} + +/*=== Statistiques */ +.stat > table { + width: 100%; +} + +/*=== GLOBAL VIEW */ +/*================*/ +/*=== Category boxes */ +#stream.global .box-category { + display: inline-block; + width: 19em; + max-width: 95%; + margin: 20px 10px; + border: 1px solid #ccc; + vertical-align: top; +} +#stream.global .category { + width: 100%; +} +#stream.global .btn { + display: block; +} +#stream.global .box-category .feeds { + display: block; + overflow: auto; +} +#stream.global .box-category .feed { + width: 19em; + max-width: 90%; +} + +/*=== Panel */ +#overlay { + display: none; + position: fixed; + top: 0; bottom: 0; + left: 0; right: 0; + background: rgba(0, 0, 0, 0.9); +} +#panel { + display: none; + position: fixed; + top: 1em; bottom: 1em; + left: 2em; right: 2em; + overflow: auto; + background: #fff; +} +#panel .close { + position: fixed; + top: 0; bottom: 0; + left: 0; right: 0; + display: block; +} +#panel .close img { + display: none; +} + +/*=== DIVERS */ +/*===========*/ +.nav-login, +.nav_menu .search, +.nav_menu .toggle_aside { + display: none; +} + +.aside .toggle_aside { + position: absolute; + right: 0; + display: none; + width: 30px; + height: 30px; + line-height: 30px; + text-align: center; +} + +/*=== MOBILE */ +/*===========*/ +@media(max-width: 840px) { + .header, + .aside .btn-important, + .aside .feeds .dropdown, + .flux_header .item.website span, + .item.date, .day .date, + .dropdown-menu > .no-mobile, + .no-mobile { + display: none; + } + .nav-login { + display: block; + } + .nav_menu .toggle_aside, + .aside .toggle_aside, + .nav_menu .search, + #panel .close img { + display: inline-block; + } + + .aside { + position: fixed; + top: 0; bottom: 0; + left: 0; + width: 0; + overflow: hidden; + z-index: 100; + } + .aside:target { + width: 90%; + overflow: auto; + } + .aside .categories { + margin: 10px 0 75px; + } + + .flux_header .item.website { + width: 40px; + } + + .flux:not(.current):hover .item.title { + position: relative; + width: auto; + white-space: nowrap; + } + + .notification { + top: 0; + left: 0; + right: 0; + } + + #nav_entries { + width: 100%; + } + + #stream.global .box-category { + margin: 10px 0; + } + + #panel { + top: 0; bottom: 0; + left: 0; right: 0; + } + #panel .close { + top: 0; right: 0; + left: auto; bottom: auto; + display: inline-block; + width: 30px; + height: 30px; + } +} + +/*=== PRINTER */ +/*============*/ +@media print { + .header, .aside, + .nav_menu, .day, + .flux_header, + .flux_content .bottom, + .pagination, + #nav_entries { + display: none; + } + html, body { + background: #fff; + color: #000; + font-family: Serif; + } + #global, + .flux_content { + display: block !important; + } + .flux_content .content { + width: 100% !important; + } + .flux_content .content a { + color: #000; + } + .flux_content .content a::after { + content: " [" attr(href) "] "; + font-style: italic; + } +} diff --git a/p/themes/BlueLagoon/thumbs/original.png b/p/themes/BlueLagoon/thumbs/original.png Binary files differnew file mode 100644 index 000000000..bb8695945 --- /dev/null +++ b/p/themes/BlueLagoon/thumbs/original.png diff --git a/p/themes/Dark/dark.css b/p/themes/Dark/dark.css new file mode 100644 index 000000000..f72ed8b5b --- /dev/null +++ b/p/themes/Dark/dark.css @@ -0,0 +1,1035 @@ +@charset "UTF-8"; + +/*=== FONTS */ +@font-face { + font-family: "OpenSans"; + src: url("../fonts/openSans.woff") format("woff"); +} + +/*=== GENERAL */ +/*============*/ +html, body { + height: 100%; + font-family: "OpenSans", "Cantarell", "Helvetica", "Arial", sans-serif; + background: #1c1c1c; + color: #888; +} + +/*=== Links */ +a, button.as-link { + color: #6986B2; + outline: none; +} + +/*=== Images */ +img.favicon { + background: #fff; + border-radius: 2px; +} + +/*=== Forms */ +legend { + margin: 20px 0 5px; + padding: 5px 0; + font-size: 1.4em; + border-bottom: 1px solid #2f2f2f; +} +label { + min-height: 25px; + padding: 5px 0; + cursor: pointer; +} +textarea { + width: 360px; + height: 100px; +} +input, select, textarea { + min-height: 25px; + padding: 5px; + line-height: 25px; + vertical-align: middle; + background: #333; + border: 1px solid #000; + border-radius: 3px; + color: #999; + box-shadow: 0 2px 2px #1d1d1d inset; +} +option { + padding: 0 .5em; +} +input:focus, select:focus, textarea:focus { + color: #6986b2; + border-color: #2f2f2f; +} +input:invalid, select:invalid { + border-color: #f00; + box-shadow: 0 0 2px 1px #f00; +} +input:disabled, select:disabled { + background: #666; + color: #aaa; +} +input.extend { + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; +} + +/*=== Tables */ +table { + border-collapse: collapse; +} + +tr, th, td { + padding: 0.5em; + border: 1px solid #333; +} +th { + background: #222; +} +form td, +form th { + font-weight: normal; + text-align: center; +} + +/*=== COMPONENTS */ +/*===============*/ +/*=== Forms */ +.form-group.form-actions { + padding: 5px 0; + background: #1a1a1a; + border-top: 1px solid #2f2f2f; +} +.form-group.form-actions .btn { + margin: 0 10px; +} +.form-group .group-name { + padding: 10px 0; + text-align: right; +} +.form-group .group-controls { + min-height: 25px; + padding: 5px 0; +} +.form-group table { + margin: 10px 0 0 220px; +} + +/*=== Buttons */ +.stick { + vertical-align: middle; + font-size: 0; +} +.stick input, +.stick .btn { + border-radius: 0; +} +.stick .btn:first-child, +.stick input:first-child { + border-radius: 3px 0 0 3px; +} +.stick .btn-important:first-child { + border-right: 1px solid #000; +} +.stick .btn:last-child, +.stick input:last-child { + border-radius: 0 3px 3px 0; +} +.stick .btn + .btn, +.stick .btn + input, +.stick .btn + .dropdown > .btn, +.stick input + .btn, +.stick input + input, +.stick input + .dropdown > .btn, +.stick .dropdown + .btn, +.stick .dropdown + input, +.stick .dropdown + .dropdown > .btn { + border-left: none; +} +.stick input:focus+input { + border-left: 1px solid #000; +} +.stick input+input:focus { + border-left: 1px solid #333; +} +.stick .btn + .dropdown > .btn { + border-left: none; + border-radius: 0 3px 3px 0; +} + +.btn { + display: inline-block; + min-height: 37px; + min-width: 15px; + margin: 0; + padding: 5px 10px; + font-size: 0.9rem; + vertical-align: middle; + cursor: pointer; + overflow: hidden; + background: #111; + border-radius: 3px; + border: 1px solid #000; + color: #888; +} +a.btn { + min-height: 25px; + line-height: 25px; +} +.btn:hover { + text-decoration: none; + background: -moz-linear-gradient(top, #4A5D7A 0%, #26303F 100%); + background: -moz-linear-gradient(top, #4A5D7A 0%, #26303F 100%); + background: -webkit-linear-gradient(top, #4A5D7A 0%, #26303F 100%); + background: -o-linear-gradient(top, #4A5D7A 0%, #26303F 100%); + background: -ms-linear-gradient(top, #4A5D7A 0%, #26303F 100%); +} +.btn.active, +.dropdown-target:target ~ .btn.dropdown-toggle { + background: #333; +} +.btn:active { + background: #26303F; +} + +.btn-important { + font-weight: normal; + background: #26303F; +} +.btn-important:hover { + background: linear-gradient(top, #4A5D7A 0%, #26303F 100%); + background: -moz-linear-gradient(top, #4A5D7A 0%, #26303F 100%); + background: -webkit-linear-gradient(top, #4A5D7A 0%, #26303F 100%); + background: -o-linear-gradient(top, #4A5D7A 0%, #26303F 100%); + background: -ms-linear-gradient(top, #4A5D7A 0%, #26303F 100%); +} +.btn-important:active { + background: #26303F; +} + +.btn-attention { + background: #880011; +} +.btn-attention:hover { + background: linear-gradient(top, #cc0044 0%, #880011 100%); + background: -moz-linear-gradient(top, #cc0044 0%, #880011 100%); + background: -webkit-linear-gradient(top, #cc0044 0%, #880011 100%); + background: -o-linear-gradient(top, #cc0044 0%, #880011 100%); + background: -ms-linear-gradient(top, #cc0044 0%, #880011 100%); +} +.btn-attention:active { + background: #880011; +} + +/*=== Navigation */ +.nav-list .nav-header, +.nav-list .item { + height: 2.5em; + line-height: 2.5em; + font-size: 0.9rem; +} +.nav-list .item:hover { + background: #26303F; +} +.nav-list .item.active { + background: #333; +} +.nav-list .item:hover a, +.nav-list .item.active a { + color: #888; +} +.nav-list .disable { + text-align: center; + color: #aaa; + background: #fafafa; +} +.nav-list .item > a { + padding: 0 10px; +} +.nav-list a:hover { + text-decoration: none; +} +.nav-list .item.empty a { + color: #c95; +} +.nav-list .item:hover.empty a, +.nav-list .item.active.empty a { + color: #fff; + background: #c95; +} +.nav-list .item.error a { + color: #a44; +} +.nav-list .item:hover.error a, +.nav-list .item.active.error a { + color: #fff; + background: #a44; +} + +.nav-list .nav-header { + padding: 0 10px; + font-weight: bold; + background: #111; + border-bottom: 1px solid #333; +} + +.nav-list .nav-form { + padding: 3px; + text-align: center; +} + +.nav-head { + margin: 0; + text-align: right; + background: #1c1c1c; + border-bottom: 1px solid #333; +} +.nav-head .item { + padding: 5px 10px; + font-size: 0.9rem; + line-height: 1.5rem; +} + +/*=== Horizontal-list */ +.horizontal-list { + margin: 0; + padding: 0; +} +.horizontal-list .item { + vertical-align: middle; +} + +/*=== Dropdown */ +.dropdown-menu { + margin: 5px 0 0; + padding: 5px 0; + font-size: 0.8rem; + text-align: left; + background: #1a1a1a; + border: 1px solid #888; + border-radius: 5px; +} +.dropdown-menu::after { + content: ""; + position: absolute; + top: -6px; + right: 13px; + width: 10px; + height: 10px; + z-index: -10; + transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + background: #1a1a1a; + border-top: 1px solid #888; + border-left: 1px solid #888; +} +.dropdown-header { + padding: 0 5px 5px; + font-weight: bold; + text-align: left; + color: #888; +} +.dropdown-menu > .item > a { + padding: 0 25px; + line-height: 2.5em; +} +.dropdown-menu > .item > span, +.dropdown-menu > .item > .as-link { + padding: 0 22px; + line-height: 2em; +} +.dropdown-menu > .item:hover { + background: #26303F; + color: #888; +} +.dropdown-menu > .item[aria-checked="true"] > a::before { + font-weight: bold; + margin: 0 0 0 -14px; +} +.dropdown-menu > .item:hover > a { + text-decoration: none; + color: #888; +} +.dropdown-menu .input select, +.dropdown-menu .input input { + margin: 0 auto 5px; + padding: 2px 5px; + border-radius: 3px; +} + +.separator { + margin: 5px 0; + border-bottom: 1px solid #333; +} + +/*=== Alerts */ +.alert { + margin: 15px auto; + padding: 10px 15px; + font-size: 0.9em; + background: #111; + border: 1px solid #888; + border-radius: 5px; + color: #aaa; +} +.alert-head { + font-size: 1.15em; +} +.alert > a { + text-decoration: underline; + color: inherit; +} +.alert-warn { + border: 1px solid #c95; + color: #c95; +} +.alert-success { + border: 1px solid #484; + color: #484; +} +.alert-error { + border: 1px solid #a44; + color: #a44; +} + +/*=== Pagination */ +.pagination { + text-align: center; + font-size: 0.8em; + background: #1c1c1c; + color: #888; +} +.content .pagination { + margin: 0; + padding: 0; +} +.pagination .item.pager-current { + font-weight: bold; + font-size: 1.5em; + background: #111; +} +.pagination .item a { + display: block; + font-style: italic; + line-height: 3em; + text-decoration: none; + color: #666; +} +.pagination .item a:hover { + background-color: #111; +} +.pagination:first-child .item { + border-bottom: 1px solid #333; +} +.pagination:last-child .item { + border-top: 1px solid #333; +} + +.pagination .loading, +.pagination a:hover.loading { + font-size: 0; +} + +/*=== Boxes */ +.box { + border: 1px solid #000; + border-radius: 5px; +} +.box .box-title { + margin: 0; + padding: 5px 10px; + background: #26303F; + border-bottom: 1px solid #000; + border-radius: 5px 5px 0 0; +} +.box .box-content { + max-height: 260px; +} + +.box .box-content .item { + padding: 0 10px; + font-size: 0.9rem; + line-height: 2.5em; +} + +.box .box-content .item .configure { + visibility: hidden; +} +.box .box-content .item:hover .configure { + visibility: visible; +} + +/*=== Tree */ +.tree { + margin: 10px 0; +} +.tree-folder-title { + position: relative; + padding: 0 10px; + line-height: 2.5rem; + font-size: 1rem; + background: #1c1c1c; +} +.tree-folder-title .title { + background: inherit; + color: #888; +} +.tree-folder-title .title:hover { + text-decoration: none; +} +.tree-folder.active .tree-folder-title { + background: #2c2c2c; + font-weight: bold; +} +.tree-folder-items { + border-top: 1px solid #222; + border-bottom: 1px solid #222; + background: #161616; +} +.tree-folder-items > .item { + padding: 0 10px; + line-height: 2.5rem; + font-size: 0.8rem; +} +.tree-folder-items > .item.active { + background: #1c1c1c; +} +.tree-folder-items > .item > a { + text-decoration: none; +} +.tree-folder-items > .item.active > a { + color: #888; +} + +/*=== STRUCTURE */ +/*===============*/ +/*=== Header */ +.header { + height: 85px; +} +.header > .item { + padding: 10px; + vertical-align: middle; + text-align: center; + border-bottom: 1px solid #333; +} +.header > .item.title{ + width: 230px; +} +.header > .item.title h1 { + margin: 0.5em 0; +} +.header > .item.title h1 a { + text-decoration: none; +} +.header > .item.search input { + width: 230px; +} +.header .item.search input:focus { + width: 350px; +} + +/*=== Body */ +#global { + height: calc(100% - 85px); +} +.aside { + border-right: 1px solid #333; + background: #1c1c1c; +} +.aside.aside_feed { + padding: 10px 0; + text-align: center; +} +.aside.aside_feed .tree { + margin: 10px 0 50px; +} + +/*=== Aside main page (categories) */ +.aside_feed .tree-folder-title > .title:not([data-unread="0"])::after { + position: absolute; + right: 0; + margin: 10px 0; + padding: 0 10px; + font-size: 0.9rem; + line-height: 1.5rem; + background: inherit; +} + +/*=== Aside main page (feeds) */ +.feed.item.empty.active { + background: #c95; +} +.feed.item.error.active { + background: #a44; +} +.feed.item.empty, +.feed.item.empty > a { + color: #c95; +} +.feed.item.error, +.feed.item.error > a { + color: #a44; +} +.feed.item.empty.active, +.feed.item.empty.active > a { + color: #111; +} +.feed.item.error.active, +.feed.item.error.active > a { + color: #fff; +} +.aside_feed .tree-folder-items .dropdown-menu::after { + left: 2px; +} +.aside_feed .tree-folder-items .item .dropdown-target:target ~ .dropdown-toggle > .icon, +.aside_feed .tree-folder-items .item:hover .dropdown-toggle > .icon, +.aside_feed .tree-folder-items .item.active .dropdown-toggle > .icon { + border-radius: 3px; + background-color: #111; +} + +/*=== Configuration pages */ +.post { + padding: 10px 50px; + font-size: 0.9em; +} +.post form { + margin: 10px 0; +} +.post.content { + max-width: 550px; +} + +/*=== Prompt (centered) */ +.prompt { + text-align: center; +} +.prompt label { + text-align: left; +} +.prompt form { + margin: 10px auto 20px auto; + width: 200px; +} +.prompt input { + margin: 5px auto; + width: 100%; +} +.prompt p { + margin: 20px 0; +} + +/*=== New article notification */ +#new-article { + text-align: center; + font-size: 0.9em; + background: #26303F; +} +#new-article:hover { + background: #4A5D7A; +} +#new-article > a { + line-height: 3em; + font-weight: bold; + color: #fff; +} +#new-article > a:hover { + text-decoration: none; +} + +/*=== Day indication */ +.day { + padding: 0 10px; + font-weight: bold; + line-height: 3em; + border-top: 1px solid #333; + border-bottom: 1px solid #333; +} +.day .name { + padding: 0 10px 0 0; + font-size: 1.8em; + opacity: 0.3; + font-style: italic; + text-align: right; + color: #aab; + text-shadow: 0px -1px 0px #333; +} + +/*=== Index menu */ +.nav_menu { + text-align: center; + padding: 5px 0; + border-bottom: 1px solid #2f2f2f; +} + +/*=== Feed articles */ +.flux { + border-left: 2px solid #2f2f2f; +} +.flux:hover { + background: #111; +} +.flux.current { + border-left: 2px solid #0062BE; + background: #111; +} +.flux.not_read { + border-left: 2px solid #FF5300; +} +.flux.favorite { + border-left: 2px solid #FFC300; +} + + +.flux_header { + font-size: 0.8rem; + cursor: pointer; +} +.flux_header .title { + font-size: 0.9rem; +} +.flux_header .item.title a { + color: #888; +} +.flux .website .favicon { + margin: 5px; +} +.flux .date { + font-size: 0.7rem; + color: #666; +} +.flux:not(.current):hover .item.title { + background: #111; +} + +.flux .bottom { + font-size: 0.8rem; + text-align: center; +} + +/*=== Content of feed articles */ +.content { + padding: 20px 10px; +} +.content > h1.title > a { + color: #888; +} + +.content hr { + margin: 30px 10px; + height: 1px; + background: #666; + border: 0; + box-shadow: 0 2px 5px #666; +} + +.content pre { + margin: 10px auto; + padding: 10px 20px; + overflow: auto; + background: #222; + color: #fff; + border: 1px solid #000; + font-size: 0.9rem; + border-radius: 3px; +} +.content code { + padding: 2px 5px; + color: #dd1144; + background: #000; + border: 1px solid #333; + border-radius: 3px; +} +.content pre code { + background: transparent; + color: #fff; + border: none; +} + +.content blockquote { + display: block; + margin: 0; + padding: 5px 20px; + border-top: 1px solid #444; + border-bottom: 1px solid #444; + background: #222; + color: #999; +} +.content blockquote p { + margin: 0; +} + +/*=== Notification and actualize notification */ +.notification { + padding: 0 0 0 5px; + text-align: center; + font-weight: bold; + font-size: 0.9em; + line-height: 3em; + z-index: 10; + vertical-align: middle; + border-radius: 5px; + box-shadow: 0 0 5px #666; + background: #111; + color: #c95; + border: 1px solid #c95; +} +.notification.good { + border-color: #484; + color: #484; +} +.notification.bad { + border-color: #a44; + color: #a44; +} +.notification a.close { + padding: 0 15px; + line-height: 3em; +} +.notification a.close:hover { + background: #222; + border-radius: 0 3px 3px 0; +} +.notification.good a.close:hover { + background: #484; +} +.notification.bad a.close:hover { + background: #a44; +} + +.notification#actualizeProgress { + line-height: 2em; +} + +/*=== "Load more" part */ +#bigMarkAsRead { + text-align: center; + text-decoration: none; +} +#bigMarkAsRead:hover { + background: #111; + color: #aaa; +} + +/*=== Navigation menu (for articles) */ +#nav_entries { + margin: 0; + text-align: center; + line-height: 3em; + table-layout: fixed; + background: #111; + border-top: 1px solid #333; +} + +/*=== READER VIEW */ +/*================*/ +#stream.reader .flux { + padding: 0 0 50px; + border: none; + background: #111; +} +#stream.reader .flux .author { + margin: 0 0 10px; + font-size: 90%; + color: #666; +} + +/*=== GLOBAL VIEW */ +/*================*/ +.box.category .box-title .title { + font-weight: normal; + text-decoration: none; + text-align: left; + color: #888; +} +.box.category:not([data-unread="0"]) .box-title { + background: #34495E; +} +.box.category:not([data-unread="0"]) .box-title:active { + background: #26303F; +} +.box.category:not([data-unread="0"]) .box-title .title { + color: #fff; + font-weight: bold; +} +.box.category .title:not([data-unread="0"])::after { + position: absolute; + top: 5px; right: 10px; + border: 0; + background: none; + font-weight: bold; + box-shadow: none; + text-shadow: none; +} +.box.category .item.feed { + padding: 2px 10px; + font-size: 0.8rem; +} + +/*=== Panel */ +#panel { + background: #1c1c1c; + border: 1px solid #666; + border-radius: 3px; +} + +/*=== Slider */ +#slider { + background-color: #1c1c1c; + border-left: 1px solid #666; +} + +/*=== DIVERS */ +/*===========*/ +.aside.aside_feed .nav-form input, +.aside.aside_feed .nav-form select { + width: 140px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu { + right: -20px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu::after { + right: 33px; +} + +/*=== STATISTICS */ +/*===============*/ +.stat { + margin: 10px 0 20px; +} + +.stat th, +.stat td, +.stat tr { + border: none; +} +.stat > table td, +.stat > table th { + border-bottom: 1px solid #333; +} + +.stat > .horizontal-list { + margin: 0 0 5px; +} +.stat > .horizontal-list .item { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.stat > .horizontal-list .item:first-child { + width: 270px; +} + +/*=== LOGS */ +/*=========*/ +.loglist { + overflow: hidden; + border: 1px solid #333; +} +.log { + padding: 5px 10px; + font-size: 0.8rem; + background: #111; + color: #888; +} +.log+.log { + border-top: 1px solid #333; +} +.log .date { + display: block; + font-weight: bold; +} +.log.error { + background: #a44; + color: #fff; +} +.log.warning { + background: #c95; + color: #fff; +} +.log.notice { + background: #ec9; + color: #000; +} +.log.debug { + background: #111; + color: #eee; +} + +/*=== MOBILE */ +/*===========*/ +@media(max-width: 840px) { + .aside { + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; + } + .aside .toggle_aside, + #panel .close { + display: block; + width: 100%; + height: 50px; + line-height: 50px; + text-align: center; + background: #111; + border-bottom: 1px solid #333; + } + + .aside.aside_feed { + padding: 0; + } + + .nav_menu .btn { + margin: 5px 10px; + } + .nav_menu .stick { + margin: 0 10px; + } + .nav_menu .stick .btn { + margin: 5px 0; + } + .nav_menu .search { + display: inline-block; + max-width: 97%; + } + .nav_menu .search input { + max-width: 97%; + width: 90px; + } + .nav_menu .search input:focus { + width: 400px; + } + + .day .name { + font-size: 1.1rem; + } + + .pagination { + margin: 0 0 3.5em; + } + + .notification { + border-top: none; + border-right: none; + border-left: none; + border-radius: 0; + } + .notification a.close { + display: block; + left: 0; + } + .notification a.close:hover { + opacity: 0.5; + } + .notification a.close .icon { + display: none; + } +} diff --git a/p/themes/Dark/freshrss.css b/p/themes/Dark/freshrss.css deleted file mode 100644 index f6577c645..000000000 --- a/p/themes/Dark/freshrss.css +++ /dev/null @@ -1,927 +0,0 @@ -@charset "UTF-8"; - -/* STRUCTURE */ -.header { - display: table; - width: 100%; - background: #1c1c1c; - table-layout: fixed; -} - .header > .item { - display: table-cell; - padding: 10px 0; - border-bottom: 1px solid #2f2f2f; - vertical-align: middle; - text-align: center; - } - .header > .item.title { - width: 250px; - white-space: nowrap; - } - .logo { - display: inline-block; - font-size: 48px; - height: 32px; - width: 32px; - padding: 10px; - } - .header > .item.title h1 { - display: inline-block; - margin: 0; - } - .header > .item.search input { - width: 230px; - } - .header .item.search input:focus { - width: 330px; - } - .header > .item.configure { - width: 100px; - } - -.item a:hover { - text-decoration: none; -} - -#global { - display: table; - width: 100%; - height: 100%; - background: #1c1c1c; - table-layout: fixed; -} - .aside { - display: table-cell; - height: 100%; - width: 250px; - vertical-align: top; - border-right: 1px solid #2f2f2f; - background: #1c1c1c; - } - .aside .nav-form input { - width: 180px; - } - .aside.aside_flux { - padding: 10px 0 40px; - } - .aside.aside_feed .nav-form input { - width: 140px; - } - .aside.aside_feed .nav-form .dropdown .dropdown-menu { - right: -20px; - } - .aside.aside_feed .nav-form .dropdown .dropdown-menu:after { - right: 33px; - } - - .nav-login { - display: none; - } - - .nav_menu { - width: 100%; - background: #1c1c1c; - border-bottom: 1px solid #2f2f2f; - text-align: center; - padding: 5px 0; - } - .nav_menu .search { - display:none; - } - -.favicon { - height: 16px; - width: 16px; -} - -.categories { - margin: 0; - padding: 0; - text-align: center; - list-style: none; -} - .category { - display: block; - width: 220px; - margin: 10px auto; - text-align: left; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - .category .btn:first-child { - width: 195px; - position: relative; - } - .category.stick .btn:first-child { - width:160px; - } - .category .btn:first-child:not([data-unread="0"]):after { - content: attr(data-unread); - position: absolute; - top: 3px; right: 3px; - padding: 1px 5px; - background: #1a1a1a; - color: #888; - font-size: 90%; - border: 1px solid #000; - border-radius: 5px; - } - .category + .feeds:not(.active) { - display:none; - } - .categories .feeds { - width: 100%; - margin: 0; - list-style: none; - } - .categories .feeds .item.active { - background: #26303F; - } - .categories .feeds .item.active .feed { - color: #888; - } - .categories .feeds .item.empty .feed { - color: #e67e22; - } - .categories .feeds .item.empty.active { - background: #e67e22; - } - .categories .feeds .item.empty.active .feed { - color: #fff; - } - .categories .feeds .item.error .feed { - color: #BD362F; - } - .categories .feeds .item .feed { - display: inline-block; - margin: 0; - width: 165px; - line-height: 35px; - font-size: 90%; - vertical-align: middle; - text-align: left; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - .feed:not([data-unread="0"]):before { - content: "(" attr(data-unread) ") "; - } - .categories .feeds .dropdown-menu { - left: 0; - } - .categories .feeds .dropdown-menu:after { - left: 2px; - } - .categories .feeds .item .dropdown-toggle > .icon { - visibility: hidden; - cursor: pointer; - } - .categories .feeds .item .dropdown-target:target ~ .dropdown-toggle > .icon, - .categories .feeds .item:hover .dropdown-toggle > .icon, - .categories .feeds .item.active .dropdown-toggle > .icon { - background-color: #1c1c1c; - border-radius: 3px; - visibility: visible; - } - -.post { - padding: 10px 50px; -} - .post form { - margin: 10px 0; - } - -.day { - min-height: 50px; - padding: 0 10px; - font-size: 130%; - font-weight: bold; - line-height: 50px; - background: #1c1c1c; - border-top: 1px solid #2f2f2f; -} - #new-article + .day { - border-top: none; - } - .day .name { - position: absolute; - right: 0; - width: 50%; - height: 1.5em; - padding: 0 10px 0 0; - overflow: hidden; - color: #aab; - font-size: 1.8em; - opacity: .3; - text-shadow: 0px -1px 0px #333; - font-style: italic; - white-space: nowrap; - text-overflow: ellipsis; - text-align: right; - } - -#new-article { - display: none; - min-height: 40px; - background: #26303F; - text-align: center; -} - #new-article:hover { - background: #4A5D7A; - } - #new-article > a { - display: block; - line-height: 40px; - color: #fff; - font-weight: bold; - } - #new-article > a:hover { - text-decoration: none; - } - -.flux { - border-left: 3px solid #2f2f2f; - background: #1c1c1c; -} - .flux.not_read { - border-left: 3px solid #FF5300; - background: #1c1c1c; - } - .flux.favorite { - border-left: 3px solid #FFC300; - background: #1c1c1c; - } - .flux.current { - border-left: 3px solid #0062BE; - background: #1a1a1a; - } - - .horizontal-list > .item:not(.title):not(.website) > a { - display: block; - } - - .flux_header { - background: inherit; - height: 25px; - font-size: 12px; - border-top: 1px solid #2f2f2f; - cursor: pointer; - } - .flux .item { - line-height: 40px; - white-space: nowrap; - } - .flux_header > .item { - overflow: hidden; - text-overflow: ellipsis; - } - .flux .item.manage { - width: 40px; - text-align: center; - } - .flux .item.website { - width: 200px; - } - .website .favicon { - padding: 5px; - } - .flux .item.title { - background: inherit; - } - .flux .item.title a { - color: #888; - outline: none; - } - .flux.not_read .item.title, - .flux.current .item.title { - font-weight: bold; - } - .flux .item.date { - width: 145px; - padding:0 5px 0 0; - text-align: right; - font-size: 10px; - color: #666; - } - .link { - width: 40px; - text-align: center; - } - -#stream.reader .flux { - padding: 0 0 30px; - border: none; - background: #1c1c1c; - color: #888; -} - #stream.reader .flux .author { - margin: 0 0 10px; - font-size: 90%; - color: #666; - } - -#stream.global { - text-align: center; -} - #stream.global .box-category { - display: inline-block; - width: 280px; - margin: 20px 10px; - vertical-align: top; - background: #1a1a1a; - border: 1px solid #000; - border-radius: 5px; - text-align: left; - box-shadow: 0 0 5px #2f2f2f; - } - #stream.global .category { - width: 100%; - margin: 0; - } - #stream.global .btn { - display: block; - width: auto; - height: 35px; - margin: 0; - padding: 0 10px; - background: #26303F; - border: none; - border-bottom: 1px solid #2f2f2f; - border-radius: 5px 5px 0 0; - line-height: 35px; - font-size: 120%; - } - #stream.global .btn:not([data-unread="0"]) { - background: #34495e; - color: #fff; - font-weight: bold; - } - #stream.global .btn:first-child:not([data-unread="0"]):after { - top: 0; right: 5px; - border: 0; - background: none; - color: #fff; - font-weight: bold; - box-shadow: none; - } - #stream.global .box-category .feeds { - display: block; - max-height: 250px; - margin: 0; - list-style: none; - overflow: auto; - } - #stream.global .box-category .feeds .item { - padding: 2px 10px; - font-size: 90%; - } - #stream.global .box-category .feed { - width: 220px; - } - -.content { - min-height: 150px; - max-width: 550px; - margin: 0 auto; - padding: 20px 10px; - line-height: 170%; - word-wrap: break-word; -} - .content h1, .content h2, .content h3 { - margin: 20px 0 5px; - } - .content > .title { - font-size: x-large; - margin: 0; - } - - .content p { - margin: 0 0 20px; - } - img.big { - display: block; - margin: 10px auto; - } - figure img.big { - margin: 0; - } - .content hr { - margin: 30px 0; - height: 1px; - background: #ddd; - border: 0; - } - .content pre { - margin: 10px auto; - padding: 10px; - overflow: auto; - background: #000; - color: #fff; - font-size: 110%; - } - .content q, .content blockquote { - display: block; - margin: 5px 0; - padding: 5px 20px; - font-style: italic; - border-left: 4px solid #ccc; - color: #666; - } - .content blockquote p { - margin: 0; - } - -#panel { - display: none; - position: fixed; - top: 10px; bottom: 10px; - left: 100px; right: 100px; - overflow: auto; - background: #1c1c1c; - border: 1px solid #95a5a6; - border-radius: 5px; -} - #panel .close { - position: fixed; - top: 10px; right: 0; - display: inline-block; - width: 26px; - height: 26px; - margin: 0 10px 0 0; - border: 1px solid #ccc; - border-radius: 20px; - text-align: center; - line-height: 26px; - background: #fff; - } - -#overlay { - display: none; - position: fixed; - top: 0; bottom: 0; - left: 0; right: 0; - background: rgba(0, 0, 0, 0.9); -} - -.flux_content .bottom { - font-size: 90%; - text-align: center; -} - -.hide_posts > :not(.active) > .flux_content { - display:none; -} - -/*** PAGINATION ***/ -.pagination { - display: table; - width: 100%; - margin: 0; - background: #1a1a1a; - text-align: center; - color: #888; - font-size: 80%; - line-height: 200%; - table-layout: fixed; -} - .pagination .item { - display: table-cell; - line-height: 40px; - } - .pagination .item.pager-current { - font-weight: bold; - font-size: 140%; - } - .pagination .pager-first, - .pagination .pager-previous, - .pagination .pager-next, - .pagination .pager-last { - width: 100px; - } - .pagination .item a { - display: block; - color: #333; - font-style: italic; - } - .pagination:first-child .item { - border-bottom: 1px solid #aaa; - } - .pagination:last-child .item { - border-top: 1px solid #aaa; - } - -#nav_entries { - display: table; - width: 250px; - height: 40px; - position: fixed; - bottom: 0; - left: 0; - margin: 0; - background: #1c1c1c; - border-top: 1px solid #2f2f2f; - text-align: center; - line-height: 40px; - table-layout: fixed; -} - #nav_entries .item { - display: table-cell; - width: 30%; - } - #nav_entries a { - display: block; - } - #nav_entries .i_up { - margin: 5px 0 0; - vertical-align: top; - } - -.loading { - background: url("loader.gif") center center no-repeat; - font-size: 0; -} - -#bigMarkAsRead { - display: block; - font-style: normal; - padding: 32px 0 64px 0; - text-align: center; - text-decoration: none; -} - #bigMarkAsRead:hover { - background: #1c1c1c; - color: #888; - } - .bigTick { - font-size: 72pt; - line-height: 1.6em; - } - -/*** NOTIFICATION ***/ -#notification { - position: absolute; - top: 10px; - left: 25%; right: 25%; - min-height: 30px; - padding: 10px; - line-height: 30px; - text-align: center; - border-radius: 5px; - box-shadow: 0 0 5px #666; - background: #1a1a1a; - color: #888; - border: 1px solid #f4f899; - font-weight: bold; - z-index: 10; -} - #notification.closed { - display: none; - } - #notification a.close { - position: absolute; - top: -10px; right: -10px; - display: inline-block; - width: 16px; - height: 16px; - padding: 5px; - background: #1a1a1a; - border-radius: 50px; - line-height: 16px; - border:1px solid #f4f899; - } - -.toggle_aside, .btn.toggle_aside { - display: none; -} - -.actualizeProgress { - position: fixed; - top: 10px; - left: 25%; right: 25%; - padding: 5px; - background: #1a1a1a; - text-align: center; - border: 1px solid #2f2f2f; - border-radius: 5px; -} - .actualizeProgress progress { - max-width: 100%; - vertical-align: middle; - } - .actualizeProgress .progress { - color: #888; - font-size: 90%; - vertical-align: middle; - } - -.logs { - border: 1px solid #aaa; -} - .log { - padding: 5px 2%; - overflow: auto; - background: #fafafa; - border-bottom: 1px solid #999; - color: #333; - font-size: 90%; - } - .log .date { - display: block; - } - .log.error { - background: #fdd; - color: #844; - } - .log.warning { - background: #ffe; - color: #c95; - } - .log.notice { - background: #f4f4f4; - color: #aaa; - } - .log.debug { - background: #111; - color: #eee; - } - -.form-group table { - border-collapse:collapse; - margin:10px 0 0 220px; - text-align:center; -} - -.form-group tr, .form-group th, .form-group td { - border:1px solid #2f2f2f; - font-weight:normal; - padding:.5em; -} - -select.number option { - text-align:right; -} - -@media(min-width: 841px) { - .flux:not(.current):hover .item.title { - max-width: calc(100% - 580px); - padding-right: 1.5em; - position: absolute; - } -} - -@media(max-width: 840px) { - .header, - .aside .btn-important, - .aside .feeds .dropdown, - .flux_header .item.website span, - .item.date { - display: none; - } - .flux_header .item.website { - width: 40px; - text-align: center; - } - .flux_header .item.website .favicon { - padding: 12px; - } - - .nav-login { - display: block; - } - - .pagination { - margin: 0 0 40px; - } - .pagination .pager-previous, .pagination .pager-next { - width: 100px; - } - - .toggle_aside, .btn.toggle_aside { - display: inline-block; - } - .aside { - position: fixed; - top: 0; left: 0; - width: 0; - overflow: hidden; - border-right: none; - z-index: 10; - transition: width 200ms linear; - } - .aside.aside_flux { - padding: 10px 0 0; - } - .aside:target { - width: 80%; - border-right: 1px solid #aaa; - overflow: auto; - } - .aside .toggle_aside { - position: absolute; - right: 0; - display: inline-block; - width: 26px; - height: 26px; - margin: 0 10px 0 0; - border: 1px solid #ccc; - border-radius: 20px; - text-align: center; - line-height: 26px; - } - .aside .categories { - margin: 30px 0; - } - - #nav_entries { - width: 100%; - } - - .nav_menu .btn { - margin: 5px 10px; - } - .nav_menu .stick { - margin: 0 10px; - } - .nav_menu .stick .btn { - margin: 5px 0; - } - .nav_menu .search { - display: inline-block; - max-width: 97%; - } - .nav_menu .search input { - max-width: 97%; - width: 90px; - } - .nav_menu .search input:focus { - width: 400px; - } - - #panel { - left: 5px; right: 5px; - } - - .day .date { - display: none; - } - .day .name { - height: 2.6em; - font-size: 1em; - text-shadow: none; - } - - #notification, - .actualizeProgress { - top: 0; - left: 0; - right: 0; - border-radius: 0; - border: none; - border-bottom: 1px solid #f4f899; - } - #notification a.close { - left: 0; right: 0; - top: 0; bottom: 0; - width: auto; - height: auto; - background: transparent; - border: none; - } - #notification a.close .icon { - display: none; - } -} - -/*** FALLBACK ***/ -.btn { - background: #1c1c1c; -} - .btn:hover { - background: -moz-linear-gradient(top, #4A5D7A 0%, #26303F 100%); - background: -webkit-linear-gradient(top, #4A5D7A 0%, #26303F 100%); - background: -o-linear-gradient(top, #4A5D7A 0%, #26303F 100%); - background: -ms-linear-gradient(top, #4A5D7A 0%, #26303F 100%); - } - .btn-important { - background: #26303F; - } - .btn-important:hover { - background: -moz-linear-gradient(top, #4A5D7A 0%, #26303F 100%); - background: -webkit-linear-gradient(top, #4A5D7A 0%, #26303F 100%); - background: -o-linear-gradient(top, #4A5D7A 0%, #26303F 100%); - background: -ms-linear-gradient(top, #4A5D7A 0%, #26303F 100%); - } - .btn-attention { - background: #880011; - } - .btn-attention:hover { - background: -moz-linear-gradient(top, #cc0044 0%, #880011 100%); - background: -webkit-linear-gradient(top, #cc0044 0%, #880011 100%); - background: -o-linear-gradient(top, #cc0044 0%, #880011 100%); - background: -ms-linear-gradient(top, #cc0044 0%, #880011 100%); - } - -.dropdown-menu:after { - -moz-transform: rotate(45deg); - -webkit-transform: rotate(45deg); - -ms-transform: rotate(45deg); -} - -.nav-head { - background: #1c1c1c; -} - -input.extend { - -moz-transition: width 200ms linear; - -webkit-transition: width 200ms linear; - -o-transition: width 200ms linear; - -ms-transition: width 200ms linear; -} - -@media(max-width: 840px) { - .aside { - -moz-transition: width 200ms linear; - -webkit-transition: width 200ms linear; - -o-transition: width 200ms linear; - -ms-transition: width 200ms linear; - } -} - -@media print { - .header, - .aside, - .nav_menu, - .day, - .flux_header, - .flux_content .bottom, - .pagination { - display: none; - } - - html, body { - background: #fff; - color: #000; - font-family: Serif; - font-size: 12pt; - } - - #global, - .flux_content { - display: block !important; - } - - .flux_content .content { - width: 100% !important; - text-align: justify; - } - - .flux_content .content a { - color: #000; - } - .flux_content .content a:after { - content: " (" attr(href) ") "; - text-decoration: underline; - } -} - -.stat { - border:1px solid #2f2f2f; - border-radius:10px; - margin:10px 0; - padding:0 5px; -} -.stat > h2 { - border-bottom:1px solid #2f2f2f; - margin:0 -5px; - padding-left:5px; -} -.stat > div { - margin:5px 0; -} -.stat > table { - border-collapse:collapse; - margin:5px 0; - width:100%; -} -.stat > table > thead > tr { - border-bottom:2px solid #2f2f2f; -} -.stat > table > tbody > tr { - border-bottom:1px solid #2f2f2f; -} -.stat > table > tbody > tr:last-child { - border-bottom:0; -} -.stat > table th, .stat > table td { - border-left:2px solid #2f2f2f; - padding:5px; -} -.stat > table th:first-child, .stat > table td:first-child { - border-left:0; -} -.stat > table td.numeric{ - margin:5px 0; - text-align:center; -} diff --git a/p/themes/Dark/global.css b/p/themes/Dark/global.css deleted file mode 100644 index e296f2188..000000000 --- a/p/themes/Dark/global.css +++ /dev/null @@ -1,531 +0,0 @@ -@charset "UTF-8"; - -/* FONTS */ -@font-face { - font-family: "OpenSans"; - src: url("../fonts/openSans.woff") format("woff"); -} - - -* { - margin: 0; - padding: 0; -} -html, body { - height: 100%; - font-size: 95%; - font-family: "OpenSans", "Cantarell", "Helvetica", "Arial", sans-serif; - color: #888; -} - -/* LIENS */ -a { - color: #6986B2; - text-decoration: none; -} - a:hover { - text-decoration: underline; - } - -/* LISTES */ -ul, ol, dl { - margin: 10px 0 10px 30px; - line-height: 190%; -} - dd { - margin: 0 0 10px 30px; - } - -/* TITRES */ -h1, h2, h3 { - min-height: 40px; - margin: 15px 0 5px; - line-height: 40px; -} - -/* IMG */ -figure { - margin: 5px 0 10px; - text-align: center; -} - figcaption { - display: inline-block; - padding: 3px 20px; - color: #999; - font-style: italic; - border-bottom: 1px solid #ccc; - } -img { - height: auto; - max-width: 100%; - vertical-align: middle; -} - a img { - border: none; - } - -/* VIDEOS */ -iframe, embed, object, video { - max-width: 100%; -} - -/* FORMULAIRES */ -legend { - display: block; - width: 100%; - margin: 20px 0 5px; - padding: 5px 0; - border-bottom: 1px solid #2f2f2f; - font-size: 150%; - clear: both; -} -label { - display: block; - min-height: 25px; - padding: 5px 0; - font-size: 14px; - line-height: 25px; - cursor: pointer; -} -input { - width: 180px; -} -textarea { - width: 360px; - height: 100px; -} -input, select, textarea { - display: inline-block; - max-width: 100%; - min-height: 25px; - padding: 5px; - background: #333; - border: 1px solid #000; - border-radius: 3px; - color: #999; - line-height: 25px; - vertical-align: middle; - box-shadow: 0 2px 2px #1d1d1d inset; -} - option { - padding:0 .5em 0 .5em; - } - input[type="radio"], - input[type="checkbox"] { - width: 15px !important; - min-height: 15px !important; - } - input:focus, select:focus, textarea:focus { - color: #6986b2; - border-color: #2f2f2f; - } - input:invalid, select:invalid { - border-color: red; - box-shadow: 0 0 2px 1px red; - } - input:focus.extend { - width: 300px; - transition: width 200ms linear; - } - -.form-group { - margin: 0; -} - .form-group:after { - content: ""; - display: block; - clear: both; - } - .form-group.form-actions { - min-width: 250px; - padding: 5px 0; - background: #1a1a1a; - border-top: 1px solid #2f2f2f; - } - .form-group.form-actions .btn { - margin: 0 10px; - } - .form-group .group-name { - display: block; - float: left; - width: 200px; - padding: 10px 0; - text-align: right; - } - .form-group .group-controls { - min-width: 250px; - min-height: 25px; - margin: 0 0 0 220px; - padding: 5px 0; - } - .form-group .group-controls .control { - display: block; - min-height: 30px; - padding: 5px 0; - line-height: 25px; - font-size: 14px; - } - -.stick { - display: inline-block; - white-space: nowrap; - font-size: 0px; - vertical-align: middle; -} - .stick input, - .stick .btn { - border-radius: 0; - font-size: 14px; - } - .stick .btn:first-child, - .stick input:first-child { - border-radius: 3px 0 0 3px; - } - .stick .btn-important:first-child { - border-right: 1px solid #000; - } - .stick .btn:last-child, - .stick input:last-child { - border-radius: 0 3px 3px 0; - } - .stick .btn + .btn, - .stick .btn + input, - .stick .btn + .dropdown > .btn, - .stick input + .btn, - .stick input + input, - .stick input + .dropdown > .btn, - .stick .dropdown + .btn, - .stick .dropdown + input, - .stick .dropdown + .dropdown > .btn { - border-left: none; - } - .stick .btn + .dropdown > .btn { - border-left: none; - border-radius: 0 3px 3px 0; - } - .stick .btn + .dropdown a { - font-size: 12px; - } - -.btn { - display: inline-block; - min-height: 37px; - min-width: 15px; - padding: 5px 10px; - background: linear-gradient(to bottom, #fff 0%, #eee 100%); - border-radius: 3px; - border: 1px solid #000; - color: #888; - line-height: 20px; - vertical-align: middle; - cursor: pointer; - overflow: hidden; -} - a.btn { - min-height: 25px; - line-height: 25px; - } - .btn:hover { - background: linear-gradient(to bottom, #4A5D7A, #26303F); - text-decoration: none; - } - .btn.active, - .btn:active, - .dropdown-target:target ~ .btn.dropdown-toggle { - background: #26303F; - } - - .btn-important { - background: linear-gradient(to bottom, #0084CC, #0045CC); - color: #888888; - border: 1px solid #000000; - } - .btn-important:hover { - background: linear-gradient(to bottom, #0066CC, #0045CC); - } - .btn-important:active { - background: #0044CB; - box-shadow: none; - } - - .btn-attention { - background: linear-gradient(to bottom, #E95B57, #BD362F); - color: #888888; - border: 1px solid #000000; - } - .btn-attention:hover { - background: linear-gradient(to bottom, #D14641, #BD362F); - } - .btn-attention:active { - background: #BD362F; - box-shadow: none; - } - -/* NAVIGATION */ -.nav-list .nav-header, -.nav-list .item { - display: block; - height: 35px; - line-height: 35px; -} - .nav-list .item:hover { - background: #1a1a1a; - } - .nav-list .item:hover a { - color: #26303F; - } - .nav-list .item.active { - background: #26303F; - color: #1a1a1a; - } - .nav-list .item.active a { - color: #888; - } - .nav-list .disable { - color: #aaa; - background: #fafafa; - text-align: center; - } - .nav-list .item > * { - display: block; - padding: 0 10px; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - .nav-list a:hover { - text-decoration: none; - } - .nav-list .item.error a { - color: #BD362F; - } - .nav-list .item.active.error a { - color: #fff; - background: #BD362F; - } - .nav-list .item.empty a { - color: #f39c12; - } - .nav-list .item.active.empty a { - color: #fff; - background: #f39c12; - } - - .nav-list .nav-header { - padding: 0 10px; - background: #1a1a1a; - border-bottom: 1px solid #2f2f2f; - font-weight: bold; - } - .nav-list .separator { - display: block; - height: 0; - margin: 5px 0; - border-bottom: 1px solid #2f2f2f; - } - - .nav-list .nav-form { - padding: 3px; - text-align: center; - } - -.nav-head { - display: block; - margin: 0; - background: linear-gradient(to bottom, #fff, #f0f0f0); - border-bottom: 1px solid #2f2f2f; - text-align: right; -} - .nav-head .item { - display: inline-block; - padding: 5px 10px; - } - -/* HORIZONTAL-LIST */ -.horizontal-list { - display: table; - table-layout: fixed; - margin: 0; - padding: 0; - width: 100%; -} - .horizontal-list .item { - display: table-cell; - vertical-align: middle; - } - -/* DROPDOWN */ -.dropdown { - position: relative; - display: inline-block; -} - .dropdown-target { - display: none; - } - - .dropdown-menu { - display: none; - min-width: 200px; - margin: 5px 0 0; - padding: 5px 0; - position: absolute; - right: 0px; - background: #1a1a1a; - border: 1px solid #888; - border-radius: 5px; - text-align: left; - } - .dropdown-menu:after { - content: ""; - position: absolute; - top: -6px; - right: 13px; - width: 10px; - height: 10px; - background: #1a1a1a; - border-top: 1px solid #888; - border-left: 1px solid #888; - z-index: -10; - transform: rotate(45deg); - } - .dropdown-header { - display: block; - padding: 0 5px; - color: #888; - font-weight: bold; - font-size: 14px; - line-height: 30px; - } - .dropdown-menu .item { - display: block; - height: 30px; - font-size: 90%; - line-height: 30px; - } - .dropdown-menu > .item > a { - display: block; - padding: 0 25px; - line-height: 30px; - } - .dropdown-menu > .item.share > a { - display: list-item; - list-style-position:inside; - list-style-type:decimal; - } - .dropdown-menu > .item:hover { - background: #26303F; - color: #888; - } - .dropdown-menu > .item[aria-checked="true"] > a:before { - content: '✓ '; - font-weight: bold; - margin: 0 0 0 -1.2em; - padding: 0 0.2em 0 0; - } - .dropdown-menu > .item:hover > a { - color: #888; - text-decoration: none; - } - .dropdown-menu .input { - display: block; - height: 40px; - font-size: 90%; - line-height: 30px; - } - .dropdown-menu .input select, - .dropdown-menu .input input { - display: block; - height: 20px; - width: 95%; - margin: auto; - padding: 2px 5px; - border-radius: 3px; - } - .dropdown-menu .input select { - width: 70%; - height: auto; - } - .dropdown-menu .separator { - display: block; - height: 0; - margin: 5px 0; - border-bottom: 1px solid #888; - } - .dropdown-target:target ~ .dropdown-menu { - display: block; - z-index: 10; - } - .dropdown-close { - display: inline; - } - .dropdown-close a { - font-size: 0; - position: fixed; - top: 0; bottom: 0; - left: 0; right: 0; - display: block; - z-index: -10; - } - -/* ALERTS */ -.alert { - display: block; - width: 90%; - margin: 15px auto; - padding: 10px 15px; - background: #1a1a1a; - border: 1px solid #ccc; - border-right: 1px solid #aaa; - border-bottom: 1px solid #aaa; - border-radius: 5px; - color: #aaa; -} - .alert-head { - margin: 0; - font-weight: bold; - font-size: 110%; - } - .alert > a { - color: inherit; - text-decoration: underline; - } - .alert-warn { - border: 1px solid #c95; - color: #c95; - } - .alert-success { - border: 1px solid #484; - color: #484; - } - .alert-error { - border: 1px solid #844; - color: #844; - } - -/* ICÔNES */ -.icon { - display: inline-block; - width: 16px; - height: 16px; - vertical-align: middle; - line-height: 16px; -} - -/* Prompt (centré) */ -.prompt { - text-align: center; -} - .prompt label { - text-align: left; - } - .prompt form { - margin: 1em auto 2.5em auto; - width: 10em; - } - .prompt input { - margin: .4em auto 1.1em auto; - width: 100%; - } - .prompt p { - margin: 20px 0; - } diff --git a/p/themes/Dark/icons/icon.svg b/p/themes/Dark/icons/icon.svg new file mode 100644 index 000000000..4eb53dda9 --- /dev/null +++ b/p/themes/Dark/icons/icon.svg @@ -0,0 +1,12 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"> + <title>Logo FreshRSS</title> + <circle fill="#6986B2" cx="128" cy="128" r="33"/> + <g fill="none" stroke="#6986B2" stroke-width="24"> + <g stroke-opacity="0.3"> + <path d="M12,128 A116,116 0 1,1 128,244"/> + <path d="M54,128 A74,74 0 1,1 128,202"/> + </g> + <path d="M128,12 A116,116 0 0,1 244,128"/> + <path d="M128,54 A74,74 0 0,1 202,128"/> + </g> +</svg> diff --git a/p/themes/Dark/metadata.json b/p/themes/Dark/metadata.json index 27cae27df..bdc068c2e 100644 --- a/p/themes/Dark/metadata.json +++ b/p/themes/Dark/metadata.json @@ -2,6 +2,6 @@ "name": "Dark", "author": "AD", "description": "Le coté obscur du thème “Origine”", - "version": 0.1, - "files": ["global.css", "freshrss.css"] + "version": 0.2, + "files": ["_template.css", "dark.css"] } diff --git a/p/themes/Dark/thumbs/original.png b/p/themes/Dark/thumbs/original.png Binary files differnew file mode 100644 index 000000000..fd574319f --- /dev/null +++ b/p/themes/Dark/thumbs/original.png diff --git a/p/themes/Flat/flat.css b/p/themes/Flat/flat.css new file mode 100644 index 000000000..0672c6a38 --- /dev/null +++ b/p/themes/Flat/flat.css @@ -0,0 +1,1024 @@ +@charset "UTF-8"; + +/*=== FONTS */ +@font-face { + font-family: "OpenSans"; + src: url("../fonts/openSans.woff") format("woff"); +} + +/*=== GENERAL */ +/*============*/ +html, body { + height: 100%; + font-family: "OpenSans", "Cantarell", "Helvetica", "Arial", sans-serif; + background: #fafafa; +} + +/*=== Links */ +a, button.as-link { + color: #2980b9; + outline: none; +} + +/*=== Forms */ +legend { + display: inline-block; + width: auto; + margin: 20px 0 5px; + padding: 5px 20px; + font-size: 1.4em; + clear: both; + background: #ecf0f1; + border-radius: 20px; +} +label { + min-height: 25px; + padding: 5px 0; + cursor: pointer; + color: #444; +} +textarea { + width: 360px; + height: 100px; +} +input, select, textarea { + min-height: 25px; + padding: 5px; + line-height: 25px; + vertical-align: middle; + background: #fff; + border: none; + border-bottom: 3px solid #ddd; + border-left-color: #ddd; + color: #666; + border-radius: 5px; +} +option { + padding: 0 .5em; +} +input:focus, select:focus, textarea:focus { + color: #333; + border-color: #2980b9; +} +input:invalid, select:invalid { + color: #f00; + border-color: #f00; + box-shadow: none; +} +input:disabled, select:disabled { + background: #eee; +} +input.extend { + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; +} + +/*=== Tables */ +table { + border-collapse: collapse; +} + +tr, th, td { + padding: 0.5em; + border: 1px solid #ddd; +} +th { + background: #f6f6f6; +} +form td, +form th { + font-weight: normal; + text-align: center; +} + +/*=== COMPONENTS */ +/*===============*/ +/*=== Forms */ +.form-group { + padding: 5px; + border: 1px solid transparent; + border-radius: 3px; +} +.form-group::after { + content: ""; + display: block; + clear: both; +} +.form-group:hover { + background: #fff; + border: 1px solid #eee; + border-radius: 3px; + border: 1px solid #eee; +} +.form-group.form-actions { + margin: 15px 0 25px; + padding: 5px 0; + background: #ecf0f1; + border-top: 3px solid #bdc3c7; + border-radius: 5px 5px 0 0; +} +.form-group.form-actions .btn { + margin: 0 10px; +} +.form-group .group-name { + padding: 10px 0; + text-align: right; +} +.form-group .group-controls { + min-height: 25px; + padding: 5px 0; +} +.form-group .group-controls .control { + line-height: 2.0em; +} +.form-group table { + margin: 10px 0 0 220px; +} + +/*=== Buttons */ +.stick { + vertical-align: middle; + font-size: 0; +} +.stick input, +.stick .btn { + border-radius: 0; +} +.stick .btn:first-child, +.stick input:first-child { + border-radius: 5px 0 0 5px; +} +.stick .btn:last-child, +.stick input:last-child, +.stick .btn + .dropdown > .btn { + border-radius: 0 5px 5px 0; +} +.stick .btn + .btn, +.stick .btn + input, +.stick .btn + .dropdown > .btn, +.stick input + .btn, +.stick input + input, +.stick input + .dropdown > .btn, +.stick .dropdown + .btn, +.stick .dropdown + input, +.stick .dropdown + .dropdown > .btn { + border-left-width: 1px; + border-left-style: solid; +} + +.btn { + display: inline-block; + min-height: 38px; + min-width: 15px; + margin: 0; + padding: 5px 10px; + font-size: 0.9rem; + vertical-align: middle; + cursor: pointer; + overflow: hidden; + background: #3498db; + border-radius: 5px; + border: none; + border-bottom: 3px solid #2980b9; + border-left-color: #2980b9; + color: #fff; +} +a.btn { + min-height: 25px; + line-height: 25px; +} +.btn:hover { + text-decoration: none; +} +.btn.active, +.btn:active, +.btn:hover, +.dropdown-target:target ~ .btn.dropdown-toggle { + background: #2980b9; +} + +.btn-important { + font-weight: normal; + background: #e67e22; + color: #fff; + border-bottom: 3px solid #d35400; + border-left-color: #d35400; +} +.btn-important:hover, +.btn-important:active { + background: #d35400; +} + +.btn-attention { + background: #e74c3c; + color: #fff; + border-bottom: 3px solid #c0392b; + border-left-color: #c0392b; +} +.btn-attention:hover, +.btn-attention:active { + background: #c0392b; +} + +/*=== Navigation */ +.nav-list .nav-header, +.nav-list .item { + height: 2.5em; + line-height: 2.5em; + font-size: 0.9rem; +} +.nav-list .item:hover, +.nav-list .item.active { + background: #2980b9; + color: #fff; +} +.nav-list .item:hover a, +.nav-list .item.active a { + color: #fff; +} +.nav-list .disable { + text-align: center; + background: #fafafa; + color: #aaa; +} +.nav-list .item > a { + padding: 0 10px; +} +.nav-list a:hover { + text-decoration: none; +} +.nav-list .item.empty a { + color: #f39c12; +} +.nav-list .item:hover.empty a, +.nav-list .item.active.empty a { + color: #fff; + background: #f39c12; +} +.nav-list .item.error a { + color: #bd362f; +} +.nav-list .item:hover.error a, +.nav-list .item.active.error a { + color: #fff; + background: #bd362f; +} + +.nav-list .nav-header { + padding: 0 10px; + font-weight: bold; + background: #34495e; + color: #fff; +} + +.nav-list .nav-form { + padding: 3px; + text-align: center; +} + +.nav-head { + margin: 0; + text-align: right; + background: #34495e; + color: #fff; +} +.nav-head a { + color: #fff; +} +.nav-head .item { + padding: 5px 10px; + font-size: 0.9rem; + line-height: 1.5rem; +} + +/*=== Horizontal-list */ +.horizontal-list { + margin: 0; + padding: 0; +} +.horizontal-list .item { + vertical-align: middle; +} + +/*=== Dropdown */ +.dropdown-menu { + margin: 5px 0 0; + padding: 5px 0; + font-size: 0.8rem; + text-align: left; + border: 1px solid #95a5a6; + border-radius: 3px; +} +.dropdown-menu::after { + content: ""; + position: absolute; + top: -6px; + right: 13px; + width: 10px; + height: 10px; + z-index: -10; + transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + background: #fff; + border-top: 1px solid #95a5a6; + border-left: 1px solid #95a5a6; +} +.dropdown-header { + padding: 0 5px 5px; + font-weight: bold; + text-align: left; + color: #34495e; +} +.dropdown-menu > .item > a { + padding: 0 25px; + line-height: 2.5em; +} +.dropdown-menu > .item > span, +.dropdown-menu > .item > .as-link { + padding: 0 22px; + line-height: 2em; +} +.dropdown-menu > .item:hover { + background: #2980b9; + color: #fff; +} +.dropdown-menu > .item[aria-checked="true"] > a::before { + font-weight: bold; + margin: 0 0 0 -14px; +} +.dropdown-menu > .item:hover > a { + text-decoration: none; + color: #fff; +} +.dropdown-menu .input select, +.dropdown-menu .input input { + margin: 0 auto 5px; + padding: 2px 5px; + border-radius: 3px; +} + +.separator { + margin: 5px 0; + border-bottom: 1px solid #ddd; +} + +/*=== Alerts */ +.alert { + margin: 15px auto; + padding: 10px 15px; + font-size: 0.9em; + background: #f4f4f4; + border: 1px solid #ccc; + border-right: 1px solid #aaa; + border-bottom: 1px solid #aaa; + border-radius: 5px; + color: #aaa; + text-shadow: 0 0 1px #eee; +} +.alert-head { + font-size: 1.15em; +} +.alert > a { + text-decoration: underline; + color: inherit; +} +.alert-warn { + background: #ffe; + border: 1px solid #eeb; + color: #c95; +} +.alert-success { + background: #dfd; + border: 1px solid #cec; + color: #484; +} +.alert-error { + background: #fdd; + border: 1px solid #ecc; + color: #844; +} + +/*=== Pagination */ +.pagination { + text-align: center; + font-size: 0.8em; + background: #ecf0f1; + color: #000; +} +.content .pagination { + margin: 0; + padding: 0; +} +.pagination .item.pager-current { + font-weight: bold; + font-size: 1.5em; + background: #34495e; + color: #ecf0f1; +} +.pagination .item a { + display: block; + font-style: italic; + line-height: 3em; + text-decoration: none; + color: #000; +} +.pagination .item a:hover { + background: #34495e; + color: #ecf0f1; +} + +.pagination .loading, +.pagination a:hover.loading { + font-size: 0; + background: url("loader.gif") center center no-repeat #34495e; +} + +/*=== Boxes */ +.box { + border: 1px solid #ddd; + border-radius: 5px; +} +.box .box-title { + margin: 0; + padding: 5px 10px; + background: #ecf0f1; + color: #333; + border-bottom: 1px solid #ddd; + border-radius: 5px 5px 0 0; +} +.box .box-content { + max-height: 260px; +} + +.box .box-content .item { + padding: 0 10px; + font-size: 0.9rem; + line-height: 2.5em; +} + +.box .box-content .item .configure { + visibility: hidden; +} +.box .box-content .item .configure .icon { + vertical-align: middle; + background-color: #95a5a6; + border-radius: 3px; +} +.box .box-content .item:hover .configure { + visibility: visible; +} + +/*=== Tree */ +.tree { + margin: 10px 0; +} +.tree-folder-title { + position: relative; + padding: 0 10px; + background: #34495e; + line-height: 2.5rem; + font-size: 1rem; +} +.tree-folder-title .title { + background: inherit; + color: #fff; +} +.tree-folder-title .title:hover { + text-decoration: none; +} +.tree-folder.active .tree-folder-title { + background: #2980b9; + font-weight: bold; +} +.tree-folder-items { + background: #2c3e50; +} +.tree-folder-items > .item { + padding: 0 10px; + line-height: 2.5rem; + font-size: 0.8rem; +} +.tree-folder-items > .item.active { + background: #2980b9; +} +.tree-folder-items > .item > a { + text-decoration: none; + color: #fff; +} + +/*=== STRUCTURE */ +/*===============*/ +/*=== Header */ +.header { + height: 85px; + background: #ecf0f1; +} +.header > .item { + padding: 10px; + vertical-align: middle; + text-align: center; +} +.header > .item.title{ + width: 230px; +} +.header > .item.title h1 { + margin: 0.5em 0; +} +.header > .item.title h1 a { + text-decoration: none; +} +.header > .item.search input { + width: 230px; +} +.header .item.search input:focus { + width: 350px; +} + +/*=== Body */ +#global { + height: calc(100% - 85px); +} +.aside { + background: #ecf0f1; +} +.aside.aside_feed { + padding: 10px 0; + text-align: center; + background: #34495e; + border-radius: 0 10px 0 0; +} +.aside.aside_feed .tree { + margin: 10px 0 50px; +} + +/*=== Aside main page (categories) */ +.aside_feed .tree-folder-title > .title:not([data-unread="0"])::after { + position: absolute; + right: 0; + margin: 10px 0; + padding: 0 10px; + font-size: 0.9rem; + line-height: 1.5rem; + background: inherit; +} + +/*=== Aside main page (feeds) */ +.feed.item.empty.active { + background: #f39c12; +} +.feed.item.error.active { + background: #bd362f; +} +.feed.item.empty, +.feed.item.empty > a { + color: #e67e22; +} +.feed.item.error, +.feed.item.error > a { + color: #bd362f; +} +.feed.item.empty.active, +.feed.item.error.active, +.feed.item.empty.active > a, +.feed.item.error.active > a { + color: #fff; +} +.aside_feed .tree-folder-items .dropdown-menu::after { + left: 2px; +} +.aside_feed .tree-folder-items .item .dropdown-target:target ~ .dropdown-toggle > .icon, +.aside_feed .tree-folder-items .item:hover .dropdown-toggle > .icon, +.aside_feed .tree-folder-items .item.active .dropdown-toggle > .icon { + border-radius: 3px; +} + +/*=== Configuration pages */ +.post { + padding: 10px 50px; + font-size: 0.9em; +} +.post form { + margin: 10px 0; +} +.post.content { + max-width: 550px; +} + +/*=== Prompt (centered) */ +.prompt { + text-align: center; +} +.prompt label { + text-align: left; +} +.prompt form { + margin: 10px auto 20px auto; + width: 200px; +} +.prompt input { + margin: 5px auto; + width: 100%; +} +.prompt p { + margin: 20px 0; +} + +/*=== New article notification */ +#new-article { + text-align: center; + font-size: 0.9em; + background: #3498db; +} +#new-article:hover { + background: #2980b9; +} +#new-article > a { + line-height: 3em; + font-weight: bold; + color: #fff; +} +#new-article > a:hover { + text-decoration: none; +} + +/*=== Day indication */ +.day { + padding: 0 10px; + font-weight: bold; + line-height: 3em; + border-left: 2px solid #ecf0f1; +} +.day .name { + padding: 0 10px 0 0; + font-size: 1.8em; + opacity: 0.3; + font-style: italic; + text-align: right; + color: #aab; +} + +/*=== Index menu */ +.nav_menu { + text-align: center; + padding: 5px 0; +} + +#dropdown-query ~ .dropdown-menu .dropdown-header .icon { + vertical-align: middle; + background-color: #95a5a6; + border-radius: 3px; +} + +/*=== Feed articles */ +.flux { + border-left: 2px solid #ecf0f1; +} +.flux:hover { + background: #fff; +} +.flux.current { + border-left-color: #3498db; +} +.flux.not_read { + background: #FFF3ED; + border-left-color: #FF5300; +} +.flux.not_read:not(.current):hover .item.title { + background: #FFF3ED; +} +.flux.favorite { + background: #FFF6DA; + border-left-color: #FFC300; +} +.flux.favorite:not(.current):hover .item.title { + background: #FFF6DA; +} +.flux.current { + background: #fff; +} + + +.flux_header { + font-size: 0.8rem; + cursor: pointer; + border-top: 1px solid #ecf0f1; +} +.flux_header .title { + font-size: 0.9rem; +} +.flux .website .favicon { + padding: 5px; +} +.flux .date { + font-size: 0.7rem; + color: #666; +} + +.flux .bottom { + font-size: 0.8rem; + text-align: center; +} + +/*=== Content of feed articles */ +.content { + padding: 20px 10px; +} +.content > h1.title > a { + color: #000; +} + +.content hr { + margin: 30px 10px; + height: 1px; + background: #ddd; + border: 0; + box-shadow: 0 2px 5px #ccc; +} + +.content pre { + margin: 10px auto; + padding: 10px 20px; + overflow: auto; + background: #222; + color: #fff; + font-size: 0.9rem; + border-radius: 3px; +} +.content code { + padding: 2px 5px; + color: #dd1144; + background: #fafafa; + border: 1px solid #eee; + border-radius: 3px; +} +.content pre code { + background: transparent; + color: #fff; + border: none; +} + +.content blockquote { + display: block; + margin: 0; + padding: 5px 20px; + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + background: #fafafa; + color: #333; +} +.content blockquote p { + margin: 0; +} + +/*=== Notification and actualize notification */ +.notification { + padding: 0 0 0 5px; + text-align: center; + font-weight: bold; + font-size: 0.9em; + line-height: 3em; + z-index: 10; + vertical-align: middle; + background: #ddd; + color: #666; + border-radius: 3px; + border: none; +} +.notification.good { + background: #1abc9c; + color: #fff; +} +.notification.bad { + background: #e74c3c; + color: #fff; +} +.notification a.close { + padding: 0 15px; + line-height: 3em; + border-radius: 0 3px 3px 0; +} +.notification.good a.close:hover { + background: #16a085; +} +.notification.bad a.close:hover { + background: #c0392b; +} + +.notification#actualizeProgress { + line-height: 2em; +} + +/*=== "Load more" part */ +#bigMarkAsRead { + text-align: center; + text-decoration: none; + background: #ecf0f1; +} +#bigMarkAsRead:hover { + background: #34495e; + color: #fff; +} + +/*=== Navigation menu (for articles) */ +#nav_entries { + margin: 0; + text-align: center; + line-height: 3em; + table-layout: fixed; + background: #34495e; +} + +/*=== READER VIEW */ +/*================*/ +#stream.reader .flux { + padding: 0 0 50px; + background: #ecf0f1; + color: #34495e; + border: none; +} +#stream.reader .flux .author { + margin: 0 0 10px; + font-size: 90%; + color: #999; +} + +/*=== GLOBAL VIEW */ +/*================*/ +.box.category .box-title .title { + font-weight: normal; + text-decoration: none; + text-align: left; +} +.box.category:not([data-unread="0"]) .box-title { + background: #3498db; +} +.box.category:not([data-unread="0"]) .box-title:active { + background: #2980b9; +} +.box.category:not([data-unread="0"]) .box-title .title { + font-weight: bold; + color: #fff; +} +.box.category .title:not([data-unread="0"])::after { + position: absolute; + top: 5px; right: 10px; + border: 0; + background: none; + font-weight: bold; + box-shadow: none; + text-shadow: none; +} +.box.category .item.feed { + padding: 2px 10px; + font-size: 0.8rem; +} + +/*=== DIVERS */ +/*===========*/ +.aside.aside_feed .nav-form input, +.aside.aside_feed .nav-form select { + width: 140px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu { + right: -20px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu::after { + right: 33px; +} + +/*=== STATISTICS */ +/*===============*/ +.stat { + margin: 10px 0 20px; +} + +.stat th, +.stat td, +.stat tr { + border: none; +} +.stat > table td, +.stat > table th { + border-bottom: 1px solid #ddd; +} + +.stat > .horizontal-list { + margin: 0 0 5px; +} +.stat > .horizontal-list .item { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.stat > .horizontal-list .item:first-child { + width: 270px; +} + +/*=== LOGS */ +/*=========*/ +.loglist { + overflow: hidden; + border: 1px solid #aaa; +} +.log { + margin: 10px 0; + padding: 5px 2%; + overflow: auto; + font-size: 0.8rem; + background: #fafafa; + color: #666; +} + +.log > .date { + margin: 0 10px 0 0; + padding: 5px 10px; + border-radius: 20px; +} +.log.error > .date { + background: #e74c3c; + color: #fff; +} +.log.warning > .date { + background: #f39c12; +} +.log.notice > .date { + background: #ecf0f1; +} +.log.debug > .date { + background: #111; + color: #eee; +} + +/*=== MOBILE */ +/*===========*/ +@media(max-width: 840px) { + .aside { + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; + } + .aside .toggle_aside, + #panel .close { + display: block; + width: 100%; + height: 50px; + line-height: 50px; + text-align: center; + background: #2c3e50; + } + + .aside.aside_feed { + padding: 0; + } + + .nav_menu .btn { + margin: 5px 10px; + } + .nav_menu .stick { + margin: 0 10px; + } + .nav_menu .stick .btn { + margin: 5px 0; + } + .nav_menu .search { + display: inline-block; + max-width: 97%; + } + .nav_menu .search input { + max-width: 97%; + width: 90px; + } + .nav_menu .search input:focus { + width: 400px; + } + + .day .name { + font-size: 1.1rem; + } + + .pagination { + margin: 0 0 3.5em; + } + + .notification { + border-radius: 0; + } + .notification a.close { + display: block; + left: 0; + background: transparent; + } + .notification a.close:hover { + opacity: 0.5; + } + .notification a.close .icon { + display: none; + } +} diff --git a/p/themes/Flat/freshrss.css b/p/themes/Flat/freshrss.css deleted file mode 100644 index 1d551d8fb..000000000 --- a/p/themes/Flat/freshrss.css +++ /dev/null @@ -1,905 +0,0 @@ -@charset "UTF-8"; - -/* STRUCTURE */ -body { - background: #fafafa; -} - -.header { - display: table; - width: 100%; - table-layout: fixed; - background: #ecf0f1; -} - .header > .item { - display: table-cell; - padding: 10px 0; - vertical-align: middle; - text-align: center; - } - .header > .item.title { - width: 250px; - white-space: nowrap; - } - .logo { - display: inline-block; - font-size: 48px; - height: 32px; - width: 32px; - padding: 10px; - } - .header > .item.title h1 { - display: inline-block; - margin: 0; - } - .header > .item.search input { - width: 230px; - } - .header .item.search input:focus { - width: 330px; - } - .header > .item.configure { - width: 100px; - } - -.item a:hover { - text-decoration: none; -} - -#global { - display: table; - width: 100%; - height: 100%; - table-layout: fixed; -} - .aside { - display: table-cell; - height: 100%; - width: 250px; - vertical-align: top; - background: #ecf0f1; - } - .aside .nav-form input { - width: 180px; - } - .aside.aside_flux { - padding: 10px 0 40px; - } - .aside.aside_feed .nav-form input { - width: 140px; - } - .aside.aside_feed .nav-form .dropdown-menu { - right: -20px; - } - .aside.aside_feed .nav-form .dropdown-menu:after { - right: 33px; - } - - .nav-login { - display: none; - } - - .nav_menu { - width: 100%; - text-align: center; - padding: 5px 0; - } - .nav_menu .search { - display:none; - } - -.favicon { - height: 16px; - width: 16px; -} - -.categories { - margin: 0; - padding: 0; - text-align: center; - list-style: none; -} - .category { - display: block; - width: 220px; - margin: 10px auto; - text-align: left; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - .category .btn:first-child { - width: 195px; - position: relative; - } - .category.stick .btn:first-child { - width:160px; - } - .category .btn:first-child:not([data-unread="0"]):after { - content: attr(data-unread); - position: absolute; - top: 5px; right: 5px; - padding: 0 5px; - color: #fff; - font-size: 90%; - background: #3498DB; - border-radius: 5px; - } - .category + .feeds:not(.active) { - display:none; - } - .categories .feeds { - width: 100%; - margin: 0 auto; - list-style: none; - } - .categories .feeds .item.active:after { - content: "⇢"; - line-height: 35px; - float: right; - } - .categories .feeds .item.empty .feed { - color: #e67e22; - } - .categories .feeds .item.error .feed { - color: #BD362F; - } - .categories .feeds .item .feed { - display: inline-block; - margin: 0; - width: 165px; - line-height: 35px; - font-size: 90%; - vertical-align: middle; - text-align: left; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - .feed:not([data-unread="0"]) { - font-weight:bold; - } - .feed:not([data-unread="0"]):before { - content: "(" attr(data-unread) ") "; - } - .categories .feeds .dropdown-menu { - left: 0; - } - .categories .feeds .dropdown-menu:after { - left: 2px; - } - .categories .feeds .item .dropdown-toggle > .icon { - visibility: hidden; - cursor: pointer; - } - .categories .feeds .item .dropdown-target:target ~ .dropdown-toggle > .icon, - .categories .feeds .item:hover .dropdown-toggle > .icon, - .categories .feeds .item.active .dropdown-toggle > .icon { - background-color: #95a5a6; - border-radius: 3px; - visibility: visible; - } - .categories .btn:hover .notRead, - .categories .btn.active .notRead { - background: #2980B9; - border-left: 3px solid #3498DB; - } - -.post { - padding: 10px 50px; -} - .post form { - margin: 10px 0; - } - -.day { - padding: 5px 15px; - font-size: 130%; - font-weight: bold; - line-height: 50px; - border-left: 3px solid #ecf0f1; -} - .day .name { - position: absolute; - right: 0; - width: 50%; - height: 1.5em; - padding: 0 10px 0 0; - overflow: hidden; - color: #aab; - font-size: 1.8em; - opacity: .3; - font-style: italic; - text-align: right; - white-space: nowrap; - text-overflow: ellipsis; - z-index: -10; - } - -#new-article { - display: none; - min-height: 40px; - background: #3498db; - text-align: center; -} - #new-article:hover { - background: #2980b9; - } - #new-article > a { - display: block; - line-height: 40px; - color: #fff; - font-weight: bold; - } - #new-article > a:hover { - text-decoration: none; - } - -.flux { - border-left: 3px solid #ecf0f1; -} - .flux:hover { - background: #fff; - } - .flux.not_read { - border-left-color: #FF5300; - background: #FFF3ED; - } - .flux.favorite { - border-left-color: #FFC300; - background: #FFF6DA; - } - .flux.current { - border-left-color: #3498db; - background: #fff; - } - - .horizontal-list > .item:not(.title):not(.website) > a { - display: block; - } - - .flux_header { - background: inherit; - height: 25px; - font-size: 12px; - border-top: 1px solid #ecf0f1; - cursor: pointer; - } - .flux .item { - line-height: 40px; - white-space: nowrap; - } - .flux_header > .item { - overflow: hidden; - text-overflow: ellipsis; - } - .flux .item.manage { - width: 40px; - text-align: center; - } - .flux .item.website { - width: 200px; - } - .website .favicon { - padding: 5px; - } - .flux .item.title { - background: inherit; - } - .flux .item.title a { - color: #333; - outline: none; - } - .flux.current .item.title, - .flux.not_read .item.title { - font-weight: bold; - } - .flux .item.date { - width: 145px; - padding:0 5px 0 0; - text-align: right; - font-size: 10px; - color: #666; - } - .link { - width: 40px; - text-align: center; - } - -#stream.reader .flux { - position: relative; - padding: 0 0 30px; - border: none; - background: #ecf0f1; - color: #34495e; - font-size: 120%; -} - #stream.reader .flux .author { - margin: 0 0 10px; - font-size: 90%; - color: #aaa; - } - -#stream.global { - text-align: center; -} - #stream.global .box-category { - display: inline-block; - width: 280px; - margin: 20px 10px; - vertical-align: top; - border: 1px solid #ddd; - border-radius: 5px; - text-align: left; - } - #stream.global .category { - width: 100%; - margin: 0; - } - #stream.global .btn { - display: block; - width: auto; - height: 35px; - margin: 0; - padding: 0 10px; - background: #ecf0f1; - color: #333; - border-bottom: 1px solid #ddd; - border-radius: 5px 5px 0 0; - line-height: 35px; - font-size: 120%; - } - #stream.global .btn:not([data-unread="0"]) { - background: #3498db; - color: #fff; - font-weight: bold; - } - #stream.global .btn:first-child:not([data-unread="0"]):after { - top: 0; right: 5px; - border: 0; - background: none; - color: #fff; - font-weight: bold; - box-shadow: none; - } - #stream.global .box-category .feeds { - display: block; - max-height: 250px; - margin: 0; - list-style: none; - overflow: auto; - } - #stream.global .box-category .feeds .item { - padding: 2px 10px; - font-size: 90%; - } - #stream.global .box-category .feed { - width: 220px; - } - -.content { - min-height: 150px; - max-width: 550px; - margin: 0 auto; - padding: 20px 10px; - line-height: 170%; - word-wrap: break-word; -} - .content h1, .content h2, .content h3 { - margin: 20px 0 5px; - } - .content > .title { - font-size: x-large; - margin: 0; - } - - .content p { - margin: 0 0 20px; - } - img.big { - display: block; - margin: 10px auto; - } - figure img.big { - margin: 0; - } - .content hr { - margin: 30px 0; - height: 1px; - background: #ddd; - border: 0; - } - .content pre { - margin: 10px auto; - padding: 10px; - overflow: auto; - background: #000; - color: #fff; - font-size: 110%; - } - .content q, .content blockquote { - display: block; - margin: 5px 0; - padding: 5px 20px; - font-style: italic; - border-left: 4px solid #ccc; - color: #666; - } - .content blockquote p { - margin: 0; - } - -#panel { - display: none; - position: fixed; - top: 10px; bottom: 10px; - left: 100px; right: 100px; - overflow: auto; - background: #fff; - border: 1px solid #95a5a6; - border-radius: 5px; -} - #panel .close { - position: fixed; - top: 10px; right: 0px; - display: inline-block; - width: 26px; - height: 26px; - margin: 0 10px 0 0; - border-radius: 3px; - text-align: center; - line-height: 24px; - background: #95a5a6; - } - #panel .close:hover { - background: #7f8c8d; - } - -#overlay { - display: none; - position: fixed; - top: 0; bottom: 0; - left: 0; right: 0; - background: rgba(0, 0, 0, 0.9); -} - -.flux_content .bottom { - font-size: 90%; - text-align: center; -} - -.hide_posts > :not(.active) > .flux_content { - display:none; -} - -/*** PAGINATION ***/ -.pagination { - display: table; - width: 100%; - margin: 0; - background: #ecf0f1; - text-align: center; - color: #000; - font-size: 80%; - line-height: 200%; - table-layout: fixed; - font-weight: bold; -} - .pagination .item { - display: table-cell; - line-height: 40px; - vertical-align: top; - } - .pagination .item.pager-current { - font-weight: bold; - font-size: 140%; - color: #ecf0f1; - background: #34495e; - } - .pagination .item.pager-first, - .pagination .item.pager-previous, - .pagination .item.pager-next, - .pagination .item.pager-last { - width: 100px; - } - .pagination .item a { - display: block; - color: #000; - font-weight: bold; - line-height: 40px; - } - .pagination .item a:hover { - color: #ecf0f1; - background: #34495e; - } - -#nav_entries { - display: table; - width: 250px; - height: 40px; - position: fixed; - bottom: 0; - left: 0; - margin: 0; - background: #34495e; - text-align: center; - line-height: 40px; - table-layout: fixed; -} - #nav_entries .item { - display: table-cell; - width: 30%; - } - #nav_entries a { - display: block; - } - #nav_entries .i_up { - margin: 5px 0 0; - vertical-align: top; - } - -.pagination .loading, -.pagination a:hover.loading { - background: url("loader.gif") center center no-repeat #34495e; - font-size: 0; -} - -#bigMarkAsRead { - background: #ecf0f1; - display: block; - font-style: normal; - padding: 32px 0 64px 0; - text-align: center; - text-decoration: none; - text-shadow: 0 -1px 0 #aaa; -} - #bigMarkAsRead:hover { - background: #34495e; - color: #fff; - } - .bigTick { - font-size: 72pt; - line-height: 1.6em; - } - -/*** NOTIFICATION ***/ -#notification { - position: absolute; - top: 10px; - left: 25%; right: 25%; - min-height: 30px; - padding: 10px; - line-height: 30px; - text-align: center; - border-radius: 3px; - background: #ddd; - color: #666; - font-weight: bold; - z-index: 10; -} - #notification.closed { - display: none; - } - #notification.good { - background: #1abc9c; - color: #fff; - } - #notification.bad { - background: #e74c3c; - color: #fff; - } - #notification a.close { - position: absolute; - top: -6px; right: -6px; - display: inline-block; - width: 16px; - height: 16px; - padding: 5px; - border-radius: 3px; - line-height: 16px; - } - #notification.good a.close { - background: #1abc9c; - } - #notification.bad a.close { - background: #e74c3c; - } - -.toggle_aside, .btn.toggle_aside { - display: none; -} - -.actualizeProgress { - position: fixed; - top: 10px; - left: 25%; right: 25%; - padding: 5px; - background: #3498db; - color: #fff; - text-align: center; - border-radius: 3px; - font-weight: bold; -} - .actualizeProgress progress { - max-width: 100%; - width: 250px; - height: 15px; - vertical-align: middle; - background: #fff; - border: none; - } - .actualizeProgress .progress { - color: #ecf0f1; - } - -.logs { - border: 1px solid #34495e; -} - .log { - margin: 10px 0; - padding: 5px 2%; - overflow: auto; - background: #fafafa; - color: #666; - font-size: 90%; - } - .log>.date { - margin: 0 10px 0 0; - padding: 5px 10px; - border-radius: 20px; - } - .log.error>.date { - background: #e74c3c; - color: #fff; - } - .log.warning>.date { - background: #f39c12; - } - .log.notice>.date { - background: #ecf0f1; - } - .log.debug>.date { - background: #111; - color: #eee; - } - -.form-group table { - border-collapse:collapse; - margin:10px 0 0 220px; - text-align:center; -} - -.form-group tr, .form-group th, .form-group td { - font-weight:normal; - padding:.5em; -} - -select.number option { - text-align:right; -} - -@media(min-width: 841px) { - .flux:not(.current):hover .item.title { - max-width: calc(100% - 580px); - padding-right: 1.5em; - position: absolute; - } -} - -@media(max-width: 840px) { - .header, - .aside .btn-important, - .aside .feeds .dropdown, - .flux_header .item.website span, - .item.date { - display: none; - } - .flux_header .item.website { - width: 40px; - text-align: center; - } - .flux_header .item.website .favicon { - padding: 12px; - } - - .nav-login { - display: block; - } - - .pagination { - margin: 0 0 40px; - } - .pagination .pager-previous, .pagination .pager-next { - width: 100px; - } - - .toggle_aside, .btn.toggle_aside { - display: inline-block; - } - .aside { - position: fixed; - top: 0; left: 0; - width: 0; - overflow: hidden; - z-index: 10; - transition: width 200ms linear; - background: #ecf0f1; - } - .aside.aside_flux { - padding: 10px 0 0; - } - .aside:target { - width: 80%; - border-right: 1px solid #aaa; - overflow: auto; - } - .aside .toggle_aside { - position: absolute; - right: 10px; - display: inline-block; - width: 26px; - height: 26px; - margin: 0 10px 0 0; - border-radius: 3px; - text-align: center; - line-height: 24px; - background: #95a5a6; - } - .aside .toggle_aside:hover { - background: #7f8c8d; - } - .aside .categories { - margin: 30px 0; - } - - #nav_entries { - width: 100%; - } - - .nav_menu .btn { - margin: 5px 10px; - } - .nav_menu .stick { - margin: 0 10px; - } - .nav_menu .stick .btn { - margin: 5px 0; - } - .nav_menu .search { - display: inline-block; - max-width: 97%; - } - .nav_menu .search input { - max-width: 97%; - width: 90px; - } - .nav_menu .search input:focus { - width: 400px; - } - - #panel { - left: 5px; right: 5px; - } - - .day .date { - display: none; - } - .day .name { - height: 2.6em; - font-size: 1em; - text-shadow: none; - } - - #notification, - .actualizeProgress { - top: 0; - left: 0; - right: 0; - border-radius: 0; - } - #notification a.close, - #notification.good a.close, - #notification.bad a.close { - left: 0; right: 0; - top: 0; bottom: 0; - width: auto; - height: auto; - background: transparent; - border: none; - } - #notification a.close .icon { - display: none; - } -} - -/*** FALLBACK ***/ -.dropdown-menu:after { - -moz-transform: rotate(45deg); - -webkit-transform: rotate(45deg); - -ms-transform: rotate(45deg); -} - -input.extend { - -moz-transition: width 200ms linear; - -webkit-transition: width 200ms linear; - -o-transition: width 200ms linear; - -ms-transition: width 200ms linear; -} - -@media print { - .header, - .aside, - .nav_menu, - .day, - .flux_header, - .flux_content .bottom, - .pagination { - display: none; - } - - html, body { - background: #fff; - color: #000; - font-family: Serif; - font-size: 12pt; - } - - #global, - .flux_content { - display: block !important; - } - - .flux_content .content { - width: 100% !important; - text-align: justify; - } - - .flux_content .content a { - color: #000; - } - .flux_content .content a:after { - content: " (" attr(href) ") "; - text-decoration: underline; - } -} - -.stat { - border:1px solid #aaa; - border-radius:10px; - box-shadow:2px 2px 5px #aaa; - margin:10px 0; - padding:0 5px; -} -.stat > h2 { - border-bottom:1px solid #aaa; - margin:0 -5px; - padding-left:5px; -} -.stat > div { - margin:5px 0; -} -.stat > table { - border-collapse:collapse; - margin:5px 0; - width:100%; -} -.stat > table > thead > tr { - border-bottom:2px solid #aaa; -} -.stat > table > tbody > tr { - border-bottom:1px solid #aaa; -} -.stat > table > tbody > tr:last-child { - border-bottom:0; -} -.stat > table th, .stat > table td { - border-left:2px solid #aaa; - padding:5px; -} -.stat > table th:first-child, .stat > table td:first-child { - border-left:0; -} -.stat > table td.numeric{ - margin:5px 0; - text-align:center; -}
\ No newline at end of file diff --git a/p/themes/Flat/global.css b/p/themes/Flat/global.css deleted file mode 100644 index 4044dd781..000000000 --- a/p/themes/Flat/global.css +++ /dev/null @@ -1,534 +0,0 @@ -@charset "UTF-8"; - -/* FONTS */ -@font-face { - font-family: "OpenSans"; - src: url("../fonts/openSans.woff") format("woff"); -} - - -* { - margin: 0; - padding: 0; -} -html, body { - height: 100%; - font-size: 95%; - font-family: "OpenSans", "Cantarell", "Helvetica", "Arial", sans-serif; -} - -/* LIENS */ -a { - color: #2980b9; - text-decoration: none; -} - a:hover { - text-decoration: underline; - } - -/* LISTES */ -ul, ol, dl { - margin: 10px 0 10px 30px; - line-height: 190%; -} - dd { - margin: 0 0 10px 30px; - } - -/* TITRES */ -h1, h2, h3 { - min-height: 40px; - margin: 15px 0 5px; - line-height: 40px; -} - -/* IMG */ -figure { - margin: 5px 0 10px; - text-align: center; -} - figcaption { - display: inline-block; - padding: 3px 20px; - color: #999; - font-style: italic; - border-bottom: 1px solid #ccc; - } -img { - height: auto; - max-width: 100%; - vertical-align: middle; -} - a img { - border: none; - } - -/* VIDEOS */ -iframe, embed, object, video { - max-width: 100%; -} - -/* FORMULAIRES */ -legend { - display: inline-block; - margin: 20px 0 5px; - padding: 5px 20px; - font-size: 150%; - clear: both; - background: #ecf0f1; - border-radius: 20px; -} -label { - display: block; - min-height: 25px; - padding: 5px 0; - font-size: 12px; - line-height: 25px; - cursor: pointer; - font-weight: bold; - color: #444; -} -input { - width: 180px; -} -textarea { - width: 360px; - height: 100px; -} -input, select, textarea { - display: inline-block; - max-width: 100%; - min-height: 25px; - padding: 5px; - background: #FFF; - border: none; - border-bottom: 3px solid #ddd; - color: #666; - line-height: 25px; - vertical-align: middle; - border-radius: 5px; -} - option { - padding:0 .5em 0 .5em; - } - input[type="radio"], - input[type="checkbox"] { - width: 15px !important; - min-height: 15px !important; - } - input:focus, select:focus, textarea:focus { - color: #333; - border-color: #2980b9; - } - input:invalid, select:invalid { - border-color: red; - box-shadow: 0 0 2px 1px red; - } - input:focus.extend { - width: 300px; - transition: width 200ms linear; - } - -.form-group { - margin: 5px 0; - border: 1px solid transparent; -} - .form-group:after { - content: ""; - display: block; - clear: both; - } - .form-group:hover { - background: #fff; - border: 1px solid #eee; - border-radius: 3px; - } - .form-group.form-actions { - min-width: 250px; - margin: 20px 0; - padding: 5px 0; - background: #ecf0f1; - border-top: 3px solid #bdc3c7; - border-radius: 5px 5px 0 0; - } - .form-group.form-actions .btn { - margin: 0 10px; - } - .form-group .group-name { - display: block; - float: left; - width: 200px; - padding: 10px 0; - text-align: right; - } - .form-group .group-controls { - min-width: 250px; - min-height: 25px; - margin: 0 0 0 220px; - padding: 5px 0; - } - .form-group .group-controls label { - font-weight: normal; - font-size: 14px; - color: #000; - } - .form-group .group-controls .control { - display: block; - min-height: 30px; - padding: 5px 0; - line-height: 25px; - font-size: 14px; - } - -.stick { - display: inline-block; - white-space: nowrap; - font-size: 0px; - vertical-align: middle; -} - .stick .btn, - .stick input { - font-size: 14px; - border-radius: 0; - } - .stick .btn:first-child, - .stick input:first-child { - border-radius: 5px 0 0 5px; - } - .stick .btn:last-child, - .stick input:last-child, - .stick .btn + .dropdown > .btn { - border-radius: 0 5px 5px 0; - } - .stick .btn + .dropdown a { - font-size: 12px; - } - -.btn { - display: inline-block; - min-height: 38px; - min-width: 18px; - padding: 5px 10px; - background: #3498db; - border-radius: 5px; - border: none; - border-bottom: 3px solid #2980b9; - color: #fff; - line-height: 20px; - vertical-align: middle; - cursor: pointer; - overflow: hidden; -} - a.btn { - min-height: 25px; - line-height: 25px; - } - .btn.active, - .btn:active, - .btn:hover, - .dropdown-target:target ~ .btn.dropdown-toggle { - background: #2980b9; - text-decoration: none; - } - - .btn-important { - background: #e67e22; - color: #fff; - border-bottom: 3px solid #d35400; - } - .btn-important:active, - .btn-important:hover { - background: #d35400; - } - - .btn-attention { - background: #e74c3c; - color: #fff; - border-bottom: 3px solid #c0392b; - } - .btn-attention:hover, - .btn-attention:active { - background: #c0392b; - } - -/* NAVIGATION */ -.nav-list { - border-right: 1px solid #ecf0f1; -} -.nav-list .nav-header, -.nav-list .item { - display: block; - height: 35px; - line-height: 35px; - margin: 5px 0; -} - .nav-list .item:hover, - .nav-list .item.active { - background: #2980b9; - color: #fff; - } - .nav-list .item:hover a, - .nav-list .item.active a { - color: #fff; - } - .nav-list .disable { - color: #aaa; - background: #fafafa; - text-align: center; - } - .nav-list .item > * { - display: block; - padding: 0 10px; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - .nav-list a:hover { - text-decoration: none; - } - .nav-list .item.error a { - color: #BD362F; - } - .nav-list .item:hover.error a, - .nav-list .item.active.error a { - color: #fff; - background: #BD362F; - } - .nav-list .item.empty a { - color: #f39c12; - } - .nav-list .item:hover.empty a, - .nav-list .item.active.empty a { - color: #fff; - background: #f39c12; - } - - .nav-list .nav-header { - padding: 0 10px; - margin: 0; - color: #fff; - background: #34495e; - font-weight: bold; - } - .nav-list .separator { - display: block; - height: 0; - margin: 5px 0; - border-bottom: 1px solid #ddd; - } - - .nav-list .nav-form { - padding: 3px; - text-align: center; - } - -.nav-head { - display: block; - margin: 0; - background: #34495e; - color: #fff; - text-align: right; -} - .nav-head a { - color: #fff; - } - .nav-head .item { - display: inline-block; - padding: 5px 10px; - } - -/* HORIZONTAL-LIST */ -.horizontal-list { - display: table; - table-layout: fixed; - margin: 0; - padding: 0; - width: 100%; -} - .horizontal-list .item { - display: table-cell; - vertical-align: middle; - } - -/* DROPDOWN */ -.dropdown { - position: relative; - display: inline-block; -} - .dropdown-target { - display: none; - } - - .dropdown-menu { - display: none; - min-width: 200px; - margin: 5px 0 0; - padding: 5px 0; - position: absolute; - right: 0px; - background: #fff; - border: 1px solid #95a5a6; - border-radius: 3px; - text-align: left; - } - .dropdown-menu:after { - content: ""; - position: absolute; - top: -6px; - right: 13px; - width: 10px; - height: 10px; - background: #fff; - border-top: 1px solid #95a5a6; - border-left: 1px solid #95a5a6; - z-index: -10; - transform: rotate(45deg); - } - .dropdown-header { - display: block; - padding: 0 5px; - color: #34495e; - font-weight: bold; - font-size: 14px; - line-height: 30px; - } - .dropdown-menu > .item { - display: block; - height: 30px; - font-size: 90%; - line-height: 30px; - } - .dropdown-menu > .item > a { - display: block; - padding: 0 25px; - line-height: 30px; - } - .dropdown-menu > .item.share > a { - display: list-item; - list-style-position:inside; - list-style-type:decimal; - } - .dropdown-menu > .item:hover > a { - background: #2980b9; - color: #fff; - } - .dropdown-menu > .item[aria-checked="true"] > a:before { - content: '✓ '; - font-weight: bold; - margin: 0 0 0 -1.2em; - padding: 0 0.2em 0 0; - } - .dropdown-menu > .item:hover > a { - color: #fff; - text-decoration: none; - } - .dropdown-menu .input { - display: block; - height: 40px; - font-size: 90%; - line-height: 30px; - } - .dropdown-menu label { - font-weight: normal; - } - .dropdown-menu .input select, - .dropdown-menu .input input { - display: block; - height: 20px; - width: 95%; - margin: auto; - padding: 2px 5px; - border-radius: 3px; - } - .dropdown-menu .input select { - width: 70%; - height: auto; - } - .dropdown-menu .separator { - display: block; - height: 0; - margin: 5px 0; - border-bottom: 1px solid #95a5a6; - } - .dropdown-target:target ~ .dropdown-menu { - display: block; - z-index: 10; - } - .dropdown-close { - display: inline; - } - .dropdown-close a { - font-size: 0; - position: fixed; - top: 0; bottom: 0; - left: 0; right: 0; - display: block; - z-index: -10; - } - -/* ALERTS */ -.alert { - display: block; - width: 90%; - margin: 15px auto; - padding: 10px 15px; - background: #f4f4f4; - border: 1px solid #ccc; - border-right: 1px solid #aaa; - border-bottom: 1px solid #aaa; - border-radius: 5px; - color: #aaa; - text-shadow: 0 0 1px #eee; -} - .alert-head { - margin: 0; - font-weight: bold; - font-size: 110%; - } - .alert > a { - color: inherit; - text-decoration: underline; - } - .alert-warn { - background: #ffe; - border: 1px solid #eeb; - color: #c95; - } - .alert-success { - background: #dfd; - border: 1px solid #cec; - color: #484; - } - .alert-error { - background: #fdd; - border: 1px solid #ecc; - color: #844; - } - -/* ICÔNES */ -.icon { - display: inline-block; - width: 16px; - height: 16px; - vertical-align: middle; - line-height: 16px; -} - -/* Prompt (centré) */ -.prompt { - text-align: center; -} - .prompt label { - text-align: left; - } - .prompt form { - margin: 1em auto 2.5em auto; - width: 10em; - } - .prompt input { - margin: .4em auto 1.1em auto; - width: 100%; - } - .prompt p { - margin: 20px 0; - } diff --git a/p/themes/Flat/icons/icon.svg b/p/themes/Flat/icons/icon.svg new file mode 100644 index 000000000..9657d020c --- /dev/null +++ b/p/themes/Flat/icons/icon.svg @@ -0,0 +1,12 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"> + <title>Logo FreshRSS</title> + <circle fill="#2980b9" cx="128" cy="128" r="33"/> + <g fill="none" stroke="#2980b9" stroke-width="24"> + <g stroke-opacity="0.3"> + <path d="M12,128 A116,116 0 1,1 128,244"/> + <path d="M54,128 A74,74 0 1,1 128,202"/> + </g> + <path d="M128,12 A116,116 0 0,1 244,128"/> + <path d="M128,54 A74,74 0 0,1 202,128"/> + </g> +</svg> diff --git a/p/themes/Flat/icons/key.svg b/p/themes/Flat/icons/key.svg new file mode 100644 index 000000000..77d0218e5 --- /dev/null +++ b/p/themes/Flat/icons/key.svg @@ -0,0 +1,7 @@ +<svg xmlns="http://www.w3.org/2000/svg"> +<g transform="translate(-340.99994,-257)" fill="#ffffff"> +<path style="block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m346,260c-2.7496,0-5,2.2504-5,5s2.2504,5,5,5c1.5862,0,2.9034-0.84459,3.8125-2h4.8438,0.75l0.21875-0.75,1.0312-4,0.3125-1.25h-1.2812-5.875c-0.90914-1.1554-2.2263-2-3.8125-2zm0,2c1.1158,0,2.0379,0.59507,2.5625,1.5l0.3125,0.5h0.5625,4.9688l-0.53125,2h-4.4375-0.5625l-0.3125,0.5c-0.52462,0.90493-1.4466,1.5-2.5625,1.5-1.6687,0-3-1.3313-3-3s1.3313-3,3-3z"/> +<path opacity="0.35" style="enable-background:accumulate;color:#000000;" d="M355.5,265,350,265,349.44,267,355,267z" fill-rule="nonzero"/> +<path style="enable-background:accumulate;color:#000000;" d="m346,265c0,0.55228-0.44772,1-1,1s-1-0.44772-1-1,0.44772-1,1-1,1,0.44772,1,1z" fill-rule="nonzero"/> +</g> +</svg> diff --git a/p/themes/Flat/icons/rss.svg b/p/themes/Flat/icons/rss.svg new file mode 100644 index 000000000..4d4faf7ae --- /dev/null +++ b/p/themes/Flat/icons/rss.svg @@ -0,0 +1,6 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g fill-rule="nonzero" transform="translate(-561,-301.00012)" fill="#fff"> +<path style="enable-background:new;color:#000000;" d="m325.06,97.188c0,1.7872-0.89543,3.2361-2,3.2361s-2-1.4488-2-3.2361c0-1.7872,0.89543-3.2361,2-3.2361s2,1.4488,2,3.2361z" transform="matrix(1.0000007,0,0,0.61803426,241.93747,252.93479)"/> +<path style="enable-background:new;color:#000000;" d="m563,303,0,1c0,0.55016,0.45347,1,1,1,4.9706,0,9,4.0294,9,9,0,0.55016,0.45347,1,1,1h1v-1c0-6.0751-4.9249-11-11-11h-1zm0,4,0,1c0,0.55016,0.45347,1,1,1,2.7614,0,5,2.2386,5,5,0,0.55016,0.45347,1,1,1h1v-1c0-3.866-3.134-7-7-7h-1z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Flat/icons/view-global.svg b/p/themes/Flat/icons/view-global.svg new file mode 100644 index 000000000..9d2cd0f32 --- /dev/null +++ b/p/themes/Flat/icons/view-global.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g transform="translate(-61-867)" fill="#fff" color="#000"><rect height="2" rx=".385" ry=".379" width="2" x="64" y="870"/><rect height="2" rx=".385" ry=".379" width="2" x="68" y="870"/><rect height="2" rx=".385" ry=".379" width="2" x="72" y="870"/><rect height="2" rx=".385" ry=".379" width="2" x="64" y="874.02"/><rect height="2" rx=".385" ry=".379" width="2" x="68" y="874.02"/><rect height="2" rx=".385" ry=".379" width="2" x="72" y="874.02"/><rect height="2" rx=".385" ry=".379" width="2" x="64" y="878"/><rect height="2" rx=".385" ry=".379" width="2" x="68" y="878"/><rect height="2" rx=".385" ry=".379" width="2" x="72" y="878"/></g></svg>
\ No newline at end of file diff --git a/p/themes/Flat/icons/view-normal.svg b/p/themes/Flat/icons/view-normal.svg new file mode 100644 index 000000000..8eda2047e --- /dev/null +++ b/p/themes/Flat/icons/view-normal.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g transform="translate(-40-746)" fill="#fff" color="#fff"><path d="m43 749h10v2h-10z"/><path d="m43 753h10v2h-10z"/><path d="m43 757h10v2h-10z"/></g></svg>
\ No newline at end of file diff --git a/p/themes/Flat/icons/view-reader.svg b/p/themes/Flat/icons/view-reader.svg new file mode 100644 index 000000000..0e4f60a1a --- /dev/null +++ b/p/themes/Flat/icons/view-reader.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g transform="translate(-181-867)" fill="#fff" color="#fff"><path d="m 181,868 0,1 0,11 0,1 1,0 5,0 c 0.1754,0 0.52538,0.15166 0.8125,0.34375 0.28712,0.19209 0.46875,0.375 0.46875,0.375 L 189,882.4375 l 0.71875,-0.75 c 0,0 0.8963,-0.6875 1.28125,-0.6875 l 5,0 1,0 0,-1 0,-11 0,-1 -1,0 -5,0 c -0.87652,0 -1.56017,0.34756 -2.03125,0.6875 -0.0301,-0.0207 -0.031,-0.0105 -0.0625,-0.0312 C 188.44557,868.35254 187.82811,868 187,868 l -5,0 -1,0 z m 2,2 4,0 c 0.13821,0 0.51476,0.14746 0.8125,0.34375 0.29774,0.19629 0.5,0.375 0.5,0.375 l 0.71875,0.6875 0.6875,-0.71875 c 0,0 0.89975,-0.6875 1.28125,-0.6875 l 4,0 0,9 -4,0 c -0.87693,0 -1.56008,0.34735 -2.03125,0.6875 -0.0196,-0.0135 -0.011,-0.0177 -0.0312,-0.0312 C 188.47725,879.34834 187.83512,879 187,879 l -4,0 0,-9 z"/><g transform="scale(-1 1)"><rect height="2" rx=".375" width="3" x="-187" y="872"/><rect height="2" rx=".375" width="3" x="-187" y="875"/><rect height="2" rx=".375" width="3" x="-194" y="872"/><rect height="2" rx=".375" width="3" x="-194" y="875"/></g></g></svg>
\ No newline at end of file diff --git a/p/themes/Flat/metadata.json b/p/themes/Flat/metadata.json index 6b94d11c2..3afdc98af 100644 --- a/p/themes/Flat/metadata.json +++ b/p/themes/Flat/metadata.json @@ -2,6 +2,6 @@ "name": "Flat design", "author": "Marien Fressinaud", "description": "Thème plat pour FreshRSS", - "version": 0.1, - "files": ["global.css", "freshrss.css"] + "version": 0.2, + "files": ["_template.css", "flat.css"] }
\ No newline at end of file diff --git a/p/themes/Flat/thumbs/original.png b/p/themes/Flat/thumbs/original.png Binary files differnew file mode 100644 index 000000000..b9cafa9c8 --- /dev/null +++ b/p/themes/Flat/thumbs/original.png diff --git a/p/themes/Origine/freshrss.css b/p/themes/Origine/freshrss.css deleted file mode 100644 index 86bd508df..000000000 --- a/p/themes/Origine/freshrss.css +++ /dev/null @@ -1,961 +0,0 @@ -@charset "UTF-8"; - -/* STRUCTURE */ -.header { - display: table; - width: 100%; - background: #f4f4f4; - table-layout: fixed; -} - .header > .item { - display: table-cell; - padding: 10px 0; - border-bottom: 1px solid #aaa; - vertical-align: middle; - text-align: center; - } - .header > .item.title { - width: 250px; - white-space: nowrap; - } - .logo { - display: inline-block; - font-size: 48px; - height: 32px; - width: 32px; - padding: 10px; - } - .header > .item.title h1 { - display: inline-block; - margin: 0; - text-shadow: 1px -1px 0 #ccc; - } - .header > .item.search input { - width: 230px; - } - .header .item.search input:focus { - width: 330px; - } - .header > .item.configure { - width: 100px; - } - -.item a:hover { - text-decoration: none; -} - -#global { - display: table; - width: 100%; - height: 100%; - background: #fafafa; - table-layout: fixed; -} - .aside { - display: table-cell; - height: 100%; - width: 250px; - vertical-align: top; - border-right: 1px solid #aaa; - background: #fff; - } - .aside .nav-form input { - width: 180px; - } - .aside.aside_flux { - padding: 10px 0 40px; - } - .aside.aside_feed .nav-form input { - width: 140px; - } - .aside.aside_feed .nav-form .dropdown .dropdown-menu { - right: -20px; - } - .aside.aside_feed .nav-form .dropdown .dropdown-menu:after { - right: 33px; - } - - .nav-login { - display: none; - } - - .nav_menu { - width: 100%; - background: #fafafa; - border-bottom: 1px solid #aaa; - text-align: center; - padding: 5px 0; - } - .nav_menu .search { - display:none; - } - -.favicon { - height: 16px; - width: 16px; -} - -.categories { - margin: 0; - padding: 0; - text-align: center; - list-style: none; -} - .category { - display: block; - width: 220px; - margin: 10px auto; - text-align: left; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - .category .btn:first-child { - width: 195px; - position: relative; - } - .category.stick .btn:first-child { - width:160px; - } - .category .btn:first-child:not([data-unread="0"]):after { - content: attr(data-unread); - position: absolute; - top: 3px; right: 3px; - padding: 1px 5px; - background: #ccc; - color: #fff; - font-size: 90%; - border: 1px solid #bbb; - border-radius: 5px; - box-shadow: 1px 3px 3px #aaa inset; - text-shadow: 0 0 1px #aaa; - } - .category + .feeds:not(.active) { - display:none; - } - .categories .feeds { - width: 100%; - margin: 0; - list-style: none; - } - .categories .feeds .item.active { - background: #0062BE; - } - .categories .feeds .item.active .feed { - color: #fff; - } - .categories .feeds .item.empty .feed { - color: #e67e22; - } - .categories .feeds .item.empty.active { - background: #e67e22; - } - .categories .feeds .item.empty.active .feed { - color: #fff; - } - .categories .feeds .item.error .feed { - color: #BD362F; - } - .categories .feeds .item .feed { - display: inline-block; - margin: 0; - width: 165px; - line-height: 35px; - font-size: 90%; - vertical-align: middle; - text-align: left; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - .feed:not([data-unread="0"]) { - font-weight:bold; - } - .feed:not([data-unread="0"]):before { - content: "(" attr(data-unread) ") "; - } - .categories .feeds .dropdown-menu { - left: 0; - } - .categories .feeds .dropdown-menu:after { - left: 2px; - } - .categories .feeds .item .dropdown-toggle > .icon { - visibility: hidden; - cursor: pointer; - } - .categories .feeds .item .dropdown-target:target ~ .dropdown-toggle > .icon, - .categories .feeds .item:hover .dropdown-toggle > .icon, - .categories .feeds .item.active .dropdown-toggle > .icon { - background-color: #fff; - border-radius: 3px; - visibility: visible; - } - -.post { - padding: 10px 50px; -} - .post form { - margin: 10px 0; - } - -.day { - min-height: 50px; - padding: 0 10px; - font-size: 130%; - font-weight: bold; - line-height: 50px; - background: #fff; - border-top: 1px solid #aaa; - border-bottom: 1px solid #aaa; -} - #new-article + .day { - border-top: none; - } - .day .name { - position: absolute; - right: 0; - width: 50%; - height: 1.5em; - padding: 0 10px 0 0; - overflow: hidden; - color: #aab; - font-size: 1.8em; - opacity: .3; - text-shadow: 0px -1px 0px #333; - font-style: italic; - white-space: nowrap; - text-overflow: ellipsis; - text-align: right; - } - -#new-article { - display: none; - min-height: 40px; - background: #0084CC; - text-align: center; -} - #new-article:hover { - background: #0066CC; - } - #new-article > a { - display: block; - line-height: 40px; - color: #fff; - font-weight: bold; - } - #new-article > a:hover { - text-decoration: none; - } - -.flux { - border-left: 3px solid #aaa; - background: #fafafa; -} - .flux:hover { - background: #fff; - } - .flux.not_read { - border-left: 3px solid #FF5300; - background: #FFF3ED; - } - .flux.favorite { - border-left: 3px solid #FFC300; - background: #FFF6DA; - } - .flux.current { - border-left: 3px solid #0062BE; - background: #fff; - } - - .horizontal-list > .item:not(.title):not(.website) > a { - display: block; - } - - .flux_header { - background: inherit; - height: 25px; - font-size: 12px; - border-top: 1px solid #ddd; - cursor: pointer; - } - .flux .item { - line-height: 40px; - white-space: nowrap; - } - .flux_header > .item { - overflow: hidden; - text-overflow: ellipsis; - } - .flux .item.manage { - width: 40px; - text-align: center; - } - .flux .item.website { - width: 200px; - } - .website .favicon { - padding: 5px; - } - .flux .item.title { - background: inherit; - } - .flux .item.title a { - color: #000; - outline: none; - } - .flux.not_read .item.title, - .flux.current .item.title { - font-weight: bold; - } - .flux .item.date { - width: 145px; - padding:0 5px 0 0; - text-align: right; - font-size: 10px; - color: #666; - } - .link { - width: 40px; - text-align: center; - } - -#stream.reader .flux { - padding: 0 0 30px; - border: none; - background: #f0f0f0; - color: #333; -} - #stream.reader .flux .author { - margin: 0 0 10px; - font-size: 90%; - color: #666; - } - -#stream.global { - text-align: center; -} - #stream.global .box-category { - display: inline-block; - width: 280px; - margin: 20px 10px; - vertical-align: top; - background: #fff; - border: 1px solid #aaa; - border-radius: 5px; - text-align: left; - box-shadow: 0 0 5px #bbb; - } - #stream.global .category { - width: 100%; - margin: 0; - } - #stream.global .btn { - display: block; - width: auto; - height: 35px; - margin: 0; - padding: 0 10px; - background: #eee; - border: none; - border-bottom: 1px solid #aaa; - border-radius: 5px 5px 0 0; - line-height: 35px; - font-size: 120%; - } - #stream.global .btn:not([data-unread="0"]) { - background: #0084CC; - color: #fff; - font-weight: bold; - text-shadow: none; - } - #stream.global .btn:first-child:not([data-unread="0"]):after { - top: 0; right: 5px; - border: 0; - background: none; - color: #fff; - font-weight: bold; - box-shadow: none; - text-shadow: none; - } - #stream.global .box-category .feeds { - display: block; - max-height: 250px; - margin: 0; - list-style: none; - overflow: auto; - } - #stream.global .box-category .feeds .item { - padding: 2px 10px; - font-size: 90%; - } - #stream.global .box-category .feed { - width: 220px; - } - -.content { - min-height: 150px; - max-width: 550px; - margin: 0 auto; - padding: 20px 10px; - line-height: 170%; - word-wrap: break-word; -} - .content h1, .content h2, .content h3 { - margin: 20px 0 5px; - } - .content > .title { - font-size: x-large; - margin: 0; - } - - .content p { - margin: 0 0 20px; - } - img.big { - display: block; - margin: 10px auto; - } - figure img.big { - margin: 0; - } - .content hr { - margin: 30px 0; - height: 1px; - background: #ddd; - border: 0; - } - .content pre { - margin: 10px auto; - padding: 10px; - overflow: auto; - background: #000; - color: #fff; - font-size: 110%; - } - .content q, .content blockquote { - display: block; - margin: 5px 0; - padding: 5px 20px; - font-style: italic; - border-left: 4px solid #ccc; - color: #666; - } - .content blockquote p { - margin: 0; - } - -#panel { - display: none; - position: fixed; - top: 10px; bottom: 10px; - left: 100px; right: 100px; - overflow: auto; - background: #fff; - border: 1px solid #95a5a6; - border-radius: 5px; -} - #panel .close { - position: fixed; - top: 10px; right: 0; - display: inline-block; - width: 26px; - height: 26px; - margin: 0 10px 0 0; - border: 1px solid #ccc; - border-radius: 20px; - text-align: center; - line-height: 26px; - background: #fff; - } - -#overlay { - display: none; - position: fixed; - top: 0; bottom: 0; - left: 0; right: 0; - background: rgba(0, 0, 0, 0.9); -} - -.flux_content .bottom { - font-size: 90%; - text-align: center; -} - -.hide_posts > :not(.active) > .flux_content { - display:none; -} - -/*** PAGINATION ***/ -.pagination { - display: table; - width: 100%; - margin: 0; - background: #fafafa; - text-align: center; - color: #333; - font-size: 80%; - line-height: 200%; - table-layout: fixed; -} - .pagination .item { - display: table-cell; - line-height: 40px; - } - .pagination .item.pager-current { - font-weight: bold; - font-size: 140%; - } - .pagination .pager-first, - .pagination .pager-previous, - .pagination .pager-next, - .pagination .pager-last { - width: 100px; - } - .pagination .item a { - display: block; - color: #333; - font-style: italic; - } - .pagination:first-child .item { - border-bottom: 1px solid #aaa; - } - .pagination:last-child .item { - border-top: 1px solid #aaa; - } - -#nav_entries { - display: table; - width: 250px; - height: 40px; - position: fixed; - bottom: 0; - left: 0; - margin: 0; - background: #fff; - border-top: 1px solid #ddd; - text-align: center; - line-height: 40px; - table-layout: fixed; -} - #nav_entries .item { - display: table-cell; - width: 30%; - } - #nav_entries a { - display: block; - } - #nav_entries .i_up { - margin: 5px 0 0; - vertical-align: top; - } - -.loading { - background: url("loader.gif") center center no-repeat; - font-size: 0; -} - -#bigMarkAsRead { - display: block; - font-style: normal; - padding: 32px 0 64px 0; - text-align: center; - text-decoration: none; - text-shadow: 0 -1px 0 #aaa; -} - #bigMarkAsRead:hover { - background: #333; - color: #fff; - } - .bigTick { - font-size: 72pt; - line-height: 1.6em; - } - -/*** NOTIFICATION ***/ -#notification { - position: absolute; - top: 10px; - left: 25%; right: 25%; - min-height: 30px; - padding: 10px; - line-height: 30px; - text-align: center; - border-radius: 5px; - box-shadow: 0 0 5px #666; - background: #ddd; - color: #666; - font-weight: bold; - z-index: 10; -} - #notification.closed { - display: none; - } - #notification.good { - background: #f4f899; - } - #notification.bad { - background: #f4a899; - } - #notification a.close { - position: absolute; - top: -10px; right: -10px; - display: inline-block; - width: 16px; - height: 16px; - padding: 5px; - background: #fff; - border-radius: 50px; - border: 1px solid #aaa; - line-height: 16px; - } - -.toggle_aside, .btn.toggle_aside { - display: none; -} - -.actualizeProgress { - position: fixed; - top: 10px; - left: 25%; right: 25%; - padding: 5px; - background: #fff; - text-align: center; - border: 1px solid #ddd; - border-radius: 5px; -} - .actualizeProgress progress { - max-width: 100%; - vertical-align: middle; - } - .actualizeProgress .progress { - color: #999; - font-size: 90%; - vertical-align: middle; - } - -.logs { - border: 1px solid #aaa; -} - .log { - padding: 5px 2%; - overflow: auto; - background: #fafafa; - border-bottom: 1px solid #999; - color: #333; - font-size: 90%; - } - .log .date { - display: block; - } - .log.error { - background: #fdd; - color: #844; - } - .log.warning { - background: #ffe; - color: #c95; - } - .log.notice { - background: #f4f4f4; - color: #aaa; - } - .log.debug { - background: #111; - color: #eee; - } - -.form-group table { - border-collapse:collapse; - margin:10px 0 0 220px; - text-align:center; -} - -.form-group tr, .form-group th, .form-group td { - border:1px solid #DDD; - font-weight:normal; - padding:.5em; -} - -select.number option { - text-align:right; -} - -@media(min-width: 841px) { - .flux:not(.current):hover .item.title { - max-width: calc(100% - 580px); - padding-right: 1.5em; - position: absolute; - } -} - -@media(max-width: 840px) { - .header, - .aside .btn-important, - .aside .feeds .dropdown, - .flux_header .item.website span, - .item.date { - display: none; - } - .flux_header .item.website { - width: 40px; - text-align: center; - } - .flux_header .item.website .favicon { - padding: 12px; - } - - .nav-login { - display: block; - } - - .pagination { - margin: 0 0 40px; - } - .pagination .pager-previous, .pagination .pager-next { - width: 100px; - } - - .toggle_aside, .btn.toggle_aside { - display: inline-block; - } - .aside { - position: fixed; - top: 0; left: 0; - width: 0; - overflow: hidden; - border-right: none; - z-index: 10; - transition: width 200ms linear; - } - .aside.aside_flux { - padding: 10px 0 0; - } - .aside:target { - width: 80%; - border-right: 1px solid #aaa; - overflow: auto; - } - .aside .toggle_aside { - position: absolute; - right: 0; - display: inline-block; - width: 26px; - height: 26px; - margin: 0 10px 0 0; - border: 1px solid #ccc; - border-radius: 20px; - text-align: center; - line-height: 26px; - } - .aside .categories { - margin: 30px 0; - } - - #nav_entries { - width: 100%; - } - - .nav_menu .btn { - margin: 5px 10px; - } - .nav_menu .stick { - margin: 0 10px; - } - .nav_menu .stick .btn { - margin: 5px 0; - } - .nav_menu .search { - display: inline-block; - max-width: 97%; - } - .nav_menu .search input { - max-width: 97%; - width: 90px; - } - .nav_menu .search input:focus { - width: 400px; - } - - #panel { - left: 5px; right: 5px; - } - - .day .date { - display: none; - } - .day .name { - height: 2.6em; - font-size: 1em; - text-shadow: none; - } - - #notification, - .actualizeProgress { - top: 0; - left: 0; - right: 0; - border-radius: 0; - } - #notification a.close { - left: 0; right: 0; - top: 0; bottom: 0; - width: auto; - height: auto; - background: transparent; - border: none; - } - #notification a.close .icon { - display: none; - } -} - -/*** FALLBACK ***/ -.btn { - background: #fff; - background: -moz-linear-gradient(top, #fff 0%, #eee 100%); - background: -webkit-linear-gradient(top, #fff 0%, #eee 100%); - background: -o-linear-gradient(top, #fff 0%, #eee 100%); - background: -ms-linear-gradient(top, #fff 0%, #eee 100%); -} - .btn:hover { - background: #f0f0f0; - background: -moz-linear-gradient(top, #f8f8f8 0%, #f0f0f0 100%); - background: -webkit-linear-gradient(top, #f8f8f8 0%, #f0f0f0 100%); - background: -o-linear-gradient(top, #f8f8f8 0%, #f0f0f0 100%); - background: -ms-linear-gradient(top, #f8f8f8 0%, #f0f0f0 100%); - } - .btn-important { - background: #0084CC; - background: -moz-linear-gradient(top, #0084CC 0%, #0045CC 100%); - background: -webkit-linear-gradient(top, #0084CC 0%, #0045CC 100%); - background: -o-linear-gradient(top, #0084CC 0%, #0045CC 100%); - background: -ms-linear-gradient(top, #0084CC 0%, #0045CC 100%); - } - .btn-important:hover { - background: -moz-linear-gradient(top, #0066CC 0%, #0045CC 100%); - background: -webkit-linear-gradient(top, #0066CC 0%, #0045CC 100%); - background: -o-linear-gradient(top, #0066CC 0%, #0045CC 100%); - background: -ms-linear-gradient(top, #0066CC 0%, #0045CC 100%); - } - .btn-attention { - background: #E95B57; - background: -moz-linear-gradient(top, #E95B57 0%, #BD362F 100%); - background: -webkit-linear-gradient(top, #E95B57 0%, #BD362F 100%); - background: -o-linear-gradient(top, #E95B57 0%, #BD362F 100%); - background: -ms-linear-gradient(top, #E95B57 0%, #BD362F 100%); - } - .btn-attention:hover { - background: -moz-linear-gradient(top, #D14641 0%, #BD362F 100%); - background: -webkit-linear-gradient(top, #D14641 0%, #BD362F 100%); - background: -o-linear-gradient(top, #D14641 0%, #BD362F 100%); - background: -ms-linear-gradient(top, #D14641 0%, #BD362F 100%); - } - -.dropdown-menu:after { - -moz-transform: rotate(45deg); - -webkit-transform: rotate(45deg); - -ms-transform: rotate(45deg); -} - -.nav-head { - background: #fff; - background: -moz-linear-gradient(top, #fff 0%, #f0f0f0 100%); - background: -webkit-linear-gradient(top, #fff 0%, #f0f0f0 100%); - background: -o-linear-gradient(top, #fff 0%, #f0f0f0 100%); - background: -ms-linear-gradient(top, #fff 0%, #f0f0f0 100%); -} - -input.extend { - -moz-transition: width 200ms linear; - -webkit-transition: width 200ms linear; - -o-transition: width 200ms linear; - -ms-transition: width 200ms linear; -} - -@media(max-width: 840px) { - .aside { - -moz-transition: width 200ms linear; - -webkit-transition: width 200ms linear; - -o-transition: width 200ms linear; - -ms-transition: width 200ms linear; - } -} - -@media print { - .header, - .aside, - .nav_menu, - .day, - .flux_header, - .flux_content .bottom, - .pagination { - display: none; - } - - html, body { - background: #fff; - color: #000; - font-family: Serif; - font-size: 12pt; - } - - #global, - .flux_content { - display: block !important; - } - - .flux_content .content { - width: 100% !important; - text-align: justify; - } - - .flux_content .content a { - color: #000; - } - .flux_content .content a:after { - content: " (" attr(href) ") "; - text-decoration: underline; - } -} - -.stat { - border:1px solid #aaa; - border-radius:10px; - box-shadow:2px 2px 5px #aaa; - margin:10px 0; - padding:0 5px; -} -.stat > h2 { - border-bottom:1px solid #aaa; - margin:0 -5px; - padding-left:5px; -} -.stat > div { - margin:5px 0; -} -.stat > table { - border-collapse:collapse; - margin:5px 0; - width:100%; -} -.stat > table > thead > tr { - border-bottom:2px solid #aaa; -} -.stat > table > tbody > tr { - border-bottom:1px solid #aaa; -} -.stat > table > tbody > tr:last-child { - border-bottom:0; -} -.stat > table th, .stat > table td { - border-left:2px solid #aaa; - padding:5px; -} -.stat > table th:first-child, .stat > table td:first-child { - border-left:0; -} -.stat > table td.numeric{ - margin:5px 0; - text-align:center; -}
\ No newline at end of file diff --git a/p/themes/Origine/global.css b/p/themes/Origine/global.css deleted file mode 100644 index 5792c9e4d..000000000 --- a/p/themes/Origine/global.css +++ /dev/null @@ -1,547 +0,0 @@ -@charset "UTF-8"; - -/* FONTS */ -@font-face { - font-family: "OpenSans"; - src: url("../fonts/openSans.woff") format("woff"); -} - - -* { - margin: 0; - padding: 0; -} -html, body { - height: 100%; - font-size: 95%; - font-family: "OpenSans", "Cantarell", "Helvetica", "Arial", sans-serif; -} - -/* LIENS */ -a { - color: #0062BE; - text-decoration: none; -} - a:hover { - text-decoration: underline; - } - -/* LISTES */ -ul, ol, dl { - margin: 10px 0 10px 30px; - line-height: 190%; -} - dd { - margin: 0 0 10px 30px; - } - -/* TITRES */ -h1, h2, h3 { - min-height: 40px; - margin: 15px 0 5px; - line-height: 40px; -} - -/* IMG */ -figure { - margin: 5px 0 10px; - text-align: center; -} - figcaption { - display: inline-block; - padding: 3px 20px; - color: #999; - font-style: italic; - border-bottom: 1px solid #ccc; - } -img { - height: auto; - max-width: 100%; - vertical-align: middle; -} - a img { - border: none; - } - -/* VIDEOS */ -iframe, embed, object, video { - max-width: 100%; -} - -/* FORMULAIRES */ -legend { - display: block; - width: 100%; - margin: 20px 0 5px; - padding: 5px 0; - border-bottom: 1px solid #ddd; - font-size: 150%; - clear: both; -} -label { - display: block; - min-height: 25px; - padding: 5px 0; - font-size: 14px; - line-height: 25px; - cursor: pointer; -} -input { - width: 180px; -} -textarea { - width: 360px; - height: 100px; -} -input, select, textarea { - display: inline-block; - max-width: 100%; - min-height: 25px; - padding: 5px; - background: #fdfdfd; - border: 1px solid #bbb; - border-radius: 3px; - color: #666; - line-height: 25px; - vertical-align: middle; - box-shadow: 0 2px 2px #eee inset; -} - option { - padding:0 .5em 0 .5em; - } - input[type="radio"], - input[type="checkbox"] { - width: 15px !important; - min-height: 15px !important; - } - input:focus, select:focus, textarea:focus { - color: #0062BE; - border-color: #33BBFF; - box-shadow: 0 2px 2px #DDDDFF inset; - } - input:invalid, select:invalid { - border-color: red; - box-shadow: 0 0 2px 1px red; - } - input:focus.extend { - width: 300px; - transition: width 200ms linear; - } - -.form-group { - margin: 0; -} - .form-group:after { - content: ""; - display: block; - clear: both; - } - .form-group.form-actions { - min-width: 250px; - padding: 5px 0; - background: #f4f4f4; - border-top: 1px solid #ddd; - } - .form-group.form-actions .btn { - margin: 0 10px; - } - .form-group .group-name { - display: block; - float: left; - width: 200px; - padding: 10px 0; - text-align: right; - } - .form-group .group-controls { - min-width: 250px; - min-height: 25px; - margin: 0 0 0 220px; - padding: 5px 0; - } - .form-group .group-controls .control { - display: block; - min-height: 30px; - padding: 5px 0; - line-height: 25px; - font-size: 14px; - } - -.stick { - display: inline-block; - white-space: nowrap; - font-size: 0px; - vertical-align: middle; -} - .stick input, - .stick .btn { - border-radius: 0; - font-size: 14px; - } - .stick .btn:first-child, - .stick input:first-child { - border-radius: 3px 0 0 3px; - } - .stick .btn-important:first-child { - border-right: 1px solid #06f; - } - .stick .btn:last-child, - .stick input:last-child { - border-radius: 0 3px 3px 0; - } - .stick .btn + .btn, - .stick .btn + input, - .stick .btn + .dropdown > .btn, - .stick input + .btn, - .stick input + input, - .stick input + .dropdown > .btn, - .stick .dropdown + .btn, - .stick .dropdown + input, - .stick .dropdown + .dropdown > .btn { - border-left: none; - } - .stick input + .btn { - border-top: 1px solid #bbb; - } - .stick .btn + .dropdown > .btn { - border-left: none; - border-radius: 0 3px 3px 0; - } - .stick .btn + .dropdown a { - font-size: 12px; - } - -.btn { - display: inline-block; - min-height: 37px; - min-width: 15px; - padding: 5px 10px; - background: linear-gradient(to bottom, #fff 0%, #eee 100%); - border-radius: 3px; - border: 1px solid #ddd; - border-bottom: 1px solid #aaa; - border-right: 1px solid #aaa; - color: #666; - text-shadow: 0px -1px 0 #ddd; - line-height: 20px; - vertical-align: middle; - cursor: pointer; - overflow: hidden; -} - a.btn { - min-height: 25px; - line-height: 25px; - } - .btn:hover { - background: linear-gradient(to bottom, #f8f8f8, #f0f0f0); - text-decoration: none; - } - .btn.active, - .btn:active, - .dropdown-target:target ~ .btn.dropdown-toggle { - box-shadow: 0px 2px 4px #e0e0e0 inset, 0px 1px 2px #fafafa; - background: #eee; - } - - .btn-important { - background: linear-gradient(to bottom, #0084CC, #0045CC); - color: #fff; - border: 1px solid #0062B7; - text-shadow: 0px -1px 0 #aaa; - } - .btn-important:hover { - background: linear-gradient(to bottom, #0066CC, #0045CC); - } - .btn-important:active { - background: #0044CB; - box-shadow: none; - } - - .btn-attention { - background: linear-gradient(to bottom, #E95B57, #BD362F); - color: #fff; - border: 1px solid #C44742; - text-shadow: 0px -1px 0px #666; - } - .btn-attention:hover { - background: linear-gradient(to bottom, #D14641, #BD362F); - } - .btn-attention:active { - background: #BD362F; - box-shadow: none; - } - -/* NAVIGATION */ -.nav-list .nav-header, -.nav-list .item { - display: block; - height: 35px; - line-height: 35px; -} - .nav-list .item:hover { - background: #fafafa; - } - .nav-list .item:hover a { - color: #003388; - } - .nav-list .item.active { - background: #0062BE; - color: #fff; - } - .nav-list .item.active a { - color: #fff; - } - .nav-list .disable { - color: #aaa; - background: #fafafa; - text-align: center; - } - .nav-list .item > * { - display: block; - padding: 0 10px; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - .nav-list a:hover { - text-decoration: none; - } - .nav-list .item.error a { - color: #BD362F; - } - .nav-list .item.active.error a { - color: #fff; - background: #BD362F; - } - .nav-list .item.empty a { - color: #f39c12; - } - .nav-list .item.active.empty a { - color: #fff; - background: #f39c12; - } - - .nav-list .nav-header { - padding: 0 10px; - color: #888; - background: #f4f4f4; - border-bottom: 1px solid #ddd; - font-weight: bold; - text-shadow: 0 0 1px #ddd; - } - .nav-list .separator { - display: block; - height: 0; - margin: 5px 0; - border-bottom: 1px solid #ddd; - } - - .nav-list .nav-form { - padding: 3px; - text-align: center; - } - -.nav-head { - display: block; - margin: 0; - background: linear-gradient(to bottom, #fff, #f0f0f0); - border-bottom: 1px solid #ddd; - text-align: right; -} - .nav-head .item { - display: inline-block; - padding: 5px 10px; - } - -/* HORIZONTAL-LIST */ -.horizontal-list { - display: table; - table-layout: fixed; - margin: 0; - padding: 0; - width: 100%; -} - .horizontal-list .item { - display: table-cell; - vertical-align: middle; - } - -/* DROPDOWN */ -.dropdown { - position: relative; - display: inline-block; -} - .dropdown-target { - display: none; - } - - .dropdown-menu { - display: none; - min-width: 200px; - margin: 5px 0 0; - padding: 5px 0; - position: absolute; - right: 0px; - background: #fff; - border: 1px solid #ddd; - border-radius: 5px; - text-align: left; - box-shadow: 3px 3px 3px #ddd; - } - .dropdown-menu:after { - content: ""; - position: absolute; - top: -6px; - right: 13px; - width: 10px; - height: 10px; - background: #fff; - border-top: 1px solid #ddd; - border-left: 1px solid #ddd; - z-index: -10; - transform: rotate(45deg); - } - .dropdown-header { - display: block; - padding: 0 5px; - color: #888; - font-weight: bold; - font-size: 14px; - line-height: 30px; - } - .dropdown-menu > .item { - display: block; - height: 30px; - font-size: 90%; - line-height: 30px; - } - .dropdown-menu > .item > a { - display: block; - padding: 0 25px; - line-height: 30px; - } - .dropdown-menu > .item.share > a { - display: list-item; - list-style-position:inside; - list-style-type:decimal; - } - .dropdown-menu > .item:hover { - background: #0062BE; - color: #fff; - } - .dropdown-menu > .item[aria-checked="true"] > a:before { - content: '✓ '; - font-weight: bold; - margin: 0 0 0 -1.2em; - padding: 0 0.2em 0 0; - } - .dropdown-menu > .item:hover > a { - color: #fff; - text-decoration: none; - } - .dropdown-menu .input { - display: block; - height: 40px; - font-size: 90%; - line-height: 30px; - } - .dropdown-menu .input select, - .dropdown-menu .input input { - display: block; - height: 20px; - width: 95%; - margin: auto; - padding: 2px 5px; - border-radius: 3px; - } - .dropdown-menu .input select { - width: 70%; - height: auto; - } - .dropdown-menu .separator { - display: block; - height: 0; - margin: 5px 0; - border-bottom: 1px solid #ddd; - } - .dropdown-target:target ~ .dropdown-menu { - display: block; - z-index: 10; - } - .dropdown-close { - display: inline; - } - .dropdown-close a { - font-size: 0; - position: fixed; - top: 0; bottom: 0; - left: 0; right: 0; - display: block; - z-index: -10; - } - -/* ALERTS */ -.alert { - display: block; - width: 90%; - margin: 15px auto; - padding: 10px 15px; - background: #f4f4f4; - border: 1px solid #ccc; - border-right: 1px solid #aaa; - border-bottom: 1px solid #aaa; - border-radius: 5px; - color: #aaa; - text-shadow: 0 0 1px #eee; -} - .alert-head { - margin: 0; - font-weight: bold; - font-size: 110%; - } - .alert > a { - color: inherit; - text-decoration: underline; - } - .alert-warn { - background: #ffe; - border: 1px solid #eeb; - color: #c95; - } - .alert-success { - background: #dfd; - border: 1px solid #cec; - color: #484; - } - .alert-error { - background: #fdd; - border: 1px solid #ecc; - color: #844; - } - -/* ICÔNES */ -.icon { - display: inline-block; - width: 16px; - height: 16px; - vertical-align: middle; - line-height: 16px; -} - -/* Prompt (centré) */ -.prompt { - text-align: center; -} - .prompt label { - text-align: left; - } - .prompt form { - margin: 1em auto 2.5em auto; - width: 10em; - } - .prompt input { - margin: .4em auto 1.1em auto; - width: 100%; - } - .prompt p { - margin: 20px 0; - } diff --git a/p/themes/Origine/metadata.json b/p/themes/Origine/metadata.json index f93dcbc3f..774320eb4 100644 --- a/p/themes/Origine/metadata.json +++ b/p/themes/Origine/metadata.json @@ -2,6 +2,6 @@ "name": "Origine", "author": "Marien Fressinaud", "description": "Le thème par défaut pour FreshRSS", - "version": 0.1, - "files": ["global.css", "freshrss.css"] + "version": 0.2, + "files": ["_template.css", "origine.css"] } diff --git a/p/themes/Origine/origine.css b/p/themes/Origine/origine.css new file mode 100644 index 000000000..da461087b --- /dev/null +++ b/p/themes/Origine/origine.css @@ -0,0 +1,1071 @@ +@charset "UTF-8"; + +/*=== FONTS */ +@font-face { + font-family: "OpenSans"; + src: url("../fonts/openSans.woff") format("woff"); +} + +/*=== GENERAL */ +/*============*/ +html, body { + height: 100%; + font-family: "OpenSans", "Cantarell", "Helvetica", "Arial", sans-serif; + background: #fafafa; +} + +/*=== Links */ +a, button.as-link { + color: #0062be; + outline: none; +} + +/*=== Forms */ +legend { + margin: 20px 0 5px; + padding: 5px 0; + border-bottom: 1px solid #ddd; + font-size: 1.4em; +} +label { + min-height: 25px; + padding: 5px 0; + cursor: pointer; +} +textarea { + width: 360px; + height: 100px; +} +input, select, textarea { + min-height: 25px; + padding: 5px; + background: #fdfdfd; + border: 1px solid #bbb; + border-radius: 3px; + color: #666; + line-height: 25px; + vertical-align: middle; + box-shadow: 0 2px 2px #eee inset; +} +option { + padding: 0 .5em; +} +input:focus, select:focus, textarea:focus { + color: #0062be; + border-color: #33bbff; + box-shadow: 0 2px 2px #ddddff inset; +} +input:invalid, select:invalid { + border-color: #f00; + box-shadow: 0 0 2px 2px #fdd inset; +} +input:disabled, select:disabled { + background: #eee; +} +input.extend { + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; +} + +/*=== Tables */ +table { + border-collapse: collapse; +} + +tr, th, td { + padding: 0.5em; + border: 1px solid #ddd; +} +th { + background: #f6f6f6; +} +form td, +form th { + font-weight: normal; + text-align: center; +} + +/*=== COMPONENTS */ +/*===============*/ +/*=== Forms */ +.form-group.form-actions { + padding: 5px 0; + background: #f4f4f4; + border-top: 1px solid #ddd; +} +.form-group.form-actions .btn { + margin: 0 10px; +} +.form-group .group-name { + padding: 10px 0; + text-align: right; +} +.form-group .group-controls { + min-height: 25px; + padding: 5px 0; +} +.form-group table { + margin: 10px 0 0 220px; +} + +/*=== Buttons */ +.stick { + vertical-align: middle; + font-size: 0; +} +.stick input, +.stick .btn { + border-radius: 0; +} +.stick .btn:first-child, +.stick input:first-child { + border-radius: 3px 0 0 3px; +} +.stick .btn-important:first-child { + border-right: 1px solid #06f; +} +.stick .btn:last-child, +.stick input:last-child { + border-radius: 0 3px 3px 0; +} +.stick .btn + .btn, +.stick .btn + input, +.stick .btn + .dropdown > .btn, +.stick input + .btn, +.stick input + input, +.stick input + .dropdown > .btn, +.stick .dropdown + .btn, +.stick .dropdown + input, +.stick .dropdown + .dropdown > .btn { + border-left: none; +} +.stick input + .btn { + border-top: 1px solid #bbb; +} +.stick .btn + .dropdown > .btn { + border-left: none; + border-radius: 0 3px 3px 0; +} + +.btn { + display: inline-block; + min-height: 37px; + min-width: 15px; + margin: 0; + padding: 5px 10px; + background: #fff; + background: linear-gradient(to bottom, #fff 0%, #eee 100%); + background: -moz-linear-gradient(top, #fff 0%, #eee 100%); + background: -webkit-linear-gradient(top, #fff 0%, #eee 100%); + background: -o-linear-gradient(top, #fff 0%, #eee 100%); + background: -ms-linear-gradient(top, #fff 0%, #eee 100%); + border-radius: 3px; + border: 1px solid #ddd; + border-bottom: 1px solid #aaa; + border-right: 1px solid #aaa; + color: #666; + text-shadow: 0px -1px 0 #ddd; + font-size: 0.9rem; + vertical-align: middle; + cursor: pointer; + overflow: hidden; +} +a.btn { + min-height: 25px; + line-height: 25px; +} +.btn:hover { + background: #f0f0f0; + background: linear-gradient(to bottom, #f8f8f8, #f0f0f0); + background: -moz-linear-gradient(top, #f8f8f8 0%, #f0f0f0 100%); + background: -webkit-linear-gradient(top, #f8f8f8 0%, #f0f0f0 100%); + background: -o-linear-gradient(top, #f8f8f8 0%, #f0f0f0 100%); + background: -ms-linear-gradient(top, #f8f8f8 0%, #f0f0f0 100%); + text-decoration: none; +} +.btn.active, +.btn:active, +.dropdown-target:target ~ .btn.dropdown-toggle { + box-shadow: 0px 2px 4px #e0e0e0 inset, 0px 1px 2px #fafafa; + background: #eee; +} + +.btn-important { + background: #0084CC; + background: linear-gradient(to bottom, #0084CC, #0045CC); + background: -moz-linear-gradient(top, #0084CC 0%, #0045CC 100%); + background: -webkit-linear-gradient(top, #0084CC 0%, #0045CC 100%); + background: -o-linear-gradient(top, #0084CC 0%, #0045CC 100%); + background: -ms-linear-gradient(top, #0084CC 0%, #0045CC 100%); + color: #fff; + border: 1px solid #0062B7; + text-shadow: 0px -1px 0 #aaa; + font-weight: normal; +} +.btn-important:hover { + background: linear-gradient(to bottom, #0066CC, #0045CC); + background: -moz-linear-gradient(top, #0066CC 0%, #0045CC 100%); + background: -webkit-linear-gradient(top, #0066CC 0%, #0045CC 100%); + background: -o-linear-gradient(top, #0066CC 0%, #0045CC 100%); + background: -ms-linear-gradient(top, #0066CC 0%, #0045CC 100%); +} +.btn-important:active { + background: #0044CB; + box-shadow: none; +} + +.btn-attention { + background: #E95B57; + background: linear-gradient(to bottom, #E95B57, #BD362F); + background: -moz-linear-gradient(top, #E95B57 0%, #BD362F 100%); + background: -webkit-linear-gradient(top, #E95B57 0%, #BD362F 100%); + background: -o-linear-gradient(top, #E95B57 0%, #BD362F 100%); + background: -ms-linear-gradient(top, #E95B57 0%, #BD362F 100%); + color: #fff; + border: 1px solid #C44742; + text-shadow: 0px -1px 0px #666; +} +.btn-attention:hover { + background: linear-gradient(to bottom, #D14641, #BD362F); + background: -moz-linear-gradient(top, #D14641 0%, #BD362F 100%); + background: -webkit-linear-gradient(top, #D14641 0%, #BD362F 100%); + background: -o-linear-gradient(top, #D14641 0%, #BD362F 100%); + background: -ms-linear-gradient(top, #D14641 0%, #BD362F 100%); +} +.btn-attention:active { + background: #BD362F; + box-shadow: none; +} + +/*=== Navigation */ +.nav-list .nav-header, +.nav-list .item { + height: 2.5em; + line-height: 2.5em; + font-size: 0.9rem; +} +.nav-list .item:hover { + background: #fafafa; +} +.nav-list .item:hover a { + color: #003388; +} +.nav-list .item.active { + background: #0062BE; + color: #fff; +} +.nav-list .item.active a { + color: #fff; +} +.nav-list .disable { + color: #aaa; + background: #fafafa; + text-align: center; +} +.nav-list .item > a { + padding: 0 10px; +} +.nav-list a:hover { + text-decoration: none; +} +.nav-list .item.empty a { + color: #f39c12; +} +.nav-list .item.active.empty a { + color: #fff; + background: #f39c12; +} +.nav-list .item.error a { + color: #BD362F; +} +.nav-list .item.active.error a { + color: #fff; + background: #BD362F; +} + +.nav-list .nav-header { + padding: 0 10px; + color: #888; + background: #f4f4f4; + border-bottom: 1px solid #ddd; + font-weight: bold; + text-shadow: 0 0 1px #ddd; +} + +.nav-list .nav-form { + padding: 3px; + text-align: center; +} + +.nav-head { + margin: 0; + background: #fff; + background: linear-gradient(to bottom, #fff, #f0f0f0); + background: -moz-linear-gradient(top, #fff 0%, #f0f0f0 100%); + background: -webkit-linear-gradient(top, #fff 0%, #f0f0f0 100%); + background: -o-linear-gradient(top, #fff 0%, #f0f0f0 100%); + background: -ms-linear-gradient(top, #fff 0%, #f0f0f0 100%); + border-bottom: 1px solid #ddd; + text-align: right; +} +.nav-head .item { + padding: 5px 10px; + font-size: 0.9rem; + line-height: 1.5rem; +} + +/*=== Horizontal-list */ +.horizontal-list { + margin: 0; + padding: 0; +} +.horizontal-list .item { + vertical-align: middle; +} + +/*=== Dropdown */ +.dropdown-menu { + margin: 5px 0 0; + padding: 5px 0; + border: 1px solid #ddd; + border-radius: 5px; + box-shadow: 3px 3px 3px #ddd; + font-size: 0.8rem; + text-align: left; +} +.dropdown-menu::after { + content: ""; + position: absolute; + top: -6px; + right: 13px; + width: 10px; + height: 10px; + background: #fff; + border-top: 1px solid #ddd; + border-left: 1px solid #ddd; + z-index: -10; + transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); +} +.dropdown-header { + padding: 0 5px 5px; + color: #888; + font-weight: bold; + text-align: left; +} +.dropdown-menu > .item { +} +.dropdown-menu > .item > a { + padding: 0 25px; + line-height: 2.5em; +} +.dropdown-menu > .item > span, +.dropdown-menu > .item > .as-link { + padding: 0 22px; + line-height: 2em; +} +.dropdown-menu > .item:hover { + background: #0062BE; + color: #fff; +} +.dropdown-menu > .item[aria-checked="true"] > a::before { + font-weight: bold; + margin: 0 0 0 -14px; +} +.dropdown-menu > .item:hover > a { + color: #fff; + text-decoration: none; +} +.dropdown-menu .input select, +.dropdown-menu .input input { + margin: 0 auto 5px; + padding: 2px 5px; + border-radius: 3px; +} + +.separator { + margin: 5px 0; + border-bottom: 1px solid #ddd; +} + +/*=== Alerts */ +.alert { + margin: 15px auto; + padding: 10px 15px; + background: #f4f4f4; + border: 1px solid #ccc; + border-right: 1px solid #aaa; + border-bottom: 1px solid #aaa; + border-radius: 5px; + color: #aaa; + text-shadow: 0 0 1px #eee; + font-size: 0.9em; +} +.alert-head { + font-size: 1.15em; +} +.alert > a { + color: inherit; + text-decoration: underline; +} +.alert-warn { + background: #ffe; + border: 1px solid #eeb; + color: #c95; +} +.alert-success { + background: #dfd; + border: 1px solid #cec; + color: #484; +} +.alert-error { + background: #fdd; + border: 1px solid #ecc; + color: #844; +} + +/*=== Pagination */ +.pagination { + background: #fafafa; + text-align: center; + color: #333; + font-size: 0.8em; +} +.content .pagination { + margin: 0; + padding: 0; +} +.pagination .item.pager-current { + font-weight: bold; + font-size: 1.5em; +} +.pagination .item a { + display: block; + color: #333; + font-style: italic; + line-height: 3em; + text-decoration: none; +} +.pagination .item a:hover { + background: #ddd; +} +.pagination:first-child .item { + border-bottom: 1px solid #aaa; +} +.pagination:last-child .item { + border-top: 1px solid #aaa; +} + +.pagination .loading, +.pagination a:hover.loading { + background: url("loader.gif") center center no-repeat #fff; + font-size: 0; +} + +/*=== Boxes */ +.box { + background: #fff; + border-radius: 5px; + box-shadow: 0 0 3px #bbb; +} +.box .box-title { + margin: 0; + padding: 5px 10px; + background: #f6f6f6; + border-bottom: 1px solid #ddd; + border-radius: 5px 5px 0 0; +} +.box .box-content { + min-height: 2.5em; + max-height: 260px; +} + +.box .box-content .item { + padding: 0 10px; + font-size: 0.9rem; + line-height: 2.5em; +} + +.box .box-content .item .configure { + visibility: hidden; +} +.box .box-content .item:hover .configure { + visibility: visible; +} + +/*=== Tree */ +.tree { + margin: 10px 0; +} +.tree-folder-title { + position: relative; + padding: 0 10px; + background: #fff; + line-height: 2.5rem; + font-size: 1rem; +} +.tree-folder-title .title { + background: inherit; + color: #444; +} +.tree-folder-title .title:hover { + text-decoration: none; +} +.tree-folder.active .tree-folder-title { + background: #f0f0f0; + font-weight: bold; +} +.tree-folder.active .tree-folder-title .title { + color: #0062BE; +} +.tree-folder-items { + border-top: 1px solid #ccc; + border-bottom: 1px solid #ccc; + background: #f6f6f6; +} +.tree-folder-items > .item { + padding: 0 10px; + line-height: 2.5rem; + font-size: 0.8rem; +} +.tree-folder-items > .item.active { + background: #0062be; +} +.tree-folder-items > .item > a { + text-decoration: none; +} +.tree-folder-items > .item.active > a { + color: #fff; +} + +/*=== STRUCTURE */ +/*===============*/ +/*=== Header */ +.header { + height: 85px; + background: #f4f4f4; +} +.header > .item { + padding: 10px; + border-bottom: 1px solid #aaa; + vertical-align: middle; + text-align: center; +} +.header > .item.title{ + width: 230px; +} +.header > .item.title h1 { + margin: 0.5em 0; + text-shadow: 1px -1px 0 #ccc; +} +.header > .item.title h1 a { + text-decoration: none; +} +.header > .item.search input { + width: 230px; +} +.header .item.search input:focus { + width: 350px; +} + +/*=== Body */ +#global { + height: calc(100% - 85px); +} +.aside { + border-right: 1px solid #aaa; + background: #fff; +} +.aside.aside_feed { + padding: 10px 0; + text-align: center; + background: #fff; +} +.aside.aside_feed .tree { + margin: 10px 0 50px; +} + +/*=== Aside main page (categories) */ +.aside_feed .category .title:not([data-unread="0"])::after { + position: absolute; + right: 0; + margin: 10px 0; + padding: 0 10px; + font-size: 0.9rem; + line-height: 1.5rem; + background: inherit; +} + +/*=== Aside main page (feeds) */ +.feed.item.empty.active { + background: #e67e22; +} +.feed.item.error.active { + background: #bd362f; +} +.feed.item.empty, +.feed.item.empty > a { + color: #e67e22; +} +.feed.item.error, +.feed.item.error > a { + color: #bd362f; +} +.feed.item.empty.active, +.feed.item.error.active, +.feed.item.empty.active > a, +.feed.item.error.active > a { + color: #fff; +} +.aside_feed .tree-folder-items .dropdown-menu::after { + left: 2px; +} +.aside_feed .tree-folder-items .item .dropdown-target:target ~ .dropdown-toggle > .icon, +.aside_feed .tree-folder-items .item.active .dropdown-toggle > .icon { + background-color: #fff; + border-radius: 3px; +} + +/*=== Configuration pages */ +.post { + padding: 10px 50px; + font-size: 0.9em; +} +.post form { + margin: 10px 0; +} +.post.content { + max-width: 550px; +} + +/*=== Prompt (centered) */ +.prompt { + text-align: center; +} +.prompt label { + text-align: left; +} +.prompt form { + margin: 10px auto 20px auto; + width: 200px; +} +.prompt input { + margin: 5px auto; + width: 100%; +} +.prompt p { + margin: 20px 0; +} + +/*=== New article notification */ +#new-article { + background: #0084CC; + text-align: center; + font-size: 0.9em; +} +#new-article:hover { + background: #0066CC; +} +#new-article > a { + line-height: 3em; + color: #fff; + font-weight: bold; +} +#new-article > a:hover { + text-decoration: none; +} + +/*=== Day indication */ +.day { + padding: 0 10px; + font-weight: bold; + line-height: 3em; + background: #fff; + border-top: 1px solid #aaa; + border-bottom: 1px solid #aaa; +} +#new-article + .day { + border-top: none; +} +.day .name { + padding: 0 10px 0 0; + color: #aab; + font-size: 1.8em; + opacity: 0.3; + text-shadow: 0px -1px 0px #666; + font-style: italic; + text-align: right; +} + +/*=== Index menu */ +.nav_menu { + background: #fafafa; + border-bottom: 1px solid #aaa; + text-align: center; + padding: 5px 0; +} + +/*=== Feed articles */ +.flux { + border-left: 2px solid #aaa; + background: #fafafa; +} +.flux:hover { + background: #fff; +} +.flux.current { + border-left: 2px solid #0062BE; +} +.flux.not_read { + border-left: 2px solid #FF5300; + background: #FFF3ED; +} +.flux.not_read:not(.current):hover .item.title { + background: #FFF3ED; +} +.flux.favorite { + border-left: 2px solid #FFC300; + background: #FFF6DA; +} +.flux.favorite:not(.current):hover .item.title { + background: #FFF6DA; +} +.flux.current { + background: #fff; +} + + +.flux_header { + border-top: 1px solid #ddd; + font-size: 0.8rem; + cursor: pointer; +} +.flux_header .title { + font-size: 0.9rem; +} +.flux .website .favicon { + padding: 5px; +} +.flux .date { + color: #666; + font-size: 0.7rem; +} + +.flux .bottom { + font-size: 0.8rem; + text-align: center; +} + +/*=== Content of feed articles */ +.content { + padding: 20px 10px; +} +.content > h1.title > a { + color: #000; +} + +.content hr { + margin: 30px 10px; + height: 1px; + background: #ddd; + border: 0; + box-shadow: 0 2px 5px #ccc; +} + +.content pre { + margin: 10px auto; + padding: 10px 20px; + overflow: auto; + background: #222; + color: #fff; + font-size: 0.9rem; + border-radius: 3px; +} +.content code { + padding: 2px 5px; + color: #dd1144; + background: #fafafa; + border: 1px solid #eee; + border-radius: 3px; +} +.content pre code { + background: transparent; + color: #fff; + border: none; +} + +.content blockquote { + display: block; + margin: 0; + padding: 5px 20px; + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + background: #fafafa; + color: #333; +} +.content blockquote p { + margin: 0; +} + +/*=== Notification and actualize notification */ +.notification { + padding: 0 0 0 5px; + text-align: center; + border: 1px solid #eeb; + border-radius: 3px; + box-shadow: 0 0 5px #ddd; + font-weight: bold; + font-size: 0.9em; + line-height: 3em; + z-index: 10; + vertical-align: middle; +} +.notification.good { + background: #ffe; + border: 1px solid #eeb; + color: #c95; +} +.notification.bad { + background: #fdd; + border: 1px solid #ecc; + color: #844; +} +.notification a.close { + padding: 0 15px; + line-height: 3em; +} +.notification.good a.close:hover { + background: #eeb; +} +.notification.bad a.close:hover { + background: #ecc; +} + +.notification#actualizeProgress { + line-height: 2em; +} + +/*=== "Load more" part */ +#bigMarkAsRead { + text-align: center; + text-decoration: none; + text-shadow: 0 -1px 0 #aaa; + color: #666; + background: #fafafa; +} +#bigMarkAsRead:hover { + color: #0062be; + background: #fff; + box-shadow: 0 -5px 10px #eee inset; +} +#bigMarkAsRead:hover .bigTick { + text-shadow: 0 0 5px #0062be; +} + +/*=== Navigation menu (for articles) */ +#nav_entries { + margin: 0; + background: #fff; + border-top: 1px solid #ddd; + text-align: center; + line-height: 3em; + table-layout: fixed; +} + +/*=== READER VIEW */ +/*================*/ +#stream.reader .flux { + padding: 0 0 50px; + border: none; + background: #f0f0f0; + color: #333; +} +#stream.reader .flux .author { + margin: 0 0 10px; + font-size: 90%; + color: #666; +} + +/*=== GLOBAL VIEW */ +/*================*/ +.box.category .box-title .title { + font-weight: normal; + text-decoration: none; + text-align: left; +} +.box.category:not([data-unread="0"]) .box-title { + background: #0084CC; +} +.box.category:not([data-unread="0"]) .box-title:active { + background: #3498db; +} +.box.category:not([data-unread="0"]) .box-title .title { + color: #fff; + font-weight: bold; +} +.box.category .title:not([data-unread="0"])::after { + position: absolute; + top: 5px; right: 10px; + border: 0; + background: none; + color: #fff; + font-weight: bold; + box-shadow: none; + text-shadow: none; +} +.box.category .item.feed { + padding: 2px 10px; + font-size: 0.8rem; +} + +/*=== DIVERS */ +/*===========*/ +.aside.aside_feed .nav-form input, +.aside.aside_feed .nav-form select { + width: 140px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu { + right: -20px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu::after { + right: 33px; +} + +/*=== STATISTICS */ +/*===============*/ +.stat { + margin: 10px 0 20px; +} + +.stat th, +.stat td, +.stat tr { + border: none; +} +.stat > table td, +.stat > table th { + border-bottom: 1px solid #ddd; +} + +.stat > .horizontal-list { + margin: 0 0 5px; +} +.stat > .horizontal-list .item { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.stat > .horizontal-list .item:first-child { + width: 270px; +} + +/*=== LOGS */ +/*=========*/ +.loglist { + border: 1px solid #aaa; + border-radius: 5px; + overflow: hidden; +} +.log { + padding: 5px 10px; + background: #fafafa; + color: #333; + font-size: 0.8rem; +} +.log+.log { + border-top: 1px solid #aaa; +} +.log .date { + display: block; + font-weight: bold; +} +.log.error { + background: #fdd; + color: #844; +} +.log.warning { + background: #ffe; + color: #c95; +} +.log.notice { + background: #f4f4f4; + color: #aaa; +} +.log.debug { + background: #333; + color: #eee; +} + +/*=== MOBILE */ +/*===========*/ +@media(max-width: 840px) { + .aside { + box-shadow: 3px 0 3px #aaa; + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; + } + .aside .toggle_aside, + #panel .close { + display: block; + width: 100%; + height: 50px; + line-height: 50px; + text-align: center; + background: #f6f6f6; + border-bottom: 1px solid #ddd; + } + + .aside.aside_feed { + padding: 0; + } + + .nav_menu .btn { + margin: 5px 10px; + } + .nav_menu .stick { + margin: 0 10px; + } + .nav_menu .stick .btn { + margin: 5px 0; + } + .nav_menu .search { + display: inline-block; + max-width: 97%; + } + .nav_menu .search input { + max-width: 97%; + width: 90px; + } + .nav_menu .search input:focus { + width: 400px; + } + + .day .name { + font-size: 1.1rem; + text-shadow: none; + } + + .pagination { + margin: 0 0 3.5em; + } + + .notification a.close { + display: block; + left: 0; + background: transparent; + } + .notification a.close:hover { + opacity: 0.5; + } + .notification a.close .icon { + display: none; + } +} diff --git a/p/themes/Origine/thumbs/original.png b/p/themes/Origine/thumbs/original.png Binary files differnew file mode 100644 index 000000000..d26d4fbed --- /dev/null +++ b/p/themes/Origine/thumbs/original.png diff --git a/p/themes/Pafat/README.md b/p/themes/Pafat/README.md new file mode 100644 index 000000000..adddc1bf0 --- /dev/null +++ b/p/themes/Pafat/README.md @@ -0,0 +1,4 @@ +Pafat +===== + +Thème Pafat pour FreshRSS diff --git a/p/themes/Pafat/icons/all.svg b/p/themes/Pafat/icons/all.svg new file mode 100644 index 000000000..14fa80366 --- /dev/null +++ b/p/themes/Pafat/icons/all.svg @@ -0,0 +1,7 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-40.0002,-746)" fill="#FFF"> +<rect style="color:#FFF;" height="2.0002" width="9.9996" y="749" x="43"/> +<rect style="color:#FFF;" height="2.0002" width="9.9996" y="753" x="43"/> +<rect style="color:#FFF;" height="2.0002" width="9.9996" y="757" x="43"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/bookmark.svg b/p/themes/Pafat/icons/bookmark.svg new file mode 100644 index 000000000..70d0c81fb --- /dev/null +++ b/p/themes/Pafat/icons/bookmark.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-41.000202,-397)"> +<path style="enable-background:accumulate;color:#000000;" d="m530.95,186.71c-0.77941,0.55189-3.1576-1.906-4.1125-1.9179-0.95532-0.0119-3.3949,2.3858-4.161,1.8149-0.76573-0.57072,0.83698-3.592,0.55319-4.5039-0.2839-0.91223-3.3182-2.4915-3.0119-3.3965,0.30617-0.90461,3.6749-0.31399,4.4544-0.86567,0.77986-0.5519,1.3442-3.9257,2.2995-3.914,0.95494,0.0116,1.4342,3.398,2.1998,3.9689,0.76588,0.57114,4.1489,0.0653,4.4331,0.97746,0.28402,0.9118-2.7885,2.414-3.0949,3.3186-0.30652,0.90489,1.22,3.966,0.44027,4.5182z" fill-rule="nonzero" transform="matrix(1.0472113,-0.00871584,0.00871584,1.0472113,-504.35434,220.15425)" fill="#FFF"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/down.svg b/p/themes/Pafat/icons/down.svg new file mode 100644 index 000000000..050d6b969 --- /dev/null +++ b/p/themes/Pafat/icons/down.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-181.0002,-747)"> +<path style="block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:new;text-transform:none;" d="m195.03,751,0,1c-0.00091,0.0111,0.00059,0.021-0.00009,0.0312-0.0112,0.25496-0.12835,0.50994-0.31251,0.6875l-5.7188,6.2977-5.7188-6.2977c-0.18821-0.1881-0.28121-0.45346-0.28122-0.71875v-1h1c0.26531,0.00007,0.53059,0.0931,0.71873,0.28131l4.2812,4.829,4.2813-4.829c0.19464-0.21073,0.46925-0.30315,0.74998-0.2813z" fill-rule="nonzero" fill="#666"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/icon.svg b/p/themes/Pafat/icons/icon.svg new file mode 100644 index 000000000..b489e18da --- /dev/null +++ b/p/themes/Pafat/icons/icon.svg @@ -0,0 +1,12 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"> + <title>Logo FreshRSS</title> + <circle fill="#C5C6CA" cx="128" cy="128" r="33"/> + <g fill="none" stroke="#C5C6CA" stroke-width="24"> + <g stroke-opacity="0.3"> + <path d="M12,128 A116,116 0 1,1 128,244"/> + <path d="M54,128 A74,74 0 1,1 128,202"/> + </g> + <path d="M128,12 A116,116 0 0,1 244,128"/> + <path d="M128,54 A74,74 0 0,1 202,128"/> + </g> +</svg> diff --git a/p/themes/Pafat/icons/link.svg b/p/themes/Pafat/icons/link.svg new file mode 100644 index 000000000..cc30f9f8b --- /dev/null +++ b/p/themes/Pafat/icons/link.svg @@ -0,0 +1,7 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16.004" width="16"> +<g fill="#666" transform="translate(-183,-529)"> +<path style="enable-background:accumulate;color:#000000;" d="m191,533.85,0,10.38-2.344-2.2882-1.3394,2.7346c-0.32808,0.73962-2.0337,0.14492-1.5487-0.84412l1.3255-2.8393h-2.9579l6.8645-7.1436z" fill-rule="nonzero" display="block"/> +<path d="m190.16,530.06c-3.8266,0.46006-6.5788,3.9578-6.0938,7.7812,0.13127,1.0347,0.29377,1.3818,0.29377,1.3818l1.675-1.6318c-0.33104-2.7534,1.6216-5.2315,4.375-5.5625,2.7534-0.33104,5.2315,1.6216,5.5625,4.375,0.31355,2.608-1.3913,5.0249-3.9688,5.5312l0.0312,2s0.52086-0.1059,0.62354-0.13097c3.4156-0.83385,5.7063-4.1273,5.2827-7.6503-0.46006-3.8266-3.9547-6.5538-7.7812-6.0938z" style="baseline-shift:baseline;block-progression:tb;color:#666;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;"/> +<path opacity="0.3" style="enable-background:accumulate;color:#666;" d="m187.11,536.81,0-0.20574-0.19826,0.0186c0.0165-0.13095,0.0329-0.26167,0.0496-0.3926h-0.11578l-0.11556,0.14959-0.11578,0.0559-0.1653-0.0932-0.0165-0.20575,0.0331-0.22438,0.24798-0.18688h0.19826l0.0329-0.11229,0.24786,0.0559,0.18183,0.2246,0.0331-0.37419,0.31401-0.26167,0.11567-0.28055,0.23133-0.0934,0.1322-0.18688,0.29738-0.0564,0.14885-0.22415h-0.44623l0.28094-0.13095h0.19814l0.28106-0.0937,0.0331-0.11186-0.0992-0.0937-0.11567-0.0375,0.0331-0.11208-0.0826-0.16822-0.19837,0.0746,0.0331-0.14947-0.23134-0.13096-0.18171,0.3177,0.0165,0.11229-0.18171,0.075-0.11578,0.24302-0.0495-0.22438-0.31402-0.13095-0.0496-0.16822,0.41315-0.24325,0.18182-0.16822,0.0165-0.20563-0.0991-0.0562-0.13219-0.0188-0.0826,0.20575s-0.1382,0.0271-0.17373,0.0358c-0.45378,0.41804-1.3707,1.3204-1.5837,3.024,0.008,0.0395,0.15441,0.26854,0.15441,0.26854l0.347,0.20552,0.347,0.0937m3.9661-4.3003-0.4298-0.16833-0.49552,0.0561-0.61161,0.16822-0.11567,0.11229,0.38008,0.26167,0,0.14959-0.14875,0.14959,0.19846,0.39294,0.13188-0.075,0.16561-0.26168c0.2553-0.0789,0.4842-0.16833,0.72686-0.28053l0.19846-0.5048m2.5292,0.34192-0.375,0.0937-0.21875,0.15625,0,0.125-0.375,0.25,0.0937,0.34375,0.21875-0.15625,0.125,0.15625,0.15625,0.0937,0.0937-0.28125-0.0625-0.15625,0.0625-0.0937,0.21875-0.1875,0.0937,0-0.0937,0.21875,0,0.1875c0.0892-0.0242,0.1588-0.051,0.25-0.0625l-0.25,0.1875v0.125l-0.3125,0.21875-0.28125-0.0625v-0.15625l-0.125,0.0625,0.0625,0.15625h-0.21875l-0.125,0.21875-0.15625,0.15625-0.0937,0.0312v0.1875l0.0312,0.15625h-0.0312v0.53125l0.0625-0.0312,0.0937-0.21875,0.1875-0.125,0.0312-0.0937,0.28125-0.0625,0.15625,0.1875,0.1875,0.0937-0.0937,0.1875,0.15625-0.0312,0.0625-0.21875-0.1875-0.21875h0.0625l0.21875,0.15625,0.0312,0.21875,0.15625,0.21875,0.0625-0.3125,0.0937-0.0312c0.0959,0.0996,0.1692,0.23163,0.25,0.34375h0.28125l0.1875,0.125-0.0937,0.0937-0.15625,0.15625h-0.25l-0.34375-0.0937h-0.1875l-0.125,0.15625-0.34375-0.375-0.25-0.0625-0.375,0.0625-0.15625,0.0937v2.4062l0.0312,0.0312,0.25-0.15625,0.0937,0.0937h0.28125l0.125,0.15625-0.0937,0.3125,0.1875,0.1875v0.375l0.125,0.25-0.0937,0.25c-0.009,0.16159,0,0.30714,0,0.46875,0.0795,0.21894,0.14355,0.43575,0.21875,0.65625l0.0625,0.34375v0.1875h0.125l0.21875-0.125h0.25l0.375-0.4375-0.0312-0.15625,0.25-0.21875-0.1875-0.1875,0.21875-0.1875,0.21875-0.125,0.0937-0.125-0.0625-0.25v-0.59375l0.1875-0.375,0.1875-0.25,0.25-0.5625v-0.15625c-0.11654,0.0146-0.22972,0.0231-0.34375,0.0312-0.0722,0.005-0.14446,0-0.21875,0-0.12359-0.25961-0.2183-0.50966-0.3125-0.78125l-0.15625-0.1875-0.0937-0.3125,0.0625-0.0625,0.21875,0.25,0.25,0.5625,0.15625,0.15625-0.0625,0.21875,0.15625,0.15625,0.25-0.25,0.3125-0.21875,0.15625-0.1875v-0.21875c-0.0389-0.0732-0.0547-0.14545-0.0937-0.21875l-0.15625,0.1875-0.125-0.15625-0.1875-0.125v-0.28125l0.21875,0.21875,0.21875-0.0312c0.10166,0.0923,0.19205,0.20751,0.28125,0.3125l0.15625-0.1875c0-0.17463-0.19976-1.0204-0.625-1.75-0.42526-0.72932-1.1562-1.4062-1.1562-1.4062l-0.0625,0.0937-0.21875,0.21875-0.25-0.25h0.25l0.125-0.125-0.46875-0.0937-0.25-0.0937z" fill-rule="nonzero"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/login.svg b/p/themes/Pafat/icons/login.svg new file mode 100644 index 000000000..cf2b347ad --- /dev/null +++ b/p/themes/Pafat/icons/login.svg @@ -0,0 +1,6 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-181.0002,-237)" fill="#666"> +<path style="color:#666;" d="m184,244c-0.554,0-1,0.446-1,1v0.53125,5.4688h12v-5.4688-0.53c0-0.554-0.446-1-1-1h-10z" fill-rule="nonzero"/> +<path style="baseline-shift:baseline;block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m188,238c-1.6447,0-3,1.3553-3,3v7c0,1.6447,1.3553,3,3,3h2c1.6447,0,3-1.3553,3-3v-7c0-1.6447-1.3553-3-3-3h-2zm0,2,2,0c0.5713,0,1,0.4287,1,1v7c0,0.5713-0.4287,1-1,1h-2c-0.5713,0-1-0.4287-1-1v-7c0-0.5713,0.4287-1,1-1z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/logout.svg b/p/themes/Pafat/icons/logout.svg new file mode 100644 index 000000000..ac2d180d8 --- /dev/null +++ b/p/themes/Pafat/icons/logout.svg @@ -0,0 +1,6 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-201.0002,-237)" fill="#666"> +<path style="color:#666;" d="m204,246c-0.554,0-1,0.446-1,1v0.53125,5.4688h12v-5.4688-0.53c0-0.554-0.446-1-1-1h-10z" fill-rule="nonzero"/> +<path style="baseline-shift:baseline;block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m208,237c-1.6447,0-3,1.3553-3,3v3h2v-3c0-0.57129,0.42873-1,1-1h2c0.57127,0,1,0.42871,1,1v7h2v-7c0-1.6447-1.3553-3-3-3h-2z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/next.svg b/p/themes/Pafat/icons/next.svg new file mode 100644 index 000000000..59d512450 --- /dev/null +++ b/p/themes/Pafat/icons/next.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-121.0002,-747)"> +<path style="block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:new;text-transform:none;" d="m125,749,1,0c0.0104-0.00012,0.0208-0.00046,0.0313,0,0.25495,0.0112,0.50987,0.12858,0.6875,0.3125l6.2977,5.7188-6.2977,5.7188c-0.18816,0.18819-0.45346,0.28125-0.71875,0.28125h-1v-1c0-0.26529,0.0931-0.53058,0.28125-0.71875l4.829-4.2812-4.829-4.2812c-0.21074-0.19463-0.30316-0.46925-0.28125-0.75z" fill-rule="nonzero" fill="#666"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/non-starred.svg b/p/themes/Pafat/icons/non-starred.svg new file mode 100644 index 000000000..e019daffd --- /dev/null +++ b/p/themes/Pafat/icons/non-starred.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-61.000202,-397)"> +<path style="baseline-shift:baseline;block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" fill="#666" d="m69.003,398.01c-0.2659-0.00099-0.49859,0.1006-0.6647,0.2393-0.16611,0.13869-0.27742,0.32137-0.38968,0.50028-0.22453,0.35782-0.39269,0.76873-0.56546,1.2036-0.17277,0.43483-0.34713,0.88766-0.5046,1.2323-0.15747,0.34465-0.3456,0.57871-0.35862,0.58776-0.01287,0.009-0.30722,0.117-0.69576,0.15181-0.38855,0.0348-0.88122,0.0492-1.3632,0.0694-0.48202,0.0202-0.9703,0.0362-1.393,0.12817-0.21138,0.046-0.4154,0.10148-0.60434,0.20956s-0.36689,0.28631-0.45004,0.53002-0.04901,0.50627,0.03636,0.70157c0.08537,0.19531,0.22656,0.36514,0.3682,0.52344,0.2833,0.31663,0.6327,0.60557,1.0079,0.89849s0.77671,0.55926,1.0678,0.81027c0.29104,0.25101,0.45422,0.50796,0.45912,0.52271,0.0048,0.0146,0.03119,0.33498-0.05456,0.70231-0.08575,0.36732-0.2238,0.81174-0.35282,1.2603-0.12902,0.44861-0.25176,0.90196-0.2917,1.3184-0.01997,0.20819-0.04285,0.40729,0.0053,0.61409,0.04814,0.20679,0.1845,0.43007,0.39902,0.58168,0.21451,0.15161,0.44936,0.1881,0.66823,0.1701s0.43535-0.0703,0.63515-0.15132c0.39961-0.16214,0.80177-0.42851,1.2064-0.68231,0.40465-0.2538,0.80822-0.52155,1.1456-0.71107,0.33734-0.18952,0.6484-0.2686,0.66445-0.26854,0.01586,0.00006,0.30338,0.0951,0.63894,0.28732,0.33556,0.19221,0.72532,0.46503,1.1276,0.72205,0.40229,0.25702,0.81996,0.49752,1.218,0.66284,0.19903,0.0827,0.38893,0.15086,0.60762,0.17059,0.2187,0.0197,0.47978-0.031,0.69551-0.18105,0.21572-0.15001,0.33928-0.35235,0.38918-0.55877s0.04291-0.43517,0.02476-0.64358c-0.03632-0.41683-0.15899-0.86394-0.2841-1.3137-0.12511-0.44978-0.26165-0.88661-0.34421-1.2548-0.08256-0.36813-0.07169-0.68662-0.06666-0.70133,0.005-0.0145,0.18746-0.25247,0.4806-0.50101,0.29313-0.24854,0.67599-0.53755,1.0536-0.82731,0.37764-0.28976,0.76716-0.57158,1.0531-0.88579,0.14298-0.1571,0.2418-0.33444,0.32882-0.52904s0.136-0.42874,0.05481-0.67306-0.27108-0.41314-0.45912-0.52272-0.36679-0.18158-0.57782-0.22931c-0.42206-0.0955-0.91359-0.14009-1.3956-0.16426-0.48198-0.0242-0.94584-0.039-1.3342-0.077s-0.71565-0.13122-0.72859-0.14037c-0.01279-0.009-0.18402-0.23636-0.3384-0.58217s-0.32658-0.78819-0.49548-1.2243c-0.1689-0.4361-0.33477-0.86429-0.55609-1.2238-0.11067-0.17977-0.23335-0.35397-0.39826-0.49396s-0.40309-0.25684-0.66899-0.25783zm0.0086,0.99424c0.0422,0.0358,0.10671,0.13602,0.1841,0.26173,0.15477,0.25141,0.33068,0.6272,0.49397,1.0488,0.16329,0.42163,0.31905,0.88645,0.49598,1.2828,0.17693,0.39633,0.31456,0.73379,0.6753,0.98889,0.36072,0.25509,0.77019,0.29763,1.2152,0.34118,0.44506,0.0435,0.92882,0.0532,1.3948,0.0765,0.46599,0.0234,0.91824,0.0697,1.2135,0.13647,0.14763,0.0334,0.25558,0.0572,0.30381,0.0853-0.02227,0.0498-0.07958,0.15478-0.17956,0.26464-0.19997,0.21973-0.53749,0.48746-0.90261,0.7676-0.36511,0.28015-0.77804,0.57219-1.114,0.85704-0.33595,0.28485-0.63992,0.53221-0.77987,0.94209-0.13995,0.40986-0.05396,0.77681,0.04065,1.1987s0.25406,0.87813,0.37502,1.313c0.12096,0.43486,0.22688,0.84692,0.25228,1.1385,0.01156,0.13264-0.01699,0.23485-0.02778,0.29267-0.05993-0.008-0.1764-0.0324-0.30381-0.0853-0.27836-0.11561-0.64649-0.32808-1.0354-0.57657-0.38894-0.24849-0.8039-0.53053-1.1885-0.75081-0.38457-0.22028-0.70791-0.39837-1.1551-0.40015-0.44722-0.002-0.79205,0.17245-1.1786,0.38965-0.38659,0.21719-0.78438,0.49517-1.1756,0.74055-0.39123,0.24538-0.77636,0.4507-1.0559,0.56412-0.13977,0.0567-0.24616,0.0856-0.3023,0.0902-0.01026-0.0578-0.01522-0.16008-0.0025-0.29243,0.02793-0.29118,0.13818-0.70893,0.26291-1.1426,0.12473-0.43372,0.25404-0.89785,0.35232-1.3188,0.09828-0.42099,0.18672-0.78846,0.05027-1.1994-0.13644-0.41097-0.43218-0.64202-0.76571-0.92967-0.33353-0.28766-0.70551-0.58555-1.0683-0.86876-0.36275-0.2832-0.7178-0.56075-0.91597-0.78224-0.09908-0.11075-0.16221-0.21163-0.1841-0.26173,0.04834-0.0276,0.15448-0.058,0.3023-0.0902,0.29562-0.0643,0.74518-0.10714,1.2112-0.1267,0.46603-0.0196,0.94824-0.0298,1.3935-0.0697,0.44531-0.0399,0.84679-0.0499,1.2097-0.30216,0.36289-0.25221,0.5383-0.60511,0.71876-1.0001,0.18046-0.39497,0.33731-0.84115,0.50435-1.2616,0.16704-0.42041,0.31848-0.83556,0.47556-1.0859,0.07853-0.12515,0.16751-0.20007,0.21012-0.23565z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/prev.svg b/p/themes/Pafat/icons/prev.svg new file mode 100644 index 000000000..000ecb10d --- /dev/null +++ b/p/themes/Pafat/icons/prev.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-301.0002,-747)"> +<path style="block-progression:tb;color:#666;direction:ltr;text-indent:0;text-align:start;enable-background:new;text-transform:none;" d="m313.01,749-1,0c-0.0104-0.00012-0.0208-0.00046-0.0313,0-0.25495,0.0112-0.50987,0.12858-0.6875,0.3125l-6.2977,5.7188,6.2977,5.7188c0.18816,0.18819,0.45346,0.28125,0.71875,0.28125h1v-1c0-0.26529-0.0931-0.53058-0.28125-0.71875l-4.829-4.2812,4.829-4.2812c0.21074-0.19463,0.30316-0.46925,0.28125-0.75z" fill-rule="nonzero" fill="#666"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/read.svg b/p/themes/Pafat/icons/read.svg new file mode 100644 index 000000000..f3ce7532d --- /dev/null +++ b/p/themes/Pafat/icons/read.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16.001" width="16"> +<g transform="translate(-60.99995,-296.9989)"> +<path opacity="1" style="baseline-shift:baseline;block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" fill="#666" d="m68.875,297a1.0001,1.0001,0,0,0,-0.5,0.25l-4.9062,4a1.0001,1.0001,0,0,0,-0.0625,0.0312s-0.32587,0.29728-0.65625,0.75c-0.22334,0.30605-0.3527,0.8316-0.5,1.3125a1.0001,1.0001,0,0,0,-0.03125,0.0312,1.0001,1.0001,0,0,0,-0.21875,0.5625c-0.00051,0.0118,0.00036,0.0195,0,0.0312a1.0001,1.0001,0,0,0,0,0.0312,1.0001,1.0001,0,0,0,0,0.15625v7.8438a1.0001,1.0001,0,0,0,1,1h12a1.0001,1.0001,0,0,0,1,-1v-7.8438a1.0001,1.0001,0,0,0,0,-0.15625,1.0001,1.0001,0,0,0,-0.21875,-0.65625,1.0001,1.0001,0,0,0,-0.03125,-0.0312c-0.32774-1.1879-1.125-2-1.125-2a1.0001,1.0001,0,0,0,-0.0312,-0.0312l-4.969-4.02a1.0001,1.0001,0,0,0,-0.65625,-0.25,1.0001,1.0001,0,0,0,-0.0937,0zm0.125,2.2812,4.3125,3.5312,0.0312,0.0312c0.021,0.0255,0.18032,0.24952,0.34375,0.5l-4.6874,3.5312-4.6875-3.5312c0.0259-0.0394,0.0349-0.0872,0.0625-0.125,0.1908-0.26146,0.31874-0.41421,0.34375-0.4375l0.03125-0.0312,4.25-3.4688zm-5,5.0938,4.6875,3.5312,0.3125,0.21875,0.3125-0.21875,4.6875-3.5312,0,6.625-10,0,0-6.625z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/share.svg b/p/themes/Pafat/icons/share.svg new file mode 100644 index 000000000..5010082cb --- /dev/null +++ b/p/themes/Pafat/icons/share.svg @@ -0,0 +1,8 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g fill="#666" transform="translate(-581.0002,-196)"> +<path style="enable-background:new;color:#000000;" d="m291,178.03c0,1.0873-0.88144,1.9688-1.9688,1.9688-1.0873,0-1.9688-0.88144-1.9688-1.9688,0-1.0873,0.88144-1.9688,1.9688-1.9688,1.0873,0,1.9688,0.88144,1.9688,1.9688z" fill-rule="nonzero" transform="matrix(1.5079365,0,0,1.5079365,148.15963,-64.49107)"/> +<path style="enable-background:new;color:#000000;" d="m291,178.03c0,1.0873-0.88144,1.9688-1.9688,1.9688-1.0873,0-1.9688-0.88144-1.9688-1.9688,0-1.0873,0.88144-1.9688,1.9688-1.9688,1.0873,0,1.9688,0.88144,1.9688,1.9688z" fill-rule="nonzero" transform="matrix(1.5079365,0,0,1.5079365,158.12818,-59.49107)"/> +<path style="enable-background:new;color:#000000;" d="m291,178.03c0,1.0873-0.88144,1.9688-1.9688,1.9688-1.0873,0-1.9688-0.88144-1.9688-1.9688,0-1.0873,0.88144-1.9688,1.9688-1.9688,1.0873,0,1.9688,0.88144,1.9688,1.9688z" fill-rule="nonzero" transform="matrix(1.5079365,0,0,1.5079365,158.12818,-69.49107)"/> +<path style="baseline-shift:baseline;block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m593.62,198.16-10.062,4.875-1.8125,0.90625,1.8125,0.90625,10.031,5.0625,0.90625-1.8125-8.2188-4.1562,8.2188-4-0.875-1.7812z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/starred.svg b/p/themes/Pafat/icons/starred.svg new file mode 100644 index 000000000..b9ab2f9f7 --- /dev/null +++ b/p/themes/Pafat/icons/starred.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-41.000202,-397)"> +<path style="enable-background:accumulate;color:#000000;" d="m530.95,186.71c-0.77941,0.55189-3.1576-1.906-4.1125-1.9179-0.95532-0.0119-3.3949,2.3858-4.161,1.8149-0.76573-0.57072,0.83698-3.592,0.55319-4.5039-0.2839-0.91223-3.3182-2.4915-3.0119-3.3965,0.30617-0.90461,3.6749-0.31399,4.4544-0.86567,0.77986-0.5519,1.3442-3.9257,2.2995-3.914,0.95494,0.0116,1.4342,3.398,2.1998,3.9689,0.76588,0.57114,4.1489,0.0653,4.4331,0.97746,0.28402,0.9118-2.7885,2.414-3.0949,3.3186-0.30652,0.90489,1.22,3.966,0.44027,4.5182z" fill-rule="nonzero" transform="matrix(1.0472113,-0.00871584,0.00871584,1.0472113,-504.35434,220.15425)" fill="#666"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/tag.svg b/p/themes/Pafat/icons/tag.svg new file mode 100644 index 000000000..9908d4665 --- /dev/null +++ b/p/themes/Pafat/icons/tag.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-141.0002,-807)"> +<path d="m149,809,0,13,4-4,4,4c0.0525-6.8494-0.0285-10.584,0-13z" fill="#666"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/unread.svg b/p/themes/Pafat/icons/unread.svg new file mode 100644 index 000000000..77ce9c8b4 --- /dev/null +++ b/p/themes/Pafat/icons/unread.svg @@ -0,0 +1,6 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-40.99995,-297)" fill="#666"> +<path style="block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m43.781,301a1.0001,1.0001,0,0,0,-0.40625,1.7812l5,4,0.625,0.5,0.625-0.5,5-4a1.0005,1.0005,0,1,0,-1.25,-1.5625l-4.375,3.5-4.375-3.5a1.0001,1.0001,0,0,0,-0.844,-0.22z"/> +<path style="block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="M42.906,300a1.0001,1.0001,0,0,0,-0.906,1v9a1.0001,1.0001,0,0,0,1,1h12a1.0001,1.0001,0,0,0,1,-1v-9a1.0001,1.0001,0,0,0,-1,-1h-12a1.0001,1.0001,0,0,0,-0.09375,0zm1.094,2h10v7h-10v-7z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/icons/up.svg b/p/themes/Pafat/icons/up.svg new file mode 100644 index 000000000..bd9be09e9 --- /dev/null +++ b/p/themes/Pafat/icons/up.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-201.0002,-747)"> +<path style="block-progression:tb;color:#666;direction:ltr;text-indent:0;text-align:start;enable-background:new;text-transform:none;" d="m215.03,759,0-1c-0.00091-0.0111,0.00059-0.021-0.00009-0.0312-0.0112-0.25496-0.12835-0.50994-0.31251-0.6875l-5.7188-6.2977-5.7188,6.2977c-0.18821,0.1881-0.28121,0.45346-0.28122,0.71875v1h1c0.26531-0.00007,0.53059-0.0931,0.71873-0.28131l4.2812-4.829,4.2813,4.829c0.19464,0.21073,0.46925,0.30315,0.74998,0.2813z" fill-rule="nonzero" fill="#666"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Pafat/loader.gif b/p/themes/Pafat/loader.gif Binary files differnew file mode 100644 index 000000000..a3d327a18 --- /dev/null +++ b/p/themes/Pafat/loader.gif diff --git a/p/themes/Pafat/metadata.json b/p/themes/Pafat/metadata.json new file mode 100644 index 000000000..ba82e0a09 --- /dev/null +++ b/p/themes/Pafat/metadata.json @@ -0,0 +1,7 @@ +{ + "name": "Pafat", + "author": "Plopoyop", + "description": "Un thème pour FreshRSS", + "version": 0.2, + "files": ["_template.css", "pafat.css"] +} diff --git a/p/themes/Pafat/pafat.css b/p/themes/Pafat/pafat.css new file mode 100644 index 000000000..abe808eab --- /dev/null +++ b/p/themes/Pafat/pafat.css @@ -0,0 +1,1079 @@ +@charset "UTF-8"; + +/*=== FONTS */ +@font-face { + font-family: "OpenSans"; + src: url("../fonts/openSans.woff") format("woff"); +} + +/*=== GENERAL */ +/*============*/ +html, body { + height: 100%; + font-family: "OpenSans", "Cantarell", "Helvetica", "Arial", sans-serif; + background: #fafafa; + color : #666; +} + +/*=== Links */ +a { + color: #2980b9; + outline: none; +} + +/*=== Forms */ +legend { + margin: 20px 0 5px; + padding: 5px 0; + border-bottom: 1px solid #ddd; + font-size: 1.4em; +} +label { + min-height: 25px; + padding: 5px 0; + cursor: pointer; +} +textarea { + width: 360px; + height: 100px; +} +input, select, textarea { + min-height: 25px; + padding: 1px; + background: #fdfdfd; + border: 1px solid #bbb; + border-radius: 3px; + color: #666; + line-height: 21px; + vertical-align: middle; +} + +option { + padding: 0 .5em; +} +input:focus, select:focus, textarea:focus { + outline-color: #aaa; +} + +input:invalid, select:invalid { + border-color: #f00; + box-shadow: 0 0 2px 2px #fdd inset; + outline-color: #fdd; +} +input:disabled, select:disabled { + background: #eee; +} +input.extend { + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; +} + +/*=== Tables */ +table { + border-collapse: collapse; +} + +tr, th, td { + padding: 0.5em; + border: 1px solid #ddd; +} +th { + background: #f6f6f6; +} +form td, +form th { + font-weight: normal; + text-align: center; +} + +/*=== COMPONENTS */ +/*===============*/ +/*=== Forms */ +.form-group.form-actions { + padding: 5px 0; + background: #f4f4f4; + border-top: 1px solid #ddd; +} +.form-group.form-actions .btn { + margin: 0 10px; +} +.form-group .group-name { + padding: 10px 0; + text-align: right; +} +.form-group .group-controls { + min-height: 25px; + padding: 5px 0; + margin : 10px 0 10px 220px; + +} +.form-group table { + margin: 10px 0 0 220px; +} + +/*=== Buttons */ +.stick { + vertical-align: middle; + font-size: 0; + min-width: 215px; +} +.stick input, +.stick .btn { + border-radius: 0; +} +.stick .btn:first-child, +.stick input:first-child { + border-radius: 3px 0 0 3px; +} +.stick .btn-important:first-child { + width:176px; +} +.stick .btn:last-child, +.stick input:last-child { + border-radius: 0 3px 3px 0; +} +.stick .btn + .btn, +.stick .btn + input, +.stick .btn + .dropdown > .btn, +.stick input + .btn, +.stick input + input, +.stick input + .dropdown > .btn, +.stick .dropdown + .btn, +.stick .dropdown + input, +.stick .dropdown + .dropdown > .btn { + border-left: none; + +} + +.stick .btn + .dropdown > .btn { + border-left: none; + border-radius: 0 3px 3px 0; +} + +.btn { + display: inline-block; + min-height: 29px; + min-width: 15px; + margin: 0; + padding: 1px 5px; + background: #fff; + border-radius: 3px; + border: 1px solid #aaa; + color: #666; + font-size: 0.9rem; + vertical-align: middle; + cursor: pointer; + overflow: hidden; +} + +a.btn { + min-height: 25px; + line-height: 25px; +} + + +a.btn { + min-height: 25px; + line-height: 25px; +} + +.read_all.btn { + height:29px; +} + +.btn:hover { + background: #f0f0f0; + text-decoration: none; +} + +.btn.active, +.btn:active, +.dropdown-target:target ~ .btn.dropdown-toggle { + background: #eee; +} + +.btn-important { + background: #5cb85c; + color: #fff; + border-color: #5cb85c; + font-weight: normal; +} +.btn-important:hover, .btn-important:active { + background:#47a447; + border-color : #47a447; + box-shadow: none; +} + +.btn-attention { + background: #d9534f; + color: #fff; + border: 1px solid #d9534f; + outline-color : #aaa; +} +.btn-attention:hover { + background: #d2322d; + border-color : #d2322d; +} +.btn-attention:active { + background: #d2322d; + box-shadow: none; +} + +/*=== Navigation */ +.nav-list .nav-header, +.nav-list .item { + height: 2.5em; + line-height: 2.5em; + font-size: 0.9rem; +} +.nav-list .item:hover { + background: #fafafa; +} +.nav-list .item:hover a { + color: #003388; +} +.nav-list .item.active { + background: #3498DB; + color: #fff; +} +.nav-list .item.active a { + color: #fff; +} +.nav-list .disable { + color: #aaa; + background: #fafafa; + text-align: center; +} +.nav-list .item > a { + padding: 0 10px; +} +.nav-list a:hover { + text-decoration: none; +} +.nav-list .item.empty a { + color: #f39c12; +} +.nav-list .item.active.empty a { + color: #fff; + background: #f39c12; +} +.nav-list .item.error a { + color: #BD362F; +} +.nav-list .item.active.error a { + color: #fff; + background: #BD362F; +} + +.nav-list .nav-header { + padding: 0 10px; + color: #888; + background: #f4f4f4; + border-bottom: 1px solid #ddd; + font-weight: bold; +} + +.nav-list .nav-form { + padding: 3px; + text-align: center; +} + +.nav-head { + margin: 0; + background: #fff; + background: linear-gradient(to bottom, #fff, #f0f0f0); + background: -moz-linear-gradient(top, #fff 0%, #f0f0f0 100%); + background: -webkit-linear-gradient(top, #fff 0%, #f0f0f0 100%); + background: -o-linear-gradient(top, #fff 0%, #f0f0f0 100%); + background: -ms-linear-gradient(top, #fff 0%, #f0f0f0 100%); + border-bottom: 1px solid #ddd; + text-align: right; +} +.nav-head .item { + padding: 5px 10px; + font-size: 0.9rem; + line-height: 1.5rem; +} + +/*=== Horizontal-list */ +.horizontal-list { + margin: 0; + padding: 0; +} +.horizontal-list .item { + vertical-align: middle; +} + +/*=== Dropdown */ +.dropdown-menu { + margin: 5px 0 0; + padding: 5px 0; + border: 1px solid #aaa; + border-radius: 5px; + font-size: 0.8rem; + text-align: left; +} +.dropdown-menu::after { + content: ""; + position: absolute; + top: -6px; + right: 13px; + width: 10px; + height: 10px; + background: #fff; + border-top: 1px solid #aaa; + border-left: 1px solid #aaa; + z-index: -10; + transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); +} +.dropdown-header { + padding: 0 5px 5px; + color: #888; + font-weight: bold; + text-align: left; +} +.dropdown-menu > .item { +} + +.dropdown-menu > .item > a { + padding: 0 22px; + line-height: 2.5em; + color: #666; + font-size: 0.8rem; +} + +.dropdown-menu > .item > span, +.dropdown-menu > .item > .as-link { + padding: 0 22px; + line-height: 2em; + font-size: 0.8rem; +} + +.dropdown-menu > .item:hover { + background: #eee; + color: #666; +} +.dropdown-menu > .item[aria-checked="true"] > a::before { + font-weight: bold; + margin: 0 0 0 -14px; +} +.dropdown-menu > .item:hover > a { + color: #666; + text-decoration: none; +} +.dropdown-menu .input select, +.dropdown-menu .input input { + margin: 0 auto 5px; + padding: 2px 5px; + border-radius: 3px; +} + +.separator { + margin: 5px 0; + border-bottom: 1px solid #ddd; +} + +/*=== Alerts */ +.alert { + margin: 15px auto; + padding: 10px 15px; + background: #f4f4f4; + border: 1px solid #ccc; + border-right: 1px solid #aaa; + border-bottom: 1px solid #aaa; + border-radius: 5px; + color: #aaa; + font-size: 0.9em; +} +.alert-head { + font-size: 1.15em; +} +.alert > a { + color: inherit; + text-decoration: underline; +} +.alert-warn { + background: #ffe; + border: 1px solid #eeb; + color: #c95; +} +.alert-success { + background: #dfd; + border: 1px solid #cec; + color: #484; +} +.alert-error { + background: #fdd; + border: 1px solid #ecc; + color: #844; +} + +/*=== Pagination */ +.pagination { + background: #fff; + text-align: center; + color: #41444f; + font-size: 0.8em; +} +.content .pagination { + margin: 0; + padding: 0; +} +.pagination .item.pager-current { + font-weight: bold; + font-size: 1.5em; +} +.pagination .item a { + display: block; + color: #41444f; + font-style: italic; + line-height: 3em; + text-decoration: none; +} +.pagination .item a:hover { + background: #ddd; +} +.pagination:first-child .item { + border-bottom: 1px solid #aaa; +} +.pagination:last-child .item { + border-top: 1px solid #aaa; +} + +.pagination .loading, +.pagination a:hover.loading { + background: url("loader.gif") center center no-repeat #fff; + font-size: 0; +} + +/*=== Boxes */ +.box { + border: 1px solid #aaa; + border-radius: 5px; +} +.box .box-title { + margin: 0; + padding: 5px 10px; + background: #f6f6f6; + border-bottom: 1px solid #aaa; + border-radius: 5px 5px 0 0; +} +.box .box-content { + max-height: 260px; +} + +.box .box-content .item { + padding: 0 10px; + font-size: 0.9rem; + line-height: 2.5em; +} + +.box .box-content .item .configure { + visibility: hidden; +} +.box .box-content .item:hover .configure { + visibility: visible; +} + +/*=== Tree */ +.tree { + margin: 10px 0; +} +.tree-folder-title { + position: relative; + margin: 5px; + padding: 0 10px; + line-height: 2rem; + font-size: 0.9rem; + background: #5bc0de; + color: #fff; + border-top: 1px solid transparent; + border-bottom: 1px solid transparent; + border-radius: 5px; +} +.tree-folder-title .title { + background: inherit; + color: #fff; +} +.tree-folder-title .title:hover { + text-decoration: none; +} +.tree-folder.active .tree-folder-title { + background: #39b3d7; + font-weight: bold; + font-size: 1rem; + border-top: 1px solid #666; + border-bottom: 1px solid #666; +} +.tree-folder-items > .item { + padding: 0 10px; + line-height: 2.5rem; + font-size: 0.8rem; +} +.tree-folder-items > .item.active { + background: #5cb85c; +} +.tree-folder-items > .item > a { + text-decoration: none; +} +.tree-folder-items > .item.active > a { + color: #fff; +} + +/*=== STRUCTURE */ +/*===============*/ +/*=== Header */ +.header { + height: 85px; + background: #41444f; +} +.header > .item { + padding: 10px; + border-bottom: 1px solid #aaa; + vertical-align: middle; + text-align: center; +} +.header > .item.title{ + width: 230px; +} +.header > .item.title h1 { + margin: 0.5em 0; +} + +.header > .item.title h1 a, a.signin { + text-decoration: none; + color : #C5C6CA; +} + +.header > .item.search input { + width: 230px; + height : 29px; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +.header > .item.search button { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + height : 29px; +} + +.header .item.search input:focus { + width: 350px; +} + +/*=== Body */ +#global { + height: calc(100% - 85px); +} +.aside { + border-right: 1px solid #aaa; + background: #fff; +} +.aside.aside_feed { + padding: 10px 0; + text-align: center; +} +.aside.aside_feed .tree { + margin: 10px 0 50px; +} + +/*=== Aside main page (categories) */ +.aside_feed .tree-folder-title > .title:not([data-unread="0"])::after { + position: absolute; + top: 0.25rem; right: 3px; + padding: 0px 5px; + border: 1px solid #fff; + border-radius: 3px; + font-size: 0.8rem; + line-height: 1.5rem; +} +.aside_feed .tree-folder.all .tree-folder-title { + background: #428bca; +} +.aside_feed .tree-folder.all.active .tree-folder-title { + background: #3276b1; +} +.aside_feed .tree-folder.favorites .tree-folder-title { + background: #f0ad4e; +} +.aside_feed .tree-folder.favorites.active .tree-folder-title { + background: #ed9c28; +} + +/*=== Aside main page (feeds) */ +.feed.item.empty.active { + background: #e67e22; +} +.feed.item.error.active { + background: #bd362f; +} +.feed.item.empty, +.feed.item.empty > a { + color: #e67e22; +} +.feed.item.error, +.feed.item.error > a { + color: #bd362f; +} +.feed.item.empty.active, +.feed.item.error.active, +.feed.item.empty.active > a, +.feed.item.error.active > a { + color: #fff; +} +.aside_feed .tree-folder-items .dropdown-menu::after { + left: 2px; +} +.aside_feed .tree-folder-items .item .dropdown-target:target ~ .dropdown-toggle > .icon, +.aside_feed .tree-folder-items .item:hover .dropdown-toggle > .icon, +.aside_feed .tree-folder-items .item.active .dropdown-toggle > .icon { + border-radius: 3px; + background-color: #fff; +} + +/*=== Configuration pages */ +.post { + padding: 10px 50px; + font-size: 0.9em; +} +.post form { + margin: 10px 0; +} +.post.content { + max-width: 550px; +} + +/*=== Prompt (centered) */ +.prompt { + text-align: center; +} +.prompt label { + text-align: left; +} +.prompt form { + margin: 10px auto 20px auto; + width: 200px; +} +.prompt input { + margin: 5px auto; + width: 100%; +} +.prompt p { + margin: 20px 0; +} + +/*=== New article notification */ +#new-article { + background: #428bca; + text-align: center; + font-size: 0.9em; +} +#new-article:hover { + background: #3276b1; +} +#new-article > a { + line-height: 3em; + color: #fff; + font-weight: bold; +} +#new-article > a:hover { + text-decoration: none; +} + +/*=== Day indication */ +.day { + padding: 0 10px; + font-weight: bold; + line-height: 3em; + background: #fff; + border-top: 1px solid #aaa; + border-bottom: 1px solid #aaa; + color : #666; +} +#new-article + .day { + border-top: none; +} +.day .name { + padding: 0 10px 0 0; + color : #666; + font-size: 1.8em; + opacity: 0.3; + font-style: italic; + text-align: right; +} + +/*=== Index menu */ +.nav_menu { + background: #fafafa; + border-bottom: 1px solid #aaa; + text-align: center; + padding: 5px 0; +} + +/*=== Feed articles */ +.flux { + border-left: 3px solid #5cb85c; + background: #fafafa; +} +.flux:hover { + background: #fff; +} +.flux.current { + border-left: 3px solid #39b3d7; +} +.flux.not_read { + border-left: 3px solid #d9534f; +} +.flux .item.title a, .flux.not_read:not(.current):hover .item.title { + color : #333; +} +.flux.favorite { + border-left: 2px solid #428bca; + background: #FFF6DA; +} +.flux.favorite:not(.current):hover .item.title { + background: #FFF6DA; +} +.flux.current { + background: #fff; +} + + +.flux_header { + border-top: 1px solid #ddd; + font-size: 0.8rem; + cursor: pointer; +} +.flux_header .title { + font-size: 0.9rem; +} +.flux .website .favicon { + padding: 5px; +} +.flux .date { + color: #666; + font-size: 0.7rem; +} + +.flux .bottom { + font-size: 0.8rem; + text-align: center; +} + +/*=== Content of feed articles */ +.content { + padding: 20px 10px; +} +.content > h1.title > a { + color: #333; +} + +.content hr { + margin: 30px 10px; + height: 1px; + background: #ddd; + border: 0; + box-shadow: 0 2px 5px #ccc; +} + +.content pre { + margin: 10px auto; + padding: 10px 20px; + overflow: auto; + background: #222; + color: #fff; + font-size: 0.9rem; + border-radius: 3px; +} +.content code { + padding: 2px 5px; + color: #dd1144; + background: #fafafa; + border: 1px solid #eee; + border-radius: 3px; +} +.content pre code { + background: transparent; + color: #fff; + border: none; +} + +.content blockquote { + display: block; + margin: 0; + padding: 5px 20px; + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + background: #fafafa; + color: #41444f; +} +.content blockquote p { + margin: 0; +} + +/*=== Notification and actualize notification */ +.notification { + padding: 0 0 0 5px; + text-align: center; + border: 1px solid #eeb; + border-radius: 3px; + box-shadow: 0 0 5px #ddd; + font-weight: bold; + font-size: 0.9em; + line-height: 3em; + z-index: 10; + vertical-align: middle; +} +.notification.good { + background: #ffe; + border: 1px solid #eeb; + color: #c95; +} +.notification.bad { + background: #fdd; + border: 1px solid #ecc; + color: #844; +} +.notification a.close { + padding: 0 15px; + line-height: 3em; +} +.notification.good a.close:hover { + background: #eeb; +} +.notification.bad a.close:hover { + background: #ecc; +} + +.notification#actualizeProgress { + line-height: 2em; +} + +/*=== "Load more" part */ +#bigMarkAsRead { + text-align: center; + text-decoration: none; + color: #666; + background: #fafafa; +} +#bigMarkAsRead:hover { + color: #000; + background: #f0f0f0; +} + +#bigMarkAsRead:hover .bigTick { +/* text-shadow: 0 0 10px #666;*/ +} + +/*=== Navigation menu (for articles) */ +#nav_entries { + margin: 0; + background: #fff; + border-top: 1px solid #ddd; + text-align: center; + line-height: 3em; + table-layout: fixed; +} + +#nav_entries .item:hover { + background:#eee ; +} +/*=== READER VIEW */ +/*================*/ +#stream.reader .flux { + padding: 0 0 50px; + border: none; + background: #f0f0f0; + color: #41444f; +} +#stream.reader .flux .author { + margin: 0 0 10px; + font-size: 90%; + color: #666; +} + +/*=== GLOBAL VIEW */ +/*================*/ +.box.category .box-title .title { + font-weight: normal; + text-decoration: none; + text-align: left; +} +.box.category:not([data-unread="0"]) .box-title { + background: #5BC0DE; +} +.box.category:not([data-unread="0"]) .box-title .title { + font-weight: bold; + color: #fff; +} +.box.category .title:not([data-unread="0"])::after { + position: absolute; + top: 5px; right: 10px; + border: 0; + background: none; + font-weight: bold; + box-shadow: none; + text-shadow: none; + font-size: 0.8rem; + line-height: 1.6rem; +} +.box.category .item.feed { + padding: 2px 10px; + font-size: 0.8rem; +} + +/*=== DIVERS */ +/*===========*/ +.aside.aside_feed .nav-form input, +.aside.aside_feed .nav-form select { + width: 140px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu { + right: -20px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu::after { + right: 33px; +} + +/*=== STATISTICS */ +/*===============*/ +.stat { + margin: 10px 0 20px; +} + +.stat th, +.stat td, +.stat tr { + border: none; +} +.stat > table td, +.stat > table th { + border-bottom: 1px solid #ddd; + text-align: center; +} +.stat > .horizontal-list { + margin: 0 0 5px; +} +.stat > .horizontal-list .item { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.stat > .horizontal-list .item:first-child { + width: 250px; +} + +/*=== LOGS */ +/*=========*/ +.loglist { + border: 1px solid #aaa; + border-radius: 5px; + overflow: hidden; +} +.log { + padding: 5px 10px; + background: #fafafa; + color: #41444f; + font-size: 0.8rem; +} +.log+.log { + border-top: 1px solid #aaa; +} +.log .date { + display: block; + font-weight: bold; +} +.log.error { + background: #fdd; + color: #844; +} +.log.warning { + background: #ffe; + color: #c95; +} +.log.notice { + background: #f4f4f4; + color: #aaa; +} +.log.debug { + background: #41444f; + color: #eee; +} + +/*=== MOBILE */ +/*===========*/ +@media(max-width: 840px) { + .aside { + box-shadow: 3px 0 3px #aaa; + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; + } + .aside .toggle_aside, + #panel .close { + display: block; + width: 100%; + height: 40px; + line-height: 40px; + text-align: center; + background: #f6f6f6; + border-bottom: 1px solid #ddd; + } + + .aside.aside_feed { + padding: 0; + } + + .nav_menu .btn { + margin: 5px 10px; + } + .nav_menu .stick { + margin: 0 10px; + } + .nav_menu .stick .btn { + margin: 5px 0; + } + .nav_menu .search { + display: inline-block; + max-width: 97%; + } + .nav_menu .search input { + max-width: 97%; + width: 90px; + } + .nav_menu .search input:focus { + width: 400px; + } + + .day .name { + font-size: 1.1rem; + text-shadow: none; + } + + .pagination { + margin: 0 0 3.5em; + } + + .notification a.close { + display: block; + left: 0; + background: transparent; + } + .notification a.close:hover { + opacity: 0.5; + } + .notification a.close .icon { + display: none; + } +}
\ No newline at end of file diff --git a/p/themes/Pafat/thumbs/original.png b/p/themes/Pafat/thumbs/original.png Binary files differnew file mode 100644 index 000000000..fe05f7260 --- /dev/null +++ b/p/themes/Pafat/thumbs/original.png diff --git a/p/themes/Screwdriver/README.md b/p/themes/Screwdriver/README.md new file mode 100644 index 000000000..385e1dc71 --- /dev/null +++ b/p/themes/Screwdriver/README.md @@ -0,0 +1,36 @@ +Screwdriver +======= + +**C'est un cocktail! C'est chaud mais "fresh" à la fois. C'est... c'est... un thème pour l'agrégateur de flux RSS<a href="https://github.com/FreshRSS/FreshRSS/" target="blank">FreshRSS</a>!!** +En toute modestie, ce thème tue du chaton. + + + + +Installation +----------------- +1. Placez le dossier du thème dans ledossier /FreshRSS/p/themes/Screwdriver de votre FreshRSS; +2. Allez dans les paramètres d'Affichage et changez de thème; +3. Profitez de votre Screwdriver! +4. Remontez les problèmes sur Github (facultatif mais fortement apprécié) + + + +Screwdriver est distribué sous license BeerWare: +----------------- + +« LICENCE BEERWARE » (Révision 42): + +mister.air@gmail.com a créé ce fichier. Tant que vous conservez cet avertissement, + +vous pouvez faire ce que vous voulez de ce truc. Si on se rencontre un jour et + +que vous pensez que ce truc vaut le coup, vous pouvez me payer une bière en retour. + +*Mister aiR* + + + + + + diff --git a/p/themes/Screwdriver/icons/bookmark.svg b/p/themes/Screwdriver/icons/bookmark.svg new file mode 100644 index 000000000..edf5a02db --- /dev/null +++ b/p/themes/Screwdriver/icons/bookmark.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-41.000202,-397)"> +<path style="color:#000000;enable-background:accumulate;" d="m530.95,186.71c-0.77941,0.55189-3.1576-1.906-4.1125-1.9179-0.95532-0.0119-3.3949,2.3858-4.161,1.8149-0.76573-0.57072,0.83698-3.592,0.55319-4.5039-0.2839-0.91223-3.3182-2.4915-3.0119-3.3965,0.30617-0.90461,3.6749-0.31399,4.4544-0.86567,0.77986-0.5519,1.3442-3.9257,2.2995-3.914,0.95494,0.0116,1.4342,3.398,2.1998,3.9689,0.76588,0.57114,4.1489,0.0653,4.4331,0.97746,0.28402,0.9118-2.7885,2.414-3.0949,3.3186-0.30652,0.90489,1.22,3.966,0.44027,4.5182z" fill-rule="nonzero" transform="matrix(1.0472113,-0.00871584,0.00871584,1.0472113,-504.35434,220.15425)" fill="#d18104"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Screwdriver/icons/favicon-16-32-48-64.ico b/p/themes/Screwdriver/icons/favicon-16-32-48-64.ico Binary files differnew file mode 100644 index 000000000..7c5eb5517 --- /dev/null +++ b/p/themes/Screwdriver/icons/favicon-16-32-48-64.ico diff --git a/p/themes/Screwdriver/icons/favicon-256.png b/p/themes/Screwdriver/icons/favicon-256.png Binary files differnew file mode 100644 index 000000000..235b18c97 --- /dev/null +++ b/p/themes/Screwdriver/icons/favicon-256.png diff --git a/p/themes/Screwdriver/icons/favicon.svg b/p/themes/Screwdriver/icons/favicon.svg new file mode 100644 index 000000000..895a727bb --- /dev/null +++ b/p/themes/Screwdriver/icons/favicon.svg @@ -0,0 +1,34 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<defs> +<linearGradient id="linearGradient4149"> +<stop stop-color="#d18114" offset="0"/> +<stop stop-color="#ed9514" offset="1"/> +</linearGradient> +<linearGradient id="linearGradient4155" y2="28.285" xlink:href="#linearGradient4149" gradientUnits="userSpaceOnUse" x2="144.51" y1="28.285" x1="64.102"/> +<linearGradient id="linearGradient4159" y2="-11.652" xlink:href="#linearGradient4149" gradientUnits="userSpaceOnUse" x2="126.84" y1="69.532" x1="64.102"/> +</defs> +<g fill="#FFF" transform="matrix(1.7556028,0,0,1.7556028,2.4536682,156.92143)"> +<g transform="matrix(0.9774773,0,0,0.9774773,0.92631875,-74.208835)"> +<path d="m64.102-11.469,0,14.25c36.018,0.0418,65.198,29.235,65.218,65.259h15.189c-0.46275-43.994-36.228-79.509-80.332-79.509-0.02635,0-0.05196-0.000025-0.0783,0z"/> +<path d="m64.102,14.799,0,14.876c21.188,0.12639,38.346,17.217,38.639,38.365h15.581c-0.21-29.445-24.175-53.241-53.669-53.241-0.18468,0-0.36384-0.0019-0.54807,0z"/> +</g> +<g transform="translate(-4.1395349,-75.482558)"> +<path d="M61.077,4.2013c-32.069,3.4709-57.062,30.537-57.188,63.5h11.906c-0.001-0.13569,0-0.27032,0-0.40625,0-26.472,19.725-48.306,45.281-51.656v-11.437z"/> +<path d="m61.077,25.42c-20.105,3.4776-35.409,20.946-35.469,42.031h11.125c0.11711-14.724,10.509-27.002,24.344-30.062v-11.969z"/> +<path d="m68.171,50.108c-9.502,0-17.188,7.6855-17.188,17.188,0,9.502,7.6855,17.219,17.188,17.219,9.502,0,17.219-7.7167,17.219-17.219,0-9.502-7.7167-17.188-17.219-17.188z"/> +<path d="m98.14,74.17c-2.9607,13.954-15.281,24.445-30.094,24.562v11.656c0.12455,0.001,0.2502,0,0.375,0,21.41,0,39.173-15.697,42.344-36.219h-12.625z"/> +<path d="m119.58,74.17c-3.3587,25.459-25.062,45.157-51.406,45.281v12.656c33.284-0.0636,60.6-25.457,63.719-57.938h-12.312z"/> +</g> +</g> +<g fill="url(#linearGradient4155)" transform="matrix(1.7160619,0,0,1.7160619,5.3998589,23.251436)"> +<path d="m64.102-11.469,0,14.25c36.018,0.0418,65.198,29.235,65.218,65.259h15.189c-0.46275-43.994-36.228-79.509-80.332-79.509-0.02635,0-0.05196-0.000025-0.0783,0z"/> +<path d="m64.102,14.799,0,14.876c21.188,0.12639,38.346,17.217,38.639,38.365h15.581c-0.21-29.445-24.175-53.241-53.669-53.241-0.18468,0-0.36384-0.0019-0.54807,0z"/> +</g> +<g fill="#222" transform="matrix(1.7556028,0,0,1.7556028,-3.4937681,21.015289)"> +<path d="M61.077,4.2013c-32.069,3.4709-57.062,30.537-57.188,63.5h11.906c-0.001-0.13569,0-0.27032,0-0.40625,0-26.472,19.725-48.306,45.281-51.656v-11.437z"/> +<path d="m61.077,25.42c-20.105,3.4776-35.409,20.946-35.469,42.031h11.125c0.11711-14.724,10.509-27.002,24.344-30.062v-11.969z"/> +<path d="m68.171,50.108c-9.502,0-17.188,7.6855-17.188,17.188,0,9.502,7.6855,17.219,17.188,17.219,9.502,0,17.219-7.7167,17.219-17.219,0-9.502-7.7167-17.188-17.219-17.188z"/> +<path d="m98.14,74.17c-2.9607,13.954-15.281,24.445-30.094,24.562v11.656c0.12455,0.001,0.2502,0,0.375,0,21.41,0,39.173-15.697,42.344-36.219h-12.625z"/> +<path d="m119.58,74.17c-3.3587,25.459-25.062,45.157-51.406,45.281v12.656c33.284-0.0636,60.6-25.457,63.719-57.938h-12.312z"/> +</g> +</svg> diff --git a/p/themes/Screwdriver/icons/icon.svg b/p/themes/Screwdriver/icons/icon.svg new file mode 100644 index 000000000..268814463 --- /dev/null +++ b/p/themes/Screwdriver/icons/icon.svg @@ -0,0 +1,34 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<defs> +<linearGradient id="linearGradient4149"> +<stop stop-color="#d18114" offset="0"/> +<stop stop-color="#ed9514" offset="1"/> +</linearGradient> +<linearGradient id="linearGradient4155" y2="28.285" xlink:href="#linearGradient4149" gradientUnits="userSpaceOnUse" x2="144.51" y1="28.285" x1="64.102"/> +<linearGradient id="linearGradient4159" y2="-11.652" xlink:href="#linearGradient4149" gradientUnits="userSpaceOnUse" x2="126.84" y1="69.532" x1="64.102"/> +</defs> +<g fill="#FFF" transform="matrix(0.40427237,0,0,0.40427237,0.65228897,36.70875)"> +<g transform="matrix(0.9774773,0,0,0.9774773,0.92631875,-74.208835)"> +<path d="m64.102-11.469,0,14.25c36.018,0.0418,65.198,29.235,65.218,65.259h15.189c-0.46275-43.994-36.228-79.509-80.332-79.509-0.02635,0-0.05196-0.000025-0.0783,0z"/> +<path d="m64.102,14.799,0,14.876c21.188,0.12639,38.346,17.217,38.639,38.365h15.581c-0.21-29.445-24.175-53.241-53.669-53.241-0.18468,0-0.36384-0.0019-0.54807,0z"/> +</g> +<g transform="translate(-4.1395349,-75.482558)"> +<path d="M61.077,4.2013c-32.069,3.4709-57.062,30.537-57.188,63.5h11.906c-0.001-0.13569,0-0.27032,0-0.40625,0-26.472,19.725-48.306,45.281-51.656v-11.437z"/> +<path d="m61.077,25.42c-20.105,3.4776-35.409,20.946-35.469,42.031h11.125c0.11711-14.724,10.509-27.002,24.344-30.062v-11.969z"/> +<path d="m68.171,50.108c-9.502,0-17.188,7.6855-17.188,17.188,0,9.502,7.6855,17.219,17.188,17.219,9.502,0,17.219-7.7167,17.219-17.219,0-9.502-7.7167-17.188-17.219-17.188z"/> +<path d="m98.14,74.17c-2.9607,13.954-15.281,24.445-30.094,24.562v11.656c0.12455,0.001,0.2502,0,0.375,0,21.41,0,39.173-15.697,42.344-36.219h-12.625z"/> +<path d="m119.58,74.17c-3.3587,25.459-25.062,45.157-51.406,45.281v12.656c33.284-0.0636,60.6-25.457,63.719-57.938h-12.312z"/> +</g> +</g> +<g fill="url(#linearGradient4155)" transform="matrix(0.39516706,0,0,0.39516706,1.3307246,5.9278164)"> +<path d="m64.102-11.469,0,14.25c36.018,0.0418,65.198,29.235,65.218,65.259h15.189c-0.46275-43.994-36.228-79.509-80.332-79.509-0.02635,0-0.05196-0.000025-0.0783,0z"/> +<path d="m64.102,14.799,0,14.876c21.188,0.12639,38.346,17.217,38.639,38.365h15.581c-0.21-29.445-24.175-53.241-53.669-53.241-0.18468,0-0.36384-0.0019-0.54807,0z"/> +</g> +<g fill="#222" transform="matrix(0.40427237,0,0,0.40427237,-0.71726009,5.4128854)"> +<path d="M61.077,4.2013c-32.069,3.4709-57.062,30.537-57.188,63.5h11.906c-0.001-0.13569,0-0.27032,0-0.40625,0-26.472,19.725-48.306,45.281-51.656v-11.437z"/> +<path d="m61.077,25.42c-20.105,3.4776-35.409,20.946-35.469,42.031h11.125c0.11711-14.724,10.509-27.002,24.344-30.062v-11.969z"/> +<path d="m68.171,50.108c-9.502,0-17.188,7.6855-17.188,17.188,0,9.502,7.6855,17.219,17.188,17.219,9.502,0,17.219-7.7167,17.219-17.219,0-9.502-7.7167-17.188-17.219-17.188z"/> +<path d="m98.14,74.17c-2.9607,13.954-15.281,24.445-30.094,24.562v11.656c0.12455,0.001,0.2502,0,0.375,0,21.41,0,39.173-15.697,42.344-36.219h-12.625z"/> +<path d="m119.58,74.17c-3.3587,25.459-25.062,45.157-51.406,45.281v12.656c33.284-0.0636,60.6-25.457,63.719-57.938h-12.312z"/> +</g> +</svg> diff --git a/p/themes/Screwdriver/icons/read.svg b/p/themes/Screwdriver/icons/read.svg new file mode 100644 index 000000000..5e454e36b --- /dev/null +++ b/p/themes/Screwdriver/icons/read.svg @@ -0,0 +1,3 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16.001" width="16"> +<path fill="#CCC" d="m8.0005,3.2833c-3.4339,0-6.4103,1.9996-7.8729,4.9206,1.4626,2.9209,4.439,4.9206,7.8729,4.9206,3.4338,0,6.4102-1.9996,7.8729-4.9206-1.462-2.9204-4.439-4.9201-7.8725-4.9201zm3.8819,2.6095c0.9251,0.59007,1.709,1.3804,2.2978,2.3111-0.58881,0.93063-1.3727,1.721-2.2978,2.3111-1.1624,0.7414-2.5047,1.1333-3.8818,1.1333s-2.7195-0.39189-3.8819-1.1333c-0.92507-0.59004-1.709-1.3804-2.2978-2.3111,0.58881-0.93066,1.3727-1.721,2.2978-2.3111,0.06025-0.038442,0.12111-0.075682,0.18234-0.11225-0.15312,0.42021-0.23692,0.87374-0.23692,1.3469,0,2.174,1.7624,3.9364,3.9364,3.9364s3.9365-1.7624,3.9365-3.9364c0-0.4732-0.0838-0.92673-0.23692-1.347,0.0612,0.036566,0.12206,0.073839,0.18234,0.11228zm-3.8815,0.7427c0,0.81528-0.66089,1.4762-1.4762,1.4762-0.81528,0-1.4762-0.66089-1.4762-1.4762,0-0.81528,0.66089-1.4762,1.4762-1.4762,0.81527,0,1.4762,0.66089,1.4762,1.4762z"/> +</svg>
\ No newline at end of file diff --git a/p/themes/Screwdriver/icons/starred.svg b/p/themes/Screwdriver/icons/starred.svg new file mode 100644 index 000000000..cd06525fd --- /dev/null +++ b/p/themes/Screwdriver/icons/starred.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-41.000202,-397)"> +<path style="color:#000000;enable-background:accumulate;" d="m530.95,186.71c-0.77941,0.55189-3.1576-1.906-4.1125-1.9179-0.95532-0.0119-3.3949,2.3858-4.161,1.8149-0.76573-0.57072,0.83698-3.592,0.55319-4.5039-0.2839-0.91223-3.3182-2.4915-3.0119-3.3965,0.30617-0.90461,3.6749-0.31399,4.4544-0.86567,0.77986-0.5519,1.3442-3.9257,2.2995-3.914,0.95494,0.0116,1.4342,3.398,2.1998,3.9689,0.76588,0.57114,4.1489,0.0653,4.4331,0.97746,0.28402,0.9118-2.7885,2.414-3.0949,3.3186-0.30652,0.90489,1.22,3.966,0.44027,4.5182z" fill-rule="nonzero" transform="matrix(1.0472113,-0.00871584,0.00871584,1.0472113,-504.35434,220.15425)" fill="#eaa904"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/Screwdriver/icons/unread.svg b/p/themes/Screwdriver/icons/unread.svg new file mode 100644 index 000000000..a27acf2b6 --- /dev/null +++ b/p/themes/Screwdriver/icons/unread.svg @@ -0,0 +1,3 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<path fill="#666" d="m7.9824,3.529c-3.4339,0-6.4103,1.9996-7.8729,4.9206,1.4626,2.9214,4.439,4.9204,7.8729,4.9204,3.4338,0,6.4102-1.9996,7.8729-4.9206-1.462-2.9207-4.439-4.9204-7.8726-4.9204zm3.8819,2.6095c0.9251,0.59007,1.709,1.3804,2.2978,2.3111-0.58881,0.93063-1.3727,1.721-2.2978,2.3111-1.1624,0.7414-2.5047,1.1333-3.8818,1.1333s-2.7195-0.39189-3.8819-1.1333c-0.9248-0.59-1.7087-1.3807-2.2975-2.3114,0.5888-0.9307,1.3727-1.721,2.2978-2.3111,0.0602-0.0384,0.1211-0.0757,0.1823-0.1122-0.15312,0.42021-0.23692,0.87374-0.23692,1.3469,0,2.174,1.7624,3.9364,3.9365,3.9364,2.174,0,3.9365-1.7624,3.9365-3.9364,0-0.4732-0.0838-0.92673-0.23692-1.347,0.0612,0.036566,0.12206,0.073839,0.18234,0.11228zm-3.8816,0.7427c0,0.81528-0.66089,1.4762-1.4762,1.4762-0.81528,0-1.4762-0.66089-1.4762-1.4762,0-0.81528,0.66089-1.4762,1.4762-1.4762,0.81527,0,1.4762,0.66089,1.4762,1.4762z"/> +</svg>
\ No newline at end of file diff --git a/p/themes/Screwdriver/loader.gif b/p/themes/Screwdriver/loader.gif Binary files differnew file mode 100644 index 000000000..5ff26f0e3 --- /dev/null +++ b/p/themes/Screwdriver/loader.gif diff --git a/p/themes/Screwdriver/metadata.json b/p/themes/Screwdriver/metadata.json new file mode 100644 index 000000000..46095e507 --- /dev/null +++ b/p/themes/Screwdriver/metadata.json @@ -0,0 +1,7 @@ +{ + "name": "Screwdriver", + "author": "Mister aiR", + "description": "C'est un cocktail ! C'est chaud mais « fresh » à la fois. Ce thème tue du chaton.", + "version": 1.1, + "files": ["_template.css","screwdriver.css"] +} diff --git a/p/themes/Screwdriver/screwdriver.css b/p/themes/Screwdriver/screwdriver.css new file mode 100644 index 000000000..9dbe523a1 --- /dev/null +++ b/p/themes/Screwdriver/screwdriver.css @@ -0,0 +1,1204 @@ +@charset "UTF-8"; + +/*=== FONTS */ +@font-face { + font-family: "OpenSans"; + src: url("../fonts/openSans.woff") format("woff"); +} + +/*=== GENERAL */ +/*============*/ +html, body { + height: 100%; + font-family: "OpenSans", "Cantarell", "Helvetica", "Arial", sans-serif; + background: #fafafa; + font-size: 92%; +} + +/*=== Links */ +a, button.as-link { + color: #D18114; + outline: none; +} + +/*=== Forms */ +.form-group{ + width: 100%; + float: left; + height: auto; + display: inline-block; +} +legend { + margin: 20px 0 5px; + padding: 5px 0; + border-bottom: 1px solid #ddd; + font-size: 1.4em; +} +label { + min-height: 25px; + padding: 5px 0; + cursor: pointer; +} +textarea { + width: 360px; + height: 100px; +} +input, select, textarea { + min-height: 25px; + padding: 5px; + background: #fff; + border: 1px solid #ccc; + border-radius: 3px; + color: #222; + line-height: 25px; + vertical-align: middle; + box-shadow: 0 1px 2px #ccc inset, 0 1px #fff; +} +option { + padding: 0 .5em; +} +input:focus, select:focus, textarea:focus { + color: #0F0F0F; + box-shadow: 0 0 3px #E7AB34; + border: solid 1px #E7AB34; +} +input:invalid, select:invalid { + border-color: #f00; + box-shadow: 0 0 2px 2px #fdd inset; +} +input:disabled, select:disabled { + background: #eee; +} +input.extend { + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; +} + +/*=== Tables */ +table { + border-collapse: collapse; +} + +tr, th, td { + padding: 0.5em; + border: 1px solid #ddd; +} +th { + background: #f6f6f6; +} +form td, +form th { + font-weight: normal; + text-align: center; +} + +/*=== COMPONENTS */ +/*===============*/ +/*=== Forms */ +.form-group.form-actions { + padding: 5px 0; + background: #f4f4f4; + border-top: 1px solid #ddd; +} +.form-group.form-actions .btn { + margin: 0 10px; + border-radius: 4px; + box-shadow:0 1px rgba(255,255,255,0.08) inset; +} +.form-group .group-name { + padding: 10px 0; + text-align: right; +} +.form-group .group-controls { + min-height: 25px; + padding: 5px 0; +} +.form-group table { + margin: 10px 0 0 220px; +} + +/*=== Buttons */ + +.dropdown-menu .input select, .dropdown-menu .input input { + background:#444; + color:#fff; + box-shadow:0 2px 2px #222 inset, 0px 1px rgba(255, 255, 255, 0.08); + border:solid 1px #171717; +} + +.stick { + vertical-align: middle; + font-size: 0; +} +.stick input, +.stick .btn { + border-radius: 0; +} +.stick .btn:first-child,.stick input:first-child { + border-radius: 6px 0 0 6px; +} +.stick .btn-important:first-child { +} +.stick .btn:last-child, .stick input:last-child { + border-radius: 0 6px 6px 0; +} +.stick .btn + .btn, +.stick .btn + input, +.stick .btn + .dropdown > .btn, +.stick input + .btn, +.stick input + input, +.stick input + .dropdown > .btn, +.stick .dropdown + .btn, +.stick .dropdown + input, +.stick .dropdown + .dropdown > .btn { + border-left: none; +} +.stick .btn + .dropdown > .btn { + border-left: none; + border-radius: 0 3px 3px 0; +} + +.btn { + display: inline-block; + min-height: 37px; + min-width: 15px; + margin: 0; + padding: 5px 10px; + color:#222; + border: solid 1px #ccc; + border-radius: 4px; + background: linear-gradient(0deg, #EDE7DE 0%, #FFF 100%) #EDE7DE; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #FFF 100%); + text-shadow: 0px -1px rgba(255,255,255,0.08); + font-size: 0.9rem; + vertical-align: middle; + cursor: pointer; + overflow: hidden; +} +a.btn { + min-height: 25px; + line-height: 25px; +} +.btn:hover { + text-shadow: 0 0 2px #fff; + text-decoration:none; +} +.btn.active,.btn:active,.dropdown-target:target ~ .btn.dropdown-toggle { + background: linear-gradient(180deg, #EDE7DE 0%, #FFF 100%) #EDE7DE; + background: -webkit-linear-gradient(top, #EDE7DE 0%, #FFF 100%); +} + +.nav_menu .btn.active, .nav_menu .btn:active, .nav_menu .dropdown-target:target ~ .btn.dropdown-toggle{ + box-shadow: 0 1px #fff; + border-radius: 4px; + background: linear-gradient(180deg, #EDE7DE 0%, #F6F6F6 100%) #EDE7DE; + background: -webkit-linear-gradient(top, #EDE7DE 0%, #F6F6F6 100%); + border: solid 1px #ccc; +} +.nav_menu .btn { + border: 0; + background:transparent; +} + +.read_all { + color:#222; +} +.btn.dropdown-toggle[href="#dropdown-configure"]{ + background: linear-gradient(0deg, #EDE7DE 0%, #FFF 100%) #EDE7DE; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #FFF 100%); + border-radius: 4px; + border: solid 1px #ccc; + box-shadow: 0 1px #fff; +} +.btn.dropdown-toggle:active { + background:transparent; +} +.btn-important { + background: linear-gradient(180deg, #E4992C 0%, #D18114 100%) #E4992C; + background: -webkit-linear-gradient(top, #E4992C 0%, #D18114 100%); + color: #FFF; + box-shadow: 0 1px rgba(255,255,255,0.08) inset; + border-radius: 4px; + text-shadow: 0px -1px rgba(255,255,255,0.08); + font-weight: normal; +} +.btn-important:hover { +} +.btn-important:active { + background: linear-gradient(0deg, #E4992C 0%, #D18114 100%) #E4992C; + background: -webkit-linear-gradient(bottom, #E4992C 0%, #D18114 100%); +} + +.btn-attention { + background: #E95B57; + background: linear-gradient(to bottom, #E95B57, #BD362F); + background: -webkit-linear-gradient(top, #E95B57 0%, #BD362F 100%); + color: #fff; + border: 1px solid #C44742; + text-shadow: 0px -1px 0px #666; +} +.btn-attention:hover { + background: linear-gradient(to bottom, #D14641, #BD362F); + background: -webkit-linear-gradient(top, #D14641 0%, #BD362F 100%); +} +.btn-attention:active { + background: #BD362F; + box-shadow: none; +} +.btn[type="reset"]{ + color: #fff; + background:linear-gradient(180deg, #222 0%, #171717 100%) #171717; + background: -webkit-linear-gradient(top, #222 0%, #171717 100%); + box-shadow:0 -1px rgba(255,255,255,0.08) inset; +} +/*=== Navigation */ +.nav-list .nav-header, +.nav-list .item { + height: 2.5em; + line-height: 2.5em; + font-size: 0.9rem; +} +.nav-list .item:hover { + text-shadow: 0 0 2px rgba(255,255,255,0.28); + color:#fff; +} + +.nav-list .item.active { + background: linear-gradient(180deg, #222 0%, #171717 100%) repeat scroll 0% 0% #171717; + background: -webkit-linear-gradient(180deg, #222 0%, #171717 100%); + border-width: medium medium 1px; + border-style: none none solid; + border-color: -moz-use-text-color -moz-use-text-color #171717; + box-shadow: -1px 2px 2px #171717, 0px 1px rgba(255, 255, 255, 0.08) inset; + margin: 0; +} +.nav-list .item.active a { + color: #D18114; +} +.nav-list .disable { + color: #aaa; + background: #fafafa; + text-align: center; +} +.nav-list .item > a { + padding: 0 10px; + color:#ccc; +} +.nav-list a:hover { + text-decoration: none; +} +.nav-list .item.empty a { + color: #f39c12; +} +.nav-list .item.active.empty a { + color: #fff; + background: linear-gradient(180deg, #E4992C 0%, #D18114 100%) #E4992C; + background: -webkit-linear-gradient(180deg, #E4992C 0%, #D18114 100%); +} +.nav-list .item.error a { + color: #BD362F; +} +.nav-list .item.active.error a { + color: #fff; + background: #BD362F; +} + +.nav-list .nav-header { + padding: 0 10px; + color: #222; + background: transparent; +} + +.nav-list .nav-form { + padding: 3px; + text-align: center; +} + +.nav-head { + margin: 0; + background: linear-gradient(0deg, #EDE7DE 0%, #FFF 100%) #EDE7DE; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #FFF 100%); + text-align: right; +} +.nav-head .item { + padding: 5px 10px; + font-size: 0.9rem; + line-height: 1.5rem; +} + +/*=== Horizontal-list */ +.horizontal-list { + margin: 0; + padding: 0; +} +.horizontal-list .item { + vertical-align: middle; +} + +/*=== Dropdown */ +.dropdown-menu { + margin: 5px 0 0; + padding: 5px 0; + border: 1px solid #171717; + border-radius: 4px; + box-shadow: 0 0 3px #000; + font-size: 0.8rem; + text-align: left; + background: #222; +} +.dropdown-menu::after { + content: ""; + position: absolute; + top: -6px; + right: 13px; + width: 10px; + height: 10px; + background: #222; + border-top: 1px solid #171717; + border-left: 1px solid #171717; + z-index: -10; + transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); +} +.dropdown-header { + display:none; +} +.dropdown-menu > .item { +} +.dropdown-menu > .item > a { + padding: 0 25px; + line-height: 2.5em; + color: #ccc; +} +.dropdown-menu > .item > span, +.dropdown-menu > .item > .as-link { + padding: 0 22px; + line-height: 2em; + color: #ccc; +} +.dropdown-menu > .item:hover { + background: #171717; + color: #fff; +} +.dropdown-menu > .item[aria-checked="true"] > a::before { + font-weight: bold; + margin: 0 0 0 -14px; +} +.dropdown-menu > .item:hover > a { + color: #fff; + text-decoration: none; +} +.dropdown-menu .input select, +.dropdown-menu .input input { + margin: 0 auto 5px; + padding: 2px 5px; + border-radius: 3px; +} + +.separator { + margin: 5px 0; + border-bottom: 1px solid #171717; + box-shadow: 0 1px rgba(255,255,255,0.08); +} + +/*=== Alerts */ +.alert { + margin: 15px auto; + padding: 10px 15px; + background: #f4f4f4; + border: 1px solid #ccc; + border-right: 1px solid #aaa; + border-bottom: 1px solid #aaa; + border-radius: 5px; + color: #aaa; + text-shadow: 0 0 1px #eee; + font-size: 0.9em; +} +.alert-head { + font-size: 1.15em; +} +.alert > a { + color: inherit; + text-decoration: underline; +} +.alert-warn { + background: #ffe; + border: 1px solid #eeb; + color: #c95; +} +.alert-success { + background: #dfd; + border: 1px solid #cec; + color: #484; +} +.alert-error { + background: #fdd; + border: 1px solid #ecc; + color: #844; +} + +/*=== Pagination */ +.pagination { + background: #fafafa; + text-align: center; + color: #333; + font-size: 0.8em; +} +.content .pagination { + margin: 0; + padding: 0; +} +.pagination .item.pager-current { + font-weight: bold; + font-size: 1.5em; +} +.pagination .item a { + display: block; + color: #333; + font-style: italic; + line-height: 3em; + text-decoration: none; +} +.pagination .item a:hover { + background: #ddd; +} +.pagination:first-child .item { + border-bottom: 1px solid #aaa; +} +.pagination:last-child .item { + border-top: 1px solid #ddd; +} + +.pagination .loading, +.pagination a:hover.loading { + background: url("loader.gif") center center no-repeat #fff; + font-size: 0; +} + +/*=== Boxes */ +.box { + background: #EDE7DE; + border-radius: 4px; + box-shadow: 0 1px #fff; +} +.box .box-title { + margin: 0; + padding: 5px 10px; + background: linear-gradient(0deg, #EDE7DE 0%, #fff 100%) #171717; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #fff 100%); + box-shadow: 0px -1px #fff inset,0 -2px #ccc inset; + color: #888; + text-shadow: 0 1px #ccc; + border-radius: 4px 4px 0 0; + font-size: 1.1rem; + font-weight: normal; +} +.box .box-content { + max-height: 260px; +} + +.box .box-content .item { + padding: 0 10px; + font-size: 0.9rem; + line-height: 2.5em; +} + +.box .box-content .item .configure { + visibility: hidden; +} +.box .box-content .item:hover .configure { + visibility: visible; +} + +/*=== Tree */ +.tree { + margin: 10px 0; +} +.tree-folder-title { + position: relative; + padding: 0 10px; + line-height: 2.5rem; + font-size: 0.9rem; +} +.tree-folder-title .title { + background: inherit; + color: #fff; +} +.tree-folder-title .title:hover { + text-decoration: none; +} +.tree-folder.active .tree-folder-title { + background: linear-gradient(180deg, #222 0%, #171717 100%) #171717; + background: -webkit-linear-gradient(top, #222 0%, #171717 100%); + box-shadow: 0px 1px #171717, 0px 1px rgba(255, 255, 255, 0.08) inset; + text-shadow: 0 0 2px rgba(255,255,255,0.28); + color: #fff; +} +.tree-folder-items { + background: #171717; + padding: 8px 0; + box-shadow: 0 4px 4px #171717 inset, 0 1px rgba(255,255,255,0.08),0 -1px rgba(255,255,255,0.08); +} +.tree-folder-items > .item { + padding: 0 10px; + line-height: 2.5rem; + font-size: 0.8rem; +} +.tree-folder-items > .item.active { + background: linear-gradient(180deg, #222 0%, #171717 100%) #171717; + background: -webkit-linear-gradient(top, #222 0%, #171717 100%); + border-radius: 4px; + margin: 0px 8px; + box-shadow: 0px 1px #171717, 0px 1px rgba(255, 255, 255, 0.08) inset, 0 2px 2px #111; +} +.tree-folder-items > .item > a { + text-decoration: none; + color: #fff; + font-size: 0.92em; +} +.tree-folder-items > .item.active > a { +} + +/*=== STRUCTURE */ +/*===============*/ +/*=== Header */ +.header { + height: 55px; + background: linear-gradient(0deg, #EDE7DE 0%, #FFF 100%) #EDE7DE; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #FFF 100%); +} +.header > .item { + padding: 0; + vertical-align: middle; + text-align: center; +} +.header > .item.title .logo { + height: 60px; + width: 60px; +} +.header > .item.title{ + width: 250px; +} +.header > .item.title h1 { + margin: 0.5em 0; +} +.header > .item.title h1 a { + text-decoration: none; + font-size: 28px; + color:#222; + text-shadow: 0 1px #fff; +} +.header > .item.search input { + width: 230px; +} +.header .item.search input:focus { + width: 350px; +} + +/*=== Body */ +#global { + background:#EDE7DE; + height: calc(100% - 60px); +} +.aside { + border-radius: 0px 12px 0px 0px; + box-shadow: 0px -1px #FFF, 0 2px 2px #171717 inset; + border-top: 1px solid #CCC; + background: #222; + width: 235px; +} +.aside.aside_feed { + padding: 10px 0; + text-align: center; +} +.aside.aside_feed .tree { + margin: 10px 0 50px; +} + +/*=== Aside main page (categories) */ +.aside_feed .tree-folder-title > .title:not([data-unread="0"])::after { + position: absolute; + right: 3px; + padding: 1px 5px; + color: #fff; + text-shadow: 0 1px rgba(255,255,255,0.08); +} +.aside_feed .btn-important { + border: none; +} + +/*=== Aside main page (feeds) */ +.feed.item.empty, +.feed.item.empty > a { + color: #e67e22; +} +.feed.item.error, +.feed.item.error > a { + color: #BD362F; +} +.aside_feed .tree-folder-items .dropdown-menu::after { + left: 2px; +} +.aside_feed .tree-folder-items .item .dropdown-target:target ~ .dropdown-toggle > .icon, +.aside_feed .tree-folder-items .item:hover .dropdown-toggle > .icon, +.aside_feed .tree-folder-items .item.active .dropdown-toggle > .icon { + border-radius: 3px; +} + +/*=== Configuration pages */ +.post { + padding: 10px 50px; + font-size: 0.9em; +} +.post form { + margin: 10px 0; +} +.post.content { + max-width: 550px; +} + +/*=== Prompt (centered) */ +.prompt { + text-align: center; + padding: 14px 0px; + text-shadow: 0 1px rgba(255,255,255,0.08); +} +.prompt label { + text-align: left; +} +.prompt form { + margin: 10px auto 20px auto; + width: 180px; +} +.prompt input { + margin: 5px auto; + width: 100%; +} +.prompt p { + margin: 20px 0; +} +.prompt input#username,.prompt input#passwordPlain{ + border:solid 1px #ccc; + box-shadow: 0 4px -4px #ccc inset,0px 1px rgba(255, 255, 255, 0.08); + background:#fff; +} +.prompt input#username:focus,.prompt input#passwordPlain:focus{ + border: solid 1px #E7AB34; + box-shadow: 0 0 3px #E7AB34; +} + +/*=== New article notification */ +#new-article { + background: #0084CC; + text-align: center; + font-size: 0.9em; +} +#new-article:hover { + background: #0066CC; +} +#new-article > a { + line-height: 3em; + color: #fff; + font-weight: bold; +} +#new-article > a:hover { + text-decoration: none; +} + +/*=== Day indication */ +.day { + padding: 0 10px; + font-style:italic; + line-height: 3em; + box-shadow: 0 1px #BDB7AE inset, 0 -1px rgba(255,255,255,0.28) inset; + background: linear-gradient(0deg, #EDE7DE 0%, #C2BCB3 100%) #EDE7DE; + background: -webkit-linear-gradient(bottom, #C2BCB3 0%, #FFF 100%); + color: #666; + text-shadow: 0 1px rgba(255,255,255,0.28); + text-align: center; +} +#new-article + .day { + border-top: none; +} +.day .name { + display: none; +} + +/*=== Index menu */ +.nav_menu { + background: #EDE7DE; + border-bottom: 1px solid #ccc; + box-shadow:0 -1px rgba(255, 255, 255, 0.28) inset; + text-align: center; + padding: 5px 0; +} +#panel >.nav_menu{ + background: linear-gradient(0deg, #EDE7DE 0%, #FFF 100%) #EDE7DE; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #FFF 100%); +} +#panel > .nav_menu > #nav_menu_read_all{ + background: linear-gradient(0deg, #EDE7DE 0%, #FFF 100%) #EDE7DE; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #FFF 100%); + border-radius: 4px; + border: 1px solid #CCC; + box-shadow: 0px 1px #FFF; +} +#panel > .nav_menu > #nav_menu_read_all .dropdown > .btn.dropdown-toggle { + border-radius: 0 4px 4px 0; + border:none; + border-left: solid 1px #ccc; +} + +/*=== Feed articles */ +.flux_content { + background: #FFF; + border-radius: 10px; +} +.flux { + background: #EDE7DE; +} +.flux:hover { + background: #F9F7F4; +} +.flux:not(.current):hover .item.title { + background: #F9F7F4; +} +.flux.current .flux .item.title a { + text-shadow:0 0 2px #ccc; +} +.flux.not_read:not(.current):hover .item.title { + opacity:0.85; +} +.flux.favorite { + background: #FFF6DA; +} +.flux.favorite:not(.current):hover{ + background: #F9F7F4; +} +.flux.favorite:not(.current):hover .item.title { + background: #F9F7F4; +} +.flux.current { + background: linear-gradient(0deg, #EDE7DE 0%, #FFF 100%) #EDE7DE; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #FFF 100%); + box-shadow: 0 -1px #fff inset, 0 2px #ccc; + border-radius: 10px; + margin: 3px 6px; +} + +.flux .item.title { +opacity: 0.35; +} +.flux.favorite .item.title { +opacity: 1; +} +.flux.not_read .item.title { +opacity: 1; +} +.flux.current .item.title a { + color: #0f0f0f; +} +.flux .item.title a { + color: #333; +} + +.flux_header { + border-top: 1px solid #ddd; + font-size: 0.8rem; + cursor: pointer; + box-shadow: 0 -1px rgba(255,255,255,0.28) inset; +} +.flux_header .title { + font-size: 0.9rem; +} +.flux .website .favicon { + padding: 5px; +} +.flux .date { + color: #666; + font-size: 0.7rem; +} + +.flux .bottom { + font-size: 0.8rem; + text-align: center; +} + +/*=== Content of feed articles */ +.content { + padding: 20px 10px; +} +.content > h1.title > a { + color: #000; +} + +.content hr { + margin: 30px 10px; + height: 1px; + background: #ddd; + border: 0; + box-shadow: 0 2px 5px #ccc; +} + +.content pre { + margin: 10px auto; + padding: 10px 20px; + overflow: auto; + background: #222; + color: #fff; + font-size: 0.9rem; + border-radius: 3px; +} +.content code { + padding: 2px 5px; + color: #dd1144; + background: #fafafa; + border: 1px solid #eee; + border-radius: 3px; +} +.content pre code { + background: transparent; + color: #fff; + border: none; +} + +.content blockquote { + display: block; + margin: 0; + padding: 5px 20px; + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + background: #fafafa; + color: #333; +} +.content blockquote p { + margin: 0; +} + +/*=== Notification and actualize notification */ +.notification { + padding: 0 0 0 5px; + text-align: center; + background:#222; + border: none; + border-radius: 0 0 12px 12px; + box-shadow: 0px 0px 4px rgba(0,0,0,0.45), 0 -1px rgba(255,255,255,0.08) inset, 0 2px 2px #171717 inset; + color:#fff; + font-weight: bold; + font-size: 0.9em; + line-height: 3em; + position:absolute; + top:0; + z-index: 10; + vertical-align: middle; +} +.notification.good { + color: #c95; +} +.notification.bad { + background: #fdd; + color: #844; +} +.notification a.close { + padding: 0 15px; + line-height: 3em; +} +.notification#actualizeProgress { + line-height: 2em; +} + +/*=== "Load more" part */ +#bigMarkAsRead { + text-align: center; + text-decoration: none; + text-shadow: 0 -1px 0 #aaa; + color: #666; + background: #EDE7DE; + box-shadow: 0 1px rgba(255,255,255,0.28)inset; +} +#bigMarkAsRead:hover { + color: #000; + background: #EDE7DE; + background: radial-gradient(circle at 50% -25% , #ccc 0%, #EDE7DE 50%); +} +#bigMarkAsRead:hover .bigTick { + text-shadow: 0 0 10px #666; +} + +/*=== Navigation menu (for articles) */ +#nav_entries { + background: linear-gradient(180deg, #222 0%, #171717 100%) #222; + background: -webkit-linear-gradient(top, #222 0%, #171717 100%); + border-top: 1px solid #171717; + text-align: center; + line-height: 3em; + table-layout: fixed; + box-shadow: 0 1px rgba(255,255,255,0.08) inset, 0 -2px 2px #171717; + width:235px; +} + +/*=== READER VIEW */ +/*================*/ +#stream.reader .flux { + padding: 0 0 50px; + border: none; + background: #f0f0f0; + color: #333; +} +#stream.reader .flux .author { + margin: 0 0 10px; + font-size: 90%; + color: #666; +} + +/*=== GLOBAL VIEW */ +/*================*/ +#stream.global { + padding: 24px 0; + box-shadow: 0px 8px 8px #C2BCB3 inset; +} + +.box.category .box-title { + background: linear-gradient(0deg, #EDE7DE 0%, #fff 100%) #171717; + background: -webkit-linear-gradient(bottom, #EDE7DE 0%, #fff 100%); + box-shadow: 0px -1px #fff inset,0 -2px #ccc inset; + border-radius: none; + line-height: 2em; + font-size: 1.2rem; + text-shadow:0 1px #ccc; +} +.box.category .box-title .title { + font-weight: normal; + text-decoration: none; + text-align: left; + color: #888; +} +.box.category:not([data-unread="0"]) .box-title { +} +.box.category:not([data-unread="0"]) .box-title:active { +} +.box.category:not([data-unread="0"]) .box-title .title { + color: #222; + font-weight: bold; +} +.box.category .title:not([data-unread="0"])::after { + position: absolute; + top: 5px; right: 10px; + border: 0; + background: none; + font-weight: bold; +} +.box.category .item.feed { + padding: 2px 10px; + font-size: 0.8rem; +} +.box.category .item.feed:not(.empty):not(.error) .item-title { + color: #222; +} + +/*=== PANEL */ +/*===========*/ +#panel { + box-shadow: 0px 0px 4px #000; + border-radius: 8px; + background:#EDE7DE; +} +/*=== DIVERS */ +/*===========*/ +.aside.aside_feed .nav-form input,.aside.aside_feed .nav-form select { + width: 130px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu { + right: -20px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu::after { + right: 33px; +} + +/*=== STATISTICS */ +/*===============*/ +.stat { + margin: 10px 0 20px; +} + +.stat th, +.stat td, +.stat tr { + border: none; +} +.stat > table td, +.stat > table th { + border-bottom: 1px solid #ccc; + background: rgba(255,255,255,0.38); + box-shadow: 0 1px #fff; +} + +.stat > .horizontal-list { + margin: 0 0 5px; +} +.stat > .horizontal-list .item { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.stat > .horizontal-list .item:first-child { + width: 250px; +} + +/*=== LOGS */ +/*=========*/ +.loglist { + border: 1px solid #aaa; + border-radius: 5px; + overflow: hidden; +} +.log { + padding: 5px 10px; + background: #fafafa; + color: #333; + font-size: 0.8rem; +} +.log+.log { + border-top: 1px solid #aaa; +} +.log .date { + display: block; + font-weight: bold; +} +.log.error { + background: #fdd; + color: #844; +} +.log.warning { + background: #ffe; + color: #c95; +} +.log.notice { + background: #f4f4f4; + color: #aaa; +} +.log.debug { + background: #333; + color: #eee; +} + +#slider.active { + box-shadow: -4px 0 4px rgba(15, 15, 15, 0.55); + background: #F8F8F8; +} +#close-slider.active { + background: rgba(15, 15, 15, 0.35); +} + +/*=== MOBILE */ +/*===========*/ +@media screen and (max-width: 840px) { + .header { + display: table; + } + .nav-login { + display: none; + } + + .aside { + width: 0; + border-top: none; + box-shadow: 3px 0 3px #000; + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; + } + .aside:target { + width: 235px; + } + .aside .toggle_aside, + #panel .close { + display: block; + width: 100%; + height: 40px; + line-height: 40px; + text-align: center; + background: #171717; + box-shadow: 0 1px rgba(255,255,255,0.08); + border-radius: 0 8px 0 8px; + } + .aside .btn-important { + display: inline-block; + margin: 20px 0 0; + } + + .aside.aside_feed { + padding: 0; + } + + .nav_menu .btn { + margin: 5px 10px; + } + .nav_menu .stick { + margin: 0 10px; + } + .nav_menu .stick .btn { + margin: 5px 0; + } + .nav_menu .search { + display: inline-block; + max-width: 97%; + } + .nav_menu .search input { + max-width: 97%; + width: 90px; + } + .nav_menu .search input:focus { + width: 400px; + } + + .day .name { + display: none; + } + + .pagination { + margin: 0 0 3.5em; + } + + .notification a.close { + display: block; + left: 0; + background: transparent; + } + .notification a.close:hover { + opacity: 0.5; + } + .notification a.close .icon { + display: none; + } + .nav_menu .search { + display: none; + } + + #nav_entries { + width: 100%; + } +} + +@media (max-width: 700px) { + .header{ + display: none; + } + .nav-login { + display: inline-block; + width: 100%; + } + .nav_menu .search { + display: inline-block; + } + .aside .btn-important { + display: none; + } +} diff --git a/p/themes/Screwdriver/thumbs/original.png b/p/themes/Screwdriver/thumbs/original.png Binary files differnew file mode 100644 index 000000000..ba9bacf90 --- /dev/null +++ b/p/themes/Screwdriver/thumbs/original.png diff --git a/p/themes/base-theme/README.md b/p/themes/base-theme/README.md new file mode 100644 index 000000000..9f7d635ca --- /dev/null +++ b/p/themes/base-theme/README.md @@ -0,0 +1,12 @@ +FreshRSS-base-theme +=================== + +A base theme for [FreshRSS](http://freshrss.org) + +1. Custom ```base.css``` file with colors, backgrounds and borders +2. Change information in ```metadata.json``` file (at least, give a name!) +3. Choose your new theme in FreshRSS configuration +4. Enjoy your wonderful theme! + +Don't hesitate to share your theme with us [on Github](https://github.com/FreshRSS/FreshRSS/issues) :) + diff --git a/p/themes/base-theme/base.css b/p/themes/base-theme/base.css new file mode 100644 index 000000000..192a957c9 --- /dev/null +++ b/p/themes/base-theme/base.css @@ -0,0 +1,818 @@ +@charset "UTF-8"; + +/*=== FONTS */ +@font-face { + font-family: "OpenSans"; + src: url("../fonts/openSans.woff") format("woff"); +} + +/*=== GENERAL */ +/*============*/ +html, body { + height: 100%; + font-family: "OpenSans", "Cantarell", "Helvetica", "Arial", sans-serif; +} + +/*=== Links */ +a, button.as-link { + outline: none; +} + +/*=== Forms */ +legend { + margin: 20px 0 5px; + padding: 5px 0; + font-size: 1.4em; +} +label { + min-height: 25px; + padding: 5px 0; + cursor: pointer; +} +textarea { + width: 360px; + height: 100px; +} +input, select, textarea { + min-height: 25px; + padding: 5px; + line-height: 25px; + vertical-align: middle; +} +option { + padding: 0 .5em; +} +input:focus, select:focus, textarea:focus { +} +input:invalid, select:invalid { +} +input:disabled, select:disabled { +} +input.extend { + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; +} + +/*=== Tables */ +table { + border-collapse: collapse; +} + +tr, th, td { + padding: 0.5em; +} +th { +} +form td, +form th { + font-weight: normal; + text-align: center; +} + +/*=== COMPONENTS */ +/*===============*/ +/*=== Forms */ +.form-group.form-actions { + padding: 5px 0; +} +.form-group.form-actions .btn { + margin: 0 10px; +} +.form-group .group-name { + padding: 10px 0; + text-align: right; +} +.form-group .group-controls { + min-height: 25px; + padding: 5px 0; +} +.form-group table { + margin: 10px 0 0 220px; +} + +/*=== Buttons */ +.stick { + vertical-align: middle; + font-size: 0; +} +.stick input, +.stick .btn { +} +.stick .btn:first-child, +.stick input:first-child { +} +.stick .btn-important:first-child { +} +.stick .btn:last-child, +.stick input:last-child { +} +.stick .btn + .btn, +.stick .btn + input, +.stick .btn + .dropdown > .btn, +.stick input + .btn, +.stick input + input, +.stick input + .dropdown > .btn, +.stick .dropdown + .btn, +.stick .dropdown + input, +.stick .dropdown + .dropdown > .btn { +} +.stick input + .btn { +} +.stick .btn + .dropdown > .btn { +} + +.btn { + display: inline-block; + min-height: 37px; + min-width: 15px; + margin: 0; + padding: 5px 10px; + font-size: 0.9rem; + vertical-align: middle; + cursor: pointer; + overflow: hidden; +} +a.btn { + min-height: 25px; + line-height: 25px; +} +.btn:hover { + text-decoration: none; +} +.btn.active, +.btn:active, +.dropdown-target:target ~ .btn.dropdown-toggle { +} + +.btn-important { + font-weight: normal; +} +.btn-important:hover { +} +.btn-important:active { +} + +.btn-attention { +} +.btn-attention:hover { +} +.btn-attention:active { +} + +/*=== Navigation */ +.nav-list .nav-header, +.nav-list .item { + height: 2.5em; + line-height: 2.5em; + font-size: 0.9rem; +} +.nav-list .item:hover { +} +.nav-list .item:hover a { +} +.nav-list .item.active { +} +.nav-list .item.active a { +} +.nav-list .disable { + text-align: center; +} +.nav-list .item > a { + padding: 0 10px; +} +.nav-list a:hover { + text-decoration: none; +} +.nav-list .item.empty a { +} +.nav-list .item.active.empty a { +} +.nav-list .item.error a { +} +.nav-list .item.active.error a { +} + +.nav-list .nav-header { + padding: 0 10px; + font-weight: bold; +} + +.nav-list .nav-form { + padding: 3px; + text-align: center; +} + +.nav-head { + margin: 0; + text-align: right; +} +.nav-head .item { + padding: 5px 10px; + font-size: 0.9rem; + line-height: 1.5rem; +} + +/*=== Horizontal-list */ +.horizontal-list { + margin: 0; + padding: 0; +} +.horizontal-list .item { + vertical-align: middle; +} + +/*=== Dropdown */ +.dropdown-menu { + margin: 5px 0 0; + padding: 5px 0; + font-size: 0.8rem; + text-align: left; +} +.dropdown-menu::after { + content: ""; + position: absolute; + top: -6px; + right: 13px; + width: 10px; + height: 10px; + z-index: -10; + transform: rotate(45deg); + -moz-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); +} +.dropdown-header { + padding: 0 5px 5px; + font-weight: bold; + text-align: left; +} +.dropdown-menu > .item { +} +.dropdown-menu > .item > a { + padding: 0 25px; + line-height: 2.5em; +} +.dropdown-menu > .item > span, +.dropdown-menu > .item > .as-link { + padding: 0 22px; + line-height: 2em; +} +.dropdown-menu > .item:hover { +} +.dropdown-menu > .item[aria-checked="true"] > a::before { + font-weight: bold; + margin: 0 0 0 -14px; +} +.dropdown-menu > .item:hover > a { + text-decoration: none; +} +.dropdown-menu .input select, +.dropdown-menu .input input { + margin: 0 auto 5px; + padding: 2px 5px; +} + +.separator { + margin: 5px 0; +} + +/*=== Alerts */ +.alert { + margin: 15px auto; + padding: 10px 15px; + font-size: 0.9em; +} +.alert-head { + font-size: 1.15em; +} +.alert > a { + text-decoration: underline; +} +.alert-warn { +} +.alert-success { +} +.alert-error { +} + +/*=== Pagination */ +.pagination { + text-align: center; + font-size: 0.8em; +} +.content .pagination { + margin: 0; + padding: 0; +} +.pagination .item.pager-current { + font-weight: bold; + font-size: 1.5em; +} +.pagination .item a { + display: block; + font-style: italic; + line-height: 3em; + text-decoration: none; +} +.pagination .item a:hover { +} +.pagination:first-child .item { +} +.pagination:last-child .item { +} + +.pagination .loading, +.pagination a:hover.loading { + font-size: 0; +} + +/*=== Boxes */ +.box { +} +.box .box-title { + margin: 0; + padding: 5px 10px; +} +.box .box-content { + max-height: 260px; +} + +.box .box-content .item { + padding: 0 10px; + font-size: 0.9rem; + line-height: 2.5em; +} + +.box .box-content .item .configure { + visibility: hidden; +} +.box .box-content .item:hover .configure { + visibility: visible; +} + +/*=== Tree */ +.tree { + margin: 10px 0; +} +.tree-folder-title { + position: relative; + padding: 0 10px; + line-height: 2.5rem; + font-size: 1rem; +} +.tree-folder-title .title { + background: inherit; +} +.tree-folder-title .title:hover { + text-decoration: none; +} +.tree-folder.active .tree-folder-title { + font-weight: bold; +} +.tree-folder.active .tree-folder-title .title { +} +.tree-folder-items { +} +.tree-folder-items > .item { + padding: 0 10px; + line-height: 2.5rem; + font-size: 0.8rem; +} +.tree-folder-items > .item.active { +} +.tree-folder-items > .item > a { + text-decoration: none; +} +.tree-folder-items > .item.active > a { +} + +/*=== STRUCTURE */ +/*===============*/ +/*=== Header */ +.header { + height: 85px; +} +.header > .item { + padding: 10px; + vertical-align: middle; + text-align: center; +} +.header > .item.title{ + width: 230px; +} +.header > .item.title h1 { + margin: 0.5em 0; +} +.header > .item.title h1 a { + text-decoration: none; +} +.header > .item.search input { + width: 230px; +} +.header .item.search input:focus { + width: 350px; +} + +/*=== Body */ +#global { + height: calc(100% - 85px); +} +.aside { +} +.aside.aside_feed { + padding: 10px 0; + text-align: center; +} +.aside.aside_feed .tree { + margin: 10px 0 50px; +} + +/*=== Aside main page (categories) */ +.aside_feed .tree-folder-title > .title:not([data-unread="0"])::after { + position: absolute; + right: 0; + margin: 10px 0; + padding: 0 10px; + font-size: 0.9rem; + line-height: 1.5rem; +} + +/*=== Aside main page (feeds) */ +.feed.item.empty.active { +} +.feed.item.error.active { +} +.feed.item.empty, +.feed.item.empty > a { +} +.feed.item.error, +.feed.item.error > a { +} +.feed.item.empty.active, +.feed.item.error.active, +.feed.item.empty.active > a, +.feed.item.error.active > a { +} +.aside_feed .tree-folder-items .dropdown-menu::after { + left: 2px; +} +.aside_feed .tree-folder-items .item .dropdown-target:target ~ .dropdown-toggle > .icon, +.aside_feed .tree-folder-items .item:hover .dropdown-toggle > .icon, +.aside_feed .tree-folder-items .item.active .dropdown-toggle > .icon { + border-radius: 3px; +} + +/*=== Configuration pages */ +.post { + padding: 10px 50px; + font-size: 0.9em; +} +.post form { + margin: 10px 0; +} +.post.content { + max-width: 550px; +} + +/*=== Prompt (centered) */ +.prompt { + text-align: center; +} +.prompt label { + text-align: left; +} +.prompt form { + margin: 10px auto 20px auto; + width: 180px; +} +.prompt input { + margin: 5px auto; + width: 100%; +} +.prompt p { + margin: 20px 0; +} + +/*=== New article notification */ +#new-article { + text-align: center; + font-size: 0.9em; +} +#new-article:hover { +} +#new-article > a { + line-height: 3em; + font-weight: bold; +} +#new-article > a:hover { + text-decoration: none; +} + +/*=== Day indication */ +.day { + padding: 0 10px; + font-weight: bold; + line-height: 3em; +} +#new-article + .day { +} +.day .name { + padding: 0 10px 0 0; + font-size: 1.8em; + opacity: 0.3; + font-style: italic; + text-align: right; +} + +/*=== Index menu */ +.nav_menu { + text-align: center; + padding: 5px 0; +} + +/*=== Feed articles */ +.flux { +} +.flux:hover { +} +.flux.current { +} +.flux.not_read { +} +.flux.not_read:not(.current):hover .item.title { +} +.flux.favorite { +} +.flux.favorite:not(.current):hover .item.title { +} +.flux.current { +} + + +.flux_header { + font-size: 0.8rem; + cursor: pointer; +} +.flux_header .title { + font-size: 0.9rem; +} +.flux .website .favicon { + padding: 5px; +} +.flux .date { + font-size: 0.7rem; +} +.flux:not(.current):hover .item.title { +} + +.flux .bottom { + font-size: 0.8rem; + text-align: center; +} + +/*=== Content of feed articles */ +.content { + padding: 20px 10px; +} +.content > h1.title > a { +} + +.content hr { + margin: 30px 10px; + height: 1px; +} + +.content pre { + margin: 10px auto; + padding: 10px 20px; + overflow: auto; + font-size: 0.9rem; +} +.content code { + padding: 2px 5px; +} +.content pre code { +} + +.content blockquote { + display: block; + margin: 0; + padding: 5px 20px; +} +.content blockquote p { + margin: 0; +} + +/*=== Notification and actualize notification */ +.notification { + padding: 0 0 0 5px; + text-align: center; + font-weight: bold; + font-size: 0.9em; + line-height: 3em; + z-index: 10; + vertical-align: middle; +} +.notification.good { +} +.notification.bad { +} +.notification a.close { + padding: 0 15px; + line-height: 3em; +} +.notification.good a.close:hover { +} +.notification.bad a.close:hover { +} + +.notification#actualizeProgress { + line-height: 2em; +} + +/*=== "Load more" part */ +#bigMarkAsRead { + text-align: center; + text-decoration: none; +} +#bigMarkAsRead:hover { +} +#bigMarkAsRead:hover .bigTick { +} + +/*=== Navigation menu (for articles) */ +#nav_entries { + margin: 0; + text-align: center; + line-height: 3em; + table-layout: fixed; +} + +/*=== READER VIEW */ +/*================*/ +#stream.reader .flux { + padding: 0 0 50px; +} +#stream.reader .flux .author { + margin: 0 0 10px; + font-size: 90%; +} + +/*=== GLOBAL VIEW */ +/*================*/ +.box.category .box-title .title { + font-weight: normal; + text-decoration: none; + text-align: left; +} +.box.category:not([data-unread="0"]) .box-title { +} +.box.category:not([data-unread="0"]) .box-title:active { +} +.box.category:not([data-unread="0"]) .box-title .title { + font-weight: bold; +} +.box.category .title:not([data-unread="0"])::after { + position: absolute; + top: 5px; right: 10px; + border: 0; + background: none; + font-weight: bold; + box-shadow: none; + text-shadow: none; +} +.box.category .item.feed { + padding: 2px 10px; + font-size: 0.8rem; +} + +/*=== DIVERS */ +/*===========*/ +.aside.aside_feed .nav-form input, +.aside.aside_feed .nav-form select { + width: 140px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu { + right: -20px; +} +.aside.aside_feed .nav-form .dropdown .dropdown-menu::after { + right: 33px; +} + +/*=== STATISTICS */ +/*===============*/ +.stat { + margin: 10px 0 20px; +} + +.stat th, +.stat td, +.stat tr { +} +.stat > table td, +.stat > table th { + text-align: center; +} + +.stat > .horizontal-list { + margin: 0 0 5px; +} +.stat > .horizontal-list .item { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.stat > .horizontal-list .item:first-child { + width: 250px; +} + +/*=== LOGS */ +/*=========*/ +.loglist { + overflow: hidden; +} +.log { + padding: 5px 10px; + font-size: 0.8rem; +} +.log+.log { +} +.log .date { + display: block; + font-weight: bold; +} +.log.error { +} +.log.warning { +} +.log.notice { +} +.log.debug { +} + +/*=== MOBILE */ +/*===========*/ +@media(max-width: 840px) { + .aside { + transition: width 200ms linear; + -moz-transition: width 200ms linear; + -webkit-transition: width 200ms linear; + -o-transition: width 200ms linear; + -ms-transition: width 200ms linear; + } + .aside .toggle_aside, + #panel .close { + display: block; + width: 100%; + height: 50px; + line-height: 50px; + text-align: center; + } + + .aside.aside_feed { + padding: 0; + } + + .nav_menu .btn { + margin: 5px 10px; + } + .nav_menu .stick { + margin: 0 10px; + } + .nav_menu .stick .btn { + margin: 5px 0; + } + .nav_menu .search { + display: inline-block; + max-width: 97%; + } + .nav_menu .search input { + max-width: 97%; + width: 90px; + } + .nav_menu .search input:focus { + width: 400px; + } + + .day .name { + font-size: 1.1rem; + } + + .pagination { + margin: 0 0 3.5em; + } + + .notification a.close { + display: block; + left: 0; + } + .notification a.close:hover { + opacity: 0.5; + } + .notification a.close .icon { + display: none; + } +} diff --git a/p/themes/base-theme/loader.gif b/p/themes/base-theme/loader.gif Binary files differnew file mode 100644 index 000000000..5ff26f0e3 --- /dev/null +++ b/p/themes/base-theme/loader.gif diff --git a/p/themes/base-theme/metadata.json b/p/themes/base-theme/metadata.json new file mode 100644 index 000000000..4d59365a8 --- /dev/null +++ b/p/themes/base-theme/metadata.json @@ -0,0 +1,7 @@ +{ + "name": "", + "author": "Your name", + "description": "A wonderful base theme", + "version": 0.1, + "files": ["template.css", "base.css"] +} diff --git a/p/themes/base-theme/template.css b/p/themes/base-theme/template.css new file mode 100644 index 000000000..cc36c3ffa --- /dev/null +++ b/p/themes/base-theme/template.css @@ -0,0 +1,918 @@ +@charset "UTF-8"; + +/*=== GENERAL */ +/*============*/ +html, body { + margin: 0; + padding: 0; + font-size: 100%; +} + +/*=== Links */ +a { + text-decoration: none; +} +a:hover { + text-decoration: underline; +} + +/*=== Lists */ +ul, ol, dd { + margin: 0; + padding: 0; +} + +/*=== Titles */ +h1 { + margin: 0.6em 0 0.3em; + font-size: 1.5em; + line-height: 1.6em; +} +h2 { + margin: 0.5em 0 0.25em; + font-size: 1.3em; + line-height: 2em; +} +h3 { + margin: 0.5em 0 0.25em; + font-size: 1.1em; + line-height: 2em; +} + +/*=== Paragraphs */ +p { + margin: 1em 0 0.5em; + font-size: 1em; +} +sup { + line-height: 25px; + position: relative; + top: -0.8em; + vertical-align: baseline; +} + +/*=== Images */ +img { + height: auto; + max-width: 100%; +} +img.favicon { + height: 16px; + width: 16px; + vertical-align: middle; +} + +/*=== Videos */ +iframe, embed, object, video { + max-width: 100%; +} + +/*=== Forms */ +legend { + display: block; + width: 100%; + clear: both; +} +label { + display: block; +} +input { + width: 180px; +} +textarea, +input[type="file"], +input.long, +input.extend:focus { + width: 300px; +} +input, select, textarea { + display: inline-block; + max-width: 100%; +} +input[type="radio"], +input[type="checkbox"] { + width: 15px !important; + min-height: 15px !important; +} +button.as-link, +button.as-link:hover, +button.as-link:active { + background: transparent; + border: none; + color: inherit; + cursor: pointer; + font-size: 1.1em; + text-align: left; +} + +/*=== Tables */ +table { + max-width: 100%; +} +th.numeric, +td.numeric { + text-align: center; +} + +/*=== COMPONENTS */ +/*===============*/ + +[aria-hidden="true"] { + display: none; +} + +/*=== Forms */ +.form-group::after { + content: ""; + display: block; + clear: both; +} +.form-group.form-actions { + min-width: 250px; +} +.form-group .group-name { + display: block; + float: left; + width: 200px; +} +.form-group .group-controls { + min-width: 250px; + margin: 0 0 0 220px; +} +.form-group .group-controls .control { + display: block; +} + +/*=== Buttons */ +.stick { + display: inline-block; + white-space: nowrap; +} +.btn, +a.btn { + display: inline-block; + cursor: pointer; + overflow: hidden; +} +.btn-important { + font-weight: bold; +} + +/*=== Navigation */ +.nav-list .nav-header, +.nav-list .item { + display: block; +} +.nav-list .item, +.nav-list .item > a { + display: block; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.nav-head { + display: block; +} +.nav-head .item { + display: inline-block; +} + +/*=== Horizontal-list */ +.horizontal-list { + display: table; + table-layout: fixed; + width: 100%; +} +.horizontal-list .item { + display: table-cell; +} + +/*=== Dropdown */ +.dropdown { + position: relative; + display: inline-block; + vertical-align: middle; +} +.dropdown-target { + display: none; +} +.dropdown-menu { + display: none; + min-width: 200px; + margin: 0; + position: absolute; + right: 0; + background: #fff; + border: 1px solid #aaa; +} +.dropdown-header { + display: block; +} +.dropdown-menu > .item { + display: block; +} +.dropdown-menu > .item > a, +.dropdown-menu > .item > .as-link, +.dropdown-menu > .item > span { + display: block; + min-width: 200px; +} +.dropdown-menu > .item[aria-checked="true"] > a::before { + content: '✓'; +} +.dropdown-menu .input { + display: block; +} +.dropdown-menu .input select, +.dropdown-menu .input input { + display: block; + max-width: 95%; +} +.dropdown-target:target ~ .dropdown-menu { + display: block; + z-index: 10; +} +.dropdown-close { + display: inline; +} +.dropdown-close a { + font-size: 0; + position: fixed; + top: 0; bottom: 0; + left: 0; right: 0; + display: block; + z-index: -10; +} +.separator { + display: block; + height: 0; + border-bottom: 1px solid #aaa; +} + +/*=== Alerts */ +.alert { + display: block; + width: 90%; +} +.group-controls .alert { + width: 100% +} +.alert-head { + margin: 0; + font-weight: bold; +} +.alert ul { + margin: 5px 20px; +} + +/*=== Icons */ +.icon { + display: inline-block; + width: 16px; + height: 16px; + vertical-align: middle; + line-height: 16px; +} + +/*=== Pagination */ +.pagination { + display: table; + width: 100%; + margin: 0; + padding: 0; + table-layout: fixed; +} +.pagination .item { + display: table-cell; +} +.pagination .pager-first, +.pagination .pager-previous, +.pagination .pager-next, +.pagination .pager-last { + width: 100px; +} + +/*=== Boxes */ +.box { + display: inline-block; + width: 20rem; + max-width: 95%; + margin: 20px 10px; + border: 1px solid #ccc; + vertical-align: top; +} +.box .box-title { + position: relative; + font-size: 1.2rem; + font-weight: bold; + text-align: center; +} +.box .box-title a { + display: block; +} +.box .box-title form { + margin: 0; +} +.box .box-content { + display: block; + overflow: auto; +} +.box .box-content .item { + display: block; +} +.box .box-content .item.disabled { + text-align: center; + font-style: italic; +} + +.box .box-content-centered { + padding: 30px 5px; + text-align: center; +} +.box .box-content-centered .btn { + margin: 20px 0 0; +} + +/*=== Draggable */ +.drag-hover { + margin: 0 0 5px; + border-bottom: 2px solid #ccc; +} +[draggable=true] { + cursor: grab; +} + +/*=== Tree */ +.tree { + margin: 0; + padding: 0; + list-style: none; + text-align: left; +} +.tree-folder-items { + padding: 0; + list-style: none; +} +.tree-folder-title { + display: block; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.tree-folder-title .title { + display: inline-block; + width: 100%; + vertical-align: middle; +} +.tree-folder-items > .item { + display: block; + white-space: nowrap; +} +.tree-folder-items > .item > a { + display: inline-block; + vertical-align: middle; + width: calc(100% - 32px); + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +/*=== STRUCTURE */ +/*===============*/ +/*=== Header */ +.header { + display: table; + width: 100%; + table-layout: fixed; +} +.header > .item { + display: table-cell; +} +.header > .item.title { + width: 250px; + white-space: nowrap; +} +.header > .item.title h1 { + display: inline-block; +} +.header > .item.title .logo { + display: inline-block; + height: 32px; + width: 32px; + vertical-align: middle; +} +.header > .item.configure { + width: 100px; +} + +/*=== Body */ +#global { + display: table; + width: 100%; + height: 100%; + table-layout: fixed; +} +.aside { + display: table-cell; + height: 100%; + width: 300px; + vertical-align: top; +} + +/*=== Aside main page */ +.aside_feed .category .title { + width: calc(100% - 35px); +} + +.aside_feed .tree-folder-title .icon { + padding: 5px; +} +.aside_feed .tree-folder-items .item.feed { + padding: 0px 15px; +} +.aside_feed .tree-folder-items:not(.active) { + display: none; +} +.aside_feed .tree-folder-items .dropdown { + vertical-align: top; +} +.aside_feed .tree-folder-items .dropdown-menu { + left: 0; +} +.aside_feed .tree-folder-items .item .dropdown-toggle > .icon { + visibility: hidden; + cursor: pointer; +} +.aside_feed .tree-folder-items .item .dropdown-target:target ~ .dropdown-toggle > .icon, +.aside_feed .tree-folder-items .item:hover .dropdown-toggle > .icon, +.aside_feed .tree-folder-items .item.active .dropdown-toggle > .icon { + visibility: visible; +} + +/*=== New article notification */ +#new-article { + display: none; +} +#new-article > a { + display: block; +} + +/*=== Day indication */ +.day .name { + position: absolute; + right: 0; + width: 50%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +/*=== Feed article header and footer */ +.flux_header { + position: relative; +} +.flux .item { + line-height: 40px; + white-space: nowrap; +} +.flux .item.manage, +.flux .item.link { + width: 40px; + text-align: center; +} +.flux .item.website { + width: 200px; +} +.flux.not_read .item.title, +.flux.current .item.title { + font-weight: bold; +} +.flux:not(.current):hover .item.title { + position: absolute; + max-width: calc(100% - 320px); + background: #fff; +} +.flux .item.title a { + color: #000; + text-decoration: none; +} +.flux .item.date { + width: 155px; + text-align: right; + overflow: hidden; +} +.flux .item > a { + display: block; +} +.flux .item > a { + display: block; + text-decoration: none; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.flux .item.share > a, +.item.query > a { + display: list-item; + list-style-position: inside; + list-style-type: decimal; +} + +/*=== Feed article content */ +.hide_posts > .flux:not(.active) > .flux_content { + display: none; +} +.content { + min-height: 20em; + margin: auto; + line-height: 1.7em; + word-wrap: break-word; +} +.content.large { + max-width: 1000px; +} +.content.medium { + max-width: 800px; +} +.content.thin { + max-width: 550px; +} +.content ul, +.content ol, +.content dd { + margin: 0 0 0 15px; + padding: 0 0 5px 15px; +} +.content pre { + overflow: auto; +} +br { + line-height: 1em; +} +br + br + br { + display: none; +} + +/*=== Notification and actualize notification */ +.notification { + position: absolute; + top: 1em; + left: 25%; right: 25%; + z-index: 10; + background: #fff; + border: 1px solid #aaa; +} +.notification.closed { + display: none; +} +.notification a.close { + position: absolute; + top: 0; bottom: 0; + right: 0; + display: inline-block; +} + +#actualizeProgress { + position: fixed; +} +#actualizeProgress progress { + max-width: 100%; + vertical-align: middle; +} +#actualizeProgress .progress { + vertical-align: middle; +} + +/*=== Navigation menu (for articles) */ +#nav_entries { + position: fixed; + bottom: 0; left: 0; + display: table; + width: 300px; + background: #fff; + table-layout: fixed; +} +#nav_entries .item { + display: table-cell; + width: 30%; +} +#nav_entries a { + display: block; +} + +/*=== "Load more" part */ +#load_more { + min-height: 40px; +} +.loading { + background: url("loader.gif") center center no-repeat; + font-size: 0; +} +#bigMarkAsRead { + display: block; + width: 100%; + padding: 1em 0; + text-align: center; + font-size: 1.4em; +} +.bigTick { + font-size: 4em; +} + +/*=== Statistiques */ +.stat { + margin: 15px 0; +} +.stat.half { + display: inline-block; + width: 46%; + padding: 0 2%; +} +.stat > table { + width: 100%; +} +.statGraph { + height: 300px; +} + +/*=== GLOBAL VIEW */ +/*================*/ +#stream.global { + text-align: center; +} + +#stream.global .box { + text-align: left; +} + +/*=== Panel */ +#overlay { + display: none; + position: fixed; + top: 0; bottom: 0; + left: 0; right: 0; + background: rgba(0, 0, 0, 0.9); +} +#panel { + display: none; + position: fixed; + top: 1em; bottom: 1em; + left: 2em; right: 2em; + overflow: auto; + background: #fff; +} +#overlay .close { + position: fixed; + top: 0; bottom: 0; + left: 0; right: 0; + display: block; +} +#overlay .close img { + display: none; +} + +/*=== Slider */ +#slider { + position: fixed; + top: 0; bottom: 0; + left: 100%; right: 0; + overflow: auto; + background: #fff; + border-left: 1px solid #aaa; + transition: left 200ms linear; + -moz-transition: left 200ms linear; + -webkit-transition: left 200ms linear; + -o-transition: left 200ms linear; + -ms-transition: left 200ms linear; +} +#slider.active { + left: 40%; +} +#close-slider { + position: fixed; + top: 0; bottom: 0; + left: 100%; right: 0; + cursor: pointer; +} +#close-slider.active { + left: 0; +} + +/*=== SLIDESHOW */ +/*==============*/ +.slides { + padding: 0; + height: 320px; + display: block; + position: relative; + min-width: 260px; + max-width: 640px; + margin-bottom: 30px; + border: 1px solid #aaa; +} +.slides input { + display: none; +} +.slide-container { + display: block; +} +.slide { + top: 0; + opacity: 0; + width: 100%; + height: 100%; + display: block; + position: absolute; + transform: scale(0); + transition: all .7s ease-in-out; +} +.slide img { + width: 100%; + height: 100%; +} +.nav label { + width: 10%; + height: 100%; + display: none; + position: absolute; + opacity: 0; + z-index: 9; + cursor: pointer; + transition: opacity .2s; + color: #FFF; + font-size: 1000%; + text-align: center; + line-height: 225%; + font-family: "Varela Round", sans-serif; + background-color: rgba(255, 255, 255, .3); + text-shadow: 0px 0px 15px rgb(119, 119, 119); + padding: 0; +} +.properties { + display: none; + bottom: 0; + left: 0; right: 0; + position: absolute; + padding: 5px; + background: rgba(255, 255, 255, 0.7); + color: #000; + border-top: 1px solid #aaa; + z-index: 10; +} +.properties .page-number { + right: 5px; + top: 0; + position: absolute; +} +.slide:hover + .nav label { + opacity: 0.5; +} +.nav label:hover { + opacity: 1; +} +.nav .next { + right: 0; +} +input:checked + .slide-container .slide { + opacity: 1; + transform: scale(1); + transition: opacity 1s ease-in-out; +} +input:checked + .slide-container .nav label { + display: block; +} +input:checked + .slide-container .properties { + display: block; +} + +/*=== DIVERS */ +/*===========*/ +.category .title:not([data-unread="0"])::after { + content: attr(data-unread); +} +.category .title.error::before { + content: "⚠ "; + color: #bd362f; +} +.feed .item-title:not([data-unread="0"])::before { + content: "(" attr(data-unread) ") "; +} +.feed .item-title:not([data-unread="0"]) { + font-weight: bold; +} + +.state_unread .category:not(.active)[data-unread="0"], +.state_unread .feed:not(.active)[data-unread="0"] { + display: none; +} + +.nav-login, +.nav_menu .search, +.aside .toggle_aside, +.nav_menu .toggle_aside { + display: none; +} + +.enclosure > [download] { + font-size: xx-large; + margin-left: .8em; +} + +/*=== MOBILE */ +/*===========*/ +@media(max-width: 840px) { + .header, + .aside .btn-important, + .flux_header .item.website span, + .item.date, .day .date, + .dropdown-menu > .no-mobile, + .no-mobile { + display: none; + } + .aside .toggle_aside, + .nav-login { + display: block; + } + .nav_menu .toggle_aside, + .nav_menu .search, + #panel .close img { + display: inline-block; + } + + .aside { + position: fixed; + top: 0; bottom: 0; + left: 0; + width: 0; + overflow: hidden; + z-index: 100; + } + .aside:target { + width: 90%; + overflow: auto; + } + + .flux_header .item.website { + width: 40px; + } + + .flux:not(.current):hover .item.title { + position: relative; + width: auto; + white-space: nowrap; + } + + .notification { + top: 0; + left: 0; + right: 0; + } + + #nav_entries { + width: 100%; + } + + #panel { + top: 25px; bottom: 30px; + left: 0; right: 0; + } + #panel .close { + top: 0; right: 0; + left: auto; bottom: auto; + display: inline-block; + width: 30px; + height: 30px; + } +} + +/*=== PRINTER */ +/*============*/ +@media print { + .header, .aside, + .nav_menu, .day, + .flux_header, + .flux_content .bottom, + .pagination, + #nav_entries { + display: none; + } + html, body { + background: #fff; + color: #000; + font-family: Serif; + } + #global, + .flux_content { + display: block !important; + } + .flux_content .content { + width: 100% !important; + } + .flux_content .content a { + color: #000; + } + .flux_content .content a::after { + content: " [" attr(href) "] "; + font-style: italic; + } +} diff --git a/p/themes/icons/add.svg b/p/themes/icons/add.svg index 425c9b4aa..652491775 100644 --- a/p/themes/icons/add.svg +++ b/p/themes/icons/add.svg @@ -1,30 +1,5 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:svg='http://www.w3.org/2000/svg' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' version='1.1' inkscape:version='0.47 r22583' height='16' sodipodi:docname='list-add-symbolic.svg' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:object-paths='true' inkscape:cy='17.83946' inkscape:current-layer='layer12' inkscape:window-width='1920' pagecolor='#555753' showborder='false' showguides='true' inkscape:snap-nodes='false' objecttolerance='10' showgrid='true' inkscape:object-nodes='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:window-x='0' inkscape:snap-bbox='true' bordercolor='#666666' id='namedview88' inkscape:window-maximized='1' inkscape:snap-global='true' inkscape:window-y='26' gridtolerance='10' inkscape:zoom='1' inkscape:window-height='1021' borderopacity='1' guidetolerance='10' inkscape:snap-bbox-midpoints='false' inkscape:cx='-2.56708' inkscape:bbox-paths='false' inkscape:snap-grids='true' inkscape:pageopacity='1' inkscape:snap-to-guides='true'> - <inkscape:grid visible='true' spacingx='1px' type='xygrid' spacingy='1px' id='grid4866' empspacing='2' enabled='true' snapvisiblegridlinesonly='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g transform='translate(-60.0002,-726)' inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline'/> - <g transform='translate(-60.0002,-726)' inkscape:groupmode='layer' id='layer10' inkscape:label='devices'/> - <g transform='translate(-60.0002,-726)' inkscape:groupmode='layer' id='layer11' inkscape:label='apps'/> - <g transform='translate(-60.0002,-726)' inkscape:groupmode='layer' id='layer12' inkscape:label='actions'> - - <path d='m 67.0002,729 0,4 -4,0 0,2 4,0 0,4 2,0 0,-4 4,0 0,-2 -4,0 0,-4 -2,0 z' id='rect31992' style='color:#666666;fill:#666666;fill-opacity:1;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible'/> - </g> - <g transform='translate(-60.0002,-726)' inkscape:groupmode='layer' id='layer13' inkscape:label='places'/> - <g transform='translate(-60.0002,-726)' inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes'/> - <g transform='translate(-60.0002,-726)' inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline'/> - <g transform='translate(-60.0002,-726)' inkscape:groupmode='layer' id='g4953' inkscape:label='categories' style='display:inline'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-60.0002,-726)"> +<path style="color:#666666;" fill="#666" d="m67,729,0,4-4,0,0,2,4,0,0,4,2,0,0-4,4,0,0-2-4,0,0-4-2,0z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/all.svg b/p/themes/icons/all.svg index 2180f7a4b..aeaa96277 100644 --- a/p/themes/icons/all.svg +++ b/p/themes/icons/all.svg @@ -1,32 +1,7 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:svg='http://www.w3.org/2000/svg' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' sodipodi:docname='view-list-symbolic.svg' version='1.1' inkscape:version='0.48.1 r9760' height='16' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:cy='71.95215' pagecolor='#555753' borderopacity='1' showborder='false' inkscape:bbox-paths='false' guidetolerance='10' inkscape:object-paths='true' inkscape:window-width='1198' showguides='true' inkscape:object-nodes='true' inkscape:snap-bbox='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:snap-nodes='false' bordercolor='#666666' objecttolerance='10' id='namedview88' showgrid='false' inkscape:window-maximized='0' inkscape:window-x='1582' inkscape:snap-global='true' inkscape:window-y='85' gridtolerance='10' inkscape:window-height='1079' inkscape:snap-to-guides='true' inkscape:current-layer='layer12' inkscape:snap-bbox-midpoints='false' inkscape:zoom='1' inkscape:cx='244.57499' inkscape:snap-grids='true' inkscape:pageopacity='1'> - <inkscape:grid spacingx='1px' spacingy='1px' id='grid4866' empspacing='2' enabled='true' type='xygrid' snapvisiblegridlinesonly='true' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:label='status' transform='translate(-40.0002,-746)' inkscape:groupmode='layer' id='layer9' style='display:inline'/> - <g inkscape:label='devices' transform='translate(-40.0002,-746)' inkscape:groupmode='layer' id='layer10'/> - <g inkscape:label='apps' transform='translate(-40.0002,-746)' inkscape:groupmode='layer' id='layer11'/> - <g inkscape:label='actions' transform='translate(-40.0002,-746)' inkscape:groupmode='layer' id='layer12'> - - <rect inkscape:label='a' x='43.000397' y='748.99976' id='rect7356' height='2.0002136' width='9.9996014' style='color:#bebebe;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible'/> - <rect inkscape:label='a' x='43.000397' y='752.99976' id='rect7358' height='2.0002136' width='9.9996014' style='color:#bebebe;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible'/> - <rect inkscape:label='a' x='43.000397' y='756.99976' id='rect7360' height='2.0002136' width='9.9996014' style='color:#bebebe;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible'/> - </g> - <g inkscape:label='places' transform='translate(-40.0002,-746)' inkscape:groupmode='layer' id='layer13'/> - <g inkscape:label='mimetypes' transform='translate(-40.0002,-746)' inkscape:groupmode='layer' id='layer14'/> - <g inkscape:label='emblems' transform='translate(-40.0002,-746)' inkscape:groupmode='layer' id='layer15' style='display:inline'/> - <g inkscape:label='categories' transform='translate(-40.0002,-746)' inkscape:groupmode='layer' id='g4953' style='display:inline'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-40.0002,-746)" fill="#bebebe"> +<rect style="color:#bebebe;" height="2.0002" width="9.9996" y="749" x="43"/> +<rect style="color:#bebebe;" height="2.0002" width="9.9996" y="753" x="43"/> +<rect style="color:#bebebe;" height="2.0002" width="9.9996" y="757" x="43"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/apple-touch-icon.png b/p/themes/icons/apple-touch-icon.png Binary files differnew file mode 100644 index 000000000..0bbab07ea --- /dev/null +++ b/p/themes/icons/apple-touch-icon.png diff --git a/p/themes/icons/bookmark-add.svg b/p/themes/icons/bookmark-add.svg new file mode 100644 index 000000000..51db9c498 --- /dev/null +++ b/p/themes/icons/bookmark-add.svg @@ -0,0 +1,6 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-141.0002,-807)" fill="#bebebe"> +<path d="m143,807,0,13,4-4,4,4,0-4,0-1-2,0,0-4,2,0,0-4z"/> +<path d="m152,810,0,2-2,0,0,2,2,0,0,2,2,0,0-2,2,0,0-2-2,0,0-2-2,0z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/bookmark.svg b/p/themes/icons/bookmark.svg index d6e2cebb5..63a44908f 100644 --- a/p/themes/icons/bookmark.svg +++ b/p/themes/icons/bookmark.svg @@ -1,32 +1,5 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:svg='http://www.w3.org/2000/svg' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' sodipodi:docname='starred-symbolic.svg' version='1.1' inkscape:version='0.48.1 r9760' height='16' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:cy='0.50817' pagecolor='#555753' borderopacity='1' showborder='false' inkscape:bbox-paths='false' guidetolerance='10' inkscape:object-paths='true' inkscape:window-width='1457' showguides='true' inkscape:object-nodes='true' inkscape:snap-bbox='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:snap-nodes='false' bordercolor='#666666' objecttolerance='10' id='namedview88' showgrid='false' inkscape:window-maximized='0' inkscape:window-x='86' inkscape:snap-global='true' inkscape:window-y='51' gridtolerance='10' inkscape:window-height='1093' inkscape:snap-to-guides='true' inkscape:current-layer='layer9' inkscape:snap-bbox-midpoints='false' inkscape:zoom='1' inkscape:cx='19.029058' inkscape:snap-grids='true' inkscape:pageopacity='1'> - <inkscape:grid spacingx='1px' spacingy='1px' id='grid4866' empspacing='2' enabled='true' type='xygrid' snapvisiblegridlinesonly='true' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:label='status' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer9' style='display:inline'> - <g inkscape:label='folder-remote' transform='translate(-186.9996,-599)' id='g11910-1'> - - </g> - <path sodipodi:cy='180.96373' sodipodi:r2='3.8276224' transform='matrix(1.0472113,-0.00871584,0.00871584,1.0472113,-504.35434,220.15425)' inkscape:rounded='0.2104596' inkscape:flatsided='false' inkscape:transform-center-x='-0.0094346789' inkscape:transform-center-y='-0.69491065' d='m 530.9488,186.70897 c -0.77941,0.55189 -3.15759,-1.90601 -4.11253,-1.9179 -0.95532,-0.0119 -3.39494,2.38585 -4.16096,1.8149 -0.76573,-0.57072 0.83698,-3.59203 0.55319,-4.50391 -0.2839,-0.91223 -3.31818,-2.49151 -3.01189,-3.39647 0.30617,-0.90461 3.67487,-0.31399 4.45442,-0.86567 0.77986,-0.5519 1.3442,-3.92569 2.29952,-3.91404 0.95494,0.0116 1.43421,3.39798 2.19979,3.9689 0.76588,0.57114 4.14893,0.0653 4.43307,0.97746 0.28402,0.9118 -2.78848,2.41405 -3.09488,3.31858 -0.30652,0.90489 1.21999,3.96605 0.44027,4.51815 z' id='path11922-0' sodipodi:type='star' sodipodi:arg1='0.95492637' sodipodi:r1='7.0383992' style='color:#000000;fill:#f1c40f;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate' sodipodi:arg2='1.5829876' inkscape:randomized='0' sodipodi:cx='526.88293' sodipodi:sides='5'/> - </g> - <g inkscape:label='devices' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer10'/> - <g inkscape:label='apps' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer11'/> - <g inkscape:label='actions' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer12'/> - <g inkscape:label='places' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer13'/> - <g inkscape:label='mimetypes' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer14'/> - <g inkscape:label='emblems' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer15' style='display:inline'/> - <g inkscape:label='categories' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='g4953' style='display:inline'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-41.000202,-397)"> +<path style="enable-background:accumulate;color:#000000;" d="m530.95,186.71c-0.77941,0.55189-3.1576-1.906-4.1125-1.9179-0.95532-0.0119-3.3949,2.3858-4.161,1.8149-0.76573-0.57072,0.83698-3.592,0.55319-4.5039-0.2839-0.91223-3.3182-2.4915-3.0119-3.3965,0.30617-0.90461,3.6749-0.31399,4.4544-0.86567,0.77986-0.5519,1.3442-3.9257,2.2995-3.914,0.95494,0.0116,1.4342,3.398,2.1998,3.9689,0.76588,0.57114,4.1489,0.0653,4.4331,0.97746,0.28402,0.9118-2.7885,2.414-3.0949,3.3186-0.30652,0.90489,1.22,3.966,0.44027,4.5182z" fill-rule="nonzero" transform="matrix(1.0472113,-0.00871584,0.00871584,1.0472113,-504.35434,220.15425)" fill="#f1c40f"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/category-white.svg b/p/themes/icons/category-white.svg index 5e61aeea5..5bb5cecd9 100644 --- a/p/themes/icons/category-white.svg +++ b/p/themes/icons/category-white.svg @@ -1,31 +1,7 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:svg='http://www.w3.org/2000/svg' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' sodipodi:docname='folder-symbolic.svg' version='1.1' inkscape:version='0.48.0 r9654' height='16' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:cy='-173.07332' pagecolor='#555753' borderopacity='1' showborder='false' inkscape:bbox-paths='false' guidetolerance='10' inkscape:window-width='1310' showguides='true' inkscape:object-nodes='true' inkscape:snap-bbox='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:snap-nodes='true' bordercolor='#FFFFFF' objecttolerance='10' id='namedview88' showgrid='false' inkscape:window-maximized='0' inkscape:window-x='52' inkscape:snap-global='true' inkscape:window-y='24' gridtolerance='10' inkscape:window-height='690' inkscape:snap-to-guides='true' inkscape:current-layer='layer13' inkscape:zoom='1' inkscape:cx='-157.67647' inkscape:snap-grids='true' inkscape:pageopacity='1'> - <inkscape:grid spacingx='1px' spacingy='1px' id='grid4866' empspacing='2' enabled='true' type='xygrid' snapvisiblegridlinesonly='true' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:label='status' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer9' style='display:inline'/> - <g inkscape:label='devices' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer10'/> - <g inkscape:label='apps' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer11'/> - <g inkscape:label='actions' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer12'/> - <g inkscape:label='places' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer13'> - <g transform='translate(234.0002,-820)' id='g14154'> - <path inkscape:connector-curvature='0' d='m 208.53105,997 c -0.28913,0 -0.53125,0.24212 -0.53125,0.53125 l 0,13.93755 c 0,0.2985 0.23264,0.5312 0.53125,0.5312 l 14.9375,0 c 0.2986,0 0.53125,-0.2326 0.53125,-0.5312 l 0,-8.9376 c 0,-0.2891 -0.24212,-0.5312 -0.53125,-0.5312 l -12.46875,0 0,7.5 c 0,0.277 -0.223,0.5 -0.5,0.5 -0.277,0 -0.5,-0.223 -0.5,-0.5 l 0,-8 c 0,-0.277 0.223,-0.5 0.5,-0.5 l 2.96875,0 8.53125,0 0,-1.4062 c 0,-0.3272 -0.26666,-0.5938 -0.59375,-0.5938 l -7.40625,0 0,-1.46875 C 213.9998,997.2421 213.75768,997 213.46855,997 z' id='rect3845' sodipodi:nodetypes='ccccccccccsccccccccccc' style='fill:#FFFFFF;fill-opacity:1;stroke:none;display:inline'/> - - </g> - </g> - <g inkscape:label='mimetypes' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer14'/> - <g inkscape:label='emblems' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer15' style='display:inline'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-442,-176)"> +<g transform="translate(234.0002,-820)"> +<path d="m208.53,997c-0.28913,0-0.53125,0.24212-0.53125,0.53125v13.938c0,0.2985,0.23264,0.5312,0.53125,0.5312h14.938c0.2986,0,0.53125-0.2326,0.53125-0.5312v-8.9376c0-0.2891-0.24212-0.5312-0.53125-0.5312h-12.469v7.5c0,0.277-0.223,0.5-0.5,0.5s-0.5-0.223-0.5-0.5v-8c0-0.277,0.223-0.5,0.5-0.5h2.9688,8.5312v-1.4062c0-0.3272-0.26666-0.5938-0.59375-0.5938h-7.4062v-1.4688c0-0.39-0.24-0.63-0.53-0.63z" fill="#FFF"/> +</g> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/category.svg b/p/themes/icons/category.svg index 71f95490e..b5470d84a 100644 --- a/p/themes/icons/category.svg +++ b/p/themes/icons/category.svg @@ -1,31 +1,7 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:svg='http://www.w3.org/2000/svg' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' sodipodi:docname='folder-symbolic.svg' version='1.1' inkscape:version='0.48.0 r9654' height='16' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:cy='-173.07332' pagecolor='#555753' borderopacity='1' showborder='false' inkscape:bbox-paths='false' guidetolerance='10' inkscape:window-width='1310' showguides='true' inkscape:object-nodes='true' inkscape:snap-bbox='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:snap-nodes='true' bordercolor='#666666' objecttolerance='10' id='namedview88' showgrid='false' inkscape:window-maximized='0' inkscape:window-x='52' inkscape:snap-global='true' inkscape:window-y='24' gridtolerance='10' inkscape:window-height='690' inkscape:snap-to-guides='true' inkscape:current-layer='layer13' inkscape:zoom='1' inkscape:cx='-157.67647' inkscape:snap-grids='true' inkscape:pageopacity='1'> - <inkscape:grid spacingx='1px' spacingy='1px' id='grid4866' empspacing='2' enabled='true' type='xygrid' snapvisiblegridlinesonly='true' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:label='status' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer9' style='display:inline'/> - <g inkscape:label='devices' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer10'/> - <g inkscape:label='apps' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer11'/> - <g inkscape:label='actions' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer12'/> - <g inkscape:label='places' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer13'> - <g transform='translate(234.0002,-820)' id='g14154'> - <path inkscape:connector-curvature='0' d='m 208.53105,997 c -0.28913,0 -0.53125,0.24212 -0.53125,0.53125 l 0,13.93755 c 0,0.2985 0.23264,0.5312 0.53125,0.5312 l 14.9375,0 c 0.2986,0 0.53125,-0.2326 0.53125,-0.5312 l 0,-8.9376 c 0,-0.2891 -0.24212,-0.5312 -0.53125,-0.5312 l -12.46875,0 0,7.5 c 0,0.277 -0.223,0.5 -0.5,0.5 -0.277,0 -0.5,-0.223 -0.5,-0.5 l 0,-8 c 0,-0.277 0.223,-0.5 0.5,-0.5 l 2.96875,0 8.53125,0 0,-1.4062 c 0,-0.3272 -0.26666,-0.5938 -0.59375,-0.5938 l -7.40625,0 0,-1.46875 C 213.9998,997.2421 213.75768,997 213.46855,997 z' id='rect3845' sodipodi:nodetypes='ccccccccccsccccccccccc' style='fill:#666666;fill-opacity:1;stroke:none;display:inline'/> - - </g> - </g> - <g inkscape:label='mimetypes' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer14'/> - <g inkscape:label='emblems' transform='translate(-442,-176)' inkscape:groupmode='layer' id='layer15' style='display:inline'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-442,-176)"> +<g transform="translate(234.0002,-820)"> +<path d="m208.53,997c-0.28913,0-0.53125,0.24212-0.53125,0.53125v13.938c0,0.2985,0.23264,0.5312,0.53125,0.5312h14.938c0.2986,0,0.53125-0.2326,0.53125-0.5312v-8.9376c0-0.2891-0.24212-0.5312-0.53125-0.5312h-12.469v7.5c0,0.277-0.223,0.5-0.5,0.5s-0.5-0.223-0.5-0.5v-8c0-0.277,0.223-0.5,0.5-0.5h2.9688,8.5312v-1.4062c0-0.3272-0.26666-0.5938-0.59375-0.5938h-7.4062v-1.4688c0-0.39-0.24-0.63-0.53-0.63z" fill="#666"/> +</g> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/close.svg b/p/themes/icons/close.svg index c0c786fd6..20d1577ab 100644 --- a/p/themes/icons/close.svg +++ b/p/themes/icons/close.svg @@ -1,28 +1,7 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:svg='http://www.w3.org/2000/svg' id='svg7384' version='1.1' height='16' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <defs id='defs7386'/> - <g transform='translate(-60,-518)' id='layer9' style='display:inline'/> - <g transform='translate(-60,-518)' id='layer10'/> - <g transform='translate(-60,-518)' id='layer11'/> - <g transform='translate(-60,-518)' id='layer12'> - <g transform='translate(19,-242)' id='layer4-4-1' style='display:inline'> - - <path inkscape:connector-curvature='0' d='m 45,764 1,0 c 0.01037,-1.2e-4 0.02079,-4.6e-4 0.03125,0 0.254951,0.0112 0.50987,0.12858 0.6875,0.3125 L 49,766.59375 51.3125,764.3125 C 51.578125,764.082 51.759172,764.007 52,764 l 1,0 0,1 c 0,0.28647 -0.03434,0.55065 -0.25,0.75 l -2.28125,2.28125 2.25,2.25 C 52.906938,770.46942 52.999992,770.7347 53,771 l 0,1 -1,0 c -0.265301,-10e-6 -0.530586,-0.0931 -0.71875,-0.28125 L 49,769.4375 46.71875,771.71875 C 46.530586,771.90694 46.26529,772 46,772 l -1,0 0,-1 c -3e-6,-0.26529 0.09306,-0.53058 0.28125,-0.71875 l 2.28125,-2.25 L 45.28125,765.75 C 45.070508,765.55537 44.97809,765.28075 45,765 l 0,-1 z' id='path10839-9' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#bebebe;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78124988;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new;font-family:Andale Mono;-inkscape-font-specification:Andale Mono'/> - </g> - </g> - <g transform='translate(-60,-518)' id='layer13'/> - <g transform='translate(-60,-518)' id='layer14'/> - <g transform='translate(-60,-518)' id='layer15'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-60,-518)"> +<g transform="translate(19,-242)"> +<path style="block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:new;text-transform:none;" d="m45,764,1,0c0.01037-0.00012,0.02079-0.00046,0.03125,0,0.25495,0.0112,0.50987,0.12858,0.6875,0.3125l2.282,2.28,2.312-2.28c0.266-0.23,0.447-0.3,0.688-0.31h1v1c0,0.28647-0.03434,0.55065-0.25,0.75l-2.2812,2.2812,2.25,2.25c0.188,0.19,0.281,0.45,0.281,0.72v1h-1c-0.2653-0.00001-0.53059-0.0931-0.71875-0.28125l-2.281-2.28-2.281,2.28c-0.188,0.19-0.454,0.28-0.719,0.28h-1v-1c-0.000003-0.26529,0.09306-0.53058,0.28125-0.71875l2.2812-2.25-2.281-2.28c-0.21-0.19-0.303-0.47-0.281-0.75v-1z" fill-rule="nonzero" fill="#bebebe"/> +</g> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/configure.svg b/p/themes/icons/configure.svg index 52df8bca7..2957a7abe 100644 --- a/p/themes/icons/configure.svg +++ b/p/themes/icons/configure.svg @@ -1,31 +1,5 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns='http://www.w3.org/2000/svg' id='svg7384' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:cc='http://creativecommons.org/ns#' xmlns:svg='http://www.w3.org/2000/svg' width='16' sodipodi:docname='emblem-system-symbolic.svg' height='16' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' version='1.1' inkscape:version='0.48.1 r9760'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:window-height='967' inkscape:snap-bbox-midpoints='false' inkscape:snap-grids='true' inkscape:object-paths='false' pagecolor='#555753' inkscape:zoom='1' inkscape:current-layer='layer15' borderopacity='1' inkscape:snap-others='false' inkscape:window-x='2259' inkscape:window-y='356' inkscape:snap-to-guides='true' gridtolerance='10' id='namedview88' inkscape:snap-global='true' inkscape:cx='9.30971' inkscape:cy='-0.23089111' bordercolor='#666666' inkscape:window-width='1226' inkscape:snap-bbox='true' guidetolerance='10' showguides='true' showborder='false' inkscape:guide-bbox='true' inkscape:object-nodes='false' inkscape:pageopacity='1' inkscape:window-maximized='0' objecttolerance='10' showgrid='false' inkscape:snap-nodes='true' inkscape:bbox-paths='false' inkscape:pageshadow='2'> - <inkscape:grid visible='true' spacingx='1px' spacingy='1px' id='grid4866' type='xygrid' empspacing='2' enabled='true' snapvisiblegridlinesonly='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:label='status' id='layer9' style='display:inline' transform='translate(-441.0002,-400.99999)' inkscape:groupmode='layer'/> - <g inkscape:label='devices' id='layer10' transform='translate(-441.0002,-400.99999)' inkscape:groupmode='layer'/> - <g inkscape:label='apps' id='layer11' transform='translate(-441.0002,-400.99999)' inkscape:groupmode='layer'/> - <g inkscape:label='places' id='layer13' transform='translate(-441.0002,-400.99999)' inkscape:groupmode='layer'/> - <g inkscape:label='mimetypes' id='layer14' transform='translate(-441.0002,-400.99999)' inkscape:groupmode='layer'/> - <g inkscape:label='emblems' id='layer15' style='display:inline' transform='translate(-441.0002,-400.99999)' inkscape:groupmode='layer'> - - <path id='path35543-6-4' d='m 449.0004,402.00002 c -0.22065,0 -0.44081,0.0113 -0.65625,0.0312 l -0.40625,2.09375 c -0.33446,0.0733 -0.66305,0.17589 -0.96875,0.3125 l -1.53125,-1.46875 c -0.38863,0.23011 -0.72695,0.51408 -1.0625,0.8125 l 0.90625,1.90625 c -0.22242,0.24899 -0.42425,0.5225 -0.59375,0.8125 l -2.09375,-0.28125 c -0.17772,0.40877 -0.30872,0.83637 -0.40625,1.28125 l 1.84375,1 c -0.0171,0.16809 -0.0312,0.3274 -0.0312,0.5 0,0.1726 0.0142,0.33191 0.0312,0.5 l -1.84375,1 c 0.0975,0.44488 0.22853,0.87248 0.40625,1.28125 l 2.09375,-0.28125 c 0.1695,0.29 0.37133,0.56351 0.59375,0.8125 l -0.90625,1.90625 c 0.33555,0.29842 0.67387,0.58239 1.0625,0.8125 l 1.53125,-1.46875 c 0.3057,0.13661 0.63429,0.23916 0.96875,0.3125 l 0.40625,2.09375 c 0.21544,0.02 0.4356,0.0312 0.65625,0.0312 0.22065,0 0.44081,-0.0113 0.65625,-0.0312 l 0.40625,-2.09375 c 0.33446,-0.0733 0.66305,-0.17589 0.96875,-0.3125 l 1.53125,1.46875 c 0.38863,-0.23011 0.72695,-0.51408 1.0625,-0.8125 l -0.90625,-1.90625 c 0.22242,-0.24899 0.42425,-0.5225 0.59375,-0.8125 l 2.09375,0.28125 c 0.17772,-0.40877 0.30872,-0.83637 0.40625,-1.28125 l -1.84375,-1 c 0.0171,-0.16809 0.0312,-0.3274 0.0312,-0.5 0,-0.1726 -0.0142,-0.33191 -0.0312,-0.5 l 1.84375,-1 c -0.0975,-0.44488 -0.22853,-0.87248 -0.40625,-1.28125 l -2.09375,0.28125 c -0.1695,-0.29 -0.37133,-0.56351 -0.59375,-0.8125 l 0.90625,-1.90625 c -0.33555,-0.29842 -0.67387,-0.58239 -1.0625,-0.8125 l -1.53125,1.46875 c -0.3057,-0.13661 -0.63429,-0.23916 -0.96875,-0.3125 l -0.40625,-2.09375 c -0.21544,-0.02 -0.4356,-0.0312 -0.65625,-0.0312 z m 0,4 c 1.65685,0 3,1.34315 3,3 0,1.65685 -1.34315,3 -3,3 -1.65685,0 -3,-1.34315 -3,-3 0,-1.65685 1.34315,-3 3,-3 z' style='color:#666666;fill:#666666;fill-opacity:1;fill-rule:nonzero;stroke:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate' inkscape:connector-curvature='0' sodipodi:nodetypes='sccccccccccsccccccccccsccccccccccsccccccccccssssss'/> - </g> - <g inkscape:label='emotes' id='g71291' style='display:inline' transform='translate(-441.0002,-400.99999)' inkscape:groupmode='layer'/> - <g inkscape:label='categories' id='g4953' style='display:inline' transform='translate(-441.0002,-400.99999)' inkscape:groupmode='layer'/> - <g inkscape:label='actions' id='layer12' style='display:inline' transform='translate(-441.0002,-400.99999)' inkscape:groupmode='layer'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-441.0002,-400.99999)"> +<path style="color:#666666;enable-background:accumulate;" d="m449,402c-0.22065,0-0.44081,0.0113-0.65625,0.0312l-0.40625,2.0938c-0.33446,0.0733-0.66305,0.17589-0.96875,0.3125l-1.5312-1.4688c-0.38863,0.23011-0.72695,0.51408-1.0625,0.8125l0.90625,1.9062c-0.22242,0.24899-0.42425,0.5225-0.59375,0.8125l-2.0938-0.28125c-0.17772,0.40877-0.30872,0.83637-0.40625,1.2812l1.8438,1c-0.0171,0.16809-0.0312,0.3274-0.0312,0.5s0.0142,0.33191,0.0312,0.5l-1.8438,1c0.0975,0.44488,0.22853,0.87248,0.40625,1.2812l2.0938-0.28125c0.1695,0.29,0.37133,0.56351,0.59375,0.8125l-0.90625,1.9062c0.33555,0.29842,0.67387,0.58239,1.0625,0.8125l1.5312-1.4688c0.3057,0.13661,0.63429,0.23916,0.96875,0.3125l0.40625,2.0938c0.21544,0.02,0.4356,0.0312,0.65625,0.0312s0.44081-0.0113,0.65625-0.0312l0.40625-2.0938c0.33446-0.0733,0.66305-0.17589,0.96875-0.3125l1.5312,1.4688c0.38863-0.23011,0.72695-0.51408,1.0625-0.8125l-0.90625-1.9062c0.22242-0.24899,0.42425-0.5225,0.59375-0.8125l2.0938,0.28125c0.17772-0.40877,0.30872-0.83637,0.40625-1.2812l-1.8438-1c0.0171-0.16809,0.0312-0.3274,0.0312-0.5s-0.0142-0.33191-0.0312-0.5l1.8438-1c-0.0975-0.44488-0.22853-0.87248-0.40625-1.2812l-2.0938,0.28125c-0.1695-0.29-0.37133-0.56351-0.59375-0.8125l0.90625-1.9062c-0.33555-0.29842-0.67387-0.58239-1.0625-0.8125l-1.5312,1.4688c-0.3057-0.13661-0.63429-0.23916-0.96875-0.3125l-0.40625-2.0938c-0.21544-0.02-0.4356-0.0312-0.65625-0.0312zm0,4c1.6568,0,3,1.3432,3,3s-1.3432,3-3,3-3-1.3432-3-3,1.3432-3,3-3z" fill-rule="nonzero" fill="#666"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/default_favicon.ico b/p/themes/icons/default_favicon.ico Binary files differnew file mode 100644 index 000000000..e4d5e8f67 --- /dev/null +++ b/p/themes/icons/default_favicon.ico diff --git a/p/themes/icons/down.svg b/p/themes/icons/down.svg index 06d031fae..8a234ee99 100644 --- a/p/themes/icons/down.svg +++ b/p/themes/icons/down.svg @@ -1,31 +1,5 @@ -<?xml version='1.0' encoding='UTF-8' standalone='no'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' sodipodi:docname='go-down-symbolic.svg' height='16' id='svg7384' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:svg='http://www.w3.org/2000/svg' inkscape:version='0.48.4 r9939' version='1.1' width='16' xmlns='http://www.w3.org/2000/svg'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:bbox-nodes='false' inkscape:bbox-paths='true' bordercolor='#666666' borderopacity='1' inkscape:current-layer='layer12' inkscape:cx='18.648774' inkscape:cy='9.99302' gridtolerance='10' inkscape:guide-bbox='true' guidetolerance='10' id='namedview88' inkscape:object-nodes='false' inkscape:object-paths='false' objecttolerance='10' pagecolor='#3a3b39' inkscape:pageopacity='1' inkscape:pageshadow='2' showborder='false' showgrid='false' showguides='true' inkscape:snap-bbox='true' inkscape:snap-bbox-midpoints='false' inkscape:snap-global='true' inkscape:snap-grids='true' inkscape:snap-nodes='false' inkscape:snap-others='false' inkscape:snap-to-guides='true' inkscape:window-height='1408' inkscape:window-maximized='1' inkscape:window-width='2560' inkscape:window-x='0' inkscape:window-y='0' inkscape:zoom='1'> - <inkscape:grid empspacing='2' enabled='true' id='grid4866' originx='60px' originy='530px' snapvisiblegridlinesonly='true' spacingx='1px' spacingy='1px' type='xygrid' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline' transform='translate(-181.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer10' inkscape:label='devices' transform='translate(-181.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer11' inkscape:label='apps' transform='translate(-181.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer13' inkscape:label='places' transform='translate(-181.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes' transform='translate(-181.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline' transform='translate(-181.0002,-747)'/> - <g inkscape:groupmode='layer' id='g71291' inkscape:label='emotes' style='display:inline' transform='translate(-181.0002,-747)'/> - <g inkscape:groupmode='layer' id='g4953' inkscape:label='categories' style='display:inline' transform='translate(-181.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer12' inkscape:label='actions' style='display:inline' transform='translate(-181.0002,-747)'> - - <path inkscape:connector-curvature='0' d='m 195.03152,751.00323 0,1.00001 c -9.1e-4,0.0111 5.9e-4,0.021 -9e-5,0.0312 -0.0112,0.25496 -0.12835,0.50994 -0.31251,0.6875 l -5.71875,6.29767 -5.71875,-6.29773 c -0.18821,-0.1881 -0.28121,-0.45346 -0.28122,-0.71875 l 0,-1.00001 1,0 c 0.26531,7e-5 0.53059,0.0931 0.71873,0.28131 l 4.28125,4.82896 4.28127,-4.82896 c 0.19464,-0.21073 0.46925,-0.30315 0.74998,-0.2813 z' id='path10839-9-9-5-9-1' sodipodi:nodetypes='ccsccccccccccc' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#bebebe;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78124988;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new;font-family:Andale Mono;-inkscape-font-specification:Andale Mono'/> - </g> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-181.0002,-747)"> +<path style="block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:new;text-transform:none;" d="m195.03,751,0,1c-0.00091,0.0111,0.00059,0.021-0.00009,0.0312-0.0112,0.25496-0.12835,0.50994-0.31251,0.6875l-5.7188,6.2977-5.7188-6.2977c-0.18821-0.1881-0.28121-0.45346-0.28122-0.71875v-1h1c0.26531,0.00007,0.53059,0.0931,0.71873,0.28131l4.2812,4.829,4.2813-4.829c0.19464-0.21073,0.46925-0.30315,0.74998-0.2813z" fill-rule="nonzero" fill="#bebebe"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/favicon.svg b/p/themes/icons/favicon.svg index a44f0a1c0..a252050b9 100644 --- a/p/themes/icons/favicon.svg +++ b/p/themes/icons/favicon.svg @@ -1,11 +1,7 @@ -<?xml version="1.0" encoding="UTF-8"?> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"> <title>Logo FreshRSS</title> - <circle fill="#FFF" cx="128" cy="128" r="128"/> - <circle fill="#0062BE" cx="128" cy="128" r="33"/> - <g fill="none" stroke="#0062BE" stroke-width="24"> <g stroke-opacity="0.3"> <path d="M12,128 A116,116 0 1,1 128,244"/> diff --git a/p/themes/icons/help.svg b/p/themes/icons/help.svg index b103ec46d..9a0022f76 100644 --- a/p/themes/icons/help.svg +++ b/p/themes/icons/help.svg @@ -1,32 +1,7 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:svg='http://www.w3.org/2000/svg' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' version='1.1' inkscape:version='0.47 r22583' height='16' sodipodi:docname='help-browser-symbolic.svg' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:object-paths='true' inkscape:cy='-218.16054' inkscape:current-layer='layer11' inkscape:window-width='1920' pagecolor='#555753' showborder='false' showguides='true' inkscape:snap-nodes='false' objecttolerance='10' showgrid='true' inkscape:object-nodes='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:window-x='0' inkscape:snap-bbox='true' bordercolor='#666666' id='namedview88' inkscape:window-maximized='1' inkscape:snap-global='true' inkscape:window-y='26' gridtolerance='10' inkscape:zoom='1' inkscape:window-height='1021' borderopacity='1' guidetolerance='10' inkscape:snap-bbox-midpoints='false' inkscape:cx='-124.56688' inkscape:bbox-paths='false' inkscape:snap-grids='true' inkscape:pageopacity='1' inkscape:snap-to-guides='true'> - <inkscape:grid visible='true' spacingx='1px' type='xygrid' spacingy='1px' id='grid4866' empspacing='2' enabled='true' snapvisiblegridlinesonly='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g transform='translate(-182,-490)' inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline'/> - <g transform='translate(-182,-490)' inkscape:groupmode='layer' id='layer10' inkscape:label='devices'/> - <g transform='translate(-182,-490)' inkscape:groupmode='layer' id='layer11' inkscape:label='apps'> - <path d='m 190,490 c -4.4147,0 -8,3.5853 -8,8 0,4.4147 3.5853,8 8,8 4.4147,0 8,-3.5853 8,-8 0,-4.4147 -3.5853,-8 -8,-8 z m 0,2 c 3.3413,0 6,2.6587 6,6 0,3.3413 -2.6587,6 -6,6 -3.3413,0 -6,-2.6587 -6,-6 0,-3.3413 2.6587,-6 6,-6 z' id='rect11749-5-0-3' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#bebebe;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans'/> - - <path d='M 189.34375,495 C 188.05763,495 187,496.05763 187,497.34375 l 0,1.3125 c 0,1.28612 1.05763,2.34375 2.34375,2.34375 l 1.3125,0 C 191.94237,501 193,499.94237 193,498.65625 l 0,-1.3125 C 193,496.05763 191.94237,495 190.65625,495 l -1.3125,0 z m 0,1 1.3125,0 c 0.74942,0 1.34375,0.59433 1.34375,1.34375 l 0,1.3125 C 192,499.40567 191.40567,500 190.65625,500 l -1.3125,0 C 188.59433,500 188,499.40567 188,498.65625 l 0,-1.3125 C 188,496.59433 188.59433,496 189.34375,496 z' id='rect11749-5-0-3-3' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#bebebe;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:0.99999994;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans'/> - <path inkscape:connector-curvature='0' d='m 186.71875,491.4375 c -1.51031,0.6073 -2.6811,1.7985 -3.28125,3.3125 l 3.75,1.875 c 0.25196,-0.64029 0.74249,-1.17056 1.375,-1.4375 l -1.84375,-3.75 z m 6.5625,0 -1.84375,3.75 c 0.63251,0.26694 1.12304,0.79721 1.375,1.4375 l 3.75,-1.875 c -0.60015,-1.514 -1.77094,-2.7052 -3.28125,-3.3125 z m -6.09375,8 -3.75,1.875 c 0.60709,1.48862 1.78896,2.64995 3.28125,3.25 l 1.875,-3.75 c -0.62682,-0.25556 -1.14334,-0.75203 -1.40625,-1.375 z m 5.625,0 c -0.26291,0.62297 -0.77943,1.11944 -1.40625,1.375 l 1.875,3.75 c 1.49229,-0.60005 2.67416,-1.76138 3.28125,-3.25 l -3.75,-1.875 z' id='path4624' style='fill:#bebebe;fill-opacity:1;stroke:none'/> - </g> - <g transform='translate(-182,-490)' inkscape:groupmode='layer' id='layer12' inkscape:label='actions'/> - <g transform='translate(-182,-490)' inkscape:groupmode='layer' id='layer13' inkscape:label='places'/> - <g transform='translate(-182,-490)' inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes'/> - <g transform='translate(-182,-490)' inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline'/> - <g transform='translate(-182,-490)' inkscape:groupmode='layer' id='g4953' inkscape:label='categories' style='display:inline'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-182,-490)" fill="#bebebe"> +<path style="block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m190,490c-4.4147,0-8,3.5853-8,8s3.5853,8,8,8,8-3.5853,8-8-3.5853-8-8-8zm0,2c3.3413,0,6,2.6587,6,6s-2.6587,6-6,6-6-2.6587-6-6,2.6587-6,6-6z"/> +<path style="block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="M189.34,495c-1.28,0-2.34,1.06-2.34,2.34v1.3125c0,1.2861,1.0576,2.3438,2.3438,2.3438h1.3125c1.29,0.01,2.35-1.05,2.35-2.33v-1.3125c0-1.29-1.06-2.35-2.34-2.35h-1.3125zm0,1,1.3125,0c0.74942,0,1.3438,0.59433,1.3438,1.3438v1.3125c0.01,0.76-0.58,1.35-1.33,1.35h-1.3125c-0.76,0-1.35-0.59-1.35-1.34v-1.3125c0-0.76,0.59-1.35,1.34-1.35z"/> +<path d="m186.72,491.44c-1.5103,0.6073-2.6811,1.7985-3.2812,3.3125l3.75,1.875c0.25196-0.64029,0.74249-1.1706,1.375-1.4375l-1.8438-3.75zm6.5625,0-1.8438,3.75c0.63251,0.26694,1.123,0.79721,1.375,1.4375l3.75-1.875c-0.60015-1.514-1.7709-2.7052-3.2812-3.3125zm-6.0938,8-3.75,1.875c0.60709,1.4886,1.789,2.65,3.2812,3.25l1.875-3.75c-0.62682-0.25556-1.1433-0.75203-1.4062-1.375zm5.625,0c-0.26291,0.62297-0.77943,1.1194-1.4062,1.375l1.875,3.75c1.4923-0.60005,2.6742-1.7614,3.2812-3.25l-3.75-1.875z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/icon.svg b/p/themes/icons/icon.svg index 742c04b6e..caa987dac 100644 --- a/p/themes/icons/icon.svg +++ b/p/themes/icons/icon.svg @@ -1,9 +1,6 @@ -<?xml version="1.0" encoding="UTF-8"?> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"> <title>Logo FreshRSS</title> - <circle fill="#0062BE" cx="128" cy="128" r="33"/> - <g fill="none" stroke="#0062BE" stroke-width="24"> <g stroke-opacity="0.3"> <path d="M12,128 A116,116 0 1,1 128,244"/> diff --git a/p/themes/icons/import.svg b/p/themes/icons/import.svg new file mode 100644 index 000000000..18a54ab59 --- /dev/null +++ b/p/themes/icons/import.svg @@ -0,0 +1 @@ +<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" height="16" width="16"><g transform="translate(-80,-648)"/><g transform="translate(-80,-648)"/><g transform="translate(-80,-648)"/><g transform="translate(-80,-648)"><path d="m84.406 657a0.5 0.5 0 0 0-0.312 0.219l-1 1.5a0.5 0.5 0 1 0 0.813 0.563l1-1.5A0.5 0.5 0 0 0 84.406 657zm7 0a0.5 0.5 0 0 0-0.312 0.781l1 1.5a0.5 0.5 0 1 0 0.813-0.562l-1-1.5A0.5 0.5 0 0 0 91.406 657z" style="-inkscape-font-specification:Sans;baseline-shift:baseline;block-progression:tb;direction:ltr;fill:#ffffff;font-family:Sans;font-size:medium;letter-spacing:normal;line-height:normal;text-align:start;text-anchor:start;text-decoration:none;text-indent:0;text-transform:none;word-spacing:normal;writing-mode:lr-tb"/><g transform="translate(-80,110)"><path d="m167 539 0 5.563-1.281-1.281C165.531 543.093 165.265 543 165 543l-1 0 0 1c0 0.265 0.093 0.531 0.281 0.719l3 3 0.281 0.281 0.875 0 0.281-0.281 3-3C171.907 544.531 172 544.265 172 544l0-1-1 0c-0.265 0-0.531 0.093-0.719 0.281L169 544.563 169 539z" style="-inkscape-font-specification:Bitstream Vera Sans;block-progression:tb;direction:ltr;fill:#ffffff;font-family:Bitstream Vera Sans;font-size:medium;letter-spacing:normal;line-height:normal;text-align:start;text-anchor:start;text-decoration:none;text-indent:0;text-transform:none;word-spacing:normal;writing-mode:lr-tb"/><path d="m163 549 0 4 10 0 0-4zm3.344 1.438c0.021-0.001 0.042-0.001 0.063 0 0.291-0.056 0.599 0.204 0.594 0.5l0 0.063 2 0 0-0.062c-0.004-0.264 0.236-0.507 0.5-0.507 0.264 0 0.504 0.243 0.5 0.507L170 551c0 0.545-0.455 1-1 1l-2 0c-0.545 0-1-0.455-1-1l0-0.062c-0.011-0.217 0.137-0.432 0.344-0.5z" fill="#ffffff"/></g></g><g transform="translate(-80,-648)"/><g transform="translate(-80,-648)"/><g transform="translate(-80,-648)"/></svg> diff --git a/p/themes/icons/key.svg b/p/themes/icons/key.svg new file mode 100644 index 000000000..9193f4552 --- /dev/null +++ b/p/themes/icons/key.svg @@ -0,0 +1,7 @@ +<svg xmlns="http://www.w3.org/2000/svg"> +<g transform="translate(-340.99994,-257)" fill="#666666"> +<path style="block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m346,260c-2.7496,0-5,2.2504-5,5s2.2504,5,5,5c1.5862,0,2.9034-0.84459,3.8125-2h4.8438,0.75l0.21875-0.75,1.0312-4,0.3125-1.25h-1.2812-5.875c-0.90914-1.1554-2.2263-2-3.8125-2zm0,2c1.1158,0,2.0379,0.59507,2.5625,1.5l0.3125,0.5h0.5625,4.9688l-0.53125,2h-4.4375-0.5625l-0.3125,0.5c-0.52462,0.90493-1.4466,1.5-2.5625,1.5-1.6687,0-3-1.3313-3-3s1.3313-3,3-3z"/> +<path opacity="0.35" style="enable-background:accumulate;color:#000000;" d="M355.5,265,350,265,349.44,267,355,267z" fill-rule="nonzero"/> +<path style="enable-background:accumulate;color:#000000;" d="m346,265c0,0.55228-0.44772,1-1,1s-1-0.44772-1-1,0.44772-1,1-1,1,0.44772,1,1z" fill-rule="nonzero"/> +</g> +</svg> diff --git a/p/themes/icons/link.svg b/p/themes/icons/link.svg index ddc8e0706..e5290af76 100644 --- a/p/themes/icons/link.svg +++ b/p/themes/icons/link.svg @@ -1,33 +1,7 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' id='svg7384' sodipodi:docname='web-browser-symbolic.svg' version='1.1' inkscape:version='0.48.1 r9760' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:cc='http://creativecommons.org/ns#' xmlns:svg='http://www.w3.org/2000/svg' width='16' xmlns='http://www.w3.org/2000/svg' height='16.00366'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:object-paths='false' inkscape:current-layer='layer11' inkscape:bbox-paths='false' inkscape:pageshadow='2' inkscape:snap-bbox='true' inkscape:pageopacity='1' inkscape:guide-bbox='true' pagecolor='#555753' bordercolor='#666666' showguides='true' inkscape:snap-bbox-midpoints='false' inkscape:window-maximized='0' inkscape:snap-grids='true' inkscape:window-width='1595' id='namedview88' inkscape:window-x='2191' inkscape:window-y='111' gridtolerance='10' borderopacity='1' showgrid='false' inkscape:cx='21.026784' inkscape:cy='2.9913602' inkscape:snap-nodes='false' inkscape:window-height='1162' inkscape:snap-global='true' inkscape:object-nodes='false' objecttolerance='10' inkscape:snap-others='false' inkscape:zoom='1' guidetolerance='10' inkscape:snap-to-guides='true' showborder='false'> - <inkscape:grid enabled='true' type='xygrid' id='grid4866' visible='true' snapvisiblegridlinesonly='true' empspacing='2' spacingx='1px' spacingy='1px'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g style='display:inline' inkscape:groupmode='layer' id='layer9' inkscape:label='status' transform='translate(-183,-529)'/> - <g inkscape:groupmode='layer' id='layer10' inkscape:label='devices' transform='translate(-183,-529)'/> - <g inkscape:groupmode='layer' id='layer11' inkscape:label='apps' transform='translate(-183,-529)'> - - <path style='color:#000000;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:block;overflow:visible;enable-background:accumulate' sodipodi:nodetypes='cccccccc' id='path6242' inkscape:connector-curvature='0' d='m 191.0002,533.84553 0,10.38049 -2.34399,-2.28818 -1.33941,2.73465 c -0.32808,0.73962 -2.03368,0.14492 -1.5487,-0.84412 l 1.32547,-2.83928 -2.95789,0 6.86452,-7.14356 z'/> - <path style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans' sodipodi:nodetypes='csccssccsssc' id='path23405' inkscape:connector-curvature='0' d='m 190.15645,530.0625 c -3.82659,0.46006 -6.57883,3.95775 -6.09375,7.78125 0.13127,1.03473 0.29377,1.38184 0.29377,1.38184 l 1.67498,-1.63184 c -0.33104,-2.75343 1.62156,-5.23146 4.375,-5.5625 2.75344,-0.33104 5.23146,1.62156 5.5625,4.375 0.31355,2.60795 -1.39127,5.02493 -3.96875,5.53125 l 0.0312,2 c 0,0 0.52086,-0.1059 0.62354,-0.13097 3.41561,-0.83385 5.70627,-4.1273 5.28271,-7.65028 -0.46006,-3.8266 -3.95466,-6.55381 -7.78125,-6.09375 z'/> - <path style='opacity:0.3;color:#000000;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate' id='path11289' inkscape:connector-curvature='0' d='m 187.11293,536.81497 0,-0.20574 -0.19826,0.0186 c 0.0165,-0.13095 0.0329,-0.26167 0.0496,-0.3926 l -0.11578,0 -0.11556,0.14959 -0.11578,0.0559 -0.1653,-0.0932 -0.0165,-0.20575 0.0331,-0.22438 0.24798,-0.18688 0.19826,0 0.0329,-0.11229 0.24786,0.0559 0.18183,0.2246 0.0331,-0.37419 0.31401,-0.26167 0.11567,-0.28055 0.23133,-0.0934 0.1322,-0.18688 0.29738,-0.0564 0.14885,-0.22415 c -0.14874,0 -0.29749,0 -0.44623,0 l 0.28094,-0.13095 0.19814,0 0.28106,-0.0937 0.0331,-0.11186 -0.0992,-0.0937 -0.11567,-0.0375 0.0331,-0.11208 -0.0826,-0.16822 -0.19837,0.0746 0.0331,-0.14947 -0.23134,-0.13096 -0.18171,0.3177 0.0165,0.11229 -0.18171,0.075 -0.11578,0.24302 -0.0495,-0.22438 -0.31402,-0.13095 -0.0496,-0.16822 0.41315,-0.24325 0.18182,-0.16822 0.0165,-0.20563 -0.0991,-0.0562 -0.13219,-0.0188 -0.0826,0.20575 c 0,0 -0.1382,0.0271 -0.17373,0.0358 -0.45378,0.41804 -1.37066,1.32044 -1.58368,3.02405 0.008,0.0395 0.15441,0.26854 0.15441,0.26854 l 0.347,0.20552 0.347,0.0937 m 3.96609,-4.30034 -0.4298,-0.16833 -0.49552,0.0561 -0.61161,0.16822 -0.11567,0.11229 0.38008,0.26167 0,0.14959 -0.14875,0.14959 0.19846,0.39294 0.13188,-0.075 0.16561,-0.26168 c 0.2553,-0.0789 0.4842,-0.16833 0.72686,-0.28053 l 0.19846,-0.5048 m 2.52925,0.34192 -0.375,0.0937 -0.21875,0.15625 0,0.125 -0.375,0.25 0.0937,0.34375 0.21875,-0.15625 0.125,0.15625 0.15625,0.0937 0.0937,-0.28125 -0.0625,-0.15625 0.0625,-0.0937 0.21875,-0.1875 0.0937,0 -0.0937,0.21875 0,0.1875 c 0.0892,-0.0242 0.1588,-0.051 0.25,-0.0625 l -0.25,0.1875 0,0.125 -0.3125,0.21875 -0.28125,-0.0625 0,-0.15625 -0.125,0.0625 0.0625,0.15625 -0.21875,0 -0.125,0.21875 -0.15625,0.15625 -0.0937,0.0312 0,0.1875 0.0312,0.15625 -0.0312,0 0,0.53125 0.0625,-0.0312 0.0937,-0.21875 0.1875,-0.125 0.0312,-0.0937 0.28125,-0.0625 0.15625,0.1875 0.1875,0.0937 -0.0937,0.1875 0.15625,-0.0312 0.0625,-0.21875 -0.1875,-0.21875 0.0625,0 0.21875,0.15625 0.0312,0.21875 0.15625,0.21875 0.0625,-0.3125 0.0937,-0.0312 c 0.0959,0.0996 0.1692,0.23163 0.25,0.34375 l 0.28125,0 0.1875,0.125 -0.0937,0.0937 -0.15625,0.15625 -0.25,0 -0.34375,-0.0937 -0.1875,0 -0.125,0.15625 -0.34375,-0.375 -0.25,-0.0625 -0.375,0.0625 -0.15625,0.0937 0,2.40625 0.0312,0.0312 0.25,-0.15625 0.0937,0.0937 0.28125,0 0.125,0.15625 -0.0937,0.3125 0.1875,0.1875 0,0.375 0.125,0.25 -0.0937,0.25 c -0.009,0.16159 0,0.30714 0,0.46875 0.0795,0.21894 0.14355,0.43575 0.21875,0.65625 l 0.0625,0.34375 0,0.1875 0.125,0 0.21875,-0.125 0.25,0 0.375,-0.4375 -0.0312,-0.15625 0.25,-0.21875 -0.1875,-0.1875 0.21875,-0.1875 0.21875,-0.125 0.0937,-0.125 -0.0625,-0.25 0,-0.59375 0.1875,-0.375 0.1875,-0.25 0.25,-0.5625 0,-0.15625 c -0.11654,0.0146 -0.22972,0.0231 -0.34375,0.0312 -0.0722,0.005 -0.14446,0 -0.21875,0 -0.12359,-0.25961 -0.2183,-0.50966 -0.3125,-0.78125 l -0.15625,-0.1875 -0.0937,-0.3125 0.0625,-0.0625 0.21875,0.25 0.25,0.5625 0.15625,0.15625 -0.0625,0.21875 0.15625,0.15625 0.25,-0.25 0.3125,-0.21875 0.15625,-0.1875 0,-0.21875 c -0.0389,-0.0732 -0.0547,-0.14545 -0.0937,-0.21875 l -0.15625,0.1875 -0.125,-0.15625 -0.1875,-0.125 0,-0.28125 0.21875,0.21875 0.21875,-0.0312 c 0.10166,0.0923 0.19205,0.20751 0.28125,0.3125 l 0.15625,-0.1875 c 0,-0.17463 -0.19976,-1.02044 -0.625,-1.75 -0.42526,-0.72932 -1.15625,-1.40625 -1.15625,-1.40625 l -0.0625,0.0937 -0.21875,0.21875 -0.25,-0.25 0.25,0 0.125,-0.125 -0.46875,-0.0937 -0.25,-0.0937 z'/> - </g> - <g inkscape:groupmode='layer' id='layer13' inkscape:label='places' transform='translate(-183,-529)'/> - <g inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes' transform='translate(-183,-529)'/> - <g style='display:inline' inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' transform='translate(-183,-529)'/> - <g style='display:inline' inkscape:groupmode='layer' id='g71291' inkscape:label='emotes' transform='translate(-183,-529)'/> - <g style='display:inline' inkscape:groupmode='layer' id='g4953' inkscape:label='categories' transform='translate(-183,-529)'/> - <g style='display:inline' inkscape:groupmode='layer' id='layer12' inkscape:label='actions' transform='translate(-183,-529)'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16.004" width="16"> +<g fill="#bebebe" transform="translate(-183,-529)"> +<path style="enable-background:accumulate;color:#000000;" d="m191,533.85,0,10.38-2.344-2.2882-1.3394,2.7346c-0.32808,0.73962-2.0337,0.14492-1.5487-0.84412l1.3255-2.8393h-2.9579l6.8645-7.1436z" fill-rule="nonzero" display="block"/> +<path d="m190.16,530.06c-3.8266,0.46006-6.5788,3.9578-6.0938,7.7812,0.13127,1.0347,0.29377,1.3818,0.29377,1.3818l1.675-1.6318c-0.33104-2.7534,1.6216-5.2315,4.375-5.5625,2.7534-0.33104,5.2315,1.6216,5.5625,4.375,0.31355,2.608-1.3913,5.0249-3.9688,5.5312l0.0312,2s0.52086-0.1059,0.62354-0.13097c3.4156-0.83385,5.7063-4.1273,5.2827-7.6503-0.46006-3.8266-3.9547-6.5538-7.7812-6.0938z" style="baseline-shift:baseline;block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;"/> +<path opacity="0.3" style="enable-background:accumulate;color:#000000;" d="m187.11,536.81,0-0.20574-0.19826,0.0186c0.0165-0.13095,0.0329-0.26167,0.0496-0.3926h-0.11578l-0.11556,0.14959-0.11578,0.0559-0.1653-0.0932-0.0165-0.20575,0.0331-0.22438,0.24798-0.18688h0.19826l0.0329-0.11229,0.24786,0.0559,0.18183,0.2246,0.0331-0.37419,0.31401-0.26167,0.11567-0.28055,0.23133-0.0934,0.1322-0.18688,0.29738-0.0564,0.14885-0.22415h-0.44623l0.28094-0.13095h0.19814l0.28106-0.0937,0.0331-0.11186-0.0992-0.0937-0.11567-0.0375,0.0331-0.11208-0.0826-0.16822-0.19837,0.0746,0.0331-0.14947-0.23134-0.13096-0.18171,0.3177,0.0165,0.11229-0.18171,0.075-0.11578,0.24302-0.0495-0.22438-0.31402-0.13095-0.0496-0.16822,0.41315-0.24325,0.18182-0.16822,0.0165-0.20563-0.0991-0.0562-0.13219-0.0188-0.0826,0.20575s-0.1382,0.0271-0.17373,0.0358c-0.45378,0.41804-1.3707,1.3204-1.5837,3.024,0.008,0.0395,0.15441,0.26854,0.15441,0.26854l0.347,0.20552,0.347,0.0937m3.9661-4.3003-0.4298-0.16833-0.49552,0.0561-0.61161,0.16822-0.11567,0.11229,0.38008,0.26167,0,0.14959-0.14875,0.14959,0.19846,0.39294,0.13188-0.075,0.16561-0.26168c0.2553-0.0789,0.4842-0.16833,0.72686-0.28053l0.19846-0.5048m2.5292,0.34192-0.375,0.0937-0.21875,0.15625,0,0.125-0.375,0.25,0.0937,0.34375,0.21875-0.15625,0.125,0.15625,0.15625,0.0937,0.0937-0.28125-0.0625-0.15625,0.0625-0.0937,0.21875-0.1875,0.0937,0-0.0937,0.21875,0,0.1875c0.0892-0.0242,0.1588-0.051,0.25-0.0625l-0.25,0.1875v0.125l-0.3125,0.21875-0.28125-0.0625v-0.15625l-0.125,0.0625,0.0625,0.15625h-0.21875l-0.125,0.21875-0.15625,0.15625-0.0937,0.0312v0.1875l0.0312,0.15625h-0.0312v0.53125l0.0625-0.0312,0.0937-0.21875,0.1875-0.125,0.0312-0.0937,0.28125-0.0625,0.15625,0.1875,0.1875,0.0937-0.0937,0.1875,0.15625-0.0312,0.0625-0.21875-0.1875-0.21875h0.0625l0.21875,0.15625,0.0312,0.21875,0.15625,0.21875,0.0625-0.3125,0.0937-0.0312c0.0959,0.0996,0.1692,0.23163,0.25,0.34375h0.28125l0.1875,0.125-0.0937,0.0937-0.15625,0.15625h-0.25l-0.34375-0.0937h-0.1875l-0.125,0.15625-0.34375-0.375-0.25-0.0625-0.375,0.0625-0.15625,0.0937v2.4062l0.0312,0.0312,0.25-0.15625,0.0937,0.0937h0.28125l0.125,0.15625-0.0937,0.3125,0.1875,0.1875v0.375l0.125,0.25-0.0937,0.25c-0.009,0.16159,0,0.30714,0,0.46875,0.0795,0.21894,0.14355,0.43575,0.21875,0.65625l0.0625,0.34375v0.1875h0.125l0.21875-0.125h0.25l0.375-0.4375-0.0312-0.15625,0.25-0.21875-0.1875-0.1875,0.21875-0.1875,0.21875-0.125,0.0937-0.125-0.0625-0.25v-0.59375l0.1875-0.375,0.1875-0.25,0.25-0.5625v-0.15625c-0.11654,0.0146-0.22972,0.0231-0.34375,0.0312-0.0722,0.005-0.14446,0-0.21875,0-0.12359-0.25961-0.2183-0.50966-0.3125-0.78125l-0.15625-0.1875-0.0937-0.3125,0.0625-0.0625,0.21875,0.25,0.25,0.5625,0.15625,0.15625-0.0625,0.21875,0.15625,0.15625,0.25-0.25,0.3125-0.21875,0.15625-0.1875v-0.21875c-0.0389-0.0732-0.0547-0.14545-0.0937-0.21875l-0.15625,0.1875-0.125-0.15625-0.1875-0.125v-0.28125l0.21875,0.21875,0.21875-0.0312c0.10166,0.0923,0.19205,0.20751,0.28125,0.3125l0.15625-0.1875c0-0.17463-0.19976-1.0204-0.625-1.75-0.42526-0.72932-1.1562-1.4062-1.1562-1.4062l-0.0625,0.0937-0.21875,0.21875-0.25-0.25h0.25l0.125-0.125-0.46875-0.0937-0.25-0.0937z" fill-rule="nonzero"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/login.svg b/p/themes/icons/login.svg index 0a8af162f..954a0b74b 100644 --- a/p/themes/icons/login.svg +++ b/p/themes/icons/login.svg @@ -1,33 +1,6 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:svg='http://www.w3.org/2000/svg' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' sodipodi:docname='changes-prevent-symbolic.svg' version='1.1' inkscape:version='0.48.1 r9760' height='16' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:cy='9.416826' pagecolor='#555753' borderopacity='1' showborder='false' inkscape:bbox-paths='false' guidetolerance='10' inkscape:object-paths='true' inkscape:window-width='1296' showguides='true' inkscape:object-nodes='true' inkscape:snap-bbox='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:snap-nodes='false' bordercolor='#666666' objecttolerance='10' id='namedview88' showgrid='false' inkscape:window-maximized='0' inkscape:window-x='1941' inkscape:snap-global='true' inkscape:window-y='81' gridtolerance='10' inkscape:window-height='1013' inkscape:snap-to-guides='true' inkscape:current-layer='layer9' inkscape:snap-bbox-midpoints='false' inkscape:zoom='1' inkscape:cx='52.563336' inkscape:snap-grids='true' inkscape:pageopacity='1'> - <inkscape:grid spacingx='1px' spacingy='1px' id='grid4866' empspacing='2' enabled='true' type='xygrid' snapvisiblegridlinesonly='true' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:label='status' transform='translate(-181.0002,-237)' inkscape:groupmode='layer' id='layer9' style='display:inline'> - <g inkscape:label='lock' transform='translate(161.0002,-39)' id='g4053' style='fill:#bebebe;fill-opacity:1'> - - </g> - <path inkscape:connector-curvature='0' d='m 184,244 c -0.554,0 -1,0.446 -1,1 l 0,0.53125 0,5.46875 12,0 0,-5.46875 L 195,245 c 0,-0.554 -0.446,-1 -1,-1 l -10,0 z' id='rect4063' sodipodi:nodetypes='csccccscc' style='color:#bebebe;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible'/> - <path inkscape:connector-curvature='0' d='m 188,238 c -1.6447,0 -3,1.3553 -3,3 l 0,7 c 0,1.6447 1.3553,3 3,3 l 2,0 c 1.6447,0 3,-1.3553 3,-3 l 0,-7 c 0,-1.6447 -1.3553,-3 -3,-3 l -2,0 z m 0,2 2,0 c 0.5713,0 1,0.4287 1,1 l 0,7 c 0,0.5713 -0.4287,1 -1,1 l -2,0 c -0.5713,0 -1,-0.4287 -1,-1 l 0,-7 c 0,-0.5713 0.4287,-1 1,-1 z' id='rect4291' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#bebebe;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans'/> - </g> - <g inkscape:label='devices' transform='translate(-181.0002,-237)' inkscape:groupmode='layer' id='layer10'/> - <g inkscape:label='apps' transform='translate(-181.0002,-237)' inkscape:groupmode='layer' id='layer11'/> - <g inkscape:label='actions' transform='translate(-181.0002,-237)' inkscape:groupmode='layer' id='layer12'/> - <g inkscape:label='places' transform='translate(-181.0002,-237)' inkscape:groupmode='layer' id='layer13'/> - <g inkscape:label='mimetypes' transform='translate(-181.0002,-237)' inkscape:groupmode='layer' id='layer14'/> - <g inkscape:label='emblems' transform='translate(-181.0002,-237)' inkscape:groupmode='layer' id='layer15' style='display:inline'/> - <g inkscape:label='categories' transform='translate(-181.0002,-237)' inkscape:groupmode='layer' id='g4953' style='display:inline'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-181.0002,-237)" fill="#bebebe"> +<path style="color:#bebebe;" d="m184,244c-0.554,0-1,0.446-1,1v0.53125,5.4688h12v-5.4688-0.53c0-0.554-0.446-1-1-1h-10z" fill-rule="nonzero"/> +<path style="baseline-shift:baseline;block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m188,238c-1.6447,0-3,1.3553-3,3v7c0,1.6447,1.3553,3,3,3h2c1.6447,0,3-1.3553,3-3v-7c0-1.6447-1.3553-3-3-3h-2zm0,2,2,0c0.5713,0,1,0.4287,1,1v7c0,0.5713-0.4287,1-1,1h-2c-0.5713,0-1-0.4287-1-1v-7c0-0.5713,0.4287-1,1-1z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/logout.svg b/p/themes/icons/logout.svg index 284a67578..8dd4ef08b 100644 --- a/p/themes/icons/logout.svg +++ b/p/themes/icons/logout.svg @@ -1,33 +1,6 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:svg='http://www.w3.org/2000/svg' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' sodipodi:docname='changes-allow-symbolic.svg' version='1.1' inkscape:version='0.48.1 r9760' height='16' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:cy='9.416826' pagecolor='#555753' borderopacity='1' showborder='false' inkscape:bbox-paths='false' guidetolerance='10' inkscape:object-paths='true' inkscape:window-width='1296' showguides='true' inkscape:object-nodes='true' inkscape:snap-bbox='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:snap-nodes='false' bordercolor='#666666' objecttolerance='10' id='namedview88' showgrid='false' inkscape:window-maximized='0' inkscape:window-x='1941' inkscape:snap-global='true' inkscape:window-y='81' gridtolerance='10' inkscape:window-height='1013' inkscape:snap-to-guides='true' inkscape:current-layer='layer9' inkscape:snap-bbox-midpoints='false' inkscape:zoom='1' inkscape:cx='32.563336' inkscape:snap-grids='true' inkscape:pageopacity='1'> - <inkscape:grid spacingx='1px' spacingy='1px' id='grid4866' empspacing='2' enabled='true' type='xygrid' snapvisiblegridlinesonly='true' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:label='status' transform='translate(-201.0002,-237)' inkscape:groupmode='layer' id='layer9' style='display:inline'> - <g inkscape:label='lock' transform='translate(181.0002,-39)' id='g4053-3' style='fill:#bebebe;fill-opacity:1'> - - </g> - <path inkscape:connector-curvature='0' d='m 204,246 c -0.554,0 -1,0.446 -1,1 l 0,0.53125 0,5.46875 12,0 0,-5.46875 L 215,247 c 0,-0.554 -0.446,-1 -1,-1 l -10,0 z' id='rect4063-6' sodipodi:nodetypes='csccccscc' style='color:#bebebe;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible'/> - <path inkscape:connector-curvature='0' d='m 208.0002,237 c -1.64469,0 -3,1.35529 -3,3 l 0,3 2,0 0,-3 c 0,-0.57129 0.42873,-1 1,-1 l 2,0 c 0.57127,0 1,0.42871 1,1 l 0,7 2,0 0,-7 c 0,-1.64471 -1.35531,-3 -3,-3 l -2,0 z' id='rect4291-4' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#bebebe;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans'/> - </g> - <g inkscape:label='devices' transform='translate(-201.0002,-237)' inkscape:groupmode='layer' id='layer10'/> - <g inkscape:label='apps' transform='translate(-201.0002,-237)' inkscape:groupmode='layer' id='layer11'/> - <g inkscape:label='actions' transform='translate(-201.0002,-237)' inkscape:groupmode='layer' id='layer12'/> - <g inkscape:label='places' transform='translate(-201.0002,-237)' inkscape:groupmode='layer' id='layer13'/> - <g inkscape:label='mimetypes' transform='translate(-201.0002,-237)' inkscape:groupmode='layer' id='layer14'/> - <g inkscape:label='emblems' transform='translate(-201.0002,-237)' inkscape:groupmode='layer' id='layer15' style='display:inline'/> - <g inkscape:label='categories' transform='translate(-201.0002,-237)' inkscape:groupmode='layer' id='g4953' style='display:inline'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-201.0002,-237)" fill="#bebebe"> +<path style="color:#bebebe;" d="m204,246c-0.554,0-1,0.446-1,1v0.53125,5.4688h12v-5.4688-0.53c0-0.554-0.446-1-1-1h-10z" fill-rule="nonzero"/> +<path style="baseline-shift:baseline;block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m208,237c-1.6447,0-3,1.3553-3,3v3h2v-3c0-0.57129,0.42873-1,1-1h2c0.57127,0,1,0.42871,1,1v7h2v-7c0-1.6447-1.3553-3-3-3h-2z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/next.svg b/p/themes/icons/next.svg index 72637b4e6..d504d096c 100644 --- a/p/themes/icons/next.svg +++ b/p/themes/icons/next.svg @@ -1,31 +1,5 @@ -<?xml version='1.0' encoding='UTF-8' standalone='no'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' sodipodi:docname='go-next-symbolic.svg' height='16' id='svg7384' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:svg='http://www.w3.org/2000/svg' inkscape:version='0.48.4 r9939' version='1.1' width='16' xmlns='http://www.w3.org/2000/svg'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:bbox-nodes='false' inkscape:bbox-paths='true' bordercolor='#666666' borderopacity='1' inkscape:current-layer='layer12' inkscape:cx='78.648774' inkscape:cy='9.99302' gridtolerance='10' inkscape:guide-bbox='true' guidetolerance='10' id='namedview88' inkscape:object-nodes='false' inkscape:object-paths='false' objecttolerance='10' pagecolor='#3a3b39' inkscape:pageopacity='1' inkscape:pageshadow='2' showborder='false' showgrid='false' showguides='true' inkscape:snap-bbox='true' inkscape:snap-bbox-midpoints='false' inkscape:snap-global='true' inkscape:snap-grids='true' inkscape:snap-nodes='false' inkscape:snap-others='false' inkscape:snap-to-guides='true' inkscape:window-height='1408' inkscape:window-maximized='1' inkscape:window-width='2560' inkscape:window-x='0' inkscape:window-y='0' inkscape:zoom='1'> - <inkscape:grid empspacing='2' enabled='true' id='grid4866' originx='120px' originy='530px' snapvisiblegridlinesonly='true' spacingx='1px' spacingy='1px' type='xygrid' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline' transform='translate(-121.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer10' inkscape:label='devices' transform='translate(-121.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer11' inkscape:label='apps' transform='translate(-121.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer13' inkscape:label='places' transform='translate(-121.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes' transform='translate(-121.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline' transform='translate(-121.0002,-747)'/> - <g inkscape:groupmode='layer' id='g71291' inkscape:label='emotes' style='display:inline' transform='translate(-121.0002,-747)'/> - <g inkscape:groupmode='layer' id='g4953' inkscape:label='categories' style='display:inline' transform='translate(-121.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer12' inkscape:label='actions' style='display:inline' transform='translate(-121.0002,-747)'> - - <path inkscape:connector-curvature='0' d='m 125.0004,749 1,0 c 0.0104,-1.2e-4 0.0208,-4.6e-4 0.0313,0 0.25495,0.0112 0.50987,0.12858 0.6875,0.3125 l 6.29767,5.71875 -6.29772,5.71875 c -0.18816,0.18819 -0.45346,0.28125 -0.71875,0.28125 l -1,0 0,-1 c 0,-0.26529 0.0931,-0.53058 0.28125,-0.71875 l 4.82897,-4.28125 -4.82897,-4.28125 c -0.21074,-0.19463 -0.30316,-0.46925 -0.28125,-0.75 z' id='path10839-9-9-5-9' sodipodi:nodetypes='ccsccccccccccc' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#bebebe;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78124988;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new;font-family:Andale Mono;-inkscape-font-specification:Andale Mono'/> - </g> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-121.0002,-747)"> +<path style="block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:new;text-transform:none;" d="m125,749,1,0c0.0104-0.00012,0.0208-0.00046,0.0313,0,0.25495,0.0112,0.50987,0.12858,0.6875,0.3125l6.2977,5.7188-6.2977,5.7188c-0.18816,0.18819-0.45346,0.28125-0.71875,0.28125h-1v-1c0-0.26529,0.0931-0.53058,0.28125-0.71875l4.829-4.2812-4.829-4.2812c-0.21074-0.19463-0.30316-0.46925-0.28125-0.75z" fill-rule="nonzero" fill="#bebebe"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/non-starred.svg b/p/themes/icons/non-starred.svg index 346717f78..4ebcfccbd 100644 --- a/p/themes/icons/non-starred.svg +++ b/p/themes/icons/non-starred.svg @@ -1,32 +1,5 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:svg='http://www.w3.org/2000/svg' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' sodipodi:docname='non-starred-symbolic.svg' version='1.1' inkscape:version='0.48.1 r9760' height='16' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:cy='0.50817' pagecolor='#555753' borderopacity='1' showborder='false' inkscape:bbox-paths='false' guidetolerance='10' inkscape:object-paths='true' inkscape:window-width='1457' showguides='true' inkscape:object-nodes='true' inkscape:snap-bbox='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:snap-nodes='false' bordercolor='#666666' objecttolerance='10' id='namedview88' showgrid='false' inkscape:window-maximized='0' inkscape:window-x='86' inkscape:snap-global='true' inkscape:window-y='51' gridtolerance='10' inkscape:window-height='1093' inkscape:snap-to-guides='true' inkscape:current-layer='layer9' inkscape:snap-bbox-midpoints='false' inkscape:zoom='1' inkscape:cx='-0.97094164' inkscape:snap-grids='true' inkscape:pageopacity='1'> - <inkscape:grid spacingx='1px' spacingy='1px' id='grid4866' empspacing='2' enabled='true' type='xygrid' snapvisiblegridlinesonly='true' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:label='status' transform='translate(-61.000202,-397)' inkscape:groupmode='layer' id='layer9' style='display:inline'> - <g inkscape:label='folder-remote' transform='translate(-166.9996,-599)' id='g5516'> - - </g> - <path inkscape:connector-curvature='0' d='m 69.002994,398.0051 c -0.2659,-9.9e-4 -0.498591,0.1006 -0.664702,0.2393 -0.166111,0.13869 -0.277415,0.32137 -0.389683,0.50028 -0.224526,0.35782 -0.392692,0.76873 -0.565462,1.20357 -0.17277,0.43483 -0.347131,0.88766 -0.504599,1.23232 -0.157468,0.34465 -0.345596,0.57871 -0.35862,0.58776 -0.01287,0.009 -0.307217,0.117 -0.695765,0.15181 -0.388547,0.0348 -0.881219,0.0492 -1.36324,0.0694 -0.482021,0.0202 -0.970296,0.0362 -1.393042,0.12817 -0.211377,0.046 -0.4154,0.10148 -0.604343,0.20956 -0.188943,0.10808 -0.366894,0.28631 -0.450041,0.53002 -0.08315,0.24371 -0.04901,0.50627 0.03636,0.70157 0.08537,0.19531 0.226562,0.36514 0.368205,0.52344 0.283296,0.31663 0.632701,0.60557 1.007899,0.89849 0.375198,0.29292 0.776711,0.55926 1.067753,0.81027 0.291042,0.25101 0.454223,0.50796 0.459122,0.52271 0.0048,0.0146 0.03119,0.33498 -0.05456,0.70231 -0.08575,0.36732 -0.223801,0.81174 -0.352819,1.26034 -0.129019,0.44861 -0.25176,0.90196 -0.291704,1.31835 -0.01997,0.20819 -0.04285,0.40729 0.0053,0.61409 0.04814,0.20679 0.184498,0.43007 0.399016,0.58168 0.214508,0.15161 0.449359,0.1881 0.668233,0.1701 0.218874,-0.018 0.435347,-0.0703 0.635153,-0.15132 0.399612,-0.16214 0.801767,-0.42851 1.206417,-0.68231 0.404649,-0.2538 0.808218,-0.52155 1.145553,-0.71107 0.337335,-0.18952 0.648398,-0.2686 0.66445,-0.26854 0.01586,6e-5 0.303381,0.0951 0.638936,0.28732 0.335555,0.19221 0.725321,0.46503 1.127607,0.72205 0.402287,0.25702 0.819957,0.49752 1.218019,0.66284 0.199027,0.0827 0.388928,0.15086 0.607623,0.17059 0.218695,0.0197 0.479784,-0.031 0.695512,-0.18105 0.215717,-0.15001 0.339276,-0.35235 0.389178,-0.55877 0.0499,-0.20642 0.04291,-0.43517 0.02476,-0.64358 -0.03632,-0.41683 -0.158989,-0.86394 -0.284099,-1.31372 -0.12511,-0.44978 -0.261649,-0.88661 -0.344206,-1.25475 -0.08256,-0.36813 -0.07169,-0.68662 -0.06666,-0.70133 0.005,-0.0145 0.187465,-0.25247 0.480599,-0.50101 0.293134,-0.24854 0.675989,-0.53755 1.053628,-0.82731 0.37764,-0.28976 0.767161,-0.57158 1.053124,-0.88579 0.142977,-0.1571 0.241796,-0.33444 0.32882,-0.52904 0.08702,-0.1946 0.135998,-0.42874 0.05481,-0.67306 -0.08119,-0.24432 -0.271084,-0.41314 -0.459122,-0.52272 -0.188037,-0.10958 -0.366789,-0.18158 -0.577821,-0.22931 -0.422064,-0.0955 -0.913586,-0.14009 -1.395564,-0.16426 -0.481977,-0.0242 -0.945835,-0.039 -1.334196,-0.077 -0.388361,-0.038 -0.715653,-0.13122 -0.728592,-0.14037 -0.01279,-0.009 -0.184019,-0.23636 -0.338404,-0.58217 -0.154385,-0.34581 -0.326584,-0.78819 -0.495481,-1.22429 -0.168896,-0.4361 -0.334766,-0.86429 -0.556091,-1.2238 -0.110668,-0.17977 -0.233352,-0.35397 -0.398259,-0.49396 -0.164907,-0.13999 -0.40309,-0.25684 -0.66899,-0.25783 z m 0.0086,0.99424 c 0.0422,0.0358 0.106711,0.13602 0.184103,0.26173 0.154773,0.25141 0.330675,0.6272 0.493967,1.04883 0.163292,0.42163 0.319052,0.88645 0.495985,1.28277 0.176933,0.39633 0.314564,0.73379 0.675296,0.98889 0.360721,0.25509 0.770187,0.29763 1.215244,0.34118 0.445058,0.0435 0.92882,0.0532 1.394807,0.0765 0.465988,0.0234 0.918236,0.0697 1.213479,0.13647 0.147627,0.0334 0.255581,0.0572 0.303811,0.0853 -0.02227,0.0498 -0.07958,0.15478 -0.179562,0.26464 -0.199968,0.21973 -0.537491,0.48746 -0.902606,0.7676 -0.365114,0.28015 -0.778037,0.57219 -1.113986,0.85704 -0.33595,0.28485 -0.639918,0.53221 -0.779871,0.94209 -0.139952,0.40986 -0.05396,0.77681 0.04065,1.19869 0.09461,0.42189 0.25406,0.87813 0.375016,1.31299 0.120956,0.43486 0.226877,0.84692 0.25228,1.13851 0.01156,0.13264 -0.01699,0.23485 -0.02778,0.29267 -0.05993,-0.008 -0.176402,-0.0324 -0.303811,-0.0853 -0.278362,-0.11561 -0.646494,-0.32808 -1.03543,-0.57657 -0.388935,-0.24849 -0.803899,-0.53053 -1.18847,-0.75081 -0.38457,-0.22028 -0.707909,-0.39837 -1.155138,-0.40015 -0.447219,-0.002 -0.792046,0.17245 -1.178633,0.38965 -0.386587,0.21719 -0.784375,0.49517 -1.175607,0.74055 -0.391232,0.24538 -0.776359,0.4507 -1.055898,0.56412 -0.139769,0.0567 -0.246155,0.0856 -0.302298,0.0902 -0.01026,-0.0578 -0.01522,-0.16008 -0.0025,-0.29243 0.02793,-0.29118 0.138178,-0.70893 0.262912,-1.14264 0.124734,-0.43372 0.254035,-0.89785 0.352315,-1.31883 0.09828,-0.42099 0.186721,-0.78846 0.05027,-1.19943 -0.136442,-0.41097 -0.43218,-0.64202 -0.765707,-0.92967 -0.333527,-0.28766 -0.705509,-0.58555 -1.068257,-0.86876 -0.362749,-0.2832 -0.717797,-0.56075 -0.915974,-0.78224 -0.09908,-0.11075 -0.162208,-0.21163 -0.184103,-0.26173 0.04834,-0.0276 0.154481,-0.058 0.302298,-0.0902 0.295625,-0.0643 0.745175,-0.10714 1.211209,-0.1267 0.466034,-0.0196 0.948238,-0.0298 1.393546,-0.0697 0.445308,-0.0399 0.846793,-0.0499 1.209695,-0.30216 0.362893,-0.25221 0.5383,-0.60511 0.718755,-1.00009 0.180456,-0.39497 0.33731,-0.84115 0.504347,-1.26156 0.167037,-0.42041 0.318485,-0.83556 0.475555,-1.08586 0.07853,-0.12515 0.167511,-0.20007 0.21012,-0.23565 z' id='path5520' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:1.04970646;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans'/> - </g> - <g inkscape:label='devices' transform='translate(-61.000202,-397)' inkscape:groupmode='layer' id='layer10'/> - <g inkscape:label='apps' transform='translate(-61.000202,-397)' inkscape:groupmode='layer' id='layer11'/> - <g inkscape:label='actions' transform='translate(-61.000202,-397)' inkscape:groupmode='layer' id='layer12'/> - <g inkscape:label='places' transform='translate(-61.000202,-397)' inkscape:groupmode='layer' id='layer13'/> - <g inkscape:label='mimetypes' transform='translate(-61.000202,-397)' inkscape:groupmode='layer' id='layer14'/> - <g inkscape:label='emblems' transform='translate(-61.000202,-397)' inkscape:groupmode='layer' id='layer15' style='display:inline'/> - <g inkscape:label='categories' transform='translate(-61.000202,-397)' inkscape:groupmode='layer' id='g4953' style='display:inline'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-61.000202,-397)"> +<path style="baseline-shift:baseline;block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" fill="#bebebe" d="m69.003,398.01c-0.2659-0.00099-0.49859,0.1006-0.6647,0.2393-0.16611,0.13869-0.27742,0.32137-0.38968,0.50028-0.22453,0.35782-0.39269,0.76873-0.56546,1.2036-0.17277,0.43483-0.34713,0.88766-0.5046,1.2323-0.15747,0.34465-0.3456,0.57871-0.35862,0.58776-0.01287,0.009-0.30722,0.117-0.69576,0.15181-0.38855,0.0348-0.88122,0.0492-1.3632,0.0694-0.48202,0.0202-0.9703,0.0362-1.393,0.12817-0.21138,0.046-0.4154,0.10148-0.60434,0.20956s-0.36689,0.28631-0.45004,0.53002-0.04901,0.50627,0.03636,0.70157c0.08537,0.19531,0.22656,0.36514,0.3682,0.52344,0.2833,0.31663,0.6327,0.60557,1.0079,0.89849s0.77671,0.55926,1.0678,0.81027c0.29104,0.25101,0.45422,0.50796,0.45912,0.52271,0.0048,0.0146,0.03119,0.33498-0.05456,0.70231-0.08575,0.36732-0.2238,0.81174-0.35282,1.2603-0.12902,0.44861-0.25176,0.90196-0.2917,1.3184-0.01997,0.20819-0.04285,0.40729,0.0053,0.61409,0.04814,0.20679,0.1845,0.43007,0.39902,0.58168,0.21451,0.15161,0.44936,0.1881,0.66823,0.1701s0.43535-0.0703,0.63515-0.15132c0.39961-0.16214,0.80177-0.42851,1.2064-0.68231,0.40465-0.2538,0.80822-0.52155,1.1456-0.71107,0.33734-0.18952,0.6484-0.2686,0.66445-0.26854,0.01586,0.00006,0.30338,0.0951,0.63894,0.28732,0.33556,0.19221,0.72532,0.46503,1.1276,0.72205,0.40229,0.25702,0.81996,0.49752,1.218,0.66284,0.19903,0.0827,0.38893,0.15086,0.60762,0.17059,0.2187,0.0197,0.47978-0.031,0.69551-0.18105,0.21572-0.15001,0.33928-0.35235,0.38918-0.55877s0.04291-0.43517,0.02476-0.64358c-0.03632-0.41683-0.15899-0.86394-0.2841-1.3137-0.12511-0.44978-0.26165-0.88661-0.34421-1.2548-0.08256-0.36813-0.07169-0.68662-0.06666-0.70133,0.005-0.0145,0.18746-0.25247,0.4806-0.50101,0.29313-0.24854,0.67599-0.53755,1.0536-0.82731,0.37764-0.28976,0.76716-0.57158,1.0531-0.88579,0.14298-0.1571,0.2418-0.33444,0.32882-0.52904s0.136-0.42874,0.05481-0.67306-0.27108-0.41314-0.45912-0.52272-0.36679-0.18158-0.57782-0.22931c-0.42206-0.0955-0.91359-0.14009-1.3956-0.16426-0.48198-0.0242-0.94584-0.039-1.3342-0.077s-0.71565-0.13122-0.72859-0.14037c-0.01279-0.009-0.18402-0.23636-0.3384-0.58217s-0.32658-0.78819-0.49548-1.2243c-0.1689-0.4361-0.33477-0.86429-0.55609-1.2238-0.11067-0.17977-0.23335-0.35397-0.39826-0.49396s-0.40309-0.25684-0.66899-0.25783zm0.0086,0.99424c0.0422,0.0358,0.10671,0.13602,0.1841,0.26173,0.15477,0.25141,0.33068,0.6272,0.49397,1.0488,0.16329,0.42163,0.31905,0.88645,0.49598,1.2828,0.17693,0.39633,0.31456,0.73379,0.6753,0.98889,0.36072,0.25509,0.77019,0.29763,1.2152,0.34118,0.44506,0.0435,0.92882,0.0532,1.3948,0.0765,0.46599,0.0234,0.91824,0.0697,1.2135,0.13647,0.14763,0.0334,0.25558,0.0572,0.30381,0.0853-0.02227,0.0498-0.07958,0.15478-0.17956,0.26464-0.19997,0.21973-0.53749,0.48746-0.90261,0.7676-0.36511,0.28015-0.77804,0.57219-1.114,0.85704-0.33595,0.28485-0.63992,0.53221-0.77987,0.94209-0.13995,0.40986-0.05396,0.77681,0.04065,1.1987s0.25406,0.87813,0.37502,1.313c0.12096,0.43486,0.22688,0.84692,0.25228,1.1385,0.01156,0.13264-0.01699,0.23485-0.02778,0.29267-0.05993-0.008-0.1764-0.0324-0.30381-0.0853-0.27836-0.11561-0.64649-0.32808-1.0354-0.57657-0.38894-0.24849-0.8039-0.53053-1.1885-0.75081-0.38457-0.22028-0.70791-0.39837-1.1551-0.40015-0.44722-0.002-0.79205,0.17245-1.1786,0.38965-0.38659,0.21719-0.78438,0.49517-1.1756,0.74055-0.39123,0.24538-0.77636,0.4507-1.0559,0.56412-0.13977,0.0567-0.24616,0.0856-0.3023,0.0902-0.01026-0.0578-0.01522-0.16008-0.0025-0.29243,0.02793-0.29118,0.13818-0.70893,0.26291-1.1426,0.12473-0.43372,0.25404-0.89785,0.35232-1.3188,0.09828-0.42099,0.18672-0.78846,0.05027-1.1994-0.13644-0.41097-0.43218-0.64202-0.76571-0.92967-0.33353-0.28766-0.70551-0.58555-1.0683-0.86876-0.36275-0.2832-0.7178-0.56075-0.91597-0.78224-0.09908-0.11075-0.16221-0.21163-0.1841-0.26173,0.04834-0.0276,0.15448-0.058,0.3023-0.0902,0.29562-0.0643,0.74518-0.10714,1.2112-0.1267,0.46603-0.0196,0.94824-0.0298,1.3935-0.0697,0.44531-0.0399,0.84679-0.0499,1.2097-0.30216,0.36289-0.25221,0.5383-0.60511,0.71876-1.0001,0.18046-0.39497,0.33731-0.84115,0.50435-1.2616,0.16704-0.42041,0.31848-0.83556,0.47556-1.0859,0.07853-0.12515,0.16751-0.20007,0.21012-0.23565z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/prev.svg b/p/themes/icons/prev.svg index 67685c50c..ea4372098 100644 --- a/p/themes/icons/prev.svg +++ b/p/themes/icons/prev.svg @@ -1,31 +1,5 @@ -<?xml version='1.0' encoding='UTF-8' standalone='no'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' sodipodi:docname='go-next-rtl-symbolic.svg' height='16' id='svg7384' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:svg='http://www.w3.org/2000/svg' inkscape:version='0.48.4 r9939' version='1.1' width='16' xmlns='http://www.w3.org/2000/svg'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:bbox-nodes='false' inkscape:bbox-paths='true' bordercolor='#666666' borderopacity='1' inkscape:current-layer='layer12' inkscape:cx='-101.35123' inkscape:cy='9.99302' gridtolerance='10' inkscape:guide-bbox='true' guidetolerance='10' id='namedview88' inkscape:object-nodes='false' inkscape:object-paths='false' objecttolerance='10' pagecolor='#3a3b39' inkscape:pageopacity='1' inkscape:pageshadow='2' showborder='false' showgrid='false' showguides='true' inkscape:snap-bbox='true' inkscape:snap-bbox-midpoints='false' inkscape:snap-global='true' inkscape:snap-grids='true' inkscape:snap-nodes='false' inkscape:snap-others='false' inkscape:snap-to-guides='true' inkscape:window-height='1408' inkscape:window-maximized='1' inkscape:window-width='2560' inkscape:window-x='0' inkscape:window-y='0' inkscape:zoom='1'> - <inkscape:grid empspacing='2' enabled='true' id='grid4866' originx='-60px' originy='530px' snapvisiblegridlinesonly='true' spacingx='1px' spacingy='1px' type='xygrid' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline' transform='translate(-301.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer10' inkscape:label='devices' transform='translate(-301.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer11' inkscape:label='apps' transform='translate(-301.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer13' inkscape:label='places' transform='translate(-301.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes' transform='translate(-301.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline' transform='translate(-301.0002,-747)'/> - <g inkscape:groupmode='layer' id='g71291' inkscape:label='emotes' style='display:inline' transform='translate(-301.0002,-747)'/> - <g inkscape:groupmode='layer' id='g4953' inkscape:label='categories' style='display:inline' transform='translate(-301.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer12' inkscape:label='actions' style='display:inline' transform='translate(-301.0002,-747)'> - - <path inkscape:connector-curvature='0' d='m 313.01372,749 -1,0 c -0.0104,-1.2e-4 -0.0208,-4.6e-4 -0.0313,0 -0.25495,0.0112 -0.50987,0.12858 -0.6875,0.3125 l -6.29767,5.71875 6.29772,5.71875 c 0.18816,0.18819 0.45346,0.28125 0.71875,0.28125 l 1,0 0,-1 c 0,-0.26529 -0.0931,-0.53058 -0.28125,-0.71875 l -4.82897,-4.28125 4.82897,-4.28125 c 0.21074,-0.19463 0.30316,-0.46925 0.28125,-0.75 z' id='path5441' sodipodi:nodetypes='ccsccccccccccc' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#bebebe;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78124988;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new;font-family:Andale Mono;-inkscape-font-specification:Andale Mono'/> - </g> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-301.0002,-747)"> +<path style="block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:new;text-transform:none;" d="m313.01,749-1,0c-0.0104-0.00012-0.0208-0.00046-0.0313,0-0.25495,0.0112-0.50987,0.12858-0.6875,0.3125l-6.2977,5.7188,6.2977,5.7188c0.18816,0.18819,0.45346,0.28125,0.71875,0.28125h1v-1c0-0.26529-0.0931-0.53058-0.28125-0.71875l-4.829-4.2812,4.829-4.2812c0.21074-0.19463,0.30316-0.46925,0.28125-0.75z" fill-rule="nonzero" fill="#bebebe"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/read.svg b/p/themes/icons/read.svg index 932bfd860..d72c198df 100644 --- a/p/themes/icons/read.svg +++ b/p/themes/icons/read.svg @@ -1,31 +1,5 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns='http://www.w3.org/2000/svg' id='svg7384' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' width='16' xmlns:cc='http://creativecommons.org/ns#' height='16.001099' sodipodi:docname='mail-read-symbolic.svg' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:svg='http://www.w3.org/2000/svg' inkscape:version='0.48.1 r9760' version='1.1'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:window-width='1226' id='namedview88' showgrid='false' objecttolerance='10' inkscape:pageopacity='1' inkscape:cx='12.92257' inkscape:cy='-1.422716' inkscape:snap-bbox='true' borderopacity='1' inkscape:object-nodes='false' inkscape:current-layer='layer9' inkscape:snap-to-guides='true' inkscape:snap-others='false' inkscape:snap-grids='true' bordercolor='#666666' inkscape:window-height='967' inkscape:snap-bbox-midpoints='false' showborder='false' inkscape:bbox-paths='false' inkscape:guide-bbox='true' inkscape:window-x='2657' inkscape:window-y='338' inkscape:snap-global='true' inkscape:snap-nodes='true' pagecolor='#555753' inkscape:object-paths='false' inkscape:pageshadow='2' inkscape:zoom='1' inkscape:window-maximized='0' gridtolerance='10' guidetolerance='10' showguides='true'> - <inkscape:grid id='grid4866' empspacing='2' type='xygrid' visible='true' snapvisiblegridlinesonly='true' enabled='true' spacingx='1px' spacingy='1px'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g id='layer9' inkscape:groupmode='layer' style='display:inline' transform='translate(-60.99995,-296.9989)' inkscape:label='status'> - - <path id='path35631' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;opacity:0.35;color:#000000;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans' d='m 68.8752,297 a 1.0001,1.0001 0 0 0 -0.5,0.25 l -4.90625,4 a 1.0001,1.0001 0 0 0 -0.0625,0.0312 c 0,0 -0.32587,0.29728 -0.65625,0.75 -0.22334,0.30605 -0.3527,0.8316 -0.5,1.3125 a 1.0001,1.0001 0 0 0 -0.03125,0.0312 1.0001,1.0001 0 0 0 -0.21875,0.5625 c -5.1e-4,0.0118 3.6e-4,0.0195 0,0.0312 a 1.0001,1.0001 0 0 0 0,0.0312 1.0001,1.0001 0 0 0 0,0.15625 l 0,7.84375 a 1.0001,1.0001 0 0 0 1,1 l 12,0 a 1.0001,1.0001 0 0 0 1,-1 l 0,-7.84375 a 1.0001,1.0001 0 0 0 0,-0.15625 1.0001,1.0001 0 0 0 -0.21875,-0.65625 1.0001,1.0001 0 0 0 -0.03125,-0.0312 c -0.32774,-1.18787 -1.125,-2 -1.125,-2 a 1.0001,1.0001 0 0 0 -0.0312,-0.0312 L 69.6252,297.25 a 1.0001,1.0001 0 0 0 -0.65625,-0.25 1.0001,1.0001 0 0 0 -0.0937,0 z m 0.125,2.28125 4.3125,3.53125 0.0312,0.0312 c 0.021,0.0255 0.18032,0.24952 0.34375,0.5 l -4.68745,3.53125 -4.6875,-3.53125 c 0.0259,-0.0394 0.0349,-0.0872 0.0625,-0.125 0.1908,-0.26146 0.31874,-0.41421 0.34375,-0.4375 l 0.03125,-0.0312 4.25,-3.46875 z m -5,5.09375 4.6875,3.53125 0.3125,0.21875 0.3125,-0.21875 4.6875,-3.53125 0,6.625 -10,0 0,-6.625 z' inkscape:connector-curvature='0'/> - </g> - <g id='layer10' inkscape:groupmode='layer' transform='translate(-60.99995,-296.9989)' inkscape:label='devices'/> - <g id='layer11' inkscape:groupmode='layer' transform='translate(-60.99995,-296.9989)' inkscape:label='apps'/> - <g id='layer13' inkscape:groupmode='layer' transform='translate(-60.99995,-296.9989)' inkscape:label='places'/> - <g id='layer14' inkscape:groupmode='layer' transform='translate(-60.99995,-296.9989)' inkscape:label='mimetypes'/> - <g id='layer15' inkscape:groupmode='layer' style='display:inline' transform='translate(-60.99995,-296.9989)' inkscape:label='emblems'/> - <g id='g71291' inkscape:groupmode='layer' style='display:inline' transform='translate(-60.99995,-296.9989)' inkscape:label='emotes'/> - <g id='g4953' inkscape:groupmode='layer' style='display:inline' transform='translate(-60.99995,-296.9989)' inkscape:label='categories'/> - <g id='layer12' inkscape:groupmode='layer' style='display:inline' transform='translate(-60.99995,-296.9989)' inkscape:label='actions'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16.001" width="16"> +<g transform="translate(-60.99995,-296.9989)"> +<path opacity="0.35" style="baseline-shift:baseline;block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" fill="#bebebe" d="m68.875,297a1.0001,1.0001,0,0,0,-0.5,0.25l-4.9062,4a1.0001,1.0001,0,0,0,-0.0625,0.0312s-0.32587,0.29728-0.65625,0.75c-0.22334,0.30605-0.3527,0.8316-0.5,1.3125a1.0001,1.0001,0,0,0,-0.03125,0.0312,1.0001,1.0001,0,0,0,-0.21875,0.5625c-0.00051,0.0118,0.00036,0.0195,0,0.0312a1.0001,1.0001,0,0,0,0,0.0312,1.0001,1.0001,0,0,0,0,0.15625v7.8438a1.0001,1.0001,0,0,0,1,1h12a1.0001,1.0001,0,0,0,1,-1v-7.8438a1.0001,1.0001,0,0,0,0,-0.15625,1.0001,1.0001,0,0,0,-0.21875,-0.65625,1.0001,1.0001,0,0,0,-0.03125,-0.0312c-0.32774-1.1879-1.125-2-1.125-2a1.0001,1.0001,0,0,0,-0.0312,-0.0312l-4.969-4.02a1.0001,1.0001,0,0,0,-0.65625,-0.25,1.0001,1.0001,0,0,0,-0.0937,0zm0.125,2.2812,4.3125,3.5312,0.0312,0.0312c0.021,0.0255,0.18032,0.24952,0.34375,0.5l-4.6874,3.5312-4.6875-3.5312c0.0259-0.0394,0.0349-0.0872,0.0625-0.125,0.1908-0.26146,0.31874-0.41421,0.34375-0.4375l0.03125-0.0312,4.25-3.4688zm-5,5.0938,4.6875,3.5312,0.3125,0.21875,0.3125-0.21875,4.6875-3.5312,0,6.625-10,0,0-6.625z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/refresh.svg b/p/themes/icons/refresh.svg index 11728fc5d..62fe56c1e 100644 --- a/p/themes/icons/refresh.svg +++ b/p/themes/icons/refresh.svg @@ -1,31 +1,5 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:svg='http://www.w3.org/2000/svg' xmlns:cc='http://creativecommons.org/ns#' id='svg7384' sodipodi:docname='view-refresh-symbolic.svg' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns='http://www.w3.org/2000/svg' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' inkscape:version='0.48.1 r9760' version='1.1' width='16' height='16' xmlns:dc='http://purl.org/dc/elements/1.1/'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:zoom='1' inkscape:bbox-paths='false' inkscape:pageopacity='1' guidetolerance='10' inkscape:snap-bbox='true' inkscape:window-height='1162' objecttolerance='10' id='namedview88' showborder='false' inkscape:window-x='2191' inkscape:window-y='111' inkscape:cx='9.3351214' inkscape:cy='10.6119' gridtolerance='10' inkscape:snap-bbox-midpoints='false' showguides='true' inkscape:pageshadow='2' pagecolor='#555753' bordercolor='#666666' inkscape:snap-global='true' inkscape:window-maximized='0' inkscape:object-nodes='false' inkscape:snap-nodes='false' inkscape:guide-bbox='true' inkscape:window-width='1595' inkscape:snap-others='false' borderopacity='1' showgrid='false' inkscape:snap-to-guides='true' inkscape:object-paths='false' inkscape:snap-grids='true' inkscape:current-layer='layer12'> - <inkscape:grid enabled='true' spacingx='1px' spacingy='1px' id='grid4866' visible='true' snapvisiblegridlinesonly='true' empspacing='2' type='xygrid'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g id='layer9' transform='translate(-241.0002,-627)' inkscape:label='status' style='display:inline' inkscape:groupmode='layer'/> - <g id='layer10' transform='translate(-241.0002,-627)' inkscape:label='devices' inkscape:groupmode='layer'/> - <g id='layer11' transform='translate(-241.0002,-627)' inkscape:label='apps' inkscape:groupmode='layer'/> - <g id='layer13' transform='translate(-241.0002,-627)' inkscape:label='places' inkscape:groupmode='layer'/> - <g id='layer14' transform='translate(-241.0002,-627)' inkscape:label='mimetypes' inkscape:groupmode='layer'/> - <g id='layer15' transform='translate(-241.0002,-627)' inkscape:label='emblems' style='display:inline' inkscape:groupmode='layer'/> - <g id='g71291' transform='translate(-241.0002,-627)' inkscape:label='emotes' style='display:inline' inkscape:groupmode='layer'/> - <g id='g4953' transform='translate(-241.0002,-627)' inkscape:label='categories' style='display:inline' inkscape:groupmode='layer'/> - <g id='layer12' transform='translate(-241.0002,-627)' inkscape:label='actions' style='display:inline' inkscape:groupmode='layer'> - - <path id='path4597' d='m 253.90645,628.96875 a 1.0001,1.0001 0 0 0 -0.125,0.0312 1.0001,1.0001 0 0 0 -0.78125,1 l 0,1.6875 c -0.38225,-0.57796 -0.84927,-1.08223 -1.40625,-1.5 -1.15563,-0.86677 -2.53199,-1.25227 -3.875,-1.1875 -0.19186,0.009 -0.37223,0.0353 -0.5625,0.0625 -1.52218,0.21741 -2.97815,1.02304 -3.96875,2.34375 -1.98119,2.64144 -1.42267,6.42505 1.21875,8.40625 2.64147,1.98122 6.42504,1.42267 8.40625,-1.21875 A 1.0063276,1.0063276 0 0 0 253.0002,638 a 1.0063276,1.0063276 0 0 0 0,-0.15625 l 0,-0.84375 -0.8125,0 -0.0937,0 a 1.0063276,1.0063276 0 0 0 -0.0937,0 1.0063276,1.0063276 0 0 0 -0.8125,0.40625 c -1.33265,1.77674 -3.81702,2.11387 -5.59375,0.78125 -1.77674,-1.33264 -2.1139,-3.81699 -0.78125,-5.59375 1.33265,-1.77674 3.817,-2.11389 5.59375,-0.78125 0.42946,0.32212 0.76954,0.73295 1.03125,1.1875 l -1.4375,0 a 1.0001,1.0001 0 0 0 -1,1 1.0001,1.0001 0 0 0 0,0.21875 l 0,0.78125 0.84375,0 0.15625,0 4,0 1,0 0,-1 0,-4 a 1.0001,1.0001 0 0 0 0,-0.1875 l 0,-0.8125 -0.8125,0 a 1.0001,1.0001 0 0 0 -0.28125,-0.0312 z' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#666666;fill:#666666;fill-opacity:1;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans' inkscape:connector-curvature='0'/> - </g> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-241.0002,-627)"> +<path style="baseline-shift:baseline;block-progression:tb;color:#666666;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" fill="#666" d="m253.91,628.97a1.0001,1.0001,0,0,0,-0.125,0.0312,1.0001,1.0001,0,0,0,-0.78125,1v1.6875c-0.38225-0.57796-0.84927-1.0822-1.4062-1.5-1.1556-0.86677-2.532-1.2523-3.875-1.1875-0.19186,0.009-0.37223,0.0353-0.5625,0.0625-1.5222,0.21741-2.9782,1.023-3.9688,2.3438-1.9812,2.6414-1.4227,6.425,1.2188,8.4062s6.425,1.4227,8.4062-1.2188a1.0063,1.0063,0,0,0,0.18,-0.59,1.0063,1.0063,0,0,0,0,-0.15625v-0.84375h-0.8125-0.0937a1.0063,1.0063,0,0,0,-0.0937,0,1.0063,1.0063,0,0,0,-0.8125,0.40625c-1.3326,1.7767-3.817,2.1139-5.5938,0.78125-1.7767-1.3326-2.1139-3.817-0.78125-5.5938,1.3326-1.7767,3.817-2.1139,5.5938-0.78125,0.42946,0.32212,0.76954,0.73295,1.0312,1.1875h-1.4375a1.0001,1.0001,0,0,0,-1,1,1.0001,1.0001,0,0,0,0,0.21875v0.78125h0.84375,0.15625,4,1v-1-4a1.0001,1.0001,0,0,0,0,-0.1875v-0.8125h-0.8125a1.0001,1.0001,0,0,0,-0.28125,-0.0312z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/rss.svg b/p/themes/icons/rss.svg index ceaddceee..2a8713be3 100644 --- a/p/themes/icons/rss.svg +++ b/p/themes/icons/rss.svg @@ -1,32 +1,6 @@ -<?xml version='1.0' encoding='UTF-8' standalone='no'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' sodipodi:docname='application-rss+xml-symbolic.svg' height='16' id='svg7384' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:svg='http://www.w3.org/2000/svg' inkscape:version='0.48.3.1 r9886' version='1.1' width='16' xmlns='http://www.w3.org/2000/svg'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:bbox-paths='false' bordercolor='#666666' borderopacity='1' inkscape:current-layer='layer14' inkscape:cx='27.01134' inkscape:cy='1.367038' gridtolerance='10' inkscape:guide-bbox='true' guidetolerance='10' id='namedview88' inkscape:object-nodes='false' inkscape:object-paths='false' objecttolerance='10' pagecolor='#3a3b39' inkscape:pageopacity='1' inkscape:pageshadow='2' showborder='false' showgrid='false' showguides='true' inkscape:snap-bbox='true' inkscape:snap-bbox-midpoints='false' inkscape:snap-global='true' inkscape:snap-grids='true' inkscape:snap-nodes='false' inkscape:snap-others='false' inkscape:snap-to-guides='true' inkscape:window-height='709' inkscape:window-maximized='1' inkscape:window-width='1366' inkscape:window-x='0' inkscape:window-y='27' inkscape:zoom='1'> - <inkscape:grid empspacing='2' enabled='true' id='grid4866' originx='-319.9998px' originy='84.00012px' snapvisiblegridlinesonly='true' spacingx='1px' spacingy='1px' type='xygrid' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline' transform='translate(-561,-301.00012)'/> - <g inkscape:groupmode='layer' id='layer10' inkscape:label='devices' transform='translate(-561,-301.00012)'/> - <g inkscape:groupmode='layer' id='layer11' inkscape:label='apps' transform='translate(-561,-301.00012)'/> - <g inkscape:groupmode='layer' id='layer13' inkscape:label='places' transform='translate(-561,-301.00012)'/> - <g inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes' transform='translate(-561,-301.00012)'> - - <path sodipodi:cx='323.0625' sodipodi:cy='97.1875' d='m 325.0625,97.1875 a 2,3.236068 0 1 1 -4,0 2,3.236068 0 1 1 4,0 z' id='path4983' sodipodi:rx='2' sodipodi:ry='3.236068' style='color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.69602728;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new' transform='matrix(1.0000007,0,0,0.61803426,241.93747,252.93479)' sodipodi:type='arc'/> - <path inkscape:connector-curvature='0' d='m 563.0002,303 0,1 c 0,0.55016 0.45347,1 1,1 4.97056,0 9,4.02944 9,9 0,0.55016 0.45347,1 1,1 l 1,0 0,-1 c 0,-6.07513 -4.92487,-11 -11,-11 l -1,0 z m 0,4 0,1 c 0,0.55016 0.45347,1 1,1 2.76143,0 5,2.23857 5,5 0,0.55016 0.45347,1 1,1 l 1,0 0,-1 c 0,-3.866 -3.134,-7 -7,-7 l -1,0 z' id='path5814' style='color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.33333492;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new'/> - </g> - <g inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline' transform='translate(-561,-301.00012)'/> - <g inkscape:groupmode='layer' id='g71291' inkscape:label='emotes' style='display:inline' transform='translate(-561,-301.00012)'/> - <g inkscape:groupmode='layer' id='g4953' inkscape:label='categories' style='display:inline' transform='translate(-561,-301.00012)'/> - <g inkscape:groupmode='layer' id='layer12' inkscape:label='actions' style='display:inline' transform='translate(-561,-301.00012)'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g fill-rule="nonzero" transform="translate(-561,-301.00012)" fill="#666"> +<path style="enable-background:new;color:#000000;" d="m325.06,97.188c0,1.7872-0.89543,3.2361-2,3.2361s-2-1.4488-2-3.2361c0-1.7872,0.89543-3.2361,2-3.2361s2,1.4488,2,3.2361z" transform="matrix(1.0000007,0,0,0.61803426,241.93747,252.93479)"/> +<path style="enable-background:new;color:#000000;" d="m563,303,0,1c0,0.55016,0.45347,1,1,1,4.9706,0,9,4.0294,9,9,0,0.55016,0.45347,1,1,1h1v-1c0-6.0751-4.9249-11-11-11h-1zm0,4,0,1c0,0.55016,0.45347,1,1,1,2.7614,0,5,2.2386,5,5,0,0.55016,0.45347,1,1,1h1v-1c0-3.866-3.134-7-7-7h-1z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/search.svg b/p/themes/icons/search.svg index acfb364cc..35a28dfca 100644 --- a/p/themes/icons/search.svg +++ b/p/themes/icons/search.svg @@ -1,32 +1,6 @@ -<?xml version='1.0' encoding='UTF-8' standalone='no'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' sodipodi:docname='folder-saved-search-symbolic.svg' height='16' id='svg7384' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:svg='http://www.w3.org/2000/svg' inkscape:version='0.48.2 r9819' version='1.1' width='16.000002' xmlns='http://www.w3.org/2000/svg'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:bbox-paths='false' bordercolor='#666666' borderopacity='1' inkscape:current-layer='layer13' inkscape:cx='-151.02446' inkscape:cy='0.353386' gridtolerance='10' inkscape:guide-bbox='true' guidetolerance='10' id='namedview88' inkscape:object-nodes='false' inkscape:object-paths='false' objecttolerance='10' pagecolor='#555753' inkscape:pageopacity='1' inkscape:pageshadow='2' showborder='false' showgrid='false' showguides='true' inkscape:snap-bbox='true' inkscape:snap-bbox-midpoints='false' inkscape:snap-global='true' inkscape:snap-grids='true' inkscape:snap-nodes='false' inkscape:snap-others='false' inkscape:snap-to-guides='true' inkscape:window-height='1168' inkscape:window-maximized='1' inkscape:window-width='1600' inkscape:window-x='0' inkscape:window-y='0' inkscape:zoom='1'> - <inkscape:grid empspacing='2' enabled='true' id='grid4866' snapvisiblegridlinesonly='true' spacingx='1px' spacingy='1px' type='xygrid' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline' transform='translate(-441.0004,-195)'/> - <g inkscape:groupmode='layer' id='layer10' inkscape:label='devices' transform='translate(-441.0004,-195)'/> - <g inkscape:groupmode='layer' id='layer11' inkscape:label='apps' transform='translate(-441.0004,-195)'/> - <g inkscape:groupmode='layer' id='layer13' inkscape:label='places' transform='translate(-441.0004,-195)'> - <path inkscape:connector-curvature='0' d='m 447.50781,195.99554 c -3.02886,0 -5.51073,2.47905 -5.51073,5.50447 0,3.02541 2.48187,5.50446 5.51073,5.50446 3.02885,0 5.51072,-2.47905 5.51072,-5.50446 0,-3.02542 -2.48187,-5.50447 -5.51072,-5.50447 z m 0,2.00893 c 1.94735,0 3.49951,1.55039 3.49951,3.49554 0,1.94514 -1.55216,3.49553 -3.49951,3.49553 -1.94736,0 -3.49952,-1.55039 -3.49952,-3.49553 0,-1.94515 1.55216,-3.49554 3.49952,-3.49554 z' id='path5079' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#666666;fill:#666666;fill-opacity:1;stroke:none;stroke-width:1.55467153;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new;font-family:Sans;-inkscape-font-specification:Sans'/> - <path inkscape:connector-curvature='0' d='m 450.8125,204 a 1.0001,1.0001 0 0 0 -0.5,1.71875 l 4,4 a 1.0054782,1.0054782 0 1 0 1.40625,-1.4375 l -4,-4 A 1.0001,1.0001 0 0 0 450.8125,204 z' id='path5081' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#666666;fill:#666666;fill-opacity:1;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new;font-family:Sans;-inkscape-font-specification:Sans'/> - - </g> - <g inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes' transform='translate(-441.0004,-195)'/> - <g inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline' transform='translate(-441.0004,-195)'/> - <g inkscape:groupmode='layer' id='g71291' inkscape:label='emotes' style='display:inline' transform='translate(-441.0004,-195)'/> - <g inkscape:groupmode='layer' id='g4953' inkscape:label='categories' style='display:inline' transform='translate(-441.0004,-195)'/> - <g inkscape:groupmode='layer' id='layer12' inkscape:label='actions' style='display:inline' transform='translate(-441.0004,-195)'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g fill="#666" transform="translate(-441.0004,-195)"> +<path style="baseline-shift:baseline;block-progression:tb;color:#666666;direction:ltr;text-indent:0;text-align:start;enable-background:new;text-transform:none;" d="m447.51,196c-3.0289,0-5.5107,2.479-5.5107,5.5045,0,3.0254,2.4819,5.5045,5.5107,5.5045s5.5107-2.479,5.5107-5.5045c0-3.0254-2.4819-5.5045-5.5107-5.5045zm0,2.0089c1.9474,0,3.4995,1.5504,3.4995,3.4955s-1.5522,3.4955-3.4995,3.4955c-1.9474,0-3.4995-1.5504-3.4995-3.4955,0-1.9452,1.5522-3.4955,3.4995-3.4955z"/> +<path style="baseline-shift:baseline;block-progression:tb;color:#666666;direction:ltr;text-indent:0;text-align:start;enable-background:new;text-transform:none;" d="m450.81,204a1.0001,1.0001,0,0,0,-0.5,1.7188l4,4a1.0055,1.0055,0,1,0,1.4062,-1.4375l-4-4a1.0001,1.0001,0,0,0,-0.91,-0.28z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/share.svg b/p/themes/icons/share.svg index 443321882..db7a3649c 100644 --- a/p/themes/icons/share.svg +++ b/p/themes/icons/share.svg @@ -1,34 +1,8 @@ -<?xml version='1.0' encoding='UTF-8' standalone='no'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' sodipodi:docname='folder-publicshare-symbolic.svg' height='16' id='svg7384' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:svg='http://www.w3.org/2000/svg' inkscape:version='0.48.3.1 r9886' version='1.1' width='16' xmlns='http://www.w3.org/2000/svg'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:bbox-paths='false' bordercolor='#666666' borderopacity='1' inkscape:current-layer='layer13' inkscape:cx='-55.50224' inkscape:cy='-178.38158' gridtolerance='10' inkscape:guide-bbox='true' guidetolerance='10' id='namedview88' inkscape:object-nodes='false' inkscape:object-paths='false' objecttolerance='10' pagecolor='#3a3b39' inkscape:pageopacity='1' inkscape:pageshadow='2' showborder='false' showgrid='false' showguides='true' inkscape:snap-bbox='true' inkscape:snap-bbox-midpoints='false' inkscape:snap-global='true' inkscape:snap-grids='true' inkscape:snap-nodes='false' inkscape:snap-others='false' inkscape:snap-to-guides='true' inkscape:window-height='1381' inkscape:window-maximized='1' inkscape:window-width='2560' inkscape:window-x='1600' inkscape:window-y='27' inkscape:zoom='1'> - <inkscape:grid empspacing='2' enabled='true' id='grid4866' originx='-340px' originy='-20.999999px' snapvisiblegridlinesonly='true' spacingx='1px' spacingy='1px' type='xygrid' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline' transform='translate(-581.0002,-196)'/> - <g inkscape:groupmode='layer' id='layer10' inkscape:label='devices' transform='translate(-581.0002,-196)'/> - <g inkscape:groupmode='layer' id='layer11' inkscape:label='apps' transform='translate(-581.0002,-196)'/> - <g inkscape:groupmode='layer' id='layer13' inkscape:label='places' transform='translate(-581.0002,-196)'> - - <path sodipodi:cx='289.03125' sodipodi:cy='178.03125' d='m 291,178.03125 a 1.96875,1.96875 0 1 1 -3.9375,0 1.96875,1.96875 0 1 1 3.9375,0 z' id='path8192' sodipodi:rx='1.96875' sodipodi:ry='1.96875' style='color:#000000;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999994;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new' transform='matrix(1.5079365,0,0,1.5079365,148.15963,-64.49107)' sodipodi:type='arc'/> - <path sodipodi:cx='289.03125' sodipodi:cy='178.03125' d='m 291,178.03125 a 1.96875,1.96875 0 1 1 -3.9375,0 1.96875,1.96875 0 1 1 3.9375,0 z' id='path8194' sodipodi:rx='1.96875' sodipodi:ry='1.96875' style='color:#000000;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999994;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new' transform='matrix(1.5079365,0,0,1.5079365,158.12818,-59.49107)' sodipodi:type='arc'/> - <path sodipodi:cx='289.03125' sodipodi:cy='178.03125' d='m 291,178.03125 a 1.96875,1.96875 0 1 1 -3.9375,0 1.96875,1.96875 0 1 1 3.9375,0 z' id='path8196' sodipodi:rx='1.96875' sodipodi:ry='1.96875' style='color:#000000;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999994;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new' transform='matrix(1.5079365,0,0,1.5079365,158.12818,-69.49107)' sodipodi:type='arc'/> - <path inkscape:connector-curvature='0' d='m 593.625,198.15625 -10.0625,4.875 -1.8125,0.90625 1.8125,0.90625 10.03125,5.0625 0.90625,-1.8125 -8.21875,-4.15625 8.21875,-4 -0.875,-1.78125 z' id='path8198' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans'/> - </g> - <g inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes' transform='translate(-581.0002,-196)'/> - <g inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline' transform='translate(-581.0002,-196)'/> - <g inkscape:groupmode='layer' id='g71291' inkscape:label='emotes' style='display:inline' transform='translate(-581.0002,-196)'/> - <g inkscape:groupmode='layer' id='g4953' inkscape:label='categories' style='display:inline' transform='translate(-581.0002,-196)'/> - <g inkscape:groupmode='layer' id='layer12' inkscape:label='actions' style='display:inline' transform='translate(-581.0002,-196)'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g fill="#bebebe" transform="translate(-581.0002,-196)"> +<path style="enable-background:new;color:#000000;" d="m291,178.03c0,1.0873-0.88144,1.9688-1.9688,1.9688-1.0873,0-1.9688-0.88144-1.9688-1.9688,0-1.0873,0.88144-1.9688,1.9688-1.9688,1.0873,0,1.9688,0.88144,1.9688,1.9688z" fill-rule="nonzero" transform="matrix(1.5079365,0,0,1.5079365,148.15963,-64.49107)"/> +<path style="enable-background:new;color:#000000;" d="m291,178.03c0,1.0873-0.88144,1.9688-1.9688,1.9688-1.0873,0-1.9688-0.88144-1.9688-1.9688,0-1.0873,0.88144-1.9688,1.9688-1.9688,1.0873,0,1.9688,0.88144,1.9688,1.9688z" fill-rule="nonzero" transform="matrix(1.5079365,0,0,1.5079365,158.12818,-59.49107)"/> +<path style="enable-background:new;color:#000000;" d="m291,178.03c0,1.0873-0.88144,1.9688-1.9688,1.9688-1.0873,0-1.9688-0.88144-1.9688-1.9688,0-1.0873,0.88144-1.9688,1.9688-1.9688,1.0873,0,1.9688,0.88144,1.9688,1.9688z" fill-rule="nonzero" transform="matrix(1.5079365,0,0,1.5079365,158.12818,-69.49107)"/> +<path style="baseline-shift:baseline;block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m593.62,198.16-10.062,4.875-1.8125,0.90625,1.8125,0.90625,10.031,5.0625,0.90625-1.8125-8.2188-4.1562,8.2188-4-0.875-1.7812z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/starred.svg b/p/themes/icons/starred.svg index d6e2cebb5..63a44908f 100644 --- a/p/themes/icons/starred.svg +++ b/p/themes/icons/starred.svg @@ -1,32 +1,5 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:svg='http://www.w3.org/2000/svg' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' sodipodi:docname='starred-symbolic.svg' version='1.1' inkscape:version='0.48.1 r9760' height='16' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:cy='0.50817' pagecolor='#555753' borderopacity='1' showborder='false' inkscape:bbox-paths='false' guidetolerance='10' inkscape:object-paths='true' inkscape:window-width='1457' showguides='true' inkscape:object-nodes='true' inkscape:snap-bbox='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:snap-nodes='false' bordercolor='#666666' objecttolerance='10' id='namedview88' showgrid='false' inkscape:window-maximized='0' inkscape:window-x='86' inkscape:snap-global='true' inkscape:window-y='51' gridtolerance='10' inkscape:window-height='1093' inkscape:snap-to-guides='true' inkscape:current-layer='layer9' inkscape:snap-bbox-midpoints='false' inkscape:zoom='1' inkscape:cx='19.029058' inkscape:snap-grids='true' inkscape:pageopacity='1'> - <inkscape:grid spacingx='1px' spacingy='1px' id='grid4866' empspacing='2' enabled='true' type='xygrid' snapvisiblegridlinesonly='true' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:label='status' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer9' style='display:inline'> - <g inkscape:label='folder-remote' transform='translate(-186.9996,-599)' id='g11910-1'> - - </g> - <path sodipodi:cy='180.96373' sodipodi:r2='3.8276224' transform='matrix(1.0472113,-0.00871584,0.00871584,1.0472113,-504.35434,220.15425)' inkscape:rounded='0.2104596' inkscape:flatsided='false' inkscape:transform-center-x='-0.0094346789' inkscape:transform-center-y='-0.69491065' d='m 530.9488,186.70897 c -0.77941,0.55189 -3.15759,-1.90601 -4.11253,-1.9179 -0.95532,-0.0119 -3.39494,2.38585 -4.16096,1.8149 -0.76573,-0.57072 0.83698,-3.59203 0.55319,-4.50391 -0.2839,-0.91223 -3.31818,-2.49151 -3.01189,-3.39647 0.30617,-0.90461 3.67487,-0.31399 4.45442,-0.86567 0.77986,-0.5519 1.3442,-3.92569 2.29952,-3.91404 0.95494,0.0116 1.43421,3.39798 2.19979,3.9689 0.76588,0.57114 4.14893,0.0653 4.43307,0.97746 0.28402,0.9118 -2.78848,2.41405 -3.09488,3.31858 -0.30652,0.90489 1.21999,3.96605 0.44027,4.51815 z' id='path11922-0' sodipodi:type='star' sodipodi:arg1='0.95492637' sodipodi:r1='7.0383992' style='color:#000000;fill:#f1c40f;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate' sodipodi:arg2='1.5829876' inkscape:randomized='0' sodipodi:cx='526.88293' sodipodi:sides='5'/> - </g> - <g inkscape:label='devices' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer10'/> - <g inkscape:label='apps' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer11'/> - <g inkscape:label='actions' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer12'/> - <g inkscape:label='places' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer13'/> - <g inkscape:label='mimetypes' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer14'/> - <g inkscape:label='emblems' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='layer15' style='display:inline'/> - <g inkscape:label='categories' transform='translate(-41.000202,-397)' inkscape:groupmode='layer' id='g4953' style='display:inline'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-41.000202,-397)"> +<path style="enable-background:accumulate;color:#000000;" d="m530.95,186.71c-0.77941,0.55189-3.1576-1.906-4.1125-1.9179-0.95532-0.0119-3.3949,2.3858-4.161,1.8149-0.76573-0.57072,0.83698-3.592,0.55319-4.5039-0.2839-0.91223-3.3182-2.4915-3.0119-3.3965,0.30617-0.90461,3.6749-0.31399,4.4544-0.86567,0.77986-0.5519,1.3442-3.9257,2.2995-3.914,0.95494,0.0116,1.4342,3.398,2.1998,3.9689,0.76588,0.57114,4.1489,0.0653,4.4331,0.97746,0.28402,0.9118-2.7885,2.414-3.0949,3.3186-0.30652,0.90489,1.22,3.966,0.44027,4.5182z" fill-rule="nonzero" transform="matrix(1.0472113,-0.00871584,0.00871584,1.0472113,-504.35434,220.15425)" fill="#f1c40f"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/stats.svg b/p/themes/icons/stats.svg new file mode 100644 index 000000000..90a23215f --- /dev/null +++ b/p/themes/icons/stats.svg @@ -0,0 +1,6 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-142,-490)" fill="#bebebe"> +<path style="block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="M144.19,490c-1.21,0-2.19,1.02-2.19,2.22v10.562c0,1.2008,0.98238,2.2188,2.1875,2.2188h11.625c1.2051,0,2.1875-1.0179,2.1875-2.2188v-10.562c-0.01-1.2-0.99-2.22-2.2-2.22h-11.625zm0,2,11.625,0c0.12026,0,0.1875,0.08,0.1875,0.21875v10.562c-0.01,0.14-0.08,0.22-0.2,0.22h-11.625c-0.12026,0-0.1875-0.08-0.1875-0.21875v-10.562c0.01-0.14,0.08-0.22,0.2-0.22z"/> +<path style="block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m151.31,493.97a0.50005,0.50005,0,0,0,-0.34375,0.34375l-1.6875,6.0938-0.875-1.1875a0.50005,0.50005,0,0,0,-0.4,-0.21h-2.5-0.5v1h0.5,2.25l1.3125,1.7812a0.50005,0.50005,0,0,0,0.875,-0.15625l1.5312-5.4375,1.0625,3.4688a0.50005,0.50005,0,0,0,0.47,0.35h1.5,0.5v-1h-0.5-1.125l-1.4375-4.6875a0.50005,0.50005,0,0,0,-0.625,-0.34375z"/> +</g> +</svg> diff --git a/p/themes/icons/tag.svg b/p/themes/icons/tag.svg index 688aca7a4..0d6db6ed8 100644 --- a/p/themes/icons/tag.svg +++ b/p/themes/icons/tag.svg @@ -1,134 +1,5 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - sodipodi:docname="tag.svg" - height="16" - id="svg7384" - inkscape:version="0.48.4 r9939" - version="1.1" - width="16"> - <metadata - id="metadata90"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview - inkscape:bbox-paths="false" - bordercolor="#666666" - borderopacity="1" - inkscape:current-layer="layer12" - inkscape:cx="63.620645" - inkscape:cy="27.761176" - gridtolerance="10" - inkscape:guide-bbox="true" - guidetolerance="10" - id="namedview88" - inkscape:object-nodes="false" - inkscape:object-paths="false" - objecttolerance="10" - pagecolor="#555753" - inkscape:pageopacity="1" - inkscape:pageshadow="2" - showborder="false" - showgrid="false" - showguides="true" - inkscape:snap-bbox="true" - inkscape:snap-bbox-midpoints="false" - inkscape:snap-global="true" - inkscape:snap-grids="true" - inkscape:snap-nodes="false" - inkscape:snap-others="false" - inkscape:snap-to-guides="true" - inkscape:window-height="709" - inkscape:window-maximized="1" - inkscape:window-width="1366" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:zoom="4"> - <inkscape:grid - empspacing="2" - enabled="true" - id="grid4866" - snapvisiblegridlinesonly="true" - spacingx="1px" - spacingy="1px" - type="xygrid" - visible="true" /> - </sodipodi:namedview> - <title - id="title9167">Gnome Symbolic Icon Theme</title> - <defs - id="defs7386" /> - <g - inkscape:groupmode="layer" - id="layer9" - inkscape:label="status" - style="display:inline" - transform="translate(-141.0002,-807)" /> - <g - inkscape:groupmode="layer" - id="layer10" - inkscape:label="devices" - transform="translate(-141.0002,-807)" /> - <g - inkscape:groupmode="layer" - id="layer11" - inkscape:label="apps" - transform="translate(-141.0002,-807)" /> - <g - inkscape:groupmode="layer" - id="layer13" - inkscape:label="places" - transform="translate(-141.0002,-807)" /> - <g - inkscape:groupmode="layer" - id="layer14" - inkscape:label="mimetypes" - transform="translate(-141.0002,-807)" /> - <g - inkscape:groupmode="layer" - id="layer15" - inkscape:label="emblems" - style="display:inline" - transform="translate(-141.0002,-807)" /> - <g - inkscape:groupmode="layer" - id="g71291" - inkscape:label="emotes" - style="display:inline" - transform="translate(-141.0002,-807)" /> - <g - inkscape:groupmode="layer" - id="g4953" - inkscape:label="categories" - style="display:inline" - transform="translate(-141.0002,-807)" /> - <g - inkscape:groupmode="layer" - id="layer12" - inkscape:label="actions" - style="display:inline" - transform="translate(-141.0002,-807)"> - <path - inkscape:connector-curvature="0" - d="m 149.0002,809 0,13 4,-4 4,4 c 0.0525,-6.84943 -0.0285,-10.58353 0,-13 z" - id="path12292" - sodipodi:nodetypes="cccccc" - style="fill:#bebebe;fill-opacity:1;stroke:none" /> - </g> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-141.0002,-807)"> +<path d="m149,809,0,13,4-4,4,4c0.0525-6.8494-0.0285-10.584,0-13z" fill="#bebebe"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/unread.svg b/p/themes/icons/unread.svg index f541fb25b..dc1cc609c 100644 --- a/p/themes/icons/unread.svg +++ b/p/themes/icons/unread.svg @@ -1,30 +1,6 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:svg='http://www.w3.org/2000/svg' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' id='svg7384' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' version='1.1' inkscape:version='0.47 r22583' height='16' sodipodi:docname='mail-unread-symbolic.svg' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns='http://www.w3.org/2000/svg' width='16'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:cy='-166.8292' inkscape:current-layer='layer9' inkscape:window-width='1310' pagecolor='#555753' showborder='false' showguides='true' inkscape:snap-nodes='true' objecttolerance='10' showgrid='false' inkscape:object-nodes='true' inkscape:pageshadow='2' inkscape:guide-bbox='true' inkscape:window-x='54' inkscape:snap-bbox='true' bordercolor='#666666' id='namedview88' inkscape:window-maximized='0' inkscape:snap-global='true' inkscape:window-y='25' gridtolerance='10' inkscape:zoom='1' inkscape:window-height='690' borderopacity='1' guidetolerance='10' inkscape:cx='315.82499' inkscape:bbox-paths='false' inkscape:snap-grids='true' inkscape:pageopacity='1' inkscape:snap-to-guides='true'> - <inkscape:grid visible='true' spacingx='1px' type='xygrid' spacingy='1px' id='grid4866' empspacing='2' enabled='true' snapvisiblegridlinesonly='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g transform='translate(-40.99995,-297)' inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline'> - - <path d='m 43.78125,301 a 1.0000999,1.0000999 0 0 0 -0.40625,1.78125 l 5,4 0.625,0.5 0.625,-0.5 5,-4 a 1.0004882,1.0004882 0 1 0 -1.25,-1.5625 l -4.375,3.5 -4.375,-3.5 A 1.0000999,1.0000999 0 0 0 43.78125,301 z' id='path35600' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#000000;fill:#e74c3c;fill-opacity:1;stroke:none;stroke-width:1.99999976;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans'/> - <path d='M 42.90625,300 A 1.0001,1.0001 0 0 0 42,301 l 0,9 a 1.0001,1.0001 0 0 0 1,1 l 12,0 a 1.0001,1.0001 0 0 0 1,-1 l 0,-9 a 1.0001,1.0001 0 0 0 -1,-1 l -12,0 a 1.0001,1.0001 0 0 0 -0.09375,0 z M 44,302 l 10,0 0,7 -10,0 0,-7 z' id='rect35604' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#000000;fill:#e74c3c;fill-opacity:1;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans'/> - </g> - <g transform='translate(-40.99995,-297)' inkscape:groupmode='layer' id='layer10' inkscape:label='devices'/> - <g transform='translate(-40.99995,-297)' inkscape:groupmode='layer' id='layer11' inkscape:label='apps'/> - <g transform='translate(-40.99995,-297)' inkscape:groupmode='layer' id='layer12' inkscape:label='actions'/> - <g transform='translate(-40.99995,-297)' inkscape:groupmode='layer' id='layer13' inkscape:label='places'/> - <g transform='translate(-40.99995,-297)' inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes'/> - <g transform='translate(-40.99995,-297)' inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline'/> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-40.99995,-297)" fill="#e74c3c"> +<path style="block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="m43.781,301a1.0001,1.0001,0,0,0,-0.40625,1.7812l5,4,0.625,0.5,0.625-0.5,5-4a1.0005,1.0005,0,1,0,-1.25,-1.5625l-4.375,3.5-4.375-3.5a1.0001,1.0001,0,0,0,-0.844,-0.22z"/> +<path style="block-progression:tb;color:#000000;direction:ltr;text-indent:0;text-align:start;enable-background:accumulate;text-transform:none;" d="M42.906,300a1.0001,1.0001,0,0,0,-0.906,1v9a1.0001,1.0001,0,0,0,1,1h12a1.0001,1.0001,0,0,0,1,-1v-9a1.0001,1.0001,0,0,0,-1,-1h-12a1.0001,1.0001,0,0,0,-0.09375,0zm1.094,2h10v7h-10v-7z"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/up.svg b/p/themes/icons/up.svg index dab31a20d..4819c9205 100644 --- a/p/themes/icons/up.svg +++ b/p/themes/icons/up.svg @@ -1,31 +1,5 @@ -<?xml version='1.0' encoding='UTF-8' standalone='no'?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' sodipodi:docname='go-up-symbolic.svg' height='16' id='svg7384' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' xmlns:svg='http://www.w3.org/2000/svg' inkscape:version='0.48.4 r9939' version='1.1' width='16' xmlns='http://www.w3.org/2000/svg'> - <metadata id='metadata90'> - <rdf:RDF> - <cc:Work rdf:about=''> - <dc:format>image/svg+xml</dc:format> - <dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/> - <dc:title>Gnome Symbolic Icon Theme</dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview inkscape:bbox-nodes='false' inkscape:bbox-paths='true' bordercolor='#666666' borderopacity='1' inkscape:current-layer='layer12' inkscape:cx='-1.351226' inkscape:cy='9.99302' gridtolerance='10' inkscape:guide-bbox='true' guidetolerance='10' id='namedview88' inkscape:object-nodes='false' inkscape:object-paths='false' objecttolerance='10' pagecolor='#3a3b39' inkscape:pageopacity='1' inkscape:pageshadow='2' showborder='false' showgrid='false' showguides='true' inkscape:snap-bbox='true' inkscape:snap-bbox-midpoints='false' inkscape:snap-global='true' inkscape:snap-grids='true' inkscape:snap-nodes='false' inkscape:snap-others='false' inkscape:snap-to-guides='true' inkscape:window-height='1408' inkscape:window-maximized='1' inkscape:window-width='2560' inkscape:window-x='0' inkscape:window-y='0' inkscape:zoom='1'> - <inkscape:grid empspacing='2' enabled='true' id='grid4866' originx='40px' originy='530px' snapvisiblegridlinesonly='true' spacingx='1px' spacingy='1px' type='xygrid' visible='true'/> - </sodipodi:namedview> - <title id='title9167'>Gnome Symbolic Icon Theme</title> - <defs id='defs7386'/> - <g inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline' transform='translate(-201.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer10' inkscape:label='devices' transform='translate(-201.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer11' inkscape:label='apps' transform='translate(-201.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer13' inkscape:label='places' transform='translate(-201.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes' transform='translate(-201.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline' transform='translate(-201.0002,-747)'/> - <g inkscape:groupmode='layer' id='g71291' inkscape:label='emotes' style='display:inline' transform='translate(-201.0002,-747)'/> - <g inkscape:groupmode='layer' id='g4953' inkscape:label='categories' style='display:inline' transform='translate(-201.0002,-747)'/> - <g inkscape:groupmode='layer' id='layer12' inkscape:label='actions' style='display:inline' transform='translate(-201.0002,-747)'> - - <path inkscape:connector-curvature='0' d='m 215.03152,758.99677 0,-1.00001 c -9.1e-4,-0.0111 5.9e-4,-0.021 -9e-5,-0.0312 -0.0112,-0.25496 -0.12835,-0.50994 -0.31251,-0.6875 l -5.71875,-6.29767 -5.71875,6.29773 c -0.18821,0.1881 -0.28121,0.45346 -0.28122,0.71875 l 0,1.00001 1,0 c 0.26531,-7e-5 0.53059,-0.0931 0.71873,-0.28131 l 4.28125,-4.82896 4.28127,4.82896 c 0.19464,0.21073 0.46925,0.30315 0.74998,0.2813 z' id='path10839-9-9-5-9-1-0' sodipodi:nodetypes='ccsccccccccccc' style='font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#bebebe;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78124988;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new;font-family:Andale Mono;-inkscape-font-specification:Andale Mono'/> - </g> -</svg> +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16"> +<g transform="translate(-201.0002,-747)"> +<path style="block-progression:tb;color:#bebebe;direction:ltr;text-indent:0;text-align:start;enable-background:new;text-transform:none;" d="m215.03,759,0-1c-0.00091-0.0111,0.00059-0.021-0.00009-0.0312-0.0112-0.25496-0.12835-0.50994-0.31251-0.6875l-5.7188-6.2977-5.7188,6.2977c-0.18821,0.1881-0.28121,0.45346-0.28122,0.71875v1h1c0.26531-0.00007,0.53059-0.0931,0.71873-0.28131l4.2812-4.829,4.2813,4.829c0.19464,0.21073,0.46925,0.30315,0.74998,0.2813z" fill-rule="nonzero" fill="#bebebe"/> +</g> +</svg>
\ No newline at end of file diff --git a/p/themes/icons/view-global.svg b/p/themes/icons/view-global.svg new file mode 100644 index 000000000..d81e79790 --- /dev/null +++ b/p/themes/icons/view-global.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g transform="translate(-61-867)" fill="#666" color="#000"><rect height="2" rx=".385" ry=".379" width="2" x="64" y="870"/><rect height="2" rx=".385" ry=".379" width="2" x="68" y="870"/><rect height="2" rx=".385" ry=".379" width="2" x="72" y="870"/><rect height="2" rx=".385" ry=".379" width="2" x="64" y="874.02"/><rect height="2" rx=".385" ry=".379" width="2" x="68" y="874.02"/><rect height="2" rx=".385" ry=".379" width="2" x="72" y="874.02"/><rect height="2" rx=".385" ry=".379" width="2" x="64" y="878"/><rect height="2" rx=".385" ry=".379" width="2" x="68" y="878"/><rect height="2" rx=".385" ry=".379" width="2" x="72" y="878"/></g></svg>
\ No newline at end of file diff --git a/p/themes/icons/view-normal.svg b/p/themes/icons/view-normal.svg new file mode 100644 index 000000000..c35b101df --- /dev/null +++ b/p/themes/icons/view-normal.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g transform="translate(-40-746)" fill="#666" color="#666"><path d="m43 749h10v2h-10z"/><path d="m43 753h10v2h-10z"/><path d="m43 757h10v2h-10z"/></g></svg>
\ No newline at end of file diff --git a/p/themes/icons/view-reader.svg b/p/themes/icons/view-reader.svg new file mode 100644 index 000000000..3243aed6e --- /dev/null +++ b/p/themes/icons/view-reader.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g transform="translate(-181-867)" fill="#666" color="#666"><path d="m 181,868 0,1 0,11 0,1 1,0 5,0 c 0.1754,0 0.52538,0.15166 0.8125,0.34375 0.28712,0.19209 0.46875,0.375 0.46875,0.375 L 189,882.4375 l 0.71875,-0.75 c 0,0 0.8963,-0.6875 1.28125,-0.6875 l 5,0 1,0 0,-1 0,-11 0,-1 -1,0 -5,0 c -0.87652,0 -1.56017,0.34756 -2.03125,0.6875 -0.0301,-0.0207 -0.031,-0.0105 -0.0625,-0.0312 C 188.44557,868.35254 187.82811,868 187,868 l -5,0 -1,0 z m 2,2 4,0 c 0.13821,0 0.51476,0.14746 0.8125,0.34375 0.29774,0.19629 0.5,0.375 0.5,0.375 l 0.71875,0.6875 0.6875,-0.71875 c 0,0 0.89975,-0.6875 1.28125,-0.6875 l 4,0 0,9 -4,0 c -0.87693,0 -1.56008,0.34735 -2.03125,0.6875 -0.0196,-0.0135 -0.011,-0.0177 -0.0312,-0.0312 C 188.47725,879.34834 187.83512,879 187,879 l -4,0 0,-9 z"/><g transform="scale(-1 1)"><rect height="2" rx=".375" width="3" x="-187" y="872"/><rect height="2" rx=".375" width="3" x="-187" y="875"/><rect height="2" rx=".375" width="3" x="-194" y="872"/><rect height="2" rx=".375" width="3" x="-194" y="875"/></g></g></svg>
\ No newline at end of file diff --git a/p/themes/index.html b/p/themes/index.html new file mode 100644 index 000000000..85faaa37e --- /dev/null +++ b/p/themes/index.html @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB"> +<head> +<meta charset="UTF-8" /> +<meta http-equiv="Refresh" content="0; url=/" /> +<title>Redirection</title> +<meta name="robots" content="noindex" /> +</head> + +<body> +<p><a href="/">Redirection</a></p> +</body> +</html> diff --git a/p/themes/p.css b/p/themes/p.css new file mode 100644 index 000000000..171b2078b --- /dev/null +++ b/p/themes/p.css @@ -0,0 +1,17 @@ +@charset "UTF-8"; + +body { + font-family: sans-serif; + text-align: center; +} +h1 { + font-size: xx-large; + text-shadow: 1px -1px 0 #CCCCCC; +} +h1 a { + color: #0062BE; + text-decoration: none; +} +img { + border: 0; +} diff --git a/tests/app/Models/CategoryTest.php b/tests/app/Models/CategoryTest.php new file mode 100644 index 000000000..da439b785 --- /dev/null +++ b/tests/app/Models/CategoryTest.php @@ -0,0 +1,32 @@ +<?php + +class FreshRSS_CategoryTest extends \PHPUnit_Framework_TestCase { + + public function test__construct_whenNoParameters_createsObjectWithDefaultValues() { + $category = new FreshRSS_Category(); + $this->assertEquals(0, $category->id()); + $this->assertEquals('', $category->name()); + } + + /** + * @param string $input + * @param string $expected + * @dataProvider provideValidNames + */ + public function test_name_whenValidValue_storesModifiedValue($input, $expected) { + $category = new FreshRSS_Category($input); + $this->assertEquals($expected, $category->name()); + } + + public function provideValidNames() { + return array( + array('', ''), + array('this string does not need trimming', 'this string does not need trimming'), + array(' this string needs trimming on left', 'this string needs trimming on left'), + array('this string needs trimming on right ', 'this string needs trimming on right'), + array(' this string needs trimming on both ends ', 'this string needs trimming on both ends'), + array(str_repeat('This string needs to be shortened because its length is way too long. ', 4), str_repeat('This string needs to be shortened because its length is way too long. ', 3) . 'This string needs to be shortened because its'), + ); + } + +} diff --git a/tests/app/Models/ContextTest.php b/tests/app/Models/ContextTest.php new file mode 100644 index 000000000..4dc8b7757 --- /dev/null +++ b/tests/app/Models/ContextTest.php @@ -0,0 +1,5 @@ +<?php + +class ContextTest extends \PHPUnit_Framework_TestCase { + +} diff --git a/tests/app/Models/SearchTest.php b/tests/app/Models/SearchTest.php new file mode 100644 index 000000000..73ff56cc6 --- /dev/null +++ b/tests/app/Models/SearchTest.php @@ -0,0 +1,293 @@ +<?php + +require_once(LIB_PATH . '/lib_date.php'); + +class SearchTest extends \PHPUnit_Framework_TestCase { + + /** + * @dataProvider provideEmptyInput + * @param string|null $input + */ + public function test__construct_whenInputIsEmpty_getsOnlyNullValues($input) { + $search = new FreshRSS_Search($input); + $this->assertEquals('', $search->getRawInput()); + $this->assertNull($search->getIntitle()); + $this->assertNull($search->getMinDate()); + $this->assertNull($search->getMaxDate()); + $this->assertNull($search->getMinPubdate()); + $this->assertNull($search->getMaxPubdate()); + $this->assertNull($search->getAuthor()); + $this->assertNull($search->getTags()); + $this->assertNull($search->getSearch()); + } + + /** + * Return an array of values for the search object. + * Here is the description of the values + * @return array + */ + public function provideEmptyInput() { + return array( + array(''), + array(null), + ); + } + + /** + * @dataProvider provideIntitleSearch + * @param string $input + * @param string $intitle_value + * @param string|null $search_value + */ + public function test__construct_whenInputContainsIntitle_setsIntitlePropery($input, $intitle_value, $search_value) { + $search = new FreshRSS_Search($input); + $this->assertEquals($intitle_value, $search->getIntitle()); + $this->assertEquals($search_value, $search->getSearch()); + } + + /** + * @return array + */ + public function provideIntitleSearch() { + return array( + array('intitle:word1', 'word1', null), + array('intitle:word1 word2', 'word1', array('word2')), + array('intitle:"word1 word2"', 'word1 word2', null), + array("intitle:'word1 word2'", 'word1 word2', null), + array('word1 intitle:word2', 'word2', array('word1')), + array('word1 intitle:word2 word3', 'word2', array('word1', 'word3')), + array('word1 intitle:"word2 word3"', 'word2 word3', array('word1')), + array("word1 intitle:'word2 word3'", 'word2 word3', array('word1')), + array('intitle:word1 intitle:word2', 'word1', array('intitle:word2')), + array('intitle: word1 word2', null, array('word1', 'word2')), + array('intitle:123', '123', null), + array('intitle:"word1 word2" word3"', 'word1 word2', array('word3"')), + array("intitle:'word1 word2' word3'", 'word1 word2', array("word3'")), + array('intitle:"word1 word2\' word3"', "word1 word2' word3", null), + array("intitle:'word1 word2\" word3'", 'word1 word2" word3', null), + array("intitle:word1 'word2 word3' word4", 'word1', array('word2 word3', 'word4')), + ); + } + + /** + * @dataProvider provideAuthorSearch + * @param string $input + * @param string $author_value + * @param string|null $search_value + */ + public function test__construct_whenInputContainsAuthor_setsAuthorValue($input, $author_value, $search_value) { + $search = new FreshRSS_Search($input); + $this->assertEquals($author_value, $search->getAuthor()); + $this->assertEquals($search_value, $search->getSearch()); + } + + /** + * @return array + */ + public function provideAuthorSearch() { + return array( + array('author:word1', 'word1', null), + array('author:word1 word2', 'word1', array('word2')), + array('author:"word1 word2"', 'word1 word2', null), + array("author:'word1 word2'", 'word1 word2', null), + array('word1 author:word2', 'word2', array('word1')), + array('word1 author:word2 word3', 'word2', array('word1', 'word3')), + array('word1 author:"word2 word3"', 'word2 word3', array('word1')), + array("word1 author:'word2 word3'", 'word2 word3', array('word1')), + array('author:word1 author:word2', 'word1', array('author:word2')), + array('author: word1 word2', null, array('word1', 'word2')), + array('author:123', '123', null), + array('author:"word1 word2" word3"', 'word1 word2', array('word3"')), + array("author:'word1 word2' word3'", 'word1 word2', array("word3'")), + array('author:"word1 word2\' word3"', "word1 word2' word3", null), + array("author:'word1 word2\" word3'", 'word1 word2" word3', null), + array("author:word1 'word2 word3' word4", 'word1', array('word2 word3', 'word4')), + ); + } + + /** + * @dataProvider provideInurlSearch + * @param string $input + * @param string $inurl_value + * @param string|null $search_value + */ + public function test__construct_whenInputContainsInurl_setsInurlValue($input, $inurl_value, $search_value) { + $search = new FreshRSS_Search($input); + $this->assertEquals($inurl_value, $search->getInurl()); + $this->assertEquals($search_value, $search->getSearch()); + } + + /** + * @return array + */ + public function provideInurlSearch() { + return array( + array('inurl:word1', 'word1', null), + array('inurl: word1', null, array('word1')), + array('inurl:123', '123', null), + array('inurl:word1 word2', 'word1', array('word2')), + array('inurl:"word1 word2"', '"word1', array('word2"')), + array("inurl:word1 'word2 word3' word4", 'word1', array('word2 word3', 'word4')), + ); + } + + /** + * @dataProvider provideDateSearch + * @param string $input + * @param string $min_date_value + * @param string $max_date_value + */ + public function test__construct_whenInputContainsDate_setsDateValues($input, $min_date_value, $max_date_value) { + $search = new FreshRSS_Search($input); + $this->assertEquals($min_date_value, $search->getMinDate()); + $this->assertEquals($max_date_value, $search->getMaxDate()); + } + + /** + * @return array + */ + public function provideDateSearch() { + return array( + array('date:2007-03-01T13:00:00Z/2008-05-11T15:30:00Z', '1172754000', '1210519800'), + array('date:2007-03-01T13:00:00Z/P1Y2M10DT2H30M', '1172754000', '1210516199'), + array('date:P1Y2M10DT2H30M/2008-05-11T15:30:00Z', '1172757601', '1210519800'), + array('date:2007-03-01/2008-05-11', '1172725200', '1210564799'), + array('date:2007-03-01/', '1172725200', ''), + array('date:/2008-05-11', '', '1210564799'), + ); + } + + /** + * @dataProvider providePubdateSearch + * @param string $input + * @param string $min_pubdate_value + * @param string $max_pubdate_value + */ + public function test__construct_whenInputContainsPubdate_setsPubdateValues($input, $min_pubdate_value, $max_pubdate_value) { + $search = new FreshRSS_Search($input); + $this->assertEquals($min_pubdate_value, $search->getMinPubdate()); + $this->assertEquals($max_pubdate_value, $search->getMaxPubdate()); + } + + /** + * @return array + */ + public function providePubdateSearch() { + return array( + array('pubdate:2007-03-01T13:00:00Z/2008-05-11T15:30:00Z', '1172754000', '1210519800'), + array('pubdate:2007-03-01T13:00:00Z/P1Y2M10DT2H30M', '1172754000', '1210516199'), + array('pubdate:P1Y2M10DT2H30M/2008-05-11T15:30:00Z', '1172757601', '1210519800'), + array('pubdate:2007-03-01/2008-05-11', '1172725200', '1210564799'), + array('pubdate:2007-03-01/', '1172725200', ''), + array('pubdate:/2008-05-11', '', '1210564799'), + ); + } + + /** + * @dataProvider provideTagsSearch + * @param string $input + * @param string $tags_value + * @param string|null $search_value + */ + public function test__construct_whenInputContainsTags_setsTagsValue($input, $tags_value, $search_value) { + $search = new FreshRSS_Search($input); + $this->assertEquals($tags_value, $search->getTags()); + $this->assertEquals($search_value, $search->getSearch()); + } + + /** + * @return array + */ + public function provideTagsSearch() { + return array( + array('#word1', array('word1'), null), + array('# word1', null, array('#', 'word1')), + array('#123', array('123'), null), + array('#word1 word2', array('word1'), array('word2')), + array('#"word1 word2"', array('"word1'), array('word2"')), + array('#word1 #word2', array('word1', 'word2'), null), + array("#word1 'word2 word3' word4", array('word1'), array('word2 word3', 'word4')), + ); + } + + /** + * @dataProvider provideMultipleSearch + * @param string $input + * @param string $author_value + * @param string $min_date_value + * @param string $max_date_value + * @param string $intitle_value + * @param string $inurl_value + * @param string $min_pubdate_value + * @param string $max_pubdate_value + * @param array $tags_value + * @param string|null $search_value + */ + public function test__construct_whenInputContainsMultipleKeywords_setsValues($input, $author_value, $min_date_value, $max_date_value, $intitle_value, $inurl_value, $min_pubdate_value, $max_pubdate_value, $tags_value, $search_value) { + $search = new FreshRSS_Search($input); + $this->assertEquals($author_value, $search->getAuthor()); + $this->assertEquals($min_date_value, $search->getMinDate()); + $this->assertEquals($max_date_value, $search->getMaxDate()); + $this->assertEquals($intitle_value, $search->getIntitle()); + $this->assertEquals($inurl_value, $search->getInurl()); + $this->assertEquals($min_pubdate_value, $search->getMinPubdate()); + $this->assertEquals($max_pubdate_value, $search->getMaxPubdate()); + $this->assertEquals($tags_value, $search->getTags()); + $this->assertEquals($search_value, $search->getSearch()); + $this->assertEquals($input, $search->getRawInput()); + } + + public function provideMultipleSearch() { + return array( + array( + 'author:word1 date:2007-03-01/2008-05-11 intitle:word2 inurl:word3 pubdate:2007-03-01/2008-05-11 #word4 #word5', + 'word1', + '1172725200', + '1210564799', + 'word2', + 'word3', + '1172725200', + '1210564799', + array('word4', 'word5'), + null, + ), + array( + 'word6 intitle:word2 inurl:word3 pubdate:2007-03-01/2008-05-11 #word4 author:word1 #word5 date:2007-03-01/2008-05-11', + 'word1', + '1172725200', + '1210564799', + 'word2', + 'word3', + '1172725200', + '1210564799', + array('word4', 'word5'), + array('word6'), + ), + array( + 'word6 intitle:word2 inurl:word3 pubdate:2007-03-01/2008-05-11 #word4 author:word1 #word5 word7 date:2007-03-01/2008-05-11', + 'word1', + '1172725200', + '1210564799', + 'word2', + 'word3', + '1172725200', + '1210564799', + array('word4', 'word5'), + array('word6', 'word7'), + ), + array( + 'word6 intitle:word2 inurl:word3 pubdate:2007-03-01/2008-05-11 #word4 author:word1 #word5 "word7 word8" date:2007-03-01/2008-05-11', + 'word1', + '1172725200', + '1210564799', + 'word2', + 'word3', + '1172725200', + '1210564799', + array('word4', 'word5'), + array('word7 word8', 'word6'), + ), + ); + } + +} diff --git a/tests/app/Models/UserQueryTest.php b/tests/app/Models/UserQueryTest.php new file mode 100644 index 000000000..a0928d5ae --- /dev/null +++ b/tests/app/Models/UserQueryTest.php @@ -0,0 +1,229 @@ +<?php + +/** + * Description of UserQueryTest + */ +class UserQueryTest extends \PHPUnit_Framework_TestCase { + + public function test__construct_whenAllQuery_storesAllParameters() { + $query = array('get' => 'a'); + $user_query = new FreshRSS_UserQuery($query); + $this->assertEquals('all', $user_query->getGetName()); + $this->assertEquals('all', $user_query->getGetType()); + } + + public function test__construct_whenFavoriteQuery_storesFavoriteParameters() { + $query = array('get' => 's'); + $user_query = new FreshRSS_UserQuery($query); + $this->assertEquals('favorite', $user_query->getGetName()); + $this->assertEquals('favorite', $user_query->getGetType()); + } + + /** + * @expectedException Exceptions/FreshRSS_DAO_Exception + * @expectedExceptionMessage Category DAO is not loaded in UserQuery + */ + public function test__construct_whenCategoryQueryAndNoDao_throwsException() { + $this->markTestIncomplete('There is a problem with the exception autoloading. We need to make a better autoloading process'); + $query = array('get' => 'c_1'); + new FreshRSS_UserQuery($query); + } + + public function test__construct_whenCategoryQuery_storesCategoryParameters() { + $category_name = 'some category name'; + $cat = $this->getMock('FreshRSS_Category'); + $cat->expects($this->atLeastOnce()) + ->method('name') + ->withAnyParameters() + ->willReturn($category_name); + $cat_dao = $this->getMock('FreshRSS_Searchable'); + $cat_dao->expects($this->atLeastOnce()) + ->method('searchById') + ->withAnyParameters() + ->willReturn($cat); + $query = array('get' => 'c_1'); + $user_query = new FreshRSS_UserQuery($query, null, $cat_dao); + $this->assertEquals($category_name, $user_query->getGetName()); + $this->assertEquals('category', $user_query->getGetType()); + } + + /** + * @expectedException Exceptions/FreshRSS_DAO_Exception + * @expectedExceptionMessage Feed DAO is not loaded in UserQuery + */ + public function test__construct_whenFeedQueryAndNoDao_throwsException() { + $this->markTestIncomplete('There is a problem with the exception autoloading. We need to make a better autoloading process'); + $query = array('get' => 'c_1'); + new FreshRSS_UserQuery($query); + } + + public function test__construct_whenFeedQuery_storesFeedParameters() { + $feed_name = 'some feed name'; + $feed = $this->getMock('FreshRSS_Feed', array(), array('', false)); + $feed->expects($this->atLeastOnce()) + ->method('name') + ->withAnyParameters() + ->willReturn($feed_name); + $feed_dao = $this->getMock('FreshRSS_Searchable'); + $feed_dao->expects($this->atLeastOnce()) + ->method('searchById') + ->withAnyParameters() + ->willReturn($feed); + $query = array('get' => 'f_1'); + $user_query = new FreshRSS_UserQuery($query, $feed_dao, null); + $this->assertEquals($feed_name, $user_query->getGetName()); + $this->assertEquals('feed', $user_query->getGetType()); + } + + public function test__construct_whenUnknownQuery_doesStoreParameters() { + $query = array('get' => 'q'); + $user_query = new FreshRSS_UserQuery($query); + $this->assertNull($user_query->getGetName()); + $this->assertNull($user_query->getGetType()); + } + + public function test__construct_whenName_storesName() { + $name = 'some name'; + $query = array('name' => $name); + $user_query = new FreshRSS_UserQuery($query); + $this->assertEquals($name, $user_query->getName()); + } + + public function test__construct_whenOrder_storesOrder() { + $order = 'some order'; + $query = array('order' => $order); + $user_query = new FreshRSS_UserQuery($query); + $this->assertEquals($order, $user_query->getOrder()); + } + + public function test__construct_whenState_storesState() { + $state = 'some state'; + $query = array('state' => $state); + $user_query = new FreshRSS_UserQuery($query); + $this->assertEquals($state, $user_query->getState()); + } + + public function test__construct_whenUrl_storesUrl() { + $url = 'some url'; + $query = array('url' => $url); + $user_query = new FreshRSS_UserQuery($query); + $this->assertEquals($url, $user_query->getUrl()); + } + + public function testToArray_whenNoData_returnsEmptyArray() { + $user_query = new FreshRSS_UserQuery(array()); + $this->assertInternalType('array', $user_query->toArray()); + $this->assertCount(0, $user_query->toArray()); + } + + public function testToArray_whenData_returnsArray() { + $query = array( + 'get' => 's', + 'name' => 'some name', + 'order' => 'some order', + 'search' => 'some search', + 'state' => 'some state', + 'url' => 'some url', + ); + $user_query = new FreshRSS_UserQuery($query); + $this->assertInternalType('array', $user_query->toArray()); + $this->assertCount(6, $user_query->toArray()); + $this->assertEquals($query, $user_query->toArray()); + } + + public function testHasSearch_whenSearch_returnsTrue() { + $query = array( + 'search' => 'some search', + ); + $user_query = new FreshRSS_UserQuery($query); + $this->assertTrue($user_query->hasSearch()); + } + + public function testHasSearch_whenNoSearch_returnsFalse() { + $user_query = new FreshRSS_UserQuery(array()); + $this->assertFalse($user_query->hasSearch()); + } + + public function testHasParameters_whenAllQuery_returnsFalse() { + $query = array('get' => 'a'); + $user_query = new FreshRSS_UserQuery($query); + $this->assertFalse($user_query->hasParameters()); + } + + public function testHasParameters_whenNoParameter_returnsFalse() { + $query = array(); + $user_query = new FreshRSS_UserQuery($query); + $this->assertFalse($user_query->hasParameters()); + } + + public function testHasParameters_whenParameter_returnTrue() { + $query = array('get' => 's'); + $user_query = new FreshRSS_UserQuery($query); + $this->assertTrue($user_query->hasParameters()); + } + + public function testIsDeprecated_whenCategoryExists_returnFalse() { + $cat = $this->getMock('FreshRSS_Category'); + $cat_dao = $this->getMock('FreshRSS_Searchable'); + $cat_dao->expects($this->atLeastOnce()) + ->method('searchById') + ->withAnyParameters() + ->willReturn($cat); + $query = array('get' => 'c_1'); + $user_query = new FreshRSS_UserQuery($query, null, $cat_dao); + $this->assertFalse($user_query->isDeprecated()); + } + + public function testIsDeprecated_whenCategoryDoesNotExist_returnTrue() { + $cat_dao = $this->getMock('FreshRSS_Searchable'); + $cat_dao->expects($this->atLeastOnce()) + ->method('searchById') + ->withAnyParameters() + ->willReturn(null); + $query = array('get' => 'c_1'); + $user_query = new FreshRSS_UserQuery($query, null, $cat_dao); + $this->assertTrue($user_query->isDeprecated()); + } + + public function testIsDeprecated_whenFeedExists_returnFalse() { + $feed = $this->getMock('FreshRSS_Feed', array(), array('', false)); + $feed_dao = $this->getMock('FreshRSS_Searchable'); + $feed_dao->expects($this->atLeastOnce()) + ->method('searchById') + ->withAnyParameters() + ->willReturn($feed); + $query = array('get' => 'f_1'); + $user_query = new FreshRSS_UserQuery($query, $feed_dao, null); + $this->assertFalse($user_query->isDeprecated()); + } + + public function testIsDeprecated_whenFeedDoesNotExist_returnTrue() { + $feed_dao = $this->getMock('FreshRSS_Searchable'); + $feed_dao->expects($this->atLeastOnce()) + ->method('searchById') + ->withAnyParameters() + ->willReturn(null); + $query = array('get' => 'f_1'); + $user_query = new FreshRSS_UserQuery($query, $feed_dao, null); + $this->assertTrue($user_query->isDeprecated()); + } + + public function testIsDeprecated_whenAllQuery_returnFalse() { + $query = array('get' => 'a'); + $user_query = new FreshRSS_UserQuery($query); + $this->assertFalse($user_query->isDeprecated()); + } + + public function testIsDeprecated_whenFavoriteQuery_returnFalse() { + $query = array('get' => 's'); + $user_query = new FreshRSS_UserQuery($query); + $this->assertFalse($user_query->isDeprecated()); + } + + public function testIsDeprecated_whenUnknownQuery_returnFalse() { + $query = array('get' => 'q'); + $user_query = new FreshRSS_UserQuery($query); + $this->assertFalse($user_query->isDeprecated()); + } + +} diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 000000000..24340b15c --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,7 @@ +<?php + +error_reporting(E_ALL); +ini_set('display_errors', 1); + +require('../constants.php'); +require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader
\ No newline at end of file diff --git a/tests/phpunit.xml b/tests/phpunit.xml new file mode 100644 index 000000000..f639637ec --- /dev/null +++ b/tests/phpunit.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<phpunit bootstrap="bootstrap.php"> + <filter> + <whitelist> + <directory suffix=".php">../app</directory> + </whitelist> + </filter> + <testsuites> + <testsuite name="FreshRSS"> + <directory>app</directory> + </testsuite> + </testsuites> +</phpunit>
\ No newline at end of file |
