aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-01-04 01:47:07 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-01-04 01:47:07 +0100
commitd7c929e53b889460cd416d2864563e16200d2a01 (patch)
treeb91657455d48fa31aaa9b0bc6d8828db3622db1d /app/views
parentcf8b3d080942ad682665569250038eda494d346b (diff)
parentc80ab2af7e0f6de4acf6dc02fab208d7b5baff45 (diff)
Merge remote-tracking branch 'origin/dev' into beta
Diffstat (limited to 'app/views')
-rw-r--r--app/views/configure/archiving.phtml58
-rw-r--r--app/views/configure/display.phtml135
-rw-r--r--app/views/configure/feed.phtml4
-rw-r--r--app/views/configure/importExport.phtml7
-rw-r--r--app/views/configure/sharing.phtml2
-rw-r--r--app/views/configure/shortcut.phtml9
-rw-r--r--app/views/configure/users.phtml154
-rw-r--r--app/views/feed/actualize.phtml2
-rw-r--r--app/views/helpers/javascript_vars.phtml23
-rw-r--r--app/views/helpers/view/global_view.phtml4
-rw-r--r--app/views/helpers/view/normal_view.phtml70
-rw-r--r--app/views/helpers/view/reader_view.phtml2
-rw-r--r--app/views/index/index.phtml45
-rw-r--r--app/views/javascript/actualize.phtml32
14 files changed, 362 insertions, 185 deletions
diff --git a/app/views/configure/archiving.phtml b/app/views/configure/archiving.phtml
new file mode 100644
index 000000000..6e26ca81e
--- /dev/null
+++ b/app/views/configure/archiving.phtml
@@ -0,0 +1,58 @@
+<?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('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>
+
+ <div class="form-group">
+ <label class="group-name" for="old_entries"><?php echo Minz_Translate::t('delete_articles_every'); ?></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>
+ </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>
+ <div class="group-controls">
+ <select class="number" name="keep_history_default" id="keep_history_default" required="required"><?php
+ foreach (array('' => '', 0 => '0', 10 => '10', 50 => '50', 100 => '100', 500 => '500', 1000 => '1 000', 5000 => '5 000', 10000 => '10 000', -1 => '∞') as $v => $t) {
+ echo '<option value="' . $v . ($this->conf->keep_history_default == $v ? '" selected="selected' : '') . '">' . $t . ' </option>';
+ }
+ ?></select> (<?php echo Minz_Translate::t('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>
+ </div>
+ </div>
+ </form>
+
+ <form method="post" action="<?php echo _url('entry', 'optimize'); ?>">
+ <legend><?php echo Minz_Translate::t ('advanced'); ?></legend>
+
+ <div class="form-group">
+ <p class="group-name"><?php echo Minz_Translate::t('current_user'); ?></p>
+ <div class="group-controls">
+ <p><?php echo $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'); ?>
+ </div>
+ </div>
+
+ <?php if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { ?>
+ <div class="form-group">
+ <p class="group-name"><?php echo Minz_Translate::t('users'); ?></p>
+ <div class="group-controls">
+ <p><?php echo formatBytes($this->size_total); ?></p>
+ </div>
+ </div>
+ <?php } ?>
+ </form>
+</div>
diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml
index fca533752..11a987610 100644
--- a/app/views/configure/display.phtml
+++ b/app/views/configure/display.phtml
@@ -4,7 +4,7 @@
<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', 'display'); ?>">
- <legend><?php echo Minz_Translate::t ('general_configuration'); ?></legend>
+ <legend><?php echo Minz_Translate::t ('theme'); ?></legend>
<div class="form-group">
<label class="group-name" for="language"><?php echo Minz_Translate::t ('language'); ?></label>
@@ -12,7 +12,7 @@
<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>
+ <option value="<?php echo $short; ?>"<?php echo $this->conf->language === $short ? ' selected="selected"' : ''; ?>><?php echo $lib; ?></option>
<?php } ?>
</select>
</div>
@@ -23,7 +23,7 @@
<div class="group-controls">
<select name="theme" id="theme">
<?php foreach ($this->themes as $theme) { ?>
- <option value="<?php echo $theme['path']; ?>"<?php echo $this->conf->theme () == $theme['path'] ? ' selected="selected"' : ''; ?>>
+ <option value="<?php echo $theme['path']; ?>"<?php echo $this->conf->theme === $theme['path'] ? ' selected="selected"' : ''; ?>>
<?php echo $theme['name'] . ' ' . Minz_Translate::t ('by') . ' ' . $theme['author']; ?>
</option>
<?php } ?>
@@ -38,71 +38,12 @@
</div>
</div>
- <legend><?php echo Minz_Translate::t ('login_configuration'); ?></legend>
-
- <div class="form-group">
- <label class="group-name" for="mail_login"><?php echo Minz_Translate::t ('persona_connection_email'); ?></label>
- <?php $mail = $this->conf->mailLogin (); ?>
- <div class="group-controls">
- <input type="email" id="mail_login" name="mail_login" value="<?php echo $mail ? $mail : ''; ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" />
- <noscript><b><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></b></noscript>
- <label class="checkbox" for="anon_access">
- <input type="checkbox" name="anon_access" id="anon_access" value="yes"<?php echo $this->conf->anonAccess () == 'yes' ? ' checked="checked"' : ''; ?> />
- <?php echo Minz_Translate::t ('allow_anonymous'); ?>
- </label>
- </div>
- </div>
-
- <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 FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('explain_token', Minz_Url::display(null, 'html', true), $token); ?>
- </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 ('archiving_configuration'); ?></legend>
- <p><?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('archiving_configuration_help'); ?></p>
-
- <div class="form-group">
- <label class="group-name" for="old_entries"><?php echo Minz_Translate::t ('delete_articles_every'); ?></label>
- <div class="group-controls">
- <input type="number" id="old_entries" name="old_entries" min="1" max="1200" value="<?php echo $this->conf->oldEntries (); ?>" /> <?php echo Minz_Translate::t ('month'); ?>
-   <a class="btn confirm" href="<?php echo _url('entry', 'purge'); ?>"><?php echo Minz_Translate::t('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'); ?> (<?php echo Minz_Translate::t('by_default'); ?>)</label>
- <div class="group-controls">
- <select class="number" name="keep_history_default" id="keep_history_default"><?php
- foreach (array(-3 => '', 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->keepHistoryDefault() == $v ? '" selected="selected' : '') . '">' . $t . ' </option>';
- }
- ?></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->postsPerPage (); ?>" />
+ <input type="number" id="posts_per_page" name="posts_per_page" value="<?php echo $this->conf->posts_per_page; ?>" />
</div>
</div>
@@ -110,8 +51,8 @@
<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->sortOrder () === 'DESC' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('newer_first'); ?></option>
- <option value="ASC"<?php echo $this->conf->sortOrder () === 'ASC' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('older_first'); ?></option>
+ <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>
</div>
</div>
@@ -120,16 +61,16 @@
<label class="group-name" for="view_mode"><?php echo Minz_Translate::t ('default_view'); ?></label>
<div class="group-controls">
<select name="view_mode" id="view_mode">
- <option value="normal"<?php echo $this->conf->viewMode () == 'normal' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('normal_view'); ?></option>
- <option value="reader"<?php echo $this->conf->viewMode () == 'reader' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('reader_view'); ?></option>
- <option value="global"<?php echo $this->conf->viewMode () == 'global' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t ('global_view'); ?></option>
+ <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>
<label class="radio" for="radio_all">
- <input type="radio" name="default_view" id="radio_all" value="all"<?php echo $this->conf->defaultView () == 'all' ? ' checked="checked"' : ''; ?> />
+ <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->defaultView () == 'not_read' ? ' checked="checked"' : ''; ?> />
+ <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>
@@ -138,9 +79,9 @@
<div class="form-group">
<div class="group-controls">
<label class="checkbox" for="auto_load_more">
- <input type="checkbox" name="auto_load_more" id="auto_load_more" value="yes"<?php echo $this->conf->autoLoadMore () == 'yes' ? ' checked="checked"' : ''; ?> />
+ <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'); ?>
- <?php echo $this->conf->displayPosts () == 'no' ? '<noscript> - <b>' . Minz_Translate::t ('javascript_should_be_activated') . '</b></noscript>' : ''; ?>
+ <noscript> - <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript>
</label>
</div>
</div>
@@ -148,9 +89,9 @@
<div class="form-group">
<div class="group-controls">
<label class="checkbox" for="display_posts">
- <input type="checkbox" name="display_posts" id="display_posts" value="yes"<?php echo $this->conf->displayPosts () == 'yes' ? ' checked="checked"' : ''; ?> />
+ <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'); ?>
- <?php echo $this->conf->displayPosts () == 'no' ? '<noscript> - <b>' . Minz_Translate::t ('javascript_should_be_activated') . '</b></noscript>' : ''; ?>
+ <noscript> - <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript>
</label>
</div>
</div>
@@ -158,9 +99,9 @@
<div class="form-group">
<div class="group-controls">
<label class="checkbox" for="lazyload">
- <input type="checkbox" name="lazyload" id="lazyload" value="yes"<?php echo $this->conf->lazyload () == 'yes' ? ' checked="checked"' : ''; ?> />
+ <input type="checkbox" name="lazyload" id="lazyload" value="1"<?php echo $this->conf->lazyload ? ' checked="checked"' : ''; ?> />
<?php echo Minz_Translate::t ('img_with_lazyload'); ?>
- <?php echo $this->conf->lazyload () == 'yes' ? '<noscript> - <b>' . Minz_Translate::t ('javascript_should_be_activated') . '</b></noscript>' : ''; ?>
+ <noscript> - <strong><?php echo Minz_Translate::t ('javascript_should_be_activated'); ?></strong></noscript>
</label>
</div>
</div>
@@ -169,19 +110,19 @@
<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="yes"<?php echo $this->conf->markWhenArticle () == 'yes' ? ' checked="checked"' : ''; ?> />
+ <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="yes"<?php echo $this->conf->markWhenSite () == 'yes' ? ' checked="checked"' : ''; ?> />
+ <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="yes"<?php echo $this->conf->markWhenScroll () == 'yes' ? ' checked="checked"' : ''; ?> />
+ <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="yes"<?php echo $this->conf->markUponReception () == 'yes' ? ' checked="checked"' : ''; ?> />
+ <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>
@@ -191,7 +132,7 @@
<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="yes"<?php echo $this->conf->onread_jump_next () == 'yes' ? ' checked="checked"' : ''; ?> />
+ <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>
@@ -221,20 +162,20 @@
<tbody>
<tr>
<th><?php echo Minz_Translate::t ('top_line'); ?></th>
- <td><input type="checkbox" name="topline_read" value="yes"<?php echo $this->conf->toplineRead () ? ' checked="checked"' : ''; ?> /></td>
- <td><input type="checkbox" name="topline_favorite" value="yes"<?php echo $this->conf->toplineFavorite () ? ' checked="checked"' : ''; ?> /></td>
+ <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>
<td><input type="checkbox" disabled="disabled" /></td>
<td><input type="checkbox" disabled="disabled" /></td>
- <td><input type="checkbox" name="topline_date" value="yes"<?php echo $this->conf->toplineDate () ? ' checked="checked"' : ''; ?> /></td>
- <td><input type="checkbox" name="topline_link" value="yes"<?php echo $this->conf->toplineLink () ? ' checked="checked"' : ''; ?> /></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>
</tr><tr>
<th><?php echo Minz_Translate::t ('bottom_line'); ?></th>
- <td><input type="checkbox" name="bottomline_read" value="yes"<?php echo $this->conf->bottomlineRead () ? ' checked="checked"' : ''; ?> /></td>
- <td><input type="checkbox" name="bottomline_favorite" value="yes"<?php echo $this->conf->bottomlineFavorite () ? ' checked="checked"' : ''; ?> /></td>
- <td><input type="checkbox" name="bottomline_sharing" value="yes"<?php echo $this->conf->bottomlineSharing () ? ' checked="checked"' : ''; ?> /></td>
- <td><input type="checkbox" name="bottomline_tags" value="yes"<?php echo $this->conf->bottomlineTags () ? ' checked="checked"' : ''; ?> /></td>
- <td><input type="checkbox" name="bottomline_date" value="yes"<?php echo $this->conf->bottomlineDate () ? ' checked="checked"' : ''; ?> /></td>
- <td><input type="checkbox" name="bottomline_link" value="yes"<?php echo $this->conf->bottomlineLink () ? ' checked="checked"' : ''; ?> /></td>
+ <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>
</tr>
</tbody>
</table><br />
@@ -246,17 +187,5 @@
<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"></label>
- <div class="group-controls">
- <p><?php echo $this->nb_total; ?> <?php echo Minz_Translate::t('articles') ?>, <?php echo formatBytes($this->size_total); ?>.</p>
- <p><a class="btn" href="<?php echo _url('entry', 'optimize'); ?>">
- <?php echo Minz_Translate::t('optimize_bdd'); ?>
- </a></p>
- <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('optimize_todo_sometimes'); ?>
- </div>
- </div>
</form>
</div>
diff --git a/app/views/configure/feed.phtml b/app/views/configure/feed.phtml
index e738ab64f..a0fe39f8a 100644
--- a/app/views/configure/feed.phtml
+++ b/app/views/configure/feed.phtml
@@ -87,8 +87,8 @@
<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"><?php
- foreach (array(-3 => '', -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) {
+ <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>
diff --git a/app/views/configure/importExport.phtml b/app/views/configure/importExport.phtml
index 29a0a682b..e2217d9ed 100644
--- a/app/views/configure/importExport.phtml
+++ b/app/views/configure/importExport.phtml
@@ -1,5 +1,8 @@
-<?php if ($this->req == 'export') { ?>
-<?php echo '<?xml version="1.0" encoding="UTF-8" ?>'; // résout bug sur certain serveur ?>
+<?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>
diff --git a/app/views/configure/sharing.phtml b/app/views/configure/sharing.phtml
index 825537fc9..c6a96b48a 100644
--- a/app/views/configure/sharing.phtml
+++ b/app/views/configure/sharing.phtml
@@ -47,7 +47,7 @@
foreach ($services as $service) {
?>
<label class="checkbox" for="<?php echo $service; ?>">
- <input type="checkbox" name="<?php echo $service; ?>" id="<?php echo $service; ?>" value="yes"<?php echo $this->conf->sharing ($service) ? ' checked="checked"' : ''; ?> />
+ <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 } ?>
diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtml
index e78d91820..b0867f711 100644
--- a/app/views/configure/shortcut.phtml
+++ b/app/views/configure/shortcut.phtml
@@ -9,7 +9,7 @@
<?php } ?>
</datalist>
- <?php $s = $this->conf->shortcuts (); ?>
+ <?php $s = $this->conf->shortcuts; ?>
<form method="post" action="<?php echo _url ('configure', 'shortcut'); ?>">
<legend><?php echo Minz_Translate::t ('shortcuts_management'); ?></legend>
@@ -68,6 +68,13 @@
</div>
</div>
+ <div class="form-group">
+ <label class="group-name" for="auto_share_shortcut"><?php echo Minz_Translate::t ('auto_share'); ?></label>
+ <div class="group-controls">
+ <input type="text" id="auto_share_shortcut" name="shortcuts[auto_share]" list="keys" value="<?php echo $s['auto_share']; ?>" />
+ </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>
diff --git a/app/views/configure/users.phtml b/app/views/configure/users.phtml
new file mode 100644
index 000000000..d40a3ad5b
--- /dev/null
+++ b/app/views/configure/users.phtml
@@ -0,0 +1,154 @@
+<?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="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" 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>
+
+ <?php if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) { ?>
+ <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 } ?>
+
+ <?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">
+ <option value=""></option>
+ <option value="none"<?php echo Minz_Configuration::authType() === 'none' ? ' selected="selected"' : ''; ?>><?php echo Minz_Translate::t('auth_none'); ?></option>
+ <option value="http_auth"<?php echo Minz_Configuration::authType() === 'http_auth' ? ' selected="selected"' : '', httpAuthUser() == '' ? ' disabled="disabled"' : ''; ?>>HTTP Auth</option>
+ <option value="persona"<?php echo Minz_Configuration::authType() === 'persona' ? ' selected="selected"' : '', $this->conf->mail_login == '' ? ' disabled="disabled"' : ''; ?>>Mozilla Persona</option>
+ </select>
+ <code>$_SERVER['REMOTE_USER'] = `<?php echo httpAuthUser(); ?>`</code>
+ </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::authType() === 'persona') { ?>
+
+ <legend>Mozilla Persona</legend>
+ <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"' : ''; ?> />
+ <?php echo Minz_Translate::t('allow_anonymous', Minz_Configuration::defaultUser()); ?>
+ </label>
+ </div>
+ </div>
+
+ <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 FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t('explain_token', Minz_Url::display(null, 'html', true), $token); ?>
+ </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 } ?>
+ </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" pattern="[0-9a-zA-Z]{1,16}" placeholder="demo" />
+ </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" 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/feed/actualize.phtml b/app/views/feed/actualize.phtml
index a0aba9318..d86bac9de 100644
--- a/app/views/feed/actualize.phtml
+++ b/app/views/feed/actualize.phtml
@@ -1 +1 @@
-OK \ No newline at end of file
+OK
diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml
index d008e2e48..92c068f7e 100644
--- a/app/views/helpers/javascript_vars.phtml
+++ b/app/views/helpers/javascript_vars.phtml
@@ -1,16 +1,16 @@
<?php
echo '"use strict";', "\n";
- $mark = $this->conf->markWhen ();
+ $mark = $this->conf->mark_when;
echo 'var ',
- 'hide_posts=', ($this->conf->displayPosts () === 'yes' || Minz_Request::param ('output') === 'reader') ? 'false' : 'true',
- ',auto_mark_article=', $mark['article'] === 'yes' ? 'true' : 'false',
- ',auto_mark_site=', $mark['site'] === 'yes' ? 'true' : 'false',
- ',auto_mark_scroll=', $mark['scroll'] === 'yes' ? 'true' : 'false',
- ',auto_load_more=', $this->conf->autoLoadMore () === 'yes' ? 'true' : 'false',
- ',full_lazyload=', $this->conf->lazyload () === 'yes' && ($this->conf->displayPosts () === 'yes' || Minz_Request::param ('output') === 'reader') ? 'true' : 'false',
- ',does_lazyload=', $this->conf->lazyload() === 'yes' ? 'true' : 'false';
+ '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 ();
+ $s = $this->conf->shortcuts;
echo ',shortcuts={',
'mark_read:"', $s['mark_read'], '",',
'mark_favorite:"', $s['mark_favorite'], '",',
@@ -18,7 +18,8 @@
'prev_entry:"', $s['prev_entry'], '",',
'next_entry:"', $s['next_entry'], '",',
'collapse_entry:"', $s['collapse_entry'], '",',
- 'load_more:"', $s['load_more'], '"',
+ 'load_more:"', $s['load_more'], '",',
+ 'auto_share:"', $s['auto_share'], '"',
"},\n";
if (Minz_Request::param ('output') === 'global') {
@@ -29,7 +30,7 @@
if ($mail != 'null') {
$mail = '"' . $mail . '"';
}
- echo 'use_persona=', login_is_conf ($this->conf) ? 'true' : 'false',
+ echo 'use_persona=', Minz_Configuration::authType() === 'persona' ? 'true' : 'false',
',url_freshrss="', _url ('index', 'index'), '",',
'url_login="', _url ('index', 'login'), '",',
'url_logout="', _url ('index', 'logout'), '",',
diff --git a/app/views/helpers/view/global_view.phtml b/app/views/helpers/view/global_view.phtml
index bc6e24e37..58ff13d4e 100644
--- a/app/views/helpers/view/global_view.phtml
+++ b/app/views/helpers/view/global_view.phtml
@@ -31,6 +31,6 @@
</div>
<div id="overlay"></div>
-<div id="panel"<?php echo $this->conf->displayPosts () === 'no' ? ' class="hide_posts"' : ''; ?>>
+<div id="panel"<?php echo $this->conf->display_posts ? '' : ' class="hide_posts"'; ?>>
<a class="close" href="#"><?php echo FreshRSS_Themes::icon('close'); ?></a>
-</div> \ No newline at end of file
+</div>
diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml
index 4307c2113..5e46f3c8e 100644
--- a/app/views/helpers/view/normal_view.phtml
+++ b/app/views/helpers/view/normal_view.phtml
@@ -7,39 +7,54 @@ if (!empty($this->entries)) {
$display_today = true;
$display_yesterday = true;
$display_others = true;
-
- $logged = !login_is_conf ($this->conf) || is_logged ();
- $shaarli = $this->conf->sharing ('shaarli');
- $poche = $this->conf->sharing ('poche');
- $diaspora = $this->conf->sharing ('diaspora');
+ if ($this->loginOk) {
+ $shaarli = $this->conf->sharing ('shaarli');
+ $poche = $this->conf->sharing ('poche');
+ $diaspora = $this->conf->sharing ('diaspora');
+ } else {
+ $shaarli = '';
+ $poche = '';
+ $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');
- $today = $this->today;
- $hidePosts = $this->conf->displayPosts() === 'no';
- $lazyload = $this->conf->lazyload() === 'yes';
+ $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 || $poche || $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 foreach ($this->entries as $item) { ?>
- <?php if ($display_today && $item->isDay (FreshRSS_Days::TODAY, $today)) { ?>
+ <?php 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>
<span class="name"><?php echo $this->currentName; ?></span>
</div>
<?php $display_today = false; } ?>
- <?php if ($display_yesterday && $item->isDay (FreshRSS_Days::YESTERDAY, $today)) { ?>
+ <?php 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>
<span class="name"><?php echo $this->currentName; ?></span>
</div>
<?php $display_yesterday = false; } ?>
- <?php if ($display_others && $item->isDay (FreshRSS_Days::BEFORE_YESTERDAY, $today)) { ?>
+ <?php 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>
@@ -48,14 +63,14 @@ if (!empty($this->entries)) {
<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 ($logged) {
- if ($this->conf->toplineRead ()) {
+ if ($this->loginOk) {
+ if ($topline_read) {
?><li class="item manage"><?php
?><a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', $item->isRead () ? 0 : 1); ?>"><?php
echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php
?></li><?php
}
- if ($this->conf->toplineFavorite ()) {
+ if ($topline_favorite) {
?><li class="item manage"><?php
?><a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', $item->isFavorite () ? 0 : 1); ?>"><?php
echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php
@@ -67,8 +82,8 @@ if (!empty($this->entries)) {
?>
<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 ($this->conf->toplineDate ()) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?>
- <?php if ($this->conf->toplineLink ()) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?>
+ <?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">
@@ -85,14 +100,14 @@ if (!empty($this->entries)) {
?>
</div>
<ul class="horizontal-list bottom"><?php
- if ($logged) {
- if ($this->conf->bottomlineRead ()) {
+ if ($this->loginOk) {
+ if ($bottomline_read) {
?><li class="item manage"><?php
?><a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', $item->isRead () ? 0 : 1); ?>"><?php
echo FreshRSS_Themes::icon($item->isRead () ? 'read' : 'unread'); ?></a><?php
?></li><?php
}
- if ($this->conf->bottomlineFavorite ()) {
+ if ($bottomline_favorite) {
?><li class="item manage"><?php
?><a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', $item->isFavorite () ? 0 : 1); ?>"><?php
echo FreshRSS_Themes::icon($item->isFavorite () ? 'starred' : 'non-starred'); ?></a><?php
@@ -101,10 +116,7 @@ if (!empty($this->entries)) {
} ?>
<li class="item">
<?php
- if ($this->conf->bottomlineSharing () && (
- $shaarli || $poche || $diaspora || $twitter ||
- $google_plus || $facebook || $email
- )) {
+ if ($bottomline_sharing) {
$link = urlencode ($item->link ());
$title = urlencode ($item->title () . ' - ' . $feed->name ());
?>
@@ -117,19 +129,19 @@ if (!empty($this->entries)) {
<ul class="dropdown-menu">
<li class="dropdown-close"><a href="#close">❌</a></li>
- <?php if ($logged && $shaarli) { ?>
+ <?php if ($shaarli) { ?>
<li class="item">
<a target="_blank" href="<?php echo $shaarli . '?post=' . $link . '&amp;title=' . $title . '&amp;source=FreshRSS'; ?>">
<?php echo Minz_Translate::t ('shaarli'); ?>
</a>
</li>
- <?php } if ($logged && $poche) { ?>
+ <?php } if ($poche) { ?>
<li class="item">
<a target="_blank" href="<?php echo $poche . '?action=add&amp;url=' . base64_encode (urldecode($link)); ?>">
<?php echo Minz_Translate::t ('poche'); ?>
</a>
</li>
- <?php } if ($logged && $diaspora) { ?>
+ <?php } if ($diaspora) { ?>
<li class="item">
<a target="_blank" href="<?php echo $diaspora . '/bookmarklet?url=' . $link . '&amp;title=' . $title; ?>">
<?php echo Minz_Translate::t ('diaspora'); ?>
@@ -171,7 +183,7 @@ if (!empty($this->entries)) {
<?php } ?>
</li>
<?php
- $tags = $this->conf->bottomlineTags () ? $item->tags() : null;
+ $tags = $bottomline_tags ? $item->tags() : null;
if (!empty($tags)) {
?>
<li class="item">
@@ -190,8 +202,8 @@ if (!empty($this->entries)) {
</div>
</li>
<?php } ?>
- <?php if ($this->conf->bottomlineDate ()) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?>
- <?php if ($this->conf->bottomlineLink ()) { ?><li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a></li><?php } ?>
+ <?php if ($bottomline_date) { ?><li class="item date"><?php echo $item->date (); ?> </li><?php } ?>
+ <?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>
diff --git a/app/views/helpers/view/reader_view.phtml b/app/views/helpers/view/reader_view.phtml
index 47254f74e..2f64e672a 100644
--- a/app/views/helpers/view/reader_view.phtml
+++ b/app/views/helpers/view/reader_view.phtml
@@ -2,7 +2,7 @@
$this->partial ('nav_menu');
if (!empty($this->entries)) {
- $lazyload = $this->conf->lazyload() === 'yes';
+ $lazyload = $this->conf->lazyload;
?>
<div id="stream" class="reader">
diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml
index cf98060c4..549d0b61e 100644
--- a/app/views/index/index.phtml
+++ b/app/views/index/index.phtml
@@ -1,29 +1,38 @@
<?php
+function showForbidden() {
+?><div class="post content">
+ <h1><?php echo Minz_Translate::t ('forbidden_access'); ?></h1>
+ <p><?php echo Minz_Configuration::canLogIn() ?
+ Minz_Translate::t ('forbidden_access_description') :
+ Minz_Translate::t ('forbidden_access') . ' (' . Minz_Configuration::authType() . ')'; ?></p>
+ <p><a href="<?php echo _url ('index', 'about'); ?>"><?php echo Minz_Translate::t ('about_freshrss'); ?></a></p>
+</div><?php
+}
+
$output = Minz_Request::param ('output', 'normal');
-$token = $this->conf->token();
-$token_param = Minz_Request::param ('token', '');
-$token_is_ok = ($token != '' && $token == $token_param);
-if(!login_is_conf ($this->conf) ||
- is_logged() ||
- $this->conf->anonAccess() == 'yes' ||
- ($output == 'rss' && $token_is_ok)) {
- if($output == 'rss') {
+if ($this->loginOk || Minz_Configuration::allowAnonymous()) {
+ if ($output === 'normal') {
+ $this->renderHelper ('view/normal_view');
+ } elseif ($output === 'rss') {
$this->renderHelper ('view/rss_view');
- } elseif($output == 'reader') {
+ } elseif ($output === 'reader') {
$this->renderHelper ('view/reader_view');
- } elseif($output == 'global') {
+ } elseif ($output === 'global') {
$this->renderHelper ('view/global_view');
} else {
$this->renderHelper ('view/normal_view');
}
+} elseif ($output === 'rss') {
+ $token = $this->conf->token;
+ $token_param = Minz_Request::param ('token', '');
+ $token_is_ok = ($token != '' && $token == $token_param);
+ if ($token_is_ok) {
+ $this->renderHelper ('view/rss_view');
+ } else {
+ showForbidden();
+ }
} else {
-?>
-<div class="post content">
- <h1><?php echo Minz_Translate::t ('forbidden_access'); ?></h1>
- <p><?php echo Minz_Translate::t ('forbidden_access_description'); ?></p>
- <p><a href="<?php echo _url ('index', 'about'); ?>"><?php echo Minz_Translate::t ('about_freshrss'); ?></a></p>
-</div>
-<?php
-} \ No newline at end of file
+ showForbidden();
+}
diff --git a/app/views/javascript/actualize.phtml b/app/views/javascript/actualize.phtml
index 69689133c..1f6072c29 100644
--- a/app/views/javascript/actualize.phtml
+++ b/app/views/javascript/actualize.phtml
@@ -1,37 +1,41 @@
-var feeds = new Array ();
+"use strict";
+var feeds = [];
<?php foreach ($this->feeds as $feed) { ?>
-feeds.push ("<?php echo Minz_Url::display (array ('c' => 'feed', 'a' => 'actualize', 'params' => array ('id' => $feed->id (), 'ajax' => '1')), 'php'); ?>");
+feeds.push("<?php echo Minz_Url::display (array ('c' => 'feed', 'a' => 'actualize', 'params' => array ('id' => $feed->id (), 'ajax' => '1')), 'php'); ?>");
<?php } ?>
-function initProgressBar (init) {
+function initProgressBar(init) {
if (init) {
- $("body").after ("\<div id=\"actualizeProgress\" class=\"actualizeProgress\">\
+ $("body").after("\<div id=\"actualizeProgress\" class=\"actualizeProgress\">\
<?php echo Minz_Translate::t ('refresh'); ?> <span class=\"progress\">0 / " + feeds.length + "</span><br />\
<progress id=\"actualizeProgressBar\" value=\"0\" max=\"" + feeds.length + "\"></progress>\
</div>");
} else {
- window.location.reload ();
+ window.location.reload();
}
}
-function updateProgressBar (i) {
+function updateProgressBar(i) {
$("#actualizeProgressBar").val(i);
- $("#actualizeProgress .progress").html (i + " / " + feeds.length);
+ $("#actualizeProgress .progress").html(i + " / " + feeds.length);
}
-function updateFeeds () {
- initProgressBar (true);
+function updateFeeds() {
+ if (feeds.length === 0) {
+ return;
+ }
+ initProgressBar(true);
var i = 0;
for (var f in feeds) {
- $.ajax ({
+ $.ajax({
type: 'POST',
url: feeds[f],
- }).done (function (data) {
+ }).done(function (data) {
i++;
- updateProgressBar (i);
+ updateProgressBar(i);
- if (i == feeds.length) {
- initProgressBar (false);
+ if (i === feeds.length) {
+ initProgressBar(false);
}
});
}