diff options
Diffstat (limited to 'app/views')
43 files changed, 1216 insertions, 805 deletions
diff --git a/app/views/auth/formLogin.phtml b/app/views/auth/formLogin.phtml index 01d1d4736..ecac7aced 100644 --- a/app/views/auth/formLogin.phtml +++ b/app/views/auth/formLogin.phtml @@ -1,33 +1,33 @@ <div class="prompt"> - <h1><?php echo _t('gen.auth.login'); ?></h1> + <h1><?= _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> + <a href="<?= _url('auth', 'register') ?>"><?= _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(); ?>" /> + <form id="crypto-form" method="post" action="<?= _url('auth', 'login') ?>"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> <div> - <label for="username"><?php echo _t('gen.auth.username'); ?></label> - <input type="text" id="username" name="username" autocomplete="username" size="16" required="required" pattern="<?php echo FreshRSS_user_Controller::USERNAME_PATTERN; ?>" autofocus="autofocus" /> + <label for="username"><?= _t('gen.auth.username') ?></label> + <input type="text" id="username" name="username" autocomplete="username" size="16" required="required" pattern="<?= FreshRSS_user_Controller::USERNAME_PATTERN ?>" autofocus="autofocus" /> </div> <div> - <label for="passwordPlain"><?php echo _t('gen.auth.password'); ?></label> + <label for="passwordPlain"><?= _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> + <noscript><strong><?= _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); ?> + <?= _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> + <button id="loginButton" type="submit" class="btn btn-important"><?= _t('gen.auth.login') ?></button> </div> </form> - <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('gen.freshrss.about'); ?></a></p> + <p><a href="<?= _url('index', 'about') ?>"><?= _t('gen.freshrss.about') ?></a></p> </div> diff --git a/app/views/auth/index.phtml b/app/views/auth/index.phtml index 20966f24e..c1cf95b2b 100644 --- a/app/views/auth/index.phtml +++ b/app/views/auth/index.phtml @@ -1,22 +1,22 @@ <?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> + <a href="<?= _url('index', 'index') ?>"><?= _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> + <form method="post" action="<?= _url('auth', 'index') ?>"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <legend><?= _t('admin.auth.type') ?></legend> <div class="form-group"> - <label class="group-name" for="auth_type"><?php echo _t('admin.auth.type'); ?></label> + <label class="group-name" for="auth_type"><?= _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; ?>"> + <select id="auth_type" name="auth_type" required="required" data-leave-validation="<?= 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> + <option value="form"<?= FreshRSS_Context::$system_conf->auth_type === 'form' ? ' selected="selected"' : '', cryptAvailable() ? '' : ' disabled="disabled"' ?>><?= _t('admin.auth.form') ?></option> + <option value="http_auth"<?= FreshRSS_Context::$system_conf->auth_type === 'http_auth' ? ' selected="selected"' : '', httpAuthUser() == '' ? ' disabled="disabled"' : '' ?>><?= _t('admin.auth.http') ?> (REMOTE_USER = '<?= httpAuthUser() ?>')</option> + <option value="none"<?= FreshRSS_Context::$system_conf->auth_type === 'none' ? ' selected="selected"' : '' ?>><?= _t('admin.auth.none') ?></option> </select> </div> </div> @@ -25,8 +25,8 @@ <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); ?> + FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"'; ?> data-leave-validation="<?= FreshRSS_Context::$system_conf->allow_anonymous ?>"/> + <?= _t('admin.auth.allow_anonymous', FreshRSS_Context::$system_conf->default_user) ?> </label> </div> </div> @@ -35,8 +35,8 @@ <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'); ?> + FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"'; ?> data-leave-validation="<?= FreshRSS_Context::$system_conf->allow_anonymous_refresh ?>"/> + <?= _t('admin.auth.allow_anonymous_refresh') ?> </label> </div> </div> @@ -45,9 +45,9 @@ <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> + FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"'; ?> data-leave-validation="<?= FreshRSS_Context::$system_conf->unsafe_autologin_enabled ?>"/> + <?= _t('admin.auth.unsafe_autologin') ?> + <kbd><?= Minz_Url::display(array('c' => 'auth', 'a' => 'login', 'params' => array('u' => 'alice', 'p' => '1234')), 'html', true) ?></kbd> </label> </div> </div> @@ -56,16 +56,16 @@ <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'); ?> + FreshRSS_Auth::accessNeedsLogin() ? '' : ' disabled="disabled"'; ?> data-leave-validation="<?= FreshRSS_Context::$system_conf->api_enabled ?>"/> + <?= _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> + <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/auth/register.phtml b/app/views/auth/register.phtml index 19e11ef76..4233f7fd4 100644 --- a/app/views/auth/register.phtml +++ b/app/views/auth/register.phtml @@ -1,22 +1,40 @@ <div class="prompt"> - <h1><?php echo _t('gen.auth.registration'); ?></h1> + <h1><?= _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(); ?>" /> + <form method="post" action="<?= _url('user', 'create') ?>"> + <input type="hidden" name="_csrf" value="<?= 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" autocomplete="off" pattern="<?php echo FreshRSS_user_Controller::USERNAME_PATTERN; ?>" /> + <label class="group-name" for="new_user_name"><?= _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" autocomplete="off" pattern="<?= FreshRSS_user_Controller::USERNAME_PATTERN ?>" /> </div> + <?php if ($this->show_email_field) { ?> + <div> + <label class="group-name" for="new_user_email"> + <?= _t('gen.auth.email') ?> + </label> + <input id="new_user_email" name="new_user_email" type="email" required /> + </div> + <?php } ?> + <div> - <label class="group-name" for="new_user_passwordPlain"><?php echo _t('gen.auth.password'), '<br />', _i('help'), ' ', _t('gen.auth.password.format'); ?></label> + <label class="group-name" for="new_user_passwordPlain"><?= _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="new-password" pattern=".{7,}" /> - <a class="btn toggle-password" data-toggle="new_user_passwordPlain"><?php echo _i('key'); ?></a> + <a class="btn toggle-password" data-toggle="new_user_passwordPlain"><?= _i('key') ?></a> </div> - <noscript><b><?php echo _t('gen.js.should_be_activated'); ?></b></noscript> + <noscript><b><?= _t('gen.js.should_be_activated') ?></b></noscript> </div> + <?php if ($this->show_tos_checkbox) { ?> + <div> + <label class="checkbox" for="accept-tos"> + <input type="checkbox" name="accept_tos" id="accept-tos" value="1" required /> + <?= _t('gen.auth.accept_tos', _url('index', 'tos')) ?> + </label> + </div> + <?php } ?> + <div> <?php $redirect_url = urlencode(Minz_Url::display( @@ -24,11 +42,11 @@ '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> + <input type="hidden" name="r" value="<?= $redirect_url ?>" /> + <button type="submit" class="btn btn-important"><?= _t('gen.action.create') ?></button> + <a class="btn" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.cancel') ?></a> </div> </form> - <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('gen.freshrss.about'); ?></a></p> + <p><a href="<?= _url('index', 'about') ?>"><?= _t('gen.freshrss.about') ?></a></p> </div> diff --git a/app/views/configure/archiving.phtml b/app/views/configure/archiving.phtml index 09be55fd9..7d76e4dcc 100644 --- a/app/views/configure/archiving.phtml +++ b/app/views/configure/archiving.phtml @@ -1,34 +1,17 @@ <?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> + <a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a> - <form method="post" action="<?php echo _url('configure', 'archiving'); ?>"> - <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> + <form method="post" action="<?= _url('configure', 'archiving') ?>"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <legend><?= _t('conf.archiving') ?></legend> + <p><?= _i('help') ?> <?= _t('conf.archiving.help') ?></p> <div class="form-group"> - <label class="group-name" for="old_entries"><?php echo _t('conf.archiving.delete_after'); ?></label> + <label class="group-name" for="ttl_default"><?= _t('conf.archiving.ttl') ?></label> <div class="group-controls"> - <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 _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" 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', FreshRSS_Feed::KEEP_HISTORY_INFINITE => '∞') as $v => $t) { - echo '<option value="' . $v . (FreshRSS_Context::$user_conf->keep_history_default == $v ? '" selected="selected' : '') . '">' . $t . ' </option>'; - } - ?></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 + <select class="number" name="ttl_default" id="ttl_default" required="required" data-leave-validation="<?= 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', @@ -43,44 +26,123 @@ 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'); ?>) + ?></select> (<?= _t('gen.short.by_default') ?>) + </div> + </div> + + <p class="alert alert-warn"> + <?= _t('conf.archiving.policy_warning') ?> + </p> + + <div class="form-group"> + <label class="group-name"><?= _t('conf.archiving.policy') ?><br /><small>(<?= _t('gen.short.by_default') ?>)</small></label> + <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(FreshRSS_Context::$user_conf->archiving['keep_max']) ? '' : ' checked="checked"' ?> data-leave-validation="<?= empty(FreshRSS_Context::$user_conf->archiving['keep_max']) ? 0 : 1 ?>"/> + <?= _t('conf.archiving.keep_max') ?> + <?php $keepMax = empty(FreshRSS_Context::$user_conf->archiving['keep_max']) ? 200 : FreshRSS_Context::$user_conf->archiving['keep_max']; ?> + <input type="number" id="keep_max" name="keep_max" min="0" value="<?= $keepMax ?>" data-leave-validation="<?= $keepMax ?>"/> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="enable_keep_period"> + <input type="checkbox" name="enable_keep_period" id="enable_keep_period" value="1"<?= FreshRSS_Context::$user_conf->volatile['enable_keep_period'] ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->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="<?= FreshRSS_Context::$user_conf->volatile['keep_period_count'] ?>" data-leave-validation="<?= FreshRSS_Context::$user_conf->volatile['keep_period_count'] ?>"/> + <select class="number" name="keep_period_unit" id="keep_period_unit" data-leave-validation="<?= FreshRSS_Context::$user_conf->volatile['keep_period_unit'] ?>"> + <option></option> + <option value="P1Y" <?= 'P1Y' === FreshRSS_Context::$user_conf->volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.years') ?></option> + <option value="P1M" <?= 'P1M' === FreshRSS_Context::$user_conf->volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.months') ?></option> + <option value="P1W" <?= 'P1W' === FreshRSS_Context::$user_conf->volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.weeks') ?></option> + <option value="P1D" <?= 'P1D' === FreshRSS_Context::$user_conf->volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.days') ?></option> + <option value="PT1H" <?= 'PT1H' === FreshRSS_Context::$user_conf->volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.hours') ?></option> + </select> + </label> + </div> + </div> + + <div class="form-group"> + <label class="group-name"><?= _t('conf.archiving.exception') ?><br /><small>(<?= _t('gen.short.by_default') ?>)</small></label> + <div class="group-controls"> + <label class="checkbox" for="keep_favourites"> + <input type="checkbox" name="keep_favourites" id="keep_favourites" value="1"<?= FreshRSS_Context::$user_conf->archiving['keep_favourites'] !== false ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->archiving['keep_favourites'] !== false ? 1 : 0 ?>"/> + <?= _t('conf.archiving.keep_favourites') ?> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="keep_labels"> + <input type="checkbox" name="keep_labels" id="keep_labels" value="1"<?= FreshRSS_Context::$user_conf->archiving['keep_labels'] !== false ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->archiving['keep_labels'] !== false ? 1 : 0 ?>"/> + <?= _t('conf.archiving.keep_labels') ?> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="keep_unreads"> + <input type="checkbox" name="keep_unreads" id="keep_unreads" value="1"<?= FreshRSS_Context::$user_conf->archiving['keep_unreads'] ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->archiving['keep_unreads'] ? 1 : 0 ?>"/> + <?= _t('conf.archiving.keep_unreads') ?> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label for="keep_min_default"><?= _t('conf.archiving.keep_min_by_feed') ?> + <input type="number" id="keep_min_default" name="keep_min_default" min="0" value="<?= FreshRSS_Context::$user_conf->archiving['keep_min'] ?>" data-leave-validation="<?= FreshRSS_Context::$user_conf->archiving['keep_min'] ?>"> + </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> + <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> - <form method="post" action="<?php echo _url('entry', 'optimize'); ?>"> - <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> - <legend><?php echo _t('conf.archiving.advanced'); ?></legend> + <legend><?= _t('conf.archiving.maintenance') ?></legend> + <form method="post" action="<?= _url('entry', 'purge') ?>"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> <div class="form-group"> - <label class="group-name"><?php echo _t('conf.user.current'); ?></label> + <label class="group-name"><?= _t('conf.user.current') ?></label> <div class="group-controls"> - <?php echo _t('conf.user.articles_and_size', format_number($this->nb_total), format_bytes($this->size_user)); ?> + <?= _t('conf.user.articles_and_size', format_number($this->nb_total), format_bytes($this->size_user)) ?> </div> </div> - <?php if (FreshRSS_Auth::hasAccess('admin')) { ?> <div class="form-group"> - <label class="group-name"><?php echo _t('conf.user.users'); ?></label> <div class="group-controls"> - <?php echo format_bytes($this->size_total); ?> + <button type="submit" class="btn btn-important confirm"><?= _t('conf.archiving.purge_now') ?></button> </div> </div> + </form> - <div class="form-group form-actions"> + <form method="post" action="<?= _url('entry', 'optimize') ?>"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <div class="form-group"> <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'); ?> + <button type="submit" class="btn btn-important"><?= _t('conf.archiving.optimize') ?></button> + <?= _i('help') ?> <?= _t('conf.archiving.optimize_help') ?> </div> </div> - <?php } ?> </form> + + <?php if (FreshRSS_Auth::hasAccess('admin')): ?> + <div class="form-group"> + <label class="group-name"><?= _t('conf.user.users') ?></label> + <div class="group-controls"> + <?= format_bytes($this->size_total) ?> + </div> + </div> + <?php endif; ?> </div> diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index 58c4e219a..c1cfecc2a 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -1,47 +1,47 @@ <?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> + <a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a> - <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> + <form method="post" action="<?= _url('configure', 'display') ?>"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <legend><?= _t('conf.display') ?></legend> <div class="form-group"> - <label class="group-name" for="language"><?php echo _t('conf.display.language'); ?></label> + <label class="group-name" for="language"><?= _t('conf.display.language') ?></label> <div class="group-controls"> - <select name="language" id="language" data-leave-validation="<?php echo FreshRSS_Context::$user_conf->language; ?>"> + <select name="language" id="language" data-leave-validation="<?= 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> + <option value="<?= $lang ?>"<?= FreshRSS_Context::$user_conf->language === $lang ? ' selected="selected"' : '' ?>><?= _t('gen.lang.' . $lang) ?></option> <?php } ?> </select> </div> </div> <div class="form-group"> - <label class="group-name" for="theme"><?php echo _t('conf.display.theme'); ?></label> + <label class="group-name" for="theme"><?= _t('conf.display.theme') ?></label> <div class="group-controls"> <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; ?>"/> + <input type="radio" name="theme" id="img-<?= $i ?>" <?php if (FreshRSS_Context::$user_conf->theme === $theme['id']) {echo "checked";}?> value="<?= $theme['id'] ?>" data-leave-validation="<?= (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')?>"/> + <img src="<?= 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> + <label for="img-<?= $i - 1 ?>" class="prev">‹</label> <?php } ?> <?php if ($i !== $slides) {?> - <label for="img-<?php echo $i + 1 ?>" class="next">›</label> + <label for="img-<?= $i + 1 ?>" class="next">›</label> <?php } ?> </div> <div class="properties"> - <div><?php echo sprintf('%s — %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><?= sprintf('%s — %s %s', $theme['name'], _t('gen.short.by_author'), $theme['author']) ?></div> + <div><?= $theme['description'] ?></div> + <div class="page-number"><?= sprintf('%d/%d', $i, $slides) ?></div> </div> </li> <?php $i++ ?> @@ -52,81 +52,84 @@ <?php $width = FreshRSS_Context::$user_conf->content_width; ?> <div class="form-group"> - <label class="group-name" for="content_width"><?php echo _t('conf.display.width.content'); ?></label> + <label class="group-name" for="content_width"><?= _t('conf.display.width.content') ?></label> <div class="group-controls"> - <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'); ?> + <select name="content_width" id="content_width" required="" data-leave-validation="<?= $width ?>"> + <option value="thin" <?= $width === 'thin'? 'selected="selected"' : '' ?>> + <?= _t('conf.display.width.thin') ?> </option> - <option value="medium" <?php echo $width === 'medium'? 'selected="selected"' : ''; ?>> - <?php echo _t('conf.display.width.medium'); ?> + <option value="medium" <?= $width === 'medium'? 'selected="selected"' : '' ?>> + <?= _t('conf.display.width.medium') ?> </option> - <option value="large" <?php echo $width === 'large'? 'selected="selected"' : ''; ?>> - <?php echo _t('conf.display.width.large'); ?> + <option value="large" <?= $width === 'large'? 'selected="selected"' : '' ?>> + <?= _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 value="no_limit" <?= $width === 'no_limit'? 'selected="selected"' : '' ?>> + <?= _t('conf.display.width.no_limit') ?> </option> </select> </div> </div> <div class="form-group"> - <label class="group-name"><?php echo _t('conf.display.icon.entry'); ?></label> + <label class="group-name"><?= _t('conf.display.icon.entry') ?></label> <table> <thead> <tr> <th> </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.related_tags'); ?></th> - <th><?php echo _t('conf.display.icon.sharing'); ?></th> - <th><?php echo _t('conf.display.icon.publication_date'); ?></th> - <th><?php echo _i('link'); ?></th> + <th title="<?= _t('gen.action.mark_read') ?>"><?= _i('read') ?></th> + <th title="<?= _t('gen.action.mark_favorite') ?>"><?= _i('bookmark') ?></th> + <th><?= _t('conf.display.icon.related_tags') ?></th> + <th><?= _t('conf.display.icon.sharing') ?></th> + <th><?= _t('conf.display.icon.display_authors') ?></th> + <th><?= _t('conf.display.icon.publication_date') ?></th> + <th><?= _i('link') ?></th> </tr> </thead> <tbody> <tr> - <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> + <th><?= _t('conf.display.icon.top_line') ?></th> + <td><input type="checkbox" name="topline_read" value="1"<?= FreshRSS_Context::$user_conf->topline_read ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->topline_read ?>"/></td> + <td><input type="checkbox" name="topline_favorite" value="1"<?= FreshRSS_Context::$user_conf->topline_favorite ? ' checked="checked"' : '' ?> data-leave-validation="<?= 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 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> + <td><input type="checkbox" name="topline_display_authors" value="1"<?= FreshRSS_Context::$user_conf->topline_display_authors ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->topline_display_authors ?>"/></td> + <td><input type="checkbox" name="topline_date" value="1"<?= FreshRSS_Context::$user_conf->topline_date ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->topline_date ?>"/></td> + <td><input type="checkbox" name="topline_link" value="1"<?= FreshRSS_Context::$user_conf->topline_link ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->topline_link ?>"/></td> </tr><tr> - <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_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_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_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> + <th><?= _t('conf.display.icon.bottom_line') ?></th> + <td><input type="checkbox" name="bottomline_read" value="1"<?= FreshRSS_Context::$user_conf->bottomline_read ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->bottomline_read ?>"/></td> + <td><input type="checkbox" name="bottomline_favorite" value="1"<?= FreshRSS_Context::$user_conf->bottomline_favorite ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->bottomline_favorite ?>"/></td> + <td><input type="checkbox" name="bottomline_tags" value="1"<?= FreshRSS_Context::$user_conf->bottomline_tags ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->bottomline_tags ?>"/></td> + <td><input type="checkbox" name="bottomline_sharing" value="1"<?= FreshRSS_Context::$user_conf->bottomline_sharing ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->bottomline_sharing ?>"/></td> + <td><input type="checkbox" disabled="disabled" /></td> + <td><input type="checkbox" name="bottomline_date" value="1"<?= FreshRSS_Context::$user_conf->bottomline_date ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->bottomline_date ?>"/></td> + <td><input type="checkbox" name="bottomline_link" value="1"<?= FreshRSS_Context::$user_conf->bottomline_link ? ' checked="checked"' : '' ?> data-leave-validation="<?= 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> + <label class="group-name" for="html5_notif_timeout"><?= _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'); ?> + <input type="number" id="html5_notif_timeout" name="html5_notif_timeout" value="<?= FreshRSS_Context::$user_conf->html5_notif_timeout ?>" data-leave-validation="<?= FreshRSS_Context::$user_conf->html5_notif_timeout ?>"/> <?= _t('conf.display.notif_html5.seconds') ?> </div> </div> <div class="form-group"> <div class="group-controls"> <label class="checkbox" for="show_nav_buttons"> - <input type="checkbox" name="show_nav_buttons" id="show_nav_buttons" value="1"<?php echo FreshRSS_Context::$user_conf->show_nav_buttons ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->show_nav_buttons; ?>"/> - <?php echo _t('conf.display.show_nav_buttons'); ?> + <input type="checkbox" name="show_nav_buttons" id="show_nav_buttons" value="1"<?= FreshRSS_Context::$user_conf->show_nav_buttons ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->show_nav_buttons ?>"/> + <?= _t('conf.display.show_nav_buttons') ?> </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> + <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/configure/queries.phtml b/app/views/configure/queries.phtml index baaf74954..a0f600b5d 100644 --- a/app/views/configure/queries.phtml +++ b/app/views/configure/queries.phtml @@ -1,70 +1,70 @@ <?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> + <a href="<?= _url('index', 'index') ?>"><?= _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> + <form method="post" action="<?= _url('configure', 'queries') ?>"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <legend><?= _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); ?> + <div class="form-group" id="query-group-<?= $key ?>"> + <label class="group-name" for="queries_<?= $key ?>_name"> + <?= _t('conf.query.number', $key + 1) ?> </label> <div class="group-controls"> - <input type="hidden" id="queries_<?php echo $key; ?>_url" 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(); ?>"/> + <input type="hidden" id="queries_<?= $key ?>_url" name="queries[<?= $key ?>][url]" value="<?= $query->getUrl() ?>"/> + <input type="hidden" id="queries_<?= $key ?>_search" name="queries[<?= $key ?>][search]" value="<?= $query->getSearch() ?>"/> + <input type="hidden" id="queries_<?= $key ?>_state" name="queries[<?= $key ?>][state]" value="<?= $query->getState() ?>"/> + <input type="hidden" id="queries_<?= $key ?>_order" name="queries[<?= $key ?>][order]" value="<?= $query->getOrder() ?>"/> + <input type="hidden" id="queries_<?= $key ?>_get" name="queries[<?= $key ?>][get]" value="<?= $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(); ?>" + id="queries_<?= $key ?>_name" + name="queries[<?= $key ?>][name]" + value="<?= $query->getName() ?>" + data-leave-validation="<?= $query->getName() ?>" /> - <a class="btn" href="<?php echo $query->getUrl(); ?>" title="<?php echo _t('conf.query.display'); ?>"> - <?php echo _i('link'); ?> + <a class="btn" href="<?= $query->getUrl() ?>" title="<?= _t('conf.query.display') ?>"> + <?= _i('link') ?> </a> - <a class="btn btn-attention remove" href="#" data-remove="query-group-<?php echo $key; ?>" title="<?php echo _t('conf.query.remove'); ?>"> - <?php echo _i('close'); ?> + <a class="btn btn-attention remove" href="#" data-remove="query-group-<?= $key ?>" title="<?= _t('conf.query.remove') ?>"> + <?= _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 class="alert-head"><?= _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 class="alert-head"><?= _t('conf.query.deprecated') ?></div> </div> <?php } else { ?> <div class="alert alert-success"> - <div class="alert-head"><?php echo _t('conf.query.filter'); ?></div> + <div class="alert-head"><?= _t('conf.query.filter') ?></div> <ul> <?php if ($query->hasSearch()) { ?> - <li class="item"><?php echo _t('conf.query.search', $query->getSearch()->getRawInput()); ?></li> + <li class="item"><?= _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> + <li class="item"><?= _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> + <li class="item"><?= _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> + <li class="item"><?= _t('conf.query.get_' . $query->getGetType(), $query->getGetName()) ?></li> <?php } ?> </ul> </div> @@ -76,12 +76,12 @@ <?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> + <button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button> + <button type="reset" class="btn"><?= _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> + <p class="alert alert-warn"><span class="alert-head"><?= _t('gen.short.damn') ?></span> <?= _t('conf.query.none') ?></p> <?php } ?> </form> diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml index ebb00c97b..7c42b59f1 100644 --- a/app/views/configure/reading.phtml +++ b/app/views/configure/reading.phtml @@ -1,48 +1,48 @@ <?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> + <a href="<?= _url('index', 'index') ?>"><?= _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> + <form method="post" action="<?= _url('configure', 'reading') ?>"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <legend><?= _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> + <label class="group-name" for="posts_per_page"><?= _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'); ?> + <input type="number" id="posts_per_page" name="posts_per_page" value="<?= FreshRSS_Context::$user_conf->posts_per_page ?>" min="5" max="500" data-leave-validation="<?= FreshRSS_Context::$user_conf->posts_per_page ?>"/> + <?= _i('help') ?> <?= _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> + <label class="group-name" for="sort_order"><?= _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 name="sort_order" id="sort_order" data-leave-validation="<?= FreshRSS_Context::$user_conf->sort_order ?>"> + <option value="DESC"<?= FreshRSS_Context::$user_conf->sort_order === 'DESC' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.sort.newer_first') ?></option> + <option value="ASC"<?= FreshRSS_Context::$user_conf->sort_order === 'ASC' ? ' selected="selected"' : '' ?>><?= _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> + <label class="group-name" for="view_mode"><?= _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 name="view_mode" id="view_mode" data-leave-validation="<?= FreshRSS_Context::$user_conf->view_mode ?>"> + <option value="normal"<?= FreshRSS_Context::$user_conf->view_mode === 'normal' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.view.normal') ?></option> + <option value="reader"<?= FreshRSS_Context::$user_conf->view_mode === 'reader' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.view.reader') ?></option> + <option value="global"<?= FreshRSS_Context::$user_conf->view_mode === 'global' ? ' selected="selected"' : '' ?>><?= _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> + <label class="group-name" for="view_mode"><?= _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 name="default_view" id="default_view" data-leave-validation="<?= FreshRSS_Context::$user_conf->default_view ?>"> + <option value="adaptive"<?= FreshRSS_Context::$user_conf->default_view === 'adaptive' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.adaptive') ?></option> + <option value="all"<?= FreshRSS_Context::$user_conf->default_view === 'all' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.all_articles') ?></option> + <option value="unread"<?= FreshRSS_Context::$user_conf->default_view === 'unread' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.unread') ?></option> </select> </div> </div> @@ -50,8 +50,8 @@ <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'); ?> + <input type="checkbox" name="hide_read_feeds" id="hide_read_feeds" value="1"<?= FreshRSS_Context::$user_conf->hide_read_feeds ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->hide_read_feeds ?>"/> + <?= _t('conf.reading.hide_read_feeds') ?> </label> </div> </div> @@ -59,9 +59,9 @@ <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> + <input type="checkbox" name="display_posts" id="display_posts" value="1"<?= FreshRSS_Context::$user_conf->display_posts ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->display_posts ?>"/> + <?= _t('conf.reading.display_articles_unfolded') ?> + <noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript> </label> </div> </div> @@ -69,9 +69,9 @@ <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> + <input type="checkbox" name="display_categories" id="display_categories" value="1"<?= FreshRSS_Context::$user_conf->display_categories ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->display_categories ?>"/> + <?= _t('conf.reading.display_categories_unfolded') ?> + <noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript> </label> </div> </div> @@ -79,9 +79,9 @@ <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> + <input type="checkbox" name="sticky_post" id="sticky_post" value="1"<?= FreshRSS_Context::$user_conf->sticky_post ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->sticky_post ?>"/> + <?= _t('conf.reading.sticky_post') ?> + <noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript> </label> </div> </div> @@ -89,9 +89,9 @@ <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> + <input type="checkbox" name="auto_load_more" id="auto_load_more" value="1"<?= FreshRSS_Context::$user_conf->auto_load_more ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->auto_load_more ?>"/> + <?= _t('conf.reading.auto_load_more') ?> + <noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript> </label> </div> </div> @@ -99,9 +99,9 @@ <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> + <input type="checkbox" name="lazyload" id="lazyload" value="1"<?= FreshRSS_Context::$user_conf->lazyload ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->lazyload ?>"/> + <?= _t('conf.reading.img_with_lazyload') ?> + <noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript> </label> </div> </div> @@ -109,9 +109,9 @@ <div class="form-group"> <div class="group-controls"> <label class="checkbox" for="sides_close_article"> - <input type="checkbox" name="sides_close_article" id="sides_close_article" value="1"<?php echo FreshRSS_Context::$user_conf->sides_close_article ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->sides_close_article; ?>"/> - <?php echo _t('conf.reading.sides_close_article'); ?> - <noscript> — <strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> + <input type="checkbox" name="sides_close_article" id="sides_close_article" value="1"<?= FreshRSS_Context::$user_conf->sides_close_article ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->sides_close_article ?>"/> + <?= _t('conf.reading.sides_close_article') ?> + <noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript> </label> </div> </div> @@ -119,9 +119,9 @@ <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> + <input type="checkbox" name="reading_confirm" id="reading_confirm" value="1"<?= FreshRSS_Context::$user_conf->reading_confirm ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->reading_confirm ?>"/> + <?= _t('conf.reading.confirm_enabled') ?> + <noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript> </label> </div> </div> @@ -129,9 +129,9 @@ <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> + <input type="checkbox" name="auto_remove_article" id="auto_remove_article" value="1"<?= FreshRSS_Context::$user_conf->auto_remove_article ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->auto_remove_article ?>"/> + <?= _t('conf.reading.auto_remove_article') ?> + <noscript> — <strong><?= _t('gen.js.should_be_activated') ?></strong></noscript> </label> </div> </div> @@ -139,48 +139,48 @@ <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'); ?> + <input type="checkbox" name="mark_updated_article_unread" id="mark_updated_article_unread" value="1"<?= FreshRSS_Context::$user_conf->mark_updated_article_unread ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->mark_updated_article_unread ?>"/> + <?= _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> + <label class="group-name"><?= _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'); ?> + <input type="checkbox" name="mark_open_article" id="check_open_article" value="1"<?= FreshRSS_Context::$user_conf->mark_when['article'] ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->mark_when['article'] ?>"/> + <?= _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'); ?> + <input type="checkbox" name="mark_open_site" id="check_open_site" value="1"<?= FreshRSS_Context::$user_conf->mark_when['site'] ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->mark_when['site'] ?>"/> + <?= _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'); ?> + <input type="checkbox" name="mark_scroll" id="check_scroll" value="1"<?= FreshRSS_Context::$user_conf->mark_when['scroll'] ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->mark_when['scroll'] ?>"/> + <?= _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'); ?> + <input type="checkbox" name="mark_upon_reception" id="check_reception" value="1"<?= FreshRSS_Context::$user_conf->mark_when['reception'] ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->mark_when['reception'] ?>"/> + <?= _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> + <label class="group-name"><?= _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'); ?> + <input type="checkbox" name="onread_jump_next" id="onread_jump_next" value="1"<?= FreshRSS_Context::$user_conf->onread_jump_next ? ' checked="checked"' : '' ?> data-leave-validation="<?= FreshRSS_Context::$user_conf->onread_jump_next ?>"/> + <?= _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> + <button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button> + <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button> </div> </div> diff --git a/app/views/configure/sharing.phtml b/app/views/configure/sharing.phtml index 026659007..32ef11716 100644 --- a/app/views/configure/sharing.phtml +++ b/app/views/configure/sharing.phtml @@ -1,48 +1,48 @@ <?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> + <a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></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> + <form method="post" action="<?= _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="<?= _t('conf.sharing.share_name') ?>" size="64" /> + <input type="url" id="share_##key##_url" name="share[##key##][url]" class="extend" value="" placeholder="<?= _t('gen.short.not_applicable') ?>" size="64" disabled /><a href="#" class="remove btn btn-attention" data-remove="group-share-##key##"><?= _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##" /> <input type="hidden" id="share_##key##_method" name="share[##key##][method]" value="##method##" /> <input type="hidden" id="share_##key##_field" name="share[##key##][field]" value="##field##" /> <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##" title="<?php echo _t('conf.sharing.remove'); ?>"><?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> + <input type="text" id="share_##key##_name" name="share[##key##][name]" class="extend" value="" placeholder="<?= _t('conf.sharing.share_name') ?>" size="64" /> + <input type="url" id="share_##key##_url" name="share[##key##][url]" class="extend" value="" placeholder="<?= _t('conf.sharing.share_url') ?>" size="64" /> + <a href="#" class="remove btn btn-attention" data-remove="group-share-##key##" title="<?= _t('conf.sharing.remove') ?>"><?= _i('close') ?></a></div> + <a target="_blank" rel="noreferrer" class="btn" title="<?= _t('conf.sharing.more_information') ?>" href="##help##"><?= _i('help') ?></a> </div></div>'> - <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> - <legend><?php echo _t('conf.sharing'); ?></legend> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <legend><?= _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; ?>"> + <div class="form-group group-share" id="group-share-<?= $key ?>"> <label class="group-name"> - <?php echo $share->name(true); ?> + <?= $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(); ?>' /> - <input type='hidden' id='share_<?php echo $key; ?>_method' name="share[<?php echo $key; ?>][method]" value='<?php echo $share->method(); ?>' /> - <input type='hidden' id='share_<?php echo $key; ?>_field' name="share[<?php echo $key; ?>][field]" value='<?php echo $share->field(); ?>' /> + <input type='hidden' id='share_<?= $key ?>_type' name="share[<?= $key ?>][type]" value='<?= $share->type() ?>' /> + <input type='hidden' id='share_<?= $key ?>_method' name="share[<?= $key ?>][method]" value='<?= $share->method() ?>' /> + <input type='hidden' id='share_<?= $key ?>_field' name="share[<?= $key ?>][field]" value='<?= $share->field() ?>' /> <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(); ?>"/> + <input type="text" id="share_<?= $key ?>_name" name="share[<?= $key ?>][name]" class="extend" value="<?= $share->name() ?>" placeholder="<?= _t('conf.sharing.share_name') ?>" size="64" data-leave-validation="<?= $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(); ?>"/> + <input type="url" id="share_<?= $key ?>_url" name="share[<?= $key ?>][url]" class="extend" value="<?= $share->baseUrl() ?>" placeholder="<?= _t('conf.sharing.share_url') ?>" size="64" data-leave-validation="<?= $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/> + <input type="url" id="share_<?= $key ?>_url" name="share[<?= $key ?>][url]" class="extend" value="<?= $share->baseUrl() ?>" placeholder="<?= _t('gen.short.not_applicable') ?>" size="64" disabled/> <?php } ?> - <a href='#' class='remove btn btn-attention' data-remove="group-share-<?php echo $key; ?>" title="<?php echo _t('conf.sharing.remove'); ?>"><?php echo _i('close'); ?></a> + <a href='#' class='remove btn btn-attention' data-remove="group-share-<?= $key ?>" title="<?= _t('conf.sharing.remove') ?>"><?= _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> + <a target="_blank" rel="noreferrer" class="btn" title="<?= _t('conf.sharing.more_information') ?>" href="<?= $share->help() ?>"><?= _i('help') ?></a> <?php } ?> </div> </div> @@ -52,19 +52,19 @@ <div class="group-controls"> <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(); ?>' data-method='<?php echo $share->method(); ?>' data-field='<?php echo $share->field(); ?>'> - <?php echo $share->name(true); ?> + <option value='<?= $share->type() ?>' data-form='<?= $share->formType() ?>' data-help='<?= $share->help() ?>' data-method='<?= $share->method() ?>' data-field='<?= $share->field() ?>'> + <?= $share->name(true) ?> </option> <?php } ?> </select> - <a href='#' class='share add btn' title="<?php echo _t('conf.sharing.add'); ?>"><?php echo _i('add'); ?></a> + <a href='#' class='share add btn' title="<?= _t('conf.sharing.add') ?>"><?= _i('add') ?></a> </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/configure/shortcut.phtml b/app/views/configure/shortcut.phtml index 412ea676d..4412266cc 100644 --- a/app/views/configure/shortcut.phtml +++ b/app/views/configure/shortcut.phtml @@ -1,181 +1,181 @@ <?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> + <a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a> <datalist id="keys"> <?php foreach ($this->list_keys as $key) { ?> - <option value="<?php echo $key; ?>"> + <option value="<?= $key ?>"> <?php } ?> </datalist> <?php $s = FreshRSS_Context::$user_conf->shortcuts; ?> - <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> + <form method="post" action="<?= _url('configure', 'shortcut') ?>"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <legend><?= _t('conf.shortcut') ?></legend> - <noscript><p class="alert alert-error"><?php echo _t('conf.shortcut.javascript'); ?></p></noscript> + <noscript><p class="alert alert-error"><?= _t('conf.shortcut.javascript') ?></p></noscript> - <legend><?php echo _t('conf.shortcut.views'); ?></legend> + <legend><?= _t('conf.shortcut.views') ?></legend> <div class="form-group"> - <label class="group-name" for="normal_view_shortcut"><?php echo _t('conf.shortcut.normal_view'); ?></label> + <label class="group-name" for="normal_view_shortcut"><?= _t('conf.shortcut.normal_view') ?></label> <div class="group-controls"> - <input type="text" id="normal_view_shortcut" name="shortcuts[normal_view]" list="keys" value="<?php echo $s['normal_view']; ?>" data-leave-validation="<?php echo $s['normal_view']; ?>"/> + <input type="text" id="normal_view_shortcut" name="shortcuts[normal_view]" list="keys" value="<?= $s['normal_view'] ?>" data-leave-validation="<?= $s['normal_view'] ?>"/> </div> </div> <div class="form-group"> - <label class="group-name" for="global_view_shortcut"><?php echo _t('conf.shortcut.global_view'); ?></label> + <label class="group-name" for="global_view_shortcut"><?= _t('conf.shortcut.global_view') ?></label> <div class="group-controls"> - <input type="text" id="global_view_shortcut" name="shortcuts[global_view]" list="keys" value="<?php echo $s['global_view']; ?>" data-leave-validation="<?php echo $s['global_view']; ?>"/> + <input type="text" id="global_view_shortcut" name="shortcuts[global_view]" list="keys" value="<?= $s['global_view'] ?>" data-leave-validation="<?= $s['global_view'] ?>"/> </div> </div> <div class="form-group"> - <label class="group-name" for="reading_view_shortcut"><?php echo _t('conf.shortcut.reading_view'); ?></label> + <label class="group-name" for="reading_view_shortcut"><?= _t('conf.shortcut.reading_view') ?></label> <div class="group-controls"> - <input type="text" id="reading_view_shortcut" name="shortcuts[reading_view]" list="keys" value="<?php echo $s['reading_view']; ?>" data-leave-validation="<?php echo $s['reading_view']; ?>"/> + <input type="text" id="reading_view_shortcut" name="shortcuts[reading_view]" list="keys" value="<?= $s['reading_view'] ?>" data-leave-validation="<?= $s['reading_view'] ?>"/> </div> </div> <div class="form-group"> - <label class="group-name" for="rss_view_shortcut"><?php echo _t('conf.shortcut.rss_view'); ?></label> + <label class="group-name" for="rss_view_shortcut"><?= _t('conf.shortcut.rss_view') ?></label> <div class="group-controls"> - <input type="text" id="rss_view_shortcut" name="shortcuts[rss_view]" list="keys" value="<?php echo $s['rss_view']; ?>" data-leave-validation="<?php echo $s['rss_view']; ?>"/> + <input type="text" id="rss_view_shortcut" name="shortcuts[rss_view]" list="keys" value="<?= $s['rss_view'] ?>" data-leave-validation="<?= $s['rss_view'] ?>"/> </div> </div> - <legend><?php echo _t('conf.shortcut.navigation'); ?></legend> + <legend><?= _t('conf.shortcut.navigation') ?></legend> - <p class="alert alert-warn"><?php echo _t('conf.shortcut.navigation_help');?></p> + <p class="alert alert-warn"><?= _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> + <label class="group-name" for="next_entry"><?= _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']; ?>"/> + <input type="text" id="next_entry" name="shortcuts[next_entry]" list="keys" value="<?= $s['next_entry'] ?>" data-leave-validation="<?= $s['next_entry'] ?>"/> </div> </div> <div class="form-group"> - <label class="group-name" for="prev_entry"><?php echo _t('conf.shortcut.previous_article'); ?></label> + <label class="group-name" for="prev_entry"><?= _t('conf.shortcut.previous_article') ?></label> <div class="group-controls"> - <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']; ?>"/> + <input type="text" id="prev_entry" name="shortcuts[prev_entry]" list="keys" value="<?= $s['prev_entry'] ?>" data-leave-validation="<?= $s['prev_entry'] ?>"/> </div> </div> <div class="form-group"> - <label class="group-name" for="first_entry"><?php echo _t('conf.shortcut.first_article'); ?></label> + <label class="group-name" for="first_entry"><?= _t('conf.shortcut.first_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="first_entry" name="shortcuts[first_entry]" list="keys" value="<?= $s['first_entry'] ?>" data-leave-validation="<?= $s['first_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="last_entry"><?= _t('conf.shortcut.last_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="last_entry" name="shortcuts[last_entry]" list="keys" value="<?= $s['last_entry'] ?>" data-leave-validation="<?= $s['last_entry'] ?>"/> </div> </div> - <p class="alert alert-warn"><?php echo _t('conf.shortcut.navigation_no_mod_help');?></p> + <p class="alert alert-warn"><?= _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="skip_next_entry"><?= _t('conf.shortcut.skip_next_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="skip_next_entry" name="shortcuts[skip_next_entry]" list="keys" value="<?= $s['skip_next_entry'] ?>" data-leave-validation="<?= $s['skip_next_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="skip_prev_entry"><?= _t('conf.shortcut.skip_previous_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="skip_prev_entry" name="shortcuts[skip_prev_entry]" list="keys" value="<?= $s['skip_prev_entry'] ?>" data-leave-validation="<?= $s['skip_prev_entry'] ?>"/> </div> </div> - <legend><?php echo _t('conf.shortcut.article_action');?></legend> + <legend><?= _t('conf.shortcut.article_action') ?></legend> <div class="form-group"> - <label class="group-name" for="mark_read"><?php echo _t('conf.shortcut.mark_read'); ?></label> + <label class="group-name" for="mark_read"><?= _t('conf.shortcut.mark_read') ?></label> <div class="group-controls"> - <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'); ?> + <input type="text" id="mark_read" name="shortcuts[mark_read]" list="keys" value="<?= $s['mark_read'] ?>" data-leave-validation="<?= $s['mark_read'] ?>"/> + <?= _t('conf.shortcut.shift_for_all_read') ?> </div> </div> <div class="form-group"> - <label class="group-name" for="mark_favorite"><?php echo _t('conf.shortcut.mark_favorite'); ?></label> + <label class="group-name" for="mark_favorite"><?= _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']; ?>"/> + <input type="text" id="mark_favorite" name="shortcuts[mark_favorite]" list="keys" value="<?= $s['mark_favorite'] ?>" data-leave-validation="<?= $s['mark_favorite'] ?>"/> </div> </div> <div class="form-group"> - <label class="group-name" for="go_website"><?php echo _t('conf.shortcut.see_on_website'); ?></label> + <label class="group-name" for="go_website"><?= _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']; ?>"/> + <input type="text" id="go_website" name="shortcuts[go_website]" list="keys" value="<?= $s['go_website'] ?>" data-leave-validation="<?= $s['go_website'] ?>"/> </div> </div> <div class="form-group"> - <label class="group-name" for="auto_share_shortcut"><?php echo _t('conf.shortcut.auto_share'); ?></label> + <label class="group-name" for="auto_share_shortcut"><?= _t('conf.shortcut.auto_share') ?></label> <div class="group-controls"> - <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'); ?> + <input type="text" id="auto_share_shortcut" name="shortcuts[auto_share]" list="keys" value="<?= $s['auto_share'] ?>" data-leave-validation="<?= $s['auto_share'] ?>"/> + <?= _t('conf.shortcut.auto_share_help') ?> </div> </div> <div class="form-group"> - <label class="group-name" for="collapse_entry"><?php echo _t('conf.shortcut.collapse_article'); ?></label> + <label class="group-name" for="collapse_entry"><?= _t('conf.shortcut.collapse_article') ?></label> <div class="group-controls"> - <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']; ?>"/> + <input type="text" id="collapse_entry" name="shortcuts[collapse_entry]" list="keys" value="<?= $s['collapse_entry'] ?>" data-leave-validation="<?= $s['collapse_entry'] ?>"/> </div> </div> - <legend><?php echo _t('conf.shortcut.other_action');?></legend> + <legend><?= _t('conf.shortcut.other_action') ?></legend> <div class="form-group"> - <label class="group-name" for="load_more_shortcut"><?php echo _t('conf.shortcut.load_more'); ?></label> + <label class="group-name" for="load_more_shortcut"><?= _t('conf.shortcut.load_more') ?></label> <div class="group-controls"> - <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']; ?>"/> + <input type="text" id="load_more_shortcut" name="shortcuts[load_more]" list="keys" value="<?= $s['load_more'] ?>" data-leave-validation="<?= $s['load_more'] ?>"/> </div> </div> <div class="form-group"> - <label class="group-name" for="focus_search_shortcut"><?php echo _t('conf.shortcut.focus_search'); ?></label> + <label class="group-name" for="focus_search_shortcut"><?= _t('conf.shortcut.focus_search') ?></label> <div class="group-controls"> - <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']; ?>"/> + <input type="text" id="focus_search_shortcut" name="shortcuts[focus_search]" list="keys" value="<?= $s['focus_search'] ?>" data-leave-validation="<?= $s['focus_search'] ?>"/> </div> </div> <div class="form-group"> - <label class="group-name" for="user_filter_shortcut"><?php echo _t('conf.shortcut.user_filter'); ?></label> + <label class="group-name" for="user_filter_shortcut"><?= _t('conf.shortcut.user_filter') ?></label> <div class="group-controls"> - <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'); ?> + <input type="text" id="user_filter_shortcut" name="shortcuts[user_filter]" list="keys" value="<?= $s['user_filter'] ?>" data-leave-validation="<?= $s['user_filter'] ?>"/> + <?= _t('conf.shortcut.user_filter_help') ?> </div> </div> <div class="form-group"> - <label class="group-name" for="close_dropdown_shortcut"><?php echo _t('conf.shortcut.close_dropdown'); ?></label> + <label class="group-name" for="close_dropdown_shortcut"><?= _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']; ?>"/> + <input type="text" id="close_dropdown" name="shortcuts[close_dropdown]" list="keys" value="<?= $s['close_dropdown'] ?>" data-leave-validation="<?= $s['close_dropdown'] ?>"/> </div> </div> <div class="form-group"> - <label class="group-name" for="help_shortcut"><?php echo _t('conf.shortcut.help'); ?></label> + <label class="group-name" for="help_shortcut"><?= _t('conf.shortcut.help') ?></label> <div class="group-controls"> - <input type="text" id="help_shortcut" name="shortcuts[help]" list="keys" value="<?php echo $s['help']; ?>" data-leave-validation="<?php echo $s['help']; ?>"/> + <input type="text" id="help_shortcut" name="shortcuts[help]" list="keys" value="<?= $s['help'] ?>" data-leave-validation="<?= $s['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/configure/system.phtml b/app/views/configure/system.phtml index 9af4cc2c9..1a718e20f 100644 --- a/app/views/configure/system.phtml +++ b/app/views/configure/system.phtml @@ -1,31 +1,31 @@ <?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> + <a href="<?= _url('index', 'index') ?>"><?= _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> + <form method="post" action="<?= _url('configure', 'system') ?>"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <legend><?= _t('admin.system') ?></legend> <div class="form-group"> - <label class="group-name" for="instance-name"><?php echo _t('admin.system.instance-name'); ?></label> + <label class="group-name" for="instance-name"><?= _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; ?>"/> + <input type="text" class="extend" id="instance-name" name="instance-name" value="<?= FreshRSS_Context::$system_conf->title ?>" data-leave-validation="<?= 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> + <label class="group-name" for="auto-update-url"><?= _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; ?>"/> + <input type="text" class="extend" id="auto-update-url" name="auto-update-url" value="<?= FreshRSS_Context::$system_conf->auto_update_url ?>" data-leave-validation="<?= 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> + <label class="group-name" for="max-registrations"><?= _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'); ?> + <input type="number" id="max-registrations" name="max-registrations" value="<?= FreshRSS_Context::$system_conf->limits['max_registrations'] ?>" min="0" data-leave-validation="<?= FreshRSS_Context::$system_conf->limits['max_registrations'] ?>"/> + <?= _i('help') ?> <?= _t('admin.system.registration.help') ?> </div> </div> @@ -38,32 +38,50 @@ </div> </div> + <?php if ($this->can_enable_email_validation) { ?> + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="force-email-validation"> + <input + type="checkbox" + name="force-email-validation" + id="force-email-validation" + value="1" + <?= FreshRSS_Context::$system_conf->force_email_validation ? 'checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::$system_conf->force_email_validation ?>" + /> + <?= _t('admin.system.force_email_validation') ?> + </label> + </div> + </div> + <?php } ?> + <div class="form-group"> - <label class="group-name" for="max-feeds"><?php echo _t('admin.system.max-feeds'); ?></label> + <label class="group-name" for="max-feeds"><?= _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']; ?>"/> + <input type="number" id="max-feeds" name="max-feeds" value="<?= FreshRSS_Context::$system_conf->limits['max_feeds'] ?>" min="1" data-leave-validation="<?= 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> + <label class="group-name" for="max-categories"><?= _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']; ?>"/> + <input type="number" id="max-categories" name="max-categories" value="<?= FreshRSS_Context::$system_conf->limits['max_categories'] ?>" min="1" data-leave-validation="<?= FreshRSS_Context::$system_conf->limits['max_categories'] ?>"/> </div> </div> - + <div class="form-group"> - <label class="group-name" for="cookie-duration"><?php echo _t('admin.system.cookie-duration.number'); ?></label> + <label class="group-name" for="cookie-duration"><?= _t('admin.system.cookie-duration.number') ?></label> <div class="group-controls"> - <input type="number" id="cookie-duration" name="cookie-duration" value="<?php echo FreshRSS_Context::$system_conf->limits['cookie_duration']; ?>" min="0" data-leave-validation="<?php echo FreshRSS_Context::$system_conf->limits['cookie_duration']; ?>"/> - <?php echo _i('help'); ?> <?php echo _t('admin.system.cookie-duration.help'); ?> + <input type="number" id="cookie-duration" name="cookie-duration" value="<?= FreshRSS_Context::$system_conf->limits['cookie_duration'] ?>" min="0" data-leave-validation="<?= FreshRSS_Context::$system_conf->limits['cookie_duration'] ?>"/> + <?= _i('help') ?> <?= _t('admin.system.cookie-duration.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/error/index.phtml b/app/views/error/index.phtml index 8fd74e8bf..d5618d54c 100644 --- a/app/views/error/index.phtml +++ b/app/views/error/index.phtml @@ -1,9 +1,9 @@ <div class="post"> <div class="alert alert-error"> - <h1 class="alert-head"><?php echo $this->code; ?></h1> + <h1 class="alert-head"><?= $this->code ?></h1> <p> - <?php echo htmlspecialchars($this->errorMessage, ENT_NOQUOTES, 'UTF-8'); ?><br /> - <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + <?= htmlspecialchars($this->errorMessage, ENT_NOQUOTES, 'UTF-8') ?><br /> + <a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a> </p> </div> </div> diff --git a/app/views/extension/index.phtml b/app/views/extension/index.phtml index 6439a0333..f5c5bf032 100644 --- a/app/views/extension/index.phtml +++ b/app/views/extension/index.phtml @@ -1,14 +1,14 @@ <?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> + <a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a> - <h1><?php echo _t('admin.extensions.title'); ?></h1> + <h1><?= _t('admin.extensions.title') ?></h1> <form id="form-extension" method="post"> - <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> <?php if (!empty($this->extension_list['system'])) { ?> - <h2><?php echo _t('admin.extensions.system'); ?></h2> + <h2><?= _t('admin.extensions.system') ?></h2> <?php foreach ($this->extension_list['system'] as $ext) { $this->ext_details = $ext; @@ -18,7 +18,7 @@ <?php } ?> <?php if (!empty($this->extension_list['user'])) { ?> - <h2><?php echo _t('admin.extensions.user'); ?></h2> + <h2><?= _t('admin.extensions.user') ?></h2> <?php foreach ($this->extension_list['user'] as $ext) { $this->ext_details = $ext; @@ -30,34 +30,34 @@ if (empty($this->extension_list['system']) && empty($this->extension_list['user'])) { ?> - <p class="alert alert-warn"><?php echo _t('admin.extensions.empty_list'); ?></p> + <p class="alert alert-warn"><?= _t('admin.extensions.empty_list') ?></p> <?php } ?> </form> <?php if (!empty($this->available_extensions)) { ?> - <h2><?php echo _t('admin.extensions.community'); ?></h2> + <h2><?= _t('admin.extensions.community') ?></h2> <table> <tr> - <th><?php echo _t('admin.extensions.name'); ?></th> - <th><?php echo _t('admin.extensions.version'); ?></th> - <th><?php echo _t('admin.extensions.author'); ?></th> - <th><?php echo _t('admin.extensions.description'); ?></th> + <th><?= _t('admin.extensions.name') ?></th> + <th><?= _t('admin.extensions.version') ?></th> + <th><?= _t('admin.extensions.author') ?></th> + <th><?= _t('admin.extensions.description') ?></th> </tr> <?php foreach ($this->available_extensions as $ext) { ?> <tr> - <td><a href="<?php echo $ext['url']; ?>" target="_blank"><?php echo $ext['name']; ?></a></td> - <td><?php echo $ext['version']; ?></td> - <td><?php echo $ext['author']; ?></td> + <td><a href="<?= $ext['url'] ?>" target="_blank"><?= $ext['name'] ?></a></td> + <td><?= $ext['version'] ?></td> + <td><?= $ext['author'] ?></td> <td> - <?php echo $ext['description']; ?> + <?= $ext['description'] ?> <?php if (isset($this->extensions_installed[$ext['name']])) { ?> <?php if (version_compare($this->extensions_installed[$ext['name']], $ext['version']) >= 0) { ?> <span class="alert alert-success"> - <?php echo _t('admin.extensions.latest'); ?> + <?= _t('admin.extensions.latest') ?> </span> <?php } else if ($this->extensions_installed[$ext['name']] != $ext['version']) { ?> <span class="alert alert-warn"> - <?php echo _t('admin.extensions.update'); ?> + <?= _t('admin.extensions.update') ?> </span> <?php } ?> <?php } ?> @@ -69,8 +69,8 @@ </div> <?php $class = isset($this->extension) ? ' class="active"' : ''; ?> -<a href="#" id="close-slider"<?php echo $class; ?>></a> -<div id="slider"<?php echo $class; ?>> +<a href="#" id="close-slider"<?= $class ?>></a> +<div id="slider"<?= $class ?>> <?php if (isset($this->extension)) { $this->renderHelper('extension/configure'); diff --git a/app/views/feed/add.phtml b/app/views/feed/add.phtml index 340970b25..e39f45a86 100644 --- a/app/views/feed/add.phtml +++ b/app/views/feed/add.phtml @@ -1,90 +1,90 @@ <?php if ($this->feed) { ?> <div class="post"> - <h1><?php echo _t('sub.feed.add'); ?></h1> + <h1><?= _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> + <p class="alert alert-error"><span class="alert-head"><?= _t('gen.short.damn') ?></span> <?= _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.information'); ?></legend> + <form method="post" action="<?= _url('feed', 'add') ?>" autocomplete="off"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <legend><?= _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> + <label class="group-name"><?= _t('sub.feed.title') ?></label> <div class="group-controls"> - <label><?php echo $this->feed->name() ; ?></label> + <label><?= $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> + <label class="group-name"><?= _t('sub.feed.description') ?></label> <div class="group-controls"> - <label><?php echo htmlspecialchars($desc, ENT_NOQUOTES, 'UTF-8'); ?></label> + <label><?= 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> + <label class="group-name"><?= _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> + <?= $this->feed->website() ?> + <a class="btn" target="_blank" rel="noreferrer" href="<?= $this->feed->website() ?>"><?= _i('link') ?></a> </div> </div> <?php } ?> <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_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> + <input type="text" name="url_rss" 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 $this->feed->url(); ?>"><?php echo _t('sub.feed.validator'); ?></a> + <a class="btn" target="_blank" rel="noreferrer" href="http://validator.w3.org/feed/check.cgi?url=<?= $this->feed->url() ?>"><?= _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() == 1 ? ' selected="selected"' : ''; ?>> - <?php echo $cat->name(); ?> + <option value="<?= $cat->id() ?>"<?= $cat->id() == 1 ? ' selected="selected"' : '' ?>> + <?= $cat->name() ?> </option> <?php } ?> - <option value="nc"><?php echo _t('sub.category.new'); ?></option> + <option value="nc"><?= _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'); ?>" /> + <input type="text" name="new_category[name]" id="new_category_name" autocomplete="off" placeholder="<?= _t('sub.category.new') ?>" /> </span> </div> </div> - <legend><?php echo _t('sub.feed.auth.http'); ?></legend> + <legend><?= _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> + <label class="group-name" for="http_user"><?= _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" /> + <input type="text" name="http_user" id="http_user" class="extend" value="<?= empty($auth['username']) ? ' ' : $auth['username'] ?>" autocomplete="off" /> </div> - <label class="group-name" for="http_pass"><?php echo _t('sub.feed.auth.password'); ?></label> + <label class="group-name" for="http_pass"><?= _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="new-password" /> + <input type="password" name="http_pass" id="http_pass" class="extend" value="<?= $auth['password'] ?>" autocomplete="new-password" /> </div> <div class="group-controls"> - <?php echo _i('help'); ?> <?php echo _t('sub.feed.auth.help'); ?> + <?= _i('help') ?> <?= _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> + <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/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> diff --git a/app/views/importExport/index.phtml b/app/views/importExport/index.phtml index 139e715c5..e5a24dbc4 100644 --- a/app/views/importExport/index.phtml +++ b/app/views/importExport/index.phtml @@ -1,14 +1,14 @@ <?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> + <a href="<?= _url('index', 'index') ?>"><?= _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> + <form method="post" action="<?= _url('importExport', 'import') ?>" enctype="multipart/form-data"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <legend><?= _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'); ?> + <?= 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" /> @@ -17,30 +17,30 @@ <div class="form-group form-actions"> <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo _t('gen.action.import'); ?></button> + <button type="submit" class="btn btn-important"><?= _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> + <form method="post" action="<?= _url('importExport', 'export') ?>"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <legend><?= _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'); ?> + <?= _t('sub.import_export.export_opml') ?> </label> <label class="checkbox" for="export_labelled"> - <input type="checkbox" name="export_labelled" id="export_labelled" value="1" <?php echo extension_loaded('zip') ? 'checked="checked"' : ''; ?> /> - <?php echo _t('sub.import_export.export_labelled'); ?> + <input type="checkbox" name="export_labelled" id="export_labelled" value="1" <?= extension_loaded('zip') ? 'checked="checked"' : '' ?> /> + <?= _t('sub.import_export.export_labelled') ?> </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'); ?> + <input type="checkbox" name="export_starred" id="export_starred" value="1" <?= extension_loaded('zip') ? 'checked="checked"' : '' ?> /> + <?= _t('sub.import_export.export_starred') ?> </label> <?php @@ -49,10 +49,10 @@ $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>'; ?> + <select name="export_feeds[]"<?= $select_args ?> size="10"> + <?= extension_loaded('zip') ? '' : '<option></option>' ?> <?php foreach ($this->feeds as $feed) { ?> - <option value="<?php echo $feed->id(); ?>"><?php echo $feed->name(); ?></option> + <option value="<?= $feed->id() ?>"><?= $feed->name() ?></option> <?php } ?> </select> </div> @@ -60,7 +60,7 @@ <div class="form-group form-actions"> <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo _t('gen.action.export'); ?></button> + <button type="submit" class="btn btn-important"><?= _t('gen.action.export') ?></button> </div> </div> </form> diff --git a/app/views/index/about.phtml b/app/views/index/about.phtml index 649729952..320847886 100644 --- a/app/views/index/about.phtml +++ b/app/views/index/about.phtml @@ -1,26 +1,26 @@ <div class="post content"> - <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + <a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a> - <h1><?php echo _t('index.about'); ?></h1> + <h1><?= _t('index.about') ?></h1> <dl class="infos"> - <dt><?php echo _t('index.about.project_website'); ?></dt> - <dd><a href="<?php echo FRESHRSS_WEBSITE; ?>"><?php echo FRESHRSS_WEBSITE; ?></a></dd> + <dt><?= _t('index.about.project_website') ?></dt> + <dd><a href="<?= FRESHRSS_WEBSITE ?>"><?= FRESHRSS_WEBSITE ?></a></dd> - <dt><?php echo _t('index.about.bugs_reports'); ?></dt> - <dd><?php echo _t('index.about.github'); ?></dd> + <dt><?= _t('index.about.bugs_reports') ?></dt> + <dd><?= _t('index.about.github') ?></dd> - <dt><?php echo _t('index.about.license'); ?></dt> - <dd><?php echo _t('index.about.agpl3'); ?></dd> + <dt><?= _t('index.about.license') ?></dt> + <dd><?= _t('index.about.agpl3') ?></dd> <?php if (FreshRSS_Auth::hasAccess()): ?> - <dt><?php echo _t('index.about.version'); ?></dt> - <dd><?php echo FRESHRSS_VERSION; ?></dd> + <dt><?= _t('index.about.version') ?></dt> + <dd><?= FRESHRSS_VERSION ?></dd> <?php endif; ?> </dl> - <p><?php echo _t('index.about.freshrss_description'); ?></p> + <p><?= _t('index.about.freshrss_description') ?></p> - <h1><?php echo _t('index.about.credits'); ?></h1> - <p><?php echo _t('index.about.credits_content'); ?></p> + <h1><?= _t('index.about.credits') ?></h1> + <p><?= _t('index.about.credits_content') ?></p> </div> diff --git a/app/views/index/global.phtml b/app/views/index/global.phtml index 2f25b6dc2..a49e16525 100644 --- a/app/views/index/global.phtml +++ b/app/views/index/global.phtml @@ -9,7 +9,7 @@ } ?> -<div id="stream" class="global<?php echo $class; ?>"> +<div id="stream" class="global<?= $class ?>"> <?php $params = Minz_Request::fetchGET(); unset($params['c']); @@ -26,8 +26,8 @@ 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> + <div class="box category" data-unread="<?= $cat->nbNotRead() ?>"> + <div class="box-title"><a class="title" data-unread="<?= format_number($cat->nbNotRead()) ?>" href="<?= Minz_Url::display($url_base) ?>"><?= $cat->name() ?></a></div> <ul class="box-content"> <?php @@ -37,9 +37,9 @@ $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, $feed->mute() ? ' mute' : ''; ?>" 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 id="f_<?= $feed->id() ?>" class="item feed<?= $error, $empty, $feed->mute() ? ' mute' : '' ?>" data-unread="<?= $feed->nbNotRead() ?>" data-priority="<?= $feed->priority() ?>"> + <img class="favicon" src="<?= $feed->favicon() ?>" alt="✇" /> + <a class="item-title" data-unread="<?= format_number($feed->nbNotRead()) ?>" href="<?= Minz_Url::display($url_base) ?>"><?= $feed->name() ?></a> </li> <?php } ?> </ul> @@ -51,7 +51,7 @@ </div> <div id="overlay"> - <a class="close" href="#"><?php echo _i('close'); ?></a> + <a class="close" href="#"><?= _i('close') ?></a> </div> -<div id="panel"<?php echo FreshRSS_Context::$user_conf->display_posts ? '' : ' class="hide_posts"'; ?>> +<div id="panel"<?= FreshRSS_Context::$user_conf->display_posts ? '' : ' class="hide_posts"' ?>> </div> diff --git a/app/views/index/logs.phtml b/app/views/index/logs.phtml index a88f89278..2deb1c315 100644 --- a/app/views/index/logs.phtml +++ b/app/views/index/logs.phtml @@ -1,11 +1,11 @@ <div class="post content"> - <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + <a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a> - <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(); ?>" /> + <h1><?= _t('index.log') ?></h1> + <form method="post" action="<?= _url('index', 'logs') ?>"><p> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> <input type="hidden" name="clearLogs" /> - <button type="submit" class="btn"><?php echo _t('index.log.clear'); ?></button> + <button type="submit" class="btn"><?= _t('index.log.clear') ?></button> </p></form> <?php $items = $this->logsPaginator->items(); ?> @@ -15,12 +15,12 @@ <?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 <?= $log->level() ?>"><span class="date"><?= @date('Y-m-d H:i:s', @strtotime($log->date())) ?></span><?= htmlspecialchars($log->info(), ENT_NOQUOTES, 'UTF-8') ?></div> <?php } ?> <?php $this->logsPaginator->render('logs_pagination.phtml','page'); ?> </div> <?php } else { ?> - <p class="alert alert-warn"><?php echo _t('index.log.empty'); ?></p> + <p class="alert alert-warn"><?= _t('index.log.empty') ?></p> <?php } ?> </div> diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml index ac2ea812d..f556df201 100644 --- a/app/views/index/normal.phtml +++ b/app/views/index/normal.phtml @@ -14,9 +14,9 @@ if (!empty($this->entries)) { $today = @strtotime('today'); ?> -<div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>"><?php +<div id="stream" class="normal<?= $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> + <a href="<?= Minz_Url::display(Minz_Request::currentRequest()) ?>"><?= _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); @@ -36,23 +36,23 @@ if (!empty($this->entries)) { 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 + ?><span class="date"> — <?= timestamptodate(time(), false) ?></span><?php + ?><span class="name"><?= 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 + ?><span class="date"> — <?= timestamptodate(time() - 86400, false) ?></span><?php + ?><span class="name"><?= 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 + ?><span class="name"><?= FreshRSS_Context::$name ?></span><?php ?></div><?php $display_others = false; } @@ -65,8 +65,8 @@ if (!empty($this->entries)) { $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" class="go_website" href="<?php echo $this->entry->link(); ?>"><?php echo $this->entry->title(); ?></a></h1> + <div class="content <?= $content_width ?>"> + <h1 class="title"><a target="_blank" rel="noreferrer" class="go_website" href="<?= $this->entry->link() ?>"><?= $this->entry->title() ?></a></h1> <div class="author"><?php $authors = $this->entry->authors(); if (is_array($authors)): @@ -75,7 +75,7 @@ if (!empty($this->entries)) { echo $first ? _t('gen.short.by_author') . ' ' : '· '; $first = false; ?> -<em><a href="<?php echo _url('index', 'index', 'search', 'author:' . str_replace(' ', '+', htmlspecialchars_decode($author, ENT_QUOTES))); ?>"><?php echo $author; ?></a></em> +<em><a href="<?= _url('index', 'index', 'search', 'author:' . str_replace(' ', '+', htmlspecialchars_decode($author, ENT_QUOTES))) ?>"><?= $author ?></a></em> <?php endforeach; ?> </div><?php endif; @@ -96,7 +96,7 @@ if (!empty($this->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 /> + <h2><?= _t('index.feed.empty') ?></h2> + <a href="<?= _url('subscription', 'index') ?>"><?= _t('index.feed.add') ?></a><br /><br /> </div> <?php } ?> diff --git a/app/views/index/reader.phtml b/app/views/index/reader.phtml index 129fae937..bbb6bd22b 100644 --- a/app/views/index/reader.phtml +++ b/app/views/index/reader.phtml @@ -9,16 +9,16 @@ if (!empty($this->entries)) { <div id="stream" class="reader"> <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> + <a href="<?= Minz_Url::display(Minz_Request::currentRequest()) ?>"><?= _t('gen.js.new_article'); /* TODO: move string in JS*/ ?></a> </div> <?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<?= !$item->isRead() ? ' not_read' : '' ?><?= $item->isFavorite() ? ' favorite' : '' ?>" id="flux_<?= $item->id() ?>"> <div class="flux_content"> - <div class="content <?php echo $content_width; ?>"> + <div class="content <?= $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); @@ -31,16 +31,16 @@ if (!empty($this->entries)) { $readUrl['params']['is_read'] = 0; } ?> - <a class="read" href="<?php echo Minz_Url::display($readUrl); ?>"> - <?php echo _i($item->isRead() ? 'read' : 'unread'); ?> + <a class="read" href="<?= Minz_Url::display($readUrl) ?>"> + <?= _i($item->isRead() ? 'read' : 'unread') ?> </a> - <a class="bookmark" href="<?php echo Minz_Url::display($favoriteUrl); ?>"> - <?php echo _i($item->isFavorite() ? 'starred' : 'non-starred'); ?> + <a class="bookmark" href="<?= Minz_Url::display($favoriteUrl) ?>"> + <?= _i($item->isFavorite() ? 'starred' : 'non-starred') ?> </a> - <a class="website" href="<?php echo _url('index', 'reader', 'get', 'f_' . $feed->id()); ?>"> - <img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span> + <a class="website" href="<?= _url('index', 'reader', 'get', 'f_' . $feed->id()) ?>"> + <img class="favicon" src="<?= $feed->favicon() ?>" alt="✇" /> <span><?= $feed->name() ?></span> </a> - <h1 class="title"><a target="_blank" rel="noreferrer" class="go_website" href="<?php echo $item->link(); ?>"><?php echo $item->title(); ?></a></h1> + <h1 class="title"><a target="_blank" rel="noreferrer" class="go_website" href="<?= $item->link() ?>"><?= $item->title() ?></a></h1> <div class="author"><?php $authors = $item->authors(); @@ -50,7 +50,7 @@ if (!empty($this->entries)) { echo $first ? _t('gen.short.by_author') . ' ' : '· '; $first = false; ?> -<em><a href="<?php echo _url('index', 'index', 'search', 'author:' . str_replace(' ', '+', htmlspecialchars_decode($author, ENT_QUOTES))); ?>"><?php echo $author; ?></a></em> +<em><a href="<?= _url('index', 'index', 'search', 'author:' . str_replace(' ', '+', htmlspecialchars_decode($author, ENT_QUOTES))) ?>"><?= $author ?></a></em> <?php endforeach; echo ' — '; @@ -58,7 +58,7 @@ if (!empty($this->entries)) { echo $item->date(); ?></div> - <?php echo $item->content(); ?> + <?= $item->content() ?> </div> </div> </div> @@ -69,7 +69,7 @@ if (!empty($this->entries)) { <?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 /> + <h2><?= _t('index.feed.empty') ?></h2> + <a href="<?= _url('subscription', 'index') ?>"><?= _t('index.feed.add') ?></a><br /><br /> </div> <?php } ?> diff --git a/app/views/index/rss.phtml b/app/views/index/rss.phtml index 104e03d15..00be01c28 100755 --- a/app/views/index/rss.phtml +++ b/app/views/index/rss.phtml @@ -1,23 +1,23 @@ -<?php echo '<?xml version="1.0" encoding="UTF-8" ?>'; ?> +<?= '<?xml version="1.0" encoding="UTF-8" ?>'; ?> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel> - <title><?php echo $this->rss_title; ?></title> - <link><?php echo Minz_Url::display(null, 'html', true); ?></link> - <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->url, 'html', true); ?>" rel="self" type="application/rss+xml" /> + <title><?= $this->rss_title ?></title> + <link><?= Minz_Url::display(null, 'html', true) ?></link> + <description><?= _t('index.feed.rss_of', $this->rss_title) ?></description> + <pubDate><?= date('D, d M Y H:i:s O') ?></pubDate> + <lastBuildDate><?= gmdate('D, d M Y H:i:s') ?> GMT</lastBuildDate> + <atom:link href="<?= 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> + <title><?= $item->title() ?></title> + <link><?= $item->link() ?></link> <?php $authors = $item->authors(); if (is_array($authors)) { foreach ($authors as $author) { - echo "\t\t\t" , '<author>', $author, '</author>', "\n"; + echo "\t\t\t" , '<dc:creator>', $author, '</dc:creator>', "\n"; } } $categories = $item->tags(); @@ -30,8 +30,8 @@ foreach ($this->entries as $item) { <description><![CDATA[<?php 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><?= date('D, d M Y H:i:s O', $item->date(true)) ?></pubDate> + <guid isPermaLink="false"><?= $item->id() ?></guid> </item> <?php } ?> diff --git a/app/views/index/tos.phtml b/app/views/index/tos.phtml new file mode 100644 index 000000000..38dd0add6 --- /dev/null +++ b/app/views/index/tos.phtml @@ -0,0 +1,13 @@ +<div class="post content"> + <?php if ($this->can_register) { ?> + <a href="<?= _url('auth', 'register') ?>"> + <?= _t('gen.action.back') ?> + </a> + <?php } else { ?> + <a href="<?= _url('index', 'index') ?>"> + <?= _t('gen.action.back') ?> + </a> + <?php } ?> + + <?= $this->terms_of_service ?> +</div> diff --git a/app/views/stats/idle.phtml b/app/views/stats/idle.phtml index 88c78d465..9421893fb 100644 --- a/app/views/stats/idle.phtml +++ b/app/views/stats/idle.phtml @@ -1,9 +1,9 @@ <?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> + <a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a> - <h1><?php echo _t('admin.stats.idle'); ?></h1> + <h1><?= _t('admin.stats.idle') ?></h1> <?php $current_url = Minz_Url::display( @@ -16,21 +16,21 @@ $nothing = false; ?> <div class="stat"> - <h2><?php echo _t('gen.date.' . $period); ?></h2> + <h2><?= _t('gen.date.' . $period) ?></h2> <form id="form-delete" method="post"> - <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <input type="hidden" name="_csrf" value="<?= 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> + <a class="btn" href="<?= _url('index', 'index', 'get', 'f_' . $feed['id']) ?>"><?= _i('link') ?> <?= _t('gen.action.filter') ?></a> + <a class="btn" href="<?= _url('subscription', 'index', 'id', $feed['id']) ?>"><?= _i('configure') ?> <?= _t('gen.action.manage') ?></a> + <button class="btn btn-attention confirm" form="form-delete" formaction="<?= _url('feed', 'delete', 'id', $feed['id'], 'r', $current_url) ?>"><?= _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> + <span title="<?= timestamptodate($feed['last_date'], false) ?>"><?= $feed['name'] ?> (<?= _t('admin.stats.number_entries', $feed['nb_articles']) ?>)</span> </li> </ul> <?php } ?> @@ -43,7 +43,7 @@ if ($nothing) { ?> <p class="alert alert-warn"> - <span class="alert-head"><?php echo _t('admin.stats.no_idle'); ?></span> + <span class="alert-head"><?= _t('admin.stats.no_idle') ?></span> </p> <?php } ?> </div> diff --git a/app/views/stats/index.phtml b/app/views/stats/index.phtml index 2ff3e6c52..4af197c5b 100644 --- a/app/views/stats/index.phtml +++ b/app/views/stats/index.phtml @@ -1,63 +1,63 @@ <?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> + <a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a> - <h1><?php echo _t('admin.stats.main'); ?></h1> + <h1><?= _t('admin.stats.main') ?></h1> <div class="stat half"> - <h2><?php echo _t('admin.stats.entry_repartition'); ?></h2> + <h2><?= _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> + <th><?= _t('admin.stats.main_stream') ?></th> + <th><?= _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> + <th><?= _t('admin.stats.status_total') ?></th> + <td class="numeric"><?= format_number($this->repartition['main_stream']['total']) ?></td> + <td class="numeric"><?= 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> + <th><?= _t('admin.stats.status_read') ?></th> + <td class="numeric"><?= format_number($this->repartition['main_stream']['count_reads']) ?></td> + <td class="numeric"><?= 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> + <th><?= _t('admin.stats.status_unread') ?></th> + <td class="numeric"><?= format_number($this->repartition['main_stream']['count_unreads']) ?></td> + <td class="numeric"><?= 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> + <th><?= _t('admin.stats.status_favorites') ?></th> + <td class="numeric"><?= format_number($this->repartition['main_stream']['count_favorites']) ?></td> + <td class="numeric"><?= 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> + <h2><?= _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> + <th><?= _t('admin.stats.feed') ?></th> + <th><?= _t('admin.stats.category') ?></th> + <th><?= _t('admin.stats.entry_count') ?></th> + <th><?= _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> + <td><a href="<?= _url('stats', 'repartition', 'id', $feed['id']) ?>"><?= $feed['name'] ?></a></td> + <td><?= $feed['category'] ?></td> + <td class="numeric"><?= format_number($feed['count']) ?></td> + <td class="numeric"><?= format_number($feed['count'] / $this->repartition['all_feeds']['total'] * 100, 1) ?></td> </tr> <?php } ?> </tbody> @@ -65,18 +65,18 @@ </div> <div class="stat"> - <h2><?php echo _t('admin.stats.entry_per_day'); ?></h2> + <h2><?= _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> + <h2><?= _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> + <h2><?= _t('admin.stats.entry_per_category') ?></h2> <div id="statsEntryPerCategory" class="statGraph"></div> <div id="statsEntryPerCategoryLegend"></div> </div> @@ -90,4 +90,4 @@ echo htmlspecialchars(json_encode(array( 'entryByCategory' => $this->entryByCategory, ), JSON_UNESCAPED_UNICODE), ENT_NOQUOTES, 'UTF-8'); ?></script> -<script src="../scripts/stats.js?<?php echo @filemtime(PUBLIC_PATH . '/scripts/stats.js'); ?>"></script> +<script src="../scripts/stats.js?<?= @filemtime(PUBLIC_PATH . '/scripts/stats.js') ?>"></script> diff --git a/app/views/stats/repartition.phtml b/app/views/stats/repartition.phtml index 4bce418c9..7b445a7cc 100644 --- a/app/views/stats/repartition.phtml +++ b/app/views/stats/repartition.phtml @@ -1,12 +1,12 @@ <?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> + <a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a> - <h1><?php echo _t('admin.stats.repartition'); ?></h1> + <h1><?= _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> + <option data-url="<?= _url('stats', 'repartition') ?>"><?= _t('admin.stats.all_feeds') ?></option> <?php foreach ($this->categories as $category) { $feeds = $category->feeds(); if (!empty($feeds)) { @@ -24,40 +24,40 @@ </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 class="btn" href="<?= _url('subscription', 'index', 'id', $this->feed->id()) ?>"> + <?= _i('configure') ?> <?= _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> + <th><?= _t('admin.stats.status_total') ?></th> + <th><?= _t('admin.stats.status_read') ?></th> + <th><?= _t('admin.stats.status_unread') ?></th> + <th><?= _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> + <td class="numeric"><?= $this->repartition['total'] ?></td> + <td class="numeric"><?= $this->repartition['count_reads'] ?></td> + <td class="numeric"><?= $this->repartition['count_unreads'] ?></td> + <td class="numeric"><?= $this->repartition['count_favorites'] ?></td> </tr> </table> </div> <div class="stat"> - <h2><?php echo _t('admin.stats.entry_per_hour', $this->averageHour); ?></h2> + <h2><?= _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> + <h2><?= _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> + <h2><?= _t('admin.stats.entry_per_month', $this->averageMonth) ?></h2> <div id="statsEntryPerMonth" class="statGraph"></div> </div> </div> @@ -71,4 +71,4 @@ echo htmlspecialchars(json_encode(array( 'months' => $this->months, ), JSON_UNESCAPED_UNICODE), ENT_NOQUOTES, 'UTF-8'); ?></script> -<script src="../scripts/repartition.js?<?php echo @filemtime(PUBLIC_PATH . '/scripts/repartition.js'); ?>"></script> +<script src="../scripts/repartition.js?<?= @filemtime(PUBLIC_PATH . '/scripts/repartition.js') ?>"></script> diff --git a/app/views/subscription/bookmarklet.phtml b/app/views/subscription/bookmarklet.phtml index 76ac700e0..e6f311f58 100644 --- a/app/views/subscription/bookmarklet.phtml +++ b/app/views/subscription/bookmarklet.phtml @@ -1,17 +1,20 @@ <?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> + <a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a> - <legend><?php echo _t('sub.bookmarklet.title'); ?></legend> - <p><a class="btn btn-important" 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.bookmarklet.label'); ?></a></p> - <?php echo _t('sub.bookmarklet.documentation'); ?> + <legend><?= _t('sub.bookmarklet.title') ?></legend> + <p><a class="btn btn-important" href="javascript:(function(){var%20url%20=%20location.href;var%20otherWindow=window.open('about:blank','_blank');otherWindow.opener=null;otherWindow.location='<?= Minz_Url::display(array('c' => 'feed', 'a' => 'add'), 'html', true) ?>&url_rss='+encodeURIComponent(url);})();"><?= _t('sub.bookmarklet.label') ?></a></p> + <?= _t('sub.bookmarklet.documentation') ?> - <legend><?php echo _t('sub.firefox.title'); ?></legend> - <p><?php echo _t('sub.firefox.documentation'); ?></p> - <pre>browser.contentHandlers.types.number.uri → <?php echo Minz_Url::display(array('c' => 'feed', 'a' => 'add'), 'html', true); ?>&url_rss=%s</pre> + <legend><?= _t('sub.firefox.title') ?></legend> + <p class="alert alert-warn"> + <?= _t('sub.firefox.obsolete_63', $this->default_category->name()) ?> + </p> + <p><?= _t('sub.firefox.documentation') ?></p> + <pre>browser.contentHandlers.types.number.uri → <?= Minz_Url::display(array('c' => 'feed', 'a' => 'add'), 'html', true) ?>&url_rss=%s</pre> - <legend><?php echo _t('sub.api.title'); ?></legend> - <p><?php echo _t('sub.api.documentation'); ?></p> - <pre><?php echo Minz_Url::display(array('c' => 'feed', 'a' => 'add'), 'html', true); ?>&url_rss=%s</pre> + <legend><?= _t('sub.api.title') ?></legend> + <p><?= _t('sub.api.documentation') ?></p> + <pre><?= Minz_Url::display(array('c' => 'feed', 'a' => 'add'), 'html', true) ?>&url_rss=%s</pre> </div>
\ No newline at end of file diff --git a/app/views/subscription/feed.phtml b/app/views/subscription/feed.phtml index 60664fdee..1a167777f 100644 --- a/app/views/subscription/feed.phtml +++ b/app/views/subscription/feed.phtml @@ -9,7 +9,7 @@ if ($this->feed) { } 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'); ?> + <span class="alert-head"><?= _t('sub.feed.no_selected') ?></span> + <?= _t('sub.feed.think_to_add') ?> </div> <?php } ?> diff --git a/app/views/subscription/index.phtml b/app/views/subscription/index.phtml index 20f72ad66..da7593a8d 100644 --- a/app/views/subscription/index.phtml +++ b/app/views/subscription/index.phtml @@ -1,77 +1,77 @@ <?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> + <a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a> - <h2><?php echo _t('sub.title'); ?></h2> + <h2><?= _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(); ?>" /> + <form id="add_rss" method="post" action="<?= _url('feed', 'add') ?>" autocomplete="off"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> <div class="stick"> - <input type="url" name="url_rss" class="long" placeholder="<?php echo _t('sub.feed.add'); ?>" /> + <input type="url" name="url_rss" class="long" placeholder="<?= _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> + <a class="dropdown-toggle btn" href="#dropdown-cat"><?= _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="dropdown-header"><?= _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 value="<?= $cat->id() ?>"<?= $cat->id() == 1 ? ' selected="selected"' : '' ?>> + <?= $cat->name() ?> </option> <?php } ?> - <option value="nc"><?php echo _t('sub.category.new'); ?></option> + <option value="nc"><?= _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'); ?>" /> + <input type="text" name="new_category[name]" id="new_category_name" autocomplete="off" placeholder="<?= _t('sub.category.new') ?>" /> </li> <li class="separator"></li> - <li class="dropdown-header"><?php echo _t('sub.feed.auth.http'); ?></li> + <li class="dropdown-header"><?= _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'); ?>" /> + <input type="text" name="http_user" id="http_user_feed" value=" " autocomplete="off" placeholder="<?= _t('sub.feed.auth.username') ?>" /> </li> <li class="input"> - <input type="password" name="http_pass" id="http_pass_feed" autocomplete="new-password" placeholder="<?php echo _t('sub.feed.auth.password'); ?>" /> + <input type="password" name="http_pass" id="http_pass_feed" autocomplete="new-password" placeholder="<?= _t('sub.feed.auth.password') ?>" /> </li> </ul> </div> - <button class="btn" type="submit"><?php echo _i('add'); ?></button> + <button class="btn" type="submit"><?= _i('add') ?></button> </div> </form> <p class="alert alert-warn"> - <?php echo _t('sub.feed.moved_category_deleted', $this->default_category->name()); ?> + <?= _t('sub.feed.moved_category_deleted', $this->default_category->name()) ?> </p> <?php if ($this->onlyFeedsWithError): ?> <p class="alert alert-warn"> - <?php echo _t('sub.feed.showing.error'); ?> + <?= _t('sub.feed.showing.error') ?> </p> <?php endif; ?> <div class="box"> - <div class="box-title"><label for="new-category"><?php echo _t('sub.category.add'); ?></label></div> + <div class="box-title"><label for="new-category"><?= _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 action="<?= _url('category', 'create') ?>" method="post"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <li class="item"><input type="text" id="new-category" name="new-category" placeholder="<?= _t('sub.category.new') ?>" /></li> + <li class="item"><button class="btn btn-important" type="submit"><?= _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(); ?>" /> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> </form> <?php @@ -80,10 +80,10 @@ ?> <div class="box"> <div class="box-title"> - <a class="configure open-slider" href="<?php echo _url('subscription', 'category', 'id', $cat->id()); ?>"><?php echo _i('configure'); ?></a> - <?php echo $cat->name(); ?> + <a class="configure open-slider" href="<?= _url('subscription', 'category', 'id', $cat->id()) ?>"><?= _i('configure') ?></a> + <?= $cat->name() ?> </div> - <ul class="box-content" data-cat-id="<?php echo $cat->id(); ?>"> + <ul class="box-content" data-cat-id="<?= $cat->id() ?>"> <?php if (!empty($feeds)) { ?> <?php foreach ($feeds as $feed) { @@ -93,17 +93,17 @@ $error = $feed->inError() ? ' error' : ''; $empty = $feed->nbEntries() == 0 ? ' empty' : ''; ?> - <li class="item feed<?php echo $error, $empty, $feed->mute() ? ' mute': ''; ?>" + <li class="item feed<?= $error, $empty, $feed->mute() ? ' mute': '' ?>" draggable="true" - data-feed-id="<?php echo $feed->id(); ?>" + data-feed-id="<?= $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(); ?> + <a class="configure open-slider" href="<?= _url('subscription', 'feed', 'id', $feed->id()) ?>"><?= _i('configure') ?></a> + <img class="favicon" src="<?= $feed->favicon() ?>" alt="✇" /> <?= $feed->name() ?> </li> <?php } } else { ?> - <li class="item disabled" dropzone="move"><?php echo _t('sub.category.empty'); ?></li> + <li class="item disabled" dropzone="move"><?= _t('sub.category.empty') ?></li> <?php } ?> </ul> </div> @@ -111,16 +111,16 @@ <ul> <?php if ($this->onlyFeedsWithError): ?> - <li><a href="<?php echo _url('subscription', 'index'); ?>"><?php echo _t('sub.feed.show.all'); ?></a></li> + <li><a href="<?= _url('subscription', 'index') ?>"><?= _t('sub.feed.show.all') ?></a></li> <?php else: ?> - <li><a href="<?php echo _url('subscription', 'index', 'error', 1); ?>"><?php echo _t('sub.feed.show.error'); ?></a></li> + <li><a href="<?= _url('subscription', 'index', 'error', 1) ?>"><?= _t('sub.feed.show.error') ?></a></li> <?php endif; ?> </ul> </div> <?php $class = $this->displaySlider ? ' class="active"' : ''; ?> -<a href="#" id="close-slider"<?php echo $class; ?>></a> -<div id="slider"<?php echo $class; ?>> +<a href="#" id="close-slider"<?= $class ?>></a> +<div id="slider"<?= $class ?>> <?php if (isset($this->feed)) { $this->renderHelper('feed/update'); diff --git a/app/views/update/apply.phtml b/app/views/update/apply.phtml index 8221929ae..c5e6884db 100644 --- a/app/views/update/apply.phtml +++ b/app/views/update/apply.phtml @@ -1,9 +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> + <a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a> - <h1><?php echo _t('admin.update'); ?></h1> + <h1><?= _t('admin.update') ?></h1> <?php ask_info_update(); ?> </div> diff --git a/app/views/update/checkInstall.phtml b/app/views/update/checkInstall.phtml index 33d78cbe7..183f914c0 100644 --- a/app/views/update/checkInstall.phtml +++ b/app/views/update/checkInstall.phtml @@ -1,15 +1,15 @@ <?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> + <a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a> - <h2><?php echo _t('admin.check_install.php'); ?></h2> + <h2><?= _t('admin.check_install.php') ?></h2> <?php foreach ($this->status_php as $key => $status) { ?> - <p class="alert <?php echo $status ? 'alert-success' : 'alert-error'; ?>"> + <p class="alert <?= $status ? 'alert-success' : 'alert-error' ?>"> <?php if ($key === 'php') { - echo _t('admin.check_install.' . $key . '.' . ($status ? 'ok' : 'nok'), PHP_VERSION, '5.3.8'); + echo _t('admin.check_install.' . $key . '.' . ($status ? 'ok' : 'nok'), PHP_VERSION, '5.6.0'); } else { echo _t('admin.check_install.' . $key . '.' . ($status ? 'ok' : 'nok')); } @@ -17,20 +17,20 @@ </p> <?php } ?> - <h2><?php echo _t('admin.check_install.files'); ?></h2> + <h2><?= _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 class="alert <?= $status ? 'alert-success' : 'alert-error' ?>"> + <?= _t('admin.check_install.' . $key . '.' . ($status ? 'ok' : 'nok')) ?> </p> <?php } ?> <?php /* - <h2><?php echo _t('admin.check_install.database'); ?></h2> + <h2><?= _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 class="alert <?= $status ? 'alert-success' : 'alert-error' ?>"> + <?= _t('admin.check_install.' . $key . '.' . ($status ? 'ok' : 'nok')) ?> </p> <?php } ?> */ ?> diff --git a/app/views/update/index.phtml b/app/views/update/index.phtml index 0599d5b0d..041941e39 100644 --- a/app/views/update/index.phtml +++ b/app/views/update/index.phtml @@ -1,16 +1,16 @@ <?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> + <a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a> - <h1><?php echo _t('admin.update'); ?></h1> + <h1><?= _t('admin.update') ?></h1> <p> - <?php echo _i('help'); ?> <?php echo _t('admin.update.current_version', FRESHRSS_VERSION); ?> + <?= _i('help') ?> <?= _t('admin.update.current_version', FRESHRSS_VERSION) ?> </p> <p> - <?php echo _t('admin.update.last', $this->last_update_time); ?> + <?= _t('admin.update.last', $this->last_update_time) ?> </p> <?php if (!empty($this->message)) { ?> @@ -28,9 +28,9 @@ break; } ?> - <p class="alert <?php echo $class; ?>"> - <span class="alert-head"><?php echo $this->message['title']; ?></span> - <?php echo $this->message['body']; ?> + <p class="alert <?= $class ?>"> + <span class="alert-head"><?= $this->message['title'] ?></span> + <?= $this->message['body'] ?> </p> <?php } ?> @@ -38,11 +38,11 @@ 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> + <a href="<?= _url('update', 'check') ?>" class="btn"><?= _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> + <a class="btn btn-important" href="<?= _url('update', 'apply') ?>"><?= _t('admin.update.apply') ?></a> <?php } ?> </div> diff --git a/app/views/user/manage.phtml b/app/views/user/manage.phtml index d0e5928ef..93d1008b5 100644 --- a/app/views/user/manage.phtml +++ b/app/views/user/manage.phtml @@ -1,98 +1,109 @@ <?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> + <a href="<?= _url('index', 'index') ?>"><?= _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> + <form method="post" action="<?= _url('user', 'create') ?>" autocomplete="off"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <legend><?= _t('admin.user.create') ?></legend> <div class="form-group"> - <label class="group-name" for="new_user_language"><?php echo _t('admin.user.language'); ?></label> + <label class="group-name" for="new_user_language"><?= _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> + <option value="<?= $lang ?>"<?= FreshRSS_Context::$user_conf->language === $lang ? ' selected="selected"' : '' ?>><?= _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> + <label class="group-name" for="new_user_name"><?= _t('admin.user.username') ?></label> <div class="group-controls"> - <input id="new_user_name" name="new_user_name" type="text" size="16" required="required" autocomplete="off" pattern="<?php echo FreshRSS_user_Controller::USERNAME_PATTERN; ?>" placeholder="demo" /> + <input id="new_user_name" name="new_user_name" type="text" size="16" required="required" autocomplete="off" pattern="<?= FreshRSS_user_Controller::USERNAME_PATTERN ?>" placeholder="demo" /> </div> </div> + <?php if ($this->show_email_field) { ?> + <div class="form-group"> + <label class="group-name" for="new_user_email"> + <?= _t('gen.auth.email') ?> + </label> + <div class="group-controls"> + <input id="new_user_email" name="new_user_email" type="email" required /> + </div> + </div> + <?php } ?> + <div class="form-group"> - <label class="group-name" for="new_user_passwordPlain"><?php echo _t('admin.user.password_form'); ?></label> + <label class="group-name" for="new_user_passwordPlain"><?= _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> + <a class="btn toggle-password" data-toggle="new_user_passwordPlain"><?= _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> + <?= _i('help') ?> <?= _t('admin.user.password_format') ?> + <noscript><b><?= _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> + <button type="submit" class="btn btn-important"><?= _t('gen.action.create') ?></button> + <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button> </div> </div> </form> - <form method="post" action="<?php echo _url('user', 'update'); ?>"> - <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> - <legend><?php echo _t('admin.user.update_users'); ?></legend> + <form method="post" action="<?= _url('user', 'update') ?>"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <legend><?= _t('admin.user.update_users') ?></legend> <div class="form-group"> - <label class="group-name" for="current_user"><?php echo _t('admin.user.selected'); ?></label> + <label class="group-name" for="current_user"><?= _t('admin.user.selected') ?></label> <div class="group-controls"> <select id="current_user" name="username"> <option selected="selected"> </option> <?php foreach (listUsers() as $username) { ?> - <option value="<?php echo $username; ?>"><?php echo $username; ?></option> + <option value="<?= $username ?>"><?= $username ?></option> <?php } ?> </select> </div> </div> <div class="form-group"> - <label class="group-name" for="newPasswordPlain"><?php echo _t('admin.user.password_form'); ?></label> + <label class="group-name" for="newPasswordPlain"><?= _t('admin.user.password_form') ?></label> <div class="group-controls"> <div class="stick"> - <input type="password" id="newPasswordPlain" name="newPasswordPlain" autocomplete="new-password" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/> - <a class="btn toggle-password" data-toggle="newPasswordPlain"><?php echo _i('key'); ?></a> + <input type="password" id="newPasswordPlain" name="newPasswordPlain" autocomplete="new-password" pattern=".{7,}" <?= cryptAvailable() ? '' : 'disabled="disabled" ' ?>/> + <a class="btn toggle-password" data-toggle="newPasswordPlain"><?= _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> + <?= _i('help') ?> <?= _t('conf.profile.password_format') ?> + <noscript><b><?= _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.update'); ?></button> - <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> + <button type="submit" class="btn btn-important"><?= _t('gen.action.update') ?></button> + <button type="reset" class="btn"><?= _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.delete_users'); ?></legend> + <form method="post" action="<?= _url('user', 'delete') ?>"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <legend><?= _t('admin.user.delete_users') ?></legend> <div class="form-group"> - <label class="group-name" for="user-list"><?php echo _t('admin.user.selected'); ?></label> + <label class="group-name" for="user-list"><?= _t('admin.user.selected') ?></label> <div class="group-controls"> <select id="user-list" class="select-change" name="username"> <option selected="selected"> </option> <?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> + <option data-url="<?= _url('user', 'manage', 'u', $username) ?>" <?= $this->current_user === $username ? 'selected="selected"' : '' ?> value="<?= $username ?>"><?= $username ?></option> <?php } ?> </select> @@ -104,7 +115,7 @@ <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> + <button type="submit" class="btn btn-attention confirm"><?= _t('gen.action.remove') ?></button> </div> </div> </form> diff --git a/app/views/user/profile.phtml b/app/views/user/profile.phtml index 83140376d..b8bb5cee9 100644 --- a/app/views/user/profile.phtml +++ b/app/views/user/profile.phtml @@ -1,82 +1,100 @@ -<?php $this->partial('aside_configure'); ?> +<?php + if (!$this->disable_aside) { + $this->partial('aside_configure'); + } +?> <div class="post"> - <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + <a href="<?= _url('index', 'index') ?>"><?= _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> + <form method="post" action="<?= _url('user', 'profile') ?>"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <legend><?= _t('conf.profile') ?></legend> <div class="form-group"> - <label class="group-name" for="current_user"><?php echo _t('conf.user.current'); ?></label> + <label class="group-name" for="current_user"><?= _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> + <input id="current_user" type="text" disabled="disabled" value="<?= Minz_Session::param('currentUser', '_') ?>" /> + </div> + </div> + + <?php if (FreshRSS_Auth::hasAccess('admin')) { ?> + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="is_admin"> + <input type="checkbox" id="is_admin" disabled checked /> + <?= _t('conf.user.is_admin') ?> + </label> + </div> + </div> + <?php } ?> + + <div class="form-group"> + <label class="group-name" for="email"><?= _t('conf.profile.email') ?></label> + <div class="group-controls"> + <input id="email" name="email" type="email" value="<?= FreshRSS_Context::$user_conf->mail_login ?>" /> </div> </div> <div class="form-group"> - <label class="group-name" for="newPasswordPlain"><?php echo _t('conf.profile.password_form'); ?></label> + <label class="group-name" for="newPasswordPlain"><?= _t('conf.profile.password_form') ?></label> <div class="group-controls"> <div class="stick"> - <input type="password" id="newPasswordPlain" name="newPasswordPlain" autocomplete="new-password" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/> - <a class="btn toggle-password" data-toggle="newPasswordPlain"><?php echo _i('key'); ?></a> + <input type="password" id="newPasswordPlain" name="newPasswordPlain" autocomplete="new-password" pattern=".{7,}" <?= cryptAvailable() ? '' : 'disabled="disabled" ' ?>/> + <a class="btn toggle-password" data-toggle="newPasswordPlain"><?= _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> + <?= _i('help') ?> <?= _t('conf.profile.password_format') ?> + <noscript><b><?= _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> + <label class="group-name" for="apiPasswordPlain"><?= _t('conf.profile.password_api') ?></label> <div class="group-controls"> <div class="stick"> - <input type="password" id="apiPasswordPlain" name="apiPasswordPlain" autocomplete="new-password" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/> - <a class="btn toggle-password" data-toggle="apiPasswordPlain"><?php echo _i('key'); ?></a> + <input type="password" id="apiPasswordPlain" name="apiPasswordPlain" autocomplete="new-password" pattern=".{7,}" <?= cryptAvailable() ? '' : 'disabled="disabled" ' ?>/> + <a class="btn toggle-password" data-toggle="apiPasswordPlain"><?= _i('key') ?></a> </div> - <?php echo _i('help'); ?> <kbd><a href="../api/"><?php echo Minz_Url::display('/api/', 'html', true); ?></a></kbd> + <?= _i('help') ?> <kbd><a href="../api/"><?= Minz_Url::display('/api/', 'html', true) ?></a></kbd> </div> </div> <?php } ?> <?php if (FreshRSS_Auth::accessNeedsAction()) { ?> <div class="form-group"> - <label class="group-name" for="token"><?php echo _t('admin.auth.token'); ?></label> + <label class="group-name" for="token"><?= _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('user' => Minz_Session::param('currentUser'), 'token' => $token, 'hours' => FreshRSS_Context::$user_conf->since_hours_posts_per_rss)), 'html', true); ?></kbd> + <input type="text" id="token" name="token" value="<?= $token ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>"<?php + echo FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"'; ?> data-leave-validation="<?= $token ?>"/> + <?= _i('help') ?> <?= _t('admin.auth.token_help') ?> + <kbd><?= Minz_Url::display(array('a' => 'rss', 'params' => array('user' => Minz_Session::param('currentUser'), 'token' => $token, 'hours' => FreshRSS_Context::$user_conf->since_hours_posts_per_rss)), 'html', true) ?></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> + <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> <?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> + <form id="crypto-form" method="post" action="<?= _url('user', 'delete') ?>"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <legend><?= _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> + <p class="alert alert-warn"><span class="alert-head"><?= _t('gen.short.attention') ?></span> <?= _t('conf.profile.delete.warn') ?></p> <div class="form-group"> - <label class="group-name" for="passwordPlain"><?php echo _t('gen.auth.password'); ?></label> + <label class="group-name" for="passwordPlain"><?= _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> + <noscript><strong><?= _t('gen.js.should_be_activated') ?></strong></noscript> </div> </div> @@ -88,9 +106,9 @@ '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> + <input type="hidden" name="r" value="<?= $redirect_url ?>" /> + <input type="hidden" name="username" id="username" value="<?= Minz_Session::param('currentUser', '_') ?>" /> + <button type="submit" class="btn btn-attention confirm"><?= _t('gen.action.remove') ?></button> </div> </div> </form> diff --git a/app/views/user/validateEmail.phtml b/app/views/user/validateEmail.phtml new file mode 100644 index 000000000..e525b1b6b --- /dev/null +++ b/app/views/user/validateEmail.phtml @@ -0,0 +1,22 @@ +<div class="post"> + <p> + <?= _t('user.email.validation.need_to', FreshRSS_Context::$system_conf->title) ?> + </p> + + <p> + <?= _t('user.email.validation.email_sent_to', FreshRSS_Context::$user_conf->mail_login) ?> + </p> + + <form action="<?= _url('user', 'sendValidationEmail') ?>" method="post"> + <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" /> + <button type="submit" class="btn"> + <?= _t('user.email.validation.resend_email') ?> + </button> + </form> + + <p> + <small> + <?= _t('user.email.validation.change_email', _url('user', 'profile')) ?> + </small> + </p> +</div> diff --git a/app/views/user_mailer/email_need_validation.txt b/app/views/user_mailer/email_need_validation.txt new file mode 100644 index 000000000..c1f4d9911 --- /dev/null +++ b/app/views/user_mailer/email_need_validation.txt @@ -0,0 +1,5 @@ +<?= _t('user.mailer.email_need_validation.welcome', $this->username) ?> + +<?= _t('user.mailer.email_need_validation.body', $this->site_title) ?> + +<?= $this->validation_url ?> |
