diff options
| author | 2019-10-31 18:15:47 +0100 | |
|---|---|---|
| committer | 2019-10-31 18:15:47 +0100 | |
| commit | 3aa66f317b496ccd9a2df914bbc747c52081a7ad (patch) | |
| tree | 6a3f3f74899801abdca00546e213dfdc141c53cf /app/views/helpers | |
| parent | 82611c9622ed23b0e9fcf5f9f651ddffa1fd7706 (diff) | |
| parent | fcae48f313d399050cb15f37a8a73ae52fc67796 (diff) | |
Merge pull request #2599 from FreshRSS/dev1.15.0
FreshRSS 1.15
Diffstat (limited to 'app/views/helpers')
| -rw-r--r-- | app/views/helpers/category/update.phtml | 154 | ||||
| -rw-r--r-- | app/views/helpers/export/articles.phtml | 5 | ||||
| -rw-r--r-- | app/views/helpers/extension/configure.phtml | 8 | ||||
| -rw-r--r-- | app/views/helpers/extension/details.phtml | 12 | ||||
| -rw-r--r-- | app/views/helpers/feed/update.phtml | 267 | ||||
| -rw-r--r-- | app/views/helpers/index/normal/entry_bottom.phtml | 38 | ||||
| -rw-r--r-- | app/views/helpers/index/normal/entry_header.phtml | 26 | ||||
| -rwxr-xr-x | app/views/helpers/logs_pagination.phtml | 12 | ||||
| -rwxr-xr-x | app/views/helpers/pagination.phtml | 16 |
9 files changed, 388 insertions, 150 deletions
diff --git a/app/views/helpers/category/update.phtml b/app/views/helpers/category/update.phtml index a2ee3e2ef..9e55e613d 100644 --- a/app/views/helpers/category/update.phtml +++ b/app/views/helpers/category/update.phtml @@ -1,34 +1,160 @@ <div class="post"> - <h1><?php echo $this->category->name(); ?></h1> + <h1><?= $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> + <a href="<?= _url('index', 'index', 'get', 'c_' . $this->category->id()) ?>"><?= _i('link') ?> <?= _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> + <form method="post" action="<?= _url('subscription', 'category', 'id', $this->category->id()) ?>" autocomplete="off"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <legend><?= _t('sub.category.information') ?></legend> <div class="form-group"> - <label class="group-name" for="name"><?php echo _t('sub.category.title'); ?></label> + <label class="group-name" for="name"><?= _t('sub.category.title') ?></label> <div class="group-controls"> - <input type="text" name="name" id="name" class="extend" value="<?php echo $this->category->name() ; ?>" /> + <input type="text" name="name" id="name" class="extend" value="<?= $this->category->name() ?>" <?php + //Disallow changing the name of the default category + echo $this->category->id() == FreshRSS_CategoryDAO::DEFAULTCATEGORYID ? 'disabled="disabled"' : ''; + ?> /> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="position"><?= _t('sub.category.position') ?></label> + <div class="group-controls"> + <input type="number" name="position" id="position" min="1" value="<?= $this->category->attributes('position') ?>" /> + <?= _i('help') ?> <?= _t('sub.category.position_help') ?> </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-important"><?= _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> + data-str-confirm="<?= _t('gen.js.confirm_action_feed_cat') ?>" + formaction="<?= _url('category', 'empty', 'id', $this->category->id()) ?>" + formmethod="post"><?= _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> + data-str-confirm="<?= _t('gen.js.confirm_action_feed_cat') ?>" + formaction="<?= _url('category', 'delete', 'id', $this->category->id()) ?>" + formmethod="post"><?= _t('gen.action.remove') ?></button> <?php endif;?> </div> </div> + + <legend><?= _t('sub.category.archiving') ?></legend> + <?php + $archiving = $this->category->attributes('archiving'); + if (empty($archiving)) { + $archiving = [ 'default' => true ]; + } else { + $archiving['default'] = false; + } + $volatile = [ + 'enable_keep_period' => false, + 'keep_period_count' => '3', + 'keep_period_unit' => 'P1M', + ]; + if (!empty($archiving['keep_period'])) { + if (preg_match('/^PT?(?P<count>\d+)[YMWDH]$/', $archiving['keep_period'], $matches)) { + $volatile['enable_keep_period'] = true; + $volatile['keep_period_count'] = $matches['count']; + $volatile['keep_period_unit'] = str_replace($matches['count'], '1', $archiving['keep_period']); + } + } + //Defaults + if (!isset($archiving['keep_max'])) { + $archiving['keep_max'] = false; + } + if (!isset($archiving['keep_favourites'])) { + $archiving['keep_favourites'] = true; + } + if (!isset($archiving['keep_labels'])) { + $archiving['keep_labels'] = true; + } + if (!isset($archiving['keep_unreads'])) { + $archiving['keep_unreads'] = false; + } + if (!isset($archiving['keep_min'])) { + $archiving['keep_min'] = 50; + } + ?> + + <p class="alert alert-warn"> + <?= _t('conf.archiving.policy_warning') ?> + </p> + + <div class="form-group"> + <label class="group-name"><?= _t('conf.archiving.policy') ?></label> + <div class="group-controls"> + <label class="checkbox"> + <input type="checkbox" name="use_default_purge_options" id="use_default_purge_options" value="1"<?= $archiving['default'] ? ' checked="checked"' : '' ?> data-leave-validation="<?= $archiving['default'] ? 1 : 0 ?>" /> + <?= _t('gen.short.by_default') ?> + </label> + </div> + </div> + <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>> + <div class="group-controls"> + <label class="checkbox" for="enable_keep_max"> + <input type="checkbox" name="enable_keep_max" id="enable_keep_max" value="1"<?= empty($archiving['keep_max']) ? '' : ' checked="checked"' ?> data-leave-validation="<?= empty($archiving['keep_max']) ? 0 : 1 ?>"/> + <?= _t('conf.archiving.keep_max') ?> + <input type="number" id="keep_max" name="keep_max" min="0" value="<?= empty($archiving['keep_max']) ? 200 : $archiving['keep_max'] ?>" data-leave-validation="<?= empty($archiving['keep_max']) ? 200 : $archiving['keep_max'] ?>"/> + </label> + </div> + </div> + <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>> + <div class="group-controls"> + <label class="checkbox" for="enable_keep_period"> + <input type="checkbox" name="enable_keep_period" id="enable_keep_period" value="1"<?= $volatile['enable_keep_period'] ? ' checked="checked"' : '' ?> data-leave-validation="<?= $volatile['enable_keep_period'] ? 1 : 0 ?>"/> + <?= _t('conf.archiving.keep_period') ?> + <input type="number" id="keep_period_count" name="keep_period_count" min="0" value="<?= $volatile['keep_period_count'] ?>" data-leave-validation="<?= $volatile['keep_period_count'] ?>"/> + <select class="number" name="keep_period_unit" id="keep_period_unit" data-leave-validation="<?= $volatile['keep_period_unit'] ?>"> + <option></option> + <option value="P1Y" <?= 'P1Y' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.years') ?></option> + <option value="P1M" <?= 'P1M' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.months') ?></option> + <option value="P1W" <?= 'P1W' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.weeks') ?></option> + <option value="P1D" <?= 'P1D' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.days') ?></option> + <option value="PT1H" <?= 'PT1H' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.hours') ?></option> + </select> + </label> + </div> + </div> + <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>> + <label class="group-name"><?= _t('conf.archiving.exception') ?></label> + <div class="group-controls"> + <label class="checkbox" for="keep_favourites"> + <input type="checkbox" name="keep_favourites" id="keep_favourites" value="1"<?= $archiving['keep_favourites'] ? ' checked="checked"' : '' ?> data-leave-validation="<?= $archiving['keep_favourites'] ? 1 : 0 ?>"/> + <?= _t('conf.archiving.keep_favourites') ?> + </label> + </div> + </div> + <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>> + <div class="group-controls"> + <label class="checkbox" for="keep_labels"> + <input type="checkbox" name="keep_labels" id="keep_labels" value="1"<?= $archiving['keep_labels'] ? ' checked="checked"' : '' ?> data-leave-validation="<?= $archiving['keep_labels'] ? 1 : 0 ?>"/> + <?= _t('conf.archiving.keep_labels') ?> + </label> + </div> + </div> + <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>> + <div class="group-controls"> + <label class="checkbox" for="keep_unreads"> + <input type="checkbox" name="keep_unreads" id="keep_unreads" value="1"<?= $archiving['keep_unreads'] ? ' checked="checked"' : '' ?> data-leave-validation="<?= $archiving['keep_unreads'] ? 1 : 0 ?>"/> + <?= _t('conf.archiving.keep_unreads') ?> + </label> + </div> + </div> + <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>> + <div class="group-controls"> + <label for="keep_min"><?= _t('sub.feed.keep_min') ?> + <input type="number" id="keep_min" name="keep_min" min="0" value="<?= $archiving['keep_min'] ?>" data-leave-validation="<?= $archiving['keep_min'] ?>"> + </label> + </div> + </div> + <div class="form-group form-actions"> + <div class="group-controls"> + <button class="btn btn-important"><?= _t('gen.action.submit') ?></button> + <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button> + </div> + </div> </form> </div> diff --git a/app/views/helpers/export/articles.phtml b/app/views/helpers/export/articles.phtml index 2d1fcd133..0bbfb86ec 100644 --- a/app/views/helpers/export/articles.phtml +++ b/app/views/helpers/export/articles.phtml @@ -1,10 +1,7 @@ <?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; -} +$options = JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; $articles = array( 'id' => 'user/' . str_replace('/', '', $username) . '/state/org.freshrss/' . $this->type, diff --git a/app/views/helpers/extension/configure.phtml b/app/views/helpers/extension/configure.phtml index cde872aa0..cb6ebd6bb 100644 --- a/app/views/helpers/extension/configure.phtml +++ b/app/views/helpers/extension/configure.phtml @@ -1,19 +1,19 @@ <div class="post"> <h1> - <?php echo $this->extension->getName(); ?> (<?php echo $this->extension->getVersion(); ?>) — + <?= $this->extension->getName() ?> (<?= $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> + <p class="alert alert-warn"><?= $this->extension->getDescription() ?> — <?= _t('gen.short.by_author'), ' ', $this->extension->getAuthor() ?></p> - <h2><?php echo _t('gen.action.manage'); ?></h2> + <h2><?= _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> + <p class="alert alert-warn"><?= _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 index acba4e816..ed9674e3d 100644 --- a/app/views/helpers/extension/details.phtml +++ b/app/views/helpers/extension/details.phtml @@ -3,19 +3,19 @@ <?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> + <a class="btn open-slider" href="<?= _url('extension', 'configure', 'e', $name_encoded) ?>"><?= _i('configure') ?> <?= _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> + <button class="btn active" form="form-extension" formaction="<?= _url('extension', 'disable', 'e', $name_encoded) ?>"><?= _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> + <button class="btn" form="form-extension" formaction="<?= _url('extension', 'enable', 'e', $name_encoded) ?>"><?= _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> + <button class="btn btn-attention confirm" form="form-extension" formaction="<?= _url('extension', 'remove', 'e', $name_encoded) ?>"><?= _t('gen.action.remove') ?></button> <?php } ?> </div> <?php } else { ?> - <?php echo _t('admin.extensions.system.no_rights'); ?> + <?= _t('admin.extensions.system.no_rights') ?> <?php } ?> </li> - <li class="item"><?php echo $this->ext_details->getName(); ?></li> + <li class="item"><?= $this->ext_details->getName() ?></li> </ul> diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml index 620806d7b..e5f186956 100644 --- a/app/views/helpers/feed/update.phtml +++ b/app/views/helpers/feed/update.phtml @@ -1,114 +1,214 @@ <div class="post"> - <h1><?php echo $this->feed->name(); ?></h1> + <h1><?= $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> + <a href="<?= _url('index', 'index', 'get', 'f_' . $this->feed->id()) ?>"><?= _i('link') ?> <?= _t('gen.action.filter') ?></a> + <?= _t('gen.short.or') ?> + <a href="<?= _url('stats', 'repartition', 'id', $this->feed->id()) ?>"><?= _i('stats') ?> <?= _t('sub.feed.stats') ?></a> </div> - <p><?php echo $this->feed->description(); ?></p> + <p><?= $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> + <p class="alert alert-error"><span class="alert-head"><?= _t('gen.short.damn') ?></span> <?= _t('sub.feed.error') ?></p> <?php } elseif ($nbEntries === 0) { ?> - <p class="alert alert-warn"><?php echo _t('sub.feed.empty'); ?></p> + <p class="alert alert-warn"><?= _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.information'); ?></legend> + <form method="post" action="<?= _url('subscription', 'feed', 'id', $this->feed->id()) ?>" autocomplete="off"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <legend><?= _t('sub.feed.information') ?></legend> <div class="form-group"> - <label class="group-name" for="name"><?php echo _t('sub.feed.title'); ?></label> + <label class="group-name" for="name"><?= _t('sub.feed.title') ?></label> <div class="group-controls"> - <input type="text" name="name" id="name" class="extend" value="<?php echo $this->feed->name() ; ?>" /> + <input type="text" name="name" id="name" class="extend" value="<?= $this->feed->name() ?>" /> </div> </div> <div class="form-group"> - <label class="group-name" for="description"><?php echo _t('sub.feed.description'); ?></label> + <label class="group-name" for="description"><?= _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> + <textarea name="description" id="description"><?= 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> + <label class="group-name" for="website"><?= _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> + <input type="text" name="website" id="website" class="extend" value="<?= $this->feed->website() ?>" /> + <a class="btn" target="_blank" rel="noreferrer" href="<?= $this->feed->website() ?>"><?= _i('link') ?></a> </div> </div> </div> <div class="form-group"> - <label class="group-name" for="url"><?php echo _t('sub.feed.url'); ?></label> + <label class="group-name" for="url"><?= _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> + <input type="text" name="url" id="url" class="extend" value="<?= $this->feed->url() ?>" /> + <a class="btn" target="_blank" rel="noreferrer" href="<?= $this->feed->url() ?>"><?= _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> + <a class="btn" target="_blank" rel="noreferrer" href="http://validator.w3.org/feed/check.cgi?url=<?= rawurlencode(htmlspecialchars_decode($this->feed->url(), ENT_QUOTES)) ?>"><?= _t('sub.feed.validator') ?></a> </div> </div> <div class="form-group"> - <label class="group-name" for="category"><?php echo _t('sub.category'); ?></label> + <label class="group-name" for="category"><?= _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 value="<?= $cat->id() ?>"<?= $cat->id()== $this->feed->category() ? ' selected="selected"' : '' ?>> + <?= $cat->name() ?> </option> <?php } ?> </select> </div> </div> <div class="form-group"> - <label class="group-name" for="priority"><?php echo _t('sub.feed.priority'); ?></label> + <label class="group-name" for="priority"><?= _t('sub.feed.priority') ?></label> <div class="group-controls"> <select name="priority" id="priority"> - <option value='<?php echo FreshRSS_Feed::PRIORITY_MAIN_STREAM;?>' <?php if (FreshRSS_Feed::PRIORITY_MAIN_STREAM === $this->feed->priority()) {echo 'selected="selected"';}?>><?php echo _t('sub.feed.priority.main_stream'); ?></option> - <option value='<?php echo FreshRSS_Feed::PRIORITY_NORMAL;?>' <?php if (FreshRSS_Feed::PRIORITY_NORMAL === $this->feed->priority()) {echo 'selected="selected"';}?>><?php echo _t('sub.feed.priority.normal'); ?></option> - <option value='<?php echo FreshRSS_Feed::PRIORITY_ARCHIVED;?>' <?php if (FreshRSS_Feed::PRIORITY_ARCHIVED === $this->feed->priority()) {echo 'selected="selected"';}?>><?php echo _t('sub.feed.priority.archived'); ?></option> + <option value='<?= FreshRSS_Feed::PRIORITY_MAIN_STREAM ?>' <?php if (FreshRSS_Feed::PRIORITY_MAIN_STREAM === $this->feed->priority()) {echo 'selected="selected"';}?>><?= _t('sub.feed.priority.main_stream') ?></option> + <option value='<?= FreshRSS_Feed::PRIORITY_NORMAL ?>' <?php if (FreshRSS_Feed::PRIORITY_NORMAL === $this->feed->priority()) {echo 'selected="selected"';}?>><?= _t('sub.feed.priority.normal') ?></option> + <option value='<?= FreshRSS_Feed::PRIORITY_ARCHIVED ?>' <?php if (FreshRSS_Feed::PRIORITY_ARCHIVED === $this->feed->priority()) {echo 'selected="selected"';}?>><?= _t('sub.feed.priority.archived') ?></option> </select> </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-important"><?= _t('gen.action.submit') ?></button> + <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></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> + data-str-confirm="<?= _t('gen.js.confirm_action_feed_cat') ?>" + formaction="<?= _url('feed', 'delete', 'id', $this->feed->id()) ?>" + formmethod="post"><?= _t('gen.action.remove') ?></button> </div> </div> - <legend><?php echo _t('sub.feed.archiving'); ?></legend> + <legend><?= _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'); ?> + <input type="text" value="<?= _t('sub.feed.number_entries', $nbEntries) ?>" disabled="disabled" /> + <a class="btn" href="<?= _url('feed', 'actualize', 'id', $this->feed->id()) ?>"> + <?= _i('refresh') ?> <?= _t('gen.action.actualize') ?> </a> </div> </div> </div> + <?php + $archiving = $this->feed->attributes('archiving'); + if (empty($archiving)) { + $archiving = [ 'default' => true ]; + } else { + $archiving['default'] = false; + } + $volatile = [ + 'enable_keep_period' => false, + 'keep_period_count' => '3', + 'keep_period_unit' => 'P1M', + ]; + if (!empty($archiving['keep_period'])) { + if (preg_match('/^PT?(?P<count>\d+)[YMWDH]$/', $archiving['keep_period'], $matches)) { + $volatile['enable_keep_period'] = true; + $volatile['keep_period_count'] = $matches['count']; + $volatile['keep_period_unit'] = str_replace($matches['count'], '1', $archiving['keep_period']); + } + } + //Defaults + if (!isset($archiving['keep_max'])) { + $archiving['keep_max'] = false; + } + if (!isset($archiving['keep_min'])) { + $archiving['keep_min'] = 50; + } + if (!isset($archiving['keep_favourites'])) { + $archiving['keep_favourites'] = true; + } + if (!isset($archiving['keep_labels'])) { + $archiving['keep_labels'] = true; + } + if (!isset($archiving['keep_unreads'])) { + $archiving['keep_unreads'] = false; + } + ?> + + <p class="alert alert-warn"> + <?= _t('conf.archiving.policy_warning') ?> + </p> + <div class="form-group"> - <label class="group-name" for="keep_history"><?php echo _t('sub.feed.keep_history'); ?></label> + <label class="group-name"><?= _t('conf.archiving.policy') ?></label> <div class="group-controls"> - <select class="number" name="keep_history" id="keep_history" required="required"><?php - foreach (array('' => '', FreshRSS_Feed::KEEP_HISTORY_DEFAULT => _t('gen.short.by_default'), 0 => '0', 10 => '10', 50 => '50', 100 => '100', 500 => '500', 1000 => '1 000', 5000 => '5 000', 10000 => '10 000', FreshRSS_Feed::KEEP_HISTORY_INFINITE => '∞') as $v => $t) { - echo '<option value="' . $v . ($this->feed->keepHistory() === $v ? '" selected="selected' : '') . '">' . $t . '</option>'; - } - ?></select> + <label class="checkbox"> + <input type="checkbox" name="use_default_purge_options" id="use_default_purge_options" value="1"<?= $archiving['default'] ? ' checked="checked"' : '' ?> data-leave-validation="<?= $archiving['default'] ? 1 : 0 ?>" /> + <?= _t('gen.short.by_default') ?> + </label> + </div> + </div> + <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>> + <div class="group-controls"> + <label class="checkbox" for="enable_keep_max"> + <input type="checkbox" name="enable_keep_max" id="enable_keep_max" value="1"<?= empty($archiving['keep_max']) ? '' : ' checked="checked"' ?> data-leave-validation="<?= empty($archiving['keep_max']) ? 0 : 1 ?>"/> + <?= _t('conf.archiving.keep_max') ?> + <input type="number" id="keep_max" name="keep_max" min="0" value="<?= empty($archiving['keep_max']) ? 200 : $archiving['keep_max'] ?>" data-leave-validation="<?= empty($archiving['keep_max']) ? 200 : $archiving['keep_max'] ?>"/> + </label> + </div> + </div> + <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>> + <div class="group-controls"> + <label class="checkbox" for="enable_keep_period"> + <input type="checkbox" name="enable_keep_period" id="enable_keep_period" value="1"<?= $volatile['enable_keep_period'] ? ' checked="checked"' : '' ?> data-leave-validation="<?= $volatile['enable_keep_period'] ? 1 : 0 ?>"/> + <?= _t('conf.archiving.keep_period') ?> + <input type="number" id="keep_period_count" name="keep_period_count" min="0" value="<?= $volatile['keep_period_count'] ?>" data-leave-validation="<?= $volatile['keep_period_count'] ?>"/> + <select class="number" name="keep_period_unit" id="keep_period_unit" data-leave-validation="<?= $volatile['keep_period_unit'] ?>"> + <option></option> + <option value="P1Y" <?= 'P1Y' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.years') ?></option> + <option value="P1M" <?= 'P1M' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.months') ?></option> + <option value="P1W" <?= 'P1W' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.weeks') ?></option> + <option value="P1D" <?= 'P1D' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.days') ?></option> + <option value="PT1H" <?= 'PT1H' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.hours') ?></option> + </select> + </label> </div> </div> + <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>> + <label class="group-name"><?= _t('conf.archiving.exception') ?></label> + <div class="group-controls"> + <label class="checkbox" for="keep_favourites"> + <input type="checkbox" name="keep_favourites" id="keep_favourites" value="1"<?= $archiving['keep_favourites'] ? ' checked="checked"' : '' ?> data-leave-validation="<?= $archiving['keep_favourites'] ? 1 : 0 ?>"/> + <?= _t('conf.archiving.keep_favourites') ?> + </label> + </div> + </div> + <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>> + <div class="group-controls"> + <label class="checkbox" for="keep_labels"> + <input type="checkbox" name="keep_labels" id="keep_labels" value="1"<?= $archiving['keep_labels'] ? ' checked="checked"' : '' ?> data-leave-validation="<?= $archiving['keep_labels'] ? 1 : 0 ?>"/> + <?= _t('conf.archiving.keep_labels') ?> + </label> + </div> + </div> + <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>> + <div class="group-controls"> + <label class="checkbox" for="keep_unreads"> + <input type="checkbox" name="keep_unreads" id="keep_unreads" value="1"<?= $archiving['keep_unreads'] ? ' checked="checked"' : '' ?> data-leave-validation="<?= $archiving['keep_unreads'] ?>"/> + <?= _t('conf.archiving.keep_unreads') ?> + </label> + </div> + </div> + <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>> + <div class="group-controls"> + <label for="keep_min"><?= _t('sub.feed.keep_min') ?> + <input type="number" id="keep_min" name="keep_min" min="0" value="<?= $archiving['keep_min'] ?>" data-leave-validation="<?= $archiving['keep_min'] ?>"> + </label> + </div> + </div> + <div class="form-group"> - <label class="group-name" for="ttl"><?php echo _t('sub.feed.ttl'); ?></label> + <label class="group-name" for="ttl"><?= _t('sub.feed.ttl') ?></label> <div class="group-controls"> <select class="number" name="ttl" id="ttl" required="required"><?php $found = false; @@ -127,130 +227,131 @@ } ?></select> <label for="mute"> - <input type="checkbox" name="mute" id="mute" value="1"<?php echo $this->feed->mute() ? ' checked="checked"' : ''; ?> /> - <?php echo _t('sub.feed.mute'); ?> + <input type="checkbox" name="mute" id="mute" value="1"<?= $this->feed->mute() ? ' checked="checked"' : '' ?> /> + <?= _t('sub.feed.mute') ?> </label> </div> </div> <div class="form-group"> - <label class="group-name" for="pubsubhubbub"><?php echo _t('sub.feed.websub'); ?></label> + <label class="group-name" for="pubsubhubbub"><?= _t('sub.feed.websub') ?></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"' : ''; ?> /> + <input type="checkbox" name="pubsubhubbub" id="pubsubhubbub" disabled="disabled" value="1"<?= $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> + <button class="btn btn-important"><?= _t('gen.action.submit') ?></button> + <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button> + <button class="btn btn-attention confirm" formmethod="post" formaction="<?= _url('feed', 'truncate', 'id', $this->feed->id()) ?>"><?= _t('gen.action.truncate') ?></button> </div> </div> - <legend><?php echo _t('sub.feed.auth.configuration'); ?></legend> + <legend><?= _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> + <label class="group-name" for="http_user_feed<?= $this->feed->id() ?>"><?= _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'); ?> + <input type="text" name="http_user_feed<?= $this->feed->id() ?>" id="http_user_feed<?= $this->feed->id() ?>" class="extend" value="<?= empty($auth['username']) ? ' ' : $auth['username'] ?>" autocomplete="off" /> + <?= _i('help') ?> <?= _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> + <label class="group-name" for="http_pass_feed<?= $this->feed->id() ?>"><?= _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="new-password" /> + <input type="password" name="http_pass_feed<?= $this->feed->id() ?>" id="http_pass_feed<?= $this->feed->id() ?>" class="extend" value="<?= $auth['password'] ?>" autocomplete="new-password" /> </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> + <button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button> + <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button> </div> </div> - <legend><?php echo _t('sub.feed.advanced'); ?></legend> + <legend><?= _t('sub.feed.advanced') ?></legend> <div class="form-group"> - <label class="group-name" for="path_entries"><?php echo _t('sub.feed.css_path'); ?></label> + <label class="group-name" for="path_entries"><?= _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'); ?> + <input type="text" name="path_entries" id="path_entries" class="extend" value="<?= $this->feed->pathEntries() ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" /> + <?= _i('help') ?> <?= _t('sub.feed.css_help') ?> </div> </div> <div class="form-group"> - <label class="group-name" for="mark_updated_article_unread"><?php echo _t('conf.reading.mark_updated_article_unread'); ?></label> + <label class="group-name" for="mark_updated_article_unread"><?= _t('conf.reading.mark_updated_article_unread') ?></label> <div class="group-controls"> <label class="checkbox" for="mark_updated_article_unread"> <select name="mark_updated_article_unread" id="mark_updated_article_unread"> - <option value=""<?php echo $this->feed->attributes('mark_updated_article_unread') === null ? ' selected="selected"' : ''; ?>><?php echo _t('gen.short.by_default'); ?></option> - <option value="0"<?php echo $this->feed->attributes('mark_updated_article_unread') === false ? ' selected="selected"' : ''; ?>><?php echo _t('gen.short.no'); ?></option> - <option value="1"<?php echo $this->feed->attributes('mark_updated_article_unread') === true ? ' selected="selected"' : ''; ?>><?php echo _t('gen.short.yes'); ?></option> + <option value=""<?= $this->feed->attributes('mark_updated_article_unread') === null ? ' selected="selected"' : '' ?>><?= _t('gen.short.by_default') ?></option> + <option value="0"<?= $this->feed->attributes('mark_updated_article_unread') === false ? ' selected="selected"' : '' ?>><?= _t('gen.short.no') ?></option> + <option value="1"<?= $this->feed->attributes('mark_updated_article_unread') === true ? ' selected="selected"' : '' ?>><?= _t('gen.short.yes') ?></option> </select> </label> </div> </div> <div class="form-group"> - <label class="group-name" for="read_upon_reception"><?php echo _t('conf.reading.read.when'); ?></label> + <label class="group-name" for="read_upon_reception"><?= _t('conf.reading.read.when') ?></label> <div class="group-controls"> <label class="checkbox" for="read_upon_reception"> <select name="read_upon_reception" id="read_upon_reception"> - <option value=""<?php echo $this->feed->attributes('read_upon_reception') === null ? ' selected="selected"' : ''; ?>><?php echo _t('gen.short.by_default'); ?></option> - <option value="0"<?php echo $this->feed->attributes('read_upon_reception') === false ? ' selected="selected"' : ''; ?>><?php echo _t('gen.short.no'); ?></option> - <option value="1"<?php echo $this->feed->attributes('read_upon_reception') === true ? ' selected="selected"' : ''; ?>><?php echo _t('gen.short.yes'); ?></option> + <option value=""<?= $this->feed->attributes('read_upon_reception') === null ? ' selected="selected"' : '' ?>><?= _t('gen.short.by_default') ?></option> + <option value="0"<?= $this->feed->attributes('read_upon_reception') === false ? ' selected="selected"' : '' ?>><?= _t('gen.short.no') ?></option> + <option value="1"<?= $this->feed->attributes('read_upon_reception') === true ? ' selected="selected"' : '' ?>><?= _t('gen.short.yes') ?></option> </select> - <?php echo _t('conf.reading.read.upon_reception'); ?> + <?= _t('conf.reading.read.upon_reception') ?> </label> </div> </div> <div class="form-group"> - <label class="group-name" for="clear_cache"><?php echo _t('sub.feed.clear_cache'); ?></label> + <label class="group-name" for="clear_cache"><?= _t('sub.feed.clear_cache') ?></label> <div class="group-controls"> - <input type="checkbox" name="clear_cache" id="clear_cache" value="1"<?php echo $this->feed->attributes('clear_cache') ? ' checked="checked"' : ''; ?> /> + <input type="checkbox" name="clear_cache" id="clear_cache" value="1"<?= $this->feed->attributes('clear_cache') ? ' checked="checked"' : '' ?> /> </div> </div> <?php if (FreshRSS_Auth::hasAccess('admin')) { ?> <div class="form-group"> - <label class="group-name" for="timeout"><?php echo _t('sub.feed.timeout'); ?></label> + <label class="group-name" for="timeout"><?= _t('sub.feed.timeout') ?></label> <div class="group-controls"> - <input type="number" name="timeout" id="timeout" min="3" max="120" value="<?php echo $this->feed->attributes('timeout'); ?>" placeholder="<?php echo _t('gen.short.by_default'); ?>" /> + <input type="number" name="timeout" id="timeout" min="3" max="120" value="<?= $this->feed->attributes('timeout') ?>" placeholder="<?= _t('gen.short.by_default') ?>" /> </div> </div> <div class="form-group"> - <label class="group-name" for="ssl_verify"><?php echo _t('sub.feed.ssl_verify'); ?></label> + <label class="group-name" for="ssl_verify"><?= _t('sub.feed.ssl_verify') ?></label> <div class="group-controls"> <label class="checkbox" for="ssl_verify"> <select name="ssl_verify" id="ssl_verify"> - <option value=""<?php echo $this->feed->attributes('ssl_verify') === null ? ' selected="selected"' : ''; ?>><?php echo _t('gen.short.by_default'); ?></option> - <option value="0"<?php echo $this->feed->attributes('ssl_verify') === false ? ' selected="selected"' : ''; ?>><?php echo _t('gen.short.no'); ?></option> - <option value="1"<?php echo $this->feed->attributes('ssl_verify') === true ? ' selected="selected"' : ''; ?>><?php echo _t('gen.short.yes'); ?></option> + <option value=""<?= $this->feed->attributes('ssl_verify') === null ? ' selected="selected"' : '' ?>><?= _t('gen.short.by_default') ?></option> + <option value="0"<?= $this->feed->attributes('ssl_verify') === false ? ' selected="selected"' : '' ?>><?= _t('gen.short.no') ?></option> + <option value="1"<?= $this->feed->attributes('ssl_verify') === true ? ' selected="selected"' : '' ?>><?= _t('gen.short.yes') ?></option> </select> </label> </div> </div> <?php } ?> - <legend><?php echo _t('sub.feed.filteractions'); ?></legend> + <legend><?= _t('sub.feed.filteractions') ?></legend> <div class="form-group"> - <label class="group-name" for="filteractions_read"><?php echo _t('conf.reading.read.when'); ?></label> + <label class="group-name" for="filteractions_read"><?= _t('conf.reading.read.when') ?></label> <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'), PHP_EOL; } ?></textarea> - <?php echo _i('help'); ?> <?php echo _t('sub.feed.filteractions.help'); ?> + <?= _i('help') ?> <?= _t('sub.feed.filteractions.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> + <button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button> + <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button> </div> </div> </form> diff --git a/app/views/helpers/index/normal/entry_bottom.phtml b/app/views/helpers/index/normal/entry_bottom.phtml index c0edbdf7d..dd84ca346 100644 --- a/app/views/helpers/index/normal/entry_bottom.phtml +++ b/app/views/helpers/index/normal/entry_bottom.phtml @@ -19,7 +19,7 @@ if ($this->entry->isRead()) { $arUrl['params']['is_read'] = 0; } - ?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php + ?><a class="read" href="<?= Minz_Url::display($arUrl) ?>"><?php echo _i($this->entry->isRead() ? 'read' : 'unread'); ?></a><?php ?></li><?php } @@ -29,7 +29,7 @@ if ($this->entry->isFavorite()) { $arUrl['params']['is_favorite'] = 0; } - ?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php + ?><a class="bookmark" href="<?= Minz_Url::display($arUrl) ?>"><?php echo _i($this->entry->isFavorite() ? 'starred' : 'non-starred'); ?></a><?php ?></li><?php } @@ -37,9 +37,9 @@ if ($bottomline_labels) { ?><li class="item"> <div class="dropdown dynamictags"> - <div id="dropdown-labels-<?php echo $this->entry->id();?>" class="dropdown-target"></div> - <?php echo FreshRSS_Themes::alt('label'); ?> - <a class="dropdown-toggle" href="#dropdown-labels-<?php echo $this->entry->id();?>"><?php + <div id="dropdown-labels-<?= $this->entry->id() ?>" class="dropdown-target"></div> + <?= FreshRSS_Themes::alt('label') ?> + <a class="dropdown-toggle" href="#dropdown-labels-<?= $this->entry->id() ?>"><?php echo _t('index.menu.tags'); ?></a> <ul class="dropdown-menu dropdown-menu-scrollable"> @@ -53,15 +53,15 @@ 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 + <div id="dropdown-tags-<?= $this->entry->id() ?>" class="dropdown-target"></div> + <?= _i('tag') ?> + <a class="dropdown-toggle" href="#dropdown-tags-<?= $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', '#' . str_replace(' ', '+', htmlspecialchars_decode($tag, ENT_QUOTES))); ?>"><?php echo $tag; ?></a></li><?php + ?><li class="item"><a href="<?= _url('index', 'index', 'search', '#' . str_replace(' ', '+', htmlspecialchars_decode($tag, ENT_QUOTES))) ?>"><?= $tag ?></a></li><?php } ?> </ul> </div> @@ -70,10 +70,10 @@ ?><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'); ?> + <div id="dropdown-share-<?= $this->entry->id() ?>" class="dropdown-target"></div> + <a class="dropdown-toggle" href="#dropdown-share-<?= $this->entry->id() ?>"> + <?= _i('share') ?> + <?= _t('index.share') ?> </a> <ul class="dropdown-menu"> @@ -90,11 +90,11 @@ $share->update($share_options); ?><li class="item share"> <?php if ('GET' === $share->method()) {?> - <a target="_blank" rel="noreferrer" href="<?php echo $share->url(); ?>"><?php echo $share->name(); ?></a> + <a target="_blank" rel="noreferrer" href="<?= $share->url() ?>"><?= $share->name() ?></a> <?php } else {?> - <a href="POST"><?php echo $share->name(); ?></a> - <form method="POST" action="<?php echo $share->url(); ?>" disabled="disabled"> - <input type="hidden" value="<?php echo $link; ?>" name="<?php echo $share->field(); ?>"/> + <a href="POST"><?= $share->name() ?></a> + <form method="POST" action="<?= $share->url() ?>" disabled="disabled"> + <input type="hidden" value="<?= $link ?>" name="<?= $share->field() ?>"/> </form> <?php } ?> </li><?php @@ -104,9 +104,9 @@ <?php } ?> </li><?php if ($bottomline_date) { - ?><li class="item date"><?php echo $this->entry->date(); ?></li><?php + ?><li class="item date"><?= $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 + ?><li class="item link"><a target="_blank" rel="noreferrer" href="<?= $this->entry->link() ?>"><?= _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 index 86298e59f..d22cf5036 100644 --- a/app/views/helpers/index/normal/entry_header.phtml +++ b/app/views/helpers/index/normal/entry_header.phtml @@ -1,6 +1,7 @@ <?php $topline_read = FreshRSS_Context::$user_conf->topline_read; $topline_favorite = FreshRSS_Context::$user_conf->topline_favorite; + $topline_display_authors = FreshRSS_Context::$user_conf->topline_display_authors; $topline_date = FreshRSS_Context::$user_conf->topline_date; $topline_link = FreshRSS_Context::$user_conf->topline_link; ?><ul class="horizontal-list flux_header"><?php @@ -11,7 +12,7 @@ if ($this->entry->isRead()) { $arUrl['params']['is_read'] = 0; } - ?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php + ?><a class="read" href="<?= Minz_Url::display($arUrl) ?>"><?php echo _i($this->entry->isRead() ? 'read' : 'unread'); ?></a><?php ?></li><?php } @@ -21,13 +22,26 @@ if ($this->entry->isFavorite()) { $arUrl['params']['is_favorite'] = 0; } - ?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php + ?><a class="bookmark" href="<?= 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 } ?> + ?><li class="item website"><a href="<?= _url('index', 'index', 'get', 'f_' . $this->feed->id()) ?>"><img class="favicon" src="<?= $this->feed->favicon() ?>" alt="✇" /> <span><?= $this->feed->name() ?></span></a></li> + <li class="item title"><a target="_blank" rel="noreferrer" href="<?= $this->entry->link() ?>"><?= $this->entry->title() ?></a><?php + if ($topline_display_authors): + ?><div class="item author"><?php + $authors = $this->entry->authors(); + if (is_array($authors)) { + $first = true; + foreach ($authors as $author) { + echo $first ? $author : ', ' . $author; + $first = false; + } + } + ?></div><?php + endif; + ?></li> + <?php if ($topline_date) { ?><li class="item date"><?= $this->entry->date() ?> </li><?php } ?> + <?php if ($topline_link) { ?><li class="item link"><a target="_blank" rel="noreferrer" href="<?= $this->entry->link() ?>"><?= _i('link') ?></a></li><?php } ?> </ul> diff --git a/app/views/helpers/logs_pagination.phtml b/app/views/helpers/logs_pagination.phtml index bf9d91f04..e74074173 100755 --- a/app/views/helpers/logs_pagination.phtml +++ b/app/views/helpers/logs_pagination.phtml @@ -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 _t('gen.pagination.first'); ?></a> + <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>">« <?= _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 _t('gen.pagination.previous'); ?></a> + <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>">‹ <?= _t('gen.pagination.previous') ?></a> <?php } ?> </li> @@ -24,9 +24,9 @@ <?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="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>"><?= $i ?></a></li> <?php } else { ?> - <li class="item pager-current"><?php echo $i; ?></li> + <li class="item pager-current"><?= $i ?></li> <?php } ?> <?php } ?> <?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 _t('gen.pagination.next'); ?> ›</a> + <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>"><?= _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 _t('gen.pagination.last'); ?> »</a> + <a href="<?= Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)) ?>"><?= _t('gen.pagination.last') ?> »</a> <?php } ?> </li> </ul> diff --git a/app/views/helpers/pagination.phtml b/app/views/helpers/pagination.phtml index fc37ce3f5..b7d62ceab 100755 --- a/app/views/helpers/pagination.phtml +++ b/app/views/helpers/pagination.phtml @@ -18,26 +18,26 @@ ?> <form id="mark-read-pagination" method="post"> -<input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> +<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> <ul class="pagination"> <li class="item pager-next"> <?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 id="load_more" href="<?= Minz_Url::display($url_next) ?>"> + <?= _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' : ''; ?>" + class="as-link <?= FreshRSS_Context::$user_conf->reading_confirm ? 'confirm" disabled="disabled' : '' ?>" form="mark-read-pagination" - formaction="<?php echo Minz_Url::display($url_mark_read); ?>" + formaction="<?= Minz_Url::display($url_mark_read) ?>" type="submit"> - <?php echo _t('gen.pagination.nothing_to_load'); ?><br /> + <?= _t('gen.pagination.nothing_to_load') ?><br /> <span class="bigTick">✓</span><br /> - <?php echo _t('gen.pagination.mark_all_read'); ?> + <?= _t('gen.pagination.mark_all_read') ?> </button> <?php } else { ?> <a id="bigMarkAsRead" href="."> - <?php echo _t('gen.pagination.nothing_to_load'); ?><br /> + <?= _t('gen.pagination.nothing_to_load') ?><br /> </a> <?php } ?> </li> |
