diff options
| author | 2019-07-25 16:51:48 +0200 | |
|---|---|---|
| committer | 2019-07-25 16:51:48 +0200 | |
| commit | 82611c9622ed23b0e9fcf5f9f651ddffa1fd7706 (patch) | |
| tree | fc2c97fd8dd84ec30473cb85b889d8326c9a831a /app | |
| parent | 744a9e8cf00aef7dec0acfa5f90f0dcfa2ef8837 (diff) | |
| parent | 042b40eeeea77db854daab1bec96fce5c2cdd4b2 (diff) | |
Merge pull request #2451 from FreshRSS/dev1.14.3
FreshRSS 1.14.3
Diffstat (limited to 'app')
32 files changed, 186 insertions, 106 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 0aed9b0a1..862bb10fb 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -243,7 +243,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { } } - public static function actualizeFeed($feed_id, $feed_url, $force, $simplePiePush = null, $isNewFeed = false, $noCommit = false) { + public static function actualizeFeed($feed_id, $feed_url, $force, $simplePiePush = null, $isNewFeed = false, $noCommit = false, $maxFeeds = 10) { @set_time_limit(300); $feedDAO = FreshRSS_Factory::createFeedDao(); @@ -262,6 +262,11 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $feeds = $feedDAO->listFeedsOrderUpdate(-1); } + // Set maxFeeds to a minimum of 10 + if (!is_int($maxFeeds) || $maxFeeds < 10) { + $maxFeeds = 10; + } + // 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); @@ -459,9 +464,9 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $updated_feeds++; unset($feed); - // No more than 10 feeds unless $force is true to avoid overloading + // No more than $maxFeeds feeds unless $force is true to avoid overloading // the server. - if ($updated_feeds >= 10 && !$force) { + if ($updated_feeds >= $maxFeeds && !$force) { break; } } @@ -497,6 +502,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $id = Minz_Request::param('id'); $url = Minz_Request::param('url'); $force = Minz_Request::param('force'); + $maxFeeds = (int)Minz_Request::param('maxFeeds'); $noCommit = Minz_Request::fetchPOST('noCommit', 0) == 1; if ($id == -1 && !$noCommit) { //Special request only to commit & refresh DB cache @@ -511,7 +517,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $databaseDAO = FreshRSS_Factory::createDatabaseDAO(); $databaseDAO->minorDbMaintenance(); } else { - list($updated_feeds, $feed, $nb_new_articles) = self::actualizeFeed($id, $url, $force, null, false, $noCommit); + list($updated_feeds, $feed, $nb_new_articles) = self::actualizeFeed($id, $url, $force, null, false, $noCommit, $maxFeeds); } if (Minz_Request::param('ajax')) { diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php index 824d65815..f536113dd 100755 --- a/app/Controllers/indexController.php +++ b/app/Controllers/indexController.php @@ -54,7 +54,7 @@ class FreshRSS_index_Controller extends Minz_ActionController { } }; - $this->view->callbackBeforeEntries = function ($view) { + $this->view->callbackBeforePagination = function ($view) { try { FreshRSS_Context::$number++; //+1 for pagination $entries = FreshRSS_index_Controller::listEntriesByContext(); diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php index 9cf41ed0b..79da39751 100644 --- a/app/Controllers/subscriptionController.php +++ b/app/Controllers/subscriptionController.php @@ -35,9 +35,20 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { $this->view->onlyFeedsWithError = Minz_Request::paramTernary('error'); $id = Minz_Request::param('id'); - if ($id !== false) { - $feedDAO = FreshRSS_Factory::createFeedDao(); - $this->view->feed = $feedDAO->searchById($id); + $this->view->displaySlider = false; + if (false !== $id) { + $type = Minz_Request::param('type'); + $this->view->displaySlider = true; + switch ($type) { + case 'category': + $categoryDAO = FreshRSS_Factory::createCategoryDao(); + $this->view->category = $categoryDAO->searchById($id); + break; + default: + $feedDAO = FreshRSS_Factory::createFeedDao(); + $this->view->feed = $feedDAO->searchById($id); + break; + } } } @@ -140,6 +151,35 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { } } + public function categoryAction() { + $this->view->_useLayout(false); + + $categoryDAO = FreshRSS_Factory::createCategoryDao(); + + $id = Minz_Request::param('id'); + $category = $categoryDAO->searchById($id); + if ($id === false || null === $category) { + Minz_Error::error(404); + return; + } + $this->view->category = $category; + + if (Minz_Request::isPost()) { + $values = array( + 'name' => Minz_Request::param('name', ''), + ); + + invalidateHttpCache(); + + $url_redirect = array('c' => 'subscription', 'params' => array('id' => $id, 'type' => 'category')); + if (false !== $categoryDAO->updateCategory($id, $values)) { + Minz_Request::good(_t('feedback.sub.category.updated'), $url_redirect); + } else { + Minz_Request::bad(_t('feedback.sub.category.error'), $url_redirect); + } + } + } + /** * This action displays the bookmarklet page. */ diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php index be3787561..6d0fced5b 100644 --- a/app/Controllers/userController.php +++ b/app/Controllers/userController.php @@ -38,7 +38,7 @@ class FreshRSS_user_Controller extends Minz_ActionController { * The username is also used as folder name, file name, and part of SQL table name. * '_' is a reserved internal username. */ - const USERNAME_PATTERN = '[0-9a-zA-Z_][0-9a-zA-Z_.]{1,38}|[0-9a-zA-Z]'; + const USERNAME_PATTERN = '([0-9a-zA-Z_][0-9a-zA-Z_.@-]{1,38}|[0-9a-zA-Z])'; public static function checkUsername($username) { return preg_match('/^' . self::USERNAME_PATTERN . '$/', $username) === 1; diff --git a/app/FreshRSS.php b/app/FreshRSS.php index ecf13e4cf..8f614c538 100644 --- a/app/FreshRSS.php +++ b/app/FreshRSS.php @@ -68,9 +68,12 @@ class FreshRSS extends Minz_FrontController { ' [HTTP_REFERER=' . htmlspecialchars($http_referer, ENT_NOQUOTES, 'UTF-8') . ']' ))); } - if ((!FreshRSS_Auth::isCsrfOk()) && - (Minz_Request::controllerName() !== 'auth' || Minz_Request::actionName() !== 'login')) { - // Token-based protection against XSRF attacks, except for the login form itself + if (!(FreshRSS_Auth::isCsrfOk() || + (Minz_Request::controllerName() === 'auth' && Minz_Request::actionName() === 'login') || + (Minz_Request::controllerName() === 'user' && Minz_Request::actionName() === 'create' && + !FreshRSS_Auth::hasAccess('admin')) + )) { + // Token-based protection against XSRF attacks, except for the login or self-create user forms Minz_Translate::init('en'); //TODO: Better choice of fallback language Minz_Error::error(403, array('error' => array( _t('feedback.access.denied'), diff --git a/app/Models/Category.php b/app/Models/Category.php index 240dbca73..fa711aa66 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -7,6 +7,7 @@ class FreshRSS_Category extends Minz_Model { private $nbNotRead = -1; private $feeds = null; private $hasFeedsWithError = false; + private $isDefault = false; public function __construct($name = '', $feeds = null) { $this->_name($name); @@ -28,6 +29,9 @@ class FreshRSS_Category extends Minz_Model { public function name() { return $this->name; } + public function isDefault() { + return $this->isDefault; + } public function nbFeed() { if ($this->nbFeed < 0) { $catDAO = FreshRSS_Factory::createCategoryDao(); @@ -70,6 +74,9 @@ class FreshRSS_Category extends Minz_Model { public function _name($value) { $this->name = trim($value); } + public function _isDefault($value) { + $this->isDefault = $value; + } public function _feeds($values) { if (!is_array($values)) { $values = array($values); diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php index ba7eb765e..6535adae7 100644 --- a/app/Models/CategoryDAO.php +++ b/app/Models/CategoryDAO.php @@ -282,6 +282,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo implements FreshRSS_Searchable $dao['name'] ); $cat->_id($dao['id']); + $cat->_isDefault(static::DEFAULTCATEGORYID === intval($dao['id'])); $list[$key] = $cat; } diff --git a/app/i18n/cz/sub.php b/app/i18n/cz/sub.php index 2e81c928d..b2bdf416b 100644 --- a/app/i18n/cz/sub.php +++ b/app/i18n/cz/sub.php @@ -14,7 +14,9 @@ return array( '_' => 'Kategorie', 'add' => 'Přidat kategorii', 'empty' => 'Vyprázdit kategorii', + 'information' => 'Informace', 'new' => 'Nová kategorie', + 'title' => 'Název', ), 'feed' => array( 'add' => 'Přidat RSS kanál', @@ -37,7 +39,7 @@ return array( '_' => 'Filter actions', //TODO - Translation 'help' => 'Write one search filter per line.', //TODO - Translation ), - 'informations' => 'Informace', + 'information' => '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>.', 'mute' => 'mute', //TODO - Translation diff --git a/app/i18n/de/sub.php b/app/i18n/de/sub.php index bd050671e..abc01b954 100644 --- a/app/i18n/de/sub.php +++ b/app/i18n/de/sub.php @@ -14,7 +14,9 @@ return array( '_' => 'Kategorie', 'add' => 'Eine Kategorie hinzufügen', 'empty' => 'Leere Kategorie', + 'information' => 'Information', 'new' => 'Neue Kategorie', + 'title' => 'Titel', ), 'feed' => array( 'add' => 'Einen RSS-Feed hinzufügen', @@ -37,7 +39,7 @@ return array( '_' => 'Filter actions', //TODO - Translation 'help' => 'Write one search filter per line.', //TODO - Translation ), - 'informations' => 'Information', + 'information' => '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.', 'mute' => 'Stumm schalten', diff --git a/app/i18n/en/sub.php b/app/i18n/en/sub.php index f11eb9b99..fde01f9df 100644 --- a/app/i18n/en/sub.php +++ b/app/i18n/en/sub.php @@ -14,7 +14,9 @@ return array( '_' => 'Category', 'add' => 'Add a category', 'empty' => 'Empty category', + 'information' => 'Information', 'new' => 'New category', + 'title' => 'Title', ), 'feed' => array( 'add' => 'Add a RSS feed', @@ -37,7 +39,7 @@ return array( '_' => 'Filter actions', 'help' => 'Write one search filter per line.', ), - 'informations' => 'Information', + 'information' => '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>.', 'mute' => 'mute', diff --git a/app/i18n/es/sub.php b/app/i18n/es/sub.php index c0526106f..7d33c59fa 100755 --- a/app/i18n/es/sub.php +++ b/app/i18n/es/sub.php @@ -14,7 +14,9 @@ return array( '_' => 'Categoría', 'add' => 'Añadir a la categoría', 'empty' => 'Vaciar categoría', + 'information' => 'Información', 'new' => 'Nueva categoría', + 'title' => 'Título', ), 'feed' => array( 'add' => 'Añadir fuente RSS', @@ -37,7 +39,7 @@ return array( '_' => 'Filter actions', //TODO - Translation 'help' => 'Write one search filter per line.', //TODO - Translation ), - 'informations' => 'Información', + 'information' => 'Información', 'keep_history' => 'Número mínimo de artículos a conservar', 'moved_category_deleted' => 'Al borrar una categoría todas sus fuentes pasan automáticamente a la categoría <em>%s</em>.', 'mute' => 'mute', //TODO - Translation diff --git a/app/i18n/fr/sub.php b/app/i18n/fr/sub.php index b71019faa..df44150c2 100644 --- a/app/i18n/fr/sub.php +++ b/app/i18n/fr/sub.php @@ -14,7 +14,9 @@ return array( '_' => 'Catégorie', 'add' => 'Ajouter une catégorie', 'empty' => 'Catégorie vide', + 'information' => 'Informations', 'new' => 'Nouvelle catégorie', + 'title' => 'Titre', ), 'feed' => array( 'add' => 'Ajouter un flux RSS', @@ -37,7 +39,7 @@ return array( '_' => 'Filtres d’action', 'help' => 'Écrivez une recherche par ligne.', ), - 'informations' => 'Informations', + 'information' => '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>.', 'mute' => 'muet', diff --git a/app/i18n/he/sub.php b/app/i18n/he/sub.php index bb2025bc3..8a629defb 100644 --- a/app/i18n/he/sub.php +++ b/app/i18n/he/sub.php @@ -14,7 +14,9 @@ return array( '_' => 'קטגוריה', 'add' => 'הוספת קטגוריה', 'empty' => 'Empty category', //TODO - Translation + 'information' => 'מידע', 'new' => 'קטגוריה חדשה', + 'title' => 'כותרת', ), 'feed' => array( 'add' => 'הוספת הזנה', @@ -37,7 +39,7 @@ return array( '_' => 'Filter actions', //TODO - Translation 'help' => 'Write one search filter per line.', //TODO - Translation ), - 'informations' => 'מידע', + 'information' => 'מידע', 'keep_history' => 'מסםר מינימלי של מאמרים לשמור', 'moved_category_deleted' => 'כאשר הקטגוריה נמחקת ההזנות שבתוכה אוטומטית מקוטלגות תחת <em>%s</em>.', 'mute' => 'mute', //TODO - Translation diff --git a/app/i18n/it/sub.php b/app/i18n/it/sub.php index bf279e059..50738d9e3 100644 --- a/app/i18n/it/sub.php +++ b/app/i18n/it/sub.php @@ -14,7 +14,9 @@ return array( '_' => 'Categoria', 'add' => 'Aggiungi una categoria', 'empty' => 'Categoria vuota', + 'information' => 'Informazioni', 'new' => 'Nuova categoria', + 'title' => 'Titolo', ), 'feed' => array( 'add' => 'Aggiungi un Feed RSS', @@ -37,7 +39,7 @@ return array( '_' => 'Filter actions', //TODO - Translation 'help' => 'Write one search filter per line.', //TODO - Translation ), - 'informations' => 'Informazioni', + 'information' => '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>.', 'mute' => 'mute', //TODO - Translation diff --git a/app/i18n/kr/sub.php b/app/i18n/kr/sub.php index 151775c1c..f8eccfa27 100644 --- a/app/i18n/kr/sub.php +++ b/app/i18n/kr/sub.php @@ -14,7 +14,9 @@ return array( '_' => '카테고리', 'add' => '카테고리 추가', 'empty' => '빈 카테고리', + 'information' => '정보', 'new' => '새 카테고리', + 'title' => '제목', ), 'feed' => array( 'add' => 'RSS 피드 추가', @@ -37,7 +39,7 @@ return array( '_' => 'Filter actions', //TODO - Translation 'help' => 'Write one search filter per line.', //TODO - Translation ), - 'informations' => '정보', + 'information' => '정보', 'keep_history' => '최소 유지 글 개수', 'moved_category_deleted' => '카테고리를 삭제하면, 해당 카테고리 아래에 있던 피드들은 자동적으로 <em>%s</em> 아래로 분류됩니다.', 'mute' => '무기한 새로고침 금지', diff --git a/app/i18n/nl/sub.php b/app/i18n/nl/sub.php index 8ba9c020d..b59515f42 100644 --- a/app/i18n/nl/sub.php +++ b/app/i18n/nl/sub.php @@ -14,7 +14,9 @@ return array( '_' => 'Categorie', 'add' => 'Voeg categorie toe', 'empty' => 'Lege categorie', + 'information' => 'Informatie', 'new' => 'Nieuwe categorie', + 'title' => 'Titel', ), 'feed' => array( 'add' => 'Voeg een RSS feed toe', @@ -37,7 +39,7 @@ return array( '_' => 'Filter actions', //TODO - Translation 'help' => 'Write one search filter per line.', //TODO - Translation ), - 'informations' => 'Informatie', + 'information' => '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>.', 'mute' => 'demp', diff --git a/app/i18n/oc/sub.php b/app/i18n/oc/sub.php index 5a7bb2b57..eae9dff29 100644 --- a/app/i18n/oc/sub.php +++ b/app/i18n/oc/sub.php @@ -13,7 +13,9 @@ return array( '_' => 'Categoria', 'add' => 'Ajustar una categoria', 'empty' => 'Categoria voida', + 'information' => 'Informacions', 'new' => 'Nòva categoria', + 'title' => 'Títol', ), 'feed' => array( 'add' => 'Ajustar un flux RSS', @@ -36,7 +38,7 @@ return array( '_' => 'Filtre d’accion', 'help' => 'Escrivètz una recèrca per linha.', ), - 'informations' => 'Informacions', + 'information' => 'Informacions', 'keep_history' => 'Nombre minimum d’articles de servar', 'moved_category_deleted' => 'Quand escafatz una categoria, sos fluxes son automaticament classats dins <em>%s</em>.', 'mute' => 'mut', diff --git a/app/i18n/pt-br/sub.php b/app/i18n/pt-br/sub.php index fc26e89e7..d4bea33c4 100644 --- a/app/i18n/pt-br/sub.php +++ b/app/i18n/pt-br/sub.php @@ -14,7 +14,9 @@ return array( '_' => 'Categoria', 'add' => 'Adicionar uma categoria', 'empty' => 'Categoria vazia', + 'information' => 'Informações', 'new' => 'Nova categoria', + 'title' => 'Título', ), 'feed' => array( 'add' => 'Adicionar um RSS feed', @@ -37,7 +39,7 @@ return array( '_' => 'Filter actions', //TODO - Translation 'help' => 'Write one search filter per line.', //TODO - Translation ), - 'informations' => 'Informações', + 'information' => 'Informações', 'keep_history' => 'Número mínimo de artigos para manter', 'moved_category_deleted' => 'Quando você deleta uma categoria, seus feeds são automaticamente classificados como <em>%s</em>.', 'mute' => 'mute', //TODO - Translation diff --git a/app/i18n/ru/sub.php b/app/i18n/ru/sub.php index e125d549e..a2c4e4690 100644 --- a/app/i18n/ru/sub.php +++ b/app/i18n/ru/sub.php @@ -14,7 +14,9 @@ return array( '_' => 'Category', //TODO - Translation 'add' => 'Add a category', //TODO - Translation 'empty' => 'Empty category', //TODO - Translation + 'information' => 'Information', //TODO - Translation 'new' => 'New category', //TODO - Translation + 'title' => 'Title', //TODO - Translation ), 'feed' => array( 'add' => 'Add a RSS feed', //TODO - Translation @@ -37,7 +39,7 @@ return array( '_' => 'Filter actions', //TODO - Translation 'help' => 'Write one search filter per line.', //TODO - Translation ), - 'informations' => 'Information', //TODO - Translation + 'information' => 'Information', //TODO - Translation 'keep_history' => 'Minimum number of articles to keep', //TODO - Translation 'moved_category_deleted' => 'When you delete a category, its feeds are automatically classified under <em>%s</em>.', //TODO - Translation 'mute' => 'mute', //TODO - Translation diff --git a/app/i18n/tr/sub.php b/app/i18n/tr/sub.php index 9f4945c0a..858d15758 100644 --- a/app/i18n/tr/sub.php +++ b/app/i18n/tr/sub.php @@ -14,7 +14,9 @@ return array( '_' => 'Kategori', 'add' => 'Kategori ekle', 'empty' => 'Boş kategori', + 'information' => 'Bilgi', 'new' => 'Yeni kategori', + 'title' => 'Başlık', ), 'feed' => array( 'add' => 'RSS akışı ekle', @@ -37,7 +39,7 @@ return array( '_' => 'Filter actions', //TODO - Translation 'help' => 'Write one search filter per line.', //TODO - Translation ), - 'informations' => 'Bilgi', + 'information' => '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.', 'mute' => 'mute', //TODO - Translation diff --git a/app/i18n/zh-cn/sub.php b/app/i18n/zh-cn/sub.php index 90f9fd942..bf517756b 100644 --- a/app/i18n/zh-cn/sub.php +++ b/app/i18n/zh-cn/sub.php @@ -14,7 +14,9 @@ return array( '_' => '分类', 'add' => '添加分类', 'empty' => '空分类', + 'information' => '信息', 'new' => '新分类', + 'title' => '标题', ), 'feed' => array( 'add' => '添加 RSS 源', @@ -37,7 +39,7 @@ return array( '_' => 'Filter actions', //TODO - Translation 'help' => 'Write one search filter per line.', //TODO - Translation ), - 'informations' => '信息', + 'information' => '信息', 'keep_history' => '至少保存的文章数', 'moved_category_deleted' => '删除分类时,其中的 RSS 源会自动归类到 <em>%s</em>', 'mute' => '暂停', diff --git a/app/install.php b/app/install.php index b15cc76ea..961a7c171 100644 --- a/app/install.php +++ b/app/install.php @@ -125,7 +125,9 @@ function saveStep2() { $_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('/[^0-9a-zA-Z_]/', '', param('default_user', '')), 0, 38); + if (FreshRSS_user_Controller::checkUsername(param('default_user', ''))) { + $_SESSION['default_user'] = param('default_user', ''); + } $password_plain = param('passwordPlain', false); if ($password_plain !== false && cryptAvailable()) { @@ -605,18 +607,18 @@ function printStep3() { <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_mysql')) {?> + <option value="mysql" + <?php echo(isset($_SESSION['bd_type']) && $_SESSION['bd_type'] === 'mysql') ? 'selected="selected"' : ''; ?>> + MySQL + </option> + <?php }?> <?php if (extension_loaded('pdo_pgsql')) {?> <option value="pgsql" <?php echo(isset($_SESSION['bd_type']) && $_SESSION['bd_type'] === 'pgsql') ? 'selected="selected"' : ''; ?>> @@ -722,6 +724,7 @@ case 5: <head> <meta charset="UTF-8" /> <meta name="viewport" content="initial-scale=1.0" /> + <script id="jsonVars" type="application/json">{}</script> <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'); ?>" /> diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 4d860a54c..af7267bac 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -1,4 +1,11 @@ -<?php $actual_view = Minz_Request::actionName(); ?> +<?php + $actual_view = Minz_Request::actionName(); + + flush(); + if (isset($this->callbackBeforePagination)) { + call_user_func($this->callbackBeforePagination, $this); + } +?> <div class="nav_menu"> <?php if ($actual_view === 'normal' || $actual_view === 'reader' ) { ?> diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtml index 70a274edd..412ea676d 100644 --- a/app/views/configure/shortcut.phtml +++ b/app/views/configure/shortcut.phtml @@ -65,33 +65,33 @@ </div> </div> - <p class="alert alert-warn"><?php echo _t('conf.shortcut.navigation_no_mod_help');?></p> - <div class="form-group"> - <label class="group-name" for="skip_next_entry"><?php echo _t('conf.shortcut.skip_next_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="skip_next_entry" name="shortcuts[skip_next_entry]" list="keys" value="<?php echo $s['skip_next_entry']; ?>" data-leave-validation="<?php echo $s['skip_next_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="skip_prev_entry"><?php echo _t('conf.shortcut.skip_previous_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="skip_prev_entry" name="shortcuts[skip_prev_entry]" list="keys" value="<?php echo $s['skip_prev_entry']; ?>" data-leave-validation="<?php echo $s['skip_prev_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> + <p class="alert alert-warn"><?php echo _t('conf.shortcut.navigation_no_mod_help');?></p> + <div class="form-group"> - <label class="group-name" for="first_entry"><?php echo _t('conf.shortcut.first_article'); ?></label> + <label class="group-name" for="skip_next_entry"><?php echo _t('conf.shortcut.skip_next_article'); ?></label> <div class="group-controls"> - <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']; ?>"/> + <input type="text" id="skip_next_entry" name="shortcuts[skip_next_entry]" list="keys" value="<?php echo $s['skip_next_entry']; ?>" data-leave-validation="<?php echo $s['skip_next_entry']; ?>"/> </div> </div> <div class="form-group"> - <label class="group-name" for="last_entry"><?php echo _t('conf.shortcut.last_article'); ?></label> + <label class="group-name" for="skip_prev_entry"><?php echo _t('conf.shortcut.skip_previous_article'); ?></label> <div class="group-controls"> - <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']; ?>"/> + <input type="text" id="skip_prev_entry" name="shortcuts[skip_prev_entry]" list="keys" value="<?php echo $s['skip_prev_entry']; ?>" data-leave-validation="<?php echo $s['skip_prev_entry']; ?>"/> </div> </div> diff --git a/app/views/feed/add.phtml b/app/views/feed/add.phtml index 823cf1b2f..340970b25 100644 --- a/app/views/feed/add.phtml +++ b/app/views/feed/add.phtml @@ -8,7 +8,7 @@ <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> + <legend><?php echo _t('sub.feed.information'); ?></legend> <?php if ($this->load_ok) { ?> <div class="form-group"> <label class="group-name"><?php echo _t('sub.feed.title'); ?></label> diff --git a/app/views/helpers/category/update.phtml b/app/views/helpers/category/update.phtml new file mode 100644 index 000000000..a2ee3e2ef --- /dev/null +++ b/app/views/helpers/category/update.phtml @@ -0,0 +1,34 @@ +<div class="post"> + <h1><?php echo $this->category->name(); ?></h1> + + <div> + <a href="<?php echo _url('index', 'index', 'get', 'c_' . $this->category->id()); ?>"><?php echo _i('link'); ?> <?php echo _t('gen.action.filter'); ?></a> + </div> + + <form method="post" action="<?php echo _url('subscription', 'category', 'id', $this->category->id()); ?>" autocomplete="off"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('sub.category.information'); ?></legend> + <div class="form-group"> + <label class="group-name" for="name"><?php echo _t('sub.category.title'); ?></label> + <div class="group-controls"> + <input type="text" name="name" id="name" class="extend" value="<?php echo $this->category->name() ; ?>" /> + </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('category', 'empty', 'id', $this->category->id()); ?>" + formmethod="post"><?php echo _t('gen.action.empty'); ?></button> + <?php if (!$this->category->isDefault()): ?> + <button class="btn btn-attention confirm" + data-str-confirm="<?php echo _t('gen.js.confirm_action_feed_cat'); ?>" + formaction="<?php echo _url('category', 'delete', 'id', $this->category->id()); ?>" + formmethod="post"><?php echo _t('gen.action.remove'); ?></button> + <?php endif;?> + </div> + </div> + </form> +</div> diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml index be8034c0d..620806d7b 100644 --- a/app/views/helpers/feed/update.phtml +++ b/app/views/helpers/feed/update.phtml @@ -19,7 +19,7 @@ <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> + <legend><?php echo _t('sub.feed.information'); ?></legend> <div class="form-group"> <label class="group-name" for="name"><?php echo _t('sub.feed.title'); ?></label> <div class="group-controls"> @@ -240,7 +240,7 @@ <div class="group-controls"> <textarea name="filteractions_read" id="filteractions_read"><?php foreach ($this->feed->filtersAction('read') as $filterRead) { - echo htmlspecialchars($filterRead->getRawInput(), ENT_NOQUOTES, 'UTF-8'), "\n\n"; + echo htmlspecialchars($filterRead->getRawInput(), ENT_NOQUOTES, 'UTF-8'), PHP_EOL; } ?></textarea> <?php echo _i('help'); ?> <?php echo _t('sub.feed.filteractions.help'); ?> diff --git a/app/views/index/global.phtml b/app/views/index/global.phtml index 3566abe7e..2f25b6dc2 100644 --- a/app/views/index/global.phtml +++ b/app/views/index/global.phtml @@ -1,11 +1,6 @@ <?php $this->partial('nav_menu'); - flush(); - if (isset($this->callbackBeforeEntries)) { - call_user_func($this->callbackBeforeEntries, $this); - } - $class = ''; if (FreshRSS_Context::$user_conf->hide_read_feeds && FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) && diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml index d5ae8e2f9..ac2ea812d 100644 --- a/app/views/index/normal.phtml +++ b/app/views/index/normal.phtml @@ -3,11 +3,6 @@ $this->partial('aside_feed'); $this->partial('nav_menu'); -flush(); -if (isset($this->callbackBeforeEntries)) { - call_user_func($this->callbackBeforeEntries, $this); -} - if (!empty($this->entries)) { $display_today = true; $display_yesterday = true; diff --git a/app/views/index/reader.phtml b/app/views/index/reader.phtml index fbe37d2e3..129fae937 100644 --- a/app/views/index/reader.phtml +++ b/app/views/index/reader.phtml @@ -2,11 +2,6 @@ $this->partial('aside_feed'); $this->partial('nav_menu'); -flush(); -if (isset($this->callbackBeforeEntries)) { - call_user_func($this->callbackBeforeEntries, $this); -} - if (!empty($this->entries)) { $lazyload = FreshRSS_Context::$user_conf->lazyload; $content_width = FreshRSS_Context::$user_conf->content_width; diff --git a/app/views/subscription/category.phtml b/app/views/subscription/category.phtml new file mode 100644 index 000000000..38746f23c --- /dev/null +++ b/app/views/subscription/category.phtml @@ -0,0 +1,5 @@ +<?php + +if ($this->category) { + $this->renderHelper('category/update'); +} diff --git a/app/views/subscription/index.phtml b/app/views/subscription/index.phtml index 8b196cb00..20f72ad66 100644 --- a/app/views/subscription/index.phtml +++ b/app/views/subscription/index.phtml @@ -80,50 +80,9 @@ ?> <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> + <a class="configure open-slider" href="<?php echo _url('subscription', 'category', 'id', $cat->id()); ?>"><?php echo _i('configure'); ?></a> + <?php echo $cat->name(); ?> </div> - <ul class="box-content" data-cat-id="<?php echo $cat->id(); ?>"> <?php if (!empty($feeds)) { ?> <?php @@ -159,12 +118,14 @@ </ul> </div> -<?php $class = isset($this->feed) ? ' class="active"' : ''; ?> +<?php $class = $this->displaySlider ? ' 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'); + } elseif (isset($this->category)) { + $this->renderHelper('category/update'); } ?> </div> |
