diff options
| author | 2017-02-15 14:14:03 +0100 | |
|---|---|---|
| committer | 2017-02-15 14:14:03 +0100 | |
| commit | 5a1bb1393b4496eb35a2ffb3cc63d41c9dc1e2e5 (patch) | |
| tree | 67028e45792c575c25c92616633f64cc7a4a13eb /app/views | |
| parent | 7e949d50320317b5c3b5a2da2bdaf324e794b2f7 (diff) | |
| parent | 5f637bd816b7323885bfe1751a1724ee59a822f6 (diff) | |
Merge remote-tracking branch 'FreshRSS/master'
Diffstat (limited to 'app/views')
59 files changed, 2348 insertions, 1377 deletions
diff --git a/app/views/auth/formLogin.phtml b/app/views/auth/formLogin.phtml new file mode 100644 index 000000000..a8213b7ae --- /dev/null +++ b/app/views/auth/formLogin.phtml @@ -0,0 +1,33 @@ +<div class="prompt"> + <h1><?php echo _t('gen.auth.login'); ?></h1> + + <?php if (!max_registrations_reached()) { ?> + <a href="<?php echo _url('auth', 'register'); ?>"><?php echo _t('gen.auth.registration.ask'); ?></a> + <?php } ?> + + <form id="crypto-form" method="post" action="<?php echo _url('auth', 'login'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <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', $this->cookie_days); ?> + </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..010eae33f --- /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'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <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" data-leave-validation="<?php echo FreshRSS_Context::$system_conf->auth_type; ?>"> + <?php if (!in_array(FreshRSS_Context::$system_conf->auth_type, array('form', 'http_auth', 'none'))) { ?> + <option selected="selected"></option> + <?php } ?> + <option value="form"<?php echo FreshRSS_Context::$system_conf->auth_type === 'form' ? ' selected="selected"' : '', cryptAvailable() ? '' : ' disabled="disabled"'; ?>><?php echo _t('admin.auth.form'); ?></option> + <option value="http_auth"<?php echo FreshRSS_Context::$system_conf->auth_type === 'http_auth' ? ' selected="selected"' : '', httpAuthUser() == '' ? ' disabled="disabled"' : ''; ?>><?php echo _t('admin.auth.http'); ?> (REMOTE_USER = '<?php echo httpAuthUser(); ?>')</option> + <option value="none"<?php echo FreshRSS_Context::$system_conf->auth_type === 'none' ? ' selected="selected"' : ''; ?>><?php echo _t('admin.auth.none'); ?></option> + </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"'; ?> data-leave-validation="<?php echo FreshRSS_Context::$system_conf->allow_anonymous; ?>"/> + <?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"'; ?> data-leave-validation="<?php echo FreshRSS_Context::$system_conf->allow_anonymous_refresh; ?>"/> + <?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"'; ?> data-leave-validation="<?php echo FreshRSS_Context::$system_conf->unsafe_autologin_enabled; ?>"/> + <?php echo _t('admin.auth.unsafe_autologin'); ?> + <kbd><?php echo Minz_Url::display(array('c' => 'auth', 'a' => 'login', 'params' => array('u' => 'alice', 'p' => '1234')), 'html', true); ?></kbd> + </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"'; ?> data-leave-validation="<?php echo $token; ?>"/> + <?php echo _i('help'); ?> <?php echo _t('admin.auth.token_help'); ?> + <kbd><?php echo Minz_Url::display(array('a' => 'rss', 'params' => array('token' => $token, 'hours' => FreshRSS_Context::$user_conf->since_hours_posts_per_rss)), '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"'; ?> data-leave-validation="<?php echo FreshRSS_Context::$system_conf->api_enabled; ?>"/> + <?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/register.phtml b/app/views/auth/register.phtml new file mode 100644 index 000000000..1f9976391 --- /dev/null +++ b/app/views/auth/register.phtml @@ -0,0 +1,34 @@ +<div class="prompt"> + <h1><?php echo _t('gen.auth.registration'); ?></h1> + + <form method="post" action="<?php echo _url('user', 'create'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <div> + <label class="group-name" for="new_user_name"><?php echo _t('gen.auth.username'), '<br />', _i('help'), ' ', _t('gen.auth.username.format'); ?></label> + <input id="new_user_name" name="new_user_name" type="text" size="16" required="required" maxlength="16" autocomplete="off" pattern="[0-9a-zA-Z]{1,16}" /> + </div> + + <div> + <label class="group-name" for="new_user_passwordPlain"><?php echo _t('gen.auth.password'), '<br />', _i('help'), ' ', _t('gen.auth.password.format'); ?></label> + <div class="stick"> + <input type="password" id="new_user_passwordPlain" name="new_user_passwordPlain" required="required" autocomplete="off" pattern=".{7,}" /> + <a class="btn toggle-password" data-toggle="new_user_passwordPlain"><?php echo _i('key'); ?></a> + </div> + <noscript><b><?php echo _t('gen.js.should_be_activated'); ?></b></noscript> + </div> + + <div> + <?php + $redirect_url = urlencode(Minz_Url::display( + array('c' => 'index', 'a' => 'index'), + 'php', true + )); + ?> + <input type="hidden" name="r" value="<?php echo $redirect_url; ?>" /> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.create'); ?></button> + <a class="btn" href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.cancel'); ?></a> + </div> + </form> + + <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('gen.freshrss.about'); ?></a></p> +</div> diff --git a/app/views/configure/archiving.phtml b/app/views/configure/archiving.phtml index e144d0f45..2254f5dba 100644 --- a/app/views/configure/archiving.phtml +++ b/app/views/configure/archiving.phtml @@ -1,56 +1,84 @@ <?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> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('conf.archiving'); ?></legend> + <p><?php echo _i('help'); ?> <?php echo _t('conf.archiving.help'); ?></p> <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; ?>" data-leave-validation="<?php echo FreshRSS_Context::$user_conf->old_entries; ?>"/> <?php echo _t('gen.date.month'); ?> + <a class="btn confirm" href="<?php echo _url('entry', 'purge'); ?>"><?php echo _t('conf.archiving.purge_now'); ?></a> </div> </div> <div class="form-group"> - <label class="group-name" for="keep_history_default"><?php echo 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 + <select class="number" name="keep_history_default" id="keep_history_default" required="required" data-leave-validation="<?php echo FreshRSS_Context::$user_conf->keep_history_default; ?>"><?php foreach (array('' => '', 0 => '0', 10 => '10', 50 => '50', 100 => '100', 500 => '500', 1000 => '1 000', 5000 => '5 000', 10000 => '10 000', -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 _t('conf.archiving.ttl'); ?></label> + <div class="group-controls"> + <select class="number" name="ttl_default" id="ttl_default" required="required" data-leave-validation="<?php echo FreshRSS_Context::$user_conf->ttl_default; ?>"><?php + $found = false; + foreach (array(1200 => '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min', + 3600 => '1h', 5400 => '1.5h', 7200 => '2h', 10800 => '3h', 14400 => '4h', 18800 => '5h', 21600 => '6h', 25200 => '7h', 28800 => '8h', + 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 . (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(FreshRSS_Context::$user_conf->ttl_default) . '" selected="selected">' . intval(FreshRSS_Context::$user_conf->ttl_default) . 's</option>'; + } + ?></select> (<?php echo _t('gen.short.by_default'); ?>) </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> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <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 a564e8cdd..000000000 --- a/app/views/configure/categorize.phtml +++ /dev/null @@ -1,47 +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"> - <input type="text" id="cat_<?php echo $cat->id (); ?>" name="categories[]" value="<?php echo $cat->name (); ?>" /> - - <?php if ($cat->nbFeed () > 0) { ?> - <a class="confirm" href="<?php echo _url ('feed', 'delete', 'id', $cat->id (), 'type', 'category'); ?>"><?php echo Minz_Translate::t ('ask_empty'); ?></a> - <?php } ?> - (<?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 9104e4ef1..62ecc1080 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -1,194 +1,123 @@ -<?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 ('theme'); ?></legend> + <form method="post" action="<?php echo _url('configure', 'display'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('conf.display'); ?></legend> <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> + <select name="language" id="language" data-leave-validation="<?php echo FreshRSS_Context::$user_conf->language; ?>"> + <?php $languages = Minz_Translate::availableLanguages(); ?> + <?php foreach ($languages as $lang) { ?> + <option value="<?php echo $lang; ?>"<?php echo FreshRSS_Context::$user_conf->language === $lang ? ' selected="selected"' : ''; ?>><?php echo _t('gen.lang.' . $lang); ?></option> <?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> - </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 ('reading_configuration'); ?></legend> - - <div class="form-group"> - <label class="group-name" for="posts_per_page"><?php echo Minz_Translate::t ('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; ?>" /> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="sort_order"><?php echo Minz_Translate::t ('sort_order'); ?></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> - </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'] ?>" data-leave-validation="<?php echo (FreshRSS_Context::$user_conf->theme === $theme['id']) ? 1 : 0; ?>"/> + <li class="slide-container"> + <div class="slide"> + <img src="<?php echo Minz_Url::display('/themes/' . $theme['id'] . '/thumbs/original.png')?>"/> + </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 = FreshRSS_Context::$user_conf->content_width; ?> <div class="form-group"> - <label class="group-name" for="view_mode"><?php echo Minz_Translate::t ('default_view'); ?></label> + <label class="group-name" for="content_width"><?php echo _t('conf.display.width.content'); ?></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> + <select name="content_width" id="content_width" required="" data-leave-validation="<?php echo $width; ?>"> + <option value="thin" <?php echo $width === 'thin'? 'selected="selected"' : ''; ?>> + <?php echo _t('conf.display.width.thin'); ?> + </option> + <option value="medium" <?php echo $width === 'medium'? 'selected="selected"' : ''; ?>> + <?php echo _t('conf.display.width.medium'); ?> + </option> + <option value="large" <?php echo $width === 'large'? 'selected="selected"' : ''; ?>> + <?php echo _t('conf.display.width.large'); ?> + </option> + <option value="no_limit" <?php echo $width === 'no_limit'? 'selected="selected"' : ''; ?>> + <?php echo _t('conf.display.width.no_limit'); ?> + </option> </select> - <label class="radio" for="radio_all"> - <input type="radio" name="default_view" id="radio_all" value="all"<?php echo $this->conf->default_view === 'all' ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('show_all_articles'); ?> - </label> - <label class="radio" for="radio_not_read"> - <input type="radio" name="default_view" id="radio_not_read" value="not_read"<?php echo $this->conf->default_view === 'not_read' ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('show_not_reads'); ?> - </label> </div> </div> <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> - </label> - </div> - </div> - - <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> - </label> - </div> - </div> - - <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> - </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="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_selected'); ?> - </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'); ?> - </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'); ?> - </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'); ?> - </label> - </div> - </div> - - <div class="form-group"> - <label class="group-name"><?php echo Minz_Translate::t ('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'); ?> - </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> - - <legend><?php echo Minz_Translate::t ('reading_icons'); ?></legend> - <div class="form-group"> + <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"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->topline_read; ?>"/></td> + <td><input type="checkbox" name="topline_favorite" value="1"<?php echo FreshRSS_Context::$user_conf->topline_favorite ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->topline_favorite; ?>"/></td> <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"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->topline_date; ?>"/></td> + <td><input type="checkbox" name="topline_link" value="1"<?php echo FreshRSS_Context::$user_conf->topline_link ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->topline_link; ?>"/></td> </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"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->bottomline_read; ?>"/></td> + <td><input type="checkbox" name="bottomline_favorite" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_favorite ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->bottomline_favorite; ?>"/></td> + <td><input type="checkbox" name="bottomline_sharing" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_sharing ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->bottomline_sharing; ?>"/></td> + <td><input type="checkbox" name="bottomline_tags" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_tags ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->bottomline_tags; ?>"/></td> + <td><input type="checkbox" name="bottomline_date" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_date ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->bottomline_date; ?>"/></td> + <td><input type="checkbox" name="bottomline_link" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_link ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->bottomline_link; ?>"/></td> </tr> </tbody> </table><br /> </div> + + <div class="form-group"> + <label class="group-name" for="html5_notif_timeout"><?php echo _t('conf.display.notif_html5.timeout'); ?></label> + <div class="group-controls"> + <input type="number" id="html5_notif_timeout" name="html5_notif_timeout" value="<?php echo FreshRSS_Context::$user_conf->html5_notif_timeout; ?>" data-leave-validation="<?php echo FreshRSS_Context::$user_conf->html5_notif_timeout; ?>"/> <?php echo _t('conf.display.notif_html5.seconds'); ?> + </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 2da04ac2d..000000000 --- a/app/views/configure/feed.phtml +++ /dev/null @@ -1,150 +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"> - <input type="text" name="website" id="website" class="extend" value="<?php echo $this->flux->website (); ?>" /> - <a target="_blank" href="<?php echo $this->flux->website (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="url"><?php echo Minz_Translate::t ('feed_url'); ?></label> - <div class="group-controls"> - <input type="text" name="url" id="url" class="extend" value="<?php echo $this->flux->url (); ?>" /> - <a target="_blank" href="<?php echo $this->flux->url (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> - <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 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' => 'delete', 'params' => array ('id' => $this->flux->id ()))); ?>"><?php echo Minz_Translate::t ('delete'); ?></button> - </div> - </div> - - <legend><?php echo Minz_Translate::t ('archiving_configuration'); ?></legend> - - <div class="form-group"> - <label class="group-name"></label> - <div class="group-controls"> - <a class="btn" href="<?php echo _url ('feed', 'actualize', 'id', $this->flux->id ()); ?>"> - <?php echo FreshRSS_Themes::icon('refresh'); ?> <?php echo Minz_Translate::t('actualize'); ?> - </a> - </div> - </div> - <div class="form-group"> - <label class="group-name"><?php echo Minz_Translate::t ('number_articles'); ?></label> - <div class="group-controls"> - <span class="control"><?php echo $nbEntries; ?></span> - </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 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/importExport.phtml b/app/views/configure/importExport.phtml deleted file mode 100644 index e2217d9ed..000000000 --- a/app/views/configure/importExport.phtml +++ /dev/null @@ -1,40 +0,0 @@ -<?php -require_once(LIB_PATH . '/lib_opml.php'); -if ($this->req == 'export') { - echo '<?xml version="1.0" encoding="UTF-8" ?>'; -?> -<!-- Generated by <?php echo Minz_Configuration::title (); ?> --> -<opml version="2.0"> - <head> - <title><?php echo Minz_Configuration::title (); ?> OPML Feed</title> - <dateCreated><?php echo date('D, d M Y H:i:s'); ?></dateCreated> - </head> - <body> -<?php echo opml_export ($this->categories); ?> - </body> -</opml> -<?php } else { ?> -<?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 Minz_Url::display (array ('c' => 'configure', 'a' => 'importExport', 'params' => array ('q' => 'import'))); ?>" enctype="multipart/form-data"> - <legend><?php echo Minz_Translate::t ('import_export_opml'); ?></legend> - <div class="form-group"> - <label class="group-name" for="file"><?php echo Minz_Translate::t ('file_to_import'); ?></label> - <div class="group-controls"> - <input type="file" name="file" id="file" /> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('import'); ?></button> - <?php echo Minz_Translate::t ('or'); ?> - <a target="_blank" class="btn btn-important" href="<?php echo _url ('configure', 'importExport', 'q', 'export'); ?>"><?php echo Minz_Translate::t ('export'); ?></a> - </div> - </div> - </form> -</div> -<?php } ?> diff --git a/app/views/configure/queries.phtml b/app/views/configure/queries.phtml new file mode 100644 index 000000000..0dffa268d --- /dev/null +++ b/app/views/configure/queries.phtml @@ -0,0 +1,88 @@ +<?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('configure', 'queries'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('conf.query'); ?></legend> + + <?php foreach ($this->queries as $key => $query) { ?> + <div class="form-group" id="query-group-<?php echo $key; ?>"> + <label class="group-name" for="queries_<?php echo $key; ?>_name"> + <?php echo _t('conf.query.number', $key + 1); ?> + </label> + + <div class="group-controls"> + <input type="hidden" id="queries_<?php echo $key; ?>_search" name="queries[<?php echo $key; ?>][url]" value="<?php echo $query->getUrl(); ?>"/> + <input type="hidden" id="queries_<?php echo $key; ?>_search" name="queries[<?php echo $key; ?>][search]" value="<?php echo $query->getSearch(); ?>"/> + <input type="hidden" id="queries_<?php echo $key; ?>_state" name="queries[<?php echo $key; ?>][state]" value="<?php echo $query->getState(); ?>"/> + <input type="hidden" id="queries_<?php echo $key; ?>_order" name="queries[<?php echo $key; ?>][order]" value="<?php echo $query->getOrder(); ?>"/> + <input type="hidden" id="queries_<?php echo $key; ?>_get" name="queries[<?php echo $key; ?>][get]" value="<?php echo $query->getGet(); ?>"/> + + <div class="stick"> + <input class="extend" + type="text" + id="queries_<?php echo $key; ?>_name" + name="queries[<?php echo $key; ?>][name]" + value="<?php echo $query->getName(); ?>" + data-leave-validation="<?php echo $query->getName(); ?>" + /> + + <a class="btn" href="<?php echo $query->getUrl(); ?>"> + <?php echo _i('link'); ?> + </a> + + <a class="btn btn-attention remove" href="#" data-remove="query-group-<?php echo $key; ?>"> + <?php echo _i('close'); ?> + </a> + </div> + + <?php if (!$query->hasParameters()) { ?> + <div class="alert alert-warn"> + <div class="alert-head"><?php echo _t('conf.query.no_filter'); ?></div> + </div> + <?php } elseif ($query->isDeprecated()) { ?> + <div class="alert alert-error"> + <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('conf.query.filter'); ?></div> + + <ul> + <?php if ($query->hasSearch()) { ?> + <li class="item"><?php echo _t('conf.query.search', $query->getSearch()->getRawInput()); ?></li> + <?php } ?> + + <?php if ($query->getState()) { ?> + <li class="item"><?php echo _t('conf.query.state_' . $query->getState()); ?></li> + <?php } ?> + + <?php if ($query->getOrder()) { ?> + <li class="item"><?php echo _t('conf.query.order_' . strtolower($query->getOrder())); ?></li> + <?php } ?> + + <?php if ($query->getGet()) { ?> + <li class="item"><?php echo _t('conf.query.get_' . $query->getGetType(), $query->getGetName()); ?></li> + <?php } ?> + </ul> + </div> + <?php } ?> + </div> + </div> + <?php } ?> + + <?php if (count(FreshRSS_Context::$user_conf->queries) > 0) { ?> + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> + </div> + </div> + <?php } else { ?> + <p class="alert alert-warn"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('conf.query.none'); ?></p> + <?php } ?> + </form> + +</div>
\ No newline at end of file diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml new file mode 100644 index 000000000..07dabf15f --- /dev/null +++ b/app/views/configure/reading.phtml @@ -0,0 +1,178 @@ +<?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('configure', 'reading'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('conf.reading'); ?></legend> + + <div class="form-group"> + <label class="group-name" for="posts_per_page"><?php echo _t('conf.reading.articles_per_page'); ?></label> + <div class="group-controls"> + <input type="number" id="posts_per_page" name="posts_per_page" value="<?php echo FreshRSS_Context::$user_conf->posts_per_page; ?>" min="5" max="500" data-leave-validation="<?php echo FreshRSS_Context::$user_conf->posts_per_page; ?>"/> + <?php echo _i('help'); ?> <?php echo _t('conf.reading.number_divided_when_reader'); ?> + </div> + </div> + + <div class="form-group"> + <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" data-leave-validation="<?php echo FreshRSS_Context::$user_conf->sort_order; ?>"> + <option value="DESC"<?php echo FreshRSS_Context::$user_conf->sort_order === 'DESC' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.sort.newer_first'); ?></option> + <option value="ASC"<?php echo FreshRSS_Context::$user_conf->sort_order === 'ASC' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.sort.older_first'); ?></option> + </select> + </div> + </div> + + <div class="form-group"> + <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" data-leave-validation="<?php echo FreshRSS_Context::$user_conf->view_mode; ?>"> + <option value="normal"<?php echo FreshRSS_Context::$user_conf->view_mode === 'normal' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.view.normal'); ?></option> + <option value="reader"<?php echo FreshRSS_Context::$user_conf->view_mode === 'reader' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.view.reader'); ?></option> + <option value="global"<?php echo FreshRSS_Context::$user_conf->view_mode === 'global' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.view.global'); ?></option> + </select> + </div> + </div> + + <div class="form-group"> + <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" data-leave-validation="<?php echo FreshRSS_Context::$user_conf->default_view; ?>"> + <option value="adaptive"<?php echo FreshRSS_Context::$user_conf->default_view === 'adaptive' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.show.adaptive'); ?></option> + <option value="all"<?php echo FreshRSS_Context::$user_conf->default_view === 'all' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.show.all_articles'); ?></option> + <option value="unread"<?php echo FreshRSS_Context::$user_conf->default_view === 'unread' ? ' selected="selected"' : ''; ?>><?php echo _t('conf.reading.show.unread'); ?></option> + </select> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="hide_read_feeds"> + <input type="checkbox" name="hide_read_feeds" id="hide_read_feeds" value="1"<?php echo FreshRSS_Context::$user_conf->hide_read_feeds ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->hide_read_feeds; ?>"/> + <?php echo _t('conf.reading.hide_read_feeds'); ?> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="display_posts"> + <input type="checkbox" name="display_posts" id="display_posts" value="1"<?php echo FreshRSS_Context::$user_conf->display_posts ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->display_posts; ?>"/> + <?php echo _t('conf.reading.display_articles_unfolded'); ?> + <noscript> — <strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="display_categories"> + <input type="checkbox" name="display_categories" id="display_categories" value="1"<?php echo FreshRSS_Context::$user_conf->display_categories ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->display_categories; ?>"/> + <?php echo _t('conf.reading.display_categories_unfolded'); ?> + <noscript> — <strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="sticky_post"> + <input type="checkbox" name="sticky_post" id="sticky_post" value="1"<?php echo FreshRSS_Context::$user_conf->sticky_post ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->sticky_post; ?>"/> + <?php echo _t('conf.reading.sticky_post'); ?> + <noscript> — <strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="auto_load_more"> + <input type="checkbox" name="auto_load_more" id="auto_load_more" value="1"<?php echo FreshRSS_Context::$user_conf->auto_load_more ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->auto_load_more; ?>"/> + <?php echo _t('conf.reading.auto_load_more'); ?> + <noscript> — <strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="lazyload"> + <input type="checkbox" name="lazyload" id="lazyload" value="1"<?php echo FreshRSS_Context::$user_conf->lazyload ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->lazyload; ?>"/> + <?php echo _t('conf.reading.img_with_lazyload'); ?> + <noscript> — <strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="reading_confirm"> + <input type="checkbox" name="reading_confirm" id="reading_confirm" value="1"<?php echo FreshRSS_Context::$user_conf->reading_confirm ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->reading_confirm; ?>"/> + <?php echo _t('conf.reading.confirm_enabled'); ?> + <noscript> — <strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="auto_remove_article"> + <input type="checkbox" name="auto_remove_article" id="auto_remove_article" value="1"<?php echo FreshRSS_Context::$user_conf->auto_remove_article ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->auto_remove_article; ?>"/> + <?php echo _t('conf.reading.auto_remove_article'); ?> + <noscript> — <strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> + </label> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="mark_updated_article_unread"> + <input type="checkbox" name="mark_updated_article_unread" id="mark_updated_article_unread" value="1"<?php echo FreshRSS_Context::$user_conf->mark_updated_article_unread ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->mark_updated_article_unread; ?>"/> + <?php echo _t('conf.reading.mark_updated_article_unread'); ?> + </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 FreshRSS_Context::$user_conf->mark_when['article'] ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->mark_when['article']; ?>"/> + <?php echo _t('conf.reading.read.article_viewed'); ?> + </label> + <label class="checkbox" for="check_open_site"> + <input type="checkbox" name="mark_open_site" id="check_open_site" value="1"<?php echo FreshRSS_Context::$user_conf->mark_when['site'] ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->mark_when['site']; ?>"/> + <?php echo _t('conf.reading.read.article_open_on_website'); ?> + </label> + <label class="checkbox" for="check_scroll"> + <input type="checkbox" name="mark_scroll" id="check_scroll" value="1"<?php echo FreshRSS_Context::$user_conf->mark_when['scroll'] ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->mark_when['scroll']; ?>"/> + <?php echo _t('conf.reading.read.scroll'); ?> + </label> + <label class="checkbox" for="check_reception"> + <input type="checkbox" name="mark_upon_reception" id="check_reception" value="1"<?php echo FreshRSS_Context::$user_conf->mark_when['reception'] ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->mark_when['reception']; ?>"/> + <?php echo _t('conf.reading.read.upon_reception'); ?> + </label> + </div> + </div> + + <div class="form-group"> + <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 FreshRSS_Context::$user_conf->onread_jump_next ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->onread_jump_next; ?>"/> + <?php echo _t('conf.reading.jump_next'); ?> + </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/configure/sharing.phtml b/app/views/configure/sharing.phtml index e3ea11665..ffcfb8b29 100644 --- a/app/views/configure/sharing.phtml +++ b/app/views/configure/sharing.phtml @@ -1,63 +1,66 @@ -<?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'); ?>"> - <legend><?php echo Minz_Translate::t ('sharing'); ?></legend> - <div class="form-group"> - <label class="group-name" for="shaarli"> - <?php echo Minz_Translate::t ('your_shaarli'); ?> - </label> - <div class="group-controls"> - <input type="url" id="shaarli" name="shaarli" class="extend" value="<?php echo $this->conf->sharing ('shaarli'); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" size="64" /> - - <?php echo FreshRSS_Themes::icon('help'); ?> <a target="_blank" href="http://sebsauvage.net/wiki/doku.php?id=php:shaarli"><?php echo Minz_Translate::t ('more_information'); ?></a> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="wallabag"> - <?php echo Minz_Translate::t ('your_wallabag'); ?> - </label> - <div class="group-controls"> - <input type="url" id="wallabag" name="wallabag" class="extend" value="<?php echo $this->conf->sharing ('wallabag'); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" size="64" /> - - <?php echo FreshRSS_Themes::icon('help'); ?> <a target="_blank" href="http://www.wallabag.org"><?php echo Minz_Translate::t ('more_information'); ?></a> - </div> - </div> - - <div class="form-group"> - <label class="group-name" for="diaspora"> - <?php echo Minz_Translate::t ('your_diaspora_pod'); ?> - </label> - <div class="group-controls"> - <input type="url" id="diaspora" name="diaspora" class="extend" value="<?php echo $this->conf->sharing ('diaspora'); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" size="64" /> - - <?php echo FreshRSS_Themes::icon('help'); ?> <a target="_blank" href="https://diasporafoundation.org/"><?php echo Minz_Translate::t ('more_information'); ?></a> + <form method="post" action="<?php echo _url('configure', 'sharing'); ?>" + data-simple='<div class="form-group" id="group-share-##key##"><label class="group-name">##label##</label><div class="group-controls"><div class="stick"><input type="text" id="share_##key##_name" name="share[##key##][name]" class="extend" value="##label##" placeholder="<?php echo _t('conf.sharing.share_name'); ?>" size="64" /> + <input type="url" id="share_##key##_url" name="share[##key##][url]" class="extend" value="" placeholder="<?php echo _t('gen.short.not_applicable'); ?>" size="64" disabled /><a href="#" class="remove btn btn-attention" data-remove="group-share-##key##"><?php echo _i('close'); ?></a></div> + <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 _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" rel="noreferrer" class="btn" title="<?php echo _t('conf.sharing.more_information'); ?>" href="##help##"><?php echo _i('help'); ?></a> + </div></div>'> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <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 $share->name(true); ?> + </label> + <div class="group-controls"> + <input type='hidden' id='share_<?php echo $key; ?>_type' name="share[<?php echo $key; ?>][type]" value='<?php echo $share->type(); ?>' /> + <div class="stick"> + <input type="text" id="share_<?php echo $key; ?>_name" name="share[<?php echo $key; ?>][name]" class="extend" value="<?php echo $share->name(); ?>" placeholder="<?php echo _t('conf.sharing.share_name'); ?>" size="64" data-leave-validation="<?php echo $share->name(); ?>"/> + <?php if ($share->formType() === 'advanced') { ?> + <input type="url" id="share_<?php echo $key; ?>_url" name="share[<?php echo $key; ?>][url]" class="extend" value="<?php echo $share->baseUrl(); ?>" placeholder="<?php echo _t('conf.sharing.share_url'); ?>" size="64" data-leave-validation="<?php echo $share->baseUrl(); ?>"/> + <?php } else { ?> + <input type="url" id="share_<?php echo $key; ?>_url" name="share[<?php echo $key; ?>][url]" class="extend" value="<?php echo $share->baseUrl(); ?>" placeholder="<?php echo _t('gen.short.not_applicable'); ?>" size="64" disabled/> + <?php } ?> + <a href='#' class='remove btn btn-attention' data-remove="group-share-<?php echo $key; ?>"><?php echo _i('close'); ?></a> + </div> + <?php if ($share->formType() === 'advanced') { ?> + <a target="_blank" rel="noreferrer" class="btn" title="<?php echo _t('conf.sharing.more_information'); ?>" href="<?php echo $share->help(); ?>"><?php echo _i('help'); ?></a> + <?php } ?> + </div> </div> - </div> + <?php } ?> <div class="form-group"> - <label class="group-name"><?php echo Minz_Translate::t ('activate_sharing'); ?></label> <div class="group-controls"> - <?php - $services = array ('twitter', 'g+', 'facebook', 'email', 'print'); - - foreach ($services as $service) { - ?> - <label class="checkbox" for="<?php echo $service; ?>"> - <input type="checkbox" name="<?php echo $service; ?>" id="<?php echo $service; ?>" value="1"<?php echo $this->conf->sharing($service) ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ($service); ?> - </label> - <?php } ?> + <select> + <?php foreach (FreshRSS_Share::enum() as $share) { ?> + <option value='<?php echo $share->type(); ?>' data-form='<?php echo $share->formType(); ?>' data-help='<?php echo $share->help(); ?>'> + <?php echo $share->name(true); ?> + </option> + <?php } ?> + </select> + <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 748a65d17..dceeb17de 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,97 +9,127 @@ <?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_management'); ?></legend> + <form method="post" action="<?php echo _url('configure', 'shortcut'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('conf.shortcut'); ?></legend> - <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 _t('conf.shortcut.next_article'); ?></label> + <div class="group-controls"> + <input type="text" id="next_entry" name="shortcuts[next_entry]" list="keys" value="<?php echo $s['next_entry']; ?>" data-leave-validation="<?php echo $s['next_entry']; ?>"/> + </div> + </div> <div class="form-group"> - <label class="group-name" for="next_entry"><?php echo Minz_Translate::t ('next_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="next_entry" name="shortcuts[next_entry]" list="keys" value="<?php echo $s['next_entry']; ?>" /> + <input type="text" id="prev_entry" name="shortcuts[prev_entry]" list="keys" value="<?php echo $s['prev_entry']; ?>" data-leave-validation="<?php echo $s['prev_entry']; ?>"/> </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="first_entry"><?php echo _t('conf.shortcut.first_article'); ?></label> <div class="group-controls"> - <input type="text" id="prev_entry" name="shortcuts[prev_entry]" list="keys" value="<?php echo $s['prev_entry']; ?>" /> + <input type="text" id="first_entry" name="shortcuts[first_entry]" list="keys" value="<?php echo $s['first_entry']; ?>" data-leave-validation="<?php echo $s['first_entry']; ?>"/> </div> </div> <div class="form-group"> - <label class="group-name" for="first_entry"><?php echo Minz_Translate::t ('first_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="first_entry" name="shortcuts[first_entry]" list="keys" value="<?php echo $s['first_entry']; ?>" /> + <input type="text" id="last_entry" name="shortcuts[last_entry]" list="keys" value="<?php echo $s['last_entry']; ?>" data-leave-validation="<?php echo $s['last_entry']; ?>"/> </div> </div> + <legend><?php echo _t('conf.shortcut.article_action');?></legend> + <div class="form-group"> - <label class="group-name" for="last_entry"><?php echo Minz_Translate::t ('last_article'); ?></label> + <label class="group-name" for="mark_read"><?php echo _t('conf.shortcut.mark_read'); ?></label> <div class="group-controls"> - <input type="text" id="last_entry" name="shortcuts[last_entry]" list="keys" value="<?php echo $s['last_entry']; ?>" /> + <input type="text" id="mark_read" name="shortcuts[mark_read]" list="keys" value="<?php echo $s['mark_read']; ?>" data-leave-validation="<?php echo $s['mark_read']; ?>"/> + <?php echo _t('conf.shortcut.shift_for_all_read'); ?> </div> </div> - <div><?php echo Minz_Translate::t ('shortcuts_navigation_help');?></div> + <div class="form-group"> + <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']; ?>" data-leave-validation="<?php echo $s['mark_favorite']; ?>"/> + </div> + </div> - <legend><?php echo Minz_Translate::t ('shortcuts_article_action');?></legend> + <div class="form-group"> + <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']; ?>" data-leave-validation="<?php echo $s['go_website']; ?>"/> + </div> + </div> <div class="form-group"> - <label class="group-name" for="mark_read"><?php echo Minz_Translate::t ('mark_read'); ?></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="mark_read" name="shortcuts[mark_read]" list="keys" value="<?php echo $s['mark_read']; ?>" /> - <?php echo Minz_Translate::t ('shift_for_all_read'); ?> + <input type="text" id="auto_share_shortcut" name="shortcuts[auto_share]" list="keys" value="<?php echo $s['auto_share']; ?>" data-leave-validation="<?php echo $s['auto_share']; ?>"/> + <?php echo _t('conf.shortcut.auto_share_help'); ?> </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="collapse_entry"><?php echo _t('conf.shortcut.collapse_article'); ?></label> <div class="group-controls"> - <input type="text" id="mark_favorite" name="shortcuts[mark_favorite]" list="keys" value="<?php echo $s['mark_favorite']; ?>" /> + <input type="text" id="collapse_entry" name="shortcuts[collapse_entry]" list="keys" value="<?php echo $s['collapse_entry']; ?>" data-leave-validation="<?php echo $s['collapse_entry']; ?>"/> </div> </div> + <legend><?php echo _t('conf.shortcut.other_action');?></legend> + <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="load_more_shortcut"><?php echo _t('conf.shortcut.load_more'); ?></label> <div class="group-controls"> - <input type="text" id="go_website" name="shortcuts[go_website]" list="keys" value="<?php echo $s['go_website']; ?>" /> + <input type="text" id="load_more_shortcut" name="shortcuts[load_more]" list="keys" value="<?php echo $s['load_more']; ?>" data-leave-validation="<?php echo $s['load_more']; ?>"/> </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="focus_search_shortcut"><?php echo _t('conf.shortcut.focus_search'); ?></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'); ?> + <input type="text" id="focus_search_shortcut" name="shortcuts[focus_search]" list="keys" value="<?php echo $s['focus_search']; ?>" data-leave-validation="<?php echo $s['focus_search']; ?>"/> </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="user_filter_shortcut"><?php echo _t('conf.shortcut.user_filter'); ?></label> <div class="group-controls"> - <input type="text" id="collapse_entry" name="shortcuts[collapse_entry]" list="keys" value="<?php echo $s['collapse_entry']; ?>" /> + <input type="text" id="user_filter_shortcut" name="shortcuts[user_filter]" list="keys" value="<?php echo $s['user_filter']; ?>" data-leave-validation="<?php echo $s['user_filter']; ?>"/> + <?php echo _t('conf.shortcut.user_filter_help'); ?> </div> </div> - <legend><?php echo Minz_Translate::t ('shortcuts_other_action');?></legend> + <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']; ?>" data-leave-validation="<?php echo $s['close_dropdown']; ?>"/> + </div> + </div> <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="help_shortcut"><?php echo _t('conf.shortcut.help'); ?></label> <div class="group-controls"> - <input type="text" id="load_more_shortcut" name="shortcuts[load_more]" list="keys" value="<?php echo $s['load_more']; ?>" /> + <input type="text" id="help_shortcut" name="shortcuts[help]" list="keys" value="<?php echo $s['help']; ?>" data-leave-validation="<?php echo $s['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/configure/system.phtml b/app/views/configure/system.phtml new file mode 100644 index 000000000..935b49fda --- /dev/null +++ b/app/views/configure/system.phtml @@ -0,0 +1,62 @@ +<?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('configure', 'system'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('admin.system'); ?></legend> + + <div class="form-group"> + <label class="group-name" for="instance-name"><?php echo _t('admin.system.instance-name'); ?></label> + <div class="group-controls"> + <input type="text" class="extend" id="instance-name" name="instance-name" value="<?php echo FreshRSS_Context::$system_conf->title; ?>" data-leave-validation="<?php echo FreshRSS_Context::$system_conf->title; ?>"/> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="auto-update-url"><?php echo _t('admin.system.auto-update-url'); ?></label> + <div class="group-controls"> + <input type="text" class="extend" id="auto-update-url" name="auto-update-url" value="<?php echo FreshRSS_Context::$system_conf->auto_update_url; ?>" data-leave-validation="<?php echo FreshRSS_Context::$system_conf->auto_update_url; ?>"/> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="max-registrations"><?php echo _t('admin.system.registration.number'); ?></label> + <div class="group-controls"> + <input type="number" id="max-registrations" name="max-registrations" value="<?php echo FreshRSS_Context::$system_conf->limits['max_registrations']; ?>" min="0" data-leave-validation="<?php echo FreshRSS_Context::$system_conf->limits['max_registrations']; ?>"/> + <?php echo _i('help'); ?> <?php echo _t('admin.system.registration.help'); ?> + </div> + </div> + + <div class="form-group"> + <div class="group-controls"> + <?php + $number = count(listUsers()); + echo _t($number > 1 ? 'admin.user.numbers' : 'admin.user.number', $number); + ?> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="max-feeds"><?php echo _t('admin.system.max-feeds'); ?></label> + <div class="group-controls"> + <input type="number" id="max-feeds" name="max-feeds" value="<?php echo FreshRSS_Context::$system_conf->limits['max_feeds']; ?>" min="1" data-leave-validation="<?php echo FreshRSS_Context::$system_conf->limits['max_feeds']; ?>"/> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="max-categories"><?php echo _t('admin.system.max-categories'); ?></label> + <div class="group-controls"> + <input type="number" id="max-categories" name="max-categories" value="<?php echo FreshRSS_Context::$system_conf->limits['max_categories']; ?>" min="1" data-leave-validation="<?php echo FreshRSS_Context::$system_conf->limits['max_categories']; ?>"/> + </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/configure/users.phtml b/app/views/configure/users.phtml deleted file mode 100644 index 1305feac9..000000000 --- a/app/views/configure/users.phtml +++ /dev/null @@ -1,172 +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"> - <input type="password" id="passwordPlain" name="passwordPlain" autocomplete="off" pattern=".{7,}" /> - <noscript><b><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></b></noscript> - </div> - </div> - - <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"' : '', version_compare(PHP_VERSION, '5.3', '<') ? ' 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> - - <?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 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"> - <input type="password" id="new_user_passwordPlain" name="new_user_passwordPlain" autocomplete="off" pattern=".{7,}" /> - <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..d85706669 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); -} else { - Minz_Request::_param ('is_favorite', 1); -} +$url = array( + 'c' => Minz_Request::controllerName(), + 'a' => Minz_Request::actionName(), + 'params' => Minz_Request::fetchGET(), +); -$url = Minz_Url::display (array ( - 'c' => Minz_Request::controllerName (), - 'a' => Minz_Request::actionName (), - 'params' => Minz_Request::params (), -)); +$url['params']['is_favorite'] = Minz_Request::param('is_favorite', true) ? '0' : '1'; -echo json_encode (array ('url' => str_ireplace ('&', '&', $url), 'icon' => FreshRSS_Themes::icon(Minz_Request::param ('is_favorite') ? 'non-starred' : 'starred'))); +FreshRSS::loadStylesAndScripts(); +echo json_encode(array( + 'url' => str_ireplace('&', '&', Minz_Url::display($url)), + 'icon' => _i($url['params']['is_favorite'] === '1' ? 'non-starred' : 'starred') + )); diff --git a/app/views/entry/read.phtml b/app/views/entry/read.phtml index 9e79d4c07..73977d94b 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); -} else { - Minz_Request::_param ('is_read', 1); -} +$url = array( + 'c' => Minz_Request::controllerName(), + 'a' => Minz_Request::actionName(), + 'params' => Minz_Request::fetchGET(), +); -$url = Minz_Url::display (array ( - 'c' => Minz_Request::controllerName (), - 'a' => Minz_Request::actionName (), - 'params' => Minz_Request::params (), -)); +$url['params']['is_read'] = Minz_Request::param('is_read', true) ? '0' : '1'; -echo json_encode (array ('url' => str_ireplace ('&', '&', $url), 'icon' => FreshRSS_Themes::icon(Minz_Request::param ('is_read') ? 'unread' : 'read'))); +FreshRSS::loadStylesAndScripts(); +echo json_encode(array( + 'url' => str_ireplace('&', '&', Minz_Url::display($url)), + 'icon' => _i($url['params']['is_read'] === '1' ? 'unread' : 'read') + )); diff --git a/app/views/error/index.phtml b/app/views/error/index.phtml index 6a09c3aa2..fe3abf8c4 100644 --- a/app/views/error/index.phtml +++ b/app/views/error/index.phtml @@ -1,18 +1,9 @@ <div class="post"> <div class="alert alert-error"> <h1 class="alert-head"><?php echo $this->code; ?></h1> - <p> - <?php - switch(Minz_Request::param ('code')) { - case 403: - echo Minz_Translate::t ('forbidden_access'); - break; - case 404: - default: - echo Minz_Translate::t ('page_not_found'); - } ?><br /> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> + <?php echo $this->errorMessage; ?><br /> + <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..7cb16bfff --- /dev/null +++ b/app/views/extension/index.phtml @@ -0,0 +1,46 @@ +<?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"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <?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 } ?> + </form> +</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 new file mode 100644 index 000000000..5cd59d298 --- /dev/null +++ b/app/views/feed/add.phtml @@ -0,0 +1,92 @@ +<?php if ($this->feed) { ?> +<div class="post"> + <h1><?php echo _t('sub.feed.add'); ?></h1> + + <?php if (!$this->load_ok) { ?> + <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('feedback.sub.feed.internal_problem', _url('index', 'logs')); ?></p> + <?php } ?> + + <form method="post" action="<?php echo _url('feed', 'add'); ?>" autocomplete="off"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('sub.feed.informations'); ?></legend> + <?php if ($this->load_ok) { ?> + <div class="form-group"> + <label class="group-name"><?php echo _t('sub.feed.title'); ?></label> + <div class="group-controls"> + <label><?php echo $this->feed->name() ; ?></label> + </div> + </div> + + <?php $desc = $this->feed->description(); if ($desc != '') { ?> + <div class="form-group"> + <label class="group-name"><?php echo _t('sub.feed.description'); ?></label> + <div class="group-controls"> + <label><?php echo htmlspecialchars($desc, ENT_NOQUOTES, 'UTF-8'); ?></label> + </div> + </div> + <?php } ?> + + <div class="form-group"> + <label class="group-name"><?php echo _t('sub.feed.website'); ?></label> + <div class="group-controls"> + <?php echo $this->feed->website(); ?> + <a class="btn" target="_blank" rel="noreferrer" href="<?php echo $this->feed->website(); ?>"><?php echo _i('link'); ?></a> + </div> + </div> + <?php } ?> + + <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_rss" id="url" class="extend" value="<?php echo $this->feed->url(); ?>" /> + <a class="btn" target="_blank" rel="noreferrer" href="<?php echo $this->feed->url(); ?>"><?php echo _i('link'); ?></a> + </div> + <a class="btn" target="_blank" rel="noreferrer" href="http://validator.w3.org/feed/check.cgi?url=<?php echo $this->feed->url(); ?>"><?php echo _t('sub.feed.validator'); ?></a> + </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() == 1 ? ' selected="selected"' : ''; ?>> + <?php echo $cat->name(); ?> + </option> + <?php } ?> + <option value="nc"><?php echo _t('sub.category.new'); ?></option> + </select> + + <span aria-hidden="true"> + <input type="text" name="new_category[name]" id="new_category_name" autocomplete="off" placeholder="<?php echo _t('sub.category.new'); ?>" /> + </span> + </div> + </div> + + <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 _t('sub.feed.auth.username'); ?></label> + <div class="group-controls"> + <input type="text" name="http_user" id="http_user" class="extend" value="<?php echo empty($auth['username']) ? ' ' : $auth['username']; ?>" autocomplete="off" /> + </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 class="group-controls"> + <?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 _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> + </div> + </div> + </form> +</div> +<?php } ?> 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/articles.phtml b/app/views/helpers/export/articles.phtml new file mode 100644 index 000000000..49c370023 --- /dev/null +++ b/app/views/helpers/export/articles.phtml @@ -0,0 +1,66 @@ +<?php +$username = Minz_Session::param('currentUser', '_'); + +$options = 0; +if (version_compare(PHP_VERSION, '5.4.0') >= 0) { + $options = JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; +} + +$articles = array( + 'id' => 'user/' . str_replace('/', '', $username) . '/state/org.freshrss/' . $this->type, + 'title' => $this->list_title, + 'author' => $username, + 'items' => array(), +); + +echo rtrim(json_encode($articles, $options), " ]}\n\r\t"), "\n"; +$first = true; + +foreach ($this->entriesRaw as $entryRaw) { + if (empty($entryRaw)) { + continue; + } + $entry = FreshRSS_EntryDAO::daoToEntry($entryRaw); + if (!isset($this->feed)) { + $feed = FreshRSS_CategoryDAO::findFeed($this->categories, $entry->feed()); + if ($feed == null) { + $feed = $entry->feed(true); + } + } else { + $feed = $this->feed; + } + + $article = array( + 'id' => $entry->guid(), + 'categories' => array_values($entry->tags()), + 'title' => $entry->title(), + 'author' => $entry->author(), + 'published' => $entry->date(true), + 'updated' => $entry->date(true), + 'alternate' => array(array( + 'href' => $entry->link(), + 'type' => 'text/html', + )), + 'content' => array( + 'content' => $entry->content(), + ), + 'origin' => array( + 'streamId' => $feed == null ? '' : $feed->id(), + 'title' => $feed == null ? '' : $feed->name(), + 'htmlUrl' => $feed == null ? '' : $feed->website(), + 'feedUrl' => $feed == null ? '' : $feed->url(), + ) + ); + + $line = json_encode($article, $options); + if ($line != '') { + if ($first) { + $first = false; + } else { + echo ",\n"; + } + echo $line; + } +} + +echo "\n]}\n"; diff --git a/app/views/helpers/export/opml.phtml b/app/views/helpers/export/opml.phtml new file mode 100644 index 000000000..236cca303 --- /dev/null +++ b/app/views/helpers/export/opml.phtml @@ -0,0 +1,28 @@ +<?php + +$opml_array = array( + 'head' => array( + 'title' => FreshRSS_Context::$system_conf->title, + 'dateCreated' => date('D, d M Y H:i:s') + ), + 'body' => array() +); + +foreach ($this->categories as $key => $cat) { + $opml_array['body'][$key] = array( + 'text' => $cat['name'], + '@outlines' => array() + ); + + foreach ($cat['feeds'] as $feed) { + $opml_array['body'][$key]['@outlines'][] = array( + 'text' => htmlspecialchars_decode($feed->name()), + 'type' => 'rss', + 'xmlUrl' => htmlspecialchars_decode($feed->url()), + 'htmlUrl' => htmlspecialchars_decode($feed->website()), + 'description' => htmlspecialchars_decode($feed->description()), + ); + } +} + +echo libopml_render($opml_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..bf87a255a --- /dev/null +++ b/app/views/helpers/feed/update.phtml @@ -0,0 +1,183 @@ +<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"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <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" rel="noreferrer" 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" rel="noreferrer" href="<?php echo $this->feed->url(); ?>"><?php echo _i('link'); ?></a> + </div> + + <a class="btn" target="_blank" rel="noreferrer" href="http://validator.w3.org/feed/check.cgi?url=<?php echo rawurlencode(htmlspecialchars_decode($this->feed->url(), ENT_QUOTES)); ?>"><?php echo _t('sub.feed.validator'); ?></a> + </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"> + <label class="group-name" for="pubsubhubbub"><?php echo _t('sub.feed.pubsubhubbub'); ?></label> + <div class="group-controls"> + <label class="checkbox" for="pubsubhubbub"> + <input type="checkbox" name="pubsubhubbub" id="pubsubhubbub" disabled="disabled" value="1"<?php echo $this->feed->pubSubHubbubEnabled() ? ' checked="checked"' : ''; ?> /> + </label> + </div> + </div> + <div class="form-group form-actions"> + <div class="group-controls"> + <button class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button class="btn btn-attention confirm" formmethod="post" formaction="<?php echo _url('feed', 'truncate', 'id', $this->feed->id()); ?>"><?php echo _t('gen.action.truncate'); ?></button> + </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_feed<?php echo $this->feed->id(); ?>"><?php echo _t('sub.feed.auth.username'); ?></label> + <div class="group-controls"> + <input type="text" name="http_user_feed<?php echo $this->feed->id(); ?>" id="http_user_feed<?php echo $this->feed->id(); ?>" class="extend" value="<?php echo empty($auth['username']) ? ' ' : $auth['username']; ?>" autocomplete="off" /> + <?php echo _i('help'); ?> <?php echo _t('sub.feed.auth.help'); ?> + </div> + + <label class="group-name" for="http_pass_feed<?php echo $this->feed->id(); ?>"><?php echo _t('sub.feed.auth.password'); ?></label> + <div class="group-controls"> + <input type="password" name="http_pass_feed<?php echo $this->feed->id(); ?>" id="http_pass_feed<?php echo $this->feed->id(); ?>" class="extend" value="<?php echo $auth['password']; ?>" autocomplete="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..a9d5a80ca --- /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" rel="noreferrer" 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', '#' . htmlspecialchars_decode($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" rel="noreferrer" 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..86298e59f --- /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" rel="noreferrer" href="<?php echo $this->entry->link(); ?>"><?php echo $this->entry->title(); ?></a></li> + <?php if ($topline_date) { ?><li class="item date"><?php echo $this->entry->date(); ?> </li><?php } ?> + <?php if ($topline_link) { ?><li class="item link"><a target="_blank" rel="noreferrer" href="<?php echo $this->entry->link(); ?>"><?php echo _i('link'); ?></a></li><?php } ?> +</ul> diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 3d7c8a98f..745baa195 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -1,52 +1,53 @@ <?php - -echo '"use strict";', "\n"; - -$mark = $this->conf->mark_when; -echo 'var ', - 'hide_posts=', ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'false' : 'true', - ',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', - ',full_lazyload=', $this->conf->lazyload && ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'true' : 'false', - ',does_lazyload=', $this->conf->lazyload ? 'true' : 'false'; - -$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'], '"', -"},\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 'str_confirmation="', Minz_Translate::t('confirm_action'), '"', ",\n"; - -$autoActualise = Minz_Session::param('actualize_feeds', false); -echo 'auto_actualize_feeds=', $autoActualise ? 'true' : 'false', ";\n"; +$mark = FreshRSS_Context::$user_conf->mark_when; +$s = FreshRSS_Context::$user_conf->shortcuts; +echo htmlspecialchars(json_encode(array( + 'context' => array( + 'auto_remove_article' => !!FreshRSS_Context::isAutoRemoveAvailable(), + 'hide_posts' => !(FreshRSS_Context::$user_conf->display_posts || Minz_Request::actionName() === 'reader'), + 'display_order' => Minz_Request::param('order', FreshRSS_Context::$user_conf->sort_order), + 'auto_mark_article' => !!$mark['article'], + 'auto_mark_site' => !!$mark['site'], + 'auto_mark_scroll' => !!$mark['scroll'], + 'auto_load_more' => !!FreshRSS_Context::$user_conf->auto_load_more, + 'auto_actualize_feeds' => !!Minz_Session::param('actualize_feeds', false), + 'does_lazyload' => !!FreshRSS_Context::$user_conf->lazyload , + 'sticky_post' => !!FreshRSS_Context::isStickyPostEnabled(), + 'html5_notif_timeout' => FreshRSS_Context::$user_conf->html5_notif_timeout, + 'auth_type' => FreshRSS_Context::$system_conf->auth_type, + 'current_view' => Minz_Request::actionName(), + 'csrf' => FreshRSS_Auth::csrfToken(), + ), + 'shortcuts' => array( + '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'], + ), + 'url' => array( + 'index' => _url('index', 'index'), + 'login' => Minz_Url::display(array('c' => 'auth', 'a' => 'login'), 'php'), + 'logout' => Minz_Url::display(array('c' => 'auth', 'a' => 'logout'), 'php'), + 'help' => FRESHRSS_WIKI, + ), + 'i18n' => array( + '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'), + ), + 'icons' => array( + 'close' => _i('close'), + ), +), JSON_UNESCAPED_UNICODE), ENT_NOQUOTES); diff --git a/app/views/helpers/logs_pagination.phtml b/app/views/helpers/logs_pagination.phtml index e3d14810e..bf9d91f04 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::fetchGET(); ?> <?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 d4983a32e..893451af9 100755 --- a/app/views/helpers/pagination.phtml +++ b/app/views/helpers/pagination.phtml @@ -1,26 +1,45 @@ <?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']['state'] = FreshRSS_Context::$state; + $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, + 'search' => FreshRSS_Context::$search, + 'state' => FreshRSS_Context::$state, + ) + ); ?> +<form id="mark-read-pagination" method="post"> +<input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> <ul class="pagination"> <li class="item pager-next"> - <?php if (!empty($this->nextId)) { ?> - <?php $params['next'] = $this->nextId; ?> - <a id="load_more" href="<?php echo Minz_Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Minz_Translate::t ('load_more'); ?></a> - <?php } elseif ($markReadUrl) { ?> - <a id="bigMarkAsRead" href="<?php echo $markReadUrl; ?>"> - <?php echo Minz_Translate::t ('nothing_to_load'); ?><br /> - <span class="bigTick">✔</span><br /> - <?php echo Minz_Translate::t ('mark_all_read'); ?> - </a> + <?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 ($url_mark_read) { ?> + <button id="bigMarkAsRead" + class="as-link <?php echo FreshRSS_Context::$user_conf->reading_confirm ? 'confirm" disabled="disabled' : ''; ?>" + form="mark-read-pagination" + formaction="<?php echo Minz_Url::display($url_mark_read); ?>" + type="submit"> + <?php echo _t('gen.pagination.nothing_to_load'); ?><br /> + <span class="bigTick">✓</span><br /> + <?php echo _t('gen.pagination.mark_all_read'); ?> + </button> <?php } else { ?> - <a id="bigMarkAsRead" href="."> - <?php echo Minz_Translate::t ('nothing_to_load'); ?><br /> - </a> + <a id="bigMarkAsRead" href="."> + <?php echo _t('gen.pagination.nothing_to_load'); ?><br /> + </a> <?php } ?> </li> </ul> +</form> diff --git a/app/views/helpers/view/global_view.phtml b/app/views/helpers/view/global_view.phtml deleted file mode 100644 index db937eeae..000000000 --- a/app/views/helpers/view/global_view.phtml +++ /dev/null @@ -1,45 +0,0 @@ -<?php $this->partial ('nav_menu'); ?> - -<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> diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml deleted file mode 100644 index ae93b627c..000000000 --- a/app/views/helpers/view/normal_view.phtml +++ /dev/null @@ -1,240 +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) { - $shaarli = $this->conf->sharing ('shaarli'); - $wallabag = $this->conf->sharing ('wallabag'); - $diaspora = $this->conf->sharing ('diaspora'); - } else { - $shaarli = ''; - $wallabag = ''; - $diaspora = ''; - } - $twitter = $this->conf->sharing ('twitter'); - $google_plus = $this->conf->sharing ('g+'); - $facebook = $this->conf->sharing ('facebook'); - $email = $this->conf->sharing ('email'); - $print = $this->conf->sharing ('print'); - $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 && ( - $shaarli || $wallabag || $diaspora || $twitter || - $google_plus || $facebook || $email || $print); - $bottomline_tags = $this->conf->bottomline_tags; - $bottomline_date = $this->conf->bottomline_date; - $bottomline_link = $this->conf->bottomline_link; -?> - -<div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>"><?php - ?><div id="new-article"> - <a href="<?php echo _url('index', 'index'); ?>"><?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 (empty($feed)) $feed = $item->feed (true); - ?><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"> - <h1 class="title"><?php echo $item->title (); ?></h1> - <?php - $author = $item->author (); - echo $author != '' ? '<div class="author">' . Minz_Translate::t ('by_author', $author) . '</div>' : ''; - if ($lazyload) { - echo $hidePosts ? lazyIframe(lazyimg($item->content())) : lazyimg($item->content()); - } else { - echo $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 if ($shaarli) { ?> - <li class="item share"> - <a target="_blank" href="<?php echo $shaarli . '?post=' . $link . '&title=' . $title . '&source=FreshRSS'; ?>"> - <?php echo Minz_Translate::t ('shaarli'); ?> - </a> - </li> - <?php } if ($wallabag) { ?> - <li class="item share"> - <a target="_blank" href="<?php echo $wallabag . '?action=add&url=' . base64_encode (urldecode($link)); ?>"> - <?php echo Minz_Translate::t ('wallabag'); ?> - </a> - </li> - <?php } if ($diaspora) { ?> - <li class="item share"> - <a target="_blank" href="<?php echo $diaspora . '/bookmarklet?url=' . $link . '&title=' . $title; ?>"> - <?php echo Minz_Translate::t ('diaspora'); ?> - </a> - </li> - <?php } if ($twitter) { ?> - <li class="item share"> - <a target="_blank" href="https://twitter.com/share?url=<?php echo $link; ?>&text=<?php echo $title; ?>"> - <?php echo Minz_Translate::t ('twitter'); ?> - </a> - </li> - <?php } if ($google_plus) { ?> - <li class="item share"> - <a target="_blank" href="https://plus.google.com/share?url=<?php echo $link; ?>"> - <?php echo Minz_Translate::t ('g+'); ?> - </a> - </li> - <?php } if ($facebook) { ?> - <li class="item share"> - <a target="_blank" href="https://www.facebook.com/sharer.php?u=<?php echo $link; ?>&t=<?php echo $title; ?>"> - <?php echo Minz_Translate::t ('facebook'); ?> - </a> - </li> - <?php } if ($email) { ?> - <li class="item share"> - <a href="mailto:?subject=<?php echo urldecode($title); ?>&body=<?php echo $link; ?>"> - <?php echo Minz_Translate::t ('by_email'); ?> - </a> - </li> - <?php } if ($print) { ?> - <li class="item share"> - <a href="#" class="print-article"> - <?php echo Minz_Translate::t ('print'); ?> - </a> - </li> - <?php } ?> - </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> - <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $item->id ();?>"><?php - echo FreshRSS_Themes::icon('tag'), Minz_Translate::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="alert alert-warn normal"> - <span class="alert-head"><?php echo Minz_Translate::t ('no_feed_to_display'); ?></span> - <?php echo Minz_Translate::t ('think_to_add'); ?> -</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 bda96e86d..000000000 --- a/app/views/helpers/view/reader_view.phtml +++ /dev/null @@ -1,49 +0,0 @@ -<?php -$this->partial ('nav_menu'); - -if (!empty($this->entries)) { - $lazyload = $this->conf->lazyload; -?> - -<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 - $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 (); ?> - <?php echo $author != '' ? Minz_Translate::t ('by_author', $author) . ' — ' : ''; ?> - <?php echo $item->date (); ?> - </div> - - <?php - if ($lazyload) { - echo lazyimg($item->content ()); - } else { - echo $item->content(); - } - ?> - </div> - </div> - </div> - <?php } ?> - - <?php $this->renderHelper('pagination'); ?> -</div> - -<?php } else { ?> -<div id="stream" class="alert alert-warn reader"> - <span class="alert-head"><?php echo Minz_Translate::t ('no_feed_to_display'); ?></span> - <?php echo Minz_Translate::t ('think_to_add'); ?> -</div> -<?php } ?> diff --git a/app/views/importExport/export.phtml b/app/views/importExport/export.phtml new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/app/views/importExport/export.phtml diff --git a/app/views/importExport/index.phtml b/app/views/importExport/index.phtml new file mode 100644 index 000000000..c5049e3ea --- /dev/null +++ b/app/views/importExport/index.phtml @@ -0,0 +1,63 @@ +<?php $this->partial('aside_subscription'); ?> + +<div class="post "> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <form method="post" action="<?php echo _url('importExport', 'import'); ?>" enctype="multipart/form-data"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('sub.import_export.import'); ?></legend> + <div class="form-group"> + <label class="group-name" for="file"> + <?php echo extension_loaded('zip') ? _t('sub.import_export.file_to_import') : _t('sub.import_export.file_to_import_no_zip'); ?> + </label> + <div class="group-controls"> + <input type="file" name="file" id="file" /> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <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'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <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('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('sub.import_export.export_starred'); ?> + </label> + + <?php + $select_args = ''; + if (extension_loaded('zip')) { + $select_args = ' size="' . min(10, count($this->feeds)) .'" multiple="multiple"'; + } + ?> + <select name="export_feeds[]"<?php echo $select_args; ?> size="10"> + <?php echo extension_loaded('zip') ? '' : '<option></option>'; ?> + <?php foreach ($this->feeds as $feed) { ?> + <option value="<?php echo $feed->id(); ?>"><?php echo $feed->name(); ?></option> + <?php } ?> + </select> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.export'); ?></button> + </div> + </div> + </form> + <?php } ?> +</div> 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 cc925ea59..000000000 --- a/app/views/index/formLogin.phtml +++ /dev/null @@ -1,32 +0,0 @@ -<div class="prompt"> - <h1><?php echo Minz_Translate::t('login'); ?></h1><?php - - switch (Minz_Configuration::authType()) { - case 'form': - ?><form id="loginForm" method="post" action="<?php echo _url('index', 'formLogin'); ?>"> - <div> - <label for="username"><?php echo Minz_Translate::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 Minz_Translate::t('password'); ?></label> - <input type="password" id="passwordPlain" required="required" /> - <input type="hidden" id="challenge" name="challenge" /><br /> - <noscript><strong><?php echo Minz_Translate::t('javascript_should_be_activated'); ?></strong></noscript> - </div> - <div> - <button id="loginButton" type="submit" class="btn btn-important"><?php echo Minz_Translate::t('login'); ?></button> - </div> - </form><?php - break; - - case 'persona': - ?><p> - <?php echo FreshRSS_Themes::icon('login'); ?> - <a class="signin" href="#"><?php echo Minz_Translate::t('login_with_persona'); ?></a> - </p><?php - break; - } ?> - - <p><a href="<?php echo _url('index', 'about'); ?>"><?php echo Minz_Translate::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..f35732c8f --- /dev/null +++ b/app/views/index/global.phtml @@ -0,0 +1,57 @@ +<?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 + $params = Minz_Request::fetchGET(); + unset($params['c']); + unset($params['a']); + $url_base = array( + 'c' => 'index', + 'a' => 'normal', + 'params' => $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..a88f89278 100644 --- a/app/views/index/logs.phtml +++ b/app/views/index/logs.phtml @@ -1,25 +1,26 @@ <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="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> <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)) { ?> - <div class="logs"> - <?php $this->logsPaginator->render ('logs_pagination.phtml', 'page'); ?> + <?php if (!empty($items)) { ?> + <div class="loglist"> + <?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..6fda11ed9 --- /dev/null +++ b/app/views/index/normal.phtml @@ -0,0 +1,93 @@ +<?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(); + ?>" data-feed="<?php echo $this->feed->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" rel="noreferrer" 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 620bf1388..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->rss_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/index/stats.phtml b/app/views/index/stats.phtml deleted file mode 100644 index b5c18813d..000000000 --- a/app/views/index/stats.phtml +++ /dev/null @@ -1,125 +0,0 @@ -<div class="post content"> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> - - <h1><?php echo Minz_Translate::t ('stats'); ?></h1> - - <div class="stat"> - <h2><?php echo Minz_Translate::t ('stats_entry_repartition'); ?></h2> - <table> - <thead> - <tr> - <th> </th> - <th><?php echo Minz_Translate::t ('main_stream'); ?></th> - <th><?php echo Minz_Translate::t ('all_feeds'); ?></th> - </tr> - </thead> - <tbody> - <tr> - <th><?php echo Minz_Translate::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> - </tr> - <tr> - <th><?php echo Minz_Translate::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> - </tr> - <tr> - <th><?php echo Minz_Translate::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> - </tr> - <tr> - <th><?php echo Minz_Translate::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> - </tr> - </tbody> - </table> - </div> - - <div class="stat"> - <h2><?php echo Minz_Translate::t ('stats_entry_per_day'); ?></h2> - <div id="statsEntryPerDay" style="height: 300px"></div> - </div> - - <div class="stat"> - <h2><?php echo Minz_Translate::t ('stats_feed_per_category'); ?></h2> - <div id="statsFeedPerCategory" style="height: 300px"></div> - <div id="statsFeedPerCategoryLegend"></div> - </div> - - <div class="stat"> - <h2><?php echo Minz_Translate::t ('stats_entry_per_category'); ?></h2> - <div id="statsEntryPerCategory" style="height: 300px"></div> - <div id="statsEntryPerCategoryLegend"></div> - </div> - - <div class="stat"> - <h2><?php echo Minz_Translate::t ('stats_top_feed'); ?></h2> - <table> - <thead> - <tr> - <th><?php echo Minz_Translate::t ('feed'); ?></th> - <th><?php echo Minz_Translate::t ('category'); ?></th> - <th><?php echo Minz_Translate::t ('stats_entry_count'); ?></th> - </tr> - </thead> - <tbody> - <?php foreach ($this->topFeed as $feed): ?> - <tr> - <td><?php echo $feed['name']; ?></td> - <td><?php echo $feed['category']; ?></td> - <td class="numeric"><?php echo formatNumber($feed['count']); ?></td> - </tr> - <?php endforeach;?> - </tbody> - </table> - </div> -</div> - -<script> -"use strict"; -function initStats() { - if (!window.Flotr) { - if (window.console) { - console.log('FreshRSS waiting for Flotr…'); - } - window.setTimeout(initStats, 50); - return; - } - // Entry per day - Flotr.draw(document.getElementById('statsEntryPerDay'), - [<?php echo $this->count ?>], - { - grid: {verticalLines: false}, - bars: {horizontal: false, show: true}, - xaxis: {noTicks: 6, showLabels: false, tickDecimals: 0}, - yaxis: {min: 0}, - mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return numberFormat(obj.y);}} - }); - // Feed per category - Flotr.draw(document.getElementById('statsFeedPerCategory'), - <?php echo $this->feedByCategory ?>, - { - grid: {verticalLines: false, horizontalLines: false}, - pie: {explode: 10, show: true, labelFormatter: function(){return '';}}, - xaxis: {showLabels: false}, - yaxis: {showLabels: false}, - mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return obj.series.label + ' - '+ numberFormat(obj.y) + ' ('+ (obj.fraction * 100).toFixed(1) + '%)';}}, - legend: {container: document.getElementById('statsFeedPerCategoryLegend'), noColumns: 3} - }); - // Entry per category - Flotr.draw(document.getElementById('statsEntryPerCategory'), - <?php echo $this->entryByCategory ?>, - { - grid: {verticalLines: false, horizontalLines: false}, - pie: {explode: 10, show: true, labelFormatter: function(){return '';}}, - xaxis: {showLabels: false}, - yaxis: {showLabels: false}, - mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return obj.series.label + ' - '+ numberFormat(obj.y) + ' ('+ (obj.fraction * 100).toFixed(1) + '%)';}}, - legend: {container: document.getElementById('statsEntryPerCategoryLegend'), noColumns: 3} - }); -} -initStats(); -</script> diff --git a/app/views/javascript/actualize.phtml b/app/views/javascript/actualize.phtml index 3b12ad774..3baabf748 100644 --- a/app/views/javascript/actualize.phtml +++ b/app/views/javascript/actualize.phtml @@ -1,55 +1,13 @@ -"use strict"; -var feeds = [<?php - foreach ($this->feeds as $feed) { - echo "'", Minz_Url::display(array('c' => 'feed', 'a' => 'actualize', 'params' => array('id' => $feed->id(), 'ajax' => '1')), 'php'), "',\n"; - } - ?>], - feed_processed = 0, - feed_count = feeds.length; - -function initProgressBar(init) { - if (init) { - $("body").after("\<div id=\"actualizeProgress\" class=\"actualizeProgress\">\ - <?php echo Minz_Translate::t ('refresh'); ?> <span class=\"progress\">0 / " + feed_count + "</span><br />\ - <progress id=\"actualizeProgressBar\" value=\"0\" max=\"" + feed_count + "\"></progress>\ - </div>"); - } else { - window.location.reload(); - } -} -function updateProgressBar(i) { - $("#actualizeProgressBar").val(i); - $("#actualizeProgress .progress").html(i + " / " + feed_count); -} - -function updateFeeds() { - if (feed_count === 0) { - openNotification("<?php echo Minz_Translate::t ('no_feed_to_refresh'); ?>", "good"); - return; - } - initProgressBar(true); - - for (var i = 0; i < 10; i++) { - updateFeed(); - } -} - -function updateFeed() { - var feed = feeds.pop(); - if (feed == undefined) { - return; - } - $.ajax({ - type: 'POST', - url: feed, - }).complete(function (data) { - feed_processed++; - updateProgressBar(feed_processed); - - if (feed_processed === feed_count) { - initProgressBar(false); - } else { - updateFeed(); - } - }); -} +<?php +$feeds = array(); +foreach ($this->feeds as $feed) { + $feeds[] = array( + 'url' => Minz_Url::display(array('c' => 'feed', 'a' => 'actualize', 'params' => array('id' => $feed->id(), 'ajax' => '1')), 'php'), + 'title' => $feed->name(), + ); +} +echo json_encode(array( + 'feeds' => $feeds, + 'feedback_no_refresh' => _t('feedback.sub.feed.no_refresh'), + 'feedback_actualize' => _t('feedback.sub.actualize'), +)); diff --git a/app/views/stats/idle.phtml b/app/views/stats/idle.phtml new file mode 100644 index 000000000..88c78d465 --- /dev/null +++ b/app/views/stats/idle.phtml @@ -0,0 +1,49 @@ +<?php $this->partial('aside_stats'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <h1><?php echo _t('admin.stats.idle'); ?></h1> + + <?php + $current_url = Minz_Url::display( + array('c' => 'stats', 'a' => 'idle'), + 'php', true + ); + $nothing = true; + foreach ($this->idleFeeds as $period => $feeds) { + if (!empty($feeds)) { + $nothing = false; + ?> + <div class="stat"> + <h2><?php echo _t('gen.date.' . $period); ?></h2> + + <form id="form-delete" method="post"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <?php foreach ($feeds as $feed) { ?> + <ul class="horizontal-list"> + <li class="item"> + <div class="stick"> + <a class="btn" href="<?php echo _url('index', 'index', 'get', 'f_' . $feed['id']); ?>"><?php echo _i('link'); ?> <?php echo _t('gen.action.filter'); ?></a> + <a class="btn" href="<?php echo _url('subscription', 'index', 'id', $feed['id']); ?>"><?php echo _i('configure'); ?> <?php echo _t('gen.action.manage'); ?></a> + <button class="btn btn-attention confirm" form="form-delete" formaction="<?php echo _url('feed', 'delete', 'id', $feed['id'], 'r', $current_url); ?>"><?php echo _t('gen.action.remove'); ?></button> + </div> + </li> + <li class="item"> + <span title="<?php echo timestamptodate($feed['last_date'], false); ?>"><?php echo $feed['name']; ?> (<?php echo _t('admin.stats.number_entries', $feed['nb_articles']); ?>)</span> + </li> + </ul> + <?php } ?> + </form> + </div> + <?php + } + } + + if ($nothing) { + ?> + <p class="alert alert-warn"> + <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 new file mode 100644 index 000000000..a36f812a8 --- /dev/null +++ b/app/views/stats/index.phtml @@ -0,0 +1,93 @@ +<?php $this->partial('aside_stats'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <h1><?php echo _t('admin.stats.main'); ?></h1> + + <div class="stat half"> + <h2><?php echo _t('admin.stats.entry_repartition'); ?></h2> + <table> + <thead> + <tr> + <th> </th> + <th><?php echo _t('admin.stats.main_stream'); ?></th> + <th><?php echo _t('admin.stats.all_feeds'); ?></th> + </tr> + </thead> + <tbody> + <tr> + <th><?php echo _t('admin.stats.status_total'); ?></th> + <td class="numeric"><?php echo format_number($this->repartition['main_stream']['total']); ?></td> + <td class="numeric"><?php echo format_number($this->repartition['all_feeds']['total']); ?></td> + </tr> + <tr> + <th><?php echo _t('admin.stats.status_read'); ?></th> + <td class="numeric"><?php echo format_number($this->repartition['main_stream']['count_reads']); ?></td> + <td class="numeric"><?php echo format_number($this->repartition['all_feeds']['count_reads']); ?></td> + </tr> + <tr> + <th><?php echo _t('admin.stats.status_unread'); ?></th> + <td class="numeric"><?php echo format_number($this->repartition['main_stream']['count_unreads']); ?></td> + <td class="numeric"><?php echo format_number($this->repartition['all_feeds']['count_unreads']); ?></td> + </tr> + <tr> + <th><?php echo _t('admin.stats.status_favorites'); ?></th> + <td class="numeric"><?php echo format_number($this->repartition['main_stream']['count_favorites']); ?></td> + <td class="numeric"><?php echo format_number($this->repartition['all_feeds']['count_favorites']); ?></td> + </tr> + </tbody> + </table> + </div><!-- + + --><div class="stat half"> + <h2><?php echo _t('admin.stats.top_feed'); ?></h2> + <table> + <thead> + <tr> + <th><?php echo _t('admin.stats.feed'); ?></th> + <th><?php echo _t('admin.stats.category'); ?></th> + <th><?php echo _t('admin.stats.entry_count'); ?></th> + <th><?php echo _t('admin.stats.percent_of_total'); ?></th> + </tr> + </thead> + <tbody> + <?php foreach ($this->topFeed as $feed) { ?> + <tr> + <td><a href="<?php echo _url('stats', 'repartition', 'id', $feed['id']); ?>"><?php echo $feed['name']; ?></a></td> + <td><?php echo $feed['category']; ?></td> + <td class="numeric"><?php echo format_number($feed['count']); ?></td> + <td class="numeric"><?php echo format_number($feed['count'] / $this->repartition['all_feeds']['total'] * 100, 1);?></td> + </tr> + <?php } ?> + </tbody> + </table> + </div> + + <div class="stat"> + <h2><?php echo _t('admin.stats.entry_per_day'); ?></h2> + <div id="statsEntryPerDay" class="statGraph"></div> + </div> + + <div class="stat half"> + <h2><?php echo _t('admin.stats.feed_per_category'); ?></h2> + <div id="statsFeedPerCategory" class="statGraph"></div> + <div id="statsFeedPerCategoryLegend"></div> + </div> + + <div class="stat half"> + <h2><?php echo _t('admin.stats.entry_per_category'); ?></h2> + <div id="statsEntryPerCategory" class="statGraph"></div> + <div id="statsEntryPerCategoryLegend"></div> + </div> +</div> + +<script id="jsonStats" type="application/json"><?php +echo htmlspecialchars(json_encode(array( + 'average' => $this->average, + 'dataCount' => $this->count, + 'feedByCategory' => $this->feedByCategory, + 'entryByCategory' => $this->entryByCategory, +), JSON_UNESCAPED_UNICODE), ENT_NOQUOTES); +?></script> +<script src="../scripts/stats.js?<?php echo @filemtime(PUBLIC_PATH . '/scripts/stats.js'); ?>"></script> diff --git a/app/views/stats/repartition.phtml b/app/views/stats/repartition.phtml new file mode 100644 index 000000000..5ebcdce5a --- /dev/null +++ b/app/views/stats/repartition.phtml @@ -0,0 +1,74 @@ +<?php $this->partial('aside_stats'); ?> + +<div class="post "> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <h1><?php echo _t('admin.stats.repartition'); ?></h1> + + <select id="feed_select" class="select-change"> + <option data-url="<?php echo _url('stats', 'repartition')?>"><?php echo _t('admin.stats.all_feeds')?></option> + <?php foreach ($this->categories as $category) { + $feeds = $category->feeds(); + if (!empty($feeds)) { + echo '<optgroup label="', $category->name(), '">'; + foreach ($feeds as $feed) { + if ($this->feed && $feed->id() == $this->feed->id()) { + echo '<option value="', $feed->id(), '" selected="selected" data-url="', _url('stats', 'repartition', 'id', $feed->id()), '">', $feed->name(), '</option>'; + } else { + echo '<option value="', $feed->id(), '" data-url="', _url('stats', 'repartition', 'id', $feed->id()), '">', $feed->name(), '</option>'; + } + } + echo '</optgroup>'; + } + }?> + </select> + + <?php if ($this->feed) {?> + <a class="btn" href="<?php echo _url('subscription', 'index', 'id', $this->feed->id()); ?>"> + <?php echo _i('configure'); ?> <?php echo _t('gen.action.manage'); ?> + </a> + <?php }?> + + <div class="stat"> + <table> + <tr> + <th><?php echo _t('admin.stats.status_total'); ?></th> + <th><?php echo _t('admin.stats.status_read'); ?></th> + <th><?php echo _t('admin.stats.status_unread'); ?></th> + <th><?php echo _t('admin.stats.status_favorites'); ?></th> + </tr> + <tr> + <td class="numeric"><?php echo $this->repartition['total']; ?></td> + <td class="numeric"><?php echo $this->repartition['count_reads']; ?></td> + <td class="numeric"><?php echo $this->repartition['count_unreads']; ?></td> + <td class="numeric"><?php echo $this->repartition['count_favorites']; ?></td> + </tr> + </table> + </div> + + <div class="stat"> + <h2><?php echo _t('admin.stats.entry_per_hour', $this->averageHour); ?></h2> + <div id="statsEntryPerHour" class="statGraph"></div> + </div> + + <div class="stat half"> + <h2><?php echo _t('admin.stats.entry_per_day_of_week', $this->averageDayOfWeek); ?></h2> + <div id="statsEntryPerDayOfWeek" class="statGraph"></div> + </div> + + <div class="stat half"> + <h2><?php echo _t('admin.stats.entry_per_month', $this->averageMonth); ?></h2> + <div id="statsEntryPerMonth" class="statGraph"></div> + </div> +</div> + +<script id="jsonRepartition" type="application/json"><?php +echo htmlspecialchars(json_encode(array( + 'repartitionHour' => $this->repartitionHour, + 'repartitionDayOfWeek' => $this->repartitionDayOfWeek, + 'days' => $this->days, + 'repartitionMonth' => $this->repartitionMonth, + 'months' => $this->months, +), JSON_UNESCAPED_UNICODE), ENT_NOQUOTES); +?></script> +<script src="../scripts/repartition.js?<?php echo @filemtime(PUBLIC_PATH . '/scripts/repartition.js'); ?>"></script> 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..48f760d3e --- /dev/null +++ b/app/views/subscription/index.phtml @@ -0,0 +1,153 @@ +<?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"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <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" aria-hidden="true"> + <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_feed" value=" " autocomplete="off" placeholder="<?php echo _t('sub.feed.auth.username'); ?>" /> + </li> + <li class="input"> + <input type="password" name="http_pass" id="http_pass_feed" 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"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <li class="item"><input type="text" id="new-category" name="new-category" placeholder="<?php echo _t('sub.category.new'); ?>" /></li> + <li class="item"><button class="btn btn-important" type="submit"><?php echo _t('gen.action.submit'); ?></button></li> + </form> + </ul> + </div> + + <form id="controller-category" method="post" aria-hidden="true"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + </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="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <input type="text" name="name" value="<?php echo $cat->name(); ?>" /> + + <div class="dropdown"> + <div id="dropdown-cat-<?php echo $cat->id(); ?>" class="dropdown-target"></div> + + <a class="dropdown-toggle btn" href="#dropdown-cat-<?php echo $cat->id(); ?>"><?php echo _i('down'); ?></a> + <ul class="dropdown-menu"> + <li class="dropdown-close"><a href="#close">❌</a></li> + + <li class="item"><a href="<?php echo _url('index', 'index', 'get', 'c_' . $cat->id()); ?>"><?php echo _t('gen.action.filter'); ?></a></li> + + <?php + $no_feed = empty($feeds); + $is_default = ($cat->id() === $this->default_category->id()); + + if (!$no_feed || !$is_default) { + ?> + <li class="separator"></li> + <?php } if (!$no_feed) { ?> + <li class="item"> + <button class="as-link confirm" + data-str-confirm="<?php echo _t('gen.js.confirm_action_feed_cat'); ?>" + type="submit" + form="controller-category" + formaction="<?php echo _url('category', 'empty', 'id', $cat->id()); ?>"> + <?php echo _t('gen.action.empty'); ?></button> + </li> + <?php } if (!$is_default) { ?> + <li class="item"> + <button class="as-link confirm" + data-str-confirm="<?php echo _t('gen.js.confirm_action_feed_cat'); ?>" + type="submit" + form="controller-category" + formaction="<?php echo _url('category', 'delete', 'id', $cat->id()); ?>"> + <?php echo _t('gen.action.remove'); ?></button> + </li> + <?php } ?> + </ul> + </div> + </form> + </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 new file mode 100644 index 000000000..8221929ae --- /dev/null +++ b/app/views/update/apply.phtml @@ -0,0 +1,9 @@ +<?php $this->partial('aside_configure'); ?> + +<div class="post"> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('gen.action.back_to_rss_feeds'); ?></a> + + <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..543ab43de --- /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.3.3'); + } 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 new file mode 100644 index 000000000..da1bc7ef5 --- /dev/null +++ b/app/views/update/index.phtml @@ -0,0 +1,34 @@ +<?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.update'); ?></h1> + + <p> + <?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)) { ?> + <p class="alert <?php echo $this->message['status'] === 'bad' ? 'alert-error' : 'alert-warn'; ?>"> + <span class="alert-head"><?php echo $this->message['title']; ?></span> + <?php echo $this->message['body']; ?> + </p> + <?php } ?> + + <?php + if (empty($this->message) || $this->message['status'] !== 'good') { + ?> + <p> + <a href="<?php echo _url('update', 'check'); ?>" class="btn"><?php echo _t('admin.update.check'); ?></a> + </p> + <?php } ?> + + <?php if ($this->update_to_apply) { ?> + <a class="btn btn-important" href="<?php echo _url('update', 'apply'); ?>"><?php echo _t('admin.update.apply'); ?></a> + <?php } ?> +</div> diff --git a/app/views/user/manage.phtml b/app/views/user/manage.phtml new file mode 100644 index 000000000..a32247d14 --- /dev/null +++ b/app/views/user/manage.phtml @@ -0,0 +1,74 @@ +<?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'); ?>" autocomplete="off"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <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="new-password" 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 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'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <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..429375e44 --- /dev/null +++ b/app/views/user/profile.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('user', 'profile'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <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="newPasswordPlain"><?php echo _t('conf.profile.password_form'); ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="password" id="newPasswordPlain" name="newPasswordPlain" autocomplete="off" pattern=".{7,}" <?php echo cryptAvailable() ? '' : 'disabled="disabled" '; ?>/> + <a class="btn toggle-password" data-toggle="newPasswordPlain"><?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> + <?php echo _i('help'); ?> <kbd><a href="../api/"><?php echo Minz_Url::display('/api/greader.php', 'html', true); ?></a></kbd> + </div> + </div> + <?php } ?> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button> + <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button> + </div> + </div> + </form> + + <?php if (!FreshRSS_Auth::hasAccess('admin')) { ?> + <form id="crypto-form" method="post" action="<?php echo _url('user', 'delete'); ?>"> + <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" /> + <legend><?php echo _t('conf.profile.delete'); ?></legend> + + <p class="alert alert-warn"><span class="alert-head"><?php echo _t('gen.short.attention'); ?></span> <?php echo _t('conf.profile.delete.warn'); ?></p> + + <div class="form-group"> + <label class="group-name" for="passwordPlain"><?php echo _t('gen.auth.password'); ?></label> + <div class="group-controls"> + <input type="password" id="passwordPlain" required="required" /> + <input type="hidden" id="challenge" name="challenge" /><br /> + <noscript><strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <?php + $redirect_url = urlencode(Minz_Url::display( + array('c' => 'user', 'a' => 'profile'), + 'php', true + )); + ?> + <input type="hidden" name="r" value="<?php echo $redirect_url; ?>" /> + <input type="hidden" name="username" id="username" value="<?php echo Minz_Session::param('currentUser', '_'); ?>" /> + <button type="submit" class="btn btn-attention confirm"><?php echo _t('gen.action.remove'); ?></button> + </div> + </div> + </form> + <?php } ?> +</div> |
