diff options
| author | 2018-02-24 12:02:16 +0100 | |
|---|---|---|
| committer | 2018-02-24 12:02:16 +0100 | |
| commit | 5ebeb9e3e5d46195a83211140c1d28d58be19b2a (patch) | |
| tree | 6b93ae52a1206b6045087f893dde67a04b4e1bda /app/Controllers/subscriptionController.php | |
| parent | 889888f20eb6f3dd476b78c0f59672f7c7962354 (diff) | |
| parent | 294f9336ad0f315574c74d6b527b1bb8a280f3c6 (diff) | |
Merge pull request #1786 from FreshRSS/dev1.10.0
FreshRSS 1.10.0
Diffstat (limited to 'app/Controllers/subscriptionController.php')
| -rw-r--r-- | app/Controllers/subscriptionController.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php index 6af048b84..37efd3b57 100644 --- a/app/Controllers/subscriptionController.php +++ b/app/Controllers/subscriptionController.php @@ -15,8 +15,10 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { } $catDAO = new FreshRSS_CategoryDAO(); + $feedDAO = new FreshRSS_FeedDAO(); $catDAO->checkDefault(); + $feedDAO->updateTTL(); $this->view->categories = $catDAO->listCategories(false); $this->view->default_category = $catDAO->getDefault(); } @@ -55,7 +57,7 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { * - display in main stream (default: 0) * - HTTP authentication * - number of article to retain (default: -2) - * - refresh frequency (default: -2) + * - refresh frequency (default: 0) * Default values are empty strings unless specified. */ public function feedAction() { @@ -87,6 +89,12 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { $cat = intval(Minz_Request::param('category', 0)); + $mute = Minz_Request::param('mute', false); + $ttl = intval(Minz_Request::param('ttl', FreshRSS_Feed::TTL_DEFAULT)); + if ($mute && FreshRSS_Feed::TTL_DEFAULT === $ttl) { + $ttl = FreshRSS_Context::$user_conf->ttl_default; + } + $values = array( 'name' => Minz_Request::param('name', ''), 'description' => sanitizeHTML(Minz_Request::param('description', '', true)), @@ -94,10 +102,10 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { 'url' => checkUrl(Minz_Request::param('url', '')), 'category' => $cat, 'pathEntries' => Minz_Request::param('path_entries', ''), - 'priority' => intval(Minz_Request::param('priority', 0)), + 'priority' => intval(Minz_Request::param('priority', FreshRSS_Feed::PRIORITY_MAIN_STREAM)), 'httpAuth' => $httpAuth, - 'keep_history' => intval(Minz_Request::param('keep_history', -2)), - 'ttl' => intval(Minz_Request::param('ttl', -2)), + 'keep_history' => intval(Minz_Request::param('keep_history', FreshRSS_Feed::KEEP_HISTORY_DEFAULT)), + 'ttl' => $ttl * ($mute ? -1 : 1), ); invalidateHttpCache(); |
