diff options
| author | 2015-01-31 14:45:37 +0100 | |
|---|---|---|
| committer | 2015-01-31 14:45:37 +0100 | |
| commit | a97bbd9bd54c5fa56d54b3c214cf4e8af96af8b2 (patch) | |
| tree | 6e83890bc1b3814a12c3b7bedc0d5944f30f507b /app/views | |
| parent | 42fd539a1b14f883077048a35864b4294b6efe94 (diff) | |
| parent | e91b72b63cd11ae3c4f59e48439e93955242c673 (diff) | |
Merge branch 'dev'
Conflicts:
CHANGELOG
README.fr.md
README.md
app/Controllers/feedController.php
app/Controllers/indexController.php
app/i18n/en.php
app/i18n/fr.php
app/views/helpers/view/normal_view.phtml
app/views/stats/index.phtml
app/views/stats/repartition.phtml
constants.php
p/scripts/main.js
Diffstat (limited to 'app/views')
55 files changed, 1538 insertions, 1262 deletions
diff --git a/app/views/auth/formLogin.phtml b/app/views/auth/formLogin.phtml new file mode 100644 index 000000000..979e17349 --- /dev/null +++ b/app/views/auth/formLogin.phtml @@ -0,0 +1,28 @@ +<div class="prompt"> + <h1><?php echo _t('gen.auth.login'); ?></h1> + + <form id="crypto-form" method="post" action="<?php echo _url('auth', 'login'); ?>"> + <div> + <label for="username"><?php echo _t('gen.auth.username'); ?></label> + <input type="text" id="username" name="username" size="16" required="required" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" autofocus="autofocus" /> + </div> + <div> + <label for="passwordPlain"><?php echo _t('gen.auth.password'); ?></label> + <input type="password" id="passwordPlain" required="required" /> + <input type="hidden" id="challenge" name="challenge" /><br /> + <noscript><strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> + </div> + <div> + <label class="checkbox" for="keep_logged_in"> + <input type="checkbox" name="keep_logged_in" id="keep_logged_in" value="1" /> + <?php echo _t('gen.auth.keep_logged_in'); ?> + </label> + <br /> + </div> + <div> + <button id="loginButton" type="submit" class="btn btn-important"><?php echo _t('gen.auth.login'); ?></button> + </div> + </form> + + <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('gen.freshrss.about'); ?></a></p> +</div> diff --git a/app/views/auth/index.phtml b/app/views/auth/index.phtml new file mode 100644 index 000000000..f7a862ac9 --- /dev/null +++ b/app/views/auth/index.phtml @@ -0,0 +1,85 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <form method="post" action="<?php echo _url('auth', 'index'); ?>"> + <legend><?php echo _t('admin.auth.type'); ?></legend> + + <div class="form-group"> + <label class="group-name" for="auth_type"><?php echo _t('admin.auth.type'); ?></label> + <div class="group-controls"> + <select id="auth_type" name="auth_type" required="required"> + <?php if (!in_array(FreshRSS_Context::$system_conf->auth_type, array('form', 'persona', '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="persona"<?php echo FreshRSS_Context::$system_conf->auth_type === 'persona' ? ' selected="selected"' : '', FreshRSS_Context::$user_conf->mail_login == '' ? ' disabled="disabled"' : ''; ?>><?php echo _t('admin.auth.persona'); ?></option> + <option value="http_auth"<?php echo FreshRSS_Context::$system_conf->auth_type === 'http_auth' ? ' selected="selected"' : '', httpAuthUser() == '' ? ' disabled="disabled"' : ''; ?>><?php echo _t('admin.auth.http'); ?> (REMOTE_USER = '<?php echo httpAuthUser(); ?>')</option> + <option value="none"<?php echo FreshRSS_Context::$system_conf->auth_type === 'none' ? ' selected="selected"' : ''; ?>><?php echo _t('admin.auth.none'); ?></option> + </select> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="anon_access"> + <input type="checkbox" name="anon_access" id="anon_access" value="1"<?php echo FreshRSS_Context::$system_conf->allow_anonymous ? ' checked="checked"' : '', + FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"'; ?> /> + <?php echo _t('admin.auth.allow_anonymous', FreshRSS_Context::$system_conf->default_user); ?> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="anon_refresh"> + <input type="checkbox" name="anon_refresh" id="anon_refresh" value="1"<?php echo FreshRSS_Context::$system_conf->allow_anonymous_refresh ? ' checked="checked"' : '', + FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"'; ?> /> + <?php echo _t('admin.auth.allow_anonymous_refresh'); ?> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="unsafe_autologin"> + <input type="checkbox" name="unsafe_autologin" id="unsafe_autologin" value="1"<?php echo FreshRSS_Context::$system_conf->unsafe_autologin_enabled ? ' checked="checked"' : '', + FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"'; ?> /> + <?php echo _t('admin.auth.unsafe_autologin'); ?> + <kbd><?php echo Minz_Url::display(array('c' => 'auth', 'a' => 'login', 'params' => array('u' => 'alice', 'p' => '1234')), 'html', true); ?></kbd> + </label> + </div> + </div> + + <?php if (FreshRSS_Auth::accessNeedsAction()) { ?> + <div class="form-group"> + <label class="group-name" for="token"><?php echo _t('admin.auth.token'); ?></label> + <?php $token = FreshRSS_Context::$user_conf->token; ?> + <div class="group-controls"> + <input type="text" id="token" name="token" value="<?php echo $token; ?>" placeholder="<?php echo _t('gen.short.blank_to_disable'); ?>"<?php + echo FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"'; ?> /> + <?php echo _i('help'); ?> <?php echo _t('admin.auth.token_help'); ?> + <kbd><?php echo Minz_Url::display(array('params' => array('output' => 'rss', 'token' => $token)), 'html', true); ?></kbd> + </div> + </div> + <?php } ?> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="api_enabled"> + <input type="checkbox" name="api_enabled" id="api_enabled" value="1"<?php echo FreshRSS_Context::$system_conf->api_enabled ? ' checked="checked"' : '', + FreshRSS_Auth::accessNeedsLogin() ? '' : ' disabled="disabled"'; ?> /> + <?php echo _t('admin.auth.api_enabled'); ?> + </label> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> + </div> + </div> + </form> +</div> diff --git a/app/views/auth/logout.phtml b/app/views/auth/logout.phtml new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/app/views/auth/logout.phtml diff --git a/app/views/auth/personaLogin.phtml b/app/views/auth/personaLogin.phtml new file mode 100644 index 000000000..545ed2eac --- /dev/null +++ b/app/views/auth/personaLogin.phtml @@ -0,0 +1,24 @@ +<?php if ($this->res === false) { ?> +<div class="prompt"> + <h1><?php echo _t('gen.auth.login'); ?></h1> + + <p> + <a class="signin btn btn-important" href="<?php echo _url('auth', 'login'); ?>"> + <?php echo _i('login'); ?> <?php echo _t('gen.auth.login_persona'); ?> + </a> + + <br /><br /> + + <?php echo _i('help'); ?> + <small> + <a href="<?php echo _url('auth', 'reset'); ?>"><?php echo _t('gen.auth.login_persona_problem'); ?></a> + </small> + </p> + + <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('gen.freshrss.about'); ?></a></p> +</div> +<?php +} else { + echo json_encode($this->res); +} +?> diff --git a/app/views/index/resetAuth.phtml b/app/views/auth/reset.phtml index 6d4282c14..6e9816ad3 100644 --- a/app/views/index/resetAuth.phtml +++ b/app/views/auth/reset.phtml @@ -1,5 +1,5 @@ <div class="prompt"> - <h1><?php echo _t('auth_reset'); ?></h1> + <h1><?php echo _t('gen.auth.reset'); ?></h1> <?php if (!empty($this->message)) { ?> <p class="alert <?php echo $this->message['status'] === 'bad' ? 'alert-error' : 'alert-warn'; ?>"> @@ -9,24 +9,24 @@ <?php } ?> <?php if (!$this->no_form) { ?> - <form id="crypto-form" method="post" action="<?php echo _url('index', 'resetAuth'); ?>"> + <form id="crypto-form" method="post" action="<?php echo _url('auth', 'reset'); ?>"> <p class="alert alert-warn"> - <span class="alert-head"><?php echo _t('attention'); ?></span><br /> - <?php echo _t('auth_will_reset'); ?> + <span class="alert-head"><?php echo _t('gen.short.attention'); ?></span><br /> + <?php echo _t('gen.auth.will_reset'); ?> </p> <div> - <label for="username"><?php echo _t('username_admin'); ?></label> + <label for="username"><?php echo _t('gen.auth.username_admin'); ?></label> <input type="text" id="username" name="username" size="16" required="required" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" autofocus="autofocus" /> </div> <div> - <label for="passwordPlain"><?php echo _t('password'); ?></label> + <label for="passwordPlain"><?php echo _t('gen.auth.password'); ?></label> <input type="password" id="passwordPlain" required="required" /> <input type="hidden" id="challenge" name="challenge" /><br /> - <noscript><strong><?php echo _t('javascript_should_be_activated'); ?></strong></noscript> + <noscript><strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> </div> <div> - <button id="loginButton" type="submit" class="btn btn-important"><?php echo _t('submit'); ?></button> + <button id="loginButton" type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> </div> </form> <?php } ?> diff --git a/app/views/configure/archiving.phtml b/app/views/configure/archiving.phtml index c9cc7fe02..875463137 100644 --- a/app/views/configure/archiving.phtml +++ b/app/views/configure/archiving.phtml @@ -1,31 +1,31 @@ <?php $this->partial('aside_configure'); ?> <div class="post"> - <a href="<?php echo _url('index', 'index'); ?>"><?php echo Minz_Translate::t('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> <form method="post" action="<?php echo _url('configure', 'archiving'); ?>"> - <legend><?php echo Minz_Translate::t('archiving_configuration'); ?></legend> - <p><?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('archiving_configuration_help'); ?></p> + <legend><?php echo _t('conf.archiving'); ?></legend> + <p><?php echo _i('help'); ?> <?php echo _t('conf.archiving.help'); ?></p> <div class="form-group"> - <label class="group-name" for="old_entries"><?php echo Minz_Translate::t('delete_articles_every'); ?></label> + <label class="group-name" for="old_entries"><?php echo _t('conf.archiving.delete_after'); ?></label> <div class="group-controls"> - <input type="number" id="old_entries" name="old_entries" min="1" max="1200" value="<?php echo $this->conf->old_entries; ?>" /> <?php echo Minz_Translate::t('month'); ?> - <a class="btn confirm" href="<?php echo _url('entry', 'purge'); ?>"><?php echo Minz_Translate::t('purge_now'); ?></a> + <input type="number" id="old_entries" name="old_entries" min="1" max="1200" value="<?php echo FreshRSS_Context::$user_conf->old_entries; ?>" /> <?php echo _t('gen.date.month'); ?> + <a class="btn confirm" href="<?php echo _url('entry', 'purge'); ?>"><?php echo _t('conf.archiving.purge_now'); ?></a> </div> </div> <div class="form-group"> - <label class="group-name" for="keep_history_default"><?php echo Minz_Translate::t('keep_history'), ' ', Minz_Translate::t('by_feed'); ?></label> + <label class="group-name" for="keep_history_default"><?php echo _t('conf.archiving.keep_history_by_feed'); ?></label> <div class="group-controls"> <select class="number" name="keep_history_default" id="keep_history_default" required="required"><?php foreach (array('' => '', 0 => '0', 10 => '10', 50 => '50', 100 => '100', 500 => '500', 1000 => '1 000', 5000 => '5 000', 10000 => '10 000', -1 => '∞') as $v => $t) { - echo '<option value="' . $v . ($this->conf->keep_history_default == $v ? '" selected="selected' : '') . '">' . $t . ' </option>'; + echo '<option value="' . $v . (FreshRSS_Context::$user_conf->keep_history_default == $v ? '" selected="selected' : '') . '">' . $t . ' </option>'; } - ?></select> (<?php echo Minz_Translate::t('by_default'); ?>) + ?></select> (<?php echo _t('gen.short.by_default'); ?>) </div> </div> <div class="form-group"> - <label class="group-name" for="ttl_default"><?php echo Minz_Translate::t('ttl'); ?></label> + <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"><?php $found = false; @@ -34,44 +34,49 @@ 36000 => '10h', 43200 => '12h', 64800 => '18h', 86400 => '1d', 129600 => '1.5d', 172800 => '2d', 259200 => '3d', 345600 => '4d', 432000 => '5d', 518400 => '6d', 604800 => '1wk', -1 => '∞') as $v => $t) { - echo '<option value="' . $v . ($this->conf->ttl_default == $v ? '" selected="selected' : '') . '">' . $t . '</option>'; - if ($this->conf->ttl_default == $v) { + echo '<option value="' . $v . (FreshRSS_Context::$user_conf->ttl_default == $v ? '" selected="selected' : '') . '">' . $t . '</option>'; + if (FreshRSS_Context::$user_conf->ttl_default == $v) { $found = true; } } if (!$found) { - echo '<option value="' . intval($this->conf->ttl_default) . '" selected="selected">' . intval($this->conf->ttl_default) . 's</option>'; + echo '<option value="' . intval(FreshRSS_Context::$user_conf->ttl_default) . '" selected="selected">' . intval(FreshRSS_Context::$user_conf->ttl_default) . 's</option>'; } - ?></select> (<?php echo Minz_Translate::t('by_default'); ?>) + ?></select> (<?php echo _t('gen.short.by_default'); ?>) </div> </div> <div class="form-group form-actions"> <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('save'); ?></button> - <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> </div> </div> </form> <form method="post" action="<?php echo _url('entry', 'optimize'); ?>"> - <legend><?php echo Minz_Translate::t ('advanced'); ?></legend> + <legend><?php echo _t('conf.archiving.advanced'); ?></legend> <div class="form-group"> - <p class="group-name"><?php echo Minz_Translate::t('current_user'); ?></p> + <label class="group-name"><?php echo _t('conf.user.current'); ?></label> <div class="group-controls"> - <p><?php echo formatNumber($this->nb_total), ' ', Minz_Translate::t('articles'), ', ', formatBytes($this->size_user); ?></p> - <input type="hidden" name="optimiseDatabase" value="1" /> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('optimize_bdd'); ?></button> - <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('optimize_todo_sometimes'); ?> + <?php echo _t('conf.user.articles_and_size', format_number($this->nb_total), format_bytes($this->size_user)); ?> </div> </div> - <?php if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { ?> + <?php if (FreshRSS_Auth::hasAccess('admin')) { ?> <div class="form-group"> - <p class="group-name"><?php echo Minz_Translate::t('users'); ?></p> + <label class="group-name"><?php echo _t('conf.user.users'); ?></label> <div class="group-controls"> - <p><?php echo formatBytes($this->size_total); ?></p> + <?php echo format_bytes($this->size_total); ?> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <input type="hidden" name="optimiseDatabase" value="1" /> + <button type="submit" class="btn btn-important"><?php echo _t('conf.archiving.optimize'); ?></button> + <?php echo _i('help'); ?> <?php echo _t('conf.archiving.optimize_help'); ?> </div> </div> <?php } ?> diff --git a/app/views/configure/categorize.phtml b/app/views/configure/categorize.phtml deleted file mode 100644 index 23d1c9fa1..000000000 --- a/app/views/configure/categorize.phtml +++ /dev/null @@ -1,55 +0,0 @@ -<?php $this->partial ('aside_feed'); ?> - -<div class="post"> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> - - <form method="post" action="<?php echo _url ('configure', 'categorize'); ?>"> - <legend><?php echo Minz_Translate::t ('categories_management'); ?></legend> - - <p class="alert alert-warn"><?php echo Minz_Translate::t ('feeds_moved_category_deleted', $this->defaultCategory->name ()); ?></p> - - <?php $i = 0; foreach ($this->categories as $cat) { $i++; ?> - <div class="form-group"> - <label class="group-name" for="cat_<?php echo $cat->id (); ?>"> - <?php echo Minz_Translate::t ('category_number', $i); ?> - </label> - <div class="group-controls"> - <div class="stick"> - <input type="text" id="cat_<?php echo $cat->id (); ?>" name="categories[]" value="<?php echo $cat->name (); ?>" /> - - <?php if ($cat->nbFeed () > 0) { ?> - <a class="btn" href="<?php echo _url('index', 'index', 'get', 'c_' . $cat->id ()); ?>"> - <?php echo _i('link'); ?> - </a> - <button formaction="<?php echo _url('feed', 'delete', 'id', $cat->id (), 'type', 'category'); ?>" - class="btn btn-attention confirm" - data-str-confirm="<?php echo _t('confirm_action_feed_cat'); ?>" - type="submit"><?php echo _t('ask_empty'); ?></button> - <?php } ?> - </div> - (<?php echo Minz_Translate::t ('number_feeds', $cat->nbFeed ()); ?>) - - <?php if ($cat->id () === $this->defaultCategory->id ()) { ?> - <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('can_not_be_deleted'); ?> - <?php } ?> - - <input type="hidden" name="ids[]" value="<?php echo $cat->id (); ?>" /> - </div> - </div> - <?php } ?> - - <div class="form-group"> - <label class="group-name" for="new_category"><?php echo Minz_Translate::t ('add_category'); ?></label> - <div class="group-controls"> - <input type="text" id="new_category" name="new_category" placeholder="<?php echo Minz_Translate::t ('new_category'); ?>" /> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> - <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button> - </div> - </div> - </form> -</div> diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index 8eb3a156b..02249bc55 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -1,108 +1,122 @@ -<?php $this->partial ('aside_configure'); ?> +<?php $this->partial('aside_configure'); ?> <div class="post"> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> - <form method="post" action="<?php echo _url ('configure', 'display'); ?>"> - <legend><?php echo Minz_Translate::t ('display_configuration'); ?></legend> + <form method="post" action="<?php echo _url('configure', 'display'); ?>"> + <legend><?php echo _t('conf.display'); ?></legend> <div class="form-group"> - <label class="group-name" for="language"><?php echo Minz_Translate::t ('language'); ?></label> + <label class="group-name" for="language"><?php echo _t('conf.display.language'); ?></label> <div class="group-controls"> <select name="language" id="language"> - <?php $languages = $this->conf->availableLanguages (); ?> - <?php foreach ($languages as $short => $lib) { ?> - <option value="<?php echo $short; ?>"<?php echo $this->conf->language === $short ? ' selected="selected"' : ''; ?>><?php echo $lib; ?></option> + <?php $languages = Minz_Translate::availableLanguages(); ?> + <?php foreach ($languages as $lang) { ?> + <option value="<?php echo $lang; ?>"<?php echo FreshRSS_Context::$user_conf->language === $lang ? ' selected="selected"' : ''; ?>><?php echo _t('gen.lang.' . $lang); ?></option> <?php } ?> </select> </div> </div> <div class="form-group"> - <label class="group-name" for="theme"><?php echo Minz_Translate::t ('theme'); ?></label> + <label class="group-name" for="theme"><?php echo _t('conf.display.theme'); ?></label> <div class="group-controls"> - <select name="theme" id="theme" required=""><?php - $found = false; - foreach ($this->themes as $theme) { - ?><option value="<?php echo $theme['id']; ?>"<?php if ($this->conf->theme === $theme['id']) { echo ' selected="selected"'; $found = true; } ?>><?php - echo $theme['name'] . ' — ' . Minz_Translate::t ('by') . ' ' . $theme['author']; - ?></option><?php - } - if (!$found) { - ?><option selected="selected"></option><?php - } - ?></select> + <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'] ?>"/> + <li class="slide-container"> + <div class="slide"> + <img src="<?php echo Minz_Url::display('/themes/' . $theme['id'] . '/thumbs/original.png')?>"/> + </div> + <div class="nav"> + <?php if ($i !== 1) {?> + <label for="img-<?php echo $i - 1 ?>" class="prev">‹</label> + <?php } ?> + <?php if ($i !== $slides) {?> + <label for="img-<?php echo $i + 1 ?>" class="next">›</label> + <?php } ?> + </div> + <div class="properties"> + <div><?php echo sprintf('%s — %s', $theme['name'], _t('gen.short.by_author', $theme['author'])); ?></div> + <div><?php echo $theme['description'] ?></div> + <div class="page-number"><?php echo sprintf('%d/%d', $i, $slides) ?></div> + </div> + </li> + <?php $i++ ?> + <?php } ?> + </ul> </div> </div> - <?php $width = $this->conf->content_width; ?> + <?php $width = FreshRSS_Context::$user_conf->content_width; ?> <div class="form-group"> - <label class="group-name" for="content_width"><?php echo Minz_Translate::t('content_width'); ?></label> + <label class="group-name" for="content_width"><?php echo _t('conf.display.width.content'); ?></label> <div class="group-controls"> <select name="content_width" id="content_width" required=""> <option value="thin" <?php echo $width === 'thin'? 'selected="selected"' : ''; ?>> - <?php echo Minz_Translate::t('width_thin'); ?> + <?php echo _t('conf.display.width.thin'); ?> </option> <option value="medium" <?php echo $width === 'medium'? 'selected="selected"' : ''; ?>> - <?php echo Minz_Translate::t('width_medium'); ?> + <?php echo _t('conf.display.width.medium'); ?> </option> <option value="large" <?php echo $width === 'large'? 'selected="selected"' : ''; ?>> - <?php echo Minz_Translate::t('width_large'); ?> + <?php echo _t('conf.display.width.large'); ?> </option> <option value="no_limit" <?php echo $width === 'no_limit'? 'selected="selected"' : ''; ?>> - <?php echo Minz_Translate::t('width_no_limit'); ?> + <?php echo _t('conf.display.width.no_limit'); ?> </option> </select> </div> </div> <div class="form-group"> - <label class="group-name" for="theme"><?php echo Minz_Translate::t ('article_icons'); ?></label> + <label class="group-name" for="theme"><?php echo _t('conf.display.icon.entry'); ?></label> <table> <thead> <tr> <th> </th> - <th title="<?php echo Minz_Translate::t ('mark_read'); ?>"><?php echo FreshRSS_Themes::icon('read'); ?></th> - <th title="<?php echo Minz_Translate::t ('mark_favorite'); ?>"><?php echo FreshRSS_Themes::icon('bookmark'); ?></th> - <th><?php echo Minz_Translate::t ('sharing'); ?></th> - <th><?php echo Minz_Translate::t ('related_tags'); ?></th> - <th><?php echo Minz_Translate::t ('publication_date'); ?></th> - <th><?php echo FreshRSS_Themes::icon('link'); ?></th> + <th title="<?php echo _t('gen.action.mark_read'); ?>"><?php echo _i('read'); ?></th> + <th title="<?php echo _t('gen.action.mark_favorite'); ?>"><?php echo _i('bookmark'); ?></th> + <th><?php echo _t('conf.display.icon.sharing'); ?></th> + <th><?php echo _t('conf.display.icon.related_tags'); ?></th> + <th><?php echo _t('conf.display.icon.publication_date'); ?></th> + <th><?php echo _i('link'); ?></th> </tr> </thead> <tbody> <tr> - <th><?php echo Minz_Translate::t ('top_line'); ?></th> - <td><input type="checkbox" name="topline_read" value="1"<?php echo $this->conf->topline_read ? ' checked="checked"' : ''; ?> /></td> - <td><input type="checkbox" name="topline_favorite" value="1"<?php echo $this->conf->topline_favorite ? ' checked="checked"' : ''; ?> /></td> + <th><?php echo _t('conf.display.icon.top_line'); ?></th> + <td><input type="checkbox" name="topline_read" value="1"<?php echo FreshRSS_Context::$user_conf->topline_read ? ' checked="checked"' : ''; ?> /></td> + <td><input type="checkbox" name="topline_favorite" value="1"<?php echo FreshRSS_Context::$user_conf->topline_favorite ? ' checked="checked"' : ''; ?> /></td> <td><input type="checkbox" disabled="disabled" /></td> <td><input type="checkbox" disabled="disabled" /></td> - <td><input type="checkbox" name="topline_date" value="1"<?php echo $this->conf->topline_date ? ' checked="checked"' : ''; ?> /></td> - <td><input type="checkbox" name="topline_link" value="1"<?php echo $this->conf->topline_link ? ' checked="checked"' : ''; ?> /></td> + <td><input type="checkbox" name="topline_date" value="1"<?php echo FreshRSS_Context::$user_conf->topline_date ? ' checked="checked"' : ''; ?> /></td> + <td><input type="checkbox" name="topline_link" value="1"<?php echo FreshRSS_Context::$user_conf->topline_link ? ' checked="checked"' : ''; ?> /></td> </tr><tr> - <th><?php echo Minz_Translate::t ('bottom_line'); ?></th> - <td><input type="checkbox" name="bottomline_read" value="1"<?php echo $this->conf->bottomline_read ? ' checked="checked"' : ''; ?> /></td> - <td><input type="checkbox" name="bottomline_favorite" value="1"<?php echo $this->conf->bottomline_favorite ? ' checked="checked"' : ''; ?> /></td> - <td><input type="checkbox" name="bottomline_sharing" value="1"<?php echo $this->conf->bottomline_sharing ? ' checked="checked"' : ''; ?> /></td> - <td><input type="checkbox" name="bottomline_tags" value="1"<?php echo $this->conf->bottomline_tags ? ' checked="checked"' : ''; ?> /></td> - <td><input type="checkbox" name="bottomline_date" value="1"<?php echo $this->conf->bottomline_date ? ' checked="checked"' : ''; ?> /></td> - <td><input type="checkbox" name="bottomline_link" value="1"<?php echo $this->conf->bottomline_link ? ' checked="checked"' : ''; ?> /></td> + <th><?php echo _t('conf.display.icon.bottom_line'); ?></th> + <td><input type="checkbox" name="bottomline_read" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_read ? ' checked="checked"' : ''; ?> /></td> + <td><input type="checkbox" name="bottomline_favorite" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_favorite ? ' checked="checked"' : ''; ?> /></td> + <td><input type="checkbox" name="bottomline_sharing" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_sharing ? ' checked="checked"' : ''; ?> /></td> + <td><input type="checkbox" name="bottomline_tags" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_tags ? ' checked="checked"' : ''; ?> /></td> + <td><input type="checkbox" name="bottomline_date" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_date ? ' checked="checked"' : ''; ?> /></td> + <td><input type="checkbox" name="bottomline_link" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_link ? ' checked="checked"' : ''; ?> /></td> </tr> </tbody> </table><br /> </div> <div class="form-group"> - <label class="group-name" for="posts_per_page"><?php echo Minz_Translate::t ('html5_notif_timeout'); ?></label> + <label class="group-name" for="posts_per_page"><?php echo _t('conf.display.notif_html5.timeout'); ?></label> <div class="group-controls"> - <input type="number" id="html5_notif_timeout" name="html5_notif_timeout" value="<?php echo $this->conf->html5_notif_timeout; ?>" /> <?php echo Minz_Translate::t ('seconds_(0_means_no_timeout)'); ?> + <input type="number" id="html5_notif_timeout" name="html5_notif_timeout" value="<?php echo FreshRSS_Context::$user_conf->html5_notif_timeout; ?>" /> <?php echo _t('conf.display.notif_html5.seconds'); ?> </div> </div> <div class="form-group form-actions"> <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> - <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> </div> </div> </form> diff --git a/app/views/configure/feed.phtml b/app/views/configure/feed.phtml deleted file mode 100644 index e96a28739..000000000 --- a/app/views/configure/feed.phtml +++ /dev/null @@ -1,182 +0,0 @@ -<?php $this->partial ('aside_feed'); ?> - -<?php if ($this->flux) { ?> -<div class="post"> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> <?php echo Minz_Translate::t ('or'); ?> <a href="<?php echo _url ('index', 'index', 'get', 'f_' . $this->flux->id ()); ?>"><?php echo Minz_Translate::t ('filter'); ?></a> - - <h1><?php echo $this->flux->name (); ?></h1> - <?php echo $this->flux->description (); ?> - - <?php $nbEntries = $this->flux->nbEntries (); ?> - - <?php if ($this->flux->inError ()) { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo Minz_Translate::t ('damn'); ?></span> <?php echo Minz_Translate::t ('feed_in_error'); ?></p> - <?php } elseif ($nbEntries === 0) { ?> - <p class="alert alert-warn"><?php echo Minz_Translate::t ('feed_empty'); ?></p> - <?php } ?> - - <form method="post" action="<?php echo _url ('configure', 'feed', 'id', $this->flux->id ()); ?>" autocomplete="off"> - <legend><?php echo Minz_Translate::t ('informations'); ?></legend> - <div class="form-group"> - <label class="group-name" for="name"><?php echo Minz_Translate::t ('title'); ?></label> - <div class="group-controls"> - <input type="text" name="name" id="name" class="extend" value="<?php echo $this->flux->name () ; ?>" /> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="description"><?php echo Minz_Translate::t ('feed_description'); ?></label> - <div class="group-controls"> - <textarea name="description" id="description"><?php echo htmlspecialchars($this->flux->description(), ENT_NOQUOTES, 'UTF-8'); ?></textarea> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="website"><?php echo Minz_Translate::t ('website_url'); ?></label> - <div class="group-controls"> - <div class="stick"> - <input type="text" name="website" id="website" class="extend" value="<?php echo $this->flux->website (); ?>" /> - <a class="btn" target="_blank" href="<?php echo $this->flux->website (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> - </div> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="url"><?php echo Minz_Translate::t ('feed_url'); ?></label> - <div class="group-controls"> - <div class="stick"> - <input type="text" name="url" id="url" class="extend" value="<?php echo $this->flux->url (); ?>" /> - <a class="btn" target="_blank" href="<?php echo $this->flux->url (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> - </div> - - <a class="btn" target="_blank" href="http://validator.w3.org/feed/check.cgi?url=<?php echo $this->flux->url (); ?>"><?php echo Minz_Translate::t ('feed_validator'); ?></a> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="category"><?php echo Minz_Translate::t ('category'); ?></label> - <div class="group-controls"> - <select name="category" id="category"> - <?php foreach ($this->categories as $cat) { ?> - <option value="<?php echo $cat->id (); ?>"<?php echo $cat->id ()== $this->flux->category () ? ' selected="selected"' : ''; ?>> - <?php echo $cat->name (); ?> - </option> - <?php } ?> - </select> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="priority"><?php echo Minz_Translate::t ('show_in_all_flux'); ?></label> - <div class="group-controls"> - <label class="checkbox" for="priority"> - <input type="checkbox" name="priority" id="priority" value="10"<?php echo $this->flux->priority () > 0 ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('yes'); ?> - </label> - </div> - </div> - <div class="form-group"> - <div class="group-controls"> - <a href="<?php echo _url('stats', 'repartition', 'id', $this->flux->id()); ?>"> - <?php echo _i('stats'); ?> <?php echo _t('stats'); ?> - </a> - </div> - </div> - <div class="form-group form-actions"> - <div class="group-controls"> - <button class="btn btn-important"><?php echo _t('save'); ?></button> - <button class="btn btn-attention confirm" - data-str-confirm="<?php echo _t('confirm_action_feed_cat'); ?>" - formaction="<?php echo _url('feed', 'delete', 'id', $this->flux->id ()); ?>" - formmethod="post"><?php echo _t('delete'); ?></button> - </div> - </div> - - <legend><?php echo Minz_Translate::t ('archiving_configuration'); ?></legend> - - <div class="form-group"> - <div class="group-controls"> - <div class="stick"> - <input type="text" value="<?php echo _t('number_articles', $nbEntries); ?>" disabled="disabled" /> - <a class="btn" href="<?php echo _url('feed', 'actualize', 'id', $this->flux->id ()); ?>"> - <?php echo _i('refresh'); ?> <?php echo _t('actualize'); ?> - </a> - </div> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="keep_history"><?php echo Minz_Translate::t ('keep_history'); ?></label> - <div class="group-controls"> - <select class="number" name="keep_history" id="keep_history" required="required"><?php - foreach (array('' => '', -2 => Minz_Translate::t('by_default'), 0 => '0', 10 => '10', 50 => '50', 100 => '100', 500 => '500', 1000 => '1 000', 5000 => '5 000', 10000 => '10 000', -1 => '∞') as $v => $t) { - echo '<option value="' . $v . ($this->flux->keepHistory() === $v ? '" selected="selected' : '') . '">' . $t . '</option>'; - } - ?></select> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="ttl"><?php echo Minz_Translate::t('ttl'); ?></label> - <div class="group-controls"> - <select class="number" name="ttl" id="ttl" required="required"><?php - $found = false; - foreach (array(-2 => Minz_Translate::t('by_default'), 900 => '15min', 1200 => '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min', - 3600 => '1h', 5400 => '1.5h', 7200 => '2h', 10800 => '3h', 14400 => '4h', 18800 => '5h', 21600 => '6h', 25200 => '7h', 28800 => '8h', - 36000 => '10h', 43200 => '12h', 64800 => '18h', - 86400 => '1d', 129600 => '1.5d', 172800 => '2d', 259200 => '3d', 345600 => '4d', 432000 => '5d', 518400 => '6d', - 604800 => '1wk', 1209600 => '2wk', 1814400 => '3wk', 2419200 => '4wk', 2629744 => '1mo', -1 => '∞') as $v => $t) { - echo '<option value="' . $v . ($this->flux->ttl() === $v ? '" selected="selected' : '') . '">' . $t . '</option>'; - if ($this->flux->ttl() == $v) { - $found = true; - } - } - if (!$found) { - echo '<option value="' . intval($this->flux->ttl()) . '" selected="selected">' . intval($this->flux->ttl()) . 's</option>'; - } - ?></select> - </div> - </div> - <div class="form-group form-actions"> - <div class="group-controls"> - <button class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> - <button class="btn btn-attention confirm" formmethod="post" formaction="<?php echo Minz_Url::display (array ('c' => 'feed', 'a' => 'truncate', 'params' => array ('id' => $this->flux->id ()))); ?>"><?php echo Minz_Translate::t ('truncate'); ?></button> - </div> - </div> - - <legend><?php echo Minz_Translate::t ('login_configuration'); ?></legend> - <?php $auth = $this->flux->httpAuth (false); ?> - <div class="form-group"> - <label class="group-name" for="http_user"><?php echo Minz_Translate::t ('http_username'); ?></label> - <div class="group-controls"> - <input type="text" name="http_user" id="http_user" class="extend" value="<?php echo $auth['username']; ?>" autocomplete="off" /> - <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('access_protected_feeds'); ?> - </div> - - <label class="group-name" for="http_pass"><?php echo Minz_Translate::t ('http_password'); ?></label> - <div class="group-controls"> - <input type="password" name="http_pass" id="http_pass" class="extend" value="<?php echo $auth['password']; ?>" autocomplete="off" /> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> - <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button> - </div> - </div> - - <legend><?php echo Minz_Translate::t ('advanced'); ?></legend> - <div class="form-group"> - <label class="group-name" for="path_entries"><?php echo Minz_Translate::t ('css_path_on_website'); ?></label> - <div class="group-controls"> - <input type="text" name="path_entries" id="path_entries" class="extend" value="<?php echo $this->flux->pathEntries (); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" /> - <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('retrieve_truncated_feeds'); ?> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> - <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button> - </div> - </div> - </form> -</div> - -<?php } else { ?> -<div class="alert alert-warn"><span class="alert-head"><?php echo Minz_Translate::t ('no_selected_feed'); ?></span> <?php echo Minz_Translate::t ('think_to_add'); ?></div> -<?php } ?> diff --git a/app/views/configure/queries.phtml b/app/views/configure/queries.phtml index e778ce078..5f449deb3 100644 --- a/app/views/configure/queries.phtml +++ b/app/views/configure/queries.phtml @@ -1,15 +1,15 @@ <?php $this->partial('aside_configure'); ?> <div class="post"> - <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> <form method="post" action="<?php echo _url('configure', 'queries'); ?>"> - <legend><?php echo _t('queries'); ?></legend> + <legend><?php echo _t('conf.query'); ?></legend> - <?php foreach ($this->conf->queries as $key => $query) { ?> + <?php foreach (FreshRSS_Context::$user_conf->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('query_number', $key + 1); ?> + <?php echo _t('conf.query.number', $key + 1); ?> </label> <div class="group-controls"> @@ -49,31 +49,31 @@ <?php if ($exist === 0) { ?> <div class="alert alert-warn"> - <div class="alert-head"><?php echo _t('no_query_filter'); ?></div> + <div class="alert-head"><?php echo _t('conf.query.no_filter'); ?></div> </div> <?php } elseif ($deprecated) { ?> <div class="alert alert-error"> - <div class="alert-head"><?php echo _t('query_deprecated'); ?></div> + <div class="alert-head"><?php echo _t('conf.query.deprecated'); ?></div> </div> <?php } else { ?> <div class="alert alert-success"> - <div class="alert-head"><?php echo _t('query_filter'); ?></div> + <div class="alert-head"><?php echo _t('conf.query.filter'); ?></div> <ul> <?php if (isset($query['search'])) { ?> - <li class="item"><?php echo _t('query_search', $query['search']); ?></li> + <li class="item"><?php echo _t('conf.query.search', $query['search']); ?></li> <?php } ?> <?php if (isset($query['state'])) { ?> - <li class="item"><?php echo _t('query_state_' . $query['state']); ?></li> + <li class="item"><?php echo _t('conf.query.state_' . $query['state']); ?></li> <?php } ?> <?php if (isset($query['order'])) { ?> - <li class="item"><?php echo _t('query_order_' . strtolower($query['order'])); ?></li> + <li class="item"><?php echo _t('conf.query.order_' . strtolower($query['order'])); ?></li> <?php } ?> <?php if (isset($query['get'])) { ?> - <li class="item"><?php echo _t('query_get_' . $this->query_get[$key]['type'], $this->query_get[$key]['name']); ?></li> + <li class="item"><?php echo _t('conf.query.get_' . $this->query_get[$key]['type'], $this->query_get[$key]['name']); ?></li> <?php } ?> </ul> </div> @@ -82,15 +82,15 @@ </div> <?php } ?> - <?php if (count($this->conf->queries) > 0) { ?> + <?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('save'); ?></button> - <button type="reset" class="btn"><?php echo _t('cancel'); ?></button> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> </div> </div> <?php } else { ?> - <p class="alert alert-warn"><span class="alert-head"><?php echo _t('damn'); ?></span> <?php echo _t('no_query'); ?></p> + <p class="alert alert-warn"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('conf.query.none'); ?></p> <?php } ?> </form> diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml index 8b2da2a28..636671f14 100644 --- a/app/views/configure/reading.phtml +++ b/app/views/configure/reading.phtml @@ -1,47 +1,47 @@ -<?php $this->partial ('aside_configure'); ?> +<?php $this->partial('aside_configure'); ?> <div class="post"> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> - <form method="post" action="<?php echo _url ('configure', 'reading'); ?>"> - <legend><?php echo Minz_Translate::t ('reading_configuration'); ?></legend> + <form method="post" action="<?php echo _url('configure', 'reading'); ?>"> + <legend><?php echo _t('conf.reading'); ?></legend> <div class="form-group"> - <label class="group-name" for="posts_per_page"><?php echo Minz_Translate::t ('articles_per_page'); ?></label> + <label class="group-name" for="posts_per_page"><?php echo _t('conf.reading.articles_per_page'); ?></label> <div class="group-controls"> - <input type="number" id="posts_per_page" name="posts_per_page" value="<?php echo $this->conf->posts_per_page; ?>" min="5" max="50" /> - <?php echo _i('help'); ?> <?php echo _t('number_divided_when_reader'); ?> + <input type="number" id="posts_per_page" name="posts_per_page" value="<?php echo FreshRSS_Context::$user_conf->posts_per_page; ?>" min="5" max="50" /> + <?php echo _i('help'); ?> <?php echo _t('conf.reading.number_divided_when_reader'); ?> </div> </div> <div class="form-group"> - <label class="group-name" for="sort_order"><?php echo Minz_Translate::t ('sort_order'); ?></label> + <label class="group-name" for="sort_order"><?php echo _t('conf.reading.sort'); ?></label> <div class="group-controls"> <select name="sort_order" id="sort_order"> - <option value="DESC"<?php echo $this->conf->sort_order === 'DESC' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('newer_first'); ?></option> - <option value="ASC"<?php echo $this->conf->sort_order === 'ASC' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('older_first'); ?></option> + <option value="DESC"<?php echo FreshRSS_Context::$user_conf->sort_order === 'DESC' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.sort.newer_first'); ?></option> + <option value="ASC"<?php echo FreshRSS_Context::$user_conf->sort_order === 'ASC' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.sort.older_first'); ?></option> </select> </div> </div> <div class="form-group"> - <label class="group-name" for="view_mode"><?php echo Minz_Translate::t ('default_view'); ?></label> + <label class="group-name" for="view_mode"><?php echo _t('conf.reading.view.default'); ?></label> <div class="group-controls"> <select name="view_mode" id="view_mode"> - <option value="normal"<?php echo $this->conf->view_mode === 'normal' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('normal_view'); ?></option> - <option value="reader"<?php echo $this->conf->view_mode === 'reader' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('reader_view'); ?></option> - <option value="global"<?php echo $this->conf->view_mode === 'global' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('global_view'); ?></option> + <option value="normal"<?php echo FreshRSS_Context::$user_conf->view_mode === 'normal' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.view.normal'); ?></option> + <option value="reader"<?php echo FreshRSS_Context::$user_conf->view_mode === 'reader' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.view.reader'); ?></option> + <option value="global"<?php echo FreshRSS_Context::$user_conf->view_mode === 'global' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.view.global'); ?></option> </select> </div> </div> <div class="form-group"> - <label class="group-name" for="view_mode"><?php echo _t('articles_to_display'); ?></label> + <label class="group-name" for="view_mode"><?php echo _t('conf.reading.show'); ?></label> <div class="group-controls"> <select name="default_view" id="default_view"> - <option value="<?php echo FreshRSS_Entry::STATE_NOT_READ; ?>"<?php echo $this->conf->default_view === FreshRSS_Entry::STATE_NOT_READ ? ' selected="selected"' : ''; ?>><?php echo _t('show_adaptive'); ?></option> - <option value="<?php echo FreshRSS_Entry::STATE_ALL; ?>"<?php echo $this->conf->default_view === FreshRSS_Entry::STATE_ALL ? ' selected="selected"' : ''; ?>><?php echo _t('show_all_articles'); ?></option> - <option value="<?php echo FreshRSS_Entry::STATE_STRICT + FreshRSS_Entry::STATE_NOT_READ; ?>"<?php echo $this->conf->default_view === FreshRSS_Entry::STATE_STRICT + FreshRSS_Entry::STATE_NOT_READ ? ' selected="selected"' : ''; ?>><?php echo _t('show_not_reads'); ?></option> + <option value="adaptive"<?php echo FreshRSS_Context::$user_conf->default_view === 'adaptive' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.show.adaptive'); ?></option> + <option value="all"<?php echo FreshRSS_Context::$user_conf->default_view === 'all' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.show.all_articles'); ?></option> + <option value="unread"<?php echo FreshRSS_Context::$user_conf->default_view === 'unread' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.show.unread'); ?></option> </select> </div> </div> @@ -49,8 +49,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 $this->conf->hide_read_feeds ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t('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"' : ''; ?> /> + <?php echo _t('conf.reading.hide_read_feeds'); ?> </label> </div> </div> @@ -58,9 +58,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 $this->conf->display_posts ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('display_articles_unfolded'); ?> - <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> + <input type="checkbox" name="display_posts" id="display_posts" value="1"<?php echo FreshRSS_Context::$user_conf->display_posts ? ' checked="checked"' : ''; ?> /> + <?php echo _t('conf.reading.display_articles_unfolded'); ?> + <noscript> — <strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> </label> </div> </div> @@ -68,9 +68,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 $this->conf->display_categories ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('display_categories_unfolded'); ?> - <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> + <input type="checkbox" name="display_categories" id="display_categories" value="1"<?php echo FreshRSS_Context::$user_conf->display_categories ? ' checked="checked"' : ''; ?> /> + <?php echo _t('conf.reading.display_categories_unfolded'); ?> + <noscript> — <strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> </label> </div> </div> @@ -78,9 +78,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 $this->conf->sticky_post ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('sticky_post'); ?> - <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> + <input type="checkbox" name="sticky_post" id="sticky_post" value="1"<?php echo FreshRSS_Context::$user_conf->sticky_post ? ' checked="checked"' : ''; ?> /> + <?php echo _t('conf.reading.sticky_post'); ?> + <noscript> — <strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> </label> </div> </div> @@ -88,9 +88,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 $this->conf->auto_load_more ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('auto_load_more'); ?> - <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> + <input type="checkbox" name="auto_load_more" id="auto_load_more" value="1"<?php echo FreshRSS_Context::$user_conf->auto_load_more ? ' checked="checked"' : ''; ?> /> + <?php echo _t('conf.reading.auto_load_more'); ?> + <noscript> — <strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> </label> </div> </div> @@ -98,9 +98,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 $this->conf->lazyload ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('img_with_lazyload'); ?> - <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> + <input type="checkbox" name="lazyload" id="lazyload" value="1"<?php echo FreshRSS_Context::$user_conf->lazyload ? ' checked="checked"' : ''; ?> /> + <?php echo _t('conf.reading.img_with_lazyload'); ?> + <noscript> — <strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> </label> </div> </div> @@ -108,49 +108,59 @@ <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 $this->conf->reading_confirm ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('reading_confirm'); ?> - <noscript> — <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript> + <input type="checkbox" name="reading_confirm" id="reading_confirm" value="1"<?php echo FreshRSS_Context::$user_conf->reading_confirm ? ' checked="checked"' : ''; ?> /> + <?php echo _t('conf.reading.confirm_enabled'); ?> + <noscript> — <strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> </label> </div> </div> <div class="form-group"> - <label class="group-name"><?php echo Minz_Translate::t ('auto_read_when'); ?></label> + <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"' : ''; ?> /> + <?php echo _t('conf.reading.auto_remove_article'); ?> + <noscript> — <strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> + </label> + </div> + </div> + + <div class="form-group"> + <label class="group-name"><?php echo _t('conf.reading.read.when'); ?></label> <div class="group-controls"> <label class="checkbox" for="check_open_article"> - <input type="checkbox" name="mark_open_article" id="check_open_article" value="1"<?php echo $this->conf->mark_when['article'] ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t('article_viewed'); ?> + <input type="checkbox" name="mark_open_article" id="check_open_article" value="1"<?php echo FreshRSS_Context::$user_conf->mark_when['article'] ? ' checked="checked"' : ''; ?> /> + <?php echo _t('conf.reading.read.article_viewed'); ?> </label> <label class="checkbox" for="check_open_site"> - <input type="checkbox" name="mark_open_site" id="check_open_site" value="1"<?php echo $this->conf->mark_when['site'] ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('article_open_on_website'); ?> + <input type="checkbox" name="mark_open_site" id="check_open_site" value="1"<?php echo FreshRSS_Context::$user_conf->mark_when['site'] ? ' checked="checked"' : ''; ?> /> + <?php echo _t('conf.reading.read.article_open_on_website'); ?> </label> <label class="checkbox" for="check_scroll"> - <input type="checkbox" name="mark_scroll" id="check_scroll" value="1"<?php echo $this->conf->mark_when['scroll'] ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('scroll'); ?> + <input type="checkbox" name="mark_scroll" id="check_scroll" value="1"<?php echo FreshRSS_Context::$user_conf->mark_when['scroll'] ? ' checked="checked"' : ''; ?> /> + <?php echo _t('conf.reading.read.scroll'); ?> </label> <label class="checkbox" for="check_reception"> - <input type="checkbox" name="mark_upon_reception" id="check_reception" value="1"<?php echo $this->conf->mark_when['reception'] ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('upon_reception'); ?> + <input type="checkbox" name="mark_upon_reception" id="check_reception" value="1"<?php echo FreshRSS_Context::$user_conf->mark_when['reception'] ? ' checked="checked"' : ''; ?> /> + <?php echo _t('conf.reading.read.upon_reception'); ?> </label> </div> </div> <div class="form-group"> - <label class="group-name"><?php echo Minz_Translate::t ('after_onread'); ?></label> + <label class="group-name"><?php echo _t('conf.reading.after_onread'); ?></label> <div class="group-controls"> <label class="checkbox" for="onread_jump_next"> - <input type="checkbox" name="onread_jump_next" id="onread_jump_next" value="1"<?php echo $this->conf->onread_jump_next ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('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"' : ''; ?> /> + <?php echo _t('conf.reading.jump_next'); ?> </label> </div> </div> <div class="form-group form-actions"> <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> - <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> </div> </div> diff --git a/app/views/configure/sharing.phtml b/app/views/configure/sharing.phtml index 02ce331da..da7557480 100644 --- a/app/views/configure/sharing.phtml +++ b/app/views/configure/sharing.phtml @@ -1,58 +1,63 @@ -<?php $this->partial ('aside_configure'); ?> +<?php $this->partial('aside_configure'); ?> <div class="post"> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> - <form method="post" action="<?php echo _url ('configure', 'sharing'); ?>" - data-simple='<div class="form-group" id="group-share-##key##"><label class="group-name">##label##</label><div class="group-controls"><a href="#" class="remove btn btn-attention" data-remove="group-share-##key##"><?php echo FreshRSS_Themes::icon('close'); ?></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"><a href="#" class="remove btn btn-attention" data-remove="group-share-##key##"><?php echo _i('close'); ?></a> <input type="hidden" id="share_##key##_type" name="share[##key##][type]" value="##type##" /></div></div>' data-advanced='<div class="form-group" id="group-share-##key##"><label class="group-name">##label##</label><div class="group-controls"> <input type="hidden" id="share_##key##_type" name="share[##key##][type]" value="##type##" /> <div class="stick"> - <input type="text" id="share_##key##_name" name="share[##key##][name]" class="extend" value="" placeholder="<?php echo Minz_Translate::t ('share_name'); ?>" size="64" /> - <input type="url" id="share_##key##_url" name="share[##key##][url]" class="extend" value="" placeholder="<?php echo Minz_Translate::t ('share_url'); ?>" size="64" /> - <a href="#" class="remove btn btn-attention" data-remove="group-share-##key##"><?php echo FreshRSS_Themes::icon('close'); ?></a></div> - <a target="_blank" class="btn" title="<?php echo Minz_Translate::t('more_information'); ?>" href="##help##"><?php echo FreshRSS_Themes::icon('help'); ?></a> + <input type="text" id="share_##key##_name" name="share[##key##][name]" class="extend" value="" placeholder="<?php echo _t('conf.sharing.share_name'); ?>" size="64" /> + <input type="url" id="share_##key##_url" name="share[##key##][url]" class="extend" value="" placeholder="<?php echo _t('conf.sharing.share_url'); ?>" size="64" /> + <a href="#" class="remove btn btn-attention" data-remove="group-share-##key##"><?php echo _i('close'); ?></a></div> + <a target="_blank" class="btn" title="<?php echo _t('conf.sharing.more_information'); ?>" href="##help##"><?php echo _i('help'); ?></a> </div></div>'> - <legend><?php echo Minz_Translate::t ('sharing'); ?></legend> - <?php foreach ($this->conf->sharing as $key => $sharing): ?> - <?php $share = $this->conf->shares[$sharing['type']]; ?> - <div class="form-group" id="group-share-<?php echo $key; ?>"> + <legend><?php echo _t('conf.sharing'); ?></legend> + <?php + foreach (FreshRSS_Context::$user_conf->sharing as $key => $share_options) { + $share = FreshRSS_Share::get($share_options['type']); + $share->update($share_options); + ?> + <div class="form-group group-share" id="group-share-<?php echo $key; ?>"> <label class="group-name"> - <?php echo Minz_Translate::t ($sharing['type']); ?> + <?php echo $share->name(true); ?> </label> <div class="group-controls"> - <input type='hidden' id='share_<?php echo $key;?>_type' name="share[<?php echo $key;?>][type]" value='<?php echo $sharing['type']?>' /> - <?php if ($share['form'] === 'advanced') { ?> + <input type='hidden' id='share_<?php echo $key; ?>_type' name="share[<?php echo $key; ?>][type]" value='<?php echo $share->type(); ?>' /> + <?php if ($share->formType() === 'advanced') { ?> <div class="stick"> - <input type="text" id="share_<?php echo $key;?>_name" name="share[<?php echo $key;?>][name]" class="extend" value="<?php echo $sharing['name']?>" placeholder="<?php echo Minz_Translate::t ('share_name'); ?>" size="64" /> - <input type="url" id="share_<?php echo $key;?>_url" name="share[<?php echo $key;?>][url]" class="extend" value="<?php echo $sharing['url']?>" placeholder="<?php echo Minz_Translate::t ('share_url'); ?>" size="64" /> - <a href='#' class='remove btn btn-attention' data-remove="group-share-<?php echo $key; ?>"><?php echo FreshRSS_Themes::icon('close'); ?></a> + <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" /> + <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" /> + <a href='#' class='remove btn btn-attention' data-remove="group-share-<?php echo $key; ?>"><?php echo _i('close'); ?></a> </div> - <a target="_blank" class="btn" title="<?php echo Minz_Translate::t('more_information'); ?>" href="<?php echo $share['help']?>"><?php echo FreshRSS_Themes::icon('help'); ?></a> + <a target="_blank" class="btn" title="<?php echo _t('conf.sharing.more_information'); ?>" href="<?php echo $share->help(); ?>"><?php echo _i('help'); ?></a> <?php } else { ?> - <a href='#' class='remove btn btn-attention' data-remove="group-share-<?php echo $key; ?>"><?php echo FreshRSS_Themes::icon('close'); ?></a> + <a href='#' class='remove btn btn-attention' data-remove="group-share-<?php echo $key; ?>"><?php echo _i('close'); ?></a> <?php } ?> </div> </div> - <?php endforeach;?> + <?php } ?> <div class="form-group"> <div class="group-controls"> <select> - <?php foreach($this->conf->shares as $key => $params):?> - <option value='<?php echo $key?>' data-form='<?php echo $params['form']?>' data-help='<?php if (!empty($params['help'])) {echo $params['help'];}?>'><?php echo Minz_Translate::t($key) ?></option> - <?php endforeach; ?> + <?php foreach (FreshRSS_Share::enum() as $share) { ?> + <option value='<?php echo $share->type(); ?>' data-form='<?php echo $share->formType(); ?>' data-help='<?php echo $share->help(); ?>'> + <?php echo $share->name(true); ?> + </option> + <?php } ?> </select> - <a href='#' class='share add btn'><?php echo FreshRSS_Themes::icon('add'); ?></a> + <a href='#' class='share add btn'><?php echo _i('add'); ?></a> </div> </div> <div class="form-group form-actions"> <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> - <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> </div> </div> </form> diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtml index a4029b676..f68091af9 100644 --- a/app/views/configure/shortcut.phtml +++ b/app/views/configure/shortcut.phtml @@ -1,7 +1,7 @@ -<?php $this->partial ('aside_configure'); ?> +<?php $this->partial('aside_configure'); ?> <div class="post"> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> <datalist id="keys"> <?php foreach ($this->list_keys as $key) { ?> @@ -9,110 +9,117 @@ <?php } ?> </datalist> - <?php $s = $this->conf->shortcuts; ?> + <?php $s = FreshRSS_Context::$user_conf->shortcuts; ?> - <form method="post" action="<?php echo _url ('configure', 'shortcut'); ?>"> - <legend><?php echo Minz_Translate::t ('shortcuts'); ?></legend> + <form method="post" action="<?php echo _url('configure', 'shortcut'); ?>"> + <legend><?php echo _t('conf.shortcut'); ?></legend> - <noscript><p class="alert alert-error"><?php echo Minz_Translate::t ('javascript_for_shortcuts'); ?></p></noscript> + <noscript><p class="alert alert-error"><?php echo _t('conf.shortcut.javascript'); ?></p></noscript> - <legend><?php echo Minz_Translate::t ('shortcuts_navigation'); ?></legend> + <legend><?php echo _t('conf.shortcut.navigation'); ?></legend> + + <p class="alert alert-warn"><?php echo _t('conf.shortcut.navigation_help');?></p> <div class="form-group"> - <label class="group-name" for="next_entry"><?php echo Minz_Translate::t ('next_article'); ?></label> + <label class="group-name" for="next_entry"><?php echo _t('conf.shortcut.next_article'); ?></label> <div class="group-controls"> <input type="text" id="next_entry" name="shortcuts[next_entry]" list="keys" value="<?php echo $s['next_entry']; ?>" /> </div> </div> <div class="form-group"> - <label class="group-name" for="prev_entry"><?php echo Minz_Translate::t ('previous_article'); ?></label> + <label class="group-name" for="prev_entry"><?php echo _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']; ?>" /> </div> </div> <div class="form-group"> - <label class="group-name" for="first_entry"><?php echo Minz_Translate::t ('first_article'); ?></label> + <label class="group-name" for="first_entry"><?php echo _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']; ?>" /> </div> </div> <div class="form-group"> - <label class="group-name" for="last_entry"><?php echo Minz_Translate::t ('last_article'); ?></label> + <label class="group-name" for="last_entry"><?php echo _t('conf.shortcut.last_article'); ?></label> <div class="group-controls"> <input type="text" id="last_entry" name="shortcuts[last_entry]" list="keys" value="<?php echo $s['last_entry']; ?>" /> </div> </div> - <div><?php echo Minz_Translate::t ('shortcuts_navigation_help');?></div> - - <legend><?php echo Minz_Translate::t ('shortcuts_article_action');?></legend> + <legend><?php echo _t('conf.shortcut.article_action');?></legend> <div class="form-group"> - <label class="group-name" for="mark_read"><?php echo Minz_Translate::t ('mark_read'); ?></label> + <label class="group-name" for="mark_read"><?php echo _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']; ?>" /> - <?php echo Minz_Translate::t ('shift_for_all_read'); ?> + <?php echo _t('conf.shortcut.shift_for_all_read'); ?> </div> </div> <div class="form-group"> - <label class="group-name" for="mark_favorite"><?php echo Minz_Translate::t ('mark_favorite'); ?></label> + <label class="group-name" for="mark_favorite"><?php echo _t('conf.shortcut.mark_favorite'); ?></label> <div class="group-controls"> <input type="text" id="mark_favorite" name="shortcuts[mark_favorite]" list="keys" value="<?php echo $s['mark_favorite']; ?>" /> </div> </div> <div class="form-group"> - <label class="group-name" for="go_website"><?php echo Minz_Translate::t ('see_on_website'); ?></label> + <label class="group-name" for="go_website"><?php echo _t('conf.shortcut.see_on_website'); ?></label> <div class="group-controls"> <input type="text" id="go_website" name="shortcuts[go_website]" list="keys" value="<?php echo $s['go_website']; ?>" /> </div> </div> <div class="form-group"> - <label class="group-name" for="auto_share_shortcut"><?php echo Minz_Translate::t ('auto_share'); ?></label> + <label class="group-name" for="auto_share_shortcut"><?php echo _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']; ?>" /> - <?php echo Minz_Translate::t ('auto_share_help'); ?> + <?php echo _t('conf.shortcut.auto_share_help'); ?> </div> </div> <div class="form-group"> - <label class="group-name" for="collapse_entry"><?php echo Minz_Translate::t ('collapse_article'); ?></label> + <label class="group-name" for="collapse_entry"><?php echo _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']; ?>" /> </div> </div> - <legend><?php echo Minz_Translate::t ('shortcuts_other_action');?></legend> + <legend><?php echo _t('conf.shortcut.other_action');?></legend> <div class="form-group"> - <label class="group-name" for="load_more_shortcut"><?php echo Minz_Translate::t ('load_more'); ?></label> + <label class="group-name" for="load_more_shortcut"><?php echo _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']; ?>" /> </div> </div> <div class="form-group"> - <label class="group-name" for="focus_search_shortcut"><?php echo Minz_Translate::t ('focus_search'); ?></label> + <label class="group-name" for="focus_search_shortcut"><?php echo _t('conf.shortcut.focus_search'); ?></label> <div class="group-controls"> <input type="text" id="focus_search_shortcut" name="shortcuts[focus_search]" list="keys" value="<?php echo $s['focus_search']; ?>" /> </div> </div> <div class="form-group"> - <label class="group-name" for="user_filter_shortcut"><?php echo Minz_Translate::t ('user_filter'); ?></label> + <label class="group-name" for="user_filter_shortcut"><?php echo _t('conf.shortcut.user_filter'); ?></label> <div class="group-controls"> <input type="text" id="user_filter_shortcut" name="shortcuts[user_filter]" list="keys" value="<?php echo $s['user_filter']; ?>" /> - <?php echo Minz_Translate::t ('user_filter_help'); ?> + <?php echo _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> + <div class="group-controls"> + <input type="text" id="close_dropdown" name="shortcuts[close_dropdown]" list="keys" value="<?php echo $s['close_dropdown']; ?>" /> </div> </div> <div class="form-group"> - <label class="group-name" for="help_shortcut"><?php echo Minz_Translate::t ('help'); ?></label> + <label class="group-name" for="help_shortcut"><?php echo _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']; ?>" /> </div> @@ -120,8 +127,8 @@ <div class="form-group form-actions"> <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> - <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> </div> </div> </form> diff --git a/app/views/configure/users.phtml b/app/views/configure/users.phtml deleted file mode 100644 index 272896fb2..000000000 --- a/app/views/configure/users.phtml +++ /dev/null @@ -1,211 +0,0 @@ -<?php $this->partial('aside_configure'); ?> - -<div class="post"> - <a href="<?php echo _url('index', 'index'); ?>"><?php echo Minz_Translate::t('back_to_rss_feeds'); ?></a> - - <form method="post" action="<?php echo _url('users', 'auth'); ?>"> - <legend><?php echo Minz_Translate::t('login_configuration'); ?></legend> - - <div class="form-group"> - <label class="group-name" for="current_user"><?php echo Minz_Translate::t('current_user'); ?></label> - <div class="group-controls"> - <input id="current_user" type="text" disabled="disabled" value="<?php echo Minz_Session::param('currentUser', '_'); ?>" /> - <label class="checkbox" for="is_admin"> - <input type="checkbox" id="is_admin" disabled="disabled" <?php echo Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_')) ? 'checked="checked" ' : ''; ?>/> - <?php echo Minz_Translate::t('is_admin'); ?> - </label> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="passwordPlain"><?php echo Minz_Translate::t('password_form'); ?></label> - <div class="group-controls"> - <div class="stick"> - <input type="password" id="passwordPlain" name="passwordPlain" autocomplete="off" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/> - <a class="btn toggle-password"><?php echo FreshRSS_Themes::icon('key'); ?></a> - </div> - <noscript><b><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></b></noscript> - </div> - </div> - - <?php if (Minz_Configuration::apiEnabled()) { ?> - <div class="form-group"> - <label class="group-name" for="apiPasswordPlain"><?php echo Minz_Translate::t('password_api'); ?></label> - <div class="group-controls"> - <div class="stick"> - <input type="password" id="apiPasswordPlain" name="apiPasswordPlain" autocomplete="off" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/> - <a class="btn toggle-password"><?php echo FreshRSS_Themes::icon('key'); ?></a> - </div> - </div> - </div> - <?php } ?> - - <div class="form-group"> - <label class="group-name" for="mail_login"><?php echo Minz_Translate::t('persona_connection_email'); ?></label> - <?php $mail = $this->conf->mail_login; ?> - <div class="group-controls"> - <input type="email" id="mail_login" name="mail_login" class="extend" autocomplete="off" value="<?php echo $mail; ?>" <?php echo Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_')) ? '' : 'disabled="disabled"'; ?> placeholder="alice@example.net" /> - <noscript><b><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></b></noscript> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('save'); ?></button> - <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button> - </div> - </div> - - <?php if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { ?> - - <legend><?php echo Minz_Translate::t('auth_type'); ?></legend> - - <div class="form-group"> - <label class="group-name" for="auth_type"><?php echo Minz_Translate::t('auth_type'); ?></label> - <div class="group-controls"> - <select id="auth_type" name="auth_type" required="required"> - <?php if (!in_array(Minz_Configuration::authType(), array('form', 'persona', 'http_auth', 'none'))) { ?> - <option selected="selected"></option> - <?php } ?> - <option value="form"<?php echo Minz_Configuration::authType() === 'form' ? ' selected="selected"' : '', cryptAvailable() ? '' : ' disabled="disabled"'; ?>><?php echo Minz_Translate::t('auth_form'); ?></option> - <option value="persona"<?php echo Minz_Configuration::authType() === 'persona' ? ' selected="selected"' : '', $this->conf->mail_login == '' ? ' disabled="disabled"' : ''; ?>><?php echo Minz_Translate::t('auth_persona'); ?></option> - <option value="http_auth"<?php echo Minz_Configuration::authType() === 'http_auth' ? ' selected="selected"' : '', httpAuthUser() == '' ? ' disabled="disabled"' : ''; ?>><?php echo Minz_Translate::t('http_auth'); ?> (REMOTE_USER = '<?php echo httpAuthUser(); ?>')</option> - <option value="none"<?php echo Minz_Configuration::authType() === 'none' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t('auth_none'); ?></option> - </select> - </div> - </div> - - <div class="form-group"> - <div class="group-controls"> - <label class="checkbox" for="anon_access"> - <input type="checkbox" name="anon_access" id="anon_access" value="1"<?php echo Minz_Configuration::allowAnonymous() ? ' checked="checked"' : '', - Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> /> - <?php echo Minz_Translate::t('allow_anonymous', Minz_Configuration::defaultUser()); ?> - </label> - </div> - </div> - - <div class="form-group"> - <div class="group-controls"> - <label class="checkbox" for="anon_refresh"> - <input type="checkbox" name="anon_refresh" id="anon_refresh" value="1"<?php echo Minz_Configuration::allowAnonymousRefresh() ? ' checked="checked"' : '', - Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> /> - <?php echo Minz_Translate::t('allow_anonymous_refresh'); ?> - </label> - </div> - </div> - - <div class="form-group"> - <div class="group-controls"> - <label class="checkbox" for="unsafe_autologin"> - <input type="checkbox" name="unsafe_autologin" id="unsafe_autologin" value="1"<?php echo Minz_Configuration::unsafeAutologinEnabled() ? ' checked="checked"' : '', - Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> /> - <?php echo Minz_Translate::t('unsafe_autologin'); ?> - <kbd>p/i/?a=formLogin&u=Alice&p=1234</kbd> - </label> - </div> - </div> - - <?php if (Minz_Configuration::canLogIn()) { ?> - <div class="form-group"> - <label class="group-name" for="token"><?php echo Minz_Translate::t('auth_token'); ?></label> - <?php $token = $this->conf->token; ?> - <div class="group-controls"> - <input type="text" id="token" name="token" value="<?php echo $token; ?>" placeholder="<?php echo Minz_Translate::t('blank_to_disable'); ?>"<?php - echo Minz_Configuration::canLogIn() ? '' : ' disabled="disabled"'; ?> /> - <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('explain_token', Minz_Url::display(null, 'html', true), $token); ?> - </div> - </div> - <?php } ?> - - <div class="form-group"> - <div class="group-controls"> - <label class="checkbox" for="api_enabled"> - <input type="checkbox" name="api_enabled" id="api_enabled" value="1"<?php echo Minz_Configuration::apiEnabled() ? ' checked="checked"' : '', - Minz_Configuration::needsLogin() ? '' : ' disabled="disabled"'; ?> /> - <?php echo Minz_Translate::t('api_enabled'); ?> - </label> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('save'); ?></button> - <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button> - </div> - </div> - </form> - - <form method="post" action="<?php echo _url('users', 'delete'); ?>"> - <legend><?php echo Minz_Translate::t('users'); ?></legend> - - <div class="form-group"> - <label class="group-name" for="users_list"><?php echo Minz_Translate::t('users_list'); ?></label> - <div class="group-controls"> - <select id="users_list" name="username"><?php - foreach (listUsers() as $user) { - echo '<option>', $user, '</option>'; - } - ?></select> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-attention confirm"><?php echo Minz_Translate::t('delete'); ?></button> - </div> - </div> - </form> - - <form method="post" action="<?php echo _url('users', 'create'); ?>"> - <legend><?php echo Minz_Translate::t('create_user'); ?></legend> - - <div class="form-group"> - <label class="group-name" for="new_user_language"><?php echo Minz_Translate::t ('language'); ?></label> - <div class="group-controls"> - <select name="new_user_language" id="new_user_language"> - <?php $languages = $this->conf->availableLanguages (); ?> - <?php foreach ($languages as $short => $lib) { ?> - <option value="<?php echo $short; ?>"<?php echo $this->conf->language === $short ? ' selected="selected"' : ''; ?>><?php echo $lib; ?></option> - <?php } ?> - </select> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="new_user_name"><?php echo Minz_Translate::t('username'); ?></label> - <div class="group-controls"> - <input id="new_user_name" name="new_user_name" type="text" size="16" required="required" maxlength="16" autocomplete="off" pattern="[0-9a-zA-Z]{1,16}" placeholder="demo" /> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="new_user_passwordPlain"><?php echo Minz_Translate::t('password_form'); ?></label> - <div class="group-controls"> - <div class="stick"> - <input type="password" id="new_user_passwordPlain" name="new_user_passwordPlain" autocomplete="off" pattern=".{7,}" /> - <a class="btn toggle-password"><?php echo FreshRSS_Themes::icon('key'); ?></a> - </div> - <noscript><b><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></b></noscript> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="new_user_email"><?php echo Minz_Translate::t('persona_connection_email'); ?></label> - <?php $mail = $this->conf->mail_login; ?> - <div class="group-controls"> - <input type="email" id="new_user_email" name="new_user_email" class="extend" autocomplete="off" placeholder="alice@example.net" /> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('create'); ?></button> - <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button> - </div> - </div> - - </form> - - <?php } ?> -</div> diff --git a/app/views/entry/bookmark.phtml b/app/views/entry/bookmark.phtml index c1fc32b7f..c346d2c4c 100755 --- a/app/views/entry/bookmark.phtml +++ b/app/views/entry/bookmark.phtml @@ -1,16 +1,16 @@ <?php header('Content-Type: application/json; charset=UTF-8'); -if (Minz_Request::param ('is_favorite', true)) { - Minz_Request::_param ('is_favorite', 0); +if (Minz_Request::param('is_favorite', true)) { + Minz_Request::_param('is_favorite', 0); } else { - Minz_Request::_param ('is_favorite', 1); + Minz_Request::_param('is_favorite', 1); } -$url = Minz_Url::display (array ( - 'c' => Minz_Request::controllerName (), - 'a' => Minz_Request::actionName (), - 'params' => Minz_Request::params (), +$url = Minz_Url::display(array( + 'c' => Minz_Request::controllerName(), + 'a' => Minz_Request::actionName(), + 'params' => Minz_Request::params(), )); -echo json_encode (array ('url' => str_ireplace ('&', '&', $url), 'icon' => FreshRSS_Themes::icon(Minz_Request::param ('is_favorite') ? 'non-starred' : 'starred'))); +echo json_encode(array('url' => str_ireplace('&', '&', $url), 'icon' => _i(Minz_Request::param('is_favorite') ? 'non-starred' : 'starred'))); diff --git a/app/views/entry/read.phtml b/app/views/entry/read.phtml index 9e79d4c07..fabdec9e0 100755 --- a/app/views/entry/read.phtml +++ b/app/views/entry/read.phtml @@ -1,16 +1,16 @@ <?php header('Content-Type: application/json; charset=UTF-8'); -if (Minz_Request::param ('is_read', true)) { - Minz_Request::_param ('is_read', 0); +if (Minz_Request::param('is_read', true)) { + Minz_Request::_param('is_read', 0); } else { - Minz_Request::_param ('is_read', 1); + Minz_Request::_param('is_read', 1); } -$url = Minz_Url::display (array ( - 'c' => Minz_Request::controllerName (), - 'a' => Minz_Request::actionName (), - 'params' => Minz_Request::params (), +$url = Minz_Url::display(array( + 'c' => Minz_Request::controllerName(), + 'a' => Minz_Request::actionName(), + 'params' => Minz_Request::params(), )); -echo json_encode (array ('url' => str_ireplace ('&', '&', $url), 'icon' => FreshRSS_Themes::icon(Minz_Request::param ('is_read') ? 'unread' : 'read'))); +echo json_encode(array('url' => str_ireplace('&', '&', $url), 'icon' => _i(Minz_Request::param('is_read') ? 'unread' : 'read'))); diff --git a/app/views/error/index.phtml b/app/views/error/index.phtml index ef4fbd39d..fe3abf8c4 100644 --- a/app/views/error/index.phtml +++ b/app/views/error/index.phtml @@ -3,7 +3,7 @@ <h1 class="alert-head"><?php echo $this->code; ?></h1> <p> <?php echo $this->errorMessage; ?><br /> - <a href="<?php echo _url('index', 'index'); ?>"><?php echo Minz_Translate::t('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> </p> </div> </div> diff --git a/app/views/extension/configure.phtml b/app/views/extension/configure.phtml new file mode 100644 index 000000000..8933eeae5 --- /dev/null +++ b/app/views/extension/configure.phtml @@ -0,0 +1,3 @@ +<?php + +$this->renderHelper('extension/configure'); diff --git a/app/views/extension/index.phtml b/app/views/extension/index.phtml new file mode 100644 index 000000000..f2d05028f --- /dev/null +++ b/app/views/extension/index.phtml @@ -0,0 +1,44 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <h1><?php echo _t('admin.extensions.title'); ?></h1> + + <form id="form-extension" method="post" style="display: none"></form> + <?php if (!empty($this->extension_list['system'])) { ?> + <h2><?php echo _t('admin.extensions.system'); ?></h2> + <?php + foreach ($this->extension_list['system'] as $ext) { + $this->ext_details = $ext; + $this->renderHelper('extension/details'); + } + ?> + <?php } ?> + + <?php if (!empty($this->extension_list['user'])) { ?> + <h2><?php echo _t('admin.extensions.user'); ?></h2> + <?php + foreach ($this->extension_list['user'] as $ext) { + $this->ext_details = $ext; + $this->renderHelper('extension/details'); + } + ?> + <?php + } + + if (empty($this->extension_list['system']) && empty($this->extension_list['user'])) { + ?> + <p class="alert alert-warn"><?php echo _t('admin.extensions.empty_list'); ?></p> + <?php } ?> +</div> + +<?php $class = isset($this->extension) ? ' class="active"' : ''; ?> +<a href="#" id="close-slider"<?php echo $class; ?>></a> +<div id="slider"<?php echo $class; ?>> +<?php + if (isset($this->extension)) { + $this->renderHelper('extension/configure'); + } +?> +</div> diff --git a/app/views/feed/add.phtml b/app/views/feed/add.phtml index 849dacac6..4cdd3f390 100644 --- a/app/views/feed/add.phtml +++ b/app/views/feed/add.phtml @@ -1,16 +1,16 @@ <?php if ($this->feed) { ?> <div class="post"> - <h1><?php echo Minz_Translate::t ('add_rss_feed'); ?></h1> + <h1><?php echo _t('sub.feed.add'); ?></h1> <?php if (!$this->load_ok) { ?> - <p class="alert alert-error"><span class="alert-head"><?php echo Minz_Translate::t('damn'); ?></span> <?php echo Minz_Translate::t('internal_problem_feed', _url('index', 'logs')); ?></p> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('feedback.sub.feed.internal_problem', _url('index', 'logs')); ?></p> <?php } ?> <form method="post" action="<?php echo _url('feed', 'add'); ?>" autocomplete="off"> - <legend><?php echo Minz_Translate::t('informations'); ?></legend> + <legend><?php echo _t('sub.feed.informations'); ?></legend> <?php if ($this->load_ok) { ?> <div class="form-group"> - <label class="group-name"><?php echo Minz_Translate::t('title'); ?></label> + <label class="group-name"><?php echo _t('sub.feed.title'); ?></label> <div class="group-controls"> <label><?php echo $this->feed->name() ; ?></label> </div> @@ -18,7 +18,7 @@ <?php $desc = $this->feed->description(); if ($desc != '') { ?> <div class="form-group"> - <label class="group-name"><?php echo Minz_Translate::t('feed_description'); ?></label> + <label class="group-name"><?php echo _t('sub.feed.description'); ?></label> <div class="group-controls"> <label><?php echo htmlspecialchars($desc, ENT_NOQUOTES, 'UTF-8'); ?></label> </div> @@ -26,26 +26,26 @@ <?php } ?> <div class="form-group"> - <label class="group-name"><?php echo Minz_Translate::t('website_url'); ?></label> + <label class="group-name"><?php echo _t('sub.feed.website'); ?></label> <div class="group-controls"> <?php echo $this->feed->website(); ?> - <a class="btn" target="_blank" href="<?php echo $this->feed->website(); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> + <a class="btn" target="_blank" href="<?php echo $this->feed->website(); ?>"><?php echo _i('link'); ?></a> </div> </div> <?php } ?> <div class="form-group"> - <label class="group-name" for="url"><?php echo Minz_Translate::t('feed_url'); ?></label> + <label class="group-name" for="url"><?php echo _t('sub.feed.url'); ?></label> <div class="group-controls"> <div class="stick"> <input type="text" name="url_rss" id="url" class="extend" value="<?php echo $this->feed->url(); ?>" /> - <a class="btn" target="_blank" href="<?php echo $this->feed->url(); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> + <a class="btn" target="_blank" href="<?php echo $this->feed->url(); ?>"><?php echo _i('link'); ?></a> </div> - <a class="btn" target="_blank" href="http://validator.w3.org/feed/check.cgi?url=<?php echo $this->feed->url(); ?>"><?php echo Minz_Translate::t('feed_validator'); ?></a> + <a class="btn" target="_blank" href="http://validator.w3.org/feed/check.cgi?url=<?php echo $this->feed->url(); ?>"><?php echo _t('sub.feed.validator'); ?></a> </div> </div> <div class="form-group"> - <label class="group-name" for="category"><?php echo Minz_Translate::t('category'); ?></label> + <label class="group-name" for="category"><?php echo _t('sub.category'); ?></label> <div class="group-controls"> <select name="category" id="category"> <?php foreach ($this->categories as $cat) { ?> @@ -53,37 +53,37 @@ <?php echo $cat->name(); ?> </option> <?php } ?> - <option value="nc"><?php echo Minz_Translate::t('new_category'); ?></option> + <option value="nc"><?php echo _t('sub.category.new'); ?></option> </select> <span style="display: none;"> - <input type="text" name="new_category[name]" id="new_category_name" autocomplete="off" placeholder="<?php echo Minz_Translate::t('new_category'); ?>" /> + <input type="text" name="new_category[name]" id="new_category_name" autocomplete="off" placeholder="<?php echo _t('sub.category.new'); ?>" /> </span> </div> </div> - <legend><?php echo Minz_Translate::t('http_authentication'); ?></legend> + <legend><?php echo _t('sub.feed.auth.http'); ?></legend> <?php $auth = $this->feed->httpAuth(false); ?> <div class="form-group"> - <label class="group-name" for="http_user"><?php echo Minz_Translate::t('http_username'); ?></label> + <label class="group-name" for="http_user"><?php echo _t('sub.feed.auth.username'); ?></label> <div class="group-controls"> <input type="text" name="http_user" id="http_user" class="extend" value="<?php echo $auth['username']; ?>" autocomplete="off" /> </div> - <label class="group-name" for="http_pass"><?php echo Minz_Translate::t('http_password'); ?></label> + <label class="group-name" for="http_pass"><?php echo _t('sub.feed.auth.password'); ?></label> <div class="group-controls"> <input type="password" name="http_pass" id="http_pass" class="extend" value="<?php echo $auth['password']; ?>" autocomplete="off" /> </div> <div class="group-controls"> - <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('access_protected_feeds'); ?> + <?php echo _i('help'); ?> <?php echo _t('sub.feed.auth.help'); ?> </div> </div> <div class="form-group form-actions"> <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t('save'); ?></button> - <button type="reset" class="btn"><?php echo Minz_Translate::t('cancel'); ?></button> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> </div> </div> </form> diff --git a/app/views/feed/move.phtml b/app/views/feed/move.phtml new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/app/views/feed/move.phtml diff --git a/app/views/helpers/export/opml.phtml b/app/views/helpers/export/opml.phtml index 8622d9144..236cca303 100644 --- a/app/views/helpers/export/opml.phtml +++ b/app/views/helpers/export/opml.phtml @@ -2,7 +2,7 @@ $opml_array = array( 'head' => array( - 'title' => Minz_Configuration::title(), + 'title' => FreshRSS_Context::$system_conf->title, 'dateCreated' => date('D, d M Y H:i:s') ), 'body' => array() diff --git a/app/views/helpers/extension/configure.phtml b/app/views/helpers/extension/configure.phtml new file mode 100644 index 000000000..95d968aba --- /dev/null +++ b/app/views/helpers/extension/configure.phtml @@ -0,0 +1,19 @@ +<div class="post"> + <h1> + <?php echo $this->extension->getName(); ?> (<?php echo $this->extension->getVersion(); ?>) — + <?php echo $this->extension->isEnabled() ? _t('admin.extensions.enabled') + : _t('admin.extensions.disabled'); ?> + </h1> + + <p class="alert alert-warn"><?php echo $this->extension->getDescription(); ?> — <?php echo _t('gen.short.by_author', $this->extension->getAuthor()); ?></p> + + <h2><?php echo _t('gen.action.manage'); ?></h2> + <?php + $configure_view = $this->extension->getConfigureView(); + if ($configure_view !== false) { + echo $configure_view; + } else { + ?> + <p class="alert alert-warn"><?php echo _t('admin.extensions.no_configure_view'); ?></p> + <?php } ?> +</div> diff --git a/app/views/helpers/extension/details.phtml b/app/views/helpers/extension/details.phtml new file mode 100644 index 000000000..acba4e816 --- /dev/null +++ b/app/views/helpers/extension/details.phtml @@ -0,0 +1,21 @@ +<ul class="horizontal-list"> + <li class="item"> + <?php if ($this->ext_details->getType() === 'user' || FreshRSS_Auth::hasAccess('admin')) { ?> + <?php $name_encoded = urlencode($this->ext_details->getName()); ?> + <div class="stick"> + <a class="btn open-slider" href="<?php echo _url('extension', 'configure', 'e', $name_encoded); ?>"><?php echo _i('configure'); ?> <?php echo _t('gen.action.manage'); ?></a> + <?php if ($this->ext_details->isEnabled()) { ?> + <button class="btn active" form="form-extension" formaction="<?php echo _url('extension', 'disable', 'e', $name_encoded); ?>"><?php echo _t('gen.action.disable'); ?></button> + <?php } else { ?> + <button class="btn" form="form-extension" formaction="<?php echo _url('extension', 'enable', 'e', $name_encoded); ?>"><?php echo _t('gen.action.enable'); ?></button> + <?php } ?> + <?php if (FreshRSS_Auth::hasAccess('admin')) { ?> + <button class="btn btn-attention confirm" form="form-extension" formaction="<?php echo _url('extension', 'remove', 'e', $name_encoded); ?>"><?php echo _t('gen.action.remove'); ?></button> + <?php } ?> + </div> + <?php } else { ?> + <?php echo _t('admin.extensions.system.no_rights'); ?> + <?php } ?> + </li> + <li class="item"><?php echo $this->ext_details->getName(); ?></li> +</ul> diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml new file mode 100644 index 000000000..0b08d036c --- /dev/null +++ b/app/views/helpers/feed/update.phtml @@ -0,0 +1,174 @@ +<div class="post"> + <h1><?php echo $this->feed->name(); ?></h1> + + <div> + <a href="<?php echo _url('index', 'index', 'get', 'f_' . $this->feed->id()); ?>"><?php echo _i('link'); ?> <?php echo _t('gen.action.filter'); ?></a> + <?php echo _t('gen.short.or'); ?> + <a href="<?php echo _url('stats', 'repartition', 'id', $this->feed->id()); ?>"><?php echo _i('stats'); ?> <?php echo _t('sub.feed.stats'); ?></a> + </div> + + <p><?php echo $this->feed->description(); ?></p> + + <?php $nbEntries = $this->feed->nbEntries(); ?> + + <?php if ($this->feed->inError()) { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('sub.feed.error'); ?></p> + <?php } elseif ($nbEntries === 0) { ?> + <p class="alert alert-warn"><?php echo _t('sub.feed.empty'); ?></p> + <?php } ?> + + <form method="post" action="<?php echo _url('subscription', 'feed', 'id', $this->feed->id()); ?>" autocomplete="off"> + <legend><?php echo _t('sub.feed.informations'); ?></legend> + <div class="form-group"> + <label class="group-name" for="name"><?php echo _t('sub.feed.title'); ?></label> + <div class="group-controls"> + <input type="text" name="name" id="name" class="extend" value="<?php echo $this->feed->name() ; ?>" /> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="description"><?php echo _t('sub.feed.description'); ?></label> + <div class="group-controls"> + <textarea name="description" id="description"><?php echo htmlspecialchars($this->feed->description(), ENT_NOQUOTES, 'UTF-8'); ?></textarea> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="website"><?php echo _t('sub.feed.website'); ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="text" name="website" id="website" class="extend" value="<?php echo $this->feed->website(); ?>" /> + <a class="btn" target="_blank" href="<?php echo $this->feed->website(); ?>"><?php echo _i('link'); ?></a> + </div> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="url"><?php echo _t('sub.feed.url'); ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="text" name="url" id="url" class="extend" value="<?php echo $this->feed->url(); ?>" /> + <a class="btn" target="_blank" href="<?php echo $this->feed->url(); ?>"><?php echo _i('link'); ?></a> + </div> + + <a class="btn" target="_blank" href="http://validator.w3.org/feed/check.cgi?url=<?php echo $this->feed->url(); ?>"><?php echo _t('sub.feed.validator'); ?></a> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="category"><?php echo _t('sub.category'); ?></label> + <div class="group-controls"> + <select name="category" id="category"> + <?php foreach ($this->categories as $cat) { ?> + <option value="<?php echo $cat->id(); ?>"<?php echo $cat->id()== $this->feed->category() ? ' selected="selected"' : ''; ?>> + <?php echo $cat->name(); ?> + </option> + <?php } ?> + </select> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="priority"><?php echo _t('sub.feed.in_main_stream'); ?></label> + <div class="group-controls"> + <label class="checkbox" for="priority"> + <input type="checkbox" name="priority" id="priority" value="10"<?php echo $this->feed->priority() > 0 ? ' checked="checked"' : ''; ?> /> + <?php echo _t('gen.short.yes'); ?> + </label> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button class="btn btn-attention confirm" + data-str-confirm="<?php echo _t('gen.js.confirm_action_feed_cat'); ?>" + formaction="<?php echo _url('feed', 'delete', 'id', $this->feed->id()); ?>" + formmethod="post"><?php echo _t('gen.action.remove'); ?></button> + </div> + </div> + + <legend><?php echo _t('sub.feed.archiving'); ?></legend> + + <div class="form-group"> + <div class="group-controls"> + <div class="stick"> + <input type="text" value="<?php echo _t('sub.feed.number_entries', $nbEntries); ?>" disabled="disabled" /> + <a class="btn" href="<?php echo _url('feed', 'actualize', 'id', $this->feed->id()); ?>"> + <?php echo _i('refresh'); ?> <?php echo _t('gen.action.actualize'); ?> + </a> + </div> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="keep_history"><?php echo _t('sub.feed.keep_history'); ?></label> + <div class="group-controls"> + <select class="number" name="keep_history" id="keep_history" required="required"><?php + foreach (array('' => '', -2 => _t('gen.short.by_default'), 0 => '0', 10 => '10', 50 => '50', 100 => '100', 500 => '500', 1000 => '1 000', 5000 => '5 000', 10000 => '10 000', -1 => '∞') as $v => $t) { + echo '<option value="' . $v . ($this->feed->keepHistory() === $v ? '" selected="selected' : '') . '">' . $t . '</option>'; + } + ?></select> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="ttl"><?php echo _t('sub.feed.ttl'); ?></label> + <div class="group-controls"> + <select class="number" name="ttl" id="ttl" required="required"><?php + $found = false; + foreach (array(-2 => _t('gen.short.by_default'), 900 => '15min', 1200 => '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min', + 3600 => '1h', 5400 => '1.5h', 7200 => '2h', 10800 => '3h', 14400 => '4h', 18800 => '5h', 21600 => '6h', 25200 => '7h', 28800 => '8h', + 36000 => '10h', 43200 => '12h', 64800 => '18h', + 86400 => '1d', 129600 => '1.5d', 172800 => '2d', 259200 => '3d', 345600 => '4d', 432000 => '5d', 518400 => '6d', + 604800 => '1wk', 1209600 => '2wk', 1814400 => '3wk', 2419200 => '4wk', 2629744 => '1mo', -1 => '∞') as $v => $t) { + echo '<option value="' . $v . ($this->feed->ttl() === $v ? '" selected="selected' : '') . '">' . $t . '</option>'; + if ($this->feed->ttl() == $v) { + $found = true; + } + } + if (!$found) { + echo '<option value="' . intval($this->feed->ttl()) . '" selected="selected">' . intval($this->feed->ttl()) . 's</option>'; + } + ?></select> + </div> + </div> + <div class="form-group form-actions"> + <div class="group-controls"> + <button class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button class="btn btn-attention confirm" formmethod="post" formaction="<?php echo _url('feed', 'truncate', 'id', $this->feed->id()); ?>"><?php echo _t('gen.action.truncate'); ?></button> + </div> + </div> + + <legend><?php echo _t('sub.feed.auth.configuration'); ?></legend> + <?php $auth = $this->feed->httpAuth(false); ?> + <div class="form-group"> + <label class="group-name" for="http_user"><?php echo _t('sub.feed.auth.username'); ?></label> + <div class="group-controls"> + <input type="text" name="http_user" id="http_user" class="extend" value="<?php echo $auth['username']; ?>" autocomplete="off" /> + <?php echo _i('help'); ?> <?php echo _t('sub.feed.auth.help'); ?> + </div> + + <label class="group-name" for="http_pass"><?php echo _t('sub.feed.auth.password'); ?></label> + <div class="group-controls"> + <input type="password" name="http_pass" id="http_pass" class="extend" value="<?php echo $auth['password']; ?>" autocomplete="off" /> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> + </div> + </div> + + <legend><?php echo _t('sub.feed.advanced'); ?></legend> + <div class="form-group"> + <label class="group-name" for="path_entries"><?php echo _t('sub.feed.css_path'); ?></label> + <div class="group-controls"> + <input type="text" name="path_entries" id="path_entries" class="extend" value="<?php echo $this->feed->pathEntries(); ?>" placeholder="<?php echo _t('gen.short.blank_to_disable'); ?>" /> + <?php echo _i('help'); ?> <?php echo _t('sub.feed.css_help'); ?> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> + </div> + </div> + </form> +</div> diff --git a/app/views/helpers/index/normal/entry_bottom.phtml b/app/views/helpers/index/normal/entry_bottom.phtml new file mode 100644 index 000000000..20b4b332c --- /dev/null +++ b/app/views/helpers/index/normal/entry_bottom.phtml @@ -0,0 +1,86 @@ +<?php + $sharing = array(); + if (FreshRSS_Auth::hasAccess()) { + $sharing = FreshRSS_Context::$user_conf->sharing; + } + + $bottomline_read = FreshRSS_Context::$user_conf->bottomline_read; + $bottomline_favorite = FreshRSS_Context::$user_conf->bottomline_favorite; + $bottomline_sharing = FreshRSS_Context::$user_conf->bottomline_sharing && (count($sharing) > 0); + $bottomline_tags = FreshRSS_Context::$user_conf->bottomline_tags; + $bottomline_date = FreshRSS_Context::$user_conf->bottomline_date; + $bottomline_link = FreshRSS_Context::$user_conf->bottomline_link; +?><ul class="horizontal-list bottom"><?php + if (FreshRSS_Auth::hasAccess()) { + if ($bottomline_read) { + ?><li class="item manage"><?php + $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $this->entry->id())); + if ($this->entry->isRead()) { + $arUrl['params']['is_read'] = 0; + } + ?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php + echo _i($this->entry->isRead() ? 'read' : 'unread'); ?></a><?php + ?></li><?php + } + if ($bottomline_favorite) { + ?><li class="item manage"><?php + $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $this->entry->id())); + if ($this->entry->isFavorite()) { + $arUrl['params']['is_favorite'] = 0; + } + ?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php + echo _i($this->entry->isFavorite() ? 'starred' : 'non-starred'); ?></a><?php + ?></li><?php + } + } ?> + <li class="item"><?php + if ($bottomline_sharing) { + ?><div class="dropdown"> + <div id="dropdown-share-<?php echo $this->entry->id();?>" class="dropdown-target"></div> + <a class="dropdown-toggle" href="#dropdown-share-<?php echo $this->entry->id();?>"> + <?php echo _i('share'); ?> + <?php echo _t('index.share'); ?> + </a> + + <ul class="dropdown-menu"> + <li class="dropdown-close"><a href="#close">❌</a></li><?php + $link = $this->entry->link(); + $title = $this->entry->title() . ' · ' . $this->feed->name(); + foreach (FreshRSS_Context::$user_conf->sharing as $share_options) { + $share = FreshRSS_Share::get($share_options['type']); + $share_options['link'] = $link; + $share_options['title'] = $title; + $share->update($share_options); + ?><li class="item share"> + <a target="_blank" href="<?php echo $share->url(); ?>"><?php echo $share->name(); ?></a> + </li><?php + } + ?></ul> + </div> + <?php } ?> + </li><?php + $tags = $bottomline_tags ? $this->entry->tags() : null; + if (!empty($tags)) { + ?><li class="item"> + <div class="dropdown"> + <div id="dropdown-tags-<?php echo $this->entry->id();?>" class="dropdown-target"></div> + <?php echo _i('tag'); ?> + <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $this->entry->id();?>"><?php + echo _t('index.tag.related'); + ?></a> + <ul class="dropdown-menu"> + <li class="dropdown-close"><a href="#close">❌</a></li><?php + foreach($tags as $tag) { + ?><li class="item"><a href="<?php echo _url('index', 'index', 'search', urlencode('#' . $tag)); ?>"><?php echo $tag; ?></a></li><?php + } ?> + </ul> + </div> + </li><?php + } + if ($bottomline_date) { + ?><li class="item date"><?php echo $this->entry->date(); ?></li><?php + } + if ($bottomline_link) { + ?><li class="item link"><a target="_blank" href="<?php echo $this->entry->link(); ?>"><?php echo _i('link'); ?></a></li><?php + } ?> +</ul> diff --git a/app/views/helpers/index/normal/entry_header.phtml b/app/views/helpers/index/normal/entry_header.phtml new file mode 100644 index 000000000..dc544298f --- /dev/null +++ b/app/views/helpers/index/normal/entry_header.phtml @@ -0,0 +1,33 @@ +<?php + $topline_read = FreshRSS_Context::$user_conf->topline_read; + $topline_favorite = FreshRSS_Context::$user_conf->topline_favorite; + $topline_date = FreshRSS_Context::$user_conf->topline_date; + $topline_link = FreshRSS_Context::$user_conf->topline_link; +?><ul class="horizontal-list flux_header"><?php + if (FreshRSS_Auth::hasAccess()) { + if ($topline_read) { + ?><li class="item manage"><?php + $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $this->entry->id())); + if ($this->entry->isRead()) { + $arUrl['params']['is_read'] = 0; + } + ?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php + echo _i($this->entry->isRead() ? 'read' : 'unread'); ?></a><?php + ?></li><?php + } + if ($topline_favorite) { + ?><li class="item manage"><?php + $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $this->entry->id())); + if ($this->entry->isFavorite()) { + $arUrl['params']['is_favorite'] = 0; + } + ?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php + echo _i($this->entry->isFavorite() ? 'starred' : 'non-starred'); ?></a><?php + ?></li><?php + } + } + ?><li class="item website"><a href="<?php echo _url('index', 'index', 'get', 'f_' . $this->feed->id()); ?>"><img class="favicon" src="<?php echo $this->feed->favicon(); ?>" alt="✇" /> <span><?php echo $this->feed->name(); ?></span></a></li> + <li class="item title"><a target="_blank" 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" href="<?php echo $this->entry->link(); ?>"><?php echo _i('link'); ?></a></li><?php } ?> +</ul> diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 1139eb446..adf0783f3 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -1,61 +1,71 @@ +"use strict"; <?php -echo '"use strict";', "\n"; +$mark = FreshRSS_Context::$user_conf->mark_when; +$mail = Minz_Session::param('mail', false); +$auto_actualize = Minz_Session::param('actualize_feeds', false); +$hide_posts = (FreshRSS_Context::$user_conf->display_posts || + Minz_Request::param('output') === 'reader'); +$s = FreshRSS_Context::$user_conf->shortcuts; -$mark = $this->conf->mark_when; -echo 'var ', - 'help_url="', FRESHRSS_WIKI, '"', - ',hide_posts=', ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'false' : 'true', - ',display_order="', Minz_Request::param('order', $this->conf->sort_order), '"', - ',auto_mark_article=', $mark['article'] ? 'true' : 'false', - ',auto_mark_site=', $mark['site'] ? 'true' : 'false', - ',auto_mark_scroll=', $mark['scroll'] ? 'true' : 'false', - ',auto_load_more=', $this->conf->auto_load_more ? 'true' : 'false', - ',does_lazyload=', $this->conf->lazyload ? 'true' : 'false', - ',sticky_post=', $this->conf->sticky_post ? 'true' : 'false'; +$url_login = Minz_Url::display(array( + 'c' => 'auth', + 'a' => 'login' +), 'php'); +$url_logout = Minz_Url::display(array( + 'c' => 'auth', + 'a' => 'logout' +), 'php'); -$s = $this->conf->shortcuts; -echo ',shortcuts={', - 'mark_read:"', $s['mark_read'], '",', - 'mark_favorite:"', $s['mark_favorite'], '",', - 'go_website:"', $s['go_website'], '",', - 'prev_entry:"', $s['prev_entry'], '",', - 'next_entry:"', $s['next_entry'], '",', - 'first_entry:"', $s['first_entry'], '",', - 'last_entry:"', $s['last_entry'], '",', - 'collapse_entry:"', $s['collapse_entry'], '",', - 'load_more:"', $s['load_more'], '",', - 'auto_share:"', $s['auto_share'], '",', - 'focus_search:"', $s['focus_search'], '",', - 'user_filter:"', $s['user_filter'], '",', - 'help:"', $s['help'], '"', +echo 'var context={', + 'auto_remove_article:', FreshRSS_Context::isAutoRemoveAvailable() ? 'true' : 'false', ',', + 'hide_posts:', $hide_posts ? 'false' : 'true', ',', + 'display_order:"', Minz_Request::param('order', FreshRSS_Context::$user_conf->sort_order), '",', + 'auto_mark_article:', $mark['article'] ? 'true' : 'false', ',', + 'auto_mark_site:', $mark['site'] ? 'true' : 'false', ',', + 'auto_mark_scroll:', $mark['scroll'] ? 'true' : 'false', ',', + 'auto_load_more:', FreshRSS_Context::$user_conf->auto_load_more ? 'true' : 'false', ',', + 'auto_actualize_feeds:', $auto_actualize ? 'true' : 'false', ',', + 'does_lazyload:', FreshRSS_Context::$user_conf->lazyload ? 'true' : 'false', ',', + 'sticky_post:', FreshRSS_Context::isStickyPostEnabled() ? 'true' : 'false', ',', + 'html5_notif_timeout:', FreshRSS_Context::$user_conf->html5_notif_timeout, ',', + 'auth_type:"', FreshRSS_Context::$system_conf->auth_type, '",', + 'current_user_mail:', $mail ? ('"' . $mail . '"') : 'null', ',', + 'current_view:"', Minz_Request::param('output', 'normal'), '"', "},\n"; -if (Minz_Request::param ('output') === 'global') { - echo "iconClose='", FreshRSS_Themes::icon('close'), "',\n"; -} - -$authType = Minz_Configuration::authType(); -if ($authType === 'persona') { - // If user is disconnected, current_user_mail MUST be null - $mail = Minz_Session::param ('mail', false); - if ($mail) { - echo 'current_user_mail="' . $mail . '",'; - } else { - echo 'current_user_mail=null,'; - } -} - -echo 'authType="', $authType, '",', - 'url_freshrss="', _url ('index', 'index'), '",', - 'url_login="', _url ('index', 'login'), '",', - 'url_logout="', _url ('index', 'logout'), '",'; +echo 'shortcuts={', + 'mark_read:"', @$s['mark_read'], '",', + 'mark_favorite:"', @$s['mark_favorite'], '",', + 'go_website:"', @$s['go_website'], '",', + 'prev_entry:"', @$s['prev_entry'], '",', + 'next_entry:"', @$s['next_entry'], '",', + 'first_entry:"', @$s['first_entry'], '",', + 'last_entry:"', @$s['last_entry'], '",', + 'collapse_entry:"', @$s['collapse_entry'], '",', + 'load_more:"', @$s['load_more'], '",', + 'auto_share:"', @$s['auto_share'], '",', + 'focus_search:"', @$s['focus_search'], '",', + 'user_filter:"', @$s['user_filter'], '",', + 'help:"', @$s['help'], '",', + 'close_dropdown:"', @$s['close_dropdown'], '"', +"},\n"; -echo 'str_confirmation_default="', Minz_Translate::t('confirm_action'), '"', ",\n"; -echo 'str_notif_title_articles="', Minz_Translate::t('notif_title_new_articles'), '"', ",\n"; -echo 'str_notif_body_articles="', Minz_Translate::t('notif_body_new_articles'), '"', ",\n"; -echo 'html5_notif_timeout=', $this->conf->html5_notif_timeout,",\n"; +echo 'url={', + 'index:"', _url('index', 'index'), '",', + 'login:"', $url_login, '",', + 'logout:"', $url_logout, '",', + 'help:"', FRESHRSS_WIKI, '"', +"},\n"; +echo 'i18n={', + 'confirmation_default:"', _t('gen.js.confirm_action'), '",', + 'notif_title_articles:"', _t('gen.js.feedback.title_new_articles'), '",', + 'notif_body_articles:"', _t('gen.js.feedback.body_new_articles'), '",', + 'notif_request_failed:"', _t('gen.js.feedback.request_failed'), '",', + 'category_empty:"', _t('gen.js.category_empty'), '"', +"},\n"; -$autoActualise = Minz_Session::param('actualize_feeds', false); -echo 'auto_actualize_feeds=', $autoActualise ? 'true' : 'false', ";\n"; +echo 'icons={', + 'close:\'', _i('close'), '\'', +"}\n";
\ No newline at end of file diff --git a/app/views/helpers/logs_pagination.phtml b/app/views/helpers/logs_pagination.phtml index e3d14810e..58b3c68f4 100755 --- a/app/views/helpers/logs_pagination.phtml +++ b/app/views/helpers/logs_pagination.phtml @@ -1,7 +1,7 @@ <?php - $c = Minz_Request::controllerName (); - $a = Minz_Request::actionName (); - $params = Minz_Request::params (); + $c = Minz_Request::controllerName(); + $a = Minz_Request::actionName(); + $params = Minz_Request::params(); ?> <?php if ($this->nbPage > 1) { ?> @@ -9,14 +9,14 @@ <?php $params[$getteur] = 1; ?> <li class="item pager-first"> <?php if ($this->currentPage > 1) { ?> - <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">« <?php echo Minz_Translate::t('first'); ?></a> + <a href="<?php echo Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)); ?>">« <?php echo _t('gen.pagination.first'); ?></a> <?php } ?> </li> <?php $params[$getteur] = $this->currentPage - 1; ?> <li class="item pager-previous"> <?php if ($this->currentPage > 1) { ?> - <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">‹ <?php echo Minz_Translate::t('previous'); ?></a> + <a href="<?php echo Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)); ?>">‹ <?php echo _t('gen.pagination.previous'); ?></a> <?php } ?> </li> @@ -24,7 +24,7 @@ <?php if($i > 0 && $i <= $this->nbPage) { ?> <?php if ($i != $this->currentPage) { ?> <?php $params[$getteur] = $i; ?> - <li class="item pager-item"><a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo $i; ?></a></li> + <li class="item pager-item"><a href="<?php echo Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo $i; ?></a></li> <?php } else { ?> <li class="item pager-current"><?php echo $i; ?></li> <?php } ?> @@ -34,13 +34,13 @@ <?php $params[$getteur] = $this->currentPage + 1; ?> <li class="item pager-next"> <?php if ($this->currentPage < $this->nbPage) { ?> - <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Minz_Translate::t('next'); ?> ›</a> + <a href="<?php echo Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo _t('gen.pagination.next'); ?> ›</a> <?php } ?> </li> <?php $params[$getteur] = $this->nbPage; ?> <li class="item pager-last"> <?php if ($this->currentPage < $this->nbPage) { ?> - <a href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Minz_Translate::t('last'); ?> »</a> + <a href="<?php echo Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo _t('gen.pagination.last'); ?> »</a> <?php } ?> </li> </ul> diff --git a/app/views/helpers/pagination.phtml b/app/views/helpers/pagination.phtml index cea338364..b20201c4b 100755 --- a/app/views/helpers/pagination.phtml +++ b/app/views/helpers/pagination.phtml @@ -1,36 +1,40 @@ <?php - $c = Minz_Request::controllerName(); - $a = Minz_Request::actionName(); - $params = Minz_Request::params(); - $markReadUrl = Minz_Session::param('markReadUrl'); - Minz_Session::_param('markReadUrl', false); + $url_next = Minz_Request::currentRequest(); + $url_next['params']['next'] = FreshRSS_Context::$next_id; + $url_next['params']['ajax'] = 1; + + $url_mark_read = array( + 'c' => 'entry', + 'a' => 'read', + 'params' => array( + 'get' => FreshRSS_Context::currentGet(), + 'nextGet' => FreshRSS_Context::$next_get, + 'idMax' => FreshRSS_Context::$id_max, + ) + ); ?> <form id="mark-read-pagination" method="post" style="display: none"></form> <ul class="pagination"> <li class="item pager-next"> - <?php if (!empty($this->nextId)) { ?> - <?php - $params['next'] = $this->nextId; - $params['ajax'] = 1; - ?> - <a id="load_more" href="<?php echo Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)); ?>"> - <?php echo _t('load_more'); ?> + <?php if (FreshRSS_Context::$next_id) { ?> + <a id="load_more" href="<?php echo Minz_Url::display($url_next); ?>"> + <?php echo _t('gen.pagination.load_more'); ?> </a> - <?php } elseif ($markReadUrl) { ?> + <?php } elseif ($url_mark_read) { ?> <button id="bigMarkAsRead" - class="as-link <?php echo $this->conf->reading_confirm ? 'confirm' : ''; ?>" + class="as-link <?php echo FreshRSS_Context::$user_conf->reading_confirm ? 'confirm' : ''; ?>" form="mark-read-pagination" - formaction="<?php echo $markReadUrl; ?>" + formaction="<?php echo Minz_Url::display($url_mark_read); ?>" type="submit"> - <?php echo _t('nothing_to_load'); ?><br /> + <?php echo _t('gen.pagination.nothing_to_load'); ?><br /> <span class="bigTick">✓</span><br /> - <?php echo _t('mark_all_read'); ?> + <?php echo _t('gen.pagination.mark_all_read'); ?> </button> <?php } else { ?> <a id="bigMarkAsRead" href="."> - <?php echo _t('nothing_to_load'); ?><br /> + <?php echo _t('gen.pagination.nothing_to_load'); ?><br /> </a> <?php } ?> </li> diff --git a/app/views/helpers/view/global_view.phtml b/app/views/helpers/view/global_view.phtml deleted file mode 100644 index 72bcf4c73..000000000 --- a/app/views/helpers/view/global_view.phtml +++ /dev/null @@ -1,53 +0,0 @@ -<?php $this->partial ('nav_menu'); ?> - -<?php if (!empty($this->entries)) { ?> -<div id="stream" class="global categories"> -<?php - $arUrl = array('c' => 'index', 'a' => 'index', 'params' => array()); - if ($this->conf->view_mode !== 'normal') { - $arUrl['params']['output'] = 'normal'; - } - $p = Minz_Request::param('state', ''); - if (($p != '') && ($this->conf->default_view !== $p)) { - $arUrl['params']['state'] = $p; - } - - foreach ($this->cat_aside as $cat) { - $feeds = $cat->feeds (); - if (!empty ($feeds)) { -?> - <div class="box-category"> - <div class="category"> - <a data-unread="<?php echo formatNumber($cat->nbNotRead()); ?>" class="btn" href="<?php $arUrl['params']['get'] = 'c_' . $cat->id (); echo Minz_Url::display($arUrl); ?>"> - <?php echo $cat->name(); ?> - </a> - </div> - <ul class="feeds"> - <?php foreach ($feeds as $feed) { ?> - <?php $not_read = $feed->nbNotRead (); ?> - <li id="f_<?php echo $feed->id (); ?>" class="item<?php echo $feed->inError () ? ' error' : ''; ?><?php echo $feed->nbEntries () == 0 ? ' empty' : ''; ?>"> - <img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> - <a class="feed" data-unread="<?php echo formatNumber($feed->nbNotRead()); ?>" data-priority="<?php echo $feed->priority (); ?>" href="<?php $arUrl['params']['get'] = 'f_' . $feed->id(); echo Minz_Url::display($arUrl); ?>"> - <?php echo $feed->name(); ?> - </a> - </li> - <?php } ?> - </ul> - </div> -<?php - } - } -?> -</div> - -<div id="overlay"></div> -<div id="panel"<?php echo $this->conf->display_posts ? '' : ' class="hide_posts"'; ?>> - <a class="close" href="#"><?php echo FreshRSS_Themes::icon('close'); ?></a> -</div> - -<?php } else { ?> -<div id="stream" class="prompt alert alert-warn global"> - <h2><?php echo _t('no_feed_to_display'); ?></h2> - <a href="<?php echo _url('configure', 'feed'); ?>"><?php echo _t('think_to_add'); ?></a><br /><br /> -</div> -<?php } ?> diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml deleted file mode 100644 index 6d9789f8d..000000000 --- a/app/views/helpers/view/normal_view.phtml +++ /dev/null @@ -1,191 +0,0 @@ -<?php - -$this->partial ('aside_flux'); -$this->partial ('nav_menu'); - -if (!empty($this->entries)) { - $display_today = true; - $display_yesterday = true; - $display_others = true; - if ($this->loginOk) { - $sharing = $this->conf->sharing; - } else { - $sharing = array(); - } - $hidePosts = !$this->conf->display_posts; - $lazyload = $this->conf->lazyload; - $topline_read = $this->conf->topline_read; - $topline_favorite = $this->conf->topline_favorite; - $topline_date = $this->conf->topline_date; - $topline_link = $this->conf->topline_link; - $bottomline_read = $this->conf->bottomline_read; - $bottomline_favorite = $this->conf->bottomline_favorite; - $bottomline_sharing = $this->conf->bottomline_sharing && (count($sharing)); - $bottomline_tags = $this->conf->bottomline_tags; - $bottomline_date = $this->conf->bottomline_date; - $bottomline_link = $this->conf->bottomline_link; - - $content_width = $this->conf->content_width; -?> - -<div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>"><?php - ?><div id="new-article"> - <a href="<?php echo Minz_Url::display ($this->url); ?>"><?php echo Minz_Translate::t ('new_article'); ?></a> - </div><?php - foreach ($this->entries as $item) { - if ($display_today && $item->isDay (FreshRSS_Days::TODAY, $this->today)) { - ?><div class="day" id="day_today"><?php - echo Minz_Translate::t ('today'); - ?><span class="date"> — <?php echo timestamptodate (time (), false); ?></span><?php - ?><span class="name"><?php echo $this->currentName; ?></span><?php - ?></div><?php - $display_today = false; - } - if ($display_yesterday && $item->isDay (FreshRSS_Days::YESTERDAY, $this->today)) { - ?><div class="day" id="day_yesterday"><?php - echo Minz_Translate::t ('yesterday'); - ?><span class="date"> — <?php echo timestamptodate (time () - 86400, false); ?></span><?php - ?><span class="name"><?php echo $this->currentName; ?></span><?php - ?></div><?php - $display_yesterday = false; - } - if ($display_others && $item->isDay (FreshRSS_Days::BEFORE_YESTERDAY, $this->today)) { - ?><div class="day" id="day_before_yesterday"><?php - echo Minz_Translate::t ('before_yesterday'); - ?><span class="name"><?php echo $this->currentName; ?></span><?php - ?></div><?php - $display_others = false; - } - ?><div class="flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id (); ?>"> - <ul class="horizontal-list flux_header"><?php - if ($this->loginOk) { - if ($topline_read) { - ?><li class="item manage"><?php - $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id ())); - if ($item->isRead()) { - $arUrl['params']['is_read'] = 0; - } - ?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php - echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php - ?></li><?php - } - if ($topline_favorite) { - ?><li class="item manage"><?php - $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id ())); - if ($item->isFavorite()) { - $arUrl['params']['is_favorite'] = 0; - } - ?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php - echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php - ?></li><?php - } - } - $feed = FreshRSS_CategoryDAO::findFeed($this->cat_aside, $item->feed ()); //We most likely already have the feed object in cache - if ($feed == null) { - $feed = $item->feed(true); - if ($feed == null) { - $feed = FreshRSS_Feed::example(); - } - } - ?><li class="item website"><a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>"><img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span></a></li> - <li class="item title"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo $item->title (); ?></a></li> - <?php if ($topline_date) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?> - <?php if ($topline_link) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?> - </ul> - - <div class="flux_content"> - <div class="content <?php echo $content_width; ?>"> - <h1 class="title"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo $item->title (); ?></a></h1> - <?php - $author = $item->author(); - echo $author != '' ? '<div class="author">' . Minz_Translate::t('by_author', $author) . '</div>' : '', - $lazyload && $hidePosts ? lazyimg($item->content()) : $item->content(); - ?> - </div> - <ul class="horizontal-list bottom"><?php - if ($this->loginOk) { - if ($bottomline_read) { - ?><li class="item manage"><?php - $arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id ())); - if ($item->isRead()) { - $arUrl['params']['is_read'] = 0; - } - ?><a class="read" href="<?php echo Minz_Url::display($arUrl); ?>"><?php - echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php - ?></li><?php - } - if ($bottomline_favorite) { - ?><li class="item manage"><?php - $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id ())); - if ($item->isFavorite()) { - $arUrl['params']['is_favorite'] = 0; - } - ?><a class="bookmark" href="<?php echo Minz_Url::display($arUrl); ?>"><?php - echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php - ?></li><?php - } - } ?> - <li class="item"><?php - if ($bottomline_sharing) { - $link = urlencode ($item->link ()); - $title = urlencode ($item->title () . ' · ' . $feed->name ()); - ?><div class="dropdown"> - <div id="dropdown-share-<?php echo $item->id ();?>" class="dropdown-target"></div> - <a class="dropdown-toggle" href="#dropdown-share-<?php echo $item->id ();?>"> - <?php echo FreshRSS_Themes::icon('share'); ?> - <?php echo Minz_Translate::t ('share'); ?> - </a> - - <ul class="dropdown-menu"> - <li class="dropdown-close"><a href="#close">❌</a></li> - <?php foreach ($sharing as $share) :?> - <li class="item share"> - <a target="_blank" href="<?php echo FreshRSS_Share::generateUrl($this->conf->shares, $share, $item->link(), $item->title() . ' . ' . $feed->name())?>"> - <?php echo Minz_Translate::t ($share['name']);?> - </a> - </li> - <?php endforeach;?> - </ul> - </div> - <?php } ?> - </li><?php - $tags = $bottomline_tags ? $item->tags() : null; - if (!empty($tags)) { - ?><li class="item"> - <div class="dropdown"> - <div id="dropdown-tags-<?php echo $item->id();?>" class="dropdown-target"></div> - <?php echo _i('tag'); ?> - <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $item->id();?>"><?php - echo _t('related_tags'); - ?></a> - <ul class="dropdown-menu"> - <li class="dropdown-close"><a href="#close">❌</a></li><?php - foreach($tags as $tag) { - ?><li class="item"><a href="<?php echo _url('index', 'index', 'search', urlencode('#' . $tag)); ?>"><?php echo $tag; ?></a></li><?php - } ?> - </ul> - </div> - </li><?php - } - if ($bottomline_date) { - ?><li class="item date"><?php echo $item->date (); ?></li><?php - } - if ($bottomline_link) { - ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php - } ?> - </ul> - </div> - </div> - <?php } ?> - - <?php $this->renderHelper('pagination'); ?> -</div> - -<?php $this->partial ('nav_entries'); ?> - -<?php } else { ?> -<div id="stream" class="prompt alert alert-warn normal"> - <h2><?php echo _t('no_feed_to_display'); ?></h2> - <a href="<?php echo _url('configure', 'feed'); ?>"><?php echo _t('think_to_add'); ?></a><br /><br /> -</div> -<?php } ?> diff --git a/app/views/helpers/view/reader_view.phtml b/app/views/helpers/view/reader_view.phtml deleted file mode 100644 index c80dca519..000000000 --- a/app/views/helpers/view/reader_view.phtml +++ /dev/null @@ -1,44 +0,0 @@ -<?php -$this->partial ('nav_menu'); - -if (!empty($this->entries)) { - $lazyload = $this->conf->lazyload; - $content_width = $this->conf->content_width; -?> - -<div id="stream" class="reader"> - <?php foreach ($this->entries as $item) { ?> - - <div class="flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id (); ?>"> - <div class="flux_content"> - <div class="content <?php echo $content_width; ?>"> - <?php - $feed = FreshRSS_CategoryDAO::findFeed($this->cat_aside, $item->feed ()); //We most likely already have the feed object in cache - if (empty($feed)) $feed = $item->feed (true); - ?> - <a href="<?php echo $item->link (); ?>"> - <img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span> - </a> - <h1 class="title"><?php echo $item->title (); ?></h1> - - <div class="author"><?php - $author = $item->author(); - echo $author != '' ? Minz_Translate::t('by_author', $author) . ' — ' : '', - $item->date(); - ?></div> - - <?php echo $item->content(); ?> - </div> - </div> - </div> - <?php } ?> - - <?php $this->renderHelper('pagination'); ?> -</div> - -<?php } else { ?> -<div id="stream" class="prompt alert alert-warn reader"> - <h2><?php echo _t('no_feed_to_display'); ?></h2> - <a href="<?php echo _url('configure', 'feed'); ?>"><?php echo _t('think_to_add'); ?></a><br /><br /> -</div> -<?php } ?> diff --git a/app/views/importExport/index.phtml b/app/views/importExport/index.phtml index 35371faca..a64524bf1 100644 --- a/app/views/importExport/index.phtml +++ b/app/views/importExport/index.phtml @@ -1,13 +1,13 @@ -<?php $this->partial('aside_feed'); ?> +<?php $this->partial('aside_subscription'); ?> <div class="post "> - <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> <form method="post" action="<?php echo _url('importExport', 'import'); ?>" enctype="multipart/form-data"> - <legend><?php echo _t('import'); ?></legend> + <legend><?php echo _t('sub.import_export.import'); ?></legend> <div class="form-group"> <label class="group-name" for="file"> - <?php echo extension_loaded('zip') ? _t('file_to_import') : _t('file_to_import_no_zip'); ?> + <?php echo extension_loaded('zip') ? _t('sub.import_export.file_to_import') : _t('sub.import_export.file_to_import_no_zip'); ?> </label> <div class="group-controls"> <input type="file" name="file" id="file" /> @@ -16,24 +16,24 @@ <div class="form-group form-actions"> <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo _t('import'); ?></button> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.import'); ?></button> </div> </div> </form> <?php if (count($this->feeds) > 0) { ?> <form method="post" action="<?php echo _url('importExport', 'export'); ?>"> - <legend><?php echo _t('export'); ?></legend> + <legend><?php echo _t('sub.import_export.export'); ?></legend> <div class="form-group"> <div class="group-controls"> <label class="checkbox" for="export_opml"> <input type="checkbox" name="export_opml" id="export_opml" value="1" checked="checked" /> - <?php echo _t('export_opml'); ?> + <?php echo _t('sub.import_export.export_opml'); ?> </label> <label class="checkbox" for="export_starred"> <input type="checkbox" name="export_starred" id="export_starred" value="1" <?php echo extension_loaded('zip') ? 'checked="checked"' : ''; ?> /> - <?php echo _t('export_starred'); ?> + <?php echo _t('sub.import_export.export_starred'); ?> </label> <?php @@ -53,7 +53,7 @@ <div class="form-group form-actions"> <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo _t('export'); ?></button> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.export'); ?></button> </div> </div> </form> diff --git a/app/views/index/about.phtml b/app/views/index/about.phtml index 76ff804d8..3fdb5160d 100644 --- a/app/views/index/about.phtml +++ b/app/views/index/about.phtml @@ -1,27 +1,24 @@ <div class="post content"> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> - <h1><?php echo Minz_Translate::t ('about_freshrss'); ?></h1> + <h1><?php echo _t('index.about'); ?></h1> <dl class="infos"> - <dt><?php echo Minz_Translate::t ('project_website'); ?></dt> + <dt><?php echo _t('index.about.project_website'); ?></dt> <dd><a href="<?php echo FRESHRSS_WEBSITE; ?>"><?php echo FRESHRSS_WEBSITE; ?></a></dd> - <dt><?php echo Minz_Translate::t ('lead_developer'); ?></dt> - <dd><a href="mailto:contact@marienfressinaud.fr">Marien Fressinaud</a> — <a href="http://marienfressinaud.fr"><?php echo Minz_Translate::t ('website'); ?></a></dd> + <dt><?php echo _t('index.about.bugs_reports'); ?></dt> + <dd><?php echo _t('index.about.github'); ?></dd> - <dt><?php echo Minz_Translate::t ('bugs_reports'); ?></dt> - <dd><?php echo Minz_Translate::t ('github_or_email'); ?></dd> + <dt><?php echo _t('index.about.license'); ?></dt> + <dd><?php echo _t('index.about.agpl3'); ?></dd> - <dt><?php echo Minz_Translate::t ('license'); ?></dt> - <dd><?php echo Minz_Translate::t ('agpl3'); ?></dd> - - <dt><?php echo Minz_Translate::t ('version'); ?></dt> + <dt><?php echo _t('index.about.version'); ?></dt> <dd><?php echo FRESHRSS_VERSION; ?></dd> </dl> - <p><?php echo Minz_Translate::t ('freshrss_description'); ?></p> + <p><?php echo _t('index.about.freshrss_description'); ?></p> - <h1><?php echo Minz_Translate::t ('credits'); ?></h1> - <p><?php echo Minz_Translate::t ('credits_content'); ?></p> + <h1><?php echo _t('index.about.credits'); ?></h1> + <p><?php echo _t('index.about.credits_content'); ?></p> </div> diff --git a/app/views/index/formLogin.phtml b/app/views/index/formLogin.phtml deleted file mode 100644 index b05cdced4..000000000 --- a/app/views/index/formLogin.phtml +++ /dev/null @@ -1,46 +0,0 @@ -<div class="prompt"> - <h1><?php echo _t('login'); ?></h1><?php - - switch (Minz_Configuration::authType()) { - case 'form': - ?><form id="crypto-form" method="post" action="<?php echo _url('index', 'formLogin'); ?>"> - <div> - <label for="username"><?php echo _t('username'); ?></label> - <input type="text" id="username" name="username" size="16" required="required" maxlength="16" pattern="[0-9a-zA-Z]{1,16}" autofocus="autofocus" /> - </div> - <div> - <label for="passwordPlain"><?php echo _t('password'); ?></label> - <input type="password" id="passwordPlain" required="required" /> - <input type="hidden" id="challenge" name="challenge" /><br /> - <noscript><strong><?php echo _t('javascript_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('keep_logged_in'); ?> - </label> - <br /> - </div> - <div> - <button id="loginButton" type="submit" class="btn btn-important"><?php echo _t('login'); ?></button> - </div> - </form><?php - break; - - case 'persona': - ?><p> - <a class="signin btn btn-important" href="#"> - <?php echo _i('login'); ?> - <?php echo _t('login_with_persona'); ?> - </a><br /><br /> - - <?php echo _i('help'); ?> - <small> - <a href="<?php echo _url('index', 'resetAuth'); ?>"><?php echo _t('login_persona_problem'); ?></a> - </small> - </p><?php - break; - } ?> - - <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('about_freshrss'); ?></a></p> -</div> diff --git a/app/views/index/global.phtml b/app/views/index/global.phtml new file mode 100644 index 000000000..0ffa3bc54 --- /dev/null +++ b/app/views/index/global.phtml @@ -0,0 +1,54 @@ +<?php + $this->partial('nav_menu'); + + $class = ''; + if (FreshRSS_Context::$user_conf->hide_read_feeds && + FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) && + !FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_READ)) { + $class = ' state_unread'; + } +?> + +<div id="stream" class="global<?php echo $class; ?>"> +<?php + $url_base = array( + 'c' => 'index', + 'a' => 'normal', + 'params' => Minz_Request::params() + ); + + foreach ($this->categories as $cat) { + $feeds = $cat->feeds(); + $url_base['params']['get'] = 'c_' . $cat->id(); + + if (!empty($feeds)) { +?> + <div class="box category" data-unread="<?php echo $cat->nbNotRead(); ?>"> + <div class="box-title"><a class="title" data-unread="<?php echo format_number($cat->nbNotRead()); ?>" href="<?php echo Minz_Url::display($url_base); ?>"><?php echo $cat->name(); ?></a></div> + + <ul class="box-content"> + <?php + foreach ($feeds as $feed) { + $nb_not_read = $feed->nbNotRead(); + $error = $feed->inError() ? ' error' : ''; + $empty = $feed->nbEntries() === 0 ? ' empty' : ''; + $url_base['params']['get'] = 'f_' . $feed->id(); + ?> + <li id="f_<?php echo $feed->id(); ?>" class="item feed<?php echo $error, $empty; ?>" data-unread="<?php echo $feed->nbNotRead(); ?>" data-priority="<?php echo $feed->priority(); ?>"> + <img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" /> + <a class="item-title" data-unread="<?php echo format_number($feed->nbNotRead()); ?>" href="<?php echo Minz_Url::display($url_base); ?>"><?php echo $feed->name(); ?></a> + </li> + <?php } ?> + </ul> + </div> +<?php + } + } +?> +</div> + +<div id="overlay"> + <a class="close" href="#"><?php echo _i('close'); ?></a> +</div> +<div id="panel"<?php echo FreshRSS_Context::$user_conf->display_posts ? '' : ' class="hide_posts"'; ?>> +</div> diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml index 1ff36ca8e..e69de29bb 100644 --- a/app/views/index/index.phtml +++ b/app/views/index/index.phtml @@ -1,25 +0,0 @@ -<?php - -$output = Minz_Request::param ('output', 'normal'); - -if ($this->loginOk || Minz_Configuration::allowAnonymous()) { - if ($output === 'normal') { - $this->renderHelper ('view/normal_view'); - } elseif ($output === 'reader') { - $this->renderHelper ('view/reader_view'); - } elseif ($output === 'global') { - $this->renderHelper ('view/global_view'); - } elseif ($output === 'rss') { - $this->renderHelper ('view/rss_view'); - } else { - Minz_Request::_param ('output', 'normal'); - $output = 'normal'; - $this->renderHelper ('view/normal_view'); - } -} elseif ($output === 'rss') { - // token has already been checked in the controller so we can show the view - $this->renderHelper ('view/rss_view'); -} else { - // Normally, it should not happen, but log it anyway - Minz_Log::record ('Something is wrong in ' . __FILE__ . ' line ' . __LINE__, Minz_Log::ERROR); -} diff --git a/app/views/index/login.phtml b/app/views/index/login.phtml deleted file mode 100644 index cc814deff..000000000 --- a/app/views/index/login.phtml +++ /dev/null @@ -1 +0,0 @@ -<?php print_r ($this->res); ?> diff --git a/app/views/index/logout.phtml b/app/views/index/logout.phtml deleted file mode 100644 index a0aba9318..000000000 --- a/app/views/index/logout.phtml +++ /dev/null @@ -1 +0,0 @@ -OK
\ No newline at end of file diff --git a/app/views/index/logs.phtml b/app/views/index/logs.phtml index 1b77b39af..02256bd98 100644 --- a/app/views/index/logs.phtml +++ b/app/views/index/logs.phtml @@ -1,25 +1,25 @@ <div class="post content"> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> - <h1><?php echo Minz_Translate::t ('logs'); ?></h1> - <form method="post" action="<?php echo _url ('index', 'logs'); ?>"><p> + <h1><?php echo _t('index.log'); ?></h1> + <form method="post" action="<?php echo _url('index', 'logs'); ?>"><p> <input type="hidden" name="clearLogs" /> - <button type="submit" class="btn"><?php echo Minz_Translate::t ('clear_logs'); ?></button> + <button type="submit" class="btn"><?php echo _t('index.log.clear'); ?></button> </p></form> - <?php $items = $this->logsPaginator->items (); ?> + <?php $items = $this->logsPaginator->items(); ?> - <?php if (!empty ($items)) { ?> + <?php if (!empty($items)) { ?> <div class="logs"> - <?php $this->logsPaginator->render ('logs_pagination.phtml', 'page'); ?> + <?php $this->logsPaginator->render('logs_pagination.phtml', 'page'); ?> <?php foreach ($items as $log) { ?> - <div class="log <?php echo $log->level (); ?>"><span class="date"><?php echo @date ('Y-m-d H:i:s', @strtotime ($log->date ())); ?></span><?php echo htmlspecialchars ($log->info (), ENT_NOQUOTES, 'UTF-8'); ?></div> + <div class="log <?php echo $log->level(); ?>"><span class="date"><?php echo @date('Y-m-d H:i:s', @strtotime($log->date())); ?></span><?php echo htmlspecialchars($log->info(), ENT_NOQUOTES, 'UTF-8'); ?></div> <?php } ?> - <?php $this->logsPaginator->render ('logs_pagination.phtml','page'); ?> + <?php $this->logsPaginator->render('logs_pagination.phtml','page'); ?> </div> <?php } else { ?> - <p class="alert alert-warn"><?php echo Minz_Translate::t ('logs_empty'); ?></p> + <p class="alert alert-warn"><?php echo _t('index.log.empty'); ?></p> <?php } ?> </div> diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml new file mode 100644 index 000000000..f71abf158 --- /dev/null +++ b/app/views/index/normal.phtml @@ -0,0 +1,89 @@ +<?php + +$this->partial('aside_feed'); +$this->partial('nav_menu'); + +if (!empty($this->entries)) { + $display_today = true; + $display_yesterday = true; + $display_others = true; + $hidePosts = !FreshRSS_Context::$user_conf->display_posts; + $lazyload = FreshRSS_Context::$user_conf->lazyload; + $content_width = FreshRSS_Context::$user_conf->content_width; + + $today = @strtotime('today'); +?> + +<div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>"><?php + ?><div id="new-article"> + <a href="<?php echo Minz_Url::display(Minz_Request::currentRequest()); ?>"><?php echo _t('gen.js.new_article'); /* TODO: move string in JS*/ ?></a> + </div><?php + foreach ($this->entries as $item) { + $this->entry = Minz_ExtensionManager::callHook('entry_before_display', $item); + if (is_null($this->entry)) { + continue; + } + + // We most likely already have the feed object in cache + $this->feed = FreshRSS_CategoryDAO::findFeed($this->categories, $this->entry->feed()); + if ($this->feed == null) { + $this->feed = $this->entry->feed(true); + if ($this->feed == null) { + $this->feed = FreshRSS_Feed::example(); + } + } + + if ($display_today && $this->entry->isDay(FreshRSS_Days::TODAY, $today)) { + ?><div class="day" id="day_today"><?php + echo _t('gen.date.today'); + ?><span class="date"> — <?php echo timestamptodate(time(), false); ?></span><?php + ?><span class="name"><?php echo FreshRSS_Context::$name; ?></span><?php + ?></div><?php + $display_today = false; + } + if ($display_yesterday && $this->entry->isDay(FreshRSS_Days::YESTERDAY, $today)) { + ?><div class="day" id="day_yesterday"><?php + echo _t('gen.date.yesterday'); + ?><span class="date"> — <?php echo timestamptodate(time() - 86400, false); ?></span><?php + ?><span class="name"><?php echo FreshRSS_Context::$name; ?></span><?php + ?></div><?php + $display_yesterday = false; + } + if ($display_others && $this->entry->isDay(FreshRSS_Days::BEFORE_YESTERDAY, $today)) { + ?><div class="day" id="day_before_yesterday"><?php + echo _t('gen.date.before_yesterday'); + ?><span class="name"><?php echo FreshRSS_Context::$name; ?></span><?php + ?></div><?php + $display_others = false; + } + ?><div class="flux<?php echo !$this->entry->isRead() ? ' not_read' : ''; ?><?php echo $this->entry->isFavorite() ? ' favorite' : ''; ?>" id="flux_<?php echo $this->entry->id(); ?>"><?php + + $this->renderHelper('index/normal/entry_header'); + + ?><div class="flux_content"> + <div class="content <?php echo $content_width; ?>"> + <h1 class="title"><a target="_blank" href="<?php echo $this->entry->link(); ?>"><?php echo $this->entry->title(); ?></a></h1> + <?php + $author = $this->entry->author(); + echo $author != '' ? '<div class="author">' . _t('gen.short.by_author', $author) . '</div>' : '', + $lazyload && $hidePosts ? lazyimg($this->entry->content()) : $this->entry->content(); + ?> + </div><?php + + $this->renderHelper('index/normal/entry_bottom'); + + ?></div> + </div><?php + } + + $this->renderHelper('pagination'); +?></div> + +<?php $this->partial('nav_entries'); ?> + +<?php } else { ?> +<div id="stream" class="prompt alert alert-warn normal"> + <h2><?php echo _t('index.feed.empty'); ?></h2> + <a href="<?php echo _url('subscription', 'index'); ?>"><?php echo _t('index.feed.add'); ?></a><br /><br /> +</div> +<?php } ?> diff --git a/app/views/index/reader.phtml b/app/views/index/reader.phtml new file mode 100644 index 000000000..a19ee322e --- /dev/null +++ b/app/views/index/reader.phtml @@ -0,0 +1,47 @@ +<?php +$this->partial('nav_menu'); + +if (!empty($this->entries)) { + $lazyload = FreshRSS_Context::$user_conf->lazyload; + $content_width = FreshRSS_Context::$user_conf->content_width; +?> + +<div id="stream" class="reader"><?php + foreach ($this->entries as $item) { + $item = Minz_ExtensionManager::callHook('entry_before_display', $item); + if (is_null($item)) { + continue; + } + ?><div class="flux<?php echo !$item->isRead() ? ' not_read' : ''; ?><?php echo $item->isFavorite() ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id(); ?>"> + <div class="flux_content"> + <div class="content <?php echo $content_width; ?>"> + <?php + $feed = FreshRSS_CategoryDAO::findFeed($this->categories, $item->feed()); //We most likely already have the feed object in cache + if (empty($feed)) $feed = $item->feed(true); + ?> + <a href="<?php echo $item->link(); ?>"> + <img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span> + </a> + <h1 class="title"><?php echo $item->title(); ?></h1> + + <div class="author"><?php + $author = $item->author(); + echo $author != '' ? _t('gen.short.by_author', $author) . ' — ' : '', + $item->date(); + ?></div> + + <?php echo $item->content(); ?> + </div> + </div> + </div> + <?php } ?> + + <?php $this->renderHelper('pagination'); ?> +</div> + +<?php } else { ?> +<div id="stream" class="prompt alert alert-warn reader"> + <h2><?php echo _t('index.feed.empty'); ?></h2> + <a href="<?php echo _url('subscription', 'index'); ?>"><?php echo _t('index.feed.add'); ?></a><br /><br /> +</div> +<?php } ?> diff --git a/app/views/helpers/view/rss_view.phtml b/app/views/index/rss.phtml index 2c6ca610b..86074517c 100755 --- a/app/views/helpers/view/rss_view.phtml +++ b/app/views/index/rss.phtml @@ -3,25 +3,25 @@ <channel> <title><?php echo $this->rss_title; ?></title> <link><?php echo Minz_Url::display(null, 'html', true); ?></link> - <description><?php echo Minz_Translate::t ('rss_feeds_of', $this->rss_title); ?></description> + <description><?php echo _t('index.feed.rss_of', $this->rss_title); ?></description> <pubDate><?php echo date('D, d M Y H:i:s O'); ?></pubDate> <lastBuildDate><?php echo gmdate('D, d M Y H:i:s'); ?> GMT</lastBuildDate> - <atom:link href="<?php echo Minz_Url::display ($this->url, 'html', true); ?>" rel="self" type="application/rss+xml" /> + <atom:link href="<?php echo Minz_Url::display($this->url, 'html', true); ?>" rel="self" type="application/rss+xml" /> <?php foreach ($this->entries as $item) { ?> <item> - <title><?php echo $item->title (); ?></title> - <link><?php echo $item->link (); ?></link> - <?php $author = $item->author (); ?> + <title><?php echo $item->title(); ?></title> + <link><?php echo $item->link(); ?></link> + <?php $author = $item->author(); ?> <?php if ($author != '') { ?> <dc:creator><?php echo $author; ?></dc:creator> <?php } ?> <description><![CDATA[<?php - echo $item->content (); + echo $item->content(); ?>]]></description> - <pubDate><?php echo date('D, d M Y H:i:s O', $item->date (true)); ?></pubDate> - <guid isPermaLink="false"><?php echo $item->id (); ?></guid> + <pubDate><?php echo date('D, d M Y H:i:s O', $item->date(true)); ?></pubDate> + <guid isPermaLink="false"><?php echo $item->id(); ?></guid> </item> <?php } ?> diff --git a/app/views/javascript/actualize.phtml b/app/views/javascript/actualize.phtml index 74cef4998..454228909 100644 --- a/app/views/javascript/actualize.phtml +++ b/app/views/javascript/actualize.phtml @@ -9,7 +9,7 @@ var feeds = [<?php foreach ($this->feeds as $feed) { ?>{<?php function initProgressBar(init) { if (init) { $("body").after("\<div id=\"actualizeProgress\" class=\"notification good\">\ - <?php echo _t('refresh'); ?><br /><span class=\"title\">/</span><br />\ + <?php echo _t('feedback.sub.actualize'); ?><br /><span class=\"title\">/</span><br />\ <span class=\"progress\">0 / " + feed_count + "</span>\ </div>"); } else { @@ -23,7 +23,7 @@ function updateProgressBar(i, title_feed) { function updateFeeds() { if (feed_count === 0) { - openNotification("<?php echo _t('no_feed_to_refresh'); ?>", "good"); + openNotification("<?php echo _t('feedback.sub.feed.no_refresh'); ?>", "good"); ajax_loading = false; return; } diff --git a/app/views/stats/idle.phtml b/app/views/stats/idle.phtml index 6f3d4a117..22117792d 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('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> - <h1><?php echo _t('stats_idle'); ?></h1> + <h1><?php echo _t('admin.stats.idle'); ?></h1> <?php $current_url = urlencode(Minz_Url::display( @@ -16,7 +16,7 @@ $nothing = false; ?> <div class="stat"> - <h2><?php echo _t($period); ?></h2> + <h2><?php echo _t('gen.date.' . $period); ?></h2> <form id="form-delete" method="post" style="display: none"></form> @@ -24,13 +24,13 @@ <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('filter'); ?></a> - <a class="btn" href="<?php echo _url('configure', 'feed', 'id', $feed['id']); ?>"><?php echo _i('configure'); ?> <?php echo _t('administration'); ?></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('delete'); ?></button> + <a class="btn" href="<?php echo _url('index', 'index', 'get', 'f_' . $feed['id']); ?>"><?php echo _i('link'); ?> <?php echo _t('gen.action.filter'); ?></a> + <a class="btn" href="<?php echo _url('subscription', 'index', 'id', $feed['id']); ?>"><?php echo _i('configure'); ?> <?php echo _t('gen.action.manage'); ?></a> + <button class="btn btn-attention confirm" form="form-delete" formaction="<?php echo _url('feed', 'delete', 'id', $feed['id'], 'r', $current_url); ?>"><?php echo _t('gen.action.remove'); ?></button> </div> </li> <li class="item"> - <span title="<?php echo timestamptodate($feed['last_date'], false); ?>"><?php echo $feed['name']; ?> (<?php echo _t('number_articles', $feed['nb_articles']); ?>)</span> + <span title="<?php echo timestamptodate($feed['last_date'], false); ?>"><?php echo $feed['name']; ?> (<?php echo _t('admin.stats.number_entries', $feed['nb_articles']); ?>)</span> </li> </ul> <?php } ?> @@ -42,7 +42,7 @@ if ($nothing) { ?> <p class="alert alert-warn"> - <span class="alert-head"><?php echo _t('stats_no_idle'); ?></span> + <span class="alert-head"><?php echo _t('admin.stats.no_idle'); ?></span> </p> <?php } ?> </div> diff --git a/app/views/stats/index.phtml b/app/views/stats/index.phtml index fa57a77c0..18bcd4d99 100644 --- a/app/views/stats/index.phtml +++ b/app/views/stats/index.phtml @@ -1,82 +1,82 @@ <?php $this->partial('aside_stats'); ?> <div class="post"> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo _t ('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> - <h1><?php echo _t ('stats_main'); ?></h1> + <h1><?php echo _t('admin.stats.main'); ?></h1> <div class="stat half"> - <h2><?php echo _t ('stats_entry_repartition'); ?></h2> + <h2><?php echo _t('admin.stats.entry_repartition'); ?></h2> <table> <thead> <tr> <th> </th> - <th><?php echo _t ('main_stream'); ?></th> - <th><?php echo _t ('all_feeds'); ?></th> + <th><?php echo _t('admin.stats.main_stream'); ?></th> + <th><?php echo _t('admin.stats.all_feeds'); ?></th> </tr> </thead> <tbody> <tr> - <th><?php echo _t ('status_total'); ?></th> - <td class="numeric"><?php echo formatNumber($this->repartition['main_stream']['total']); ?></td> - <td class="numeric"><?php echo formatNumber($this->repartition['all_feeds']['total']); ?></td> + <th><?php echo _t('admin.stats.status_total'); ?></th> + <td class="numeric"><?php echo format_number($this->repartition['main_stream']['total']); ?></td> + <td class="numeric"><?php echo format_number($this->repartition['all_feeds']['total']); ?></td> </tr> <tr> - <th><?php echo _t ('status_read'); ?></th> - <td class="numeric"><?php echo formatNumber($this->repartition['main_stream']['read']); ?></td> - <td class="numeric"><?php echo formatNumber($this->repartition['all_feeds']['read']); ?></td> + <th><?php echo _t('admin.stats.status_read'); ?></th> + <td class="numeric"><?php echo format_number($this->repartition['main_stream']['read']); ?></td> + <td class="numeric"><?php echo format_number($this->repartition['all_feeds']['read']); ?></td> </tr> <tr> - <th><?php echo _t ('status_unread'); ?></th> - <td class="numeric"><?php echo formatNumber($this->repartition['main_stream']['unread']); ?></td> - <td class="numeric"><?php echo formatNumber($this->repartition['all_feeds']['unread']); ?></td> + <th><?php echo _t('admin.stats.status_unread'); ?></th> + <td class="numeric"><?php echo format_number($this->repartition['main_stream']['unread']); ?></td> + <td class="numeric"><?php echo format_number($this->repartition['all_feeds']['unread']); ?></td> </tr> <tr> - <th><?php echo _t ('status_favorites'); ?></th> - <td class="numeric"><?php echo formatNumber($this->repartition['main_stream']['favorite']); ?></td> - <td class="numeric"><?php echo formatNumber($this->repartition['all_feeds']['favorite']); ?></td> + <th><?php echo _t('admin.stats.status_favorites'); ?></th> + <td class="numeric"><?php echo format_number($this->repartition['main_stream']['favorite']); ?></td> + <td class="numeric"><?php echo format_number($this->repartition['all_feeds']['favorite']); ?></td> </tr> </tbody> </table> </div><!-- --><div class="stat half"> - <h2><?php echo _t ('stats_top_feed'); ?></h2> + <h2><?php echo _t('admin.stats.top_feed'); ?></h2> <table> <thead> <tr> - <th><?php echo _t ('feed'); ?></th> - <th><?php echo _t ('category'); ?></th> - <th><?php echo _t ('stats_entry_count'); ?></th> - <th><?php echo _t ('stats_percent_of_total'); ?></th> + <th><?php echo _t('admin.stats.feed'); ?></th> + <th><?php echo _t('admin.stats.category'); ?></th> + <th><?php echo _t('admin.stats.entry_count'); ?></th> + <th><?php echo _t('admin.stats.percent_of_total'); ?></th> </tr> </thead> <tbody> - <?php foreach ($this->topFeed as $feed): ?> + <?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 formatNumber($feed['count']); ?></td> - <td class="numeric"><?php echo formatNumber($feed['count'] / $this->repartition['all_feeds']['total'] * 100, 1);?></td> + <td class="numeric"><?php echo format_number($feed['count']); ?></td> + <td class="numeric"><?php echo format_number($feed['count'] / $this->repartition['all_feeds']['total'] * 100, 1);?></td> </tr> - <?php endforeach;?> + <?php } ?> </tbody> </table> </div> <div class="stat"> - <h2><?php echo _t ('stats_entry_per_day'); ?></h2> + <h2><?php echo _t('admin.stats.entry_per_day'); ?></h2> <div id="statsEntryPerDay" style="height: 300px"></div> </div> <div class="stat half"> - <h2><?php echo _t ('stats_feed_per_category'); ?></h2> + <h2><?php echo _t('admin.stats.feed_per_category'); ?></h2> <div id="statsFeedPerCategory" style="height: 300px"></div> <div id="statsFeedPerCategoryLegend"></div> </div><!-- --><div class="stat half"> - <h2><?php echo _t ('stats_entry_per_category'); ?></h2> + <h2><?php echo _t('admin.stats.entry_per_category'); ?></h2> <div id="statsEntryPerCategory" style="height: 300px"></div> <div id="statsEntryPerCategoryLegend"></div> </div> diff --git a/app/views/stats/repartition.phtml b/app/views/stats/repartition.phtml index 750a3ffdc..b20d9bbd0 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('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> - <h1><?php echo _t('stats_repartition'); ?></h1> + <h1><?php echo _t('admin.stats.repartition'); ?></h1> - <select id="feed_select"> - <option data-url="<?php echo _url('stats', 'repartition')?>"><?php echo _t('all_feeds')?></option> + <select id="feed_select" class="select-change"> + <option data-url="<?php echo _url('stats', 'repartition')?>"><?php echo _t('admin.stats.all_feeds')?></option> <?php foreach ($this->categories as $category) { $feeds = $category->feeds(); if (!empty($feeds)) { @@ -24,23 +24,40 @@ </select> <?php if ($this->feed) {?> - <a class="btn" href="<?php echo _url('configure', 'feed', 'id', $this->feed->id()); ?>"> - <?php echo _i('configure'); ?> <?php echo _t('administration'); ?> + <a class="btn" href="<?php echo _url('subscription', 'index', 'id', $this->feed->id()); ?>"> + <?php echo _i('configure'); ?> <?php echo _t('gen.action.manage'); ?> </a> <?php }?> <div class="stat"> - <h2><?php echo _t('stats_entry_per_hour'); ?></h2> + <table> + <tr> + <th><?php echo _t('admin.stats.status_total'); ?></th> + <th><?php echo _t('admin.stats.status_read'); ?></th> + <th><?php echo _t('admin.stats.status_unread'); ?></th> + <th><?php echo _t('admin.stats.status_favorites'); ?></th> + </tr> + <tr> + <td class="numeric"><?php echo $this->repartition['total']; ?></td> + <td class="numeric"><?php echo $this->repartition['read']; ?></td> + <td class="numeric"><?php echo $this->repartition['unread']; ?></td> + <td class="numeric"><?php echo $this->repartition['favorite']; ?></td> + </tr> + </table> + </div> + + <div class="stat"> + <h2><?php echo _t('admin.stats.entry_per_hour', $this->averageHour); ?></h2> <div id="statsEntryPerHour" style="height: 300px"></div> </div> <div class="stat half"> - <h2><?php echo _t('stats_entry_per_day_of_week'); ?></h2> + <h2><?php echo _t('admin.stats.entry_per_day_of_week', $this->averageDayOfWeek); ?></h2> <div id="statsEntryPerDayOfWeek" style="height: 300px"></div> </div><!-- --><div class="stat half"> - <h2><?php echo _t('stats_entry_per_month'); ?></h2> + <h2><?php echo _t('admin.stats.entry_per_month', $this->averageMonth); ?></h2> <div id="statsEntryPerMonth" style="height: 300px"></div> </div> </div> @@ -56,19 +73,10 @@ function initStats() { return; } // Entry per hour - var avg_h = []; - for (var i = -1; i <= 24; i++) { - avg_h.push([i, <?php echo $this->averageHour?>]); - } Flotr.draw(document.getElementById('statsEntryPerHour'), [{ data: <?php echo $this->repartitionHour ?>, bars: {horizontal: false, show: true} - }, { - data: avg_h, - lines: {show: true}, - label: "<?php echo $this->averageHour?>", - yaxis: 2 }], { grid: {verticalLines: false}, @@ -81,23 +89,13 @@ function initStats() { max: 23.9, tickDecimals: 0}, yaxis: {min: 0}, - y2axis: {showLabels: false}, mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return numberFormat(obj.y);}} }); // Entry per day of week - var avg_dow = []; - for (var i = -1; i <= 7; i++) { - avg_dow.push([i, <?php echo $this->averageDayOfWeek?>]); - } Flotr.draw(document.getElementById('statsEntryPerDayOfWeek'), [{ data: <?php echo $this->repartitionDayOfWeek ?>, bars: {horizontal: false, show: true} - }, { - data: avg_dow, - lines: {show: true}, - label: "<?php echo $this->averageDayOfWeek?>", - yaxis: 2 }], { grid: {verticalLines: false}, @@ -111,23 +109,13 @@ function initStats() { max: 6.9, tickDecimals: 0}, yaxis: {min: 0}, - y2axis: {showLabels: false}, mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return numberFormat(obj.y);}} }); // Entry per month - var avg_m = []; - for (var i = 0; i <= 13; i++) { - avg_m.push([i, <?php echo $this->averageMonth?>]); - } Flotr.draw(document.getElementById('statsEntryPerMonth'), [{ data: <?php echo $this->repartitionMonth ?>, bars: {horizontal: false, show: true} - }, { - data: avg_m, - lines: {show: true}, - label: "<?php echo $this->averageMonth?>", - yaxis: 2 }], { grid: {verticalLines: false}, @@ -141,7 +129,6 @@ function initStats() { max: 12.9, tickDecimals: 0}, yaxis: {min: 0}, - y2axis: {showLabels: false}, mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return numberFormat(obj.y);}} }); diff --git a/app/views/subscription/feed.phtml b/app/views/subscription/feed.phtml new file mode 100644 index 000000000..60664fdee --- /dev/null +++ b/app/views/subscription/feed.phtml @@ -0,0 +1,15 @@ +<?php + +if (!Minz_Request::param('ajax')) { + $this->partial('aside_subscription'); +} + +if ($this->feed) { + $this->renderHelper('feed/update'); +} else { +?> +<div class="alert alert-warn"> + <span class="alert-head"><?php echo _t('sub.feed.no_selected'); ?></span> + <?php echo _t('sub.feed.think_to_add'); ?> +</div> +<?php } ?> diff --git a/app/views/subscription/index.phtml b/app/views/subscription/index.phtml new file mode 100644 index 000000000..331e8244e --- /dev/null +++ b/app/views/subscription/index.phtml @@ -0,0 +1,148 @@ +<?php $this->partial('aside_subscription'); ?> + +<div class="post drop-section"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <h2><?php echo _t('sub.title'); ?></h2> + + <form id="add_rss" method="post" action="<?php echo _url('feed', 'add'); ?>" autocomplete="off"> + <div class="stick"> + <input type="url" name="url_rss" class="long" placeholder="<?php echo _t('sub.feed.add'); ?>" /> + <div class="dropdown"> + <div id="dropdown-cat" class="dropdown-target"></div> + + <a class="dropdown-toggle btn" href="#dropdown-cat"><?php echo _i('down'); ?></a> + <ul class="dropdown-menu"> + <li class="dropdown-close"><a href="#close">❌</a></li> + + <li class="dropdown-header"><?php echo _t('sub.category'); ?></li> + + <li class="input"> + <select name="category" id="category"> + <?php foreach ($this->categories as $cat) { ?> + <option value="<?php echo $cat->id(); ?>"<?php echo $cat->id() == 1 ? ' selected="selected"' : ''; ?>> + <?php echo $cat->name(); ?> + </option> + <?php } ?> + <option value="nc"><?php echo _t('sub.category.new'); ?></option> + </select> + </li> + + <li class="input" style="display:none"> + <input type="text" name="new_category[name]" id="new_category_name" autocomplete="off" placeholder="<?php echo _t('sub.category.new'); ?>" /> + </li> + + <li class="separator"></li> + + <li class="dropdown-header"><?php echo _t('sub.feed.auth.http'); ?></li> + <li class="input"> + <input type="text" name="http_user" id="http_user_add" autocomplete="off" placeholder="<?php echo _t('sub.feed.auth.username'); ?>" /> + </li> + <li class="input"> + <input type="password" name="http_pass" id="http_pass_add" autocomplete="off" placeholder="<?php echo _t('sub.feed.auth.password'); ?>" /> + </li> + </ul> + </div> + <button class="btn" type="submit"><?php echo _i('add'); ?></button> + </div> + </form> + + <p class="alert alert-warn"> + <?php echo _t('sub.feed.moved_category_deleted', $this->default_category->name()); ?> + </p> + + <div class="box"> + <div class="box-title"><label for="new-category"><?php echo _t('sub.category.add'); ?></label></div> + + <ul class="box-content box-content-centered"> + <form action="<?php echo _url('category', 'create'); ?>" method="post"> + <li class="item"><input type="text" id="new-category" name="new-category" placeholder="<?php echo _t('sub.category.new'); ?>" /></li> + <li class="item"><button class="btn btn-important" type="submit"><?php echo _t('gen.action.submit'); ?></button></li> + </form> + </ul> + </div> + + <form id="controller-category" method="post" style="display: none;"></form> + + <?php + foreach ($this->categories as $cat) { + $feeds = $cat->feeds(); + ?> + <div class="box"> + <div class="box-title"> + <form action="<?php echo _url('category', 'update', 'id', $cat->id()); ?>" method="post"> + <input type="text" name="name" value="<?php echo $cat->name(); ?>" /> + + <div class="dropdown"> + <div id="dropdown-cat-<?php echo $cat->id(); ?>" class="dropdown-target"></div> + + <a class="dropdown-toggle btn" href="#dropdown-cat-<?php echo $cat->id(); ?>"><?php echo _i('down'); ?></a> + <ul class="dropdown-menu"> + <li class="dropdown-close"><a href="#close">❌</a></li> + + <li class="item"><a href="<?php echo _url('index', 'index', 'get', 'c_' . $cat->id()); ?>"><?php echo _t('gen.action.filter'); ?></a></li> + + <?php + $no_feed = empty($feeds); + $is_default = ($cat->id() === $this->default_category->id()); + + if (!$no_feed || !$is_default) { + ?> + <li class="separator"></li> + <?php } if (!$no_feed) { ?> + <li class="item"> + <button class="as-link confirm" + data-str-confirm="<?php echo _t('gen.js.confirm_action_feed_cat'); ?>" + type="submit" + form="controller-category" + formaction="<?php echo _url('category', 'empty', 'id', $cat->id()); ?>"> + <?php echo _t('gen.action.empty'); ?></button> + </li> + <?php } if (!$is_default) { ?> + <li class="item"> + <button class="as-link confirm" + data-str-confirm="<?php echo _t('gen.js.confirm_action_feed_cat'); ?>" + type="submit" + form="controller-category" + formaction="<?php echo _url('category', 'delete', 'id', $cat->id()); ?>"> + <?php echo _t('gen.action.remove'); ?></button> + </li> + <?php } ?> + </ul> + </div> + </form> + </div> + + <ul class="box-content" data-cat-id="<?php echo $cat->id(); ?>"> + <?php if (!empty($feeds)) { ?> + <?php + foreach ($feeds as $feed) { + $error = $feed->inError() ? ' error' : ''; + $empty = $feed->nbEntries() == 0 ? ' empty' : ''; + ?> + <li class="item feed<?php echo $error, $empty; ?>" + draggable="true" + data-feed-id="<?php echo $feed->id(); ?>" + dropzone="move"> + <a class="configure open-slider" href="<?php echo _url('subscription', 'feed', 'id', $feed->id()); ?>"><?php echo _i('configure'); ?></a> + <img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" /> <?php echo $feed->name(); ?> + </li> + <?php } + } else { + ?> + <li class="item disabled" dropzone="move"><?php echo _t('sub.category.empty'); ?></li> + <?php } ?> + </ul> + </div> + <?php } ?> +</div> + +<?php $class = isset($this->feed) ? ' class="active"' : ''; ?> +<a href="#" id="close-slider"<?php echo $class; ?>></a> +<div id="slider"<?php echo $class; ?>> +<?php + if (isset($this->feed)) { + $this->renderHelper('feed/update'); + } +?> +</div> diff --git a/app/views/update/apply.phtml b/app/views/update/apply.phtml index 30566c7ab..8221929ae 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('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> - <h1><?php echo _t('update_system'); ?></h1> + <h1><?php echo _t('admin.update'); ?></h1> <?php ask_info_update(); ?> </div> diff --git a/app/views/update/checkInstall.phtml b/app/views/update/checkInstall.phtml new file mode 100644 index 000000000..a92860c7e --- /dev/null +++ b/app/views/update/checkInstall.phtml @@ -0,0 +1,38 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <h2><?php echo _t('admin.check_install.php'); ?></h2> + + <?php foreach ($this->status_php as $key => $status) { ?> + <p class="alert <?php echo $status ? 'alert-success' : 'alert-error'; ?>"> + <?php + if ($key === 'php') { + echo _t('admin.check_install.' . $key . '.' . ($status ? 'ok' : 'nok'), PHP_VERSION, '5.2.1'); + } else { + echo _t('admin.check_install.' . $key . '.' . ($status ? 'ok' : 'nok')); + } + ?> + </p> + <?php } ?> + + <h2><?php echo _t('admin.check_install.files'); ?></h2> + + <?php foreach ($this->status_files as $key => $status) { ?> + <p class="alert <?php echo $status ? 'alert-success' : 'alert-error'; ?>"> + <?php echo _t('admin.check_install.' . $key . '.' . ($status ? 'ok' : 'nok')); ?> + </p> + <?php } ?> + + <?php /* + <h2><?php echo _t('admin.check_install.database'); ?></h2> + + <?php foreach ($this->status_database as $key => $status) { ?> + <p class="alert <?php echo $status ? 'alert-success' : 'alert-error'; ?>"> + <?php echo _t('admin.check_install.' . $key . '.' . ($status ? 'ok' : 'nok')); ?> + </p> + <?php } ?> + */ ?> + +</div> diff --git a/app/views/update/index.phtml b/app/views/update/index.phtml index 401f6acd6..da1bc7ef5 100644 --- a/app/views/update/index.phtml +++ b/app/views/update/index.phtml @@ -1,12 +1,16 @@ <?php $this->partial('aside_configure'); ?> <div class="post"> - <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> - <h1><?php echo _t('update_system'); ?></h1> + <h1><?php echo _t('admin.update'); ?></h1> <p> - <?php echo _i('help'); ?> <?php echo _t('update_last', $this->last_update_time); ?> + <?php echo _i('help'); ?> <?php echo _t('admin.update.current_version', FRESHRSS_VERSION); ?> + </p> + + <p> + <?php echo _t('admin.update.last', $this->last_update_time); ?> </p> <?php if (!empty($this->message)) { ?> @@ -14,23 +18,17 @@ <span class="alert-head"><?php echo $this->message['title']; ?></span> <?php echo $this->message['body']; ?> </p> - <?php } elseif ($this->check_last_hour) { ?> - <p class="alert alert-warn"> - <span class="alert-head"><?php echo _t('damn'); ?></span> - <?php echo _t('no_update'); ?> - </p> <?php } ?> <?php - if (!$this->check_last_hour && - (empty($this->message) || $this->message['status'] !== 'good')) { + if (empty($this->message) || $this->message['status'] !== 'good') { ?> <p> - <a href="<?php echo _url('update', 'check'); ?>" class="btn"><?php echo _t('update_check'); ?></a> + <a href="<?php echo _url('update', 'check'); ?>" class="btn"><?php echo _t('admin.update.check'); ?></a> </p> <?php } ?> <?php if ($this->update_to_apply) { ?> - <a class="btn btn-important" href="<?php echo _url('update', 'apply'); ?>"><?php echo _t('update_apply'); ?></a> + <a class="btn btn-important" href="<?php echo _url('update', 'apply'); ?>"><?php echo _t('admin.update.apply'); ?></a> <?php } ?> </div> diff --git a/app/views/user/manage.phtml b/app/views/user/manage.phtml new file mode 100644 index 000000000..fe1b6618b --- /dev/null +++ b/app/views/user/manage.phtml @@ -0,0 +1,80 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <form method="post" action="<?php echo _url('user', 'create'); ?>"> + <legend><?php echo _t('admin.user.create'); ?></legend> + + <div class="form-group"> + <label class="group-name" for="new_user_language"><?php echo _t('admin.user.language'); ?></label> + <div class="group-controls"> + <select name="new_user_language" id="new_user_language"> + <?php $languages = Minz_Translate::availableLanguages(); ?> + <?php foreach ($languages as $lang) { ?> + <option value="<?php echo $lang; ?>"<?php echo FreshRSS_Context::$user_conf->language === $lang ? ' selected="selected"' : ''; ?>><?php echo _t('gen.lang.' . $lang); ?></option> + <?php } ?> + </select> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="new_user_name"><?php echo _t('admin.user.username'); ?></label> + <div class="group-controls"> + <input id="new_user_name" name="new_user_name" type="text" size="16" required="required" maxlength="16" autocomplete="off" pattern="[0-9a-zA-Z]{1,16}" placeholder="demo" /> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="new_user_passwordPlain"><?php echo _t('admin.user.password_form'); ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="password" id="new_user_passwordPlain" name="new_user_passwordPlain" autocomplete="off" pattern=".{7,}" /> + <a class="btn toggle-password" data-toggle="new_user_passwordPlain"><?php echo _i('key'); ?></a> + </div> + <?php echo _i('help'); ?> <?php echo _t('admin.user.password_format'); ?> + <noscript><b><?php echo _t('gen.js.should_be_activated'); ?></b></noscript> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="new_user_email"><?php echo _t('admin.user.email_persona'); ?></label> + <?php $mail = FreshRSS_Context::$user_conf->mail_login; ?> + <div class="group-controls"> + <input type="email" id="new_user_email" name="new_user_email" class="extend" autocomplete="off" placeholder="alice@example.net" /> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.create'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> + </div> + </div> + </form> + + <form method="post" action="<?php echo _url('user', 'delete'); ?>"> + <legend><?php echo _t('admin.user.users'); ?></legend> + + <div class="form-group"> + <label class="group-name" for="user-list"><?php echo _t('admin.user.user_list'); ?></label> + <div class="group-controls"> + <select id="user-list" class="select-change" name="username"> + <?php foreach (listUsers() as $username) { ?> + <option data-url="<?php echo _url('user', 'manage', 'u', $username); ?>" <?php echo $this->current_user === $username ? 'selected="selected"' : ''; ?> value="<?php echo $username; ?>"><?php echo $username; ?></option> + <?php } ?> + </select> + + <p><?php echo _t('admin.user.articles_and_size', + format_number($this->nb_articles), + format_bytes($this->size_user)); ?></p> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-attention confirm"><?php echo _t('gen.action.remove'); ?></button> + </div> + </div> + </form> +</div> diff --git a/app/views/user/profile.phtml b/app/views/user/profile.phtml new file mode 100644 index 000000000..c44202edd --- /dev/null +++ b/app/views/user/profile.phtml @@ -0,0 +1,60 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <form method="post" action="<?php echo _url('user', 'profile'); ?>"> + <legend><?php echo _t('conf.profile'); ?></legend> + + <div class="form-group"> + <label class="group-name" for="current_user"><?php echo _t('conf.user.current'); ?></label> + <div class="group-controls"> + <input id="current_user" type="text" disabled="disabled" value="<?php echo Minz_Session::param('currentUser', '_'); ?>" /> + <label class="checkbox" for="is_admin"> + <input type="checkbox" id="is_admin" disabled="disabled" <?php echo FreshRSS_Auth::hasAccess('admin') ? 'checked="checked" ' : ''; ?>/> + <?php echo _t('conf.user.is_admin'); ?> + </label> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="passwordPlain"><?php echo _t('conf.profile.password_form'); ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="password" id="passwordPlain" name="passwordPlain" autocomplete="off" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/> + <a class="btn toggle-password" data-toggle="passwordPlain"><?php echo _i('key'); ?></a> + </div> + <?php echo _i('help'); ?> <?php echo _t('conf.profile.password_format'); ?> + <noscript><b><?php echo _t('gen.js.should_be_activated'); ?></b></noscript> + </div> + </div> + + <?php if (FreshRSS_Context::$system_conf->api_enabled) { ?> + <div class="form-group"> + <label class="group-name" for="apiPasswordPlain"><?php echo _t('conf.profile.password_api'); ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="password" id="apiPasswordPlain" name="apiPasswordPlain" autocomplete="off" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/> + <a class="btn toggle-password" data-toggle="apiPasswordPlain"><?php echo _i('key'); ?></a> + </div> + </div> + </div> + <?php } ?> + + <div class="form-group"> + <label class="group-name" for="mail_login"><?php echo _t('conf.profile.email_persona'); ?></label> + <?php $mail = FreshRSS_Context::$user_conf->mail_login; ?> + <div class="group-controls"> + <input type="email" id="mail_login" name="mail_login" class="extend" autocomplete="off" value="<?php echo $mail; ?>" <?php echo FreshRSS_Auth::hasAccess('admin') ? '' : 'disabled="disabled"'; ?> placeholder="alice@example.net" /> + <noscript><b><?php echo _t('gen.js.should_be_activated'); ?></b></noscript> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> + </div> + </div> + </form> +</div> |
